storeconfig 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var Jg=Object.create;var Ss=Object.defineProperty;var Zg=Object.getOwnPropertyDescriptor;var Xg=Object.getOwnPropertyNames;var Qg=Object.getPrototypeOf,em=Object.prototype.hasOwnProperty;var m=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var rm=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Xg(r))!em.call(e,i)&&i!==t&&Ss(e,i,{get:()=>r[i],enumerable:!(n=Zg(r,i))||n.enumerable});return e};var L=(e,r,t)=>(t=e!=null?Jg(Qg(e)):{},rm(r||!e||!e.__esModule?Ss(t,"default",{value:e,enumerable:!0}):t,e));var Zi=m((Ji,Os)=>{(function(e,r){"use strict";typeof define=="function"&&define.amd?define("stackframe",[],r):typeof Ji=="object"?Os.exports=r():e.StackFrame=r()})(Ji,function(){"use strict";function e(S){return!isNaN(parseFloat(S))&&isFinite(S)}function r(S){return S.charAt(0).toUpperCase()+S.substring(1)}function t(S){return function(){return this[S]}}var n=["isConstructor","isEval","isNative","isToplevel"],i=["columnNumber","lineNumber"],a=["fileName","functionName","source"],s=["args"],u=["evalOrigin"],d=n.concat(i,a,s,u);function h(S){if(S)for(var g=0;g<d.length;g++)S[d[g]]!==void 0&&this["set"+r(d[g])](S[d[g]])}h.prototype={getArgs:function(){return this.args},setArgs:function(S){if(Object.prototype.toString.call(S)!=="[object Array]")throw new TypeError("Args must be an Array");this.args=S},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(S){if(S instanceof h)this.evalOrigin=S;else if(S instanceof Object)this.evalOrigin=new h(S);else throw new TypeError("Eval Origin must be an Object or StackFrame")},toString:function(){var S=this.getFileName()||"",g=this.getLineNumber()||"",w=this.getColumnNumber()||"",T=this.getFunctionName()||"";return this.getIsEval()?S?"[eval] ("+S+":"+g+":"+w+")":"[eval]:"+g+":"+w:T?T+" ("+S+":"+g+":"+w+")":S+":"+g+":"+w}},h.fromString=function(g){var w=g.indexOf("("),T=g.lastIndexOf(")"),D=g.substring(0,w),$=g.substring(w+1,T).split(","),P=g.substring(T+1);if(P.indexOf("@")===0)var C=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(P,""),z=C[1],Y=C[2],B=C[3];return new h({functionName:D,args:$||void 0,fileName:z,lineNumber:Y||void 0,columnNumber:B||void 0})};for(var y=0;y<n.length;y++)h.prototype["get"+r(n[y])]=t(n[y]),h.prototype["set"+r(n[y])]=(function(S){return function(g){this[S]=!!g}})(n[y]);for(var b=0;b<i.length;b++)h.prototype["get"+r(i[b])]=t(i[b]),h.prototype["set"+r(i[b])]=(function(S){return function(g){if(!e(g))throw new TypeError(S+" must be a Number");this[S]=Number(g)}})(i[b]);for(var _=0;_<a.length;_++)h.prototype["get"+r(a[_])]=t(a[_]),h.prototype["set"+r(a[_])]=(function(S){return function(g){this[S]=String(g)}})(a[_]);return h})});var As=m((Xi,Ps)=>{(function(e,r){"use strict";typeof define=="function"&&define.amd?define("error-stack-parser",["stackframe"],r):typeof Xi=="object"?Ps.exports=r(Zi()):e.ErrorStackParser=r(e.StackFrame)})(Xi,function(r){"use strict";var t=/(^|@)\S+:\d+/,n=/^\s*at .*(\S+:\d+|\(native\))/m,i=/^(eval@)?(\[native code])?$/;return{parse:function(s){if(typeof s.stacktrace<"u"||typeof s["opera#sourceloc"]<"u")return this.parseOpera(s);if(s.stack&&s.stack.match(n))return this.parseV8OrIE(s);if(s.stack)return this.parseFFOrSafari(s);throw new Error("Cannot parse given Error object")},extractLocation:function(s){if(s.indexOf(":")===-1)return[s];var u=/(.+?)(?::(\d+))?(?::(\d+))?$/,d=u.exec(s.replace(/[()]/g,""));return[d[1],d[2]||void 0,d[3]||void 0]},parseV8OrIE:function(s){var u=s.stack.split(`
2
+ "use strict";var Xg=Object.create;var Ps=Object.defineProperty;var Qg=Object.getOwnPropertyDescriptor;var em=Object.getOwnPropertyNames;var rm=Object.getPrototypeOf,tm=Object.prototype.hasOwnProperty;var m=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var nm=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of em(r))!tm.call(e,i)&&i!==t&&Ps(e,i,{get:()=>r[i],enumerable:!(n=Qg(r,i))||n.enumerable});return e};var C=(e,r,t)=>(t=e!=null?Xg(rm(e)):{},nm(r||!e||!e.__esModule?Ps(t,"default",{value:e,enumerable:!0}):t,e));var Xi=m((Zi,Ts)=>{(function(e,r){"use strict";typeof define=="function"&&define.amd?define("stackframe",[],r):typeof Zi=="object"?Ts.exports=r():e.StackFrame=r()})(Zi,function(){"use strict";function e(S){return!isNaN(parseFloat(S))&&isFinite(S)}function r(S){return S.charAt(0).toUpperCase()+S.substring(1)}function t(S){return function(){return this[S]}}var n=["isConstructor","isEval","isNative","isToplevel"],i=["columnNumber","lineNumber"],a=["fileName","functionName","source"],s=["args"],u=["evalOrigin"],d=n.concat(i,a,s,u);function h(S){if(S)for(var g=0;g<d.length;g++)S[d[g]]!==void 0&&this["set"+r(d[g])](S[d[g]])}h.prototype={getArgs:function(){return this.args},setArgs:function(S){if(Object.prototype.toString.call(S)!=="[object Array]")throw new TypeError("Args must be an Array");this.args=S},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(S){if(S instanceof h)this.evalOrigin=S;else if(S instanceof Object)this.evalOrigin=new h(S);else throw new TypeError("Eval Origin must be an Object or StackFrame")},toString:function(){var S=this.getFileName()||"",g=this.getLineNumber()||"",w=this.getColumnNumber()||"",T=this.getFunctionName()||"";return this.getIsEval()?S?"[eval] ("+S+":"+g+":"+w+")":"[eval]:"+g+":"+w:T?T+" ("+S+":"+g+":"+w+")":S+":"+g+":"+w}},h.fromString=function(g){var w=g.indexOf("("),T=g.lastIndexOf(")"),D=g.substring(0,w),$=g.substring(w+1,T).split(","),P=g.substring(T+1);if(P.indexOf("@")===0)var L=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(P,""),z=L[1],Y=L[2],B=L[3];return new h({functionName:D,args:$||void 0,fileName:z,lineNumber:Y||void 0,columnNumber:B||void 0})};for(var y=0;y<n.length;y++)h.prototype["get"+r(n[y])]=t(n[y]),h.prototype["set"+r(n[y])]=(function(S){return function(g){this[S]=!!g}})(n[y]);for(var b=0;b<i.length;b++)h.prototype["get"+r(i[b])]=t(i[b]),h.prototype["set"+r(i[b])]=(function(S){return function(g){if(!e(g))throw new TypeError(S+" must be a Number");this[S]=Number(g)}})(i[b]);for(var _=0;_<a.length;_++)h.prototype["get"+r(a[_])]=t(a[_]),h.prototype["set"+r(a[_])]=(function(S){return function(g){this[S]=String(g)}})(a[_]);return h})});var xs=m((Qi,Ns)=>{(function(e,r){"use strict";typeof define=="function"&&define.amd?define("error-stack-parser",["stackframe"],r):typeof Qi=="object"?Ns.exports=r(Xi()):e.ErrorStackParser=r(e.StackFrame)})(Qi,function(r){"use strict";var t=/(^|@)\S+:\d+/,n=/^\s*at .*(\S+:\d+|\(native\))/m,i=/^(eval@)?(\[native code])?$/;return{parse:function(s){if(typeof s.stacktrace<"u"||typeof s["opera#sourceloc"]<"u")return this.parseOpera(s);if(s.stack&&s.stack.match(n))return this.parseV8OrIE(s);if(s.stack)return this.parseFFOrSafari(s);throw new Error("Cannot parse given Error object")},extractLocation:function(s){if(s.indexOf(":")===-1)return[s];var u=/(.+?)(?::(\d+))?(?::(\d+))?$/,d=u.exec(s.replace(/[()]/g,""));return[d[1],d[2]||void 0,d[3]||void 0]},parseV8OrIE:function(s){var u=s.stack.split(`
3
3
  `).filter(function(d){return!!d.match(n)},this);return u.map(function(d){d.indexOf("(eval ")>-1&&(d=d.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var h=d.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),y=h.match(/ (\(.+\)$)/);h=y?h.replace(y[0],""):h;var b=this.extractLocation(y?y[1]:h),_=y&&h||void 0,S=["eval","<anonymous>"].indexOf(b[0])>-1?void 0:b[0];return new r({functionName:_,fileName:S,lineNumber:b[1],columnNumber:b[2],source:d})},this)},parseFFOrSafari:function(s){var u=s.stack.split(`
4
4
  `).filter(function(d){return!d.match(i)},this);return u.map(function(d){if(d.indexOf(" > eval")>-1&&(d=d.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),d.indexOf("@")===-1&&d.indexOf(":")===-1)return new r({functionName:d});var h=/((.*".+"[^@]*)?[^@]*)(?:@)/,y=d.match(h),b=y&&y[1]?y[1]:void 0,_=this.extractLocation(d.replace(h,""));return new r({functionName:b,fileName:_[0],lineNumber:_[1],columnNumber:_[2],source:d})},this)},parseOpera:function(s){return!s.stacktrace||s.message.indexOf(`
5
5
  `)>-1&&s.message.split(`
@@ -7,62 +7,62 @@
7
7
  `).length?this.parseOpera9(s):s.stack?this.parseOpera11(s):this.parseOpera10(s)},parseOpera9:function(s){for(var u=/Line (\d+).*script (?:in )?(\S+)/i,d=s.message.split(`
8
8
  `),h=[],y=2,b=d.length;y<b;y+=2){var _=u.exec(d[y]);_&&h.push(new r({fileName:_[2],lineNumber:_[1],source:d[y]}))}return h},parseOpera10:function(s){for(var u=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,d=s.stacktrace.split(`
9
9
  `),h=[],y=0,b=d.length;y<b;y+=2){var _=u.exec(d[y]);_&&h.push(new r({functionName:_[3]||void 0,fileName:_[2],lineNumber:_[1],source:d[y]}))}return h},parseOpera11:function(s){var u=s.stack.split(`
10
- `).filter(function(d){return!!d.match(t)&&!d.match(/^Error created at/)},this);return u.map(function(d){var h=d.split("@"),y=this.extractLocation(h.pop()),b=h.shift()||"",_=b.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,S;b.match(/\(([^)]*)\)/)&&(S=b.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var g=S===void 0||S==="[arguments not available]"?void 0:S.split(",");return new r({functionName:_,args:g,fileName:y[0],lineNumber:y[1],columnNumber:y[2],source:d})},this)}}})});var Ns=m((vE,Ts)=>{Ts.exports=tm;function tm(e){switch(Object.prototype.toString.call(e)){case"[object Error]":return!0;case"[object Exception]":return!0;case"[object DOMException]":return!0;default:return e instanceof Error}}});var Ms=m((Qi,xs)=>{(function(e,r){"use strict";typeof define=="function"&&define.amd?define("stack-generator",["stackframe"],r):typeof Qi=="object"?xs.exports=r(Zi()):e.StackGenerator=r(e.StackFrame)})(Qi,function(e){return{backtrace:function(t){var n=[],i=10;typeof t=="object"&&typeof t.maxStackSize=="number"&&(i=t.maxStackSize);for(var a=arguments.callee;a&&n.length<i&&a.arguments;){for(var s=new Array(a.arguments.length),u=0;u<s.length;++u)s[u]=a.arguments[u];/function(?:\s+([\w$]+))+\s*\(/.test(a.toString())?n.push(new e({functionName:RegExp.$1||void 0,args:s})):n.push(new e({args:s}));try{a=a.caller}catch{break}}return n}}})});var Ds=m((bE,Is)=>{Is.exports=Rs;function Rs(e,r){if(e&&r)return Rs(e)(r);if(typeof e!="function")throw new TypeError("need wrapper function");return Object.keys(e).forEach(function(n){t[n]=e[n]}),t;function t(){for(var n=new Array(arguments.length),i=0;i<n.length;i++)n[i]=arguments[i];var a=e.apply(this,n),s=n[n.length-1];return typeof a=="function"&&a!==s&&Object.keys(s).forEach(function(u){a[u]=s[u]}),a}}});var ra=m((_E,ea)=>{var Cs=Ds();ea.exports=Cs(cn);ea.exports.strict=Cs(Ls);cn.proto=cn(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return cn(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return Ls(this)},configurable:!0})});function cn(e){var r=function(){return r.called?r.value:(r.called=!0,r.value=e.apply(this,arguments))};return r.called=!1,r}function Ls(e){var r=function(){if(r.called)throw new Error(r.onceError);return r.called=!0,r.value=e.apply(this,arguments)},t=e.name||"Function wrapped with `once`";return r.onceError=t+" shouldn't be called more than once",r.called=!1,r}});var Us=m((wE,$s)=>{var nm=ra(),im=function(){},am=global.Bare?queueMicrotask:process.nextTick.bind(process),om=function(e){return e.setHeader&&typeof e.abort=="function"},sm=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},qs=function(e,r,t){if(typeof r=="function")return qs(e,null,r);r||(r={}),t=nm(t||im);var n=e._writableState,i=e._readableState,a=r.readable||r.readable!==!1&&e.readable,s=r.writable||r.writable!==!1&&e.writable,u=!1,d=function(){e.writable||h()},h=function(){s=!1,a||t.call(e)},y=function(){a=!1,s||t.call(e)},b=function(T){t.call(e,T?new Error("exited with error code: "+T):null)},_=function(T){t.call(e,T)},S=function(){am(g)},g=function(){if(!u){if(a&&!(i&&i.ended&&!i.destroyed))return t.call(e,new Error("premature close"));if(s&&!(n&&n.ended&&!n.destroyed))return t.call(e,new Error("premature close"))}},w=function(){e.req.on("finish",h)};return om(e)?(e.on("complete",h),e.on("abort",S),e.req?w():e.on("request",w)):s&&!n&&(e.on("end",d),e.on("close",d)),sm(e)&&e.on("exit",b),e.on("end",y),e.on("finish",h),r.error!==!1&&e.on("error",_),e.on("close",S),function(){u=!0,e.removeListener("complete",h),e.removeListener("abort",S),e.removeListener("request",w),e.req&&e.req.removeListener("finish",h),e.removeListener("end",d),e.removeListener("close",d),e.removeListener("finish",h),e.removeListener("exit",b),e.removeListener("end",y),e.removeListener("error",_),e.removeListener("close",S)}};$s.exports=qs});var ks=m((EE,Fs)=>{var um=ra(),lm=Us(),fn;try{fn=require("fs")}catch{}var vt=function(){},cm=typeof process>"u"?!1:/^v?\.0/.test(process.version),dn=function(e){return typeof e=="function"},fm=function(e){return!cm||!fn?!1:(e instanceof(fn.ReadStream||vt)||e instanceof(fn.WriteStream||vt))&&dn(e.close)},dm=function(e){return e.setHeader&&dn(e.abort)},pm=function(e,r,t,n){n=um(n);var i=!1;e.on("close",function(){i=!0}),lm(e,{readable:r,writable:t},function(s){if(s)return n(s);i=!0,n()});var a=!1;return function(s){if(!i&&!a){if(a=!0,fm(e))return e.close(vt);if(dm(e))return e.abort();if(dn(e.destroy))return e.destroy();n(s||new Error("stream was destroyed"))}}},js=function(e){e()},hm=function(e,r){return e.pipe(r)},gm=function(){var e=Array.prototype.slice.call(arguments),r=dn(e[e.length-1]||vt)&&e.pop()||vt;if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new Error("pump requires two streams per minimum");var t,n=e.map(function(i,a){var s=a<e.length-1,u=a>0;return pm(i,s,u,function(d){t||(t=d),d&&n.forEach(js),!s&&(n.forEach(js),r(t))})});return e.reduce(hm)};Fs.exports=gm});var Bs=m((SE,Jr)=>{var ta=require("stream"),mm=require("util"),ym=require("timers");Jr.exports=function(e,r){return Jr.exports.createStream(e,r)};Jr.exports.createStream=function(e,r){return e?zs(e,r):new or(r)};Jr.exports.createLineStream=function(e){return console.log("WARNING: byline#createLineStream is deprecated and will be removed soon"),zs(e)};function zs(e,r){if(!e)throw new Error("expected readStream");if(!e.readable)throw new Error("readStream must be readable");var t=new or(r);return e.pipe(t),t}Jr.exports.LineStream=or;function or(e){ta.Transform.call(this,e),e=e||{},this._readableState.objectMode=!0,this._lineBuffer=[],this._keepEmptyLines=e.keepEmptyLines||!1,this._lastChunkEndedWithCR=!1;var r=this;this.on("pipe",function(t){r.encoding||t instanceof ta.Readable&&(r.encoding=t._readableState.encoding)})}mm.inherits(or,ta.Transform);or.prototype._transform=function(e,r,t){r=r||"utf8",Buffer.isBuffer(e)&&(r=="buffer"?(e=e.toString(),r="utf8"):e=e.toString(r)),this._chunkEncoding=r;var n=e.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/g);this._lastChunkEndedWithCR&&e[0]==`
11
- `&&n.shift(),this._lineBuffer.length>0&&(this._lineBuffer[this._lineBuffer.length-1]+=n[0],n.shift()),this._lastChunkEndedWithCR=e[e.length-1]=="\r",this._lineBuffer=this._lineBuffer.concat(n),this._pushBuffer(r,1,t)};or.prototype._pushBuffer=function(e,r,t){for(;this._lineBuffer.length>r;){var n=this._lineBuffer.shift();if((this._keepEmptyLines||n.length>0)&&!this.push(this._reencode(n,e))){var i=this;ym.setImmediate(function(){i._pushBuffer(e,r,t)});return}}t()};or.prototype._flush=function(e){this._pushBuffer(this._chunkEncoding,0,e)};or.prototype._reencode=function(e,r){return this.encoding&&this.encoding!=r?new Buffer(e,r).toString(this.encoding):this.encoding?e:new Buffer(e,r)}});var Gs=m((Hs,na)=>{(function(e){if(typeof Hs=="object"&&typeof na<"u")na.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var r;typeof window<"u"?r=window:typeof global<"u"?r=global:typeof self<"u"?r=self:r=this,r.bugsnag=e()}})(function(){var e,r,t,n=(function(){function o(f,l,p,v){v===void 0&&(v=new Date),this.type=p,this.message=f,this.metadata=l,this.timestamp=v}var c=o.prototype;return c.toJSON=function(){return{type:this.type,name:this.message,timestamp:this.timestamp,metaData:this.metadata}},o})(),i=n,a=["navigation","request","process","log","user","state","error","manual"],s=function(o,c,f){for(var l=f,p=0,v=o.length;p<v;p++)l=c(l,o[p],p,o);return l},u=function(o,c){return s(o,function(f,l,p,v){return c(l,p,v)?f.concat(l):f},[])},d=function(o,c){return s(o,function(f,l,p,v){return f===!0||l===c},!1)},h=function(o){return Object.prototype.toString.call(o)==="[object Array]"},y=!{toString:null}.propertyIsEnumerable("toString"),b=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],_=function(o){var c=[],f;for(f in o)Object.prototype.hasOwnProperty.call(o,f)&&c.push(f);if(!y)return c;for(var l=0,p=b.length;l<p;l++)Object.prototype.hasOwnProperty.call(o,b[l])&&c.push(b[l]);return c},S=function(o,c){return o===void 0&&(o=1),c===void 0&&(c=1/0),function(f){return typeof f=="number"&&parseInt(""+f,10)===f&&f>=o&&f<=c}},g=function(o){return typeof o=="function"||h(o)&&u(o,function(c){return typeof c=="function"}).length===o.length},w=function(o){return typeof o=="string"&&!!o.length},T={},D=function(){return{unhandledExceptions:!0,unhandledRejections:!0}};T.schema={apiKey:{defaultValue:function(){return null},message:"is required",validate:w},appVersion:{defaultValue:function(){},message:"should be a string",validate:function(o){return o===void 0||w(o)}},appType:{defaultValue:function(){},message:"should be a string",validate:function(o){return o===void 0||w(o)}},autoDetectErrors:{defaultValue:function(){return!0},message:"should be true|false",validate:function(o){return o===!0||o===!1}},enabledErrorTypes:{defaultValue:function(){return D()},message:"should be an object containing the flags { unhandledExceptions:true|false, unhandledRejections:true|false }",allowPartialObject:!0,validate:function(o){if(typeof o!="object"||!o)return!1;var c=_(o),f=_(D());return!(u(c,function(l){return d(f,l)}).length<c.length||u(_(o),function(l){return typeof o[l]!="boolean"}).length>0)}},onError:{defaultValue:function(){return[]},message:"should be a function or array of functions",validate:g},onSession:{defaultValue:function(){return[]},message:"should be a function or array of functions",validate:g},onBreadcrumb:{defaultValue:function(){return[]},message:"should be a function or array of functions",validate:g},endpoints:{defaultValue:function(o){return typeof o>"u"?{notify:"https://notify.bugsnag.com",sessions:"https://sessions.bugsnag.com"}:{notify:null,sessions:null}},message:"should be an object containing endpoint URLs { notify, sessions }",validate:function(o){return o&&typeof o=="object"&&w(o.notify)&&w(o.sessions)&&u(_(o),function(c){return!d(["notify","sessions"],c)}).length===0}},autoTrackSessions:{defaultValue:function(o){return!0},message:"should be true|false",validate:function(o){return o===!0||o===!1}},enabledReleaseStages:{defaultValue:function(){return null},message:"should be an array of strings",validate:function(o){return o===null||h(o)&&u(o,function(c){return typeof c=="string"}).length===o.length}},releaseStage:{defaultValue:function(){return"production"},message:"should be a string",validate:function(o){return typeof o=="string"&&o.length}},maxBreadcrumbs:{defaultValue:function(){return 25},message:"should be a number \u2264100",validate:function(o){return S(0,100)(o)}},enabledBreadcrumbTypes:{defaultValue:function(){return a},message:"should be null or a list of available breadcrumb types ("+a.join(",")+")",validate:function(o){return o===null||h(o)&&s(o,function(c,f){return c===!1?c:d(a,f)},!0)}},context:{defaultValue:function(){},message:"should be a string",validate:function(o){return o===void 0||typeof o=="string"}},user:{defaultValue:function(){return{}},message:"should be an object with { id, email, name } properties",validate:function(o){return o===null||o&&s(_(o),function(c,f){return c&&d(["id","email","name"],f)},!0)}},metadata:{defaultValue:function(){return{}},message:"should be an object",validate:function(o){return typeof o=="object"&&o!==null}},logger:{defaultValue:function(){},message:"should be null or an object with methods { debug, info, warn, error }",validate:function(o){return!o||o&&s(["debug","info","warn","error"],function(c,f){return c&&typeof o[f]=="function"},!0)}},redactedKeys:{defaultValue:function(){return["password"]},message:"should be an array of strings|regexes",validate:function(o){return h(o)&&o.length===u(o,function(c){return typeof c=="string"||c&&typeof c.test=="function"}).length}},plugins:{defaultValue:function(){return[]},message:"should be an array of plugin objects",validate:function(o){return h(o)&&o.length===u(o,function(c){return c&&typeof c=="object"&&typeof c.load=="function"}).length}},featureFlags:{defaultValue:function(){return[]},message:'should be an array of objects that have a "name" property',validate:function(o){return h(o)&&o.length===u(o,function(c){return c&&typeof c=="object"&&typeof c.name=="string"}).length}},reportUnhandledPromiseRejectionsAsHandled:{defaultValue:function(){return!1},message:"should be true|false",validate:function(o){return o===!0||o===!1}},sendPayloadChecksums:{defaultValue:function(){return!1},message:"should be true|false",validate:function(o){return o===!0||o===!1}}};var $=As(),P=function(o){for(var c=1;c<arguments.length;c++){var f=arguments[c];for(var l in f)Object.prototype.hasOwnProperty.call(f,l)&&(o[l]=f[l])}return o},C=function(o,c){return s(o,function(f,l,p,v){return f.concat(c(l,p,v))},[])},z=function(o,c,f,l){var p=l&&l.redactedKeys?l.redactedKeys:[],v=l&&l.redactedPaths?l.redactedPaths:[];return JSON.stringify(R(o,p,v),c,f)},Y=20,B=25e3,G=8,U="...";function Z(o){return o instanceof Error||/^\[object (Error|(Dom)?Exception)\]$/.test(Object.prototype.toString.call(o))}function ne(o){return"[Throws: "+(o?o.message:"?")+"]"}function te(o,c){for(var f=0,l=o.length;f<l;f++)if(o[f]===c)return!0;return!1}function ce(o,c){for(var f=0,l=o.length;f<l;f++)if(c.indexOf(o[f])===0)return!0;return!1}function fe(o,c){for(var f=0,l=o.length;f<l;f++)if(typeof o[f]=="string"&&o[f].toLowerCase()===c.toLowerCase()||o[f]&&typeof o[f].test=="function"&&o[f].test(c))return!0;return!1}function $e(o){return Object.prototype.toString.call(o)==="[object Array]"}function O(o,c){try{return o[c]}catch(f){return ne(f)}}function R(o,c,f){var l=[],p=0;function v(E,x){function M(){return x.length>G&&p>B}if(p++,x.length>Y||M())return U;if(E===null||typeof E!="object")return E;if(te(l,E))return"[Circular]";if(l.push(E),typeof E.toJSON=="function")try{p--;var j=v(E.toJSON(),x);return l.pop(),j}catch(Kr){return ne(Kr)}var H=Z(E);if(H){p--;var pe=v({name:E.name,message:E.message},x);return l.pop(),pe}if($e(E)){for(var ye=[],ar=0,De=E.length;ar<De;ar++){if(M()){ye.push(U);break}ye.push(v(E[ar],x.concat("[]")))}return l.pop(),ye}var Vr={};try{for(var We in E)if(Object.prototype.hasOwnProperty.call(E,We)){if(ce(f,x.join("."))&&fe(c,We)){Vr[We]="[REDACTED]";continue}if(M()){Vr[We]=U;break}Vr[We]=v(O(E,We),x.concat(We))}}catch{}return l.pop(),Vr}return v(o,[])}function V(o,c,f,l){if(typeof f=="string"){l===void 0?l=null:l!==null&&typeof l!="string"&&(l=z(l));var p=c[f];if(typeof p=="number"){o[p]={name:f,variant:l};return}o.push({name:f,variant:l}),c[f]=o.length-1}}function ue(o,c,f){if(h(c)){for(var l=0;l<c.length;++l){var p=c[l];p===null||typeof p!="object"||V(o,f,p.name,p.variant)}return o}}function q(o){return C(u(o,Boolean),function(c){var f=c.name,l=c.variant,p={featureFlag:f};return typeof l=="string"&&(p.variant=l),p})}function _e(o,c,f){var l=c[f];typeof l=="number"&&(o[l]=null,delete c[f])}var de={add:V,clear:_e,merge:ue,toEventApi:q},Ne=function(o){return!!o&&(!!o.stack||!!o.stacktrace||!!o["opera#sourceloc"])&&typeof(o.stack||o.stacktrace||o["opera#sourceloc"])=="string"&&o.stack!==o.name+": "+o.message},Ue=Ns(),Br=function(o,c,f,l){var p;if(c){var v;if(f===null)return Hr(o,c);typeof f=="object"&&(v=f),typeof f=="string"&&(v=(p={},p[f]=l,p)),v&&(c==="__proto__"||c==="constructor"||c==="prototype"||(o[c]||(o[c]={}),o[c]=P({},o[c],v)))}},er=function(o,c,f){if(typeof c=="string"){if(!f)return o[c];if(o[c])return o[c][f]}},Hr=function(o,c,f){if(typeof c=="string"){if(!f){delete o[c];return}c==="__proto__"||c==="constructor"||c==="prototype"||o[c]&&delete o[c][f]}},ie={add:Br,get:er,clear:Hr};function rr(){return rr=Object.assign?Object.assign.bind():function(o){for(var c=1;c<arguments.length;c++){var f=arguments[c];for(var l in f)({}).hasOwnProperty.call(f,l)&&(o[l]=f[l])}return o},rr.apply(null,arguments)}var ht=Ms(),Se=(function(){function o(f,l,p,v,E){p===void 0&&(p=[]),v===void 0&&(v=tr()),this.apiKey=void 0,this.context=void 0,this.groupingHash=void 0,this.originalError=E,this._handledState=v,this.severity=this._handledState.severity,this.unhandled=this._handledState.unhandled,this.app={},this.device={},this.request={},this.breadcrumbs=[],this.threads=[],this._metadata={},this._features=[],this._featuresIndex={},this._user={},this._session=void 0,this._correlation=void 0,this._groupingDiscriminator=void 0,this.errors=[nr(f,l,o.__type,p)]}var c=o.prototype;return c.addMetadata=function(l,p,v){return ie.add(this._metadata,l,p,v)},c.setTraceCorrelation=function(l,p){typeof l=="string"&&(this._correlation=rr({traceId:l},typeof p=="string"?{spanId:p}:{}))},c.getGroupingDiscriminator=function(){return this._groupingDiscriminator},c.setGroupingDiscriminator=function(l){var p=this._groupingDiscriminator;return(typeof l=="string"||l===null||l===void 0)&&(this._groupingDiscriminator=l),p},c.getMetadata=function(l,p){return ie.get(this._metadata,l,p)},c.clearMetadata=function(l,p){return ie.clear(this._metadata,l,p)},c.addFeatureFlag=function(l,p){p===void 0&&(p=null),de.add(this._features,this._featuresIndex,l,p)},c.addFeatureFlags=function(l){de.merge(this._features,l,this._featuresIndex)},c.getFeatureFlags=function(){return de.toEventApi(this._features)},c.clearFeatureFlag=function(l){de.clear(this._features,this._featuresIndex,l)},c.clearFeatureFlags=function(){this._features=[],this._featuresIndex={}},c.getUser=function(){return this._user},c.setUser=function(l,p,v){this._user={id:l,email:p,name:v}},c.toJSON=function(){return{payloadVersion:"4",exceptions:C(this.errors,function(l){return P({},l,{message:l.errorMessage})}),severity:this.severity,unhandled:this._handledState.unhandled,severityReason:this._handledState.severityReason,app:this.app,device:this.device,request:this.request,breadcrumbs:this.breadcrumbs,context:this.context,groupingHash:this.groupingHash,groupingDiscriminator:this._groupingDiscriminator,metaData:this._metadata,user:this._user,session:this._session,featureFlags:this.getFeatureFlags(),correlation:this._correlation}},o})(),Gr=function(o){var c={file:o.fileName,method:Re(o.functionName),lineNumber:o.lineNumber,columnNumber:o.columnNumber,code:void 0,inProject:void 0};return c.lineNumber>-1&&!c.file&&!c.method&&(c.file="global code"),c},Re=function(o){return/^global code$/i.test(o)?"global code":o},tr=function(){return{unhandled:!1,severity:"warning",severityReason:{type:"handledException"}}},Zt=function(o){return typeof o=="string"?o:""};function nr(o,c,f,l){return{errorClass:Zt(o),errorMessage:Zt(c),type:f,stacktrace:s(l,function(p,v){var E=Gr(v);try{return JSON.stringify(E)==="{}"?p:p.concat(E)}catch{return p}},[])}}function Ge(o){return o.cause?[o].concat(Ge(o.cause)):[o]}Se.getStacktrace=function(o,c,f){if(Ne(o))return $.parse(o).slice(c);try{return u(ht.backtrace(),function(l){return(l.functionName||"").indexOf("StackGenerator$$")===-1}).slice(1+f)}catch{return[]}},Se.create=function(o,c,f,l,p,v){p===void 0&&(p=0);var E=Xt(o,c,l,v),x=E[0],M=E[1],j;try{var H=Se.getStacktrace(x,M>0?1+M+p:0,1+p);j=new Se(x.name,x.message,H,f,o)}catch{j=new Se(x.name,x.message,[],f,o)}if(x.name==="InvalidError"&&j.addMetadata(""+l,"non-error parameter",Wr(o)),x.cause){var pe,ye=Ge(x).slice(1),ar=C(ye,function(De){var Vr=Ue(De)&&Ne(De)?$.parse(De):[],We=Xt(De,!0,"error cause"),Kr=We[0];return Kr.name==="InvalidError"&&j.addMetadata("error cause",Wr(De)),nr(Kr.name,Kr.message,Se.__type,Vr)});(pe=j.errors).push.apply(pe,ar)}return j};var Wr=function(o){return o===null?"null":o===void 0?"undefined":o},Xt=function(o,c,f,l){var p,v=0,E=function(x){var M=f==="error cause"?"was":"received";l&&l.warn(f+" "+M+' a non-error: "'+x+'"');var j=new Error(f+" "+M+' a non-error. See "'+f+'" tab for more detail.');return j.name="InvalidError",j};if(!c)Ue(o)?p=o:(p=E(typeof o),v+=2);else switch(typeof o){case"string":case"number":case"boolean":p=new Error(String(o)),v+=1;break;case"function":p=E("function"),v+=2;break;case"object":o!==null&&Ue(o)?p=o:o!==null&&Qt(o)?(p=new Error(o.message||o.errorMessage),p.name=o.name||o.errorClass,v+=1):(p=E(o===null?"null":"unsupported object"),v+=2);break;default:p=E("nothing"),v+=2}if(!Ne(p))try{throw p}catch(x){Ne(x)&&(p=x,v=1)}return[p,v]};Se.__type="browserjs";var Qt=function(o){return(typeof o.name=="string"||typeof o.errorClass=="string")&&(typeof o.message=="string"||typeof o.errorMessage=="string")},en=Se,Ih=function(o,c,f){var l=0,p=function(){if(l>=o.length)return f(null,!0);c(o[l],function(v,E){if(v)return f(v);if(E===!1)return f(null,!1);l++,p()})};p()},Dh=function(o,c,f,l){var p=function(v,E){if(typeof v!="function")return E(null);try{if(v.length!==2){var x=v(c);return x&&typeof x.then=="function"?x.then(function(M){return setTimeout(function(){return E(null,M)})},function(M){setTimeout(function(){return f(M),E(null,!0)})}):E(null,x)}v(c,function(M,j){if(M)return f(M),E(null);E(null,j)})}catch(M){f(M),E(null)}};Ih(o,p,l)},qi=function(o,c,f,l){for(var p=!1,v=o.slice();!p&&v.length;)try{p=v.pop()(c)===!1}catch(E){l.error("Error occurred in "+f+" callback, continuing anyway\u2026"),l.error(E)}return p},rn=function(c,f){var l="000000000"+c;return l.substr(l.length-f)},Ch=require("os");function Lh(){try{return Ch.hostname()}catch{return process.env._CLUSTER_NETWORK_NAME_||process.env.COMPUTERNAME||"hostname"}}var ss=2,qh=rn(process.pid.toString(36),ss),us=Lh(),$h=us.length,Uh=rn(us.split("").reduce(function(o,c){return+o+c.charCodeAt(0)},+$h+36).toString(36),ss),ls=function(){return qh+Uh},jh=function(c){return typeof c=="string"&&/^c[a-z0-9]{20,32}$/.test(c)},gt=0,$i=4,tn=36,cs=Math.pow(tn,$i);function fs(){return rn((Math.random()*cs<<0).toString(tn),$i)}function Fh(){return gt=gt<cs?gt:0,gt++,gt-1}function Ui(){var o="c",c=new Date().getTime().toString(tn),f=rn(Fh().toString(tn),$i),l=ls(),p=fs()+fs();return o+c+f+l+p}Ui.fingerprint=ls,Ui.isCuid=jh;var kh=Ui,zh=(function(){function o(){this.id=kh(),this.startedAt=new Date,this._handled=0,this._unhandled=0,this._user={},this.app={},this.device={}}var c=o.prototype;return c.getUser=function(){return this._user},c.setUser=function(l,p,v){this._user={id:l,email:p,name:v}},c.toJSON=function(){return{id:this.id,startedAt:this.startedAt,events:{handled:this._handled,unhandled:this._unhandled}}},c._track=function(l){this[l._handledState.unhandled?"_unhandled":"_handled"]+=1},o})(),ji=zh,Bh=de.add,Hh=de.clear,Fi=de.merge,Gh="00000",Wh="https://notify.insighthub.smartbear.com",Yh="https://sessions.insighthub.smartbear.com",ir=function(){},Vh=(function(){function o(f,l,p,v){var E=this;l===void 0&&(l=T.schema),p===void 0&&(p=[]),this._notifier=v,this._config={},this._schema=l,this._delivery={sendSession:ir,sendEvent:ir},this._logger={debug:ir,info:ir,warn:ir,error:ir},this._plugins={},this._breadcrumbs=[],this._session=null,this._metadata={},this._featuresIndex={},this._features=[],this._context=void 0,this._user={},this._groupingDiscriminator=void 0,this._cbs={e:[],s:[],sp:[],b:[]},this.Client=o,this.Event=en,this.Breadcrumb=i,this.Session=ji,this._config=this._configure(f,p),C(p.concat(this._config.plugins),function(j){j&&E._loadPlugin(j)}),this._depth=1;var x=this,M=this.notify;this.notify=function(){return M.apply(x,arguments)}}var c=o.prototype;return c.addMetadata=function(l,p,v){return ie.add(this._metadata,l,p,v)},c.getMetadata=function(l,p){return ie.get(this._metadata,l,p)},c.clearMetadata=function(l,p){return ie.clear(this._metadata,l,p)},c.addFeatureFlag=function(l,p){p===void 0&&(p=null),Bh(this._features,this._featuresIndex,l,p)},c.addFeatureFlags=function(l){Fi(this._features,l,this._featuresIndex)},c.clearFeatureFlag=function(l){Hh(this._features,this._featuresIndex,l)},c.clearFeatureFlags=function(){this._features=[],this._featuresIndex={}},c.getContext=function(){return this._context},c.setContext=function(l){this._context=l},c.getGroupingDiscriminator=function(){return this._groupingDiscriminator},c.setGroupingDiscriminator=function(l){var p=this._groupingDiscriminator;return(typeof l=="string"||l===null||l===void 0)&&(this._groupingDiscriminator=l),p},c._configure=function(l,p){var v=s(p,function(j,H){return H&&H.configSchema?P({},j,H.configSchema):j},this._schema);l.endpoints||(l.sendPayloadChecksums="sendPayloadChecksums"in l?l.sendPayloadChecksums:!0);var E=s(_(v),function(j,H){var pe=v[H].defaultValue(l[H]);if(l[H]!==void 0){var ye=v[H].validate(l[H]);ye?v[H].allowPartialObject?j.config[H]=P(pe,l[H]):j.config[H]=l[H]:(j.errors[H]=v[H].message,j.config[H]=pe)}else j.config[H]=pe;return j},{errors:{},config:{}}),x=E.errors,M=E.config;if(v.apiKey){if(!M.apiKey)throw new Error("No Bugsnag API Key set");/^[0-9a-f]{32}$/i.test(M.apiKey)||(x.apiKey="should be a string of 32 hexadecimal characters"),l.endpoints===void 0&&M.apiKey.startsWith(Gh)&&(M.endpoints={notify:Wh,sessions:Yh})}return this._metadata=P({},M.metadata),Fi(this._features,M.featureFlags,this._featuresIndex),this._user=P({},M.user),this._context=M.context,M.logger&&(this._logger=M.logger),M.onError&&(this._cbs.e=this._cbs.e.concat(M.onError)),M.onBreadcrumb&&(this._cbs.b=this._cbs.b.concat(M.onBreadcrumb)),M.onSession&&(this._cbs.s=this._cbs.s.concat(M.onSession)),_(x).length&&this._logger.warn(Kh(x,l)),M},c.getUser=function(){return this._user},c.setUser=function(l,p,v){this._user={id:l,email:p,name:v}},c._loadPlugin=function(l){var p=l.load(this);l.name&&(this._plugins["~"+l.name+"~"]=p)},c.getPlugin=function(l){return this._plugins["~"+l+"~"]},c._setDelivery=function(l){this._delivery=l(this)},c.startSession=function(){var l=new ji;l.app.releaseStage=this._config.releaseStage,l.app.version=this._config.appVersion,l.app.type=this._config.appType,l._user=P({},this._user);var p=qi(this._cbs.s,l,"onSession",this._logger);return p?(this._logger.debug("Session not started due to onSession callback"),this):this._sessionDelegate.startSession(this,l)},c.addOnError=function(l,p){p===void 0&&(p=!1),this._cbs.e[p?"unshift":"push"](l)},c.removeOnError=function(l){this._cbs.e=u(this._cbs.e,function(p){return p!==l})},c._addOnSessionPayload=function(l){this._cbs.sp.push(l)},c.addOnSession=function(l){this._cbs.s.push(l)},c.removeOnSession=function(l){this._cbs.s=u(this._cbs.s,function(p){return p!==l})},c.addOnBreadcrumb=function(l,p){p===void 0&&(p=!1),this._cbs.b[p?"unshift":"push"](l)},c.removeOnBreadcrumb=function(l){this._cbs.b=u(this._cbs.b,function(p){return p!==l})},c.pauseSession=function(){return this._sessionDelegate.pauseSession(this)},c.resumeSession=function(){return this._sessionDelegate.resumeSession(this)},c.leaveBreadcrumb=function(l,p,v){if(l=typeof l=="string"?l:"",v=typeof v=="string"&&d(a,v)?v:"manual",p=typeof p=="object"&&p!==null?p:{},!!l){var E=new i(l,p,v),x=qi(this._cbs.b,E,"onBreadcrumb",this._logger);if(x){this._logger.debug("Breadcrumb not attached due to onBreadcrumb callback");return}this._breadcrumbs.push(E),this._breadcrumbs.length>this._config.maxBreadcrumbs&&(this._breadcrumbs=this._breadcrumbs.slice(this._breadcrumbs.length-this._config.maxBreadcrumbs))}},c._isBreadcrumbTypeEnabled=function(l){var p=this._config.enabledBreadcrumbTypes;return p===null||d(p,l)},c.notify=function(l,p,v){v===void 0&&(v=ir);var E=en.create(l,!0,void 0,"notify()",this._depth+1,this._logger);this._notify(E,p,v)},c._notify=function(l,p,v){var E=this;if(v===void 0&&(v=ir),l.app=P({},l.app,{releaseStage:this._config.releaseStage,version:this._config.appVersion,type:this._config.appType}),l.context=l.context||this._context,l._metadata=P({},l._metadata,this._metadata),l._user=P({},l._user,this._user),l.breadcrumbs=this._breadcrumbs.slice(),l.setGroupingDiscriminator(this._groupingDiscriminator),Fi(l._features,this._features,l._featuresIndex),this._config.enabledReleaseStages!==null&&!d(this._config.enabledReleaseStages,this._config.releaseStage))return this._logger.warn("Event not sent due to releaseStage/enabledReleaseStages configuration"),v(null,l);var x=l.severity,M=function(H){E._logger.error("Error occurred in onError callback, continuing anyway\u2026"),E._logger.error(H)},j=[].concat(this._cbs.e).concat(p);Dh(j,l,M,function(H,pe){if(H&&M(H),!pe)return E._logger.debug("Event not sent due to onError callback"),v(null,l);E._isBreadcrumbTypeEnabled("error")&&o.prototype.leaveBreadcrumb.call(E,l.errors[0].errorClass,{errorClass:l.errors[0].errorClass,errorMessage:l.errors[0].errorMessage,severity:l.severity},"error"),x!==l.severity&&(l._handledState.severityReason={type:"userCallbackSetSeverity"}),l.unhandled!==l._handledState.unhandled&&(l._handledState.severityReason.unhandledOverridden=!0,l._handledState.unhandled=l.unhandled),E._session&&(E._session._track(l),l._session=E._session),E._delivery.sendEvent({apiKey:l.apiKey||E._config.apiKey,notifier:E._notifier,events:[l]},function(ye){return v(ye,l)})})},o})(),Kh=function(o,c){var f=new Error(`Invalid configuration
12
- `+C(_(o),function(l){return" - "+l+" "+o[l]+", got "+Jh(c[l])}).join(`
10
+ `).filter(function(d){return!!d.match(t)&&!d.match(/^Error created at/)},this);return u.map(function(d){var h=d.split("@"),y=this.extractLocation(h.pop()),b=h.shift()||"",_=b.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,S;b.match(/\(([^)]*)\)/)&&(S=b.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var g=S===void 0||S==="[arguments not available]"?void 0:S.split(",");return new r({functionName:_,args:g,fileName:y[0],lineNumber:y[1],columnNumber:y[2],source:d})},this)}}})});var Rs=m((_E,Ms)=>{Ms.exports=im;function im(e){switch(Object.prototype.toString.call(e)){case"[object Error]":return!0;case"[object Exception]":return!0;case"[object DOMException]":return!0;default:return e instanceof Error}}});var Ds=m((ea,Is)=>{(function(e,r){"use strict";typeof define=="function"&&define.amd?define("stack-generator",["stackframe"],r):typeof ea=="object"?Is.exports=r(Xi()):e.StackGenerator=r(e.StackFrame)})(ea,function(e){return{backtrace:function(t){var n=[],i=10;typeof t=="object"&&typeof t.maxStackSize=="number"&&(i=t.maxStackSize);for(var a=arguments.callee;a&&n.length<i&&a.arguments;){for(var s=new Array(a.arguments.length),u=0;u<s.length;++u)s[u]=a.arguments[u];/function(?:\s+([\w$]+))+\s*\(/.test(a.toString())?n.push(new e({functionName:RegExp.$1||void 0,args:s})):n.push(new e({args:s}));try{a=a.caller}catch{break}}return n}}})});var qs=m((wE,Ls)=>{Ls.exports=Cs;function Cs(e,r){if(e&&r)return Cs(e)(r);if(typeof e!="function")throw new TypeError("need wrapper function");return Object.keys(e).forEach(function(n){t[n]=e[n]}),t;function t(){for(var n=new Array(arguments.length),i=0;i<n.length;i++)n[i]=arguments[i];var a=e.apply(this,n),s=n[n.length-1];return typeof a=="function"&&a!==s&&Object.keys(s).forEach(function(u){a[u]=s[u]}),a}}});var ta=m((EE,ra)=>{var $s=qs();ra.exports=$s(cn);ra.exports.strict=$s(Us);cn.proto=cn(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return cn(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return Us(this)},configurable:!0})});function cn(e){var r=function(){return r.called?r.value:(r.called=!0,r.value=e.apply(this,arguments))};return r.called=!1,r}function Us(e){var r=function(){if(r.called)throw new Error(r.onceError);return r.called=!0,r.value=e.apply(this,arguments)},t=e.name||"Function wrapped with `once`";return r.onceError=t+" shouldn't be called more than once",r.called=!1,r}});var ks=m((SE,Fs)=>{var am=ta(),om=function(){},sm=global.Bare?queueMicrotask:process.nextTick.bind(process),um=function(e){return e.setHeader&&typeof e.abort=="function"},lm=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},js=function(e,r,t){if(typeof r=="function")return js(e,null,r);r||(r={}),t=am(t||om);var n=e._writableState,i=e._readableState,a=r.readable||r.readable!==!1&&e.readable,s=r.writable||r.writable!==!1&&e.writable,u=!1,d=function(){e.writable||h()},h=function(){s=!1,a||t.call(e)},y=function(){a=!1,s||t.call(e)},b=function(T){t.call(e,T?new Error("exited with error code: "+T):null)},_=function(T){t.call(e,T)},S=function(){sm(g)},g=function(){if(!u){if(a&&!(i&&i.ended&&!i.destroyed))return t.call(e,new Error("premature close"));if(s&&!(n&&n.ended&&!n.destroyed))return t.call(e,new Error("premature close"))}},w=function(){e.req.on("finish",h)};return um(e)?(e.on("complete",h),e.on("abort",S),e.req?w():e.on("request",w)):s&&!n&&(e.on("end",d),e.on("close",d)),lm(e)&&e.on("exit",b),e.on("end",y),e.on("finish",h),r.error!==!1&&e.on("error",_),e.on("close",S),function(){u=!0,e.removeListener("complete",h),e.removeListener("abort",S),e.removeListener("request",w),e.req&&e.req.removeListener("finish",h),e.removeListener("end",d),e.removeListener("close",d),e.removeListener("finish",h),e.removeListener("exit",b),e.removeListener("end",y),e.removeListener("error",_),e.removeListener("close",S)}};Fs.exports=js});var Hs=m((OE,Bs)=>{var cm=ta(),fm=ks(),fn;try{fn=require("fs")}catch{}var vt=function(){},dm=typeof process>"u"?!1:/^v?\.0/.test(process.version),dn=function(e){return typeof e=="function"},pm=function(e){return!dm||!fn?!1:(e instanceof(fn.ReadStream||vt)||e instanceof(fn.WriteStream||vt))&&dn(e.close)},hm=function(e){return e.setHeader&&dn(e.abort)},gm=function(e,r,t,n){n=cm(n);var i=!1;e.on("close",function(){i=!0}),fm(e,{readable:r,writable:t},function(s){if(s)return n(s);i=!0,n()});var a=!1;return function(s){if(!i&&!a){if(a=!0,pm(e))return e.close(vt);if(hm(e))return e.abort();if(dn(e.destroy))return e.destroy();n(s||new Error("stream was destroyed"))}}},zs=function(e){e()},mm=function(e,r){return e.pipe(r)},ym=function(){var e=Array.prototype.slice.call(arguments),r=dn(e[e.length-1]||vt)&&e.pop()||vt;if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new Error("pump requires two streams per minimum");var t,n=e.map(function(i,a){var s=a<e.length-1,u=a>0;return gm(i,s,u,function(d){t||(t=d),d&&n.forEach(zs),!s&&(n.forEach(zs),r(t))})});return e.reduce(mm)};Bs.exports=ym});var Ws=m((PE,Jr)=>{var na=require("stream"),vm=require("util"),bm=require("timers");Jr.exports=function(e,r){return Jr.exports.createStream(e,r)};Jr.exports.createStream=function(e,r){return e?Gs(e,r):new or(r)};Jr.exports.createLineStream=function(e){return console.log("WARNING: byline#createLineStream is deprecated and will be removed soon"),Gs(e)};function Gs(e,r){if(!e)throw new Error("expected readStream");if(!e.readable)throw new Error("readStream must be readable");var t=new or(r);return e.pipe(t),t}Jr.exports.LineStream=or;function or(e){na.Transform.call(this,e),e=e||{},this._readableState.objectMode=!0,this._lineBuffer=[],this._keepEmptyLines=e.keepEmptyLines||!1,this._lastChunkEndedWithCR=!1;var r=this;this.on("pipe",function(t){r.encoding||t instanceof na.Readable&&(r.encoding=t._readableState.encoding)})}vm.inherits(or,na.Transform);or.prototype._transform=function(e,r,t){r=r||"utf8",Buffer.isBuffer(e)&&(r=="buffer"?(e=e.toString(),r="utf8"):e=e.toString(r)),this._chunkEncoding=r;var n=e.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/g);this._lastChunkEndedWithCR&&e[0]==`
11
+ `&&n.shift(),this._lineBuffer.length>0&&(this._lineBuffer[this._lineBuffer.length-1]+=n[0],n.shift()),this._lastChunkEndedWithCR=e[e.length-1]=="\r",this._lineBuffer=this._lineBuffer.concat(n),this._pushBuffer(r,1,t)};or.prototype._pushBuffer=function(e,r,t){for(;this._lineBuffer.length>r;){var n=this._lineBuffer.shift();if((this._keepEmptyLines||n.length>0)&&!this.push(this._reencode(n,e))){var i=this;bm.setImmediate(function(){i._pushBuffer(e,r,t)});return}}t()};or.prototype._flush=function(e){this._pushBuffer(this._chunkEncoding,0,e)};or.prototype._reencode=function(e,r){return this.encoding&&this.encoding!=r?new Buffer(e,r).toString(this.encoding):this.encoding?e:new Buffer(e,r)}});var Vs=m((Ys,ia)=>{(function(e){if(typeof Ys=="object"&&typeof ia<"u")ia.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var r;typeof window<"u"?r=window:typeof global<"u"?r=global:typeof self<"u"?r=self:r=this,r.bugsnag=e()}})(function(){var e,r,t,n=(function(){function o(f,l,p,v){v===void 0&&(v=new Date),this.type=p,this.message=f,this.metadata=l,this.timestamp=v}var c=o.prototype;return c.toJSON=function(){return{type:this.type,name:this.message,timestamp:this.timestamp,metaData:this.metadata}},o})(),i=n,a=["navigation","request","process","log","user","state","error","manual"],s=function(o,c,f){for(var l=f,p=0,v=o.length;p<v;p++)l=c(l,o[p],p,o);return l},u=function(o,c){return s(o,function(f,l,p,v){return c(l,p,v)?f.concat(l):f},[])},d=function(o,c){return s(o,function(f,l,p,v){return f===!0||l===c},!1)},h=function(o){return Object.prototype.toString.call(o)==="[object Array]"},y=!{toString:null}.propertyIsEnumerable("toString"),b=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],_=function(o){var c=[],f;for(f in o)Object.prototype.hasOwnProperty.call(o,f)&&c.push(f);if(!y)return c;for(var l=0,p=b.length;l<p;l++)Object.prototype.hasOwnProperty.call(o,b[l])&&c.push(b[l]);return c},S=function(o,c){return o===void 0&&(o=1),c===void 0&&(c=1/0),function(f){return typeof f=="number"&&parseInt(""+f,10)===f&&f>=o&&f<=c}},g=function(o){return typeof o=="function"||h(o)&&u(o,function(c){return typeof c=="function"}).length===o.length},w=function(o){return typeof o=="string"&&!!o.length},T={},D=function(){return{unhandledExceptions:!0,unhandledRejections:!0}};T.schema={apiKey:{defaultValue:function(){return null},message:"is required",validate:w},appVersion:{defaultValue:function(){},message:"should be a string",validate:function(o){return o===void 0||w(o)}},appType:{defaultValue:function(){},message:"should be a string",validate:function(o){return o===void 0||w(o)}},autoDetectErrors:{defaultValue:function(){return!0},message:"should be true|false",validate:function(o){return o===!0||o===!1}},enabledErrorTypes:{defaultValue:function(){return D()},message:"should be an object containing the flags { unhandledExceptions:true|false, unhandledRejections:true|false }",allowPartialObject:!0,validate:function(o){if(typeof o!="object"||!o)return!1;var c=_(o),f=_(D());return!(u(c,function(l){return d(f,l)}).length<c.length||u(_(o),function(l){return typeof o[l]!="boolean"}).length>0)}},onError:{defaultValue:function(){return[]},message:"should be a function or array of functions",validate:g},onSession:{defaultValue:function(){return[]},message:"should be a function or array of functions",validate:g},onBreadcrumb:{defaultValue:function(){return[]},message:"should be a function or array of functions",validate:g},endpoints:{defaultValue:function(o){return typeof o>"u"?{notify:"https://notify.bugsnag.com",sessions:"https://sessions.bugsnag.com"}:{notify:null,sessions:null}},message:"should be an object containing endpoint URLs { notify, sessions }",validate:function(o){return o&&typeof o=="object"&&w(o.notify)&&w(o.sessions)&&u(_(o),function(c){return!d(["notify","sessions"],c)}).length===0}},autoTrackSessions:{defaultValue:function(o){return!0},message:"should be true|false",validate:function(o){return o===!0||o===!1}},enabledReleaseStages:{defaultValue:function(){return null},message:"should be an array of strings",validate:function(o){return o===null||h(o)&&u(o,function(c){return typeof c=="string"}).length===o.length}},releaseStage:{defaultValue:function(){return"production"},message:"should be a string",validate:function(o){return typeof o=="string"&&o.length}},maxBreadcrumbs:{defaultValue:function(){return 25},message:"should be a number \u2264100",validate:function(o){return S(0,100)(o)}},enabledBreadcrumbTypes:{defaultValue:function(){return a},message:"should be null or a list of available breadcrumb types ("+a.join(",")+")",validate:function(o){return o===null||h(o)&&s(o,function(c,f){return c===!1?c:d(a,f)},!0)}},context:{defaultValue:function(){},message:"should be a string",validate:function(o){return o===void 0||typeof o=="string"}},user:{defaultValue:function(){return{}},message:"should be an object with { id, email, name } properties",validate:function(o){return o===null||o&&s(_(o),function(c,f){return c&&d(["id","email","name"],f)},!0)}},metadata:{defaultValue:function(){return{}},message:"should be an object",validate:function(o){return typeof o=="object"&&o!==null}},logger:{defaultValue:function(){},message:"should be null or an object with methods { debug, info, warn, error }",validate:function(o){return!o||o&&s(["debug","info","warn","error"],function(c,f){return c&&typeof o[f]=="function"},!0)}},redactedKeys:{defaultValue:function(){return["password"]},message:"should be an array of strings|regexes",validate:function(o){return h(o)&&o.length===u(o,function(c){return typeof c=="string"||c&&typeof c.test=="function"}).length}},plugins:{defaultValue:function(){return[]},message:"should be an array of plugin objects",validate:function(o){return h(o)&&o.length===u(o,function(c){return c&&typeof c=="object"&&typeof c.load=="function"}).length}},featureFlags:{defaultValue:function(){return[]},message:'should be an array of objects that have a "name" property',validate:function(o){return h(o)&&o.length===u(o,function(c){return c&&typeof c=="object"&&typeof c.name=="string"}).length}},reportUnhandledPromiseRejectionsAsHandled:{defaultValue:function(){return!1},message:"should be true|false",validate:function(o){return o===!0||o===!1}},sendPayloadChecksums:{defaultValue:function(){return!1},message:"should be true|false",validate:function(o){return o===!0||o===!1}}};var $=xs(),P=function(o){for(var c=1;c<arguments.length;c++){var f=arguments[c];for(var l in f)Object.prototype.hasOwnProperty.call(f,l)&&(o[l]=f[l])}return o},L=function(o,c){return s(o,function(f,l,p,v){return f.concat(c(l,p,v))},[])},z=function(o,c,f,l){var p=l&&l.redactedKeys?l.redactedKeys:[],v=l&&l.redactedPaths?l.redactedPaths:[];return JSON.stringify(R(o,p,v),c,f)},Y=20,B=25e3,G=8,U="...";function Z(o){return o instanceof Error||/^\[object (Error|(Dom)?Exception)\]$/.test(Object.prototype.toString.call(o))}function ne(o){return"[Throws: "+(o?o.message:"?")+"]"}function te(o,c){for(var f=0,l=o.length;f<l;f++)if(o[f]===c)return!0;return!1}function ce(o,c){for(var f=0,l=o.length;f<l;f++)if(c.indexOf(o[f])===0)return!0;return!1}function fe(o,c){for(var f=0,l=o.length;f<l;f++)if(typeof o[f]=="string"&&o[f].toLowerCase()===c.toLowerCase()||o[f]&&typeof o[f].test=="function"&&o[f].test(c))return!0;return!1}function $e(o){return Object.prototype.toString.call(o)==="[object Array]"}function O(o,c){try{return o[c]}catch(f){return ne(f)}}function R(o,c,f){var l=[],p=0;function v(E,x){function M(){return x.length>G&&p>B}if(p++,x.length>Y||M())return U;if(E===null||typeof E!="object")return E;if(te(l,E))return"[Circular]";if(l.push(E),typeof E.toJSON=="function")try{p--;var j=v(E.toJSON(),x);return l.pop(),j}catch(Kr){return ne(Kr)}var H=Z(E);if(H){p--;var pe=v({name:E.name,message:E.message},x);return l.pop(),pe}if($e(E)){for(var ye=[],ar=0,De=E.length;ar<De;ar++){if(M()){ye.push(U);break}ye.push(v(E[ar],x.concat("[]")))}return l.pop(),ye}var Vr={};try{for(var We in E)if(Object.prototype.hasOwnProperty.call(E,We)){if(ce(f,x.join("."))&&fe(c,We)){Vr[We]="[REDACTED]";continue}if(M()){Vr[We]=U;break}Vr[We]=v(O(E,We),x.concat(We))}}catch{}return l.pop(),Vr}return v(o,[])}function V(o,c,f,l){if(typeof f=="string"){l===void 0?l=null:l!==null&&typeof l!="string"&&(l=z(l));var p=c[f];if(typeof p=="number"){o[p]={name:f,variant:l};return}o.push({name:f,variant:l}),c[f]=o.length-1}}function ue(o,c,f){if(h(c)){for(var l=0;l<c.length;++l){var p=c[l];p===null||typeof p!="object"||V(o,f,p.name,p.variant)}return o}}function q(o){return L(u(o,Boolean),function(c){var f=c.name,l=c.variant,p={featureFlag:f};return typeof l=="string"&&(p.variant=l),p})}function _e(o,c,f){var l=c[f];typeof l=="number"&&(o[l]=null,delete c[f])}var de={add:V,clear:_e,merge:ue,toEventApi:q},Ne=function(o){return!!o&&(!!o.stack||!!o.stacktrace||!!o["opera#sourceloc"])&&typeof(o.stack||o.stacktrace||o["opera#sourceloc"])=="string"&&o.stack!==o.name+": "+o.message},Ue=Rs(),Br=function(o,c,f,l){var p;if(c){var v;if(f===null)return Hr(o,c);typeof f=="object"&&(v=f),typeof f=="string"&&(v=(p={},p[f]=l,p)),v&&(c==="__proto__"||c==="constructor"||c==="prototype"||(o[c]||(o[c]={}),o[c]=P({},o[c],v)))}},er=function(o,c,f){if(typeof c=="string"){if(!f)return o[c];if(o[c])return o[c][f]}},Hr=function(o,c,f){if(typeof c=="string"){if(!f){delete o[c];return}c==="__proto__"||c==="constructor"||c==="prototype"||o[c]&&delete o[c][f]}},ie={add:Br,get:er,clear:Hr};function rr(){return rr=Object.assign?Object.assign.bind():function(o){for(var c=1;c<arguments.length;c++){var f=arguments[c];for(var l in f)({}).hasOwnProperty.call(f,l)&&(o[l]=f[l])}return o},rr.apply(null,arguments)}var ht=Ds(),Se=(function(){function o(f,l,p,v,E){p===void 0&&(p=[]),v===void 0&&(v=tr()),this.apiKey=void 0,this.context=void 0,this.groupingHash=void 0,this.originalError=E,this._handledState=v,this.severity=this._handledState.severity,this.unhandled=this._handledState.unhandled,this.app={},this.device={},this.request={},this.breadcrumbs=[],this.threads=[],this._metadata={},this._features=[],this._featuresIndex={},this._user={},this._session=void 0,this._correlation=void 0,this._groupingDiscriminator=void 0,this.errors=[nr(f,l,o.__type,p)]}var c=o.prototype;return c.addMetadata=function(l,p,v){return ie.add(this._metadata,l,p,v)},c.setTraceCorrelation=function(l,p){typeof l=="string"&&(this._correlation=rr({traceId:l},typeof p=="string"?{spanId:p}:{}))},c.getGroupingDiscriminator=function(){return this._groupingDiscriminator},c.setGroupingDiscriminator=function(l){var p=this._groupingDiscriminator;return(typeof l=="string"||l===null||l===void 0)&&(this._groupingDiscriminator=l),p},c.getMetadata=function(l,p){return ie.get(this._metadata,l,p)},c.clearMetadata=function(l,p){return ie.clear(this._metadata,l,p)},c.addFeatureFlag=function(l,p){p===void 0&&(p=null),de.add(this._features,this._featuresIndex,l,p)},c.addFeatureFlags=function(l){de.merge(this._features,l,this._featuresIndex)},c.getFeatureFlags=function(){return de.toEventApi(this._features)},c.clearFeatureFlag=function(l){de.clear(this._features,this._featuresIndex,l)},c.clearFeatureFlags=function(){this._features=[],this._featuresIndex={}},c.getUser=function(){return this._user},c.setUser=function(l,p,v){this._user={id:l,email:p,name:v}},c.toJSON=function(){return{payloadVersion:"4",exceptions:L(this.errors,function(l){return P({},l,{message:l.errorMessage})}),severity:this.severity,unhandled:this._handledState.unhandled,severityReason:this._handledState.severityReason,app:this.app,device:this.device,request:this.request,breadcrumbs:this.breadcrumbs,context:this.context,groupingHash:this.groupingHash,groupingDiscriminator:this._groupingDiscriminator,metaData:this._metadata,user:this._user,session:this._session,featureFlags:this.getFeatureFlags(),correlation:this._correlation}},o})(),Gr=function(o){var c={file:o.fileName,method:Re(o.functionName),lineNumber:o.lineNumber,columnNumber:o.columnNumber,code:void 0,inProject:void 0};return c.lineNumber>-1&&!c.file&&!c.method&&(c.file="global code"),c},Re=function(o){return/^global code$/i.test(o)?"global code":o},tr=function(){return{unhandled:!1,severity:"warning",severityReason:{type:"handledException"}}},Zt=function(o){return typeof o=="string"?o:""};function nr(o,c,f,l){return{errorClass:Zt(o),errorMessage:Zt(c),type:f,stacktrace:s(l,function(p,v){var E=Gr(v);try{return JSON.stringify(E)==="{}"?p:p.concat(E)}catch{return p}},[])}}function Ge(o){return o.cause?[o].concat(Ge(o.cause)):[o]}Se.getStacktrace=function(o,c,f){if(Ne(o))return $.parse(o).slice(c);try{return u(ht.backtrace(),function(l){return(l.functionName||"").indexOf("StackGenerator$$")===-1}).slice(1+f)}catch{return[]}},Se.create=function(o,c,f,l,p,v){p===void 0&&(p=0);var E=Xt(o,c,l,v),x=E[0],M=E[1],j;try{var H=Se.getStacktrace(x,M>0?1+M+p:0,1+p);j=new Se(x.name,x.message,H,f,o)}catch{j=new Se(x.name,x.message,[],f,o)}if(x.name==="InvalidError"&&j.addMetadata(""+l,"non-error parameter",Wr(o)),x.cause){var pe,ye=Ge(x).slice(1),ar=L(ye,function(De){var Vr=Ue(De)&&Ne(De)?$.parse(De):[],We=Xt(De,!0,"error cause"),Kr=We[0];return Kr.name==="InvalidError"&&j.addMetadata("error cause",Wr(De)),nr(Kr.name,Kr.message,Se.__type,Vr)});(pe=j.errors).push.apply(pe,ar)}return j};var Wr=function(o){return o===null?"null":o===void 0?"undefined":o},Xt=function(o,c,f,l){var p,v=0,E=function(x){var M=f==="error cause"?"was":"received";l&&l.warn(f+" "+M+' a non-error: "'+x+'"');var j=new Error(f+" "+M+' a non-error. See "'+f+'" tab for more detail.');return j.name="InvalidError",j};if(!c)Ue(o)?p=o:(p=E(typeof o),v+=2);else switch(typeof o){case"string":case"number":case"boolean":p=new Error(String(o)),v+=1;break;case"function":p=E("function"),v+=2;break;case"object":o!==null&&Ue(o)?p=o:o!==null&&Qt(o)?(p=new Error(o.message||o.errorMessage),p.name=o.name||o.errorClass,v+=1):(p=E(o===null?"null":"unsupported object"),v+=2);break;default:p=E("nothing"),v+=2}if(!Ne(p))try{throw p}catch(x){Ne(x)&&(p=x,v=1)}return[p,v]};Se.__type="browserjs";var Qt=function(o){return(typeof o.name=="string"||typeof o.errorClass=="string")&&(typeof o.message=="string"||typeof o.errorMessage=="string")},en=Se,Ch=function(o,c,f){var l=0,p=function(){if(l>=o.length)return f(null,!0);c(o[l],function(v,E){if(v)return f(v);if(E===!1)return f(null,!1);l++,p()})};p()},Lh=function(o,c,f,l){var p=function(v,E){if(typeof v!="function")return E(null);try{if(v.length!==2){var x=v(c);return x&&typeof x.then=="function"?x.then(function(M){return setTimeout(function(){return E(null,M)})},function(M){setTimeout(function(){return f(M),E(null,!0)})}):E(null,x)}v(c,function(M,j){if(M)return f(M),E(null);E(null,j)})}catch(M){f(M),E(null)}};Ch(o,p,l)},qi=function(o,c,f,l){for(var p=!1,v=o.slice();!p&&v.length;)try{p=v.pop()(c)===!1}catch(E){l.error("Error occurred in "+f+" callback, continuing anyway\u2026"),l.error(E)}return p},rn=function(c,f){var l="000000000"+c;return l.substr(l.length-f)},qh=require("os");function $h(){try{return qh.hostname()}catch{return process.env._CLUSTER_NETWORK_NAME_||process.env.COMPUTERNAME||"hostname"}}var ls=2,Uh=rn(process.pid.toString(36),ls),cs=$h(),jh=cs.length,Fh=rn(cs.split("").reduce(function(o,c){return+o+c.charCodeAt(0)},+jh+36).toString(36),ls),fs=function(){return Uh+Fh},kh=function(c){return typeof c=="string"&&/^c[a-z0-9]{20,32}$/.test(c)},gt=0,$i=4,tn=36,ds=Math.pow(tn,$i);function ps(){return rn((Math.random()*ds<<0).toString(tn),$i)}function zh(){return gt=gt<ds?gt:0,gt++,gt-1}function Ui(){var o="c",c=new Date().getTime().toString(tn),f=rn(zh().toString(tn),$i),l=fs(),p=ps()+ps();return o+c+f+l+p}Ui.fingerprint=fs,Ui.isCuid=kh;var Bh=Ui,Hh=(function(){function o(){this.id=Bh(),this.startedAt=new Date,this._handled=0,this._unhandled=0,this._user={},this.app={},this.device={}}var c=o.prototype;return c.getUser=function(){return this._user},c.setUser=function(l,p,v){this._user={id:l,email:p,name:v}},c.toJSON=function(){return{id:this.id,startedAt:this.startedAt,events:{handled:this._handled,unhandled:this._unhandled}}},c._track=function(l){this[l._handledState.unhandled?"_unhandled":"_handled"]+=1},o})(),ji=Hh,Gh=de.add,Wh=de.clear,Fi=de.merge,Yh="00000",Vh="https://notify.insighthub.smartbear.com",Kh="https://sessions.insighthub.smartbear.com",ir=function(){},Jh=(function(){function o(f,l,p,v){var E=this;l===void 0&&(l=T.schema),p===void 0&&(p=[]),this._notifier=v,this._config={},this._schema=l,this._delivery={sendSession:ir,sendEvent:ir},this._logger={debug:ir,info:ir,warn:ir,error:ir},this._plugins={},this._breadcrumbs=[],this._session=null,this._metadata={},this._featuresIndex={},this._features=[],this._context=void 0,this._user={},this._groupingDiscriminator=void 0,this._cbs={e:[],s:[],sp:[],b:[]},this.Client=o,this.Event=en,this.Breadcrumb=i,this.Session=ji,this._config=this._configure(f,p),L(p.concat(this._config.plugins),function(j){j&&E._loadPlugin(j)}),this._depth=1;var x=this,M=this.notify;this.notify=function(){return M.apply(x,arguments)}}var c=o.prototype;return c.addMetadata=function(l,p,v){return ie.add(this._metadata,l,p,v)},c.getMetadata=function(l,p){return ie.get(this._metadata,l,p)},c.clearMetadata=function(l,p){return ie.clear(this._metadata,l,p)},c.addFeatureFlag=function(l,p){p===void 0&&(p=null),Gh(this._features,this._featuresIndex,l,p)},c.addFeatureFlags=function(l){Fi(this._features,l,this._featuresIndex)},c.clearFeatureFlag=function(l){Wh(this._features,this._featuresIndex,l)},c.clearFeatureFlags=function(){this._features=[],this._featuresIndex={}},c.getContext=function(){return this._context},c.setContext=function(l){this._context=l},c.getGroupingDiscriminator=function(){return this._groupingDiscriminator},c.setGroupingDiscriminator=function(l){var p=this._groupingDiscriminator;return(typeof l=="string"||l===null||l===void 0)&&(this._groupingDiscriminator=l),p},c._configure=function(l,p){var v=s(p,function(j,H){return H&&H.configSchema?P({},j,H.configSchema):j},this._schema);l.endpoints||(l.sendPayloadChecksums="sendPayloadChecksums"in l?l.sendPayloadChecksums:!0);var E=s(_(v),function(j,H){var pe=v[H].defaultValue(l[H]);if(l[H]!==void 0){var ye=v[H].validate(l[H]);ye?v[H].allowPartialObject?j.config[H]=P(pe,l[H]):j.config[H]=l[H]:(j.errors[H]=v[H].message,j.config[H]=pe)}else j.config[H]=pe;return j},{errors:{},config:{}}),x=E.errors,M=E.config;if(v.apiKey){if(!M.apiKey)throw new Error("No Bugsnag API Key set");/^[0-9a-f]{32}$/i.test(M.apiKey)||(x.apiKey="should be a string of 32 hexadecimal characters"),l.endpoints===void 0&&M.apiKey.startsWith(Yh)&&(M.endpoints={notify:Vh,sessions:Kh})}return this._metadata=P({},M.metadata),Fi(this._features,M.featureFlags,this._featuresIndex),this._user=P({},M.user),this._context=M.context,M.logger&&(this._logger=M.logger),M.onError&&(this._cbs.e=this._cbs.e.concat(M.onError)),M.onBreadcrumb&&(this._cbs.b=this._cbs.b.concat(M.onBreadcrumb)),M.onSession&&(this._cbs.s=this._cbs.s.concat(M.onSession)),_(x).length&&this._logger.warn(Zh(x,l)),M},c.getUser=function(){return this._user},c.setUser=function(l,p,v){this._user={id:l,email:p,name:v}},c._loadPlugin=function(l){var p=l.load(this);l.name&&(this._plugins["~"+l.name+"~"]=p)},c.getPlugin=function(l){return this._plugins["~"+l+"~"]},c._setDelivery=function(l){this._delivery=l(this)},c.startSession=function(){var l=new ji;l.app.releaseStage=this._config.releaseStage,l.app.version=this._config.appVersion,l.app.type=this._config.appType,l._user=P({},this._user);var p=qi(this._cbs.s,l,"onSession",this._logger);return p?(this._logger.debug("Session not started due to onSession callback"),this):this._sessionDelegate.startSession(this,l)},c.addOnError=function(l,p){p===void 0&&(p=!1),this._cbs.e[p?"unshift":"push"](l)},c.removeOnError=function(l){this._cbs.e=u(this._cbs.e,function(p){return p!==l})},c._addOnSessionPayload=function(l){this._cbs.sp.push(l)},c.addOnSession=function(l){this._cbs.s.push(l)},c.removeOnSession=function(l){this._cbs.s=u(this._cbs.s,function(p){return p!==l})},c.addOnBreadcrumb=function(l,p){p===void 0&&(p=!1),this._cbs.b[p?"unshift":"push"](l)},c.removeOnBreadcrumb=function(l){this._cbs.b=u(this._cbs.b,function(p){return p!==l})},c.pauseSession=function(){return this._sessionDelegate.pauseSession(this)},c.resumeSession=function(){return this._sessionDelegate.resumeSession(this)},c.leaveBreadcrumb=function(l,p,v){if(l=typeof l=="string"?l:"",v=typeof v=="string"&&d(a,v)?v:"manual",p=typeof p=="object"&&p!==null?p:{},!!l){var E=new i(l,p,v),x=qi(this._cbs.b,E,"onBreadcrumb",this._logger);if(x){this._logger.debug("Breadcrumb not attached due to onBreadcrumb callback");return}this._breadcrumbs.push(E),this._breadcrumbs.length>this._config.maxBreadcrumbs&&(this._breadcrumbs=this._breadcrumbs.slice(this._breadcrumbs.length-this._config.maxBreadcrumbs))}},c._isBreadcrumbTypeEnabled=function(l){var p=this._config.enabledBreadcrumbTypes;return p===null||d(p,l)},c.notify=function(l,p,v){v===void 0&&(v=ir);var E=en.create(l,!0,void 0,"notify()",this._depth+1,this._logger);this._notify(E,p,v)},c._notify=function(l,p,v){var E=this;if(v===void 0&&(v=ir),l.app=P({},l.app,{releaseStage:this._config.releaseStage,version:this._config.appVersion,type:this._config.appType}),l.context=l.context||this._context,l._metadata=P({},l._metadata,this._metadata),l._user=P({},l._user,this._user),l.breadcrumbs=this._breadcrumbs.slice(),l.setGroupingDiscriminator(this._groupingDiscriminator),Fi(l._features,this._features,l._featuresIndex),this._config.enabledReleaseStages!==null&&!d(this._config.enabledReleaseStages,this._config.releaseStage))return this._logger.warn("Event not sent due to releaseStage/enabledReleaseStages configuration"),v(null,l);var x=l.severity,M=function(H){E._logger.error("Error occurred in onError callback, continuing anyway\u2026"),E._logger.error(H)},j=[].concat(this._cbs.e).concat(p);Lh(j,l,M,function(H,pe){if(H&&M(H),!pe)return E._logger.debug("Event not sent due to onError callback"),v(null,l);E._isBreadcrumbTypeEnabled("error")&&o.prototype.leaveBreadcrumb.call(E,l.errors[0].errorClass,{errorClass:l.errors[0].errorClass,errorMessage:l.errors[0].errorMessage,severity:l.severity},"error"),x!==l.severity&&(l._handledState.severityReason={type:"userCallbackSetSeverity"}),l.unhandled!==l._handledState.unhandled&&(l._handledState.severityReason.unhandledOverridden=!0,l._handledState.unhandled=l.unhandled),E._session&&(E._session._track(l),l._session=E._session),E._delivery.sendEvent({apiKey:l.apiKey||E._config.apiKey,notifier:E._notifier,events:[l]},function(ye){return v(ye,l)})})},o})(),Zh=function(o,c){var f=new Error(`Invalid configuration
12
+ `+L(_(o),function(l){return" - "+l+" "+o[l]+", got "+Xh(c[l])}).join(`
13
13
 
14
- `));return f},Jh=function(o){switch(typeof o){case"string":case"number":case"object":return JSON.stringify(o);default:return String(o)}},nn=Vh,an={},ds=["events.[].metaData","events.[].breadcrumbs.[].metaData","events.[].request"];an.event=function(o,c){var f=z(o,null,null,{redactedPaths:ds,redactedKeys:c});return f.length>1e6&&(o.events[0]._metadata={notifier:`WARNING!
14
+ `));return f},Xh=function(o){switch(typeof o){case"string":case"number":case"object":return JSON.stringify(o);default:return String(o)}},nn=Jh,an={},hs=["events.[].metaData","events.[].breadcrumbs.[].metaData","events.[].request"];an.event=function(o,c){var f=z(o,null,null,{redactedPaths:hs,redactedKeys:c});return f.length>1e6&&(o.events[0]._metadata={notifier:`WARNING!
15
15
  Serialized payload was `+f.length/1e6+`MB (limit = 1MB)
16
- metadata was removed`},f=z(o,null,null,{redactedPaths:ds,redactedKeys:c})),f},an.session=function(o,c){var f=z(o,null,null);return f};var Zh=require("http"),Xh=require("https"),Qh=require("url"),eg=Qh.parse,ps=function(o,c){var f=o.url,l=o.headers,p=o.body,v=o.agent,E=!1,x=function(ye){E||(E=!0,c(ye))},M=eg(f),j=M.protocol==="https:",H=j?Xh:Zh,pe=H.request({method:"POST",hostname:M.hostname,port:M.port,path:M.path,headers:l,agent:v});pe.on("error",x),pe.on("response",function(ye){rg(ye,function(ar,De){if(ar)return x(ar);if(ye.statusCode<200||ye.statusCode>=300)return x(new Error("Bad statusCode from API: "+ye.statusCode+`
17
- `+De));c(null,De)})}),pe.write(p),pe.end()},rg=function(o,c){var f="";o.on("error",c),o.setEncoding("utf8"),o.on("data",function(l){f+=l}),o.on("end",function(){return c(null,f)})},tg=function(o){return{sendEvent:function(c,f){f===void 0&&(f=function(){});var l=an.event(c,o._config.redactedKeys),p=function(E){E&&o._logger.error(`Event failed to send\u2026
18
- `+(E&&E.stack?E.stack:E),E),l.length>1e6&&o._logger.warn("Event oversized ("+(l.length/1e6).toFixed(2)+" MB)"),f(E)};if(o._config.endpoints.notify===null){var v=new Error("Event not sent due to incomplete endpoint configuration");return p(v)}try{ps({url:o._config.endpoints.notify,headers:{"Content-Type":"application/json","Bugsnag-Api-Key":c.apiKey||o._config.apiKey,"Bugsnag-Payload-Version":"4","Bugsnag-Sent-At":new Date().toISOString()},body:l,agent:o._config.agent},function(E,x){return p(E)})}catch(E){p(E)}},sendSession:function(c,f){f===void 0&&(f=function(){});var l=function(v){v&&o._logger.error(`Session failed to send\u2026
19
- `+(v&&v.stack?v.stack:v),v),f(v)};if(o._config.endpoints.session===null){var p=new Error("Session not sent due to incomplete endpoint configuration");return l(p)}try{ps({url:o._config.endpoints.sessions,headers:{"Content-Type":"application/json","Bugsnag-Api-Key":o._config.apiKey,"Bugsnag-Payload-Version":"1","Bugsnag-Sent-At":new Date().toISOString()},body:an.session(c,o._config.redactedKeys),agent:o._config.agent},function(v){return l(v)})}catch(v){l(v)}}}};function mt(){return mt=Object.assign?Object.assign.bind():function(o){for(var c=1;c<arguments.length;c++){var f=arguments[c];for(var l in f)({}).hasOwnProperty.call(f,l)&&(o[l]=f[l])}return o},mt.apply(null,arguments)}var ki=T.schema,ng=require("os"),ig=require("util"),ag=ig.inspect,og={appType:mt({},ki.appType,{defaultValue:function(){return"node"}}),projectRoot:{defaultValue:function(){return process.cwd()},validate:function(o){return o===null||w(o)},message:"should be string"},hostname:{defaultValue:function(){return ng.hostname()},message:"should be a string",validate:function(o){return o===null||w(o)}},logger:mt({},ki.logger,{defaultValue:function(){return sg()}}),releaseStage:mt({},ki.releaseStage,{defaultValue:function(){return process.env.NODE_ENV||"production"}}),agent:{defaultValue:function(){},message:"should be an HTTP(s) agent",validate:function(o){return o===void 0||ug(o)}},onUncaughtException:{defaultValue:function(){return function(o,c,f){f.error("Uncaught exception"+gs(c)+`, the process will now terminate\u2026
20
- `+hs(o)),process.exit(1)}},message:"should be a function",validate:function(o){return typeof o=="function"}},onUnhandledRejection:{defaultValue:function(){return function(o,c,f){f.error("Unhandled rejection"+gs(c)+`\u2026
21
- `+hs(o))}},message:"should be a function",validate:function(o){return typeof o=="function"}}},hs=function(o){return o&&o.stack?o.stack:ag(o)},sg=function(){return["debug","info","warn","error"].reduce(function(o,c){var f=console[c]||console.log;return o[c]=f.bind(console,"[bugsnag]"),o},{})},gs=function(o){return o.request&&Object.keys(o.request).length?" at "+o.request.httpMethod+" "+(o.request.path||o.request.url):""},ug=function(o){return typeof o=="object"&&o!==null||typeof o=="boolean"},ms=new Date,lg=function(){ms=new Date},cg={name:"appDuration",load:function(o){return o.addOnError(function(c){var f=new Date;c.app.duration=f-ms},!0),{reset:lg}}},zi={};zi.load=function(o){var c=/^(local-)?dev(elopment)?$/.test(o._config.releaseStage);c||!o._isBreadcrumbTypeEnabled("log")||C(ys,function(f){var l=console[f];console[f]=function(){for(var p=arguments.length,v=new Array(p),E=0;E<p;E++)v[E]=arguments[E];o.leaveBreadcrumb("Console output",s(v,function(x,M,j){var H="[Unknown value]";try{H=String(M)}catch{}if(H==="[object Object]")try{H=JSON.stringify(M)}catch{}return x["["+j+"]"]=H,x},{severity:f.indexOf("group")===0?"log":f}),"log"),l.apply(console,v)},console[f]._restore=function(){console[f]=l}})},process.env.NODE_ENV!=="production"&&(zi.destroy=function(){return ys.forEach(function(o){typeof console[o]._restore=="function"&&console[o]._restore()})});var ys=u(["log","debug","info","warn","error"],function(o){return typeof console<"u"&&typeof console[o]=="function"}),Bi={},vs=[];Bi=function(o){var c=new o.Client({},{},[],o._notifier);return c._config=o._config,c._breadcrumbs=o._breadcrumbs.slice(),c._metadata=P({},o._metadata),c._features=[].concat(o._features),c._featuresIndex=P({},o._featuresIndex),c._user=P({},o._user),c._context=o._context,c._cbs={e:o._cbs.e.slice(),s:o._cbs.s.slice(),sp:o._cbs.sp.slice(),b:o._cbs.b.slice()},c._logger=o._logger,c._delivery=o._delivery,c._sessionDelegate=o._sessionDelegate,vs.forEach(function(f){f(c)}),c},Bi.registerCallback=function(o){vs.push(o)};var Yr={};Yr.getStack=function(){return new Error().stack.split(`
16
+ metadata was removed`},f=z(o,null,null,{redactedPaths:hs,redactedKeys:c})),f},an.session=function(o,c){var f=z(o,null,null);return f};var Qh=require("http"),eg=require("https"),rg=require("url"),tg=rg.parse,gs=function(o,c){var f=o.url,l=o.headers,p=o.body,v=o.agent,E=!1,x=function(ye){E||(E=!0,c(ye))},M=tg(f),j=M.protocol==="https:",H=j?eg:Qh,pe=H.request({method:"POST",hostname:M.hostname,port:M.port,path:M.path,headers:l,agent:v});pe.on("error",x),pe.on("response",function(ye){ng(ye,function(ar,De){if(ar)return x(ar);if(ye.statusCode<200||ye.statusCode>=300)return x(new Error("Bad statusCode from API: "+ye.statusCode+`
17
+ `+De));c(null,De)})}),pe.write(p),pe.end()},ng=function(o,c){var f="";o.on("error",c),o.setEncoding("utf8"),o.on("data",function(l){f+=l}),o.on("end",function(){return c(null,f)})},ig=function(o){return{sendEvent:function(c,f){f===void 0&&(f=function(){});var l=an.event(c,o._config.redactedKeys),p=function(E){E&&o._logger.error(`Event failed to send\u2026
18
+ `+(E&&E.stack?E.stack:E),E),l.length>1e6&&o._logger.warn("Event oversized ("+(l.length/1e6).toFixed(2)+" MB)"),f(E)};if(o._config.endpoints.notify===null){var v=new Error("Event not sent due to incomplete endpoint configuration");return p(v)}try{gs({url:o._config.endpoints.notify,headers:{"Content-Type":"application/json","Bugsnag-Api-Key":c.apiKey||o._config.apiKey,"Bugsnag-Payload-Version":"4","Bugsnag-Sent-At":new Date().toISOString()},body:l,agent:o._config.agent},function(E,x){return p(E)})}catch(E){p(E)}},sendSession:function(c,f){f===void 0&&(f=function(){});var l=function(v){v&&o._logger.error(`Session failed to send\u2026
19
+ `+(v&&v.stack?v.stack:v),v),f(v)};if(o._config.endpoints.session===null){var p=new Error("Session not sent due to incomplete endpoint configuration");return l(p)}try{gs({url:o._config.endpoints.sessions,headers:{"Content-Type":"application/json","Bugsnag-Api-Key":o._config.apiKey,"Bugsnag-Payload-Version":"1","Bugsnag-Sent-At":new Date().toISOString()},body:an.session(c,o._config.redactedKeys),agent:o._config.agent},function(v){return l(v)})}catch(v){l(v)}}}};function mt(){return mt=Object.assign?Object.assign.bind():function(o){for(var c=1;c<arguments.length;c++){var f=arguments[c];for(var l in f)({}).hasOwnProperty.call(f,l)&&(o[l]=f[l])}return o},mt.apply(null,arguments)}var ki=T.schema,ag=require("os"),og=require("util"),sg=og.inspect,ug={appType:mt({},ki.appType,{defaultValue:function(){return"node"}}),projectRoot:{defaultValue:function(){return process.cwd()},validate:function(o){return o===null||w(o)},message:"should be string"},hostname:{defaultValue:function(){return ag.hostname()},message:"should be a string",validate:function(o){return o===null||w(o)}},logger:mt({},ki.logger,{defaultValue:function(){return lg()}}),releaseStage:mt({},ki.releaseStage,{defaultValue:function(){return process.env.NODE_ENV||"production"}}),agent:{defaultValue:function(){},message:"should be an HTTP(s) agent",validate:function(o){return o===void 0||cg(o)}},onUncaughtException:{defaultValue:function(){return function(o,c,f){f.error("Uncaught exception"+ys(c)+`, the process will now terminate\u2026
20
+ `+ms(o)),process.exit(1)}},message:"should be a function",validate:function(o){return typeof o=="function"}},onUnhandledRejection:{defaultValue:function(){return function(o,c,f){f.error("Unhandled rejection"+ys(c)+`\u2026
21
+ `+ms(o))}},message:"should be a function",validate:function(o){return typeof o=="function"}}},ms=function(o){return o&&o.stack?o.stack:sg(o)},lg=function(){return["debug","info","warn","error"].reduce(function(o,c){var f=console[c]||console.log;return o[c]=f.bind(console,"[bugsnag]"),o},{})},ys=function(o){return o.request&&Object.keys(o.request).length?" at "+o.request.httpMethod+" "+(o.request.path||o.request.url):""},cg=function(o){return typeof o=="object"&&o!==null||typeof o=="boolean"},vs=new Date,fg=function(){vs=new Date},dg={name:"appDuration",load:function(o){return o.addOnError(function(c){var f=new Date;c.app.duration=f-vs},!0),{reset:fg}}},zi={};zi.load=function(o){var c=/^(local-)?dev(elopment)?$/.test(o._config.releaseStage);c||!o._isBreadcrumbTypeEnabled("log")||L(bs,function(f){var l=console[f];console[f]=function(){for(var p=arguments.length,v=new Array(p),E=0;E<p;E++)v[E]=arguments[E];o.leaveBreadcrumb("Console output",s(v,function(x,M,j){var H="[Unknown value]";try{H=String(M)}catch{}if(H==="[object Object]")try{H=JSON.stringify(M)}catch{}return x["["+j+"]"]=H,x},{severity:f.indexOf("group")===0?"log":f}),"log"),l.apply(console,v)},console[f]._restore=function(){console[f]=l}})},process.env.NODE_ENV!=="production"&&(zi.destroy=function(){return bs.forEach(function(o){typeof console[o]._restore=="function"&&console[o]._restore()})});var bs=u(["log","debug","info","warn","error"],function(o){return typeof console<"u"&&typeof console[o]=="function"}),Bi={},_s=[];Bi=function(o){var c=new o.Client({},{},[],o._notifier);return c._config=o._config,c._breadcrumbs=o._breadcrumbs.slice(),c._metadata=P({},o._metadata),c._features=[].concat(o._features),c._featuresIndex=P({},o._featuresIndex),c._user=P({},o._user),c._context=o._context,c._cbs={e:o._cbs.e.slice(),s:o._cbs.s.slice(),sp:o._cbs.sp.slice(),b:o._cbs.b.slice()},c._logger=o._logger,c._delivery=o._delivery,c._sessionDelegate=o._sessionDelegate,_s.forEach(function(f){f(c)}),c},Bi.registerCallback=function(o){_s.push(o)};var Yr={};Yr.getStack=function(){return new Error().stack.split(`
22
22
  `).slice(3).join(`
23
23
  `)},Yr.maybeUseFallbackStack=function(o,c){var f=o.stack.split(`
24
24
  `);return(f.length===1||f.length===2&&/at Error \(native\)/.test(f[1]))&&(o.stack=f[0]+`
25
- `+c),o};var on={},fg=Yr.getStack;on={name:"contextualize",load:function(o){var c=function(f,l){var p=fg(),v=Bi(o);v.fallbackStack=p,v.addOnError(l),o._clientContext.run(v,f)};return c}},on.default=on;var sn={},dg=Yr.getStack,pg=Yr.maybeUseFallbackStack;sn={name:"intercept",load:function(o){var c=function(f,l){f===void 0&&(f=function(){}),typeof l!="function"&&(l=f,f=function(){});var p=dg();return function(v){if(v){v.stack&&pg(v,p);var E=o.Event.create(v,!0,{severity:"warning",unhandled:!1,severityReason:{type:"callbackErrorIntercept"}},"intercept()",1);o._notify(E,f);return}for(var x=arguments.length,M=new Array(x>1?x-1:0),j=1;j<x;j++)M[j-1]=arguments[j];l.apply(void 0,M)}};return c}},sn.default=sn;function un(){return un=Object.assign?Object.assign.bind():function(o){for(var c=1;c<arguments.length;c++){var f=arguments[c];for(var l in f)({}).hasOwnProperty.call(f,l)&&(o[l]=f[l])}return o},un.apply(null,arguments)}var yt=require("os"),hg={load:function(o){var c={osName:yt.platform()+" ("+yt.arch()+")",osVersion:yt.release(),totalMemory:yt.totalmem(),hostname:o._config.hostname,runtimeVersions:{node:process.versions.node}};o._addOnSessionPayload(function(f){f.device=un({},f.device,c)}),o.addOnError(function(f){f.device=un({},f.device,c,{freeMemory:yt.freemem(),time:new Date})},!0)}},bs=require("path"),gg=bs.join,mg=bs.resolve,_s=function(o){return gg(mg(o),"/")},yg={load:function(o){return o.addOnError(function(c){if(o._config.projectRoot){var f=_s(o._config.projectRoot),l=c.errors.reduce(function(p,v){return p.concat(v.stacktrace)},[]);l.map(function(p){p.inProject=typeof p.file=="string"&&p.file.indexOf(f)===0&&!/\/node_modules\//.test(p.file)})}})}};function Hi(){return Hi=Object.assign?Object.assign.bind():function(o){for(var c=1;c<arguments.length;c++){var f=arguments[c];for(var l in f)({}).hasOwnProperty.call(f,l)&&(o[l]=f[l])}return o},Hi.apply(null,arguments)}function vg(o,c){o.prototype=Object.create(c.prototype),o.prototype.constructor=o,Gi(o,c)}function Gi(o,c){return Gi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(f,l){return f.__proto__=l,f},Gi(o,c)}var ws=3,Es=200,bg=require("fs"),_g=bg.createReadStream,wg=require("stream"),Eg=wg.Writable,Sg=ks(),Og=Bs(),Pg=require("path"),Ag={load:function(o){if(o._config.sendCode){var c=function(f,l){return new Promise(function(p,v){try{if(!f.lineNumber||!f.file)return p(f);var E=Pg.resolve(o._config.projectRoot,f.file),x=E+"@"+f.lineNumber;if(x in l)return f.code=l[x],p(f);Tg(E,f.lineNumber,function(M,j){return M||(f.code=l[x]=j),p(f)})}catch{return p(f)}})};o.addOnError(function(f){return new Promise(function(l,p){var v=Object.create(null),E=f.errors.reduce(function(x,M){return x.concat(M.stacktrace)},[]);xg(E.map(function(x){return function(){return c(x,v)}})).then(l).catch(p)})})}},configSchema:{sendCode:{defaultValue:function(){return!0},validate:function(o){return o===!0||o===!1},message:"should be true or false"}}},Tg=function(o,c,f){var l=c-ws,p=c+ws,v=_g(o,{encoding:"utf8"}),E=new Og.LineStream({keepEmptyLines:!0}),x=new Ng({start:l,end:p});x.on("done",function(){return v.destroy()}),Sg(v,E,x,function(M){if(M&&M.message!=="premature close")return f(M);f(null,x.getCode())})},Ng=(function(o){function c(l){var p;return p=o.call(this,Hi({},l,{decodeStrings:!1}))||this,p._start=l.start,p._end=l.end,p._n=0,p._code={},p}vg(c,o);var f=c.prototype;return f._write=function(p,v,E){return this._n++,this._n<this._start?E(null):this._n<=this._end?(this._code[String(this._n)]=p.length<=Es?p:p.substr(0,Es),E(null)):(this.emit("done"),E(null))},f.getCode=function(){return this._code},c})(Eg),xg=function(o){return new Promise(function(c,f){var l=[];o.reduce(function(p,v){return p.then(function(E){return l.push(E),v()})},Promise.resolve()).then(function(p){l.push(p)}).then(function(){c(l.slice(1))})})},Mg=Yr.maybeUseFallbackStack,Wi,Rg={load:function(o){o._config.autoDetectErrors&&o._config.enabledErrorTypes.unhandledExceptions&&(Wi=function(c){var f=o._clientContext&&o._clientContext.getStore(),l=f||o;c.stack&&l.fallbackStack&&Mg(c,l.fallbackStack);var p=l.Event.create(c,!1,{severity:"error",unhandled:!0,severityReason:{type:"unhandledException"}},"uncaughtException handler",1);return new Promise(function(v){l._notify(p,function(){},function(E,x){E&&l._logger.error("Failed to send event to Bugsnag"),l._config.onUncaughtException(c,x,l._logger),v()})})},process.prependListener("uncaughtException",Wi))},destroy:function(){process.removeListener("uncaughtException",Wi)}},ln,Ig={load:function(o){!o._config.autoDetectErrors||!o._config.enabledErrorTypes.unhandledRejections||(ln=function(c){var f=o._clientContext&&o._clientContext.getStore(),l=f||o,p=!o._config.reportUnhandledPromiseRejectionsAsHandled,v=l.Event.create(c,!1,{severity:"error",unhandled:p,severityReason:{type:"unhandledPromiseRejection"}},"unhandledRejection handler",1);return new Promise(function(E){l._notify(v,function(){},function(x,M){x&&l._logger.error("Failed to send event to Bugsnag"),l._config.onUnhandledRejection(c,M,l._logger),E()})})},process.prependListener?process.prependListener("unhandledRejection",ln):process.on("unhandledRejection",ln))},destroy:function(){process.removeListener("unhandledRejection",ln)}},Dg=Yi;function Yi(o){o=o||{},this.ms=o.min||100,this.max=o.max||1e4,this.factor=o.factor||2,this.jitter=o.jitter>0&&o.jitter<=1?o.jitter:0,this.attempts=0}Yi.prototype.duration=function(){var o=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var c=Math.random(),f=Math.floor(c*this.jitter*o);o=(Math.floor(c*10)&1)==0?o-f:o+f}return Math.min(o,this.max)|0},Yi.prototype.reset=function(){this.attempts=0};function Cg(o,c){o.prototype=Object.create(c.prototype),o.prototype.constructor=o,Vi(o,c)}function Vi(o,c){return Vi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(f,l){return f.__proto__=l,f},Vi(o,c)}var Lg=10*1e3,qg=require("events").EventEmitter,$g=(function(o){function c(l){var p;return p=o.call(this)||this,p._sessions=new Map,p._interval=null,p._intervalLength=l||Lg,p._summarize=p._summarize.bind(p),p}Cg(c,o);var f=c.prototype;return f.start=function(){this._interval||(this._interval=setInterval(this._summarize,this._intervalLength).unref())},f.stop=function(){clearInterval(this._interval),this._interval=null},f.track=function(p){var v=Ug(p.startedAt),E=this._sessions.get(v);return this._sessions.set(v,typeof E>"u"?1:E+1),p},f._summarize=function(){var p=this,v=[];this._sessions.forEach(function(E,x){v.push({startedAt:x,sessionsStarted:E}),p._sessions.delete(x)}),v.length&&this.emit("summary",v)},c})(qg),Ug=function(o){var c=new Date(o);return c.setSeconds(0),c.setMilliseconds(0),c.toISOString()},jg={load:function(o){var c=new $g(o._config.sessionSummaryInterval);c.on("summary",Fg(o)),c.start(),o._sessionDelegate={startSession:function(f,l){return f._session=l,f._pausedSession=null,c.track(f._session),f},pauseSession:function(f){f._pausedSession=f._session,f._session=null},resumeSession:function(f){return f._session?f:f._pausedSession?(f._session=f._pausedSession,f._pausedSession=null,f):f.startSession()}}},configSchema:{sessionSummaryInterval:{defaultValue:function(){},validate:function(o){return o===void 0||S()(o)},message:"should be a positive integer"}}},Fg=function(o){return function(c){if(o._config.enabledReleaseStages!==null&&!o._config.enabledReleaseStages.includes(o._config.releaseStage)){o._logger.warn("Session not sent due to releaseStage/enabledReleaseStages configuration");return}if(!c.length)return;var f=new Dg({min:1e3,max:1e4}),l=10;v(p);function p(E){if(!E){var x=c.reduce(function(M,j){return M+j.sessionsStarted},0);return o._logger.debug(x+" session(s) reported")}if(f.attempts===10){o._logger.error("Session delivery failed, max retries exceeded",E);return}o._logger.debug("Session delivery failed, retry #"+(f.attempts+1)+"/"+l,E),setTimeout(function(){return v(p)},f.duration())}function v(E){var x={notifier:o._notifier,device:{},app:{releaseStage:o._config.releaseStage,version:o._config.appVersion,type:o._config.appType},sessionCounts:c},M=qi(o._cbs.sp,x,"onSessionPayload",o._logger);if(M)return o._logger.debug("Session not sent due to onSessionPayload callback"),E(null);o._delivery.sendSession(x,E)}}},kg={load:function(o){o.addOnError(function(c){var f=c.errors.reduce(function(l,p){return l.concat(p.stacktrace)},[]);f.forEach(function(l){typeof l.file=="string"&&(l.file=l.file.replace(/\\/g,"/"))})})}},zg={load:function(o){return o.addOnError(function(c){if(o._config.projectRoot){var f=_s(o._config.projectRoot),l=c.errors.reduce(function(p,v){return p.concat(v.stacktrace)},[]);l.map(function(p){typeof p.file=="string"&&p.file.indexOf(f)===0&&(p.file=p.file.replace(f,""))})}})}},br={};function Ki(){return Ki=Object.assign?Object.assign.bind():function(o){for(var c=1;c<arguments.length;c++){var f=arguments[c];for(var l in f)({}).hasOwnProperty.call(f,l)&&(o[l]=f[l])}return o},Ki.apply(null,arguments)}var Bg="Bugsnag Node",Hg="8.6.0",Gg="https://github.com/bugsnag/bugsnag-js",Wg=require("async_hooks"),Yg=Wg.AsyncLocalStorage;en.__type="nodejs";var Vg=Ki({},T.schema,og),Kg=[cg,Ag,yg,zg,jg,hg,Rg,Ig,sn,on,kg,zi],Ie={_client:null,createClient:function(o){typeof o=="string"&&(o={apiKey:o}),o||(o={});var c=new nn(o,Vg,Kg,{name:Bg,version:Hg,url:Gg});return Object.keys(nn.prototype).forEach(function(f){var l=c[f];c[f]=function(){var p=c._clientContext&&typeof c._clientContext.getStore=="function"?c._clientContext.getStore():null,v=p||c,E=p?p[f]:l;v._depth+=1;var x=E.apply(v,arguments);return v._depth-=1,x}}),c._clientContext=new Yg,c._setDelivery(tg),c._logger.debug("Loaded!"),c},start:function(o){return Ie._client?(Ie._client._logger.warn("Bugsnag.start() was called more than once. Ignoring."),Ie._client):(Ie._client=Ie.createClient(o),Ie._client)},isStarted:function(){return Ie._client!=null}};return Object.keys(nn.prototype).forEach(function(o){/^_/.test(o)||(Ie[o]=function(){var c=Ie._client,f=c&&c._clientContext&&c._clientContext.getStore();if(f&&(c=f),!c)return console.error("Bugsnag."+o+"() was called before Bugsnag.start()");c._depth+=1;var l=c[o].apply(c,arguments);return c._depth-=1,l})}),br=Ie,br.Client=nn,br.Event=en,br.Session=ji,br.Breadcrumb=i,br.default=Ie,br})});var ia=m((OE,Ws)=>{Ws.exports=Gs()});var pn=m(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.TerritoryCodeSchema=_r.territoryCodes=void 0;var bm=require("zod");_r.territoryCodes=["AFG","AGO","AIA","ALB","ARE","ARG","ARM","ATG","AUS","AUT","AZE","BEL","BEN","BFA","BGR","BHR","BHS","BIH","BLR","BLZ","BMU","BOL","BRA","BRB","BRN","BTN","BWA","CAN","CHE","CHL","CHN","CIV","CMR","COD","COG","COL","CPV","CRI","CYM","CYP","CZE","DEU","DMA","DNK","DOM","DZA","ECU","EGY","ESP","EST","FIN","FJI","FRA","FSM","GAB","GBR","GEO","GHA","GMB","GNB","GRC","GRD","GTM","GUY","HKG","HND","HRV","HUN","IDN","IND","IRL","IRQ","ISL","ISR","ITA","JAM","JOR","JPN","KAZ","KEN","KGZ","KHM","KNA","KOR","KWT","LAO","LBN","LBR","LBY","LCA","LKA","LTU","LUX","LVA","MAC","MAR","MDA","MDG","MDV","MEX","MKD","MLI","MLT","MMR","MNE","MNG","MOZ","MRT","MSR","MUS","MWI","MYS","NAM","NER","NGA","NIC","NLD","NOR","NPL","NRU","NZL","OMN","PAK","PAN","PER","PHL","PLW","PNG","POL","PRT","PRY","QAT","ROU","RUS","RWA","SAU","SEN","SGP","SLB","SLE","SLV","SRB","STP","SUR","SVK","SVN","SWE","SWZ","SYC","TCA","TCD","THA","TJK","TKM","TON","TTO","TUN","TUR","TWN","TZA","UGA","UKR","URY","USA","UZB","VCT","VEN","VGB","VNM","VUT","XKS","YEM","ZAF","ZMB","ZWE"];_r.TerritoryCodeSchema=bm.z.enum(_r.territoryCodes)});var aa=m(wr=>{"use strict";Object.defineProperty(wr,"__esModule",{value:!0});wr.LocaleCodeSchema=wr.localeCodes=void 0;var _m=require("zod");wr.localeCodes=["ar-SA","ca","zh-Hans","zh-Hant","hr","cs","da","nl-NL","en-AU","en-CA","en-GB","en-US","fi","fr-FR","fr-CA","de-DE","el","he","hi","hu","id","it","ja","ko","ms","no","pl","pt-BR","pt-PT","ro","ru","sk","es-MX","es-ES","sv","th","tr","uk","vi"];wr.LocaleCodeSchema=_m.z.enum(wr.localeCodes)});var bt=m(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.ContextualError=void 0;Ye.isNotFoundError=wm;Ye.isRateLimitError=Em;Ye.isNotAuthorizedError=Sm;Ye.isVersionNotUpdatableError=Om;Ye.extractClientErrorToSend=Ys;var oa=require("zod-validation-error"),hn=class e extends Error{constructor(r,t){super(r),this.stack=new Error(r).stack,this.context=t,Object.setPrototypeOf(this,e.prototype)}};Ye.ContextualError=hn;function Er(e){let r=[];if(!e||typeof e!="object")return r;e.errors&&Array.isArray(e.errors)&&r.push(e);for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];Array.isArray(n)?n.forEach(i=>{r.push(...Er(i))}):n&&typeof n=="object"&&r.push(...Er(n))}return r}function wm(e){let r=Er(e);for(let t of r)if(t.errors&&Array.isArray(t.errors)&&t.errors.some(n=>n.status==="404"||n.status===404))return!0;return e?.status===404||e?.status==="404"||e?.response?.status===404}function Em(e){if(e?.status===429||e?.status==="429")return!0;let r=Er(e);for(let t of r)if(t.errors&&Array.isArray(t.errors)&&t.errors.some(n=>n.status===429||n.status==="429"))return!0;return!1}function Sm(e){if(e?.status===401||e?.status==="401")return!0;let r=Er(e);for(let t of r)if(t.errors&&Array.isArray(t.errors)&&t.errors.some(n=>n.status===401||n.status==="401"||n.code==="NOT_AUTHORIZED"))return!0;return!1}function Om(e){if(e?.status===409||e?.status==="409")return!0;let r=Er(e);for(let t of r)if(t.errors&&Array.isArray(t.errors)&&t.errors.some(n=>n.status===409||n.status==="409"||n.code==="ENTITY_ERROR.ATTRIBUTE.INVALID.INVALID_STATE"))return!0;return!1}function Ys(e){try{if(oa.isZodErrorLike&&(0,oa.isZodErrorLike)(e))return{message:(0,oa.fromError)(e).message,status:400}}catch{}if(e instanceof hn){let t=Er(e.context).flatMap(i=>Array.isArray(i.errors)?i.errors.map(a=>({title:a?.title,detail:a?.detail})):[]),n=e.message;if(e.context instanceof Error){let i=Ys(e.context);n=n+`
26
- ${i.message}`,t=t.concat(i.details||[])}return{message:n,status:400,details:t}}return typeof e=="string"?{message:e,status:400}:e instanceof Error?{message:e.message,status:400}:{message:"Internal server error",status:500}}});var gn=m(Sr=>{"use strict";Object.defineProperty(Sr,"__esModule",{value:!0});Sr.isValidProductId=void 0;Sr.deepEqualUnordered=sa;Sr.readJsonFile=Nm;Sr.validateAppStoreModelData=Mm;var Pm=require("zod"),Am=require("fs"),Tm=bt();function sa(e,r){if(e===r)return!0;if(typeof e!=typeof r)return!1;if(Array.isArray(e)&&Array.isArray(r)){if(e.length!==r.length)return!1;let t=new Array(r.length).fill(!1);for(let n of e){let i=!1;for(let a=0;a<r.length;a++)if(!t[a]&&sa(n,r[a])){t[a]=!0,i=!0;break}if(!i)return!1}return!0}if(e&&r&&typeof e=="object"){let t=Object.keys(e),n=Object.keys(r);if(t.length!==n.length)return!1;for(let i of t)if(!Object.prototype.hasOwnProperty.call(r,i)||!sa(e[i],r[i]))return!1;return!0}return!1}function Nm(e){let r=(0,Am.readFileSync)(e,"utf-8");try{return JSON.parse(r)}catch(t){throw new Tm.ContextualError(`\u274C Invalid JSON format! ${e}`,{filePath:e,jsonError:t})}}var xm=e=>/^[a-zA-Z0-9._]+$/.test(e);Sr.isValidProductId=xm;function Mm(e,r){e.primaryLocale&&e.localizations&&e.localizations.length>0&&(e.localizations.some(n=>n.locale===e.primaryLocale)||r.addIssue({code:Pm.z.ZodIssueCode.custom,message:`Primary locale '${e.primaryLocale}' must exist in the localizations array`,path:["primaryLocale"]}))}});var Vs=m((xE,Rm)=>{Rm.exports=[{duration:7,durationType:"1w",bonusPeriods:["1w","1m","2m","3m","6m","1y","3d","2w"],introOfferDurations:[{modeType:"PayUpFront",durations:[{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1}]},{modeType:"PayAsYouGo",durations:[{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:2},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:3},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:4},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:5},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:6},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:7},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:8},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:9},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:10},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:11},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:12}]},{modeType:"FreeTrial",durations:[{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_DAY",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_WEEK",numberOfPeriods:1}]}]},{duration:30,durationType:"1m",bonusPeriods:["1w","1m","2m","3m","6m","1y","3d","2w"],introOfferDurations:[{modeType:"PayUpFront",durations:[{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1}]},{modeType:"PayAsYouGo",durations:[{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:2},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:3},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:4},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:5},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:6},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:7},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:8},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:9},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:10},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:11},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:12}]},{modeType:"FreeTrial",durations:[{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_DAY",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_WEEK",numberOfPeriods:1}]}]},{duration:60,durationType:"2m",bonusPeriods:["1w","1m","2m","3m","6m","1y","3d","2w"],introOfferDurations:[{modeType:"PayUpFront",durations:[{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1}]},{modeType:"PayAsYouGo",durations:[{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:2},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:3},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:4},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:5},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:6}]},{modeType:"FreeTrial",durations:[{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_DAY",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_WEEK",numberOfPeriods:1}]}]},{duration:90,durationType:"3m",bonusPeriods:["1w","1m","2m","3m","6m","1y","3d","2w"],introOfferDurations:[{modeType:"PayUpFront",durations:[{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1}]},{modeType:"PayAsYouGo",durations:[{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:2},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:3},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:4}]},{modeType:"FreeTrial",durations:[{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_DAY",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_WEEK",numberOfPeriods:1}]}]},{duration:180,durationType:"6m",bonusPeriods:["1w","1m","2m","3m","6m","1y","3d","2w"],introOfferDurations:[{modeType:"PayUpFront",durations:[{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1}]},{modeType:"PayAsYouGo",durations:[{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:2}]},{modeType:"FreeTrial",durations:[{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_DAY",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_WEEK",numberOfPeriods:1}]}]},{duration:365,durationType:"1y",bonusPeriods:["1w","1m","2m","3m","6m","1y","3d","2w"],introOfferDurations:[{modeType:"PayUpFront",durations:[{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1}]},{modeType:"PayAsYouGo",durations:[{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1}]},{modeType:"FreeTrial",durations:[{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_DAY",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_WEEK",numberOfPeriods:1}]}]}]});var ua=m(sr=>{"use strict";var Im=sr&&sr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(sr,"__esModule",{value:!0});sr.getValidIntroductoryOfferDurations=Xs;sr.getValidPayAsYouGoPeriods=Qs;sr.isValidIntroductoryOfferDuration=Cm;sr.isValidPayAsYouGoPeriods=Lm;var Ks=Im(Vs()),Js={ONE_WEEK:7,ONE_MONTH:30,TWO_MONTHS:60,THREE_MONTHS:90,SIX_MONTHS:180,ONE_YEAR:365},Zs={PAY_AS_YOU_GO:"PayAsYouGo",PAY_UP_FRONT:"PayUpFront",FREE_TRIAL:"FreeTrial"};function Dm(e,r){if(r==="ONE_MONTH")switch(e){case 1:return"ONE_MONTH";case 2:return"TWO_MONTHS";case 3:return"THREE_MONTHS";case 6:return"SIX_MONTHS";default:return null}else if(r==="ONE_WEEK")switch(e){case 1:return"ONE_WEEK";case 2:return"TWO_WEEKS";default:return null}else if(r==="ONE_DAY")switch(e){case 3:return"THREE_DAYS";default:return null}else if(r==="ONE_YEAR")switch(e){case 1:return"ONE_YEAR";default:return null}return null}function Xs(e,r){if(r==="PAY_AS_YOU_GO")return[];let t=Js[e],n=Zs[r],i=Ks.default.find(u=>u.duration===t);if(!i)throw new Error(`No duration configuration found for subscription period: ${e}`);let a=i.introOfferDurations.find(u=>u.modeType===n);if(!a)throw new Error(`No intro offer configuration found for offer type: ${r}`);let s=new Set;for(let u of a.durations){let d=Dm(u.typeDuration,u.typeUnit);d&&s.add(d)}return Array.from(s)}function Qs(e){let r=Js[e],t=Zs.PAY_AS_YOU_GO,n=Ks.default.find(a=>a.duration===r);if(!n)throw new Error(`No duration configuration found for subscription period: ${e}`);let i=n.introOfferDurations.find(a=>a.modeType===t);if(!i)throw new Error(`No PAY_AS_YOU_GO configuration found for subscription period: ${e}`);return i.durations.map(a=>a.numberOfPeriods)}function Cm(e,r,t){return r==="PAY_AS_YOU_GO"?!1:Xs(e,r).includes(t)}function Lm(e,r){return Qs(e).includes(r)}});var we=m((RE,eu)=>{"use strict";var la=class e extends Error{constructor(r){super(`Format functions must be synchronous taking a two arguments: (info, opts)
25
+ `+c),o};var on={},pg=Yr.getStack;on={name:"contextualize",load:function(o){var c=function(f,l){var p=pg(),v=Bi(o);v.fallbackStack=p,v.addOnError(l),o._clientContext.run(v,f)};return c}},on.default=on;var sn={},hg=Yr.getStack,gg=Yr.maybeUseFallbackStack;sn={name:"intercept",load:function(o){var c=function(f,l){f===void 0&&(f=function(){}),typeof l!="function"&&(l=f,f=function(){});var p=hg();return function(v){if(v){v.stack&&gg(v,p);var E=o.Event.create(v,!0,{severity:"warning",unhandled:!1,severityReason:{type:"callbackErrorIntercept"}},"intercept()",1);o._notify(E,f);return}for(var x=arguments.length,M=new Array(x>1?x-1:0),j=1;j<x;j++)M[j-1]=arguments[j];l.apply(void 0,M)}};return c}},sn.default=sn;function un(){return un=Object.assign?Object.assign.bind():function(o){for(var c=1;c<arguments.length;c++){var f=arguments[c];for(var l in f)({}).hasOwnProperty.call(f,l)&&(o[l]=f[l])}return o},un.apply(null,arguments)}var yt=require("os"),mg={load:function(o){var c={osName:yt.platform()+" ("+yt.arch()+")",osVersion:yt.release(),totalMemory:yt.totalmem(),hostname:o._config.hostname,runtimeVersions:{node:process.versions.node}};o._addOnSessionPayload(function(f){f.device=un({},f.device,c)}),o.addOnError(function(f){f.device=un({},f.device,c,{freeMemory:yt.freemem(),time:new Date})},!0)}},ws=require("path"),yg=ws.join,vg=ws.resolve,Es=function(o){return yg(vg(o),"/")},bg={load:function(o){return o.addOnError(function(c){if(o._config.projectRoot){var f=Es(o._config.projectRoot),l=c.errors.reduce(function(p,v){return p.concat(v.stacktrace)},[]);l.map(function(p){p.inProject=typeof p.file=="string"&&p.file.indexOf(f)===0&&!/\/node_modules\//.test(p.file)})}})}};function Hi(){return Hi=Object.assign?Object.assign.bind():function(o){for(var c=1;c<arguments.length;c++){var f=arguments[c];for(var l in f)({}).hasOwnProperty.call(f,l)&&(o[l]=f[l])}return o},Hi.apply(null,arguments)}function _g(o,c){o.prototype=Object.create(c.prototype),o.prototype.constructor=o,Gi(o,c)}function Gi(o,c){return Gi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(f,l){return f.__proto__=l,f},Gi(o,c)}var Ss=3,Os=200,wg=require("fs"),Eg=wg.createReadStream,Sg=require("stream"),Og=Sg.Writable,Pg=Hs(),Ag=Ws(),Tg=require("path"),Ng={load:function(o){if(o._config.sendCode){var c=function(f,l){return new Promise(function(p,v){try{if(!f.lineNumber||!f.file)return p(f);var E=Tg.resolve(o._config.projectRoot,f.file),x=E+"@"+f.lineNumber;if(x in l)return f.code=l[x],p(f);xg(E,f.lineNumber,function(M,j){return M||(f.code=l[x]=j),p(f)})}catch{return p(f)}})};o.addOnError(function(f){return new Promise(function(l,p){var v=Object.create(null),E=f.errors.reduce(function(x,M){return x.concat(M.stacktrace)},[]);Rg(E.map(function(x){return function(){return c(x,v)}})).then(l).catch(p)})})}},configSchema:{sendCode:{defaultValue:function(){return!0},validate:function(o){return o===!0||o===!1},message:"should be true or false"}}},xg=function(o,c,f){var l=c-Ss,p=c+Ss,v=Eg(o,{encoding:"utf8"}),E=new Ag.LineStream({keepEmptyLines:!0}),x=new Mg({start:l,end:p});x.on("done",function(){return v.destroy()}),Pg(v,E,x,function(M){if(M&&M.message!=="premature close")return f(M);f(null,x.getCode())})},Mg=(function(o){function c(l){var p;return p=o.call(this,Hi({},l,{decodeStrings:!1}))||this,p._start=l.start,p._end=l.end,p._n=0,p._code={},p}_g(c,o);var f=c.prototype;return f._write=function(p,v,E){return this._n++,this._n<this._start?E(null):this._n<=this._end?(this._code[String(this._n)]=p.length<=Os?p:p.substr(0,Os),E(null)):(this.emit("done"),E(null))},f.getCode=function(){return this._code},c})(Og),Rg=function(o){return new Promise(function(c,f){var l=[];o.reduce(function(p,v){return p.then(function(E){return l.push(E),v()})},Promise.resolve()).then(function(p){l.push(p)}).then(function(){c(l.slice(1))})})},Ig=Yr.maybeUseFallbackStack,Wi,Dg={load:function(o){o._config.autoDetectErrors&&o._config.enabledErrorTypes.unhandledExceptions&&(Wi=function(c){var f=o._clientContext&&o._clientContext.getStore(),l=f||o;c.stack&&l.fallbackStack&&Ig(c,l.fallbackStack);var p=l.Event.create(c,!1,{severity:"error",unhandled:!0,severityReason:{type:"unhandledException"}},"uncaughtException handler",1);return new Promise(function(v){l._notify(p,function(){},function(E,x){E&&l._logger.error("Failed to send event to Bugsnag"),l._config.onUncaughtException(c,x,l._logger),v()})})},process.prependListener("uncaughtException",Wi))},destroy:function(){process.removeListener("uncaughtException",Wi)}},ln,Cg={load:function(o){!o._config.autoDetectErrors||!o._config.enabledErrorTypes.unhandledRejections||(ln=function(c){var f=o._clientContext&&o._clientContext.getStore(),l=f||o,p=!o._config.reportUnhandledPromiseRejectionsAsHandled,v=l.Event.create(c,!1,{severity:"error",unhandled:p,severityReason:{type:"unhandledPromiseRejection"}},"unhandledRejection handler",1);return new Promise(function(E){l._notify(v,function(){},function(x,M){x&&l._logger.error("Failed to send event to Bugsnag"),l._config.onUnhandledRejection(c,M,l._logger),E()})})},process.prependListener?process.prependListener("unhandledRejection",ln):process.on("unhandledRejection",ln))},destroy:function(){process.removeListener("unhandledRejection",ln)}},Lg=Yi;function Yi(o){o=o||{},this.ms=o.min||100,this.max=o.max||1e4,this.factor=o.factor||2,this.jitter=o.jitter>0&&o.jitter<=1?o.jitter:0,this.attempts=0}Yi.prototype.duration=function(){var o=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var c=Math.random(),f=Math.floor(c*this.jitter*o);o=(Math.floor(c*10)&1)==0?o-f:o+f}return Math.min(o,this.max)|0},Yi.prototype.reset=function(){this.attempts=0};function qg(o,c){o.prototype=Object.create(c.prototype),o.prototype.constructor=o,Vi(o,c)}function Vi(o,c){return Vi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(f,l){return f.__proto__=l,f},Vi(o,c)}var $g=10*1e3,Ug=require("events").EventEmitter,jg=(function(o){function c(l){var p;return p=o.call(this)||this,p._sessions=new Map,p._interval=null,p._intervalLength=l||$g,p._summarize=p._summarize.bind(p),p}qg(c,o);var f=c.prototype;return f.start=function(){this._interval||(this._interval=setInterval(this._summarize,this._intervalLength).unref())},f.stop=function(){clearInterval(this._interval),this._interval=null},f.track=function(p){var v=Fg(p.startedAt),E=this._sessions.get(v);return this._sessions.set(v,typeof E>"u"?1:E+1),p},f._summarize=function(){var p=this,v=[];this._sessions.forEach(function(E,x){v.push({startedAt:x,sessionsStarted:E}),p._sessions.delete(x)}),v.length&&this.emit("summary",v)},c})(Ug),Fg=function(o){var c=new Date(o);return c.setSeconds(0),c.setMilliseconds(0),c.toISOString()},kg={load:function(o){var c=new jg(o._config.sessionSummaryInterval);c.on("summary",zg(o)),c.start(),o._sessionDelegate={startSession:function(f,l){return f._session=l,f._pausedSession=null,c.track(f._session),f},pauseSession:function(f){f._pausedSession=f._session,f._session=null},resumeSession:function(f){return f._session?f:f._pausedSession?(f._session=f._pausedSession,f._pausedSession=null,f):f.startSession()}}},configSchema:{sessionSummaryInterval:{defaultValue:function(){},validate:function(o){return o===void 0||S()(o)},message:"should be a positive integer"}}},zg=function(o){return function(c){if(o._config.enabledReleaseStages!==null&&!o._config.enabledReleaseStages.includes(o._config.releaseStage)){o._logger.warn("Session not sent due to releaseStage/enabledReleaseStages configuration");return}if(!c.length)return;var f=new Lg({min:1e3,max:1e4}),l=10;v(p);function p(E){if(!E){var x=c.reduce(function(M,j){return M+j.sessionsStarted},0);return o._logger.debug(x+" session(s) reported")}if(f.attempts===10){o._logger.error("Session delivery failed, max retries exceeded",E);return}o._logger.debug("Session delivery failed, retry #"+(f.attempts+1)+"/"+l,E),setTimeout(function(){return v(p)},f.duration())}function v(E){var x={notifier:o._notifier,device:{},app:{releaseStage:o._config.releaseStage,version:o._config.appVersion,type:o._config.appType},sessionCounts:c},M=qi(o._cbs.sp,x,"onSessionPayload",o._logger);if(M)return o._logger.debug("Session not sent due to onSessionPayload callback"),E(null);o._delivery.sendSession(x,E)}}},Bg={load:function(o){o.addOnError(function(c){var f=c.errors.reduce(function(l,p){return l.concat(p.stacktrace)},[]);f.forEach(function(l){typeof l.file=="string"&&(l.file=l.file.replace(/\\/g,"/"))})})}},Hg={load:function(o){return o.addOnError(function(c){if(o._config.projectRoot){var f=Es(o._config.projectRoot),l=c.errors.reduce(function(p,v){return p.concat(v.stacktrace)},[]);l.map(function(p){typeof p.file=="string"&&p.file.indexOf(f)===0&&(p.file=p.file.replace(f,""))})}})}},br={};function Ki(){return Ki=Object.assign?Object.assign.bind():function(o){for(var c=1;c<arguments.length;c++){var f=arguments[c];for(var l in f)({}).hasOwnProperty.call(f,l)&&(o[l]=f[l])}return o},Ki.apply(null,arguments)}var Gg="Bugsnag Node",Wg="8.6.0",Yg="https://github.com/bugsnag/bugsnag-js",Vg=require("async_hooks"),Kg=Vg.AsyncLocalStorage;en.__type="nodejs";var Jg=Ki({},T.schema,ug),Zg=[dg,Ng,bg,Hg,kg,mg,Dg,Cg,sn,on,Bg,zi],Ie={_client:null,createClient:function(o){typeof o=="string"&&(o={apiKey:o}),o||(o={});var c=new nn(o,Jg,Zg,{name:Gg,version:Wg,url:Yg});return Object.keys(nn.prototype).forEach(function(f){var l=c[f];c[f]=function(){var p=c._clientContext&&typeof c._clientContext.getStore=="function"?c._clientContext.getStore():null,v=p||c,E=p?p[f]:l;v._depth+=1;var x=E.apply(v,arguments);return v._depth-=1,x}}),c._clientContext=new Kg,c._setDelivery(ig),c._logger.debug("Loaded!"),c},start:function(o){return Ie._client?(Ie._client._logger.warn("Bugsnag.start() was called more than once. Ignoring."),Ie._client):(Ie._client=Ie.createClient(o),Ie._client)},isStarted:function(){return Ie._client!=null}};return Object.keys(nn.prototype).forEach(function(o){/^_/.test(o)||(Ie[o]=function(){var c=Ie._client,f=c&&c._clientContext&&c._clientContext.getStore();if(f&&(c=f),!c)return console.error("Bugsnag."+o+"() was called before Bugsnag.start()");c._depth+=1;var l=c[o].apply(c,arguments);return c._depth-=1,l})}),br=Ie,br.Client=nn,br.Event=en,br.Session=ji,br.Breadcrumb=i,br.default=Ie,br})});var aa=m((AE,Ks)=>{Ks.exports=Vs()});var pn=m(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.TerritoryCodeSchema=_r.territoryCodes=void 0;var wm=require("zod");_r.territoryCodes=["AFG","AGO","AIA","ALB","ARE","ARG","ARM","ATG","AUS","AUT","AZE","BEL","BEN","BFA","BGR","BHR","BHS","BIH","BLR","BLZ","BMU","BOL","BRA","BRB","BRN","BTN","BWA","CAN","CHE","CHL","CHN","CIV","CMR","COD","COG","COL","CPV","CRI","CYM","CYP","CZE","DEU","DMA","DNK","DOM","DZA","ECU","EGY","ESP","EST","FIN","FJI","FRA","FSM","GAB","GBR","GEO","GHA","GMB","GNB","GRC","GRD","GTM","GUY","HKG","HND","HRV","HUN","IDN","IND","IRL","IRQ","ISL","ISR","ITA","JAM","JOR","JPN","KAZ","KEN","KGZ","KHM","KNA","KOR","KWT","LAO","LBN","LBR","LBY","LCA","LKA","LTU","LUX","LVA","MAC","MAR","MDA","MDG","MDV","MEX","MKD","MLI","MLT","MMR","MNE","MNG","MOZ","MRT","MSR","MUS","MWI","MYS","NAM","NER","NGA","NIC","NLD","NOR","NPL","NRU","NZL","OMN","PAK","PAN","PER","PHL","PLW","PNG","POL","PRT","PRY","QAT","ROU","RUS","RWA","SAU","SEN","SGP","SLB","SLE","SLV","SRB","STP","SUR","SVK","SVN","SWE","SWZ","SYC","TCA","TCD","THA","TJK","TKM","TON","TTO","TUN","TUR","TWN","TZA","UGA","UKR","URY","USA","UZB","VCT","VEN","VGB","VNM","VUT","XKS","YEM","ZAF","ZMB","ZWE"];_r.TerritoryCodeSchema=wm.z.enum(_r.territoryCodes)});var sa=m(wr=>{"use strict";Object.defineProperty(wr,"__esModule",{value:!0});wr.LocaleCodeSchema=wr.localeCodes=void 0;var Em=require("zod");wr.localeCodes=["ar-SA","ca","zh-Hans","zh-Hant","hr","cs","da","nl-NL","en-AU","en-CA","en-GB","en-US","fi","fr-FR","fr-CA","de-DE","el","he","hi","hu","id","it","ja","ko","ms","no","pl","pt-BR","pt-PT","ro","ru","sk","es-MX","es-ES","sv","th","tr","uk","vi"];wr.LocaleCodeSchema=Em.z.enum(wr.localeCodes)});var bt=m(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.ContextualError=void 0;Ye.isNotFoundError=Sm;Ye.isRateLimitError=Om;Ye.isNotAuthorizedError=Pm;Ye.isVersionNotUpdatableError=Am;Ye.extractClientErrorToSend=Js;var ua=require("zod-validation-error"),hn=class e extends Error{constructor(r,t){super(r),this.stack=new Error(r).stack,this.context=t,Object.setPrototypeOf(this,e.prototype)}};Ye.ContextualError=hn;function Er(e){let r=[];if(!e||typeof e!="object")return r;e.errors&&Array.isArray(e.errors)&&r.push(e);for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];Array.isArray(n)?n.forEach(i=>{r.push(...Er(i))}):n&&typeof n=="object"&&r.push(...Er(n))}return r}function Sm(e){let r=Er(e);for(let t of r)if(t.errors&&Array.isArray(t.errors)&&t.errors.some(n=>n.status==="404"||n.status===404))return!0;return e?.status===404||e?.status==="404"||e?.response?.status===404}function Om(e){if(e?.status===429||e?.status==="429")return!0;let r=Er(e);for(let t of r)if(t.errors&&Array.isArray(t.errors)&&t.errors.some(n=>n.status===429||n.status==="429"))return!0;return!1}function Pm(e){if(e?.status===401||e?.status==="401")return!0;let r=Er(e);for(let t of r)if(t.errors&&Array.isArray(t.errors)&&t.errors.some(n=>n.status===401||n.status==="401"||n.code==="NOT_AUTHORIZED"))return!0;return!1}function Am(e){if(e?.status===409||e?.status==="409")return!0;let r=Er(e);for(let t of r)if(t.errors&&Array.isArray(t.errors)&&t.errors.some(n=>n.status===409||n.status==="409"||n.code==="ENTITY_ERROR.ATTRIBUTE.INVALID.INVALID_STATE"))return!0;return!1}function Js(e){try{if(ua.isZodErrorLike&&(0,ua.isZodErrorLike)(e))return{message:(0,ua.fromError)(e).message,status:400}}catch{}if(e instanceof hn){let t=Er(e.context).flatMap(i=>Array.isArray(i.errors)?i.errors.map(a=>({title:a?.title,detail:a?.detail})):[]),n=e.message;if(e.context instanceof Error){let i=Js(e.context);n=n+`
26
+ ${i.message}`,t=t.concat(i.details||[])}return{message:n,status:400,details:t}}return typeof e=="string"?{message:e,status:400}:e instanceof Error?{message:e.message,status:400}:{message:"Internal server error",status:500}}});var gn=m(Sr=>{"use strict";Object.defineProperty(Sr,"__esModule",{value:!0});Sr.isValidProductId=void 0;Sr.deepEqualUnordered=la;Sr.readJsonFile=Mm;Sr.validateAppStoreModelData=Im;var Tm=require("zod"),Nm=require("fs"),xm=bt();function la(e,r){if(e===r)return!0;if(typeof e!=typeof r)return!1;if(Array.isArray(e)&&Array.isArray(r)){if(e.length!==r.length)return!1;let t=new Array(r.length).fill(!1);for(let n of e){let i=!1;for(let a=0;a<r.length;a++)if(!t[a]&&la(n,r[a])){t[a]=!0,i=!0;break}if(!i)return!1}return!0}if(e&&r&&typeof e=="object"){let t=Object.keys(e),n=Object.keys(r);if(t.length!==n.length)return!1;for(let i of t)if(!Object.prototype.hasOwnProperty.call(r,i)||!la(e[i],r[i]))return!1;return!0}return!1}function Mm(e){let r=(0,Nm.readFileSync)(e,"utf-8");try{return JSON.parse(r)}catch(t){throw new xm.ContextualError(`\u274C Invalid JSON format! ${e}`,{filePath:e,jsonError:t})}}var Rm=e=>/^[a-zA-Z0-9._]+$/.test(e);Sr.isValidProductId=Rm;function Im(e,r){e.primaryLocale&&e.localizations&&e.localizations.length>0&&(e.localizations.some(n=>n.locale===e.primaryLocale)||r.addIssue({code:Tm.z.ZodIssueCode.custom,message:`Primary locale '${e.primaryLocale}' must exist in the localizations array`,path:["primaryLocale"]}))}});var Zs=m((RE,Dm)=>{Dm.exports=[{duration:7,durationType:"1w",bonusPeriods:["1w","1m","2m","3m","6m","1y","3d","2w"],introOfferDurations:[{modeType:"PayUpFront",durations:[{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1}]},{modeType:"PayAsYouGo",durations:[{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:2},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:3},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:4},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:5},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:6},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:7},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:8},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:9},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:10},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:11},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:12}]},{modeType:"FreeTrial",durations:[{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_DAY",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_WEEK",numberOfPeriods:1}]}]},{duration:30,durationType:"1m",bonusPeriods:["1w","1m","2m","3m","6m","1y","3d","2w"],introOfferDurations:[{modeType:"PayUpFront",durations:[{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1}]},{modeType:"PayAsYouGo",durations:[{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:2},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:3},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:4},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:5},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:6},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:7},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:8},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:9},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:10},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:11},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:12}]},{modeType:"FreeTrial",durations:[{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_DAY",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_WEEK",numberOfPeriods:1}]}]},{duration:60,durationType:"2m",bonusPeriods:["1w","1m","2m","3m","6m","1y","3d","2w"],introOfferDurations:[{modeType:"PayUpFront",durations:[{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1}]},{modeType:"PayAsYouGo",durations:[{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:2},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:3},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:4},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:5},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:6}]},{modeType:"FreeTrial",durations:[{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_DAY",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_WEEK",numberOfPeriods:1}]}]},{duration:90,durationType:"3m",bonusPeriods:["1w","1m","2m","3m","6m","1y","3d","2w"],introOfferDurations:[{modeType:"PayUpFront",durations:[{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1}]},{modeType:"PayAsYouGo",durations:[{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:2},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:3},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:4}]},{modeType:"FreeTrial",durations:[{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_DAY",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_WEEK",numberOfPeriods:1}]}]},{duration:180,durationType:"6m",bonusPeriods:["1w","1m","2m","3m","6m","1y","3d","2w"],introOfferDurations:[{modeType:"PayUpFront",durations:[{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1}]},{modeType:"PayAsYouGo",durations:[{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:2}]},{modeType:"FreeTrial",durations:[{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_DAY",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_WEEK",numberOfPeriods:1}]}]},{duration:365,durationType:"1y",bonusPeriods:["1w","1m","2m","3m","6m","1y","3d","2w"],introOfferDurations:[{modeType:"PayUpFront",durations:[{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1}]},{modeType:"PayAsYouGo",durations:[{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1}]},{modeType:"FreeTrial",durations:[{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_DAY",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_WEEK",numberOfPeriods:1}]}]}]});var ca=m(sr=>{"use strict";var Cm=sr&&sr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(sr,"__esModule",{value:!0});sr.getValidIntroductoryOfferDurations=ru;sr.getValidPayAsYouGoPeriods=tu;sr.isValidIntroductoryOfferDuration=qm;sr.isValidPayAsYouGoPeriods=$m;var Xs=Cm(Zs()),Qs={ONE_WEEK:7,ONE_MONTH:30,TWO_MONTHS:60,THREE_MONTHS:90,SIX_MONTHS:180,ONE_YEAR:365},eu={PAY_AS_YOU_GO:"PayAsYouGo",PAY_UP_FRONT:"PayUpFront",FREE_TRIAL:"FreeTrial"};function Lm(e,r){if(r==="ONE_MONTH")switch(e){case 1:return"ONE_MONTH";case 2:return"TWO_MONTHS";case 3:return"THREE_MONTHS";case 6:return"SIX_MONTHS";default:return null}else if(r==="ONE_WEEK")switch(e){case 1:return"ONE_WEEK";case 2:return"TWO_WEEKS";default:return null}else if(r==="ONE_DAY")switch(e){case 3:return"THREE_DAYS";default:return null}else if(r==="ONE_YEAR")switch(e){case 1:return"ONE_YEAR";default:return null}return null}function ru(e,r){if(r==="PAY_AS_YOU_GO")return[];let t=Qs[e],n=eu[r],i=Xs.default.find(u=>u.duration===t);if(!i)throw new Error(`No duration configuration found for subscription period: ${e}`);let a=i.introOfferDurations.find(u=>u.modeType===n);if(!a)throw new Error(`No intro offer configuration found for offer type: ${r}`);let s=new Set;for(let u of a.durations){let d=Lm(u.typeDuration,u.typeUnit);d&&s.add(d)}return Array.from(s)}function tu(e){let r=Qs[e],t=eu.PAY_AS_YOU_GO,n=Xs.default.find(a=>a.duration===r);if(!n)throw new Error(`No duration configuration found for subscription period: ${e}`);let i=n.introOfferDurations.find(a=>a.modeType===t);if(!i)throw new Error(`No PAY_AS_YOU_GO configuration found for subscription period: ${e}`);return i.durations.map(a=>a.numberOfPeriods)}function qm(e,r,t){return r==="PAY_AS_YOU_GO"?!1:ru(e,r).includes(t)}function $m(e,r){return tu(e).includes(r)}});var we=m((DE,nu)=>{"use strict";var fa=class e extends Error{constructor(r){super(`Format functions must be synchronous taking a two arguments: (info, opts)
27
27
  Found: ${r.toString().split(`
28
28
  `)[0]}
29
- `),Error.captureStackTrace(this,e)}};eu.exports=e=>{if(e.length>2)throw new la(e);function r(n={}){this.options=n}r.prototype.transform=e;function t(n){return new r(n)}return t.Format=r,t}});var iu=m((IE,nu)=>{var tu={};nu.exports=tu;var ru={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(ru).forEach(function(e){var r=ru[e],t=tu[e]=[];t.open="\x1B["+r[0]+"m",t.close="\x1B["+r[1]+"m"})});var ou=m((DE,au)=>{"use strict";au.exports=function(e,r){r=r||process.argv||[];var t=r.indexOf("--"),n=/^-{1,2}/.test(e)?"":"--",i=r.indexOf(n+e);return i!==-1&&(t===-1?!0:i<t)}});var uu=m((CE,su)=>{"use strict";var qm=require("os"),Ce=ou(),ve=process.env,Zr=void 0;Ce("no-color")||Ce("no-colors")||Ce("color=false")?Zr=!1:(Ce("color")||Ce("colors")||Ce("color=true")||Ce("color=always"))&&(Zr=!0);"FORCE_COLOR"in ve&&(Zr=ve.FORCE_COLOR.length===0||parseInt(ve.FORCE_COLOR,10)!==0);function $m(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Um(e){if(Zr===!1)return 0;if(Ce("color=16m")||Ce("color=full")||Ce("color=truecolor"))return 3;if(Ce("color=256"))return 2;if(e&&!e.isTTY&&Zr!==!0)return 0;var r=Zr?1:0;if(process.platform==="win32"){var t=qm.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in ve)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(i){return i in ve})||ve.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in ve)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(ve.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in ve){var n=parseInt((ve.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(ve.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(ve.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(ve.TERM)||"COLORTERM"in ve?1:(ve.TERM==="dumb",r)}function ca(e){var r=Um(e);return $m(r)}su.exports={supportsColor:ca,stdout:ca(process.stdout),stderr:ca(process.stderr)}});var cu=m((LE,lu)=>{lu.exports=function(r,t){var n="";r=r||"Run the trap, drop the bass",r=r.split("");var i={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2","\u0E3F"],c:["\xA9","\u023B","\u03FE"],d:["\xD0","\u018A","\u0500","\u0501","\u0502","\u0503"],e:["\xCB","\u0115","\u018E","\u0258","\u03A3","\u03BE","\u04BC","\u0A6C"],f:["\u04FA"],g:["\u0262"],h:["\u0126","\u0195","\u04A2","\u04BA","\u04C7","\u050A"],i:["\u0F0F"],j:["\u0134"],k:["\u0138","\u04A0","\u04C3","\u051E"],l:["\u0139"],m:["\u028D","\u04CD","\u04CE","\u0520","\u0521","\u0D69"],n:["\xD1","\u014B","\u019D","\u0376","\u03A0","\u048A"],o:["\xD8","\xF5","\xF8","\u01FE","\u0298","\u047A","\u05DD","\u06DD","\u0E4F"],p:["\u01F7","\u048E"],q:["\u09CD"],r:["\xAE","\u01A6","\u0210","\u024C","\u0280","\u042F"],s:["\xA7","\u03DE","\u03DF","\u03E8"],t:["\u0141","\u0166","\u0373"],u:["\u01B1","\u054D"],v:["\u05D8"],w:["\u0428","\u0460","\u047C","\u0D70"],x:["\u04B2","\u04FE","\u04FC","\u04FD"],y:["\xA5","\u04B0","\u04CB"],z:["\u01B5","\u0240"]};return r.forEach(function(a){a=a.toLowerCase();var s=i[a]||[" "],u=Math.floor(Math.random()*s.length);typeof i[a]<"u"?n+=i[a][u]:n+=a}),n}});var du=m((qE,fu)=>{fu.exports=function(r,t){r=r||" he is here ";var n={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},i=[].concat(n.up,n.down,n.mid);function a(d){var h=Math.floor(Math.random()*d);return h}function s(d){var h=!1;return i.filter(function(y){h=y===d}),h}function u(d,h){var y="",b,_;h=h||{},h.up=typeof h.up<"u"?h.up:!0,h.mid=typeof h.mid<"u"?h.mid:!0,h.down=typeof h.down<"u"?h.down:!0,h.size=typeof h.size<"u"?h.size:"maxi",d=d.split("");for(_ in d)if(!s(_)){switch(y=y+d[_],b={up:0,down:0,mid:0},h.size){case"mini":b.up=a(8),b.mid=a(2),b.down=a(8);break;case"maxi":b.up=a(16)+3,b.mid=a(4)+1,b.down=a(64)+3;break;default:b.up=a(8)+1,b.mid=a(6)/2,b.down=a(8)+1;break}var S=["up","mid","down"];for(var g in S)for(var w=S[g],T=0;T<=b[w];T++)h[w]&&(y=y+n[w][a(n[w].length)])}return y}return u(r,t)}});var hu=m(($E,pu)=>{pu.exports=function(e){return function(r,t,n){if(r===" ")return r;switch(t%3){case 0:return e.red(r);case 1:return e.white(r);case 2:return e.blue(r)}}}});var mu=m((UE,gu)=>{gu.exports=function(e){return function(r,t,n){return t%2===0?r:e.inverse(r)}}});var vu=m((jE,yu)=>{yu.exports=function(e){var r=["red","yellow","green","blue","magenta"];return function(t,n,i){return t===" "?t:e[r[n++%r.length]](t)}}});var _u=m((FE,bu)=>{bu.exports=function(e){var r=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(t,n,i){return t===" "?t:e[r[Math.round(Math.random()*(r.length-2))]](t)}}});var Au=m((zE,Pu)=>{var k={};Pu.exports=k;k.themes={};var jm=require("util"),Or=k.styles=iu(),Eu=Object.defineProperties,Fm=new RegExp(/[\r\n]+/g);k.supportsColor=uu().supportsColor;typeof k.enabled>"u"&&(k.enabled=k.supportsColor()!==!1);k.enable=function(){k.enabled=!0};k.disable=function(){k.enabled=!1};k.stripColors=k.strip=function(e){return(""+e).replace(/\x1B\[\d+m/g,"")};var kE=k.stylize=function(r,t){if(!k.enabled)return r+"";var n=Or[t];return!n&&t in k?k[t](r):n.open+r+n.close},km=/[|\\{}()[\]^$+*?.]/g,zm=function(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(km,"\\$&")};function Su(e){var r=function t(){return Hm.apply(t,arguments)};return r._styles=e,r.__proto__=Bm,r}var Ou=(function(){var e={};return Or.grey=Or.gray,Object.keys(Or).forEach(function(r){Or[r].closeRe=new RegExp(zm(Or[r].close),"g"),e[r]={get:function(){return Su(this._styles.concat(r))}}}),e})(),Bm=Eu(function(){},Ou);function Hm(){var e=Array.prototype.slice.call(arguments),r=e.map(function(s){return s!=null&&s.constructor===String?s:jm.inspect(s)}).join(" ");if(!k.enabled||!r)return r;for(var t=r.indexOf(`
30
- `)!=-1,n=this._styles,i=n.length;i--;){var a=Or[n[i]];r=a.open+r.replace(a.closeRe,a.open)+a.close,t&&(r=r.replace(Fm,function(s){return a.close+s+a.open}))}return r}k.setTheme=function(e){if(typeof e=="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var r in e)(function(t){k[t]=function(n){if(typeof e[t]=="object"){var i=n;for(var a in e[t])i=k[e[t][a]](i);return i}return k[e[t]](n)}})(r)};function Gm(){var e={};return Object.keys(Ou).forEach(function(r){e[r]={get:function(){return Su([r])}}}),e}var Wm=function(r,t){var n=t.split("");return n=n.map(r),n.join("")};k.trap=cu();k.zalgo=du();k.maps={};k.maps.america=hu()(k);k.maps.zebra=mu()(k);k.maps.rainbow=vu()(k);k.maps.random=_u()(k);for(wu in k.maps)(function(e){k[e]=function(r){return Wm(k.maps[e],r)}})(wu);var wu;Eu(k,Gm())});var fa=m((BE,Tu)=>{var Ym=Au();Tu.exports=Ym});var Nu=m(da=>{"use strict";da.levels={error:0,warn:1,help:2,data:3,info:4,debug:5,prompt:6,verbose:7,input:8,silly:9};da.colors={error:"red",warn:"yellow",help:"cyan",data:"grey",info:"green",debug:"blue",prompt:"grey",verbose:"cyan",input:"grey",silly:"magenta"}});var xu=m(pa=>{"use strict";pa.levels={error:0,warn:1,info:2,http:3,verbose:4,debug:5,silly:6};pa.colors={error:"red",warn:"yellow",info:"green",http:"green",verbose:"cyan",debug:"blue",silly:"magenta"}});var Mu=m(ha=>{"use strict";ha.levels={emerg:0,alert:1,crit:2,error:3,warning:4,notice:5,info:6,debug:7};ha.colors={emerg:"red",alert:"yellow",crit:"red",error:"red",warning:"red",notice:"yellow",info:"green",debug:"blue"}});var Ru=m(mn=>{"use strict";Object.defineProperty(mn,"cli",{value:Nu()});Object.defineProperty(mn,"npm",{value:xu()});Object.defineProperty(mn,"syslog",{value:Mu()})});var ae=m(_t=>{"use strict";Object.defineProperty(_t,"LEVEL",{value:Symbol.for("level")});Object.defineProperty(_t,"MESSAGE",{value:Symbol.for("message")});Object.defineProperty(_t,"SPLAT",{value:Symbol.for("splat")});Object.defineProperty(_t,"configs",{value:Ru()})});var bn=m((KE,vn)=>{"use strict";var ya=fa(),{LEVEL:ga,MESSAGE:ma}=ae();ya.enabled=!0;var Iu=/\s+/,yn=class e{constructor(r={}){r.colors&&this.addColors(r.colors),this.options=r}static addColors(r){let t=Object.keys(r).reduce((n,i)=>(n[i]=Iu.test(r[i])?r[i].split(Iu):r[i],n),{});return e.allColors=Object.assign({},e.allColors||{},t),e.allColors}addColors(r){return e.addColors(r)}colorize(r,t,n){if(typeof n>"u"&&(n=t),!Array.isArray(e.allColors[r]))return ya[e.allColors[r]](n);for(let i=0,a=e.allColors[r].length;i<a;i++)n=ya[e.allColors[r][i]](n);return n}transform(r,t){return t.all&&typeof r[ma]=="string"&&(r[ma]=this.colorize(r[ga],r.level,r[ma])),(t.level||t.all||!t.message)&&(r.level=this.colorize(r[ga],r.level)),(t.all||t.message)&&(r.message=this.colorize(r[ga],r.level,r.message)),r}};vn.exports=e=>new yn(e);vn.exports.Colorizer=vn.exports.Format=yn});var Cu=m((JE,Du)=>{"use strict";var{Colorizer:Vm}=bn();Du.exports=e=>(Vm.addColors(e.colors||e),e)});var qu=m((ZE,Lu)=>{"use strict";var Km=we();Lu.exports=Km(e=>(e.message=` ${e.message}`,e))});var ju=m((XE,Uu)=>{"use strict";var Jm=we(),{LEVEL:$u,MESSAGE:va}=ae();Uu.exports=Jm((e,{stack:r,cause:t})=>{if(e instanceof Error){let i=Object.assign({},e,{level:e.level,[$u]:e[$u]||e.level,message:e.message,[va]:e[va]||e.message});return r&&(i.stack=e.stack),t&&(i.cause=e.cause),i}if(!(e.message instanceof Error))return e;let n=e.message;return Object.assign(e,n),e.message=n.message,e[va]=n.message,r&&(e.stack=n.stack),t&&(e.cause=n.cause),e})});var _a=m((QE,wn)=>{"use strict";var{configs:Zm,LEVEL:Fu,MESSAGE:ba}=ae(),_n=class e{constructor(r={levels:Zm.npm.levels}){this.paddings=e.paddingForLevels(r.levels,r.filler),this.options=r}static getLongestLevel(r){let t=Object.keys(r).map(n=>n.length);return Math.max(...t)}static paddingForLevel(r,t,n){let i=n+1-r.length,a=Math.floor(i/t.length);return`${t}${t.repeat(a)}`.slice(0,i)}static paddingForLevels(r,t=" "){let n=e.getLongestLevel(r);return Object.keys(r).reduce((i,a)=>(i[a]=e.paddingForLevel(a,t,n),i),{})}transform(r,t){return r.message=`${this.paddings[r[Fu]]}${r.message}`,r[ba]&&(r[ba]=`${this.paddings[r[Fu]]}${r[ba]}`),r}};wn.exports=e=>new _n(e);wn.exports.Padder=wn.exports.Format=_n});var ku=m((eS,wa)=>{"use strict";var{Colorizer:Xm}=bn(),{Padder:Qm}=_a(),{configs:ey,MESSAGE:ry}=ae(),En=class{constructor(r={}){r.levels||(r.levels=ey.cli.levels),this.colorizer=new Xm(r),this.padder=new Qm(r),this.options=r}transform(r,t){return this.colorizer.transform(this.padder.transform(r,t),t),r[ry]=`${r.level}:${r.message}`,r}};wa.exports=e=>new En(e);wa.exports.Format=En});var Bu=m((rS,Ea)=>{"use strict";var ty=we();function zu(e){if(e.every(ny))return r=>{let t=r;for(let n=0;n<e.length;n++)if(t=e[n].transform(t,e[n].options),!t)return!1;return t}}function ny(e){if(typeof e.transform!="function")throw new Error(["No transform function found on format. Did you create a format instance?","const myFormat = format(formatFn);","const instance = myFormat();"].join(`
31
- `));return!0}Ea.exports=(...e)=>{let r=ty(zu(e)),t=r();return t.Format=r.Format,t};Ea.exports.cascade=zu});var Et=m((Aa,Wu)=>{"use strict";var{hasOwnProperty:wt}=Object.prototype,Ar=Pa();Ar.configure=Pa;Ar.stringify=Ar;Ar.default=Ar;Aa.stringify=Ar;Aa.configure=Pa;Wu.exports=Ar;var iy=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function ur(e){return e.length<5e3&&!iy.test(e)?`"${e}"`:JSON.stringify(e)}function Sa(e,r){if(e.length>200||r)return e.sort(r);for(let t=1;t<e.length;t++){let n=e[t],i=t;for(;i!==0&&e[i-1]>n;)e[i]=e[i-1],i--;e[i]=n}return e}var ay=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function Oa(e){return ay.call(e)!==void 0&&e.length!==0}function Hu(e,r,t){e.length<t&&(t=e.length);let n=r===","?"":" ",i=`"0":${n}${e[0]}`;for(let a=1;a<t;a++)i+=`${r}"${a}":${n}${e[a]}`;return i}function oy(e){if(wt.call(e,"circularValue")){let r=e.circularValue;if(typeof r=="string")return`"${r}"`;if(r==null)return r;if(r===Error||r===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function sy(e){let r;if(wt.call(e,"deterministic")&&(r=e.deterministic,typeof r!="boolean"&&typeof r!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return r===void 0?!0:r}function uy(e,r){let t;if(wt.call(e,r)&&(t=e[r],typeof t!="boolean"))throw new TypeError(`The "${r}" argument must be of type boolean`);return t===void 0?!0:t}function Gu(e,r){let t;if(wt.call(e,r)){if(t=e[r],typeof t!="number")throw new TypeError(`The "${r}" argument must be of type number`);if(!Number.isInteger(t))throw new TypeError(`The "${r}" argument must be an integer`);if(t<1)throw new RangeError(`The "${r}" argument must be >= 1`)}return t===void 0?1/0:t}function Pr(e){return e===1?"1 item":`${e} items`}function ly(e){let r=new Set;for(let t of e)(typeof t=="string"||typeof t=="number")&&r.add(String(t));return r}function cy(e){if(wt.call(e,"strict")){let r=e.strict;if(typeof r!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(r)return t=>{let n=`Object can not safely be stringified. Received type ${typeof t}`;throw typeof t!="function"&&(n+=` (${t.toString()})`),new Error(n)}}}function Pa(e){e={...e};let r=cy(e);r&&(e.bigint===void 0&&(e.bigint=!1),"circularValue"in e||(e.circularValue=Error));let t=oy(e),n=uy(e,"bigint"),i=sy(e),a=typeof i=="function"?i:void 0,s=Gu(e,"maximumDepth"),u=Gu(e,"maximumBreadth");function d(S,g,w,T,D,$){let P=g[S];switch(typeof P=="object"&&P!==null&&typeof P.toJSON=="function"&&(P=P.toJSON(S)),P=T.call(g,S,P),typeof P){case"string":return ur(P);case"object":{if(P===null)return"null";if(w.indexOf(P)!==-1)return t;let C="",z=",",Y=$;if(Array.isArray(P)){if(P.length===0)return"[]";if(s<w.length+1)return'"[Array]"';w.push(P),D!==""&&($+=D,C+=`
29
+ `),Error.captureStackTrace(this,e)}};nu.exports=e=>{if(e.length>2)throw new fa(e);function r(n={}){this.options=n}r.prototype.transform=e;function t(n){return new r(n)}return t.Format=r,t}});var su=m((CE,ou)=>{var au={};ou.exports=au;var iu={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(iu).forEach(function(e){var r=iu[e],t=au[e]=[];t.open="\x1B["+r[0]+"m",t.close="\x1B["+r[1]+"m"})});var lu=m((LE,uu)=>{"use strict";uu.exports=function(e,r){r=r||process.argv||[];var t=r.indexOf("--"),n=/^-{1,2}/.test(e)?"":"--",i=r.indexOf(n+e);return i!==-1&&(t===-1?!0:i<t)}});var fu=m((qE,cu)=>{"use strict";var Um=require("os"),Ce=lu(),ve=process.env,Zr=void 0;Ce("no-color")||Ce("no-colors")||Ce("color=false")?Zr=!1:(Ce("color")||Ce("colors")||Ce("color=true")||Ce("color=always"))&&(Zr=!0);"FORCE_COLOR"in ve&&(Zr=ve.FORCE_COLOR.length===0||parseInt(ve.FORCE_COLOR,10)!==0);function jm(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Fm(e){if(Zr===!1)return 0;if(Ce("color=16m")||Ce("color=full")||Ce("color=truecolor"))return 3;if(Ce("color=256"))return 2;if(e&&!e.isTTY&&Zr!==!0)return 0;var r=Zr?1:0;if(process.platform==="win32"){var t=Um.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in ve)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(i){return i in ve})||ve.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in ve)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(ve.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in ve){var n=parseInt((ve.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(ve.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(ve.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(ve.TERM)||"COLORTERM"in ve?1:(ve.TERM==="dumb",r)}function da(e){var r=Fm(e);return jm(r)}cu.exports={supportsColor:da,stdout:da(process.stdout),stderr:da(process.stderr)}});var pu=m(($E,du)=>{du.exports=function(r,t){var n="";r=r||"Run the trap, drop the bass",r=r.split("");var i={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2","\u0E3F"],c:["\xA9","\u023B","\u03FE"],d:["\xD0","\u018A","\u0500","\u0501","\u0502","\u0503"],e:["\xCB","\u0115","\u018E","\u0258","\u03A3","\u03BE","\u04BC","\u0A6C"],f:["\u04FA"],g:["\u0262"],h:["\u0126","\u0195","\u04A2","\u04BA","\u04C7","\u050A"],i:["\u0F0F"],j:["\u0134"],k:["\u0138","\u04A0","\u04C3","\u051E"],l:["\u0139"],m:["\u028D","\u04CD","\u04CE","\u0520","\u0521","\u0D69"],n:["\xD1","\u014B","\u019D","\u0376","\u03A0","\u048A"],o:["\xD8","\xF5","\xF8","\u01FE","\u0298","\u047A","\u05DD","\u06DD","\u0E4F"],p:["\u01F7","\u048E"],q:["\u09CD"],r:["\xAE","\u01A6","\u0210","\u024C","\u0280","\u042F"],s:["\xA7","\u03DE","\u03DF","\u03E8"],t:["\u0141","\u0166","\u0373"],u:["\u01B1","\u054D"],v:["\u05D8"],w:["\u0428","\u0460","\u047C","\u0D70"],x:["\u04B2","\u04FE","\u04FC","\u04FD"],y:["\xA5","\u04B0","\u04CB"],z:["\u01B5","\u0240"]};return r.forEach(function(a){a=a.toLowerCase();var s=i[a]||[" "],u=Math.floor(Math.random()*s.length);typeof i[a]<"u"?n+=i[a][u]:n+=a}),n}});var gu=m((UE,hu)=>{hu.exports=function(r,t){r=r||" he is here ";var n={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},i=[].concat(n.up,n.down,n.mid);function a(d){var h=Math.floor(Math.random()*d);return h}function s(d){var h=!1;return i.filter(function(y){h=y===d}),h}function u(d,h){var y="",b,_;h=h||{},h.up=typeof h.up<"u"?h.up:!0,h.mid=typeof h.mid<"u"?h.mid:!0,h.down=typeof h.down<"u"?h.down:!0,h.size=typeof h.size<"u"?h.size:"maxi",d=d.split("");for(_ in d)if(!s(_)){switch(y=y+d[_],b={up:0,down:0,mid:0},h.size){case"mini":b.up=a(8),b.mid=a(2),b.down=a(8);break;case"maxi":b.up=a(16)+3,b.mid=a(4)+1,b.down=a(64)+3;break;default:b.up=a(8)+1,b.mid=a(6)/2,b.down=a(8)+1;break}var S=["up","mid","down"];for(var g in S)for(var w=S[g],T=0;T<=b[w];T++)h[w]&&(y=y+n[w][a(n[w].length)])}return y}return u(r,t)}});var yu=m((jE,mu)=>{mu.exports=function(e){return function(r,t,n){if(r===" ")return r;switch(t%3){case 0:return e.red(r);case 1:return e.white(r);case 2:return e.blue(r)}}}});var bu=m((FE,vu)=>{vu.exports=function(e){return function(r,t,n){return t%2===0?r:e.inverse(r)}}});var wu=m((kE,_u)=>{_u.exports=function(e){var r=["red","yellow","green","blue","magenta"];return function(t,n,i){return t===" "?t:e[r[n++%r.length]](t)}}});var Su=m((zE,Eu)=>{Eu.exports=function(e){var r=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(t,n,i){return t===" "?t:e[r[Math.round(Math.random()*(r.length-2))]](t)}}});var xu=m((HE,Nu)=>{var k={};Nu.exports=k;k.themes={};var km=require("util"),Or=k.styles=su(),Pu=Object.defineProperties,zm=new RegExp(/[\r\n]+/g);k.supportsColor=fu().supportsColor;typeof k.enabled>"u"&&(k.enabled=k.supportsColor()!==!1);k.enable=function(){k.enabled=!0};k.disable=function(){k.enabled=!1};k.stripColors=k.strip=function(e){return(""+e).replace(/\x1B\[\d+m/g,"")};var BE=k.stylize=function(r,t){if(!k.enabled)return r+"";var n=Or[t];return!n&&t in k?k[t](r):n.open+r+n.close},Bm=/[|\\{}()[\]^$+*?.]/g,Hm=function(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(Bm,"\\$&")};function Au(e){var r=function t(){return Wm.apply(t,arguments)};return r._styles=e,r.__proto__=Gm,r}var Tu=(function(){var e={};return Or.grey=Or.gray,Object.keys(Or).forEach(function(r){Or[r].closeRe=new RegExp(Hm(Or[r].close),"g"),e[r]={get:function(){return Au(this._styles.concat(r))}}}),e})(),Gm=Pu(function(){},Tu);function Wm(){var e=Array.prototype.slice.call(arguments),r=e.map(function(s){return s!=null&&s.constructor===String?s:km.inspect(s)}).join(" ");if(!k.enabled||!r)return r;for(var t=r.indexOf(`
30
+ `)!=-1,n=this._styles,i=n.length;i--;){var a=Or[n[i]];r=a.open+r.replace(a.closeRe,a.open)+a.close,t&&(r=r.replace(zm,function(s){return a.close+s+a.open}))}return r}k.setTheme=function(e){if(typeof e=="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var r in e)(function(t){k[t]=function(n){if(typeof e[t]=="object"){var i=n;for(var a in e[t])i=k[e[t][a]](i);return i}return k[e[t]](n)}})(r)};function Ym(){var e={};return Object.keys(Tu).forEach(function(r){e[r]={get:function(){return Au([r])}}}),e}var Vm=function(r,t){var n=t.split("");return n=n.map(r),n.join("")};k.trap=pu();k.zalgo=gu();k.maps={};k.maps.america=yu()(k);k.maps.zebra=bu()(k);k.maps.rainbow=wu()(k);k.maps.random=Su()(k);for(Ou in k.maps)(function(e){k[e]=function(r){return Vm(k.maps[e],r)}})(Ou);var Ou;Pu(k,Ym())});var pa=m((GE,Mu)=>{var Km=xu();Mu.exports=Km});var Ru=m(ha=>{"use strict";ha.levels={error:0,warn:1,help:2,data:3,info:4,debug:5,prompt:6,verbose:7,input:8,silly:9};ha.colors={error:"red",warn:"yellow",help:"cyan",data:"grey",info:"green",debug:"blue",prompt:"grey",verbose:"cyan",input:"grey",silly:"magenta"}});var Iu=m(ga=>{"use strict";ga.levels={error:0,warn:1,info:2,http:3,verbose:4,debug:5,silly:6};ga.colors={error:"red",warn:"yellow",info:"green",http:"green",verbose:"cyan",debug:"blue",silly:"magenta"}});var Du=m(ma=>{"use strict";ma.levels={emerg:0,alert:1,crit:2,error:3,warning:4,notice:5,info:6,debug:7};ma.colors={emerg:"red",alert:"yellow",crit:"red",error:"red",warning:"red",notice:"yellow",info:"green",debug:"blue"}});var Cu=m(mn=>{"use strict";Object.defineProperty(mn,"cli",{value:Ru()});Object.defineProperty(mn,"npm",{value:Iu()});Object.defineProperty(mn,"syslog",{value:Du()})});var ae=m(_t=>{"use strict";Object.defineProperty(_t,"LEVEL",{value:Symbol.for("level")});Object.defineProperty(_t,"MESSAGE",{value:Symbol.for("message")});Object.defineProperty(_t,"SPLAT",{value:Symbol.for("splat")});Object.defineProperty(_t,"configs",{value:Cu()})});var bn=m((ZE,vn)=>{"use strict";var ba=pa(),{LEVEL:ya,MESSAGE:va}=ae();ba.enabled=!0;var Lu=/\s+/,yn=class e{constructor(r={}){r.colors&&this.addColors(r.colors),this.options=r}static addColors(r){let t=Object.keys(r).reduce((n,i)=>(n[i]=Lu.test(r[i])?r[i].split(Lu):r[i],n),{});return e.allColors=Object.assign({},e.allColors||{},t),e.allColors}addColors(r){return e.addColors(r)}colorize(r,t,n){if(typeof n>"u"&&(n=t),!Array.isArray(e.allColors[r]))return ba[e.allColors[r]](n);for(let i=0,a=e.allColors[r].length;i<a;i++)n=ba[e.allColors[r][i]](n);return n}transform(r,t){return t.all&&typeof r[va]=="string"&&(r[va]=this.colorize(r[ya],r.level,r[va])),(t.level||t.all||!t.message)&&(r.level=this.colorize(r[ya],r.level)),(t.all||t.message)&&(r.message=this.colorize(r[ya],r.level,r.message)),r}};vn.exports=e=>new yn(e);vn.exports.Colorizer=vn.exports.Format=yn});var $u=m((XE,qu)=>{"use strict";var{Colorizer:Jm}=bn();qu.exports=e=>(Jm.addColors(e.colors||e),e)});var ju=m((QE,Uu)=>{"use strict";var Zm=we();Uu.exports=Zm(e=>(e.message=` ${e.message}`,e))});var zu=m((eS,ku)=>{"use strict";var Xm=we(),{LEVEL:Fu,MESSAGE:_a}=ae();ku.exports=Xm((e,{stack:r,cause:t})=>{if(e instanceof Error){let i=Object.assign({},e,{level:e.level,[Fu]:e[Fu]||e.level,message:e.message,[_a]:e[_a]||e.message});return r&&(i.stack=e.stack),t&&(i.cause=e.cause),i}if(!(e.message instanceof Error))return e;let n=e.message;return Object.assign(e,n),e.message=n.message,e[_a]=n.message,r&&(e.stack=n.stack),t&&(e.cause=n.cause),e})});var Ea=m((rS,wn)=>{"use strict";var{configs:Qm,LEVEL:Bu,MESSAGE:wa}=ae(),_n=class e{constructor(r={levels:Qm.npm.levels}){this.paddings=e.paddingForLevels(r.levels,r.filler),this.options=r}static getLongestLevel(r){let t=Object.keys(r).map(n=>n.length);return Math.max(...t)}static paddingForLevel(r,t,n){let i=n+1-r.length,a=Math.floor(i/t.length);return`${t}${t.repeat(a)}`.slice(0,i)}static paddingForLevels(r,t=" "){let n=e.getLongestLevel(r);return Object.keys(r).reduce((i,a)=>(i[a]=e.paddingForLevel(a,t,n),i),{})}transform(r,t){return r.message=`${this.paddings[r[Bu]]}${r.message}`,r[wa]&&(r[wa]=`${this.paddings[r[Bu]]}${r[wa]}`),r}};wn.exports=e=>new _n(e);wn.exports.Padder=wn.exports.Format=_n});var Hu=m((tS,Sa)=>{"use strict";var{Colorizer:ey}=bn(),{Padder:ry}=Ea(),{configs:ty,MESSAGE:ny}=ae(),En=class{constructor(r={}){r.levels||(r.levels=ty.cli.levels),this.colorizer=new ey(r),this.padder=new ry(r),this.options=r}transform(r,t){return this.colorizer.transform(this.padder.transform(r,t),t),r[ny]=`${r.level}:${r.message}`,r}};Sa.exports=e=>new En(e);Sa.exports.Format=En});var Wu=m((nS,Oa)=>{"use strict";var iy=we();function Gu(e){if(e.every(ay))return r=>{let t=r;for(let n=0;n<e.length;n++)if(t=e[n].transform(t,e[n].options),!t)return!1;return t}}function ay(e){if(typeof e.transform!="function")throw new Error(["No transform function found on format. Did you create a format instance?","const myFormat = format(formatFn);","const instance = myFormat();"].join(`
31
+ `));return!0}Oa.exports=(...e)=>{let r=iy(Gu(e)),t=r();return t.Format=r.Format,t};Oa.exports.cascade=Gu});var Et=m((Na,Ku)=>{"use strict";var{hasOwnProperty:wt}=Object.prototype,Ar=Ta();Ar.configure=Ta;Ar.stringify=Ar;Ar.default=Ar;Na.stringify=Ar;Na.configure=Ta;Ku.exports=Ar;var oy=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function ur(e){return e.length<5e3&&!oy.test(e)?`"${e}"`:JSON.stringify(e)}function Pa(e,r){if(e.length>200||r)return e.sort(r);for(let t=1;t<e.length;t++){let n=e[t],i=t;for(;i!==0&&e[i-1]>n;)e[i]=e[i-1],i--;e[i]=n}return e}var sy=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function Aa(e){return sy.call(e)!==void 0&&e.length!==0}function Yu(e,r,t){e.length<t&&(t=e.length);let n=r===","?"":" ",i=`"0":${n}${e[0]}`;for(let a=1;a<t;a++)i+=`${r}"${a}":${n}${e[a]}`;return i}function uy(e){if(wt.call(e,"circularValue")){let r=e.circularValue;if(typeof r=="string")return`"${r}"`;if(r==null)return r;if(r===Error||r===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function ly(e){let r;if(wt.call(e,"deterministic")&&(r=e.deterministic,typeof r!="boolean"&&typeof r!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return r===void 0?!0:r}function cy(e,r){let t;if(wt.call(e,r)&&(t=e[r],typeof t!="boolean"))throw new TypeError(`The "${r}" argument must be of type boolean`);return t===void 0?!0:t}function Vu(e,r){let t;if(wt.call(e,r)){if(t=e[r],typeof t!="number")throw new TypeError(`The "${r}" argument must be of type number`);if(!Number.isInteger(t))throw new TypeError(`The "${r}" argument must be an integer`);if(t<1)throw new RangeError(`The "${r}" argument must be >= 1`)}return t===void 0?1/0:t}function Pr(e){return e===1?"1 item":`${e} items`}function fy(e){let r=new Set;for(let t of e)(typeof t=="string"||typeof t=="number")&&r.add(String(t));return r}function dy(e){if(wt.call(e,"strict")){let r=e.strict;if(typeof r!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(r)return t=>{let n=`Object can not safely be stringified. Received type ${typeof t}`;throw typeof t!="function"&&(n+=` (${t.toString()})`),new Error(n)}}}function Ta(e){e={...e};let r=dy(e);r&&(e.bigint===void 0&&(e.bigint=!1),"circularValue"in e||(e.circularValue=Error));let t=uy(e),n=cy(e,"bigint"),i=ly(e),a=typeof i=="function"?i:void 0,s=Vu(e,"maximumDepth"),u=Vu(e,"maximumBreadth");function d(S,g,w,T,D,$){let P=g[S];switch(typeof P=="object"&&P!==null&&typeof P.toJSON=="function"&&(P=P.toJSON(S)),P=T.call(g,S,P),typeof P){case"string":return ur(P);case"object":{if(P===null)return"null";if(w.indexOf(P)!==-1)return t;let L="",z=",",Y=$;if(Array.isArray(P)){if(P.length===0)return"[]";if(s<w.length+1)return'"[Array]"';w.push(P),D!==""&&($+=D,L+=`
32
32
  ${$}`,z=`,
33
- ${$}`);let te=Math.min(P.length,u),ce=0;for(;ce<te-1;ce++){let $e=d(String(ce),P,w,T,D,$);C+=$e!==void 0?$e:"null",C+=z}let fe=d(String(ce),P,w,T,D,$);if(C+=fe!==void 0?fe:"null",P.length-1>u){let $e=P.length-u-1;C+=`${z}"... ${Pr($e)} not stringified"`}return D!==""&&(C+=`
34
- ${Y}`),w.pop(),`[${C}]`}let B=Object.keys(P),G=B.length;if(G===0)return"{}";if(s<w.length+1)return'"[Object]"';let U="",Z="";D!==""&&($+=D,z=`,
35
- ${$}`,U=" ");let ne=Math.min(G,u);i&&!Oa(P)&&(B=Sa(B,a)),w.push(P);for(let te=0;te<ne;te++){let ce=B[te],fe=d(ce,P,w,T,D,$);fe!==void 0&&(C+=`${Z}${ur(ce)}:${U}${fe}`,Z=z)}if(G>u){let te=G-u;C+=`${Z}"...":${U}"${Pr(te)} not stringified"`,Z=z}return D!==""&&Z.length>1&&(C=`
36
- ${$}${C}
37
- ${Y}`),w.pop(),`{${C}}`}case"number":return isFinite(P)?String(P):r?r(P):"null";case"boolean":return P===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(P);default:return r?r(P):void 0}}function h(S,g,w,T,D,$){switch(typeof g=="object"&&g!==null&&typeof g.toJSON=="function"&&(g=g.toJSON(S)),typeof g){case"string":return ur(g);case"object":{if(g===null)return"null";if(w.indexOf(g)!==-1)return t;let P=$,C="",z=",";if(Array.isArray(g)){if(g.length===0)return"[]";if(s<w.length+1)return'"[Array]"';w.push(g),D!==""&&($+=D,C+=`
33
+ ${$}`);let te=Math.min(P.length,u),ce=0;for(;ce<te-1;ce++){let $e=d(String(ce),P,w,T,D,$);L+=$e!==void 0?$e:"null",L+=z}let fe=d(String(ce),P,w,T,D,$);if(L+=fe!==void 0?fe:"null",P.length-1>u){let $e=P.length-u-1;L+=`${z}"... ${Pr($e)} not stringified"`}return D!==""&&(L+=`
34
+ ${Y}`),w.pop(),`[${L}]`}let B=Object.keys(P),G=B.length;if(G===0)return"{}";if(s<w.length+1)return'"[Object]"';let U="",Z="";D!==""&&($+=D,z=`,
35
+ ${$}`,U=" ");let ne=Math.min(G,u);i&&!Aa(P)&&(B=Pa(B,a)),w.push(P);for(let te=0;te<ne;te++){let ce=B[te],fe=d(ce,P,w,T,D,$);fe!==void 0&&(L+=`${Z}${ur(ce)}:${U}${fe}`,Z=z)}if(G>u){let te=G-u;L+=`${Z}"...":${U}"${Pr(te)} not stringified"`,Z=z}return D!==""&&Z.length>1&&(L=`
36
+ ${$}${L}
37
+ ${Y}`),w.pop(),`{${L}}`}case"number":return isFinite(P)?String(P):r?r(P):"null";case"boolean":return P===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(P);default:return r?r(P):void 0}}function h(S,g,w,T,D,$){switch(typeof g=="object"&&g!==null&&typeof g.toJSON=="function"&&(g=g.toJSON(S)),typeof g){case"string":return ur(g);case"object":{if(g===null)return"null";if(w.indexOf(g)!==-1)return t;let P=$,L="",z=",";if(Array.isArray(g)){if(g.length===0)return"[]";if(s<w.length+1)return'"[Array]"';w.push(g),D!==""&&($+=D,L+=`
38
38
  ${$}`,z=`,
39
- ${$}`);let G=Math.min(g.length,u),U=0;for(;U<G-1;U++){let ne=h(String(U),g[U],w,T,D,$);C+=ne!==void 0?ne:"null",C+=z}let Z=h(String(U),g[U],w,T,D,$);if(C+=Z!==void 0?Z:"null",g.length-1>u){let ne=g.length-u-1;C+=`${z}"... ${Pr(ne)} not stringified"`}return D!==""&&(C+=`
40
- ${P}`),w.pop(),`[${C}]`}w.push(g);let Y="";D!==""&&($+=D,z=`,
41
- ${$}`,Y=" ");let B="";for(let G of T){let U=h(G,g[G],w,T,D,$);U!==void 0&&(C+=`${B}${ur(G)}:${Y}${U}`,B=z)}return D!==""&&B.length>1&&(C=`
42
- ${$}${C}
43
- ${P}`),w.pop(),`{${C}}`}case"number":return isFinite(g)?String(g):r?r(g):"null";case"boolean":return g===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(g);default:return r?r(g):void 0}}function y(S,g,w,T,D){switch(typeof g){case"string":return ur(g);case"object":{if(g===null)return"null";if(typeof g.toJSON=="function"){if(g=g.toJSON(S),typeof g!="object")return y(S,g,w,T,D);if(g===null)return"null"}if(w.indexOf(g)!==-1)return t;let $=D;if(Array.isArray(g)){if(g.length===0)return"[]";if(s<w.length+1)return'"[Array]"';w.push(g),D+=T;let U=`
39
+ ${$}`);let G=Math.min(g.length,u),U=0;for(;U<G-1;U++){let ne=h(String(U),g[U],w,T,D,$);L+=ne!==void 0?ne:"null",L+=z}let Z=h(String(U),g[U],w,T,D,$);if(L+=Z!==void 0?Z:"null",g.length-1>u){let ne=g.length-u-1;L+=`${z}"... ${Pr(ne)} not stringified"`}return D!==""&&(L+=`
40
+ ${P}`),w.pop(),`[${L}]`}w.push(g);let Y="";D!==""&&($+=D,z=`,
41
+ ${$}`,Y=" ");let B="";for(let G of T){let U=h(G,g[G],w,T,D,$);U!==void 0&&(L+=`${B}${ur(G)}:${Y}${U}`,B=z)}return D!==""&&B.length>1&&(L=`
42
+ ${$}${L}
43
+ ${P}`),w.pop(),`{${L}}`}case"number":return isFinite(g)?String(g):r?r(g):"null";case"boolean":return g===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(g);default:return r?r(g):void 0}}function y(S,g,w,T,D){switch(typeof g){case"string":return ur(g);case"object":{if(g===null)return"null";if(typeof g.toJSON=="function"){if(g=g.toJSON(S),typeof g!="object")return y(S,g,w,T,D);if(g===null)return"null"}if(w.indexOf(g)!==-1)return t;let $=D;if(Array.isArray(g)){if(g.length===0)return"[]";if(s<w.length+1)return'"[Array]"';w.push(g),D+=T;let U=`
44
44
  ${D}`,Z=`,
45
45
  ${D}`,ne=Math.min(g.length,u),te=0;for(;te<ne-1;te++){let fe=y(String(te),g[te],w,T,D);U+=fe!==void 0?fe:"null",U+=Z}let ce=y(String(te),g[te],w,T,D);if(U+=ce!==void 0?ce:"null",g.length-1>u){let fe=g.length-u-1;U+=`${Z}"... ${Pr(fe)} not stringified"`}return U+=`
46
- ${$}`,w.pop(),`[${U}]`}let P=Object.keys(g),C=P.length;if(C===0)return"{}";if(s<w.length+1)return'"[Object]"';D+=T;let z=`,
47
- ${D}`,Y="",B="",G=Math.min(C,u);Oa(g)&&(Y+=Hu(g,z,u),P=P.slice(g.length),G-=g.length,B=z),i&&(P=Sa(P,a)),w.push(g);for(let U=0;U<G;U++){let Z=P[U],ne=y(Z,g[Z],w,T,D);ne!==void 0&&(Y+=`${B}${ur(Z)}: ${ne}`,B=z)}if(C>u){let U=C-u;Y+=`${B}"...": "${Pr(U)} not stringified"`,B=z}return B!==""&&(Y=`
46
+ ${$}`,w.pop(),`[${U}]`}let P=Object.keys(g),L=P.length;if(L===0)return"{}";if(s<w.length+1)return'"[Object]"';D+=T;let z=`,
47
+ ${D}`,Y="",B="",G=Math.min(L,u);Aa(g)&&(Y+=Yu(g,z,u),P=P.slice(g.length),G-=g.length,B=z),i&&(P=Pa(P,a)),w.push(g);for(let U=0;U<G;U++){let Z=P[U],ne=y(Z,g[Z],w,T,D);ne!==void 0&&(Y+=`${B}${ur(Z)}: ${ne}`,B=z)}if(L>u){let U=L-u;Y+=`${B}"...": "${Pr(U)} not stringified"`,B=z}return B!==""&&(Y=`
48
48
  ${D}${Y}
49
- ${$}`),w.pop(),`{${Y}}`}case"number":return isFinite(g)?String(g):r?r(g):"null";case"boolean":return g===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(g);default:return r?r(g):void 0}}function b(S,g,w){switch(typeof g){case"string":return ur(g);case"object":{if(g===null)return"null";if(typeof g.toJSON=="function"){if(g=g.toJSON(S),typeof g!="object")return b(S,g,w);if(g===null)return"null"}if(w.indexOf(g)!==-1)return t;let T="",D=g.length!==void 0;if(D&&Array.isArray(g)){if(g.length===0)return"[]";if(s<w.length+1)return'"[Array]"';w.push(g);let Y=Math.min(g.length,u),B=0;for(;B<Y-1;B++){let U=b(String(B),g[B],w);T+=U!==void 0?U:"null",T+=","}let G=b(String(B),g[B],w);if(T+=G!==void 0?G:"null",g.length-1>u){let U=g.length-u-1;T+=`,"... ${Pr(U)} not stringified"`}return w.pop(),`[${T}]`}let $=Object.keys(g),P=$.length;if(P===0)return"{}";if(s<w.length+1)return'"[Object]"';let C="",z=Math.min(P,u);D&&Oa(g)&&(T+=Hu(g,",",u),$=$.slice(g.length),z-=g.length,C=","),i&&($=Sa($,a)),w.push(g);for(let Y=0;Y<z;Y++){let B=$[Y],G=b(B,g[B],w);G!==void 0&&(T+=`${C}${ur(B)}:${G}`,C=",")}if(P>u){let Y=P-u;T+=`${C}"...":"${Pr(Y)} not stringified"`}return w.pop(),`{${T}}`}case"number":return isFinite(g)?String(g):r?r(g):"null";case"boolean":return g===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(g);default:return r?r(g):void 0}}function _(S,g,w){if(arguments.length>1){let T="";if(typeof w=="number"?T=" ".repeat(Math.min(w,10)):typeof w=="string"&&(T=w.slice(0,10)),g!=null){if(typeof g=="function")return d("",{"":S},[],g,T,"");if(Array.isArray(g))return h("",S,[],ly(g),T,"")}if(T.length!==0)return y("",S,[],T,"")}return b("",S,[])}return _}});var Ta=m((tS,Yu)=>{"use strict";var fy=we(),{MESSAGE:dy}=ae(),py=Et();function hy(e,r){return typeof r=="bigint"?r.toString():r}Yu.exports=fy((e,r)=>{let t=py.configure(r);return e[dy]=t(e,r.replacer||hy,r.space),e})});var Ku=m((nS,Vu)=>{"use strict";var gy=we();Vu.exports=gy((e,r)=>r.message?(e.message=`[${r.label}] ${e.message}`,e):(e.label=r.label,e))});var Zu=m((iS,Ju)=>{"use strict";var my=we(),{MESSAGE:yy}=ae(),vy=Et();Ju.exports=my(e=>{let r={};return e.message&&(r["@message"]=e.message,delete e.message),e.timestamp&&(r["@timestamp"]=e.timestamp,delete e.timestamp),r["@fields"]=e,e[yy]=vy(r),e})});var Qu=m((aS,Xu)=>{"use strict";var by=we();function _y(e,r,t){let n=r.reduce((a,s)=>(a[s]=e[s],delete e[s],a),{}),i=Object.keys(e).reduce((a,s)=>(a[s]=e[s],delete e[s],a),{});return Object.assign(e,n,{[t]:i}),e}function wy(e,r,t){return e[t]=r.reduce((n,i)=>(n[i]=e[i],delete e[i],n),{}),e}Xu.exports=by((e,r={})=>{let t="metadata";r.key&&(t=r.key);let n=[];return!r.fillExcept&&!r.fillWith&&(n.push("level"),n.push("message")),r.fillExcept&&(n=r.fillExcept),n.length>0?_y(e,n,t):r.fillWith?wy(e,r.fillWith,t):e})});var rl=m((oS,el)=>{var Xr=1e3,Qr=Xr*60,et=Qr*60,Tr=et*24,Ey=Tr*7,Sy=Tr*365.25;el.exports=function(e,r){r=r||{};var t=typeof e;if(t==="string"&&e.length>0)return Oy(e);if(t==="number"&&isFinite(e))return r.long?Ay(e):Py(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Oy(e){if(e=String(e),!(e.length>100)){var r=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(r){var t=parseFloat(r[1]),n=(r[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return t*Sy;case"weeks":case"week":case"w":return t*Ey;case"days":case"day":case"d":return t*Tr;case"hours":case"hour":case"hrs":case"hr":case"h":return t*et;case"minutes":case"minute":case"mins":case"min":case"m":return t*Qr;case"seconds":case"second":case"secs":case"sec":case"s":return t*Xr;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function Py(e){var r=Math.abs(e);return r>=Tr?Math.round(e/Tr)+"d":r>=et?Math.round(e/et)+"h":r>=Qr?Math.round(e/Qr)+"m":r>=Xr?Math.round(e/Xr)+"s":e+"ms"}function Ay(e){var r=Math.abs(e);return r>=Tr?Sn(e,r,Tr,"day"):r>=et?Sn(e,r,et,"hour"):r>=Qr?Sn(e,r,Qr,"minute"):r>=Xr?Sn(e,r,Xr,"second"):e+" ms"}function Sn(e,r,t,n){var i=r>=t*1.5;return Math.round(e/t)+" "+n+(i?"s":"")}});var nl=m((St,tl)=>{"use strict";var Ty=we(),Ny=rl();tl.exports=Ty(e=>{let r=+new Date;return St.diff=r-(St.prevTime||r),St.prevTime=r,e.ms=`+${Ny(St.diff)}`,e})});var ol=m((sS,al)=>{"use strict";var xy=require("util").inspect,My=we(),{LEVEL:Ry,MESSAGE:il,SPLAT:Iy}=ae();al.exports=My((e,r={})=>{let t=Object.assign({},e);return delete t[Ry],delete t[il],delete t[Iy],e[il]=xy(t,!1,r.depth||null,r.colorize),e})});var sl=m((uS,Pn)=>{"use strict";var{MESSAGE:Dy}=ae(),On=class{constructor(r){this.template=r}transform(r){return r[Dy]=this.template(r),r}};Pn.exports=e=>new On(e);Pn.exports.Printf=Pn.exports.Format=On});var cl=m((lS,ll)=>{"use strict";var Cy=we(),{MESSAGE:ul}=ae(),Ly=Et();ll.exports=Cy(e=>{let r=Ly(Object.assign({},e,{level:void 0,message:void 0,splat:void 0})),t=e.padding&&e.padding[e.level]||"";return r!=="{}"?e[ul]=`${e.level}:${t} ${e.message} ${r}`:e[ul]=`${e.level}:${t} ${e.message}`,e})});var pl=m((cS,dl)=>{"use strict";var qy=require("util"),{SPLAT:fl}=ae(),$y=/%[scdjifoO%]/g,Uy=/%%/g,Na=class{constructor(r){this.options=r}_splat(r,t){let n=r.message,i=r[fl]||r.splat||[],a=n.match(Uy),s=a&&a.length||0,d=t.length-s-i.length,h=d<0?i.splice(d,-1*d):[],y=h.length;if(y)for(let b=0;b<y;b++)Object.assign(r,h[b]);return r.message=qy.format(n,...i),r}transform(r){let t=r.message,n=r[fl]||r.splat;if(!n||!n.length)return r;let i=t&&t.match&&t.match($y);if(!i&&(n||n.length)){let a=n.length>1?n.splice(0):n,s=a.length;if(s)for(let u=0;u<s;u++)Object.assign(r,a[u]);return r}return i?this._splat(r,i):r}};dl.exports=e=>new Na(e)});var gl=m((An,hl)=>{(function(e,r){typeof An=="object"&&typeof hl<"u"?r(An):typeof define=="function"&&define.amd?define(["exports"],r):r(e.fecha={})})(An,(function(e){"use strict";var r=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,t="\\d\\d?",n="\\d\\d",i="\\d{3}",a="\\d{4}",s="[^\\s]+",u=/\[([^]*?)\]/gm;function d(O,R){for(var V=[],ue=0,q=O.length;ue<q;ue++)V.push(O[ue].substr(0,R));return V}var h=function(O){return function(R,V){var ue=V[O].map(function(_e){return _e.toLowerCase()}),q=ue.indexOf(R.toLowerCase());return q>-1?q:null}};function y(O){for(var R=[],V=1;V<arguments.length;V++)R[V-1]=arguments[V];for(var ue=0,q=R;ue<q.length;ue++){var _e=q[ue];for(var de in _e)O[de]=_e[de]}return O}var b=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],_=["January","February","March","April","May","June","July","August","September","October","November","December"],S=d(_,3),g=d(b,3),w={dayNamesShort:g,dayNames:b,monthNamesShort:S,monthNames:_,amPm:["am","pm"],DoFn:function(O){return O+["th","st","nd","rd"][O%10>3?0:(O-O%10!==10?1:0)*O%10]}},T=y({},w),D=function(O){return T=y(T,O)},$=function(O){return O.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},P=function(O,R){for(R===void 0&&(R=2),O=String(O);O.length<R;)O="0"+O;return O},C={D:function(O){return String(O.getDate())},DD:function(O){return P(O.getDate())},Do:function(O,R){return R.DoFn(O.getDate())},d:function(O){return String(O.getDay())},dd:function(O){return P(O.getDay())},ddd:function(O,R){return R.dayNamesShort[O.getDay()]},dddd:function(O,R){return R.dayNames[O.getDay()]},M:function(O){return String(O.getMonth()+1)},MM:function(O){return P(O.getMonth()+1)},MMM:function(O,R){return R.monthNamesShort[O.getMonth()]},MMMM:function(O,R){return R.monthNames[O.getMonth()]},YY:function(O){return P(String(O.getFullYear()),4).substr(2)},YYYY:function(O){return P(O.getFullYear(),4)},h:function(O){return String(O.getHours()%12||12)},hh:function(O){return P(O.getHours()%12||12)},H:function(O){return String(O.getHours())},HH:function(O){return P(O.getHours())},m:function(O){return String(O.getMinutes())},mm:function(O){return P(O.getMinutes())},s:function(O){return String(O.getSeconds())},ss:function(O){return P(O.getSeconds())},S:function(O){return String(Math.round(O.getMilliseconds()/100))},SS:function(O){return P(Math.round(O.getMilliseconds()/10),2)},SSS:function(O){return P(O.getMilliseconds(),3)},a:function(O,R){return O.getHours()<12?R.amPm[0]:R.amPm[1]},A:function(O,R){return O.getHours()<12?R.amPm[0].toUpperCase():R.amPm[1].toUpperCase()},ZZ:function(O){var R=O.getTimezoneOffset();return(R>0?"-":"+")+P(Math.floor(Math.abs(R)/60)*100+Math.abs(R)%60,4)},Z:function(O){var R=O.getTimezoneOffset();return(R>0?"-":"+")+P(Math.floor(Math.abs(R)/60),2)+":"+P(Math.abs(R)%60,2)}},z=function(O){return+O-1},Y=[null,t],B=[null,s],G=["isPm",s,function(O,R){var V=O.toLowerCase();return V===R.amPm[0]?0:V===R.amPm[1]?1:null}],U=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(O){var R=(O+"").match(/([+-]|\d\d)/gi);if(R){var V=+R[1]*60+parseInt(R[2],10);return R[0]==="+"?V:-V}return 0}],Z={D:["day",t],DD:["day",n],Do:["day",t+s,function(O){return parseInt(O,10)}],M:["month",t,z],MM:["month",n,z],YY:["year",n,function(O){var R=new Date,V=+(""+R.getFullYear()).substr(0,2);return+(""+(+O>68?V-1:V)+O)}],h:["hour",t,void 0,"isPm"],hh:["hour",n,void 0,"isPm"],H:["hour",t],HH:["hour",n],m:["minute",t],mm:["minute",n],s:["second",t],ss:["second",n],YYYY:["year",a],S:["millisecond","\\d",function(O){return+O*100}],SS:["millisecond",n,function(O){return+O*10}],SSS:["millisecond",i],d:Y,dd:Y,ddd:B,dddd:B,MMM:["month",s,h("monthNamesShort")],MMMM:["month",s,h("monthNames")],a:G,A:G,ZZ:U,Z:U},ne={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},te=function(O){return y(ne,O)},ce=function(O,R,V){if(R===void 0&&(R=ne.default),V===void 0&&(V={}),typeof O=="number"&&(O=new Date(O)),Object.prototype.toString.call(O)!=="[object Date]"||isNaN(O.getTime()))throw new Error("Invalid Date pass to format");R=ne[R]||R;var ue=[];R=R.replace(u,function(_e,de){return ue.push(de),"@@@"});var q=y(y({},T),V);return R=R.replace(r,function(_e){return C[_e](O,q)}),R.replace(/@@@/g,function(){return ue.shift()})};function fe(O,R,V){if(V===void 0&&(V={}),typeof R!="string")throw new Error("Invalid format in fecha parse");if(R=ne[R]||R,O.length>1e3)return null;var ue=new Date,q={year:ue.getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},_e=[],de=[],Ne=R.replace(u,function(nr,Ge){return de.push($(Ge)),"@@@"}),Ue={},Br={};Ne=$(Ne).replace(r,function(nr){var Ge=Z[nr],Wr=Ge[0],Xt=Ge[1],Qt=Ge[3];if(Ue[Wr])throw new Error("Invalid format. "+Wr+" specified twice in format");return Ue[Wr]=!0,Qt&&(Br[Qt]=!0),_e.push(Ge),"("+Xt+")"}),Object.keys(Br).forEach(function(nr){if(!Ue[nr])throw new Error("Invalid format. "+nr+" is required in specified format")}),Ne=Ne.replace(/@@@/g,function(){return de.shift()});var er=O.match(new RegExp(Ne,"i"));if(!er)return null;for(var Hr=y(y({},T),V),ie=1;ie<er.length;ie++){var rr=_e[ie-1],ht=rr[0],Se=rr[2],Gr=Se?Se(er[ie],Hr):+er[ie];if(Gr==null)return null;q[ht]=Gr}q.isPm===1&&q.hour!=null&&+q.hour!=12?q.hour=+q.hour+12:q.isPm===0&&+q.hour==12&&(q.hour=0);var Re;if(q.timezoneOffset==null){Re=new Date(q.year,q.month,q.day,q.hour,q.minute,q.second,q.millisecond);for(var tr=[["month","getMonth"],["day","getDate"],["hour","getHours"],["minute","getMinutes"],["second","getSeconds"]],ie=0,Zt=tr.length;ie<Zt;ie++)if(Ue[tr[ie][0]]&&q[tr[ie][0]]!==Re[tr[ie][1]]())return null}else if(Re=new Date(Date.UTC(q.year,q.month,q.day,q.hour,q.minute-q.timezoneOffset,q.second,q.millisecond)),q.month>11||q.month<0||q.day>31||q.day<1||q.hour>23||q.hour<0||q.minute>59||q.minute<0||q.second>59||q.second<0)return null;return Re}var $e={format:ce,parse:fe,defaultI18n:w,setGlobalDateI18n:D,setGlobalDateMasks:te};e.assign=y,e.default=$e,e.format=ce,e.parse=fe,e.defaultI18n=w,e.setGlobalDateI18n=D,e.setGlobalDateMasks=te,Object.defineProperty(e,"__esModule",{value:!0})}))});var yl=m((fS,ml)=>{"use strict";var jy=gl(),Fy=we();ml.exports=Fy((e,r={})=>(r.format&&(e.timestamp=typeof r.format=="function"?r.format():jy.format(new Date,r.format)),e.timestamp||(e.timestamp=new Date().toISOString()),r.alias&&(e[r.alias]=e.timestamp),e))});var bl=m((dS,vl)=>{"use strict";var xa=fa(),ky=we(),{MESSAGE:Ma}=ae();vl.exports=ky((e,r)=>(r.level!==!1&&(e.level=xa.strip(e.level)),r.message!==!1&&(e.message=xa.strip(String(e.message))),r.raw!==!1&&e[Ma]&&(e[Ma]=xa.strip(String(e[Ma]))),e))});var Ia=m(Ra=>{"use strict";var zy=Ra.format=we();Ra.levels=Cu();function he(e,r){Object.defineProperty(zy,e,{get(){return r()},configurable:!0})}he("align",function(){return qu()});he("errors",function(){return ju()});he("cli",function(){return ku()});he("combine",function(){return Bu()});he("colorize",function(){return bn()});he("json",function(){return Ta()});he("label",function(){return Ku()});he("logstash",function(){return Zu()});he("metadata",function(){return Qu()});he("ms",function(){return nl()});he("padLevels",function(){return _a()});he("prettyPrint",function(){return ol()});he("printf",function(){return sl()});he("simple",function(){return cl()});he("splat",function(){return pl()});he("timestamp",function(){return yl()});he("uncolorize",function(){return bl()})});var Da=m(Tn=>{"use strict";var{format:_l}=require("util");Tn.warn={deprecated(e){return()=>{throw new Error(_l("{ %s } was removed in winston@3.0.0.",e))}},useFormat(e){return()=>{throw new Error([_l("{ %s } was removed in winston@3.0.0.",e),"Use a custom winston.format = winston.format(function) instead."].join(`
50
- `))}},forFunctions(e,r,t){t.forEach(n=>{e[n]=Tn.warn[r](n)})},forProperties(e,r,t){t.forEach(n=>{let i=Tn.warn[r](n);Object.defineProperty(e,n,{get:i,set:i})})}}});var wl=m((gS,By)=>{By.exports={name:"winston",description:"A logger for just about everything.",version:"3.17.0",author:"Charlie Robbins <charlie.robbins@gmail.com>",maintainers:["David Hyde <dabh@alumni.stanford.edu>"],repository:{type:"git",url:"https://github.com/winstonjs/winston.git"},keywords:["winston","logger","logging","logs","sysadmin","bunyan","pino","loglevel","tools","json","stream"],dependencies:{"@dabh/diagnostics":"^2.0.2","@colors/colors":"^1.6.0",async:"^3.2.3","is-stream":"^2.0.0",logform:"^2.7.0","one-time":"^1.0.0","readable-stream":"^3.4.0","safe-stable-stringify":"^2.3.1","stack-trace":"0.0.x","triple-beam":"^1.3.0","winston-transport":"^4.9.0"},devDependencies:{"@babel/cli":"^7.23.9","@babel/core":"^7.24.0","@babel/preset-env":"^7.24.0","@dabh/eslint-config-populist":"^4.4.0","@types/node":"^20.11.24","abstract-winston-transport":"^0.5.1",assume:"^2.2.0","cross-spawn-async":"^2.2.5",eslint:"^8.57.0",hock:"^1.4.1",mocha:"^10.3.0",nyc:"^17.1.0",rimraf:"5.0.1",split2:"^4.1.0","std-mocks":"^2.0.0",through2:"^4.0.2","winston-compat":"^0.1.5"},main:"./lib/winston.js",browser:"./dist/winston",types:"./index.d.ts",scripts:{lint:"eslint lib/*.js lib/winston/*.js lib/winston/**/*.js --resolve-plugins-relative-to ./node_modules/@dabh/eslint-config-populist",test:"rimraf test/fixtures/logs/* && mocha","test:coverage":"nyc npm run test:unit","test:unit":"mocha test/unit","test:integration":"mocha test/integration",build:"rimraf dist && babel lib -d dist",prepublishOnly:"npm run build"},engines:{node:">= 12.0.0"},license:"MIT"}});var Sl=m((mS,El)=>{El.exports=require("util").deprecate});var Ca=m((yS,Ol)=>{Ol.exports=require("stream")});var qa=m((vS,Al)=>{"use strict";function Hy(e,r){var t=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(r?r(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(La,this,e)):process.nextTick(La,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(a){!r&&a?t._writableState?t._writableState.errorEmitted?process.nextTick(Nn,t):(t._writableState.errorEmitted=!0,process.nextTick(Pl,t,a)):process.nextTick(Pl,t,a):r?(process.nextTick(Nn,t),r(a)):process.nextTick(Nn,t)}),this)}function Pl(e,r){La(e,r),Nn(e)}function Nn(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function Gy(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function La(e,r){e.emit("error",r)}function Wy(e,r){var t=e._readableState,n=e._writableState;t&&t.autoDestroy||n&&n.autoDestroy?e.destroy(r):e.emit("error",r)}Al.exports={destroy:Hy,undestroy:Gy,errorOrDestroy:Wy}});var lr=m((bS,xl)=>{"use strict";var Nl={};function xe(e,r,t){t||(t=Error);function n(a,s,u){return typeof r=="string"?r:r(a,s,u)}class i extends t{constructor(s,u,d){super(n(s,u,d))}}i.prototype.name=t.name,i.prototype.code=e,Nl[e]=i}function Tl(e,r){if(Array.isArray(e)){let t=e.length;return e=e.map(n=>String(n)),t>2?`one of ${r} ${e.slice(0,t-1).join(", ")}, or `+e[t-1]:t===2?`one of ${r} ${e[0]} or ${e[1]}`:`of ${r} ${e[0]}`}else return`of ${r} ${String(e)}`}function Yy(e,r,t){return e.substr(!t||t<0?0:+t,r.length)===r}function Vy(e,r,t){return(t===void 0||t>e.length)&&(t=e.length),e.substring(t-r.length,t)===r}function Ky(e,r,t){return typeof t!="number"&&(t=0),t+r.length>e.length?!1:e.indexOf(r,t)!==-1}xe("ERR_INVALID_OPT_VALUE",function(e,r){return'The value "'+r+'" is invalid for option "'+e+'"'},TypeError);xe("ERR_INVALID_ARG_TYPE",function(e,r,t){let n;typeof r=="string"&&Yy(r,"not ")?(n="must not be",r=r.replace(/^not /,"")):n="must be";let i;if(Vy(e," argument"))i=`The ${e} ${n} ${Tl(r,"type")}`;else{let a=Ky(e,".")?"property":"argument";i=`The "${e}" ${a} ${n} ${Tl(r,"type")}`}return i+=`. Received type ${typeof t}`,i},TypeError);xe("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");xe("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});xe("ERR_STREAM_PREMATURE_CLOSE","Premature close");xe("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});xe("ERR_MULTIPLE_CALLBACK","Callback called multiple times");xe("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");xe("ERR_STREAM_WRITE_AFTER_END","write after end");xe("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);xe("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);xe("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");xl.exports.codes=Nl});var $a=m((_S,Ml)=>{"use strict";var Jy=lr().codes.ERR_INVALID_OPT_VALUE;function Zy(e,r,t){return e.highWaterMark!=null?e.highWaterMark:r?e[t]:null}function Xy(e,r,t,n){var i=Zy(r,n,t);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var a=n?t:"highWaterMark";throw new Jy(a,i)}return Math.floor(i)}return e.objectMode?16:16*1024}Ml.exports={getHighWaterMark:Xy}});var Rl=m((wS,Ua)=>{typeof Object.create=="function"?Ua.exports=function(r,t){t&&(r.super_=t,r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:Ua.exports=function(r,t){if(t){r.super_=t;var n=function(){};n.prototype=t.prototype,r.prototype=new n,r.prototype.constructor=r}}});var rt=m((ES,Fa)=>{try{if(ja=require("util"),typeof ja.inherits!="function")throw"";Fa.exports=ja.inherits}catch{Fa.exports=Rl()}var ja});var $l=m((SS,ql)=>{"use strict";function Il(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Dl(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Il(Object(t),!0).forEach(function(n){Qy(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Il(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function Qy(e,r,t){return r=Ll(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function ev(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function Cl(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ll(n.key),n)}}function rv(e,r,t){return r&&Cl(e.prototype,r),t&&Cl(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ll(e){var r=tv(e,"string");return typeof r=="symbol"?r:String(r)}function tv(e,r){if(typeof e!="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}var nv=require("buffer"),xn=nv.Buffer,iv=require("util"),ka=iv.inspect,av=ka&&ka.custom||"inspect";function ov(e,r,t){xn.prototype.copy.call(e,r,t)}ql.exports=(function(){function e(){ev(this,e),this.head=null,this.tail=null,this.length=0}return rv(e,[{key:"push",value:function(t){var n={data:t,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length}},{key:"unshift",value:function(t){var n={data:t,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length}},{key:"shift",value:function(){if(this.length!==0){var t=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=t+n.data;return i}},{key:"concat",value:function(t){if(this.length===0)return xn.alloc(0);for(var n=xn.allocUnsafe(t>>>0),i=this.head,a=0;i;)ov(i.data,n,a),a+=i.data.length,i=i.next;return n}},{key:"consume",value:function(t,n){var i;return t<this.head.data.length?(i=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):t===this.head.data.length?i=this.shift():i=n?this._getString(t):this._getBuffer(t),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var n=this.head,i=1,a=n.data;for(t-=a.length;n=n.next;){var s=n.data,u=t>s.length?s.length:t;if(u===s.length?a+=s:a+=s.slice(0,t),t-=u,t===0){u===s.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=s.slice(u));break}++i}return this.length-=i,a}},{key:"_getBuffer",value:function(t){var n=xn.allocUnsafe(t),i=this.head,a=1;for(i.data.copy(n),t-=i.data.length;i=i.next;){var s=i.data,u=t>s.length?s.length:t;if(s.copy(n,n.length-t,0,u),t-=u,t===0){u===s.length?(++a,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=s.slice(u));break}++a}return this.length-=a,n}},{key:av,value:function(t,n){return ka(this,Dl(Dl({},n),{},{depth:0,customInspect:!1}))}}]),e})()});var Fl=m((za,jl)=>{var Mn=require("buffer"),je=Mn.Buffer;function Ul(e,r){for(var t in e)r[t]=e[t]}je.from&&je.alloc&&je.allocUnsafe&&je.allocUnsafeSlow?jl.exports=Mn:(Ul(Mn,za),za.Buffer=Nr);function Nr(e,r,t){return je(e,r,t)}Nr.prototype=Object.create(je.prototype);Ul(je,Nr);Nr.from=function(e,r,t){if(typeof e=="number")throw new TypeError("Argument must not be a number");return je(e,r,t)};Nr.alloc=function(e,r,t){if(typeof e!="number")throw new TypeError("Argument must be a number");var n=je(e);return r!==void 0?typeof t=="string"?n.fill(r,t):n.fill(r):n.fill(0),n};Nr.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return je(e)};Nr.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Mn.SlowBuffer(e)}});var Ga=m(zl=>{"use strict";var Ha=Fl().Buffer,kl=Ha.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function sv(e){if(!e)return"utf8";for(var r;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(r)return;e=(""+e).toLowerCase(),r=!0}}function uv(e){var r=sv(e);if(typeof r!="string"&&(Ha.isEncoding===kl||!kl(e)))throw new Error("Unknown encoding: "+e);return r||e}zl.StringDecoder=Ot;function Ot(e){this.encoding=uv(e);var r;switch(this.encoding){case"utf16le":this.text=hv,this.end=gv,r=4;break;case"utf8":this.fillLast=fv,r=4;break;case"base64":this.text=mv,this.end=yv,r=3;break;default:this.write=vv,this.end=bv;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Ha.allocUnsafe(r)}Ot.prototype.write=function(e){if(e.length===0)return"";var r,t;if(this.lastNeed){if(r=this.fillLast(e),r===void 0)return"";t=this.lastNeed,this.lastNeed=0}else t=0;return t<e.length?r?r+this.text(e,t):this.text(e,t):r||""};Ot.prototype.end=pv;Ot.prototype.text=dv;Ot.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function Ba(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function lv(e,r,t){var n=r.length-1;if(n<t)return 0;var i=Ba(r[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<t||i===-2?0:(i=Ba(r[n]),i>=0?(i>0&&(e.lastNeed=i-2),i):--n<t||i===-2?0:(i=Ba(r[n]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function cv(e,r,t){if((r[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&r.length>1){if((r[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&r.length>2&&(r[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function fv(e){var r=this.lastTotal-this.lastNeed,t=cv(this,e,r);if(t!==void 0)return t;if(this.lastNeed<=e.length)return e.copy(this.lastChar,r,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,r,0,e.length),this.lastNeed-=e.length}function dv(e,r){var t=lv(this,e,r);if(!this.lastNeed)return e.toString("utf8",r);this.lastTotal=t;var n=e.length-(t-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",r,n)}function pv(e){var r=e&&e.length?this.write(e):"";return this.lastNeed?r+"\uFFFD":r}function hv(e,r){if((e.length-r)%2===0){var t=e.toString("utf16le",r);if(t){var n=t.charCodeAt(t.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],t.slice(0,-1)}return t}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",r,e.length-1)}function gv(e){var r=e&&e.length?this.write(e):"";if(this.lastNeed){var t=this.lastTotal-this.lastNeed;return r+this.lastChar.toString("utf16le",0,t)}return r}function mv(e,r){var t=(e.length-r)%3;return t===0?e.toString("base64",r):(this.lastNeed=3-t,this.lastTotal=3,t===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",r,e.length-t))}function yv(e){var r=e&&e.length?this.write(e):"";return this.lastNeed?r+this.lastChar.toString("base64",0,3-this.lastNeed):r}function vv(e){return e.toString(this.encoding)}function bv(e){return e&&e.length?this.write(e):""}});var Rn=m((PS,Gl)=>{"use strict";var Bl=lr().codes.ERR_STREAM_PREMATURE_CLOSE;function _v(e){var r=!1;return function(){if(!r){r=!0;for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];e.apply(this,n)}}}function wv(){}function Ev(e){return e.setHeader&&typeof e.abort=="function"}function Hl(e,r,t){if(typeof r=="function")return Hl(e,null,r);r||(r={}),t=_v(t||wv);var n=r.readable||r.readable!==!1&&e.readable,i=r.writable||r.writable!==!1&&e.writable,a=function(){e.writable||u()},s=e._writableState&&e._writableState.finished,u=function(){i=!1,s=!0,n||t.call(e)},d=e._readableState&&e._readableState.endEmitted,h=function(){n=!1,d=!0,i||t.call(e)},y=function(g){t.call(e,g)},b=function(){var g;if(n&&!d)return(!e._readableState||!e._readableState.ended)&&(g=new Bl),t.call(e,g);if(i&&!s)return(!e._writableState||!e._writableState.ended)&&(g=new Bl),t.call(e,g)},_=function(){e.req.on("finish",u)};return Ev(e)?(e.on("complete",u),e.on("abort",b),e.req?_():e.on("request",_)):i&&!e._writableState&&(e.on("end",a),e.on("close",a)),e.on("end",h),e.on("finish",u),r.error!==!1&&e.on("error",y),e.on("close",b),function(){e.removeListener("complete",u),e.removeListener("abort",b),e.removeListener("request",_),e.req&&e.req.removeListener("finish",u),e.removeListener("end",a),e.removeListener("close",a),e.removeListener("finish",u),e.removeListener("end",h),e.removeListener("error",y),e.removeListener("close",b)}}Gl.exports=Hl});var Yl=m((AS,Wl)=>{"use strict";var In;function cr(e,r,t){return r=Sv(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Sv(e){var r=Ov(e,"string");return typeof r=="symbol"?r:String(r)}function Ov(e,r){if(typeof e!="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}var Pv=Rn(),fr=Symbol("lastResolve"),xr=Symbol("lastReject"),Pt=Symbol("error"),Dn=Symbol("ended"),Mr=Symbol("lastPromise"),Wa=Symbol("handlePromise"),Rr=Symbol("stream");function dr(e,r){return{value:e,done:r}}function Av(e){var r=e[fr];if(r!==null){var t=e[Rr].read();t!==null&&(e[Mr]=null,e[fr]=null,e[xr]=null,r(dr(t,!1)))}}function Tv(e){process.nextTick(Av,e)}function Nv(e,r){return function(t,n){e.then(function(){if(r[Dn]){t(dr(void 0,!0));return}r[Wa](t,n)},n)}}var xv=Object.getPrototypeOf(function(){}),Mv=Object.setPrototypeOf((In={get stream(){return this[Rr]},next:function(){var r=this,t=this[Pt];if(t!==null)return Promise.reject(t);if(this[Dn])return Promise.resolve(dr(void 0,!0));if(this[Rr].destroyed)return new Promise(function(s,u){process.nextTick(function(){r[Pt]?u(r[Pt]):s(dr(void 0,!0))})});var n=this[Mr],i;if(n)i=new Promise(Nv(n,this));else{var a=this[Rr].read();if(a!==null)return Promise.resolve(dr(a,!1));i=new Promise(this[Wa])}return this[Mr]=i,i}},cr(In,Symbol.asyncIterator,function(){return this}),cr(In,"return",function(){var r=this;return new Promise(function(t,n){r[Rr].destroy(null,function(i){if(i){n(i);return}t(dr(void 0,!0))})})}),In),xv),Rv=function(r){var t,n=Object.create(Mv,(t={},cr(t,Rr,{value:r,writable:!0}),cr(t,fr,{value:null,writable:!0}),cr(t,xr,{value:null,writable:!0}),cr(t,Pt,{value:null,writable:!0}),cr(t,Dn,{value:r._readableState.endEmitted,writable:!0}),cr(t,Wa,{value:function(a,s){var u=n[Rr].read();u?(n[Mr]=null,n[fr]=null,n[xr]=null,a(dr(u,!1))):(n[fr]=a,n[xr]=s)},writable:!0}),t));return n[Mr]=null,Pv(r,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var a=n[xr];a!==null&&(n[Mr]=null,n[fr]=null,n[xr]=null,a(i)),n[Pt]=i;return}var s=n[fr];s!==null&&(n[Mr]=null,n[fr]=null,n[xr]=null,s(dr(void 0,!0))),n[Dn]=!0}),r.on("readable",Tv.bind(null,n)),n};Wl.exports=Rv});var Zl=m((TS,Jl)=>{"use strict";function Vl(e,r,t,n,i,a,s){try{var u=e[a](s),d=u.value}catch(h){t(h);return}u.done?r(d):Promise.resolve(d).then(n,i)}function Iv(e){return function(){var r=this,t=arguments;return new Promise(function(n,i){var a=e.apply(r,t);function s(d){Vl(a,n,i,s,u,"next",d)}function u(d){Vl(a,n,i,s,u,"throw",d)}s(void 0)})}}function Kl(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Dv(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Kl(Object(t),!0).forEach(function(n){Cv(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Kl(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function Cv(e,r,t){return r=Lv(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Lv(e){var r=qv(e,"string");return typeof r=="symbol"?r:String(r)}function qv(e,r){if(typeof e!="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}var $v=lr().codes.ERR_INVALID_ARG_TYPE;function Uv(e,r,t){var n;if(r&&typeof r.next=="function")n=r;else if(r&&r[Symbol.asyncIterator])n=r[Symbol.asyncIterator]();else if(r&&r[Symbol.iterator])n=r[Symbol.iterator]();else throw new $v("iterable",["Iterable"],r);var i=new e(Dv({objectMode:!0},t)),a=!1;i._read=function(){a||(a=!0,s())};function s(){return u.apply(this,arguments)}function u(){return u=Iv(function*(){try{var d=yield n.next(),h=d.value,y=d.done;y?i.push(null):i.push(yield h)?s():a=!1}catch(b){i.destroy(b)}}),u.apply(this,arguments)}return i}Jl.exports=Uv});var to=m((xS,sc)=>{"use strict";sc.exports=W;var tt;W.ReadableState=rc;var NS=require("events").EventEmitter,ec=function(r,t){return r.listeners(t).length},Tt=Ca(),Cn=require("buffer").Buffer,jv=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Fv(e){return Cn.from(e)}function kv(e){return Cn.isBuffer(e)||e instanceof jv}var Ya=require("util"),F;Ya&&Ya.debuglog?F=Ya.debuglog("stream"):F=function(){};var zv=$l(),eo=qa(),Bv=$a(),Hv=Bv.getHighWaterMark,Ln=lr().codes,Gv=Ln.ERR_INVALID_ARG_TYPE,Wv=Ln.ERR_STREAM_PUSH_AFTER_EOF,Yv=Ln.ERR_METHOD_NOT_IMPLEMENTED,Vv=Ln.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,nt,Va,Ka;rt()(W,Tt);var At=eo.errorOrDestroy,Ja=["error","close","destroy","pause","resume"];function Kv(e,r,t){if(typeof e.prependListener=="function")return e.prependListener(r,t);!e._events||!e._events[r]?e.on(r,t):Array.isArray(e._events[r])?e._events[r].unshift(t):e._events[r]=[t,e._events[r]]}function rc(e,r,t){tt=tt||Ir(),e=e||{},typeof t!="boolean"&&(t=r instanceof tt),this.objectMode=!!e.objectMode,t&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=Hv(this,e,"readableHighWaterMark",t),this.buffer=new zv,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(nt||(nt=Ga().StringDecoder),this.decoder=new nt(e.encoding),this.encoding=e.encoding)}function W(e){if(tt=tt||Ir(),!(this instanceof W))return new W(e);var r=this instanceof tt;this._readableState=new rc(e,this,r),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),Tt.call(this)}Object.defineProperty(W.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(r){this._readableState&&(this._readableState.destroyed=r)}});W.prototype.destroy=eo.destroy;W.prototype._undestroy=eo.undestroy;W.prototype._destroy=function(e,r){r(e)};W.prototype.push=function(e,r){var t=this._readableState,n;return t.objectMode?n=!0:typeof e=="string"&&(r=r||t.defaultEncoding,r!==t.encoding&&(e=Cn.from(e,r),r=""),n=!0),tc(this,e,r,!1,n)};W.prototype.unshift=function(e){return tc(this,e,null,!0,!1)};function tc(e,r,t,n,i){F("readableAddChunk",r);var a=e._readableState;if(r===null)a.reading=!1,Xv(e,a);else{var s;if(i||(s=Jv(a,r)),s)At(e,s);else if(a.objectMode||r&&r.length>0)if(typeof r!="string"&&!a.objectMode&&Object.getPrototypeOf(r)!==Cn.prototype&&(r=Fv(r)),n)a.endEmitted?At(e,new Vv):Za(e,a,r,!0);else if(a.ended)At(e,new Wv);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!t?(r=a.decoder.write(r),a.objectMode||r.length!==0?Za(e,a,r,!1):Qa(e,a)):Za(e,a,r,!1)}else n||(a.reading=!1,Qa(e,a))}return!a.ended&&(a.length<a.highWaterMark||a.length===0)}function Za(e,r,t,n){r.flowing&&r.length===0&&!r.sync?(r.awaitDrain=0,e.emit("data",t)):(r.length+=r.objectMode?1:t.length,n?r.buffer.unshift(t):r.buffer.push(t),r.needReadable&&qn(e)),Qa(e,r)}function Jv(e,r){var t;return!kv(r)&&typeof r!="string"&&r!==void 0&&!e.objectMode&&(t=new Gv("chunk",["string","Buffer","Uint8Array"],r)),t}W.prototype.isPaused=function(){return this._readableState.flowing===!1};W.prototype.setEncoding=function(e){nt||(nt=Ga().StringDecoder);var r=new nt(e);this._readableState.decoder=r,this._readableState.encoding=this._readableState.decoder.encoding;for(var t=this._readableState.buffer.head,n="";t!==null;)n+=r.write(t.data),t=t.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var Xl=1073741824;function Zv(e){return e>=Xl?e=Xl:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function Ql(e,r){return e<=0||r.length===0&&r.ended?0:r.objectMode?1:e!==e?r.flowing&&r.length?r.buffer.head.data.length:r.length:(e>r.highWaterMark&&(r.highWaterMark=Zv(e)),e<=r.length?e:r.ended?r.length:(r.needReadable=!0,0))}W.prototype.read=function(e){F("read",e),e=parseInt(e,10);var r=this._readableState,t=e;if(e!==0&&(r.emittedReadable=!1),e===0&&r.needReadable&&((r.highWaterMark!==0?r.length>=r.highWaterMark:r.length>0)||r.ended))return F("read: emitReadable",r.length,r.ended),r.length===0&&r.ended?Xa(this):qn(this),null;if(e=Ql(e,r),e===0&&r.ended)return r.length===0&&Xa(this),null;var n=r.needReadable;F("need readable",n),(r.length===0||r.length-e<r.highWaterMark)&&(n=!0,F("length less than watermark",n)),r.ended||r.reading?(n=!1,F("reading or ended",n)):n&&(F("do read"),r.reading=!0,r.sync=!0,r.length===0&&(r.needReadable=!0),this._read(r.highWaterMark),r.sync=!1,r.reading||(e=Ql(t,r)));var i;return e>0?i=ac(e,r):i=null,i===null?(r.needReadable=r.length<=r.highWaterMark,e=0):(r.length-=e,r.awaitDrain=0),r.length===0&&(r.ended||(r.needReadable=!0),t!==e&&r.ended&&Xa(this)),i!==null&&this.emit("data",i),i};function Xv(e,r){if(F("onEofChunk"),!r.ended){if(r.decoder){var t=r.decoder.end();t&&t.length&&(r.buffer.push(t),r.length+=r.objectMode?1:t.length)}r.ended=!0,r.sync?qn(e):(r.needReadable=!1,r.emittedReadable||(r.emittedReadable=!0,nc(e)))}}function qn(e){var r=e._readableState;F("emitReadable",r.needReadable,r.emittedReadable),r.needReadable=!1,r.emittedReadable||(F("emitReadable",r.flowing),r.emittedReadable=!0,process.nextTick(nc,e))}function nc(e){var r=e._readableState;F("emitReadable_",r.destroyed,r.length,r.ended),!r.destroyed&&(r.length||r.ended)&&(e.emit("readable"),r.emittedReadable=!1),r.needReadable=!r.flowing&&!r.ended&&r.length<=r.highWaterMark,ro(e)}function Qa(e,r){r.readingMore||(r.readingMore=!0,process.nextTick(Qv,e,r))}function Qv(e,r){for(;!r.reading&&!r.ended&&(r.length<r.highWaterMark||r.flowing&&r.length===0);){var t=r.length;if(F("maybeReadMore read 0"),e.read(0),t===r.length)break}r.readingMore=!1}W.prototype._read=function(e){At(this,new Yv("_read()"))};W.prototype.pipe=function(e,r){var t=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1,F("pipe count=%d opts=%j",n.pipesCount,r);var i=(!r||r.end!==!1)&&e!==process.stdout&&e!==process.stderr,a=i?u:w;n.endEmitted?process.nextTick(a):t.once("end",a),e.on("unpipe",s);function s(T,D){F("onunpipe"),T===t&&D&&D.hasUnpiped===!1&&(D.hasUnpiped=!0,y())}function u(){F("onend"),e.end()}var d=eb(t);e.on("drain",d);var h=!1;function y(){F("cleanup"),e.removeListener("close",S),e.removeListener("finish",g),e.removeListener("drain",d),e.removeListener("error",_),e.removeListener("unpipe",s),t.removeListener("end",u),t.removeListener("end",w),t.removeListener("data",b),h=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&d()}t.on("data",b);function b(T){F("ondata");var D=e.write(T);F("dest.write",D),D===!1&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&oc(n.pipes,e)!==-1)&&!h&&(F("false write response, pause",n.awaitDrain),n.awaitDrain++),t.pause())}function _(T){F("onerror",T),w(),e.removeListener("error",_),ec(e,"error")===0&&At(e,T)}Kv(e,"error",_);function S(){e.removeListener("finish",g),w()}e.once("close",S);function g(){F("onfinish"),e.removeListener("close",S),w()}e.once("finish",g);function w(){F("unpipe"),t.unpipe(e)}return e.emit("pipe",t),n.flowing||(F("pipe resume"),t.resume()),e};function eb(e){return function(){var t=e._readableState;F("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&ec(e,"data")&&(t.flowing=!0,ro(e))}}W.prototype.unpipe=function(e){var r=this._readableState,t={hasUnpiped:!1};if(r.pipesCount===0)return this;if(r.pipesCount===1)return e&&e!==r.pipes?this:(e||(e=r.pipes),r.pipes=null,r.pipesCount=0,r.flowing=!1,e&&e.emit("unpipe",this,t),this);if(!e){var n=r.pipes,i=r.pipesCount;r.pipes=null,r.pipesCount=0,r.flowing=!1;for(var a=0;a<i;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var s=oc(r.pipes,e);return s===-1?this:(r.pipes.splice(s,1),r.pipesCount-=1,r.pipesCount===1&&(r.pipes=r.pipes[0]),e.emit("unpipe",this,t),this)};W.prototype.on=function(e,r){var t=Tt.prototype.on.call(this,e,r),n=this._readableState;return e==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):e==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,F("on readable",n.length,n.reading),n.length?qn(this):n.reading||process.nextTick(rb,this)),t};W.prototype.addListener=W.prototype.on;W.prototype.removeListener=function(e,r){var t=Tt.prototype.removeListener.call(this,e,r);return e==="readable"&&process.nextTick(ic,this),t};W.prototype.removeAllListeners=function(e){var r=Tt.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(ic,this),r};function ic(e){var r=e._readableState;r.readableListening=e.listenerCount("readable")>0,r.resumeScheduled&&!r.paused?r.flowing=!0:e.listenerCount("data")>0&&e.resume()}function rb(e){F("readable nexttick read 0"),e.read(0)}W.prototype.resume=function(){var e=this._readableState;return e.flowing||(F("resume"),e.flowing=!e.readableListening,tb(this,e)),e.paused=!1,this};function tb(e,r){r.resumeScheduled||(r.resumeScheduled=!0,process.nextTick(nb,e,r))}function nb(e,r){F("resume",r.reading),r.reading||e.read(0),r.resumeScheduled=!1,e.emit("resume"),ro(e),r.flowing&&!r.reading&&e.read(0)}W.prototype.pause=function(){return F("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(F("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function ro(e){var r=e._readableState;for(F("flow",r.flowing);r.flowing&&e.read()!==null;);}W.prototype.wrap=function(e){var r=this,t=this._readableState,n=!1;e.on("end",function(){if(F("wrapped end"),t.decoder&&!t.ended){var s=t.decoder.end();s&&s.length&&r.push(s)}r.push(null)}),e.on("data",function(s){if(F("wrapped data"),t.decoder&&(s=t.decoder.write(s)),!(t.objectMode&&s==null)&&!(!t.objectMode&&(!s||!s.length))){var u=r.push(s);u||(n=!0,e.pause())}});for(var i in e)this[i]===void 0&&typeof e[i]=="function"&&(this[i]=(function(u){return function(){return e[u].apply(e,arguments)}})(i));for(var a=0;a<Ja.length;a++)e.on(Ja[a],this.emit.bind(this,Ja[a]));return this._read=function(s){F("wrapped _read",s),n&&(n=!1,e.resume())},this};typeof Symbol=="function"&&(W.prototype[Symbol.asyncIterator]=function(){return Va===void 0&&(Va=Yl()),Va(this)});Object.defineProperty(W.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(W.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(W.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(r){this._readableState&&(this._readableState.flowing=r)}});W._fromList=ac;Object.defineProperty(W.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function ac(e,r){if(r.length===0)return null;var t;return r.objectMode?t=r.buffer.shift():!e||e>=r.length?(r.decoder?t=r.buffer.join(""):r.buffer.length===1?t=r.buffer.first():t=r.buffer.concat(r.length),r.buffer.clear()):t=r.buffer.consume(e,r.decoder),t}function Xa(e){var r=e._readableState;F("endReadable",r.endEmitted),r.endEmitted||(r.ended=!0,process.nextTick(ib,r,e))}function ib(e,r){if(F("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,r.readable=!1,r.emit("end"),e.autoDestroy)){var t=r._writableState;(!t||t.autoDestroy&&t.finished)&&r.destroy()}}typeof Symbol=="function"&&(W.from=function(e,r){return Ka===void 0&&(Ka=Zl()),Ka(W,e,r)});function oc(e,r){for(var t=0,n=e.length;t<n;t++)if(e[t]===r)return t;return-1}});var Ir=m((MS,lc)=>{"use strict";var ab=Object.keys||function(e){var r=[];for(var t in e)r.push(t);return r};lc.exports=Fe;var uc=to(),io=jn();rt()(Fe,uc);for(no=ab(io.prototype),$n=0;$n<no.length;$n++)Un=no[$n],Fe.prototype[Un]||(Fe.prototype[Un]=io.prototype[Un]);var no,Un,$n;function Fe(e){if(!(this instanceof Fe))return new Fe(e);uc.call(this,e),io.call(this,e),this.allowHalfOpen=!0,e&&(e.readable===!1&&(this.readable=!1),e.writable===!1&&(this.writable=!1),e.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",ob)))}Object.defineProperty(Fe.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Fe.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Fe.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function ob(){this._writableState.ended||process.nextTick(sb,this)}function sb(e){e.end()}Object.defineProperty(Fe.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(r){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=r,this._writableState.destroyed=r)}})});var jn=m((RS,gc)=>{"use strict";gc.exports=ee;function fc(e){var r=this;this.next=null,this.entry=null,this.finish=function(){Cb(r,e)}}var it;ee.WritableState=xt;var ub={deprecate:Sl()},dc=Ca(),kn=require("buffer").Buffer,lb=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function cb(e){return kn.from(e)}function fb(e){return kn.isBuffer(e)||e instanceof lb}var oo=qa(),db=$a(),pb=db.getHighWaterMark,pr=lr().codes,hb=pr.ERR_INVALID_ARG_TYPE,gb=pr.ERR_METHOD_NOT_IMPLEMENTED,mb=pr.ERR_MULTIPLE_CALLBACK,yb=pr.ERR_STREAM_CANNOT_PIPE,vb=pr.ERR_STREAM_DESTROYED,bb=pr.ERR_STREAM_NULL_VALUES,_b=pr.ERR_STREAM_WRITE_AFTER_END,wb=pr.ERR_UNKNOWN_ENCODING,at=oo.errorOrDestroy;rt()(ee,dc);function Eb(){}function xt(e,r,t){it=it||Ir(),e=e||{},typeof t!="boolean"&&(t=r instanceof it),this.objectMode=!!e.objectMode,t&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=pb(this,e,"writableHighWaterMark",t),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=e.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){xb(r,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new fc(this)}xt.prototype.getBuffer=function(){for(var r=this.bufferedRequest,t=[];r;)t.push(r),r=r.next;return t};(function(){try{Object.defineProperty(xt.prototype,"buffer",{get:ub.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var Fn;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Fn=Function.prototype[Symbol.hasInstance],Object.defineProperty(ee,Symbol.hasInstance,{value:function(r){return Fn.call(this,r)?!0:this!==ee?!1:r&&r._writableState instanceof xt}})):Fn=function(r){return r instanceof this};function ee(e){it=it||Ir();var r=this instanceof it;if(!r&&!Fn.call(ee,this))return new ee(e);this._writableState=new xt(e,this,r),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),dc.call(this)}ee.prototype.pipe=function(){at(this,new yb)};function Sb(e,r){var t=new _b;at(e,t),process.nextTick(r,t)}function Ob(e,r,t,n){var i;return t===null?i=new bb:typeof t!="string"&&!r.objectMode&&(i=new hb("chunk",["string","Buffer"],t)),i?(at(e,i),process.nextTick(n,i),!1):!0}ee.prototype.write=function(e,r,t){var n=this._writableState,i=!1,a=!n.objectMode&&fb(e);return a&&!kn.isBuffer(e)&&(e=cb(e)),typeof r=="function"&&(t=r,r=null),a?r="buffer":r||(r=n.defaultEncoding),typeof t!="function"&&(t=Eb),n.ending?Sb(this,t):(a||Ob(this,n,e,t))&&(n.pendingcb++,i=Ab(this,n,a,e,r,t)),i};ee.prototype.cork=function(){this._writableState.corked++};ee.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&pc(this,e))};ee.prototype.setDefaultEncoding=function(r){if(typeof r=="string"&&(r=r.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((r+"").toLowerCase())>-1))throw new wb(r);return this._writableState.defaultEncoding=r,this};Object.defineProperty(ee.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Pb(e,r,t){return!e.objectMode&&e.decodeStrings!==!1&&typeof r=="string"&&(r=kn.from(r,t)),r}Object.defineProperty(ee.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Ab(e,r,t,n,i,a){if(!t){var s=Pb(r,n,i);n!==s&&(t=!0,i="buffer",n=s)}var u=r.objectMode?1:n.length;r.length+=u;var d=r.length<r.highWaterMark;if(d||(r.needDrain=!0),r.writing||r.corked){var h=r.lastBufferedRequest;r.lastBufferedRequest={chunk:n,encoding:i,isBuf:t,callback:a,next:null},h?h.next=r.lastBufferedRequest:r.bufferedRequest=r.lastBufferedRequest,r.bufferedRequestCount+=1}else ao(e,r,!1,u,n,i,a);return d}function ao(e,r,t,n,i,a,s){r.writelen=n,r.writecb=s,r.writing=!0,r.sync=!0,r.destroyed?r.onwrite(new vb("write")):t?e._writev(i,r.onwrite):e._write(i,a,r.onwrite),r.sync=!1}function Tb(e,r,t,n,i){--r.pendingcb,t?(process.nextTick(i,n),process.nextTick(Nt,e,r),e._writableState.errorEmitted=!0,at(e,n)):(i(n),e._writableState.errorEmitted=!0,at(e,n),Nt(e,r))}function Nb(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function xb(e,r){var t=e._writableState,n=t.sync,i=t.writecb;if(typeof i!="function")throw new mb;if(Nb(t),r)Tb(e,t,n,r,i);else{var a=hc(t)||e.destroyed;!a&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&pc(e,t),n?process.nextTick(cc,e,t,a,i):cc(e,t,a,i)}}function cc(e,r,t,n){t||Mb(e,r),r.pendingcb--,n(),Nt(e,r)}function Mb(e,r){r.length===0&&r.needDrain&&(r.needDrain=!1,e.emit("drain"))}function pc(e,r){r.bufferProcessing=!0;var t=r.bufferedRequest;if(e._writev&&t&&t.next){var n=r.bufferedRequestCount,i=new Array(n),a=r.corkedRequestsFree;a.entry=t;for(var s=0,u=!0;t;)i[s]=t,t.isBuf||(u=!1),t=t.next,s+=1;i.allBuffers=u,ao(e,r,!0,r.length,i,"",a.finish),r.pendingcb++,r.lastBufferedRequest=null,a.next?(r.corkedRequestsFree=a.next,a.next=null):r.corkedRequestsFree=new fc(r),r.bufferedRequestCount=0}else{for(;t;){var d=t.chunk,h=t.encoding,y=t.callback,b=r.objectMode?1:d.length;if(ao(e,r,!1,b,d,h,y),t=t.next,r.bufferedRequestCount--,r.writing)break}t===null&&(r.lastBufferedRequest=null)}r.bufferedRequest=t,r.bufferProcessing=!1}ee.prototype._write=function(e,r,t){t(new gb("_write()"))};ee.prototype._writev=null;ee.prototype.end=function(e,r,t){var n=this._writableState;return typeof e=="function"?(t=e,e=null,r=null):typeof r=="function"&&(t=r,r=null),e!=null&&this.write(e,r),n.corked&&(n.corked=1,this.uncork()),n.ending||Db(this,n,t),this};Object.defineProperty(ee.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function hc(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function Rb(e,r){e._final(function(t){r.pendingcb--,t&&at(e,t),r.prefinished=!0,e.emit("prefinish"),Nt(e,r)})}function Ib(e,r){!r.prefinished&&!r.finalCalled&&(typeof e._final=="function"&&!r.destroyed?(r.pendingcb++,r.finalCalled=!0,process.nextTick(Rb,e,r)):(r.prefinished=!0,e.emit("prefinish")))}function Nt(e,r){var t=hc(r);if(t&&(Ib(e,r),r.pendingcb===0&&(r.finished=!0,e.emit("finish"),r.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return t}function Db(e,r,t){r.ending=!0,Nt(e,r),t&&(r.finished?process.nextTick(t):e.once("finish",t)),r.ended=!0,e.writable=!1}function Cb(e,r,t){var n=e.entry;for(e.entry=null;n;){var i=n.callback;r.pendingcb--,i(t),n=n.next}r.corkedRequestsFree.next=e}Object.defineProperty(ee.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(r){this._writableState&&(this._writableState.destroyed=r)}});ee.prototype.destroy=oo.destroy;ee.prototype._undestroy=oo.undestroy;ee.prototype._destroy=function(e,r){r(e)}});var so=m((IS,vc)=>{"use strict";var Lb=require("util"),mc=jn(),{LEVEL:yc}=ae(),Mt=vc.exports=function(r={}){mc.call(this,{objectMode:!0,highWaterMark:r.highWaterMark}),this.format=r.format,this.level=r.level,this.handleExceptions=r.handleExceptions,this.handleRejections=r.handleRejections,this.silent=r.silent,r.log&&(this.log=r.log),r.logv&&(this.logv=r.logv),r.close&&(this.close=r.close),this.once("pipe",t=>{this.levels=t.levels,this.parent=t}),this.once("unpipe",t=>{t===this.parent&&(this.parent=null,this.close&&this.close())})};Lb.inherits(Mt,mc);Mt.prototype._write=function(r,t,n){if(this.silent||r.exception===!0&&!this.handleExceptions)return n(null);let i=this.level||this.parent&&this.parent.level;if(!i||this.levels[i]>=this.levels[r[yc]]){if(r&&!this.format)return this.log(r,n);let a,s;try{s=this.format.transform(Object.assign({},r),this.format.options)}catch(u){a=u}if(a||!s){if(n(),a)throw a;return}return this.log(s,n)}return this._writableState.sync=!1,n(null)};Mt.prototype._writev=function(r,t){if(this.logv){let n=r.filter(this._accept,this);return n.length?this.logv(n,t):t(null)}for(let n=0;n<r.length;n++){if(!this._accept(r[n]))continue;if(r[n].chunk&&!this.format){this.log(r[n].chunk,r[n].callback);continue}let i,a;try{a=this.format.transform(Object.assign({},r[n].chunk),this.format.options)}catch(s){i=s}if(i||!a){if(r[n].callback(),i)throw t(null),i}else this.log(a,r[n].callback)}return t(null)};Mt.prototype._accept=function(r){let t=r.chunk;if(this.silent)return!1;let n=this.level||this.parent&&this.parent.level;return!!((t.exception===!0||!n||this.levels[n]>=this.levels[t[yc]])&&(this.handleExceptions||t.exception!==!0))};Mt.prototype._nop=function(){}});var lo=m((DS,_c)=>{"use strict";var qb=require("util"),{LEVEL:uo}=ae(),bc=so(),Rt=_c.exports=function(r={}){if(bc.call(this,r),!r.transport||typeof r.transport.log!="function")throw new Error("Invalid transport, must be an object with a log method.");this.transport=r.transport,this.level=this.level||r.transport.level,this.handleExceptions=this.handleExceptions||r.transport.handleExceptions,this._deprecated();function t(n){this.emit("error",n,this.transport)}this.transport.__winstonError||(this.transport.__winstonError=t.bind(this),this.transport.on("error",this.transport.__winstonError))};qb.inherits(Rt,bc);Rt.prototype._write=function(r,t,n){if(this.silent||r.exception===!0&&!this.handleExceptions)return n(null);(!this.level||this.levels[this.level]>=this.levels[r[uo]])&&this.transport.log(r[uo],r.message,r,this._nop),n(null)};Rt.prototype._writev=function(r,t){for(let n=0;n<r.length;n++)this._accept(r[n])&&(this.transport.log(r[n].chunk[uo],r[n].chunk.message,r[n].chunk,this._nop),r[n].callback());return t(null)};Rt.prototype._deprecated=function(){console.error([`${this.transport.name} is a legacy winston transport. Consider upgrading: `,"- Upgrade docs: https://github.com/winstonjs/winston/blob/master/UPGRADE-3.0.md"].join(`
51
- `))};Rt.prototype.close=function(){this.transport.close&&this.transport.close(),this.transport.__winstonError&&(this.transport.removeListener("error",this.transport.__winstonError),this.transport.__winstonError=null)}});var ot=m((CS,co)=>{"use strict";co.exports=so();co.exports.LegacyTransportStream=lo()});var Sc=m((qS,Ec)=>{"use strict";var $b=require("os"),{LEVEL:wc,MESSAGE:st}=ae(),Ub=ot();Ec.exports=class extends Ub{constructor(r={}){super(r),this.name=r.name||"console",this.stderrLevels=this._stringArrayToSet(r.stderrLevels),this.consoleWarnLevels=this._stringArrayToSet(r.consoleWarnLevels),this.eol=typeof r.eol=="string"?r.eol:$b.EOL,this.forceConsole=r.forceConsole||!1,this._consoleLog=console.log.bind(console),this._consoleWarn=console.warn.bind(console),this._consoleError=console.error.bind(console),this.setMaxListeners(30)}log(r,t){if(setImmediate(()=>this.emit("logged",r)),this.stderrLevels[r[wc]]){console._stderr&&!this.forceConsole?console._stderr.write(`${r[st]}${this.eol}`):this._consoleError(r[st]),t&&t();return}else if(this.consoleWarnLevels[r[wc]]){console._stderr&&!this.forceConsole?console._stderr.write(`${r[st]}${this.eol}`):this._consoleWarn(r[st]),t&&t();return}console._stdout&&!this.forceConsole?console._stdout.write(`${r[st]}${this.eol}`):this._consoleLog(r[st]),t&&t()}_stringArrayToSet(r,t){if(!r)return{};if(t=t||"Cannot make set from type other than Array of string elements",!Array.isArray(r))throw new Error(t);return r.reduce((n,i)=>{if(typeof i!="string")throw new Error(t);return n[i]=!0,n},{})}}});var Bn=m((zn,Oc)=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.default=jb;function jb(e){return e&&typeof e.length=="number"&&e.length>=0&&e.length%1===0}Oc.exports=zn.default});var Ac=m((Hn,Pc)=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.default=function(e){return function(...r){var t=r.pop();return e.call(this,r,t)}};Pc.exports=Hn.default});var xc=m(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.fallback=Tc;hr.wrap=Nc;var Fb=hr.hasQueueMicrotask=typeof queueMicrotask=="function"&&queueMicrotask,kb=hr.hasSetImmediate=typeof setImmediate=="function"&&setImmediate,zb=hr.hasNextTick=typeof process=="object"&&typeof process.nextTick=="function";function Tc(e){setTimeout(e,0)}function Nc(e){return(r,...t)=>e(()=>r(...t))}var It;Fb?It=queueMicrotask:kb?It=setImmediate:zb?It=process.nextTick:It=Tc;hr.default=Nc(It)});var Cc=m((Gn,Dc)=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.default=Vb;var Bb=Ac(),Hb=Ic(Bb),Gb=xc(),Wb=Ic(Gb),Yb=Dr();function Ic(e){return e&&e.__esModule?e:{default:e}}function Vb(e){return(0,Yb.isAsync)(e)?function(...r){let t=r.pop(),n=e.apply(this,r);return Mc(n,t)}:(0,Hb.default)(function(r,t){var n;try{n=e.apply(this,r)}catch(i){return t(i)}if(n&&typeof n.then=="function")return Mc(n,t);t(null,n)})}function Mc(e,r){return e.then(t=>{Rc(r,null,t)},t=>{Rc(r,t&&(t instanceof Error||t.message)?t:new Error(t))})}function Rc(e,r,t){try{e(r,t)}catch(n){(0,Wb.default)(i=>{throw i},n)}}Dc.exports=Gn.default});var Dr=m(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.isAsyncIterable=Ve.isAsyncGenerator=Ve.isAsync=void 0;var Kb=Cc(),Jb=Zb(Kb);function Zb(e){return e&&e.__esModule?e:{default:e}}function Lc(e){return e[Symbol.toStringTag]==="AsyncFunction"}function Xb(e){return e[Symbol.toStringTag]==="AsyncGenerator"}function Qb(e){return typeof e[Symbol.asyncIterator]=="function"}function e_(e){if(typeof e!="function")throw new Error("expected a function");return Lc(e)?(0,Jb.default)(e):e}Ve.default=e_;Ve.isAsync=Lc;Ve.isAsyncGenerator=Xb;Ve.isAsyncIterable=Qb});var ut=m((Wn,qc)=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.default=r_;function r_(e,r){if(r||(r=e.length),!r)throw new Error("arity is undefined");function t(...n){return typeof n[r-1]=="function"?e.apply(this,n):new Promise((i,a)=>{n[r-1]=(s,...u)=>{if(s)return a(s);i(u.length>1?u:u[0])},e.apply(this,n)})}return t}qc.exports=Wn.default});var Uc=m((Yn,$c)=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});var t_=Bn(),n_=fo(t_),i_=Dr(),a_=fo(i_),o_=ut(),s_=fo(o_);function fo(e){return e&&e.__esModule?e:{default:e}}Yn.default=(0,s_.default)((e,r,t)=>{var n=(0,n_.default)(r)?[]:{};e(r,(i,a,s)=>{(0,a_.default)(i)((u,...d)=>{d.length<2&&([d]=d),n[a]=d,s(u)})},i=>t(i,n))},3);$c.exports=Yn.default});var po=m((Vn,jc)=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.default=u_;function u_(e){function r(...t){if(e!==null){var n=e;e=null,n.apply(this,t)}}return Object.assign(r,e),r}jc.exports=Vn.default});var kc=m((Kn,Fc)=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.default=function(e){return e[Symbol.iterator]&&e[Symbol.iterator]()};Fc.exports=Kn.default});var Hc=m((Jn,Bc)=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.default=m_;var l_=Bn(),c_=zc(l_),f_=kc(),d_=zc(f_);function zc(e){return e&&e.__esModule?e:{default:e}}function p_(e){var r=-1,t=e.length;return function(){return++r<t?{value:e[r],key:r}:null}}function h_(e){var r=-1;return function(){var n=e.next();return n.done?null:(r++,{value:n.value,key:r})}}function g_(e){var r=e?Object.keys(e):[],t=-1,n=r.length;return function i(){var a=r[++t];return a==="__proto__"?i():t<n?{value:e[a],key:a}:null}}function m_(e){if((0,c_.default)(e))return p_(e);var r=(0,d_.default)(e);return r?h_(r):g_(e)}Bc.exports=Jn.default});var ho=m((Zn,Gc)=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.default=y_;function y_(e){return function(...r){if(e===null)throw new Error("Callback was already called.");var t=e;e=null,t.apply(this,r)}}Gc.exports=Zn.default});var Qn=m((Xn,Wc)=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});var v_={};Xn.default=v_;Wc.exports=Xn.default});var Vc=m((ei,Yc)=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.default=E_;var b_=Qn(),__=w_(b_);function w_(e){return e&&e.__esModule?e:{default:e}}function E_(e,r,t,n){let i=!1,a=!1,s=!1,u=0,d=0;function h(){u>=r||s||i||(s=!0,e.next().then(({value:_,done:S})=>{if(!(a||i)){if(s=!1,S){i=!0,u<=0&&n(null);return}u++,t(_,d,y),d++,h()}}).catch(b))}function y(_,S){if(u-=1,!a){if(_)return b(_);if(_===!1){i=!0,a=!0;return}if(S===__.default||i&&u<=0)return i=!0,n(null);h()}}function b(_){a||(s=!1,i=!0,n(_))}h()}Yc.exports=ei.default});var Xc=m((ri,Zc)=>{"use strict";Object.defineProperty(ri,"__esModule",{value:!0});var S_=po(),O_=Dt(S_),P_=Hc(),A_=Dt(P_),T_=ho(),N_=Dt(T_),Kc=Dr(),x_=Vc(),Jc=Dt(x_),M_=Qn(),R_=Dt(M_);function Dt(e){return e&&e.__esModule?e:{default:e}}ri.default=e=>(r,t,n)=>{if(n=(0,O_.default)(n),e<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!r)return n(null);if((0,Kc.isAsyncGenerator)(r))return(0,Jc.default)(r,e,t,n);if((0,Kc.isAsyncIterable)(r))return(0,Jc.default)(r[Symbol.asyncIterator](),e,t,n);var i=(0,A_.default)(r),a=!1,s=!1,u=0,d=!1;function h(b,_){if(!s)if(u-=1,b)a=!0,n(b);else if(b===!1)a=!0,s=!0;else{if(_===R_.default||a&&u<=0)return a=!0,n(null);d||y()}}function y(){for(d=!0;u<e&&!a;){var b=i();if(b===null){a=!0,u<=0&&n(null);return}u+=1,t(b.value,b.key,(0,N_.default)(h))}d=!1}y()};Zc.exports=ri.default});var mo=m((ti,Qc)=>{"use strict";Object.defineProperty(ti,"__esModule",{value:!0});var I_=Xc(),D_=go(I_),C_=Dr(),L_=go(C_),q_=ut(),$_=go(q_);function go(e){return e&&e.__esModule?e:{default:e}}function U_(e,r,t,n){return(0,D_.default)(r)(e,(0,L_.default)(t),n)}ti.default=(0,$_.default)(U_,4);Qc.exports=ti.default});var tf=m((ni,rf)=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});var j_=mo(),F_=ef(j_),k_=ut(),z_=ef(k_);function ef(e){return e&&e.__esModule?e:{default:e}}function B_(e,r,t){return(0,F_.default)(e,1,r,t)}ni.default=(0,z_.default)(B_,3);rf.exports=ni.default});var of=m((ii,af)=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.default=V_;var H_=Uc(),G_=nf(H_),W_=tf(),Y_=nf(W_);function nf(e){return e&&e.__esModule?e:{default:e}}function V_(e,r){return(0,G_.default)(Y_.default,e,r)}af.exports=ii.default});var yo=m((jS,uf)=>{"use strict";uf.exports=Ke;var ai=lr().codes,K_=ai.ERR_METHOD_NOT_IMPLEMENTED,J_=ai.ERR_MULTIPLE_CALLBACK,Z_=ai.ERR_TRANSFORM_ALREADY_TRANSFORMING,X_=ai.ERR_TRANSFORM_WITH_LENGTH_0,oi=Ir();rt()(Ke,oi);function Q_(e,r){var t=this._transformState;t.transforming=!1;var n=t.writecb;if(n===null)return this.emit("error",new J_);t.writechunk=null,t.writecb=null,r!=null&&this.push(r),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function Ke(e){if(!(this instanceof Ke))return new Ke(e);oi.call(this,e),this._transformState={afterTransform:Q_.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",e0)}function e0(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(r,t){sf(e,r,t)}):sf(this,null,null)}Ke.prototype.push=function(e,r){return this._transformState.needTransform=!1,oi.prototype.push.call(this,e,r)};Ke.prototype._transform=function(e,r,t){t(new K_("_transform()"))};Ke.prototype._write=function(e,r,t){var n=this._transformState;if(n.writecb=t,n.writechunk=e,n.writeencoding=r,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};Ke.prototype._read=function(e){var r=this._transformState;r.writechunk!==null&&!r.transforming?(r.transforming=!0,this._transform(r.writechunk,r.writeencoding,r.afterTransform)):r.needTransform=!0};Ke.prototype._destroy=function(e,r){oi.prototype._destroy.call(this,e,function(t){r(t)})};function sf(e,r,t){if(r)return e.emit("error",r);if(t!=null&&e.push(t),e._writableState.length)throw new X_;if(e._transformState.transforming)throw new Z_;return e.push(null)}});var ff=m((FS,cf)=>{"use strict";cf.exports=Ct;var lf=yo();rt()(Ct,lf);function Ct(e){if(!(this instanceof Ct))return new Ct(e);lf.call(this,e)}Ct.prototype._transform=function(e,r,t){t(null,e)}});var mf=m((kS,gf)=>{"use strict";var vo;function r0(e){var r=!1;return function(){r||(r=!0,e.apply(void 0,arguments))}}var hf=lr().codes,t0=hf.ERR_MISSING_ARGS,n0=hf.ERR_STREAM_DESTROYED;function df(e){if(e)throw e}function i0(e){return e.setHeader&&typeof e.abort=="function"}function a0(e,r,t,n){n=r0(n);var i=!1;e.on("close",function(){i=!0}),vo===void 0&&(vo=Rn()),vo(e,{readable:r,writable:t},function(s){if(s)return n(s);i=!0,n()});var a=!1;return function(s){if(!i&&!a){if(a=!0,i0(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(s||new n0("pipe"))}}}function pf(e){e()}function o0(e,r){return e.pipe(r)}function s0(e){return!e.length||typeof e[e.length-1]!="function"?df:e.pop()}function u0(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];var n=s0(r);if(Array.isArray(r[0])&&(r=r[0]),r.length<2)throw new t0("streams");var i,a=r.map(function(s,u){var d=u<r.length-1,h=u>0;return a0(s,d,h,function(y){i||(i=y),y&&a.forEach(pf),!d&&(a.forEach(pf),n(i))})});return r.reduce(o0)}gf.exports=u0});var Cr=m((Me,qt)=>{var Lt=require("stream");process.env.READABLE_STREAM==="disable"&&Lt?(qt.exports=Lt.Readable,Object.assign(qt.exports,Lt),qt.exports.Stream=Lt):(Me=qt.exports=to(),Me.Stream=Lt||Me,Me.Readable=Me,Me.Writable=jn(),Me.Duplex=Ir(),Me.Transform=yo(),Me.PassThrough=ff(),Me.finished=Rn(),Me.pipeline=mf())});var Po=m((zS,vf)=>{var lt=[],$t=[],bo=function(){};function wo(e){return~lt.indexOf(e)?!1:(lt.push(e),!0)}function Eo(e){bo=e}function l0(e){for(var r=[],t=0;t<lt.length;t++){if(lt[t].async){r.push(lt[t]);continue}if(lt[t](e))return!0}return r.length?new Promise(function(i){Promise.all(r.map(function(s){return s(e)})).then(function(s){i(s.some(Boolean))})}):!1}function So(e){return~$t.indexOf(e)?!1:($t.push(e),!0)}function _o(){bo.apply(bo,arguments)}function yf(e){for(var r=0;r<$t.length;r++)e=$t[r].apply($t[r],arguments);return e}function Oo(e,r){var t=Object.prototype.hasOwnProperty;for(var n in r)t.call(r,n)&&(e[n]=r[n]);return e}function c0(e){return e.enabled=!1,e.modify=So,e.set=Eo,e.use=wo,Oo(function(){return!1},e)}function f0(e){function r(){var t=Array.prototype.slice.call(arguments,0);return _o.call(_o,e,yf(t,e)),!0}return e.enabled=!0,e.modify=So,e.set=Eo,e.use=wo,Oo(r,e)}vf.exports=function(r){return r.introduce=Oo,r.enabled=l0,r.process=yf,r.modify=So,r.write=_o,r.nope=c0,r.yep=f0,r.set=Eo,r.use=wo,r}});var _f=m((BS,bf)=>{var d0=Po(),p0=d0(function e(r,t){return t=t||{},t.namespace=r,t.prod=!0,t.dev=!1,t.force||e.force?e.yep(t):e.nope(t)});bf.exports=p0});var Ef=m((HS,wf)=>{"use strict";wf.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var Of=m((GS,Sf)=>{Sf.exports=function(r){return!r||typeof r=="string"?!1:r instanceof Array||Array.isArray(r)||r.length>=0&&(r.splice instanceof Function||Object.getOwnPropertyDescriptor(r,r.length-1)&&r.constructor.name!=="String")}});var Tf=m((WS,Af)=>{"use strict";var h0=Of(),g0=Array.prototype.concat,m0=Array.prototype.slice,Pf=Af.exports=function(r){for(var t=[],n=0,i=r.length;n<i;n++){var a=r[n];h0(a)?t=g0.call(t,m0.call(a)):t.push(a)}return t};Pf.wrap=function(e){return function(){return e(Pf(arguments))}}});var Rf=m((YS,Mf)=>{var Ut=Ef(),jt=Tf(),Nf=Object.hasOwnProperty,xf=Object.create(null);for(si in Ut)Nf.call(Ut,si)&&(xf[Ut[si]]=si);var si,Oe=Mf.exports={to:{},get:{}};Oe.get=function(e){var r=e.substring(0,3).toLowerCase(),t,n;switch(r){case"hsl":t=Oe.get.hsl(e),n="hsl";break;case"hwb":t=Oe.get.hwb(e),n="hwb";break;default:t=Oe.get.rgb(e),n="rgb";break}return t?{model:n,value:t}:null};Oe.get.rgb=function(e){if(!e)return null;var r=/^#([a-f0-9]{3,4})$/i,t=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,n=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,i=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,a=/^(\w+)$/,s=[0,0,0,1],u,d,h;if(u=e.match(t)){for(h=u[2],u=u[1],d=0;d<3;d++){var y=d*2;s[d]=parseInt(u.slice(y,y+2),16)}h&&(s[3]=parseInt(h,16)/255)}else if(u=e.match(r)){for(u=u[1],h=u[3],d=0;d<3;d++)s[d]=parseInt(u[d]+u[d],16);h&&(s[3]=parseInt(h+h,16)/255)}else if(u=e.match(n)){for(d=0;d<3;d++)s[d]=parseInt(u[d+1],0);u[4]&&(u[5]?s[3]=parseFloat(u[4])*.01:s[3]=parseFloat(u[4]))}else if(u=e.match(i)){for(d=0;d<3;d++)s[d]=Math.round(parseFloat(u[d+1])*2.55);u[4]&&(u[5]?s[3]=parseFloat(u[4])*.01:s[3]=parseFloat(u[4]))}else return(u=e.match(a))?u[1]==="transparent"?[0,0,0,0]:Nf.call(Ut,u[1])?(s=Ut[u[1]],s[3]=1,s):null:null;for(d=0;d<3;d++)s[d]=gr(s[d],0,255);return s[3]=gr(s[3],0,1),s};Oe.get.hsl=function(e){if(!e)return null;var r=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,t=e.match(r);if(t){var n=parseFloat(t[4]),i=(parseFloat(t[1])%360+360)%360,a=gr(parseFloat(t[2]),0,100),s=gr(parseFloat(t[3]),0,100),u=gr(isNaN(n)?1:n,0,1);return[i,a,s,u]}return null};Oe.get.hwb=function(e){if(!e)return null;var r=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,t=e.match(r);if(t){var n=parseFloat(t[4]),i=(parseFloat(t[1])%360+360)%360,a=gr(parseFloat(t[2]),0,100),s=gr(parseFloat(t[3]),0,100),u=gr(isNaN(n)?1:n,0,1);return[i,a,s,u]}return null};Oe.to.hex=function(){var e=jt(arguments);return"#"+ui(e[0])+ui(e[1])+ui(e[2])+(e[3]<1?ui(Math.round(e[3]*255)):"")};Oe.to.rgb=function(){var e=jt(arguments);return e.length<4||e[3]===1?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"};Oe.to.rgb.percent=function(){var e=jt(arguments),r=Math.round(e[0]/255*100),t=Math.round(e[1]/255*100),n=Math.round(e[2]/255*100);return e.length<4||e[3]===1?"rgb("+r+"%, "+t+"%, "+n+"%)":"rgba("+r+"%, "+t+"%, "+n+"%, "+e[3]+")"};Oe.to.hsl=function(){var e=jt(arguments);return e.length<4||e[3]===1?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"};Oe.to.hwb=function(){var e=jt(arguments),r="";return e.length>=4&&e[3]!==1&&(r=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+r+")"};Oe.to.keyword=function(e){return xf[e.slice(0,3)]};function gr(e,r,t){return Math.min(Math.max(r,e),t)}function ui(e){var r=Math.round(e).toString(16).toUpperCase();return r.length<2?"0"+r:r}});var Df=m((VS,If)=>{"use strict";If.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var Ao=m((KS,$f)=>{var Lr=Df(),qf={};for(li in Lr)Lr.hasOwnProperty(li)&&(qf[Lr[li]]=li);var li,I=$f.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(be in I)if(I.hasOwnProperty(be)){if(!("channels"in I[be]))throw new Error("missing channels property: "+be);if(!("labels"in I[be]))throw new Error("missing channel labels property: "+be);if(I[be].labels.length!==I[be].channels)throw new Error("channel and label counts mismatch: "+be);Cf=I[be].channels,Lf=I[be].labels,delete I[be].channels,delete I[be].labels,Object.defineProperty(I[be],"channels",{value:Cf}),Object.defineProperty(I[be],"labels",{value:Lf})}var Cf,Lf,be;I.rgb.hsl=function(e){var r=e[0]/255,t=e[1]/255,n=e[2]/255,i=Math.min(r,t,n),a=Math.max(r,t,n),s=a-i,u,d,h;return a===i?u=0:r===a?u=(t-n)/s:t===a?u=2+(n-r)/s:n===a&&(u=4+(r-t)/s),u=Math.min(u*60,360),u<0&&(u+=360),h=(i+a)/2,a===i?d=0:h<=.5?d=s/(a+i):d=s/(2-a-i),[u,d*100,h*100]};I.rgb.hsv=function(e){var r,t,n,i,a,s=e[0]/255,u=e[1]/255,d=e[2]/255,h=Math.max(s,u,d),y=h-Math.min(s,u,d),b=function(_){return(h-_)/6/y+1/2};return y===0?i=a=0:(a=y/h,r=b(s),t=b(u),n=b(d),s===h?i=n-t:u===h?i=1/3+r-n:d===h&&(i=2/3+t-r),i<0?i+=1:i>1&&(i-=1)),[i*360,a*100,h*100]};I.rgb.hwb=function(e){var r=e[0],t=e[1],n=e[2],i=I.rgb.hsl(e)[0],a=1/255*Math.min(r,Math.min(t,n));return n=1-1/255*Math.max(r,Math.max(t,n)),[i,a*100,n*100]};I.rgb.cmyk=function(e){var r=e[0]/255,t=e[1]/255,n=e[2]/255,i,a,s,u;return u=Math.min(1-r,1-t,1-n),i=(1-r-u)/(1-u)||0,a=(1-t-u)/(1-u)||0,s=(1-n-u)/(1-u)||0,[i*100,a*100,s*100,u*100]};function y0(e,r){return Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2)+Math.pow(e[2]-r[2],2)}I.rgb.keyword=function(e){var r=qf[e];if(r)return r;var t=1/0,n;for(var i in Lr)if(Lr.hasOwnProperty(i)){var a=Lr[i],s=y0(e,a);s<t&&(t=s,n=i)}return n};I.keyword.rgb=function(e){return Lr[e]};I.rgb.xyz=function(e){var r=e[0]/255,t=e[1]/255,n=e[2]/255;r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92;var i=r*.4124+t*.3576+n*.1805,a=r*.2126+t*.7152+n*.0722,s=r*.0193+t*.1192+n*.9505;return[i*100,a*100,s*100]};I.rgb.lab=function(e){var r=I.rgb.xyz(e),t=r[0],n=r[1],i=r[2],a,s,u;return t/=95.047,n/=100,i/=108.883,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,a=116*n-16,s=500*(t-n),u=200*(n-i),[a,s,u]};I.hsl.rgb=function(e){var r=e[0]/360,t=e[1]/100,n=e[2]/100,i,a,s,u,d;if(t===0)return d=n*255,[d,d,d];n<.5?a=n*(1+t):a=n+t-n*t,i=2*n-a,u=[0,0,0];for(var h=0;h<3;h++)s=r+1/3*-(h-1),s<0&&s++,s>1&&s--,6*s<1?d=i+(a-i)*6*s:2*s<1?d=a:3*s<2?d=i+(a-i)*(2/3-s)*6:d=i,u[h]=d*255;return u};I.hsl.hsv=function(e){var r=e[0],t=e[1]/100,n=e[2]/100,i=t,a=Math.max(n,.01),s,u;return n*=2,t*=n<=1?n:2-n,i*=a<=1?a:2-a,u=(n+t)/2,s=n===0?2*i/(a+i):2*t/(n+t),[r,s*100,u*100]};I.hsv.rgb=function(e){var r=e[0]/60,t=e[1]/100,n=e[2]/100,i=Math.floor(r)%6,a=r-Math.floor(r),s=255*n*(1-t),u=255*n*(1-t*a),d=255*n*(1-t*(1-a));switch(n*=255,i){case 0:return[n,d,s];case 1:return[u,n,s];case 2:return[s,n,d];case 3:return[s,u,n];case 4:return[d,s,n];case 5:return[n,s,u]}};I.hsv.hsl=function(e){var r=e[0],t=e[1]/100,n=e[2]/100,i=Math.max(n,.01),a,s,u;return u=(2-t)*n,a=(2-t)*i,s=t*i,s/=a<=1?a:2-a,s=s||0,u/=2,[r,s*100,u*100]};I.hwb.rgb=function(e){var r=e[0]/360,t=e[1]/100,n=e[2]/100,i=t+n,a,s,u,d;i>1&&(t/=i,n/=i),a=Math.floor(6*r),s=1-n,u=6*r-a,(a&1)!==0&&(u=1-u),d=t+u*(s-t);var h,y,b;switch(a){default:case 6:case 0:h=s,y=d,b=t;break;case 1:h=d,y=s,b=t;break;case 2:h=t,y=s,b=d;break;case 3:h=t,y=d,b=s;break;case 4:h=d,y=t,b=s;break;case 5:h=s,y=t,b=d;break}return[h*255,y*255,b*255]};I.cmyk.rgb=function(e){var r=e[0]/100,t=e[1]/100,n=e[2]/100,i=e[3]/100,a,s,u;return a=1-Math.min(1,r*(1-i)+i),s=1-Math.min(1,t*(1-i)+i),u=1-Math.min(1,n*(1-i)+i),[a*255,s*255,u*255]};I.xyz.rgb=function(e){var r=e[0]/100,t=e[1]/100,n=e[2]/100,i,a,s;return i=r*3.2406+t*-1.5372+n*-.4986,a=r*-.9689+t*1.8758+n*.0415,s=r*.0557+t*-.204+n*1.057,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a*12.92,s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s*12.92,i=Math.min(Math.max(0,i),1),a=Math.min(Math.max(0,a),1),s=Math.min(Math.max(0,s),1),[i*255,a*255,s*255]};I.xyz.lab=function(e){var r=e[0],t=e[1],n=e[2],i,a,s;return r/=95.047,t/=100,n/=108.883,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,i=116*t-16,a=500*(r-t),s=200*(t-n),[i,a,s]};I.lab.xyz=function(e){var r=e[0],t=e[1],n=e[2],i,a,s;a=(r+16)/116,i=t/500+a,s=a-n/200;var u=Math.pow(a,3),d=Math.pow(i,3),h=Math.pow(s,3);return a=u>.008856?u:(a-16/116)/7.787,i=d>.008856?d:(i-16/116)/7.787,s=h>.008856?h:(s-16/116)/7.787,i*=95.047,a*=100,s*=108.883,[i,a,s]};I.lab.lch=function(e){var r=e[0],t=e[1],n=e[2],i,a,s;return i=Math.atan2(n,t),a=i*360/2/Math.PI,a<0&&(a+=360),s=Math.sqrt(t*t+n*n),[r,s,a]};I.lch.lab=function(e){var r=e[0],t=e[1],n=e[2],i,a,s;return s=n/360*2*Math.PI,i=t*Math.cos(s),a=t*Math.sin(s),[r,i,a]};I.rgb.ansi16=function(e){var r=e[0],t=e[1],n=e[2],i=1 in arguments?arguments[1]:I.rgb.hsv(e)[2];if(i=Math.round(i/50),i===0)return 30;var a=30+(Math.round(n/255)<<2|Math.round(t/255)<<1|Math.round(r/255));return i===2&&(a+=60),a};I.hsv.ansi16=function(e){return I.rgb.ansi16(I.hsv.rgb(e),e[2])};I.rgb.ansi256=function(e){var r=e[0],t=e[1],n=e[2];if(r===t&&t===n)return r<8?16:r>248?231:Math.round((r-8)/247*24)+232;var i=16+36*Math.round(r/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5);return i};I.ansi16.rgb=function(e){var r=e%10;if(r===0||r===7)return e>50&&(r+=3.5),r=r/10.5*255,[r,r,r];var t=(~~(e>50)+1)*.5,n=(r&1)*t*255,i=(r>>1&1)*t*255,a=(r>>2&1)*t*255;return[n,i,a]};I.ansi256.rgb=function(e){if(e>=232){var r=(e-232)*10+8;return[r,r,r]}e-=16;var t,n=Math.floor(e/36)/5*255,i=Math.floor((t=e%36)/6)/5*255,a=t%6/5*255;return[n,i,a]};I.rgb.hex=function(e){var r=((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255),t=r.toString(16).toUpperCase();return"000000".substring(t.length)+t};I.hex.rgb=function(e){var r=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!r)return[0,0,0];var t=r[0];r[0].length===3&&(t=t.split("").map(function(u){return u+u}).join(""));var n=parseInt(t,16),i=n>>16&255,a=n>>8&255,s=n&255;return[i,a,s]};I.rgb.hcg=function(e){var r=e[0]/255,t=e[1]/255,n=e[2]/255,i=Math.max(Math.max(r,t),n),a=Math.min(Math.min(r,t),n),s=i-a,u,d;return s<1?u=a/(1-s):u=0,s<=0?d=0:i===r?d=(t-n)/s%6:i===t?d=2+(n-r)/s:d=4+(r-t)/s+4,d/=6,d%=1,[d*360,s*100,u*100]};I.hsl.hcg=function(e){var r=e[1]/100,t=e[2]/100,n=1,i=0;return t<.5?n=2*r*t:n=2*r*(1-t),n<1&&(i=(t-.5*n)/(1-n)),[e[0],n*100,i*100]};I.hsv.hcg=function(e){var r=e[1]/100,t=e[2]/100,n=r*t,i=0;return n<1&&(i=(t-n)/(1-n)),[e[0],n*100,i*100]};I.hcg.rgb=function(e){var r=e[0]/360,t=e[1]/100,n=e[2]/100;if(t===0)return[n*255,n*255,n*255];var i=[0,0,0],a=r%1*6,s=a%1,u=1-s,d=0;switch(Math.floor(a)){case 0:i[0]=1,i[1]=s,i[2]=0;break;case 1:i[0]=u,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=s;break;case 3:i[0]=0,i[1]=u,i[2]=1;break;case 4:i[0]=s,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=u}return d=(1-t)*n,[(t*i[0]+d)*255,(t*i[1]+d)*255,(t*i[2]+d)*255]};I.hcg.hsv=function(e){var r=e[1]/100,t=e[2]/100,n=r+t*(1-r),i=0;return n>0&&(i=r/n),[e[0],i*100,n*100]};I.hcg.hsl=function(e){var r=e[1]/100,t=e[2]/100,n=t*(1-r)+.5*r,i=0;return n>0&&n<.5?i=r/(2*n):n>=.5&&n<1&&(i=r/(2*(1-n))),[e[0],i*100,n*100]};I.hcg.hwb=function(e){var r=e[1]/100,t=e[2]/100,n=r+t*(1-r);return[e[0],(n-r)*100,(1-n)*100]};I.hwb.hcg=function(e){var r=e[1]/100,t=e[2]/100,n=1-t,i=n-r,a=0;return i<1&&(a=(n-i)/(1-i)),[e[0],i*100,a*100]};I.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};I.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};I.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};I.gray.hsl=I.gray.hsv=function(e){return[0,0,e[0]]};I.gray.hwb=function(e){return[0,100,e[0]]};I.gray.cmyk=function(e){return[0,0,0,e[0]]};I.gray.lab=function(e){return[e[0],0,0]};I.gray.hex=function(e){var r=Math.round(e[0]/100*255)&255,t=(r<<16)+(r<<8)+r,n=t.toString(16).toUpperCase();return"000000".substring(n.length)+n};I.rgb.gray=function(e){var r=(e[0]+e[1]+e[2])/3;return[r/255*100]}});var jf=m((JS,Uf)=>{var ci=Ao();function v0(){for(var e={},r=Object.keys(ci),t=r.length,n=0;n<t;n++)e[r[n]]={distance:-1,parent:null};return e}function b0(e){var r=v0(),t=[e];for(r[e].distance=0;t.length;)for(var n=t.pop(),i=Object.keys(ci[n]),a=i.length,s=0;s<a;s++){var u=i[s],d=r[u];d.distance===-1&&(d.distance=r[n].distance+1,d.parent=n,t.unshift(u))}return r}function _0(e,r){return function(t){return r(e(t))}}function w0(e,r){for(var t=[r[e].parent,e],n=ci[r[e].parent][e],i=r[e].parent;r[i].parent;)t.unshift(r[i].parent),n=_0(ci[r[i].parent][i],n),i=r[i].parent;return n.conversion=t,n}Uf.exports=function(e){for(var r=b0(e),t={},n=Object.keys(r),i=n.length,a=0;a<i;a++){var s=n[a],u=r[s];u.parent!==null&&(t[s]=w0(s,r))}return t}});var kf=m((ZS,Ff)=>{var To=Ao(),E0=jf(),ct={},S0=Object.keys(To);function O0(e){var r=function(t){return t==null?t:(arguments.length>1&&(t=Array.prototype.slice.call(arguments)),e(t))};return"conversion"in e&&(r.conversion=e.conversion),r}function P0(e){var r=function(t){if(t==null)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var n=e(t);if(typeof n=="object")for(var i=n.length,a=0;a<i;a++)n[a]=Math.round(n[a]);return n};return"conversion"in e&&(r.conversion=e.conversion),r}S0.forEach(function(e){ct[e]={},Object.defineProperty(ct[e],"channels",{value:To[e].channels}),Object.defineProperty(ct[e],"labels",{value:To[e].labels});var r=E0(e),t=Object.keys(r);t.forEach(function(n){var i=r[n];ct[e][n]=P0(i),ct[e][n].raw=O0(i)})});Ff.exports=ct});var Hf=m((XS,Bf)=>{"use strict";var Ft=Rf(),Pe=kf(),Mo=[].slice,zf=["keyword","gray","hex"],No={};Object.keys(Pe).forEach(function(e){No[Mo.call(Pe[e].labels).sort().join("")]=e});var fi={};function ge(e,r){if(!(this instanceof ge))return new ge(e,r);if(r&&r in zf&&(r=null),r&&!(r in Pe))throw new Error("Unknown model: "+r);var t,n;if(e==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof ge)this.model=e.model,this.color=e.color.slice(),this.valpha=e.valpha;else if(typeof e=="string"){var i=Ft.get(e);if(i===null)throw new Error("Unable to parse color from string: "+e);this.model=i.model,n=Pe[this.model].channels,this.color=i.value.slice(0,n),this.valpha=typeof i.value[n]=="number"?i.value[n]:1}else if(e.length){this.model=r||"rgb",n=Pe[this.model].channels;var a=Mo.call(e,0,n);this.color=xo(a,n),this.valpha=typeof e[n]=="number"?e[n]:1}else if(typeof e=="number")e&=16777215,this.model="rgb",this.color=[e>>16&255,e>>8&255,e&255],this.valpha=1;else{this.valpha=1;var s=Object.keys(e);"alpha"in e&&(s.splice(s.indexOf("alpha"),1),this.valpha=typeof e.alpha=="number"?e.alpha:0);var u=s.sort().join("");if(!(u in No))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=No[u];var d=Pe[this.model].labels,h=[];for(t=0;t<d.length;t++)h.push(e[d[t]]);this.color=xo(h)}if(fi[this.model])for(n=Pe[this.model].channels,t=0;t<n;t++){var y=fi[this.model][t];y&&(this.color[t]=y(this.color[t]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}ge.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(e){var r=this.model in Ft.to?this:this.rgb();r=r.round(typeof e=="number"?e:1);var t=r.valpha===1?r.color:r.color.concat(this.valpha);return Ft.to[r.model](t)},percentString:function(e){var r=this.rgb().round(typeof e=="number"?e:1),t=r.valpha===1?r.color:r.color.concat(this.valpha);return Ft.to.rgb.percent(t)},array:function(){return this.valpha===1?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var e={},r=Pe[this.model].channels,t=Pe[this.model].labels,n=0;n<r;n++)e[t[n]]=this.color[n];return this.valpha!==1&&(e.alpha=this.valpha),e},unitArray:function(){var e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,this.valpha!==1&&e.push(this.valpha),e},unitObject:function(){var e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,this.valpha!==1&&(e.alpha=this.valpha),e},round:function(e){return e=Math.max(e||0,0),new ge(this.color.map(T0(e)).concat(this.valpha),this.model)},alpha:function(e){return arguments.length?new ge(this.color.concat(Math.max(0,Math.min(1,e))),this.model):this.valpha},red:re("rgb",0,se(255)),green:re("rgb",1,se(255)),blue:re("rgb",2,se(255)),hue:re(["hsl","hsv","hsl","hwb","hcg"],0,function(e){return(e%360+360)%360}),saturationl:re("hsl",1,se(100)),lightness:re("hsl",2,se(100)),saturationv:re("hsv",1,se(100)),value:re("hsv",2,se(100)),chroma:re("hcg",1,se(100)),gray:re("hcg",2,se(100)),white:re("hwb",1,se(100)),wblack:re("hwb",2,se(100)),cyan:re("cmyk",0,se(100)),magenta:re("cmyk",1,se(100)),yellow:re("cmyk",2,se(100)),black:re("cmyk",3,se(100)),x:re("xyz",0,se(100)),y:re("xyz",1,se(100)),z:re("xyz",2,se(100)),l:re("lab",0,se(100)),a:re("lab",1),b:re("lab",2),keyword:function(e){return arguments.length?new ge(e):Pe[this.model].keyword(this.color)},hex:function(e){return arguments.length?new ge(e):Ft.to.hex(this.rgb().round().color)},rgbNumber:function(){var e=this.rgb().color;return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255},luminosity:function(){for(var e=this.rgb().color,r=[],t=0;t<e.length;t++){var n=e[t]/255;r[t]=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)}return .2126*r[0]+.7152*r[1]+.0722*r[2]},contrast:function(e){var r=this.luminosity(),t=e.luminosity();return r>t?(r+.05)/(t+.05):(t+.05)/(r+.05)},level:function(e){var r=this.contrast(e);return r>=7.1?"AAA":r>=4.5?"AA":""},isDark:function(){var e=this.rgb().color,r=(e[0]*299+e[1]*587+e[2]*114)/1e3;return r<128},isLight:function(){return!this.isDark()},negate:function(){for(var e=this.rgb(),r=0;r<3;r++)e.color[r]=255-e.color[r];return e},lighten:function(e){var r=this.hsl();return r.color[2]+=r.color[2]*e,r},darken:function(e){var r=this.hsl();return r.color[2]-=r.color[2]*e,r},saturate:function(e){var r=this.hsl();return r.color[1]+=r.color[1]*e,r},desaturate:function(e){var r=this.hsl();return r.color[1]-=r.color[1]*e,r},whiten:function(e){var r=this.hwb();return r.color[1]+=r.color[1]*e,r},blacken:function(e){var r=this.hwb();return r.color[2]+=r.color[2]*e,r},grayscale:function(){var e=this.rgb().color,r=e[0]*.3+e[1]*.59+e[2]*.11;return ge.rgb(r,r,r)},fade:function(e){return this.alpha(this.valpha-this.valpha*e)},opaquer:function(e){return this.alpha(this.valpha+this.valpha*e)},rotate:function(e){var r=this.hsl(),t=r.color[0];return t=(t+e)%360,t=t<0?360+t:t,r.color[0]=t,r},mix:function(e,r){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);var t=e.rgb(),n=this.rgb(),i=r===void 0?.5:r,a=2*i-1,s=t.alpha()-n.alpha(),u=((a*s===-1?a:(a+s)/(1+a*s))+1)/2,d=1-u;return ge.rgb(u*t.red()+d*n.red(),u*t.green()+d*n.green(),u*t.blue()+d*n.blue(),t.alpha()*i+n.alpha()*(1-i))}};Object.keys(Pe).forEach(function(e){if(zf.indexOf(e)===-1){var r=Pe[e].channels;ge.prototype[e]=function(){if(this.model===e)return new ge(this);if(arguments.length)return new ge(arguments,e);var t=typeof arguments[r]=="number"?r:this.valpha;return new ge(N0(Pe[this.model][e].raw(this.color)).concat(t),e)},ge[e]=function(t){return typeof t=="number"&&(t=xo(Mo.call(arguments),r)),new ge(t,e)}}});function A0(e,r){return Number(e.toFixed(r))}function T0(e){return function(r){return A0(r,e)}}function re(e,r,t){return e=Array.isArray(e)?e:[e],e.forEach(function(n){(fi[n]||(fi[n]=[]))[r]=t}),e=e[0],function(n){var i;return arguments.length?(t&&(n=t(n)),i=this[e](),i.color[r]=n,i):(i=this[e]().color[r],t&&(i=t(i)),i)}}function se(e){return function(r){return Math.max(0,Math.min(e,r))}}function N0(e){return Array.isArray(e)?e:[e]}function xo(e,r){for(var t=0;t<r;t++)typeof e[t]!="number"&&(e[t]=0);return e}Bf.exports=ge});var Wf=m((QS,Gf)=>{"use strict";Gf.exports=function(r){for(var t=0,n=0;t<r.length;n=r.charCodeAt(t++)+((n<<5)-n));var i=Math.floor(Math.abs(Math.sin(n)*1e4%1*16777216)).toString(16);return"#"+Array(6-i.length+1).join("0")+i}});var Jf=m((eO,Kf)=>{"use strict";var Yf=Hf(),Vf=Wf();Kf.exports=function(r,t){var n=r.split(t||":"),i=Vf(n[0]);if(!n.length)return i;for(var a=0,s=n.length-1;a<s;a++)i=Yf(i).mix(Yf(Vf(n[a+1]))).saturate(1).hex();return i}});var Xf=m((rO,Zf)=>{"use strict";function Le(e,r){if(r)return new Le(e).style(r);if(!(this instanceof Le))return new Le(e);this.text=e}Le.prototype.prefix="\x1B[";Le.prototype.suffix="m";Le.prototype.hex=function(r){r=r[0]==="#"?r.substring(1):r,r.length===3&&(r=r.split(""),r[5]=r[2],r[4]=r[2],r[3]=r[1],r[2]=r[1],r[1]=r[0],r=r.join(""));var t=r.substring(0,2),n=r.substring(2,4),i=r.substring(4,6);return[parseInt(t,16),parseInt(n,16),parseInt(i,16)]};Le.prototype.rgb=function(r,t,n){var i=r/255*5,a=t/255*5,s=n/255*5;return this.ansi(i,a,s)};Le.prototype.ansi=function(r,t,n){var i=Math.round(r),a=Math.round(t),s=Math.round(n);return 16+i*36+a*6+s};Le.prototype.reset=function(){return this.prefix+"39;49"+this.suffix};Le.prototype.style=function(r){return this.prefix+"38;5;"+this.rgb.apply(this,this.hex(r))+this.suffix+this.text+this.reset()};Zf.exports=Le});var ed=m((tO,Qf)=>{var x0=Jf(),M0=Xf();Qf.exports=function(r,t){var n=t.namespace,i=t.colors!==!1?M0(n+":",x0(n)):n+":";return r[0]=i+" "+r[0],r}});var td=m((nO,rd)=>{"use strict";rd.exports=function(r,t){if(!t)return!1;for(var n=t.split(/[\s,]+/),i=0;i<n.length;i++){if(t=n[i].replace("*",".*?"),t.charAt(0)==="-"){if(new RegExp("^"+t.substr(1)+"$").test(r))return!1;continue}if(new RegExp("^"+t+"$").test(r))return!0}return!1}});var id=m((iO,nd)=>{var R0=td();nd.exports=function(r){return function(n){try{return R0(n,r())}catch{}return!1}}});var od=m((aO,ad)=>{var I0=id();ad.exports=I0(function(){return process.env.DEBUG||process.env.DIAGNOSTICS})});var ud=m((oO,sd)=>{sd.exports=function(e,r){try{Function.prototype.apply.call(console.log,console,r)}catch{}}});var cd=m((sO,ld)=>{var D0=Po(),C0=require("tty").isatty(1),di=D0(function e(r,t){return t=t||{},t.colors="colors"in t?t.colors:C0,t.namespace=r,t.prod=!1,t.dev=!0,!e.enabled(r)&&!(t.force||e.force)?e.nope(t):e.yep(t)});di.modify(ed());di.use(od());di.set(ud());ld.exports=di});var kt=m((uO,Ro)=>{process.env.NODE_ENV==="production"?Ro.exports=_f():Ro.exports=cd()});var dd=m((lO,fd)=>{"use strict";var Io=require("fs"),{StringDecoder:L0}=require("string_decoder"),{Stream:q0}=Cr();function $0(){}fd.exports=(e,r)=>{let t=Buffer.alloc(65536),n=new L0("utf8"),i=new q0,a="",s=0,u=0;return e.start===-1&&delete e.start,i.readable=!0,i.destroy=()=>{i.destroyed=!0,i.emit("end"),i.emit("close")},Io.open(e.file,"a+","0644",(d,h)=>{if(d){r?r(d):i.emit("error",d),i.destroy();return}(function y(){if(i.destroyed){Io.close(h,$0);return}return Io.read(h,t,0,t.length,s,(b,_)=>{if(b){r?r(b):i.emit("error",b),i.destroy();return}if(!_)return a&&((e.start==null||u>e.start)&&(r?r(null,a):i.emit("line",a)),u++,a=""),setTimeout(y,1e3);let S=n.write(t.slice(0,_));r||i.emit("data",S),S=(a+S).split(/\n+/);let g=S.length-1,w=0;for(;w<g;w++)(e.start==null||u>e.start)&&(r?r(null,S[w]):i.emit("line",S[w])),u++;return a=S[g],s+=_,y()})})()}),r?i.destroy:i}});var md=m((fO,gd)=>{"use strict";var Ee=require("fs"),le=require("path"),pd=of(),U0=require("zlib"),{MESSAGE:j0}=ae(),{Stream:F0,PassThrough:hd}=Cr(),k0=ot(),qe=kt()("winston:file"),z0=require("os"),B0=dd();gd.exports=class extends k0{constructor(r={}){super(r),this.name=r.name||"file";function t(n,...i){i.slice(1).forEach(a=>{if(r[a])throw new Error(`Cannot set ${a} and ${n} together`)})}if(this._stream=new hd,this._stream.setMaxListeners(30),this._onError=this._onError.bind(this),r.filename||r.dirname)t("filename or dirname","stream"),this._basename=this.filename=r.filename?le.basename(r.filename):"winston.log",this.dirname=r.dirname||le.dirname(r.filename),this.options=r.options||{flags:"a"};else if(r.stream)console.warn("options.stream will be removed in winston@4. Use winston.transports.Stream"),t("stream","filename","maxsize"),this._dest=this._stream.pipe(this._setupStream(r.stream)),this.dirname=le.dirname(this._dest.path);else throw new Error("Cannot log to file without filename or stream.");this.maxsize=r.maxsize||null,this.rotationFormat=r.rotationFormat||!1,this.zippedArchive=r.zippedArchive||!1,this.maxFiles=r.maxFiles||null,this.eol=typeof r.eol=="string"?r.eol:z0.EOL,this.tailable=r.tailable||!1,this.lazy=r.lazy||!1,this._size=0,this._pendingSize=0,this._created=0,this._drain=!1,this._opening=!1,this._ending=!1,this._fileExist=!1,this.dirname&&this._createLogDirIfNotExist(this.dirname),this.lazy||this.open()}finishIfEnding(){this._ending&&(this._opening?this.once("open",()=>{this._stream.once("finish",()=>this.emit("finish")),setImmediate(()=>this._stream.end())}):(this._stream.once("finish",()=>this.emit("finish")),setImmediate(()=>this._stream.end())))}log(r,t=()=>{}){if(this.silent)return t(),!0;if(this._drain){this._stream.once("drain",()=>{this._drain=!1,this.log(r,t)});return}if(this._rotate){this._stream.once("rotate",()=>{this._rotate=!1,this.log(r,t)});return}if(this.lazy){if(!this._fileExist){this._opening||this.open(),this.once("open",()=>{this._fileExist=!0,this.log(r,t)});return}if(this._needsNewFile(this._pendingSize)){this._dest.once("close",()=>{this._opening||this.open(),this.once("open",()=>{this.log(r,t)})});return}}let n=`${r[j0]}${this.eol}`,i=Buffer.byteLength(n);function a(){if(this._size+=i,this._pendingSize-=i,qe("logged %s %s",this._size,n),this.emit("logged",r),!this._rotate&&!this._opening&&this._needsNewFile()){if(this.lazy){this._endStream(()=>{this.emit("fileclosed")});return}this._rotate=!0,this._endStream(()=>this._rotateFile())}}this._pendingSize+=i,this._opening&&!this.rotatedWhileOpening&&this._needsNewFile(this._size+this._pendingSize)&&(this.rotatedWhileOpening=!0);let s=this._stream.write(n,a.bind(this));return s?t():(this._drain=!0,this._stream.once("drain",()=>{this._drain=!1,t()})),qe("written",s,this._drain),this.finishIfEnding(),s}query(r,t){typeof r=="function"&&(t=r,r={}),r=b(r);let n=le.join(this.dirname,this.filename),i="",a=[],s=0,u=Ee.createReadStream(n,{encoding:"utf8"});u.on("error",_=>{if(u.readable&&u.destroy(),!!t)return _.code!=="ENOENT"?t(_):t(null,a)}),u.on("data",_=>{_=(i+_).split(/\n+/);let S=_.length-1,g=0;for(;g<S;g++)(!r.start||s>=r.start)&&d(_[g]),s++;i=_[S]}),u.on("close",()=>{i&&d(i,!0),r.order==="desc"&&(a=a.reverse()),t&&t(null,a)});function d(_,S){try{let g=JSON.parse(_);y(g)&&h(g)}catch(g){S||u.emit("error",g)}}function h(_){if(r.rows&&a.length>=r.rows&&r.order!=="desc"){u.readable&&u.destroy();return}r.fields&&(_=r.fields.reduce((S,g)=>(S[g]=_[g],S),{})),r.order==="desc"&&a.length>=r.rows&&a.shift(),a.push(_)}function y(_){if(!_||typeof _!="object")return;let S=new Date(_.timestamp);if(!(r.from&&S<r.from||r.until&&S>r.until||r.level&&r.level!==_.level))return!0}function b(_){return _=_||{},_.rows=_.rows||_.limit||10,_.start=_.start||0,_.until=_.until||new Date,typeof _.until!="object"&&(_.until=new Date(_.until)),_.from=_.from||_.until-1440*60*1e3,typeof _.from!="object"&&(_.from=new Date(_.from)),_.order=_.order||"desc",_}}stream(r={}){let t=le.join(this.dirname,this.filename),n=new F0,i={file:t,start:r.start};return n.destroy=B0(i,(a,s)=>{if(a)return n.emit("error",a);try{n.emit("data",s),s=JSON.parse(s),n.emit("log",s)}catch(u){n.emit("error",u)}}),n}open(){this.filename&&(this._opening||(this._opening=!0,this.stat((r,t)=>{if(r)return this.emit("error",r);qe("stat done: %s { size: %s }",this.filename,t),this._size=t,this._dest=this._createStream(this._stream),this._opening=!1,this.once("open",()=>{this._stream.emit("rotate")||(this._rotate=!1)})})))}stat(r){let t=this._getFile(),n=le.join(this.dirname,t);Ee.stat(n,(i,a)=>{if(i&&i.code==="ENOENT")return qe("ENOENT\xA0ok",n),this.filename=t,r(null,0);if(i)return qe(`err ${i.code} ${n}`),r(i);if(!a||this._needsNewFile(a.size))return this._incFile(()=>this.stat(r));this.filename=t,r(null,a.size)})}close(r){this._stream&&this._stream.end(()=>{r&&r(),this.emit("flush"),this.emit("closed")})}_needsNewFile(r){return r=r||this._size,this.maxsize&&r>=this.maxsize}_onError(r){this.emit("error",r)}_setupStream(r){return r.on("error",this._onError),r}_cleanupStream(r){return r.removeListener("error",this._onError),r.destroy(),r}_rotateFile(){this._incFile(()=>this.open())}_endStream(r=()=>{}){this._dest?(this._stream.unpipe(this._dest),this._dest.end(()=>{this._cleanupStream(this._dest),r()})):r()}_createStream(r){let t=le.join(this.dirname,this.filename);qe("create stream start",t,this.options);let n=Ee.createWriteStream(t,this.options).on("error",i=>qe(i)).on("close",()=>qe("close",n.path,n.bytesWritten)).on("open",()=>{qe("file open ok",t),this.emit("open",t),r.pipe(n),this.rotatedWhileOpening&&(this._stream=new hd,this._stream.setMaxListeners(30),this._rotateFile(),this.rotatedWhileOpening=!1,this._cleanupStream(n),r.end())});return qe("create stream ok",t),n}_incFile(r){qe("_incFile",this.filename);let t=le.extname(this._basename),n=le.basename(this._basename,t),i=[];this.zippedArchive&&i.push(function(a){let s=this._created>0&&!this.tailable?this._created:"";this._compressFile(le.join(this.dirname,`${n}${s}${t}`),le.join(this.dirname,`${n}${s}${t}.gz`),a)}.bind(this)),i.push(function(a){this.tailable?this._checkMaxFilesTailable(t,n,a):(this._created+=1,this._checkMaxFilesIncrementing(t,n,a))}.bind(this)),pd(i,r)}_getFile(){let r=le.extname(this._basename),t=le.basename(this._basename,r),n=this.rotationFormat?this.rotationFormat():this._created;return!this.tailable&&this._created?`${t}${n}${r}`:`${t}${r}`}_checkMaxFilesIncrementing(r,t,n){if(!this.maxFiles||this._created<this.maxFiles)return setImmediate(n);let i=this._created-this.maxFiles,a=i!==0?i:"",s=this.zippedArchive?".gz":"",u=`${t}${a}${r}${s}`,d=le.join(this.dirname,u);Ee.unlink(d,n)}_checkMaxFilesTailable(r,t,n){let i=[];if(!this.maxFiles)return;let a=this.zippedArchive?".gz":"";for(let s=this.maxFiles-1;s>1;s--)i.push(function(u,d){let h=`${t}${u-1}${r}${a}`,y=le.join(this.dirname,h);Ee.exists(y,b=>{if(!b)return d(null);h=`${t}${u}${r}${a}`,Ee.rename(y,le.join(this.dirname,h),d)})}.bind(this,s));pd(i,()=>{Ee.rename(le.join(this.dirname,`${t}${r}${a}`),le.join(this.dirname,`${t}1${r}${a}`),n)})}_compressFile(r,t,n){Ee.access(r,Ee.F_OK,i=>{if(i)return n();var a=U0.createGzip(),s=Ee.createReadStream(r),u=Ee.createWriteStream(t);u.on("finish",()=>{Ee.unlink(r,n)}),s.pipe(a).pipe(u)})}_createLogDirIfNotExist(r){Ee.existsSync(r)||Ee.mkdirSync(r,{recursive:!0})}}});var vd=m((pO,yd)=>{"use strict";var H0=require("http"),G0=require("https"),{Stream:W0}=Cr(),Y0=ot(),{configure:V0}=Et();yd.exports=class extends Y0{constructor(r={}){super(r),this.options=r,this.name=r.name||"http",this.ssl=!!r.ssl,this.host=r.host||"localhost",this.port=r.port,this.auth=r.auth,this.path=r.path||"",this.maximumDepth=r.maximumDepth,this.agent=r.agent,this.headers=r.headers||{},this.headers["content-type"]="application/json",this.batch=r.batch||!1,this.batchInterval=r.batchInterval||5e3,this.batchCount=r.batchCount||10,this.batchOptions=[],this.batchTimeoutID=-1,this.batchCallback={},this.port||(this.port=this.ssl?443:80)}log(r,t){this._request(r,null,null,(n,i)=>{i&&i.statusCode!==200&&(n=new Error(`Invalid HTTP Status Code: ${i.statusCode}`)),n?this.emit("warn",n):this.emit("logged",r)}),t&&setImmediate(t)}query(r,t){typeof r=="function"&&(t=r,r={}),r={method:"query",params:this.normalizeQuery(r)};let n=r.params.auth||null;delete r.params.auth;let i=r.params.path||null;delete r.params.path,this._request(r,n,i,(a,s,u)=>{if(s&&s.statusCode!==200&&(a=new Error(`Invalid HTTP Status Code: ${s.statusCode}`)),a)return t(a);if(typeof u=="string")try{u=JSON.parse(u)}catch(d){return t(d)}t(null,u)})}stream(r={}){let t=new W0;r={method:"stream",params:r};let n=r.params.path||null;delete r.params.path;let i=r.params.auth||null;delete r.params.auth;let a="",s=this._request(r,i,n);return t.destroy=()=>s.destroy(),s.on("data",u=>{u=(a+u).split(/\n+/);let d=u.length-1,h=0;for(;h<d;h++)try{t.emit("log",JSON.parse(u[h]))}catch(y){t.emit("error",y)}a=u[d]}),s.on("error",u=>t.emit("error",u)),t}_request(r,t,n,i){r=r||{},t=t||this.auth,n=n||this.path||"",this.batch?this._doBatch(r,i,t,n):this._doRequest(r,i,t,n)}_doBatch(r,t,n,i){if(this.batchOptions.push(r),this.batchOptions.length===1){let a=this;this.batchCallback=t,this.batchTimeoutID=setTimeout(function(){a.batchTimeoutID=-1,a._doBatchRequest(a.batchCallback,n,i)},this.batchInterval)}this.batchOptions.length===this.batchCount&&this._doBatchRequest(this.batchCallback,n,i)}_doBatchRequest(r,t,n){this.batchTimeoutID>0&&(clearTimeout(this.batchTimeoutID),this.batchTimeoutID=-1);let i=this.batchOptions.slice();this.batchOptions=[],this._doRequest(i,r,t,n)}_doRequest(r,t,n,i){let a=Object.assign({},this.headers);n&&n.bearer&&(a.Authorization=`Bearer ${n.bearer}`);let s=(this.ssl?G0:H0).request({...this.options,method:"POST",host:this.host,port:this.port,path:`/${i.replace(/^\//,"")}`,headers:a,auth:n&&n.username&&n.password?`${n.username}:${n.password}`:"",agent:this.agent});s.on("error",t),s.on("response",d=>d.on("end",()=>t(null,d)).resume());let u=V0({...this.maximumDepth&&{maximumDepth:this.maximumDepth}});s.end(Buffer.from(u(r,this.options.replacer),"utf8"))}}});var Do=m((hO,bd)=>{"use strict";var ke=e=>e!==null&&typeof e=="object"&&typeof e.pipe=="function";ke.writable=e=>ke(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object";ke.readable=e=>ke(e)&&e.readable!==!1&&typeof e._read=="function"&&typeof e._readableState=="object";ke.duplex=e=>ke.writable(e)&&ke.readable(e);ke.transform=e=>ke.duplex(e)&&typeof e._transform=="function";bd.exports=ke});var wd=m((mO,_d)=>{"use strict";var K0=Do(),{MESSAGE:J0}=ae(),Z0=require("os"),X0=ot();_d.exports=class extends X0{constructor(r={}){if(super(r),!r.stream||!K0(r.stream))throw new Error("options.stream is required.");this._stream=r.stream,this._stream.setMaxListeners(1/0),this.isObjectMode=r.stream._writableState.objectMode,this.eol=typeof r.eol=="string"?r.eol:Z0.EOL}log(r,t){if(setImmediate(()=>this.emit("logged",r)),this.isObjectMode){this._stream.write(r),t&&t();return}this._stream.write(`${r[J0]}${this.eol}`),t&&t()}}});var Ed=m(zt=>{"use strict";Object.defineProperty(zt,"Console",{configurable:!0,enumerable:!0,get(){return Sc()}});Object.defineProperty(zt,"File",{configurable:!0,enumerable:!0,get(){return md()}});Object.defineProperty(zt,"Http",{configurable:!0,enumerable:!0,get(){return vd()}});Object.defineProperty(zt,"Stream",{configurable:!0,enumerable:!0,get(){return wd()}})});var hi=m(Bt=>{"use strict";var pi=Ia(),{configs:Co}=ae();Bt.cli=pi.levels(Co.cli);Bt.npm=pi.levels(Co.npm);Bt.syslog=pi.levels(Co.syslog);Bt.addColors=pi.levels});var Od=m((gi,Sd)=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});var Q0=Bn(),e1=qr(Q0),r1=Qn(),t1=qr(r1),n1=mo(),i1=qr(n1),a1=po(),o1=qr(a1),s1=ho(),u1=qr(s1),l1=Dr(),c1=qr(l1),f1=ut(),d1=qr(f1);function qr(e){return e&&e.__esModule?e:{default:e}}function p1(e,r,t){t=(0,o1.default)(t);var n=0,i=0,{length:a}=e,s=!1;a===0&&t(null);function u(d,h){d===!1&&(s=!0),s!==!0&&(d?t(d):(++i===a||h===t1.default)&&t(null))}for(;n<a;n++)r(e[n],n,(0,u1.default)(u))}function h1(e,r,t){return(0,i1.default)(e,1/0,r,t)}function g1(e,r,t){var n=(0,e1.default)(e)?p1:h1;return n(e,(0,c1.default)(r),t)}gi.default=(0,d1.default)(g1,3);Sd.exports=gi.default});var Ad=m((mi,Pd)=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.default=m1;function m1(e){return(r,t,n)=>e(r,n)}Pd.exports=mi.default});var bi=m((vi,Td)=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});var y1=Od(),v1=yi(y1),b1=Ad(),_1=yi(b1),w1=Dr(),E1=yi(w1),S1=ut(),O1=yi(S1);function yi(e){return e&&e.__esModule?e:{default:e}}function P1(e,r,t){return(0,v1.default)(e,(0,_1.default)((0,E1.default)(r)),t)}vi.default=(0,O1.default)(P1,3);Td.exports=vi.default});var xd=m((bO,Nd)=>{"use strict";var A1=Object.prototype.toString;Nd.exports=function(r){if(typeof r.displayName=="string"&&r.constructor.name)return r.displayName;if(typeof r.name=="string"&&r.name)return r.name;if(typeof r=="object"&&r.constructor&&typeof r.constructor.name=="string")return r.constructor.name;var t=r.toString(),n=A1.call(r).slice(8,-1);return n==="Function"?t=t.substring(t.indexOf("(")+1,t.indexOf(")")):t=n,t||"anonymous"}});var Lo=m((_O,Md)=>{"use strict";var T1=xd();Md.exports=function(r){var t=0,n;function i(){return t||(t=1,n=r.apply(this,arguments),r=null),n}return i.displayName=T1(r),i}});var qo=m(Gt=>{Gt.get=function(e){var r=Error.stackTraceLimit;Error.stackTraceLimit=1/0;var t={},n=Error.prepareStackTrace;Error.prepareStackTrace=function(a,s){return s},Error.captureStackTrace(t,e||Gt.get);var i=t.stack;return Error.prepareStackTrace=n,Error.stackTraceLimit=r,i};Gt.parse=function(e){if(!e.stack)return[];var r=this,t=e.stack.split(`
52
- `).slice(1);return t.map(function(n){if(n.match(/^\s*[-]{4,}$/))return r._createParsedCallSite({fileName:n,lineNumber:null,functionName:null,typeName:null,methodName:null,columnNumber:null,native:null});var i=n.match(/at (?:(.+)\s+\()?(?:(.+?):(\d+)(?::(\d+))?|([^)]+))\)?/);if(i){var a=null,s=null,u=null,d=null,h=null,y=i[5]==="native";if(i[1]){u=i[1];var b=u.lastIndexOf(".");if(u[b-1]=="."&&b--,b>0){a=u.substr(0,b),s=u.substr(b+1);var _=a.indexOf(".Module");_>0&&(u=u.substr(_+1),a=a.substr(0,_))}d=null}s&&(d=a,h=s),s==="<anonymous>"&&(h=null,u=null);var S={fileName:i[2]||null,lineNumber:parseInt(i[3],10)||null,functionName:u,typeName:d,methodName:h,columnNumber:parseInt(i[4],10)||null,native:y};return r._createParsedCallSite(S)}}).filter(function(n){return!!n})};function Ht(e){for(var r in e)this[r]=e[r]}var N1=["this","typeName","functionName","methodName","fileName","lineNumber","columnNumber","function","evalOrigin"],x1=["topLevel","eval","native","constructor"];N1.forEach(function(e){Ht.prototype[e]=null,Ht.prototype["get"+e[0].toUpperCase()+e.substr(1)]=function(){return this[e]}});x1.forEach(function(e){Ht.prototype[e]=!1,Ht.prototype["is"+e[0].toUpperCase()+e.substr(1)]=function(){return this[e]}});Gt._createParsedCallSite=function(e){return new Ht(e)}});var Id=m((SO,Rd)=>{"use strict";var{Writable:M1}=Cr();Rd.exports=class extends M1{constructor(r){if(super({objectMode:!0}),!r)throw new Error("ExceptionStream requires a TransportStream instance.");this.handleExceptions=!0,this.transport=r}_write(r,t,n){return r.exception?this.transport.log(r,n):(n(),!0)}}});var Uo=m((PO,Ld)=>{"use strict";var Dd=require("os"),R1=bi(),$o=kt()("winston:exception"),I1=Lo(),Cd=qo(),D1=Id();Ld.exports=class{constructor(r){if(!r)throw new Error("Logger is required to handle exceptions");this.logger=r,this.handlers=new Map}handle(...r){r.forEach(t=>{if(Array.isArray(t))return t.forEach(n=>this._addHandler(n));this._addHandler(t)}),this.catcher||(this.catcher=this._uncaughtException.bind(this),process.on("uncaughtException",this.catcher))}unhandle(){this.catcher&&(process.removeListener("uncaughtException",this.catcher),this.catcher=!1,Array.from(this.handlers.values()).forEach(r=>this.logger.unpipe(r)))}getAllInfo(r){let t=null;return r&&(t=typeof r=="string"?r:r.message),{error:r,level:"error",message:[`uncaughtException: ${t||"(no error message)"}`,r&&r.stack||" No stack trace"].join(`
53
- `),stack:r&&r.stack,exception:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(r)}}getProcessInfo(){return{pid:process.pid,uid:process.getuid?process.getuid():null,gid:process.getgid?process.getgid():null,cwd:process.cwd(),execPath:process.execPath,version:process.version,argv:process.argv,memoryUsage:process.memoryUsage()}}getOsInfo(){return{loadavg:Dd.loadavg(),uptime:Dd.uptime()}}getTrace(r){return(r?Cd.parse(r):Cd.get()).map(n=>({column:n.getColumnNumber(),file:n.getFileName(),function:n.getFunctionName(),line:n.getLineNumber(),method:n.getMethodName(),native:n.isNative()}))}_addHandler(r){if(!this.handlers.has(r)){r.handleExceptions=!0;let t=new D1(r);this.handlers.set(r,t),this.logger.pipe(t)}}_uncaughtException(r){let t=this.getAllInfo(r),n=this._getExceptionHandlers(),i=typeof this.logger.exitOnError=="function"?this.logger.exitOnError(r):this.logger.exitOnError,a;!n.length&&i&&(console.warn("winston: exitOnError cannot be true with no exception handlers."),console.warn("winston: not exiting process."),i=!1);function s(){$o("doExit",i),$o("process._exiting",process._exiting),i&&!process._exiting&&(a&&clearTimeout(a),process.exit(1))}if(!n||n.length===0)return process.nextTick(s);R1(n,(u,d)=>{let h=I1(d),y=u.transport||u;function b(_){return()=>{$o(_),h()}}y._ending=!0,y.once("finish",b("finished")),y.once("error",b("error"))},()=>i&&s()),this.logger.log(t),i&&(a=setTimeout(s,3e3))}_getExceptionHandlers(){return this.logger.transports.filter(r=>(r.transport||r).handleExceptions)}}});var $d=m((TO,qd)=>{"use strict";var{Writable:C1}=Cr();qd.exports=class extends C1{constructor(r){if(super({objectMode:!0}),!r)throw new Error("RejectionStream requires a TransportStream instance.");this.handleRejections=!0,this.transport=r}_write(r,t,n){return r.rejection?this.transport.log(r,n):(n(),!0)}}});var Fo=m((xO,Fd)=>{"use strict";var Ud=require("os"),L1=bi(),jo=kt()("winston:rejection"),q1=Lo(),jd=qo(),$1=$d();Fd.exports=class{constructor(r){if(!r)throw new Error("Logger is required to handle rejections");this.logger=r,this.handlers=new Map}handle(...r){r.forEach(t=>{if(Array.isArray(t))return t.forEach(n=>this._addHandler(n));this._addHandler(t)}),this.catcher||(this.catcher=this._unhandledRejection.bind(this),process.on("unhandledRejection",this.catcher))}unhandle(){this.catcher&&(process.removeListener("unhandledRejection",this.catcher),this.catcher=!1,Array.from(this.handlers.values()).forEach(r=>this.logger.unpipe(r)))}getAllInfo(r){let t=null;return r&&(t=typeof r=="string"?r:r.message),{error:r,level:"error",message:[`unhandledRejection: ${t||"(no error message)"}`,r&&r.stack||" No stack trace"].join(`
54
- `),stack:r&&r.stack,rejection:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(r)}}getProcessInfo(){return{pid:process.pid,uid:process.getuid?process.getuid():null,gid:process.getgid?process.getgid():null,cwd:process.cwd(),execPath:process.execPath,version:process.version,argv:process.argv,memoryUsage:process.memoryUsage()}}getOsInfo(){return{loadavg:Ud.loadavg(),uptime:Ud.uptime()}}getTrace(r){return(r?jd.parse(r):jd.get()).map(n=>({column:n.getColumnNumber(),file:n.getFileName(),function:n.getFunctionName(),line:n.getLineNumber(),method:n.getMethodName(),native:n.isNative()}))}_addHandler(r){if(!this.handlers.has(r)){r.handleRejections=!0;let t=new $1(r);this.handlers.set(r,t),this.logger.pipe(t)}}_unhandledRejection(r){let t=this.getAllInfo(r),n=this._getRejectionHandlers(),i=typeof this.logger.exitOnError=="function"?this.logger.exitOnError(r):this.logger.exitOnError,a;!n.length&&i&&(console.warn("winston: exitOnError cannot be true with no rejection handlers."),console.warn("winston: not exiting process."),i=!1);function s(){jo("doExit",i),jo("process._exiting",process._exiting),i&&!process._exiting&&(a&&clearTimeout(a),process.exit(1))}if(!n||n.length===0)return process.nextTick(s);L1(n,(u,d)=>{let h=q1(d),y=u.transport||u;function b(_){return()=>{jo(_),h()}}y._ending=!0,y.once("finish",b("finished")),y.once("error",b("error"))},()=>i&&s()),this.logger.log(t),i&&(a=setTimeout(s,3e3))}_getRejectionHandlers(){return this.logger.transports.filter(r=>(r.transport||r).handleRejections)}}});var zd=m((MO,kd)=>{"use strict";var ko=class{constructor(r){let t=_i();if(typeof r!="object"||Array.isArray(r)||!(r instanceof t))throw new Error("Logger is required for profiling");this.logger=r,this.start=Date.now()}done(...r){typeof r[r.length-1]=="function"&&(console.warn("Callback function no longer supported as of winston@3.0.0"),r.pop());let t=typeof r[r.length-1]=="object"?r.pop():{};return t.level=t.level||"info",t.durationMs=Date.now()-this.start,this.logger.write(t)}};kd.exports=ko});var _i=m((RO,Wd)=>{"use strict";var{Stream:U1,Transform:j1}=Cr(),Bd=bi(),{LEVEL:ze,SPLAT:Hd}=ae(),Gd=Do(),F1=Uo(),k1=Fo(),z1=lo(),B1=zd(),{warn:H1}=Da(),G1=hi(),W1=/%[scdjifoO%]/g,wi=class extends j1{constructor(r){super({objectMode:!0}),this.configure(r)}child(r){let t=this;return Object.create(t,{write:{value:function(n){let i=Object.assign({},r,n);n instanceof Error&&(i.stack=n.stack,i.message=n.message),t.write(i)}}})}configure({silent:r,format:t,defaultMeta:n,levels:i,level:a="info",exitOnError:s=!0,transports:u,colors:d,emitErrs:h,formatters:y,padLevels:b,rewriters:_,stripColors:S,exceptionHandlers:g,rejectionHandlers:w}={}){if(this.transports.length&&this.clear(),this.silent=r,this.format=t||this.format||Ta()(),this.defaultMeta=n||null,this.levels=i||this.levels||G1.npm.levels,this.level=a,this.exceptions&&this.exceptions.unhandle(),this.rejections&&this.rejections.unhandle(),this.exceptions=new F1(this),this.rejections=new k1(this),this.profilers={},this.exitOnError=s,u&&(u=Array.isArray(u)?u:[u],u.forEach(T=>this.add(T))),d||h||y||b||_||S)throw new Error(["{ colors, emitErrs, formatters, padLevels, rewriters, stripColors } were removed in winston@3.0.0.","Use a custom winston.format(function) instead.","See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md"].join(`
55
- `));g&&this.exceptions.handle(g),w&&this.rejections.handle(w)}isLevelEnabled(r){let t=zo(this.levels,r);if(t===null)return!1;let n=zo(this.levels,this.level);return n===null?!1:!this.transports||this.transports.length===0?n>=t:this.transports.findIndex(a=>{let s=zo(this.levels,a.level);return s===null&&(s=n),s>=t})!==-1}log(r,t,...n){if(arguments.length===1)return r[ze]=r.level,this._addDefaultMeta(r),this.write(r),this;if(arguments.length===2)return t&&typeof t=="object"?(t[ze]=t.level=r,this._addDefaultMeta(t),this.write(t),this):(t={[ze]:r,level:r,message:t},this._addDefaultMeta(t),this.write(t),this);let[i]=n;if(typeof i=="object"&&i!==null&&!(t&&t.match&&t.match(W1))){let s=Object.assign({},this.defaultMeta,i,{[ze]:r,[Hd]:n,level:r,message:t});return i.message&&(s.message=`${s.message} ${i.message}`),i.stack&&(s.stack=i.stack),i.cause&&(s.cause=i.cause),this.write(s),this}return this.write(Object.assign({},this.defaultMeta,{[ze]:r,[Hd]:n,level:r,message:t})),this}_transform(r,t,n){if(this.silent)return n();r[ze]||(r[ze]=r.level),!this.levels[r[ze]]&&this.levels[r[ze]]!==0&&console.error("[winston] Unknown logger level: %s",r[ze]),this._readableState.pipes||console.error("[winston] Attempt to write logs with no transports, which can increase memory usage: %j",r);try{this.push(this.format.transform(r,this.format.options))}finally{this._writableState.sync=!1,n()}}_final(r){let t=this.transports.slice();Bd(t,(n,i)=>{if(!n||n.finished)return setImmediate(i);n.once("finish",i),n.end()},r)}add(r){let t=!Gd(r)||r.log.length>2?new z1({transport:r}):r;if(!t._writableState||!t._writableState.objectMode)throw new Error("Transports must WritableStreams in objectMode. Set { objectMode: true }.");return this._onEvent("error",t),this._onEvent("warn",t),this.pipe(t),r.handleExceptions&&this.exceptions.handle(),r.handleRejections&&this.rejections.handle(),this}remove(r){if(!r)return this;let t=r;return(!Gd(r)||r.log.length>2)&&(t=this.transports.filter(n=>n.transport===r)[0]),t&&this.unpipe(t),this}clear(){return this.unpipe(),this}close(){return this.exceptions.unhandle(),this.rejections.unhandle(),this.clear(),this.emit("close"),this}setLevels(){H1.deprecated("setLevels")}query(r,t){typeof r=="function"&&(t=r,r={}),r=r||{};let n={},i=Object.assign({},r.query||{});function a(u,d){r.query&&typeof u.formatQuery=="function"&&(r.query=u.formatQuery(i)),u.query(r,(h,y)=>{if(h)return d(h);typeof u.formatResults=="function"&&(y=u.formatResults(y,r.format)),d(null,y)})}function s(u,d){a(u,(h,y)=>{d&&(y=h||y,y&&(n[u.name]=y),d()),d=null})}Bd(this.transports.filter(u=>!!u.query),s,()=>t(null,n))}stream(r={}){let t=new U1,n=[];return t._streams=n,t.destroy=()=>{let i=n.length;for(;i--;)n[i].destroy()},this.transports.filter(i=>!!i.stream).forEach(i=>{let a=i.stream(r);a&&(n.push(a),a.on("log",s=>{s.transport=s.transport||[],s.transport.push(i.name),t.emit("log",s)}),a.on("error",s=>{s.transport=s.transport||[],s.transport.push(i.name),t.emit("error",s)}))}),t}startTimer(){return new B1(this)}profile(r,...t){let n=Date.now();if(this.profilers[r]){let i=this.profilers[r];delete this.profilers[r],typeof t[t.length-2]=="function"&&(console.warn("Callback function no longer supported as of winston@3.0.0"),t.pop());let a=typeof t[t.length-1]=="object"?t.pop():{};return a.level=a.level||"info",a.durationMs=n-i,a.message=a.message||r,this.write(a)}return this.profilers[r]=n,this}handleExceptions(...r){console.warn("Deprecated: .handleExceptions() will be removed in winston@4. Use .exceptions.handle()"),this.exceptions.handle(...r)}unhandleExceptions(...r){console.warn("Deprecated: .unhandleExceptions() will be removed in winston@4. Use .exceptions.unhandle()"),this.exceptions.unhandle(...r)}cli(){throw new Error(["Logger.cli() was removed in winston@3.0.0","Use a custom winston.formats.cli() instead.","See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md"].join(`
56
- `))}_onEvent(r,t){function n(i){r==="error"&&!this.transports.includes(t)&&this.add(t),this.emit(r,i,t)}t["__winston"+r]||(t["__winston"+r]=n.bind(this),t.on(r,t["__winston"+r]))}_addDefaultMeta(r){this.defaultMeta&&Object.assign(r,this.defaultMeta)}};function zo(e,r){let t=e[r];return!t&&t!==0?null:t}Object.defineProperty(wi.prototype,"transports",{configurable:!1,enumerable:!0,get(){let{pipes:e}=this._readableState;return Array.isArray(e)?e:[e].filter(Boolean)}});Wd.exports=wi});var Bo=m((IO,Yd)=>{"use strict";var{LEVEL:Y1}=ae(),V1=hi(),K1=_i(),J1=kt()("winston:create-logger");function Z1(e){return"is"+e.charAt(0).toUpperCase()+e.slice(1)+"Enabled"}Yd.exports=function(e={}){e.levels=e.levels||V1.npm.levels;class r extends K1{constructor(i){super(i)}}let t=new r(e);return Object.keys(e.levels).forEach(function(n){if(J1('Define prototype method for "%s"',n),n==="log"){console.warn('Level "log" not defined: conflicts with the method "log". Use a different level name.');return}r.prototype[n]=function(...i){let a=this||t;if(i.length===1){let[s]=i,u=s&&s.message&&s||{message:s};return u.level=u[Y1]=n,a._addDefaultMeta(u),a.write(u),this||t}return i.length===0?(a.log(n,""),a):a.log(n,...i)},r.prototype[Z1(n)]=function(){return(this||t).isLevelEnabled(n)}}),t}});var Kd=m((CO,Vd)=>{"use strict";var X1=Bo();Vd.exports=class{constructor(r={}){this.loggers=new Map,this.options=r}add(r,t){if(!this.loggers.has(r)){t=Object.assign({},t||this.options);let n=t.transports||this.options.transports;n?t.transports=Array.isArray(n)?n.slice():[n]:t.transports=[];let i=X1(t);i.on("close",()=>this._delete(r)),this.loggers.set(r,i)}return this.loggers.get(r)}get(r,t){return this.add(r,t)}has(r){return!!this.loggers.has(r)}close(r){if(r)return this._removeLogger(r);this.loggers.forEach((t,n)=>this._removeLogger(n))}_removeLogger(r){if(!this.loggers.has(r))return;this.loggers.get(r).close(),this._delete(r)}_delete(r){this.loggers.delete(r)}}});var Zd=m(J=>{"use strict";var Jd=Ia(),{warn:Wt}=Da();J.version=wl().version;J.transports=Ed();J.config=hi();J.addColors=Jd.levels;J.format=Jd.format;J.createLogger=Bo();J.Logger=_i();J.ExceptionHandler=Uo();J.RejectionHandler=Fo();J.Container=Kd();J.Transport=ot();J.loggers=new J.Container;var Be=J.createLogger();Object.keys(J.config.npm.levels).concat(["log","query","stream","add","remove","clear","profile","startTimer","handleExceptions","unhandleExceptions","handleRejections","unhandleRejections","configure","child"]).forEach(e=>J[e]=(...r)=>Be[e](...r));Object.defineProperty(J,"level",{get(){return Be.level},set(e){Be.level=e}});Object.defineProperty(J,"exceptions",{get(){return Be.exceptions}});Object.defineProperty(J,"rejections",{get(){return Be.rejections}});["exitOnError"].forEach(e=>{Object.defineProperty(J,e,{get(){return Be[e]},set(r){Be[e]=r}})});Object.defineProperty(J,"default",{get(){return{exceptionHandlers:Be.exceptionHandlers,rejectionHandlers:Be.rejectionHandlers,transports:Be.transports}}});Wt.deprecated(J,"setLevels");Wt.forFunctions(J,"useFormat",["cli"]);Wt.forProperties(J,"useFormat",["padLevels","stripColors"]);Wt.forFunctions(J,"deprecated",["addRewriter","addFilter","clone","extend"]);Wt.forProperties(J,"deprecated",["emitErrs","levelLength"])});var $r=m(X=>{"use strict";var tp=X&&X.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(X,"__esModule",{value:!0});X.logger=X.processNestedErrors=X.DEFAULT_LOG_LEVEL=X.LOG_LEVELS=void 0;var mr=tp(Zd()),Q1=tp(require("util")),Xd=require("zod-validation-error");X.LOG_LEVELS=["debug","info","warn","error"];X.DEFAULT_LOG_LEVEL="info";function Qd(e,r){let{combine:t,printf:n,timestamp:i}=mr.default.format,a="\x1B[0m",s="\x1B[32m",u="\x1B[33m",d="\x1B[31m",h=n(y=>{let{level:b,message:_,timestamp:S,...g}=y,w,T;switch(b){case"debug":w="d",T=w;break;case"info":w="i",T=e?w:`${s}${w}${a}`;break;case"warn":w="warn",T=e?w:`${u}${w}${a}`;break;case"error":w="error",T=e?w:`${d}${w}${a}`;break;default:w=`${b}:`,T=w}let D=" ".repeat(w.length+1),$=rp(_,r),P=g[Symbol.for("splat")]||[],C="";P.length>0&&(C=`
57
- ${P.map(G=>rp(G,r)).join(`
58
- `)}`);let z=$+C,Y=String(z).replace(/\n/g,`
49
+ ${$}`),w.pop(),`{${Y}}`}case"number":return isFinite(g)?String(g):r?r(g):"null";case"boolean":return g===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(g);default:return r?r(g):void 0}}function b(S,g,w){switch(typeof g){case"string":return ur(g);case"object":{if(g===null)return"null";if(typeof g.toJSON=="function"){if(g=g.toJSON(S),typeof g!="object")return b(S,g,w);if(g===null)return"null"}if(w.indexOf(g)!==-1)return t;let T="",D=g.length!==void 0;if(D&&Array.isArray(g)){if(g.length===0)return"[]";if(s<w.length+1)return'"[Array]"';w.push(g);let Y=Math.min(g.length,u),B=0;for(;B<Y-1;B++){let U=b(String(B),g[B],w);T+=U!==void 0?U:"null",T+=","}let G=b(String(B),g[B],w);if(T+=G!==void 0?G:"null",g.length-1>u){let U=g.length-u-1;T+=`,"... ${Pr(U)} not stringified"`}return w.pop(),`[${T}]`}let $=Object.keys(g),P=$.length;if(P===0)return"{}";if(s<w.length+1)return'"[Object]"';let L="",z=Math.min(P,u);D&&Aa(g)&&(T+=Yu(g,",",u),$=$.slice(g.length),z-=g.length,L=","),i&&($=Pa($,a)),w.push(g);for(let Y=0;Y<z;Y++){let B=$[Y],G=b(B,g[B],w);G!==void 0&&(T+=`${L}${ur(B)}:${G}`,L=",")}if(P>u){let Y=P-u;T+=`${L}"...":"${Pr(Y)} not stringified"`}return w.pop(),`{${T}}`}case"number":return isFinite(g)?String(g):r?r(g):"null";case"boolean":return g===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(g);default:return r?r(g):void 0}}function _(S,g,w){if(arguments.length>1){let T="";if(typeof w=="number"?T=" ".repeat(Math.min(w,10)):typeof w=="string"&&(T=w.slice(0,10)),g!=null){if(typeof g=="function")return d("",{"":S},[],g,T,"");if(Array.isArray(g))return h("",S,[],fy(g),T,"")}if(T.length!==0)return y("",S,[],T,"")}return b("",S,[])}return _}});var xa=m((iS,Ju)=>{"use strict";var py=we(),{MESSAGE:hy}=ae(),gy=Et();function my(e,r){return typeof r=="bigint"?r.toString():r}Ju.exports=py((e,r)=>{let t=gy.configure(r);return e[hy]=t(e,r.replacer||my,r.space),e})});var Xu=m((aS,Zu)=>{"use strict";var yy=we();Zu.exports=yy((e,r)=>r.message?(e.message=`[${r.label}] ${e.message}`,e):(e.label=r.label,e))});var el=m((oS,Qu)=>{"use strict";var vy=we(),{MESSAGE:by}=ae(),_y=Et();Qu.exports=vy(e=>{let r={};return e.message&&(r["@message"]=e.message,delete e.message),e.timestamp&&(r["@timestamp"]=e.timestamp,delete e.timestamp),r["@fields"]=e,e[by]=_y(r),e})});var tl=m((sS,rl)=>{"use strict";var wy=we();function Ey(e,r,t){let n=r.reduce((a,s)=>(a[s]=e[s],delete e[s],a),{}),i=Object.keys(e).reduce((a,s)=>(a[s]=e[s],delete e[s],a),{});return Object.assign(e,n,{[t]:i}),e}function Sy(e,r,t){return e[t]=r.reduce((n,i)=>(n[i]=e[i],delete e[i],n),{}),e}rl.exports=wy((e,r={})=>{let t="metadata";r.key&&(t=r.key);let n=[];return!r.fillExcept&&!r.fillWith&&(n.push("level"),n.push("message")),r.fillExcept&&(n=r.fillExcept),n.length>0?Ey(e,n,t):r.fillWith?Sy(e,r.fillWith,t):e})});var il=m((uS,nl)=>{var Xr=1e3,Qr=Xr*60,et=Qr*60,Tr=et*24,Oy=Tr*7,Py=Tr*365.25;nl.exports=function(e,r){r=r||{};var t=typeof e;if(t==="string"&&e.length>0)return Ay(e);if(t==="number"&&isFinite(e))return r.long?Ny(e):Ty(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Ay(e){if(e=String(e),!(e.length>100)){var r=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(r){var t=parseFloat(r[1]),n=(r[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return t*Py;case"weeks":case"week":case"w":return t*Oy;case"days":case"day":case"d":return t*Tr;case"hours":case"hour":case"hrs":case"hr":case"h":return t*et;case"minutes":case"minute":case"mins":case"min":case"m":return t*Qr;case"seconds":case"second":case"secs":case"sec":case"s":return t*Xr;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function Ty(e){var r=Math.abs(e);return r>=Tr?Math.round(e/Tr)+"d":r>=et?Math.round(e/et)+"h":r>=Qr?Math.round(e/Qr)+"m":r>=Xr?Math.round(e/Xr)+"s":e+"ms"}function Ny(e){var r=Math.abs(e);return r>=Tr?Sn(e,r,Tr,"day"):r>=et?Sn(e,r,et,"hour"):r>=Qr?Sn(e,r,Qr,"minute"):r>=Xr?Sn(e,r,Xr,"second"):e+" ms"}function Sn(e,r,t,n){var i=r>=t*1.5;return Math.round(e/t)+" "+n+(i?"s":"")}});var ol=m((St,al)=>{"use strict";var xy=we(),My=il();al.exports=xy(e=>{let r=+new Date;return St.diff=r-(St.prevTime||r),St.prevTime=r,e.ms=`+${My(St.diff)}`,e})});var ll=m((lS,ul)=>{"use strict";var Ry=require("util").inspect,Iy=we(),{LEVEL:Dy,MESSAGE:sl,SPLAT:Cy}=ae();ul.exports=Iy((e,r={})=>{let t=Object.assign({},e);return delete t[Dy],delete t[sl],delete t[Cy],e[sl]=Ry(t,!1,r.depth||null,r.colorize),e})});var cl=m((cS,Pn)=>{"use strict";var{MESSAGE:Ly}=ae(),On=class{constructor(r){this.template=r}transform(r){return r[Ly]=this.template(r),r}};Pn.exports=e=>new On(e);Pn.exports.Printf=Pn.exports.Format=On});var pl=m((fS,dl)=>{"use strict";var qy=we(),{MESSAGE:fl}=ae(),$y=Et();dl.exports=qy(e=>{let r=$y(Object.assign({},e,{level:void 0,message:void 0,splat:void 0})),t=e.padding&&e.padding[e.level]||"";return r!=="{}"?e[fl]=`${e.level}:${t} ${e.message} ${r}`:e[fl]=`${e.level}:${t} ${e.message}`,e})});var ml=m((dS,gl)=>{"use strict";var Uy=require("util"),{SPLAT:hl}=ae(),jy=/%[scdjifoO%]/g,Fy=/%%/g,Ma=class{constructor(r){this.options=r}_splat(r,t){let n=r.message,i=r[hl]||r.splat||[],a=n.match(Fy),s=a&&a.length||0,d=t.length-s-i.length,h=d<0?i.splice(d,-1*d):[],y=h.length;if(y)for(let b=0;b<y;b++)Object.assign(r,h[b]);return r.message=Uy.format(n,...i),r}transform(r){let t=r.message,n=r[hl]||r.splat;if(!n||!n.length)return r;let i=t&&t.match&&t.match(jy);if(!i&&(n||n.length)){let a=n.length>1?n.splice(0):n,s=a.length;if(s)for(let u=0;u<s;u++)Object.assign(r,a[u]);return r}return i?this._splat(r,i):r}};gl.exports=e=>new Ma(e)});var vl=m((An,yl)=>{(function(e,r){typeof An=="object"&&typeof yl<"u"?r(An):typeof define=="function"&&define.amd?define(["exports"],r):r(e.fecha={})})(An,(function(e){"use strict";var r=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,t="\\d\\d?",n="\\d\\d",i="\\d{3}",a="\\d{4}",s="[^\\s]+",u=/\[([^]*?)\]/gm;function d(O,R){for(var V=[],ue=0,q=O.length;ue<q;ue++)V.push(O[ue].substr(0,R));return V}var h=function(O){return function(R,V){var ue=V[O].map(function(_e){return _e.toLowerCase()}),q=ue.indexOf(R.toLowerCase());return q>-1?q:null}};function y(O){for(var R=[],V=1;V<arguments.length;V++)R[V-1]=arguments[V];for(var ue=0,q=R;ue<q.length;ue++){var _e=q[ue];for(var de in _e)O[de]=_e[de]}return O}var b=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],_=["January","February","March","April","May","June","July","August","September","October","November","December"],S=d(_,3),g=d(b,3),w={dayNamesShort:g,dayNames:b,monthNamesShort:S,monthNames:_,amPm:["am","pm"],DoFn:function(O){return O+["th","st","nd","rd"][O%10>3?0:(O-O%10!==10?1:0)*O%10]}},T=y({},w),D=function(O){return T=y(T,O)},$=function(O){return O.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},P=function(O,R){for(R===void 0&&(R=2),O=String(O);O.length<R;)O="0"+O;return O},L={D:function(O){return String(O.getDate())},DD:function(O){return P(O.getDate())},Do:function(O,R){return R.DoFn(O.getDate())},d:function(O){return String(O.getDay())},dd:function(O){return P(O.getDay())},ddd:function(O,R){return R.dayNamesShort[O.getDay()]},dddd:function(O,R){return R.dayNames[O.getDay()]},M:function(O){return String(O.getMonth()+1)},MM:function(O){return P(O.getMonth()+1)},MMM:function(O,R){return R.monthNamesShort[O.getMonth()]},MMMM:function(O,R){return R.monthNames[O.getMonth()]},YY:function(O){return P(String(O.getFullYear()),4).substr(2)},YYYY:function(O){return P(O.getFullYear(),4)},h:function(O){return String(O.getHours()%12||12)},hh:function(O){return P(O.getHours()%12||12)},H:function(O){return String(O.getHours())},HH:function(O){return P(O.getHours())},m:function(O){return String(O.getMinutes())},mm:function(O){return P(O.getMinutes())},s:function(O){return String(O.getSeconds())},ss:function(O){return P(O.getSeconds())},S:function(O){return String(Math.round(O.getMilliseconds()/100))},SS:function(O){return P(Math.round(O.getMilliseconds()/10),2)},SSS:function(O){return P(O.getMilliseconds(),3)},a:function(O,R){return O.getHours()<12?R.amPm[0]:R.amPm[1]},A:function(O,R){return O.getHours()<12?R.amPm[0].toUpperCase():R.amPm[1].toUpperCase()},ZZ:function(O){var R=O.getTimezoneOffset();return(R>0?"-":"+")+P(Math.floor(Math.abs(R)/60)*100+Math.abs(R)%60,4)},Z:function(O){var R=O.getTimezoneOffset();return(R>0?"-":"+")+P(Math.floor(Math.abs(R)/60),2)+":"+P(Math.abs(R)%60,2)}},z=function(O){return+O-1},Y=[null,t],B=[null,s],G=["isPm",s,function(O,R){var V=O.toLowerCase();return V===R.amPm[0]?0:V===R.amPm[1]?1:null}],U=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(O){var R=(O+"").match(/([+-]|\d\d)/gi);if(R){var V=+R[1]*60+parseInt(R[2],10);return R[0]==="+"?V:-V}return 0}],Z={D:["day",t],DD:["day",n],Do:["day",t+s,function(O){return parseInt(O,10)}],M:["month",t,z],MM:["month",n,z],YY:["year",n,function(O){var R=new Date,V=+(""+R.getFullYear()).substr(0,2);return+(""+(+O>68?V-1:V)+O)}],h:["hour",t,void 0,"isPm"],hh:["hour",n,void 0,"isPm"],H:["hour",t],HH:["hour",n],m:["minute",t],mm:["minute",n],s:["second",t],ss:["second",n],YYYY:["year",a],S:["millisecond","\\d",function(O){return+O*100}],SS:["millisecond",n,function(O){return+O*10}],SSS:["millisecond",i],d:Y,dd:Y,ddd:B,dddd:B,MMM:["month",s,h("monthNamesShort")],MMMM:["month",s,h("monthNames")],a:G,A:G,ZZ:U,Z:U},ne={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},te=function(O){return y(ne,O)},ce=function(O,R,V){if(R===void 0&&(R=ne.default),V===void 0&&(V={}),typeof O=="number"&&(O=new Date(O)),Object.prototype.toString.call(O)!=="[object Date]"||isNaN(O.getTime()))throw new Error("Invalid Date pass to format");R=ne[R]||R;var ue=[];R=R.replace(u,function(_e,de){return ue.push(de),"@@@"});var q=y(y({},T),V);return R=R.replace(r,function(_e){return L[_e](O,q)}),R.replace(/@@@/g,function(){return ue.shift()})};function fe(O,R,V){if(V===void 0&&(V={}),typeof R!="string")throw new Error("Invalid format in fecha parse");if(R=ne[R]||R,O.length>1e3)return null;var ue=new Date,q={year:ue.getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},_e=[],de=[],Ne=R.replace(u,function(nr,Ge){return de.push($(Ge)),"@@@"}),Ue={},Br={};Ne=$(Ne).replace(r,function(nr){var Ge=Z[nr],Wr=Ge[0],Xt=Ge[1],Qt=Ge[3];if(Ue[Wr])throw new Error("Invalid format. "+Wr+" specified twice in format");return Ue[Wr]=!0,Qt&&(Br[Qt]=!0),_e.push(Ge),"("+Xt+")"}),Object.keys(Br).forEach(function(nr){if(!Ue[nr])throw new Error("Invalid format. "+nr+" is required in specified format")}),Ne=Ne.replace(/@@@/g,function(){return de.shift()});var er=O.match(new RegExp(Ne,"i"));if(!er)return null;for(var Hr=y(y({},T),V),ie=1;ie<er.length;ie++){var rr=_e[ie-1],ht=rr[0],Se=rr[2],Gr=Se?Se(er[ie],Hr):+er[ie];if(Gr==null)return null;q[ht]=Gr}q.isPm===1&&q.hour!=null&&+q.hour!=12?q.hour=+q.hour+12:q.isPm===0&&+q.hour==12&&(q.hour=0);var Re;if(q.timezoneOffset==null){Re=new Date(q.year,q.month,q.day,q.hour,q.minute,q.second,q.millisecond);for(var tr=[["month","getMonth"],["day","getDate"],["hour","getHours"],["minute","getMinutes"],["second","getSeconds"]],ie=0,Zt=tr.length;ie<Zt;ie++)if(Ue[tr[ie][0]]&&q[tr[ie][0]]!==Re[tr[ie][1]]())return null}else if(Re=new Date(Date.UTC(q.year,q.month,q.day,q.hour,q.minute-q.timezoneOffset,q.second,q.millisecond)),q.month>11||q.month<0||q.day>31||q.day<1||q.hour>23||q.hour<0||q.minute>59||q.minute<0||q.second>59||q.second<0)return null;return Re}var $e={format:ce,parse:fe,defaultI18n:w,setGlobalDateI18n:D,setGlobalDateMasks:te};e.assign=y,e.default=$e,e.format=ce,e.parse=fe,e.defaultI18n=w,e.setGlobalDateI18n=D,e.setGlobalDateMasks=te,Object.defineProperty(e,"__esModule",{value:!0})}))});var _l=m((pS,bl)=>{"use strict";var ky=vl(),zy=we();bl.exports=zy((e,r={})=>(r.format&&(e.timestamp=typeof r.format=="function"?r.format():ky.format(new Date,r.format)),e.timestamp||(e.timestamp=new Date().toISOString()),r.alias&&(e[r.alias]=e.timestamp),e))});var El=m((hS,wl)=>{"use strict";var Ra=pa(),By=we(),{MESSAGE:Ia}=ae();wl.exports=By((e,r)=>(r.level!==!1&&(e.level=Ra.strip(e.level)),r.message!==!1&&(e.message=Ra.strip(String(e.message))),r.raw!==!1&&e[Ia]&&(e[Ia]=Ra.strip(String(e[Ia]))),e))});var Ca=m(Da=>{"use strict";var Hy=Da.format=we();Da.levels=$u();function he(e,r){Object.defineProperty(Hy,e,{get(){return r()},configurable:!0})}he("align",function(){return ju()});he("errors",function(){return zu()});he("cli",function(){return Hu()});he("combine",function(){return Wu()});he("colorize",function(){return bn()});he("json",function(){return xa()});he("label",function(){return Xu()});he("logstash",function(){return el()});he("metadata",function(){return tl()});he("ms",function(){return ol()});he("padLevels",function(){return Ea()});he("prettyPrint",function(){return ll()});he("printf",function(){return cl()});he("simple",function(){return pl()});he("splat",function(){return ml()});he("timestamp",function(){return _l()});he("uncolorize",function(){return El()})});var La=m(Tn=>{"use strict";var{format:Sl}=require("util");Tn.warn={deprecated(e){return()=>{throw new Error(Sl("{ %s } was removed in winston@3.0.0.",e))}},useFormat(e){return()=>{throw new Error([Sl("{ %s } was removed in winston@3.0.0.",e),"Use a custom winston.format = winston.format(function) instead."].join(`
50
+ `))}},forFunctions(e,r,t){t.forEach(n=>{e[n]=Tn.warn[r](n)})},forProperties(e,r,t){t.forEach(n=>{let i=Tn.warn[r](n);Object.defineProperty(e,n,{get:i,set:i})})}}});var Ol=m((yS,Gy)=>{Gy.exports={name:"winston",description:"A logger for just about everything.",version:"3.17.0",author:"Charlie Robbins <charlie.robbins@gmail.com>",maintainers:["David Hyde <dabh@alumni.stanford.edu>"],repository:{type:"git",url:"https://github.com/winstonjs/winston.git"},keywords:["winston","logger","logging","logs","sysadmin","bunyan","pino","loglevel","tools","json","stream"],dependencies:{"@dabh/diagnostics":"^2.0.2","@colors/colors":"^1.6.0",async:"^3.2.3","is-stream":"^2.0.0",logform:"^2.7.0","one-time":"^1.0.0","readable-stream":"^3.4.0","safe-stable-stringify":"^2.3.1","stack-trace":"0.0.x","triple-beam":"^1.3.0","winston-transport":"^4.9.0"},devDependencies:{"@babel/cli":"^7.23.9","@babel/core":"^7.24.0","@babel/preset-env":"^7.24.0","@dabh/eslint-config-populist":"^4.4.0","@types/node":"^20.11.24","abstract-winston-transport":"^0.5.1",assume:"^2.2.0","cross-spawn-async":"^2.2.5",eslint:"^8.57.0",hock:"^1.4.1",mocha:"^10.3.0",nyc:"^17.1.0",rimraf:"5.0.1",split2:"^4.1.0","std-mocks":"^2.0.0",through2:"^4.0.2","winston-compat":"^0.1.5"},main:"./lib/winston.js",browser:"./dist/winston",types:"./index.d.ts",scripts:{lint:"eslint lib/*.js lib/winston/*.js lib/winston/**/*.js --resolve-plugins-relative-to ./node_modules/@dabh/eslint-config-populist",test:"rimraf test/fixtures/logs/* && mocha","test:coverage":"nyc npm run test:unit","test:unit":"mocha test/unit","test:integration":"mocha test/integration",build:"rimraf dist && babel lib -d dist",prepublishOnly:"npm run build"},engines:{node:">= 12.0.0"},license:"MIT"}});var Al=m((vS,Pl)=>{Pl.exports=require("util").deprecate});var qa=m((bS,Tl)=>{Tl.exports=require("stream")});var Ua=m((_S,xl)=>{"use strict";function Wy(e,r){var t=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(r?r(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick($a,this,e)):process.nextTick($a,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(a){!r&&a?t._writableState?t._writableState.errorEmitted?process.nextTick(Nn,t):(t._writableState.errorEmitted=!0,process.nextTick(Nl,t,a)):process.nextTick(Nl,t,a):r?(process.nextTick(Nn,t),r(a)):process.nextTick(Nn,t)}),this)}function Nl(e,r){$a(e,r),Nn(e)}function Nn(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function Yy(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function $a(e,r){e.emit("error",r)}function Vy(e,r){var t=e._readableState,n=e._writableState;t&&t.autoDestroy||n&&n.autoDestroy?e.destroy(r):e.emit("error",r)}xl.exports={destroy:Wy,undestroy:Yy,errorOrDestroy:Vy}});var lr=m((wS,Il)=>{"use strict";var Rl={};function xe(e,r,t){t||(t=Error);function n(a,s,u){return typeof r=="string"?r:r(a,s,u)}class i extends t{constructor(s,u,d){super(n(s,u,d))}}i.prototype.name=t.name,i.prototype.code=e,Rl[e]=i}function Ml(e,r){if(Array.isArray(e)){let t=e.length;return e=e.map(n=>String(n)),t>2?`one of ${r} ${e.slice(0,t-1).join(", ")}, or `+e[t-1]:t===2?`one of ${r} ${e[0]} or ${e[1]}`:`of ${r} ${e[0]}`}else return`of ${r} ${String(e)}`}function Ky(e,r,t){return e.substr(!t||t<0?0:+t,r.length)===r}function Jy(e,r,t){return(t===void 0||t>e.length)&&(t=e.length),e.substring(t-r.length,t)===r}function Zy(e,r,t){return typeof t!="number"&&(t=0),t+r.length>e.length?!1:e.indexOf(r,t)!==-1}xe("ERR_INVALID_OPT_VALUE",function(e,r){return'The value "'+r+'" is invalid for option "'+e+'"'},TypeError);xe("ERR_INVALID_ARG_TYPE",function(e,r,t){let n;typeof r=="string"&&Ky(r,"not ")?(n="must not be",r=r.replace(/^not /,"")):n="must be";let i;if(Jy(e," argument"))i=`The ${e} ${n} ${Ml(r,"type")}`;else{let a=Zy(e,".")?"property":"argument";i=`The "${e}" ${a} ${n} ${Ml(r,"type")}`}return i+=`. Received type ${typeof t}`,i},TypeError);xe("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");xe("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});xe("ERR_STREAM_PREMATURE_CLOSE","Premature close");xe("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});xe("ERR_MULTIPLE_CALLBACK","Callback called multiple times");xe("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");xe("ERR_STREAM_WRITE_AFTER_END","write after end");xe("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);xe("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);xe("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Il.exports.codes=Rl});var ja=m((ES,Dl)=>{"use strict";var Xy=lr().codes.ERR_INVALID_OPT_VALUE;function Qy(e,r,t){return e.highWaterMark!=null?e.highWaterMark:r?e[t]:null}function ev(e,r,t,n){var i=Qy(r,n,t);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var a=n?t:"highWaterMark";throw new Xy(a,i)}return Math.floor(i)}return e.objectMode?16:16*1024}Dl.exports={getHighWaterMark:ev}});var Cl=m((SS,Fa)=>{typeof Object.create=="function"?Fa.exports=function(r,t){t&&(r.super_=t,r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:Fa.exports=function(r,t){if(t){r.super_=t;var n=function(){};n.prototype=t.prototype,r.prototype=new n,r.prototype.constructor=r}}});var rt=m((OS,za)=>{try{if(ka=require("util"),typeof ka.inherits!="function")throw"";za.exports=ka.inherits}catch{za.exports=Cl()}var ka});var Fl=m((PS,jl)=>{"use strict";function Ll(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function ql(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Ll(Object(t),!0).forEach(function(n){rv(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ll(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function rv(e,r,t){return r=Ul(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function tv(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function $l(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ul(n.key),n)}}function nv(e,r,t){return r&&$l(e.prototype,r),t&&$l(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ul(e){var r=iv(e,"string");return typeof r=="symbol"?r:String(r)}function iv(e,r){if(typeof e!="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}var av=require("buffer"),xn=av.Buffer,ov=require("util"),Ba=ov.inspect,sv=Ba&&Ba.custom||"inspect";function uv(e,r,t){xn.prototype.copy.call(e,r,t)}jl.exports=(function(){function e(){tv(this,e),this.head=null,this.tail=null,this.length=0}return nv(e,[{key:"push",value:function(t){var n={data:t,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length}},{key:"unshift",value:function(t){var n={data:t,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length}},{key:"shift",value:function(){if(this.length!==0){var t=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=t+n.data;return i}},{key:"concat",value:function(t){if(this.length===0)return xn.alloc(0);for(var n=xn.allocUnsafe(t>>>0),i=this.head,a=0;i;)uv(i.data,n,a),a+=i.data.length,i=i.next;return n}},{key:"consume",value:function(t,n){var i;return t<this.head.data.length?(i=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):t===this.head.data.length?i=this.shift():i=n?this._getString(t):this._getBuffer(t),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var n=this.head,i=1,a=n.data;for(t-=a.length;n=n.next;){var s=n.data,u=t>s.length?s.length:t;if(u===s.length?a+=s:a+=s.slice(0,t),t-=u,t===0){u===s.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=s.slice(u));break}++i}return this.length-=i,a}},{key:"_getBuffer",value:function(t){var n=xn.allocUnsafe(t),i=this.head,a=1;for(i.data.copy(n),t-=i.data.length;i=i.next;){var s=i.data,u=t>s.length?s.length:t;if(s.copy(n,n.length-t,0,u),t-=u,t===0){u===s.length?(++a,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=s.slice(u));break}++a}return this.length-=a,n}},{key:sv,value:function(t,n){return Ba(this,ql(ql({},n),{},{depth:0,customInspect:!1}))}}]),e})()});var Bl=m((Ha,zl)=>{var Mn=require("buffer"),je=Mn.Buffer;function kl(e,r){for(var t in e)r[t]=e[t]}je.from&&je.alloc&&je.allocUnsafe&&je.allocUnsafeSlow?zl.exports=Mn:(kl(Mn,Ha),Ha.Buffer=Nr);function Nr(e,r,t){return je(e,r,t)}Nr.prototype=Object.create(je.prototype);kl(je,Nr);Nr.from=function(e,r,t){if(typeof e=="number")throw new TypeError("Argument must not be a number");return je(e,r,t)};Nr.alloc=function(e,r,t){if(typeof e!="number")throw new TypeError("Argument must be a number");var n=je(e);return r!==void 0?typeof t=="string"?n.fill(r,t):n.fill(r):n.fill(0),n};Nr.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return je(e)};Nr.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Mn.SlowBuffer(e)}});var Ya=m(Gl=>{"use strict";var Wa=Bl().Buffer,Hl=Wa.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function lv(e){if(!e)return"utf8";for(var r;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(r)return;e=(""+e).toLowerCase(),r=!0}}function cv(e){var r=lv(e);if(typeof r!="string"&&(Wa.isEncoding===Hl||!Hl(e)))throw new Error("Unknown encoding: "+e);return r||e}Gl.StringDecoder=Ot;function Ot(e){this.encoding=cv(e);var r;switch(this.encoding){case"utf16le":this.text=mv,this.end=yv,r=4;break;case"utf8":this.fillLast=pv,r=4;break;case"base64":this.text=vv,this.end=bv,r=3;break;default:this.write=_v,this.end=wv;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Wa.allocUnsafe(r)}Ot.prototype.write=function(e){if(e.length===0)return"";var r,t;if(this.lastNeed){if(r=this.fillLast(e),r===void 0)return"";t=this.lastNeed,this.lastNeed=0}else t=0;return t<e.length?r?r+this.text(e,t):this.text(e,t):r||""};Ot.prototype.end=gv;Ot.prototype.text=hv;Ot.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function Ga(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function fv(e,r,t){var n=r.length-1;if(n<t)return 0;var i=Ga(r[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<t||i===-2?0:(i=Ga(r[n]),i>=0?(i>0&&(e.lastNeed=i-2),i):--n<t||i===-2?0:(i=Ga(r[n]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function dv(e,r,t){if((r[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&r.length>1){if((r[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&r.length>2&&(r[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function pv(e){var r=this.lastTotal-this.lastNeed,t=dv(this,e,r);if(t!==void 0)return t;if(this.lastNeed<=e.length)return e.copy(this.lastChar,r,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,r,0,e.length),this.lastNeed-=e.length}function hv(e,r){var t=fv(this,e,r);if(!this.lastNeed)return e.toString("utf8",r);this.lastTotal=t;var n=e.length-(t-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",r,n)}function gv(e){var r=e&&e.length?this.write(e):"";return this.lastNeed?r+"\uFFFD":r}function mv(e,r){if((e.length-r)%2===0){var t=e.toString("utf16le",r);if(t){var n=t.charCodeAt(t.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],t.slice(0,-1)}return t}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",r,e.length-1)}function yv(e){var r=e&&e.length?this.write(e):"";if(this.lastNeed){var t=this.lastTotal-this.lastNeed;return r+this.lastChar.toString("utf16le",0,t)}return r}function vv(e,r){var t=(e.length-r)%3;return t===0?e.toString("base64",r):(this.lastNeed=3-t,this.lastTotal=3,t===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",r,e.length-t))}function bv(e){var r=e&&e.length?this.write(e):"";return this.lastNeed?r+this.lastChar.toString("base64",0,3-this.lastNeed):r}function _v(e){return e.toString(this.encoding)}function wv(e){return e&&e.length?this.write(e):""}});var Rn=m((TS,Vl)=>{"use strict";var Wl=lr().codes.ERR_STREAM_PREMATURE_CLOSE;function Ev(e){var r=!1;return function(){if(!r){r=!0;for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];e.apply(this,n)}}}function Sv(){}function Ov(e){return e.setHeader&&typeof e.abort=="function"}function Yl(e,r,t){if(typeof r=="function")return Yl(e,null,r);r||(r={}),t=Ev(t||Sv);var n=r.readable||r.readable!==!1&&e.readable,i=r.writable||r.writable!==!1&&e.writable,a=function(){e.writable||u()},s=e._writableState&&e._writableState.finished,u=function(){i=!1,s=!0,n||t.call(e)},d=e._readableState&&e._readableState.endEmitted,h=function(){n=!1,d=!0,i||t.call(e)},y=function(g){t.call(e,g)},b=function(){var g;if(n&&!d)return(!e._readableState||!e._readableState.ended)&&(g=new Wl),t.call(e,g);if(i&&!s)return(!e._writableState||!e._writableState.ended)&&(g=new Wl),t.call(e,g)},_=function(){e.req.on("finish",u)};return Ov(e)?(e.on("complete",u),e.on("abort",b),e.req?_():e.on("request",_)):i&&!e._writableState&&(e.on("end",a),e.on("close",a)),e.on("end",h),e.on("finish",u),r.error!==!1&&e.on("error",y),e.on("close",b),function(){e.removeListener("complete",u),e.removeListener("abort",b),e.removeListener("request",_),e.req&&e.req.removeListener("finish",u),e.removeListener("end",a),e.removeListener("close",a),e.removeListener("finish",u),e.removeListener("end",h),e.removeListener("error",y),e.removeListener("close",b)}}Vl.exports=Yl});var Jl=m((NS,Kl)=>{"use strict";var In;function cr(e,r,t){return r=Pv(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Pv(e){var r=Av(e,"string");return typeof r=="symbol"?r:String(r)}function Av(e,r){if(typeof e!="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}var Tv=Rn(),fr=Symbol("lastResolve"),xr=Symbol("lastReject"),Pt=Symbol("error"),Dn=Symbol("ended"),Mr=Symbol("lastPromise"),Va=Symbol("handlePromise"),Rr=Symbol("stream");function dr(e,r){return{value:e,done:r}}function Nv(e){var r=e[fr];if(r!==null){var t=e[Rr].read();t!==null&&(e[Mr]=null,e[fr]=null,e[xr]=null,r(dr(t,!1)))}}function xv(e){process.nextTick(Nv,e)}function Mv(e,r){return function(t,n){e.then(function(){if(r[Dn]){t(dr(void 0,!0));return}r[Va](t,n)},n)}}var Rv=Object.getPrototypeOf(function(){}),Iv=Object.setPrototypeOf((In={get stream(){return this[Rr]},next:function(){var r=this,t=this[Pt];if(t!==null)return Promise.reject(t);if(this[Dn])return Promise.resolve(dr(void 0,!0));if(this[Rr].destroyed)return new Promise(function(s,u){process.nextTick(function(){r[Pt]?u(r[Pt]):s(dr(void 0,!0))})});var n=this[Mr],i;if(n)i=new Promise(Mv(n,this));else{var a=this[Rr].read();if(a!==null)return Promise.resolve(dr(a,!1));i=new Promise(this[Va])}return this[Mr]=i,i}},cr(In,Symbol.asyncIterator,function(){return this}),cr(In,"return",function(){var r=this;return new Promise(function(t,n){r[Rr].destroy(null,function(i){if(i){n(i);return}t(dr(void 0,!0))})})}),In),Rv),Dv=function(r){var t,n=Object.create(Iv,(t={},cr(t,Rr,{value:r,writable:!0}),cr(t,fr,{value:null,writable:!0}),cr(t,xr,{value:null,writable:!0}),cr(t,Pt,{value:null,writable:!0}),cr(t,Dn,{value:r._readableState.endEmitted,writable:!0}),cr(t,Va,{value:function(a,s){var u=n[Rr].read();u?(n[Mr]=null,n[fr]=null,n[xr]=null,a(dr(u,!1))):(n[fr]=a,n[xr]=s)},writable:!0}),t));return n[Mr]=null,Tv(r,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var a=n[xr];a!==null&&(n[Mr]=null,n[fr]=null,n[xr]=null,a(i)),n[Pt]=i;return}var s=n[fr];s!==null&&(n[Mr]=null,n[fr]=null,n[xr]=null,s(dr(void 0,!0))),n[Dn]=!0}),r.on("readable",xv.bind(null,n)),n};Kl.exports=Dv});var ec=m((xS,Ql)=>{"use strict";function Zl(e,r,t,n,i,a,s){try{var u=e[a](s),d=u.value}catch(h){t(h);return}u.done?r(d):Promise.resolve(d).then(n,i)}function Cv(e){return function(){var r=this,t=arguments;return new Promise(function(n,i){var a=e.apply(r,t);function s(d){Zl(a,n,i,s,u,"next",d)}function u(d){Zl(a,n,i,s,u,"throw",d)}s(void 0)})}}function Xl(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Lv(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Xl(Object(t),!0).forEach(function(n){qv(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Xl(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function qv(e,r,t){return r=$v(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function $v(e){var r=Uv(e,"string");return typeof r=="symbol"?r:String(r)}function Uv(e,r){if(typeof e!="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}var jv=lr().codes.ERR_INVALID_ARG_TYPE;function Fv(e,r,t){var n;if(r&&typeof r.next=="function")n=r;else if(r&&r[Symbol.asyncIterator])n=r[Symbol.asyncIterator]();else if(r&&r[Symbol.iterator])n=r[Symbol.iterator]();else throw new jv("iterable",["Iterable"],r);var i=new e(Lv({objectMode:!0},t)),a=!1;i._read=function(){a||(a=!0,s())};function s(){return u.apply(this,arguments)}function u(){return u=Cv(function*(){try{var d=yield n.next(),h=d.value,y=d.done;y?i.push(null):i.push(yield h)?s():a=!1}catch(b){i.destroy(b)}}),u.apply(this,arguments)}return i}Ql.exports=Fv});var io=m((RS,cc)=>{"use strict";cc.exports=W;var tt;W.ReadableState=ic;var MS=require("events").EventEmitter,nc=function(r,t){return r.listeners(t).length},Tt=qa(),Cn=require("buffer").Buffer,kv=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function zv(e){return Cn.from(e)}function Bv(e){return Cn.isBuffer(e)||e instanceof kv}var Ka=require("util"),F;Ka&&Ka.debuglog?F=Ka.debuglog("stream"):F=function(){};var Hv=Fl(),to=Ua(),Gv=ja(),Wv=Gv.getHighWaterMark,Ln=lr().codes,Yv=Ln.ERR_INVALID_ARG_TYPE,Vv=Ln.ERR_STREAM_PUSH_AFTER_EOF,Kv=Ln.ERR_METHOD_NOT_IMPLEMENTED,Jv=Ln.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,nt,Ja,Za;rt()(W,Tt);var At=to.errorOrDestroy,Xa=["error","close","destroy","pause","resume"];function Zv(e,r,t){if(typeof e.prependListener=="function")return e.prependListener(r,t);!e._events||!e._events[r]?e.on(r,t):Array.isArray(e._events[r])?e._events[r].unshift(t):e._events[r]=[t,e._events[r]]}function ic(e,r,t){tt=tt||Ir(),e=e||{},typeof t!="boolean"&&(t=r instanceof tt),this.objectMode=!!e.objectMode,t&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=Wv(this,e,"readableHighWaterMark",t),this.buffer=new Hv,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(nt||(nt=Ya().StringDecoder),this.decoder=new nt(e.encoding),this.encoding=e.encoding)}function W(e){if(tt=tt||Ir(),!(this instanceof W))return new W(e);var r=this instanceof tt;this._readableState=new ic(e,this,r),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),Tt.call(this)}Object.defineProperty(W.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(r){this._readableState&&(this._readableState.destroyed=r)}});W.prototype.destroy=to.destroy;W.prototype._undestroy=to.undestroy;W.prototype._destroy=function(e,r){r(e)};W.prototype.push=function(e,r){var t=this._readableState,n;return t.objectMode?n=!0:typeof e=="string"&&(r=r||t.defaultEncoding,r!==t.encoding&&(e=Cn.from(e,r),r=""),n=!0),ac(this,e,r,!1,n)};W.prototype.unshift=function(e){return ac(this,e,null,!0,!1)};function ac(e,r,t,n,i){F("readableAddChunk",r);var a=e._readableState;if(r===null)a.reading=!1,eb(e,a);else{var s;if(i||(s=Xv(a,r)),s)At(e,s);else if(a.objectMode||r&&r.length>0)if(typeof r!="string"&&!a.objectMode&&Object.getPrototypeOf(r)!==Cn.prototype&&(r=zv(r)),n)a.endEmitted?At(e,new Jv):Qa(e,a,r,!0);else if(a.ended)At(e,new Vv);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!t?(r=a.decoder.write(r),a.objectMode||r.length!==0?Qa(e,a,r,!1):ro(e,a)):Qa(e,a,r,!1)}else n||(a.reading=!1,ro(e,a))}return!a.ended&&(a.length<a.highWaterMark||a.length===0)}function Qa(e,r,t,n){r.flowing&&r.length===0&&!r.sync?(r.awaitDrain=0,e.emit("data",t)):(r.length+=r.objectMode?1:t.length,n?r.buffer.unshift(t):r.buffer.push(t),r.needReadable&&qn(e)),ro(e,r)}function Xv(e,r){var t;return!Bv(r)&&typeof r!="string"&&r!==void 0&&!e.objectMode&&(t=new Yv("chunk",["string","Buffer","Uint8Array"],r)),t}W.prototype.isPaused=function(){return this._readableState.flowing===!1};W.prototype.setEncoding=function(e){nt||(nt=Ya().StringDecoder);var r=new nt(e);this._readableState.decoder=r,this._readableState.encoding=this._readableState.decoder.encoding;for(var t=this._readableState.buffer.head,n="";t!==null;)n+=r.write(t.data),t=t.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var rc=1073741824;function Qv(e){return e>=rc?e=rc:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function tc(e,r){return e<=0||r.length===0&&r.ended?0:r.objectMode?1:e!==e?r.flowing&&r.length?r.buffer.head.data.length:r.length:(e>r.highWaterMark&&(r.highWaterMark=Qv(e)),e<=r.length?e:r.ended?r.length:(r.needReadable=!0,0))}W.prototype.read=function(e){F("read",e),e=parseInt(e,10);var r=this._readableState,t=e;if(e!==0&&(r.emittedReadable=!1),e===0&&r.needReadable&&((r.highWaterMark!==0?r.length>=r.highWaterMark:r.length>0)||r.ended))return F("read: emitReadable",r.length,r.ended),r.length===0&&r.ended?eo(this):qn(this),null;if(e=tc(e,r),e===0&&r.ended)return r.length===0&&eo(this),null;var n=r.needReadable;F("need readable",n),(r.length===0||r.length-e<r.highWaterMark)&&(n=!0,F("length less than watermark",n)),r.ended||r.reading?(n=!1,F("reading or ended",n)):n&&(F("do read"),r.reading=!0,r.sync=!0,r.length===0&&(r.needReadable=!0),this._read(r.highWaterMark),r.sync=!1,r.reading||(e=tc(t,r)));var i;return e>0?i=uc(e,r):i=null,i===null?(r.needReadable=r.length<=r.highWaterMark,e=0):(r.length-=e,r.awaitDrain=0),r.length===0&&(r.ended||(r.needReadable=!0),t!==e&&r.ended&&eo(this)),i!==null&&this.emit("data",i),i};function eb(e,r){if(F("onEofChunk"),!r.ended){if(r.decoder){var t=r.decoder.end();t&&t.length&&(r.buffer.push(t),r.length+=r.objectMode?1:t.length)}r.ended=!0,r.sync?qn(e):(r.needReadable=!1,r.emittedReadable||(r.emittedReadable=!0,oc(e)))}}function qn(e){var r=e._readableState;F("emitReadable",r.needReadable,r.emittedReadable),r.needReadable=!1,r.emittedReadable||(F("emitReadable",r.flowing),r.emittedReadable=!0,process.nextTick(oc,e))}function oc(e){var r=e._readableState;F("emitReadable_",r.destroyed,r.length,r.ended),!r.destroyed&&(r.length||r.ended)&&(e.emit("readable"),r.emittedReadable=!1),r.needReadable=!r.flowing&&!r.ended&&r.length<=r.highWaterMark,no(e)}function ro(e,r){r.readingMore||(r.readingMore=!0,process.nextTick(rb,e,r))}function rb(e,r){for(;!r.reading&&!r.ended&&(r.length<r.highWaterMark||r.flowing&&r.length===0);){var t=r.length;if(F("maybeReadMore read 0"),e.read(0),t===r.length)break}r.readingMore=!1}W.prototype._read=function(e){At(this,new Kv("_read()"))};W.prototype.pipe=function(e,r){var t=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1,F("pipe count=%d opts=%j",n.pipesCount,r);var i=(!r||r.end!==!1)&&e!==process.stdout&&e!==process.stderr,a=i?u:w;n.endEmitted?process.nextTick(a):t.once("end",a),e.on("unpipe",s);function s(T,D){F("onunpipe"),T===t&&D&&D.hasUnpiped===!1&&(D.hasUnpiped=!0,y())}function u(){F("onend"),e.end()}var d=tb(t);e.on("drain",d);var h=!1;function y(){F("cleanup"),e.removeListener("close",S),e.removeListener("finish",g),e.removeListener("drain",d),e.removeListener("error",_),e.removeListener("unpipe",s),t.removeListener("end",u),t.removeListener("end",w),t.removeListener("data",b),h=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&d()}t.on("data",b);function b(T){F("ondata");var D=e.write(T);F("dest.write",D),D===!1&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&lc(n.pipes,e)!==-1)&&!h&&(F("false write response, pause",n.awaitDrain),n.awaitDrain++),t.pause())}function _(T){F("onerror",T),w(),e.removeListener("error",_),nc(e,"error")===0&&At(e,T)}Zv(e,"error",_);function S(){e.removeListener("finish",g),w()}e.once("close",S);function g(){F("onfinish"),e.removeListener("close",S),w()}e.once("finish",g);function w(){F("unpipe"),t.unpipe(e)}return e.emit("pipe",t),n.flowing||(F("pipe resume"),t.resume()),e};function tb(e){return function(){var t=e._readableState;F("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&nc(e,"data")&&(t.flowing=!0,no(e))}}W.prototype.unpipe=function(e){var r=this._readableState,t={hasUnpiped:!1};if(r.pipesCount===0)return this;if(r.pipesCount===1)return e&&e!==r.pipes?this:(e||(e=r.pipes),r.pipes=null,r.pipesCount=0,r.flowing=!1,e&&e.emit("unpipe",this,t),this);if(!e){var n=r.pipes,i=r.pipesCount;r.pipes=null,r.pipesCount=0,r.flowing=!1;for(var a=0;a<i;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var s=lc(r.pipes,e);return s===-1?this:(r.pipes.splice(s,1),r.pipesCount-=1,r.pipesCount===1&&(r.pipes=r.pipes[0]),e.emit("unpipe",this,t),this)};W.prototype.on=function(e,r){var t=Tt.prototype.on.call(this,e,r),n=this._readableState;return e==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):e==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,F("on readable",n.length,n.reading),n.length?qn(this):n.reading||process.nextTick(nb,this)),t};W.prototype.addListener=W.prototype.on;W.prototype.removeListener=function(e,r){var t=Tt.prototype.removeListener.call(this,e,r);return e==="readable"&&process.nextTick(sc,this),t};W.prototype.removeAllListeners=function(e){var r=Tt.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(sc,this),r};function sc(e){var r=e._readableState;r.readableListening=e.listenerCount("readable")>0,r.resumeScheduled&&!r.paused?r.flowing=!0:e.listenerCount("data")>0&&e.resume()}function nb(e){F("readable nexttick read 0"),e.read(0)}W.prototype.resume=function(){var e=this._readableState;return e.flowing||(F("resume"),e.flowing=!e.readableListening,ib(this,e)),e.paused=!1,this};function ib(e,r){r.resumeScheduled||(r.resumeScheduled=!0,process.nextTick(ab,e,r))}function ab(e,r){F("resume",r.reading),r.reading||e.read(0),r.resumeScheduled=!1,e.emit("resume"),no(e),r.flowing&&!r.reading&&e.read(0)}W.prototype.pause=function(){return F("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(F("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function no(e){var r=e._readableState;for(F("flow",r.flowing);r.flowing&&e.read()!==null;);}W.prototype.wrap=function(e){var r=this,t=this._readableState,n=!1;e.on("end",function(){if(F("wrapped end"),t.decoder&&!t.ended){var s=t.decoder.end();s&&s.length&&r.push(s)}r.push(null)}),e.on("data",function(s){if(F("wrapped data"),t.decoder&&(s=t.decoder.write(s)),!(t.objectMode&&s==null)&&!(!t.objectMode&&(!s||!s.length))){var u=r.push(s);u||(n=!0,e.pause())}});for(var i in e)this[i]===void 0&&typeof e[i]=="function"&&(this[i]=(function(u){return function(){return e[u].apply(e,arguments)}})(i));for(var a=0;a<Xa.length;a++)e.on(Xa[a],this.emit.bind(this,Xa[a]));return this._read=function(s){F("wrapped _read",s),n&&(n=!1,e.resume())},this};typeof Symbol=="function"&&(W.prototype[Symbol.asyncIterator]=function(){return Ja===void 0&&(Ja=Jl()),Ja(this)});Object.defineProperty(W.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(W.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(W.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(r){this._readableState&&(this._readableState.flowing=r)}});W._fromList=uc;Object.defineProperty(W.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function uc(e,r){if(r.length===0)return null;var t;return r.objectMode?t=r.buffer.shift():!e||e>=r.length?(r.decoder?t=r.buffer.join(""):r.buffer.length===1?t=r.buffer.first():t=r.buffer.concat(r.length),r.buffer.clear()):t=r.buffer.consume(e,r.decoder),t}function eo(e){var r=e._readableState;F("endReadable",r.endEmitted),r.endEmitted||(r.ended=!0,process.nextTick(ob,r,e))}function ob(e,r){if(F("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,r.readable=!1,r.emit("end"),e.autoDestroy)){var t=r._writableState;(!t||t.autoDestroy&&t.finished)&&r.destroy()}}typeof Symbol=="function"&&(W.from=function(e,r){return Za===void 0&&(Za=ec()),Za(W,e,r)});function lc(e,r){for(var t=0,n=e.length;t<n;t++)if(e[t]===r)return t;return-1}});var Ir=m((IS,dc)=>{"use strict";var sb=Object.keys||function(e){var r=[];for(var t in e)r.push(t);return r};dc.exports=Fe;var fc=io(),oo=jn();rt()(Fe,fc);for(ao=sb(oo.prototype),$n=0;$n<ao.length;$n++)Un=ao[$n],Fe.prototype[Un]||(Fe.prototype[Un]=oo.prototype[Un]);var ao,Un,$n;function Fe(e){if(!(this instanceof Fe))return new Fe(e);fc.call(this,e),oo.call(this,e),this.allowHalfOpen=!0,e&&(e.readable===!1&&(this.readable=!1),e.writable===!1&&(this.writable=!1),e.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",ub)))}Object.defineProperty(Fe.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Fe.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Fe.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function ub(){this._writableState.ended||process.nextTick(lb,this)}function lb(e){e.end()}Object.defineProperty(Fe.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(r){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=r,this._writableState.destroyed=r)}})});var jn=m((DS,vc)=>{"use strict";vc.exports=ee;function hc(e){var r=this;this.next=null,this.entry=null,this.finish=function(){qb(r,e)}}var it;ee.WritableState=xt;var cb={deprecate:Al()},gc=qa(),kn=require("buffer").Buffer,fb=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function db(e){return kn.from(e)}function pb(e){return kn.isBuffer(e)||e instanceof fb}var uo=Ua(),hb=ja(),gb=hb.getHighWaterMark,pr=lr().codes,mb=pr.ERR_INVALID_ARG_TYPE,yb=pr.ERR_METHOD_NOT_IMPLEMENTED,vb=pr.ERR_MULTIPLE_CALLBACK,bb=pr.ERR_STREAM_CANNOT_PIPE,_b=pr.ERR_STREAM_DESTROYED,wb=pr.ERR_STREAM_NULL_VALUES,Eb=pr.ERR_STREAM_WRITE_AFTER_END,Sb=pr.ERR_UNKNOWN_ENCODING,at=uo.errorOrDestroy;rt()(ee,gc);function Ob(){}function xt(e,r,t){it=it||Ir(),e=e||{},typeof t!="boolean"&&(t=r instanceof it),this.objectMode=!!e.objectMode,t&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=gb(this,e,"writableHighWaterMark",t),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=e.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){Rb(r,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new hc(this)}xt.prototype.getBuffer=function(){for(var r=this.bufferedRequest,t=[];r;)t.push(r),r=r.next;return t};(function(){try{Object.defineProperty(xt.prototype,"buffer",{get:cb.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var Fn;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Fn=Function.prototype[Symbol.hasInstance],Object.defineProperty(ee,Symbol.hasInstance,{value:function(r){return Fn.call(this,r)?!0:this!==ee?!1:r&&r._writableState instanceof xt}})):Fn=function(r){return r instanceof this};function ee(e){it=it||Ir();var r=this instanceof it;if(!r&&!Fn.call(ee,this))return new ee(e);this._writableState=new xt(e,this,r),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),gc.call(this)}ee.prototype.pipe=function(){at(this,new bb)};function Pb(e,r){var t=new Eb;at(e,t),process.nextTick(r,t)}function Ab(e,r,t,n){var i;return t===null?i=new wb:typeof t!="string"&&!r.objectMode&&(i=new mb("chunk",["string","Buffer"],t)),i?(at(e,i),process.nextTick(n,i),!1):!0}ee.prototype.write=function(e,r,t){var n=this._writableState,i=!1,a=!n.objectMode&&pb(e);return a&&!kn.isBuffer(e)&&(e=db(e)),typeof r=="function"&&(t=r,r=null),a?r="buffer":r||(r=n.defaultEncoding),typeof t!="function"&&(t=Ob),n.ending?Pb(this,t):(a||Ab(this,n,e,t))&&(n.pendingcb++,i=Nb(this,n,a,e,r,t)),i};ee.prototype.cork=function(){this._writableState.corked++};ee.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&mc(this,e))};ee.prototype.setDefaultEncoding=function(r){if(typeof r=="string"&&(r=r.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((r+"").toLowerCase())>-1))throw new Sb(r);return this._writableState.defaultEncoding=r,this};Object.defineProperty(ee.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Tb(e,r,t){return!e.objectMode&&e.decodeStrings!==!1&&typeof r=="string"&&(r=kn.from(r,t)),r}Object.defineProperty(ee.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Nb(e,r,t,n,i,a){if(!t){var s=Tb(r,n,i);n!==s&&(t=!0,i="buffer",n=s)}var u=r.objectMode?1:n.length;r.length+=u;var d=r.length<r.highWaterMark;if(d||(r.needDrain=!0),r.writing||r.corked){var h=r.lastBufferedRequest;r.lastBufferedRequest={chunk:n,encoding:i,isBuf:t,callback:a,next:null},h?h.next=r.lastBufferedRequest:r.bufferedRequest=r.lastBufferedRequest,r.bufferedRequestCount+=1}else so(e,r,!1,u,n,i,a);return d}function so(e,r,t,n,i,a,s){r.writelen=n,r.writecb=s,r.writing=!0,r.sync=!0,r.destroyed?r.onwrite(new _b("write")):t?e._writev(i,r.onwrite):e._write(i,a,r.onwrite),r.sync=!1}function xb(e,r,t,n,i){--r.pendingcb,t?(process.nextTick(i,n),process.nextTick(Nt,e,r),e._writableState.errorEmitted=!0,at(e,n)):(i(n),e._writableState.errorEmitted=!0,at(e,n),Nt(e,r))}function Mb(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function Rb(e,r){var t=e._writableState,n=t.sync,i=t.writecb;if(typeof i!="function")throw new vb;if(Mb(t),r)xb(e,t,n,r,i);else{var a=yc(t)||e.destroyed;!a&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&mc(e,t),n?process.nextTick(pc,e,t,a,i):pc(e,t,a,i)}}function pc(e,r,t,n){t||Ib(e,r),r.pendingcb--,n(),Nt(e,r)}function Ib(e,r){r.length===0&&r.needDrain&&(r.needDrain=!1,e.emit("drain"))}function mc(e,r){r.bufferProcessing=!0;var t=r.bufferedRequest;if(e._writev&&t&&t.next){var n=r.bufferedRequestCount,i=new Array(n),a=r.corkedRequestsFree;a.entry=t;for(var s=0,u=!0;t;)i[s]=t,t.isBuf||(u=!1),t=t.next,s+=1;i.allBuffers=u,so(e,r,!0,r.length,i,"",a.finish),r.pendingcb++,r.lastBufferedRequest=null,a.next?(r.corkedRequestsFree=a.next,a.next=null):r.corkedRequestsFree=new hc(r),r.bufferedRequestCount=0}else{for(;t;){var d=t.chunk,h=t.encoding,y=t.callback,b=r.objectMode?1:d.length;if(so(e,r,!1,b,d,h,y),t=t.next,r.bufferedRequestCount--,r.writing)break}t===null&&(r.lastBufferedRequest=null)}r.bufferedRequest=t,r.bufferProcessing=!1}ee.prototype._write=function(e,r,t){t(new yb("_write()"))};ee.prototype._writev=null;ee.prototype.end=function(e,r,t){var n=this._writableState;return typeof e=="function"?(t=e,e=null,r=null):typeof r=="function"&&(t=r,r=null),e!=null&&this.write(e,r),n.corked&&(n.corked=1,this.uncork()),n.ending||Lb(this,n,t),this};Object.defineProperty(ee.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function yc(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function Db(e,r){e._final(function(t){r.pendingcb--,t&&at(e,t),r.prefinished=!0,e.emit("prefinish"),Nt(e,r)})}function Cb(e,r){!r.prefinished&&!r.finalCalled&&(typeof e._final=="function"&&!r.destroyed?(r.pendingcb++,r.finalCalled=!0,process.nextTick(Db,e,r)):(r.prefinished=!0,e.emit("prefinish")))}function Nt(e,r){var t=yc(r);if(t&&(Cb(e,r),r.pendingcb===0&&(r.finished=!0,e.emit("finish"),r.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return t}function Lb(e,r,t){r.ending=!0,Nt(e,r),t&&(r.finished?process.nextTick(t):e.once("finish",t)),r.ended=!0,e.writable=!1}function qb(e,r,t){var n=e.entry;for(e.entry=null;n;){var i=n.callback;r.pendingcb--,i(t),n=n.next}r.corkedRequestsFree.next=e}Object.defineProperty(ee.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(r){this._writableState&&(this._writableState.destroyed=r)}});ee.prototype.destroy=uo.destroy;ee.prototype._undestroy=uo.undestroy;ee.prototype._destroy=function(e,r){r(e)}});var lo=m((CS,wc)=>{"use strict";var $b=require("util"),bc=jn(),{LEVEL:_c}=ae(),Mt=wc.exports=function(r={}){bc.call(this,{objectMode:!0,highWaterMark:r.highWaterMark}),this.format=r.format,this.level=r.level,this.handleExceptions=r.handleExceptions,this.handleRejections=r.handleRejections,this.silent=r.silent,r.log&&(this.log=r.log),r.logv&&(this.logv=r.logv),r.close&&(this.close=r.close),this.once("pipe",t=>{this.levels=t.levels,this.parent=t}),this.once("unpipe",t=>{t===this.parent&&(this.parent=null,this.close&&this.close())})};$b.inherits(Mt,bc);Mt.prototype._write=function(r,t,n){if(this.silent||r.exception===!0&&!this.handleExceptions)return n(null);let i=this.level||this.parent&&this.parent.level;if(!i||this.levels[i]>=this.levels[r[_c]]){if(r&&!this.format)return this.log(r,n);let a,s;try{s=this.format.transform(Object.assign({},r),this.format.options)}catch(u){a=u}if(a||!s){if(n(),a)throw a;return}return this.log(s,n)}return this._writableState.sync=!1,n(null)};Mt.prototype._writev=function(r,t){if(this.logv){let n=r.filter(this._accept,this);return n.length?this.logv(n,t):t(null)}for(let n=0;n<r.length;n++){if(!this._accept(r[n]))continue;if(r[n].chunk&&!this.format){this.log(r[n].chunk,r[n].callback);continue}let i,a;try{a=this.format.transform(Object.assign({},r[n].chunk),this.format.options)}catch(s){i=s}if(i||!a){if(r[n].callback(),i)throw t(null),i}else this.log(a,r[n].callback)}return t(null)};Mt.prototype._accept=function(r){let t=r.chunk;if(this.silent)return!1;let n=this.level||this.parent&&this.parent.level;return!!((t.exception===!0||!n||this.levels[n]>=this.levels[t[_c]])&&(this.handleExceptions||t.exception!==!0))};Mt.prototype._nop=function(){}});var fo=m((LS,Sc)=>{"use strict";var Ub=require("util"),{LEVEL:co}=ae(),Ec=lo(),Rt=Sc.exports=function(r={}){if(Ec.call(this,r),!r.transport||typeof r.transport.log!="function")throw new Error("Invalid transport, must be an object with a log method.");this.transport=r.transport,this.level=this.level||r.transport.level,this.handleExceptions=this.handleExceptions||r.transport.handleExceptions,this._deprecated();function t(n){this.emit("error",n,this.transport)}this.transport.__winstonError||(this.transport.__winstonError=t.bind(this),this.transport.on("error",this.transport.__winstonError))};Ub.inherits(Rt,Ec);Rt.prototype._write=function(r,t,n){if(this.silent||r.exception===!0&&!this.handleExceptions)return n(null);(!this.level||this.levels[this.level]>=this.levels[r[co]])&&this.transport.log(r[co],r.message,r,this._nop),n(null)};Rt.prototype._writev=function(r,t){for(let n=0;n<r.length;n++)this._accept(r[n])&&(this.transport.log(r[n].chunk[co],r[n].chunk.message,r[n].chunk,this._nop),r[n].callback());return t(null)};Rt.prototype._deprecated=function(){console.error([`${this.transport.name} is a legacy winston transport. Consider upgrading: `,"- Upgrade docs: https://github.com/winstonjs/winston/blob/master/UPGRADE-3.0.md"].join(`
51
+ `))};Rt.prototype.close=function(){this.transport.close&&this.transport.close(),this.transport.__winstonError&&(this.transport.removeListener("error",this.transport.__winstonError),this.transport.__winstonError=null)}});var ot=m((qS,po)=>{"use strict";po.exports=lo();po.exports.LegacyTransportStream=fo()});var Ac=m((US,Pc)=>{"use strict";var jb=require("os"),{LEVEL:Oc,MESSAGE:st}=ae(),Fb=ot();Pc.exports=class extends Fb{constructor(r={}){super(r),this.name=r.name||"console",this.stderrLevels=this._stringArrayToSet(r.stderrLevels),this.consoleWarnLevels=this._stringArrayToSet(r.consoleWarnLevels),this.eol=typeof r.eol=="string"?r.eol:jb.EOL,this.forceConsole=r.forceConsole||!1,this._consoleLog=console.log.bind(console),this._consoleWarn=console.warn.bind(console),this._consoleError=console.error.bind(console),this.setMaxListeners(30)}log(r,t){if(setImmediate(()=>this.emit("logged",r)),this.stderrLevels[r[Oc]]){console._stderr&&!this.forceConsole?console._stderr.write(`${r[st]}${this.eol}`):this._consoleError(r[st]),t&&t();return}else if(this.consoleWarnLevels[r[Oc]]){console._stderr&&!this.forceConsole?console._stderr.write(`${r[st]}${this.eol}`):this._consoleWarn(r[st]),t&&t();return}console._stdout&&!this.forceConsole?console._stdout.write(`${r[st]}${this.eol}`):this._consoleLog(r[st]),t&&t()}_stringArrayToSet(r,t){if(!r)return{};if(t=t||"Cannot make set from type other than Array of string elements",!Array.isArray(r))throw new Error(t);return r.reduce((n,i)=>{if(typeof i!="string")throw new Error(t);return n[i]=!0,n},{})}}});var Bn=m((zn,Tc)=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.default=kb;function kb(e){return e&&typeof e.length=="number"&&e.length>=0&&e.length%1===0}Tc.exports=zn.default});var xc=m((Hn,Nc)=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.default=function(e){return function(...r){var t=r.pop();return e.call(this,r,t)}};Nc.exports=Hn.default});var Ic=m(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.fallback=Mc;hr.wrap=Rc;var zb=hr.hasQueueMicrotask=typeof queueMicrotask=="function"&&queueMicrotask,Bb=hr.hasSetImmediate=typeof setImmediate=="function"&&setImmediate,Hb=hr.hasNextTick=typeof process=="object"&&typeof process.nextTick=="function";function Mc(e){setTimeout(e,0)}function Rc(e){return(r,...t)=>e(()=>r(...t))}var It;zb?It=queueMicrotask:Bb?It=setImmediate:Hb?It=process.nextTick:It=Mc;hr.default=Rc(It)});var $c=m((Gn,qc)=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.default=Jb;var Gb=xc(),Wb=Lc(Gb),Yb=Ic(),Vb=Lc(Yb),Kb=Dr();function Lc(e){return e&&e.__esModule?e:{default:e}}function Jb(e){return(0,Kb.isAsync)(e)?function(...r){let t=r.pop(),n=e.apply(this,r);return Dc(n,t)}:(0,Wb.default)(function(r,t){var n;try{n=e.apply(this,r)}catch(i){return t(i)}if(n&&typeof n.then=="function")return Dc(n,t);t(null,n)})}function Dc(e,r){return e.then(t=>{Cc(r,null,t)},t=>{Cc(r,t&&(t instanceof Error||t.message)?t:new Error(t))})}function Cc(e,r,t){try{e(r,t)}catch(n){(0,Vb.default)(i=>{throw i},n)}}qc.exports=Gn.default});var Dr=m(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.isAsyncIterable=Ve.isAsyncGenerator=Ve.isAsync=void 0;var Zb=$c(),Xb=Qb(Zb);function Qb(e){return e&&e.__esModule?e:{default:e}}function Uc(e){return e[Symbol.toStringTag]==="AsyncFunction"}function e_(e){return e[Symbol.toStringTag]==="AsyncGenerator"}function r_(e){return typeof e[Symbol.asyncIterator]=="function"}function t_(e){if(typeof e!="function")throw new Error("expected a function");return Uc(e)?(0,Xb.default)(e):e}Ve.default=t_;Ve.isAsync=Uc;Ve.isAsyncGenerator=e_;Ve.isAsyncIterable=r_});var ut=m((Wn,jc)=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.default=n_;function n_(e,r){if(r||(r=e.length),!r)throw new Error("arity is undefined");function t(...n){return typeof n[r-1]=="function"?e.apply(this,n):new Promise((i,a)=>{n[r-1]=(s,...u)=>{if(s)return a(s);i(u.length>1?u:u[0])},e.apply(this,n)})}return t}jc.exports=Wn.default});var kc=m((Yn,Fc)=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});var i_=Bn(),a_=ho(i_),o_=Dr(),s_=ho(o_),u_=ut(),l_=ho(u_);function ho(e){return e&&e.__esModule?e:{default:e}}Yn.default=(0,l_.default)((e,r,t)=>{var n=(0,a_.default)(r)?[]:{};e(r,(i,a,s)=>{(0,s_.default)(i)((u,...d)=>{d.length<2&&([d]=d),n[a]=d,s(u)})},i=>t(i,n))},3);Fc.exports=Yn.default});var go=m((Vn,zc)=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.default=c_;function c_(e){function r(...t){if(e!==null){var n=e;e=null,n.apply(this,t)}}return Object.assign(r,e),r}zc.exports=Vn.default});var Hc=m((Kn,Bc)=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.default=function(e){return e[Symbol.iterator]&&e[Symbol.iterator]()};Bc.exports=Kn.default});var Yc=m((Jn,Wc)=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.default=v_;var f_=Bn(),d_=Gc(f_),p_=Hc(),h_=Gc(p_);function Gc(e){return e&&e.__esModule?e:{default:e}}function g_(e){var r=-1,t=e.length;return function(){return++r<t?{value:e[r],key:r}:null}}function m_(e){var r=-1;return function(){var n=e.next();return n.done?null:(r++,{value:n.value,key:r})}}function y_(e){var r=e?Object.keys(e):[],t=-1,n=r.length;return function i(){var a=r[++t];return a==="__proto__"?i():t<n?{value:e[a],key:a}:null}}function v_(e){if((0,d_.default)(e))return g_(e);var r=(0,h_.default)(e);return r?m_(r):y_(e)}Wc.exports=Jn.default});var mo=m((Zn,Vc)=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.default=b_;function b_(e){return function(...r){if(e===null)throw new Error("Callback was already called.");var t=e;e=null,t.apply(this,r)}}Vc.exports=Zn.default});var Qn=m((Xn,Kc)=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});var __={};Xn.default=__;Kc.exports=Xn.default});var Zc=m((ei,Jc)=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.default=O_;var w_=Qn(),E_=S_(w_);function S_(e){return e&&e.__esModule?e:{default:e}}function O_(e,r,t,n){let i=!1,a=!1,s=!1,u=0,d=0;function h(){u>=r||s||i||(s=!0,e.next().then(({value:_,done:S})=>{if(!(a||i)){if(s=!1,S){i=!0,u<=0&&n(null);return}u++,t(_,d,y),d++,h()}}).catch(b))}function y(_,S){if(u-=1,!a){if(_)return b(_);if(_===!1){i=!0,a=!0;return}if(S===E_.default||i&&u<=0)return i=!0,n(null);h()}}function b(_){a||(s=!1,i=!0,n(_))}h()}Jc.exports=ei.default});var rf=m((ri,ef)=>{"use strict";Object.defineProperty(ri,"__esModule",{value:!0});var P_=go(),A_=Dt(P_),T_=Yc(),N_=Dt(T_),x_=mo(),M_=Dt(x_),Xc=Dr(),R_=Zc(),Qc=Dt(R_),I_=Qn(),D_=Dt(I_);function Dt(e){return e&&e.__esModule?e:{default:e}}ri.default=e=>(r,t,n)=>{if(n=(0,A_.default)(n),e<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!r)return n(null);if((0,Xc.isAsyncGenerator)(r))return(0,Qc.default)(r,e,t,n);if((0,Xc.isAsyncIterable)(r))return(0,Qc.default)(r[Symbol.asyncIterator](),e,t,n);var i=(0,N_.default)(r),a=!1,s=!1,u=0,d=!1;function h(b,_){if(!s)if(u-=1,b)a=!0,n(b);else if(b===!1)a=!0,s=!0;else{if(_===D_.default||a&&u<=0)return a=!0,n(null);d||y()}}function y(){for(d=!0;u<e&&!a;){var b=i();if(b===null){a=!0,u<=0&&n(null);return}u+=1,t(b.value,b.key,(0,M_.default)(h))}d=!1}y()};ef.exports=ri.default});var vo=m((ti,tf)=>{"use strict";Object.defineProperty(ti,"__esModule",{value:!0});var C_=rf(),L_=yo(C_),q_=Dr(),$_=yo(q_),U_=ut(),j_=yo(U_);function yo(e){return e&&e.__esModule?e:{default:e}}function F_(e,r,t,n){return(0,L_.default)(r)(e,(0,$_.default)(t),n)}ti.default=(0,j_.default)(F_,4);tf.exports=ti.default});var of=m((ni,af)=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});var k_=vo(),z_=nf(k_),B_=ut(),H_=nf(B_);function nf(e){return e&&e.__esModule?e:{default:e}}function G_(e,r,t){return(0,z_.default)(e,1,r,t)}ni.default=(0,H_.default)(G_,3);af.exports=ni.default});var lf=m((ii,uf)=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.default=J_;var W_=kc(),Y_=sf(W_),V_=of(),K_=sf(V_);function sf(e){return e&&e.__esModule?e:{default:e}}function J_(e,r){return(0,Y_.default)(K_.default,e,r)}uf.exports=ii.default});var bo=m((kS,ff)=>{"use strict";ff.exports=Ke;var ai=lr().codes,Z_=ai.ERR_METHOD_NOT_IMPLEMENTED,X_=ai.ERR_MULTIPLE_CALLBACK,Q_=ai.ERR_TRANSFORM_ALREADY_TRANSFORMING,e0=ai.ERR_TRANSFORM_WITH_LENGTH_0,oi=Ir();rt()(Ke,oi);function r0(e,r){var t=this._transformState;t.transforming=!1;var n=t.writecb;if(n===null)return this.emit("error",new X_);t.writechunk=null,t.writecb=null,r!=null&&this.push(r),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function Ke(e){if(!(this instanceof Ke))return new Ke(e);oi.call(this,e),this._transformState={afterTransform:r0.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",t0)}function t0(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(r,t){cf(e,r,t)}):cf(this,null,null)}Ke.prototype.push=function(e,r){return this._transformState.needTransform=!1,oi.prototype.push.call(this,e,r)};Ke.prototype._transform=function(e,r,t){t(new Z_("_transform()"))};Ke.prototype._write=function(e,r,t){var n=this._transformState;if(n.writecb=t,n.writechunk=e,n.writeencoding=r,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};Ke.prototype._read=function(e){var r=this._transformState;r.writechunk!==null&&!r.transforming?(r.transforming=!0,this._transform(r.writechunk,r.writeencoding,r.afterTransform)):r.needTransform=!0};Ke.prototype._destroy=function(e,r){oi.prototype._destroy.call(this,e,function(t){r(t)})};function cf(e,r,t){if(r)return e.emit("error",r);if(t!=null&&e.push(t),e._writableState.length)throw new e0;if(e._transformState.transforming)throw new Q_;return e.push(null)}});var hf=m((zS,pf)=>{"use strict";pf.exports=Ct;var df=bo();rt()(Ct,df);function Ct(e){if(!(this instanceof Ct))return new Ct(e);df.call(this,e)}Ct.prototype._transform=function(e,r,t){t(null,e)}});var bf=m((BS,vf)=>{"use strict";var _o;function n0(e){var r=!1;return function(){r||(r=!0,e.apply(void 0,arguments))}}var yf=lr().codes,i0=yf.ERR_MISSING_ARGS,a0=yf.ERR_STREAM_DESTROYED;function gf(e){if(e)throw e}function o0(e){return e.setHeader&&typeof e.abort=="function"}function s0(e,r,t,n){n=n0(n);var i=!1;e.on("close",function(){i=!0}),_o===void 0&&(_o=Rn()),_o(e,{readable:r,writable:t},function(s){if(s)return n(s);i=!0,n()});var a=!1;return function(s){if(!i&&!a){if(a=!0,o0(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(s||new a0("pipe"))}}}function mf(e){e()}function u0(e,r){return e.pipe(r)}function l0(e){return!e.length||typeof e[e.length-1]!="function"?gf:e.pop()}function c0(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];var n=l0(r);if(Array.isArray(r[0])&&(r=r[0]),r.length<2)throw new i0("streams");var i,a=r.map(function(s,u){var d=u<r.length-1,h=u>0;return s0(s,d,h,function(y){i||(i=y),y&&a.forEach(mf),!d&&(a.forEach(mf),n(i))})});return r.reduce(u0)}vf.exports=c0});var Cr=m((Me,qt)=>{var Lt=require("stream");process.env.READABLE_STREAM==="disable"&&Lt?(qt.exports=Lt.Readable,Object.assign(qt.exports,Lt),qt.exports.Stream=Lt):(Me=qt.exports=io(),Me.Stream=Lt||Me,Me.Readable=Me,Me.Writable=jn(),Me.Duplex=Ir(),Me.Transform=bo(),Me.PassThrough=hf(),Me.finished=Rn(),Me.pipeline=bf())});var To=m((HS,wf)=>{var lt=[],$t=[],wo=function(){};function So(e){return~lt.indexOf(e)?!1:(lt.push(e),!0)}function Oo(e){wo=e}function f0(e){for(var r=[],t=0;t<lt.length;t++){if(lt[t].async){r.push(lt[t]);continue}if(lt[t](e))return!0}return r.length?new Promise(function(i){Promise.all(r.map(function(s){return s(e)})).then(function(s){i(s.some(Boolean))})}):!1}function Po(e){return~$t.indexOf(e)?!1:($t.push(e),!0)}function Eo(){wo.apply(wo,arguments)}function _f(e){for(var r=0;r<$t.length;r++)e=$t[r].apply($t[r],arguments);return e}function Ao(e,r){var t=Object.prototype.hasOwnProperty;for(var n in r)t.call(r,n)&&(e[n]=r[n]);return e}function d0(e){return e.enabled=!1,e.modify=Po,e.set=Oo,e.use=So,Ao(function(){return!1},e)}function p0(e){function r(){var t=Array.prototype.slice.call(arguments,0);return Eo.call(Eo,e,_f(t,e)),!0}return e.enabled=!0,e.modify=Po,e.set=Oo,e.use=So,Ao(r,e)}wf.exports=function(r){return r.introduce=Ao,r.enabled=f0,r.process=_f,r.modify=Po,r.write=Eo,r.nope=d0,r.yep=p0,r.set=Oo,r.use=So,r}});var Sf=m((GS,Ef)=>{var h0=To(),g0=h0(function e(r,t){return t=t||{},t.namespace=r,t.prod=!0,t.dev=!1,t.force||e.force?e.yep(t):e.nope(t)});Ef.exports=g0});var Pf=m((WS,Of)=>{"use strict";Of.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var Tf=m((YS,Af)=>{Af.exports=function(r){return!r||typeof r=="string"?!1:r instanceof Array||Array.isArray(r)||r.length>=0&&(r.splice instanceof Function||Object.getOwnPropertyDescriptor(r,r.length-1)&&r.constructor.name!=="String")}});var Mf=m((VS,xf)=>{"use strict";var m0=Tf(),y0=Array.prototype.concat,v0=Array.prototype.slice,Nf=xf.exports=function(r){for(var t=[],n=0,i=r.length;n<i;n++){var a=r[n];m0(a)?t=y0.call(t,v0.call(a)):t.push(a)}return t};Nf.wrap=function(e){return function(){return e(Nf(arguments))}}});var Cf=m((KS,Df)=>{var Ut=Pf(),jt=Mf(),Rf=Object.hasOwnProperty,If=Object.create(null);for(si in Ut)Rf.call(Ut,si)&&(If[Ut[si]]=si);var si,Oe=Df.exports={to:{},get:{}};Oe.get=function(e){var r=e.substring(0,3).toLowerCase(),t,n;switch(r){case"hsl":t=Oe.get.hsl(e),n="hsl";break;case"hwb":t=Oe.get.hwb(e),n="hwb";break;default:t=Oe.get.rgb(e),n="rgb";break}return t?{model:n,value:t}:null};Oe.get.rgb=function(e){if(!e)return null;var r=/^#([a-f0-9]{3,4})$/i,t=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,n=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,i=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,a=/^(\w+)$/,s=[0,0,0,1],u,d,h;if(u=e.match(t)){for(h=u[2],u=u[1],d=0;d<3;d++){var y=d*2;s[d]=parseInt(u.slice(y,y+2),16)}h&&(s[3]=parseInt(h,16)/255)}else if(u=e.match(r)){for(u=u[1],h=u[3],d=0;d<3;d++)s[d]=parseInt(u[d]+u[d],16);h&&(s[3]=parseInt(h+h,16)/255)}else if(u=e.match(n)){for(d=0;d<3;d++)s[d]=parseInt(u[d+1],0);u[4]&&(u[5]?s[3]=parseFloat(u[4])*.01:s[3]=parseFloat(u[4]))}else if(u=e.match(i)){for(d=0;d<3;d++)s[d]=Math.round(parseFloat(u[d+1])*2.55);u[4]&&(u[5]?s[3]=parseFloat(u[4])*.01:s[3]=parseFloat(u[4]))}else return(u=e.match(a))?u[1]==="transparent"?[0,0,0,0]:Rf.call(Ut,u[1])?(s=Ut[u[1]],s[3]=1,s):null:null;for(d=0;d<3;d++)s[d]=gr(s[d],0,255);return s[3]=gr(s[3],0,1),s};Oe.get.hsl=function(e){if(!e)return null;var r=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,t=e.match(r);if(t){var n=parseFloat(t[4]),i=(parseFloat(t[1])%360+360)%360,a=gr(parseFloat(t[2]),0,100),s=gr(parseFloat(t[3]),0,100),u=gr(isNaN(n)?1:n,0,1);return[i,a,s,u]}return null};Oe.get.hwb=function(e){if(!e)return null;var r=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,t=e.match(r);if(t){var n=parseFloat(t[4]),i=(parseFloat(t[1])%360+360)%360,a=gr(parseFloat(t[2]),0,100),s=gr(parseFloat(t[3]),0,100),u=gr(isNaN(n)?1:n,0,1);return[i,a,s,u]}return null};Oe.to.hex=function(){var e=jt(arguments);return"#"+ui(e[0])+ui(e[1])+ui(e[2])+(e[3]<1?ui(Math.round(e[3]*255)):"")};Oe.to.rgb=function(){var e=jt(arguments);return e.length<4||e[3]===1?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"};Oe.to.rgb.percent=function(){var e=jt(arguments),r=Math.round(e[0]/255*100),t=Math.round(e[1]/255*100),n=Math.round(e[2]/255*100);return e.length<4||e[3]===1?"rgb("+r+"%, "+t+"%, "+n+"%)":"rgba("+r+"%, "+t+"%, "+n+"%, "+e[3]+")"};Oe.to.hsl=function(){var e=jt(arguments);return e.length<4||e[3]===1?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"};Oe.to.hwb=function(){var e=jt(arguments),r="";return e.length>=4&&e[3]!==1&&(r=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+r+")"};Oe.to.keyword=function(e){return If[e.slice(0,3)]};function gr(e,r,t){return Math.min(Math.max(r,e),t)}function ui(e){var r=Math.round(e).toString(16).toUpperCase();return r.length<2?"0"+r:r}});var qf=m((JS,Lf)=>{"use strict";Lf.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var No=m((ZS,Ff)=>{var Lr=qf(),jf={};for(li in Lr)Lr.hasOwnProperty(li)&&(jf[Lr[li]]=li);var li,I=Ff.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(be in I)if(I.hasOwnProperty(be)){if(!("channels"in I[be]))throw new Error("missing channels property: "+be);if(!("labels"in I[be]))throw new Error("missing channel labels property: "+be);if(I[be].labels.length!==I[be].channels)throw new Error("channel and label counts mismatch: "+be);$f=I[be].channels,Uf=I[be].labels,delete I[be].channels,delete I[be].labels,Object.defineProperty(I[be],"channels",{value:$f}),Object.defineProperty(I[be],"labels",{value:Uf})}var $f,Uf,be;I.rgb.hsl=function(e){var r=e[0]/255,t=e[1]/255,n=e[2]/255,i=Math.min(r,t,n),a=Math.max(r,t,n),s=a-i,u,d,h;return a===i?u=0:r===a?u=(t-n)/s:t===a?u=2+(n-r)/s:n===a&&(u=4+(r-t)/s),u=Math.min(u*60,360),u<0&&(u+=360),h=(i+a)/2,a===i?d=0:h<=.5?d=s/(a+i):d=s/(2-a-i),[u,d*100,h*100]};I.rgb.hsv=function(e){var r,t,n,i,a,s=e[0]/255,u=e[1]/255,d=e[2]/255,h=Math.max(s,u,d),y=h-Math.min(s,u,d),b=function(_){return(h-_)/6/y+1/2};return y===0?i=a=0:(a=y/h,r=b(s),t=b(u),n=b(d),s===h?i=n-t:u===h?i=1/3+r-n:d===h&&(i=2/3+t-r),i<0?i+=1:i>1&&(i-=1)),[i*360,a*100,h*100]};I.rgb.hwb=function(e){var r=e[0],t=e[1],n=e[2],i=I.rgb.hsl(e)[0],a=1/255*Math.min(r,Math.min(t,n));return n=1-1/255*Math.max(r,Math.max(t,n)),[i,a*100,n*100]};I.rgb.cmyk=function(e){var r=e[0]/255,t=e[1]/255,n=e[2]/255,i,a,s,u;return u=Math.min(1-r,1-t,1-n),i=(1-r-u)/(1-u)||0,a=(1-t-u)/(1-u)||0,s=(1-n-u)/(1-u)||0,[i*100,a*100,s*100,u*100]};function b0(e,r){return Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2)+Math.pow(e[2]-r[2],2)}I.rgb.keyword=function(e){var r=jf[e];if(r)return r;var t=1/0,n;for(var i in Lr)if(Lr.hasOwnProperty(i)){var a=Lr[i],s=b0(e,a);s<t&&(t=s,n=i)}return n};I.keyword.rgb=function(e){return Lr[e]};I.rgb.xyz=function(e){var r=e[0]/255,t=e[1]/255,n=e[2]/255;r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92;var i=r*.4124+t*.3576+n*.1805,a=r*.2126+t*.7152+n*.0722,s=r*.0193+t*.1192+n*.9505;return[i*100,a*100,s*100]};I.rgb.lab=function(e){var r=I.rgb.xyz(e),t=r[0],n=r[1],i=r[2],a,s,u;return t/=95.047,n/=100,i/=108.883,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,a=116*n-16,s=500*(t-n),u=200*(n-i),[a,s,u]};I.hsl.rgb=function(e){var r=e[0]/360,t=e[1]/100,n=e[2]/100,i,a,s,u,d;if(t===0)return d=n*255,[d,d,d];n<.5?a=n*(1+t):a=n+t-n*t,i=2*n-a,u=[0,0,0];for(var h=0;h<3;h++)s=r+1/3*-(h-1),s<0&&s++,s>1&&s--,6*s<1?d=i+(a-i)*6*s:2*s<1?d=a:3*s<2?d=i+(a-i)*(2/3-s)*6:d=i,u[h]=d*255;return u};I.hsl.hsv=function(e){var r=e[0],t=e[1]/100,n=e[2]/100,i=t,a=Math.max(n,.01),s,u;return n*=2,t*=n<=1?n:2-n,i*=a<=1?a:2-a,u=(n+t)/2,s=n===0?2*i/(a+i):2*t/(n+t),[r,s*100,u*100]};I.hsv.rgb=function(e){var r=e[0]/60,t=e[1]/100,n=e[2]/100,i=Math.floor(r)%6,a=r-Math.floor(r),s=255*n*(1-t),u=255*n*(1-t*a),d=255*n*(1-t*(1-a));switch(n*=255,i){case 0:return[n,d,s];case 1:return[u,n,s];case 2:return[s,n,d];case 3:return[s,u,n];case 4:return[d,s,n];case 5:return[n,s,u]}};I.hsv.hsl=function(e){var r=e[0],t=e[1]/100,n=e[2]/100,i=Math.max(n,.01),a,s,u;return u=(2-t)*n,a=(2-t)*i,s=t*i,s/=a<=1?a:2-a,s=s||0,u/=2,[r,s*100,u*100]};I.hwb.rgb=function(e){var r=e[0]/360,t=e[1]/100,n=e[2]/100,i=t+n,a,s,u,d;i>1&&(t/=i,n/=i),a=Math.floor(6*r),s=1-n,u=6*r-a,(a&1)!==0&&(u=1-u),d=t+u*(s-t);var h,y,b;switch(a){default:case 6:case 0:h=s,y=d,b=t;break;case 1:h=d,y=s,b=t;break;case 2:h=t,y=s,b=d;break;case 3:h=t,y=d,b=s;break;case 4:h=d,y=t,b=s;break;case 5:h=s,y=t,b=d;break}return[h*255,y*255,b*255]};I.cmyk.rgb=function(e){var r=e[0]/100,t=e[1]/100,n=e[2]/100,i=e[3]/100,a,s,u;return a=1-Math.min(1,r*(1-i)+i),s=1-Math.min(1,t*(1-i)+i),u=1-Math.min(1,n*(1-i)+i),[a*255,s*255,u*255]};I.xyz.rgb=function(e){var r=e[0]/100,t=e[1]/100,n=e[2]/100,i,a,s;return i=r*3.2406+t*-1.5372+n*-.4986,a=r*-.9689+t*1.8758+n*.0415,s=r*.0557+t*-.204+n*1.057,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a*12.92,s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s*12.92,i=Math.min(Math.max(0,i),1),a=Math.min(Math.max(0,a),1),s=Math.min(Math.max(0,s),1),[i*255,a*255,s*255]};I.xyz.lab=function(e){var r=e[0],t=e[1],n=e[2],i,a,s;return r/=95.047,t/=100,n/=108.883,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,i=116*t-16,a=500*(r-t),s=200*(t-n),[i,a,s]};I.lab.xyz=function(e){var r=e[0],t=e[1],n=e[2],i,a,s;a=(r+16)/116,i=t/500+a,s=a-n/200;var u=Math.pow(a,3),d=Math.pow(i,3),h=Math.pow(s,3);return a=u>.008856?u:(a-16/116)/7.787,i=d>.008856?d:(i-16/116)/7.787,s=h>.008856?h:(s-16/116)/7.787,i*=95.047,a*=100,s*=108.883,[i,a,s]};I.lab.lch=function(e){var r=e[0],t=e[1],n=e[2],i,a,s;return i=Math.atan2(n,t),a=i*360/2/Math.PI,a<0&&(a+=360),s=Math.sqrt(t*t+n*n),[r,s,a]};I.lch.lab=function(e){var r=e[0],t=e[1],n=e[2],i,a,s;return s=n/360*2*Math.PI,i=t*Math.cos(s),a=t*Math.sin(s),[r,i,a]};I.rgb.ansi16=function(e){var r=e[0],t=e[1],n=e[2],i=1 in arguments?arguments[1]:I.rgb.hsv(e)[2];if(i=Math.round(i/50),i===0)return 30;var a=30+(Math.round(n/255)<<2|Math.round(t/255)<<1|Math.round(r/255));return i===2&&(a+=60),a};I.hsv.ansi16=function(e){return I.rgb.ansi16(I.hsv.rgb(e),e[2])};I.rgb.ansi256=function(e){var r=e[0],t=e[1],n=e[2];if(r===t&&t===n)return r<8?16:r>248?231:Math.round((r-8)/247*24)+232;var i=16+36*Math.round(r/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5);return i};I.ansi16.rgb=function(e){var r=e%10;if(r===0||r===7)return e>50&&(r+=3.5),r=r/10.5*255,[r,r,r];var t=(~~(e>50)+1)*.5,n=(r&1)*t*255,i=(r>>1&1)*t*255,a=(r>>2&1)*t*255;return[n,i,a]};I.ansi256.rgb=function(e){if(e>=232){var r=(e-232)*10+8;return[r,r,r]}e-=16;var t,n=Math.floor(e/36)/5*255,i=Math.floor((t=e%36)/6)/5*255,a=t%6/5*255;return[n,i,a]};I.rgb.hex=function(e){var r=((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255),t=r.toString(16).toUpperCase();return"000000".substring(t.length)+t};I.hex.rgb=function(e){var r=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!r)return[0,0,0];var t=r[0];r[0].length===3&&(t=t.split("").map(function(u){return u+u}).join(""));var n=parseInt(t,16),i=n>>16&255,a=n>>8&255,s=n&255;return[i,a,s]};I.rgb.hcg=function(e){var r=e[0]/255,t=e[1]/255,n=e[2]/255,i=Math.max(Math.max(r,t),n),a=Math.min(Math.min(r,t),n),s=i-a,u,d;return s<1?u=a/(1-s):u=0,s<=0?d=0:i===r?d=(t-n)/s%6:i===t?d=2+(n-r)/s:d=4+(r-t)/s+4,d/=6,d%=1,[d*360,s*100,u*100]};I.hsl.hcg=function(e){var r=e[1]/100,t=e[2]/100,n=1,i=0;return t<.5?n=2*r*t:n=2*r*(1-t),n<1&&(i=(t-.5*n)/(1-n)),[e[0],n*100,i*100]};I.hsv.hcg=function(e){var r=e[1]/100,t=e[2]/100,n=r*t,i=0;return n<1&&(i=(t-n)/(1-n)),[e[0],n*100,i*100]};I.hcg.rgb=function(e){var r=e[0]/360,t=e[1]/100,n=e[2]/100;if(t===0)return[n*255,n*255,n*255];var i=[0,0,0],a=r%1*6,s=a%1,u=1-s,d=0;switch(Math.floor(a)){case 0:i[0]=1,i[1]=s,i[2]=0;break;case 1:i[0]=u,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=s;break;case 3:i[0]=0,i[1]=u,i[2]=1;break;case 4:i[0]=s,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=u}return d=(1-t)*n,[(t*i[0]+d)*255,(t*i[1]+d)*255,(t*i[2]+d)*255]};I.hcg.hsv=function(e){var r=e[1]/100,t=e[2]/100,n=r+t*(1-r),i=0;return n>0&&(i=r/n),[e[0],i*100,n*100]};I.hcg.hsl=function(e){var r=e[1]/100,t=e[2]/100,n=t*(1-r)+.5*r,i=0;return n>0&&n<.5?i=r/(2*n):n>=.5&&n<1&&(i=r/(2*(1-n))),[e[0],i*100,n*100]};I.hcg.hwb=function(e){var r=e[1]/100,t=e[2]/100,n=r+t*(1-r);return[e[0],(n-r)*100,(1-n)*100]};I.hwb.hcg=function(e){var r=e[1]/100,t=e[2]/100,n=1-t,i=n-r,a=0;return i<1&&(a=(n-i)/(1-i)),[e[0],i*100,a*100]};I.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};I.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};I.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};I.gray.hsl=I.gray.hsv=function(e){return[0,0,e[0]]};I.gray.hwb=function(e){return[0,100,e[0]]};I.gray.cmyk=function(e){return[0,0,0,e[0]]};I.gray.lab=function(e){return[e[0],0,0]};I.gray.hex=function(e){var r=Math.round(e[0]/100*255)&255,t=(r<<16)+(r<<8)+r,n=t.toString(16).toUpperCase();return"000000".substring(n.length)+n};I.rgb.gray=function(e){var r=(e[0]+e[1]+e[2])/3;return[r/255*100]}});var zf=m((XS,kf)=>{var ci=No();function _0(){for(var e={},r=Object.keys(ci),t=r.length,n=0;n<t;n++)e[r[n]]={distance:-1,parent:null};return e}function w0(e){var r=_0(),t=[e];for(r[e].distance=0;t.length;)for(var n=t.pop(),i=Object.keys(ci[n]),a=i.length,s=0;s<a;s++){var u=i[s],d=r[u];d.distance===-1&&(d.distance=r[n].distance+1,d.parent=n,t.unshift(u))}return r}function E0(e,r){return function(t){return r(e(t))}}function S0(e,r){for(var t=[r[e].parent,e],n=ci[r[e].parent][e],i=r[e].parent;r[i].parent;)t.unshift(r[i].parent),n=E0(ci[r[i].parent][i],n),i=r[i].parent;return n.conversion=t,n}kf.exports=function(e){for(var r=w0(e),t={},n=Object.keys(r),i=n.length,a=0;a<i;a++){var s=n[a],u=r[s];u.parent!==null&&(t[s]=S0(s,r))}return t}});var Hf=m((QS,Bf)=>{var xo=No(),O0=zf(),ct={},P0=Object.keys(xo);function A0(e){var r=function(t){return t==null?t:(arguments.length>1&&(t=Array.prototype.slice.call(arguments)),e(t))};return"conversion"in e&&(r.conversion=e.conversion),r}function T0(e){var r=function(t){if(t==null)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var n=e(t);if(typeof n=="object")for(var i=n.length,a=0;a<i;a++)n[a]=Math.round(n[a]);return n};return"conversion"in e&&(r.conversion=e.conversion),r}P0.forEach(function(e){ct[e]={},Object.defineProperty(ct[e],"channels",{value:xo[e].channels}),Object.defineProperty(ct[e],"labels",{value:xo[e].labels});var r=O0(e),t=Object.keys(r);t.forEach(function(n){var i=r[n];ct[e][n]=T0(i),ct[e][n].raw=A0(i)})});Bf.exports=ct});var Yf=m((eO,Wf)=>{"use strict";var Ft=Cf(),Pe=Hf(),Io=[].slice,Gf=["keyword","gray","hex"],Mo={};Object.keys(Pe).forEach(function(e){Mo[Io.call(Pe[e].labels).sort().join("")]=e});var fi={};function ge(e,r){if(!(this instanceof ge))return new ge(e,r);if(r&&r in Gf&&(r=null),r&&!(r in Pe))throw new Error("Unknown model: "+r);var t,n;if(e==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof ge)this.model=e.model,this.color=e.color.slice(),this.valpha=e.valpha;else if(typeof e=="string"){var i=Ft.get(e);if(i===null)throw new Error("Unable to parse color from string: "+e);this.model=i.model,n=Pe[this.model].channels,this.color=i.value.slice(0,n),this.valpha=typeof i.value[n]=="number"?i.value[n]:1}else if(e.length){this.model=r||"rgb",n=Pe[this.model].channels;var a=Io.call(e,0,n);this.color=Ro(a,n),this.valpha=typeof e[n]=="number"?e[n]:1}else if(typeof e=="number")e&=16777215,this.model="rgb",this.color=[e>>16&255,e>>8&255,e&255],this.valpha=1;else{this.valpha=1;var s=Object.keys(e);"alpha"in e&&(s.splice(s.indexOf("alpha"),1),this.valpha=typeof e.alpha=="number"?e.alpha:0);var u=s.sort().join("");if(!(u in Mo))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=Mo[u];var d=Pe[this.model].labels,h=[];for(t=0;t<d.length;t++)h.push(e[d[t]]);this.color=Ro(h)}if(fi[this.model])for(n=Pe[this.model].channels,t=0;t<n;t++){var y=fi[this.model][t];y&&(this.color[t]=y(this.color[t]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}ge.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(e){var r=this.model in Ft.to?this:this.rgb();r=r.round(typeof e=="number"?e:1);var t=r.valpha===1?r.color:r.color.concat(this.valpha);return Ft.to[r.model](t)},percentString:function(e){var r=this.rgb().round(typeof e=="number"?e:1),t=r.valpha===1?r.color:r.color.concat(this.valpha);return Ft.to.rgb.percent(t)},array:function(){return this.valpha===1?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var e={},r=Pe[this.model].channels,t=Pe[this.model].labels,n=0;n<r;n++)e[t[n]]=this.color[n];return this.valpha!==1&&(e.alpha=this.valpha),e},unitArray:function(){var e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,this.valpha!==1&&e.push(this.valpha),e},unitObject:function(){var e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,this.valpha!==1&&(e.alpha=this.valpha),e},round:function(e){return e=Math.max(e||0,0),new ge(this.color.map(x0(e)).concat(this.valpha),this.model)},alpha:function(e){return arguments.length?new ge(this.color.concat(Math.max(0,Math.min(1,e))),this.model):this.valpha},red:re("rgb",0,se(255)),green:re("rgb",1,se(255)),blue:re("rgb",2,se(255)),hue:re(["hsl","hsv","hsl","hwb","hcg"],0,function(e){return(e%360+360)%360}),saturationl:re("hsl",1,se(100)),lightness:re("hsl",2,se(100)),saturationv:re("hsv",1,se(100)),value:re("hsv",2,se(100)),chroma:re("hcg",1,se(100)),gray:re("hcg",2,se(100)),white:re("hwb",1,se(100)),wblack:re("hwb",2,se(100)),cyan:re("cmyk",0,se(100)),magenta:re("cmyk",1,se(100)),yellow:re("cmyk",2,se(100)),black:re("cmyk",3,se(100)),x:re("xyz",0,se(100)),y:re("xyz",1,se(100)),z:re("xyz",2,se(100)),l:re("lab",0,se(100)),a:re("lab",1),b:re("lab",2),keyword:function(e){return arguments.length?new ge(e):Pe[this.model].keyword(this.color)},hex:function(e){return arguments.length?new ge(e):Ft.to.hex(this.rgb().round().color)},rgbNumber:function(){var e=this.rgb().color;return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255},luminosity:function(){for(var e=this.rgb().color,r=[],t=0;t<e.length;t++){var n=e[t]/255;r[t]=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)}return .2126*r[0]+.7152*r[1]+.0722*r[2]},contrast:function(e){var r=this.luminosity(),t=e.luminosity();return r>t?(r+.05)/(t+.05):(t+.05)/(r+.05)},level:function(e){var r=this.contrast(e);return r>=7.1?"AAA":r>=4.5?"AA":""},isDark:function(){var e=this.rgb().color,r=(e[0]*299+e[1]*587+e[2]*114)/1e3;return r<128},isLight:function(){return!this.isDark()},negate:function(){for(var e=this.rgb(),r=0;r<3;r++)e.color[r]=255-e.color[r];return e},lighten:function(e){var r=this.hsl();return r.color[2]+=r.color[2]*e,r},darken:function(e){var r=this.hsl();return r.color[2]-=r.color[2]*e,r},saturate:function(e){var r=this.hsl();return r.color[1]+=r.color[1]*e,r},desaturate:function(e){var r=this.hsl();return r.color[1]-=r.color[1]*e,r},whiten:function(e){var r=this.hwb();return r.color[1]+=r.color[1]*e,r},blacken:function(e){var r=this.hwb();return r.color[2]+=r.color[2]*e,r},grayscale:function(){var e=this.rgb().color,r=e[0]*.3+e[1]*.59+e[2]*.11;return ge.rgb(r,r,r)},fade:function(e){return this.alpha(this.valpha-this.valpha*e)},opaquer:function(e){return this.alpha(this.valpha+this.valpha*e)},rotate:function(e){var r=this.hsl(),t=r.color[0];return t=(t+e)%360,t=t<0?360+t:t,r.color[0]=t,r},mix:function(e,r){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);var t=e.rgb(),n=this.rgb(),i=r===void 0?.5:r,a=2*i-1,s=t.alpha()-n.alpha(),u=((a*s===-1?a:(a+s)/(1+a*s))+1)/2,d=1-u;return ge.rgb(u*t.red()+d*n.red(),u*t.green()+d*n.green(),u*t.blue()+d*n.blue(),t.alpha()*i+n.alpha()*(1-i))}};Object.keys(Pe).forEach(function(e){if(Gf.indexOf(e)===-1){var r=Pe[e].channels;ge.prototype[e]=function(){if(this.model===e)return new ge(this);if(arguments.length)return new ge(arguments,e);var t=typeof arguments[r]=="number"?r:this.valpha;return new ge(M0(Pe[this.model][e].raw(this.color)).concat(t),e)},ge[e]=function(t){return typeof t=="number"&&(t=Ro(Io.call(arguments),r)),new ge(t,e)}}});function N0(e,r){return Number(e.toFixed(r))}function x0(e){return function(r){return N0(r,e)}}function re(e,r,t){return e=Array.isArray(e)?e:[e],e.forEach(function(n){(fi[n]||(fi[n]=[]))[r]=t}),e=e[0],function(n){var i;return arguments.length?(t&&(n=t(n)),i=this[e](),i.color[r]=n,i):(i=this[e]().color[r],t&&(i=t(i)),i)}}function se(e){return function(r){return Math.max(0,Math.min(e,r))}}function M0(e){return Array.isArray(e)?e:[e]}function Ro(e,r){for(var t=0;t<r;t++)typeof e[t]!="number"&&(e[t]=0);return e}Wf.exports=ge});var Kf=m((rO,Vf)=>{"use strict";Vf.exports=function(r){for(var t=0,n=0;t<r.length;n=r.charCodeAt(t++)+((n<<5)-n));var i=Math.floor(Math.abs(Math.sin(n)*1e4%1*16777216)).toString(16);return"#"+Array(6-i.length+1).join("0")+i}});var Qf=m((tO,Xf)=>{"use strict";var Jf=Yf(),Zf=Kf();Xf.exports=function(r,t){var n=r.split(t||":"),i=Zf(n[0]);if(!n.length)return i;for(var a=0,s=n.length-1;a<s;a++)i=Jf(i).mix(Jf(Zf(n[a+1]))).saturate(1).hex();return i}});var rd=m((nO,ed)=>{"use strict";function Le(e,r){if(r)return new Le(e).style(r);if(!(this instanceof Le))return new Le(e);this.text=e}Le.prototype.prefix="\x1B[";Le.prototype.suffix="m";Le.prototype.hex=function(r){r=r[0]==="#"?r.substring(1):r,r.length===3&&(r=r.split(""),r[5]=r[2],r[4]=r[2],r[3]=r[1],r[2]=r[1],r[1]=r[0],r=r.join(""));var t=r.substring(0,2),n=r.substring(2,4),i=r.substring(4,6);return[parseInt(t,16),parseInt(n,16),parseInt(i,16)]};Le.prototype.rgb=function(r,t,n){var i=r/255*5,a=t/255*5,s=n/255*5;return this.ansi(i,a,s)};Le.prototype.ansi=function(r,t,n){var i=Math.round(r),a=Math.round(t),s=Math.round(n);return 16+i*36+a*6+s};Le.prototype.reset=function(){return this.prefix+"39;49"+this.suffix};Le.prototype.style=function(r){return this.prefix+"38;5;"+this.rgb.apply(this,this.hex(r))+this.suffix+this.text+this.reset()};ed.exports=Le});var nd=m((iO,td)=>{var R0=Qf(),I0=rd();td.exports=function(r,t){var n=t.namespace,i=t.colors!==!1?I0(n+":",R0(n)):n+":";return r[0]=i+" "+r[0],r}});var ad=m((aO,id)=>{"use strict";id.exports=function(r,t){if(!t)return!1;for(var n=t.split(/[\s,]+/),i=0;i<n.length;i++){if(t=n[i].replace("*",".*?"),t.charAt(0)==="-"){if(new RegExp("^"+t.substr(1)+"$").test(r))return!1;continue}if(new RegExp("^"+t+"$").test(r))return!0}return!1}});var sd=m((oO,od)=>{var D0=ad();od.exports=function(r){return function(n){try{return D0(n,r())}catch{}return!1}}});var ld=m((sO,ud)=>{var C0=sd();ud.exports=C0(function(){return process.env.DEBUG||process.env.DIAGNOSTICS})});var fd=m((uO,cd)=>{cd.exports=function(e,r){try{Function.prototype.apply.call(console.log,console,r)}catch{}}});var pd=m((lO,dd)=>{var L0=To(),q0=require("tty").isatty(1),di=L0(function e(r,t){return t=t||{},t.colors="colors"in t?t.colors:q0,t.namespace=r,t.prod=!1,t.dev=!0,!e.enabled(r)&&!(t.force||e.force)?e.nope(t):e.yep(t)});di.modify(nd());di.use(ld());di.set(fd());dd.exports=di});var kt=m((cO,Do)=>{process.env.NODE_ENV==="production"?Do.exports=Sf():Do.exports=pd()});var gd=m((fO,hd)=>{"use strict";var Co=require("fs"),{StringDecoder:$0}=require("string_decoder"),{Stream:U0}=Cr();function j0(){}hd.exports=(e,r)=>{let t=Buffer.alloc(65536),n=new $0("utf8"),i=new U0,a="",s=0,u=0;return e.start===-1&&delete e.start,i.readable=!0,i.destroy=()=>{i.destroyed=!0,i.emit("end"),i.emit("close")},Co.open(e.file,"a+","0644",(d,h)=>{if(d){r?r(d):i.emit("error",d),i.destroy();return}(function y(){if(i.destroyed){Co.close(h,j0);return}return Co.read(h,t,0,t.length,s,(b,_)=>{if(b){r?r(b):i.emit("error",b),i.destroy();return}if(!_)return a&&((e.start==null||u>e.start)&&(r?r(null,a):i.emit("line",a)),u++,a=""),setTimeout(y,1e3);let S=n.write(t.slice(0,_));r||i.emit("data",S),S=(a+S).split(/\n+/);let g=S.length-1,w=0;for(;w<g;w++)(e.start==null||u>e.start)&&(r?r(null,S[w]):i.emit("line",S[w])),u++;return a=S[g],s+=_,y()})})()}),r?i.destroy:i}});var bd=m((pO,vd)=>{"use strict";var Ee=require("fs"),le=require("path"),md=lf(),F0=require("zlib"),{MESSAGE:k0}=ae(),{Stream:z0,PassThrough:yd}=Cr(),B0=ot(),qe=kt()("winston:file"),H0=require("os"),G0=gd();vd.exports=class extends B0{constructor(r={}){super(r),this.name=r.name||"file";function t(n,...i){i.slice(1).forEach(a=>{if(r[a])throw new Error(`Cannot set ${a} and ${n} together`)})}if(this._stream=new yd,this._stream.setMaxListeners(30),this._onError=this._onError.bind(this),r.filename||r.dirname)t("filename or dirname","stream"),this._basename=this.filename=r.filename?le.basename(r.filename):"winston.log",this.dirname=r.dirname||le.dirname(r.filename),this.options=r.options||{flags:"a"};else if(r.stream)console.warn("options.stream will be removed in winston@4. Use winston.transports.Stream"),t("stream","filename","maxsize"),this._dest=this._stream.pipe(this._setupStream(r.stream)),this.dirname=le.dirname(this._dest.path);else throw new Error("Cannot log to file without filename or stream.");this.maxsize=r.maxsize||null,this.rotationFormat=r.rotationFormat||!1,this.zippedArchive=r.zippedArchive||!1,this.maxFiles=r.maxFiles||null,this.eol=typeof r.eol=="string"?r.eol:H0.EOL,this.tailable=r.tailable||!1,this.lazy=r.lazy||!1,this._size=0,this._pendingSize=0,this._created=0,this._drain=!1,this._opening=!1,this._ending=!1,this._fileExist=!1,this.dirname&&this._createLogDirIfNotExist(this.dirname),this.lazy||this.open()}finishIfEnding(){this._ending&&(this._opening?this.once("open",()=>{this._stream.once("finish",()=>this.emit("finish")),setImmediate(()=>this._stream.end())}):(this._stream.once("finish",()=>this.emit("finish")),setImmediate(()=>this._stream.end())))}log(r,t=()=>{}){if(this.silent)return t(),!0;if(this._drain){this._stream.once("drain",()=>{this._drain=!1,this.log(r,t)});return}if(this._rotate){this._stream.once("rotate",()=>{this._rotate=!1,this.log(r,t)});return}if(this.lazy){if(!this._fileExist){this._opening||this.open(),this.once("open",()=>{this._fileExist=!0,this.log(r,t)});return}if(this._needsNewFile(this._pendingSize)){this._dest.once("close",()=>{this._opening||this.open(),this.once("open",()=>{this.log(r,t)})});return}}let n=`${r[k0]}${this.eol}`,i=Buffer.byteLength(n);function a(){if(this._size+=i,this._pendingSize-=i,qe("logged %s %s",this._size,n),this.emit("logged",r),!this._rotate&&!this._opening&&this._needsNewFile()){if(this.lazy){this._endStream(()=>{this.emit("fileclosed")});return}this._rotate=!0,this._endStream(()=>this._rotateFile())}}this._pendingSize+=i,this._opening&&!this.rotatedWhileOpening&&this._needsNewFile(this._size+this._pendingSize)&&(this.rotatedWhileOpening=!0);let s=this._stream.write(n,a.bind(this));return s?t():(this._drain=!0,this._stream.once("drain",()=>{this._drain=!1,t()})),qe("written",s,this._drain),this.finishIfEnding(),s}query(r,t){typeof r=="function"&&(t=r,r={}),r=b(r);let n=le.join(this.dirname,this.filename),i="",a=[],s=0,u=Ee.createReadStream(n,{encoding:"utf8"});u.on("error",_=>{if(u.readable&&u.destroy(),!!t)return _.code!=="ENOENT"?t(_):t(null,a)}),u.on("data",_=>{_=(i+_).split(/\n+/);let S=_.length-1,g=0;for(;g<S;g++)(!r.start||s>=r.start)&&d(_[g]),s++;i=_[S]}),u.on("close",()=>{i&&d(i,!0),r.order==="desc"&&(a=a.reverse()),t&&t(null,a)});function d(_,S){try{let g=JSON.parse(_);y(g)&&h(g)}catch(g){S||u.emit("error",g)}}function h(_){if(r.rows&&a.length>=r.rows&&r.order!=="desc"){u.readable&&u.destroy();return}r.fields&&(_=r.fields.reduce((S,g)=>(S[g]=_[g],S),{})),r.order==="desc"&&a.length>=r.rows&&a.shift(),a.push(_)}function y(_){if(!_||typeof _!="object")return;let S=new Date(_.timestamp);if(!(r.from&&S<r.from||r.until&&S>r.until||r.level&&r.level!==_.level))return!0}function b(_){return _=_||{},_.rows=_.rows||_.limit||10,_.start=_.start||0,_.until=_.until||new Date,typeof _.until!="object"&&(_.until=new Date(_.until)),_.from=_.from||_.until-1440*60*1e3,typeof _.from!="object"&&(_.from=new Date(_.from)),_.order=_.order||"desc",_}}stream(r={}){let t=le.join(this.dirname,this.filename),n=new z0,i={file:t,start:r.start};return n.destroy=G0(i,(a,s)=>{if(a)return n.emit("error",a);try{n.emit("data",s),s=JSON.parse(s),n.emit("log",s)}catch(u){n.emit("error",u)}}),n}open(){this.filename&&(this._opening||(this._opening=!0,this.stat((r,t)=>{if(r)return this.emit("error",r);qe("stat done: %s { size: %s }",this.filename,t),this._size=t,this._dest=this._createStream(this._stream),this._opening=!1,this.once("open",()=>{this._stream.emit("rotate")||(this._rotate=!1)})})))}stat(r){let t=this._getFile(),n=le.join(this.dirname,t);Ee.stat(n,(i,a)=>{if(i&&i.code==="ENOENT")return qe("ENOENT\xA0ok",n),this.filename=t,r(null,0);if(i)return qe(`err ${i.code} ${n}`),r(i);if(!a||this._needsNewFile(a.size))return this._incFile(()=>this.stat(r));this.filename=t,r(null,a.size)})}close(r){this._stream&&this._stream.end(()=>{r&&r(),this.emit("flush"),this.emit("closed")})}_needsNewFile(r){return r=r||this._size,this.maxsize&&r>=this.maxsize}_onError(r){this.emit("error",r)}_setupStream(r){return r.on("error",this._onError),r}_cleanupStream(r){return r.removeListener("error",this._onError),r.destroy(),r}_rotateFile(){this._incFile(()=>this.open())}_endStream(r=()=>{}){this._dest?(this._stream.unpipe(this._dest),this._dest.end(()=>{this._cleanupStream(this._dest),r()})):r()}_createStream(r){let t=le.join(this.dirname,this.filename);qe("create stream start",t,this.options);let n=Ee.createWriteStream(t,this.options).on("error",i=>qe(i)).on("close",()=>qe("close",n.path,n.bytesWritten)).on("open",()=>{qe("file open ok",t),this.emit("open",t),r.pipe(n),this.rotatedWhileOpening&&(this._stream=new yd,this._stream.setMaxListeners(30),this._rotateFile(),this.rotatedWhileOpening=!1,this._cleanupStream(n),r.end())});return qe("create stream ok",t),n}_incFile(r){qe("_incFile",this.filename);let t=le.extname(this._basename),n=le.basename(this._basename,t),i=[];this.zippedArchive&&i.push(function(a){let s=this._created>0&&!this.tailable?this._created:"";this._compressFile(le.join(this.dirname,`${n}${s}${t}`),le.join(this.dirname,`${n}${s}${t}.gz`),a)}.bind(this)),i.push(function(a){this.tailable?this._checkMaxFilesTailable(t,n,a):(this._created+=1,this._checkMaxFilesIncrementing(t,n,a))}.bind(this)),md(i,r)}_getFile(){let r=le.extname(this._basename),t=le.basename(this._basename,r),n=this.rotationFormat?this.rotationFormat():this._created;return!this.tailable&&this._created?`${t}${n}${r}`:`${t}${r}`}_checkMaxFilesIncrementing(r,t,n){if(!this.maxFiles||this._created<this.maxFiles)return setImmediate(n);let i=this._created-this.maxFiles,a=i!==0?i:"",s=this.zippedArchive?".gz":"",u=`${t}${a}${r}${s}`,d=le.join(this.dirname,u);Ee.unlink(d,n)}_checkMaxFilesTailable(r,t,n){let i=[];if(!this.maxFiles)return;let a=this.zippedArchive?".gz":"";for(let s=this.maxFiles-1;s>1;s--)i.push(function(u,d){let h=`${t}${u-1}${r}${a}`,y=le.join(this.dirname,h);Ee.exists(y,b=>{if(!b)return d(null);h=`${t}${u}${r}${a}`,Ee.rename(y,le.join(this.dirname,h),d)})}.bind(this,s));md(i,()=>{Ee.rename(le.join(this.dirname,`${t}${r}${a}`),le.join(this.dirname,`${t}1${r}${a}`),n)})}_compressFile(r,t,n){Ee.access(r,Ee.F_OK,i=>{if(i)return n();var a=F0.createGzip(),s=Ee.createReadStream(r),u=Ee.createWriteStream(t);u.on("finish",()=>{Ee.unlink(r,n)}),s.pipe(a).pipe(u)})}_createLogDirIfNotExist(r){Ee.existsSync(r)||Ee.mkdirSync(r,{recursive:!0})}}});var wd=m((gO,_d)=>{"use strict";var W0=require("http"),Y0=require("https"),{Stream:V0}=Cr(),K0=ot(),{configure:J0}=Et();_d.exports=class extends K0{constructor(r={}){super(r),this.options=r,this.name=r.name||"http",this.ssl=!!r.ssl,this.host=r.host||"localhost",this.port=r.port,this.auth=r.auth,this.path=r.path||"",this.maximumDepth=r.maximumDepth,this.agent=r.agent,this.headers=r.headers||{},this.headers["content-type"]="application/json",this.batch=r.batch||!1,this.batchInterval=r.batchInterval||5e3,this.batchCount=r.batchCount||10,this.batchOptions=[],this.batchTimeoutID=-1,this.batchCallback={},this.port||(this.port=this.ssl?443:80)}log(r,t){this._request(r,null,null,(n,i)=>{i&&i.statusCode!==200&&(n=new Error(`Invalid HTTP Status Code: ${i.statusCode}`)),n?this.emit("warn",n):this.emit("logged",r)}),t&&setImmediate(t)}query(r,t){typeof r=="function"&&(t=r,r={}),r={method:"query",params:this.normalizeQuery(r)};let n=r.params.auth||null;delete r.params.auth;let i=r.params.path||null;delete r.params.path,this._request(r,n,i,(a,s,u)=>{if(s&&s.statusCode!==200&&(a=new Error(`Invalid HTTP Status Code: ${s.statusCode}`)),a)return t(a);if(typeof u=="string")try{u=JSON.parse(u)}catch(d){return t(d)}t(null,u)})}stream(r={}){let t=new V0;r={method:"stream",params:r};let n=r.params.path||null;delete r.params.path;let i=r.params.auth||null;delete r.params.auth;let a="",s=this._request(r,i,n);return t.destroy=()=>s.destroy(),s.on("data",u=>{u=(a+u).split(/\n+/);let d=u.length-1,h=0;for(;h<d;h++)try{t.emit("log",JSON.parse(u[h]))}catch(y){t.emit("error",y)}a=u[d]}),s.on("error",u=>t.emit("error",u)),t}_request(r,t,n,i){r=r||{},t=t||this.auth,n=n||this.path||"",this.batch?this._doBatch(r,i,t,n):this._doRequest(r,i,t,n)}_doBatch(r,t,n,i){if(this.batchOptions.push(r),this.batchOptions.length===1){let a=this;this.batchCallback=t,this.batchTimeoutID=setTimeout(function(){a.batchTimeoutID=-1,a._doBatchRequest(a.batchCallback,n,i)},this.batchInterval)}this.batchOptions.length===this.batchCount&&this._doBatchRequest(this.batchCallback,n,i)}_doBatchRequest(r,t,n){this.batchTimeoutID>0&&(clearTimeout(this.batchTimeoutID),this.batchTimeoutID=-1);let i=this.batchOptions.slice();this.batchOptions=[],this._doRequest(i,r,t,n)}_doRequest(r,t,n,i){let a=Object.assign({},this.headers);n&&n.bearer&&(a.Authorization=`Bearer ${n.bearer}`);let s=(this.ssl?Y0:W0).request({...this.options,method:"POST",host:this.host,port:this.port,path:`/${i.replace(/^\//,"")}`,headers:a,auth:n&&n.username&&n.password?`${n.username}:${n.password}`:"",agent:this.agent});s.on("error",t),s.on("response",d=>d.on("end",()=>t(null,d)).resume());let u=J0({...this.maximumDepth&&{maximumDepth:this.maximumDepth}});s.end(Buffer.from(u(r,this.options.replacer),"utf8"))}}});var Lo=m((mO,Ed)=>{"use strict";var ke=e=>e!==null&&typeof e=="object"&&typeof e.pipe=="function";ke.writable=e=>ke(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object";ke.readable=e=>ke(e)&&e.readable!==!1&&typeof e._read=="function"&&typeof e._readableState=="object";ke.duplex=e=>ke.writable(e)&&ke.readable(e);ke.transform=e=>ke.duplex(e)&&typeof e._transform=="function";Ed.exports=ke});var Od=m((vO,Sd)=>{"use strict";var Z0=Lo(),{MESSAGE:X0}=ae(),Q0=require("os"),e1=ot();Sd.exports=class extends e1{constructor(r={}){if(super(r),!r.stream||!Z0(r.stream))throw new Error("options.stream is required.");this._stream=r.stream,this._stream.setMaxListeners(1/0),this.isObjectMode=r.stream._writableState.objectMode,this.eol=typeof r.eol=="string"?r.eol:Q0.EOL}log(r,t){if(setImmediate(()=>this.emit("logged",r)),this.isObjectMode){this._stream.write(r),t&&t();return}this._stream.write(`${r[X0]}${this.eol}`),t&&t()}}});var Pd=m(zt=>{"use strict";Object.defineProperty(zt,"Console",{configurable:!0,enumerable:!0,get(){return Ac()}});Object.defineProperty(zt,"File",{configurable:!0,enumerable:!0,get(){return bd()}});Object.defineProperty(zt,"Http",{configurable:!0,enumerable:!0,get(){return wd()}});Object.defineProperty(zt,"Stream",{configurable:!0,enumerable:!0,get(){return Od()}})});var hi=m(Bt=>{"use strict";var pi=Ca(),{configs:qo}=ae();Bt.cli=pi.levels(qo.cli);Bt.npm=pi.levels(qo.npm);Bt.syslog=pi.levels(qo.syslog);Bt.addColors=pi.levels});var Td=m((gi,Ad)=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});var r1=Bn(),t1=qr(r1),n1=Qn(),i1=qr(n1),a1=vo(),o1=qr(a1),s1=go(),u1=qr(s1),l1=mo(),c1=qr(l1),f1=Dr(),d1=qr(f1),p1=ut(),h1=qr(p1);function qr(e){return e&&e.__esModule?e:{default:e}}function g1(e,r,t){t=(0,u1.default)(t);var n=0,i=0,{length:a}=e,s=!1;a===0&&t(null);function u(d,h){d===!1&&(s=!0),s!==!0&&(d?t(d):(++i===a||h===i1.default)&&t(null))}for(;n<a;n++)r(e[n],n,(0,c1.default)(u))}function m1(e,r,t){return(0,o1.default)(e,1/0,r,t)}function y1(e,r,t){var n=(0,t1.default)(e)?g1:m1;return n(e,(0,d1.default)(r),t)}gi.default=(0,h1.default)(y1,3);Ad.exports=gi.default});var xd=m((mi,Nd)=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.default=v1;function v1(e){return(r,t,n)=>e(r,n)}Nd.exports=mi.default});var bi=m((vi,Md)=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});var b1=Td(),_1=yi(b1),w1=xd(),E1=yi(w1),S1=Dr(),O1=yi(S1),P1=ut(),A1=yi(P1);function yi(e){return e&&e.__esModule?e:{default:e}}function T1(e,r,t){return(0,_1.default)(e,(0,E1.default)((0,O1.default)(r)),t)}vi.default=(0,A1.default)(T1,3);Md.exports=vi.default});var Id=m((wO,Rd)=>{"use strict";var N1=Object.prototype.toString;Rd.exports=function(r){if(typeof r.displayName=="string"&&r.constructor.name)return r.displayName;if(typeof r.name=="string"&&r.name)return r.name;if(typeof r=="object"&&r.constructor&&typeof r.constructor.name=="string")return r.constructor.name;var t=r.toString(),n=N1.call(r).slice(8,-1);return n==="Function"?t=t.substring(t.indexOf("(")+1,t.indexOf(")")):t=n,t||"anonymous"}});var $o=m((EO,Dd)=>{"use strict";var x1=Id();Dd.exports=function(r){var t=0,n;function i(){return t||(t=1,n=r.apply(this,arguments),r=null),n}return i.displayName=x1(r),i}});var Uo=m(Gt=>{Gt.get=function(e){var r=Error.stackTraceLimit;Error.stackTraceLimit=1/0;var t={},n=Error.prepareStackTrace;Error.prepareStackTrace=function(a,s){return s},Error.captureStackTrace(t,e||Gt.get);var i=t.stack;return Error.prepareStackTrace=n,Error.stackTraceLimit=r,i};Gt.parse=function(e){if(!e.stack)return[];var r=this,t=e.stack.split(`
52
+ `).slice(1);return t.map(function(n){if(n.match(/^\s*[-]{4,}$/))return r._createParsedCallSite({fileName:n,lineNumber:null,functionName:null,typeName:null,methodName:null,columnNumber:null,native:null});var i=n.match(/at (?:(.+)\s+\()?(?:(.+?):(\d+)(?::(\d+))?|([^)]+))\)?/);if(i){var a=null,s=null,u=null,d=null,h=null,y=i[5]==="native";if(i[1]){u=i[1];var b=u.lastIndexOf(".");if(u[b-1]=="."&&b--,b>0){a=u.substr(0,b),s=u.substr(b+1);var _=a.indexOf(".Module");_>0&&(u=u.substr(_+1),a=a.substr(0,_))}d=null}s&&(d=a,h=s),s==="<anonymous>"&&(h=null,u=null);var S={fileName:i[2]||null,lineNumber:parseInt(i[3],10)||null,functionName:u,typeName:d,methodName:h,columnNumber:parseInt(i[4],10)||null,native:y};return r._createParsedCallSite(S)}}).filter(function(n){return!!n})};function Ht(e){for(var r in e)this[r]=e[r]}var M1=["this","typeName","functionName","methodName","fileName","lineNumber","columnNumber","function","evalOrigin"],R1=["topLevel","eval","native","constructor"];M1.forEach(function(e){Ht.prototype[e]=null,Ht.prototype["get"+e[0].toUpperCase()+e.substr(1)]=function(){return this[e]}});R1.forEach(function(e){Ht.prototype[e]=!1,Ht.prototype["is"+e[0].toUpperCase()+e.substr(1)]=function(){return this[e]}});Gt._createParsedCallSite=function(e){return new Ht(e)}});var Ld=m((PO,Cd)=>{"use strict";var{Writable:I1}=Cr();Cd.exports=class extends I1{constructor(r){if(super({objectMode:!0}),!r)throw new Error("ExceptionStream requires a TransportStream instance.");this.handleExceptions=!0,this.transport=r}_write(r,t,n){return r.exception?this.transport.log(r,n):(n(),!0)}}});var Fo=m((TO,Ud)=>{"use strict";var qd=require("os"),D1=bi(),jo=kt()("winston:exception"),C1=$o(),$d=Uo(),L1=Ld();Ud.exports=class{constructor(r){if(!r)throw new Error("Logger is required to handle exceptions");this.logger=r,this.handlers=new Map}handle(...r){r.forEach(t=>{if(Array.isArray(t))return t.forEach(n=>this._addHandler(n));this._addHandler(t)}),this.catcher||(this.catcher=this._uncaughtException.bind(this),process.on("uncaughtException",this.catcher))}unhandle(){this.catcher&&(process.removeListener("uncaughtException",this.catcher),this.catcher=!1,Array.from(this.handlers.values()).forEach(r=>this.logger.unpipe(r)))}getAllInfo(r){let t=null;return r&&(t=typeof r=="string"?r:r.message),{error:r,level:"error",message:[`uncaughtException: ${t||"(no error message)"}`,r&&r.stack||" No stack trace"].join(`
53
+ `),stack:r&&r.stack,exception:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(r)}}getProcessInfo(){return{pid:process.pid,uid:process.getuid?process.getuid():null,gid:process.getgid?process.getgid():null,cwd:process.cwd(),execPath:process.execPath,version:process.version,argv:process.argv,memoryUsage:process.memoryUsage()}}getOsInfo(){return{loadavg:qd.loadavg(),uptime:qd.uptime()}}getTrace(r){return(r?$d.parse(r):$d.get()).map(n=>({column:n.getColumnNumber(),file:n.getFileName(),function:n.getFunctionName(),line:n.getLineNumber(),method:n.getMethodName(),native:n.isNative()}))}_addHandler(r){if(!this.handlers.has(r)){r.handleExceptions=!0;let t=new L1(r);this.handlers.set(r,t),this.logger.pipe(t)}}_uncaughtException(r){let t=this.getAllInfo(r),n=this._getExceptionHandlers(),i=typeof this.logger.exitOnError=="function"?this.logger.exitOnError(r):this.logger.exitOnError,a;!n.length&&i&&(console.warn("winston: exitOnError cannot be true with no exception handlers."),console.warn("winston: not exiting process."),i=!1);function s(){jo("doExit",i),jo("process._exiting",process._exiting),i&&!process._exiting&&(a&&clearTimeout(a),process.exit(1))}if(!n||n.length===0)return process.nextTick(s);D1(n,(u,d)=>{let h=C1(d),y=u.transport||u;function b(_){return()=>{jo(_),h()}}y._ending=!0,y.once("finish",b("finished")),y.once("error",b("error"))},()=>i&&s()),this.logger.log(t),i&&(a=setTimeout(s,3e3))}_getExceptionHandlers(){return this.logger.transports.filter(r=>(r.transport||r).handleExceptions)}}});var Fd=m((xO,jd)=>{"use strict";var{Writable:q1}=Cr();jd.exports=class extends q1{constructor(r){if(super({objectMode:!0}),!r)throw new Error("RejectionStream requires a TransportStream instance.");this.handleRejections=!0,this.transport=r}_write(r,t,n){return r.rejection?this.transport.log(r,n):(n(),!0)}}});var zo=m((RO,Bd)=>{"use strict";var kd=require("os"),$1=bi(),ko=kt()("winston:rejection"),U1=$o(),zd=Uo(),j1=Fd();Bd.exports=class{constructor(r){if(!r)throw new Error("Logger is required to handle rejections");this.logger=r,this.handlers=new Map}handle(...r){r.forEach(t=>{if(Array.isArray(t))return t.forEach(n=>this._addHandler(n));this._addHandler(t)}),this.catcher||(this.catcher=this._unhandledRejection.bind(this),process.on("unhandledRejection",this.catcher))}unhandle(){this.catcher&&(process.removeListener("unhandledRejection",this.catcher),this.catcher=!1,Array.from(this.handlers.values()).forEach(r=>this.logger.unpipe(r)))}getAllInfo(r){let t=null;return r&&(t=typeof r=="string"?r:r.message),{error:r,level:"error",message:[`unhandledRejection: ${t||"(no error message)"}`,r&&r.stack||" No stack trace"].join(`
54
+ `),stack:r&&r.stack,rejection:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(r)}}getProcessInfo(){return{pid:process.pid,uid:process.getuid?process.getuid():null,gid:process.getgid?process.getgid():null,cwd:process.cwd(),execPath:process.execPath,version:process.version,argv:process.argv,memoryUsage:process.memoryUsage()}}getOsInfo(){return{loadavg:kd.loadavg(),uptime:kd.uptime()}}getTrace(r){return(r?zd.parse(r):zd.get()).map(n=>({column:n.getColumnNumber(),file:n.getFileName(),function:n.getFunctionName(),line:n.getLineNumber(),method:n.getMethodName(),native:n.isNative()}))}_addHandler(r){if(!this.handlers.has(r)){r.handleRejections=!0;let t=new j1(r);this.handlers.set(r,t),this.logger.pipe(t)}}_unhandledRejection(r){let t=this.getAllInfo(r),n=this._getRejectionHandlers(),i=typeof this.logger.exitOnError=="function"?this.logger.exitOnError(r):this.logger.exitOnError,a;!n.length&&i&&(console.warn("winston: exitOnError cannot be true with no rejection handlers."),console.warn("winston: not exiting process."),i=!1);function s(){ko("doExit",i),ko("process._exiting",process._exiting),i&&!process._exiting&&(a&&clearTimeout(a),process.exit(1))}if(!n||n.length===0)return process.nextTick(s);$1(n,(u,d)=>{let h=U1(d),y=u.transport||u;function b(_){return()=>{ko(_),h()}}y._ending=!0,y.once("finish",b("finished")),y.once("error",b("error"))},()=>i&&s()),this.logger.log(t),i&&(a=setTimeout(s,3e3))}_getRejectionHandlers(){return this.logger.transports.filter(r=>(r.transport||r).handleRejections)}}});var Gd=m((IO,Hd)=>{"use strict";var Bo=class{constructor(r){let t=_i();if(typeof r!="object"||Array.isArray(r)||!(r instanceof t))throw new Error("Logger is required for profiling");this.logger=r,this.start=Date.now()}done(...r){typeof r[r.length-1]=="function"&&(console.warn("Callback function no longer supported as of winston@3.0.0"),r.pop());let t=typeof r[r.length-1]=="object"?r.pop():{};return t.level=t.level||"info",t.durationMs=Date.now()-this.start,this.logger.write(t)}};Hd.exports=Bo});var _i=m((DO,Kd)=>{"use strict";var{Stream:F1,Transform:k1}=Cr(),Wd=bi(),{LEVEL:ze,SPLAT:Yd}=ae(),Vd=Lo(),z1=Fo(),B1=zo(),H1=fo(),G1=Gd(),{warn:W1}=La(),Y1=hi(),V1=/%[scdjifoO%]/g,wi=class extends k1{constructor(r){super({objectMode:!0}),this.configure(r)}child(r){let t=this;return Object.create(t,{write:{value:function(n){let i=Object.assign({},r,n);n instanceof Error&&(i.stack=n.stack,i.message=n.message),t.write(i)}}})}configure({silent:r,format:t,defaultMeta:n,levels:i,level:a="info",exitOnError:s=!0,transports:u,colors:d,emitErrs:h,formatters:y,padLevels:b,rewriters:_,stripColors:S,exceptionHandlers:g,rejectionHandlers:w}={}){if(this.transports.length&&this.clear(),this.silent=r,this.format=t||this.format||xa()(),this.defaultMeta=n||null,this.levels=i||this.levels||Y1.npm.levels,this.level=a,this.exceptions&&this.exceptions.unhandle(),this.rejections&&this.rejections.unhandle(),this.exceptions=new z1(this),this.rejections=new B1(this),this.profilers={},this.exitOnError=s,u&&(u=Array.isArray(u)?u:[u],u.forEach(T=>this.add(T))),d||h||y||b||_||S)throw new Error(["{ colors, emitErrs, formatters, padLevels, rewriters, stripColors } were removed in winston@3.0.0.","Use a custom winston.format(function) instead.","See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md"].join(`
55
+ `));g&&this.exceptions.handle(g),w&&this.rejections.handle(w)}isLevelEnabled(r){let t=Ho(this.levels,r);if(t===null)return!1;let n=Ho(this.levels,this.level);return n===null?!1:!this.transports||this.transports.length===0?n>=t:this.transports.findIndex(a=>{let s=Ho(this.levels,a.level);return s===null&&(s=n),s>=t})!==-1}log(r,t,...n){if(arguments.length===1)return r[ze]=r.level,this._addDefaultMeta(r),this.write(r),this;if(arguments.length===2)return t&&typeof t=="object"?(t[ze]=t.level=r,this._addDefaultMeta(t),this.write(t),this):(t={[ze]:r,level:r,message:t},this._addDefaultMeta(t),this.write(t),this);let[i]=n;if(typeof i=="object"&&i!==null&&!(t&&t.match&&t.match(V1))){let s=Object.assign({},this.defaultMeta,i,{[ze]:r,[Yd]:n,level:r,message:t});return i.message&&(s.message=`${s.message} ${i.message}`),i.stack&&(s.stack=i.stack),i.cause&&(s.cause=i.cause),this.write(s),this}return this.write(Object.assign({},this.defaultMeta,{[ze]:r,[Yd]:n,level:r,message:t})),this}_transform(r,t,n){if(this.silent)return n();r[ze]||(r[ze]=r.level),!this.levels[r[ze]]&&this.levels[r[ze]]!==0&&console.error("[winston] Unknown logger level: %s",r[ze]),this._readableState.pipes||console.error("[winston] Attempt to write logs with no transports, which can increase memory usage: %j",r);try{this.push(this.format.transform(r,this.format.options))}finally{this._writableState.sync=!1,n()}}_final(r){let t=this.transports.slice();Wd(t,(n,i)=>{if(!n||n.finished)return setImmediate(i);n.once("finish",i),n.end()},r)}add(r){let t=!Vd(r)||r.log.length>2?new H1({transport:r}):r;if(!t._writableState||!t._writableState.objectMode)throw new Error("Transports must WritableStreams in objectMode. Set { objectMode: true }.");return this._onEvent("error",t),this._onEvent("warn",t),this.pipe(t),r.handleExceptions&&this.exceptions.handle(),r.handleRejections&&this.rejections.handle(),this}remove(r){if(!r)return this;let t=r;return(!Vd(r)||r.log.length>2)&&(t=this.transports.filter(n=>n.transport===r)[0]),t&&this.unpipe(t),this}clear(){return this.unpipe(),this}close(){return this.exceptions.unhandle(),this.rejections.unhandle(),this.clear(),this.emit("close"),this}setLevels(){W1.deprecated("setLevels")}query(r,t){typeof r=="function"&&(t=r,r={}),r=r||{};let n={},i=Object.assign({},r.query||{});function a(u,d){r.query&&typeof u.formatQuery=="function"&&(r.query=u.formatQuery(i)),u.query(r,(h,y)=>{if(h)return d(h);typeof u.formatResults=="function"&&(y=u.formatResults(y,r.format)),d(null,y)})}function s(u,d){a(u,(h,y)=>{d&&(y=h||y,y&&(n[u.name]=y),d()),d=null})}Wd(this.transports.filter(u=>!!u.query),s,()=>t(null,n))}stream(r={}){let t=new F1,n=[];return t._streams=n,t.destroy=()=>{let i=n.length;for(;i--;)n[i].destroy()},this.transports.filter(i=>!!i.stream).forEach(i=>{let a=i.stream(r);a&&(n.push(a),a.on("log",s=>{s.transport=s.transport||[],s.transport.push(i.name),t.emit("log",s)}),a.on("error",s=>{s.transport=s.transport||[],s.transport.push(i.name),t.emit("error",s)}))}),t}startTimer(){return new G1(this)}profile(r,...t){let n=Date.now();if(this.profilers[r]){let i=this.profilers[r];delete this.profilers[r],typeof t[t.length-2]=="function"&&(console.warn("Callback function no longer supported as of winston@3.0.0"),t.pop());let a=typeof t[t.length-1]=="object"?t.pop():{};return a.level=a.level||"info",a.durationMs=n-i,a.message=a.message||r,this.write(a)}return this.profilers[r]=n,this}handleExceptions(...r){console.warn("Deprecated: .handleExceptions() will be removed in winston@4. Use .exceptions.handle()"),this.exceptions.handle(...r)}unhandleExceptions(...r){console.warn("Deprecated: .unhandleExceptions() will be removed in winston@4. Use .exceptions.unhandle()"),this.exceptions.unhandle(...r)}cli(){throw new Error(["Logger.cli() was removed in winston@3.0.0","Use a custom winston.formats.cli() instead.","See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md"].join(`
56
+ `))}_onEvent(r,t){function n(i){r==="error"&&!this.transports.includes(t)&&this.add(t),this.emit(r,i,t)}t["__winston"+r]||(t["__winston"+r]=n.bind(this),t.on(r,t["__winston"+r]))}_addDefaultMeta(r){this.defaultMeta&&Object.assign(r,this.defaultMeta)}};function Ho(e,r){let t=e[r];return!t&&t!==0?null:t}Object.defineProperty(wi.prototype,"transports",{configurable:!1,enumerable:!0,get(){let{pipes:e}=this._readableState;return Array.isArray(e)?e:[e].filter(Boolean)}});Kd.exports=wi});var Go=m((CO,Jd)=>{"use strict";var{LEVEL:K1}=ae(),J1=hi(),Z1=_i(),X1=kt()("winston:create-logger");function Q1(e){return"is"+e.charAt(0).toUpperCase()+e.slice(1)+"Enabled"}Jd.exports=function(e={}){e.levels=e.levels||J1.npm.levels;class r extends Z1{constructor(i){super(i)}}let t=new r(e);return Object.keys(e.levels).forEach(function(n){if(X1('Define prototype method for "%s"',n),n==="log"){console.warn('Level "log" not defined: conflicts with the method "log". Use a different level name.');return}r.prototype[n]=function(...i){let a=this||t;if(i.length===1){let[s]=i,u=s&&s.message&&s||{message:s};return u.level=u[K1]=n,a._addDefaultMeta(u),a.write(u),this||t}return i.length===0?(a.log(n,""),a):a.log(n,...i)},r.prototype[Q1(n)]=function(){return(this||t).isLevelEnabled(n)}}),t}});var Xd=m((qO,Zd)=>{"use strict";var ew=Go();Zd.exports=class{constructor(r={}){this.loggers=new Map,this.options=r}add(r,t){if(!this.loggers.has(r)){t=Object.assign({},t||this.options);let n=t.transports||this.options.transports;n?t.transports=Array.isArray(n)?n.slice():[n]:t.transports=[];let i=ew(t);i.on("close",()=>this._delete(r)),this.loggers.set(r,i)}return this.loggers.get(r)}get(r,t){return this.add(r,t)}has(r){return!!this.loggers.has(r)}close(r){if(r)return this._removeLogger(r);this.loggers.forEach((t,n)=>this._removeLogger(n))}_removeLogger(r){if(!this.loggers.has(r))return;this.loggers.get(r).close(),this._delete(r)}_delete(r){this.loggers.delete(r)}}});var ep=m(J=>{"use strict";var Qd=Ca(),{warn:Wt}=La();J.version=Ol().version;J.transports=Pd();J.config=hi();J.addColors=Qd.levels;J.format=Qd.format;J.createLogger=Go();J.Logger=_i();J.ExceptionHandler=Fo();J.RejectionHandler=zo();J.Container=Xd();J.Transport=ot();J.loggers=new J.Container;var Be=J.createLogger();Object.keys(J.config.npm.levels).concat(["log","query","stream","add","remove","clear","profile","startTimer","handleExceptions","unhandleExceptions","handleRejections","unhandleRejections","configure","child"]).forEach(e=>J[e]=(...r)=>Be[e](...r));Object.defineProperty(J,"level",{get(){return Be.level},set(e){Be.level=e}});Object.defineProperty(J,"exceptions",{get(){return Be.exceptions}});Object.defineProperty(J,"rejections",{get(){return Be.rejections}});["exitOnError"].forEach(e=>{Object.defineProperty(J,e,{get(){return Be[e]},set(r){Be[e]=r}})});Object.defineProperty(J,"default",{get(){return{exceptionHandlers:Be.exceptionHandlers,rejectionHandlers:Be.rejectionHandlers,transports:Be.transports}}});Wt.deprecated(J,"setLevels");Wt.forFunctions(J,"useFormat",["cli"]);Wt.forProperties(J,"useFormat",["padLevels","stripColors"]);Wt.forFunctions(J,"deprecated",["addRewriter","addFilter","clone","extend"]);Wt.forProperties(J,"deprecated",["emitErrs","levelLength"])});var $r=m(X=>{"use strict";var ap=X&&X.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(X,"__esModule",{value:!0});X.logger=X.processNestedErrors=X.DEFAULT_LOG_LEVEL=X.LOG_LEVELS=void 0;var mr=ap(ep()),rw=ap(require("util")),rp=require("zod-validation-error");X.LOG_LEVELS=["debug","info","warn","error"];X.DEFAULT_LOG_LEVEL="info";function tp(e,r){let{combine:t,printf:n,timestamp:i}=mr.default.format,a="\x1B[0m",s="\x1B[32m",u="\x1B[33m",d="\x1B[31m",h=n(y=>{let{level:b,message:_,timestamp:S,...g}=y,w,T;switch(b){case"debug":w="d",T=w;break;case"info":w="i",T=e?w:`${s}${w}${a}`;break;case"warn":w="warn",T=e?w:`${u}${w}${a}`;break;case"error":w="error",T=e?w:`${d}${w}${a}`;break;default:w=`${b}:`,T=w}let D=" ".repeat(w.length+1),$=ip(_,r),P=g[Symbol.for("splat")]||[],L="";P.length>0&&(L=`
57
+ ${P.map(G=>ip(G,r)).join(`
58
+ `)}`);let z=$+L,Y=String(z).replace(/\n/g,`
59
59
  ${D}`);return e&&S?`${S} [${b.toUpperCase()}] ${Y}`:`${T} ${Y}
60
- `});return e?t(i({format:"YYYY-MM-DD HH:mm:ss"}),h):t(h)}function ew(e){return mr.default.format.printf(r=>{let{level:t,message:n,timestamp:i,...a}=r,s=(0,X.processNestedErrors)(n,e),d=(a[Symbol.for("splat")]||[]).map(y=>(0,X.processNestedErrors)(y,e)),h={timestamp:i||new Date().toISOString(),level:t.toUpperCase(),message:s};return d.length>0&&(d.length===1?h.meta=d[0]:h.meta=d),JSON.stringify(h,null,0)})}function ep(e,r){let t=[];for(let n of e)n.mode==="console"?t.push(new mr.default.transports.Console({format:Qd(!1,n.showErrorStack)})):n.mode==="file"?r?t.push(new mr.default.transports.File({filename:r,format:Qd(!0,n.showErrorStack),maxsize:10*1024*1024,maxFiles:5,tailable:!0})):console.warn("File output mode requested but no filename provided. Skipping file transport."):n.mode==="json"&&t.push(new mr.default.transports.Console({format:mr.default.format.combine(mr.default.format.timestamp(),ew(n.showErrorStack))}));return t}var rw=(e,r)=>{if(e==null)return e;if(e instanceof Error){let t={message:e.message};return r&&e.stack&&(t.stack=e.stack),(0,Xd.isZodErrorLike)(e)&&(t.message=(0,Xd.fromError)(e).message),Object.keys(e).forEach(n=>{n!=="name"&&n!=="message"&&n!=="stack"&&(t[n]=(0,X.processNestedErrors)(e[n],r))}),t.context&&(t.context=(0,X.processNestedErrors)(t.context,r)),t}if(Array.isArray(e))return e.map(t=>(0,X.processNestedErrors)(t,r));if(typeof e=="object"){let t={};for(let[n,i]of Object.entries(e))t[n]=(0,X.processNestedErrors)(i,r);return t}return e};X.processNestedErrors=rw;var rp=(e,r)=>{try{if(typeof e=="string")return e;let t=(0,X.processNestedErrors)(e,r);return Q1.default.inspect(t,{colors:!1,depth:null,compact:!1,maxArrayLength:null,maxStringLength:null,customInspect:!0})}catch{return String(e)}},Ho=class e{constructor(){this.currentConfig=[],this.debug=(r,...t)=>{this.winstonLogger.debug(r,...t)},this.info=(r,...t)=>{this.winstonLogger.info(r,...t)},this.warn=(r,...t)=>{this.winstonLogger.warn(r,...t)},this.error=(r,...t)=>{this.winstonLogger.error(r,...t)},this.std=r=>{console.log(typeof r=="object"?JSON.stringify(r,null,2):r)},this.setLevel=r=>{X.LOG_LEVELS.includes(r)?this.winstonLogger.level=r:(this.winstonLogger.warn(`Invalid log level: ${r}. Using '${X.DEFAULT_LOG_LEVEL}' as default.`),this.winstonLogger.level=X.DEFAULT_LOG_LEVEL)},this.getLevel=()=>this.winstonLogger.level,this.setOutputModes=(r,t)=>{let n=r.filter(a=>a.mode==="console"||a.mode==="file"||a.mode==="json");n.length===0&&this.winstonLogger.warn("No valid output modes provided."),this.currentConfig=n,this.winstonLogger.clear(),ep(n,t).forEach(a=>this.winstonLogger.add(a))},this.getOutputModes=()=>this.currentConfig,this.currentConfig=[{mode:"console",showErrorStack:!1}],this.winstonLogger=e.createWinstonLogger(this.currentConfig)}static createWinstonLogger(r){let t=ep(r);return mr.default.createLogger({exitOnError:!0,level:X.DEFAULT_LOG_LEVEL,transports:t})}},tw=new Ho;X.logger=tw});var Go=m(Ur=>{"use strict";Object.defineProperty(Ur,"__esModule",{value:!0});Ur.getIntroductoryOfferGroupingKey=ip;Ur.getIntroductoryOfferGroupingDescription=ap;Ur.validateIntroductoryOffersGrouping=iw;Ur.validateIntroductoryOffers=aw;Ur.validateIntroductoryOfferAppleRestrictions=ow;var Ei=ua(),nw=$r(),np=bt();function ip(e){return e.type==="PAY_AS_YOU_GO"?`${e.type}_${e.numberOfPeriods}`:`${e.type}_${e.duration}`}function ap(e){return e.type==="PAY_AS_YOU_GO"?`type '${e.type}' with numberOfPeriods '${e.numberOfPeriods}'`:`type '${e.type}' with duration '${e.duration}'`}function iw(e,r){let t=new Map;for(let n=0;n<e.length;n++){let i=e[n],a=ip(i),s=ap(i);if(t.has(a)){let u=t.get(a);u.count++,u.indices.push(n);let d=u.indices;if(d.length<2){nw.logger.error(`Logic error: Expected at least 2 duplicate indices, but found ${d.length} for ${s} in subscription '${r||"unknown"}'`);continue}let h=d[0],y=d[1],b=r?` in subscription '${r}'`:"";return{success:!1,error:`Duplicate introductory offers found with ${s}${b}. Items at indices ${h} and ${y} have the same grouping criteria.`}}else t.set(a,{count:1,indices:[n]})}return{success:!0}}function aw(e,r,t){if(!t)return;let n=new Map;for(let i of t){if(i.type==="FREE_TRIAL"||i.type==="PAY_UP_FRONT"){if(!(0,Ei.isValidIntroductoryOfferDuration)(r,i.type,i.duration)){let a=(0,Ei.getValidIntroductoryOfferDurations)(r,i.type);throw new np.ContextualError(`Invalid duration '${i.duration}' for ${i.type} offer in subscription '${e}' with period '${r}'.`,{subscriptionProductId:e,subscriptionPeriod:r,offer:i,validDurations:a})}}else if(i.type==="PAY_AS_YOU_GO"&&!(0,Ei.isValidPayAsYouGoPeriods)(r,i.numberOfPeriods)){let a=(0,Ei.getValidPayAsYouGoPeriods)(r);throw new np.ContextualError(`Invalid numberOfPeriods '${i.numberOfPeriods}' for PAY_AS_YOU_GO offer in subscription '${e}' with period '${r}'.`,{subscriptionProductId:e,subscriptionPeriod:r,offer:i,validPeriods:a})}for(let a of i.availableTerritories){if(n.has(a))throw new Error(`Multiple introductory offers found for territory '${a}' in subscription '${e}'. Only one offer per territory is allowed.`);n.set(a,i)}}}function ow(e,r,t){if(!t||t.length===0)return;let n=r.availability&&r.availability.availableTerritories&&r.availability.availableTerritories.length>0,i=r.pricing&&r.pricing.prices&&r.pricing.prices.length>0;if(!n||!i)throw new Error(`Cannot create introductory offers for subscription '${e}'. Apple requires subscriptions to have both availability and pricing before introductory offers can be created.`)}});var Pi=m(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.validateSubscriptionTerritoryPricing=sw;Oi.validateSubscription=uw;var Si=require("zod"),op=Go();function sw(e,r){let t=e.pricing?.prices||[],n=e.availability,i=e.introductoryOffers||[];if(e.pricing&&!n){r.addIssue({code:Si.z.ZodIssueCode.custom,message:`Subscription '${e.productId}' has pricing defined but no availability. You need to set up availabilities first.`,path:["availability"]});return}if(i.length>0&&t.length===0){r.addIssue({code:Si.z.ZodIssueCode.custom,message:`Subscription '${e.productId}' has introductory offers but no pricing defined. Apple requires subscription pricing to be set up before any introductory offers can be created.`,path:["pricing"]});return}}function uw(e,r){if(e.introductoryOffers&&e.introductoryOffers.length>0){let t=(0,op.validateIntroductoryOffersGrouping)(e.introductoryOffers,e.productId);t.success||r.addIssue({code:Si.z.ZodIssueCode.custom,message:t.error||"Introductory offers must have unique type+duration or type+numberOfPeriods combinations",path:["introductoryOffers"]})}try{(0,op.validateIntroductoryOffers)(e.productId,e.subscriptionPeriod,e.introductoryOffers)}catch(t){r.addIssue({code:Si.z.ZodIssueCode.custom,message:t instanceof Error?t.message:"Introductory offers validation failed",path:["introductoryOffers"]})}}});var Ti=m(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.AppStoreModelSchema=N.AppStoreLocalizationSchema=N.AppStoreAppInfoLocalizationSchema=N.AppStoreVersionLocalizationSchema=N.InAppPurchaseSchema=N.SubscriptionGroupSchema=N.SubscriptionSchema=N.PromotionalOfferSchema=N.IntroductoryOfferSchema=N.SubscriptionGroupLocalizationSchema=N.AvailabilitySchema=N.LocalizationSchema=N.PriceScheduleSchema=N.PriceSchema=N.AvailableTerritoriesSchema=N.SubscriptionOfferDurationSchema=N.SubscriptionPeriodSchema=N.APP_STORE_SCHEMA_VERSION=N.WORLDWIDE_TERRITORY_CODE=N.LocaleCodeSchema=N.TerritoryCodeSchema=void 0;var A=require("zod"),Ai=pn();Object.defineProperty(N,"TerritoryCodeSchema",{enumerable:!0,get:function(){return Ai.TerritoryCodeSchema}});var Yt=aa();Object.defineProperty(N,"LocaleCodeSchema",{enumerable:!0,get:function(){return Yt.LocaleCodeSchema}});var Wo=gn(),lw=Pi(),Je=$r();N.WORLDWIDE_TERRITORY_CODE="worldwide";var Vt=64,Yo=100;N.APP_STORE_SCHEMA_VERSION="1.0.0";N.SubscriptionPeriodSchema=A.z.enum(["ONE_WEEK","ONE_MONTH","TWO_MONTHS","THREE_MONTHS","SIX_MONTHS","ONE_YEAR"]);N.SubscriptionOfferDurationSchema=A.z.enum(["THREE_DAYS","ONE_WEEK","TWO_WEEKS","ONE_MONTH","TWO_MONTHS","THREE_MONTHS","SIX_MONTHS","ONE_YEAR"]);N.AvailableTerritoriesSchema=A.z.union([A.z.array(Ai.TerritoryCodeSchema),A.z.literal(N.WORLDWIDE_TERRITORY_CODE)]);N.PriceSchema=A.z.object({price:A.z.string(),territory:Ai.TerritoryCodeSchema});N.PriceScheduleSchema=A.z.object({baseTerritory:Ai.TerritoryCodeSchema,prices:A.z.array(N.PriceSchema)}).refine(e=>e.prices.some(r=>r.territory===e.baseTerritory),{message:"The base territory must have a corresponding price in the prices array",path:["prices"]});N.LocalizationSchema=A.z.object({locale:Yt.LocaleCodeSchema,name:A.z.string(),description:A.z.string()});N.AvailabilitySchema=A.z.object({availableInNewTerritories:A.z.boolean(),availableTerritories:N.AvailableTerritoriesSchema});N.SubscriptionGroupLocalizationSchema=A.z.object({locale:Yt.LocaleCodeSchema,name:A.z.string(),customName:A.z.string().optional().nullable()}).superRefine((e,r)=>{e.customName&&e.customName.length>Vt&&Je.logger.warn(`Warning: customName '${e.customName}' is ${e.customName.length} characters long, but should be at most 30 characters for optimal App Store display.`)});var cw=A.z.object({type:A.z.literal("PAY_AS_YOU_GO"),numberOfPeriods:A.z.number(),pricing:N.PriceScheduleSchema,availableTerritories:N.AvailableTerritoriesSchema}),fw=A.z.object({type:A.z.literal("PAY_UP_FRONT"),duration:N.SubscriptionOfferDurationSchema,pricing:N.PriceScheduleSchema,availableTerritories:N.AvailableTerritoriesSchema}),dw=A.z.object({type:A.z.literal("FREE_TRIAL"),duration:N.SubscriptionOfferDurationSchema,availableTerritories:N.AvailableTerritoriesSchema});N.IntroductoryOfferSchema=A.z.discriminatedUnion("type",[cw,fw,dw]);var pw=A.z.object({id:A.z.string(),referenceName:A.z.string(),type:A.z.literal("PAY_AS_YOU_GO"),numberOfPeriods:A.z.number(),pricing:N.PriceScheduleSchema}),hw=A.z.object({id:A.z.string(),referenceName:A.z.string(),type:A.z.literal("PAY_UP_FRONT"),duration:N.SubscriptionOfferDurationSchema,pricing:N.PriceScheduleSchema}),gw=A.z.object({id:A.z.string(),referenceName:A.z.string(),type:A.z.literal("FREE_TRIAL"),duration:N.SubscriptionOfferDurationSchema});N.PromotionalOfferSchema=A.z.discriminatedUnion("type",[pw,hw,gw]).superRefine((e,r)=>{e.referenceName.length>Vt&&Je.logger.warn(`Warning: referenceName '${e.referenceName}' is ${e.referenceName.length} characters long, but should be at most 60 characters for optimal App Store display.`),e.id.length>Yo&&Je.logger.warn(`Warning: productId '${e.id}' is ${e.id.length} characters long, but should be at most 100 characters for optimal App Store display.`)});N.SubscriptionSchema=A.z.object({productId:A.z.string().refine(Wo.isValidProductId,{message:"Product ID can only contain alphanumeric characters, underscores, and periods"}),referenceName:A.z.string(),groupLevel:A.z.number(),subscriptionPeriod:N.SubscriptionPeriodSchema,familySharable:A.z.boolean(),reviewNote:A.z.string().optional(),pricing:N.PriceScheduleSchema.optional(),introductoryOffers:A.z.array(N.IntroductoryOfferSchema).optional(),promotionalOffers:A.z.array(N.PromotionalOfferSchema).optional(),availability:N.AvailabilitySchema.optional(),localizations:A.z.array(N.LocalizationSchema).optional()}).superRefine((e,r)=>{e.productId.length>Yo&&Je.logger.warn(`Warning: productId '${e.productId}' is ${e.productId.length} characters long, but should be at most 100 characters for optimal App Store display.`),e.referenceName.length>Vt&&Je.logger.warn(`Warning: referenceName '${e.referenceName}' is ${e.referenceName.length} characters long, but should be at most 60 characters for optimal App Store display.`)}).superRefine(lw.validateSubscription);N.SubscriptionGroupSchema=A.z.object({referenceName:A.z.string(),localizations:A.z.array(N.SubscriptionGroupLocalizationSchema),subscriptions:A.z.array(N.SubscriptionSchema)}).superRefine((e,r)=>{e.referenceName.length>Vt&&Je.logger.warn(`Warning: referenceName '${e.referenceName}' is ${e.referenceName.length} characters long, but should be at most 60 characters for optimal App Store display.`)});N.InAppPurchaseSchema=A.z.object({productId:A.z.string().refine(Wo.isValidProductId,{message:"Product ID can only contain alphanumeric characters, underscores, and periods"}),type:A.z.enum(["CONSUMABLE","NON_CONSUMABLE","NON_RENEWING_SUBSCRIPTION"]),referenceName:A.z.string(),familySharable:A.z.boolean(),reviewNote:A.z.string().optional(),pricing:N.PriceScheduleSchema.optional(),availability:N.AvailabilitySchema.optional(),localizations:A.z.array(N.LocalizationSchema).optional()}).superRefine((e,r)=>{e.productId.length>Yo&&Je.logger.warn(`Warning: productId '${e.productId}' is ${e.productId.length} characters long, but should be at most 30 characters for optimal App Store display.`),e.referenceName.length>Vt&&Je.logger.warn(`Warning: referenceName '${e.referenceName}' is ${e.referenceName.length} characters long, but should be at most 60 characters for optimal App Store display.`)});N.AppStoreVersionLocalizationSchema=A.z.object({description:A.z.string().optional(),keywords:A.z.string().optional(),marketingUrl:A.z.string().url().optional(),promotionalText:A.z.string().optional(),supportUrl:A.z.string().url().optional(),whatsNew:A.z.string().optional()});N.AppStoreAppInfoLocalizationSchema=A.z.object({name:A.z.string().optional(),subtitle:A.z.string().optional(),privacyPolicyUrl:A.z.string().url().optional(),privacyChoicesUrl:A.z.string().url().optional()});N.AppStoreLocalizationSchema=A.z.object({locale:Yt.LocaleCodeSchema}).and(N.AppStoreAppInfoLocalizationSchema).and(N.AppStoreVersionLocalizationSchema).superRefine((e,r)=>{e.description&&e.description.length<10&&Je.logger.warn(`Warning: description for locale '${e.locale}' is ${e.description.length} characters long, but should be at least 10 characters.`)});N.AppStoreModelSchema=A.z.object({schemaVersion:A.z.string(),appId:A.z.string(),versionString:A.z.string().optional(),pricing:N.PriceScheduleSchema.optional(),availableTerritories:N.AvailableTerritoriesSchema.optional(),inAppPurchases:A.z.array(N.InAppPurchaseSchema).optional(),subscriptionGroups:A.z.array(N.SubscriptionGroupSchema).optional(),primaryLocale:Yt.LocaleCodeSchema.optional(),localizations:A.z.array(N.AppStoreLocalizationSchema).optional(),copyright:A.z.string().optional()}).superRefine(Wo.validateAppStoreModelData)});var up=m(sp=>{"use strict";Object.defineProperty(sp,"__esModule",{value:!0})});var dp=m(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.PricingRequestSchema=He.PricingItemSchema=He.PricePointInfoSchema=He.PricingStrategySchema=void 0;var Ae=require("zod"),lp=Ae.z.enum(["apple","purchasingPower"]);He.PricingStrategySchema=lp;var cp=Ae.z.object({id:Ae.z.string(),price:Ae.z.string()});He.PricePointInfoSchema=cp;var fp=Ae.z.object({type:Ae.z.enum(["app","inAppPurchase","subscription","offer"]),id:Ae.z.string(),name:Ae.z.string(),offerType:Ae.z.string().optional(),parentName:Ae.z.string().optional()});He.PricingItemSchema=fp;var mw=Ae.z.object({appId:Ae.z.string(),selectedItem:fp,basePricePoint:cp,pricingStrategy:lp,minimumPrice:Ae.z.string().optional()});He.PricingRequestSchema=mw});var hp=m(pp=>{"use strict";Object.defineProperty(pp,"__esModule",{value:!0})});var gp=m(Vo=>{"use strict";Object.defineProperty(Vo,"__esModule",{value:!0});Vo.validateAppStoreModel=Ew;var yw=require("zod"),vw=$r(),bw=Ti(),_w=Pi(),ww=bt();function Ew(e,r=!1,t="fetch"){let n=bw.AppStoreModelSchema.safeParse(e);if(n.success){if(t==="apply"&&n.data.subscriptionGroups)for(let i of n.data.subscriptionGroups)for(let a of i.subscriptions){let s=[],u={addIssue:d=>{s.push(d)},path:[],value:a,issues:s};if((0,_w.validateSubscriptionTerritoryPricing)(a,u),s.length>0)throw new yw.z.ZodError(s)}return r&&vw.logger.info("\u2705 Validation passed! The JSON file format and structure are valid."),n.data}else throw new ww.ContextualError(`\u274C Validation failed for '${t}'!`,n.error)}});var yp=m(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.useShortcuts=Ow;Mi.removeShortcuts=Tw;var Ni=pn(),Sw=gn(),mp=$r(),xi=Ti();function Ko(e){return e.toLowerCase()===xi.WORLDWIDE_TERRITORY_CODE.toLowerCase()}function Jo(e){return(0,Sw.deepEqualUnordered)(e,Ni.territoryCodes)}function Ow(e){if(!e||typeof e!="object")return e;let r=Zo(e);return r=Pw(r),r}function Zo(e){if(!e||typeof e!="object")return e;let r={...e};return r.availableTerritories&&Array.isArray(r.availableTerritories)&&Jo(r.availableTerritories)&&(r.availableTerritories=xi.WORLDWIDE_TERRITORY_CODE),r.availability&&typeof r.availability=="object"&&r.availability.availableTerritories&&Array.isArray(r.availability.availableTerritories)&&Jo(r.availability.availableTerritories)&&(r.availability.availableTerritories=xi.WORLDWIDE_TERRITORY_CODE),Array.isArray(r.introductoryOffers)&&(r.introductoryOffers=r.introductoryOffers.map(t=>{let n={...t};return n.availableTerritories&&Array.isArray(n.availableTerritories)&&Jo(n.availableTerritories)&&(n.availableTerritories=xi.WORLDWIDE_TERRITORY_CODE),n})),Array.isArray(r.inAppPurchases)&&(r.inAppPurchases=r.inAppPurchases.map(t=>Zo(t))),Array.isArray(r.subscriptionGroups)&&(r.subscriptionGroups=r.subscriptionGroups.map(t=>{let n={...t};return Array.isArray(n.subscriptions)&&(n.subscriptions=n.subscriptions.map(i=>Zo(i))),n})),r}function Pw(e){if(!e||typeof e!="object")return e;let r={...e};return Array.isArray(r.localizations)&&r.primaryLocale&&(r.localizations=Aw(r.localizations,r.primaryLocale)),r}function Aw(e,r){if(!r)return e;let t=e.find(i=>i.locale===r);if(!t)return e;let n=e.map(i=>{if(i.locale===r)return i;let a={locale:i.locale};return Object.keys(i).filter(u=>u!=="locale").forEach(u=>{let d=u;i[d]!==t[d]&&(a[d]=i[d])}),a});return mp.logger.debug(`Optimized ${e.length} localizations to avoid duplicates with primary locale: ${r}`),n}function Tw(e){if(!e||typeof e!="object")return e;let r=Nw(e);return r=Xo(r),r}function Xo(e){if(!e||typeof e!="object")return e;let r={...e};return r.availableTerritories&&typeof r.availableTerritories=="string"&&Ko(r.availableTerritories)&&(r.availableTerritories=[...Ni.territoryCodes]),r.availability&&typeof r.availability=="object"&&r.availability.availableTerritories&&typeof r.availability.availableTerritories=="string"&&Ko(r.availability.availableTerritories)&&(r.availability.availableTerritories=[...Ni.territoryCodes]),Array.isArray(r.introductoryOffers)&&(r.introductoryOffers=r.introductoryOffers.map(t=>{let n={...t};return n.availableTerritories&&typeof n.availableTerritories=="string"&&Ko(n.availableTerritories)&&(n.availableTerritories=[...Ni.territoryCodes]),n})),Array.isArray(r.inAppPurchases)&&(r.inAppPurchases=r.inAppPurchases.map(t=>Xo(t))),Array.isArray(r.subscriptionGroups)&&(r.subscriptionGroups=r.subscriptionGroups.map(t=>{let n={...t};return Array.isArray(n.subscriptions)&&(n.subscriptions=n.subscriptions.map(i=>Xo(i))),n})),r}function Nw(e){if(!e||typeof e!="object")return e;let r={...e};return Array.isArray(r.localizations)&&r.primaryLocale&&(r.localizations=xw(r.localizations,r.primaryLocale)),r}function xw(e,r){if(!r)return e;let t=e.find(i=>i.locale===r);if(!t)return e;let n=e.map(i=>{if(i.locale===r)return i;let a={...t,locale:i.locale};return Object.keys(i).forEach(s=>{if(s!=="locale"){let u=s;a[u]=i[u]}}),a});return mp.logger.debug(`Deoptimized ${e.length} localizations to restore full data with primary locale: ${r}`),n}});var Qo=m(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.DEFAULT_CONFIG_FILENAME=ft.BASE_TERRITORY=void 0;ft.BASE_TERRITORY="USA";ft.DEFAULT_CONFIG_FILENAME="storeconfig.json"});var vp=m(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.collectPricingItems=Mw;function Mw(e){let r=[];return r.push({type:"app",id:e.appId,name:"App"}),e.inAppPurchases&&e.inAppPurchases.forEach(t=>{r.push({type:"inAppPurchase",id:t.productId,name:t.referenceName})}),e.subscriptionGroups&&e.subscriptionGroups.forEach(t=>{t.subscriptions.forEach(n=>{r.push({type:"subscription",id:n.productId,name:n.referenceName}),n.introductoryOffers&&n.introductoryOffers.filter(i=>i.type!=="FREE_TRIAL").forEach(i=>{r.push({type:"offer",id:n.productId,name:`${i.type} Introductory Offer`,offerType:i.type,parentName:n.referenceName})}),n.promotionalOffers&&n.promotionalOffers.filter(i=>i.type!=="FREE_TRIAL").forEach(i=>{r.push({type:"offer",id:i.id,name:`${i.type} Promotional Offer`,offerType:i.type,parentName:n.referenceName})})})}),r}});var Ep=m(Ze=>{"use strict";var Rw=Ze&&Ze.__createBinding||(Object.create?(function(e,r,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(r,t);(!i||("get"in i?!r.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,n,i)}):(function(e,r,t,n){n===void 0&&(n=t),e[n]=r[t]})),Iw=Ze&&Ze.__setModuleDefault||(Object.create?(function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}):function(e,r){e.default=r}),wp=Ze&&Ze.__importStar||(function(){var e=function(r){return e=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},e(r)};return function(r){if(r&&r.__esModule)return r;var t={};if(r!=null)for(var n=e(r),i=0;i<n.length;i++)n[i]!=="default"&&Rw(t,r,n[i]);return Iw(t,r),t}})();Object.defineProperty(Ze,"__esModule",{value:!0});Ze.validateFileExists=Lw;var Dw=wp(require("fs")),bp=wp(require("path")),_p=$r(),Cw=Qo();function Lw(e,r={}){let{defaultFilename:t=Cw.DEFAULT_CONFIG_FILENAME,fileDescription:n="JSON file",resolution:i=`Please either:
60
+ `});return e?t(i({format:"YYYY-MM-DD HH:mm:ss"}),h):t(h)}function tw(e){return mr.default.format.printf(r=>{let{level:t,message:n,timestamp:i,...a}=r,s=(0,X.processNestedErrors)(n,e),d=(a[Symbol.for("splat")]||[]).map(y=>(0,X.processNestedErrors)(y,e)),h={timestamp:i||new Date().toISOString(),level:t.toUpperCase(),message:s};return d.length>0&&(d.length===1?h.meta=d[0]:h.meta=d),JSON.stringify(h,null,0)})}function np(e,r){let t=[];for(let n of e)n.mode==="console"?t.push(new mr.default.transports.Console({format:tp(!1,n.showErrorStack)})):n.mode==="file"?r?t.push(new mr.default.transports.File({filename:r,format:tp(!0,n.showErrorStack),maxsize:10*1024*1024,maxFiles:5,tailable:!0})):console.warn("File output mode requested but no filename provided. Skipping file transport."):n.mode==="json"&&t.push(new mr.default.transports.Console({format:mr.default.format.combine(mr.default.format.timestamp(),tw(n.showErrorStack))}));return t}var nw=(e,r)=>{if(e==null)return e;if(e instanceof Error){let t={message:e.message};return r&&e.stack&&(t.stack=e.stack),(0,rp.isZodErrorLike)(e)&&(t.message=(0,rp.fromError)(e).message),Object.keys(e).forEach(n=>{n!=="name"&&n!=="message"&&n!=="stack"&&(t[n]=(0,X.processNestedErrors)(e[n],r))}),t.context&&(t.context=(0,X.processNestedErrors)(t.context,r)),t}if(Array.isArray(e))return e.map(t=>(0,X.processNestedErrors)(t,r));if(typeof e=="object"){let t={};for(let[n,i]of Object.entries(e))t[n]=(0,X.processNestedErrors)(i,r);return t}return e};X.processNestedErrors=nw;var ip=(e,r)=>{try{if(typeof e=="string")return e;let t=(0,X.processNestedErrors)(e,r);return rw.default.inspect(t,{colors:!1,depth:null,compact:!1,maxArrayLength:null,maxStringLength:null,customInspect:!0})}catch{return String(e)}},Wo=class e{constructor(){this.currentConfig=[],this.debug=(r,...t)=>{this.winstonLogger.debug(r,...t)},this.info=(r,...t)=>{this.winstonLogger.info(r,...t)},this.warn=(r,...t)=>{this.winstonLogger.warn(r,...t)},this.error=(r,...t)=>{this.winstonLogger.error(r,...t)},this.std=r=>{console.log(typeof r=="object"?JSON.stringify(r,null,2):r)},this.setLevel=r=>{X.LOG_LEVELS.includes(r)?this.winstonLogger.level=r:(this.winstonLogger.warn(`Invalid log level: ${r}. Using '${X.DEFAULT_LOG_LEVEL}' as default.`),this.winstonLogger.level=X.DEFAULT_LOG_LEVEL)},this.getLevel=()=>this.winstonLogger.level,this.setOutputModes=(r,t)=>{let n=r.filter(a=>a.mode==="console"||a.mode==="file"||a.mode==="json");n.length===0&&this.winstonLogger.warn("No valid output modes provided."),this.currentConfig=n,this.winstonLogger.clear(),np(n,t).forEach(a=>this.winstonLogger.add(a))},this.getOutputModes=()=>this.currentConfig,this.currentConfig=[{mode:"console",showErrorStack:!1}],this.winstonLogger=e.createWinstonLogger(this.currentConfig)}static createWinstonLogger(r){let t=np(r);return mr.default.createLogger({exitOnError:!0,level:X.DEFAULT_LOG_LEVEL,transports:t})}},iw=new Wo;X.logger=iw});var Yo=m(Ur=>{"use strict";Object.defineProperty(Ur,"__esModule",{value:!0});Ur.getIntroductoryOfferGroupingKey=sp;Ur.getIntroductoryOfferGroupingDescription=up;Ur.validateIntroductoryOffersGrouping=ow;Ur.validateIntroductoryOffers=sw;Ur.validateIntroductoryOfferAppleRestrictions=uw;var Ei=ca(),aw=$r(),op=bt();function sp(e){return e.type==="PAY_AS_YOU_GO"?`${e.type}_${e.numberOfPeriods}`:`${e.type}_${e.duration}`}function up(e){return e.type==="PAY_AS_YOU_GO"?`type '${e.type}' with numberOfPeriods '${e.numberOfPeriods}'`:`type '${e.type}' with duration '${e.duration}'`}function ow(e,r){let t=new Map;for(let n=0;n<e.length;n++){let i=e[n],a=sp(i),s=up(i);if(t.has(a)){let u=t.get(a);u.count++,u.indices.push(n);let d=u.indices;if(d.length<2){aw.logger.error(`Logic error: Expected at least 2 duplicate indices, but found ${d.length} for ${s} in subscription '${r||"unknown"}'`);continue}let h=d[0],y=d[1],b=r?` in subscription '${r}'`:"";return{success:!1,error:`Duplicate introductory offers found with ${s}${b}. Items at indices ${h} and ${y} have the same grouping criteria.`}}else t.set(a,{count:1,indices:[n]})}return{success:!0}}function sw(e,r,t){if(!t)return;let n=new Map;for(let i of t){if(i.type==="FREE_TRIAL"||i.type==="PAY_UP_FRONT"){if(!(0,Ei.isValidIntroductoryOfferDuration)(r,i.type,i.duration)){let a=(0,Ei.getValidIntroductoryOfferDurations)(r,i.type);throw new op.ContextualError(`Invalid duration '${i.duration}' for ${i.type} offer in subscription '${e}' with period '${r}'.`,{subscriptionProductId:e,subscriptionPeriod:r,offer:i,validDurations:a})}}else if(i.type==="PAY_AS_YOU_GO"&&!(0,Ei.isValidPayAsYouGoPeriods)(r,i.numberOfPeriods)){let a=(0,Ei.getValidPayAsYouGoPeriods)(r);throw new op.ContextualError(`Invalid numberOfPeriods '${i.numberOfPeriods}' for PAY_AS_YOU_GO offer in subscription '${e}' with period '${r}'.`,{subscriptionProductId:e,subscriptionPeriod:r,offer:i,validPeriods:a})}for(let a of i.availableTerritories){if(n.has(a))throw new Error(`Multiple introductory offers found for territory '${a}' in subscription '${e}'. Only one offer per territory is allowed.`);n.set(a,i)}}}function uw(e,r,t){if(!t||t.length===0)return;let n=r.availability&&r.availability.availableTerritories&&r.availability.availableTerritories.length>0,i=r.pricing&&r.pricing.prices&&r.pricing.prices.length>0;if(!n||!i)throw new Error(`Cannot create introductory offers for subscription '${e}'. Apple requires subscriptions to have both availability and pricing before introductory offers can be created.`)}});var Pi=m(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.validateSubscriptionTerritoryPricing=lw;Oi.validateSubscription=cw;var Si=require("zod"),lp=Yo();function lw(e,r){let t=e.pricing?.prices||[],n=e.availability,i=e.introductoryOffers||[];if(e.pricing&&!n){r.addIssue({code:Si.z.ZodIssueCode.custom,message:`Subscription '${e.productId}' has pricing defined but no availability. You need to set up availabilities first.`,path:["availability"]});return}if(i.length>0&&t.length===0){r.addIssue({code:Si.z.ZodIssueCode.custom,message:`Subscription '${e.productId}' has introductory offers but no pricing defined. Apple requires subscription pricing to be set up before any introductory offers can be created.`,path:["pricing"]});return}}function cw(e,r){if(e.introductoryOffers&&e.introductoryOffers.length>0){let t=(0,lp.validateIntroductoryOffersGrouping)(e.introductoryOffers,e.productId);t.success||r.addIssue({code:Si.z.ZodIssueCode.custom,message:t.error||"Introductory offers must have unique type+duration or type+numberOfPeriods combinations",path:["introductoryOffers"]})}try{(0,lp.validateIntroductoryOffers)(e.productId,e.subscriptionPeriod,e.introductoryOffers)}catch(t){r.addIssue({code:Si.z.ZodIssueCode.custom,message:t instanceof Error?t.message:"Introductory offers validation failed",path:["introductoryOffers"]})}}});var Ti=m(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.AppStoreModelSchema=N.AppStoreLocalizationSchema=N.AppStoreAppInfoLocalizationSchema=N.AppStoreVersionLocalizationSchema=N.InAppPurchaseSchema=N.SubscriptionGroupSchema=N.SubscriptionSchema=N.PromotionalOfferSchema=N.IntroductoryOfferSchema=N.SubscriptionGroupLocalizationSchema=N.AvailabilitySchema=N.LocalizationSchema=N.PriceScheduleSchema=N.PriceSchema=N.AvailableTerritoriesSchema=N.SubscriptionOfferDurationSchema=N.SubscriptionPeriodSchema=N.APP_STORE_SCHEMA_VERSION=N.WORLDWIDE_TERRITORY_CODE=N.LocaleCodeSchema=N.TerritoryCodeSchema=void 0;var A=require("zod"),Ai=pn();Object.defineProperty(N,"TerritoryCodeSchema",{enumerable:!0,get:function(){return Ai.TerritoryCodeSchema}});var Yt=sa();Object.defineProperty(N,"LocaleCodeSchema",{enumerable:!0,get:function(){return Yt.LocaleCodeSchema}});var Vo=gn(),fw=Pi(),Je=$r();N.WORLDWIDE_TERRITORY_CODE="worldwide";var Vt=64,Ko=100;N.APP_STORE_SCHEMA_VERSION="1.0.0";N.SubscriptionPeriodSchema=A.z.enum(["ONE_WEEK","ONE_MONTH","TWO_MONTHS","THREE_MONTHS","SIX_MONTHS","ONE_YEAR"]);N.SubscriptionOfferDurationSchema=A.z.enum(["THREE_DAYS","ONE_WEEK","TWO_WEEKS","ONE_MONTH","TWO_MONTHS","THREE_MONTHS","SIX_MONTHS","ONE_YEAR"]);N.AvailableTerritoriesSchema=A.z.union([A.z.array(Ai.TerritoryCodeSchema),A.z.literal(N.WORLDWIDE_TERRITORY_CODE)]);N.PriceSchema=A.z.object({price:A.z.string(),territory:Ai.TerritoryCodeSchema});N.PriceScheduleSchema=A.z.object({baseTerritory:Ai.TerritoryCodeSchema,prices:A.z.array(N.PriceSchema)}).refine(e=>e.prices.some(r=>r.territory===e.baseTerritory),{message:"The base territory must have a corresponding price in the prices array",path:["prices"]});N.LocalizationSchema=A.z.object({locale:Yt.LocaleCodeSchema,name:A.z.string(),description:A.z.string()});N.AvailabilitySchema=A.z.object({availableInNewTerritories:A.z.boolean(),availableTerritories:N.AvailableTerritoriesSchema});N.SubscriptionGroupLocalizationSchema=A.z.object({locale:Yt.LocaleCodeSchema,name:A.z.string(),customName:A.z.string().optional().nullable()}).superRefine((e,r)=>{e.customName&&e.customName.length>Vt&&Je.logger.warn(`Warning: customName '${e.customName}' is ${e.customName.length} characters long, but should be at most 30 characters for optimal App Store display.`)});var dw=A.z.object({type:A.z.literal("PAY_AS_YOU_GO"),numberOfPeriods:A.z.number(),pricing:N.PriceScheduleSchema,availableTerritories:N.AvailableTerritoriesSchema}),pw=A.z.object({type:A.z.literal("PAY_UP_FRONT"),duration:N.SubscriptionOfferDurationSchema,pricing:N.PriceScheduleSchema,availableTerritories:N.AvailableTerritoriesSchema}),hw=A.z.object({type:A.z.literal("FREE_TRIAL"),duration:N.SubscriptionOfferDurationSchema,availableTerritories:N.AvailableTerritoriesSchema});N.IntroductoryOfferSchema=A.z.discriminatedUnion("type",[dw,pw,hw]);var gw=A.z.object({id:A.z.string(),referenceName:A.z.string(),type:A.z.literal("PAY_AS_YOU_GO"),numberOfPeriods:A.z.number(),pricing:N.PriceScheduleSchema}),mw=A.z.object({id:A.z.string(),referenceName:A.z.string(),type:A.z.literal("PAY_UP_FRONT"),duration:N.SubscriptionOfferDurationSchema,pricing:N.PriceScheduleSchema}),yw=A.z.object({id:A.z.string(),referenceName:A.z.string(),type:A.z.literal("FREE_TRIAL"),duration:N.SubscriptionOfferDurationSchema});N.PromotionalOfferSchema=A.z.discriminatedUnion("type",[gw,mw,yw]).superRefine((e,r)=>{e.referenceName.length>Vt&&Je.logger.warn(`Warning: referenceName '${e.referenceName}' is ${e.referenceName.length} characters long, but should be at most 60 characters for optimal App Store display.`),e.id.length>Ko&&Je.logger.warn(`Warning: productId '${e.id}' is ${e.id.length} characters long, but should be at most 100 characters for optimal App Store display.`)});N.SubscriptionSchema=A.z.object({productId:A.z.string().refine(Vo.isValidProductId,{message:"Product ID can only contain alphanumeric characters, underscores, and periods"}),referenceName:A.z.string(),groupLevel:A.z.number(),subscriptionPeriod:N.SubscriptionPeriodSchema,familySharable:A.z.boolean(),reviewNote:A.z.string().optional(),pricing:N.PriceScheduleSchema.optional(),introductoryOffers:A.z.array(N.IntroductoryOfferSchema).optional(),promotionalOffers:A.z.array(N.PromotionalOfferSchema).optional(),availability:N.AvailabilitySchema.optional(),localizations:A.z.array(N.LocalizationSchema).optional()}).superRefine((e,r)=>{e.productId.length>Ko&&Je.logger.warn(`Warning: productId '${e.productId}' is ${e.productId.length} characters long, but should be at most 100 characters for optimal App Store display.`),e.referenceName.length>Vt&&Je.logger.warn(`Warning: referenceName '${e.referenceName}' is ${e.referenceName.length} characters long, but should be at most 60 characters for optimal App Store display.`)}).superRefine(fw.validateSubscription);N.SubscriptionGroupSchema=A.z.object({referenceName:A.z.string(),localizations:A.z.array(N.SubscriptionGroupLocalizationSchema),subscriptions:A.z.array(N.SubscriptionSchema)}).superRefine((e,r)=>{e.referenceName.length>Vt&&Je.logger.warn(`Warning: referenceName '${e.referenceName}' is ${e.referenceName.length} characters long, but should be at most 60 characters for optimal App Store display.`)});N.InAppPurchaseSchema=A.z.object({productId:A.z.string().refine(Vo.isValidProductId,{message:"Product ID can only contain alphanumeric characters, underscores, and periods"}),type:A.z.enum(["CONSUMABLE","NON_CONSUMABLE","NON_RENEWING_SUBSCRIPTION"]),referenceName:A.z.string(),familySharable:A.z.boolean(),reviewNote:A.z.string().optional(),pricing:N.PriceScheduleSchema.optional(),availability:N.AvailabilitySchema.optional(),localizations:A.z.array(N.LocalizationSchema).optional()}).superRefine((e,r)=>{e.productId.length>Ko&&Je.logger.warn(`Warning: productId '${e.productId}' is ${e.productId.length} characters long, but should be at most 30 characters for optimal App Store display.`),e.referenceName.length>Vt&&Je.logger.warn(`Warning: referenceName '${e.referenceName}' is ${e.referenceName.length} characters long, but should be at most 60 characters for optimal App Store display.`)});N.AppStoreVersionLocalizationSchema=A.z.object({description:A.z.string().optional(),keywords:A.z.string().optional(),marketingUrl:A.z.string().url().optional(),promotionalText:A.z.string().optional(),supportUrl:A.z.string().url().optional(),whatsNew:A.z.string().optional()});N.AppStoreAppInfoLocalizationSchema=A.z.object({name:A.z.string().optional(),subtitle:A.z.string().optional(),privacyPolicyUrl:A.z.string().url().optional(),privacyChoicesUrl:A.z.string().url().optional()});N.AppStoreLocalizationSchema=A.z.object({locale:Yt.LocaleCodeSchema}).and(N.AppStoreAppInfoLocalizationSchema).and(N.AppStoreVersionLocalizationSchema).superRefine((e,r)=>{e.description&&e.description.length<10&&Je.logger.warn(`Warning: description for locale '${e.locale}' is ${e.description.length} characters long, but should be at least 10 characters.`)});N.AppStoreModelSchema=A.z.object({schemaVersion:A.z.string(),appId:A.z.string(),versionString:A.z.string().optional(),pricing:N.PriceScheduleSchema.optional(),availableTerritories:N.AvailableTerritoriesSchema.optional(),inAppPurchases:A.z.array(N.InAppPurchaseSchema).optional(),subscriptionGroups:A.z.array(N.SubscriptionGroupSchema).optional(),primaryLocale:Yt.LocaleCodeSchema.optional(),localizations:A.z.array(N.AppStoreLocalizationSchema).optional(),copyright:A.z.string().optional()}).superRefine(Vo.validateAppStoreModelData)});var fp=m(cp=>{"use strict";Object.defineProperty(cp,"__esModule",{value:!0})});var gp=m(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.PricingRequestSchema=He.PricingItemSchema=He.PricePointInfoSchema=He.PricingStrategySchema=void 0;var Ae=require("zod"),dp=Ae.z.enum(["apple","purchasingPower"]);He.PricingStrategySchema=dp;var pp=Ae.z.object({id:Ae.z.string(),price:Ae.z.string()});He.PricePointInfoSchema=pp;var hp=Ae.z.object({type:Ae.z.enum(["app","inAppPurchase","subscription","offer"]),id:Ae.z.string(),name:Ae.z.string(),offerType:Ae.z.string().optional(),parentName:Ae.z.string().optional()});He.PricingItemSchema=hp;var vw=Ae.z.object({appId:Ae.z.string(),selectedItem:hp,basePricePoint:pp,pricingStrategy:dp,minimumPrice:Ae.z.string().optional()});He.PricingRequestSchema=vw});var yp=m(mp=>{"use strict";Object.defineProperty(mp,"__esModule",{value:!0})});var vp=m(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});Jo.validateAppStoreModel=Ow;var bw=require("zod"),_w=$r(),ww=Ti(),Ew=Pi(),Sw=bt();function Ow(e,r=!1,t="fetch"){let n=ww.AppStoreModelSchema.safeParse(e);if(n.success){if(t==="apply"&&n.data.subscriptionGroups)for(let i of n.data.subscriptionGroups)for(let a of i.subscriptions){let s=[],u={addIssue:d=>{s.push(d)},path:[],value:a,issues:s};if((0,Ew.validateSubscriptionTerritoryPricing)(a,u),s.length>0)throw new bw.z.ZodError(s)}return r&&_w.logger.info("\u2705 Validation passed! The JSON file format and structure are valid."),n.data}else throw new Sw.ContextualError(`\u274C Validation failed for '${t}'!`,n.error)}});var _p=m(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.useShortcuts=Aw;Mi.removeShortcuts=xw;var Ni=pn(),Pw=gn(),bp=$r(),xi=Ti();function Zo(e){return e.toLowerCase()===xi.WORLDWIDE_TERRITORY_CODE.toLowerCase()}function Xo(e){return(0,Pw.deepEqualUnordered)(e,Ni.territoryCodes)}function Aw(e){if(!e||typeof e!="object")return e;let r=Qo(e);return r=Tw(r),r}function Qo(e){if(!e||typeof e!="object")return e;let r={...e};return r.availableTerritories&&Array.isArray(r.availableTerritories)&&Xo(r.availableTerritories)&&(r.availableTerritories=xi.WORLDWIDE_TERRITORY_CODE),r.availability&&typeof r.availability=="object"&&r.availability.availableTerritories&&Array.isArray(r.availability.availableTerritories)&&Xo(r.availability.availableTerritories)&&(r.availability.availableTerritories=xi.WORLDWIDE_TERRITORY_CODE),Array.isArray(r.introductoryOffers)&&(r.introductoryOffers=r.introductoryOffers.map(t=>{let n={...t};return n.availableTerritories&&Array.isArray(n.availableTerritories)&&Xo(n.availableTerritories)&&(n.availableTerritories=xi.WORLDWIDE_TERRITORY_CODE),n})),Array.isArray(r.inAppPurchases)&&(r.inAppPurchases=r.inAppPurchases.map(t=>Qo(t))),Array.isArray(r.subscriptionGroups)&&(r.subscriptionGroups=r.subscriptionGroups.map(t=>{let n={...t};return Array.isArray(n.subscriptions)&&(n.subscriptions=n.subscriptions.map(i=>Qo(i))),n})),r}function Tw(e){if(!e||typeof e!="object")return e;let r={...e};return Array.isArray(r.localizations)&&r.primaryLocale&&(r.localizations=Nw(r.localizations,r.primaryLocale)),r}function Nw(e,r){if(!r)return e;let t=e.find(i=>i.locale===r);if(!t)return e;let n=e.map(i=>{if(i.locale===r)return i;let a={locale:i.locale};return Object.keys(i).filter(u=>u!=="locale").forEach(u=>{let d=u;i[d]!==t[d]&&(a[d]=i[d])}),a});return bp.logger.debug(`Optimized ${e.length} localizations to avoid duplicates with primary locale: ${r}`),n}function xw(e){if(!e||typeof e!="object")return e;let r=Mw(e);return r=es(r),r}function es(e){if(!e||typeof e!="object")return e;let r={...e};return r.availableTerritories&&typeof r.availableTerritories=="string"&&Zo(r.availableTerritories)&&(r.availableTerritories=[...Ni.territoryCodes]),r.availability&&typeof r.availability=="object"&&r.availability.availableTerritories&&typeof r.availability.availableTerritories=="string"&&Zo(r.availability.availableTerritories)&&(r.availability.availableTerritories=[...Ni.territoryCodes]),Array.isArray(r.introductoryOffers)&&(r.introductoryOffers=r.introductoryOffers.map(t=>{let n={...t};return n.availableTerritories&&typeof n.availableTerritories=="string"&&Zo(n.availableTerritories)&&(n.availableTerritories=[...Ni.territoryCodes]),n})),Array.isArray(r.inAppPurchases)&&(r.inAppPurchases=r.inAppPurchases.map(t=>es(t))),Array.isArray(r.subscriptionGroups)&&(r.subscriptionGroups=r.subscriptionGroups.map(t=>{let n={...t};return Array.isArray(n.subscriptions)&&(n.subscriptions=n.subscriptions.map(i=>es(i))),n})),r}function Mw(e){if(!e||typeof e!="object")return e;let r={...e};return Array.isArray(r.localizations)&&r.primaryLocale&&(r.localizations=Rw(r.localizations,r.primaryLocale)),r}function Rw(e,r){if(!r)return e;let t=e.find(i=>i.locale===r);if(!t)return e;let n=e.map(i=>{if(i.locale===r)return i;let a={...t,locale:i.locale};return Object.keys(i).forEach(s=>{if(s!=="locale"){let u=s;a[u]=i[u]}}),a});return bp.logger.debug(`Deoptimized ${e.length} localizations to restore full data with primary locale: ${r}`),n}});var rs=m(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.DEFAULT_CONFIG_FILENAME=ft.BASE_TERRITORY=void 0;ft.BASE_TERRITORY="USA";ft.DEFAULT_CONFIG_FILENAME="storeconfig.json"});var wp=m(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.collectPricingItems=Iw;function Iw(e){let r=[];return r.push({type:"app",id:e.appId,name:"App"}),e.inAppPurchases&&e.inAppPurchases.forEach(t=>{r.push({type:"inAppPurchase",id:t.productId,name:t.referenceName})}),e.subscriptionGroups&&e.subscriptionGroups.forEach(t=>{t.subscriptions.forEach(n=>{r.push({type:"subscription",id:n.productId,name:n.referenceName}),n.introductoryOffers&&n.introductoryOffers.filter(i=>i.type!=="FREE_TRIAL").forEach(i=>{r.push({type:"offer",id:n.productId,name:`${i.type} Introductory Offer`,offerType:i.type,parentName:n.referenceName})}),n.promotionalOffers&&n.promotionalOffers.filter(i=>i.type!=="FREE_TRIAL").forEach(i=>{r.push({type:"offer",id:i.id,name:`${i.type} Promotional Offer`,offerType:i.type,parentName:n.referenceName})})})}),r}});var Pp=m(Ze=>{"use strict";var Dw=Ze&&Ze.__createBinding||(Object.create?(function(e,r,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(r,t);(!i||("get"in i?!r.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,n,i)}):(function(e,r,t,n){n===void 0&&(n=t),e[n]=r[t]})),Cw=Ze&&Ze.__setModuleDefault||(Object.create?(function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}):function(e,r){e.default=r}),Op=Ze&&Ze.__importStar||(function(){var e=function(r){return e=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},e(r)};return function(r){if(r&&r.__esModule)return r;var t={};if(r!=null)for(var n=e(r),i=0;i<n.length;i++)n[i]!=="default"&&Dw(t,r,n[i]);return Cw(t,r),t}})();Object.defineProperty(Ze,"__esModule",{value:!0});Ze.validateFileExists=$w;var Lw=Op(require("fs")),Ep=Op(require("path")),Sp=$r(),qw=rs();function $w(e,r={}){let{defaultFilename:t=qw.DEFAULT_CONFIG_FILENAME,fileDescription:n="JSON file",resolution:i=`Please either:
61
61
  1. Create a ${t} file in the current directory, or
62
- 2. Specify a ${n} using the --file or -f option`}=r,a;return e&&e.trim()!==""?a=bp.resolve(e):a=bp.resolve(process.cwd(),t),Dw.existsSync(a)||(_p.logger.error(`File not found: ${a}`),(!e||e.trim()==="")&&_p.logger.info(`No file specified and default file ${t} not found in current directory.
63
- `+i),process.exit(1)),a}});var K=m(Q=>{"use strict";var qw=Q&&Q.__createBinding||(Object.create?(function(e,r,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(r,t);(!i||("get"in i?!r.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,n,i)}):(function(e,r,t,n){n===void 0&&(n=t),e[n]=r[t]})),me=Q&&Q.__exportStar||function(e,r){for(var t in e)t!=="default"&&!Object.prototype.hasOwnProperty.call(r,t)&&qw(r,e,t)};Object.defineProperty(Q,"__esModule",{value:!0});me(Ti(),Q);me(pn(),Q);me(aa(),Q);me(up(),Q);me(dp(),Q);me(hp(),Q);me(gn(),Q);me(Pi(),Q);me(Go(),Q);me(ua(),Q);me(bt(),Q);me(gp(),Q);me(yp(),Q);me(Qo(),Q);me(vp(),Q);me(Ep(),Q);me($r(),Q)});var vm=ia();vm.start({apiKey:"9214ba2acdaeee4012c236461232c4f3",autoTrackSessions:!1,appType:"worker",logger:null});var Nh=L(ia()),xh=L(require("dotenv")),Mh=L(require("yargs")),Rh=require("yargs/helpers"),zr=L(K());var dt=L(K()),Sp=L(K()),Op=L(K()),$w={command:"validate-format",describe:"Validate the JSON file format and structure",builder:{file:{alias:"f",describe:`Path to the JSON file. Defaults to ${dt.DEFAULT_CONFIG_FILENAME} in current directory.`,demandOption:!1,type:"string"}},handler:e=>{let r=(0,dt.validateFileExists)(e.file,{fileDescription:"JSON file"});(0,Op.validateAppStoreModel)((0,Sp.removeShortcuts)((0,dt.readJsonFile)(r)),!0,"fetch")}},Pp=$w;var yr=L(K());var Ap=L(K()),Tp=L(K()),Ri=L(K());function pt(e){return e===Ri.WORLDWIDE_TERRITORY_CODE?!0:(0,Ri.deepEqualUnordered)(e,Tp.territoryCodes)}function jr(e){return e.map(r=>`${r.territory}: $${r.price}`).join(", ")}async function Uw(e){let r="",t="";switch(e.type){case"UPDATE_APP_AVAILABILITY":let n=e.payload.desiredTerritories,i=pt(n);r="Updating app availability",t=i?"worldwide":`${Array.isArray(n)?n.length:1} territories`;break;case"UPDATE_IN_APP_PURCHASE":let a=JSON.stringify(e.payload.changes);r=`Updating in-app purchase "${e.payload.productId}"`,t=a;break;case"UPDATE_IAP_AVAILABILITY":let s=e.payload.availability.availableTerritories,u=pt(s);r=`Updating IAP "${e.payload.productId}" availability`,t=u?"worldwide":`${Array.isArray(s)?s.length:1} territories`;break;case"UPDATE_IAP_PRICING":let d=e.payload.pricing,h=jr(d.prices);r=`Updating IAP "${e.payload.productId}" pricing`,t=h;break;case"CREATE_SUBSCRIPTION":let y=e.payload.subscription,b=y.pricing?jr(y.pricing.prices):"No pricing set",_=y.availability?.availableTerritories,g=(_?pt(_):!1)?"worldwide":_?`${Array.isArray(_)?_.length:1} territories`:"No territories set";r=`Creating subscription "${y.productId}" (${y.referenceName}) in group "${e.payload.groupReferenceName}"`,t=`Period: ${y.subscriptionPeriod}, Pricing: ${b}, Territories: ${g}`;break;case"UPDATE_SUBSCRIPTION_AVAILABILITY":let w=e.payload.availability.availableTerritories,T=pt(w);r=`Updating subscription "${e.payload.subscriptionProductId}" availability`,t=T?"worldwide":`${Array.isArray(w)?w.length:1} territories`;break;case"CREATE_SUBSCRIPTION_PRICE":let D=e.payload.desiredPriceSchedule,$=jr(D.prices);r=`Creating subscription price for "${e.payload.subscriptionProductId}"`,t=$;break;case"CREATE_INTRODUCTORY_OFFER":let P=e.payload.offer,C=P.type==="FREE_TRIAL"?"Free trial":jr(P.pricing.prices),z=P.availableTerritories,B=pt(z)?"worldwide":`${Array.isArray(z)?z.length:1} territories`;r=`Creating introductory offer for subscription "${e.payload.subscriptionProductId}"`,t=`Type: ${P.type}, Period: ${e.payload.subscriptionPeriod}, Pricing: ${C}, Territories: ${B}`;break;case"CREATE_IN_APP_PURCHASE":let G=e.payload.inAppPurchase,U=G.pricing?jr(G.pricing.prices):"No pricing set",Z=G.availability?.availableTerritories,te=(Z?pt(Z):!1)?"worldwide":Z?`${Array.isArray(Z)?Z.length:1} territories`:"No territories set";r=`Creating in-app purchase "${G.productId}" (${G.referenceName})"`,t=`Type: ${G.type}, Pricing: ${U}, Territories: ${te}`;break;case"UPDATE_APP_PRICING":let ce=e.payload.pricing,fe=jr(ce.prices);r="Updating app pricing",t=fe;break;case"UPDATE_APP_DETAILS":let $e=JSON.stringify(e.payload);r="Updating app details",t=$e;break;case"UPDATE_VERSION_METADATA":let O=JSON.stringify(e.payload);r="Updating version metadata",t=O;break;case"CREATE_APP_LOCALIZATION":let R=e.payload.localization;r="Creating app localization",t=R.locale;break;case"UPDATE_APP_LOCALIZATION":let V=e.payload;r="Updating app localization",t=V.locale;break;case"DELETE_APP_LOCALIZATION":r="Deleting app localization",t=e.payload.locale;break;case"CREATE_SUBSCRIPTION_GROUP":let ue=e.payload.group;r="Creating subscription group",t=`"${ue.referenceName}"`;break;case"UPDATE_SUBSCRIPTION_GROUP":let q=e.payload,_e=JSON.stringify(e.payload.changes||{});r=`Updating subscription group "${q.referenceName}"`,t=_e;break;case"CREATE_SUBSCRIPTION_GROUP_LOCALIZATION":let de=e.payload.localization;r="Creating subscription group localization",t=de.locale;break;case"UPDATE_SUBSCRIPTION_GROUP_LOCALIZATION":let Ne=e.payload,Ue=JSON.stringify(e.payload.changes||{});r=`Updating subscription group localization for ${Ne.locale}`,t=Ue;break;case"DELETE_SUBSCRIPTION_GROUP_LOCALIZATION":r="Deleting subscription group localization",t=e.payload.locale;break;case"UPDATE_SUBSCRIPTION":let Br=e.payload,er=JSON.stringify(e.payload.changes||{});r=`Updating subscription "${Br.productId}"`,t=er;break;case"CREATE_SUBSCRIPTION_LOCALIZATION":let Hr=e.payload.localization;r="Creating subscription localization",t=Hr.locale;break;case"UPDATE_SUBSCRIPTION_LOCALIZATION":let ie=e.payload,rr=JSON.stringify(e.payload.changes||{});r=`Updating subscription localization for ${ie.locale}`,t=rr;break;case"DELETE_SUBSCRIPTION_LOCALIZATION":r="Deleting subscription localization",t=e.payload.locale;break;case"CREATE_IAP_LOCALIZATION":let ht=e.payload.localization;r="Creating IAP localization",t=ht.locale;break;case"UPDATE_IAP_LOCALIZATION":let Se=e.payload,Gr=JSON.stringify(e.payload.changes||{});r=`Updating IAP localization for ${Se.locale}`,t=Gr;break;case"DELETE_IAP_LOCALIZATION":r="Deleting IAP localization",t=e.payload.locale;break;case"DELETE_INTRODUCTORY_OFFER":r="Deleting introductory offer",t=`subscription "${e.payload.subscriptionProductId}"`;break;case"CREATE_PROMOTIONAL_OFFER":let Re=e.payload.offer,tr=Re.type==="FREE_TRIAL"?"Free trial":jr(Re.pricing.prices);r=`Creating promotional offer "${Re.referenceName}" for subscription "${e.payload.subscriptionProductId}"`,t=`Type: ${Re.type}, Pricing: ${tr}`;break;case"DELETE_PROMOTIONAL_OFFER":r="Deleting promotional offer",t=`"${e.payload.offerId}" subscription "${e.payload.subscriptionProductId}"`;break;default:r="Unknown action type",t=e.type;break}Ap.logger.info(`${r}
64
- ${t}`)}async function Np(e){for(let r of e)await Uw(r)}var Lp=L(K()),qp=L(K()),$p=L(K());var ns=L(require("axios"));var Xe=L(require("fs")),rs=L(require("path")),xp=L(require("os")),Fr=L(K()),ts=class{constructor(r){this.keyPath=r??rs.default.join(xp.default.homedir(),".storeconfig","key")}getKeyPath(){return this.keyPath}saveKey(r){try{let t=rs.default.dirname(this.keyPath);Xe.default.existsSync(t)||Xe.default.mkdirSync(t,{recursive:!0}),Xe.default.writeFileSync(this.keyPath,r,"utf8"),Fr.logger.debug(`Secret key saved to ${this.keyPath}`)}catch(t){throw new Fr.ContextualError("Failed to save secret key",t)}}loadKey(){try{return Xe.default.existsSync(this.keyPath)?Xe.default.readFileSync(this.keyPath,"utf8").trim():null}catch(r){throw new Fr.ContextualError("Failed to load secret key file",r)}}hasKey(){return Xe.default.existsSync(this.keyPath)}deleteKey(){try{Xe.default.existsSync(this.keyPath)&&(Xe.default.unlinkSync(this.keyPath),Fr.logger.debug(`Secret key deleted from ${this.keyPath}`))}catch(r){throw new Fr.ContextualError("Failed to delete secret key",r)}}},Kt=new ts;var Mp=L(K()),oe=ns.default.create({baseURL:process.env.API_BASE_URL||"http://localhost:3000",timeout:3e4,headers:{"Content-Type":"application/json"}});oe.interceptors.request.use(e=>{let r=Kt.loadKey();return r&&(e.headers["X-StoreConfig-ApiKey"]=r),e},e=>Promise.reject(e));oe.interceptors.response.use(e=>e,e=>{if(ns.default.isAxiosError(e)&&e.response?.data&&e.response.status){let r=e.response.status,t=e.response.data?.message||`API request failed with status ${r}`,n=e.response.data?.details;throw new Mp.ContextualError(t,n)}throw e});var jw=()=>Kt.hasKey(),Rp=()=>{if(!jw())throw new Error("Authentication required. Please run 'storeconfig configure' first to set up your secret key")};var Fw=5e3,Ip=async(e,r,t)=>{let n=-1;for(;;){let{status:i,currentActionIndex:a,currentAction:s,totalActions:u,error:d}=(await kw(e)).data;if(a!==n){t&&a!==n+1&&n>=0&&await zw(t,n+1,a,r);let h=Dp(s),y=`Processing action [${a+1}/${u}] ${h}`;r.text=y,n=a}if(i==="completed"){r.succeed("Actions completed successfully");return}if(i==="failed"){let h=`Actions ID '${e}'`;throw d&&(h+=`
65
- ${d}`),new Error(h)}await new Promise(h=>setTimeout(h,Fw))}},kw=async e=>(await oe.get(`/status/${e}`)).data,Dp=e=>e?e.type:"Unknown Action",zw=async(e,r,t,n)=>{let i=Math.max(0,r),a=Math.min(e.length,t);for(let s=i;s<a;s++){let u=e[s],d=e.length;if(u){let h=Dp(u),y=`Processing action [${s+1}/${d}] ${h}`;n.text=y,await new Promise(b=>setTimeout(b,500))}}};var Di=L(K()),is=L(require("inquirer"));var Ii=async()=>(await oe.get("/info")).data.data;var Cp=async(e,r,t,n=!1,i)=>{let a=await Hw();if(a){let d=await Bw(a,i);if(d)return{jobId:d,newJobCreated:!1}}return await Yw()?(i.start("Processing actions..."),{jobId:(await oe.post("/apply",{plan:e,currentState:r,desiredState:t,dryRun:n})).data.data,newJobCreated:!0}):(Di.logger.warn("Operation cancelled by user"),null)},Bw=async(e,r)=>await Gw(e)?(r.start(`Tracking progress of ongoing actions with ID: ${e}`),e):(Di.logger.warn("Operation cancelled by user - cannot create new actions while already processing actions"),null),Hw=async()=>{let e=await Ii(),{currentJob:r}=e;return r&&(r.status==="pending"||r.status==="processing")?r.id:null},Gw=async e=>{let{watchOngoing:r}=await is.default.prompt([{type:"confirm",name:"watchOngoing",message:`You already have ongoing actions with ID: (${e}). No new actions will be created until the ongoing actions are completed. Would you like to track the ongoing actions?`,default:!0}]);return r},Ww=`
62
+ 2. Specify a ${n} using the --file or -f option`}=r,a;return e&&e.trim()!==""?a=Ep.resolve(e):a=Ep.resolve(process.cwd(),t),Lw.existsSync(a)||(Sp.logger.error(`File not found: ${a}`),(!e||e.trim()==="")&&Sp.logger.info(`No file specified and default file ${t} not found in current directory.
63
+ `+i),process.exit(1)),a}});var K=m(Q=>{"use strict";var Uw=Q&&Q.__createBinding||(Object.create?(function(e,r,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(r,t);(!i||("get"in i?!r.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,n,i)}):(function(e,r,t,n){n===void 0&&(n=t),e[n]=r[t]})),me=Q&&Q.__exportStar||function(e,r){for(var t in e)t!=="default"&&!Object.prototype.hasOwnProperty.call(r,t)&&Uw(r,e,t)};Object.defineProperty(Q,"__esModule",{value:!0});me(Ti(),Q);me(pn(),Q);me(sa(),Q);me(fp(),Q);me(gp(),Q);me(yp(),Q);me(gn(),Q);me(Pi(),Q);me(Yo(),Q);me(ca(),Q);me(bt(),Q);me(vp(),Q);me(_p(),Q);me(rs(),Q);me(wp(),Q);me(Pp(),Q);me($r(),Q)});var Ji=C(require("dotenv")),As=C(require("path"));process.env.DOTENV_CONFIG_SILENT="true";Ji.default.config();Ji.default.config({path:As.default.resolve(__dirname,"../.env")});var oa=C(aa()),_m=process.env.NODE_ENV=="development";_m?oa.default.notify=()=>{}:oa.default.start({apiKey:"9214ba2acdaeee4012c236461232c4f3",autoTrackSessions:!1,appType:"worker",logger:null});var Rh=C(aa()),Ih=C(require("yargs")),Dh=require("yargs/helpers"),zr=C(K());var dt=C(K()),Ap=C(K()),Tp=C(K()),jw={command:"validate-format",describe:"Validate the JSON file format and structure",builder:{file:{alias:"f",describe:`Path to the JSON file. Defaults to ${dt.DEFAULT_CONFIG_FILENAME} in current directory.`,demandOption:!1,type:"string"}},handler:e=>{let r=(0,dt.validateFileExists)(e.file,{fileDescription:"JSON file"});(0,Tp.validateAppStoreModel)((0,Ap.removeShortcuts)((0,dt.readJsonFile)(r)),!0,"fetch")}},Np=jw;var yr=C(K());var xp=C(K()),Mp=C(K()),Ri=C(K());function pt(e){return e===Ri.WORLDWIDE_TERRITORY_CODE?!0:(0,Ri.deepEqualUnordered)(e,Mp.territoryCodes)}function jr(e){return e.map(r=>`${r.territory}: $${r.price}`).join(", ")}async function Fw(e){let r="",t="";switch(e.type){case"UPDATE_APP_AVAILABILITY":let n=e.payload.desiredTerritories,i=pt(n);r="Updating app availability",t=i?"worldwide":`${Array.isArray(n)?n.length:1} territories`;break;case"UPDATE_IN_APP_PURCHASE":let a=JSON.stringify(e.payload.changes);r=`Updating in-app purchase "${e.payload.productId}"`,t=a;break;case"UPDATE_IAP_AVAILABILITY":let s=e.payload.availability.availableTerritories,u=pt(s);r=`Updating IAP "${e.payload.productId}" availability`,t=u?"worldwide":`${Array.isArray(s)?s.length:1} territories`;break;case"UPDATE_IAP_PRICING":let d=e.payload.pricing,h=jr(d.prices);r=`Updating IAP "${e.payload.productId}" pricing`,t=h;break;case"CREATE_SUBSCRIPTION":let y=e.payload.subscription,b=y.pricing?jr(y.pricing.prices):"No pricing set",_=y.availability?.availableTerritories,g=(_?pt(_):!1)?"worldwide":_?`${Array.isArray(_)?_.length:1} territories`:"No territories set";r=`Creating subscription "${y.productId}" (${y.referenceName}) in group "${e.payload.groupReferenceName}"`,t=`Period: ${y.subscriptionPeriod}, Pricing: ${b}, Territories: ${g}`;break;case"UPDATE_SUBSCRIPTION_AVAILABILITY":let w=e.payload.availability.availableTerritories,T=pt(w);r=`Updating subscription "${e.payload.subscriptionProductId}" availability`,t=T?"worldwide":`${Array.isArray(w)?w.length:1} territories`;break;case"CREATE_SUBSCRIPTION_PRICE":let D=e.payload.desiredPriceSchedule,$=jr(D.prices);r=`Creating subscription price for "${e.payload.subscriptionProductId}"`,t=$;break;case"CREATE_INTRODUCTORY_OFFER":let P=e.payload.offer,L=P.type==="FREE_TRIAL"?"Free trial":jr(P.pricing.prices),z=P.availableTerritories,B=pt(z)?"worldwide":`${Array.isArray(z)?z.length:1} territories`;r=`Creating introductory offer for subscription "${e.payload.subscriptionProductId}"`,t=`Type: ${P.type}, Period: ${e.payload.subscriptionPeriod}, Pricing: ${L}, Territories: ${B}`;break;case"CREATE_IN_APP_PURCHASE":let G=e.payload.inAppPurchase,U=G.pricing?jr(G.pricing.prices):"No pricing set",Z=G.availability?.availableTerritories,te=(Z?pt(Z):!1)?"worldwide":Z?`${Array.isArray(Z)?Z.length:1} territories`:"No territories set";r=`Creating in-app purchase "${G.productId}" (${G.referenceName})"`,t=`Type: ${G.type}, Pricing: ${U}, Territories: ${te}`;break;case"UPDATE_APP_PRICING":let ce=e.payload.pricing,fe=jr(ce.prices);r="Updating app pricing",t=fe;break;case"UPDATE_APP_DETAILS":let $e=JSON.stringify(e.payload);r="Updating app details",t=$e;break;case"UPDATE_VERSION_METADATA":let O=JSON.stringify(e.payload);r="Updating version metadata",t=O;break;case"CREATE_APP_LOCALIZATION":let R=e.payload.localization;r="Creating app localization",t=R.locale;break;case"UPDATE_APP_LOCALIZATION":let V=e.payload;r="Updating app localization",t=V.locale;break;case"DELETE_APP_LOCALIZATION":r="Deleting app localization",t=e.payload.locale;break;case"CREATE_SUBSCRIPTION_GROUP":let ue=e.payload.group;r="Creating subscription group",t=`"${ue.referenceName}"`;break;case"UPDATE_SUBSCRIPTION_GROUP":let q=e.payload,_e=JSON.stringify(e.payload.changes||{});r=`Updating subscription group "${q.referenceName}"`,t=_e;break;case"CREATE_SUBSCRIPTION_GROUP_LOCALIZATION":let de=e.payload.localization;r="Creating subscription group localization",t=de.locale;break;case"UPDATE_SUBSCRIPTION_GROUP_LOCALIZATION":let Ne=e.payload,Ue=JSON.stringify(e.payload.changes||{});r=`Updating subscription group localization for ${Ne.locale}`,t=Ue;break;case"DELETE_SUBSCRIPTION_GROUP_LOCALIZATION":r="Deleting subscription group localization",t=e.payload.locale;break;case"UPDATE_SUBSCRIPTION":let Br=e.payload,er=JSON.stringify(e.payload.changes||{});r=`Updating subscription "${Br.productId}"`,t=er;break;case"CREATE_SUBSCRIPTION_LOCALIZATION":let Hr=e.payload.localization;r="Creating subscription localization",t=Hr.locale;break;case"UPDATE_SUBSCRIPTION_LOCALIZATION":let ie=e.payload,rr=JSON.stringify(e.payload.changes||{});r=`Updating subscription localization for ${ie.locale}`,t=rr;break;case"DELETE_SUBSCRIPTION_LOCALIZATION":r="Deleting subscription localization",t=e.payload.locale;break;case"CREATE_IAP_LOCALIZATION":let ht=e.payload.localization;r="Creating IAP localization",t=ht.locale;break;case"UPDATE_IAP_LOCALIZATION":let Se=e.payload,Gr=JSON.stringify(e.payload.changes||{});r=`Updating IAP localization for ${Se.locale}`,t=Gr;break;case"DELETE_IAP_LOCALIZATION":r="Deleting IAP localization",t=e.payload.locale;break;case"DELETE_INTRODUCTORY_OFFER":r="Deleting introductory offer",t=`subscription "${e.payload.subscriptionProductId}"`;break;case"CREATE_PROMOTIONAL_OFFER":let Re=e.payload.offer,tr=Re.type==="FREE_TRIAL"?"Free trial":jr(Re.pricing.prices);r=`Creating promotional offer "${Re.referenceName}" for subscription "${e.payload.subscriptionProductId}"`,t=`Type: ${Re.type}, Pricing: ${tr}`;break;case"DELETE_PROMOTIONAL_OFFER":r="Deleting promotional offer",t=`"${e.payload.offerId}" subscription "${e.payload.subscriptionProductId}"`;break;default:r="Unknown action type",t=e.type;break}xp.logger.info(`${r}
64
+ ${t}`)}async function Rp(e){for(let r of e)await Fw(r)}var Up=C(K()),jp=C(K()),Fp=C(K());var as=C(require("axios"));var Xe=C(require("fs")),ns=C(require("path")),Ip=C(require("os")),Fr=C(K()),is=class{constructor(r){this.keyPath=r??ns.default.join(Ip.default.homedir(),".storeconfig","key")}getKeyPath(){return this.keyPath}saveKey(r){try{let t=ns.default.dirname(this.keyPath);Xe.default.existsSync(t)||Xe.default.mkdirSync(t,{recursive:!0}),Xe.default.writeFileSync(this.keyPath,r,"utf8"),Fr.logger.debug(`Secret key saved to ${this.keyPath}`)}catch(t){throw new Fr.ContextualError("Failed to save secret key",t)}}loadKey(){try{return Xe.default.existsSync(this.keyPath)?Xe.default.readFileSync(this.keyPath,"utf8").trim():null}catch(r){throw new Fr.ContextualError("Failed to load secret key file",r)}}hasKey(){return Xe.default.existsSync(this.keyPath)}deleteKey(){try{Xe.default.existsSync(this.keyPath)&&(Xe.default.unlinkSync(this.keyPath),Fr.logger.debug(`Secret key deleted from ${this.keyPath}`))}catch(r){throw new Fr.ContextualError("Failed to delete secret key",r)}}},Kt=new is;var Dp=C(K()),oe=as.default.create({baseURL:process.env.API_BASE_URL||"https://api.storeconfig.com",timeout:3e4,headers:{"Content-Type":"application/json"}});oe.interceptors.request.use(e=>{let r=Kt.loadKey();return r&&(e.headers["X-StoreConfig-ApiKey"]=r),e},e=>Promise.reject(e));oe.interceptors.response.use(e=>e,e=>{if(as.default.isAxiosError(e)&&e.response?.data&&e.response.status){let r=e.response.status,t=e.response.data?.message||`API request failed with status ${r}`,n=e.response.data?.details;throw new Dp.ContextualError(t,n)}throw e});var kw=()=>Kt.hasKey(),Cp=()=>{if(!kw())throw new Error("Authentication required. Please run 'storeconfig configure' first to set up your secret key")};var zw=5e3,Lp=async(e,r,t)=>{let n=-1;for(;;){let{status:i,currentActionIndex:a,currentAction:s,totalActions:u,error:d}=(await Bw(e)).data;if(a!==n){t&&a!==n+1&&n>=0&&await Hw(t,n+1,a,r);let h=qp(s),y=`Processing action [${a+1}/${u}] ${h}`;r.text=y,n=a}if(i==="completed"){r.succeed("Actions completed successfully");return}if(i==="failed"){let h=`Actions ID '${e}'`;throw d&&(h+=`
65
+ ${d}`),new Error(h)}await new Promise(h=>setTimeout(h,zw))}},Bw=async e=>(await oe.get(`/status/${e}`)).data,qp=e=>e?e.type:"Unknown Action",Hw=async(e,r,t,n)=>{let i=Math.max(0,r),a=Math.min(e.length,t);for(let s=i;s<a;s++){let u=e[s],d=e.length;if(u){let h=qp(u),y=`Processing action [${s+1}/${d}] ${h}`;n.text=y,await new Promise(b=>setTimeout(b,500))}}};var Di=C(K()),os=C(require("inquirer"));var Ii=async()=>(await oe.get("/info")).data.data;var $p=async(e,r,t,n=!1,i)=>{let a=await Ww();if(a){let d=await Gw(a,i);if(d)return{jobId:d,newJobCreated:!1}}return await Kw()?(i.start("Processing actions..."),{jobId:(await oe.post("/apply",{plan:e,currentState:r,desiredState:t,dryRun:n})).data.data,newJobCreated:!0}):(Di.logger.warn("Operation cancelled by user"),null)},Gw=async(e,r)=>await Yw(e)?(r.start(`Tracking progress of ongoing actions with ID: ${e}`),e):(Di.logger.warn("Operation cancelled by user - cannot create new actions while already processing actions"),null),Ww=async()=>{let e=await Ii(),{currentJob:r}=e;return r&&(r.status==="pending"||r.status==="processing")?r.id:null},Yw=async e=>{let{watchOngoing:r}=await os.default.prompt([{type:"confirm",name:"watchOngoing",message:`You already have ongoing actions with ID: (${e}). No new actions will be created until the ongoing actions are completed. Would you like to track the ongoing actions?`,default:!0}]);return r},Vw=`
66
66
  \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510
67
67
  \u2502 \u26A0\uFE0F CRITICAL WARNING \u2502
68
68
  \u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524
@@ -72,23 +72,23 @@ ${d}`),new Error(h)}await new Promise(h=>setTimeout(h,Fw))}},kw=async e=>(await
72
72
  \u2502 Some operations are inherently irreversible \u2014 even if \u2502
73
73
  \u2502 performed manually through App Store Connect. \u2502
74
74
  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518
75
- `,Yw=async()=>{Di.logger.std(Ww);let{confirmed:e}=await is.default.prompt([{type:"confirm",name:"confirmed",message:"Do you want to proceed with applying these changes?",default:!1}]);return e};var Up=L(require("ora")),Vw=`
75
+ `,Kw=async()=>{Di.logger.std(Vw);let{confirmed:e}=await os.default.prompt([{type:"confirm",name:"confirmed",message:"Do you want to proceed with applying these changes?",default:!1}]);return e};var kp=C(require("ora")),Jw=`
76
76
  \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510
77
77
  \u2502 This may take up to 30 minutes depending on the changes. \u2502
78
78
  \u2502 Processing continues on our servers even if CLI is closed. \u2502
79
79
  \u2502 You can rerun the same command to check current status. \u2502
80
80
  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518
81
81
 
82
- `,Kw={command:"apply",describe:"Apply the changes to App Store Connect",builder:{file:{alias:"f",describe:`Path to the desired state JSON file. Defaults to ${yr.DEFAULT_CONFIG_FILENAME} in current directory.`,demandOption:!1,type:"string"},preview:{alias:"p",describe:"Show what changes would be made without applying them (i.e., perform a 'dry run' preview only).",type:"boolean",default:!1}},handler:async e=>{let r=e.preview,t=process.env.dryRun==="true",n=(0,yr.validateFileExists)(e.file,{fileDescription:"desired state JSON file"});yr.logger.debug(`Processing desired state from ${n}...`),t&&yr.logger.debug("Dry run mode enabled - no actual changes will be applied to App Store Connect");let i=(0,Up.default)("Generating actions...").start();try{let a=(0,qp.validateAppStoreModel)((0,$p.removeShortcuts)((0,Lp.readJsonFile)(n)),!1,"apply"),s=await oe.post("/diff",{desiredState:a}),{plan:u,currentState:d}=s.data.data;if(u.length===0){i.succeed("No changes to apply. Your configuration is up to date. Exiting...");return}if(i.stop(),await Np(u),r){yr.logger.info("Preview mode - no changes will be applied");return}let h=await Cp(u,d,a,t,i);if(h){let{jobId:y,newJobCreated:b}=h;i.prefixText=Vw,await Ip(y,i,b?u:void 0)}}catch(a){throw i.stop(),a}}},jp=Kw;var Jt=L(K()),Fp=L(require("fs")),kp=L(require("inquirer"));var zp=L(require("ora"));async function Jw(){return(await oe.get("/fetch-apps")).data.data}async function Zw(e){let r=e.map((n,i)=>({name:`${i+1}. ${n.name}`,value:n})),{selectedApp:t}=await kp.default.prompt([{type:"list",name:"selectedApp",message:"Select the app you want to fetch:",choices:r}]);return Jt.logger.info(`Selected: ${t.name} (ID: ${t.id})`),t.id}var Xw={command:"fetch",describe:"Fetches the app from App Store Connect.",builder:{id:{describe:"The App ID to fetch details for. If not provided, you'll be prompted to select from available apps.",demandOption:!1,type:"string"},file:{alias:"f",describe:`Path to the output JSON file. Defaults to ${Jt.DEFAULT_CONFIG_FILENAME} in current directory.`,demandOption:!1,type:"string"}},handler:async e=>{let r=e.id,t=e.file||Jt.DEFAULT_CONFIG_FILENAME,n=(0,zp.default)();try{if(!r){n.start("No app ID provided. Fetching available apps...");let s=await Jw();s.length===0&&(n.fail("No IOS apps found in your App Store Connect account"),process.exit(1)),n.stop(),r=await Zw(s)}n.start(`Fetching details for app ID: ${r} and writing to ${t}`);let a=(await oe.post("/fetch",{appId:r})).data.data;Fp.writeFileSync(t,JSON.stringify(a,null,2)),n.succeed(`Successfully fetched app: ${t}`)}catch(i){throw n.stop(),i}}},Bp=Xw;var ih=L(require("fs")),Qe=L(K()),ah=L(K()),oh=L(K());var Wp=L(require("inquirer")),Ci=L(K());function Hp(e){switch(e){case"inAppPurchase":return"In App Purchase";case"subscription":return"Subscription";case"offer":return"Offer";case"app":return"App"}}function Gp(e){if(e.type!=="offer"||!e.offerType)return`"${e.name}"`;let r=e.offerType.replace(/_/g," ").toLowerCase();return`"${r.charAt(0).toUpperCase()+r.slice(1)}" | belongs to "${e.parentName}"`}async function Qw(e){let r=e.map((i,a)=>{let s=`"${i.name}"`;return i.type==="offer"&&(s=Gp(i)),{name:`${Hp(i.type)}: ${s} (ID: ${i.id})`,value:i}}),{selectedItem:t}=await Wp.default.prompt([{type:"list",name:"selectedItem",message:"Select an item:",choices:r}]),n=t.type==="offer"?Gp(t):`"${t.name}"`;return Ci.logger.info(`\u2705 Selected: ${Hp(t.type)}: ${n} (ID: ${t.id})`),t}async function Yp(e,r=Ci.collectPricingItems,t=Qw){let n=r(e);if(n.length===0)throw new Error("No items available for pricing. Please ensure the app contains items with pricing information (app, in-app purchase, or subscription).");return await t(n)}var Kp=L(require("inquirer")),Jp=L(K());function Vp(e){let r=e.trim();if(!/^\d+(\.\d{1,2})?$/.test(r))return null;let t=Number(r);return!isFinite(t)||t<0?null:t}function eE(e,r,t){return r.map(i=>({price:i,diff:Math.abs(Number(i)-e)})).sort((i,a)=>i.diff-a.diff).slice(0,Math.max(0,t)).map(i=>i.price).sort((i,a)=>Number(i)-Number(a))}async function Zp(e,r,t){let n;n=await t(e,r.appId,Jp.BASE_TERRITORY);let i=Array.from(new Set((n||[]).map(b=>({id:b.id,price:Number(b.price)})).filter(b=>Number.isFinite(b.price)&&b.price>=0).map(b=>({id:b.id,price:b.price.toFixed(2)})))).sort((b,_)=>Number(b.price)-Number(_.price));if(!n.length)throw new Error("No available Apple price points found. This is unexpected. Please try again.");let a=b=>{let _=Vp(b);if(_===null)return"\u274C Invalid format. Please enter a non-negative number with up to 2 decimals (e.g., 5.99).";let S=_.toFixed(2);if(i.length&&!i.some(g=>g.price===S)){let g=eE(_,i.map(T=>T.price),20),w=`\u274C The price ${S} is not an available Apple price.`;return g.length&&(w+=`
82
+ `,Zw={command:"apply",describe:"Apply the changes to App Store Connect",builder:{file:{alias:"f",describe:`Path to the desired state JSON file. Defaults to ${yr.DEFAULT_CONFIG_FILENAME} in current directory.`,demandOption:!1,type:"string"},preview:{alias:"p",describe:"Show what changes would be made without applying them (i.e., perform a 'dry run' preview only).",type:"boolean",default:!1}},handler:async e=>{let r=e.preview,t=process.env.dryRun==="true",n=(0,yr.validateFileExists)(e.file,{fileDescription:"desired state JSON file"});yr.logger.debug(`Processing desired state from ${n}...`),t&&yr.logger.debug("Dry run mode enabled - no actual changes will be applied to App Store Connect");let i=(0,kp.default)("Generating actions...").start();try{let a=(0,jp.validateAppStoreModel)((0,Fp.removeShortcuts)((0,Up.readJsonFile)(n)),!1,"apply"),s=await oe.post("/diff",{desiredState:a}),{plan:u,currentState:d}=s.data.data;if(u.length===0){i.succeed("No changes to apply. Your configuration is up to date. Exiting...");return}if(i.stop(),await Rp(u),r){yr.logger.info("Preview mode - no changes will be applied");return}let h=await $p(u,d,a,t,i);if(h){let{jobId:y,newJobCreated:b}=h;i.prefixText=Jw,await Lp(y,i,b?u:void 0)}}catch(a){throw i.stop(),a}}},zp=Zw;var Jt=C(K()),Bp=C(require("fs")),Hp=C(require("inquirer"));var Gp=C(require("ora"));async function Xw(){return(await oe.get("/fetch-apps")).data.data}async function Qw(e){let r=e.map((n,i)=>({name:`${i+1}. ${n.name}`,value:n})),{selectedApp:t}=await Hp.default.prompt([{type:"list",name:"selectedApp",message:"Select the app you want to fetch:",choices:r}]);return Jt.logger.info(`Selected: ${t.name} (ID: ${t.id})`),t.id}var eE={command:"fetch",describe:"Fetches the app from App Store Connect.",builder:{id:{describe:"The App ID to fetch details for. If not provided, you'll be prompted to select from available apps.",demandOption:!1,type:"string"},file:{alias:"f",describe:`Path to the output JSON file. Defaults to ${Jt.DEFAULT_CONFIG_FILENAME} in current directory.`,demandOption:!1,type:"string"}},handler:async e=>{let r=e.id,t=e.file||Jt.DEFAULT_CONFIG_FILENAME,n=(0,Gp.default)();try{if(!r){n.start("No app ID provided. Fetching available apps...");let s=await Xw();s.length===0&&(n.fail("No IOS apps found in your App Store Connect account"),process.exit(1)),n.stop(),r=await Qw(s)}n.start(`Fetching details for app ID: ${r} and writing to ${t}`);let a=(await oe.post("/fetch",{appId:r})).data.data;Bp.writeFileSync(t,JSON.stringify(a,null,2)),n.succeed(`Successfully fetched app: ${t}`)}catch(i){throw n.stop(),i}}},Wp=eE;var sh=C(require("fs")),Qe=C(K()),uh=C(K()),lh=C(K());var Kp=C(require("inquirer")),Ci=C(K());function Yp(e){switch(e){case"inAppPurchase":return"In App Purchase";case"subscription":return"Subscription";case"offer":return"Offer";case"app":return"App"}}function Vp(e){if(e.type!=="offer"||!e.offerType)return`"${e.name}"`;let r=e.offerType.replace(/_/g," ").toLowerCase();return`"${r.charAt(0).toUpperCase()+r.slice(1)}" | belongs to "${e.parentName}"`}async function rE(e){let r=e.map((i,a)=>{let s=`"${i.name}"`;return i.type==="offer"&&(s=Vp(i)),{name:`${Yp(i.type)}: ${s} (ID: ${i.id})`,value:i}}),{selectedItem:t}=await Kp.default.prompt([{type:"list",name:"selectedItem",message:"Select an item:",choices:r}]),n=t.type==="offer"?Vp(t):`"${t.name}"`;return Ci.logger.info(`\u2705 Selected: ${Yp(t.type)}: ${n} (ID: ${t.id})`),t}async function Jp(e,r=Ci.collectPricingItems,t=rE){let n=r(e);if(n.length===0)throw new Error("No items available for pricing. Please ensure the app contains items with pricing information (app, in-app purchase, or subscription).");return await t(n)}var Xp=C(require("inquirer")),Qp=C(K());function Zp(e){let r=e.trim();if(!/^\d+(\.\d{1,2})?$/.test(r))return null;let t=Number(r);return!isFinite(t)||t<0?null:t}function tE(e,r,t){return r.map(i=>({price:i,diff:Math.abs(Number(i)-e)})).sort((i,a)=>i.diff-a.diff).slice(0,Math.max(0,t)).map(i=>i.price).sort((i,a)=>Number(i)-Number(a))}async function eh(e,r,t){let n;n=await t(e,r.appId,Qp.BASE_TERRITORY);let i=Array.from(new Set((n||[]).map(b=>({id:b.id,price:Number(b.price)})).filter(b=>Number.isFinite(b.price)&&b.price>=0).map(b=>({id:b.id,price:b.price.toFixed(2)})))).sort((b,_)=>Number(b.price)-Number(_.price));if(!n.length)throw new Error("No available Apple price points found. This is unexpected. Please try again.");let a=b=>{let _=Zp(b);if(_===null)return"\u274C Invalid format. Please enter a non-negative number with up to 2 decimals (e.g., 5.99).";let S=_.toFixed(2);if(i.length&&!i.some(g=>g.price===S)){let g=tE(_,i.map(T=>T.price),20),w=`\u274C The price ${S} is not an available Apple price.`;return g.length&&(w+=`
83
83
  Closest available prices:
84
- ${g.join(" | ")}`),w}return!0},{price:s}=await Kp.default.prompt([{type:"input",name:"price",message:"Enter base price in USD (e.g., 5.99):",validate:a}]),d=Vp(s).toFixed(2),h=i.find(b=>b.price===d),y=n.find(b=>b.id===h?.id);if(y)return y;throw new Error(`Price point not found for price ${d}`)}var Xp=L(require("inquirer"));async function Qp(){let{strategy:e}=await Xp.default.prompt([{type:"list",name:"strategy",message:"Select pricing strategy:",choices:[{name:"Apple (uses Apple's standard pricing tiers)",value:"apple"},{name:"Purchasing Power (uses local purchasing power parity for fair pricing)",value:"purchasingPower"}]}]);return e}var eh=L(require("inquirer")),rh=L(K());async function th(e,r){if(e==="apple")return;let t="=".repeat(50),n=["Enter optional Minimum Price in USD so that no price is below this threshold."];rh.logger.info(`
84
+ ${g.join(" | ")}`),w}return!0},{price:s}=await Xp.default.prompt([{type:"input",name:"price",message:"Enter base price in USD (e.g., 5.99):",validate:a}]),d=Zp(s).toFixed(2),h=i.find(b=>b.price===d),y=n.find(b=>b.id===h?.id);if(y)return y;throw new Error(`Price point not found for price ${d}`)}var rh=C(require("inquirer"));async function th(){let{strategy:e}=await rh.default.prompt([{type:"list",name:"strategy",message:"Select pricing strategy:",choices:[{name:"Apple (uses Apple's standard pricing tiers)",value:"apple"},{name:"Purchasing Power (uses local purchasing power parity for fair pricing)",value:"purchasingPower"}]}]);return e}var nh=C(require("inquirer")),ih=C(K());async function ah(e,r){if(e==="apple")return;let t="=".repeat(50),n=["Enter optional Minimum Price in USD so that no price is below this threshold."];ih.logger.info(`
85
85
  ${t}
86
86
  ${n.join(`
87
87
  `)}
88
- ${t}`);let i=u=>{let d=u.trim();if(d==="")return!0;let h=parseFloat(d);if(isNaN(h)||h<0)return"\u274C Invalid price. Please enter a non-negative number or press Enter to skip.";let y=parseFloat(r);return h>=y?`\u274C Minimum price (${d}) must be less than base price (${r}). Please enter a lower value or press Enter to skip.`:!0},{minimumPrice:a}=await eh.default.prompt([{type:"input",name:"minimumPrice",message:"Minimum price in USD (optional, press Enter to skip):",validate:i}]),s=a.trim();return s===""?void 0:s}async function nh(e){let{appStoreState:r,fetchTerritoryPricePointsForSelectedItem:t}=e,n=await Yp(r),i=await Zp(n,r,t),a=await Qp(),s=await th(a,i.price);return{appId:r.appId,selectedItem:{type:n.type,id:n.id,name:n.name,offerType:n.offerType},basePricePoint:i,pricingStrategy:a,minimumPrice:s}}var Li=L(K());var sh=L(require("ora"));async function rE(e,r,t){return(await oe.post("/price-points",{selectedItem:e,appId:r,territoryId:t})).data.data.pricePoints}async function tE(e,r){return(await oe.post("/apply-pricing",{appStoreState:e,pricingRequest:r})).data.data.updatedState}var nE={command:"set-price",describe:"Set prices for apps, in-app purchases, and subscriptions using interactive prompts",builder:{file:{alias:"f",describe:`Path to the store config JSON file - will be updated in place. Defaults to ${Qe.DEFAULT_CONFIG_FILENAME} in current directory.`,demandOption:!1,type:"string"}},handler:async e=>{Qe.logger.warn("this command will be available soon")}},uh=nE;var Te=L(K());var lh=L(require("fs"));function iE(e){return e.item.name}var aE=["Territory","Local Price","Local Currency","USD Price","Relative to USA (%)"];function oE(e,r){let t=[];t.push(["Name",...aE].join(",")),e.forEach(i=>{i.prices.forEach(a=>{t.push(`${iE(i)},${a.territory},${a.localPrice},${a.localCurrency},${a.usdPrice.toFixed(2)},${a.usdPercentage.toFixed(0)}`)})});let n=t.join(`
89
- `);lh.writeFileSync(r,n,"utf8")}function ch(e,r){let t=r.toLowerCase().split(".").pop();if(!t||t!=="csv")throw new Error(`Unsupported file format. Please use ".csv" extension: "${r}"`);oE(e,r)}var sE={command:"compare-price",describe:"Compare prices across territories in USD",builder:{file:{alias:"f",describe:`Path to the input JSON file with app store data. Defaults to ${Te.DEFAULT_CONFIG_FILENAME} in current directory.`,demandOption:!1,type:"string"},output:{alias:"o",describe:"Path to the output file for price comparison analysis (.csv). Defaults to compare-price.csv in current directory.",demandOption:!1,type:"string"}},handler:async e=>{Te.logger.warn("this command will be available soon")}},fh=sE;var kr=L(K()),ph=L(require("inquirer")),hh=L(require("fs")),gh=L(require("path")),uE=[{key:"minimal",name:"Minimal App"},{key:"full",name:"Full App"},{key:"subscription",name:"Subscription"},{key:"in-app-purchase",name:"In-App Purchase"}];function dh(e){let r=gh.parse(e),t=r.ext,n=r.name;return t?`${n}_example${t}`:`${e}_example`}async function lE(){let e=uE.map((t,n)=>({name:`${n+1}. ${t.name}`,value:t.key})),{selectedType:r}=await ph.default.prompt([{type:"list",name:"selectedType",message:"Select the example type you want to generate:",choices:e}]);return r}var mh=[{productId:"com.mycompany.myapp.premium.monthly",referenceName:"Monthly Premium",groupLevel:2,subscriptionPeriod:"ONE_MONTH",familySharable:!1,reviewNote:"Monthly premium subscription with free trial",pricing:{baseTerritory:"USA",prices:[{price:"3.99",territory:"USA"}]},introductoryOffers:[{type:"FREE_TRIAL",duration:"ONE_WEEK",availableTerritories:"worldwide"}],availability:{availableInNewTerritories:!0,availableTerritories:"worldwide"},localizations:[{locale:"en-US",name:"Monthly Premium",description:"Monthly access to premium features"},{locale:"es-ES",name:"Premium Mensual",description:"Acceso mensual a funciones premium"}]},{productId:"com.mycompany.myapp.premium.yearly",referenceName:"Yearly Premium",groupLevel:1,subscriptionPeriod:"ONE_YEAR",familySharable:!1,reviewNote:"Yearly premium subscription with pay as you go",pricing:{baseTerritory:"USA",prices:[{price:"20.99",territory:"USA"}]},introductoryOffers:[{type:"PAY_AS_YOU_GO",numberOfPeriods:1,pricing:{baseTerritory:"USA",prices:[{price:"10.99",territory:"USA"}]},availableTerritories:"worldwide"}],availability:{availableInNewTerritories:!0,availableTerritories:"worldwide"},localizations:[{locale:"en-US",name:"Yearly Premium",description:"Yearly access to premium features"},{locale:"es-ES",name:"Premium Anual",description:"Acceso anual a funciones premium"}]}],cE={referenceName:"Premium Subscriptions",localizations:[{locale:"en-US",name:"Premium Subscriptions"},{locale:"es-ES",name:"Suscripciones Premium"}],subscriptions:mh},as=[{productId:"com.mycompany.myapp.premium",type:"NON_CONSUMABLE",referenceName:"Premium",familySharable:!1,reviewNote:"Premium features unlock",pricing:{baseTerritory:"USA",prices:[{price:"49.99",territory:"USA"}]},availability:{availableInNewTerritories:!0,availableTerritories:"worldwide"},localizations:[{locale:"en-US",name:"Premium Upgrade",description:"Unlock all premium features"},{locale:"es-ES",name:"Premium",description:"Acceso a todas las funciones premium"}]},{productId:"com.mycompany.myapp.consumable",type:"CONSUMABLE",referenceName:"Coins",familySharable:!1,reviewNote:"Coins",pricing:{baseTerritory:"USA",prices:[{price:"2.99",territory:"USA"}]},availability:{availableInNewTerritories:!0,availableTerritories:"worldwide"},localizations:[{locale:"en-US",name:"Coins",description:"Coins to spend in the app"}]}],yh={schemaVersion:"1.0.0",appId:"1234567890",versionString:"2.1.17",pricing:{baseTerritory:"USA",prices:[{price:"0.99",territory:"USA"}]},availableTerritories:"worldwide",inAppPurchases:as,subscriptionGroups:[cE],primaryLocale:"en-US",localizations:[{locale:"en-US",name:"My App",subtitle:"The best app ever",description:"The best app ever in the whole world",keywords:"best,app,ever",promotionalText:"The best app ever in the whole world",privacyPolicyUrl:"https://mycompany.com/privacy",privacyChoicesUrl:"https://mycompany.com/privacy-choices",marketingUrl:"https://mycompany.com/marketing",supportUrl:"https://mycompany.com/support",whatsNew:"Bug fixes and improvements"}],copyright:"\xA9 2025 My Company"},fE={...yh,pricing:{baseTerritory:"USA",prices:[{price:"0.0",territory:"USA"}]},inAppPurchases:void 0,subscriptionGroups:void 0},dE={command:"example",describe:"Generate example JSON files for different data types",builder:{type:{alias:"t",describe:"Type of example to generate",choices:["minimal","full","subscription","iap","in-app-purchase"],type:"string"},file:{alias:"f",describe:`Path to the output JSON file. Defaults to ${dh(kr.DEFAULT_CONFIG_FILENAME)} in current directory.`,demandOption:!1,type:"string"}},handler:async e=>{let r=e.type,t=e.file||dh(kr.DEFAULT_CONFIG_FILENAME);r||(r=await lE());let i={minimal:fE,full:yh,subscription:mh,iap:as,"in-app-purchase":as}[r];if(!i)throw new Error(`Unknown example type: ${r}`);try{hh.writeFileSync(t,JSON.stringify(i,null,2)),kr.logger.info(`Successfully generated example and wrote to ${t}`)}catch(a){throw new kr.ContextualError("Failed to write example file",a)}}},vh=dE;var wh=L(K());var bh=L(require("inquirer"));async function _h(){let{secretKey:e}=await bh.default.prompt([{type:"password",name:"secretKey",message:"Enter your StoreConfig Secret Key:",mask:"*"}]);return e.trim()}var pE={command:"configure",describe:"Configure StoreConfig with the Secret Key",handler:async e=>{let r=await _h();if(!r)throw new Error("Secret key cannot be empty");Kt.saveKey(r),wh.logger.info("\u2705 Secret key saved successfully! Add Apple credentials now (storeconfig apple) if you haven't already.")}},Eh=pE;var Sh=L(require("fs")),vr=L(K());var os=class{constructor(){}async configureAppleCredentials(r,t,n){(0,vr.validateFileExists)(n,{fileDescription:"Apple private key (.p8 file)"});let i=this.readPrivateKeyFile(n);this.validatePrivateKey(i),vr.logger.info("Sending Apple credentials to backend..."),await this.sendCredentialsToBackend(r,t,i),vr.logger.info("\u2705 Apple credentials stored successfully!")}readPrivateKeyFile(r){try{return Sh.default.readFileSync(r,"utf8")}catch(t){throw new vr.ContextualError(`Failed to read private key file at ${r}`,t)}}validatePrivateKey(r){if(!r.includes("BEGIN PRIVATE KEY")&&!r.includes("BEGIN RSA PRIVATE KEY"))throw new Error("Invalid private key file, the file does not appear to be a valid Apple private key (.p8 file)")}async sendCredentialsToBackend(r,t,n){let i=await oe.post("/auth",{keyId:t,issuerId:r,privateKey:n});i.data.message&&vr.logger.info(i.data.message)}},Oh=new os;var hE={command:"apple",describe:"Add Apple credentials",builder:{"issuer-id":{describe:"Apple App Store Connect Issuer ID",demandOption:!0,type:"string"},"key-id":{describe:"Apple App Store Connect Key ID",demandOption:!0,type:"string"},"key-path":{describe:"Path to Apple private key (.p8 file)",demandOption:!0,type:"string"}},handler:async e=>{let r=e["issuer-id"],t=e["key-id"],n=e["key-path"];await Oh.configureAppleCredentials(r,t,n)}},Ph=hE;var Ah=L(K());var gE={command:"user",describe:"Display current user information and latest job status",builder:{},handler:async()=>{let e=await Ii(),r="";r+=`Email \u2192 ${e.user.email}`,e.currentJob&&(r+=`
88
+ ${t}`);let i=u=>{let d=u.trim();if(d==="")return!0;let h=parseFloat(d);if(isNaN(h)||h<0)return"\u274C Invalid price. Please enter a non-negative number or press Enter to skip.";let y=parseFloat(r);return h>=y?`\u274C Minimum price (${d}) must be less than base price (${r}). Please enter a lower value or press Enter to skip.`:!0},{minimumPrice:a}=await nh.default.prompt([{type:"input",name:"minimumPrice",message:"Minimum price in USD (optional, press Enter to skip):",validate:i}]),s=a.trim();return s===""?void 0:s}async function oh(e){let{appStoreState:r,fetchTerritoryPricePointsForSelectedItem:t}=e,n=await Jp(r),i=await eh(n,r,t),a=await th(),s=await ah(a,i.price);return{appId:r.appId,selectedItem:{type:n.type,id:n.id,name:n.name,offerType:n.offerType},basePricePoint:i,pricingStrategy:a,minimumPrice:s}}var Li=C(K());var ch=C(require("ora"));async function nE(e,r,t){return(await oe.post("/price-points",{selectedItem:e,appId:r,territoryId:t})).data.data.pricePoints}async function iE(e,r){return(await oe.post("/apply-pricing",{appStoreState:e,pricingRequest:r})).data.data.updatedState}var aE={command:"set-price",describe:"Set prices for apps, in-app purchases, and subscriptions using interactive prompts",builder:{file:{alias:"f",describe:`Path to the store config JSON file - will be updated in place. Defaults to ${Qe.DEFAULT_CONFIG_FILENAME} in current directory.`,demandOption:!1,type:"string"}},handler:async e=>{Qe.logger.warn("this command will be available soon")}},fh=aE;var Te=C(K());var dh=C(require("fs"));function oE(e){return e.item.name}var sE=["Territory","Local Price","Local Currency","USD Price","Relative to USA (%)"];function uE(e,r){let t=[];t.push(["Name",...sE].join(",")),e.forEach(i=>{i.prices.forEach(a=>{t.push(`${oE(i)},${a.territory},${a.localPrice},${a.localCurrency},${a.usdPrice.toFixed(2)},${a.usdPercentage.toFixed(0)}`)})});let n=t.join(`
89
+ `);dh.writeFileSync(r,n,"utf8")}function ph(e,r){let t=r.toLowerCase().split(".").pop();if(!t||t!=="csv")throw new Error(`Unsupported file format. Please use ".csv" extension: "${r}"`);uE(e,r)}var lE={command:"compare-price",describe:"Compare prices across territories in USD",builder:{file:{alias:"f",describe:`Path to the input JSON file with app store data. Defaults to ${Te.DEFAULT_CONFIG_FILENAME} in current directory.`,demandOption:!1,type:"string"},output:{alias:"o",describe:"Path to the output file for price comparison analysis (.csv). Defaults to compare-price.csv in current directory.",demandOption:!1,type:"string"}},handler:async e=>{Te.logger.warn("this command will be available soon")}},hh=lE;var kr=C(K()),mh=C(require("inquirer")),yh=C(require("fs")),vh=C(require("path")),cE=[{key:"minimal",name:"Minimal App"},{key:"full",name:"Full App"},{key:"subscription",name:"Subscription"},{key:"in-app-purchase",name:"In-App Purchase"}];function gh(e){let r=vh.parse(e),t=r.ext,n=r.name;return t?`${n}_example${t}`:`${e}_example`}async function fE(){let e=cE.map((t,n)=>({name:`${n+1}. ${t.name}`,value:t.key})),{selectedType:r}=await mh.default.prompt([{type:"list",name:"selectedType",message:"Select the example type you want to generate:",choices:e}]);return r}var bh=[{productId:"com.mycompany.myapp.premium.monthly",referenceName:"Monthly Premium",groupLevel:2,subscriptionPeriod:"ONE_MONTH",familySharable:!1,reviewNote:"Monthly premium subscription with free trial",pricing:{baseTerritory:"USA",prices:[{price:"3.99",territory:"USA"}]},introductoryOffers:[{type:"FREE_TRIAL",duration:"ONE_WEEK",availableTerritories:"worldwide"}],availability:{availableInNewTerritories:!0,availableTerritories:"worldwide"},localizations:[{locale:"en-US",name:"Monthly Premium",description:"Monthly access to premium features"},{locale:"es-ES",name:"Premium Mensual",description:"Acceso mensual a funciones premium"}]},{productId:"com.mycompany.myapp.premium.yearly",referenceName:"Yearly Premium",groupLevel:1,subscriptionPeriod:"ONE_YEAR",familySharable:!1,reviewNote:"Yearly premium subscription with pay as you go",pricing:{baseTerritory:"USA",prices:[{price:"20.99",territory:"USA"}]},introductoryOffers:[{type:"PAY_AS_YOU_GO",numberOfPeriods:1,pricing:{baseTerritory:"USA",prices:[{price:"10.99",territory:"USA"}]},availableTerritories:"worldwide"}],availability:{availableInNewTerritories:!0,availableTerritories:"worldwide"},localizations:[{locale:"en-US",name:"Yearly Premium",description:"Yearly access to premium features"},{locale:"es-ES",name:"Premium Anual",description:"Acceso anual a funciones premium"}]}],dE={referenceName:"Premium Subscriptions",localizations:[{locale:"en-US",name:"Premium Subscriptions"},{locale:"es-ES",name:"Suscripciones Premium"}],subscriptions:bh},ss=[{productId:"com.mycompany.myapp.premium",type:"NON_CONSUMABLE",referenceName:"Premium",familySharable:!1,reviewNote:"Premium features unlock",pricing:{baseTerritory:"USA",prices:[{price:"49.99",territory:"USA"}]},availability:{availableInNewTerritories:!0,availableTerritories:"worldwide"},localizations:[{locale:"en-US",name:"Premium Upgrade",description:"Unlock all premium features"},{locale:"es-ES",name:"Premium",description:"Acceso a todas las funciones premium"}]},{productId:"com.mycompany.myapp.consumable",type:"CONSUMABLE",referenceName:"Coins",familySharable:!1,reviewNote:"Coins",pricing:{baseTerritory:"USA",prices:[{price:"2.99",territory:"USA"}]},availability:{availableInNewTerritories:!0,availableTerritories:"worldwide"},localizations:[{locale:"en-US",name:"Coins",description:"Coins to spend in the app"}]}],_h={schemaVersion:"1.0.0",appId:"1234567890",versionString:"2.1.17",pricing:{baseTerritory:"USA",prices:[{price:"0.99",territory:"USA"}]},availableTerritories:"worldwide",inAppPurchases:ss,subscriptionGroups:[dE],primaryLocale:"en-US",localizations:[{locale:"en-US",name:"My App",subtitle:"The best app ever",description:"The best app ever in the whole world",keywords:"best,app,ever",promotionalText:"The best app ever in the whole world",privacyPolicyUrl:"https://mycompany.com/privacy",privacyChoicesUrl:"https://mycompany.com/privacy-choices",marketingUrl:"https://mycompany.com/marketing",supportUrl:"https://mycompany.com/support",whatsNew:"Bug fixes and improvements"}],copyright:"\xA9 2025 My Company"},pE={..._h,pricing:{baseTerritory:"USA",prices:[{price:"0.0",territory:"USA"}]},inAppPurchases:void 0,subscriptionGroups:void 0},hE={command:"example",describe:"Generate example JSON files for different data types",builder:{type:{alias:"t",describe:"Type of example to generate",choices:["minimal","full","subscription","iap","in-app-purchase"],type:"string"},file:{alias:"f",describe:`Path to the output JSON file. Defaults to ${gh(kr.DEFAULT_CONFIG_FILENAME)} in current directory.`,demandOption:!1,type:"string"}},handler:async e=>{let r=e.type,t=e.file||gh(kr.DEFAULT_CONFIG_FILENAME);r||(r=await fE());let i={minimal:pE,full:_h,subscription:bh,iap:ss,"in-app-purchase":ss}[r];if(!i)throw new Error(`Unknown example type: ${r}`);try{yh.writeFileSync(t,JSON.stringify(i,null,2)),kr.logger.info(`Successfully generated example and wrote to ${t}`)}catch(a){throw new kr.ContextualError("Failed to write example file",a)}}},wh=hE;var Oh=C(K());var Eh=C(require("inquirer"));async function Sh(){let{secretKey:e}=await Eh.default.prompt([{type:"password",name:"secretKey",message:"Enter your StoreConfig Secret Key:",mask:"*"}]);return e.trim()}var gE={command:"configure",describe:"Configure StoreConfig with the Secret Key",handler:async e=>{let r=await Sh();if(!r)throw new Error("Secret key cannot be empty");Kt.saveKey(r),Oh.logger.info("\u2705 Secret key saved successfully! Add Apple credentials now (storeconfig apple) if you haven't already.")}},Ph=gE;var Ah=C(require("fs")),vr=C(K());var us=class{constructor(){}async configureAppleCredentials(r,t,n){(0,vr.validateFileExists)(n,{fileDescription:"Apple private key (.p8 file)"});let i=this.readPrivateKeyFile(n);this.validatePrivateKey(i),vr.logger.info("Sending Apple credentials to backend..."),await this.sendCredentialsToBackend(r,t,i),vr.logger.info("\u2705 Apple credentials stored successfully!")}readPrivateKeyFile(r){try{return Ah.default.readFileSync(r,"utf8")}catch(t){throw new vr.ContextualError(`Failed to read private key file at ${r}`,t)}}validatePrivateKey(r){if(!r.includes("BEGIN PRIVATE KEY")&&!r.includes("BEGIN RSA PRIVATE KEY"))throw new Error("Invalid private key file, the file does not appear to be a valid Apple private key (.p8 file)")}async sendCredentialsToBackend(r,t,n){let i=await oe.post("/auth",{keyId:t,issuerId:r,privateKey:n});i.data.message&&vr.logger.info(i.data.message)}},Th=new us;var mE={command:"apple",describe:"Add Apple credentials",builder:{"issuer-id":{describe:"Apple App Store Connect Issuer ID",demandOption:!0,type:"string"},"key-id":{describe:"Apple App Store Connect Key ID",demandOption:!0,type:"string"},"key-path":{describe:"Path to Apple private key (.p8 file)",demandOption:!0,type:"string"}},handler:async e=>{let r=e["issuer-id"],t=e["key-id"],n=e["key-path"];await Th.configureAppleCredentials(r,t,n)}},Nh=mE;var xh=C(K());var yE={command:"user",describe:"Display current user information and latest job status",builder:{},handler:async()=>{let e=await Ii(),r="";r+=`Email \u2192 ${e.user.email}`,e.currentJob&&(r+=`
90
90
  Latest Actions \u2192 ID: ${e.currentJob.id}, Status: ${e.currentJob.status}`,e.currentJob.error&&(r+=`
91
- Error: ${e.currentJob.error}`)),Ah.logger.std(r)}},Th=gE;process.env.DOTENV_CONFIG_SILENT="true";xh.default.config();zr.logger.setOutputModes([{mode:"console",showErrorStack:!1}]);zr.logger.setLevel("info");async function mE(){await(0,Mh.default)((0,Rh.hideBin)(process.argv)).middleware(r=>{let t=["fetch","apply","set-price","compare-price","apple","user"],n=r._[0];t.includes(n)&&Rp()}).command(Pp).command(jp).command(Bp).command(uh).command(fh).command(vh).command(Eh).command(Ph).command(Th).demandCommand(1,"Please specify a command").strict().fail(async(r,t,n)=>{r&&(zr.logger.error(r,"Use 'storeconfig --help' to see available commands and options."),process.exit(1))}).help().parseAsync()}mE().catch(e=>{let r="unknown";try{r=(process.argv?.slice(2)||[])[0]||"unknown"}catch{r="unknown"}let t=(0,zr.processNestedErrors)(e,!1);zr.logger.error(`Command '${r}' failed`,t),Nh.default.notify(e,n=>{n.addMetadata("metadata",{command:r,context:t})}),process.exitCode=1});
91
+ Error: ${e.currentJob.error}`)),xh.logger.std(r)}},Mh=yE;zr.logger.setOutputModes([{mode:"console",showErrorStack:!1}]);zr.logger.setLevel("info");async function vE(){await(0,Ih.default)((0,Dh.hideBin)(process.argv)).middleware(r=>{let t=["fetch","apply","set-price","compare-price","apple","user"],n=r._[0];t.includes(n)&&Cp()}).command(Np).command(zp).command(Wp).command(fh).command(hh).command(wh).command(Ph).command(Nh).command(Mh).demandCommand(1,"Please specify a command").strict().fail(async(r,t,n)=>{r&&(zr.logger.error(r,"Use 'storeconfig --help' to see available commands and options."),process.exit(1))}).help().parseAsync()}vE().catch(e=>{let r="unknown";try{r=(process.argv?.slice(2)||[])[0]||"unknown"}catch{r="unknown"}let t=(0,zr.processNestedErrors)(e,!1);zr.logger.error(`Command '${r}' failed`,t),Rh.default.notify(e,n=>{n.addMetadata("metadata",{command:r,context:t})}),process.exitCode=1});
92
92
  /*! Bundled license information:
93
93
 
94
94
  safe-buffer/index.js: