tabby/clients/tabby-agent/dist/cli.js

177 lines
415 KiB
JavaScript
Raw Normal View History

#!/bin/env node
'use strict';
var child_process = require('child_process');
var Pt = require('zlib');
var Un = require('stream');
var fs = require('fs');
var promises = require('fs/promises');
var path = require('path');
var nR = require('util');
var iR = require('events');
var Ub = require('crypto');
var YA = require('url');
var eR = require('http');
var tR = require('https');
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
var Pt__default = /*#__PURE__*/_interopDefault(Pt);
var Un__default = /*#__PURE__*/_interopDefault(Un);
var nR__default = /*#__PURE__*/_interopDefault(nR);
var iR__default = /*#__PURE__*/_interopDefault(iR);
var Ub__default = /*#__PURE__*/_interopDefault(Ub);
var YA__default = /*#__PURE__*/_interopDefault(YA);
var eR__default = /*#__PURE__*/_interopDefault(eR);
var tR__default = /*#__PURE__*/_interopDefault(tR);
var Fb=Object.create;var fi=Object.defineProperty;var Pb=Object.getOwnPropertyDescriptor;var qb=Object.getOwnPropertyNames;var jb=Object.getPrototypeOf,Bb=Object.prototype.hasOwnProperty;var Ib=(t,e,n)=>e in t?fi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var _=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>(typeof require<"u"?require:e)[n]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')});var Lb=(t,e)=>()=>(t&&(e=t(t=0)),e);var g=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Db=(t,e)=>{for(var n in e)fi(t,n,{get:e[n],enumerable:!0});},qu=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of qb(e))!Bb.call(t,r)&&r!==n&&fi(t,r,{get:()=>e[r],enumerable:!(i=Pb(e,r))||i.enumerable});return t};var tt=(t,e,n)=>(n=t!=null?Fb(jb(t)):{},qu(e||!t||!t.__esModule?fi(n,"default",{value:t,enumerable:!0}):n,t)),Nb=t=>qu(fi({},"__esModule",{value:!0}),t);var U=(t,e,n)=>(Ib(t,typeof e!="symbol"?e+"":e,n),n),oa=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)};var m=(t,e,n)=>(oa(t,e,"read from private field"),n?n.call(t):e.get(t)),N=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n);},F=(t,e,n,i)=>(oa(t,e,"write to private field"),i?i.call(t,n):e.set(t,n),n),lr=(t,e,n,i)=>({set _(r){F(t,e,r,n);},get _(){return m(t,e,i)}}),j=(t,e,n)=>(oa(t,e,"access private method"),n);var ua=g((xq,Iu)=>{var Bu=Object.prototype.toString;Iu.exports=function(e){var n=Bu.call(e),i=n==="[object Arguments]";return i||(i=n!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&Bu.call(e.callee)==="[object Function]"),i};});var Hu=g((gq,Wu)=>{var Mu;Object.keys||(di=Object.prototype.hasOwnProperty,la=Object.prototype.toString,Lu=ua(),pa=Object.prototype.propertyIsEnumerable,Du=!pa.call({toString:null},"toString"),Nu=pa.call(function(){},"prototype"),mi=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],dr=function(t){var e=t.constructor;return e&&e.prototype===t},Uu={$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},zu=function(){if(typeof window>"u")return !1;for(var t in window)try{if(!Uu["$"+t]&&di.call(window,t)&&window[t]!==null&&typeof window[t]=="object")try{dr(window[t]);}catch{return !0}}catch{return !0}return !1}(),$u=function(t){if(typeof window>"u"||!zu)return dr(t);try{return dr(t)}catch{return !1}},Mu=function(e){var n=e!==null&&typeof e=="object",i=la.call(e)==="[object Function]",r=Lu(e),o=n&&la.call(e)==="[object String]",a=[];if(!n&&!i&&!r)throw new TypeError("Object.keys called on a non-object");var s=Nu&&i;if(o&&e.length>0&&!di.call(e,0))for(var c=0;c<e.length;++c)a.push(String(c));if(r&&e.length>0)for(var l=0;l<e.length;++l)a.push(String(l));else for(var u in e)!(s&&u==="prototype")&&di.call(e,u)&&a.push(String(u));if(Du)for(var p=$u(e),h=0;h<mi.length;++h)!(p&&mi[h]==="constructor")&&di.call(e,mi[h])&&a.push(mi[h]);return a});var di,la,Lu,pa,Du,Nu,mi,dr,Uu,zu,$u;Wu.exports=Mu;});var hr=g((vq,Ju)=>{var Mb=Array.prototype.slice,Wb=ua(),Gu=Object.keys,mr=Gu?function(e){return Gu(e)}:Hu(),Vu=Object.keys;mr.shim=function(){if(Object.keys){var e=function(){var n=Object.keys(arguments);return n&&n.length===arguments.length}(1,2);e||(Object.keys=function(i){return Wb(i)?Vu(Mb.call(i)):Vu(i)});}else Object.keys=mr;return Object.keys||mr};Ju.exports=mr;});var yr=g((bq,Ku)=>{Ku.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return !1;if(typeof Symbol.iterator=="symbol")return !0;var e={},n=Symbol("test"),i=Object(n);if(typeof n=="string"||Object.prototype.toString.c
`)>=0)return !1;return !0}function b0(t,e){var n;if(t.indent===" ")n=" ";else if(typeof t.indent=="number"&&t.indent>0)n=nt.call(Array(t.indent+1)," ");else return null;return {base:n,prev:nt.call(Array(e+1),n)}}function qa(t,e){if(t.length===0)return "";var n=`
`+e.prev+e.base;return n+nt.call(t,","+n)+`
`+e.prev}function wr(t,e){var n=Pa(t),i=[];if(n){i.length=t.length;for(var r=0;r<t.length;r++)i[r]=Rt(t,r)?e(t[r],t):"";}var o=typeof Ta=="function"?Ta(t):[],a;if(Rn){a={};for(var s=0;s<o.length;s++)a["$"+o[s]]=o[s];}for(var c in t)Rt(t,c)&&(n&&String(Number(c))===c&&c<t.length||Rn&&a["$"+c]instanceof Symbol||(lp.call(/[^\w$]/,c)?i.push(e(c,t)+": "+e(t[c],t)):i.push(c+": "+e(t[c],t))));if(typeof Ta=="function")for(var l=0;l<o.length;l++)pp.call(t,o[l])&&i.push("["+e(o[l])+"]: "+e(t[o[l]],t));return i}});var vp=g((Mq,gp)=>{var La=xt(),Tn=_e(),w0=xp(),S0=La("%TypeError%"),Ar=La("%WeakMap%",!0),Or=La("%Map%",!0),E0=Tn("WeakMap.prototype.get",!0),A0=Tn("WeakMap.prototype.set",!0),O0=Tn("WeakMap.prototype.has",!0),R0=Tn("Map.prototype.get",!0),T0=Tn("Map.prototype.set",!0),k0=Tn("Map.prototype.has",!0),Da=function(t,e){for(var n=t,i;(i=n.next)!==null;n=i)if(i.key===e)return n.next=i.next,i.next=t.next,t.next=i,i},C0=function(t,e){var n=Da(t,e);return n&&n.value},_0=function(t,e,n){var i=Da(t,e);i?i.value=n:t.next={key:e,next:t.next,value:n};},F0=function(t,e){return !!Da(t,e)};gp.exports=function(){var e,n,i,r={assert:function(o){if(!r.has(o))throw new S0("Side channel does not contain "+w0(o))},get:function(o){if(Ar&&o&&(typeof o=="object"||typeof o=="function")){if(e)return E0(e,o)}else if(Or){if(n)return R0(n,o)}else if(i)return C0(i,o)},has:function(o){if(Ar&&o&&(typeof o=="object"||typeof o=="function")){if(e)return O0(e,o)}else if(Or){if(n)return k0(n,o)}else if(i)return F0(i,o);return !1},set:function(o,a){Ar&&o&&(typeof o=="object"||typeof o=="function")?(e||(e=new Ar),A0(e,o,a)):Or?(n||(n=new Or),T0(n,o,a)):(i||(i={key:{},next:null}),_0(i,o,a));}};return r};});var Na=g((Wq,wp)=>{var bp=function(t){return t!==t};wp.exports=function(e,n){return e===0&&n===0?1/e===1/n:!!(e===n||bp(e)&&bp(n))};});var Ua=g((Hq,Sp)=>{var P0=Na();Sp.exports=function(){return typeof Object.is=="function"?Object.is:P0};});var Ap=g((Gq,Ep)=>{var q0=Ua(),j0=Ot();Ep.exports=function(){var e=q0();return j0(Object,{is:e},{is:function(){return Object.is!==e}}),e};});var kp=g((Vq,Tp)=>{var B0=Ot(),I0=On(),L0=Na(),Op=Ua(),D0=Ap(),Rp=I0(Op(),Object);B0(Rp,{getPolyfill:Op,implementation:L0,shim:D0});Tp.exports=Rp;});var gt=g((Jq,Cp)=>{var N0=yr();Cp.exports=function(){return N0()&&!!Symbol.toStringTag};});var Pp=g((Kq,Fp)=>{var U0=gt()(),z0=_e(),za=z0("Object.prototype.toString"),Rr=function(e){return U0&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:za(e)==="[object Arguments]"},_p=function(e){return Rr(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&za(e)!=="[object Array]"&&za(e.callee)==="[object Function]"},$0=function(){return Rr(arguments)}();Rr.isLegacyArguments=_p;Fp.exports=$0?Rr:_p;});var jp=g((Yq,qp)=>{var M0={}.toString;qp.exports=Array.isArray||function(t){return M0.call(t)=="[object Array]"};});var Dp=g((Xq,Lp)=>{var Ip=Function.prototype.toString,kn=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,Ma,Tr;if(typeof kn=="function"&&typeof Object.defineProperty=="function")try{Ma=Object.defineProperty({},"length",{get:function(){throw Tr}}),Tr={},kn(function(){throw 42},null,Ma);}catch(t){t!==Tr&&(kn=null);}else kn=null;var W0=/^\s*class\b/,Wa=function(e){try{var n=Ip.call(e);return W0.test(n)}catch{return !1}},$a=function(e){try{return Wa(e)?!1:(Ip.call(e),!0)}catch{return !1}},kr=Object.prototype.toString,H0="[object Object]",G0="[object Function]",V0="[object GeneratorFunction]",J0="[object HTMLAllCollection]",K0="[object HTML document.all class]",Y0="[object HTMLCollection]",X0=typeof Symbol=="function"&&!!Symbol.toStringTag,Q0=!(0 in[,]),Ha=function(){return !1};typeof document=="object"&&(Bp=document.all,kr.call(Bp)===kr.call(document.all)&&(Ha=function(e){if((Q0||!e)&&(typeof e>"u"||typeof e=="object"))try{var n=kr.call(e);return (n===J0||n===K0||n===Y0||n===H0)&&e("")==null}catch{}return !1}));var Bp;Lp.exports=kn?function(e){if(Ha(e))return !0;if(!e||typeof e!="function"&&typeof e!="object")return !1;try{kn(e,null,Ma);}catch(n){if(n!==Tr)return !1}return !Wa(e)&&$a(e)}:function(e){if(Ha(e))re
`;J.DEFAULT_CONTENT_TYPE="application/octet-stream";J.prototype.append=function(t,e,n){n=n||{},typeof n=="string"&&(n={filename:n});var i=ks.prototype.append.bind(this);if(typeof e=="number"&&(e=""+e),gm.isArray(e)){this._error(new Error("Arrays are not supported."));return}var r=this._multiPartHeader(t,e,n),o=this._multiPartFooter();i(r),i(e),i(o),this._trackLength(r,e,n);};J.prototype._trackLength=function(t,e,n){var i=0;n.knownLength!=null?i+=+n.knownLength:Buffer.isBuffer(e)?i=e.length:typeof e=="string"&&(i=Buffer.byteLength(e)),this._valueLength+=i,this._overheadLength+=Buffer.byteLength(t)+J.LINE_BREAK.length,!(!e||!e.path&&!(e.readable&&e.hasOwnProperty("httpVersion"))&&!(e instanceof WA))&&(n.knownLength||this._valuesToMeasure.push(e));};J.prototype._lengthRetriever=function(t,e){t.hasOwnProperty("fd")?t.end!=null&&t.end!=1/0&&t.start!=null?e(null,t.end+1-(t.start?t.start:0)):MA.stat(t.path,function(n,i){var r;if(n){e(n);return}r=i.size-(t.start?t.start:0),e(null,r);}):t.hasOwnProperty("httpVersion")?e(null,+t.headers["content-length"]):t.hasOwnProperty("httpModule")?(t.on("response",function(n){t.pause(),e(null,+n.headers["content-length"]);}),t.resume()):e("Unknown stream");};J.prototype._multiPartHeader=function(t,e,n){if(typeof n.header=="string")return n.header;var i=this._getContentDisposition(e,n),r=this._getContentType(e,n),o="",a={"Content-Disposition":["form-data",'name="'+t+'"'].concat(i||[]),"Content-Type":[].concat(r||[])};typeof n.header=="object"&&Ts(a,n.header);var s;for(var c in a)a.hasOwnProperty(c)&&(s=a[c],s!=null&&(Array.isArray(s)||(s=[s]),s.length&&(o+=c+": "+s.join("; ")+J.LINE_BREAK)));return "--"+this.getBoundary()+J.LINE_BREAK+o+J.LINE_BREAK};J.prototype._getContentDisposition=function(t,e){var n,i;return typeof e.filepath=="string"?n=Os.normalize(e.filepath).replace(/\\/g,"/"):e.filename||t.name||t.path?n=Os.basename(e.filename||t.name||t.path):t.readable&&t.hasOwnProperty("httpVersion")&&(n=Os.basename(t.client._httpMessage.path||"")),n&&(i='filename="'+n+'"'),i};J.prototype._getContentType=function(t,e){var n=e.contentType;return !n&&t.name&&(n=Rs.lookup(t.name)),!n&&t.path&&(n=Rs.lookup(t.path)),!n&&t.readable&&t.hasOwnProperty("httpVersion")&&(n=t.headers["content-type"]),!n&&(e.filepath||e.filename)&&(n=Rs.lookup(e.filepath||e.filename)),!n&&typeof t=="object"&&(n=J.DEFAULT_CONTENT_TYPE),n};J.prototype._multiPartFooter=function(){return function(t){var e=J.LINE_BREAK,n=this._streams.length===0;n&&(e+=this._lastBoundary()),t(e);}.bind(this)};J.prototype._lastBoundary=function(){return "--"+this.getBoundary()+"--"+J.LINE_BREAK};J.prototype.getHeaders=function(t){var e,n={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(e in t)t.hasOwnProperty(e)&&(n[e.toLowerCase()]=t[e]);return n};J.prototype.setBoundary=function(t){this._boundary=t;};J.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};J.prototype.getBuffer=function(){for(var t=new Buffer.alloc(0),e=this.getBoundary(),n=0,i=this._streams.length;n<i;n++)typeof this._streams[n]!="function"&&(Buffer.isBuffer(this._streams[n])?t=Buffer.concat([t,this._streams[n]]):t=Buffer.concat([t,Buffer.from(this._streams[n])]),(typeof this._streams[n]!="string"||this._streams[n].substring(2,e.length+2)!==e)&&(t=Buffer.concat([t,Buffer.from(J.LINE_BREAK)])));return Buffer.concat([t,Buffer.from(this._lastBoundary())])};J.prototype._generateBoundary=function(){for(var t="--------------------------",e=0;e<24;e++)t+=Math.floor(Math.random()*10).toString(16);this._boundary=t;};J.prototype.getLengthSync=function(){var t=this._overheadLength+this._valueLength;return this._streams.length&&(t+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),t};J.prototype.hasKnownLength=function(){var t=!0;return this._valuesToMeasure.length&&(t=!1),t};J.prototype.getLength=function(t){var e=this._overheadLength+this._valueLength;if(this._streams.length&&(e+=this._lastBoundary().length),!this._valuesToMeasure.length){process
2023-05-29 02:09:44 +00:00
`).join(`
`+o),t.push(r+"m+"+no.exports.humanize(this.diff)+"\x1B[0m");}else t[0]=TO()+e+" "+t[0];}function TO(){return pe.inspectOpts.hideDate?"":new Date().toISOString()+" "}function kO(...t){return process.stderr.write(to.format(...t)+`
`)}function CO(t){t?process.env.DEBUG=t:delete process.env.DEBUG;}function _O(){return process.env.DEBUG}function FO(t){t.inspectOpts={};let e=Object.keys(pe.inspectOpts);for(let n=0;n<e.length;n++)t.inspectOpts[e[n]]=pe.inspectOpts[e[n]];}no.exports=Ls()(pe);var{formatters:Lm}=no.exports;Lm.o=function(t){return this.inspectOpts.colors=this.useColors,to.inspect(t,this.inspectOpts).split(`
`).map(e=>e.trim()).join(" ")};Lm.O=function(t){return this.inspectOpts.colors=this.useColors,to.inspect(t,this.inspectOpts)};});var Nm=g((JB,Ds)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Ds.exports=Im():Ds.exports=Dm();});var zm=g((KB,Um)=>{var Ci;Um.exports=function(){if(!Ci){try{Ci=Nm()("follow-redirects");}catch{}typeof Ci!="function"&&(Ci=function(){});}Ci.apply(null,arguments);};});var Km=g((YB,Ms)=>{var en=_("url"),Ns=en.URL,PO=_("http"),qO=_("https"),Wm=_("stream").Writable,Hm=_("assert"),Gm=zm(),zs=["abort","aborted","connect","error","socket","timeout"],$s=Object.create(null);zs.forEach(function(t){$s[t]=function(e,n,i){this._redirectable.emit(t,e,n,i);};});var jO=Fi("ERR_INVALID_URL","Invalid URL",TypeError),$m=Fi("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),BO=Fi("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded"),IO=Fi("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),LO=Fi("ERR_STREAM_WRITE_AFTER_END","write after end");function Pe(t,e){Wm.call(this),this._sanitizeOptions(t),this._options=t,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],e&&this.on("response",e);var n=this;this._onNativeResponse=function(i){n._processResponse(i);},this._performRequest();}Pe.prototype=Object.create(Wm.prototype);Pe.prototype.abort=function(){Jm(this._currentRequest),this.emit("abort");};Pe.prototype.write=function(t,e,n){if(this._ending)throw new LO;if(!tn(t)&&!UO(t))throw new TypeError("data should be a string, Buffer or Uint8Array");if(_i(e)&&(n=e,e=null),t.length===0){n&&n();return}this._requestBodyLength+t.length<=this._options.maxBodyLength?(this._requestBodyLength+=t.length,this._requestBodyBuffers.push({data:t,encoding:e}),this._currentRequest.write(t,e,n)):(this.emit("error",new IO),this.abort());};Pe.prototype.end=function(t,e,n){if(_i(t)?(n=t,t=e=null):_i(e)&&(n=e,e=null),!t)this._ended=this._ending=!0,this._currentRequest.end(null,null,n);else {var i=this,r=this._currentRequest;this.write(t,e,function(){i._ended=!0,r.end(null,null,n);}),this._ending=!0;}};Pe.prototype.setHeader=function(t,e){this._options.headers[t]=e,this._currentRequest.setHeader(t,e);};Pe.prototype.removeHeader=function(t){delete this._options.headers[t],this._currentRequest.removeHeader(t);};Pe.prototype.setTimeout=function(t,e){var n=this;function i(a){a.setTimeout(t),a.removeListener("timeout",a.destroy),a.addListener("timeout",a.destroy);}function r(a){n._timeout&&clearTimeout(n._timeout),n._timeout=setTimeout(function(){n.emit("timeout"),o();},t),i(a);}function o(){n._timeout&&(clearTimeout(n._timeout),n._timeout=null),n.removeListener("abort",o),n.removeListener("error",o),n.removeListener("response",o),e&&n.removeListener("timeout",e),n.socket||n._currentRequest.removeListener("socket",r);}return e&&this.on("timeout",e),this.socket?r(this.socket):this._currentRequest.once("socket",r),this.on("socket",i),this.on("abort",o),this.on("error",o),this.on("response",o),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(t){Pe.prototype[t]=function(e,n){return this._currentRequest[t](e,n)};});["aborted","connection","socket"].forEach(function(t){Object.defineProperty(Pe.prototype,t,{get:function(){return this._currentRequest[t]}});});Pe.prototype._sanitizeOptions=function(t){if(t.headers||(t.headers={}),t.host&&(t.hostname||(t.hostname=t.host),delete t.host),!t.pathname&&t.path){var e=t.path.indexOf("?");e<0?t.pathname=t.path:(t.pathname=t.path.substring(0,e),t.search=t.path.substring(e));}};Pe.prototype._performRequest=function(){var t=this._options.protocol,e=this._options.nativeProtocols[t];if(!e){this.emit("error",new TypeError("Unsupported protocol "+t));return}if(this._options.agents){var n=t.slice(0,-1);this._options.agent=this._options.agents[n];}var i=this._currentRequest=e.request(this._options,this._onNativeResponse);i._redirectable=this;for(var r of zs)i.on(r,$s[r]);if(this._currentUrl=/^\//.test(this._options.path)?en.
GFS4: `),console.error(t);});Z[fe]||(Th=global[fe]||[],Ch(Z,Th),Z.close=function(t){function e(n,i){return t.call(Z,n,function(r){r||kh(),typeof i=="function"&&i.apply(this,arguments);})}return Object.defineProperty(e,go,{value:t}),e}(Z.close),Z.closeSync=function(t){function e(n){t.apply(Z,arguments),kh();}return Object.defineProperty(e,go,{value:t}),e}(Z.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){on(Z[fe]),_("assert").equal(Z[fe].length,0);}));var Th;global[fe]||Ch(global,Z[fe]);cc.exports=ac(qR(Z));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Z.__patched&&(cc.exports=ac(Z),Z.__patched=!0);function ac(t){FR(t),t.gracefulify=ac,t.createReadStream=k,t.createWriteStream=q;var e=t.readFile;t.readFile=n;function n(R,B,I){return typeof B=="function"&&(I=B,B=null),M(R,B,I);function M(W,z,V,K){return e(W,z,function(T){T&&(T.code==="EMFILE"||T.code==="ENFILE")?Hn([M,[W,z,V],T,K||Date.now(),Date.now()]):typeof V=="function"&&V.apply(this,arguments);})}}var i=t.writeFile;t.writeFile=r;function r(R,B,I,M){return typeof I=="function"&&(M=I,I=null),W(R,B,I,M);function W(z,V,K,T,P){return i(z,V,K,function(H){H&&(H.code==="EMFILE"||H.code==="ENFILE")?Hn([W,[z,V,K,T],H,P||Date.now(),Date.now()]):typeof T=="function"&&T.apply(this,arguments);})}}var o=t.appendFile;o&&(t.appendFile=a);function a(R,B,I,M){return typeof I=="function"&&(M=I,I=null),W(R,B,I,M);function W(z,V,K,T,P){return o(z,V,K,function(H){H&&(H.code==="EMFILE"||H.code==="ENFILE")?Hn([W,[z,V,K,T],H,P||Date.now(),Date.now()]):typeof T=="function"&&T.apply(this,arguments);})}}var s=t.copyFile;s&&(t.copyFile=c);function c(R,B,I,M){return typeof I=="function"&&(M=I,I=0),W(R,B,I,M);function W(z,V,K,T,P){return s(z,V,K,function(H){H&&(H.code==="EMFILE"||H.code==="ENFILE")?Hn([W,[z,V,K,T],H,P||Date.now(),Date.now()]):typeof T=="function"&&T.apply(this,arguments);})}}var l=t.readdir;t.readdir=p;var u=/^v[0-5]\./;function p(R,B,I){typeof B=="function"&&(I=B,B=null);var M=u.test(process.version)?function(V,K,T,P){return l(V,W(V,K,T,P))}:function(V,K,T,P){return l(V,K,W(V,K,T,P))};return M(R,B,I);function W(z,V,K,T){return function(P,H){P&&(P.code==="EMFILE"||P.code==="ENFILE")?Hn([M,[z,V,K],P,T||Date.now(),Date.now()]):(H&&H.sort&&H.sort(),typeof K=="function"&&K.call(this,P,H));}}}if(process.version.substr(0,4)==="v0.8"){var h=PR(t);b=h.ReadStream,A=h.WriteStream;}var f=t.ReadStream;f&&(b.prototype=Object.create(f.prototype),b.prototype.open=w);var d=t.WriteStream;d&&(A.prototype=Object.create(d.prototype),A.prototype.open=O),Object.defineProperty(t,"ReadStream",{get:function(){return b},set:function(R){b=R;},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return A},set:function(R){A=R;},enumerable:!0,configurable:!0});var y=b;Object.defineProperty(t,"FileReadStream",{get:function(){return y},set:function(R){y=R;},enumerable:!0,configurable:!0});var v=A;Object.defineProperty(t,"FileWriteStream",{get:function(){return v},set:function(R){v=R;},enumerable:!0,configurable:!0});function b(R,B){return this instanceof b?(f.apply(this,arguments),this):b.apply(Object.create(b.prototype),arguments)}function w(){var R=this;D(R.path,R.flags,R.mode,function(B,I){B?(R.autoClose&&R.destroy(),R.emit("error",B)):(R.fd=I,R.emit("open",I),R.read());});}function A(R,B){return this instanceof A?(d.apply(this,arguments),this):A.apply(Object.create(A.prototype),arguments)}function O(){var R=this;D(R.path,R.flags,R.mode,function(B,I){B?(R.destroy(),R.emit("error",B)):(R.fd=I,R.emit("open",I));});}function k(R,B){return new t.ReadStream(R,B)}function q(R,B){return new t.WriteStream(R,B)}var L=t.open;t.open=D;function D(R,B,I,M){return typeof I=="function"&&(M=I,I=null),W(R,B,I,M);function W(z,V,K,T,P){return L(z,V,K,function(H,sr){H&&(H.code==="EMFILE"||H.code==="ENFILE")?Hn([W,[z,V,K,T],H,P||Date.now(),Date.now()]):typeof T=="function"&&T.apply(this,arguments);})}}return t}function Hn(t){on("ENQUEUE",t[0].name,t[1]),Z[fe].push(t),sc();}var xo;function kh(){for(var t=Date.now(),e=0;e<Z[fe].length;++e)Z[fe][e].length>2&&(Z[fe][
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001"),Mi.checkPaths(t,e,"copy",n,(r,o)=>{if(r)return i(r);let{srcStat:a,destStat:s}=o;Mi.checkParentPaths(t,a,e,"copy",c=>{if(c)return i(c);Hh(t,e,n,(l,u)=>{if(l)return i(l);if(!u)return i();QR(s,t,e,n,i);});});});}function QR(t,e,n,i,r){let o=$i.dirname(n);KR(o,(a,s)=>{if(a)return r(a);if(s)return mc(t,e,n,i,r);JR(o,c=>c?r(c):mc(t,e,n,i,r));});}function Hh(t,e,n,i){if(!n.filter)return i(null,!0);Promise.resolve(n.filter(t,e)).then(r=>i(null,r),r=>i(r));}function mc(t,e,n,i,r){(i.dereference?Ae.stat:Ae.lstat)(e,(a,s)=>a?r(a):s.isDirectory()?oT(s,t,e,n,i,r):s.isFile()||s.isCharacterDevice()||s.isBlockDevice()?ZR(s,t,e,n,i,r):s.isSymbolicLink()?cT(t,e,n,i,r):s.isSocket()?r(new Error(`Cannot copy a socket file: ${e}`)):s.isFIFO()?r(new Error(`Cannot copy a FIFO pipe: ${e}`)):r(new Error(`Unknown file: ${e}`)));}function ZR(t,e,n,i,r,o){return e?eT(t,n,i,r,o):Gh(t,n,i,r,o)}function eT(t,e,n,i,r){if(i.overwrite)Ae.unlink(n,o=>o?r(o):Gh(t,e,n,i,r));else return i.errorOnExist?r(new Error(`'${n}' already exists`)):r()}function Gh(t,e,n,i,r){Ae.copyFile(e,n,o=>o?r(o):i.preserveTimestamps?tT(t.mode,e,n,r):bo(n,t.mode,r));}function tT(t,e,n,i){return nT(t)?iT(n,t,r=>r?i(r):Wh(t,e,n,i)):Wh(t,e,n,i)}function nT(t){return (t&128)===0}function iT(t,e,n){return bo(t,e|128,n)}function Wh(t,e,n,i){rT(e,n,r=>r?i(r):bo(n,t,i));}function bo(t,e,n){return Ae.chmod(t,e,n)}function rT(t,e,n){Ae.stat(t,(i,r)=>i?n(i):YR(e,r.atime,r.mtime,n));}function oT(t,e,n,i,r,o){return e?Vh(n,i,r,o):aT(t.mode,n,i,r,o)}function aT(t,e,n,i,r){Ae.mkdir(n,o=>{if(o)return r(o);Vh(e,n,i,a=>a?r(a):bo(n,t,r));});}function Vh(t,e,n,i){Ae.readdir(t,(r,o)=>r?i(r):hc(o,t,e,n,i));}function hc(t,e,n,i,r){let o=t.pop();return o?sT(t,o,e,n,i,r):r()}function sT(t,e,n,i,r,o){let a=$i.join(n,e),s=$i.join(i,e);Hh(a,s,r,(c,l)=>{if(c)return o(c);if(!l)return hc(t,n,i,r,o);Mi.checkPaths(a,s,"copy",r,(u,p)=>{if(u)return o(u);let{destStat:h}=p;mc(h,a,s,r,f=>f?o(f):hc(t,n,i,r,o));});});}function cT(t,e,n,i,r){Ae.readlink(e,(o,a)=>{if(o)return r(o);if(i.dereference&&(a=$i.resolve(process.cwd(),a)),t)Ae.readlink(n,(s,c)=>s?s.code==="EINVAL"||s.code==="UNKNOWN"?Ae.symlink(a,n,r):r(s):(i.dereference&&(c=$i.resolve(process.cwd(),c)),Mi.isSrcSubdir(a,c)?r(new Error(`Cannot copy '${a}' to a subdirectory of itself, '${c}'.`)):Mi.isSrcSubdir(c,a)?r(new Error(`Cannot overwrite '${c}' with '${a}'.`)):uT(a,n,r)));else return Ae.symlink(a,n,r)});}function uT(t,e,n){Ae.unlink(e,i=>i?n(i):Ae.symlink(t,e,n));}Jh.exports=XR;});var ey=g((dD,Zh)=>{var ge=Ee(),Wi=_("path"),lT=Ve().mkdirsSync,pT=fc().utimesMillisSync,Hi=sn();function fT(t,e,n){typeof n=="function"&&(n={filter:n}),n=n||{},n.clobber="clobber"in n?!!n.clobber:!0,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.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:i,destStat:r}=Hi.checkPathsSync(t,e,"copy",n);if(Hi.checkParentPathsSync(t,i,e,"copy"),n.filter&&!n.filter(t,e))return;let o=Wi.dirname(e);return ge.existsSync(o)||lT(o),Yh(r,t,e,n)}function Yh(t,e,n,i){let o=(i.dereference?ge.statSync:ge.lstatSync)(e);if(o.isDirectory())return vT(o,t,e,n,i);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return dT(o,t,e,n,i);if(o.isSymbolicLink())return ST(t,e,n,i);throw o.isSocket()?new Error(`Cannot copy a socket file: ${e}`):o.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}function dT(t,e,n,i,r){return e?mT(t,n,i,r):Xh(t,n,i,r)}function mT(t,e,n,i){if(i.overwrite)return ge.unlinkSync(n),Xh(t,e,n,i);if(i.errorOnExist)throw new Error(`'${n}' already exists`)}function Xh(t,e,n,i){return ge.copyFileSync(e,n),i.preserveTimestamps&&hT(t.mode,e,n),yc(n,t.mode)}function hT(t,e,n){return yT(t)&&xT(n,t),gT(e,n)}function yT(t){return (t&128)===0}function xT(t,e){return yc(t,e|128)}function yc(t,e){return ge.chmodSync(t,e)}function gT(t,e){let n=ge.statSync(t);return pT(e,n.atime,n.mtime)}function vT(t,e,n,i,r){return e?Qh(n,i,r):bT(t.mode,n,i,r)}function bT(t,e,n,i){return ge.mkdirSync(n),Qh(e,n,i),yc(n,t)}function Qh(t,e,n){ge.readdirSync(t).forEach(i=>wT(i,t,e,n));}function wT(t,e,n,i){let r=Wi.join(e,t),o=Wi.join(n,t);if(i.filter&&!i.filter(r,o))return;let{destStat:a}=Hi.checkPathsSync(r,o,"copy",i);return Yh(a,r,o,i)}function ST(t,e,n,i){let r=ge.readlinkSync(e);if(i.dereference&&(r=Wi.resolve(process.cwd(),r)),t){let o;try{o=ge.readlinkSync(n);}catch(a){if(a.code==="EINVAL"||a.code==="UNKNOWN")return ge.symlinkSync(r,n);throw a}if(i.dereference&&(o=Wi.resolve(process.cwd(),o)),Hi.isSrcSubdir(r,o))throw new Error(`Cannot copy '${r}' to a subdirectory of itself, '${o}'.`);if(Hi.isSrcSubdir(o,r))throw new Error(`Cannot overwrite '${o}' with '${r}'.`);return ET(r,n)}else return ge.symlinkSync(r,n)}function ET(t,e){return ge.unlinkSync(e),ge.symlinkSync(t,e)}Zh.exports=fT;});var wo=g((mD,ty)=>{var AT=Se().fromCallback;ty.exports={copy:AT(Kh()),copySync:ey()};});var Gi=g((hD,iy)=>{var ny=Ee(),OT=Se().fromCallback;function RT(t,e){ny.rm(t,{recursive:!0,force:!0},e);}function TT(t){ny.rmSync(t,{recursive:!0,force:!0});}iy.exports={remove:OT(RT),removeSync:TT};});var py=g((yD,ly)=>{var kT=Se().fromPromise,ay=an(),sy=_("path"),cy=Ve(),uy=Gi(),ry=kT(async function(e){let n;try{n=await ay.readdir(e);}catch{return cy.mkdirs(e)}return Promise.all(n.map(i=>uy.remove(sy.join(e,i))))});function oy(t){let e;try{e=ay.readdirSync(t);}catch{return cy.mkdirsSync(t)}e.forEach(n=>{n=sy.join(t,n),uy.removeSync(n);});}ly.exports={emptyDirSync:oy,emptydirSync:oy,emptyDir:ry,emptydir:ry};});var hy=g((xD,my)=>{var CT=Se().fromCallback,fy=_("path"),Dt=Ee(),dy=Ve();function _T(t,e){function n(){Dt.writeFile(t,"",i=>{if(i)return e(i);e();});}Dt.stat(t,(i,r)=>{if(!i&&r.isFile())return e();let o=fy.dirname(t);Dt.stat(o,(a,s)=>{if(a)return a.code==="ENOENT"?dy.mkdirs(o,c=>{if(c)return e(c);n();}):e(a);s.isDirectory()?n():Dt.readdir(o,c=>{if(c)return e(c)});});});}function FT(t){let e;try{e=Dt.statSync(t);}catch{}if(e&&e.isFile())return;let n=fy.dirname(t);try{Dt.statSync(n).isDirectory()||Dt.readdirSync(n);}catch(i){if(i&&i.code==="ENOENT")dy.mkdirsSync(n);else throw i}Dt.writeFileSync(t,"");}my.exports={createFile:CT(_T),createFileSync:FT};});var by=g((gD,vy)=>{var PT=Se().fromCallback,yy=_("path"),Nt=Ee(),xy=Ve(),qT=Lt().pathExists,{areIdentical:gy}=sn();function jT(t,e,n){function i(r,o){Nt.link(r,o,a=>{if(a)return n(a);n(null);});}Nt.lstat(e,(r,o)=>{Nt.lstat(t,(a,s)=>{if(a)return a.message=a.message.replace("lstat","ensureLink"),n(a);if(o&&gy(s,o))return n(null);let c=yy.dirname(e);qT(c,(l,u)=>{if(l)return n(l);if(u)return i(t,e);xy.mkdirs(c,p=>{if(p)return n(p);i(t,e);});});});});}function BT(t,e){let n;try{n=Nt.lstatSync(e);}catch{}try{let o=Nt.lstatSync(t);if(n&&gy(o,n))return}catch(o){throw o.message=o.message.replace("lstat","ensureLink"),o}let i=yy.dirname(e);retur
`,finalEOL:n=!0,replacer:i=null,spaces:r}={}){let o=n?e:"";return JSON.stringify(t,i,r).replace(/\n/g,e)+o}function QT(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}$y.exports={stringify:XT,stripBom:QT};});var Gy=g((AD,Hy)=>{var Jn;try{Jn=Ee();}catch{Jn=_("fs");}var Eo=Se(),{stringify:My,stripBom:Wy}=So();async function ZT(t,e={}){typeof e=="string"&&(e={encoding:e});let n=e.fs||Jn,i="throws"in e?e.throws:!0,r=await Eo.fromCallback(n.readFile)(t,e);r=Wy(r);let o;try{o=JSON.parse(r,e?e.reviver:null);}catch(a){if(i)throw a.message=`${t}: ${a.message}`,a;return null}return o}var ek=Eo.fromPromise(ZT);function tk(t,e={}){typeof e=="string"&&(e={encoding:e});let n=e.fs||Jn,i="throws"in e?e.throws:!0;try{let r=n.readFileSync(t,e);return r=Wy(r),JSON.parse(r,e.reviver)}catch(r){if(i)throw r.message=`${t}: ${r.message}`,r;return null}}async function nk(t,e,n={}){let i=n.fs||Jn,r=My(e,n);await Eo.fromCallback(i.writeFile)(t,r,n);}var ik=Eo.fromPromise(nk);function rk(t,e,n={}){let i=n.fs||Jn,r=My(e,n);return i.writeFileSync(t,r,n)}var ok={readFile:ek,readFileSync:tk,writeFile:ik,writeFileSync:rk};Hy.exports=ok;});var Jy=g((OD,Vy)=>{var Ao=Gy();Vy.exports={readJson:Ao.readFile,readJsonSync:Ao.readFileSync,writeJson:Ao.writeFile,writeJsonSync:Ao.writeFileSync};});var Oo=g((RD,Xy)=>{var ak=Se().fromCallback,Ji=Ee(),Ky=_("path"),Yy=Ve(),sk=Lt().pathExists;function ck(t,e,n,i){typeof n=="function"&&(i=n,n="utf8");let r=Ky.dirname(t);sk(r,(o,a)=>{if(o)return i(o);if(a)return Ji.writeFile(t,e,n,i);Yy.mkdirs(r,s=>{if(s)return i(s);Ji.writeFile(t,e,n,i);});});}function uk(t,...e){let n=Ky.dirname(t);if(Ji.existsSync(n))return Ji.writeFileSync(t,...e);Yy.mkdirsSync(n),Ji.writeFileSync(t,...e);}Xy.exports={outputFile:ak(ck),outputFileSync:uk};});var Zy=g((TD,Qy)=>{var{stringify:lk}=So(),{outputFile:pk}=Oo();async function fk(t,e,n={}){let i=lk(e,n);await pk(t,i,n);}Qy.exports=fk;});var tx=g((kD,ex)=>{var{stringify:dk}=So(),{outputFileSync:mk}=Oo();function hk(t,e,n){let i=dk(e,n);mk(t,i,n);}ex.exports=hk;});var ix=g((CD,nx)=>{var yk=Se().fromPromise,ve=Jy();ve.outputJson=yk(Zy());ve.outputJsonSync=tx();ve.outputJSON=ve.outputJson;ve.outputJSONSync=ve.outputJsonSync;ve.writeJSON=ve.writeJson;ve.writeJSONSync=ve.writeJsonSync;ve.readJSON=ve.readJson;ve.readJSONSync=ve.readJsonSync;nx.exports=ve;});var cx=g((_D,sx)=>{var xk=Ee(),gc=_("path"),gk=wo().copy,ax=Gi().remove,vk=Ve().mkdirp,bk=Lt().pathExists,rx=sn();function wk(t,e,n,i){typeof n=="function"&&(i=n,n={}),n=n||{};let r=n.overwrite||n.clobber||!1;rx.checkPaths(t,e,"move",n,(o,a)=>{if(o)return i(o);let{srcStat:s,isChangingCase:c=!1}=a;rx.checkParentPaths(t,s,e,"move",l=>{if(l)return i(l);if(Sk(e))return ox(t,e,r,c,i);vk(gc.dirname(e),u=>u?i(u):ox(t,e,r,c,i));});});}function Sk(t){let e=gc.dirname(t);return gc.parse(e).root===e}function ox(t,e,n,i,r){if(i)return xc(t,e,n,r);if(n)return ax(e,o=>o?r(o):xc(t,e,n,r));bk(e,(o,a)=>o?r(o):a?r(new Error("dest already exists.")):xc(t,e,n,r));}function xc(t,e,n,i){xk.rename(t,e,r=>r?r.code!=="EXDEV"?i(r):Ek(t,e,n,i):i());}function Ek(t,e,n,i){gk(t,e,{overwrite:n,errorOnExist:!0,preserveTimestamps:!0},o=>o?i(o):ax(t,i));}sx.exports=wk;});var dx=g((FD,fx)=>{var lx=Ee(),bc=_("path"),Ak=wo().copySync,px=Gi().removeSync,Ok=Ve().mkdirpSync,ux=sn();function Rk(t,e,n){n=n||{};let i=n.overwrite||n.clobber||!1,{srcStat:r,isChangingCase:o=!1}=ux.checkPathsSync(t,e,"move",n);return ux.checkParentPathsSync(t,r,e,"move"),Tk(e)||Ok(bc.dirname(e)),kk(t,e,i,o)}function Tk(t){let e=bc.dirname(t);return bc.parse(e).root===e}function kk(t,e,n,i){if(i)return vc(t,e,n);if(n)return px(e),vc(t,e,n);if(lx.existsSync(e))throw new Error("dest already exists.");return vc(t,e,n)}function vc(t,e,n){try{lx.renameSync(t,e);}catch(i){if(i.code!=="EXDEV")throw i;return Ck(t,e,n)}}function Ck(t,e,n){return Ak(t,e,{overwrite:n,errorOnExist:!0,preserveTimestamps:!0}),px(t)}fx.exports=Rk;});var hx=g((PD,mx)=>{var _k=Se().fromCallback;mx.exports={move:_k(cx()),moveSync:dx()};});var xx=g((qD,yx)=>{yx.exports={...an(),...wo(),...py(),...zy(),...ix(),...Ve()
causes have become circular...`;let i=wc(t);return i?(e.add(t),n+`
caused by: `+vx(i,e)):n},Fk=t=>vx(t,new Set),bx=(t,e,n)=>{if(!Ki(t))return "";let i=n?"":t.message||"";if(e.has(t))return i+": ...";let r=wc(t);if(r){e.add(t);let o=typeof t.cause=="function";return i+(o?"":": ")+bx(r,e,o)}else return i},Pk=t=>bx(t,new Set);wx.exports={isErrorLike:Ki,getErrorCause:wc,stackWithCauses:Fk,messageWithCauses:Pk};});var Ec=g((ID,Ex)=>{var qk=Symbol("circular-ref-tag"),Ro=Symbol("pino-raw-err-ref"),Sx=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[Ro]},set:function(t){this[Ro]=t;}}});Object.defineProperty(Sx,Ro,{writable:!0,value:{}});Ex.exports={pinoErrProto:Sx,pinoErrorSymbols:{seen:qk,rawSymbol:Ro}};});var Rx=g((LD,Ox)=>{Ox.exports=Oc;var{messageWithCauses:jk,stackWithCauses:Bk,isErrorLike:Ax}=Sc(),{pinoErrProto:Ik,pinoErrorSymbols:Lk}=Ec(),{seen:Ac}=Lk,{toString:Dk}=Object.prototype;function Oc(t){if(!Ax(t))return t;t[Ac]=void 0;let e=Object.create(Ik);e.type=Dk.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=jk(t),e.stack=Bk(t),Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(n=>Oc(n)));for(let n in t)if(e[n]===void 0){let i=t[n];Ax(i)?n!=="cause"&&!Object.prototype.hasOwnProperty.call(i,Ac)&&(e[n]=Oc(i)):e[n]=i;}return delete t[Ac],e.raw=t,e}});var kx=g((DD,Tx)=>{Tx.exports=ko;var{isErrorLike:Rc}=Sc(),{pinoErrProto:Nk,pinoErrorSymbols:Uk}=Ec(),{seen:To}=Uk,{toString:zk}=Object.prototype;function ko(t){if(!Rc(t))return t;t[To]=void 0;let e=Object.create(Nk);e.type=zk.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(n=>ko(n))),Rc(t.cause)&&!Object.prototype.hasOwnProperty.call(t.cause,To)&&(e.cause=ko(t.cause));for(let n in t)if(e[n]===void 0){let i=t[n];Rc(i)?Object.prototype.hasOwnProperty.call(i,To)||(e[n]=ko(i)):e[n]=i;}return delete t[To],e.raw=t,e}});var Px=g((ND,Fx)=>{Fx.exports={mapHttpRequest:$k,reqSerializer:_x};var Tc=Symbol("pino-raw-req-ref"),Cx=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[Tc]},set:function(t){this[Tc]=t;}}});Object.defineProperty(Cx,Tc,{writable:!0,value:{}});function _x(t){let e=t.info||t.socket,n=Object.create(Cx);if(n.id=typeof t.id=="function"?t.id():t.id||(t.info?t.info.id:void 0),n.method=t.method,t.originalUrl)n.url=t.originalUrl;else {let i=t.path;n.url=typeof i=="string"?i:t.url?t.url.path||t.url:void 0;}return t.query&&(n.query=t.query),t.params&&(n.params=t.params),n.headers=t.headers,n.remoteAddress=e&&e.remoteAddress,n.remotePort=e&&e.remotePort,n.raw=t.raw||t,n}function $k(t){return {req:_x(t)}}});var Ix=g((UD,Bx)=>{Bx.exports={mapHttpResponse:Mk,resSerializer:jx};var kc=Symbol("pino-raw-res-ref"),qx=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[kc]},set:function(t){this[kc]=t;}}});Object.defineProperty(qx,kc,{writable:!0,value:{}});function jx(t){let e=Object.create(qx);return e.statusCode=t.headersSent?t.statusCode:null,e.headers=t.getHeaders?t.getHeaders():t._headers,e.raw=t,e}function Mk(t){return {res:jx(t)}}});var _c=g((zD,Lx)=>{var Cc=Rx(),Wk=kx(),Co=Px(),_o=Ix();Lx.exports={err:Cc,errWithCause:Wk,mapHttpRequest:Co.mapHttpRequest,mapHttpResponse:_o.mapHttpResponse,req:Co.reqSerializer,res:_o.resSerializer,wrapErrorSerializer:function(e){return e===Cc?e:function(i){return e(Cc(i))}},wrapRequestSerializer:function(e){return e===Co.reqSerializer?e:function(i){return e(Co.reqSerializer(i))}},wrapResponseSeri
2023-06-06 14:25:31 +00:00
'use strict'
const o = new Proxy({}, { get: () => o, set: () => { throw Error() } });
const \u3007 = null;
o${a}
if ([o${a}].length !== 1) throw Error()`)();}catch{throw Error(n(o))}});}}});var Fo=g((WD,zx)=>{zx.exports=/[^.[\]]+|\[((?:.)*?)\]/g;});var Mx=g((HD,$x)=>{var Vk=Fo();$x.exports=Jk;function Jk({paths:t}){let e=[];var n=0;let i=t.reduce(function(r,o,a){var s=o.match(Vk).map(u=>u.replace(/'|"|`/g,""));let c=o[0]==="[";s=s.map(u=>u[0]==="["?u.substr(1,u.length-2):u);let l=s.indexOf("*");if(l>-1){let u=s.slice(0,l),p=u.join("."),h=s.slice(l+1,s.length),f=h.length>0;n++,e.push({before:u,beforeStr:p,after:h,nested:f});}else r[o]={path:s,val:void 0,precensored:!1,circle:"",escPath:JSON.stringify(o),leadingBracket:c};return r},{});return {wildcards:e,wcLen:n,secret:i}}});var Hx=g((GD,Wx)=>{var Kk=Fo();Wx.exports=Yk;function Yk({secret:t,serialize:e,wcLen:n,strict:i,isCensorFct:r,censorFctTakesPath:o},a){let s=Function("o",`
2023-06-06 14:25:31 +00:00
if (typeof o !== 'object' || o == null) {
${e1(i,e)}
2023-06-06 14:25:31 +00:00
}
const { censor, secret } = this
${Xk(t,r,o)}
2023-06-06 14:25:31 +00:00
this.compileRestore()
${Qk(n>0,r,o)}
${Zk(e)}
`).bind(a);return e===!1&&(s.restore=c=>a.restore(c)),s}function Xk(t,e,n){return Object.keys(t).map(i=>{let{escPath:r,leadingBracket:o,path:a}=t[i],s=o?1:0,c=o?"":".",l=[];for(var u;(u=Kk.exec(i))!==null;){let[,d]=u,{index:y,input:v}=u;y>s&&l.push(v.substring(0,y-(d?0:1)));}var p=l.map(d=>`o${c}${d}`).join(" && ");p.length===0?p+=`o${c}${i} != null`:p+=` && o${c}${i} != null`;let h=`
2023-06-06 14:25:31 +00:00
switch (true) {
${l.reverse().map(d=>`
case o${c}${d} === censor:
secret[${r}].circle = ${JSON.stringify(d)}
2023-06-06 14:25:31 +00:00
break
`).join(`
`)}
}
`,f=n?`val, ${JSON.stringify(a)}`:"val";return `
if (${p}) {
const val = o${c}${i}
2023-06-06 14:25:31 +00:00
if (val === censor) {
secret[${r}].precensored = true
} else {
secret[${r}].val = val
o${c}${i} = ${e?`censor(${f})`:"censor"}
2023-06-06 14:25:31 +00:00
${h}
}
}
`}).join(`
`)}function Qk(t,e,n){return t===!0?`
2023-06-06 14:25:31 +00:00
{
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}, ${n})
} else secret[beforeStr] = groupRedact(o, before, censor, ${e}, ${n})
2023-06-06 14:25:31 +00:00
}
}
`:""}function Zk(t){return t===!1?"return o":`
2023-06-06 14:25:31 +00:00
var s = this.serialize(o)
this.restore(o)
return s
`}function e1(t,e){return t===!0?"throw Error('fast-redact: primitives cannot be redacted')":e===!1?"return o":"return this.serialize(o)"}});var Pc=g((VD,Kx)=>{Kx.exports={groupRedact:n1,groupRestore:t1,nestedRedact:r1,nestedRestore:i1};function t1({keys:t,values:e,target:n}){if(n==null)return;let i=t.length;for(var r=0;r<i;r++){let o=t[r];n[o]=e[r];}}function n1(t,e,n,i,r){let o=Gx(t,e);if(o==null)return {keys:null,values:null,target:null,flat:!0};let a=Object.keys(o),s=a.length,c=e.length,l=r?[...e]:void 0,u=new Array(s);for(var p=0;p<s;p++){let h=a[p];u[p]=o[h],r?(l[c]=h,o[h]=n(o[h],l)):i?o[h]=n(o[h]):o[h]=n;}return {keys:a,values:u,target:o,flat:!0}}function i1(t){let e=t.length;for(var n=0;n<e;n++){let{key:r,target:o,value:a,level:s}=t[n];if(s===0||s===1){if(Kn(o,r)&&(o[r]=a),typeof o=="object"){let c=Object.keys(o);for(var i=0;i<c.length;i++){let l=c[i],u=o[l];Kn(u,r)&&(u[r]=a);}}}else Jx(r,o,a,s);}}function r1(t,e,n,i,r,o,a){let s=Gx(e,n);if(s==null)return;let c=Object.keys(s),l=c.length;for(var u=0;u<l;u++){let p=c[u],{value:h,parent:f,exists:d,level:y}=o1(s,p,n,i,r,o,a);d===!0&&f!==null&&t.push({key:i[i.length-1],target:f,value:h,level:y});}return t}function Kn(t,e){return t!=null?"hasOwn"in Object?Object.hasOwn(t,e):Object.prototype.hasOwnProperty.call(t,e):!1}function o1(t,e,n,i,r,o,a){let s=i.length,c=s-1,l=e;var u=-1,p,h,f,d=null,y=!0,v=null,b,w,A=!1,O=0;if(f=p=t[e],typeof p!="object")return {value:null,parent:null,exists:y};for(;p!=null&&++u<s;){if(e=i[u],d=f,e!=="*"&&!v&&!(typeof p=="object"&&e in p)){y=!1;break}if(!(e==="*"&&(v==="*"&&(A=!0),v=e,u!==c))){if(v){let q=Object.keys(p);for(var k=0;k<q.length;k++){let L=q[k];w=p[L],b=e==="*",A?(O=u,f=Vx(w,O-1,e,n,i,r,o,a,l,p,h,f,b,L,u,c)):(b||typeof w=="object"&&w!==null&&e in w)&&(b?f=w:f=w[e],h=u!==c?f:o?a?r(f,[...n,l,...i]):r(f):r,b?p[L]=h:w[e]===h?y=!1:w[e]=h===void 0&&r!==void 0||Kn(w,e)&&h===f?w[e]:h);}v=null;}else f=p[e],h=u!==c?f:o?a?r(f,[...n,l,...i]):r(f):r,p[e]=Kn(p,e)&&h===f||h===void 0&&r!==void 0?p[e]:h,p=p[e];if(typeof p!="object")break;(f===d||typeof f>"u")&&(y=!1);}}return {value:f,parent:d,exists:y,level:O}}function Gx(t,e){for(var n=-1,i=e.length,r=t;r!=null&&++n<i;)r=r[e[n]];return r}function Vx(t,e,n,i,r,o,a,s,c,l,u,p,h,f,d,y,v){if(e===0)return (h||typeof t=="object"&&t!==null&&n in t)&&(h?p=t:p=t[n],u=d!==y?p:a?s?o(p,[...i,c,...r]):o(p):o,h?l[f]=u:t[n]===u?!1:t[n]=u===void 0&&o!==void 0||Kn(t,n)&&u===p?t[n]:u),p;for(let w in t)if(typeof t[w]=="object"){var b=Vx(t[w],e-1,n,i,r,o,a,s,c,l,u,p,h,f,d,y);return b}}function Jx(t,e,n,i){if(i===0){Kn(e,t)&&(e[t]=n);return}for(let r in e)typeof e[r]=="object"&&Jx(t,e[r],n,i-1);}});var Xx=g((JD,Yx)=>{var{groupRestore:a1,nestedRestore:s1}=Pc();Yx.exports=c1;function c1({secret:t,wcLen:e}){return function(){if(this.restore)return;let i=Object.keys(t),r=u1(t,i),o=e>0,a=o?{secret:t,groupRestore:a1,nestedRestore:s1}:{secret:t};this.restore=Function("o",l1(r,i,o)).bind(a);}}function u1(t,e){return e.map(n=>{let{circle:i,escPath:r,leadingBracket:o}=t[n],s=i?`o.${i} = secret[${r}].val`:`o${o?"":"."}${n} = secret[${r}].val`,c=`secret[${r}].val = undefined`;return `
2023-06-06 14:25:31 +00:00
if (secret[${r}].val !== undefined) {
try { ${s} } catch (e) {}
${c}
}
`}).join("")}function l1(t,e,n){return `
2023-06-06 14:25:31 +00:00
const secret = this.secret
${n===!0?`
2023-06-06 14:25:31 +00:00
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 Zx=g((KD,Qx)=>{Qx.exports=p1;function p1(t){let{secret:e,censor:n,compileRestore:i,serialize:r,groupRedact:o,nestedRedact:a,wildcards:s,wcLen:c}=t,l=[{secret:e,censor:n,compileRestore:i}];return r!==!1&&l.push({serialize:r}),c>0&&l.push({groupRedact:o,nestedRedact:a,wildcards:s,wcLen:c}),Object.assign(...l)}});var ng=g((YD,tg)=>{var eg=Ux(),f1=Mx(),d1=Hx(),m1=Xx(),{groupRedact:h1,nestedRedact:y1}=Pc(),x1=Zx(),g1=Fo(),v1=eg(),qc=t=>t;qc.restore=qc;var b1="[REDACTED]";jc.rx=g1;jc.validator=eg;tg.exports=jc;function jc(t={}){let e=Array.from(new Set(t.paths||[])),n="serialize"in t&&(t.serialize===!1||typeof t.serialize=="function")?t.serialize:JSON.stringify,i=t.remove;if(i===!0&&n!==JSON.stringify)throw Error("fast-redact \u2013 remove option may only be set when serializer is JSON.stringify");let r=i===!0?void 0:"censor"in t?t.censor:b1,o=typeof r=="function",a=o&&r.length>1;if(e.length===0)return n||qc;v1({paths:e,serialize:n,censor:r});let{wildcards:s,wcLen:c,secret:l}=f1({paths:e,censor:r}),u=m1({secret:l,wcLen:c}),p="strict"in t?t.strict:!0;return d1({secret:l,wcLen:c,serialize:n,strict:p,isCensorFct:o,censorFctTakesPath:a},x1({secret:l,censor:r,compileRestore:u,serialize:n,groupRedact:h1,nestedRedact:y1,wildcards:s,wcLen:c}))}});var Yn=g((XD,ig)=>{var w1=Symbol("pino.setLevel"),S1=Symbol("pino.getLevel"),E1=Symbol("pino.levelVal"),A1=Symbol("pino.useLevelLabels"),O1=Symbol("pino.useOnlyCustomLevels"),R1=Symbol("pino.mixin"),T1=Symbol("pino.lsCache"),k1=Symbol("pino.chindings"),C1=Symbol("pino.asJson"),_1=Symbol("pino.write"),F1=Symbol("pino.redactFmt"),P1=Symbol("pino.time"),q1=Symbol("pino.timeSliceIndex"),j1=Symbol("pino.stream"),B1=Symbol("pino.stringify"),I1=Symbol("pino.stringifySafe"),L1=Symbol("pino.stringifiers"),D1=Symbol("pino.end"),N1=Symbol("pino.formatOpts"),U1=Symbol("pino.messageKey"),z1=Symbol("pino.errorKey"),$1=Symbol("pino.nestedKey"),M1=Symbol("pino.nestedKeyStr"),W1=Symbol("pino.mixinMergeStrategy"),H1=Symbol("pino.msgPrefix"),G1=Symbol("pino.wildcardFirst"),V1=Symbol.for("pino.serializers"),J1=Symbol.for("pino.formatters"),K1=Symbol.for("pino.hooks"),Y1=Symbol.for("pino.metadata");ig.exports={setLevelSym:w1,getLevelSym:S1,levelValSym:E1,useLevelLabelsSym:A1,mixinSym:R1,lsCacheSym:T1,chindingsSym:k1,asJsonSym:C1,writeSym:_1,serializersSym:V1,redactFmtSym:F1,timeSym:P1,timeSliceIndexSym:q1,streamSym:j1,stringifySym:B1,stringifySafeSym:I1,stringifiersSym:L1,endSym:D1,formatOptsSym:N1,messageKeySym:U1,errorKeySym:z1,nestedKeySym:$1,wildcardFirstSym:G1,needsMetadataGsym:Y1,useOnlyCustomLevelsSym:O1,formattersSym:J1,hooksSym:K1,nestedKeyStrSym:M1,mixinMergeStrategySym:W1,msgPrefixSym:H1};});var Lc=g((QD,sg)=>{var Ic=ng(),{redactFmtSym:X1,wildcardFirstSym:Po}=Yn(),{rx:Bc,validator:Q1}=Ic,rg=Q1({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})`}),og="[Redacted]",ag=!1;function Z1(t,e){let{paths:n,censor:i}=eC(t),r=n.reduce((s,c)=>{Bc.lastIndex=0;let l=Bc.exec(c),u=Bc.exec(c),p=l[1]!==void 0?l[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):l[0];if(p==="*"&&(p=Po),u===null)return s[p]=null,s;if(s[p]===null)return s;let{index:h}=u,f=`${c.substr(h,c.length-1)}`;return s[p]=s[p]||[],p!==Po&&s[p].length===0&&s[p].push(...s[Po]||[]),p===Po&&Object.keys(s).forEach(function(d){s[d]&&s[d].push(f);}),s[p].push(f),s},{}),o={[X1]:Ic({paths:n,censor:i,serialize:e,strict:ag})},a=(...s)=>e(typeof i=="function"?i(...s):i);return [...Object.keys(r),...Object.getOwnPropertySymbols(r)].reduce((s,c)=>{if(r[c]===null)s[c]=l=>a(l,[c]);else {let l=typeof i=="function"?(u,p)=>i(u,[c,...p]):i;s[c]=Ic({paths:r[c],censor:l,serialize:e,strict:ag});}return s},o)}function eC(t){if(Array.isArray(t))return t={paths:t,censor:og},rg(t),t;let{paths:e,censor:n=og,remove:i}=t;if(Array.isArray(e)===!1)throw Error("pino \u2013 redact must contain an array of strings");return i===!0&&(n=void 0),rg({paths:e,censor:n}),{paths:e,censor:n}}sg.exports=Z1;});var ug=g((ZD,cg)=>{var tC=()=>"",nC=()=>`,"time":${Date.now()}`,iC=()=>`,"t
${b}`,O=`,
${b}`);let I=Math.min(w.length,a),M=0;for(;M<I-1;M++){let z=s(String(M),w,d,y,v,b);A+=z!==void 0?z:"null",A+=O;}let W=s(String(M),w,d,y,v,b);if(A+=W!==void 0?W:"null",w.length-1>a){let z=w.length-a-1;A+=`${O}"... ${ln(z)} not stringified"`;}return v!==""&&(A+=`
${k}`),d.pop(),`[${A}]`}let q=Object.keys(w),L=q.length;if(L===0)return "{}";if(o<d.length+1)return '"[Object]"';let D="",R="";v!==""&&(b+=v,O=`,
${b}`,D=" ");let B=Math.min(L,a);r&&!ou(w)&&(q=ru(q)),d.push(w);for(let I=0;I<B;I++){let M=q[I],W=s(M,w,d,y,v,b);W!==void 0&&(A+=`${R}${$t(M)}:${D}${W}`,R=O);}if(L>a){let I=L-a;A+=`${R}"...":${D}"${ln(I)} not stringified"`,R=O;}return v!==""&&R.length>1&&(A=`
${b}${A}
${k}`),d.pop(),`{${A}}`}case"number":return isFinite(w)?String(w):e?e(w):"null";case"boolean":return w===!0?"true":"false";case"undefined":return;case"bigint":if(i)return String(w);default:return e?e(w):void 0}}function c(h,f,d,y,v,b){switch(typeof f=="object"&&f!==null&&typeof f.toJSON=="function"&&(f=f.toJSON(h)),typeof f){case"string":return $t(f);case"object":{if(f===null)return "null";if(d.indexOf(f)!==-1)return n;let w=b,A="",O=",";if(Array.isArray(f)){if(f.length===0)return "[]";if(o<d.length+1)return '"[Array]"';d.push(f),v!==""&&(b+=v,A+=`
${b}`,O=`,
${b}`);let L=Math.min(f.length,a),D=0;for(;D<L-1;D++){let B=c(String(D),f[D],d,y,v,b);A+=B!==void 0?B:"null",A+=O;}let R=c(String(D),f[D],d,y,v,b);if(A+=R!==void 0?R:"null",f.length-1>a){let B=f.length-a-1;A+=`${O}"... ${ln(B)} not stringified"`;}return v!==""&&(A+=`
${w}`),d.pop(),`[${A}]`}d.push(f);let k="";v!==""&&(b+=v,O=`,
${b}`,k=" ");let q="";for(let L of y){let D=c(L,f[L],d,y,v,b);D!==void 0&&(A+=`${q}${$t(L)}:${k}${D}`,q=O);}return v!==""&&q.length>1&&(A=`
${b}${A}
${w}`),d.pop(),`{${A}}`}case"number":return isFinite(f)?String(f):e?e(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(i)return String(f);default:return e?e(f):void 0}}function l(h,f,d,y,v){switch(typeof f){case"string":return $t(f);case"object":{if(f===null)return "null";if(typeof f.toJSON=="function"){if(f=f.toJSON(h),typeof f!="object")return l(h,f,d,y,v);if(f===null)return "null"}if(d.indexOf(f)!==-1)return n;let b=v;if(Array.isArray(f)){if(f.length===0)return "[]";if(o<d.length+1)return '"[Array]"';d.push(f),v+=y;let D=`
${v}`,R=`,
${v}`,B=Math.min(f.length,a),I=0;for(;I<B-1;I++){let W=l(String(I),f[I],d,y,v);D+=W!==void 0?W:"null",D+=R;}let M=l(String(I),f[I],d,y,v);if(D+=M!==void 0?M:"null",f.length-1>a){let W=f.length-a-1;D+=`${R}"... ${ln(W)} not stringified"`;}return D+=`
${b}`,d.pop(),`[${D}]`}let w=Object.keys(f),A=w.length;if(A===0)return "{}";if(o<d.length+1)return '"[Object]"';v+=y;let O=`,
${v}`,k="",q="",L=Math.min(A,a);ou(f)&&(k+=av(f,O,a),w=w.slice(f.length),L-=f.length,q=O),r&&(w=ru(w)),d.push(f);for(let D=0;D<L;D++){let R=w[D],B=l(R,f[R],d,y,v);B!==void 0&&(k+=`${q}${$t(R)}: ${B}`,q=O);}if(A>a){let D=A-a;k+=`${q}"...": "${ln(D)} not stringified"`,q=O;}return q!==""&&(k=`
${v}${k}
${b}`),d.pop(),`{${k}}`}case"number":return isFinite(f)?String(f):e?e(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(i)return String(f);default:return e?e(f):void 0}}function u(h,f,d){switch(typeof f){case"string":return $t(f);case"object":{if(f===null)return "null";if(typeof f.toJSON=="function"){if(f=f.toJSON(h),typeof f!="object")return u(h,f,d);if(f===null)return "null"}if(d.indexOf(f)!==-1)return n;let y="";if(Array.isArray(f)){if(f.length===0)return "[]";if(o<d.length+1)return '"[Array]"';d.push(f);let O=Math.min(f.length,a),k=0;for(;k<O-1;k++){let L=u(String(k),f[k],d);y+=L!==void 0?L:"null",y+=",";}let q=u(String(k),f[k],d);if(y+=q!==void 0?q:"null",f.length-1>a){let L=f.length-a-1;y+=`,"... ${ln(L)} not stringified"`;}return d.pop(),`[${y}]`}let v=Object.keys(f),b=v.length;if(b===0)return "{}";if(o<d.length+1)return '"[Object]"';let w="",A=Math.min(b,a);ou(f)&&(y+=av(f,",",a),v=v.slice(f.length),A-=f.length,w=","),r&&(v=ru(v)),d.push(f);for(let O=0;O<A;O++){let k=v[O],q=u(k,f[k],d);q!==void 0&&(y+=`${w}${$t(k)}:${q}`,w=",");}if(b>a){let O=b-a;y+=`${w}"...":"${ln(O)} not stringified"`;}return d.pop(),`{${y}}`}case"number":return isFinite(f)?String(f):e?e(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(i)return String(f);default:return e?e(f):void 0}}function p(h,f,d){if(arguments.length>1){let y="";if(typeof d=="number"?y=" ".repeat(Math.min(d,10)):typeof d=="string"&&(y=d.slice(0,10)),f!=null){if(typeof f=="function")return s("",{"":h},[],f,y,"");if(Array.isArray(f))return c("",h,[],sF(f),y,"")}if(y.length!==0)return l("",h,[],y,"")}return u("",h,[])}return p}});var mv=g((hN,dv)=>{var cu=Symbol.for("pino.metadata"),{levels:pv}=Uo(),fv=Object.create(pv);fv.silent=1/0;var uF=pv.info;function lF(t,e){let n=0;t=t||[],e=e||{dedupe:!1};let i=fv;e.levels&&typeof e.levels=="object"&&(i=e.levels);let r={write:o,add:s,flushSync:a,end:c,minLevel:0,streams:[],clone:l,[cu]:!0};return Array.isArray(t)?t.forEach(s,r):s.call(r,t),t=null,r;function o(u){let p,h=this.lastLevel,{streams:f}=this,d=0,y;for(let v=fF(f.length,e.dedupe);mF(v,f.length,e.dedupe);v=dF(v,e.dedupe))if(p=f[v],p.level<=h){if(d!==0&&d!==p.level)break;if(y=p.stream,y[cu]){let{lastTime:b,lastMsg:w,lastObj:A,lastLogger:O}=this;y.lastLevel=h,y.lastTime=b,y.lastMsg=w,y.lastObj=A,y.lastLogger=O;}y.write(u),e.dedupe&&(d=p.level);}else if(!e.dedupe)break}function a(){for(let{stream:u}of this.streams)typeof u.flushSync=="function"&&u.flushSync();}function s(u){if(!u)return r;let p=typeof u.write=="function"||u.stream,h=u.write?u:u.stream;if(!p)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:f}=this,d;typeof u.levelVal=="number"?d=u.levelVal:typeof u.level=="string"?d=i[u.level]:typeof u.level=="number"?d=u.level:d=uF;let y={stream:h,level:d,levelVal:void 0,id:n++};return f.unshift(y),f.sort(pF),this.minLevel=f[0].level,r}function c(){for(let{stream:u}of this.streams)typeof u.flushSync=="function"&&u.flushSync(),u.end();}function l(u){let p=new Array(this.streams.length);for(let h=0;h<p.length;h++)p[h]={level:u,stream:this.streams[h].stream};return {write:o,add:s,minLevel:u,streams:p,clone:l,flushSync:a,[cu]:!0}}}function pF(t,e){return t.level-e.level}function fF(t,e){return e?t-1:0}function dF(t,e){return e?t-1:t+1}function mF(t,e,n){return n?t>=0:t<e}dv.exports=lF;});var Tv=g((yN,Ue)=>{var hF=_("os"),Sv=_c(),yF=Fc(),xF=Lc(),Ev=ug(),gF=ov(),Av=Yn(),{configure:vF}=lv(),{assertDefaultLevelFound:bF,mappings:Ov,genLsCache:wF,levels:SF}=Uo(),{createArgsNormalizer:EF,asChindings:AF,buildSafeSonicBoom:hv,buildFormatters:OF,stringify:uu,normalizeDestFileDescriptor:yv,noop:RF}=No(),{version:TF}=eu(),{chindingsSym:xv,redactFmtSym:kF,serializersSym:gv,timeSym:CF,timeSliceIndexSym:_F,streamSym:FF,stringifySym:vv,stringifySafeSym:lu,stringifiersSym:bv,setLevelSym:PF,endSym:qF,formatOptsSym:jF,messageKeySym:BF,errorKeySym:IF,nestedKeySym:LF,mixinSym:DF,useOnlyCustomLevelsSym:NF,formattersSym:wv,hooksSym:UF,nestedKeyStrSym:zF,mixinMe
2023-06-06 14:25:31 +00:00
`:`
`),z=AF.bind(null,{[xv]:"",[gv]:a,[bv]:I,[vv]:uu,[lu]:D,[wv]:R}),V="";p!==null&&(h===void 0?V=z(p):V=z(Object.assign({},p,{name:h})));let K=s instanceof Function?s:s?Rv:WF,T=K().indexOf(":")+1;if(b&&!d)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(y&&typeof y!="function")throw Error(`Unknown mixin type "${typeof y}" - expected "function"`);if(L&&typeof L!="string")throw Error(`Unknown msgPrefix type "${typeof L}" - expected "string"`);bF(f,d,b);let P=Ov(d,b);return Object.assign(e,{levels:P,[NF]:b,[FF]:i,[CF]:K,[_F]:T,[vv]:uu,[lu]:D,[bv]:I,[qF]:W,[jF]:M,[BF]:c,[IF]:l,[LF]:u,[zF]:u?`,${JSON.stringify(u)}:{`:"",[gv]:a,[DF]:y,[$F]:v,[xv]:V,[wv]:R,[UF]:A,silent:RF,onChild:q,[MF]:L}),Object.setPrototypeOf(e,gF()),wF(e),e[PF](f),e}Ue.exports=pu;Ue.exports.destination=(t=process.stdout.fd)=>typeof t=="object"?(t.dest=yv(t.dest||process.stdout.fd),hv(t)):hv({dest:yv(t),minLength:0});Ue.exports.transport=Kc();Ue.exports.multistream=mv();Ue.exports.levels=Ov();Ue.exports.stdSerializers=YF;Ue.exports.stdTimeFunctions=Object.assign({},Ev);Ue.exports.symbols=Av;Ue.exports.version=TF;Ue.exports.default=pu;Ue.exports.pino=pu;});var jv={};Db(jv,{RotatingFileStream:()=>Wo,RotatingFileStreamError:()=>Yi,createStream:()=>hP});async function Cv(t){return new Promise(e=>fs.access(t,fs.constants.F_OK,n=>e(!n)))}function _v(t){return (e,n,i)=>{let r=parseInt(i,10);if(e!=="number"||r!==i||r<=0)throw new Error(`'${t}' option must be a positive integer number`)}}function du(t,e){return (n,i,r)=>{if(n!=="string")throw new Error(`Don't know how to handle 'options.${t}' type: ${n}`);i[t]=e(r);}}function qv(t,e,n){let i={};if(i.num=parseInt(t,10),isNaN(i.num))throw new Error(`Unknown 'options.${e}' format: ${t}`);if(i.num<=0)throw new Error(`A positive integer number is expected for 'options.${e}'`);if(i.unit=t.replace(/^[ 0]*/g,"").substr((i.num+"").length,1),i.unit.length===0)throw new Error(`Missing unit for 'options.${e}'`);if(!n[i.unit])throw new Error(`Unknown 'options.${e}' unit: ${i.unit}`);return i}function mu(t,e,n){if(parseInt(n/t.num,10)*t.num!==n)throw new Error(`An integer divider of ${n} is expected as ${e} for 'options.interval'`)}function lP(t){let e=qv(t,"interval",uP);switch(e.unit){case"h":mu(e,"hours",24);break;case"m":mu(e,"minutes",60);break;case"s":mu(e,"seconds",60);break}return e}function Fv(t){let e=qv(t,"size",pP);return e.unit==="K"?e.num*1024:e.unit==="M"?e.num*1048576:e.unit==="G"?e.num*1073741824:e.num}function fP(t){let e={};for(let n in t){let i=t[n],r=typeof i;if(!(n in Pv))throw new Error(`Unknown option: ${n}`);e[n]=t[n],Pv[n](r,e,i);}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 dP(t,e,n){return i=>i?`${t}.${i}${e&&!n?".gz":""}`:t}function mP(t,e,n){let i=r=>(r>9?"":"0")+r;return (r,o)=>{if(!r)return t;let a=r.getFullYear()+""+i(r.getMonth()+1),s=i(r.getDate()),c=i(r.getHours()),l=i(r.getMinutes());return a+s+"-"+c+l+"-"+i(o)+"-"+t+(e&&!n?".gz":"")}}function hP(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 n=fP(e),{compress:i,omitExtension:r}=n,o;if(typeof t=="string")o=e.rotate?dP(t,i!==void 0,r):mP(t,i!==void 0,r);else if(typeof t=="function")o=t;else throw new Error(`The "filename" argument must be one of type string or function. Received type ${typeof t}`);return new Wo(o,n)}var Yi,Wo,uP,pP,Pv,Bv=Lb(()=>{Yi=class extends Error{constructor(){super("Too many destination file attempts");U(this,"code","RFS-TOO-MANY");}},Wo=class extends Un.Writable{constructor(n,i){let{encoding:r,history:o,maxFiles:a,maxSize:s,path:c}=i;super({decodeStrings:!0,defaultEncoding:r});U(this,"createGzip");U(this,"exec");U(this,"file");U(this,"filename");U(this,"finished");U(this,"fsCreateReadStream");U(this,"fsCreateWriteStream");U(this,"fsOpen"
`),n];}catch(c){if(c.code!=="ENOENT")throw c}for(let c of s)if(c)try{let l=await this.fsStat(c);l.isFile()?a.push({name:c,size:l.size,time:l.ctime.getTime()}):this.emit("warning",new Error(`File '${c}' contained in history is not a regular file`));}catch(l){if(l.code!=="ENOENT")throw l}if(a.sort((c,l)=>c.time-l.time),r)for(;a.length>r;){let c=a.shift();await this.unlink(c.name),this.emit("removed",c.name,!0);}if(o)for(;a.reduce((c,l)=>c+l.size,0)>o;){let c=a.shift();await this.unlink(c.name),this.emit("removed",c.name,!1);}await promises.writeFile(i,a.map(c=>c.name).join(`
2023-06-06 14:25:31 +00:00
`)+`
`,"utf-8"),this.emit("history");}async immutate(n){let{size:i}=this.options,r=this.now();for(let o=1;o<1e3;++o){let a=0,s;this.filename=this.options.path+this.generator(r,o);try{s=await this.fsStat(this.filename);}catch(c){if(c.code!=="ENOENT")throw c}if(s){if(a=s.size,!s.isFile())throw new Error(`Can't write on: '${this.filename}' (it is not a file)`);if(i&&a>=i)continue}if(n)return this.last=this.filename,this.reopen(a);await this.rotated(this.last),this.last=this.filename;return}throw new Yi}async unlink(n){try{await this.fsUnlink(n);}catch(i){if(i.code!=="ENOENT")throw i;this.emit("warning",i);}}};uP={M:!0,d:!0,h:!0,m:!0,s:!0};pP={B:!0,G:!0,K:!0,M:!0};Pv={encoding:(t,e,n)=>new nR.TextDecoder(n),immutable:()=>{},initialRotation:()=>{},interval:du("interval",lP),intervalBoundary:()=>{},maxFiles:_v("maxFiles"),maxSize:du("maxSize",Fv),mode:()=>{},omitExtension:()=>{},rotate:_v("rotate"),size:du("size",Fv),teeToStdout:()=>{},compress:(t,e,n)=>{if(!n)throw new Error("A value for 'options.compress' must be specified");if(t==="boolean")return e.compress=(i,r)=>`cat ${i} | gzip -c9 > ${r}`;if(t!=="function"){if(t!=="string")throw new Error(`Don't know how to handle 'options.compress' type: ${t}`);if(n!=="gzip")throw new Error(`Don't know how to handle compression method: ${n}`)}},history:t=>{if(t!=="string")throw new Error(`Don't know how to handle 'options.history' type: ${t}`)},path:(t,e,n)=>{if(t!=="string")throw new Error(`Don't know how to handle 'options.path' type: ${t}`);n[n.length-1]!==path.sep&&(e.path=n+path.sep);}};});var Jv=g((yn,Vv)=>{var wu=_("crypto");yn=Vv.exports=rr;function rr(t,e){return e=Hv(t,e),gP(t,e)}yn.sha1=function(t){return rr(t)};yn.keys=function(t){return rr(t,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})};yn.MD5=function(t){return rr(t,{algorithm:"md5",encoding:"hex"})};yn.keysMD5=function(t){return rr(t,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var si=wu.getHashes?wu.getHashes().slice():["sha1","md5"];si.push("passthrough");var Mv=["buffer","hex","binary","base64"];function Hv(t,e){e=e||{};var n={};if(n.algorithm=e.algorithm||"sha1",n.encoding=e.encoding||"hex",n.excludeValues=!!e.excludeValues,n.algorithm=n.algorithm.toLowerCase(),n.encoding=n.encoding.toLowerCase(),n.ignoreUnknown=e.ignoreUnknown===!0,n.respectType=e.respectType!==!1,n.respectFunctionNames=e.respectFunctionNames!==!1,n.respectFunctionProperties=e.respectFunctionProperties!==!1,n.unorderedArrays=e.unorderedArrays===!0,n.unorderedSets=e.unorderedSets!==!1,n.unorderedObjects=e.unorderedObjects!==!1,n.replacer=e.replacer||void 0,n.excludeKeys=e.excludeKeys||void 0,typeof t>"u")throw new Error("Object argument required.");for(var i=0;i<si.length;++i)si[i].toLowerCase()===n.algorithm.toLowerCase()&&(n.algorithm=si[i]);if(si.indexOf(n.algorithm)===-1)throw new Error('Algorithm "'+n.algorithm+'" not supported. supported values: '+si.join(", "));if(Mv.indexOf(n.encoding)===-1&&n.algorithm!=="passthrough")throw new Error('Encoding "'+n.encoding+'" not supported. supported values: '+Mv.join(", "));return n}function Wv(t){if(typeof t!="function")return !1;var e=/^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i;return e.exec(Function.prototype.toString.call(t))!=null}function gP(t,e){var n;e.algorithm!=="passthrough"?n=wu.createHash(e.algorithm):n=new Gv,typeof n.write>"u"&&(n.write=n.update,n.end=n.update);var i=Su(e,n);if(i.dispatch(t),n.update||n.end(""),n.digest)return n.digest(e.encoding==="buffer"?void 0:e.encoding);var r=n.read();return e.encoding==="buffer"?r:r.toString(e.encoding)}yn.writeToStream=function(t,e,n){return typeof n>"u"&&(n=e,e={}),e=Hv(t,e),Su(e,n).dispatch(t)};function Su(t,e,n){n=n||[];var i=function(r){return e.update?e.update(r,"utf8"):e.write(r,"utf8")};return {dispatch:function(r){t.replacer&&(r=t.replacer(r));var o=typeof r;return r===null&&(o="null"),this["_"+o](r)},_object:function(r){var o=/\[object (.*)\]/i,a=Object.prototype.toString.call(r),s=o.exec(a);s?s=s[1]:s="unknown:["+a+"]",s=s.toLowerCase();var c=null;if((c=n.indexOf(r))>=0)return this.dispatch("[CIRCULAR:"+c+"]");if(n.
(see https://github.com/puleos/object-hash/issues/26)
Use "options.replacer" or "options.ignoreUnknown"
`)},_domwindow:function(){return i("domwindow")},_bigint:function(r){return i("bigint:"+r.toString())},_process:function(){return i("process")},_timer:function(){return i("timer")},_pipe:function(){return i("pipe")},_tcp:function(){return i("tcp")},_udp:function(){return i("udp")},_tty:function(){return i("tty")},_statwatcher:function(){return i("statwatcher")},_securecontext:function(){return i("securecontext")},_connection:function(){return i("connection")},_zlib:function(){return i("zlib")},_context:function(){return i("context")},_nodescript:function(){return i("nodescript")},_httpparser:function(){return i("httpparser")},_dataview:function(){return i("dataview")},_signal:function(){return i("signal")},_fsevent:function(){return i("fsevent")},_tlswrap:function(){return i("tlswrap")}}}function Gv(){return {buf:"",write:function(t){this.buf+=t;},end:function(t){this.buf+=t;},read:function(){return this.buf}}}});var Yv=g((NN,Kv)=>{Kv.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 Zv=g(Qo=>{Qo.byteLength=bP;Qo.toByteArray=SP;Qo.fromByteArray=OP;var mt=[],$e=[],vP=typeof Uint8Array<"u"?Uint8Array:Array,Eu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(xn=0,Xv=Eu.length;xn<Xv;++xn)mt[xn]=Eu[xn],$e[Eu.charCodeAt(xn)]=xn;var xn,Xv;$e["-".charCodeAt(0)]=62;$e["_".charCodeAt(0)]=63;function Qv(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");n===-1&&(n=e);var i=n===e?0:4-n%4;return [n,i]}function bP(t){var e=Qv(t),n=e[0],i=e[1];return (n+i)*3/4-i}function wP(t,e,n){return (e+n)*3/4-n}function SP(t){var e,n=Qv(t),i=n[0],r=n[1],o=new vP(wP(t,i,r)),a=0,s=r>0?i-4:i,c;for(c=0;c<s;c+=4)e=$e[t.charCodeAt(c)]<<18|$e[t.charCodeAt(c+1)]<<12|$e[t.charCodeAt(c+2)]<<6|$e[t.charCodeAt(c+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=e&255;return r===2&&(e=$e[t.charCodeAt(c)]<<2|$e[t.charCodeAt(c+1)]>>4,o[a++]=e&255),r===1&&(e=$e[t.charCodeAt(c)]<<10|$e[t.charCodeAt(c+1)]<<4|$e[t.charCodeAt(c+2)]>>2,o[a++]=e>>8&255,o[a++]=e&255),o}function EP(t){return mt[t>>18&63]+mt[t>>12&63]+mt[t>>6&63]+mt[t&63]}function AP(t,e,n){for(var i,r=[],o=e;o<n;o+=3)i=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),r.push(EP(i));return r.join("")}function OP(t){for(var e,n=t.length,i=n%3,r=[],o=16383,a=0,s=n-i;a<s;a+=o)r.push(AP(t,a,a+o>s?s:a+o));return i===1?(e=t[n-1],r.push(mt[e>>2]+mt[e<<4&63]+"==")):i===2&&(e=(t[n-2]<<8)+t[n-1],r.push(mt[e>>10]+mt[e>>4&63]+mt[e<<2&63]+"=")),r.join("")}});var eb=g(Au=>{Au.read=function(t,e,n,i,r){var o,a,s=r*8-i-1,c=(1<<s)-1,l=c>>1,u=-7,p=n?r-1:0,h=n?-1:1,f=t[e+p];for(p+=h,o=f&(1<<-u)-1,f>>=-u,u+=s;u>0;o=o*256+t[e+p],p+=h,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=i;u>0;a=a*256+t[e+p],p+=h,u-=8);if(o===0)o=1-l;else {if(o===c)return a?NaN:(f?-1:1)*(1/0);a=a+Math.pow(2,i),o=o-l;}return (f?-1:1)*a*Math.pow(2,o-i)};Au.write=function(t,e,n,i,r,o){var a,s,c,l=o*8-r-1,u=(1<<l)-1,p=u>>1,h=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:o-1,d=i?1:-1,y=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+p>=1?e+=h/c:e+=h*Math.pow(2,1-p),e*c>=2&&(a++,c/=2),a+p>=u?(s=0,a=u):a+p>=1?(s=(e*c-1)*Math.pow(2,r),a=a+p):(s=e*Math.pow(2,p-1)*Math.pow(2,r),a=0));r>=8;t[n+f]=s&255,f+=d,s/=256,r-=8);for(a=a<<r|s,l+=r;l>0;t[n+f]=a&255,f+=d,a/=256,l-=8);t[n+f-d]|=y*128;};});var xb=g(pi=>{var Ou=Zv(),ui=eb(),tb=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;pi.Buffer=S;pi.SlowBuffer=FP;pi.INSPECT_MAX_BYTES=50;var Zo=2147483647;pi.kMaxLength=Zo;S.TYPED_ARRAY_SUPPORT=RP();!S.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 RP(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.set
`).forEach(function(a){r=a.indexOf(":"),n=a.substring(0,r).trim().toLowerCase(),i=a.substring(r+1).trim(),!(!n||e[n]&&nO[n])&&(n==="set-cookie"?e[n]?e[n].push(i):e[n]=[i]:e[n]=e[n]?e[n]+", "+i:i);}),e};var Cm=Symbol("internals");function Ri(t){return t&&String(t).trim().toLowerCase()}function Qr(t){return t===!1||t==null?t:x.isArray(t)?t.map(Qr):String(t)}function iO(t){let e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,i;for(;i=n.exec(t);)e[i[1]]=i[2];return e}var rO=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function js(t,e,n,i,r){if(x.isFunction(i))return i.call(this,e,n);if(r&&(e=n),!!x.isString(e)){if(x.isString(i))return e.indexOf(i)!==-1;if(x.isRegExp(i))return i.test(e)}}function oO(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,i)=>n.toUpperCase()+i)}function aO(t,e){let n=x.toCamelCase(" "+e);["get","set","has"].forEach(i=>{Object.defineProperty(t,i+n,{value:function(r,o,a){return this[i].call(this,e,r,o,a)},configurable:!0});});}var Bn=class{constructor(e){e&&this.set(e);}set(e,n,i){let r=this;function o(s,c,l){let u=Ri(c);if(!u)throw new Error("header name must be a non-empty string");let p=x.findKey(r,u);(!p||r[p]===void 0||l===!0||l===void 0&&r[p]!==!1)&&(r[p||c]=Qr(s));}let a=(s,c)=>x.forEach(s,(l,u)=>o(l,u,c));return x.isPlainObject(e)||e instanceof this.constructor?a(e,n):x.isString(e)&&(e=e.trim())&&!rO(e)?a(km(e),n):e!=null&&o(n,e,i),this}get(e,n){if(e=Ri(e),e){let i=x.findKey(this,e);if(i){let r=this[i];if(!n)return r;if(n===!0)return iO(r);if(x.isFunction(n))return n.call(this,r,i);if(x.isRegExp(n))return n.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=Ri(e),e){let i=x.findKey(this,e);return !!(i&&this[i]!==void 0&&(!n||js(this,this[i],i,n)))}return !1}delete(e,n){let i=this,r=!1;function o(a){if(a=Ri(a),a){let s=x.findKey(i,a);s&&(!n||js(i,i[s],s,n))&&(delete i[s],r=!0);}}return x.isArray(e)?e.forEach(o):o(e),r}clear(e){let n=Object.keys(this),i=n.length,r=!1;for(;i--;){let o=n[i];(!e||js(this,this[o],o,e,!0))&&(delete this[o],r=!0);}return r}normalize(e){let n=this,i={};return x.forEach(this,(r,o)=>{let a=x.findKey(i,o);if(a){n[a]=Qr(r),delete n[o];return}let s=e?oO(o):String(o).trim();s!==o&&delete n[o],n[s]=Qr(r),i[s]=!0;}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let n=Object.create(null);return x.forEach(this,(i,r)=>{i!=null&&i!==!1&&(n[r]=e&&x.isArray(i)?i.join(", "):i);}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
`)}get[Symbol.toStringTag](){return "AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){let i=new this(e);return n.forEach(r=>i.set(r)),i}static accessor(e){let i=(this[Cm]=this[Cm]={accessors:{}}).accessors,r=this.prototype;function o(a){let s=Ri(a);i[s]||(aO(r,a),i[s]=!0);}return x.isArray(e)?e.forEach(o):o(e),this}};Bn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);x.freezeMethods(Bn.prototype);x.freezeMethods(Bn);var ne=Bn;function Ti(t,e){let n=this||jn,i=e||n,r=ne.from(i.headers),o=i.data;return x.forEach(t,function(s){o=s.call(n,o,r.normalize(),e?e.status:void 0);}),r.normalize(),o}function ki(t){return !!(t&&t.__CANCEL__)}function _m(t,e,n){C.call(this,t??"canceled",C.ERR_CANCELED,e,n),this.name="CanceledError";}x.inherits(_m,C,{__CANCEL__:!0});var He=_m;function _t(t,e,n){let i=n.config.validateStatus;!n.status||!i||i(n.status)?t(n):e(new C("Request failed with status code "+n.status,[C.ERR_BAD_REQUEST,C.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n));}function Bs(t){return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Is(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}function Qt(t,e){return t&&!Bs(e)?Is(t,e):e}var rh=tt(Pm(),1),oh=tt(Km(),1);var nn="1.4.0";function Pi(t){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}var zO=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function Ws(t,e,n){let i=n&&n.Blob||te.classes.Blob,r=Pi(t);if(e===void 0&&i&&(e=!0),r==="data"){t=r.length?t.slice(r.length+1):t;let o=zO.exec(t);if(!o)throw new C("Invalid URL",C.ERR_INVALID_URL);let a=o[1],s=o[2],c=o[3],l=Buffer.from(decodeURIComponent(c),s?"base64":"utf8");if(e){if(!i)throw new C("Blob is not supported",C.ERR_NOT_SUPPORT);return new i([l],{type:a})}return l}throw new C("Unsupported protocol "+r,C.ERR_NOT_SUPPORT)}function $O(t,e){let n=0,i=1e3/e,r=null;return function(a,s){let c=Date.now();if(a||c-n>i)return r&&(clearTimeout(r),r=null),n=c,t.apply(null,s);r||(r=setTimeout(()=>(r=null,n=Date.now(),t.apply(null,s)),i-(c-n)));}}var Ym=$O;function MO(t,e){t=t||10;let n=new Array(t),i=new Array(t),r=0,o=0,a;return e=e!==void 0?e:1e3,function(c){let l=Date.now(),u=i[o];a||(a=l),n[r]=c,i[r]=l;let p=o,h=0;for(;p!==r;)h+=n[p++],p=p%t;if(r=(r+1)%t,r===o&&(o=(o+1)%t),l-a<e)return;let f=u&&l-u;return f?Math.round(h*1e3/f):void 0}}var io=MO;var ro=Symbol("internals"),Hs=class extends Un__default.default.Transform{constructor(e){e=x.toFlatObject(e,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(s,c)=>!x.isUndefined(c[s])),super({readableHighWaterMark:e.chunkSize});let n=this,i=this[ro]={length:e.length,timeWindow:e.timeWindow,ticksRate:e.ticksRate,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null},r=io(i.ticksRate*e.samplesCount,i.timeWindow);this.on("newListener",s=>{s==="progress"&&(i.isCaptured||(i.isCaptured=!0));});let o=0;i.updateProgress=Ym(function(){let c=i.length,l=i.bytesSeen,u=l-o;if(!u||n.destroyed)return;let p=r(u);o=l,process.nextTick(()=>{n.emit("progress",{loaded:l,total:c,progress:c?l/c:void 0,bytes:u,rate:p||void 0,estimated:p&&c&&l<=c?(c-l)/p:void 0});});},i.ticksRate);let a=()=>{i.updateProgress(!0);};this.once("end",a),this.once("error",a);}_read(e){let n=this[ro];return n.onReadCallback&&n.onReadCallback(),super._read(e)}_transform(e,n,i){let r=this,o=this[ro],a=o.maxRate,s=this.readableHighWaterMark,c=o.timeWindow,l=1e3/c,u=a/l,p=o.minChunkSize!==!1?Math.max(o.minChunkSize,u*.01):0;function h(d,y){let v=Buffer.byteLength(d);o.bytesSeen+=v,o.bytes+=v,o.isCaptured&&o.updateProgress(),r.push(d)?process.nextTick(y):o.onReadCallback=()=>{o.onReadCallback=null,process.nextTick(y);};}let f=(d,y)=>{let v=Buffer.byteLength(d),b=null,w=s,A,O=0;if(a){let k=Date.now();(!o.ts||(O=k-o.ts)>=c)&&(o.ts=k,A=u-o.bytes,o.bytes=A<0?-A:0,O=0),A=u-o.bytes;}if(a){if(A<=0)return setTimeout(()=>{y(null,d);},c-O);A<w&&(w=A);}w&&v>w&&v-w>p&&(b=d.s
`,KO=qi.encode(Ft),YO=2,Vs=class{constructor(e,n){let{escapeName:i}=this.constructor,r=x.isString(n),o=`Content-Disposition: form-data; name="${i(e)}"${!r&&n.name?`; filename="${i(n.name)}"`:""}${Ft}`;r?n=qi.encode(String(n).replace(/\r?\n|\r\n?/g,Ft)):o+=`Content-Type: ${n.type||"application/octet-stream"}${Ft}`,this.headers=qi.encode(o+Ft),this.contentLength=r?n.byteLength:n.size,this.size=this.headers.byteLength+this.contentLength+YO,this.name=e,this.value=n;}async*encode(){yield this.headers;let{value:e}=this;x.isTypedArray(e)?yield e:yield*oo(e),yield KO;}static escapeName(e){return String(e).replace(/[\r\n"]/g,n=>({"\r":"%0D","\n":"%0A",'"':"%22"})[n])}},XO=(t,e,n)=>{let{tag:i="form-data-boundary",size:r=25,boundary:o=i+"-"+x.generateString(r,JO)}=n||{};if(!x.isFormData(t))throw TypeError("FormData instance required");if(o.length<1||o.length>70)throw Error("boundary must be 10-70 characters long");let a=qi.encode("--"+o+Ft),s=qi.encode("--"+o+"--"+Ft+Ft),c=s.byteLength,l=Array.from(t.entries()).map(([p,h])=>{let f=new Vs(p,h);return c+=f.size,f});c+=a.byteLength*l.length,c=x.toFiniteNumber(c);let u={"Content-Type":`multipart/form-data; boundary=${o}`};return Number.isFinite(c)&&(u["Content-Length"]=c),e&&e(u),Un.Readable.from(async function*(){for(let p of l)yield a,yield*p.encode();yield s;}())},Qm=XO;var Js=class extends Un__default.default.Transform{__transform(e,n,i){this.push(e),i();}_transform(e,n,i){if(e.length!==0&&(this._transform=this.__transform,e[0]!==120)){let r=Buffer.alloc(2);r[0]=120,r[1]=156,this.push(r,n);}this.__transform(e,n,i);}},Zm=Js;var ZO=(t,e)=>x.isAsyncFn(t)?function(...n){let i=n.pop();t.apply(this,n).then(r=>{try{e?i(null,...e(r)):i(null,r);}catch(o){i(o);}},i);}:t,eh=ZO;var th={flush:Pt__default.default.constants.Z_SYNC_FLUSH,finishFlush:Pt__default.default.constants.Z_SYNC_FLUSH},rR={flush:Pt__default.default.constants.BROTLI_OPERATION_FLUSH,finishFlush:Pt__default.default.constants.BROTLI_OPERATION_FLUSH},nh=x.isFunction(Pt__default.default.createBrotliDecompress),{http:oR,https:aR}=oh.default,sR=/https:?/,ih=te.protocols.map(t=>t+":");function cR(t){t.beforeRedirects.proxy&&t.beforeRedirects.proxy(t),t.beforeRedirects.config&&t.beforeRedirects.config(t);}function ah(t,e,n){let i=e;if(!i&&i!==!1){let r=(0, rh.getProxyForUrl)(n);r&&(i=new URL(r));}if(i){if(i.username&&(i.auth=(i.username||"")+":"+(i.password||"")),i.auth){(i.auth.username||i.auth.password)&&(i.auth=(i.auth.username||"")+":"+(i.auth.password||""));let o=Buffer.from(i.auth,"utf8").toString("base64");t.headers["Proxy-Authorization"]="Basic "+o;}t.headers.host=t.hostname+(t.port?":"+t.port:"");let r=i.hostname||i.host;t.hostname=r,t.host=r,t.port=i.port,t.path=n,i.protocol&&(t.protocol=i.protocol.includes(":")?i.protocol:`${i.protocol}:`);}t.beforeRedirects.proxy=function(o){ah(o,e,o.href);};}var uR=typeof process<"u"&&x.kindOf(process)==="process",lR=t=>new Promise((e,n)=>{let i,r,o=(c,l)=>{r||(r=!0,i&&i(c,l));},a=c=>{o(c),e(c);},s=c=>{o(c,!0),n(c);};t(a,s,c=>i=c).catch(s);}),sh=uR&&function(e){return lR(async function(i,r,o){let{data:a,lookup:s,family:c}=e,{responseType:l,responseEncoding:u}=e,p=e.method.toUpperCase(),h,f=!1,d;s&&x.isAsyncFn(s)&&(s=eh(s,T=>{if(x.isString(T))T=[T,T.indexOf(".")<0?6:4];else if(!x.isArray(T))throw new TypeError("lookup async function must return an array [ip: string, family: number]]");return T}));let y=new iR__default.default,v=()=>{e.cancelToken&&e.cancelToken.unsubscribe(b),e.signal&&e.signal.removeEventListener("abort",b),y.removeAllListeners();};o((T,P)=>{h=!0,P&&(f=!0,v());});function b(T){y.emit("abort",!T||T.type?new He(null,e,d):T);}y.once("abort",r),(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(b),e.signal&&(e.signal.aborted?b():e.signal.addEventListener("abort",b)));let w=Qt(e.baseURL,e.url),A=new URL(w,"http://localhost"),O=A.protocol||ih[0];if(O==="data:"){let T;if(p!=="GET")return _t(i,r,{status:405,statusText:"method not allowed",headers:{},config:e});try{T=Ws(e.url,l==="blob",{Blob:e.env&&e.env.Blob});}catch(P){throw C.from(P,C.ERR_BAD_REQUEST,e)}retur
`)?this.buffer="":this.buffer=i.pop();for(let r of i){let o=null;try{o=JSON.parse(r);}catch(a){this.logger.error({error:a},`Failed to parse request: ${r}`);continue}this.logger.debug({request:o},"Received request"),this.handleRequest(o).then(a=>{this.sendResponse(a),this.logger.debug({response:a},"Sent response");});}}}async handleRequest(e){let n=[0,null];try{if(!this.agent)throw new Error(`Agent not bound.
`);n[0]=e[0];let i=e[1].func;if(i==="cancelRequest")n[1]=this.cancelRequest(e);else {let r=this.agent[i];if(!r)throw new Error(`Unknown function: ${i}`);let o=r.apply(this.agent,e[1].args);typeof o=="object"&&typeof o.then=="function"?(this.ongoingRequests[e[0]]=o,n[1]=await o,delete this.ongoingRequests[e[0]]):n[1]=o;}}catch(i){this.logger.error({error:i},`Failed to handle request: ${JSON.stringify(e)}`);}finally{return n}}cancelRequest(e){let n=this.ongoingRequests[e[1].args[0]];return n?(n instanceof Ne&&n.cancel(),delete this.ongoingRequests[e[1].args[0]],!0):!1}sendResponse(e){this.outStream.write(JSON.stringify(e)+`
`);}bind(e){this.agent=e;for(let n of kb)this.agent.on(n,i=>{this.sendResponse([0,i]);});}listen(){this.inStream.on("data",this.handleInput.bind(this));}};var Cb=new ia;ar.create().then(t=>{Cb.bind(t);});Cb.listen();
2023-05-29 02:09:44 +00:00
/*! Bundled license information:
mime-db/index.js:
(*!
* mime-db
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015-2022 Douglas Christopher Wilson
* MIT Licensed
*)
mime-types/index.js:
(*!
* mime-types
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*)
ieee754/index.js:
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
buffer/index.js:
(*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*)
*/
//# sourceMappingURL=out.js.map
2023-06-06 14:25:31 +00:00
//# sourceMappingURL=cli.js.map