storeconfig 0.0.6 → 0.0.7

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 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(`
2
+ "use strict";var Qg=Object.create;var Ps=Object.defineProperty;var em=Object.getOwnPropertyDescriptor;var rm=Object.getOwnPropertyNames;var tm=Object.getPrototypeOf,nm=Object.prototype.hasOwnProperty;var m=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var im=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of rm(r))!nm.call(e,i)&&i!==t&&Ps(e,i,{get:()=>r[i],enumerable:!(n=em(r,i))||n.enumerable});return e};var C=(e,r,t)=>(t=e!=null?Qg(tm(e)):{},im(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"],o=["fileName","functionName","source"],s=["args"],u=["evalOrigin"],d=n.concat(i,o,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;_<o.length;_++)h.prototype["get"+r(o[_])]=t(o[_]),h.prototype["set"+r(o[_])]=(function(S){return function(g){this[S]=String(g)}})(o[_]);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 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(`
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((EE,Ms)=>{Ms.exports=om;function om(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((eo,Is)=>{(function(e,r){"use strict";typeof define=="function"&&define.amd?define("stack-generator",["stackframe"],r):typeof eo=="object"?Is.exports=r(Xi()):e.StackGenerator=r(e.StackFrame)})(eo,function(e){return{backtrace:function(t){var n=[],i=10;typeof t=="object"&&typeof t.maxStackSize=="number"&&(i=t.maxStackSize);for(var o=arguments.callee;o&&n.length<i&&o.arguments;){for(var s=new Array(o.arguments.length),u=0;u<s.length;++u)s[u]=o.arguments[u];/function(?:\s+([\w$]+))+\s*\(/.test(o.toString())?n.push(new e({functionName:RegExp.$1||void 0,args:s})):n.push(new e({args:s}));try{o=o.caller}catch{break}}return n}}})});var qs=m((SE,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 o=e.apply(this,n),s=n[n.length-1];return typeof o=="function"&&o!==s&&Object.keys(s).forEach(function(u){o[u]=s[u]}),o}}});var to=m((OE,ro)=>{var $s=qs();ro.exports=$s(cn);ro.exports.strict=$s(js);cn.proto=cn(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return cn(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return js(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 js(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((PE,Fs)=>{var am=to(),sm=function(){},um=global.Bare?queueMicrotask:process.nextTick.bind(process),lm=function(e){return e.setHeader&&typeof e.abort=="function"},cm=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},Us=function(e,r,t){if(typeof r=="function")return Us(e,null,r);r||(r={}),t=am(t||sm);var n=e._writableState,i=e._readableState,o=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,o||t.call(e)},y=function(){o=!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(){um(g)},g=function(){if(!u){if(o&&!(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 lm(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)),cm(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=Us});var Hs=m((AE,Bs)=>{var fm=to(),dm=ks(),fn;try{fn=require("fs")}catch{}var vt=function(){},pm=typeof process>"u"?!1:/^v?\.0/.test(process.version),dn=function(e){return typeof e=="function"},hm=function(e){return!pm||!fn?!1:(e instanceof(fn.ReadStream||vt)||e instanceof(fn.WriteStream||vt))&&dn(e.close)},gm=function(e){return e.setHeader&&dn(e.abort)},mm=function(e,r,t,n){n=fm(n);var i=!1;e.on("close",function(){i=!0}),dm(e,{readable:r,writable:t},function(s){if(s)return n(s);i=!0,n()});var o=!1;return function(s){if(!i&&!o){if(o=!0,hm(e))return e.close(vt);if(gm(e))return e.abort();if(dn(e.destroy))return e.destroy();n(s||new Error("stream was destroyed"))}}},zs=function(e){e()},ym=function(e,r){return e.pipe(r)},vm=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,o){var s=o<e.length-1,u=o>0;return mm(i,s,u,function(d){t||(t=d),d&&n.forEach(zs),!s&&(n.forEach(zs),r(t))})});return e.reduce(ym)};Bs.exports=vm});var Ws=m((TE,Jr)=>{var no=require("stream"),bm=require("util"),_m=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 ar(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 ar(r);return e.pipe(t),t}Jr.exports.LineStream=ar;function ar(e){no.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 no.Readable&&(r.encoding=t._readableState.encoding)})}bm.inherits(ar,no.Transform);ar.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)};ar.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;_m.setImmediate(function(){i._pushBuffer(e,r,t)});return}}t()};ar.prototype._flush=function(e){this._pushBuffer(this._chunkEncoding,0,e)};ar.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,io)=>{(function(e){if(typeof Ys=="object"&&typeof io<"u")io.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 a(f,l,p,v){v===void 0&&(v=new Date),this.type=p,this.message=f,this.metadata=l,this.timestamp=v}var c=a.prototype;return c.toJSON=function(){return{type:this.type,name:this.message,timestamp:this.timestamp,metaData:this.metadata}},a})(),i=n,o=["navigation","request","process","log","user","state","error","manual"],s=function(a,c,f){for(var l=f,p=0,v=a.length;p<v;p++)l=c(l,a[p],p,a);return l},u=function(a,c){return s(a,function(f,l,p,v){return c(l,p,v)?f.concat(l):f},[])},d=function(a,c){return s(a,function(f,l,p,v){return f===!0||l===c},!1)},h=function(a){return Object.prototype.toString.call(a)==="[object Array]"},y=!{toString:null}.propertyIsEnumerable("toString"),b=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],_=function(a){var c=[],f;for(f in a)Object.prototype.hasOwnProperty.call(a,f)&&c.push(f);if(!y)return c;for(var l=0,p=b.length;l<p;l++)Object.prototype.hasOwnProperty.call(a,b[l])&&c.push(b[l]);return c},S=function(a,c){return a===void 0&&(a=1),c===void 0&&(c=1/0),function(f){return typeof f=="number"&&parseInt(""+f,10)===f&&f>=a&&f<=c}},g=function(a){return typeof a=="function"||h(a)&&u(a,function(c){return typeof c=="function"}).length===a.length},w=function(a){return typeof a=="string"&&!!a.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(a){return a===void 0||w(a)}},appType:{defaultValue:function(){},message:"should be a string",validate:function(a){return a===void 0||w(a)}},autoDetectErrors:{defaultValue:function(){return!0},message:"should be true|false",validate:function(a){return a===!0||a===!1}},enabledErrorTypes:{defaultValue:function(){return D()},message:"should be an object containing the flags { unhandledExceptions:true|false, unhandledRejections:true|false }",allowPartialObject:!0,validate:function(a){if(typeof a!="object"||!a)return!1;var c=_(a),f=_(D());return!(u(c,function(l){return d(f,l)}).length<c.length||u(_(a),function(l){return typeof a[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(a){return typeof a>"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(a){return a&&typeof a=="object"&&w(a.notify)&&w(a.sessions)&&u(_(a),function(c){return!d(["notify","sessions"],c)}).length===0}},autoTrackSessions:{defaultValue:function(a){return!0},message:"should be true|false",validate:function(a){return a===!0||a===!1}},enabledReleaseStages:{defaultValue:function(){return null},message:"should be an array of strings",validate:function(a){return a===null||h(a)&&u(a,function(c){return typeof c=="string"}).length===a.length}},releaseStage:{defaultValue:function(){return"production"},message:"should be a string",validate:function(a){return typeof a=="string"&&a.length}},maxBreadcrumbs:{defaultValue:function(){return 25},message:"should be a number \u2264100",validate:function(a){return S(0,100)(a)}},enabledBreadcrumbTypes:{defaultValue:function(){return o},message:"should be null or a list of available breadcrumb types ("+o.join(",")+")",validate:function(a){return a===null||h(a)&&s(a,function(c,f){return c===!1?c:d(o,f)},!0)}},context:{defaultValue:function(){},message:"should be a string",validate:function(a){return a===void 0||typeof a=="string"}},user:{defaultValue:function(){return{}},message:"should be an object with { id, email, name } properties",validate:function(a){return a===null||a&&s(_(a),function(c,f){return c&&d(["id","email","name"],f)},!0)}},metadata:{defaultValue:function(){return{}},message:"should be an object",validate:function(a){return typeof a=="object"&&a!==null}},logger:{defaultValue:function(){},message:"should be null or an object with methods { debug, info, warn, error }",validate:function(a){return!a||a&&s(["debug","info","warn","error"],function(c,f){return c&&typeof a[f]=="function"},!0)}},redactedKeys:{defaultValue:function(){return["password"]},message:"should be an array of strings|regexes",validate:function(a){return h(a)&&a.length===u(a,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(a){return h(a)&&a.length===u(a,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(a){return h(a)&&a.length===u(a,function(c){return c&&typeof c=="object"&&typeof c.name=="string"}).length}},reportUnhandledPromiseRejectionsAsHandled:{defaultValue:function(){return!1},message:"should be true|false",validate:function(a){return a===!0||a===!1}},sendPayloadChecksums:{defaultValue:function(){return!1},message:"should be true|false",validate:function(a){return a===!0||a===!1}}};var $=xs(),P=function(a){for(var c=1;c<arguments.length;c++){var f=arguments[c];for(var l in f)Object.prototype.hasOwnProperty.call(f,l)&&(a[l]=f[l])}return a},L=function(a,c){return s(a,function(f,l,p,v){return f.concat(c(l,p,v))},[])},z=function(a,c,f,l){var p=l&&l.redactedKeys?l.redactedKeys:[],v=l&&l.redactedPaths?l.redactedPaths:[];return JSON.stringify(R(a,p,v),c,f)},Y=20,B=25e3,G=8,j="...";function Z(a){return a instanceof Error||/^\[object (Error|(Dom)?Exception)\]$/.test(Object.prototype.toString.call(a))}function ne(a){return"[Throws: "+(a?a.message:"?")+"]"}function te(a,c){for(var f=0,l=a.length;f<l;f++)if(a[f]===c)return!0;return!1}function ce(a,c){for(var f=0,l=a.length;f<l;f++)if(c.indexOf(a[f])===0)return!0;return!1}function fe(a,c){for(var f=0,l=a.length;f<l;f++)if(typeof a[f]=="string"&&a[f].toLowerCase()===c.toLowerCase()||a[f]&&typeof a[f].test=="function"&&a[f].test(c))return!0;return!1}function $e(a){return Object.prototype.toString.call(a)==="[object Array]"}function O(a,c){try{return a[c]}catch(f){return ne(f)}}function R(a,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 j;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 U=v(E.toJSON(),x);return l.pop(),U}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=[],or=0,De=E.length;or<De;or++){if(M()){ye.push(j);break}ye.push(v(E[or],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]=j;break}Vr[We]=v(O(E,We),x.concat(We))}}catch{}return l.pop(),Vr}return v(a,[])}function V(a,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"){a[p]={name:f,variant:l};return}a.push({name:f,variant:l}),c[f]=a.length-1}}function ue(a,c,f){if(h(c)){for(var l=0;l<c.length;++l){var p=c[l];p===null||typeof p!="object"||V(a,f,p.name,p.variant)}return a}}function q(a){return L(u(a,Boolean),function(c){var f=c.name,l=c.variant,p={featureFlag:f};return typeof l=="string"&&(p.variant=l),p})}function _e(a,c,f){var l=c[f];typeof l=="number"&&(a[l]=null,delete c[f])}var de={add:V,clear:_e,merge:ue,toEventApi:q},Ne=function(a){return!!a&&(!!a.stack||!!a.stacktrace||!!a["opera#sourceloc"])&&typeof(a.stack||a.stacktrace||a["opera#sourceloc"])=="string"&&a.stack!==a.name+": "+a.message},je=Rs(),Br=function(a,c,f,l){var p;if(c){var v;if(f===null)return Hr(a,c);typeof f=="object"&&(v=f),typeof f=="string"&&(v=(p={},p[f]=l,p)),v&&(c==="__proto__"||c==="constructor"||c==="prototype"||(a[c]||(a[c]={}),a[c]=P({},a[c],v)))}},er=function(a,c,f){if(typeof c=="string"){if(!f)return a[c];if(a[c])return a[c][f]}},Hr=function(a,c,f){if(typeof c=="string"){if(!f){delete a[c];return}c==="__proto__"||c==="constructor"||c==="prototype"||a[c]&&delete a[c][f]}},ie={add:Br,get:er,clear:Hr};function rr(){return rr=Object.assign?Object.assign.bind():function(a){for(var c=1;c<arguments.length;c++){var f=arguments[c];for(var l in f)({}).hasOwnProperty.call(f,l)&&(a[l]=f[l])}return a},rr.apply(null,arguments)}var ht=Ds(),Se=(function(){function a(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,a.__type,p)]}var c=a.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}},a})(),Gr=function(a){var c={file:a.fileName,method:Re(a.functionName),lineNumber:a.lineNumber,columnNumber:a.columnNumber,code:void 0,inProject:void 0};return c.lineNumber>-1&&!c.file&&!c.method&&(c.file="global code"),c},Re=function(a){return/^global code$/i.test(a)?"global code":a},tr=function(){return{unhandled:!1,severity:"warning",severityReason:{type:"handledException"}}},Zt=function(a){return typeof a=="string"?a:""};function nr(a,c,f,l){return{errorClass:Zt(a),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(a){return a.cause?[a].concat(Ge(a.cause)):[a]}Se.getStacktrace=function(a,c,f){if(Ne(a))return $.parse(a).slice(c);try{return u(ht.backtrace(),function(l){return(l.functionName||"").indexOf("StackGenerator$$")===-1}).slice(1+f)}catch{return[]}},Se.create=function(a,c,f,l,p,v){p===void 0&&(p=0);var E=Xt(a,c,l,v),x=E[0],M=E[1],U;try{var H=Se.getStacktrace(x,M>0?1+M+p:0,1+p);U=new Se(x.name,x.message,H,f,a)}catch{U=new Se(x.name,x.message,[],f,a)}if(x.name==="InvalidError"&&U.addMetadata(""+l,"non-error parameter",Wr(a)),x.cause){var pe,ye=Ge(x).slice(1),or=L(ye,function(De){var Vr=je(De)&&Ne(De)?$.parse(De):[],We=Xt(De,!0,"error cause"),Kr=We[0];return Kr.name==="InvalidError"&&U.addMetadata("error cause",Wr(De)),nr(Kr.name,Kr.message,Se.__type,Vr)});(pe=U.errors).push.apply(pe,or)}return U};var Wr=function(a){return a===null?"null":a===void 0?"undefined":a},Xt=function(a,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 U=new Error(f+" "+M+' a non-error. See "'+f+'" tab for more detail.');return U.name="InvalidError",U};if(!c)je(a)?p=a:(p=E(typeof a),v+=2);else switch(typeof a){case"string":case"number":case"boolean":p=new Error(String(a)),v+=1;break;case"function":p=E("function"),v+=2;break;case"object":a!==null&&je(a)?p=a:a!==null&&Qt(a)?(p=new Error(a.message||a.errorMessage),p.name=a.name||a.errorClass,v+=1):(p=E(a===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(a){return(typeof a.name=="string"||typeof a.errorClass=="string")&&(typeof a.message=="string"||typeof a.errorMessage=="string")},en=Se,Lh=function(a,c,f){var l=0,p=function(){if(l>=a.length)return f(null,!0);c(a[l],function(v,E){if(v)return f(v);if(E===!1)return f(null,!1);l++,p()})};p()},qh=function(a,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,U){if(M)return f(M),E(null);E(null,U)})}catch(M){f(M),E(null)}};Lh(a,p,l)},qi=function(a,c,f,l){for(var p=!1,v=a.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)},$h=require("os");function jh(){try{return $h.hostname()}catch{return process.env._CLUSTER_NETWORK_NAME_||process.env.COMPUTERNAME||"hostname"}}var ls=2,Uh=rn(process.pid.toString(36),ls),cs=jh(),Fh=cs.length,kh=rn(cs.split("").reduce(function(a,c){return+a+c.charCodeAt(0)},+Fh+36).toString(36),ls),fs=function(){return Uh+kh},zh=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 Bh(){return gt=gt<ds?gt:0,gt++,gt-1}function ji(){var a="c",c=new Date().getTime().toString(tn),f=rn(Bh().toString(tn),$i),l=fs(),p=ps()+ps();return a+c+f+l+p}ji.fingerprint=fs,ji.isCuid=zh;var Hh=ji,Gh=(function(){function a(){this.id=Hh(),this.startedAt=new Date,this._handled=0,this._unhandled=0,this._user={},this.app={},this.device={}}var c=a.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},a})(),Ui=Gh,Wh=de.add,Yh=de.clear,Fi=de.merge,Vh="00000",Kh="https://notify.insighthub.smartbear.com",Jh="https://sessions.insighthub.smartbear.com",ir=function(){},Zh=(function(){function a(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=a,this.Event=en,this.Breadcrumb=i,this.Session=Ui,this._config=this._configure(f,p),L(p.concat(this._config.plugins),function(U){U&&E._loadPlugin(U)}),this._depth=1;var x=this,M=this.notify;this.notify=function(){return M.apply(x,arguments)}}var c=a.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),Wh(this._features,this._featuresIndex,l,p)},c.addFeatureFlags=function(l){Fi(this._features,l,this._featuresIndex)},c.clearFeatureFlag=function(l){Yh(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(U,H){return H&&H.configSchema?P({},U,H.configSchema):U},this._schema);l.endpoints||(l.sendPayloadChecksums="sendPayloadChecksums"in l?l.sendPayloadChecksums:!0);var E=s(_(v),function(U,H){var pe=v[H].defaultValue(l[H]);if(l[H]!==void 0){var ye=v[H].validate(l[H]);ye?v[H].allowPartialObject?U.config[H]=P(pe,l[H]):U.config[H]=l[H]:(U.errors[H]=v[H].message,U.config[H]=pe)}else U.config[H]=pe;return U},{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(Vh)&&(M.endpoints={notify:Kh,sessions:Jh})}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(Xh(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 Ui;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(o,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)},U=[].concat(this._cbs.e).concat(p);qh(U,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")&&a.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)})})},a})(),Xh=function(a,c){var f=new Error(`Invalid configuration
12
+ `+L(_(a),function(l){return" - "+l+" "+a[l]+", got "+Qh(c[l])}).join(`
13
13
 
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!
14
+ `));return f},Qh=function(a){switch(typeof a){case"string":case"number":case"object":return JSON.stringify(a);default:return String(a)}},nn=Zh,on={},hs=["events.[].metaData","events.[].breadcrumbs.[].metaData","events.[].request"];on.event=function(a,c){var f=z(a,null,null,{redactedPaths:hs,redactedKeys:c});return f.length>1e6&&(a.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: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(`
16
+ metadata was removed`},f=z(a,null,null,{redactedPaths:hs,redactedKeys:c})),f},on.session=function(a,c){var f=z(a,null,null);return f};var eg=require("http"),rg=require("https"),tg=require("url"),ng=tg.parse,gs=function(a,c){var f=a.url,l=a.headers,p=a.body,v=a.agent,E=!1,x=function(ye){E||(E=!0,c(ye))},M=ng(f),U=M.protocol==="https:",H=U?rg:eg,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){ig(ye,function(or,De){if(or)return x(or);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()},ig=function(a,c){var f="";a.on("error",c),a.setEncoding("utf8"),a.on("data",function(l){f+=l}),a.on("end",function(){return c(null,f)})},og=function(a){return{sendEvent:function(c,f){f===void 0&&(f=function(){});var l=on.event(c,a._config.redactedKeys),p=function(E){E&&a._logger.error(`Event failed to send\u2026
18
+ `+(E&&E.stack?E.stack:E),E),l.length>1e6&&a._logger.warn("Event oversized ("+(l.length/1e6).toFixed(2)+" MB)"),f(E)};if(a._config.endpoints.notify===null){var v=new Error("Event not sent due to incomplete endpoint configuration");return p(v)}try{gs({url:a._config.endpoints.notify,headers:{"Content-Type":"application/json","Bugsnag-Api-Key":c.apiKey||a._config.apiKey,"Bugsnag-Payload-Version":"4","Bugsnag-Sent-At":new Date().toISOString()},body:l,agent:a._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&&a._logger.error(`Session failed to send\u2026
19
+ `+(v&&v.stack?v.stack:v),v),f(v)};if(a._config.endpoints.session===null){var p=new Error("Session not sent due to incomplete endpoint configuration");return l(p)}try{gs({url:a._config.endpoints.sessions,headers:{"Content-Type":"application/json","Bugsnag-Api-Key":a._config.apiKey,"Bugsnag-Payload-Version":"1","Bugsnag-Sent-At":new Date().toISOString()},body:on.session(c,a._config.redactedKeys),agent:a._config.agent},function(v){return l(v)})}catch(v){l(v)}}}};function mt(){return mt=Object.assign?Object.assign.bind():function(a){for(var c=1;c<arguments.length;c++){var f=arguments[c];for(var l in f)({}).hasOwnProperty.call(f,l)&&(a[l]=f[l])}return a},mt.apply(null,arguments)}var ki=T.schema,ag=require("os"),sg=require("util"),ug=sg.inspect,lg={appType:mt({},ki.appType,{defaultValue:function(){return"node"}}),projectRoot:{defaultValue:function(){return process.cwd()},validate:function(a){return a===null||w(a)},message:"should be string"},hostname:{defaultValue:function(){return ag.hostname()},message:"should be a string",validate:function(a){return a===null||w(a)}},logger:mt({},ki.logger,{defaultValue:function(){return cg()}}),releaseStage:mt({},ki.releaseStage,{defaultValue:function(){return process.env.NODE_ENV||"production"}}),agent:{defaultValue:function(){},message:"should be an HTTP(s) agent",validate:function(a){return a===void 0||fg(a)}},onUncaughtException:{defaultValue:function(){return function(a,c,f){f.error("Uncaught exception"+ys(c)+`, the process will now terminate\u2026
20
+ `+ms(a)),process.exit(1)}},message:"should be a function",validate:function(a){return typeof a=="function"}},onUnhandledRejection:{defaultValue:function(){return function(a,c,f){f.error("Unhandled rejection"+ys(c)+`\u2026
21
+ `+ms(a))}},message:"should be a function",validate:function(a){return typeof a=="function"}}},ms=function(a){return a&&a.stack?a.stack:ug(a)},cg=function(){return["debug","info","warn","error"].reduce(function(a,c){var f=console[c]||console.log;return a[c]=f.bind(console,"[bugsnag]"),a},{})},ys=function(a){return a.request&&Object.keys(a.request).length?" at "+a.request.httpMethod+" "+(a.request.path||a.request.url):""},fg=function(a){return typeof a=="object"&&a!==null||typeof a=="boolean"},vs=new Date,dg=function(){vs=new Date},pg={name:"appDuration",load:function(a){return a.addOnError(function(c){var f=new Date;c.app.duration=f-vs},!0),{reset:dg}}},zi={};zi.load=function(a){var c=/^(local-)?dev(elopment)?$/.test(a._config.releaseStage);c||!a._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];a.leaveBreadcrumb("Console output",s(v,function(x,M,U){var H="[Unknown value]";try{H=String(M)}catch{}if(H==="[object Object]")try{H=JSON.stringify(M)}catch{}return x["["+U+"]"]=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(a){typeof console[a]._restore=="function"&&console[a]._restore()})});var bs=u(["log","debug","info","warn","error"],function(a){return typeof console<"u"&&typeof console[a]=="function"}),Bi={},_s=[];Bi=function(a){var c=new a.Client({},{},[],a._notifier);return c._config=a._config,c._breadcrumbs=a._breadcrumbs.slice(),c._metadata=P({},a._metadata),c._features=[].concat(a._features),c._featuresIndex=P({},a._featuresIndex),c._user=P({},a._user),c._context=a._context,c._cbs={e:a._cbs.e.slice(),s:a._cbs.s.slice(),sp:a._cbs.sp.slice(),b:a._cbs.b.slice()},c._logger=a._logger,c._delivery=a._delivery,c._sessionDelegate=a._sessionDelegate,_s.forEach(function(f){f(c)}),c},Bi.registerCallback=function(a){_s.push(a)};var Yr={};Yr.getStack=function(){return new Error().stack.split(`
22
22
  `).slice(3).join(`
23
- `)},Yr.maybeUseFallbackStack=function(o,c){var f=o.stack.split(`
24
- `);return(f.length===1||f.length===2&&/at Error \(native\)/.test(f[1]))&&(o.stack=f[0]+`
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)
23
+ `)},Yr.maybeUseFallbackStack=function(a,c){var f=a.stack.split(`
24
+ `);return(f.length===1||f.length===2&&/at Error \(native\)/.test(f[1]))&&(a.stack=f[0]+`
25
+ `+c),a};var an={},hg=Yr.getStack;an={name:"contextualize",load:function(a){var c=function(f,l){var p=hg(),v=Bi(a);v.fallbackStack=p,v.addOnError(l),a._clientContext.run(v,f)};return c}},an.default=an;var sn={},gg=Yr.getStack,mg=Yr.maybeUseFallbackStack;sn={name:"intercept",load:function(a){var c=function(f,l){f===void 0&&(f=function(){}),typeof l!="function"&&(l=f,f=function(){});var p=gg();return function(v){if(v){v.stack&&mg(v,p);var E=a.Event.create(v,!0,{severity:"warning",unhandled:!1,severityReason:{type:"callbackErrorIntercept"}},"intercept()",1);a._notify(E,f);return}for(var x=arguments.length,M=new Array(x>1?x-1:0),U=1;U<x;U++)M[U-1]=arguments[U];l.apply(void 0,M)}};return c}},sn.default=sn;function un(){return un=Object.assign?Object.assign.bind():function(a){for(var c=1;c<arguments.length;c++){var f=arguments[c];for(var l in f)({}).hasOwnProperty.call(f,l)&&(a[l]=f[l])}return a},un.apply(null,arguments)}var yt=require("os"),yg={load:function(a){var c={osName:yt.platform()+" ("+yt.arch()+")",osVersion:yt.release(),totalMemory:yt.totalmem(),hostname:a._config.hostname,runtimeVersions:{node:process.versions.node}};a._addOnSessionPayload(function(f){f.device=un({},f.device,c)}),a.addOnError(function(f){f.device=un({},f.device,c,{freeMemory:yt.freemem(),time:new Date})},!0)}},ws=require("path"),vg=ws.join,bg=ws.resolve,Es=function(a){return vg(bg(a),"/")},_g={load:function(a){return a.addOnError(function(c){if(a._config.projectRoot){var f=Es(a._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(a){for(var c=1;c<arguments.length;c++){var f=arguments[c];for(var l in f)({}).hasOwnProperty.call(f,l)&&(a[l]=f[l])}return a},Hi.apply(null,arguments)}function wg(a,c){a.prototype=Object.create(c.prototype),a.prototype.constructor=a,Gi(a,c)}function Gi(a,c){return Gi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(f,l){return f.__proto__=l,f},Gi(a,c)}var Ss=3,Os=200,Eg=require("fs"),Sg=Eg.createReadStream,Og=require("stream"),Pg=Og.Writable,Ag=Hs(),Tg=Ws(),Ng=require("path"),xg={load:function(a){if(a._config.sendCode){var c=function(f,l){return new Promise(function(p,v){try{if(!f.lineNumber||!f.file)return p(f);var E=Ng.resolve(a._config.projectRoot,f.file),x=E+"@"+f.lineNumber;if(x in l)return f.code=l[x],p(f);Mg(E,f.lineNumber,function(M,U){return M||(f.code=l[x]=U),p(f)})}catch{return p(f)}})};a.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)},[]);Ig(E.map(function(x){return function(){return c(x,v)}})).then(l).catch(p)})})}},configSchema:{sendCode:{defaultValue:function(){return!0},validate:function(a){return a===!0||a===!1},message:"should be true or false"}}},Mg=function(a,c,f){var l=c-Ss,p=c+Ss,v=Sg(a,{encoding:"utf8"}),E=new Tg.LineStream({keepEmptyLines:!0}),x=new Rg({start:l,end:p});x.on("done",function(){return v.destroy()}),Ag(v,E,x,function(M){if(M&&M.message!=="premature close")return f(M);f(null,x.getCode())})},Rg=(function(a){function c(l){var p;return p=a.call(this,Hi({},l,{decodeStrings:!1}))||this,p._start=l.start,p._end=l.end,p._n=0,p._code={},p}wg(c,a);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})(Pg),Ig=function(a){return new Promise(function(c,f){var l=[];a.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))})})},Dg=Yr.maybeUseFallbackStack,Wi,Cg={load:function(a){a._config.autoDetectErrors&&a._config.enabledErrorTypes.unhandledExceptions&&(Wi=function(c){var f=a._clientContext&&a._clientContext.getStore(),l=f||a;c.stack&&l.fallbackStack&&Dg(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,Lg={load:function(a){!a._config.autoDetectErrors||!a._config.enabledErrorTypes.unhandledRejections||(ln=function(c){var f=a._clientContext&&a._clientContext.getStore(),l=f||a,p=!a._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)}},qg=Yi;function Yi(a){a=a||{},this.ms=a.min||100,this.max=a.max||1e4,this.factor=a.factor||2,this.jitter=a.jitter>0&&a.jitter<=1?a.jitter:0,this.attempts=0}Yi.prototype.duration=function(){var a=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var c=Math.random(),f=Math.floor(c*this.jitter*a);a=(Math.floor(c*10)&1)==0?a-f:a+f}return Math.min(a,this.max)|0},Yi.prototype.reset=function(){this.attempts=0};function $g(a,c){a.prototype=Object.create(c.prototype),a.prototype.constructor=a,Vi(a,c)}function Vi(a,c){return Vi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(f,l){return f.__proto__=l,f},Vi(a,c)}var jg=10*1e3,Ug=require("events").EventEmitter,Fg=(function(a){function c(l){var p;return p=a.call(this)||this,p._sessions=new Map,p._interval=null,p._intervalLength=l||jg,p._summarize=p._summarize.bind(p),p}$g(c,a);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=kg(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),kg=function(a){var c=new Date(a);return c.setSeconds(0),c.setMilliseconds(0),c.toISOString()},zg={load:function(a){var c=new Fg(a._config.sessionSummaryInterval);c.on("summary",Bg(a)),c.start(),a._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(a){return a===void 0||S()(a)},message:"should be a positive integer"}}},Bg=function(a){return function(c){if(a._config.enabledReleaseStages!==null&&!a._config.enabledReleaseStages.includes(a._config.releaseStage)){a._logger.warn("Session not sent due to releaseStage/enabledReleaseStages configuration");return}if(!c.length)return;var f=new qg({min:1e3,max:1e4}),l=10;v(p);function p(E){if(!E){var x=c.reduce(function(M,U){return M+U.sessionsStarted},0);return a._logger.debug(x+" session(s) reported")}if(f.attempts===10){a._logger.error("Session delivery failed, max retries exceeded",E);return}a._logger.debug("Session delivery failed, retry #"+(f.attempts+1)+"/"+l,E),setTimeout(function(){return v(p)},f.duration())}function v(E){var x={notifier:a._notifier,device:{},app:{releaseStage:a._config.releaseStage,version:a._config.appVersion,type:a._config.appType},sessionCounts:c},M=qi(a._cbs.sp,x,"onSessionPayload",a._logger);if(M)return a._logger.debug("Session not sent due to onSessionPayload callback"),E(null);a._delivery.sendSession(x,E)}}},Hg={load:function(a){a.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,"/"))})})}},Gg={load:function(a){return a.addOnError(function(c){if(a._config.projectRoot){var f=Es(a._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(a){for(var c=1;c<arguments.length;c++){var f=arguments[c];for(var l in f)({}).hasOwnProperty.call(f,l)&&(a[l]=f[l])}return a},Ki.apply(null,arguments)}var Wg="Bugsnag Node",Yg="8.6.0",Vg="https://github.com/bugsnag/bugsnag-js",Kg=require("async_hooks"),Jg=Kg.AsyncLocalStorage;en.__type="nodejs";var Zg=Ki({},T.schema,lg),Xg=[pg,xg,_g,Gg,zg,yg,Cg,Lg,sn,an,Hg,zi],Ie={_client:null,createClient:function(a){typeof a=="string"&&(a={apiKey:a}),a||(a={});var c=new nn(a,Zg,Xg,{name:Wg,version:Yg,url:Vg});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 Jg,c._setDelivery(og),c._logger.debug("Loaded!"),c},start:function(a){return Ie._client?(Ie._client._logger.warn("Bugsnag.start() was called more than once. Ignoring."),Ie._client):(Ie._client=Ie.createClient(a),Ie._client)},isStarted:function(){return Ie._client!=null}};return Object.keys(nn.prototype).forEach(function(a){/^_/.test(a)||(Ie[a]=function(){var c=Ie._client,f=c&&c._clientContext&&c._clientContext.getStore();if(f&&(c=f),!c)return console.error("Bugsnag."+a+"() was called before Bugsnag.start()");c._depth+=1;var l=c[a].apply(c,arguments);return c._depth-=1,l})}),br=Ie,br.Client=nn,br.Event=en,br.Session=Ui,br.Breadcrumb=i,br.default=Ie,br})});var oo=m((NE,Ks)=>{Ks.exports=Vs()});var pn=m(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.TerritoryCodeSchema=_r.territoryCodes=void 0;var Sm=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=Sm.z.enum(_r.territoryCodes)});var so=m(wr=>{"use strict";Object.defineProperty(wr,"__esModule",{value:!0});wr.LocaleCodeSchema=wr.localeCodes=void 0;var Om=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=Om.z.enum(wr.localeCodes)});var bt=m(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.ContextualError=void 0;Ye.isNotFoundError=Pm;Ye.isRateLimitError=Am;Ye.isNotAuthorizedError=Tm;Ye.isVersionNotUpdatableError=Nm;Ye.extractClientErrorToSend=Zs;var uo=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 Pm(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 Am(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 Tm(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 Nm(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 Zs(e){try{if(uo.isZodErrorLike&&(0,uo.isZodErrorLike)(e))return{message:(0,uo.fromError)(e).message,status:400}}catch{}if(e instanceof hn){let t=Er(e.context).flatMap(i=>Array.isArray(i.errors)?i.errors.map(o=>({title:o?.title,detail:o?.detail})):[]),n=e.message;if(e.context instanceof Error){let i=Zs(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=lo;Sr.readJsonFile=Im;Sr.validateAppStoreModelData=Cm;var xm=require("zod"),Mm=require("fs"),Rm=bt();function lo(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 o=0;o<r.length;o++)if(!t[o]&&lo(n,r[o])){t[o]=!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)||!lo(e[i],r[i]))return!1;return!0}return!1}function Im(e){let r=(0,Mm.readFileSync)(e,"utf-8");try{return JSON.parse(r)}catch(t){throw new Rm.ContextualError(`\u274C Invalid JSON format! ${e}`,{filePath:e,jsonError:t})}}var Dm=e=>/^[a-zA-Z0-9._]+$/.test(e);Sr.isValidProductId=Dm;function Cm(e,r){e.primaryLocale&&e.localizations&&e.localizations.length>0&&(e.localizations.some(n=>n.locale===e.primaryLocale)||r.addIssue({code:xm.z.ZodIssueCode.custom,message:`Primary locale '${e.primaryLocale}' must exist in the localizations array`,path:["primaryLocale"]}))}});var Xs=m((LE,Lm)=>{Lm.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 co=m(sr=>{"use strict";var qm=sr&&sr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(sr,"__esModule",{value:!0});sr.getValidIntroductoryOfferDurations=tu;sr.getValidPayAsYouGoPeriods=nu;sr.isValidIntroductoryOfferDuration=jm;sr.isValidPayAsYouGoPeriods=Um;var Qs=qm(Xs()),eu={ONE_WEEK:7,ONE_MONTH:30,TWO_MONTHS:60,THREE_MONTHS:90,SIX_MONTHS:180,ONE_YEAR:365},ru={PAY_AS_YOU_GO:"PayAsYouGo",PAY_UP_FRONT:"PayUpFront",FREE_TRIAL:"FreeTrial"};function $m(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 tu(e,r){if(r==="PAY_AS_YOU_GO")return[];let t=eu[e],n=ru[r],i=Qs.default.find(u=>u.duration===t);if(!i)throw new Error(`No duration configuration found for subscription period: ${e}`);let o=i.introOfferDurations.find(u=>u.modeType===n);if(!o)throw new Error(`No intro offer configuration found for offer type: ${r}`);let s=new Set;for(let u of o.durations){let d=$m(u.typeDuration,u.typeUnit);d&&s.add(d)}return Array.from(s)}function nu(e){let r=eu[e],t=ru.PAY_AS_YOU_GO,n=Qs.default.find(o=>o.duration===r);if(!n)throw new Error(`No duration configuration found for subscription period: ${e}`);let i=n.introOfferDurations.find(o=>o.modeType===t);if(!i)throw new Error(`No PAY_AS_YOU_GO configuration found for subscription period: ${e}`);return i.durations.map(o=>o.numberOfPeriods)}function jm(e,r,t){return r==="PAY_AS_YOU_GO"?!1:tu(e,r).includes(t)}function Um(e,r){return nu(e).includes(r)}});var we=m(($E,iu)=>{"use strict";var fo=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)}};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+=`
29
+ `),Error.captureStackTrace(this,e)}};iu.exports=e=>{if(e.length>2)throw new fo(e);function r(n={}){this.options=n}r.prototype.transform=e;function t(n){return new r(n)}return t.Format=r,t}});var uu=m((jE,su)=>{var au={};su.exports=au;var ou={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(ou).forEach(function(e){var r=ou[e],t=au[e]=[];t.open="\x1B["+r[0]+"m",t.close="\x1B["+r[1]+"m"})});var cu=m((UE,lu)=>{"use strict";lu.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 du=m((FE,fu)=>{"use strict";var Fm=require("os"),Ce=cu(),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 km(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function zm(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=Fm.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 po(e){var r=zm(e);return km(r)}fu.exports={supportsColor:po,stdout:po(process.stdout),stderr:po(process.stderr)}});var hu=m((kE,pu)=>{pu.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(o){o=o.toLowerCase();var s=i[o]||[" "],u=Math.floor(Math.random()*s.length);typeof i[o]<"u"?n+=i[o][u]:n+=o}),n}});var mu=m((zE,gu)=>{gu.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 o(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=o(8),b.mid=o(2),b.down=o(8);break;case"maxi":b.up=o(16)+3,b.mid=o(4)+1,b.down=o(64)+3;break;default:b.up=o(8)+1,b.mid=o(6)/2,b.down=o(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][o(n[w].length)])}return y}return u(r,t)}});var vu=m((BE,yu)=>{yu.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 _u=m((HE,bu)=>{bu.exports=function(e){return function(r,t,n){return t%2===0?r:e.inverse(r)}}});var Eu=m((GE,wu)=>{wu.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 Ou=m((WE,Su)=>{Su.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 Mu=m((VE,xu)=>{var k={};xu.exports=k;k.themes={};var Bm=require("util"),Or=k.styles=uu(),Au=Object.defineProperties,Hm=new RegExp(/[\r\n]+/g);k.supportsColor=du().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 YE=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},Gm=/[|\\{}()[\]^$+*?.]/g,Wm=function(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(Gm,"\\$&")};function Tu(e){var r=function t(){return Vm.apply(t,arguments)};return r._styles=e,r.__proto__=Ym,r}var Nu=(function(){var e={};return Or.grey=Or.gray,Object.keys(Or).forEach(function(r){Or[r].closeRe=new RegExp(Wm(Or[r].close),"g"),e[r]={get:function(){return Tu(this._styles.concat(r))}}}),e})(),Ym=Au(function(){},Nu);function Vm(){var e=Array.prototype.slice.call(arguments),r=e.map(function(s){return s!=null&&s.constructor===String?s:Bm.inspect(s)}).join(" ");if(!k.enabled||!r)return r;for(var t=r.indexOf(`
30
+ `)!=-1,n=this._styles,i=n.length;i--;){var o=Or[n[i]];r=o.open+r.replace(o.closeRe,o.open)+o.close,t&&(r=r.replace(Hm,function(s){return o.close+s+o.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 o in e[t])i=k[e[t][o]](i);return i}return k[e[t]](n)}})(r)};function Km(){var e={};return Object.keys(Nu).forEach(function(r){e[r]={get:function(){return Tu([r])}}}),e}var Jm=function(r,t){var n=t.split("");return n=n.map(r),n.join("")};k.trap=hu();k.zalgo=mu();k.maps={};k.maps.america=vu()(k);k.maps.zebra=_u()(k);k.maps.rainbow=Eu()(k);k.maps.random=Ou()(k);for(Pu in k.maps)(function(e){k[e]=function(r){return Jm(k.maps[e],r)}})(Pu);var Pu;Au(k,Km())});var ho=m((KE,Ru)=>{var Zm=Mu();Ru.exports=Zm});var Iu=m(go=>{"use strict";go.levels={error:0,warn:1,help:2,data:3,info:4,debug:5,prompt:6,verbose:7,input:8,silly:9};go.colors={error:"red",warn:"yellow",help:"cyan",data:"grey",info:"green",debug:"blue",prompt:"grey",verbose:"cyan",input:"grey",silly:"magenta"}});var Du=m(mo=>{"use strict";mo.levels={error:0,warn:1,info:2,http:3,verbose:4,debug:5,silly:6};mo.colors={error:"red",warn:"yellow",info:"green",http:"green",verbose:"cyan",debug:"blue",silly:"magenta"}});var Cu=m(yo=>{"use strict";yo.levels={emerg:0,alert:1,crit:2,error:3,warning:4,notice:5,info:6,debug:7};yo.colors={emerg:"red",alert:"yellow",crit:"red",error:"red",warning:"red",notice:"yellow",info:"green",debug:"blue"}});var Lu=m(mn=>{"use strict";Object.defineProperty(mn,"cli",{value:Iu()});Object.defineProperty(mn,"npm",{value:Du()});Object.defineProperty(mn,"syslog",{value:Cu()})});var oe=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:Lu()})});var bn=m((rS,vn)=>{"use strict";var _o=ho(),{LEVEL:vo,MESSAGE:bo}=oe();_o.enabled=!0;var qu=/\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]=qu.test(r[i])?r[i].split(qu):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 _o[e.allColors[r]](n);for(let i=0,o=e.allColors[r].length;i<o;i++)n=_o[e.allColors[r][i]](n);return n}transform(r,t){return t.all&&typeof r[bo]=="string"&&(r[bo]=this.colorize(r[vo],r.level,r[bo])),(t.level||t.all||!t.message)&&(r.level=this.colorize(r[vo],r.level)),(t.all||t.message)&&(r.message=this.colorize(r[vo],r.level,r.message)),r}};vn.exports=e=>new yn(e);vn.exports.Colorizer=vn.exports.Format=yn});var ju=m((tS,$u)=>{"use strict";var{Colorizer:Xm}=bn();$u.exports=e=>(Xm.addColors(e.colors||e),e)});var Fu=m((nS,Uu)=>{"use strict";var Qm=we();Uu.exports=Qm(e=>(e.message=` ${e.message}`,e))});var Bu=m((iS,zu)=>{"use strict";var ey=we(),{LEVEL:ku,MESSAGE:wo}=oe();zu.exports=ey((e,{stack:r,cause:t})=>{if(e instanceof Error){let i=Object.assign({},e,{level:e.level,[ku]:e[ku]||e.level,message:e.message,[wo]:e[wo]||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[wo]=n.message,r&&(e.stack=n.stack),t&&(e.cause=n.cause),e})});var So=m((oS,wn)=>{"use strict";var{configs:ry,LEVEL:Hu,MESSAGE:Eo}=oe(),_n=class e{constructor(r={levels:ry.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,o=Math.floor(i/t.length);return`${t}${t.repeat(o)}`.slice(0,i)}static paddingForLevels(r,t=" "){let n=e.getLongestLevel(r);return Object.keys(r).reduce((i,o)=>(i[o]=e.paddingForLevel(o,t,n),i),{})}transform(r,t){return r.message=`${this.paddings[r[Hu]]}${r.message}`,r[Eo]&&(r[Eo]=`${this.paddings[r[Hu]]}${r[Eo]}`),r}};wn.exports=e=>new _n(e);wn.exports.Padder=wn.exports.Format=_n});var Gu=m((aS,Oo)=>{"use strict";var{Colorizer:ty}=bn(),{Padder:ny}=So(),{configs:iy,MESSAGE:oy}=oe(),En=class{constructor(r={}){r.levels||(r.levels=iy.cli.levels),this.colorizer=new ty(r),this.padder=new ny(r),this.options=r}transform(r,t){return this.colorizer.transform(this.padder.transform(r,t),t),r[oy]=`${r.level}:${r.message}`,r}};Oo.exports=e=>new En(e);Oo.exports.Format=En});var Yu=m((sS,Po)=>{"use strict";var ay=we();function Wu(e){if(e.every(sy))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 sy(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}Po.exports=(...e)=>{let r=ay(Wu(e)),t=r();return t.Format=r.Format,t};Po.exports.cascade=Wu});var Et=m((xo,Ju)=>{"use strict";var{hasOwnProperty:wt}=Object.prototype,Ar=No();Ar.configure=No;Ar.stringify=Ar;Ar.default=Ar;xo.stringify=Ar;xo.configure=No;Ju.exports=Ar;var uy=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function ur(e){return e.length<5e3&&!uy.test(e)?`"${e}"`:JSON.stringify(e)}function Ao(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 ly=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function To(e){return ly.call(e)!==void 0&&e.length!==0}function Vu(e,r,t){e.length<t&&(t=e.length);let n=r===","?"":" ",i=`"0":${n}${e[0]}`;for(let o=1;o<t;o++)i+=`${r}"${o}":${n}${e[o]}`;return i}function cy(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 fy(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 dy(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 Ku(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 py(e){let r=new Set;for(let t of e)(typeof t=="string"||typeof t=="number")&&r.add(String(t));return r}function hy(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 No(e){e={...e};let r=hy(e);r&&(e.bigint===void 0&&(e.bigint=!1),"circularValue"in e||(e.circularValue=Error));let t=cy(e),n=dy(e,"bigint"),i=fy(e),o=typeof i=="function"?i:void 0,s=Ku(e,"maximumDepth"),u=Ku(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
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=`
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 j="",Z="";D!==""&&($+=D,z=`,
35
+ ${$}`,j=" ");let ne=Math.min(G,u);i&&!To(P)&&(B=Ao(B,o)),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)}:${j}${fe}`,Z=z)}if(G>u){let te=G-u;L+=`${Z}"...":${j}"${Pr(te)} not stringified"`,Z=z}return D!==""&&Z.length>1&&(L=`
36
36
  ${$}${L}
37
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,$);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+=`
39
+ ${$}`);let G=Math.min(g.length,u),j=0;for(;j<G-1;j++){let ne=h(String(j),g[j],w,T,D,$);L+=ne!==void 0?ne:"null",L+=z}let Z=h(String(j),g[j],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
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=`
41
+ ${$}`,Y=" ");let B="";for(let G of T){let j=h(G,g[G],w,T,D,$);j!==void 0&&(L+=`${B}${ur(G)}:${Y}${j}`,B=z)}return D!==""&&B.length>1&&(L=`
42
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=`
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 j=`
44
44
  ${D}`,Z=`,
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),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=`
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);j+=fe!==void 0?fe:"null",j+=Z}let ce=y(String(te),g[te],w,T,D);if(j+=ce!==void 0?ce:"null",g.length-1>u){let fe=g.length-u-1;j+=`${Z}"... ${Pr(fe)} not stringified"`}return j+=`
46
+ ${$}`,w.pop(),`[${j}]`}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);To(g)&&(Y+=Vu(g,z,u),P=P.slice(g.length),G-=g.length,B=z),i&&(P=Ao(P,o)),w.push(g);for(let j=0;j<G;j++){let Z=P[j],ne=y(Z,g[Z],w,T,D);ne!==void 0&&(Y+=`${B}${ur(Z)}: ${ne}`,B=z)}if(L>u){let j=L-u;Y+=`${B}"...": "${Pr(j)} 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 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(`
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 j=b(String(B),g[B],w);T+=j!==void 0?j:"null",T+=","}let G=b(String(B),g[B],w);if(T+=G!==void 0?G:"null",g.length-1>u){let j=g.length-u-1;T+=`,"... ${Pr(j)} 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&&To(g)&&(T+=Vu(g,",",u),$=$.slice(g.length),z-=g.length,L=","),i&&($=Ao($,o)),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,[],py(g),T,"")}if(T.length!==0)return y("",S,[],T,"")}return b("",S,[])}return _}});var Mo=m((uS,Zu)=>{"use strict";var gy=we(),{MESSAGE:my}=oe(),yy=Et();function vy(e,r){return typeof r=="bigint"?r.toString():r}Zu.exports=gy((e,r)=>{let t=yy.configure(r);return e[my]=t(e,r.replacer||vy,r.space),e})});var Qu=m((lS,Xu)=>{"use strict";var by=we();Xu.exports=by((e,r)=>r.message?(e.message=`[${r.label}] ${e.message}`,e):(e.label=r.label,e))});var rl=m((cS,el)=>{"use strict";var _y=we(),{MESSAGE:wy}=oe(),Ey=Et();el.exports=_y(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[wy]=Ey(r),e})});var nl=m((fS,tl)=>{"use strict";var Sy=we();function Oy(e,r,t){let n=r.reduce((o,s)=>(o[s]=e[s],delete e[s],o),{}),i=Object.keys(e).reduce((o,s)=>(o[s]=e[s],delete e[s],o),{});return Object.assign(e,n,{[t]:i}),e}function Py(e,r,t){return e[t]=r.reduce((n,i)=>(n[i]=e[i],delete e[i],n),{}),e}tl.exports=Sy((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?Oy(e,n,t):r.fillWith?Py(e,r.fillWith,t):e})});var ol=m((dS,il)=>{var Xr=1e3,Qr=Xr*60,et=Qr*60,Tr=et*24,Ay=Tr*7,Ty=Tr*365.25;il.exports=function(e,r){r=r||{};var t=typeof e;if(t==="string"&&e.length>0)return Ny(e);if(t==="number"&&isFinite(e))return r.long?My(e):xy(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Ny(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*Ty;case"weeks":case"week":case"w":return t*Ay;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 xy(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 My(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 sl=m((St,al)=>{"use strict";var Ry=we(),Iy=ol();al.exports=Ry(e=>{let r=+new Date;return St.diff=r-(St.prevTime||r),St.prevTime=r,e.ms=`+${Iy(St.diff)}`,e})});var cl=m((pS,ll)=>{"use strict";var Dy=require("util").inspect,Cy=we(),{LEVEL:Ly,MESSAGE:ul,SPLAT:qy}=oe();ll.exports=Cy((e,r={})=>{let t=Object.assign({},e);return delete t[Ly],delete t[ul],delete t[qy],e[ul]=Dy(t,!1,r.depth||null,r.colorize),e})});var fl=m((hS,Pn)=>{"use strict";var{MESSAGE:$y}=oe(),On=class{constructor(r){this.template=r}transform(r){return r[$y]=this.template(r),r}};Pn.exports=e=>new On(e);Pn.exports.Printf=Pn.exports.Format=On});var hl=m((gS,pl)=>{"use strict";var jy=we(),{MESSAGE:dl}=oe(),Uy=Et();pl.exports=jy(e=>{let r=Uy(Object.assign({},e,{level:void 0,message:void 0,splat:void 0})),t=e.padding&&e.padding[e.level]||"";return r!=="{}"?e[dl]=`${e.level}:${t} ${e.message} ${r}`:e[dl]=`${e.level}:${t} ${e.message}`,e})});var yl=m((mS,ml)=>{"use strict";var Fy=require("util"),{SPLAT:gl}=oe(),ky=/%[scdjifoO%]/g,zy=/%%/g,Ro=class{constructor(r){this.options=r}_splat(r,t){let n=r.message,i=r[gl]||r.splat||[],o=n.match(zy),s=o&&o.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=Fy.format(n,...i),r}transform(r){let t=r.message,n=r[gl]||r.splat;if(!n||!n.length)return r;let i=t&&t.match&&t.match(ky);if(!i&&(n||n.length)){let o=n.length>1?n.splice(0):n,s=o.length;if(s)for(let u=0;u<s;u++)Object.assign(r,o[u]);return r}return i?this._splat(r,i):r}};ml.exports=e=>new Ro(e)});var bl=m((An,vl)=>{(function(e,r){typeof An=="object"&&typeof vl<"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}",o="\\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}],j=["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",o],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:j,Z:j},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)),"@@@"}),je={},Br={};Ne=$(Ne).replace(r,function(nr){var Ge=Z[nr],Wr=Ge[0],Xt=Ge[1],Qt=Ge[3];if(je[Wr])throw new Error("Invalid format. "+Wr+" specified twice in format");return je[Wr]=!0,Qt&&(Br[Qt]=!0),_e.push(Ge),"("+Xt+")"}),Object.keys(Br).forEach(function(nr){if(!je[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(je[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 wl=m((yS,_l)=>{"use strict";var By=bl(),Hy=we();_l.exports=Hy((e,r={})=>(r.format&&(e.timestamp=typeof r.format=="function"?r.format():By.format(new Date,r.format)),e.timestamp||(e.timestamp=new Date().toISOString()),r.alias&&(e[r.alias]=e.timestamp),e))});var Sl=m((vS,El)=>{"use strict";var Io=ho(),Gy=we(),{MESSAGE:Do}=oe();El.exports=Gy((e,r)=>(r.level!==!1&&(e.level=Io.strip(e.level)),r.message!==!1&&(e.message=Io.strip(String(e.message))),r.raw!==!1&&e[Do]&&(e[Do]=Io.strip(String(e[Do]))),e))});var Lo=m(Co=>{"use strict";var Wy=Co.format=we();Co.levels=ju();function he(e,r){Object.defineProperty(Wy,e,{get(){return r()},configurable:!0})}he("align",function(){return Fu()});he("errors",function(){return Bu()});he("cli",function(){return Gu()});he("combine",function(){return Yu()});he("colorize",function(){return bn()});he("json",function(){return Mo()});he("label",function(){return Qu()});he("logstash",function(){return rl()});he("metadata",function(){return nl()});he("ms",function(){return sl()});he("padLevels",function(){return So()});he("prettyPrint",function(){return cl()});he("printf",function(){return fl()});he("simple",function(){return hl()});he("splat",function(){return yl()});he("timestamp",function(){return wl()});he("uncolorize",function(){return Sl()})});var qo=m(Tn=>{"use strict";var{format:Ol}=require("util");Tn.warn={deprecated(e){return()=>{throw new Error(Ol("{ %s } was removed in winston@3.0.0.",e))}},useFormat(e){return()=>{throw new Error([Ol("{ %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 Pl=m((wS,Yy)=>{Yy.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 Tl=m((ES,Al)=>{Al.exports=require("util").deprecate});var $o=m((SS,Nl)=>{Nl.exports=require("stream")});var Uo=m((OS,Ml)=>{"use strict";function Vy(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(jo,this,e)):process.nextTick(jo,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(o){!r&&o?t._writableState?t._writableState.errorEmitted?process.nextTick(Nn,t):(t._writableState.errorEmitted=!0,process.nextTick(xl,t,o)):process.nextTick(xl,t,o):r?(process.nextTick(Nn,t),r(o)):process.nextTick(Nn,t)}),this)}function xl(e,r){jo(e,r),Nn(e)}function Nn(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function Ky(){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 jo(e,r){e.emit("error",r)}function Jy(e,r){var t=e._readableState,n=e._writableState;t&&t.autoDestroy||n&&n.autoDestroy?e.destroy(r):e.emit("error",r)}Ml.exports={destroy:Vy,undestroy:Ky,errorOrDestroy:Jy}});var lr=m((PS,Dl)=>{"use strict";var Il={};function xe(e,r,t){t||(t=Error);function n(o,s,u){return typeof r=="string"?r:r(o,s,u)}class i extends t{constructor(s,u,d){super(n(s,u,d))}}i.prototype.name=t.name,i.prototype.code=e,Il[e]=i}function Rl(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 Zy(e,r,t){return e.substr(!t||t<0?0:+t,r.length)===r}function Xy(e,r,t){return(t===void 0||t>e.length)&&(t=e.length),e.substring(t-r.length,t)===r}function Qy(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"&&Zy(r,"not ")?(n="must not be",r=r.replace(/^not /,"")):n="must be";let i;if(Xy(e," argument"))i=`The ${e} ${n} ${Rl(r,"type")}`;else{let o=Qy(e,".")?"property":"argument";i=`The "${e}" ${o} ${n} ${Rl(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");Dl.exports.codes=Il});var Fo=m((AS,Cl)=>{"use strict";var ev=lr().codes.ERR_INVALID_OPT_VALUE;function rv(e,r,t){return e.highWaterMark!=null?e.highWaterMark:r?e[t]:null}function tv(e,r,t,n){var i=rv(r,n,t);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var o=n?t:"highWaterMark";throw new ev(o,i)}return Math.floor(i)}return e.objectMode?16:16*1024}Cl.exports={getHighWaterMark:tv}});var Ll=m((TS,ko)=>{typeof Object.create=="function"?ko.exports=function(r,t){t&&(r.super_=t,r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:ko.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((NS,Bo)=>{try{if(zo=require("util"),typeof zo.inherits!="function")throw"";Bo.exports=zo.inherits}catch{Bo.exports=Ll()}var zo});var kl=m((xS,Fl)=>{"use strict";function ql(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 $l(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?ql(Object(t),!0).forEach(function(n){nv(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ql(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function nv(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 iv(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function jl(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 ov(e,r,t){return r&&jl(e.prototype,r),t&&jl(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ul(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 sv=require("buffer"),xn=sv.Buffer,uv=require("util"),Ho=uv.inspect,lv=Ho&&Ho.custom||"inspect";function cv(e,r,t){xn.prototype.copy.call(e,r,t)}Fl.exports=(function(){function e(){iv(this,e),this.head=null,this.tail=null,this.length=0}return ov(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,o=0;i;)cv(i.data,n,o),o+=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,o=n.data;for(t-=o.length;n=n.next;){var s=n.data,u=t>s.length?s.length:t;if(u===s.length?o+=s:o+=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,o}},{key:"_getBuffer",value:function(t){var n=xn.allocUnsafe(t),i=this.head,o=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?(++o,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=s.slice(u));break}++o}return this.length-=o,n}},{key:lv,value:function(t,n){return Ho(this,$l($l({},n),{},{depth:0,customInspect:!1}))}}]),e})()});var Hl=m((Go,Bl)=>{var Mn=require("buffer"),Ue=Mn.Buffer;function zl(e,r){for(var t in e)r[t]=e[t]}Ue.from&&Ue.alloc&&Ue.allocUnsafe&&Ue.allocUnsafeSlow?Bl.exports=Mn:(zl(Mn,Go),Go.Buffer=Nr);function Nr(e,r,t){return Ue(e,r,t)}Nr.prototype=Object.create(Ue.prototype);zl(Ue,Nr);Nr.from=function(e,r,t){if(typeof e=="number")throw new TypeError("Argument must not be a number");return Ue(e,r,t)};Nr.alloc=function(e,r,t){if(typeof e!="number")throw new TypeError("Argument must be a number");var n=Ue(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 Ue(e)};Nr.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Mn.SlowBuffer(e)}});var Vo=m(Wl=>{"use strict";var Yo=Hl().Buffer,Gl=Yo.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 fv(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 dv(e){var r=fv(e);if(typeof r!="string"&&(Yo.isEncoding===Gl||!Gl(e)))throw new Error("Unknown encoding: "+e);return r||e}Wl.StringDecoder=Ot;function Ot(e){this.encoding=dv(e);var r;switch(this.encoding){case"utf16le":this.text=vv,this.end=bv,r=4;break;case"utf8":this.fillLast=gv,r=4;break;case"base64":this.text=_v,this.end=wv,r=3;break;default:this.write=Ev,this.end=Sv;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Yo.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=yv;Ot.prototype.text=mv;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 Wo(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function pv(e,r,t){var n=r.length-1;if(n<t)return 0;var i=Wo(r[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<t||i===-2?0:(i=Wo(r[n]),i>=0?(i>0&&(e.lastNeed=i-2),i):--n<t||i===-2?0:(i=Wo(r[n]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function hv(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 gv(e){var r=this.lastTotal-this.lastNeed,t=hv(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 mv(e,r){var t=pv(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 yv(e){var r=e&&e.length?this.write(e):"";return this.lastNeed?r+"\uFFFD":r}function vv(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 bv(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 _v(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 wv(e){var r=e&&e.length?this.write(e):"";return this.lastNeed?r+this.lastChar.toString("base64",0,3-this.lastNeed):r}function Ev(e){return e.toString(this.encoding)}function Sv(e){return e&&e.length?this.write(e):""}});var Rn=m((RS,Kl)=>{"use strict";var Yl=lr().codes.ERR_STREAM_PREMATURE_CLOSE;function Ov(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 Pv(){}function Av(e){return e.setHeader&&typeof e.abort=="function"}function Vl(e,r,t){if(typeof r=="function")return Vl(e,null,r);r||(r={}),t=Ov(t||Pv);var n=r.readable||r.readable!==!1&&e.readable,i=r.writable||r.writable!==!1&&e.writable,o=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 Yl),t.call(e,g);if(i&&!s)return(!e._writableState||!e._writableState.ended)&&(g=new Yl),t.call(e,g)},_=function(){e.req.on("finish",u)};return Av(e)?(e.on("complete",u),e.on("abort",b),e.req?_():e.on("request",_)):i&&!e._writableState&&(e.on("end",o),e.on("close",o)),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",o),e.removeListener("close",o),e.removeListener("finish",u),e.removeListener("end",h),e.removeListener("error",y),e.removeListener("close",b)}}Kl.exports=Vl});var Zl=m((IS,Jl)=>{"use strict";var In;function cr(e,r,t){return r=Tv(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Tv(e){var r=Nv(e,"string");return typeof r=="symbol"?r:String(r)}function Nv(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 xv=Rn(),fr=Symbol("lastResolve"),xr=Symbol("lastReject"),Pt=Symbol("error"),Dn=Symbol("ended"),Mr=Symbol("lastPromise"),Ko=Symbol("handlePromise"),Rr=Symbol("stream");function dr(e,r){return{value:e,done:r}}function Mv(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 Rv(e){process.nextTick(Mv,e)}function Iv(e,r){return function(t,n){e.then(function(){if(r[Dn]){t(dr(void 0,!0));return}r[Ko](t,n)},n)}}var Dv=Object.getPrototypeOf(function(){}),Cv=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(Iv(n,this));else{var o=this[Rr].read();if(o!==null)return Promise.resolve(dr(o,!1));i=new Promise(this[Ko])}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),Dv),Lv=function(r){var t,n=Object.create(Cv,(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,Ko,{value:function(o,s){var u=n[Rr].read();u?(n[Mr]=null,n[fr]=null,n[xr]=null,o(dr(u,!1))):(n[fr]=o,n[xr]=s)},writable:!0}),t));return n[Mr]=null,xv(r,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=n[xr];o!==null&&(n[Mr]=null,n[fr]=null,n[xr]=null,o(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",Rv.bind(null,n)),n};Jl.exports=Lv});var rc=m((DS,ec)=>{"use strict";function Xl(e,r,t,n,i,o,s){try{var u=e[o](s),d=u.value}catch(h){t(h);return}u.done?r(d):Promise.resolve(d).then(n,i)}function qv(e){return function(){var r=this,t=arguments;return new Promise(function(n,i){var o=e.apply(r,t);function s(d){Xl(o,n,i,s,u,"next",d)}function u(d){Xl(o,n,i,s,u,"throw",d)}s(void 0)})}}function Ql(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 $v(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Ql(Object(t),!0).forEach(function(n){jv(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ql(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function jv(e,r,t){return r=Uv(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Uv(e){var r=Fv(e,"string");return typeof r=="symbol"?r:String(r)}function Fv(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 kv=lr().codes.ERR_INVALID_ARG_TYPE;function zv(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 kv("iterable",["Iterable"],r);var i=new e($v({objectMode:!0},t)),o=!1;i._read=function(){o||(o=!0,s())};function s(){return u.apply(this,arguments)}function u(){return u=qv(function*(){try{var d=yield n.next(),h=d.value,y=d.done;y?i.push(null):i.push(yield h)?s():o=!1}catch(b){i.destroy(b)}}),u.apply(this,arguments)}return i}ec.exports=zv});var oa=m((LS,fc)=>{"use strict";fc.exports=W;var tt;W.ReadableState=oc;var CS=require("events").EventEmitter,ic=function(r,t){return r.listeners(t).length},Tt=$o(),Cn=require("buffer").Buffer,Bv=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Hv(e){return Cn.from(e)}function Gv(e){return Cn.isBuffer(e)||e instanceof Bv}var Jo=require("util"),F;Jo&&Jo.debuglog?F=Jo.debuglog("stream"):F=function(){};var Wv=kl(),na=Uo(),Yv=Fo(),Vv=Yv.getHighWaterMark,Ln=lr().codes,Kv=Ln.ERR_INVALID_ARG_TYPE,Jv=Ln.ERR_STREAM_PUSH_AFTER_EOF,Zv=Ln.ERR_METHOD_NOT_IMPLEMENTED,Xv=Ln.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,nt,Zo,Xo;rt()(W,Tt);var At=na.errorOrDestroy,Qo=["error","close","destroy","pause","resume"];function Qv(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 oc(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=Vv(this,e,"readableHighWaterMark",t),this.buffer=new Wv,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=Vo().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 oc(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=na.destroy;W.prototype._undestroy=na.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 o=e._readableState;if(r===null)o.reading=!1,tb(e,o);else{var s;if(i||(s=eb(o,r)),s)At(e,s);else if(o.objectMode||r&&r.length>0)if(typeof r!="string"&&!o.objectMode&&Object.getPrototypeOf(r)!==Cn.prototype&&(r=Hv(r)),n)o.endEmitted?At(e,new Xv):ea(e,o,r,!0);else if(o.ended)At(e,new Jv);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!t?(r=o.decoder.write(r),o.objectMode||r.length!==0?ea(e,o,r,!1):ta(e,o)):ea(e,o,r,!1)}else n||(o.reading=!1,ta(e,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}function ea(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)),ta(e,r)}function eb(e,r){var t;return!Gv(r)&&typeof r!="string"&&r!==void 0&&!e.objectMode&&(t=new Kv("chunk",["string","Buffer","Uint8Array"],r)),t}W.prototype.isPaused=function(){return this._readableState.flowing===!1};W.prototype.setEncoding=function(e){nt||(nt=Vo().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 tc=1073741824;function rb(e){return e>=tc?e=tc:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function nc(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=rb(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?ra(this):qn(this),null;if(e=nc(e,r),e===0&&r.ended)return r.length===0&&ra(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=nc(t,r)));var i;return e>0?i=lc(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&&ra(this)),i!==null&&this.emit("data",i),i};function tb(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,sc(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(sc,e))}function sc(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,ia(e)}function ta(e,r){r.readingMore||(r.readingMore=!0,process.nextTick(nb,e,r))}function nb(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 Zv("_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,o=i?u:w;n.endEmitted?process.nextTick(o):t.once("end",o),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=ib(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&&cc(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",_),ic(e,"error")===0&&At(e,T)}Qv(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 ib(e){return function(){var t=e._readableState;F("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&ic(e,"data")&&(t.flowing=!0,ia(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 o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=cc(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(ob,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(uc,this),t};W.prototype.removeAllListeners=function(e){var r=Tt.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(uc,this),r};function uc(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 ob(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,ab(this,e)),e.paused=!1,this};function ab(e,r){r.resumeScheduled||(r.resumeScheduled=!0,process.nextTick(sb,e,r))}function sb(e,r){F("resume",r.reading),r.reading||e.read(0),r.resumeScheduled=!1,e.emit("resume"),ia(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 ia(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 o=0;o<Qo.length;o++)e.on(Qo[o],this.emit.bind(this,Qo[o]));return this._read=function(s){F("wrapped _read",s),n&&(n=!1,e.resume())},this};typeof Symbol=="function"&&(W.prototype[Symbol.asyncIterator]=function(){return Zo===void 0&&(Zo=Zl()),Zo(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=lc;Object.defineProperty(W.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function lc(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 ra(e){var r=e._readableState;F("endReadable",r.endEmitted),r.endEmitted||(r.ended=!0,process.nextTick(ub,r,e))}function ub(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 Xo===void 0&&(Xo=rc()),Xo(W,e,r)});function cc(e,r){for(var t=0,n=e.length;t<n;t++)if(e[t]===r)return t;return-1}});var Ir=m((qS,pc)=>{"use strict";var lb=Object.keys||function(e){var r=[];for(var t in e)r.push(t);return r};pc.exports=Fe;var dc=oa(),sa=Un();rt()(Fe,dc);for(aa=lb(sa.prototype),$n=0;$n<aa.length;$n++)jn=aa[$n],Fe.prototype[jn]||(Fe.prototype[jn]=sa.prototype[jn]);var aa,jn,$n;function Fe(e){if(!(this instanceof Fe))return new Fe(e);dc.call(this,e),sa.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",cb)))}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 cb(){this._writableState.ended||process.nextTick(fb,this)}function fb(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 Un=m(($S,bc)=>{"use strict";bc.exports=ee;function gc(e){var r=this;this.next=null,this.entry=null,this.finish=function(){jb(r,e)}}var it;ee.WritableState=xt;var db={deprecate:Tl()},mc=$o(),kn=require("buffer").Buffer,pb=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function hb(e){return kn.from(e)}function gb(e){return kn.isBuffer(e)||e instanceof pb}var la=Uo(),mb=Fo(),yb=mb.getHighWaterMark,pr=lr().codes,vb=pr.ERR_INVALID_ARG_TYPE,bb=pr.ERR_METHOD_NOT_IMPLEMENTED,_b=pr.ERR_MULTIPLE_CALLBACK,wb=pr.ERR_STREAM_CANNOT_PIPE,Eb=pr.ERR_STREAM_DESTROYED,Sb=pr.ERR_STREAM_NULL_VALUES,Ob=pr.ERR_STREAM_WRITE_AFTER_END,Pb=pr.ERR_UNKNOWN_ENCODING,ot=la.errorOrDestroy;rt()(ee,mc);function Ab(){}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=yb(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){Db(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 gc(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:db.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)),mc.call(this)}ee.prototype.pipe=function(){ot(this,new wb)};function Tb(e,r){var t=new Ob;ot(e,t),process.nextTick(r,t)}function Nb(e,r,t,n){var i;return t===null?i=new Sb:typeof t!="string"&&!r.objectMode&&(i=new vb("chunk",["string","Buffer"],t)),i?(ot(e,i),process.nextTick(n,i),!1):!0}ee.prototype.write=function(e,r,t){var n=this._writableState,i=!1,o=!n.objectMode&&gb(e);return o&&!kn.isBuffer(e)&&(e=hb(e)),typeof r=="function"&&(t=r,r=null),o?r="buffer":r||(r=n.defaultEncoding),typeof t!="function"&&(t=Ab),n.ending?Tb(this,t):(o||Nb(this,n,e,t))&&(n.pendingcb++,i=Mb(this,n,o,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&&yc(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 Pb(r);return this._writableState.defaultEncoding=r,this};Object.defineProperty(ee.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function xb(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 Mb(e,r,t,n,i,o){if(!t){var s=xb(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:o,next:null},h?h.next=r.lastBufferedRequest:r.bufferedRequest=r.lastBufferedRequest,r.bufferedRequestCount+=1}else ua(e,r,!1,u,n,i,o);return d}function ua(e,r,t,n,i,o,s){r.writelen=n,r.writecb=s,r.writing=!0,r.sync=!0,r.destroyed?r.onwrite(new Eb("write")):t?e._writev(i,r.onwrite):e._write(i,o,r.onwrite),r.sync=!1}function Rb(e,r,t,n,i){--r.pendingcb,t?(process.nextTick(i,n),process.nextTick(Nt,e,r),e._writableState.errorEmitted=!0,ot(e,n)):(i(n),e._writableState.errorEmitted=!0,ot(e,n),Nt(e,r))}function Ib(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function Db(e,r){var t=e._writableState,n=t.sync,i=t.writecb;if(typeof i!="function")throw new _b;if(Ib(t),r)Rb(e,t,n,r,i);else{var o=vc(t)||e.destroyed;!o&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&yc(e,t),n?process.nextTick(hc,e,t,o,i):hc(e,t,o,i)}}function hc(e,r,t,n){t||Cb(e,r),r.pendingcb--,n(),Nt(e,r)}function Cb(e,r){r.length===0&&r.needDrain&&(r.needDrain=!1,e.emit("drain"))}function yc(e,r){r.bufferProcessing=!0;var t=r.bufferedRequest;if(e._writev&&t&&t.next){var n=r.bufferedRequestCount,i=new Array(n),o=r.corkedRequestsFree;o.entry=t;for(var s=0,u=!0;t;)i[s]=t,t.isBuf||(u=!1),t=t.next,s+=1;i.allBuffers=u,ua(e,r,!0,r.length,i,"",o.finish),r.pendingcb++,r.lastBufferedRequest=null,o.next?(r.corkedRequestsFree=o.next,o.next=null):r.corkedRequestsFree=new gc(r),r.bufferedRequestCount=0}else{for(;t;){var d=t.chunk,h=t.encoding,y=t.callback,b=r.objectMode?1:d.length;if(ua(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 bb("_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||$b(this,n,t),this};Object.defineProperty(ee.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function vc(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function Lb(e,r){e._final(function(t){r.pendingcb--,t&&ot(e,t),r.prefinished=!0,e.emit("prefinish"),Nt(e,r)})}function qb(e,r){!r.prefinished&&!r.finalCalled&&(typeof e._final=="function"&&!r.destroyed?(r.pendingcb++,r.finalCalled=!0,process.nextTick(Lb,e,r)):(r.prefinished=!0,e.emit("prefinish")))}function Nt(e,r){var t=vc(r);if(t&&(qb(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 $b(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 jb(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=la.destroy;ee.prototype._undestroy=la.undestroy;ee.prototype._destroy=function(e,r){r(e)}});var ca=m((jS,Ec)=>{"use strict";var Ub=require("util"),_c=Un(),{LEVEL:wc}=oe(),Mt=Ec.exports=function(r={}){_c.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())})};Ub.inherits(Mt,_c);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[wc]]){if(r&&!this.format)return this.log(r,n);let o,s;try{s=this.format.transform(Object.assign({},r),this.format.options)}catch(u){o=u}if(o||!s){if(n(),o)throw o;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,o;try{o=this.format.transform(Object.assign({},r[n].chunk),this.format.options)}catch(s){i=s}if(i||!o){if(r[n].callback(),i)throw t(null),i}else this.log(o,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[wc]])&&(this.handleExceptions||t.exception!==!0))};Mt.prototype._nop=function(){}});var da=m((US,Oc)=>{"use strict";var Fb=require("util"),{LEVEL:fa}=oe(),Sc=ca(),Rt=Oc.exports=function(r={}){if(Sc.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))};Fb.inherits(Rt,Sc);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[fa]])&&this.transport.log(r[fa],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[fa],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 at=m((FS,pa)=>{"use strict";pa.exports=ca();pa.exports.LegacyTransportStream=da()});var Tc=m((zS,Ac)=>{"use strict";var kb=require("os"),{LEVEL:Pc,MESSAGE:st}=oe(),zb=at();Ac.exports=class extends zb{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:kb.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[Pc]]){console._stderr&&!this.forceConsole?console._stderr.write(`${r[st]}${this.eol}`):this._consoleError(r[st]),t&&t();return}else if(this.consoleWarnLevels[r[Pc]]){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,Nc)=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.default=Bb;function Bb(e){return e&&typeof e.length=="number"&&e.length>=0&&e.length%1===0}Nc.exports=zn.default});var Mc=m((Hn,xc)=>{"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)}};xc.exports=Hn.default});var Dc=m(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.fallback=Rc;hr.wrap=Ic;var Hb=hr.hasQueueMicrotask=typeof queueMicrotask=="function"&&queueMicrotask,Gb=hr.hasSetImmediate=typeof setImmediate=="function"&&setImmediate,Wb=hr.hasNextTick=typeof process=="object"&&typeof process.nextTick=="function";function Rc(e){setTimeout(e,0)}function Ic(e){return(r,...t)=>e(()=>r(...t))}var It;Hb?It=queueMicrotask:Gb?It=setImmediate:Wb?It=process.nextTick:It=Rc;hr.default=Ic(It)});var jc=m((Gn,$c)=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.default=Xb;var Yb=Mc(),Vb=qc(Yb),Kb=Dc(),Jb=qc(Kb),Zb=Dr();function qc(e){return e&&e.__esModule?e:{default:e}}function Xb(e){return(0,Zb.isAsync)(e)?function(...r){let t=r.pop(),n=e.apply(this,r);return Cc(n,t)}:(0,Vb.default)(function(r,t){var n;try{n=e.apply(this,r)}catch(i){return t(i)}if(n&&typeof n.then=="function")return Cc(n,t);t(null,n)})}function Cc(e,r){return e.then(t=>{Lc(r,null,t)},t=>{Lc(r,t&&(t instanceof Error||t.message)?t:new Error(t))})}function Lc(e,r,t){try{e(r,t)}catch(n){(0,Jb.default)(i=>{throw i},n)}}$c.exports=Gn.default});var Dr=m(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.isAsyncIterable=Ve.isAsyncGenerator=Ve.isAsync=void 0;var Qb=jc(),e_=r_(Qb);function r_(e){return e&&e.__esModule?e:{default:e}}function Uc(e){return e[Symbol.toStringTag]==="AsyncFunction"}function t_(e){return e[Symbol.toStringTag]==="AsyncGenerator"}function n_(e){return typeof e[Symbol.asyncIterator]=="function"}function i_(e){if(typeof e!="function")throw new Error("expected a function");return Uc(e)?(0,e_.default)(e):e}Ve.default=i_;Ve.isAsync=Uc;Ve.isAsyncGenerator=t_;Ve.isAsyncIterable=n_});var ut=m((Wn,Fc)=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.default=o_;function o_(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,o)=>{n[r-1]=(s,...u)=>{if(s)return o(s);i(u.length>1?u:u[0])},e.apply(this,n)})}return t}Fc.exports=Wn.default});var zc=m((Yn,kc)=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});var a_=Bn(),s_=ha(a_),u_=Dr(),l_=ha(u_),c_=ut(),f_=ha(c_);function ha(e){return e&&e.__esModule?e:{default:e}}Yn.default=(0,f_.default)((e,r,t)=>{var n=(0,s_.default)(r)?[]:{};e(r,(i,o,s)=>{(0,l_.default)(i)((u,...d)=>{d.length<2&&([d]=d),n[o]=d,s(u)})},i=>t(i,n))},3);kc.exports=Yn.default});var ga=m((Vn,Bc)=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.default=d_;function d_(e){function r(...t){if(e!==null){var n=e;e=null,n.apply(this,t)}}return Object.assign(r,e),r}Bc.exports=Vn.default});var Gc=m((Kn,Hc)=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.default=function(e){return e[Symbol.iterator]&&e[Symbol.iterator]()};Hc.exports=Kn.default});var Vc=m((Jn,Yc)=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.default=__;var p_=Bn(),h_=Wc(p_),g_=Gc(),m_=Wc(g_);function Wc(e){return e&&e.__esModule?e:{default:e}}function y_(e){var r=-1,t=e.length;return function(){return++r<t?{value:e[r],key:r}:null}}function v_(e){var r=-1;return function(){var n=e.next();return n.done?null:(r++,{value:n.value,key:r})}}function b_(e){var r=e?Object.keys(e):[],t=-1,n=r.length;return function i(){var o=r[++t];return o==="__proto__"?i():t<n?{value:e[o],key:o}:null}}function __(e){if((0,h_.default)(e))return y_(e);var r=(0,m_.default)(e);return r?v_(r):b_(e)}Yc.exports=Jn.default});var ma=m((Zn,Kc)=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.default=w_;function w_(e){return function(...r){if(e===null)throw new Error("Callback was already called.");var t=e;e=null,t.apply(this,r)}}Kc.exports=Zn.default});var Qn=m((Xn,Jc)=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});var E_={};Xn.default=E_;Jc.exports=Xn.default});var Xc=m((ei,Zc)=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.default=A_;var S_=Qn(),O_=P_(S_);function P_(e){return e&&e.__esModule?e:{default:e}}function A_(e,r,t,n){let i=!1,o=!1,s=!1,u=0,d=0;function h(){u>=r||s||i||(s=!0,e.next().then(({value:_,done:S})=>{if(!(o||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,!o){if(_)return b(_);if(_===!1){i=!0,o=!0;return}if(S===O_.default||i&&u<=0)return i=!0,n(null);h()}}function b(_){o||(s=!1,i=!0,n(_))}h()}Zc.exports=ei.default});var tf=m((ri,rf)=>{"use strict";Object.defineProperty(ri,"__esModule",{value:!0});var T_=ga(),N_=Dt(T_),x_=Vc(),M_=Dt(x_),R_=ma(),I_=Dt(R_),Qc=Dr(),D_=Xc(),ef=Dt(D_),C_=Qn(),L_=Dt(C_);function Dt(e){return e&&e.__esModule?e:{default:e}}ri.default=e=>(r,t,n)=>{if(n=(0,N_.default)(n),e<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!r)return n(null);if((0,Qc.isAsyncGenerator)(r))return(0,ef.default)(r,e,t,n);if((0,Qc.isAsyncIterable)(r))return(0,ef.default)(r[Symbol.asyncIterator](),e,t,n);var i=(0,M_.default)(r),o=!1,s=!1,u=0,d=!1;function h(b,_){if(!s)if(u-=1,b)o=!0,n(b);else if(b===!1)o=!0,s=!0;else{if(_===L_.default||o&&u<=0)return o=!0,n(null);d||y()}}function y(){for(d=!0;u<e&&!o;){var b=i();if(b===null){o=!0,u<=0&&n(null);return}u+=1,t(b.value,b.key,(0,I_.default)(h))}d=!1}y()};rf.exports=ri.default});var va=m((ti,nf)=>{"use strict";Object.defineProperty(ti,"__esModule",{value:!0});var q_=tf(),$_=ya(q_),j_=Dr(),U_=ya(j_),F_=ut(),k_=ya(F_);function ya(e){return e&&e.__esModule?e:{default:e}}function z_(e,r,t,n){return(0,$_.default)(r)(e,(0,U_.default)(t),n)}ti.default=(0,k_.default)(z_,4);nf.exports=ti.default});var sf=m((ni,af)=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});var B_=va(),H_=of(B_),G_=ut(),W_=of(G_);function of(e){return e&&e.__esModule?e:{default:e}}function Y_(e,r,t){return(0,H_.default)(e,1,r,t)}ni.default=(0,W_.default)(Y_,3);af.exports=ni.default});var cf=m((ii,lf)=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.default=X_;var V_=zc(),K_=uf(V_),J_=sf(),Z_=uf(J_);function uf(e){return e&&e.__esModule?e:{default:e}}function X_(e,r){return(0,K_.default)(Z_.default,e,r)}lf.exports=ii.default});var ba=m((GS,df)=>{"use strict";df.exports=Ke;var oi=lr().codes,Q_=oi.ERR_METHOD_NOT_IMPLEMENTED,e0=oi.ERR_MULTIPLE_CALLBACK,r0=oi.ERR_TRANSFORM_ALREADY_TRANSFORMING,t0=oi.ERR_TRANSFORM_WITH_LENGTH_0,ai=Ir();rt()(Ke,ai);function n0(e,r){var t=this._transformState;t.transforming=!1;var n=t.writecb;if(n===null)return this.emit("error",new e0);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);ai.call(this,e),this._transformState={afterTransform:n0.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",i0)}function i0(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(r,t){ff(e,r,t)}):ff(this,null,null)}Ke.prototype.push=function(e,r){return this._transformState.needTransform=!1,ai.prototype.push.call(this,e,r)};Ke.prototype._transform=function(e,r,t){t(new Q_("_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){ai.prototype._destroy.call(this,e,function(t){r(t)})};function ff(e,r,t){if(r)return e.emit("error",r);if(t!=null&&e.push(t),e._writableState.length)throw new t0;if(e._transformState.transforming)throw new r0;return e.push(null)}});var gf=m((WS,hf)=>{"use strict";hf.exports=Ct;var pf=ba();rt()(Ct,pf);function Ct(e){if(!(this instanceof Ct))return new Ct(e);pf.call(this,e)}Ct.prototype._transform=function(e,r,t){t(null,e)}});var _f=m((YS,bf)=>{"use strict";var _a;function o0(e){var r=!1;return function(){r||(r=!0,e.apply(void 0,arguments))}}var vf=lr().codes,a0=vf.ERR_MISSING_ARGS,s0=vf.ERR_STREAM_DESTROYED;function mf(e){if(e)throw e}function u0(e){return e.setHeader&&typeof e.abort=="function"}function l0(e,r,t,n){n=o0(n);var i=!1;e.on("close",function(){i=!0}),_a===void 0&&(_a=Rn()),_a(e,{readable:r,writable:t},function(s){if(s)return n(s);i=!0,n()});var o=!1;return function(s){if(!i&&!o){if(o=!0,u0(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(s||new s0("pipe"))}}}function yf(e){e()}function c0(e,r){return e.pipe(r)}function f0(e){return!e.length||typeof e[e.length-1]!="function"?mf:e.pop()}function d0(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];var n=f0(r);if(Array.isArray(r[0])&&(r=r[0]),r.length<2)throw new a0("streams");var i,o=r.map(function(s,u){var d=u<r.length-1,h=u>0;return l0(s,d,h,function(y){i||(i=y),y&&o.forEach(yf),!d&&(o.forEach(yf),n(i))})});return r.reduce(c0)}bf.exports=d0});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=oa(),Me.Stream=Lt||Me,Me.Readable=Me,Me.Writable=Un(),Me.Duplex=Ir(),Me.Transform=ba(),Me.PassThrough=gf(),Me.finished=Rn(),Me.pipeline=_f())});var Ta=m((VS,Ef)=>{var lt=[],$t=[],wa=function(){};function Sa(e){return~lt.indexOf(e)?!1:(lt.push(e),!0)}function Oa(e){wa=e}function p0(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 Pa(e){return~$t.indexOf(e)?!1:($t.push(e),!0)}function Ea(){wa.apply(wa,arguments)}function wf(e){for(var r=0;r<$t.length;r++)e=$t[r].apply($t[r],arguments);return e}function Aa(e,r){var t=Object.prototype.hasOwnProperty;for(var n in r)t.call(r,n)&&(e[n]=r[n]);return e}function h0(e){return e.enabled=!1,e.modify=Pa,e.set=Oa,e.use=Sa,Aa(function(){return!1},e)}function g0(e){function r(){var t=Array.prototype.slice.call(arguments,0);return Ea.call(Ea,e,wf(t,e)),!0}return e.enabled=!0,e.modify=Pa,e.set=Oa,e.use=Sa,Aa(r,e)}Ef.exports=function(r){return r.introduce=Aa,r.enabled=p0,r.process=wf,r.modify=Pa,r.write=Ea,r.nope=h0,r.yep=g0,r.set=Oa,r.use=Sa,r}});var Of=m((KS,Sf)=>{var m0=Ta(),y0=m0(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)});Sf.exports=y0});var Af=m((JS,Pf)=>{"use strict";Pf.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 Nf=m((ZS,Tf)=>{Tf.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 Rf=m((XS,Mf)=>{"use strict";var v0=Nf(),b0=Array.prototype.concat,_0=Array.prototype.slice,xf=Mf.exports=function(r){for(var t=[],n=0,i=r.length;n<i;n++){var o=r[n];v0(o)?t=b0.call(t,_0.call(o)):t.push(o)}return t};xf.wrap=function(e){return function(){return e(xf(arguments))}}});var Lf=m((QS,Cf)=>{var jt=Af(),Ut=Rf(),If=Object.hasOwnProperty,Df=Object.create(null);for(si in jt)If.call(jt,si)&&(Df[jt[si]]=si);var si,Oe=Cf.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*)?\)$/,o=/^(\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(o))?u[1]==="transparent"?[0,0,0,0]:If.call(jt,u[1])?(s=jt[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,o=gr(parseFloat(t[2]),0,100),s=gr(parseFloat(t[3]),0,100),u=gr(isNaN(n)?1:n,0,1);return[i,o,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,o=gr(parseFloat(t[2]),0,100),s=gr(parseFloat(t[3]),0,100),u=gr(isNaN(n)?1:n,0,1);return[i,o,s,u]}return null};Oe.to.hex=function(){var e=Ut(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=Ut(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=Ut(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=Ut(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=Ut(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 Df[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 $f=m((eO,qf)=>{"use strict";qf.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 Na=m((rO,kf)=>{var Lr=$f(),Ff={};for(li in Lr)Lr.hasOwnProperty(li)&&(Ff[Lr[li]]=li);var li,I=kf.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);jf=I[be].channels,Uf=I[be].labels,delete I[be].channels,delete I[be].labels,Object.defineProperty(I[be],"channels",{value:jf}),Object.defineProperty(I[be],"labels",{value:Uf})}var jf,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),o=Math.max(r,t,n),s=o-i,u,d,h;return o===i?u=0:r===o?u=(t-n)/s:t===o?u=2+(n-r)/s:n===o&&(u=4+(r-t)/s),u=Math.min(u*60,360),u<0&&(u+=360),h=(i+o)/2,o===i?d=0:h<=.5?d=s/(o+i):d=s/(2-o-i),[u,d*100,h*100]};I.rgb.hsv=function(e){var r,t,n,i,o,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=o=0:(o=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,o*100,h*100]};I.rgb.hwb=function(e){var r=e[0],t=e[1],n=e[2],i=I.rgb.hsl(e)[0],o=1/255*Math.min(r,Math.min(t,n));return n=1-1/255*Math.max(r,Math.max(t,n)),[i,o*100,n*100]};I.rgb.cmyk=function(e){var r=e[0]/255,t=e[1]/255,n=e[2]/255,i,o,s,u;return u=Math.min(1-r,1-t,1-n),i=(1-r-u)/(1-u)||0,o=(1-t-u)/(1-u)||0,s=(1-n-u)/(1-u)||0,[i*100,o*100,s*100,u*100]};function w0(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=Ff[e];if(r)return r;var t=1/0,n;for(var i in Lr)if(Lr.hasOwnProperty(i)){var o=Lr[i],s=w0(e,o);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,o=r*.2126+t*.7152+n*.0722,s=r*.0193+t*.1192+n*.9505;return[i*100,o*100,s*100]};I.rgb.lab=function(e){var r=I.rgb.xyz(e),t=r[0],n=r[1],i=r[2],o,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,o=116*n-16,s=500*(t-n),u=200*(n-i),[o,s,u]};I.hsl.rgb=function(e){var r=e[0]/360,t=e[1]/100,n=e[2]/100,i,o,s,u,d;if(t===0)return d=n*255,[d,d,d];n<.5?o=n*(1+t):o=n+t-n*t,i=2*n-o,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+(o-i)*6*s:2*s<1?d=o:3*s<2?d=i+(o-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,o=Math.max(n,.01),s,u;return n*=2,t*=n<=1?n:2-n,i*=o<=1?o:2-o,u=(n+t)/2,s=n===0?2*i/(o+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,o=r-Math.floor(r),s=255*n*(1-t),u=255*n*(1-t*o),d=255*n*(1-t*(1-o));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),o,s,u;return u=(2-t)*n,o=(2-t)*i,s=t*i,s/=o<=1?o:2-o,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,o,s,u,d;i>1&&(t/=i,n/=i),o=Math.floor(6*r),s=1-n,u=6*r-o,(o&1)!==0&&(u=1-u),d=t+u*(s-t);var h,y,b;switch(o){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,o,s,u;return o=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),[o*255,s*255,u*255]};I.xyz.rgb=function(e){var r=e[0]/100,t=e[1]/100,n=e[2]/100,i,o,s;return i=r*3.2406+t*-1.5372+n*-.4986,o=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,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o*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),o=Math.min(Math.max(0,o),1),s=Math.min(Math.max(0,s),1),[i*255,o*255,s*255]};I.xyz.lab=function(e){var r=e[0],t=e[1],n=e[2],i,o,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,o=500*(r-t),s=200*(t-n),[i,o,s]};I.lab.xyz=function(e){var r=e[0],t=e[1],n=e[2],i,o,s;o=(r+16)/116,i=t/500+o,s=o-n/200;var u=Math.pow(o,3),d=Math.pow(i,3),h=Math.pow(s,3);return o=u>.008856?u:(o-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,o*=100,s*=108.883,[i,o,s]};I.lab.lch=function(e){var r=e[0],t=e[1],n=e[2],i,o,s;return i=Math.atan2(n,t),o=i*360/2/Math.PI,o<0&&(o+=360),s=Math.sqrt(t*t+n*n),[r,s,o]};I.lch.lab=function(e){var r=e[0],t=e[1],n=e[2],i,o,s;return s=n/360*2*Math.PI,i=t*Math.cos(s),o=t*Math.sin(s),[r,i,o]};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 o=30+(Math.round(n/255)<<2|Math.round(t/255)<<1|Math.round(r/255));return i===2&&(o+=60),o};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,o=(r>>2&1)*t*255;return[n,i,o]};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,o=t%6/5*255;return[n,i,o]};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,o=n>>8&255,s=n&255;return[i,o,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),o=Math.min(Math.min(r,t),n),s=i-o,u,d;return s<1?u=o/(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],o=r%1*6,s=o%1,u=1-s,d=0;switch(Math.floor(o)){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,o=0;return i<1&&(o=(n-i)/(1-i)),[e[0],i*100,o*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 Bf=m((tO,zf)=>{var ci=Na();function E0(){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 S0(e){var r=E0(),t=[e];for(r[e].distance=0;t.length;)for(var n=t.pop(),i=Object.keys(ci[n]),o=i.length,s=0;s<o;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 O0(e,r){return function(t){return r(e(t))}}function P0(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=O0(ci[r[i].parent][i],n),i=r[i].parent;return n.conversion=t,n}zf.exports=function(e){for(var r=S0(e),t={},n=Object.keys(r),i=n.length,o=0;o<i;o++){var s=n[o],u=r[s];u.parent!==null&&(t[s]=P0(s,r))}return t}});var Gf=m((nO,Hf)=>{var xa=Na(),A0=Bf(),ct={},T0=Object.keys(xa);function N0(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 x0(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,o=0;o<i;o++)n[o]=Math.round(n[o]);return n};return"conversion"in e&&(r.conversion=e.conversion),r}T0.forEach(function(e){ct[e]={},Object.defineProperty(ct[e],"channels",{value:xa[e].channels}),Object.defineProperty(ct[e],"labels",{value:xa[e].labels});var r=A0(e),t=Object.keys(r);t.forEach(function(n){var i=r[n];ct[e][n]=x0(i),ct[e][n].raw=N0(i)})});Hf.exports=ct});var Vf=m((iO,Yf)=>{"use strict";var Ft=Lf(),Pe=Gf(),Ia=[].slice,Wf=["keyword","gray","hex"],Ma={};Object.keys(Pe).forEach(function(e){Ma[Ia.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 Wf&&(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 o=Ia.call(e,0,n);this.color=Ra(o,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 Ma))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=Ma[u];var d=Pe[this.model].labels,h=[];for(t=0;t<d.length;t++)h.push(e[d[t]]);this.color=Ra(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(R0(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,o=2*i-1,s=t.alpha()-n.alpha(),u=((o*s===-1?o:(o+s)/(1+o*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(Wf.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(I0(Pe[this.model][e].raw(this.color)).concat(t),e)},ge[e]=function(t){return typeof t=="number"&&(t=Ra(Ia.call(arguments),r)),new ge(t,e)}}});function M0(e,r){return Number(e.toFixed(r))}function R0(e){return function(r){return M0(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 I0(e){return Array.isArray(e)?e:[e]}function Ra(e,r){for(var t=0;t<r;t++)typeof e[t]!="number"&&(e[t]=0);return e}Yf.exports=ge});var Jf=m((oO,Kf)=>{"use strict";Kf.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 ed=m((aO,Qf)=>{"use strict";var Zf=Vf(),Xf=Jf();Qf.exports=function(r,t){var n=r.split(t||":"),i=Xf(n[0]);if(!n.length)return i;for(var o=0,s=n.length-1;o<s;o++)i=Zf(i).mix(Zf(Xf(n[o+1]))).saturate(1).hex();return i}});var td=m((sO,rd)=>{"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,o=t/255*5,s=n/255*5;return this.ansi(i,o,s)};Le.prototype.ansi=function(r,t,n){var i=Math.round(r),o=Math.round(t),s=Math.round(n);return 16+i*36+o*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()};rd.exports=Le});var id=m((uO,nd)=>{var D0=ed(),C0=td();nd.exports=function(r,t){var n=t.namespace,i=t.colors!==!1?C0(n+":",D0(n)):n+":";return r[0]=i+" "+r[0],r}});var ad=m((lO,od)=>{"use strict";od.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 ud=m((cO,sd)=>{var L0=ad();sd.exports=function(r){return function(n){try{return L0(n,r())}catch{}return!1}}});var cd=m((fO,ld)=>{var q0=ud();ld.exports=q0(function(){return process.env.DEBUG||process.env.DIAGNOSTICS})});var dd=m((dO,fd)=>{fd.exports=function(e,r){try{Function.prototype.apply.call(console.log,console,r)}catch{}}});var hd=m((pO,pd)=>{var $0=Ta(),j0=require("tty").isatty(1),di=$0(function e(r,t){return t=t||{},t.colors="colors"in t?t.colors:j0,t.namespace=r,t.prod=!1,t.dev=!0,!e.enabled(r)&&!(t.force||e.force)?e.nope(t):e.yep(t)});di.modify(id());di.use(cd());di.set(dd());pd.exports=di});var kt=m((hO,Da)=>{process.env.NODE_ENV==="production"?Da.exports=Of():Da.exports=hd()});var md=m((gO,gd)=>{"use strict";var Ca=require("fs"),{StringDecoder:U0}=require("string_decoder"),{Stream:F0}=Cr();function k0(){}gd.exports=(e,r)=>{let t=Buffer.alloc(65536),n=new U0("utf8"),i=new F0,o="",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")},Ca.open(e.file,"a+","0644",(d,h)=>{if(d){r?r(d):i.emit("error",d),i.destroy();return}(function y(){if(i.destroyed){Ca.close(h,k0);return}return Ca.read(h,t,0,t.length,s,(b,_)=>{if(b){r?r(b):i.emit("error",b),i.destroy();return}if(!_)return o&&((e.start==null||u>e.start)&&(r?r(null,o):i.emit("line",o)),u++,o=""),setTimeout(y,1e3);let S=n.write(t.slice(0,_));r||i.emit("data",S),S=(o+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 o=S[g],s+=_,y()})})()}),r?i.destroy:i}});var _d=m((yO,bd)=>{"use strict";var Ee=require("fs"),le=require("path"),yd=cf(),z0=require("zlib"),{MESSAGE:B0}=oe(),{Stream:H0,PassThrough:vd}=Cr(),G0=at(),qe=kt()("winston:file"),W0=require("os"),Y0=md();bd.exports=class extends G0{constructor(r={}){super(r),this.name=r.name||"file";function t(n,...i){i.slice(1).forEach(o=>{if(r[o])throw new Error(`Cannot set ${o} and ${n} together`)})}if(this._stream=new vd,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:W0.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[B0]}${this.eol}`,i=Buffer.byteLength(n);function o(){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,o.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="",o=[],s=0,u=Ee.createReadStream(n,{encoding:"utf8"});u.on("error",_=>{if(u.readable&&u.destroy(),!!t)return _.code!=="ENOENT"?t(_):t(null,o)}),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"&&(o=o.reverse()),t&&t(null,o)});function d(_,S){try{let g=JSON.parse(_);y(g)&&h(g)}catch(g){S||u.emit("error",g)}}function h(_){if(r.rows&&o.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"&&o.length>=r.rows&&o.shift(),o.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 H0,i={file:t,start:r.start};return n.destroy=Y0(i,(o,s)=>{if(o)return n.emit("error",o);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,o)=>{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(!o||this._needsNewFile(o.size))return this._incFile(()=>this.stat(r));this.filename=t,r(null,o.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 vd,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(o){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`),o)}.bind(this)),i.push(function(o){this.tailable?this._checkMaxFilesTailable(t,n,o):(this._created+=1,this._checkMaxFilesIncrementing(t,n,o))}.bind(this)),yd(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,o=i!==0?i:"",s=this.zippedArchive?".gz":"",u=`${t}${o}${r}${s}`,d=le.join(this.dirname,u);Ee.unlink(d,n)}_checkMaxFilesTailable(r,t,n){let i=[];if(!this.maxFiles)return;let o=this.zippedArchive?".gz":"";for(let s=this.maxFiles-1;s>1;s--)i.push(function(u,d){let h=`${t}${u-1}${r}${o}`,y=le.join(this.dirname,h);Ee.exists(y,b=>{if(!b)return d(null);h=`${t}${u}${r}${o}`,Ee.rename(y,le.join(this.dirname,h),d)})}.bind(this,s));yd(i,()=>{Ee.rename(le.join(this.dirname,`${t}${r}${o}`),le.join(this.dirname,`${t}1${r}${o}`),n)})}_compressFile(r,t,n){Ee.access(r,Ee.F_OK,i=>{if(i)return n();var o=z0.createGzip(),s=Ee.createReadStream(r),u=Ee.createWriteStream(t);u.on("finish",()=>{Ee.unlink(r,n)}),s.pipe(o).pipe(u)})}_createLogDirIfNotExist(r){Ee.existsSync(r)||Ee.mkdirSync(r,{recursive:!0})}}});var Ed=m((bO,wd)=>{"use strict";var V0=require("http"),K0=require("https"),{Stream:J0}=Cr(),Z0=at(),{configure:X0}=Et();wd.exports=class extends Z0{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,(o,s,u)=>{if(s&&s.statusCode!==200&&(o=new Error(`Invalid HTTP Status Code: ${s.statusCode}`)),o)return t(o);if(typeof u=="string")try{u=JSON.parse(u)}catch(d){return t(d)}t(null,u)})}stream(r={}){let t=new J0;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 o="",s=this._request(r,i,n);return t.destroy=()=>s.destroy(),s.on("data",u=>{u=(o+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)}o=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 o=this;this.batchCallback=t,this.batchTimeoutID=setTimeout(function(){o.batchTimeoutID=-1,o._doBatchRequest(o.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 o=Object.assign({},this.headers);n&&n.bearer&&(o.Authorization=`Bearer ${n.bearer}`);let s=(this.ssl?K0:V0).request({...this.options,method:"POST",host:this.host,port:this.port,path:`/${i.replace(/^\//,"")}`,headers:o,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=X0({...this.maximumDepth&&{maximumDepth:this.maximumDepth}});s.end(Buffer.from(u(r,this.options.replacer),"utf8"))}}});var La=m((_O,Sd)=>{"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";Sd.exports=ke});var Pd=m((EO,Od)=>{"use strict";var Q0=La(),{MESSAGE:e1}=oe(),r1=require("os"),t1=at();Od.exports=class extends t1{constructor(r={}){if(super(r),!r.stream||!Q0(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:r1.EOL}log(r,t){if(setImmediate(()=>this.emit("logged",r)),this.isObjectMode){this._stream.write(r),t&&t();return}this._stream.write(`${r[e1]}${this.eol}`),t&&t()}}});var Ad=m(zt=>{"use strict";Object.defineProperty(zt,"Console",{configurable:!0,enumerable:!0,get(){return Tc()}});Object.defineProperty(zt,"File",{configurable:!0,enumerable:!0,get(){return _d()}});Object.defineProperty(zt,"Http",{configurable:!0,enumerable:!0,get(){return Ed()}});Object.defineProperty(zt,"Stream",{configurable:!0,enumerable:!0,get(){return Pd()}})});var hi=m(Bt=>{"use strict";var pi=Lo(),{configs:qa}=oe();Bt.cli=pi.levels(qa.cli);Bt.npm=pi.levels(qa.npm);Bt.syslog=pi.levels(qa.syslog);Bt.addColors=pi.levels});var Nd=m((gi,Td)=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});var n1=Bn(),i1=qr(n1),o1=Qn(),a1=qr(o1),s1=va(),u1=qr(s1),l1=ga(),c1=qr(l1),f1=ma(),d1=qr(f1),p1=Dr(),h1=qr(p1),g1=ut(),m1=qr(g1);function qr(e){return e&&e.__esModule?e:{default:e}}function y1(e,r,t){t=(0,c1.default)(t);var n=0,i=0,{length:o}=e,s=!1;o===0&&t(null);function u(d,h){d===!1&&(s=!0),s!==!0&&(d?t(d):(++i===o||h===a1.default)&&t(null))}for(;n<o;n++)r(e[n],n,(0,d1.default)(u))}function v1(e,r,t){return(0,u1.default)(e,1/0,r,t)}function b1(e,r,t){var n=(0,i1.default)(e)?y1:v1;return n(e,(0,h1.default)(r),t)}gi.default=(0,m1.default)(b1,3);Td.exports=gi.default});var Md=m((mi,xd)=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.default=_1;function _1(e){return(r,t,n)=>e(r,n)}xd.exports=mi.default});var bi=m((vi,Rd)=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});var w1=Nd(),E1=yi(w1),S1=Md(),O1=yi(S1),P1=Dr(),A1=yi(P1),T1=ut(),N1=yi(T1);function yi(e){return e&&e.__esModule?e:{default:e}}function x1(e,r,t){return(0,E1.default)(e,(0,O1.default)((0,A1.default)(r)),t)}vi.default=(0,N1.default)(x1,3);Rd.exports=vi.default});var Dd=m((PO,Id)=>{"use strict";var M1=Object.prototype.toString;Id.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=M1.call(r).slice(8,-1);return n==="Function"?t=t.substring(t.indexOf("(")+1,t.indexOf(")")):t=n,t||"anonymous"}});var $a=m((AO,Cd)=>{"use strict";var R1=Dd();Cd.exports=function(r){var t=0,n;function i(){return t||(t=1,n=r.apply(this,arguments),r=null),n}return i.displayName=R1(r),i}});var ja=m(Gt=>{Gt.get=function(e){var r=Error.stackTraceLimit;Error.stackTraceLimit=1/0;var t={},n=Error.prepareStackTrace;Error.prepareStackTrace=function(o,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 o=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){o=u.substr(0,b),s=u.substr(b+1);var _=o.indexOf(".Module");_>0&&(u=u.substr(_+1),o=o.substr(0,_))}d=null}s&&(d=o,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 I1=["this","typeName","functionName","methodName","fileName","lineNumber","columnNumber","function","evalOrigin"],D1=["topLevel","eval","native","constructor"];I1.forEach(function(e){Ht.prototype[e]=null,Ht.prototype["get"+e[0].toUpperCase()+e.substr(1)]=function(){return this[e]}});D1.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 qd=m((xO,Ld)=>{"use strict";var{Writable:C1}=Cr();Ld.exports=class extends C1{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 Fa=m((RO,Ud)=>{"use strict";var $d=require("os"),L1=bi(),Ua=kt()("winston:exception"),q1=$a(),jd=ja(),$1=qd();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:$d.loadavg(),uptime:$d.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.handleExceptions=!0;let t=new $1(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,o;!n.length&&i&&(console.warn("winston: exitOnError cannot be true with no exception handlers."),console.warn("winston: not exiting process."),i=!1);function s(){Ua("doExit",i),Ua("process._exiting",process._exiting),i&&!process._exiting&&(o&&clearTimeout(o),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()=>{Ua(_),h()}}y._ending=!0,y.once("finish",b("finished")),y.once("error",b("error"))},()=>i&&s()),this.logger.log(t),i&&(o=setTimeout(s,3e3))}_getExceptionHandlers(){return this.logger.transports.filter(r=>(r.transport||r).handleExceptions)}}});var kd=m((DO,Fd)=>{"use strict";var{Writable:j1}=Cr();Fd.exports=class extends j1{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 za=m((LO,Hd)=>{"use strict";var zd=require("os"),U1=bi(),ka=kt()("winston:rejection"),F1=$a(),Bd=ja(),k1=kd();Hd.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:zd.loadavg(),uptime:zd.uptime()}}getTrace(r){return(r?Bd.parse(r):Bd.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 k1(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,o;!n.length&&i&&(console.warn("winston: exitOnError cannot be true with no rejection handlers."),console.warn("winston: not exiting process."),i=!1);function s(){ka("doExit",i),ka("process._exiting",process._exiting),i&&!process._exiting&&(o&&clearTimeout(o),process.exit(1))}if(!n||n.length===0)return process.nextTick(s);U1(n,(u,d)=>{let h=F1(d),y=u.transport||u;function b(_){return()=>{ka(_),h()}}y._ending=!0,y.once("finish",b("finished")),y.once("error",b("error"))},()=>i&&s()),this.logger.log(t),i&&(o=setTimeout(s,3e3))}_getRejectionHandlers(){return this.logger.transports.filter(r=>(r.transport||r).handleRejections)}}});var Wd=m((qO,Gd)=>{"use strict";var Ba=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)}};Gd.exports=Ba});var _i=m(($O,Jd)=>{"use strict";var{Stream:z1,Transform:B1}=Cr(),Yd=bi(),{LEVEL:ze,SPLAT:Vd}=oe(),Kd=La(),H1=Fa(),G1=za(),W1=da(),Y1=Wd(),{warn:V1}=qo(),K1=hi(),J1=/%[scdjifoO%]/g,wi=class extends B1{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:o="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||Mo()(),this.defaultMeta=n||null,this.levels=i||this.levels||K1.npm.levels,this.level=o,this.exceptions&&this.exceptions.unhandle(),this.rejections&&this.rejections.unhandle(),this.exceptions=new H1(this),this.rejections=new G1(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=Ha(this.levels,r);if(t===null)return!1;let n=Ha(this.levels,this.level);return n===null?!1:!this.transports||this.transports.length===0?n>=t:this.transports.findIndex(o=>{let s=Ha(this.levels,o.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(J1))){let s=Object.assign({},this.defaultMeta,i,{[ze]:r,[Vd]: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,[Vd]: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();Yd(t,(n,i)=>{if(!n||n.finished)return setImmediate(i);n.once("finish",i),n.end()},r)}add(r){let t=!Kd(r)||r.log.length>2?new W1({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(!Kd(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(){V1.deprecated("setLevels")}query(r,t){typeof r=="function"&&(t=r,r={}),r=r||{};let n={},i=Object.assign({},r.query||{});function o(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){o(u,(h,y)=>{d&&(y=h||y,y&&(n[u.name]=y),d()),d=null})}Yd(this.transports.filter(u=>!!u.query),s,()=>t(null,n))}stream(r={}){let t=new z1,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 o=i.stream(r);o&&(n.push(o),o.on("log",s=>{s.transport=s.transport||[],s.transport.push(i.name),t.emit("log",s)}),o.on("error",s=>{s.transport=s.transport||[],s.transport.push(i.name),t.emit("error",s)}))}),t}startTimer(){return new Y1(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 o=typeof t[t.length-1]=="object"?t.pop():{};return o.level=o.level||"info",o.durationMs=n-i,o.message=o.message||r,this.write(o)}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 Ha(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)}});Jd.exports=wi});var Ga=m((jO,Zd)=>{"use strict";var{LEVEL:Z1}=oe(),X1=hi(),Q1=_i(),ew=kt()("winston:create-logger");function rw(e){return"is"+e.charAt(0).toUpperCase()+e.slice(1)+"Enabled"}Zd.exports=function(e={}){e.levels=e.levels||X1.npm.levels;class r extends Q1{constructor(i){super(i)}}let t=new r(e);return Object.keys(e.levels).forEach(function(n){if(ew('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 o=this||t;if(i.length===1){let[s]=i,u=s&&s.message&&s||{message:s};return u.level=u[Z1]=n,o._addDefaultMeta(u),o.write(u),this||t}return i.length===0?(o.log(n,""),o):o.log(n,...i)},r.prototype[rw(n)]=function(){return(this||t).isLevelEnabled(n)}}),t}});var Qd=m((FO,Xd)=>{"use strict";var tw=Ga();Xd.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=tw(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 rp=m(J=>{"use strict";var ep=Lo(),{warn:Wt}=qo();J.version=Pl().version;J.transports=Ad();J.config=hi();J.addColors=ep.levels;J.format=ep.format;J.createLogger=Ga();J.Logger=_i();J.ExceptionHandler=Fa();J.RejectionHandler=za();J.Container=Qd();J.Transport=at();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(rp()),nw=ap(require("util")),tp=require("zod-validation-error");X.LOG_LEVELS=["debug","info","warn","error"];X.DEFAULT_LOG_LEVEL="info";function np(e,r){let{combine:t,printf:n,timestamp:i}=mr.default.format,o="\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}${o}`;break;case"warn":w="warn",T=e?w:`${u}${w}${o}`;break;case"error":w="error",T=e?w:`${d}${w}${o}`;break;default:w=`${b}:`,T=w}let D=" ".repeat(w.length+1),$=op(_,r),P=g[Symbol.for("splat")]||[],L="";P.length>0&&(L=`
57
+ ${P.map(G=>op(G,r)).join(`
58
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 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:
60
+ `});return e?t(i({format:"YYYY-MM-DD HH:mm:ss"}),h):t(h)}function iw(e){return mr.default.format.printf(r=>{let{level:t,message:n,timestamp:i,...o}=r,s=(0,X.processNestedErrors)(n,e),d=(o[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 ip(e,r){let t=[];for(let n of e)n.mode==="console"?t.push(new mr.default.transports.Console({format:np(!1,n.showErrorStack)})):n.mode==="file"?r?t.push(new mr.default.transports.File({filename:r,format:np(!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(),iw(n.showErrorStack))}));return t}var ow=(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,tp.isZodErrorLike)(e)&&(t.message=(0,tp.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=ow;var op=(e,r)=>{try{if(typeof e=="string")return e;let t=(0,X.processNestedErrors)(e,r);return nw.default.inspect(t,{colors:!1,depth:null,compact:!1,maxArrayLength:null,maxStringLength:null,customInspect:!0})}catch{return String(e)}},Wa=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(o=>o.mode==="console"||o.mode==="file"||o.mode==="json");n.length===0&&this.winstonLogger.warn("No valid output modes provided."),this.currentConfig=n,this.winstonLogger.clear(),ip(n,t).forEach(o=>this.winstonLogger.add(o))},this.getOutputModes=()=>this.currentConfig,this.currentConfig=[{mode:"console",showErrorStack:!1}],this.winstonLogger=e.createWinstonLogger(this.currentConfig)}static createWinstonLogger(r){let t=ip(r);return mr.default.createLogger({exitOnError:!0,level:X.DEFAULT_LOG_LEVEL,transports:t})}},aw=new Wa;X.logger=aw});var Ya=m(jr=>{"use strict";Object.defineProperty(jr,"__esModule",{value:!0});jr.getIntroductoryOfferGroupingKey=up;jr.getIntroductoryOfferGroupingDescription=lp;jr.validateIntroductoryOffersGrouping=uw;jr.validateIntroductoryOffers=lw;jr.validateIntroductoryOfferAppleRestrictions=cw;var Ei=co(),sw=$r(),sp=bt();function up(e){return e.type==="PAY_AS_YOU_GO"?`${e.type}_${e.numberOfPeriods}`:`${e.type}_${e.duration}`}function lp(e){return e.type==="PAY_AS_YOU_GO"?`type '${e.type}' with numberOfPeriods '${e.numberOfPeriods}'`:`type '${e.type}' with duration '${e.duration}'`}function uw(e,r){let t=new Map;for(let n=0;n<e.length;n++){let i=e[n],o=up(i),s=lp(i);if(t.has(o)){let u=t.get(o);u.count++,u.indices.push(n);let d=u.indices;if(d.length<2){sw.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(o,{count:1,indices:[n]})}return{success:!0}}function lw(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 o=(0,Ei.getValidIntroductoryOfferDurations)(r,i.type);throw new sp.ContextualError(`Invalid duration '${i.duration}' for ${i.type} offer in subscription '${e}' with period '${r}'.`,{subscriptionProductId:e,subscriptionPeriod:r,offer:i,validDurations:o})}}else if(i.type==="PAY_AS_YOU_GO"&&!(0,Ei.isValidPayAsYouGoPeriods)(r,i.numberOfPeriods)){let o=(0,Ei.getValidPayAsYouGoPeriods)(r);throw new sp.ContextualError(`Invalid numberOfPeriods '${i.numberOfPeriods}' for PAY_AS_YOU_GO offer in subscription '${e}' with period '${r}'.`,{subscriptionProductId:e,subscriptionPeriod:r,offer:i,validPeriods:o})}for(let o of i.availableTerritories){if(n.has(o))throw new Error(`Multiple introductory offers found for territory '${o}' in subscription '${e}'. Only one offer per territory is allowed.`);n.set(o,i)}}}function cw(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=fw;Oi.validateSubscription=dw;var Si=require("zod"),cp=Ya();function fw(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 dw(e,r){if(e.introductoryOffers&&e.introductoryOffers.length>0){let t=(0,cp.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,cp.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=so();Object.defineProperty(N,"LocaleCodeSchema",{enumerable:!0,get:function(){return Yt.LocaleCodeSchema}});var Va=gn(),pw=Pi(),Je=$r();N.WORLDWIDE_TERRITORY_CODE="worldwide";var Vt=64,Ka=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 hw=A.z.object({type:A.z.literal("PAY_AS_YOU_GO"),numberOfPeriods:A.z.number(),pricing:N.PriceScheduleSchema,availableTerritories:N.AvailableTerritoriesSchema}),gw=A.z.object({type:A.z.literal("PAY_UP_FRONT"),duration:N.SubscriptionOfferDurationSchema,pricing:N.PriceScheduleSchema,availableTerritories:N.AvailableTerritoriesSchema}),mw=A.z.object({type:A.z.literal("FREE_TRIAL"),duration:N.SubscriptionOfferDurationSchema,availableTerritories:N.AvailableTerritoriesSchema});N.IntroductoryOfferSchema=A.z.discriminatedUnion("type",[hw,gw,mw]);var yw=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}),vw=A.z.object({id:A.z.string(),referenceName:A.z.string(),type:A.z.literal("PAY_UP_FRONT"),duration:N.SubscriptionOfferDurationSchema,pricing:N.PriceScheduleSchema}),bw=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",[yw,vw,bw]).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>Ka&&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(Va.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>Ka&&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(pw.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(Va.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>Ka&&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(Va.validateAppStoreModelData)});var dp=m(fp=>{"use strict";Object.defineProperty(fp,"__esModule",{value:!0})});var mp=m(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.PricingRequestSchema=He.PricingItemSchema=He.PricePointInfoSchema=He.PricingStrategySchema=void 0;var Ae=require("zod"),pp=Ae.z.enum(["apple","purchasingPower"]);He.PricingStrategySchema=pp;var hp=Ae.z.object({id:Ae.z.string(),price:Ae.z.string()});He.PricePointInfoSchema=hp;var gp=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=gp;var _w=Ae.z.object({appId:Ae.z.string(),selectedItem:gp,basePricePoint:hp,pricingStrategy:pp,minimumPrice:Ae.z.string().optional()});He.PricingRequestSchema=_w});var vp=m(yp=>{"use strict";Object.defineProperty(yp,"__esModule",{value:!0})});var bp=m(Ja=>{"use strict";Object.defineProperty(Ja,"__esModule",{value:!0});Ja.validateAppStoreModel=Aw;var ww=require("zod"),Ew=$r(),Sw=Ti(),Ow=Pi(),Pw=bt();function Aw(e,r=!1,t="fetch"){let n=Sw.AppStoreModelSchema.safeParse(e);if(n.success){if(t==="apply"&&n.data.subscriptionGroups)for(let i of n.data.subscriptionGroups)for(let o of i.subscriptions){let s=[],u={addIssue:d=>{s.push(d)},path:[],value:o,issues:s};if((0,Ow.validateSubscriptionTerritoryPricing)(o,u),s.length>0)throw new ww.z.ZodError(s)}return r&&Ew.logger.info("\u2705 Validation passed! The JSON file format and structure are valid."),n.data}else throw new Pw.ContextualError(`\u274C Validation failed for '${t}'!`,n.error)}});var wp=m(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.useShortcuts=Nw;Mi.removeShortcuts=Rw;var Ni=pn(),Tw=gn(),_p=$r(),xi=Ti();function Za(e){return e.toLowerCase()===xi.WORLDWIDE_TERRITORY_CODE.toLowerCase()}function Xa(e){return(0,Tw.deepEqualUnordered)(e,Ni.territoryCodes)}function Nw(e){if(!e||typeof e!="object")return e;let r=Qa(e);return r=xw(r),r}function Qa(e){if(!e||typeof e!="object")return e;let r={...e};return r.availableTerritories&&Array.isArray(r.availableTerritories)&&Xa(r.availableTerritories)&&(r.availableTerritories=xi.WORLDWIDE_TERRITORY_CODE),r.availability&&typeof r.availability=="object"&&r.availability.availableTerritories&&Array.isArray(r.availability.availableTerritories)&&Xa(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)&&Xa(n.availableTerritories)&&(n.availableTerritories=xi.WORLDWIDE_TERRITORY_CODE),n})),Array.isArray(r.inAppPurchases)&&(r.inAppPurchases=r.inAppPurchases.map(t=>Qa(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=>Qa(i))),n})),r}function xw(e){if(!e||typeof e!="object")return e;let r={...e};return Array.isArray(r.localizations)&&r.primaryLocale&&(r.localizations=Mw(r.localizations,r.primaryLocale)),r}function Mw(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 o={locale:i.locale};return Object.keys(i).filter(u=>u!=="locale").forEach(u=>{let d=u;i[d]!==t[d]&&(o[d]=i[d])}),o});return _p.logger.debug(`Optimized ${e.length} localizations to avoid duplicates with primary locale: ${r}`),n}function Rw(e){if(!e||typeof e!="object")return e;let r=Iw(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"&&Za(r.availableTerritories)&&(r.availableTerritories=[...Ni.territoryCodes]),r.availability&&typeof r.availability=="object"&&r.availability.availableTerritories&&typeof r.availability.availableTerritories=="string"&&Za(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"&&Za(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 Iw(e){if(!e||typeof e!="object")return e;let r={...e};return Array.isArray(r.localizations)&&r.primaryLocale&&(r.localizations=Dw(r.localizations,r.primaryLocale)),r}function Dw(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 o={...t,locale:i.locale};return Object.keys(i).forEach(s=>{if(s!=="locale"){let u=s;o[u]=i[u]}}),o});return _p.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 Ep=m(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.collectPricingItems=Cw;function Cw(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 Ap=m(Ze=>{"use strict";var Lw=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]})),qw=Ze&&Ze.__setModuleDefault||(Object.create?(function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}):function(e,r){e.default=r}),Pp=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"&&Lw(t,r,n[i]);return qw(t,r),t}})();Object.defineProperty(Ze,"__esModule",{value:!0});Ze.validateFileExists=Uw;var $w=Pp(require("fs")),Sp=Pp(require("path")),Op=$r(),jw=rs();function Uw(e,r={}){let{defaultFilename:t=jw.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=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=`
62
+ 2. Specify a ${n} using the --file or -f option`}=r,o;return e&&e.trim()!==""?o=Sp.resolve(e):o=Sp.resolve(process.cwd(),t),$w.existsSync(o)||(Op.logger.error(`File not found: ${o}`),(!e||e.trim()==="")&&Op.logger.info(`No file specified and default file ${t} not found in current directory.
63
+ `+i),process.exit(1)),o}});var K=m(Q=>{"use strict";var Fw=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)&&Fw(r,e,t)};Object.defineProperty(Q,"__esModule",{value:!0});me(Ti(),Q);me(pn(),Q);me(so(),Q);me(dp(),Q);me(mp(),Q);me(vp(),Q);me(gn(),Q);me(Pi(),Q);me(Ya(),Q);me(co(),Q);me(bt(),Q);me(bp(),Q);me(wp(),Q);me(rs(),Q);me(Ep(),Q);me(Ap(),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 ao=C(oo());var Js="0.0.7";var Em=process.env.NODE_ENV=="development";Em?ao.default.notify=()=>{}:ao.default.start({apiKey:"9214ba2acdaeee4012c236461232c4f3",autoTrackSessions:!1,appVersion:Js,logger:null});var Ih=C(oo()),Dh=C(require("yargs")),Ch=require("yargs/helpers"),zr=C(K());var dt=C(K()),Tp=C(K()),Np=C(K()),kw={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,Np.validateAppStoreModel)((0,Tp.removeShortcuts)((0,dt.readJsonFile)(r)),!0,"fetch")}},xp=kw;var yr=C(K());var Mp=C(K()),Rp=C(K()),Ri=C(K());function pt(e){return e===Ri.WORLDWIDE_TERRITORY_CODE?!0:(0,Ri.deepEqualUnordered)(e,Rp.territoryCodes)}function Ur(e){return e.map(r=>`${r.territory}: $${r.price}`).join(", ")}async function zw(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 o=JSON.stringify(e.payload.changes);r=`Updating in-app purchase "${e.payload.productId}"`,t=o;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=Ur(d.prices);r=`Updating IAP "${e.payload.productId}" pricing`,t=h;break;case"CREATE_SUBSCRIPTION":let y=e.payload.subscription,b=y.pricing?Ur(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,$=Ur(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":Ur(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,j=G.pricing?Ur(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: ${j}, Territories: ${te}`;break;case"UPDATE_APP_PRICING":let ce=e.payload.pricing,fe=Ur(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,je=JSON.stringify(e.payload.changes||{});r=`Updating subscription group localization for ${Ne.locale}`,t=je;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":Ur(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}Mp.logger.info(`${r}
64
+ ${t}`)}async function Ip(e){for(let r of e)await zw(r)}var Up=C(K()),Fp=C(K()),kp=C(K());var os=C(require("axios"));var Xe=C(require("fs")),ns=C(require("path")),Dp=C(require("os")),Fr=C(K()),is=class{constructor(r){this.keyPath=r??ns.default.join(Dp.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 Cp=C(K()),ae=os.default.create({baseURL:process.env.API_BASE_URL||"https://api.storeconfig.com",timeout:3e4,headers:{"Content-Type":"application/json"}});ae.interceptors.request.use(e=>{let r=Kt.loadKey();return r&&(e.headers["X-StoreConfig-ApiKey"]=r),e},e=>Promise.reject(e));ae.interceptors.response.use(e=>e,e=>{if(os.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 Cp.ContextualError(t,n)}throw e});var Bw=()=>Kt.hasKey(),Lp=()=>{if(!Bw())throw new Error("Authentication required. Please run 'storeconfig configure' first to set up your secret key")};var Hw=5e3,qp=async(e,r,t)=>{let n=-1;for(;;){let{status:i,currentActionIndex:o,currentAction:s,totalActions:u,error:d}=(await Gw(e)).data;if(o!==n){t&&o!==n+1&&n>=0&&await Ww(t,n+1,o,r);let h=$p(s),y=`Processing action [${o+1}/${u}] ${h}`;r.text=y,n=o}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,Hw))}},Gw=async e=>(await ae.get(`/status/${e}`)).data,$p=e=>e?e.type:"Unknown Action",Ww=async(e,r,t,n)=>{let i=Math.max(0,r),o=Math.min(e.length,t);for(let s=i;s<o;s++){let u=e[s],d=e.length;if(u){let h=$p(u),y=`Processing action [${s+1}/${d}] ${h}`;n.text=y,await new Promise(b=>setTimeout(b,500))}}};var Di=C(K()),as=C(require("inquirer"));var Ii=async()=>(await ae.get("/info")).data.data;var jp=async(e,r,t,n=!1,i)=>{let o=await Vw();if(o){let d=await Yw(o,i);if(d)return{jobId:d,newJobCreated:!1}}return await Zw()?(i.start("Processing actions..."),{jobId:(await ae.post("/apply",{plan:e,currentState:r,desiredState:t,dryRun:n})).data.data,newJobCreated:!0}):(Di.logger.warn("Operation cancelled by user"),null)},Yw=async(e,r)=>await Kw(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),Vw=async()=>{let e=await Ii(),{currentJob:r}=e;return r&&(r.status==="pending"||r.status==="processing")?r.id:null},Kw=async e=>{let{watchOngoing:r}=await as.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},Jw=`
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,zw))}},Bw=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
- `,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=`
75
+ `,Zw=async()=>{Di.logger.std(Jw);let{confirmed:e}=await as.default.prompt([{type:"confirm",name:"confirmed",message:"Do you want to proceed with applying these changes?",default:!1}]);return e};var zp=C(require("ora")),Xw=`
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
- `,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+=`
82
+ `,Qw={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,zp.default)("Generating actions...").start();try{let o=(0,Fp.validateAppStoreModel)((0,kp.removeShortcuts)((0,Up.readJsonFile)(n)),!1,"apply"),s=await ae.post("/diff",{desiredState:o}),{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 Ip(u),r){yr.logger.info("Preview mode - no changes will be applied");return}let h=await jp(u,d,o,t,i);if(h){let{jobId:y,newJobCreated:b}=h;i.prefixText=Xw,await qp(y,i,b?u:void 0)}}catch(o){throw i.stop(),o}}},Bp=Qw;var Jt=C(K()),Hp=C(require("fs")),Gp=C(require("inquirer"));var Wp=C(require("ora"));async function eE(){return(await ae.get("/fetch-apps")).data.data}async function rE(e){let r=e.map((n,i)=>({name:`${i+1}. ${n.name}`,value:n})),{selectedApp:t}=await Gp.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 tE={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,Wp.default)();try{if(!r){n.start("No app ID provided. Fetching available apps...");let s=await eE();s.length===0&&(n.fail("No IOS apps found in your App Store Connect account"),process.exit(1)),n.stop(),r=await rE(s)}n.start(`Fetching details for app ID: ${r} and writing to ${t}`);let o=(await ae.post("/fetch",{appId:r})).data.data;Hp.writeFileSync(t,JSON.stringify(o,null,2)),n.succeed(`Successfully fetched app: ${t}`)}catch(i){throw n.stop(),i}}},Yp=tE;var uh=C(require("fs")),Qe=C(K()),lh=C(K()),ch=C(K());var Jp=C(require("inquirer")),Ci=C(K());function Vp(e){switch(e){case"inAppPurchase":return"In App Purchase";case"subscription":return"Subscription";case"offer":return"Offer";case"app":return"App"}}function Kp(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 nE(e){let r=e.map((i,o)=>{let s=`"${i.name}"`;return i.type==="offer"&&(s=Kp(i)),{name:`${Vp(i.type)}: ${s} (ID: ${i.id})`,value:i}}),{selectedItem:t}=await Jp.default.prompt([{type:"list",name:"selectedItem",message:"Select an item:",choices:r}]),n=t.type==="offer"?Kp(t):`"${t.name}"`;return Ci.logger.info(`\u2705 Selected: ${Vp(t.type)}: ${n} (ID: ${t.id})`),t}async function Zp(e,r=Ci.collectPricingItems,t=nE){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 Qp=C(require("inquirer")),eh=C(K());function Xp(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 iE(e,r,t){return r.map(i=>({price:i,diff:Math.abs(Number(i)-e)})).sort((i,o)=>i.diff-o.diff).slice(0,Math.max(0,t)).map(i=>i.price).sort((i,o)=>Number(i)-Number(o))}async function rh(e,r,t){let n;n=await t(e,r.appId,eh.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 o=b=>{let _=Xp(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=iE(_,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 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(`
84
+ ${g.join(" | ")}`),w}return!0},{price:s}=await Qp.default.prompt([{type:"input",name:"price",message:"Enter base price in USD (e.g., 5.99):",validate:o}]),d=Xp(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 th=C(require("inquirer"));async function nh(){let{strategy:e}=await th.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 ih=C(require("inquirer")),oh=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."];oh.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 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+=`
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:o}=await ih.default.prompt([{type:"input",name:"minimumPrice",message:"Minimum price in USD (optional, press Enter to skip):",validate:i}]),s=o.trim();return s===""?void 0:s}async function sh(e){let{appStoreState:r,fetchTerritoryPricePointsForSelectedItem:t}=e,n=await Zp(r),i=await rh(n,r,t),o=await nh(),s=await ah(o,i.price);return{appId:r.appId,selectedItem:{type:n.type,id:n.id,name:n.name,offerType:n.offerType},basePricePoint:i,pricingStrategy:o,minimumPrice:s}}var Li=C(K());var fh=C(require("ora"));async function oE(e,r,t){return(await ae.post("/price-points",{selectedItem:e,appId:r,territoryId:t})).data.data.pricePoints}async function aE(e,r){return(await ae.post("/apply-pricing",{appStoreState:e,pricingRequest:r})).data.data.updatedState}var sE={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")}},dh=sE;var Te=C(K());var ph=C(require("fs"));function uE(e){return e.item.name}var lE=["Territory","Local Price","Local Currency","USD Price","Relative to USA (%)"];function cE(e,r){let t=[];t.push(["Name",...lE].join(",")),e.forEach(i=>{i.prices.forEach(o=>{t.push(`${uE(i)},${o.territory},${o.localPrice},${o.localCurrency},${o.usdPrice.toFixed(2)},${o.usdPercentage.toFixed(0)}`)})});let n=t.join(`
89
+ `);ph.writeFileSync(r,n,"utf8")}function hh(e,r){let t=r.toLowerCase().split(".").pop();if(!t||t!=="csv")throw new Error(`Unsupported file format. Please use ".csv" extension: "${r}"`);cE(e,r)}var fE={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")}},gh=fE;var kr=C(K()),yh=C(require("inquirer")),vh=C(require("fs")),bh=C(require("path")),dE=[{key:"minimal",name:"Minimal App"},{key:"full",name:"Full App"},{key:"subscription",name:"Subscription"},{key:"in-app-purchase",name:"In-App Purchase"}];function mh(e){let r=bh.parse(e),t=r.ext,n=r.name;return t?`${n}_example${t}`:`${e}_example`}async function pE(){let e=dE.map((t,n)=>({name:`${n+1}. ${t.name}`,value:t.key})),{selectedType:r}=await yh.default.prompt([{type:"list",name:"selectedType",message:"Select the example type you want to generate:",choices:e}]);return r}var _h=[{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"}]}],hE={referenceName:"Premium Subscriptions",localizations:[{locale:"en-US",name:"Premium Subscriptions"},{locale:"es-ES",name:"Suscripciones Premium"}],subscriptions:_h},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"}]}],wh={schemaVersion:"1.0.0",appId:"1234567890",versionString:"2.1.17",pricing:{baseTerritory:"USA",prices:[{price:"0.99",territory:"USA"}]},availableTerritories:"worldwide",inAppPurchases:ss,subscriptionGroups:[hE],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"},gE={...wh,pricing:{baseTerritory:"USA",prices:[{price:"0.0",territory:"USA"}]},inAppPurchases:void 0,subscriptionGroups:void 0},mE={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 ${mh(kr.DEFAULT_CONFIG_FILENAME)} in current directory.`,demandOption:!1,type:"string"}},handler:async e=>{let r=e.type,t=e.file||mh(kr.DEFAULT_CONFIG_FILENAME);r||(r=await pE());let i={minimal:gE,full:wh,subscription:_h,iap:ss,"in-app-purchase":ss}[r];if(!i)throw new Error(`Unknown example type: ${r}`);try{vh.writeFileSync(t,JSON.stringify(i,null,2)),kr.logger.info(`Successfully generated example and wrote to ${t}`)}catch(o){throw new kr.ContextualError("Failed to write example file",o)}}},Eh=mE;var Ph=C(K());var Sh=C(require("inquirer"));async function Oh(){let{secretKey:e}=await Sh.default.prompt([{type:"password",name:"secretKey",message:"Enter your StoreConfig Secret Key:",mask:"*"}]);return e.trim()}var yE={command:"configure",describe:"Configure StoreConfig with the Secret Key",handler:async e=>{let r=await Oh();if(!r)throw new Error("Secret key cannot be empty");Kt.saveKey(r),Ph.logger.info("\u2705 Secret key saved successfully! Add Apple credentials now (storeconfig apple) if you haven't already.")}},Ah=yE;var Th=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 Th.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 ae.post("/auth",{keyId:t,issuerId:r,privateKey:n});i.data.message&&vr.logger.info(i.data.message)}},Nh=new us;var vE={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 Nh.configureAppleCredentials(r,t,n)}},xh=vE;var Mh=C(K());var bE={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}`)),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});
91
+ Error: ${e.currentJob.error}`)),Mh.logger.std(r)}},Rh=bE;zr.logger.setOutputModes([{mode:"console",showErrorStack:!1}]);zr.logger.setLevel("info");async function _E(){await(0,Dh.default)((0,Ch.hideBin)(process.argv)).middleware(r=>{let t=["fetch","apply","set-price","compare-price","apple","user"],n=r._[0];t.includes(n)&&Lp()}).command(xp).command(Bp).command(Yp).command(dh).command(gh).command(Eh).command(Ah).command(xh).command(Rh).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()}_E().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),Ih.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: