storeconfig 0.0.1

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 ADDED
@@ -0,0 +1,75 @@
1
+ #!/usr/bin/env node
2
+ "use strict";var jd=Object.create;var Qo=Object.defineProperty;var kd=Object.getOwnPropertyDescriptor;var zd=Object.getOwnPropertyNames;var Hd=Object.getPrototypeOf,Gd=Object.prototype.hasOwnProperty;var c=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var Yd=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of zd(e))!Gd.call(r,n)&&n!==t&&Qo(r,n,{get:()=>e[n],enumerable:!(i=kd(e,n))||i.enumerable});return r};var S=(r,e,t)=>(t=r!=null?jd(Hd(r)):{},Yd(e||!r||!r.__esModule?Qo(t,"default",{value:r,enumerable:!0}):t,r));var wt=c(Be=>{"use strict";Object.defineProperty(Be,"__esModule",{value:!0});Be.TerritoryCodeSchema=Be.territoryCodes=void 0;var Wd=require("zod");Be.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"];Be.TerritoryCodeSchema=Wd.z.enum(Be.territoryCodes)});var Vi=c(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.LocaleCodeSchema=Ve.localeCodes=void 0;var Bd=require("zod");Ve.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"];Ve.LocaleCodeSchema=Bd.z.enum(Ve.localeCodes)});var jr=c(Te=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Te.ContextualError=void 0;Te.isNotFoundError=Vd;Te.isRateLimitError=Kd;Te.isNotAuthorizedError=Jd;Te.isVersionNotUpdatableError=Zd;Te.extractClientErrorToSend=ea;var Ki=require("zod-validation-error"),Et=class r extends Error{constructor(e,t){super(e),this.stack=new Error(e).stack,this.context=t,Object.setPrototypeOf(this,r.prototype)}};Te.ContextualError=Et;function Ke(r){let e=[];if(!r||typeof r!="object")return e;r.errors&&Array.isArray(r.errors)&&e.push(r);for(let t in r)if(r.hasOwnProperty(t)){let i=r[t];Array.isArray(i)?i.forEach(n=>{e.push(...Ke(n))}):i&&typeof i=="object"&&e.push(...Ke(i))}return e}function Vd(r){let e=Ke(r);for(let t of e)if(t.errors&&Array.isArray(t.errors)&&t.errors.some(i=>i.status==="404"||i.status===404))return!0;return r?.status===404||r?.status==="404"||r?.response?.status===404}function Kd(r){if(r?.status===429||r?.status==="429")return!0;let e=Ke(r);for(let t of e)if(t.errors&&Array.isArray(t.errors)&&t.errors.some(i=>i.status===429||i.status==="429"))return!0;return!1}function Jd(r){if(r?.status===401||r?.status==="401")return!0;let e=Ke(r);for(let t of e)if(t.errors&&Array.isArray(t.errors)&&t.errors.some(i=>i.status===401||i.status==="401"||i.code==="NOT_AUTHORIZED"))return!0;return!1}function Zd(r){if(r?.status===409||r?.status==="409")return!0;let e=Ke(r);for(let t of e)if(t.errors&&Array.isArray(t.errors)&&t.errors.some(i=>i.status===409||i.status==="409"||i.code==="ENTITY_ERROR.ATTRIBUTE.INVALID.INVALID_STATE"))return!0;return!1}function ea(r){try{if(Ki.isZodErrorLike&&(0,Ki.isZodErrorLike)(r))return{message:(0,Ki.fromError)(r).message,status:400}}catch{}if(r instanceof Et){let t=Ke(r.context).flatMap(n=>Array.isArray(n.errors)?n.errors.map(o=>({title:o?.title,detail:o?.detail})):[]),i=r.message;if(r.context instanceof Error){let n=ea(r.context);i=i+`
3
+ ${n.message}`,t=t.concat(n.details||[])}return{message:i,status:400,details:t}}return typeof r=="string"?{message:r,status:400}:r instanceof Error?{message:r.message,status:400}:{message:"Internal server error",status:500}}});var Ot=c(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.isValidProductId=void 0;Je.deepEqualUnordered=Ji;Je.readJsonFile=rp;Je.validateAppStoreModelData=ip;var Xd=require("zod"),Qd=require("fs"),ep=jr();function Ji(r,e){if(r===e)return!0;if(typeof r!=typeof e)return!1;if(Array.isArray(r)&&Array.isArray(e)){if(r.length!==e.length)return!1;let t=new Array(e.length).fill(!1);for(let i of r){let n=!1;for(let o=0;o<e.length;o++)if(!t[o]&&Ji(i,e[o])){t[o]=!0,n=!0;break}if(!n)return!1}return!0}if(r&&e&&typeof r=="object"){let t=Object.keys(r),i=Object.keys(e);if(t.length!==i.length)return!1;for(let n of t)if(!Object.prototype.hasOwnProperty.call(e,n)||!Ji(r[n],e[n]))return!1;return!0}return!1}function rp(r){let e=(0,Qd.readFileSync)(r,"utf-8");try{return JSON.parse(e)}catch(t){throw new ep.ContextualError(`\u274C Invalid JSON format! ${r}`,{filePath:r,jsonError:t})}}var tp=r=>/^[a-zA-Z0-9._]+$/.test(r);Je.isValidProductId=tp;function ip(r,e){r.primaryLocale&&r.localizations&&r.localizations.length>0&&(r.localizations.some(i=>i.locale===r.primaryLocale)||e.addIssue({code:Xd.z.ZodIssueCode.custom,message:`Primary locale '${r.primaryLocale}' must exist in the localizations array`,path:["primaryLocale"]}))}});var ra=c((Bv,np)=>{np.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 Zi=c(Ce=>{"use strict";var op=Ce&&Ce.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ce,"__esModule",{value:!0});Ce.getValidIntroductoryOfferDurations=oa;Ce.getValidPayAsYouGoPeriods=aa;Ce.isValidIntroductoryOfferDuration=sp;Ce.isValidPayAsYouGoPeriods=up;var ta=op(ra()),ia={ONE_WEEK:7,ONE_MONTH:30,TWO_MONTHS:60,THREE_MONTHS:90,SIX_MONTHS:180,ONE_YEAR:365},na={PAY_AS_YOU_GO:"PayAsYouGo",PAY_UP_FRONT:"PayUpFront",FREE_TRIAL:"FreeTrial"};function ap(r,e){if(e==="ONE_MONTH")switch(r){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(e==="ONE_WEEK")switch(r){case 1:return"ONE_WEEK";case 2:return"TWO_WEEKS";default:return null}else if(e==="ONE_DAY")switch(r){case 3:return"THREE_DAYS";default:return null}else if(e==="ONE_YEAR")switch(r){case 1:return"ONE_YEAR";default:return null}return null}function oa(r,e){if(e==="PAY_AS_YOU_GO")return[];let t=ia[r],i=na[e],n=ta.default.find(s=>s.duration===t);if(!n)throw new Error(`No duration configuration found for subscription period: ${r}`);let o=n.introOfferDurations.find(s=>s.modeType===i);if(!o)throw new Error(`No intro offer configuration found for offer type: ${e}`);let a=new Set;for(let s of o.durations){let u=ap(s.typeDuration,s.typeUnit);u&&a.add(u)}return Array.from(a)}function aa(r){let e=ia[r],t=na.PAY_AS_YOU_GO,i=ta.default.find(o=>o.duration===e);if(!i)throw new Error(`No duration configuration found for subscription period: ${r}`);let n=i.introOfferDurations.find(o=>o.modeType===t);if(!n)throw new Error(`No PAY_AS_YOU_GO configuration found for subscription period: ${r}`);return n.durations.map(o=>o.numberOfPeriods)}function sp(r,e,t){return e==="PAY_AS_YOU_GO"?!1:oa(r,e).includes(t)}function up(r,e){return aa(r).includes(e)}});var ne=c((Kv,sa)=>{"use strict";var Xi=class r extends Error{constructor(e){super(`Format functions must be synchronous taking a two arguments: (info, opts)
4
+ Found: ${e.toString().split(`
5
+ `)[0]}
6
+ `),Error.captureStackTrace(this,r)}};sa.exports=r=>{if(r.length>2)throw new Xi(r);function e(i={}){this.options=i}e.prototype.transform=r;function t(i){return new e(i)}return t.Format=e,t}});var fa=c((Jv,ca)=>{var la={};ca.exports=la;var ua={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(ua).forEach(function(r){var e=ua[r],t=la[r]=[];t.open="\x1B["+e[0]+"m",t.close="\x1B["+e[1]+"m"})});var pa=c((Zv,da)=>{"use strict";da.exports=function(r,e){e=e||process.argv||[];var t=e.indexOf("--"),i=/^-{1,2}/.test(r)?"":"--",n=e.indexOf(i+r);return n!==-1&&(t===-1?!0:n<t)}});var ma=c((Xv,ha)=>{"use strict";var lp=require("os"),me=pa(),te=process.env,wr=void 0;me("no-color")||me("no-colors")||me("color=false")?wr=!1:(me("color")||me("colors")||me("color=true")||me("color=always"))&&(wr=!0);"FORCE_COLOR"in te&&(wr=te.FORCE_COLOR.length===0||parseInt(te.FORCE_COLOR,10)!==0);function cp(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function fp(r){if(wr===!1)return 0;if(me("color=16m")||me("color=full")||me("color=truecolor"))return 3;if(me("color=256"))return 2;if(r&&!r.isTTY&&wr!==!0)return 0;var e=wr?1:0;if(process.platform==="win32"){var t=lp.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 te)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(n){return n in te})||te.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in te)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(te.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in te){var i=parseInt((te.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(te.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(te.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(te.TERM)||"COLORTERM"in te?1:(te.TERM==="dumb",e)}function Qi(r){var e=fp(r);return cp(e)}ha.exports={supportsColor:Qi,stdout:Qi(process.stdout),stderr:Qi(process.stderr)}});var ya=c((Qv,ga)=>{ga.exports=function(e,t){var i="";e=e||"Run the trap, drop the bass",e=e.split("");var n={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 e.forEach(function(o){o=o.toLowerCase();var a=n[o]||[" "],s=Math.floor(Math.random()*a.length);typeof n[o]<"u"?i+=n[o][s]:i+=o}),i}});var va=c((e1,ba)=>{ba.exports=function(e,t){e=e||" he is here ";var i={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"]},n=[].concat(i.up,i.down,i.mid);function o(u){var l=Math.floor(Math.random()*u);return l}function a(u){var l=!1;return n.filter(function(d){l=d===u}),l}function s(u,l){var d="",p,m;l=l||{},l.up=typeof l.up<"u"?l.up:!0,l.mid=typeof l.mid<"u"?l.mid:!0,l.down=typeof l.down<"u"?l.down:!0,l.size=typeof l.size<"u"?l.size:"maxi",u=u.split("");for(m in u)if(!a(m)){switch(d=d+u[m],p={up:0,down:0,mid:0},l.size){case"mini":p.up=o(8),p.mid=o(2),p.down=o(8);break;case"maxi":p.up=o(16)+3,p.mid=o(4)+1,p.down=o(64)+3;break;default:p.up=o(8)+1,p.mid=o(6)/2,p.down=o(8)+1;break}var _=["up","mid","down"];for(var f in _)for(var g=_[f],E=0;E<=p[g];E++)l[g]&&(d=d+i[g][o(i[g].length)])}return d}return s(e,t)}});var wa=c((r1,_a)=>{_a.exports=function(r){return function(e,t,i){if(e===" ")return e;switch(t%3){case 0:return r.red(e);case 1:return r.white(e);case 2:return r.blue(e)}}}});var Oa=c((t1,Ea)=>{Ea.exports=function(r){return function(e,t,i){return t%2===0?e:r.inverse(e)}}});var Pa=c((i1,Sa)=>{Sa.exports=function(r){var e=["red","yellow","green","blue","magenta"];return function(t,i,n){return t===" "?t:r[e[i++%e.length]](t)}}});var Ta=c((n1,Aa)=>{Aa.exports=function(r){var e=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(t,i,n){return t===" "?t:r[e[Math.round(Math.random()*(e.length-2))]](t)}}});var Da=c((a1,Ia)=>{var R={};Ia.exports=R;R.themes={};var dp=require("util"),Ze=R.styles=fa(),Ma=Object.defineProperties,pp=new RegExp(/[\r\n]+/g);R.supportsColor=ma().supportsColor;typeof R.enabled>"u"&&(R.enabled=R.supportsColor()!==!1);R.enable=function(){R.enabled=!0};R.disable=function(){R.enabled=!1};R.stripColors=R.strip=function(r){return(""+r).replace(/\x1B\[\d+m/g,"")};var o1=R.stylize=function(e,t){if(!R.enabled)return e+"";var i=Ze[t];return!i&&t in R?R[t](e):i.open+e+i.close},hp=/[|\\{}()[\]^$+*?.]/g,mp=function(r){if(typeof r!="string")throw new TypeError("Expected a string");return r.replace(hp,"\\$&")};function Ra(r){var e=function t(){return yp.apply(t,arguments)};return e._styles=r,e.__proto__=gp,e}var xa=(function(){var r={};return Ze.grey=Ze.gray,Object.keys(Ze).forEach(function(e){Ze[e].closeRe=new RegExp(mp(Ze[e].close),"g"),r[e]={get:function(){return Ra(this._styles.concat(e))}}}),r})(),gp=Ma(function(){},xa);function yp(){var r=Array.prototype.slice.call(arguments),e=r.map(function(a){return a!=null&&a.constructor===String?a:dp.inspect(a)}).join(" ");if(!R.enabled||!e)return e;for(var t=e.indexOf(`
7
+ `)!=-1,i=this._styles,n=i.length;n--;){var o=Ze[i[n]];e=o.open+e.replace(o.closeRe,o.open)+o.close,t&&(e=e.replace(pp,function(a){return o.close+a+o.open}))}return e}R.setTheme=function(r){if(typeof r=="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 e in r)(function(t){R[t]=function(i){if(typeof r[t]=="object"){var n=i;for(var o in r[t])n=R[r[t][o]](n);return n}return R[r[t]](i)}})(e)};function bp(){var r={};return Object.keys(xa).forEach(function(e){r[e]={get:function(){return Ra([e])}}}),r}var vp=function(e,t){var i=t.split("");return i=i.map(e),i.join("")};R.trap=ya();R.zalgo=va();R.maps={};R.maps.america=wa()(R);R.maps.zebra=Oa()(R);R.maps.rainbow=Pa()(R);R.maps.random=Ta()(R);for(Na in R.maps)(function(r){R[r]=function(e){return vp(R.maps[r],e)}})(Na);var Na;Ma(R,bp())});var en=c((s1,La)=>{var _p=Da();La.exports=_p});var Ca=c(rn=>{"use strict";rn.levels={error:0,warn:1,help:2,data:3,info:4,debug:5,prompt:6,verbose:7,input:8,silly:9};rn.colors={error:"red",warn:"yellow",help:"cyan",data:"grey",info:"green",debug:"blue",prompt:"grey",verbose:"cyan",input:"grey",silly:"magenta"}});var qa=c(tn=>{"use strict";tn.levels={error:0,warn:1,info:2,http:3,verbose:4,debug:5,silly:6};tn.colors={error:"red",warn:"yellow",info:"green",http:"green",verbose:"cyan",debug:"blue",silly:"magenta"}});var $a=c(nn=>{"use strict";nn.levels={emerg:0,alert:1,crit:2,error:3,warning:4,notice:5,info:6,debug:7};nn.colors={emerg:"red",alert:"yellow",crit:"red",error:"red",warning:"red",notice:"yellow",info:"green",debug:"blue"}});var Ua=c(St=>{"use strict";Object.defineProperty(St,"cli",{value:Ca()});Object.defineProperty(St,"npm",{value:qa()});Object.defineProperty(St,"syslog",{value:$a()})});var G=c(kr=>{"use strict";Object.defineProperty(kr,"LEVEL",{value:Symbol.for("level")});Object.defineProperty(kr,"MESSAGE",{value:Symbol.for("message")});Object.defineProperty(kr,"SPLAT",{value:Symbol.for("splat")});Object.defineProperty(kr,"configs",{value:Ua()})});var Tt=c((p1,At)=>{"use strict";var sn=en(),{LEVEL:on,MESSAGE:an}=G();sn.enabled=!0;var Fa=/\s+/,Pt=class r{constructor(e={}){e.colors&&this.addColors(e.colors),this.options=e}static addColors(e){let t=Object.keys(e).reduce((i,n)=>(i[n]=Fa.test(e[n])?e[n].split(Fa):e[n],i),{});return r.allColors=Object.assign({},r.allColors||{},t),r.allColors}addColors(e){return r.addColors(e)}colorize(e,t,i){if(typeof i>"u"&&(i=t),!Array.isArray(r.allColors[e]))return sn[r.allColors[e]](i);for(let n=0,o=r.allColors[e].length;n<o;n++)i=sn[r.allColors[e][n]](i);return i}transform(e,t){return t.all&&typeof e[an]=="string"&&(e[an]=this.colorize(e[on],e.level,e[an])),(t.level||t.all||!t.message)&&(e.level=this.colorize(e[on],e.level)),(t.all||t.message)&&(e.message=this.colorize(e[on],e.level,e.message)),e}};At.exports=r=>new Pt(r);At.exports.Colorizer=At.exports.Format=Pt});var ka=c((h1,ja)=>{"use strict";var{Colorizer:wp}=Tt();ja.exports=r=>(wp.addColors(r.colors||r),r)});var Ha=c((m1,za)=>{"use strict";var Ep=ne();za.exports=Ep(r=>(r.message=` ${r.message}`,r))});var Wa=c((g1,Ya)=>{"use strict";var Op=ne(),{LEVEL:Ga,MESSAGE:un}=G();Ya.exports=Op((r,{stack:e,cause:t})=>{if(r instanceof Error){let n=Object.assign({},r,{level:r.level,[Ga]:r[Ga]||r.level,message:r.message,[un]:r[un]||r.message});return e&&(n.stack=r.stack),t&&(n.cause=r.cause),n}if(!(r.message instanceof Error))return r;let i=r.message;return Object.assign(r,i),r.message=i.message,r[un]=i.message,e&&(r.stack=i.stack),t&&(r.cause=i.cause),r})});var cn=c((y1,Mt)=>{"use strict";var{configs:Sp,LEVEL:Ba,MESSAGE:ln}=G(),Nt=class r{constructor(e={levels:Sp.npm.levels}){this.paddings=r.paddingForLevels(e.levels,e.filler),this.options=e}static getLongestLevel(e){let t=Object.keys(e).map(i=>i.length);return Math.max(...t)}static paddingForLevel(e,t,i){let n=i+1-e.length,o=Math.floor(n/t.length);return`${t}${t.repeat(o)}`.slice(0,n)}static paddingForLevels(e,t=" "){let i=r.getLongestLevel(e);return Object.keys(e).reduce((n,o)=>(n[o]=r.paddingForLevel(o,t,i),n),{})}transform(e,t){return e.message=`${this.paddings[e[Ba]]}${e.message}`,e[ln]&&(e[ln]=`${this.paddings[e[Ba]]}${e[ln]}`),e}};Mt.exports=r=>new Nt(r);Mt.exports.Padder=Mt.exports.Format=Nt});var Va=c((b1,fn)=>{"use strict";var{Colorizer:Pp}=Tt(),{Padder:Ap}=cn(),{configs:Tp,MESSAGE:Np}=G(),Rt=class{constructor(e={}){e.levels||(e.levels=Tp.cli.levels),this.colorizer=new Pp(e),this.padder=new Ap(e),this.options=e}transform(e,t){return this.colorizer.transform(this.padder.transform(e,t),t),e[Np]=`${e.level}:${e.message}`,e}};fn.exports=r=>new Rt(r);fn.exports.Format=Rt});var Ja=c((v1,dn)=>{"use strict";var Mp=ne();function Ka(r){if(r.every(Rp))return e=>{let t=e;for(let i=0;i<r.length;i++)if(t=r[i].transform(t,r[i].options),!t)return!1;return t}}function Rp(r){if(typeof r.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(`
8
+ `));return!0}dn.exports=(...r)=>{let e=Mp(Ka(r)),t=e();return t.Format=e.Format,t};dn.exports.cascade=Ka});var Hr=c((gn,Qa)=>{"use strict";var{hasOwnProperty:zr}=Object.prototype,Qe=mn();Qe.configure=mn;Qe.stringify=Qe;Qe.default=Qe;gn.stringify=Qe;gn.configure=mn;Qa.exports=Qe;var xp=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function qe(r){return r.length<5e3&&!xp.test(r)?`"${r}"`:JSON.stringify(r)}function pn(r,e){if(r.length>200||e)return r.sort(e);for(let t=1;t<r.length;t++){let i=r[t],n=t;for(;n!==0&&r[n-1]>i;)r[n]=r[n-1],n--;r[n]=i}return r}var Ip=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function hn(r){return Ip.call(r)!==void 0&&r.length!==0}function Za(r,e,t){r.length<t&&(t=r.length);let i=e===","?"":" ",n=`"0":${i}${r[0]}`;for(let o=1;o<t;o++)n+=`${e}"${o}":${i}${r[o]}`;return n}function Dp(r){if(zr.call(r,"circularValue")){let e=r.circularValue;if(typeof e=="string")return`"${e}"`;if(e==null)return e;if(e===Error||e===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 Lp(r){let e;if(zr.call(r,"deterministic")&&(e=r.deterministic,typeof e!="boolean"&&typeof e!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return e===void 0?!0:e}function Cp(r,e){let t;if(zr.call(r,e)&&(t=r[e],typeof t!="boolean"))throw new TypeError(`The "${e}" argument must be of type boolean`);return t===void 0?!0:t}function Xa(r,e){let t;if(zr.call(r,e)){if(t=r[e],typeof t!="number")throw new TypeError(`The "${e}" argument must be of type number`);if(!Number.isInteger(t))throw new TypeError(`The "${e}" argument must be an integer`);if(t<1)throw new RangeError(`The "${e}" argument must be >= 1`)}return t===void 0?1/0:t}function Xe(r){return r===1?"1 item":`${r} items`}function qp(r){let e=new Set;for(let t of r)(typeof t=="string"||typeof t=="number")&&e.add(String(t));return e}function $p(r){if(zr.call(r,"strict")){let e=r.strict;if(typeof e!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(e)return t=>{let i=`Object can not safely be stringified. Received type ${typeof t}`;throw typeof t!="function"&&(i+=` (${t.toString()})`),new Error(i)}}}function mn(r){r={...r};let e=$p(r);e&&(r.bigint===void 0&&(r.bigint=!1),"circularValue"in r||(r.circularValue=Error));let t=Dp(r),i=Cp(r,"bigint"),n=Lp(r),o=typeof n=="function"?n:void 0,a=Xa(r,"maximumDepth"),s=Xa(r,"maximumBreadth");function u(_,f,g,E,P,N){let v=f[_];switch(typeof v=="object"&&v!==null&&typeof v.toJSON=="function"&&(v=v.toJSON(_)),v=E.call(f,_,v),typeof v){case"string":return qe(v);case"object":{if(v===null)return"null";if(g.indexOf(v)!==-1)return t;let T="",q=",",U=N;if(Array.isArray(v)){if(v.length===0)return"[]";if(a<g.length+1)return'"[Array]"';g.push(v),P!==""&&(N+=P,T+=`
9
+ ${N}`,q=`,
10
+ ${N}`);let W=Math.min(v.length,s),ee=0;for(;ee<W-1;ee++){let Le=u(String(ee),v,g,E,P,N);T+=Le!==void 0?Le:"null",T+=q}let re=u(String(ee),v,g,E,P,N);if(T+=re!==void 0?re:"null",v.length-1>s){let Le=v.length-s-1;T+=`${q}"... ${Xe(Le)} not stringified"`}return P!==""&&(T+=`
11
+ ${U}`),g.pop(),`[${T}]`}let D=Object.keys(v),L=D.length;if(L===0)return"{}";if(a<g.length+1)return'"[Object]"';let x="",j="";P!==""&&(N+=P,q=`,
12
+ ${N}`,x=" ");let K=Math.min(L,s);n&&!hn(v)&&(D=pn(D,o)),g.push(v);for(let W=0;W<K;W++){let ee=D[W],re=u(ee,v,g,E,P,N);re!==void 0&&(T+=`${j}${qe(ee)}:${x}${re}`,j=q)}if(L>s){let W=L-s;T+=`${j}"...":${x}"${Xe(W)} not stringified"`,j=q}return P!==""&&j.length>1&&(T=`
13
+ ${N}${T}
14
+ ${U}`),g.pop(),`{${T}}`}case"number":return isFinite(v)?String(v):e?e(v):"null";case"boolean":return v===!0?"true":"false";case"undefined":return;case"bigint":if(i)return String(v);default:return e?e(v):void 0}}function l(_,f,g,E,P,N){switch(typeof f=="object"&&f!==null&&typeof f.toJSON=="function"&&(f=f.toJSON(_)),typeof f){case"string":return qe(f);case"object":{if(f===null)return"null";if(g.indexOf(f)!==-1)return t;let v=N,T="",q=",";if(Array.isArray(f)){if(f.length===0)return"[]";if(a<g.length+1)return'"[Array]"';g.push(f),P!==""&&(N+=P,T+=`
15
+ ${N}`,q=`,
16
+ ${N}`);let L=Math.min(f.length,s),x=0;for(;x<L-1;x++){let K=l(String(x),f[x],g,E,P,N);T+=K!==void 0?K:"null",T+=q}let j=l(String(x),f[x],g,E,P,N);if(T+=j!==void 0?j:"null",f.length-1>s){let K=f.length-s-1;T+=`${q}"... ${Xe(K)} not stringified"`}return P!==""&&(T+=`
17
+ ${v}`),g.pop(),`[${T}]`}g.push(f);let U="";P!==""&&(N+=P,q=`,
18
+ ${N}`,U=" ");let D="";for(let L of E){let x=l(L,f[L],g,E,P,N);x!==void 0&&(T+=`${D}${qe(L)}:${U}${x}`,D=q)}return P!==""&&D.length>1&&(T=`
19
+ ${N}${T}
20
+ ${v}`),g.pop(),`{${T}}`}case"number":return isFinite(f)?String(f):e?e(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(i)return String(f);default:return e?e(f):void 0}}function d(_,f,g,E,P){switch(typeof f){case"string":return qe(f);case"object":{if(f===null)return"null";if(typeof f.toJSON=="function"){if(f=f.toJSON(_),typeof f!="object")return d(_,f,g,E,P);if(f===null)return"null"}if(g.indexOf(f)!==-1)return t;let N=P;if(Array.isArray(f)){if(f.length===0)return"[]";if(a<g.length+1)return'"[Array]"';g.push(f),P+=E;let x=`
21
+ ${P}`,j=`,
22
+ ${P}`,K=Math.min(f.length,s),W=0;for(;W<K-1;W++){let re=d(String(W),f[W],g,E,P);x+=re!==void 0?re:"null",x+=j}let ee=d(String(W),f[W],g,E,P);if(x+=ee!==void 0?ee:"null",f.length-1>s){let re=f.length-s-1;x+=`${j}"... ${Xe(re)} not stringified"`}return x+=`
23
+ ${N}`,g.pop(),`[${x}]`}let v=Object.keys(f),T=v.length;if(T===0)return"{}";if(a<g.length+1)return'"[Object]"';P+=E;let q=`,
24
+ ${P}`,U="",D="",L=Math.min(T,s);hn(f)&&(U+=Za(f,q,s),v=v.slice(f.length),L-=f.length,D=q),n&&(v=pn(v,o)),g.push(f);for(let x=0;x<L;x++){let j=v[x],K=d(j,f[j],g,E,P);K!==void 0&&(U+=`${D}${qe(j)}: ${K}`,D=q)}if(T>s){let x=T-s;U+=`${D}"...": "${Xe(x)} not stringified"`,D=q}return D!==""&&(U=`
25
+ ${P}${U}
26
+ ${N}`),g.pop(),`{${U}}`}case"number":return isFinite(f)?String(f):e?e(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(i)return String(f);default:return e?e(f):void 0}}function p(_,f,g){switch(typeof f){case"string":return qe(f);case"object":{if(f===null)return"null";if(typeof f.toJSON=="function"){if(f=f.toJSON(_),typeof f!="object")return p(_,f,g);if(f===null)return"null"}if(g.indexOf(f)!==-1)return t;let E="",P=f.length!==void 0;if(P&&Array.isArray(f)){if(f.length===0)return"[]";if(a<g.length+1)return'"[Array]"';g.push(f);let U=Math.min(f.length,s),D=0;for(;D<U-1;D++){let x=p(String(D),f[D],g);E+=x!==void 0?x:"null",E+=","}let L=p(String(D),f[D],g);if(E+=L!==void 0?L:"null",f.length-1>s){let x=f.length-s-1;E+=`,"... ${Xe(x)} not stringified"`}return g.pop(),`[${E}]`}let N=Object.keys(f),v=N.length;if(v===0)return"{}";if(a<g.length+1)return'"[Object]"';let T="",q=Math.min(v,s);P&&hn(f)&&(E+=Za(f,",",s),N=N.slice(f.length),q-=f.length,T=","),n&&(N=pn(N,o)),g.push(f);for(let U=0;U<q;U++){let D=N[U],L=p(D,f[D],g);L!==void 0&&(E+=`${T}${qe(D)}:${L}`,T=",")}if(v>s){let U=v-s;E+=`${T}"...":"${Xe(U)} not stringified"`}return g.pop(),`{${E}}`}case"number":return isFinite(f)?String(f):e?e(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(i)return String(f);default:return e?e(f):void 0}}function m(_,f,g){if(arguments.length>1){let E="";if(typeof g=="number"?E=" ".repeat(Math.min(g,10)):typeof g=="string"&&(E=g.slice(0,10)),f!=null){if(typeof f=="function")return u("",{"":_},[],f,E,"");if(Array.isArray(f))return l("",_,[],qp(f),E,"")}if(E.length!==0)return d("",_,[],E,"")}return p("",_,[])}return m}});var yn=c((_1,es)=>{"use strict";var Up=ne(),{MESSAGE:Fp}=G(),jp=Hr();function kp(r,e){return typeof e=="bigint"?e.toString():e}es.exports=Up((r,e)=>{let t=jp.configure(e);return r[Fp]=t(r,e.replacer||kp,e.space),r})});var ts=c((w1,rs)=>{"use strict";var zp=ne();rs.exports=zp((r,e)=>e.message?(r.message=`[${e.label}] ${r.message}`,r):(r.label=e.label,r))});var ns=c((E1,is)=>{"use strict";var Hp=ne(),{MESSAGE:Gp}=G(),Yp=Hr();is.exports=Hp(r=>{let e={};return r.message&&(e["@message"]=r.message,delete r.message),r.timestamp&&(e["@timestamp"]=r.timestamp,delete r.timestamp),e["@fields"]=r,r[Gp]=Yp(e),r})});var as=c((O1,os)=>{"use strict";var Wp=ne();function Bp(r,e,t){let i=e.reduce((o,a)=>(o[a]=r[a],delete r[a],o),{}),n=Object.keys(r).reduce((o,a)=>(o[a]=r[a],delete r[a],o),{});return Object.assign(r,i,{[t]:n}),r}function Vp(r,e,t){return r[t]=e.reduce((i,n)=>(i[n]=r[n],delete r[n],i),{}),r}os.exports=Wp((r,e={})=>{let t="metadata";e.key&&(t=e.key);let i=[];return!e.fillExcept&&!e.fillWith&&(i.push("level"),i.push("message")),e.fillExcept&&(i=e.fillExcept),i.length>0?Bp(r,i,t):e.fillWith?Vp(r,e.fillWith,t):r})});var us=c((S1,ss)=>{var Er=1e3,Or=Er*60,Sr=Or*60,er=Sr*24,Kp=er*7,Jp=er*365.25;ss.exports=function(r,e){e=e||{};var t=typeof r;if(t==="string"&&r.length>0)return Zp(r);if(t==="number"&&isFinite(r))return e.long?Qp(r):Xp(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function Zp(r){if(r=String(r),!(r.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r);if(e){var t=parseFloat(e[1]),i=(e[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return t*Jp;case"weeks":case"week":case"w":return t*Kp;case"days":case"day":case"d":return t*er;case"hours":case"hour":case"hrs":case"hr":case"h":return t*Sr;case"minutes":case"minute":case"mins":case"min":case"m":return t*Or;case"seconds":case"second":case"secs":case"sec":case"s":return t*Er;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function Xp(r){var e=Math.abs(r);return e>=er?Math.round(r/er)+"d":e>=Sr?Math.round(r/Sr)+"h":e>=Or?Math.round(r/Or)+"m":e>=Er?Math.round(r/Er)+"s":r+"ms"}function Qp(r){var e=Math.abs(r);return e>=er?xt(r,e,er,"day"):e>=Sr?xt(r,e,Sr,"hour"):e>=Or?xt(r,e,Or,"minute"):e>=Er?xt(r,e,Er,"second"):r+" ms"}function xt(r,e,t,i){var n=e>=t*1.5;return Math.round(r/t)+" "+i+(n?"s":"")}});var cs=c((Gr,ls)=>{"use strict";var eh=ne(),rh=us();ls.exports=eh(r=>{let e=+new Date;return Gr.diff=e-(Gr.prevTime||e),Gr.prevTime=e,r.ms=`+${rh(Gr.diff)}`,r})});var ps=c((P1,ds)=>{"use strict";var th=require("util").inspect,ih=ne(),{LEVEL:nh,MESSAGE:fs,SPLAT:oh}=G();ds.exports=ih((r,e={})=>{let t=Object.assign({},r);return delete t[nh],delete t[fs],delete t[oh],r[fs]=th(t,!1,e.depth||null,e.colorize),r})});var hs=c((A1,Dt)=>{"use strict";var{MESSAGE:ah}=G(),It=class{constructor(e){this.template=e}transform(e){return e[ah]=this.template(e),e}};Dt.exports=r=>new It(r);Dt.exports.Printf=Dt.exports.Format=It});var ys=c((T1,gs)=>{"use strict";var sh=ne(),{MESSAGE:ms}=G(),uh=Hr();gs.exports=sh(r=>{let e=uh(Object.assign({},r,{level:void 0,message:void 0,splat:void 0})),t=r.padding&&r.padding[r.level]||"";return e!=="{}"?r[ms]=`${r.level}:${t} ${r.message} ${e}`:r[ms]=`${r.level}:${t} ${r.message}`,r})});var _s=c((N1,vs)=>{"use strict";var lh=require("util"),{SPLAT:bs}=G(),ch=/%[scdjifoO%]/g,fh=/%%/g,bn=class{constructor(e){this.options=e}_splat(e,t){let i=e.message,n=e[bs]||e.splat||[],o=i.match(fh),a=o&&o.length||0,u=t.length-a-n.length,l=u<0?n.splice(u,-1*u):[],d=l.length;if(d)for(let p=0;p<d;p++)Object.assign(e,l[p]);return e.message=lh.format(i,...n),e}transform(e){let t=e.message,i=e[bs]||e.splat;if(!i||!i.length)return e;let n=t&&t.match&&t.match(ch);if(!n&&(i||i.length)){let o=i.length>1?i.splice(0):i,a=o.length;if(a)for(let s=0;s<a;s++)Object.assign(e,o[s]);return e}return n?this._splat(e,n):e}};vs.exports=r=>new bn(r)});var Es=c((Lt,ws)=>{(function(r,e){typeof Lt=="object"&&typeof ws<"u"?e(Lt):typeof define=="function"&&define.amd?define(["exports"],e):e(r.fecha={})})(Lt,(function(r){"use strict";var e=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,t="\\d\\d?",i="\\d\\d",n="\\d{3}",o="\\d{4}",a="[^\\s]+",s=/\[([^]*?)\]/gm;function u(h,w){for(var $=[],Q=0,A=h.length;Q<A;Q++)$.push(h[Q].substr(0,w));return $}var l=function(h){return function(w,$){var Q=$[h].map(function(de){return de.toLowerCase()}),A=Q.indexOf(w.toLowerCase());return A>-1?A:null}};function d(h){for(var w=[],$=1;$<arguments.length;$++)w[$-1]=arguments[$];for(var Q=0,A=w;Q<A.length;Q++){var de=A[Q];for(var Pe in de)h[Pe]=de[Pe]}return h}var p=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],m=["January","February","March","April","May","June","July","August","September","October","November","December"],_=u(m,3),f=u(p,3),g={dayNamesShort:f,dayNames:p,monthNamesShort:_,monthNames:m,amPm:["am","pm"],DoFn:function(h){return h+["th","st","nd","rd"][h%10>3?0:(h-h%10!==10?1:0)*h%10]}},E=d({},g),P=function(h){return E=d(E,h)},N=function(h){return h.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},v=function(h,w){for(w===void 0&&(w=2),h=String(h);h.length<w;)h="0"+h;return h},T={D:function(h){return String(h.getDate())},DD:function(h){return v(h.getDate())},Do:function(h,w){return w.DoFn(h.getDate())},d:function(h){return String(h.getDay())},dd:function(h){return v(h.getDay())},ddd:function(h,w){return w.dayNamesShort[h.getDay()]},dddd:function(h,w){return w.dayNames[h.getDay()]},M:function(h){return String(h.getMonth()+1)},MM:function(h){return v(h.getMonth()+1)},MMM:function(h,w){return w.monthNamesShort[h.getMonth()]},MMMM:function(h,w){return w.monthNames[h.getMonth()]},YY:function(h){return v(String(h.getFullYear()),4).substr(2)},YYYY:function(h){return v(h.getFullYear(),4)},h:function(h){return String(h.getHours()%12||12)},hh:function(h){return v(h.getHours()%12||12)},H:function(h){return String(h.getHours())},HH:function(h){return v(h.getHours())},m:function(h){return String(h.getMinutes())},mm:function(h){return v(h.getMinutes())},s:function(h){return String(h.getSeconds())},ss:function(h){return v(h.getSeconds())},S:function(h){return String(Math.round(h.getMilliseconds()/100))},SS:function(h){return v(Math.round(h.getMilliseconds()/10),2)},SSS:function(h){return v(h.getMilliseconds(),3)},a:function(h,w){return h.getHours()<12?w.amPm[0]:w.amPm[1]},A:function(h,w){return h.getHours()<12?w.amPm[0].toUpperCase():w.amPm[1].toUpperCase()},ZZ:function(h){var w=h.getTimezoneOffset();return(w>0?"-":"+")+v(Math.floor(Math.abs(w)/60)*100+Math.abs(w)%60,4)},Z:function(h){var w=h.getTimezoneOffset();return(w>0?"-":"+")+v(Math.floor(Math.abs(w)/60),2)+":"+v(Math.abs(w)%60,2)}},q=function(h){return+h-1},U=[null,t],D=[null,a],L=["isPm",a,function(h,w){var $=h.toLowerCase();return $===w.amPm[0]?0:$===w.amPm[1]?1:null}],x=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(h){var w=(h+"").match(/([+-]|\d\d)/gi);if(w){var $=+w[1]*60+parseInt(w[2],10);return w[0]==="+"?$:-$}return 0}],j={D:["day",t],DD:["day",i],Do:["day",t+a,function(h){return parseInt(h,10)}],M:["month",t,q],MM:["month",i,q],YY:["year",i,function(h){var w=new Date,$=+(""+w.getFullYear()).substr(0,2);return+(""+(+h>68?$-1:$)+h)}],h:["hour",t,void 0,"isPm"],hh:["hour",i,void 0,"isPm"],H:["hour",t],HH:["hour",i],m:["minute",t],mm:["minute",i],s:["second",t],ss:["second",i],YYYY:["year",o],S:["millisecond","\\d",function(h){return+h*100}],SS:["millisecond",i,function(h){return+h*10}],SSS:["millisecond",n],d:U,dd:U,ddd:D,dddd:D,MMM:["month",a,l("monthNamesShort")],MMMM:["month",a,l("monthNames")],a:L,A:L,ZZ:x,Z:x},K={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"},W=function(h){return d(K,h)},ee=function(h,w,$){if(w===void 0&&(w=K.default),$===void 0&&($={}),typeof h=="number"&&(h=new Date(h)),Object.prototype.toString.call(h)!=="[object Date]"||isNaN(h.getTime()))throw new Error("Invalid Date pass to format");w=K[w]||w;var Q=[];w=w.replace(s,function(de,Pe){return Q.push(Pe),"@@@"});var A=d(d({},E),$);return w=w.replace(e,function(de){return T[de](h,A)}),w.replace(/@@@/g,function(){return Q.shift()})};function re(h,w,$){if($===void 0&&($={}),typeof w!="string")throw new Error("Invalid format in fecha parse");if(w=K[w]||w,h.length>1e3)return null;var Q=new Date,A={year:Q.getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},de=[],Pe=[],We=w.replace(s,function(Fr,_r){return Pe.push(N(_r)),"@@@"}),yr={},yt={};We=N(We).replace(e,function(Fr){var _r=j[Fr],Bi=_r[0],Fd=_r[1],Xo=_r[3];if(yr[Bi])throw new Error("Invalid format. "+Bi+" specified twice in format");return yr[Bi]=!0,Xo&&(yt[Xo]=!0),de.push(_r),"("+Fd+")"}),Object.keys(yt).forEach(function(Fr){if(!yr[Fr])throw new Error("Invalid format. "+Fr+" is required in specified format")}),We=We.replace(/@@@/g,function(){return Pe.shift()});var br=h.match(new RegExp(We,"i"));if(!br)return null;for(var Yi=d(d({},E),$),ue=1;ue<br.length;ue++){var bt=de[ue-1],Wi=bt[0],vt=bt[2],_t=vt?vt(br[ue],Yi):+br[ue];if(_t==null)return null;A[Wi]=_t}A.isPm===1&&A.hour!=null&&+A.hour!=12?A.hour=+A.hour+12:A.isPm===0&&+A.hour==12&&(A.hour=0);var Ae;if(A.timezoneOffset==null){Ae=new Date(A.year,A.month,A.day,A.hour,A.minute,A.second,A.millisecond);for(var vr=[["month","getMonth"],["day","getDate"],["hour","getHours"],["minute","getMinutes"],["second","getSeconds"]],ue=0,Ud=vr.length;ue<Ud;ue++)if(yr[vr[ue][0]]&&A[vr[ue][0]]!==Ae[vr[ue][1]]())return null}else if(Ae=new Date(Date.UTC(A.year,A.month,A.day,A.hour,A.minute-A.timezoneOffset,A.second,A.millisecond)),A.month>11||A.month<0||A.day>31||A.day<1||A.hour>23||A.hour<0||A.minute>59||A.minute<0||A.second>59||A.second<0)return null;return Ae}var Le={format:ee,parse:re,defaultI18n:g,setGlobalDateI18n:P,setGlobalDateMasks:W};r.assign=d,r.default=Le,r.format=ee,r.parse=re,r.defaultI18n=g,r.setGlobalDateI18n=P,r.setGlobalDateMasks=W,Object.defineProperty(r,"__esModule",{value:!0})}))});var Ss=c((M1,Os)=>{"use strict";var dh=Es(),ph=ne();Os.exports=ph((r,e={})=>(e.format&&(r.timestamp=typeof e.format=="function"?e.format():dh.format(new Date,e.format)),r.timestamp||(r.timestamp=new Date().toISOString()),e.alias&&(r[e.alias]=r.timestamp),r))});var As=c((R1,Ps)=>{"use strict";var vn=en(),hh=ne(),{MESSAGE:_n}=G();Ps.exports=hh((r,e)=>(e.level!==!1&&(r.level=vn.strip(r.level)),e.message!==!1&&(r.message=vn.strip(String(r.message))),e.raw!==!1&&r[_n]&&(r[_n]=vn.strip(String(r[_n]))),r))});var En=c(wn=>{"use strict";var mh=wn.format=ne();wn.levels=ka();function J(r,e){Object.defineProperty(mh,r,{get(){return e()},configurable:!0})}J("align",function(){return Ha()});J("errors",function(){return Wa()});J("cli",function(){return Va()});J("combine",function(){return Ja()});J("colorize",function(){return Tt()});J("json",function(){return yn()});J("label",function(){return ts()});J("logstash",function(){return ns()});J("metadata",function(){return as()});J("ms",function(){return cs()});J("padLevels",function(){return cn()});J("prettyPrint",function(){return ps()});J("printf",function(){return hs()});J("simple",function(){return ys()});J("splat",function(){return _s()});J("timestamp",function(){return Ss()});J("uncolorize",function(){return As()})});var On=c(Ct=>{"use strict";var{format:Ts}=require("util");Ct.warn={deprecated(r){return()=>{throw new Error(Ts("{ %s } was removed in winston@3.0.0.",r))}},useFormat(r){return()=>{throw new Error([Ts("{ %s } was removed in winston@3.0.0.",r),"Use a custom winston.format = winston.format(function) instead."].join(`
27
+ `))}},forFunctions(r,e,t){t.forEach(i=>{r[i]=Ct.warn[e](i)})},forProperties(r,e,t){t.forEach(i=>{let n=Ct.warn[e](i);Object.defineProperty(r,i,{get:n,set:n})})}}});var Ns=c((D1,gh)=>{gh.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 Rs=c((L1,Ms)=>{Ms.exports=require("util").deprecate});var Sn=c((C1,xs)=>{xs.exports=require("stream")});var An=c((q1,Ds)=>{"use strict";function yh(r,e){var t=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(e?e(r):r&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(Pn,this,r)):process.nextTick(Pn,this,r)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(r||null,function(o){!e&&o?t._writableState?t._writableState.errorEmitted?process.nextTick(qt,t):(t._writableState.errorEmitted=!0,process.nextTick(Is,t,o)):process.nextTick(Is,t,o):e?(process.nextTick(qt,t),e(o)):process.nextTick(qt,t)}),this)}function Is(r,e){Pn(r,e),qt(r)}function qt(r){r._writableState&&!r._writableState.emitClose||r._readableState&&!r._readableState.emitClose||r.emit("close")}function bh(){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 Pn(r,e){r.emit("error",e)}function vh(r,e){var t=r._readableState,i=r._writableState;t&&t.autoDestroy||i&&i.autoDestroy?r.destroy(e):r.emit("error",e)}Ds.exports={destroy:yh,undestroy:bh,errorOrDestroy:vh}});var $e=c(($1,qs)=>{"use strict";var Cs={};function pe(r,e,t){t||(t=Error);function i(o,a,s){return typeof e=="string"?e:e(o,a,s)}class n extends t{constructor(a,s,u){super(i(a,s,u))}}n.prototype.name=t.name,n.prototype.code=r,Cs[r]=n}function Ls(r,e){if(Array.isArray(r)){let t=r.length;return r=r.map(i=>String(i)),t>2?`one of ${e} ${r.slice(0,t-1).join(", ")}, or `+r[t-1]:t===2?`one of ${e} ${r[0]} or ${r[1]}`:`of ${e} ${r[0]}`}else return`of ${e} ${String(r)}`}function _h(r,e,t){return r.substr(!t||t<0?0:+t,e.length)===e}function wh(r,e,t){return(t===void 0||t>r.length)&&(t=r.length),r.substring(t-e.length,t)===e}function Eh(r,e,t){return typeof t!="number"&&(t=0),t+e.length>r.length?!1:r.indexOf(e,t)!==-1}pe("ERR_INVALID_OPT_VALUE",function(r,e){return'The value "'+e+'" is invalid for option "'+r+'"'},TypeError);pe("ERR_INVALID_ARG_TYPE",function(r,e,t){let i;typeof e=="string"&&_h(e,"not ")?(i="must not be",e=e.replace(/^not /,"")):i="must be";let n;if(wh(r," argument"))n=`The ${r} ${i} ${Ls(e,"type")}`;else{let o=Eh(r,".")?"property":"argument";n=`The "${r}" ${o} ${i} ${Ls(e,"type")}`}return n+=`. Received type ${typeof t}`,n},TypeError);pe("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");pe("ERR_METHOD_NOT_IMPLEMENTED",function(r){return"The "+r+" method is not implemented"});pe("ERR_STREAM_PREMATURE_CLOSE","Premature close");pe("ERR_STREAM_DESTROYED",function(r){return"Cannot call "+r+" after a stream was destroyed"});pe("ERR_MULTIPLE_CALLBACK","Callback called multiple times");pe("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");pe("ERR_STREAM_WRITE_AFTER_END","write after end");pe("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);pe("ERR_UNKNOWN_ENCODING",function(r){return"Unknown encoding: "+r},TypeError);pe("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");qs.exports.codes=Cs});var Tn=c((U1,$s)=>{"use strict";var Oh=$e().codes.ERR_INVALID_OPT_VALUE;function Sh(r,e,t){return r.highWaterMark!=null?r.highWaterMark:e?r[t]:null}function Ph(r,e,t,i){var n=Sh(e,i,t);if(n!=null){if(!(isFinite(n)&&Math.floor(n)===n)||n<0){var o=i?t:"highWaterMark";throw new Oh(o,n)}return Math.floor(n)}return r.objectMode?16:16*1024}$s.exports={getHighWaterMark:Ph}});var Us=c((F1,Nn)=>{typeof Object.create=="function"?Nn.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Nn.exports=function(e,t){if(t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}}});var Pr=c((j1,Rn)=>{try{if(Mn=require("util"),typeof Mn.inherits!="function")throw"";Rn.exports=Mn.inherits}catch{Rn.exports=Us()}var Mn});var Gs=c((k1,Hs)=>{"use strict";function Fs(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),t.push.apply(t,i)}return t}function js(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Fs(Object(t),!0).forEach(function(i){Ah(r,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Fs(Object(t)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}return r}function Ah(r,e,t){return e=zs(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Th(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function ks(r,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(r,zs(i.key),i)}}function Nh(r,e,t){return e&&ks(r.prototype,e),t&&ks(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}function zs(r){var e=Mh(r,"string");return typeof e=="symbol"?e:String(e)}function Mh(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Rh=require("buffer"),$t=Rh.Buffer,xh=require("util"),xn=xh.inspect,Ih=xn&&xn.custom||"inspect";function Dh(r,e,t){$t.prototype.copy.call(r,e,t)}Hs.exports=(function(){function r(){Th(this,r),this.head=null,this.tail=null,this.length=0}return Nh(r,[{key:"push",value:function(t){var i={data:t,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}},{key:"unshift",value:function(t){var i={data:t,next:this.head};this.length===0&&(this.tail=i),this.head=i,++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 i=this.head,n=""+i.data;i=i.next;)n+=t+i.data;return n}},{key:"concat",value:function(t){if(this.length===0)return $t.alloc(0);for(var i=$t.allocUnsafe(t>>>0),n=this.head,o=0;n;)Dh(n.data,i,o),o+=n.data.length,n=n.next;return i}},{key:"consume",value:function(t,i){var n;return t<this.head.data.length?(n=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):t===this.head.data.length?n=this.shift():n=i?this._getString(t):this._getBuffer(t),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var i=this.head,n=1,o=i.data;for(t-=o.length;i=i.next;){var a=i.data,s=t>a.length?a.length:t;if(s===a.length?o+=a:o+=a.slice(0,t),t-=s,t===0){s===a.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=a.slice(s));break}++n}return this.length-=n,o}},{key:"_getBuffer",value:function(t){var i=$t.allocUnsafe(t),n=this.head,o=1;for(n.data.copy(i),t-=n.data.length;n=n.next;){var a=n.data,s=t>a.length?a.length:t;if(a.copy(i,i.length-t,0,s),t-=s,t===0){s===a.length?(++o,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=a.slice(s));break}++o}return this.length-=o,i}},{key:Ih,value:function(t,i){return xn(this,js(js({},i),{},{depth:0,customInspect:!1}))}}]),r})()});var Bs=c((In,Ws)=>{var Ut=require("buffer"),be=Ut.Buffer;function Ys(r,e){for(var t in r)e[t]=r[t]}be.from&&be.alloc&&be.allocUnsafe&&be.allocUnsafeSlow?Ws.exports=Ut:(Ys(Ut,In),In.Buffer=rr);function rr(r,e,t){return be(r,e,t)}rr.prototype=Object.create(be.prototype);Ys(be,rr);rr.from=function(r,e,t){if(typeof r=="number")throw new TypeError("Argument must not be a number");return be(r,e,t)};rr.alloc=function(r,e,t){if(typeof r!="number")throw new TypeError("Argument must be a number");var i=be(r);return e!==void 0?typeof t=="string"?i.fill(e,t):i.fill(e):i.fill(0),i};rr.allocUnsafe=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return be(r)};rr.allocUnsafeSlow=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return Ut.SlowBuffer(r)}});var Cn=c(Ks=>{"use strict";var Ln=Bs().Buffer,Vs=Ln.isEncoding||function(r){switch(r=""+r,r&&r.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 Lh(r){if(!r)return"utf8";for(var e;;)switch(r){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 r;default:if(e)return;r=(""+r).toLowerCase(),e=!0}}function Ch(r){var e=Lh(r);if(typeof e!="string"&&(Ln.isEncoding===Vs||!Vs(r)))throw new Error("Unknown encoding: "+r);return e||r}Ks.StringDecoder=Yr;function Yr(r){this.encoding=Ch(r);var e;switch(this.encoding){case"utf16le":this.text=kh,this.end=zh,e=4;break;case"utf8":this.fillLast=Uh,e=4;break;case"base64":this.text=Hh,this.end=Gh,e=3;break;default:this.write=Yh,this.end=Wh;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Ln.allocUnsafe(e)}Yr.prototype.write=function(r){if(r.length===0)return"";var e,t;if(this.lastNeed){if(e=this.fillLast(r),e===void 0)return"";t=this.lastNeed,this.lastNeed=0}else t=0;return t<r.length?e?e+this.text(r,t):this.text(r,t):e||""};Yr.prototype.end=jh;Yr.prototype.text=Fh;Yr.prototype.fillLast=function(r){if(this.lastNeed<=r.length)return r.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);r.copy(this.lastChar,this.lastTotal-this.lastNeed,0,r.length),this.lastNeed-=r.length};function Dn(r){return r<=127?0:r>>5===6?2:r>>4===14?3:r>>3===30?4:r>>6===2?-1:-2}function qh(r,e,t){var i=e.length-1;if(i<t)return 0;var n=Dn(e[i]);return n>=0?(n>0&&(r.lastNeed=n-1),n):--i<t||n===-2?0:(n=Dn(e[i]),n>=0?(n>0&&(r.lastNeed=n-2),n):--i<t||n===-2?0:(n=Dn(e[i]),n>=0?(n>0&&(n===2?n=0:r.lastNeed=n-3),n):0))}function $h(r,e,t){if((e[0]&192)!==128)return r.lastNeed=0,"\uFFFD";if(r.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return r.lastNeed=1,"\uFFFD";if(r.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return r.lastNeed=2,"\uFFFD"}}function Uh(r){var e=this.lastTotal-this.lastNeed,t=$h(this,r,e);if(t!==void 0)return t;if(this.lastNeed<=r.length)return r.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);r.copy(this.lastChar,e,0,r.length),this.lastNeed-=r.length}function Fh(r,e){var t=qh(this,r,e);if(!this.lastNeed)return r.toString("utf8",e);this.lastTotal=t;var i=r.length-(t-this.lastNeed);return r.copy(this.lastChar,0,i),r.toString("utf8",e,i)}function jh(r){var e=r&&r.length?this.write(r):"";return this.lastNeed?e+"\uFFFD":e}function kh(r,e){if((r.length-e)%2===0){var t=r.toString("utf16le",e);if(t){var i=t.charCodeAt(t.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=r[r.length-2],this.lastChar[1]=r[r.length-1],t.slice(0,-1)}return t}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=r[r.length-1],r.toString("utf16le",e,r.length-1)}function zh(r){var e=r&&r.length?this.write(r):"";if(this.lastNeed){var t=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,t)}return e}function Hh(r,e){var t=(r.length-e)%3;return t===0?r.toString("base64",e):(this.lastNeed=3-t,this.lastTotal=3,t===1?this.lastChar[0]=r[r.length-1]:(this.lastChar[0]=r[r.length-2],this.lastChar[1]=r[r.length-1]),r.toString("base64",e,r.length-t))}function Gh(r){var e=r&&r.length?this.write(r):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function Yh(r){return r.toString(this.encoding)}function Wh(r){return r&&r.length?this.write(r):""}});var Ft=c((H1,Xs)=>{"use strict";var Js=$e().codes.ERR_STREAM_PREMATURE_CLOSE;function Bh(r){var e=!1;return function(){if(!e){e=!0;for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];r.apply(this,i)}}}function Vh(){}function Kh(r){return r.setHeader&&typeof r.abort=="function"}function Zs(r,e,t){if(typeof e=="function")return Zs(r,null,e);e||(e={}),t=Bh(t||Vh);var i=e.readable||e.readable!==!1&&r.readable,n=e.writable||e.writable!==!1&&r.writable,o=function(){r.writable||s()},a=r._writableState&&r._writableState.finished,s=function(){n=!1,a=!0,i||t.call(r)},u=r._readableState&&r._readableState.endEmitted,l=function(){i=!1,u=!0,n||t.call(r)},d=function(f){t.call(r,f)},p=function(){var f;if(i&&!u)return(!r._readableState||!r._readableState.ended)&&(f=new Js),t.call(r,f);if(n&&!a)return(!r._writableState||!r._writableState.ended)&&(f=new Js),t.call(r,f)},m=function(){r.req.on("finish",s)};return Kh(r)?(r.on("complete",s),r.on("abort",p),r.req?m():r.on("request",m)):n&&!r._writableState&&(r.on("end",o),r.on("close",o)),r.on("end",l),r.on("finish",s),e.error!==!1&&r.on("error",d),r.on("close",p),function(){r.removeListener("complete",s),r.removeListener("abort",p),r.removeListener("request",m),r.req&&r.req.removeListener("finish",s),r.removeListener("end",o),r.removeListener("close",o),r.removeListener("finish",s),r.removeListener("end",l),r.removeListener("error",d),r.removeListener("close",p)}}Xs.exports=Zs});var eu=c((G1,Qs)=>{"use strict";var jt;function Ue(r,e,t){return e=Jh(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Jh(r){var e=Zh(r,"string");return typeof e=="symbol"?e:String(e)}function Zh(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Xh=Ft(),Fe=Symbol("lastResolve"),tr=Symbol("lastReject"),Wr=Symbol("error"),kt=Symbol("ended"),ir=Symbol("lastPromise"),qn=Symbol("handlePromise"),nr=Symbol("stream");function je(r,e){return{value:r,done:e}}function Qh(r){var e=r[Fe];if(e!==null){var t=r[nr].read();t!==null&&(r[ir]=null,r[Fe]=null,r[tr]=null,e(je(t,!1)))}}function em(r){process.nextTick(Qh,r)}function rm(r,e){return function(t,i){r.then(function(){if(e[kt]){t(je(void 0,!0));return}e[qn](t,i)},i)}}var tm=Object.getPrototypeOf(function(){}),im=Object.setPrototypeOf((jt={get stream(){return this[nr]},next:function(){var e=this,t=this[Wr];if(t!==null)return Promise.reject(t);if(this[kt])return Promise.resolve(je(void 0,!0));if(this[nr].destroyed)return new Promise(function(a,s){process.nextTick(function(){e[Wr]?s(e[Wr]):a(je(void 0,!0))})});var i=this[ir],n;if(i)n=new Promise(rm(i,this));else{var o=this[nr].read();if(o!==null)return Promise.resolve(je(o,!1));n=new Promise(this[qn])}return this[ir]=n,n}},Ue(jt,Symbol.asyncIterator,function(){return this}),Ue(jt,"return",function(){var e=this;return new Promise(function(t,i){e[nr].destroy(null,function(n){if(n){i(n);return}t(je(void 0,!0))})})}),jt),tm),nm=function(e){var t,i=Object.create(im,(t={},Ue(t,nr,{value:e,writable:!0}),Ue(t,Fe,{value:null,writable:!0}),Ue(t,tr,{value:null,writable:!0}),Ue(t,Wr,{value:null,writable:!0}),Ue(t,kt,{value:e._readableState.endEmitted,writable:!0}),Ue(t,qn,{value:function(o,a){var s=i[nr].read();s?(i[ir]=null,i[Fe]=null,i[tr]=null,o(je(s,!1))):(i[Fe]=o,i[tr]=a)},writable:!0}),t));return i[ir]=null,Xh(e,function(n){if(n&&n.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=i[tr];o!==null&&(i[ir]=null,i[Fe]=null,i[tr]=null,o(n)),i[Wr]=n;return}var a=i[Fe];a!==null&&(i[ir]=null,i[Fe]=null,i[tr]=null,a(je(void 0,!0))),i[kt]=!0}),e.on("readable",em.bind(null,i)),i};Qs.exports=nm});var nu=c((Y1,iu)=>{"use strict";function ru(r,e,t,i,n,o,a){try{var s=r[o](a),u=s.value}catch(l){t(l);return}s.done?e(u):Promise.resolve(u).then(i,n)}function om(r){return function(){var e=this,t=arguments;return new Promise(function(i,n){var o=r.apply(e,t);function a(u){ru(o,i,n,a,s,"next",u)}function s(u){ru(o,i,n,a,s,"throw",u)}a(void 0)})}}function tu(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),t.push.apply(t,i)}return t}function am(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?tu(Object(t),!0).forEach(function(i){sm(r,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):tu(Object(t)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}return r}function sm(r,e,t){return e=um(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function um(r){var e=lm(r,"string");return typeof e=="symbol"?e:String(e)}function lm(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var cm=$e().codes.ERR_INVALID_ARG_TYPE;function fm(r,e,t){var i;if(e&&typeof e.next=="function")i=e;else if(e&&e[Symbol.asyncIterator])i=e[Symbol.asyncIterator]();else if(e&&e[Symbol.iterator])i=e[Symbol.iterator]();else throw new cm("iterable",["Iterable"],e);var n=new r(am({objectMode:!0},t)),o=!1;n._read=function(){o||(o=!0,a())};function a(){return s.apply(this,arguments)}function s(){return s=om(function*(){try{var u=yield i.next(),l=u.value,d=u.done;d?n.push(null):n.push(yield l)?a():o=!1}catch(p){n.destroy(p)}}),s.apply(this,arguments)}return n}iu.exports=fm});var Wn=c((B1,hu)=>{"use strict";hu.exports=I;var Ar;I.ReadableState=uu;var W1=require("events").EventEmitter,su=function(e,t){return e.listeners(t).length},Vr=Sn(),zt=require("buffer").Buffer,dm=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function pm(r){return zt.from(r)}function hm(r){return zt.isBuffer(r)||r instanceof dm}var $n=require("util"),M;$n&&$n.debuglog?M=$n.debuglog("stream"):M=function(){};var mm=Gs(),Gn=An(),gm=Tn(),ym=gm.getHighWaterMark,Ht=$e().codes,bm=Ht.ERR_INVALID_ARG_TYPE,vm=Ht.ERR_STREAM_PUSH_AFTER_EOF,_m=Ht.ERR_METHOD_NOT_IMPLEMENTED,wm=Ht.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Tr,Un,Fn;Pr()(I,Vr);var Br=Gn.errorOrDestroy,jn=["error","close","destroy","pause","resume"];function Em(r,e,t){if(typeof r.prependListener=="function")return r.prependListener(e,t);!r._events||!r._events[e]?r.on(e,t):Array.isArray(r._events[e])?r._events[e].unshift(t):r._events[e]=[t,r._events[e]]}function uu(r,e,t){Ar=Ar||or(),r=r||{},typeof t!="boolean"&&(t=e instanceof Ar),this.objectMode=!!r.objectMode,t&&(this.objectMode=this.objectMode||!!r.readableObjectMode),this.highWaterMark=ym(this,r,"readableHighWaterMark",t),this.buffer=new mm,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=r.emitClose!==!1,this.autoDestroy=!!r.autoDestroy,this.destroyed=!1,this.defaultEncoding=r.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,r.encoding&&(Tr||(Tr=Cn().StringDecoder),this.decoder=new Tr(r.encoding),this.encoding=r.encoding)}function I(r){if(Ar=Ar||or(),!(this instanceof I))return new I(r);var e=this instanceof Ar;this._readableState=new uu(r,this,e),this.readable=!0,r&&(typeof r.read=="function"&&(this._read=r.read),typeof r.destroy=="function"&&(this._destroy=r.destroy)),Vr.call(this)}Object.defineProperty(I.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});I.prototype.destroy=Gn.destroy;I.prototype._undestroy=Gn.undestroy;I.prototype._destroy=function(r,e){e(r)};I.prototype.push=function(r,e){var t=this._readableState,i;return t.objectMode?i=!0:typeof r=="string"&&(e=e||t.defaultEncoding,e!==t.encoding&&(r=zt.from(r,e),e=""),i=!0),lu(this,r,e,!1,i)};I.prototype.unshift=function(r){return lu(this,r,null,!0,!1)};function lu(r,e,t,i,n){M("readableAddChunk",e);var o=r._readableState;if(e===null)o.reading=!1,Pm(r,o);else{var a;if(n||(a=Om(o,e)),a)Br(r,a);else if(o.objectMode||e&&e.length>0)if(typeof e!="string"&&!o.objectMode&&Object.getPrototypeOf(e)!==zt.prototype&&(e=pm(e)),i)o.endEmitted?Br(r,new wm):kn(r,o,e,!0);else if(o.ended)Br(r,new vm);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!t?(e=o.decoder.write(e),o.objectMode||e.length!==0?kn(r,o,e,!1):Hn(r,o)):kn(r,o,e,!1)}else i||(o.reading=!1,Hn(r,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}function kn(r,e,t,i){e.flowing&&e.length===0&&!e.sync?(e.awaitDrain=0,r.emit("data",t)):(e.length+=e.objectMode?1:t.length,i?e.buffer.unshift(t):e.buffer.push(t),e.needReadable&&Gt(r)),Hn(r,e)}function Om(r,e){var t;return!hm(e)&&typeof e!="string"&&e!==void 0&&!r.objectMode&&(t=new bm("chunk",["string","Buffer","Uint8Array"],e)),t}I.prototype.isPaused=function(){return this._readableState.flowing===!1};I.prototype.setEncoding=function(r){Tr||(Tr=Cn().StringDecoder);var e=new Tr(r);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var t=this._readableState.buffer.head,i="";t!==null;)i+=e.write(t.data),t=t.next;return this._readableState.buffer.clear(),i!==""&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var ou=1073741824;function Sm(r){return r>=ou?r=ou:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),r}function au(r,e){return r<=0||e.length===0&&e.ended?0:e.objectMode?1:r!==r?e.flowing&&e.length?e.buffer.head.data.length:e.length:(r>e.highWaterMark&&(e.highWaterMark=Sm(r)),r<=e.length?r:e.ended?e.length:(e.needReadable=!0,0))}I.prototype.read=function(r){M("read",r),r=parseInt(r,10);var e=this._readableState,t=r;if(r!==0&&(e.emittedReadable=!1),r===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return M("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?zn(this):Gt(this),null;if(r=au(r,e),r===0&&e.ended)return e.length===0&&zn(this),null;var i=e.needReadable;M("need readable",i),(e.length===0||e.length-r<e.highWaterMark)&&(i=!0,M("length less than watermark",i)),e.ended||e.reading?(i=!1,M("reading or ended",i)):i&&(M("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(r=au(t,e)));var n;return r>0?n=du(r,e):n=null,n===null?(e.needReadable=e.length<=e.highWaterMark,r=0):(e.length-=r,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),t!==r&&e.ended&&zn(this)),n!==null&&this.emit("data",n),n};function Pm(r,e){if(M("onEofChunk"),!e.ended){if(e.decoder){var t=e.decoder.end();t&&t.length&&(e.buffer.push(t),e.length+=e.objectMode?1:t.length)}e.ended=!0,e.sync?Gt(r):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,cu(r)))}}function Gt(r){var e=r._readableState;M("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(M("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(cu,r))}function cu(r){var e=r._readableState;M("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(r.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,Yn(r)}function Hn(r,e){e.readingMore||(e.readingMore=!0,process.nextTick(Am,r,e))}function Am(r,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var t=e.length;if(M("maybeReadMore read 0"),r.read(0),t===e.length)break}e.readingMore=!1}I.prototype._read=function(r){Br(this,new _m("_read()"))};I.prototype.pipe=function(r,e){var t=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=r;break;case 1:i.pipes=[i.pipes,r];break;default:i.pipes.push(r);break}i.pipesCount+=1,M("pipe count=%d opts=%j",i.pipesCount,e);var n=(!e||e.end!==!1)&&r!==process.stdout&&r!==process.stderr,o=n?s:g;i.endEmitted?process.nextTick(o):t.once("end",o),r.on("unpipe",a);function a(E,P){M("onunpipe"),E===t&&P&&P.hasUnpiped===!1&&(P.hasUnpiped=!0,d())}function s(){M("onend"),r.end()}var u=Tm(t);r.on("drain",u);var l=!1;function d(){M("cleanup"),r.removeListener("close",_),r.removeListener("finish",f),r.removeListener("drain",u),r.removeListener("error",m),r.removeListener("unpipe",a),t.removeListener("end",s),t.removeListener("end",g),t.removeListener("data",p),l=!0,i.awaitDrain&&(!r._writableState||r._writableState.needDrain)&&u()}t.on("data",p);function p(E){M("ondata");var P=r.write(E);M("dest.write",P),P===!1&&((i.pipesCount===1&&i.pipes===r||i.pipesCount>1&&pu(i.pipes,r)!==-1)&&!l&&(M("false write response, pause",i.awaitDrain),i.awaitDrain++),t.pause())}function m(E){M("onerror",E),g(),r.removeListener("error",m),su(r,"error")===0&&Br(r,E)}Em(r,"error",m);function _(){r.removeListener("finish",f),g()}r.once("close",_);function f(){M("onfinish"),r.removeListener("close",_),g()}r.once("finish",f);function g(){M("unpipe"),t.unpipe(r)}return r.emit("pipe",t),i.flowing||(M("pipe resume"),t.resume()),r};function Tm(r){return function(){var t=r._readableState;M("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&su(r,"data")&&(t.flowing=!0,Yn(r))}}I.prototype.unpipe=function(r){var e=this._readableState,t={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return r&&r!==e.pipes?this:(r||(r=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,r&&r.emit("unpipe",this,t),this);if(!r){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<n;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=pu(e.pipes,r);return a===-1?this:(e.pipes.splice(a,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),r.emit("unpipe",this,t),this)};I.prototype.on=function(r,e){var t=Vr.prototype.on.call(this,r,e),i=this._readableState;return r==="data"?(i.readableListening=this.listenerCount("readable")>0,i.flowing!==!1&&this.resume()):r==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,M("on readable",i.length,i.reading),i.length?Gt(this):i.reading||process.nextTick(Nm,this)),t};I.prototype.addListener=I.prototype.on;I.prototype.removeListener=function(r,e){var t=Vr.prototype.removeListener.call(this,r,e);return r==="readable"&&process.nextTick(fu,this),t};I.prototype.removeAllListeners=function(r){var e=Vr.prototype.removeAllListeners.apply(this,arguments);return(r==="readable"||r===void 0)&&process.nextTick(fu,this),e};function fu(r){var e=r._readableState;e.readableListening=r.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:r.listenerCount("data")>0&&r.resume()}function Nm(r){M("readable nexttick read 0"),r.read(0)}I.prototype.resume=function(){var r=this._readableState;return r.flowing||(M("resume"),r.flowing=!r.readableListening,Mm(this,r)),r.paused=!1,this};function Mm(r,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(Rm,r,e))}function Rm(r,e){M("resume",e.reading),e.reading||r.read(0),e.resumeScheduled=!1,r.emit("resume"),Yn(r),e.flowing&&!e.reading&&r.read(0)}I.prototype.pause=function(){return M("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(M("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Yn(r){var e=r._readableState;for(M("flow",e.flowing);e.flowing&&r.read()!==null;);}I.prototype.wrap=function(r){var e=this,t=this._readableState,i=!1;r.on("end",function(){if(M("wrapped end"),t.decoder&&!t.ended){var a=t.decoder.end();a&&a.length&&e.push(a)}e.push(null)}),r.on("data",function(a){if(M("wrapped data"),t.decoder&&(a=t.decoder.write(a)),!(t.objectMode&&a==null)&&!(!t.objectMode&&(!a||!a.length))){var s=e.push(a);s||(i=!0,r.pause())}});for(var n in r)this[n]===void 0&&typeof r[n]=="function"&&(this[n]=(function(s){return function(){return r[s].apply(r,arguments)}})(n));for(var o=0;o<jn.length;o++)r.on(jn[o],this.emit.bind(this,jn[o]));return this._read=function(a){M("wrapped _read",a),i&&(i=!1,r.resume())},this};typeof Symbol=="function"&&(I.prototype[Symbol.asyncIterator]=function(){return Un===void 0&&(Un=eu()),Un(this)});Object.defineProperty(I.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(I.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(I.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}});I._fromList=du;Object.defineProperty(I.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function du(r,e){if(e.length===0)return null;var t;return e.objectMode?t=e.buffer.shift():!r||r>=e.length?(e.decoder?t=e.buffer.join(""):e.buffer.length===1?t=e.buffer.first():t=e.buffer.concat(e.length),e.buffer.clear()):t=e.buffer.consume(r,e.decoder),t}function zn(r){var e=r._readableState;M("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(xm,e,r))}function xm(r,e){if(M("endReadableNT",r.endEmitted,r.length),!r.endEmitted&&r.length===0&&(r.endEmitted=!0,e.readable=!1,e.emit("end"),r.autoDestroy)){var t=e._writableState;(!t||t.autoDestroy&&t.finished)&&e.destroy()}}typeof Symbol=="function"&&(I.from=function(r,e){return Fn===void 0&&(Fn=nu()),Fn(I,r,e)});function pu(r,e){for(var t=0,i=r.length;t<i;t++)if(r[t]===e)return t;return-1}});var or=c((V1,gu)=>{"use strict";var Im=Object.keys||function(r){var e=[];for(var t in r)e.push(t);return e};gu.exports=ve;var mu=Wn(),Vn=Bt();Pr()(ve,mu);for(Bn=Im(Vn.prototype),Yt=0;Yt<Bn.length;Yt++)Wt=Bn[Yt],ve.prototype[Wt]||(ve.prototype[Wt]=Vn.prototype[Wt]);var Bn,Wt,Yt;function ve(r){if(!(this instanceof ve))return new ve(r);mu.call(this,r),Vn.call(this,r),this.allowHalfOpen=!0,r&&(r.readable===!1&&(this.readable=!1),r.writable===!1&&(this.writable=!1),r.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",Dm)))}Object.defineProperty(ve.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(ve.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(ve.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function Dm(){this._writableState.ended||process.nextTick(Lm,this)}function Lm(r){r.end()}Object.defineProperty(ve.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})});var Bt=c((K1,Eu)=>{"use strict";Eu.exports=z;function bu(r){var e=this;this.next=null,this.entry=null,this.finish=function(){sg(e,r)}}var Nr;z.WritableState=Jr;var Cm={deprecate:Rs()},vu=Sn(),Kt=require("buffer").Buffer,qm=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function $m(r){return Kt.from(r)}function Um(r){return Kt.isBuffer(r)||r instanceof qm}var Jn=An(),Fm=Tn(),jm=Fm.getHighWaterMark,ke=$e().codes,km=ke.ERR_INVALID_ARG_TYPE,zm=ke.ERR_METHOD_NOT_IMPLEMENTED,Hm=ke.ERR_MULTIPLE_CALLBACK,Gm=ke.ERR_STREAM_CANNOT_PIPE,Ym=ke.ERR_STREAM_DESTROYED,Wm=ke.ERR_STREAM_NULL_VALUES,Bm=ke.ERR_STREAM_WRITE_AFTER_END,Vm=ke.ERR_UNKNOWN_ENCODING,Mr=Jn.errorOrDestroy;Pr()(z,vu);function Km(){}function Jr(r,e,t){Nr=Nr||or(),r=r||{},typeof t!="boolean"&&(t=e instanceof Nr),this.objectMode=!!r.objectMode,t&&(this.objectMode=this.objectMode||!!r.writableObjectMode),this.highWaterMark=jm(this,r,"writableHighWaterMark",t),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=r.decodeStrings===!1;this.decodeStrings=!i,this.defaultEncoding=r.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(n){tg(e,n)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=r.emitClose!==!1,this.autoDestroy=!!r.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new bu(this)}Jr.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t};(function(){try{Object.defineProperty(Jr.prototype,"buffer",{get:Cm.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var Vt;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Vt=Function.prototype[Symbol.hasInstance],Object.defineProperty(z,Symbol.hasInstance,{value:function(e){return Vt.call(this,e)?!0:this!==z?!1:e&&e._writableState instanceof Jr}})):Vt=function(e){return e instanceof this};function z(r){Nr=Nr||or();var e=this instanceof Nr;if(!e&&!Vt.call(z,this))return new z(r);this._writableState=new Jr(r,this,e),this.writable=!0,r&&(typeof r.write=="function"&&(this._write=r.write),typeof r.writev=="function"&&(this._writev=r.writev),typeof r.destroy=="function"&&(this._destroy=r.destroy),typeof r.final=="function"&&(this._final=r.final)),vu.call(this)}z.prototype.pipe=function(){Mr(this,new Gm)};function Jm(r,e){var t=new Bm;Mr(r,t),process.nextTick(e,t)}function Zm(r,e,t,i){var n;return t===null?n=new Wm:typeof t!="string"&&!e.objectMode&&(n=new km("chunk",["string","Buffer"],t)),n?(Mr(r,n),process.nextTick(i,n),!1):!0}z.prototype.write=function(r,e,t){var i=this._writableState,n=!1,o=!i.objectMode&&Um(r);return o&&!Kt.isBuffer(r)&&(r=$m(r)),typeof e=="function"&&(t=e,e=null),o?e="buffer":e||(e=i.defaultEncoding),typeof t!="function"&&(t=Km),i.ending?Jm(this,t):(o||Zm(this,i,r,t))&&(i.pendingcb++,n=Qm(this,i,o,r,e,t)),n};z.prototype.cork=function(){this._writableState.corked++};z.prototype.uncork=function(){var r=this._writableState;r.corked&&(r.corked--,!r.writing&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&_u(this,r))};z.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new Vm(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(z.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Xm(r,e,t){return!r.objectMode&&r.decodeStrings!==!1&&typeof e=="string"&&(e=Kt.from(e,t)),e}Object.defineProperty(z.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Qm(r,e,t,i,n,o){if(!t){var a=Xm(e,i,n);i!==a&&(t=!0,n="buffer",i=a)}var s=e.objectMode?1:i.length;e.length+=s;var u=e.length<e.highWaterMark;if(u||(e.needDrain=!0),e.writing||e.corked){var l=e.lastBufferedRequest;e.lastBufferedRequest={chunk:i,encoding:n,isBuf:t,callback:o,next:null},l?l.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else Kn(r,e,!1,s,i,n,o);return u}function Kn(r,e,t,i,n,o,a){e.writelen=i,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new Ym("write")):t?r._writev(n,e.onwrite):r._write(n,o,e.onwrite),e.sync=!1}function eg(r,e,t,i,n){--e.pendingcb,t?(process.nextTick(n,i),process.nextTick(Kr,r,e),r._writableState.errorEmitted=!0,Mr(r,i)):(n(i),r._writableState.errorEmitted=!0,Mr(r,i),Kr(r,e))}function rg(r){r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0}function tg(r,e){var t=r._writableState,i=t.sync,n=t.writecb;if(typeof n!="function")throw new Hm;if(rg(t),e)eg(r,t,i,e,n);else{var o=wu(t)||r.destroyed;!o&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&_u(r,t),i?process.nextTick(yu,r,t,o,n):yu(r,t,o,n)}}function yu(r,e,t,i){t||ig(r,e),e.pendingcb--,i(),Kr(r,e)}function ig(r,e){e.length===0&&e.needDrain&&(e.needDrain=!1,r.emit("drain"))}function _u(r,e){e.bufferProcessing=!0;var t=e.bufferedRequest;if(r._writev&&t&&t.next){var i=e.bufferedRequestCount,n=new Array(i),o=e.corkedRequestsFree;o.entry=t;for(var a=0,s=!0;t;)n[a]=t,t.isBuf||(s=!1),t=t.next,a+=1;n.allBuffers=s,Kn(r,e,!0,e.length,n,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new bu(e),e.bufferedRequestCount=0}else{for(;t;){var u=t.chunk,l=t.encoding,d=t.callback,p=e.objectMode?1:u.length;if(Kn(r,e,!1,p,u,l,d),t=t.next,e.bufferedRequestCount--,e.writing)break}t===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=t,e.bufferProcessing=!1}z.prototype._write=function(r,e,t){t(new zm("_write()"))};z.prototype._writev=null;z.prototype.end=function(r,e,t){var i=this._writableState;return typeof r=="function"?(t=r,r=null,e=null):typeof e=="function"&&(t=e,e=null),r!=null&&this.write(r,e),i.corked&&(i.corked=1,this.uncork()),i.ending||ag(this,i,t),this};Object.defineProperty(z.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function wu(r){return r.ending&&r.length===0&&r.bufferedRequest===null&&!r.finished&&!r.writing}function ng(r,e){r._final(function(t){e.pendingcb--,t&&Mr(r,t),e.prefinished=!0,r.emit("prefinish"),Kr(r,e)})}function og(r,e){!e.prefinished&&!e.finalCalled&&(typeof r._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,process.nextTick(ng,r,e)):(e.prefinished=!0,r.emit("prefinish")))}function Kr(r,e){var t=wu(e);if(t&&(og(r,e),e.pendingcb===0&&(e.finished=!0,r.emit("finish"),e.autoDestroy))){var i=r._readableState;(!i||i.autoDestroy&&i.endEmitted)&&r.destroy()}return t}function ag(r,e,t){e.ending=!0,Kr(r,e),t&&(e.finished?process.nextTick(t):r.once("finish",t)),e.ended=!0,r.writable=!1}function sg(r,e,t){var i=r.entry;for(r.entry=null;i;){var n=i.callback;e.pendingcb--,n(t),i=i.next}e.corkedRequestsFree.next=r}Object.defineProperty(z.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});z.prototype.destroy=Jn.destroy;z.prototype._undestroy=Jn.undestroy;z.prototype._destroy=function(r,e){e(r)}});var Zn=c((J1,Pu)=>{"use strict";var ug=require("util"),Ou=Bt(),{LEVEL:Su}=G(),Zr=Pu.exports=function(e={}){Ou.call(this,{objectMode:!0,highWaterMark:e.highWaterMark}),this.format=e.format,this.level=e.level,this.handleExceptions=e.handleExceptions,this.handleRejections=e.handleRejections,this.silent=e.silent,e.log&&(this.log=e.log),e.logv&&(this.logv=e.logv),e.close&&(this.close=e.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())})};ug.inherits(Zr,Ou);Zr.prototype._write=function(e,t,i){if(this.silent||e.exception===!0&&!this.handleExceptions)return i(null);let n=this.level||this.parent&&this.parent.level;if(!n||this.levels[n]>=this.levels[e[Su]]){if(e&&!this.format)return this.log(e,i);let o,a;try{a=this.format.transform(Object.assign({},e),this.format.options)}catch(s){o=s}if(o||!a){if(i(),o)throw o;return}return this.log(a,i)}return this._writableState.sync=!1,i(null)};Zr.prototype._writev=function(e,t){if(this.logv){let i=e.filter(this._accept,this);return i.length?this.logv(i,t):t(null)}for(let i=0;i<e.length;i++){if(!this._accept(e[i]))continue;if(e[i].chunk&&!this.format){this.log(e[i].chunk,e[i].callback);continue}let n,o;try{o=this.format.transform(Object.assign({},e[i].chunk),this.format.options)}catch(a){n=a}if(n||!o){if(e[i].callback(),n)throw t(null),n}else this.log(o,e[i].callback)}return t(null)};Zr.prototype._accept=function(e){let t=e.chunk;if(this.silent)return!1;let i=this.level||this.parent&&this.parent.level;return!!((t.exception===!0||!i||this.levels[i]>=this.levels[t[Su]])&&(this.handleExceptions||t.exception!==!0))};Zr.prototype._nop=function(){}});var Qn=c((Z1,Tu)=>{"use strict";var lg=require("util"),{LEVEL:Xn}=G(),Au=Zn(),Xr=Tu.exports=function(e={}){if(Au.call(this,e),!e.transport||typeof e.transport.log!="function")throw new Error("Invalid transport, must be an object with a log method.");this.transport=e.transport,this.level=this.level||e.transport.level,this.handleExceptions=this.handleExceptions||e.transport.handleExceptions,this._deprecated();function t(i){this.emit("error",i,this.transport)}this.transport.__winstonError||(this.transport.__winstonError=t.bind(this),this.transport.on("error",this.transport.__winstonError))};lg.inherits(Xr,Au);Xr.prototype._write=function(e,t,i){if(this.silent||e.exception===!0&&!this.handleExceptions)return i(null);(!this.level||this.levels[this.level]>=this.levels[e[Xn]])&&this.transport.log(e[Xn],e.message,e,this._nop),i(null)};Xr.prototype._writev=function(e,t){for(let i=0;i<e.length;i++)this._accept(e[i])&&(this.transport.log(e[i].chunk[Xn],e[i].chunk.message,e[i].chunk,this._nop),e[i].callback());return t(null)};Xr.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(`
28
+ `))};Xr.prototype.close=function(){this.transport.close&&this.transport.close(),this.transport.__winstonError&&(this.transport.removeListener("error",this.transport.__winstonError),this.transport.__winstonError=null)}});var Rr=c((X1,eo)=>{"use strict";eo.exports=Zn();eo.exports.LegacyTransportStream=Qn()});var Ru=c((e_,Mu)=>{"use strict";var cg=require("os"),{LEVEL:Nu,MESSAGE:xr}=G(),fg=Rr();Mu.exports=class extends fg{constructor(e={}){super(e),this.name=e.name||"console",this.stderrLevels=this._stringArrayToSet(e.stderrLevels),this.consoleWarnLevels=this._stringArrayToSet(e.consoleWarnLevels),this.eol=typeof e.eol=="string"?e.eol:cg.EOL,this.forceConsole=e.forceConsole||!1,this._consoleLog=console.log.bind(console),this._consoleWarn=console.warn.bind(console),this._consoleError=console.error.bind(console),this.setMaxListeners(30)}log(e,t){if(setImmediate(()=>this.emit("logged",e)),this.stderrLevels[e[Nu]]){console._stderr&&!this.forceConsole?console._stderr.write(`${e[xr]}${this.eol}`):this._consoleError(e[xr]),t&&t();return}else if(this.consoleWarnLevels[e[Nu]]){console._stderr&&!this.forceConsole?console._stderr.write(`${e[xr]}${this.eol}`):this._consoleWarn(e[xr]),t&&t();return}console._stdout&&!this.forceConsole?console._stdout.write(`${e[xr]}${this.eol}`):this._consoleLog(e[xr]),t&&t()}_stringArrayToSet(e,t){if(!e)return{};if(t=t||"Cannot make set from type other than Array of string elements",!Array.isArray(e))throw new Error(t);return e.reduce((i,n)=>{if(typeof n!="string")throw new Error(t);return i[n]=!0,i},{})}}});var Zt=c((Jt,xu)=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.default=dg;function dg(r){return r&&typeof r.length=="number"&&r.length>=0&&r.length%1===0}xu.exports=Jt.default});var Du=c((Xt,Iu)=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.default=function(r){return function(...e){var t=e.pop();return r.call(this,e,t)}};Iu.exports=Xt.default});var qu=c(ze=>{"use strict";Object.defineProperty(ze,"__esModule",{value:!0});ze.fallback=Lu;ze.wrap=Cu;var pg=ze.hasQueueMicrotask=typeof queueMicrotask=="function"&&queueMicrotask,hg=ze.hasSetImmediate=typeof setImmediate=="function"&&setImmediate,mg=ze.hasNextTick=typeof process=="object"&&typeof process.nextTick=="function";function Lu(r){setTimeout(r,0)}function Cu(r){return(e,...t)=>r(()=>e(...t))}var Qr;pg?Qr=queueMicrotask:hg?Qr=setImmediate:mg?Qr=process.nextTick:Qr=Lu;ze.default=Cu(Qr)});var ku=c((Qt,ju)=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.default=wg;var gg=Du(),yg=Fu(gg),bg=qu(),vg=Fu(bg),_g=ar();function Fu(r){return r&&r.__esModule?r:{default:r}}function wg(r){return(0,_g.isAsync)(r)?function(...e){let t=e.pop(),i=r.apply(this,e);return $u(i,t)}:(0,yg.default)(function(e,t){var i;try{i=r.apply(this,e)}catch(n){return t(n)}if(i&&typeof i.then=="function")return $u(i,t);t(null,i)})}function $u(r,e){return r.then(t=>{Uu(e,null,t)},t=>{Uu(e,t&&(t instanceof Error||t.message)?t:new Error(t))})}function Uu(r,e,t){try{r(e,t)}catch(i){(0,vg.default)(n=>{throw n},i)}}ju.exports=Qt.default});var ar=c(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.isAsyncIterable=Ne.isAsyncGenerator=Ne.isAsync=void 0;var Eg=ku(),Og=Sg(Eg);function Sg(r){return r&&r.__esModule?r:{default:r}}function zu(r){return r[Symbol.toStringTag]==="AsyncFunction"}function Pg(r){return r[Symbol.toStringTag]==="AsyncGenerator"}function Ag(r){return typeof r[Symbol.asyncIterator]=="function"}function Tg(r){if(typeof r!="function")throw new Error("expected a function");return zu(r)?(0,Og.default)(r):r}Ne.default=Tg;Ne.isAsync=zu;Ne.isAsyncGenerator=Pg;Ne.isAsyncIterable=Ag});var Ir=c((ei,Hu)=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.default=Ng;function Ng(r,e){if(e||(e=r.length),!e)throw new Error("arity is undefined");function t(...i){return typeof i[e-1]=="function"?r.apply(this,i):new Promise((n,o)=>{i[e-1]=(a,...s)=>{if(a)return o(a);n(s.length>1?s:s[0])},r.apply(this,i)})}return t}Hu.exports=ei.default});var Yu=c((ri,Gu)=>{"use strict";Object.defineProperty(ri,"__esModule",{value:!0});var Mg=Zt(),Rg=ro(Mg),xg=ar(),Ig=ro(xg),Dg=Ir(),Lg=ro(Dg);function ro(r){return r&&r.__esModule?r:{default:r}}ri.default=(0,Lg.default)((r,e,t)=>{var i=(0,Rg.default)(e)?[]:{};r(e,(n,o,a)=>{(0,Ig.default)(n)((s,...u)=>{u.length<2&&([u]=u),i[o]=u,a(s)})},n=>t(n,i))},3);Gu.exports=ri.default});var to=c((ti,Wu)=>{"use strict";Object.defineProperty(ti,"__esModule",{value:!0});ti.default=Cg;function Cg(r){function e(...t){if(r!==null){var i=r;r=null,i.apply(this,t)}}return Object.assign(e,r),e}Wu.exports=ti.default});var Vu=c((ii,Bu)=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.default=function(r){return r[Symbol.iterator]&&r[Symbol.iterator]()};Bu.exports=ii.default});var Zu=c((ni,Ju)=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.default=Hg;var qg=Zt(),$g=Ku(qg),Ug=Vu(),Fg=Ku(Ug);function Ku(r){return r&&r.__esModule?r:{default:r}}function jg(r){var e=-1,t=r.length;return function(){return++e<t?{value:r[e],key:e}:null}}function kg(r){var e=-1;return function(){var i=r.next();return i.done?null:(e++,{value:i.value,key:e})}}function zg(r){var e=r?Object.keys(r):[],t=-1,i=e.length;return function n(){var o=e[++t];return o==="__proto__"?n():t<i?{value:r[o],key:o}:null}}function Hg(r){if((0,$g.default)(r))return jg(r);var e=(0,Fg.default)(r);return e?kg(e):zg(r)}Ju.exports=ni.default});var io=c((oi,Xu)=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.default=Gg;function Gg(r){return function(...e){if(r===null)throw new Error("Callback was already called.");var t=r;r=null,t.apply(this,e)}}Xu.exports=oi.default});var si=c((ai,Qu)=>{"use strict";Object.defineProperty(ai,"__esModule",{value:!0});var Yg={};ai.default=Yg;Qu.exports=ai.default});var rl=c((ui,el)=>{"use strict";Object.defineProperty(ui,"__esModule",{value:!0});ui.default=Kg;var Wg=si(),Bg=Vg(Wg);function Vg(r){return r&&r.__esModule?r:{default:r}}function Kg(r,e,t,i){let n=!1,o=!1,a=!1,s=0,u=0;function l(){s>=e||a||n||(a=!0,r.next().then(({value:m,done:_})=>{if(!(o||n)){if(a=!1,_){n=!0,s<=0&&i(null);return}s++,t(m,u,d),u++,l()}}).catch(p))}function d(m,_){if(s-=1,!o){if(m)return p(m);if(m===!1){n=!0,o=!0;return}if(_===Bg.default||n&&s<=0)return n=!0,i(null);l()}}function p(m){o||(a=!1,n=!0,i(m))}l()}el.exports=ui.default});var ol=c((li,nl)=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});var Jg=to(),Zg=et(Jg),Xg=Zu(),Qg=et(Xg),ey=io(),ry=et(ey),tl=ar(),ty=rl(),il=et(ty),iy=si(),ny=et(iy);function et(r){return r&&r.__esModule?r:{default:r}}li.default=r=>(e,t,i)=>{if(i=(0,Zg.default)(i),r<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!e)return i(null);if((0,tl.isAsyncGenerator)(e))return(0,il.default)(e,r,t,i);if((0,tl.isAsyncIterable)(e))return(0,il.default)(e[Symbol.asyncIterator](),r,t,i);var n=(0,Qg.default)(e),o=!1,a=!1,s=0,u=!1;function l(p,m){if(!a)if(s-=1,p)o=!0,i(p);else if(p===!1)o=!0,a=!0;else{if(m===ny.default||o&&s<=0)return o=!0,i(null);u||d()}}function d(){for(u=!0;s<r&&!o;){var p=n();if(p===null){o=!0,s<=0&&i(null);return}s+=1,t(p.value,p.key,(0,ry.default)(l))}u=!1}d()};nl.exports=li.default});var oo=c((ci,al)=>{"use strict";Object.defineProperty(ci,"__esModule",{value:!0});var oy=ol(),ay=no(oy),sy=ar(),uy=no(sy),ly=Ir(),cy=no(ly);function no(r){return r&&r.__esModule?r:{default:r}}function fy(r,e,t,i){return(0,ay.default)(e)(r,(0,uy.default)(t),i)}ci.default=(0,cy.default)(fy,4);al.exports=ci.default});var ll=c((fi,ul)=>{"use strict";Object.defineProperty(fi,"__esModule",{value:!0});var dy=oo(),py=sl(dy),hy=Ir(),my=sl(hy);function sl(r){return r&&r.__esModule?r:{default:r}}function gy(r,e,t){return(0,py.default)(r,1,e,t)}fi.default=(0,my.default)(gy,3);ul.exports=fi.default});var dl=c((di,fl)=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});di.default=wy;var yy=Yu(),by=cl(yy),vy=ll(),_y=cl(vy);function cl(r){return r&&r.__esModule?r:{default:r}}function wy(r,e){return(0,by.default)(_y.default,r,e)}fl.exports=di.default});var ao=c((i_,hl)=>{"use strict";hl.exports=Me;var pi=$e().codes,Ey=pi.ERR_METHOD_NOT_IMPLEMENTED,Oy=pi.ERR_MULTIPLE_CALLBACK,Sy=pi.ERR_TRANSFORM_ALREADY_TRANSFORMING,Py=pi.ERR_TRANSFORM_WITH_LENGTH_0,hi=or();Pr()(Me,hi);function Ay(r,e){var t=this._transformState;t.transforming=!1;var i=t.writecb;if(i===null)return this.emit("error",new Oy);t.writechunk=null,t.writecb=null,e!=null&&this.push(e),i(r);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function Me(r){if(!(this instanceof Me))return new Me(r);hi.call(this,r),this._transformState={afterTransform:Ay.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,r&&(typeof r.transform=="function"&&(this._transform=r.transform),typeof r.flush=="function"&&(this._flush=r.flush)),this.on("prefinish",Ty)}function Ty(){var r=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,t){pl(r,e,t)}):pl(this,null,null)}Me.prototype.push=function(r,e){return this._transformState.needTransform=!1,hi.prototype.push.call(this,r,e)};Me.prototype._transform=function(r,e,t){t(new Ey("_transform()"))};Me.prototype._write=function(r,e,t){var i=this._transformState;if(i.writecb=t,i.writechunk=r,i.writeencoding=e,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}};Me.prototype._read=function(r){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};Me.prototype._destroy=function(r,e){hi.prototype._destroy.call(this,r,function(t){e(t)})};function pl(r,e,t){if(e)return r.emit("error",e);if(t!=null&&r.push(t),r._writableState.length)throw new Py;if(r._transformState.transforming)throw new Sy;return r.push(null)}});var yl=c((n_,gl)=>{"use strict";gl.exports=rt;var ml=ao();Pr()(rt,ml);function rt(r){if(!(this instanceof rt))return new rt(r);ml.call(this,r)}rt.prototype._transform=function(r,e,t){t(null,r)}});var El=c((o_,wl)=>{"use strict";var so;function Ny(r){var e=!1;return function(){e||(e=!0,r.apply(void 0,arguments))}}var _l=$e().codes,My=_l.ERR_MISSING_ARGS,Ry=_l.ERR_STREAM_DESTROYED;function bl(r){if(r)throw r}function xy(r){return r.setHeader&&typeof r.abort=="function"}function Iy(r,e,t,i){i=Ny(i);var n=!1;r.on("close",function(){n=!0}),so===void 0&&(so=Ft()),so(r,{readable:e,writable:t},function(a){if(a)return i(a);n=!0,i()});var o=!1;return function(a){if(!n&&!o){if(o=!0,xy(r))return r.abort();if(typeof r.destroy=="function")return r.destroy();i(a||new Ry("pipe"))}}}function vl(r){r()}function Dy(r,e){return r.pipe(e)}function Ly(r){return!r.length||typeof r[r.length-1]!="function"?bl:r.pop()}function Cy(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];var i=Ly(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new My("streams");var n,o=e.map(function(a,s){var u=s<e.length-1,l=s>0;return Iy(a,u,l,function(d){n||(n=d),d&&o.forEach(vl),!u&&(o.forEach(vl),i(n))})});return e.reduce(Dy)}wl.exports=Cy});var sr=c((he,it)=>{var tt=require("stream");process.env.READABLE_STREAM==="disable"&&tt?(it.exports=tt.Readable,Object.assign(it.exports,tt),it.exports.Stream=tt):(he=it.exports=Wn(),he.Stream=tt||he,he.Readable=he,he.Writable=Bt(),he.Duplex=or(),he.Transform=ao(),he.PassThrough=yl(),he.finished=Ft(),he.pipeline=El())});var mo=c((a_,Sl)=>{var Dr=[],nt=[],uo=function(){};function co(r){return~Dr.indexOf(r)?!1:(Dr.push(r),!0)}function fo(r){uo=r}function qy(r){for(var e=[],t=0;t<Dr.length;t++){if(Dr[t].async){e.push(Dr[t]);continue}if(Dr[t](r))return!0}return e.length?new Promise(function(n){Promise.all(e.map(function(a){return a(r)})).then(function(a){n(a.some(Boolean))})}):!1}function po(r){return~nt.indexOf(r)?!1:(nt.push(r),!0)}function lo(){uo.apply(uo,arguments)}function Ol(r){for(var e=0;e<nt.length;e++)r=nt[e].apply(nt[e],arguments);return r}function ho(r,e){var t=Object.prototype.hasOwnProperty;for(var i in e)t.call(e,i)&&(r[i]=e[i]);return r}function $y(r){return r.enabled=!1,r.modify=po,r.set=fo,r.use=co,ho(function(){return!1},r)}function Uy(r){function e(){var t=Array.prototype.slice.call(arguments,0);return lo.call(lo,r,Ol(t,r)),!0}return r.enabled=!0,r.modify=po,r.set=fo,r.use=co,ho(e,r)}Sl.exports=function(e){return e.introduce=ho,e.enabled=qy,e.process=Ol,e.modify=po,e.write=lo,e.nope=$y,e.yep=Uy,e.set=fo,e.use=co,e}});var Al=c((s_,Pl)=>{var Fy=mo(),jy=Fy(function r(e,t){return t=t||{},t.namespace=e,t.prod=!0,t.dev=!1,t.force||r.force?r.yep(t):r.nope(t)});Pl.exports=jy});var Nl=c((u_,Tl)=>{"use strict";Tl.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 Rl=c((l_,Ml)=>{Ml.exports=function(e){return!e||typeof e=="string"?!1:e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&e.constructor.name!=="String")}});var Dl=c((c_,Il)=>{"use strict";var ky=Rl(),zy=Array.prototype.concat,Hy=Array.prototype.slice,xl=Il.exports=function(e){for(var t=[],i=0,n=e.length;i<n;i++){var o=e[i];ky(o)?t=zy.call(t,Hy.call(o)):t.push(o)}return t};xl.wrap=function(r){return function(){return r(xl(arguments))}}});var $l=c((f_,ql)=>{var ot=Nl(),at=Dl(),Ll=Object.hasOwnProperty,Cl=Object.create(null);for(mi in ot)Ll.call(ot,mi)&&(Cl[ot[mi]]=mi);var mi,le=ql.exports={to:{},get:{}};le.get=function(r){var e=r.substring(0,3).toLowerCase(),t,i;switch(e){case"hsl":t=le.get.hsl(r),i="hsl";break;case"hwb":t=le.get.hwb(r),i="hwb";break;default:t=le.get.rgb(r),i="rgb";break}return t?{model:i,value:t}:null};le.get.rgb=function(r){if(!r)return null;var e=/^#([a-f0-9]{3,4})$/i,t=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,i=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,n=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,o=/^(\w+)$/,a=[0,0,0,1],s,u,l;if(s=r.match(t)){for(l=s[2],s=s[1],u=0;u<3;u++){var d=u*2;a[u]=parseInt(s.slice(d,d+2),16)}l&&(a[3]=parseInt(l,16)/255)}else if(s=r.match(e)){for(s=s[1],l=s[3],u=0;u<3;u++)a[u]=parseInt(s[u]+s[u],16);l&&(a[3]=parseInt(l+l,16)/255)}else if(s=r.match(i)){for(u=0;u<3;u++)a[u]=parseInt(s[u+1],0);s[4]&&(s[5]?a[3]=parseFloat(s[4])*.01:a[3]=parseFloat(s[4]))}else if(s=r.match(n)){for(u=0;u<3;u++)a[u]=Math.round(parseFloat(s[u+1])*2.55);s[4]&&(s[5]?a[3]=parseFloat(s[4])*.01:a[3]=parseFloat(s[4]))}else return(s=r.match(o))?s[1]==="transparent"?[0,0,0,0]:Ll.call(ot,s[1])?(a=ot[s[1]],a[3]=1,a):null:null;for(u=0;u<3;u++)a[u]=He(a[u],0,255);return a[3]=He(a[3],0,1),a};le.get.hsl=function(r){if(!r)return null;var e=/^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=r.match(e);if(t){var i=parseFloat(t[4]),n=(parseFloat(t[1])%360+360)%360,o=He(parseFloat(t[2]),0,100),a=He(parseFloat(t[3]),0,100),s=He(isNaN(i)?1:i,0,1);return[n,o,a,s]}return null};le.get.hwb=function(r){if(!r)return null;var e=/^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=r.match(e);if(t){var i=parseFloat(t[4]),n=(parseFloat(t[1])%360+360)%360,o=He(parseFloat(t[2]),0,100),a=He(parseFloat(t[3]),0,100),s=He(isNaN(i)?1:i,0,1);return[n,o,a,s]}return null};le.to.hex=function(){var r=at(arguments);return"#"+gi(r[0])+gi(r[1])+gi(r[2])+(r[3]<1?gi(Math.round(r[3]*255)):"")};le.to.rgb=function(){var r=at(arguments);return r.length<4||r[3]===1?"rgb("+Math.round(r[0])+", "+Math.round(r[1])+", "+Math.round(r[2])+")":"rgba("+Math.round(r[0])+", "+Math.round(r[1])+", "+Math.round(r[2])+", "+r[3]+")"};le.to.rgb.percent=function(){var r=at(arguments),e=Math.round(r[0]/255*100),t=Math.round(r[1]/255*100),i=Math.round(r[2]/255*100);return r.length<4||r[3]===1?"rgb("+e+"%, "+t+"%, "+i+"%)":"rgba("+e+"%, "+t+"%, "+i+"%, "+r[3]+")"};le.to.hsl=function(){var r=at(arguments);return r.length<4||r[3]===1?"hsl("+r[0]+", "+r[1]+"%, "+r[2]+"%)":"hsla("+r[0]+", "+r[1]+"%, "+r[2]+"%, "+r[3]+")"};le.to.hwb=function(){var r=at(arguments),e="";return r.length>=4&&r[3]!==1&&(e=", "+r[3]),"hwb("+r[0]+", "+r[1]+"%, "+r[2]+"%"+e+")"};le.to.keyword=function(r){return Cl[r.slice(0,3)]};function He(r,e,t){return Math.min(Math.max(e,r),t)}function gi(r){var e=Math.round(r).toString(16).toUpperCase();return e.length<2?"0"+e:e}});var Fl=c((d_,Ul)=>{"use strict";Ul.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 go=c((p_,Hl)=>{var ur=Fl(),zl={};for(yi in ur)ur.hasOwnProperty(yi)&&(zl[ur[yi]]=yi);var yi,O=Hl.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(ie in O)if(O.hasOwnProperty(ie)){if(!("channels"in O[ie]))throw new Error("missing channels property: "+ie);if(!("labels"in O[ie]))throw new Error("missing channel labels property: "+ie);if(O[ie].labels.length!==O[ie].channels)throw new Error("channel and label counts mismatch: "+ie);jl=O[ie].channels,kl=O[ie].labels,delete O[ie].channels,delete O[ie].labels,Object.defineProperty(O[ie],"channels",{value:jl}),Object.defineProperty(O[ie],"labels",{value:kl})}var jl,kl,ie;O.rgb.hsl=function(r){var e=r[0]/255,t=r[1]/255,i=r[2]/255,n=Math.min(e,t,i),o=Math.max(e,t,i),a=o-n,s,u,l;return o===n?s=0:e===o?s=(t-i)/a:t===o?s=2+(i-e)/a:i===o&&(s=4+(e-t)/a),s=Math.min(s*60,360),s<0&&(s+=360),l=(n+o)/2,o===n?u=0:l<=.5?u=a/(o+n):u=a/(2-o-n),[s,u*100,l*100]};O.rgb.hsv=function(r){var e,t,i,n,o,a=r[0]/255,s=r[1]/255,u=r[2]/255,l=Math.max(a,s,u),d=l-Math.min(a,s,u),p=function(m){return(l-m)/6/d+1/2};return d===0?n=o=0:(o=d/l,e=p(a),t=p(s),i=p(u),a===l?n=i-t:s===l?n=1/3+e-i:u===l&&(n=2/3+t-e),n<0?n+=1:n>1&&(n-=1)),[n*360,o*100,l*100]};O.rgb.hwb=function(r){var e=r[0],t=r[1],i=r[2],n=O.rgb.hsl(r)[0],o=1/255*Math.min(e,Math.min(t,i));return i=1-1/255*Math.max(e,Math.max(t,i)),[n,o*100,i*100]};O.rgb.cmyk=function(r){var e=r[0]/255,t=r[1]/255,i=r[2]/255,n,o,a,s;return s=Math.min(1-e,1-t,1-i),n=(1-e-s)/(1-s)||0,o=(1-t-s)/(1-s)||0,a=(1-i-s)/(1-s)||0,[n*100,o*100,a*100,s*100]};function Gy(r,e){return Math.pow(r[0]-e[0],2)+Math.pow(r[1]-e[1],2)+Math.pow(r[2]-e[2],2)}O.rgb.keyword=function(r){var e=zl[r];if(e)return e;var t=1/0,i;for(var n in ur)if(ur.hasOwnProperty(n)){var o=ur[n],a=Gy(r,o);a<t&&(t=a,i=n)}return i};O.keyword.rgb=function(r){return ur[r]};O.rgb.xyz=function(r){var e=r[0]/255,t=r[1]/255,i=r[2]/255;e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92;var n=e*.4124+t*.3576+i*.1805,o=e*.2126+t*.7152+i*.0722,a=e*.0193+t*.1192+i*.9505;return[n*100,o*100,a*100]};O.rgb.lab=function(r){var e=O.rgb.xyz(r),t=e[0],i=e[1],n=e[2],o,a,s;return t/=95.047,i/=100,n/=108.883,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,o=116*i-16,a=500*(t-i),s=200*(i-n),[o,a,s]};O.hsl.rgb=function(r){var e=r[0]/360,t=r[1]/100,i=r[2]/100,n,o,a,s,u;if(t===0)return u=i*255,[u,u,u];i<.5?o=i*(1+t):o=i+t-i*t,n=2*i-o,s=[0,0,0];for(var l=0;l<3;l++)a=e+1/3*-(l-1),a<0&&a++,a>1&&a--,6*a<1?u=n+(o-n)*6*a:2*a<1?u=o:3*a<2?u=n+(o-n)*(2/3-a)*6:u=n,s[l]=u*255;return s};O.hsl.hsv=function(r){var e=r[0],t=r[1]/100,i=r[2]/100,n=t,o=Math.max(i,.01),a,s;return i*=2,t*=i<=1?i:2-i,n*=o<=1?o:2-o,s=(i+t)/2,a=i===0?2*n/(o+n):2*t/(i+t),[e,a*100,s*100]};O.hsv.rgb=function(r){var e=r[0]/60,t=r[1]/100,i=r[2]/100,n=Math.floor(e)%6,o=e-Math.floor(e),a=255*i*(1-t),s=255*i*(1-t*o),u=255*i*(1-t*(1-o));switch(i*=255,n){case 0:return[i,u,a];case 1:return[s,i,a];case 2:return[a,i,u];case 3:return[a,s,i];case 4:return[u,a,i];case 5:return[i,a,s]}};O.hsv.hsl=function(r){var e=r[0],t=r[1]/100,i=r[2]/100,n=Math.max(i,.01),o,a,s;return s=(2-t)*i,o=(2-t)*n,a=t*n,a/=o<=1?o:2-o,a=a||0,s/=2,[e,a*100,s*100]};O.hwb.rgb=function(r){var e=r[0]/360,t=r[1]/100,i=r[2]/100,n=t+i,o,a,s,u;n>1&&(t/=n,i/=n),o=Math.floor(6*e),a=1-i,s=6*e-o,(o&1)!==0&&(s=1-s),u=t+s*(a-t);var l,d,p;switch(o){default:case 6:case 0:l=a,d=u,p=t;break;case 1:l=u,d=a,p=t;break;case 2:l=t,d=a,p=u;break;case 3:l=t,d=u,p=a;break;case 4:l=u,d=t,p=a;break;case 5:l=a,d=t,p=u;break}return[l*255,d*255,p*255]};O.cmyk.rgb=function(r){var e=r[0]/100,t=r[1]/100,i=r[2]/100,n=r[3]/100,o,a,s;return o=1-Math.min(1,e*(1-n)+n),a=1-Math.min(1,t*(1-n)+n),s=1-Math.min(1,i*(1-n)+n),[o*255,a*255,s*255]};O.xyz.rgb=function(r){var e=r[0]/100,t=r[1]/100,i=r[2]/100,n,o,a;return n=e*3.2406+t*-1.5372+i*-.4986,o=e*-.9689+t*1.8758+i*.0415,a=e*.0557+t*-.204+i*1.057,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:n*12.92,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o*12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a*12.92,n=Math.min(Math.max(0,n),1),o=Math.min(Math.max(0,o),1),a=Math.min(Math.max(0,a),1),[n*255,o*255,a*255]};O.xyz.lab=function(r){var e=r[0],t=r[1],i=r[2],n,o,a;return e/=95.047,t/=100,i/=108.883,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,n=116*t-16,o=500*(e-t),a=200*(t-i),[n,o,a]};O.lab.xyz=function(r){var e=r[0],t=r[1],i=r[2],n,o,a;o=(e+16)/116,n=t/500+o,a=o-i/200;var s=Math.pow(o,3),u=Math.pow(n,3),l=Math.pow(a,3);return o=s>.008856?s:(o-16/116)/7.787,n=u>.008856?u:(n-16/116)/7.787,a=l>.008856?l:(a-16/116)/7.787,n*=95.047,o*=100,a*=108.883,[n,o,a]};O.lab.lch=function(r){var e=r[0],t=r[1],i=r[2],n,o,a;return n=Math.atan2(i,t),o=n*360/2/Math.PI,o<0&&(o+=360),a=Math.sqrt(t*t+i*i),[e,a,o]};O.lch.lab=function(r){var e=r[0],t=r[1],i=r[2],n,o,a;return a=i/360*2*Math.PI,n=t*Math.cos(a),o=t*Math.sin(a),[e,n,o]};O.rgb.ansi16=function(r){var e=r[0],t=r[1],i=r[2],n=1 in arguments?arguments[1]:O.rgb.hsv(r)[2];if(n=Math.round(n/50),n===0)return 30;var o=30+(Math.round(i/255)<<2|Math.round(t/255)<<1|Math.round(e/255));return n===2&&(o+=60),o};O.hsv.ansi16=function(r){return O.rgb.ansi16(O.hsv.rgb(r),r[2])};O.rgb.ansi256=function(r){var e=r[0],t=r[1],i=r[2];if(e===t&&t===i)return e<8?16:e>248?231:Math.round((e-8)/247*24)+232;var n=16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(i/255*5);return n};O.ansi16.rgb=function(r){var e=r%10;if(e===0||e===7)return r>50&&(e+=3.5),e=e/10.5*255,[e,e,e];var t=(~~(r>50)+1)*.5,i=(e&1)*t*255,n=(e>>1&1)*t*255,o=(e>>2&1)*t*255;return[i,n,o]};O.ansi256.rgb=function(r){if(r>=232){var e=(r-232)*10+8;return[e,e,e]}r-=16;var t,i=Math.floor(r/36)/5*255,n=Math.floor((t=r%36)/6)/5*255,o=t%6/5*255;return[i,n,o]};O.rgb.hex=function(r){var e=((Math.round(r[0])&255)<<16)+((Math.round(r[1])&255)<<8)+(Math.round(r[2])&255),t=e.toString(16).toUpperCase();return"000000".substring(t.length)+t};O.hex.rgb=function(r){var e=r.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var t=e[0];e[0].length===3&&(t=t.split("").map(function(s){return s+s}).join(""));var i=parseInt(t,16),n=i>>16&255,o=i>>8&255,a=i&255;return[n,o,a]};O.rgb.hcg=function(r){var e=r[0]/255,t=r[1]/255,i=r[2]/255,n=Math.max(Math.max(e,t),i),o=Math.min(Math.min(e,t),i),a=n-o,s,u;return a<1?s=o/(1-a):s=0,a<=0?u=0:n===e?u=(t-i)/a%6:n===t?u=2+(i-e)/a:u=4+(e-t)/a+4,u/=6,u%=1,[u*360,a*100,s*100]};O.hsl.hcg=function(r){var e=r[1]/100,t=r[2]/100,i=1,n=0;return t<.5?i=2*e*t:i=2*e*(1-t),i<1&&(n=(t-.5*i)/(1-i)),[r[0],i*100,n*100]};O.hsv.hcg=function(r){var e=r[1]/100,t=r[2]/100,i=e*t,n=0;return i<1&&(n=(t-i)/(1-i)),[r[0],i*100,n*100]};O.hcg.rgb=function(r){var e=r[0]/360,t=r[1]/100,i=r[2]/100;if(t===0)return[i*255,i*255,i*255];var n=[0,0,0],o=e%1*6,a=o%1,s=1-a,u=0;switch(Math.floor(o)){case 0:n[0]=1,n[1]=a,n[2]=0;break;case 1:n[0]=s,n[1]=1,n[2]=0;break;case 2:n[0]=0,n[1]=1,n[2]=a;break;case 3:n[0]=0,n[1]=s,n[2]=1;break;case 4:n[0]=a,n[1]=0,n[2]=1;break;default:n[0]=1,n[1]=0,n[2]=s}return u=(1-t)*i,[(t*n[0]+u)*255,(t*n[1]+u)*255,(t*n[2]+u)*255]};O.hcg.hsv=function(r){var e=r[1]/100,t=r[2]/100,i=e+t*(1-e),n=0;return i>0&&(n=e/i),[r[0],n*100,i*100]};O.hcg.hsl=function(r){var e=r[1]/100,t=r[2]/100,i=t*(1-e)+.5*e,n=0;return i>0&&i<.5?n=e/(2*i):i>=.5&&i<1&&(n=e/(2*(1-i))),[r[0],n*100,i*100]};O.hcg.hwb=function(r){var e=r[1]/100,t=r[2]/100,i=e+t*(1-e);return[r[0],(i-e)*100,(1-i)*100]};O.hwb.hcg=function(r){var e=r[1]/100,t=r[2]/100,i=1-t,n=i-e,o=0;return n<1&&(o=(i-n)/(1-n)),[r[0],n*100,o*100]};O.apple.rgb=function(r){return[r[0]/65535*255,r[1]/65535*255,r[2]/65535*255]};O.rgb.apple=function(r){return[r[0]/255*65535,r[1]/255*65535,r[2]/255*65535]};O.gray.rgb=function(r){return[r[0]/100*255,r[0]/100*255,r[0]/100*255]};O.gray.hsl=O.gray.hsv=function(r){return[0,0,r[0]]};O.gray.hwb=function(r){return[0,100,r[0]]};O.gray.cmyk=function(r){return[0,0,0,r[0]]};O.gray.lab=function(r){return[r[0],0,0]};O.gray.hex=function(r){var e=Math.round(r[0]/100*255)&255,t=(e<<16)+(e<<8)+e,i=t.toString(16).toUpperCase();return"000000".substring(i.length)+i};O.rgb.gray=function(r){var e=(r[0]+r[1]+r[2])/3;return[e/255*100]}});var Yl=c((h_,Gl)=>{var bi=go();function Yy(){for(var r={},e=Object.keys(bi),t=e.length,i=0;i<t;i++)r[e[i]]={distance:-1,parent:null};return r}function Wy(r){var e=Yy(),t=[r];for(e[r].distance=0;t.length;)for(var i=t.pop(),n=Object.keys(bi[i]),o=n.length,a=0;a<o;a++){var s=n[a],u=e[s];u.distance===-1&&(u.distance=e[i].distance+1,u.parent=i,t.unshift(s))}return e}function By(r,e){return function(t){return e(r(t))}}function Vy(r,e){for(var t=[e[r].parent,r],i=bi[e[r].parent][r],n=e[r].parent;e[n].parent;)t.unshift(e[n].parent),i=By(bi[e[n].parent][n],i),n=e[n].parent;return i.conversion=t,i}Gl.exports=function(r){for(var e=Wy(r),t={},i=Object.keys(e),n=i.length,o=0;o<n;o++){var a=i[o],s=e[a];s.parent!==null&&(t[a]=Vy(a,e))}return t}});var Bl=c((m_,Wl)=>{var yo=go(),Ky=Yl(),Lr={},Jy=Object.keys(yo);function Zy(r){var e=function(t){return t==null?t:(arguments.length>1&&(t=Array.prototype.slice.call(arguments)),r(t))};return"conversion"in r&&(e.conversion=r.conversion),e}function Xy(r){var e=function(t){if(t==null)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var i=r(t);if(typeof i=="object")for(var n=i.length,o=0;o<n;o++)i[o]=Math.round(i[o]);return i};return"conversion"in r&&(e.conversion=r.conversion),e}Jy.forEach(function(r){Lr[r]={},Object.defineProperty(Lr[r],"channels",{value:yo[r].channels}),Object.defineProperty(Lr[r],"labels",{value:yo[r].labels});var e=Ky(r),t=Object.keys(e);t.forEach(function(i){var n=e[i];Lr[r][i]=Xy(n),Lr[r][i].raw=Zy(n)})});Wl.exports=Lr});var Jl=c((g_,Kl)=>{"use strict";var st=$l(),ce=Bl(),_o=[].slice,Vl=["keyword","gray","hex"],bo={};Object.keys(ce).forEach(function(r){bo[_o.call(ce[r].labels).sort().join("")]=r});var vi={};function Z(r,e){if(!(this instanceof Z))return new Z(r,e);if(e&&e in Vl&&(e=null),e&&!(e in ce))throw new Error("Unknown model: "+e);var t,i;if(r==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(r instanceof Z)this.model=r.model,this.color=r.color.slice(),this.valpha=r.valpha;else if(typeof r=="string"){var n=st.get(r);if(n===null)throw new Error("Unable to parse color from string: "+r);this.model=n.model,i=ce[this.model].channels,this.color=n.value.slice(0,i),this.valpha=typeof n.value[i]=="number"?n.value[i]:1}else if(r.length){this.model=e||"rgb",i=ce[this.model].channels;var o=_o.call(r,0,i);this.color=vo(o,i),this.valpha=typeof r[i]=="number"?r[i]:1}else if(typeof r=="number")r&=16777215,this.model="rgb",this.color=[r>>16&255,r>>8&255,r&255],this.valpha=1;else{this.valpha=1;var a=Object.keys(r);"alpha"in r&&(a.splice(a.indexOf("alpha"),1),this.valpha=typeof r.alpha=="number"?r.alpha:0);var s=a.sort().join("");if(!(s in bo))throw new Error("Unable to parse color from object: "+JSON.stringify(r));this.model=bo[s];var u=ce[this.model].labels,l=[];for(t=0;t<u.length;t++)l.push(r[u[t]]);this.color=vo(l)}if(vi[this.model])for(i=ce[this.model].channels,t=0;t<i;t++){var d=vi[this.model][t];d&&(this.color[t]=d(this.color[t]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}Z.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(r){var e=this.model in st.to?this:this.rgb();e=e.round(typeof r=="number"?r:1);var t=e.valpha===1?e.color:e.color.concat(this.valpha);return st.to[e.model](t)},percentString:function(r){var e=this.rgb().round(typeof r=="number"?r:1),t=e.valpha===1?e.color:e.color.concat(this.valpha);return st.to.rgb.percent(t)},array:function(){return this.valpha===1?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var r={},e=ce[this.model].channels,t=ce[this.model].labels,i=0;i<e;i++)r[t[i]]=this.color[i];return this.valpha!==1&&(r.alpha=this.valpha),r},unitArray:function(){var r=this.rgb().color;return r[0]/=255,r[1]/=255,r[2]/=255,this.valpha!==1&&r.push(this.valpha),r},unitObject:function(){var r=this.rgb().object();return r.r/=255,r.g/=255,r.b/=255,this.valpha!==1&&(r.alpha=this.valpha),r},round:function(r){return r=Math.max(r||0,0),new Z(this.color.map(eb(r)).concat(this.valpha),this.model)},alpha:function(r){return arguments.length?new Z(this.color.concat(Math.max(0,Math.min(1,r))),this.model):this.valpha},red:H("rgb",0,B(255)),green:H("rgb",1,B(255)),blue:H("rgb",2,B(255)),hue:H(["hsl","hsv","hsl","hwb","hcg"],0,function(r){return(r%360+360)%360}),saturationl:H("hsl",1,B(100)),lightness:H("hsl",2,B(100)),saturationv:H("hsv",1,B(100)),value:H("hsv",2,B(100)),chroma:H("hcg",1,B(100)),gray:H("hcg",2,B(100)),white:H("hwb",1,B(100)),wblack:H("hwb",2,B(100)),cyan:H("cmyk",0,B(100)),magenta:H("cmyk",1,B(100)),yellow:H("cmyk",2,B(100)),black:H("cmyk",3,B(100)),x:H("xyz",0,B(100)),y:H("xyz",1,B(100)),z:H("xyz",2,B(100)),l:H("lab",0,B(100)),a:H("lab",1),b:H("lab",2),keyword:function(r){return arguments.length?new Z(r):ce[this.model].keyword(this.color)},hex:function(r){return arguments.length?new Z(r):st.to.hex(this.rgb().round().color)},rgbNumber:function(){var r=this.rgb().color;return(r[0]&255)<<16|(r[1]&255)<<8|r[2]&255},luminosity:function(){for(var r=this.rgb().color,e=[],t=0;t<r.length;t++){var i=r[t]/255;e[t]=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4)}return .2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(r){var e=this.luminosity(),t=r.luminosity();return e>t?(e+.05)/(t+.05):(t+.05)/(e+.05)},level:function(r){var e=this.contrast(r);return e>=7.1?"AAA":e>=4.5?"AA":""},isDark:function(){var r=this.rgb().color,e=(r[0]*299+r[1]*587+r[2]*114)/1e3;return e<128},isLight:function(){return!this.isDark()},negate:function(){for(var r=this.rgb(),e=0;e<3;e++)r.color[e]=255-r.color[e];return r},lighten:function(r){var e=this.hsl();return e.color[2]+=e.color[2]*r,e},darken:function(r){var e=this.hsl();return e.color[2]-=e.color[2]*r,e},saturate:function(r){var e=this.hsl();return e.color[1]+=e.color[1]*r,e},desaturate:function(r){var e=this.hsl();return e.color[1]-=e.color[1]*r,e},whiten:function(r){var e=this.hwb();return e.color[1]+=e.color[1]*r,e},blacken:function(r){var e=this.hwb();return e.color[2]+=e.color[2]*r,e},grayscale:function(){var r=this.rgb().color,e=r[0]*.3+r[1]*.59+r[2]*.11;return Z.rgb(e,e,e)},fade:function(r){return this.alpha(this.valpha-this.valpha*r)},opaquer:function(r){return this.alpha(this.valpha+this.valpha*r)},rotate:function(r){var e=this.hsl(),t=e.color[0];return t=(t+r)%360,t=t<0?360+t:t,e.color[0]=t,e},mix:function(r,e){if(!r||!r.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof r);var t=r.rgb(),i=this.rgb(),n=e===void 0?.5:e,o=2*n-1,a=t.alpha()-i.alpha(),s=((o*a===-1?o:(o+a)/(1+o*a))+1)/2,u=1-s;return Z.rgb(s*t.red()+u*i.red(),s*t.green()+u*i.green(),s*t.blue()+u*i.blue(),t.alpha()*n+i.alpha()*(1-n))}};Object.keys(ce).forEach(function(r){if(Vl.indexOf(r)===-1){var e=ce[r].channels;Z.prototype[r]=function(){if(this.model===r)return new Z(this);if(arguments.length)return new Z(arguments,r);var t=typeof arguments[e]=="number"?e:this.valpha;return new Z(rb(ce[this.model][r].raw(this.color)).concat(t),r)},Z[r]=function(t){return typeof t=="number"&&(t=vo(_o.call(arguments),e)),new Z(t,r)}}});function Qy(r,e){return Number(r.toFixed(e))}function eb(r){return function(e){return Qy(e,r)}}function H(r,e,t){return r=Array.isArray(r)?r:[r],r.forEach(function(i){(vi[i]||(vi[i]=[]))[e]=t}),r=r[0],function(i){var n;return arguments.length?(t&&(i=t(i)),n=this[r](),n.color[e]=i,n):(n=this[r]().color[e],t&&(n=t(n)),n)}}function B(r){return function(e){return Math.max(0,Math.min(r,e))}}function rb(r){return Array.isArray(r)?r:[r]}function vo(r,e){for(var t=0;t<e;t++)typeof r[t]!="number"&&(r[t]=0);return r}Kl.exports=Z});var Xl=c((y_,Zl)=>{"use strict";Zl.exports=function(e){for(var t=0,i=0;t<e.length;i=e.charCodeAt(t++)+((i<<5)-i));var n=Math.floor(Math.abs(Math.sin(i)*1e4%1*16777216)).toString(16);return"#"+Array(6-n.length+1).join("0")+n}});var tc=c((b_,rc)=>{"use strict";var Ql=Jl(),ec=Xl();rc.exports=function(e,t){var i=e.split(t||":"),n=ec(i[0]);if(!i.length)return n;for(var o=0,a=i.length-1;o<a;o++)n=Ql(n).mix(Ql(ec(i[o+1]))).saturate(1).hex();return n}});var nc=c((v_,ic)=>{"use strict";function ge(r,e){if(e)return new ge(r).style(e);if(!(this instanceof ge))return new ge(r);this.text=r}ge.prototype.prefix="\x1B[";ge.prototype.suffix="m";ge.prototype.hex=function(e){e=e[0]==="#"?e.substring(1):e,e.length===3&&(e=e.split(""),e[5]=e[2],e[4]=e[2],e[3]=e[1],e[2]=e[1],e[1]=e[0],e=e.join(""));var t=e.substring(0,2),i=e.substring(2,4),n=e.substring(4,6);return[parseInt(t,16),parseInt(i,16),parseInt(n,16)]};ge.prototype.rgb=function(e,t,i){var n=e/255*5,o=t/255*5,a=i/255*5;return this.ansi(n,o,a)};ge.prototype.ansi=function(e,t,i){var n=Math.round(e),o=Math.round(t),a=Math.round(i);return 16+n*36+o*6+a};ge.prototype.reset=function(){return this.prefix+"39;49"+this.suffix};ge.prototype.style=function(e){return this.prefix+"38;5;"+this.rgb.apply(this,this.hex(e))+this.suffix+this.text+this.reset()};ic.exports=ge});var ac=c((__,oc)=>{var tb=tc(),ib=nc();oc.exports=function(e,t){var i=t.namespace,n=t.colors!==!1?ib(i+":",tb(i)):i+":";return e[0]=n+" "+e[0],e}});var uc=c((w_,sc)=>{"use strict";sc.exports=function(e,t){if(!t)return!1;for(var i=t.split(/[\s,]+/),n=0;n<i.length;n++){if(t=i[n].replace("*",".*?"),t.charAt(0)==="-"){if(new RegExp("^"+t.substr(1)+"$").test(e))return!1;continue}if(new RegExp("^"+t+"$").test(e))return!0}return!1}});var cc=c((E_,lc)=>{var nb=uc();lc.exports=function(e){return function(i){try{return nb(i,e())}catch{}return!1}}});var dc=c((O_,fc)=>{var ob=cc();fc.exports=ob(function(){return process.env.DEBUG||process.env.DIAGNOSTICS})});var hc=c((S_,pc)=>{pc.exports=function(r,e){try{Function.prototype.apply.call(console.log,console,e)}catch{}}});var gc=c((P_,mc)=>{var ab=mo(),sb=require("tty").isatty(1),_i=ab(function r(e,t){return t=t||{},t.colors="colors"in t?t.colors:sb,t.namespace=e,t.prod=!1,t.dev=!0,!r.enabled(e)&&!(t.force||r.force)?r.nope(t):r.yep(t)});_i.modify(ac());_i.use(dc());_i.set(hc());mc.exports=_i});var ut=c((A_,wo)=>{process.env.NODE_ENV==="production"?wo.exports=Al():wo.exports=gc()});var bc=c((T_,yc)=>{"use strict";var Eo=require("fs"),{StringDecoder:ub}=require("string_decoder"),{Stream:lb}=sr();function cb(){}yc.exports=(r,e)=>{let t=Buffer.alloc(65536),i=new ub("utf8"),n=new lb,o="",a=0,s=0;return r.start===-1&&delete r.start,n.readable=!0,n.destroy=()=>{n.destroyed=!0,n.emit("end"),n.emit("close")},Eo.open(r.file,"a+","0644",(u,l)=>{if(u){e?e(u):n.emit("error",u),n.destroy();return}(function d(){if(n.destroyed){Eo.close(l,cb);return}return Eo.read(l,t,0,t.length,a,(p,m)=>{if(p){e?e(p):n.emit("error",p),n.destroy();return}if(!m)return o&&((r.start==null||s>r.start)&&(e?e(null,o):n.emit("line",o)),s++,o=""),setTimeout(d,1e3);let _=i.write(t.slice(0,m));e||n.emit("data",_),_=(o+_).split(/\n+/);let f=_.length-1,g=0;for(;g<f;g++)(r.start==null||s>r.start)&&(e?e(null,_[g]):n.emit("line",_[g])),s++;return o=_[f],a+=m,d()})})()}),e?n.destroy:n}});var Ec=c((M_,wc)=>{"use strict";var oe=require("fs"),V=require("path"),vc=dl(),fb=require("zlib"),{MESSAGE:db}=G(),{Stream:pb,PassThrough:_c}=sr(),hb=Rr(),ye=ut()("winston:file"),mb=require("os"),gb=bc();wc.exports=class extends hb{constructor(e={}){super(e),this.name=e.name||"file";function t(i,...n){n.slice(1).forEach(o=>{if(e[o])throw new Error(`Cannot set ${o} and ${i} together`)})}if(this._stream=new _c,this._stream.setMaxListeners(30),this._onError=this._onError.bind(this),e.filename||e.dirname)t("filename or dirname","stream"),this._basename=this.filename=e.filename?V.basename(e.filename):"winston.log",this.dirname=e.dirname||V.dirname(e.filename),this.options=e.options||{flags:"a"};else if(e.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(e.stream)),this.dirname=V.dirname(this._dest.path);else throw new Error("Cannot log to file without filename or stream.");this.maxsize=e.maxsize||null,this.rotationFormat=e.rotationFormat||!1,this.zippedArchive=e.zippedArchive||!1,this.maxFiles=e.maxFiles||null,this.eol=typeof e.eol=="string"?e.eol:mb.EOL,this.tailable=e.tailable||!1,this.lazy=e.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(e,t=()=>{}){if(this.silent)return t(),!0;if(this._drain){this._stream.once("drain",()=>{this._drain=!1,this.log(e,t)});return}if(this._rotate){this._stream.once("rotate",()=>{this._rotate=!1,this.log(e,t)});return}if(this.lazy){if(!this._fileExist){this._opening||this.open(),this.once("open",()=>{this._fileExist=!0,this.log(e,t)});return}if(this._needsNewFile(this._pendingSize)){this._dest.once("close",()=>{this._opening||this.open(),this.once("open",()=>{this.log(e,t)})});return}}let i=`${e[db]}${this.eol}`,n=Buffer.byteLength(i);function o(){if(this._size+=n,this._pendingSize-=n,ye("logged %s %s",this._size,i),this.emit("logged",e),!this._rotate&&!this._opening&&this._needsNewFile()){if(this.lazy){this._endStream(()=>{this.emit("fileclosed")});return}this._rotate=!0,this._endStream(()=>this._rotateFile())}}this._pendingSize+=n,this._opening&&!this.rotatedWhileOpening&&this._needsNewFile(this._size+this._pendingSize)&&(this.rotatedWhileOpening=!0);let a=this._stream.write(i,o.bind(this));return a?t():(this._drain=!0,this._stream.once("drain",()=>{this._drain=!1,t()})),ye("written",a,this._drain),this.finishIfEnding(),a}query(e,t){typeof e=="function"&&(t=e,e={}),e=p(e);let i=V.join(this.dirname,this.filename),n="",o=[],a=0,s=oe.createReadStream(i,{encoding:"utf8"});s.on("error",m=>{if(s.readable&&s.destroy(),!!t)return m.code!=="ENOENT"?t(m):t(null,o)}),s.on("data",m=>{m=(n+m).split(/\n+/);let _=m.length-1,f=0;for(;f<_;f++)(!e.start||a>=e.start)&&u(m[f]),a++;n=m[_]}),s.on("close",()=>{n&&u(n,!0),e.order==="desc"&&(o=o.reverse()),t&&t(null,o)});function u(m,_){try{let f=JSON.parse(m);d(f)&&l(f)}catch(f){_||s.emit("error",f)}}function l(m){if(e.rows&&o.length>=e.rows&&e.order!=="desc"){s.readable&&s.destroy();return}e.fields&&(m=e.fields.reduce((_,f)=>(_[f]=m[f],_),{})),e.order==="desc"&&o.length>=e.rows&&o.shift(),o.push(m)}function d(m){if(!m||typeof m!="object")return;let _=new Date(m.timestamp);if(!(e.from&&_<e.from||e.until&&_>e.until||e.level&&e.level!==m.level))return!0}function p(m){return m=m||{},m.rows=m.rows||m.limit||10,m.start=m.start||0,m.until=m.until||new Date,typeof m.until!="object"&&(m.until=new Date(m.until)),m.from=m.from||m.until-1440*60*1e3,typeof m.from!="object"&&(m.from=new Date(m.from)),m.order=m.order||"desc",m}}stream(e={}){let t=V.join(this.dirname,this.filename),i=new pb,n={file:t,start:e.start};return i.destroy=gb(n,(o,a)=>{if(o)return i.emit("error",o);try{i.emit("data",a),a=JSON.parse(a),i.emit("log",a)}catch(s){i.emit("error",s)}}),i}open(){this.filename&&(this._opening||(this._opening=!0,this.stat((e,t)=>{if(e)return this.emit("error",e);ye("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(e){let t=this._getFile(),i=V.join(this.dirname,t);oe.stat(i,(n,o)=>{if(n&&n.code==="ENOENT")return ye("ENOENT\xA0ok",i),this.filename=t,e(null,0);if(n)return ye(`err ${n.code} ${i}`),e(n);if(!o||this._needsNewFile(o.size))return this._incFile(()=>this.stat(e));this.filename=t,e(null,o.size)})}close(e){this._stream&&this._stream.end(()=>{e&&e(),this.emit("flush"),this.emit("closed")})}_needsNewFile(e){return e=e||this._size,this.maxsize&&e>=this.maxsize}_onError(e){this.emit("error",e)}_setupStream(e){return e.on("error",this._onError),e}_cleanupStream(e){return e.removeListener("error",this._onError),e.destroy(),e}_rotateFile(){this._incFile(()=>this.open())}_endStream(e=()=>{}){this._dest?(this._stream.unpipe(this._dest),this._dest.end(()=>{this._cleanupStream(this._dest),e()})):e()}_createStream(e){let t=V.join(this.dirname,this.filename);ye("create stream start",t,this.options);let i=oe.createWriteStream(t,this.options).on("error",n=>ye(n)).on("close",()=>ye("close",i.path,i.bytesWritten)).on("open",()=>{ye("file open ok",t),this.emit("open",t),e.pipe(i),this.rotatedWhileOpening&&(this._stream=new _c,this._stream.setMaxListeners(30),this._rotateFile(),this.rotatedWhileOpening=!1,this._cleanupStream(i),e.end())});return ye("create stream ok",t),i}_incFile(e){ye("_incFile",this.filename);let t=V.extname(this._basename),i=V.basename(this._basename,t),n=[];this.zippedArchive&&n.push(function(o){let a=this._created>0&&!this.tailable?this._created:"";this._compressFile(V.join(this.dirname,`${i}${a}${t}`),V.join(this.dirname,`${i}${a}${t}.gz`),o)}.bind(this)),n.push(function(o){this.tailable?this._checkMaxFilesTailable(t,i,o):(this._created+=1,this._checkMaxFilesIncrementing(t,i,o))}.bind(this)),vc(n,e)}_getFile(){let e=V.extname(this._basename),t=V.basename(this._basename,e),i=this.rotationFormat?this.rotationFormat():this._created;return!this.tailable&&this._created?`${t}${i}${e}`:`${t}${e}`}_checkMaxFilesIncrementing(e,t,i){if(!this.maxFiles||this._created<this.maxFiles)return setImmediate(i);let n=this._created-this.maxFiles,o=n!==0?n:"",a=this.zippedArchive?".gz":"",s=`${t}${o}${e}${a}`,u=V.join(this.dirname,s);oe.unlink(u,i)}_checkMaxFilesTailable(e,t,i){let n=[];if(!this.maxFiles)return;let o=this.zippedArchive?".gz":"";for(let a=this.maxFiles-1;a>1;a--)n.push(function(s,u){let l=`${t}${s-1}${e}${o}`,d=V.join(this.dirname,l);oe.exists(d,p=>{if(!p)return u(null);l=`${t}${s}${e}${o}`,oe.rename(d,V.join(this.dirname,l),u)})}.bind(this,a));vc(n,()=>{oe.rename(V.join(this.dirname,`${t}${e}${o}`),V.join(this.dirname,`${t}1${e}${o}`),i)})}_compressFile(e,t,i){oe.access(e,oe.F_OK,n=>{if(n)return i();var o=fb.createGzip(),a=oe.createReadStream(e),s=oe.createWriteStream(t);s.on("finish",()=>{oe.unlink(e,i)}),a.pipe(o).pipe(s)})}_createLogDirIfNotExist(e){oe.existsSync(e)||oe.mkdirSync(e,{recursive:!0})}}});var Sc=c((x_,Oc)=>{"use strict";var yb=require("http"),bb=require("https"),{Stream:vb}=sr(),_b=Rr(),{configure:wb}=Hr();Oc.exports=class extends _b{constructor(e={}){super(e),this.options=e,this.name=e.name||"http",this.ssl=!!e.ssl,this.host=e.host||"localhost",this.port=e.port,this.auth=e.auth,this.path=e.path||"",this.maximumDepth=e.maximumDepth,this.agent=e.agent,this.headers=e.headers||{},this.headers["content-type"]="application/json",this.batch=e.batch||!1,this.batchInterval=e.batchInterval||5e3,this.batchCount=e.batchCount||10,this.batchOptions=[],this.batchTimeoutID=-1,this.batchCallback={},this.port||(this.port=this.ssl?443:80)}log(e,t){this._request(e,null,null,(i,n)=>{n&&n.statusCode!==200&&(i=new Error(`Invalid HTTP Status Code: ${n.statusCode}`)),i?this.emit("warn",i):this.emit("logged",e)}),t&&setImmediate(t)}query(e,t){typeof e=="function"&&(t=e,e={}),e={method:"query",params:this.normalizeQuery(e)};let i=e.params.auth||null;delete e.params.auth;let n=e.params.path||null;delete e.params.path,this._request(e,i,n,(o,a,s)=>{if(a&&a.statusCode!==200&&(o=new Error(`Invalid HTTP Status Code: ${a.statusCode}`)),o)return t(o);if(typeof s=="string")try{s=JSON.parse(s)}catch(u){return t(u)}t(null,s)})}stream(e={}){let t=new vb;e={method:"stream",params:e};let i=e.params.path||null;delete e.params.path;let n=e.params.auth||null;delete e.params.auth;let o="",a=this._request(e,n,i);return t.destroy=()=>a.destroy(),a.on("data",s=>{s=(o+s).split(/\n+/);let u=s.length-1,l=0;for(;l<u;l++)try{t.emit("log",JSON.parse(s[l]))}catch(d){t.emit("error",d)}o=s[u]}),a.on("error",s=>t.emit("error",s)),t}_request(e,t,i,n){e=e||{},t=t||this.auth,i=i||this.path||"",this.batch?this._doBatch(e,n,t,i):this._doRequest(e,n,t,i)}_doBatch(e,t,i,n){if(this.batchOptions.push(e),this.batchOptions.length===1){let o=this;this.batchCallback=t,this.batchTimeoutID=setTimeout(function(){o.batchTimeoutID=-1,o._doBatchRequest(o.batchCallback,i,n)},this.batchInterval)}this.batchOptions.length===this.batchCount&&this._doBatchRequest(this.batchCallback,i,n)}_doBatchRequest(e,t,i){this.batchTimeoutID>0&&(clearTimeout(this.batchTimeoutID),this.batchTimeoutID=-1);let n=this.batchOptions.slice();this.batchOptions=[],this._doRequest(n,e,t,i)}_doRequest(e,t,i,n){let o=Object.assign({},this.headers);i&&i.bearer&&(o.Authorization=`Bearer ${i.bearer}`);let a=(this.ssl?bb:yb).request({...this.options,method:"POST",host:this.host,port:this.port,path:`/${n.replace(/^\//,"")}`,headers:o,auth:i&&i.username&&i.password?`${i.username}:${i.password}`:"",agent:this.agent});a.on("error",t),a.on("response",u=>u.on("end",()=>t(null,u)).resume());let s=wb({...this.maximumDepth&&{maximumDepth:this.maximumDepth}});a.end(Buffer.from(s(e,this.options.replacer),"utf8"))}}});var Oo=c((I_,Pc)=>{"use strict";var _e=r=>r!==null&&typeof r=="object"&&typeof r.pipe=="function";_e.writable=r=>_e(r)&&r.writable!==!1&&typeof r._write=="function"&&typeof r._writableState=="object";_e.readable=r=>_e(r)&&r.readable!==!1&&typeof r._read=="function"&&typeof r._readableState=="object";_e.duplex=r=>_e.writable(r)&&_e.readable(r);_e.transform=r=>_e.duplex(r)&&typeof r._transform=="function";Pc.exports=_e});var Tc=c((L_,Ac)=>{"use strict";var Eb=Oo(),{MESSAGE:Ob}=G(),Sb=require("os"),Pb=Rr();Ac.exports=class extends Pb{constructor(e={}){if(super(e),!e.stream||!Eb(e.stream))throw new Error("options.stream is required.");this._stream=e.stream,this._stream.setMaxListeners(1/0),this.isObjectMode=e.stream._writableState.objectMode,this.eol=typeof e.eol=="string"?e.eol:Sb.EOL}log(e,t){if(setImmediate(()=>this.emit("logged",e)),this.isObjectMode){this._stream.write(e),t&&t();return}this._stream.write(`${e[Ob]}${this.eol}`),t&&t()}}});var Nc=c(lt=>{"use strict";Object.defineProperty(lt,"Console",{configurable:!0,enumerable:!0,get(){return Ru()}});Object.defineProperty(lt,"File",{configurable:!0,enumerable:!0,get(){return Ec()}});Object.defineProperty(lt,"Http",{configurable:!0,enumerable:!0,get(){return Sc()}});Object.defineProperty(lt,"Stream",{configurable:!0,enumerable:!0,get(){return Tc()}})});var Ei=c(ct=>{"use strict";var wi=En(),{configs:So}=G();ct.cli=wi.levels(So.cli);ct.npm=wi.levels(So.npm);ct.syslog=wi.levels(So.syslog);ct.addColors=wi.levels});var Rc=c((Oi,Mc)=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});var Ab=Zt(),Tb=lr(Ab),Nb=si(),Mb=lr(Nb),Rb=oo(),xb=lr(Rb),Ib=to(),Db=lr(Ib),Lb=io(),Cb=lr(Lb),qb=ar(),$b=lr(qb),Ub=Ir(),Fb=lr(Ub);function lr(r){return r&&r.__esModule?r:{default:r}}function jb(r,e,t){t=(0,Db.default)(t);var i=0,n=0,{length:o}=r,a=!1;o===0&&t(null);function s(u,l){u===!1&&(a=!0),a!==!0&&(u?t(u):(++n===o||l===Mb.default)&&t(null))}for(;i<o;i++)e(r[i],i,(0,Cb.default)(s))}function kb(r,e,t){return(0,xb.default)(r,1/0,e,t)}function zb(r,e,t){var i=(0,Tb.default)(r)?jb:kb;return i(r,(0,$b.default)(e),t)}Oi.default=(0,Fb.default)(zb,3);Mc.exports=Oi.default});var Ic=c((Si,xc)=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.default=Hb;function Hb(r){return(e,t,i)=>r(e,i)}xc.exports=Si.default});var Ti=c((Ai,Dc)=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});var Gb=Rc(),Yb=Pi(Gb),Wb=Ic(),Bb=Pi(Wb),Vb=ar(),Kb=Pi(Vb),Jb=Ir(),Zb=Pi(Jb);function Pi(r){return r&&r.__esModule?r:{default:r}}function Xb(r,e,t){return(0,Yb.default)(r,(0,Bb.default)((0,Kb.default)(e)),t)}Ai.default=(0,Zb.default)(Xb,3);Dc.exports=Ai.default});var Cc=c(($_,Lc)=>{"use strict";var Qb=Object.prototype.toString;Lc.exports=function(e){if(typeof e.displayName=="string"&&e.constructor.name)return e.displayName;if(typeof e.name=="string"&&e.name)return e.name;if(typeof e=="object"&&e.constructor&&typeof e.constructor.name=="string")return e.constructor.name;var t=e.toString(),i=Qb.call(e).slice(8,-1);return i==="Function"?t=t.substring(t.indexOf("(")+1,t.indexOf(")")):t=i,t||"anonymous"}});var Po=c((U_,qc)=>{"use strict";var e0=Cc();qc.exports=function(e){var t=0,i;function n(){return t||(t=1,i=e.apply(this,arguments),e=null),i}return n.displayName=e0(e),n}});var Ao=c(dt=>{dt.get=function(r){var e=Error.stackTraceLimit;Error.stackTraceLimit=1/0;var t={},i=Error.prepareStackTrace;Error.prepareStackTrace=function(o,a){return a},Error.captureStackTrace(t,r||dt.get);var n=t.stack;return Error.prepareStackTrace=i,Error.stackTraceLimit=e,n};dt.parse=function(r){if(!r.stack)return[];var e=this,t=r.stack.split(`
29
+ `).slice(1);return t.map(function(i){if(i.match(/^\s*[-]{4,}$/))return e._createParsedCallSite({fileName:i,lineNumber:null,functionName:null,typeName:null,methodName:null,columnNumber:null,native:null});var n=i.match(/at (?:(.+)\s+\()?(?:(.+?):(\d+)(?::(\d+))?|([^)]+))\)?/);if(n){var o=null,a=null,s=null,u=null,l=null,d=n[5]==="native";if(n[1]){s=n[1];var p=s.lastIndexOf(".");if(s[p-1]=="."&&p--,p>0){o=s.substr(0,p),a=s.substr(p+1);var m=o.indexOf(".Module");m>0&&(s=s.substr(m+1),o=o.substr(0,m))}u=null}a&&(u=o,l=a),a==="<anonymous>"&&(l=null,s=null);var _={fileName:n[2]||null,lineNumber:parseInt(n[3],10)||null,functionName:s,typeName:u,methodName:l,columnNumber:parseInt(n[4],10)||null,native:d};return e._createParsedCallSite(_)}}).filter(function(i){return!!i})};function ft(r){for(var e in r)this[e]=r[e]}var r0=["this","typeName","functionName","methodName","fileName","lineNumber","columnNumber","function","evalOrigin"],t0=["topLevel","eval","native","constructor"];r0.forEach(function(r){ft.prototype[r]=null,ft.prototype["get"+r[0].toUpperCase()+r.substr(1)]=function(){return this[r]}});t0.forEach(function(r){ft.prototype[r]=!1,ft.prototype["is"+r[0].toUpperCase()+r.substr(1)]=function(){return this[r]}});dt._createParsedCallSite=function(r){return new ft(r)}});var Uc=c((k_,$c)=>{"use strict";var{Writable:i0}=sr();$c.exports=class extends i0{constructor(e){if(super({objectMode:!0}),!e)throw new Error("ExceptionStream requires a TransportStream instance.");this.handleExceptions=!0,this.transport=e}_write(e,t,i){return e.exception?this.transport.log(e,i):(i(),!0)}}});var No=c((H_,kc)=>{"use strict";var Fc=require("os"),n0=Ti(),To=ut()("winston:exception"),o0=Po(),jc=Ao(),a0=Uc();kc.exports=class{constructor(e){if(!e)throw new Error("Logger is required to handle exceptions");this.logger=e,this.handlers=new Map}handle(...e){e.forEach(t=>{if(Array.isArray(t))return t.forEach(i=>this._addHandler(i));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(e=>this.logger.unpipe(e)))}getAllInfo(e){let t=null;return e&&(t=typeof e=="string"?e:e.message),{error:e,level:"error",message:[`uncaughtException: ${t||"(no error message)"}`,e&&e.stack||" No stack trace"].join(`
30
+ `),stack:e&&e.stack,exception:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(e)}}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:Fc.loadavg(),uptime:Fc.uptime()}}getTrace(e){return(e?jc.parse(e):jc.get()).map(i=>({column:i.getColumnNumber(),file:i.getFileName(),function:i.getFunctionName(),line:i.getLineNumber(),method:i.getMethodName(),native:i.isNative()}))}_addHandler(e){if(!this.handlers.has(e)){e.handleExceptions=!0;let t=new a0(e);this.handlers.set(e,t),this.logger.pipe(t)}}_uncaughtException(e){let t=this.getAllInfo(e),i=this._getExceptionHandlers(),n=typeof this.logger.exitOnError=="function"?this.logger.exitOnError(e):this.logger.exitOnError,o;!i.length&&n&&(console.warn("winston: exitOnError cannot be true with no exception handlers."),console.warn("winston: not exiting process."),n=!1);function a(){To("doExit",n),To("process._exiting",process._exiting),n&&!process._exiting&&(o&&clearTimeout(o),process.exit(1))}if(!i||i.length===0)return process.nextTick(a);n0(i,(s,u)=>{let l=o0(u),d=s.transport||s;function p(m){return()=>{To(m),l()}}d._ending=!0,d.once("finish",p("finished")),d.once("error",p("error"))},()=>n&&a()),this.logger.log(t),n&&(o=setTimeout(a,3e3))}_getExceptionHandlers(){return this.logger.transports.filter(e=>(e.transport||e).handleExceptions)}}});var Hc=c((Y_,zc)=>{"use strict";var{Writable:s0}=sr();zc.exports=class extends s0{constructor(e){if(super({objectMode:!0}),!e)throw new Error("RejectionStream requires a TransportStream instance.");this.handleRejections=!0,this.transport=e}_write(e,t,i){return e.rejection?this.transport.log(e,i):(i(),!0)}}});var Ro=c((B_,Wc)=>{"use strict";var Gc=require("os"),u0=Ti(),Mo=ut()("winston:rejection"),l0=Po(),Yc=Ao(),c0=Hc();Wc.exports=class{constructor(e){if(!e)throw new Error("Logger is required to handle rejections");this.logger=e,this.handlers=new Map}handle(...e){e.forEach(t=>{if(Array.isArray(t))return t.forEach(i=>this._addHandler(i));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(e=>this.logger.unpipe(e)))}getAllInfo(e){let t=null;return e&&(t=typeof e=="string"?e:e.message),{error:e,level:"error",message:[`unhandledRejection: ${t||"(no error message)"}`,e&&e.stack||" No stack trace"].join(`
31
+ `),stack:e&&e.stack,rejection:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(e)}}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:Gc.loadavg(),uptime:Gc.uptime()}}getTrace(e){return(e?Yc.parse(e):Yc.get()).map(i=>({column:i.getColumnNumber(),file:i.getFileName(),function:i.getFunctionName(),line:i.getLineNumber(),method:i.getMethodName(),native:i.isNative()}))}_addHandler(e){if(!this.handlers.has(e)){e.handleRejections=!0;let t=new c0(e);this.handlers.set(e,t),this.logger.pipe(t)}}_unhandledRejection(e){let t=this.getAllInfo(e),i=this._getRejectionHandlers(),n=typeof this.logger.exitOnError=="function"?this.logger.exitOnError(e):this.logger.exitOnError,o;!i.length&&n&&(console.warn("winston: exitOnError cannot be true with no rejection handlers."),console.warn("winston: not exiting process."),n=!1);function a(){Mo("doExit",n),Mo("process._exiting",process._exiting),n&&!process._exiting&&(o&&clearTimeout(o),process.exit(1))}if(!i||i.length===0)return process.nextTick(a);u0(i,(s,u)=>{let l=l0(u),d=s.transport||s;function p(m){return()=>{Mo(m),l()}}d._ending=!0,d.once("finish",p("finished")),d.once("error",p("error"))},()=>n&&a()),this.logger.log(t),n&&(o=setTimeout(a,3e3))}_getRejectionHandlers(){return this.logger.transports.filter(e=>(e.transport||e).handleRejections)}}});var Vc=c((V_,Bc)=>{"use strict";var xo=class{constructor(e){let t=Ni();if(typeof e!="object"||Array.isArray(e)||!(e instanceof t))throw new Error("Logger is required for profiling");this.logger=e,this.start=Date.now()}done(...e){typeof e[e.length-1]=="function"&&(console.warn("Callback function no longer supported as of winston@3.0.0"),e.pop());let t=typeof e[e.length-1]=="object"?e.pop():{};return t.level=t.level||"info",t.durationMs=Date.now()-this.start,this.logger.write(t)}};Bc.exports=xo});var Ni=c((K_,Xc)=>{"use strict";var{Stream:f0,Transform:d0}=sr(),Kc=Ti(),{LEVEL:we,SPLAT:Jc}=G(),Zc=Oo(),p0=No(),h0=Ro(),m0=Qn(),g0=Vc(),{warn:y0}=On(),b0=Ei(),v0=/%[scdjifoO%]/g,Mi=class extends d0{constructor(e){super({objectMode:!0}),this.configure(e)}child(e){let t=this;return Object.create(t,{write:{value:function(i){let n=Object.assign({},e,i);i instanceof Error&&(n.stack=i.stack,n.message=i.message),t.write(n)}}})}configure({silent:e,format:t,defaultMeta:i,levels:n,level:o="info",exitOnError:a=!0,transports:s,colors:u,emitErrs:l,formatters:d,padLevels:p,rewriters:m,stripColors:_,exceptionHandlers:f,rejectionHandlers:g}={}){if(this.transports.length&&this.clear(),this.silent=e,this.format=t||this.format||yn()(),this.defaultMeta=i||null,this.levels=n||this.levels||b0.npm.levels,this.level=o,this.exceptions&&this.exceptions.unhandle(),this.rejections&&this.rejections.unhandle(),this.exceptions=new p0(this),this.rejections=new h0(this),this.profilers={},this.exitOnError=a,s&&(s=Array.isArray(s)?s:[s],s.forEach(E=>this.add(E))),u||l||d||p||m||_)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(`
32
+ `));f&&this.exceptions.handle(f),g&&this.rejections.handle(g)}isLevelEnabled(e){let t=Io(this.levels,e);if(t===null)return!1;let i=Io(this.levels,this.level);return i===null?!1:!this.transports||this.transports.length===0?i>=t:this.transports.findIndex(o=>{let a=Io(this.levels,o.level);return a===null&&(a=i),a>=t})!==-1}log(e,t,...i){if(arguments.length===1)return e[we]=e.level,this._addDefaultMeta(e),this.write(e),this;if(arguments.length===2)return t&&typeof t=="object"?(t[we]=t.level=e,this._addDefaultMeta(t),this.write(t),this):(t={[we]:e,level:e,message:t},this._addDefaultMeta(t),this.write(t),this);let[n]=i;if(typeof n=="object"&&n!==null&&!(t&&t.match&&t.match(v0))){let a=Object.assign({},this.defaultMeta,n,{[we]:e,[Jc]:i,level:e,message:t});return n.message&&(a.message=`${a.message} ${n.message}`),n.stack&&(a.stack=n.stack),n.cause&&(a.cause=n.cause),this.write(a),this}return this.write(Object.assign({},this.defaultMeta,{[we]:e,[Jc]:i,level:e,message:t})),this}_transform(e,t,i){if(this.silent)return i();e[we]||(e[we]=e.level),!this.levels[e[we]]&&this.levels[e[we]]!==0&&console.error("[winston] Unknown logger level: %s",e[we]),this._readableState.pipes||console.error("[winston] Attempt to write logs with no transports, which can increase memory usage: %j",e);try{this.push(this.format.transform(e,this.format.options))}finally{this._writableState.sync=!1,i()}}_final(e){let t=this.transports.slice();Kc(t,(i,n)=>{if(!i||i.finished)return setImmediate(n);i.once("finish",n),i.end()},e)}add(e){let t=!Zc(e)||e.log.length>2?new m0({transport:e}):e;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),e.handleExceptions&&this.exceptions.handle(),e.handleRejections&&this.rejections.handle(),this}remove(e){if(!e)return this;let t=e;return(!Zc(e)||e.log.length>2)&&(t=this.transports.filter(i=>i.transport===e)[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(){y0.deprecated("setLevels")}query(e,t){typeof e=="function"&&(t=e,e={}),e=e||{};let i={},n=Object.assign({},e.query||{});function o(s,u){e.query&&typeof s.formatQuery=="function"&&(e.query=s.formatQuery(n)),s.query(e,(l,d)=>{if(l)return u(l);typeof s.formatResults=="function"&&(d=s.formatResults(d,e.format)),u(null,d)})}function a(s,u){o(s,(l,d)=>{u&&(d=l||d,d&&(i[s.name]=d),u()),u=null})}Kc(this.transports.filter(s=>!!s.query),a,()=>t(null,i))}stream(e={}){let t=new f0,i=[];return t._streams=i,t.destroy=()=>{let n=i.length;for(;n--;)i[n].destroy()},this.transports.filter(n=>!!n.stream).forEach(n=>{let o=n.stream(e);o&&(i.push(o),o.on("log",a=>{a.transport=a.transport||[],a.transport.push(n.name),t.emit("log",a)}),o.on("error",a=>{a.transport=a.transport||[],a.transport.push(n.name),t.emit("error",a)}))}),t}startTimer(){return new g0(this)}profile(e,...t){let i=Date.now();if(this.profilers[e]){let n=this.profilers[e];delete this.profilers[e],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=i-n,o.message=o.message||e,this.write(o)}return this.profilers[e]=i,this}handleExceptions(...e){console.warn("Deprecated: .handleExceptions() will be removed in winston@4. Use .exceptions.handle()"),this.exceptions.handle(...e)}unhandleExceptions(...e){console.warn("Deprecated: .unhandleExceptions() will be removed in winston@4. Use .exceptions.unhandle()"),this.exceptions.unhandle(...e)}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(`
33
+ `))}_onEvent(e,t){function i(n){e==="error"&&!this.transports.includes(t)&&this.add(t),this.emit(e,n,t)}t["__winston"+e]||(t["__winston"+e]=i.bind(this),t.on(e,t["__winston"+e]))}_addDefaultMeta(e){this.defaultMeta&&Object.assign(e,this.defaultMeta)}};function Io(r,e){let t=r[e];return!t&&t!==0?null:t}Object.defineProperty(Mi.prototype,"transports",{configurable:!1,enumerable:!0,get(){let{pipes:r}=this._readableState;return Array.isArray(r)?r:[r].filter(Boolean)}});Xc.exports=Mi});var Do=c((J_,Qc)=>{"use strict";var{LEVEL:_0}=G(),w0=Ei(),E0=Ni(),O0=ut()("winston:create-logger");function S0(r){return"is"+r.charAt(0).toUpperCase()+r.slice(1)+"Enabled"}Qc.exports=function(r={}){r.levels=r.levels||w0.npm.levels;class e extends E0{constructor(n){super(n)}}let t=new e(r);return Object.keys(r.levels).forEach(function(i){if(O0('Define prototype method for "%s"',i),i==="log"){console.warn('Level "log" not defined: conflicts with the method "log". Use a different level name.');return}e.prototype[i]=function(...n){let o=this||t;if(n.length===1){let[a]=n,s=a&&a.message&&a||{message:a};return s.level=s[_0]=i,o._addDefaultMeta(s),o.write(s),this||t}return n.length===0?(o.log(i,""),o):o.log(i,...n)},e.prototype[S0(i)]=function(){return(this||t).isLevelEnabled(i)}}),t}});var rf=c((X_,ef)=>{"use strict";var P0=Do();ef.exports=class{constructor(e={}){this.loggers=new Map,this.options=e}add(e,t){if(!this.loggers.has(e)){t=Object.assign({},t||this.options);let i=t.transports||this.options.transports;i?t.transports=Array.isArray(i)?i.slice():[i]:t.transports=[];let n=P0(t);n.on("close",()=>this._delete(e)),this.loggers.set(e,n)}return this.loggers.get(e)}get(e,t){return this.add(e,t)}has(e){return!!this.loggers.has(e)}close(e){if(e)return this._removeLogger(e);this.loggers.forEach((t,i)=>this._removeLogger(i))}_removeLogger(e){if(!this.loggers.has(e))return;this.loggers.get(e).close(),this._delete(e)}_delete(e){this.loggers.delete(e)}}});var nf=c(F=>{"use strict";var tf=En(),{warn:pt}=On();F.version=Ns().version;F.transports=Nc();F.config=Ei();F.addColors=tf.levels;F.format=tf.format;F.createLogger=Do();F.Logger=Ni();F.ExceptionHandler=No();F.RejectionHandler=Ro();F.Container=rf();F.Transport=Rr();F.loggers=new F.Container;var Ee=F.createLogger();Object.keys(F.config.npm.levels).concat(["log","query","stream","add","remove","clear","profile","startTimer","handleExceptions","unhandleExceptions","handleRejections","unhandleRejections","configure","child"]).forEach(r=>F[r]=(...e)=>Ee[r](...e));Object.defineProperty(F,"level",{get(){return Ee.level},set(r){Ee.level=r}});Object.defineProperty(F,"exceptions",{get(){return Ee.exceptions}});Object.defineProperty(F,"rejections",{get(){return Ee.rejections}});["exitOnError"].forEach(r=>{Object.defineProperty(F,r,{get(){return Ee[r]},set(e){Ee[r]=e}})});Object.defineProperty(F,"default",{get(){return{exceptionHandlers:Ee.exceptionHandlers,rejectionHandlers:Ee.rejectionHandlers,transports:Ee.transports}}});pt.deprecated(F,"setLevels");pt.forFunctions(F,"useFormat",["cli"]);pt.forProperties(F,"useFormat",["padLevels","stripColors"]);pt.forFunctions(F,"deprecated",["addRewriter","addFilter","clone","extend"]);pt.forProperties(F,"deprecated",["emitErrs","levelLength"])});var fr=c(ae=>{"use strict";var lf=ae&&ae.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ae,"__esModule",{value:!0});ae.logger=ae.DEFAULT_LOG_LEVEL=ae.LOG_LEVELS=void 0;var Ge=lf(nf()),A0=lf(require("util")),of=require("zod-validation-error");ae.LOG_LEVELS=["debug","info","warn","error"];ae.DEFAULT_LOG_LEVEL="info";function af(r,e){let{combine:t,printf:i,timestamp:n}=Ge.default.format,o="\x1B[0m",a="\x1B[32m",s="\x1B[33m",u="\x1B[31m",l=i(d=>{let{level:p,message:m,timestamp:_,...f}=d,g,E;switch(p){case"debug":g="d",E=g;break;case"info":g="i",E=r?g:`${a}${g}${o}`;break;case"warn":g="warn",E=r?g:`${s}${g}${o}`;break;case"error":g="error",E=r?g:`${u}${g}${o}`;break;default:g=`${p}:`,E=g}let P=" ".repeat(g.length+1),N=uf(m,e),v=f[Symbol.for("splat")]||[],T="";v.length>0&&(T=`
34
+ ${v.map(L=>uf(L,e)).join(`
35
+ `)}`);let q=N+T,U=String(q).replace(/\n/g,`
36
+ ${P}`);return r&&_?`${_} [${p.toUpperCase()}] ${U}`:`${E} ${U}
37
+ `});return r?t(n({format:"YYYY-MM-DD HH:mm:ss"}),l):t(l)}function T0(r){return Ge.default.format.printf(e=>{let{level:t,message:i,timestamp:n,...o}=e,a=cr(i,r),u=(o[Symbol.for("splat")]||[]).map(d=>cr(d,r)),l={timestamp:n||new Date().toISOString(),level:t.toUpperCase(),message:a};return u.length>0&&(u.length===1?l.meta=u[0]:l.meta=u),JSON.stringify(l,null,0)})}function sf(r,e){let t=[];for(let i of r)i.mode==="console"?t.push(new Ge.default.transports.Console({format:af(!1,i.showErrorStack)})):i.mode==="file"?e?t.push(new Ge.default.transports.File({filename:e,format:af(!0,i.showErrorStack),maxsize:10*1024*1024,maxFiles:5,tailable:!0})):console.warn("File output mode requested but no filename provided. Skipping file transport."):i.mode==="json"&&t.push(new Ge.default.transports.Console({format:Ge.default.format.combine(Ge.default.format.timestamp(),T0(i.showErrorStack))}));return t}var cr=(r,e)=>{if(r==null)return r;if(r instanceof Error){let t={message:r.message};return e&&r.stack&&(t.stack=r.stack),(0,of.isZodErrorLike)(r)&&(t.message=(0,of.fromError)(r).message),Object.keys(r).forEach(i=>{i!=="name"&&i!=="message"&&i!=="stack"&&(t[i]=cr(r[i],e))}),t.context&&(t.context=cr(t.context,e)),t}if(Array.isArray(r))return r.map(t=>cr(t,e));if(typeof r=="object"){let t={};for(let[i,n]of Object.entries(r))t[i]=cr(n,e);return t}return r},uf=(r,e)=>{try{if(typeof r=="string")return r;let t=cr(r,e);return A0.default.inspect(t,{colors:!1,depth:null,compact:!1,maxArrayLength:null,maxStringLength:null,customInspect:!0})}catch{return String(r)}},Lo=class r{constructor(){this.currentConfig=[],this.debug=(e,...t)=>{this.winstonLogger.debug(e,...t)},this.info=(e,...t)=>{this.winstonLogger.info(e,...t)},this.warn=(e,...t)=>{this.winstonLogger.warn(e,...t)},this.error=(e,...t)=>{this.winstonLogger.error(e,...t)},this.std=e=>{console.log(typeof e=="object"?JSON.stringify(e,null,2):e)},this.setLevel=e=>{ae.LOG_LEVELS.includes(e)?this.winstonLogger.level=e:(this.winstonLogger.warn(`Invalid log level: ${e}. Using '${ae.DEFAULT_LOG_LEVEL}' as default.`),this.winstonLogger.level=ae.DEFAULT_LOG_LEVEL)},this.getLevel=()=>this.winstonLogger.level,this.setOutputModes=(e,t)=>{let i=e.filter(o=>o.mode==="console"||o.mode==="file"||o.mode==="json");i.length===0&&this.winstonLogger.warn("No valid output modes provided."),this.currentConfig=i,this.winstonLogger.clear(),sf(i,t).forEach(o=>this.winstonLogger.add(o))},this.getOutputModes=()=>this.currentConfig,this.currentConfig=[{mode:"console",showErrorStack:!1}],this.winstonLogger=r.createWinstonLogger(this.currentConfig)}static createWinstonLogger(e){let t=sf(e);return Ge.default.createLogger({exitOnError:!0,level:ae.DEFAULT_LOG_LEVEL,transports:t})}},N0=new Lo;ae.logger=N0});var Co=c(dr=>{"use strict";Object.defineProperty(dr,"__esModule",{value:!0});dr.getIntroductoryOfferGroupingKey=ff;dr.getIntroductoryOfferGroupingDescription=df;dr.validateIntroductoryOffersGrouping=R0;dr.validateIntroductoryOffers=x0;dr.validateIntroductoryOfferAppleRestrictions=I0;var Ri=Zi(),M0=fr(),cf=jr();function ff(r){return r.type==="PAY_AS_YOU_GO"?`${r.type}_${r.numberOfPeriods}`:`${r.type}_${r.duration}`}function df(r){return r.type==="PAY_AS_YOU_GO"?`type '${r.type}' with numberOfPeriods '${r.numberOfPeriods}'`:`type '${r.type}' with duration '${r.duration}'`}function R0(r,e){let t=new Map;for(let i=0;i<r.length;i++){let n=r[i],o=ff(n),a=df(n);if(t.has(o)){let s=t.get(o);s.count++,s.indices.push(i);let u=s.indices;if(u.length<2){M0.logger.error(`Logic error: Expected at least 2 duplicate indices, but found ${u.length} for ${a} in subscription '${e||"unknown"}'`);continue}let l=u[0],d=u[1],p=e?` in subscription '${e}'`:"";return{success:!1,error:`Duplicate introductory offers found with ${a}${p}. Items at indices ${l} and ${d} have the same grouping criteria.`}}else t.set(o,{count:1,indices:[i]})}return{success:!0}}function x0(r,e,t){if(!t)return;let i=new Map;for(let n of t){if(n.type==="FREE_TRIAL"||n.type==="PAY_UP_FRONT"){if(!(0,Ri.isValidIntroductoryOfferDuration)(e,n.type,n.duration)){let o=(0,Ri.getValidIntroductoryOfferDurations)(e,n.type);throw new cf.ContextualError(`Invalid duration '${n.duration}' for ${n.type} offer in subscription '${r}' with period '${e}'.`,{subscriptionProductId:r,subscriptionPeriod:e,offer:n,validDurations:o})}}else if(n.type==="PAY_AS_YOU_GO"&&!(0,Ri.isValidPayAsYouGoPeriods)(e,n.numberOfPeriods)){let o=(0,Ri.getValidPayAsYouGoPeriods)(e);throw new cf.ContextualError(`Invalid numberOfPeriods '${n.numberOfPeriods}' for PAY_AS_YOU_GO offer in subscription '${r}' with period '${e}'.`,{subscriptionProductId:r,subscriptionPeriod:e,offer:n,validPeriods:o})}for(let o of n.availableTerritories){if(i.has(o))throw new Error(`Multiple introductory offers found for territory '${o}' in subscription '${r}'. Only one offer per territory is allowed.`);i.set(o,n)}}}function I0(r,e,t){if(!t||t.length===0)return;let i=e.availability&&e.availability.availableTerritories&&e.availability.availableTerritories.length>0,n=e.pricing&&e.pricing.prices&&e.pricing.prices.length>0;if(!i||!n)throw new Error(`Cannot create introductory offers for subscription '${r}'. Apple requires subscriptions to have both availability and pricing before introductory offers can be created.`)}});var Di=c(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.validateSubscriptionTerritoryPricing=D0;Ii.validateSubscription=L0;var xi=require("zod"),pf=Co();function D0(r,e){let t=r.pricing?.prices||[],i=r.availability,n=r.introductoryOffers||[];if(r.pricing&&!i){e.addIssue({code:xi.z.ZodIssueCode.custom,message:`Subscription '${r.productId}' has pricing defined but no availability. You need to set up availabilities first.`,path:["availability"]});return}if(n.length>0&&t.length===0){e.addIssue({code:xi.z.ZodIssueCode.custom,message:`Subscription '${r.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 L0(r,e){if(r.introductoryOffers&&r.introductoryOffers.length>0){let t=(0,pf.validateIntroductoryOffersGrouping)(r.introductoryOffers,r.productId);t.success||e.addIssue({code:xi.z.ZodIssueCode.custom,message:t.error||"Introductory offers must have unique type+duration or type+numberOfPeriods combinations",path:["introductoryOffers"]})}try{(0,pf.validateIntroductoryOffers)(r.productId,r.subscriptionPeriod,r.introductoryOffers)}catch(t){e.addIssue({code:xi.z.ZodIssueCode.custom,message:t instanceof Error?t.message:"Introductory offers validation failed",path:["introductoryOffers"]})}}});var Ci=c(b=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});b.AppStoreModelSchema=b.AppStoreLocalizationSchema=b.AppStoreAppInfoLocalizationSchema=b.AppStoreVersionLocalizationSchema=b.InAppPurchaseSchema=b.SubscriptionGroupSchema=b.SubscriptionSchema=b.PromotionalOfferSchema=b.IntroductoryOfferSchema=b.SubscriptionGroupLocalizationSchema=b.AvailabilitySchema=b.LocalizationSchema=b.PriceScheduleSchema=b.PriceSchema=b.AvailableTerritoriesSchema=b.SubscriptionOfferDurationSchema=b.SubscriptionPeriodSchema=b.APP_STORE_SCHEMA_VERSION=b.WORLDWIDE_TERRITORY_CODE=b.LocaleCodeSchema=b.TerritoryCodeSchema=void 0;var y=require("zod"),Li=wt();Object.defineProperty(b,"TerritoryCodeSchema",{enumerable:!0,get:function(){return Li.TerritoryCodeSchema}});var ht=Vi();Object.defineProperty(b,"LocaleCodeSchema",{enumerable:!0,get:function(){return ht.LocaleCodeSchema}});var qo=Ot(),C0=Di(),Re=fr();b.WORLDWIDE_TERRITORY_CODE="worldwide";var mt=64,$o=100;b.APP_STORE_SCHEMA_VERSION="1.0.0";b.SubscriptionPeriodSchema=y.z.enum(["ONE_WEEK","ONE_MONTH","TWO_MONTHS","THREE_MONTHS","SIX_MONTHS","ONE_YEAR"]);b.SubscriptionOfferDurationSchema=y.z.enum(["THREE_DAYS","ONE_WEEK","TWO_WEEKS","ONE_MONTH","TWO_MONTHS","THREE_MONTHS","SIX_MONTHS","ONE_YEAR"]);b.AvailableTerritoriesSchema=y.z.union([y.z.array(Li.TerritoryCodeSchema),y.z.literal(b.WORLDWIDE_TERRITORY_CODE)]);b.PriceSchema=y.z.object({price:y.z.string(),territory:Li.TerritoryCodeSchema});b.PriceScheduleSchema=y.z.object({baseTerritory:Li.TerritoryCodeSchema,prices:y.z.array(b.PriceSchema)}).refine(r=>r.prices.some(e=>e.territory===r.baseTerritory),{message:"The base territory must have a corresponding price in the prices array",path:["prices"]});b.LocalizationSchema=y.z.object({locale:ht.LocaleCodeSchema,name:y.z.string(),description:y.z.string()});b.AvailabilitySchema=y.z.object({availableInNewTerritories:y.z.boolean(),availableTerritories:b.AvailableTerritoriesSchema});b.SubscriptionGroupLocalizationSchema=y.z.object({locale:ht.LocaleCodeSchema,name:y.z.string(),customName:y.z.string().optional().nullable()}).superRefine((r,e)=>{r.customName&&r.customName.length>mt&&Re.logger.warn(`Warning: customName '${r.customName}' is ${r.customName.length} characters long, but should be at most 30 characters for optimal App Store display.`)});var q0=y.z.object({type:y.z.literal("PAY_AS_YOU_GO"),numberOfPeriods:y.z.number(),pricing:b.PriceScheduleSchema,availableTerritories:b.AvailableTerritoriesSchema}),$0=y.z.object({type:y.z.literal("PAY_UP_FRONT"),duration:b.SubscriptionOfferDurationSchema,pricing:b.PriceScheduleSchema,availableTerritories:b.AvailableTerritoriesSchema}),U0=y.z.object({type:y.z.literal("FREE_TRIAL"),duration:b.SubscriptionOfferDurationSchema,availableTerritories:b.AvailableTerritoriesSchema});b.IntroductoryOfferSchema=y.z.discriminatedUnion("type",[q0,$0,U0]);var F0=y.z.object({id:y.z.string(),referenceName:y.z.string(),type:y.z.literal("PAY_AS_YOU_GO"),numberOfPeriods:y.z.number(),pricing:b.PriceScheduleSchema}),j0=y.z.object({id:y.z.string(),referenceName:y.z.string(),type:y.z.literal("PAY_UP_FRONT"),duration:b.SubscriptionOfferDurationSchema,pricing:b.PriceScheduleSchema}),k0=y.z.object({id:y.z.string(),referenceName:y.z.string(),type:y.z.literal("FREE_TRIAL"),duration:b.SubscriptionOfferDurationSchema});b.PromotionalOfferSchema=y.z.discriminatedUnion("type",[F0,j0,k0]).superRefine((r,e)=>{r.referenceName.length>mt&&Re.logger.warn(`Warning: referenceName '${r.referenceName}' is ${r.referenceName.length} characters long, but should be at most 60 characters for optimal App Store display.`),r.id.length>$o&&Re.logger.warn(`Warning: productId '${r.id}' is ${r.id.length} characters long, but should be at most 100 characters for optimal App Store display.`)});b.SubscriptionSchema=y.z.object({productId:y.z.string().refine(qo.isValidProductId,{message:"Product ID can only contain alphanumeric characters, underscores, and periods"}),referenceName:y.z.string(),groupLevel:y.z.number(),subscriptionPeriod:b.SubscriptionPeriodSchema,familySharable:y.z.boolean(),reviewNote:y.z.string().optional(),pricing:b.PriceScheduleSchema.optional(),introductoryOffers:y.z.array(b.IntroductoryOfferSchema).optional(),promotionalOffers:y.z.array(b.PromotionalOfferSchema).optional(),availability:b.AvailabilitySchema.optional(),localizations:y.z.array(b.LocalizationSchema).optional()}).superRefine((r,e)=>{r.productId.length>$o&&Re.logger.warn(`Warning: productId '${r.productId}' is ${r.productId.length} characters long, but should be at most 100 characters for optimal App Store display.`),r.referenceName.length>mt&&Re.logger.warn(`Warning: referenceName '${r.referenceName}' is ${r.referenceName.length} characters long, but should be at most 60 characters for optimal App Store display.`)}).superRefine(C0.validateSubscription);b.SubscriptionGroupSchema=y.z.object({referenceName:y.z.string(),localizations:y.z.array(b.SubscriptionGroupLocalizationSchema),subscriptions:y.z.array(b.SubscriptionSchema)}).superRefine((r,e)=>{r.referenceName.length>mt&&Re.logger.warn(`Warning: referenceName '${r.referenceName}' is ${r.referenceName.length} characters long, but should be at most 60 characters for optimal App Store display.`)});b.InAppPurchaseSchema=y.z.object({productId:y.z.string().refine(qo.isValidProductId,{message:"Product ID can only contain alphanumeric characters, underscores, and periods"}),type:y.z.enum(["CONSUMABLE","NON_CONSUMABLE","NON_RENEWING_SUBSCRIPTION"]),referenceName:y.z.string(),familySharable:y.z.boolean(),reviewNote:y.z.string().optional(),pricing:b.PriceScheduleSchema.optional(),availability:b.AvailabilitySchema.optional(),localizations:y.z.array(b.LocalizationSchema).optional()}).superRefine((r,e)=>{r.productId.length>$o&&Re.logger.warn(`Warning: productId '${r.productId}' is ${r.productId.length} characters long, but should be at most 30 characters for optimal App Store display.`),r.referenceName.length>mt&&Re.logger.warn(`Warning: referenceName '${r.referenceName}' is ${r.referenceName.length} characters long, but should be at most 60 characters for optimal App Store display.`)});b.AppStoreVersionLocalizationSchema=y.z.object({description:y.z.string().optional(),keywords:y.z.string().optional(),marketingUrl:y.z.string().url().optional(),promotionalText:y.z.string().optional(),supportUrl:y.z.string().url().optional(),whatsNew:y.z.string().optional()});b.AppStoreAppInfoLocalizationSchema=y.z.object({name:y.z.string().optional(),subtitle:y.z.string().optional(),privacyPolicyUrl:y.z.string().url().optional(),privacyChoicesUrl:y.z.string().url().optional()});b.AppStoreLocalizationSchema=y.z.object({locale:ht.LocaleCodeSchema}).and(b.AppStoreAppInfoLocalizationSchema).and(b.AppStoreVersionLocalizationSchema).superRefine((r,e)=>{r.description&&r.description.length<10&&Re.logger.warn(`Warning: description for locale '${r.locale}' is ${r.description.length} characters long, but should be at least 10 characters.`)});b.AppStoreModelSchema=y.z.object({schemaVersion:y.z.string(),appId:y.z.string(),versionString:y.z.string().optional(),pricing:b.PriceScheduleSchema.optional(),availableTerritories:b.AvailableTerritoriesSchema.optional(),inAppPurchases:y.z.array(b.InAppPurchaseSchema).optional(),subscriptionGroups:y.z.array(b.SubscriptionGroupSchema).optional(),primaryLocale:ht.LocaleCodeSchema.optional(),localizations:y.z.array(b.AppStoreLocalizationSchema).optional(),copyright:y.z.string().optional()}).superRefine(qo.validateAppStoreModelData)});var mf=c(hf=>{"use strict";Object.defineProperty(hf,"__esModule",{value:!0})});var vf=c(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.PricingRequestSchema=Oe.PricingItemSchema=Oe.PricePointInfoSchema=Oe.PricingStrategySchema=void 0;var fe=require("zod"),gf=fe.z.enum(["apple","purchasingPower"]);Oe.PricingStrategySchema=gf;var yf=fe.z.object({id:fe.z.string(),price:fe.z.string()});Oe.PricePointInfoSchema=yf;var bf=fe.z.object({type:fe.z.enum(["app","inAppPurchase","subscription","offer"]),id:fe.z.string(),name:fe.z.string(),offerType:fe.z.string().optional(),parentName:fe.z.string().optional()});Oe.PricingItemSchema=bf;var z0=fe.z.object({appId:fe.z.string(),selectedItem:bf,basePricePoint:yf,pricingStrategy:gf,minimumPrice:fe.z.string().optional()});Oe.PricingRequestSchema=z0});var wf=c(_f=>{"use strict";Object.defineProperty(_f,"__esModule",{value:!0})});var Ef=c(Uo=>{"use strict";Object.defineProperty(Uo,"__esModule",{value:!0});Uo.validateAppStoreModel=V0;var H0=require("zod"),G0=fr(),Y0=Ci(),W0=Di(),B0=jr();function V0(r,e=!1,t="fetch"){let i=Y0.AppStoreModelSchema.safeParse(r);if(i.success){if(t==="apply"&&i.data.subscriptionGroups)for(let n of i.data.subscriptionGroups)for(let o of n.subscriptions){let a=[],s={addIssue:u=>{a.push(u)},path:[],value:o,issues:a};if((0,W0.validateSubscriptionTerritoryPricing)(o,s),a.length>0)throw new H0.z.ZodError(a)}return e&&G0.logger.info("\u2705 Validation passed! The JSON file format and structure are valid."),i.data}else throw new B0.ContextualError(`\u274C Validation failed for '${t}'!`,i.error)}});var Sf=c(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.useShortcuts=J0;Ui.removeShortcuts=Q0;var qi=wt(),K0=Ot(),Of=fr(),$i=Ci();function Fo(r){return r.toLowerCase()===$i.WORLDWIDE_TERRITORY_CODE.toLowerCase()}function jo(r){return(0,K0.deepEqualUnordered)(r,qi.territoryCodes)}function J0(r){if(!r||typeof r!="object")return r;let e=ko(r);return e=Z0(e),e}function ko(r){if(!r||typeof r!="object")return r;let e={...r};return e.availableTerritories&&Array.isArray(e.availableTerritories)&&jo(e.availableTerritories)&&(e.availableTerritories=$i.WORLDWIDE_TERRITORY_CODE),e.availability&&typeof e.availability=="object"&&e.availability.availableTerritories&&Array.isArray(e.availability.availableTerritories)&&jo(e.availability.availableTerritories)&&(e.availability.availableTerritories=$i.WORLDWIDE_TERRITORY_CODE),Array.isArray(e.introductoryOffers)&&(e.introductoryOffers=e.introductoryOffers.map(t=>{let i={...t};return i.availableTerritories&&Array.isArray(i.availableTerritories)&&jo(i.availableTerritories)&&(i.availableTerritories=$i.WORLDWIDE_TERRITORY_CODE),i})),Array.isArray(e.inAppPurchases)&&(e.inAppPurchases=e.inAppPurchases.map(t=>ko(t))),Array.isArray(e.subscriptionGroups)&&(e.subscriptionGroups=e.subscriptionGroups.map(t=>{let i={...t};return Array.isArray(i.subscriptions)&&(i.subscriptions=i.subscriptions.map(n=>ko(n))),i})),e}function Z0(r){if(!r||typeof r!="object")return r;let e={...r};return Array.isArray(e.localizations)&&e.primaryLocale&&(e.localizations=X0(e.localizations,e.primaryLocale)),e}function X0(r,e){if(!e)return r;let t=r.find(n=>n.locale===e);if(!t)return r;let i=r.map(n=>{if(n.locale===e)return n;let o={locale:n.locale};return Object.keys(n).filter(s=>s!=="locale").forEach(s=>{let u=s;n[u]!==t[u]&&(o[u]=n[u])}),o});return Of.logger.debug(`Optimized ${r.length} localizations to avoid duplicates with primary locale: ${e}`),i}function Q0(r){if(!r||typeof r!="object")return r;let e=ev(r);return e=zo(e),e}function zo(r){if(!r||typeof r!="object")return r;let e={...r};return e.availableTerritories&&typeof e.availableTerritories=="string"&&Fo(e.availableTerritories)&&(e.availableTerritories=[...qi.territoryCodes]),e.availability&&typeof e.availability=="object"&&e.availability.availableTerritories&&typeof e.availability.availableTerritories=="string"&&Fo(e.availability.availableTerritories)&&(e.availability.availableTerritories=[...qi.territoryCodes]),Array.isArray(e.introductoryOffers)&&(e.introductoryOffers=e.introductoryOffers.map(t=>{let i={...t};return i.availableTerritories&&typeof i.availableTerritories=="string"&&Fo(i.availableTerritories)&&(i.availableTerritories=[...qi.territoryCodes]),i})),Array.isArray(e.inAppPurchases)&&(e.inAppPurchases=e.inAppPurchases.map(t=>zo(t))),Array.isArray(e.subscriptionGroups)&&(e.subscriptionGroups=e.subscriptionGroups.map(t=>{let i={...t};return Array.isArray(i.subscriptions)&&(i.subscriptions=i.subscriptions.map(n=>zo(n))),i})),e}function ev(r){if(!r||typeof r!="object")return r;let e={...r};return Array.isArray(e.localizations)&&e.primaryLocale&&(e.localizations=rv(e.localizations,e.primaryLocale)),e}function rv(r,e){if(!e)return r;let t=r.find(n=>n.locale===e);if(!t)return r;let i=r.map(n=>{if(n.locale===e)return n;let o={...t,locale:n.locale};return Object.keys(n).forEach(a=>{if(a!=="locale"){let s=a;o[s]=n[s]}}),o});return Of.logger.debug(`Deoptimized ${r.length} localizations to restore full data with primary locale: ${e}`),i}});var Ho=c(Cr=>{"use strict";Object.defineProperty(Cr,"__esModule",{value:!0});Cr.DEFAULT_CONFIG_FILENAME=Cr.BASE_TERRITORY=void 0;Cr.BASE_TERRITORY="USA";Cr.DEFAULT_CONFIG_FILENAME="storeconfig.json"});var Pf=c(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});Go.collectPricingItems=tv;function tv(r){let e=[];return e.push({type:"app",id:r.appId,name:"App"}),r.inAppPurchases&&r.inAppPurchases.forEach(t=>{e.push({type:"inAppPurchase",id:t.productId,name:t.referenceName})}),r.subscriptionGroups&&r.subscriptionGroups.forEach(t=>{t.subscriptions.forEach(i=>{e.push({type:"subscription",id:i.productId,name:i.referenceName}),i.introductoryOffers&&i.introductoryOffers.filter(n=>n.type!=="FREE_TRIAL").forEach(n=>{e.push({type:"offer",id:i.productId,name:`${n.type} Introductory Offer`,offerType:n.type,parentName:i.referenceName})}),i.promotionalOffers&&i.promotionalOffers.filter(n=>n.type!=="FREE_TRIAL").forEach(n=>{e.push({type:"offer",id:n.id,name:`${n.type} Promotional Offer`,offerType:n.type,parentName:i.referenceName})})})}),e}});var Mf=c(xe=>{"use strict";var iv=xe&&xe.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,i,n)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),nv=xe&&xe.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Nf=xe&&xe.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var i=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(i[i.length]=n);return i},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=r(e),n=0;n<i.length;n++)i[n]!=="default"&&iv(t,e,i[n]);return nv(t,e),t}})();Object.defineProperty(xe,"__esModule",{value:!0});xe.validateFileExists=sv;var ov=Nf(require("fs")),Af=Nf(require("path")),Tf=fr(),av=Ho();function sv(r,e={}){let{defaultFilename:t=av.DEFAULT_CONFIG_FILENAME,fileDescription:i="JSON file",resolution:n=`Please either:
38
+ 1. Create a ${t} file in the current directory, or
39
+ 2. Specify a ${i} using the --file or -f option`}=e,o;return r&&r.trim()!==""?o=Af.resolve(r):o=Af.resolve(process.cwd(),t),ov.existsSync(o)||(Tf.logger.error(`File not found: ${o}`),(!r||r.trim()==="")&&Tf.logger.info(`No file specified and default file ${t} not found in current directory.
40
+ `+n),process.exit(1)),o}});var C=c(k=>{"use strict";var uv=k&&k.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,i,n)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),X=k&&k.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&uv(e,r,t)};Object.defineProperty(k,"__esModule",{value:!0});X(Ci(),k);X(wt(),k);X(Vi(),k);X(mf(),k);X(vf(),k);X(wf(),k);X(Ot(),k);X(Di(),k);X(Co(),k);X(Zi(),k);X(jr(),k);X(Ef(),k);X(Sf(),k);X(Ho(),k);X(Pf(),k);X(Mf(),k);X(fr(),k)});var Cd=S(require("dotenv")),qd=S(require("yargs")),$d=require("yargs/helpers"),gr=S(C());var qr=S(C()),Rf=S(C()),xf=S(C()),If=S(C()),lv={command:"validate-format",describe:"Validate the JSON file format and structure",builder:{file:{alias:"f",describe:`Path to the JSON file. Defaults to ${qr.DEFAULT_CONFIG_FILENAME} in current directory.`,demandOption:!1,type:"string"}},handler:r=>{let e=(0,qr.validateFileExists)(r.file,{fileDescription:"JSON file"});try{(0,If.validateAppStoreModel)((0,xf.removeShortcuts)((0,qr.readJsonFile)(e)),!0,"fetch")}catch(t){Rf.logger.error(t),process.exit(1)}}},Df=lv;var De=S(C());var Lf=S(C()),Cf=S(C()),Fi=S(C());function $r(r){return r===Fi.WORLDWIDE_TERRITORY_CODE?!0:(0,Fi.deepEqualUnordered)(r,Cf.territoryCodes)}function pr(r){return r.map(e=>`${e.territory}: $${e.price}`).join(", ")}async function cv(r){let e="",t="";switch(r.type){case"UPDATE_APP_AVAILABILITY":let i=r.payload.desiredTerritories,n=$r(i);e="Updating app availability",t=n?"worldwide":`${Array.isArray(i)?i.length:1} territories`;break;case"UPDATE_IN_APP_PURCHASE":let o=JSON.stringify(r.payload.changes);e=`Updating in-app purchase "${r.payload.productId}"`,t=o;break;case"UPDATE_IAP_AVAILABILITY":let a=r.payload.availability.availableTerritories,s=$r(a);e=`Updating IAP "${r.payload.productId}" availability`,t=s?"worldwide":`${Array.isArray(a)?a.length:1} territories`;break;case"UPDATE_IAP_PRICING":let u=r.payload.pricing,l=pr(u.prices);e=`Updating IAP "${r.payload.productId}" pricing`,t=l;break;case"CREATE_SUBSCRIPTION":let d=r.payload.subscription,p=d.pricing?pr(d.pricing.prices):"No pricing set",m=d.availability?.availableTerritories,f=(m?$r(m):!1)?"worldwide":m?`${Array.isArray(m)?m.length:1} territories`:"No territories set";e=`Creating subscription "${d.productId}" (${d.referenceName}) in group "${r.payload.groupReferenceName}"`,t=`Period: ${d.subscriptionPeriod}, Pricing: ${p}, Territories: ${f}`;break;case"UPDATE_SUBSCRIPTION_AVAILABILITY":let g=r.payload.availability.availableTerritories,E=$r(g);e=`Updating subscription "${r.payload.subscriptionProductId}" availability`,t=E?"worldwide":`${Array.isArray(g)?g.length:1} territories`;break;case"CREATE_SUBSCRIPTION_PRICE":let P=r.payload.desiredPriceSchedule,N=pr(P.prices);e=`Creating subscription price for "${r.payload.subscriptionProductId}"`,t=N;break;case"CREATE_INTRODUCTORY_OFFER":let v=r.payload.offer,T=v.type==="FREE_TRIAL"?"Free trial":pr(v.pricing.prices),q=v.availableTerritories,D=$r(q)?"worldwide":`${Array.isArray(q)?q.length:1} territories`;e=`Creating introductory offer for subscription "${r.payload.subscriptionProductId}"`,t=`Type: ${v.type}, Period: ${r.payload.subscriptionPeriod}, Pricing: ${T}, Territories: ${D}`;break;case"CREATE_IN_APP_PURCHASE":let L=r.payload.inAppPurchase,x=L.pricing?pr(L.pricing.prices):"No pricing set",j=L.availability?.availableTerritories,W=(j?$r(j):!1)?"worldwide":j?`${Array.isArray(j)?j.length:1} territories`:"No territories set";e=`Creating in-app purchase "${L.productId}" (${L.referenceName})"`,t=`Type: ${L.type}, Pricing: ${x}, Territories: ${W}`;break;case"UPDATE_APP_PRICING":let ee=r.payload.pricing,re=pr(ee.prices);e="Updating app pricing",t=re;break;case"UPDATE_APP_DETAILS":let Le=JSON.stringify(r.payload);e="Updating app details",t=Le;break;case"UPDATE_VERSION_METADATA":let h=JSON.stringify(r.payload);e="Updating version metadata",t=h;break;case"CREATE_APP_LOCALIZATION":let w=r.payload.localization;e="Creating app localization",t=w.locale;break;case"UPDATE_APP_LOCALIZATION":let $=r.payload;e="Updating app localization",t=$.locale;break;case"DELETE_APP_LOCALIZATION":e="Deleting app localization",t=r.payload.locale;break;case"CREATE_SUBSCRIPTION_GROUP":let Q=r.payload.group;e="Creating subscription group",t=`"${Q.referenceName}"`;break;case"UPDATE_SUBSCRIPTION_GROUP":let A=r.payload,de=JSON.stringify(r.payload.changes||{});e=`Updating subscription group "${A.referenceName}"`,t=de;break;case"CREATE_SUBSCRIPTION_GROUP_LOCALIZATION":let Pe=r.payload.localization;e="Creating subscription group localization",t=Pe.locale;break;case"UPDATE_SUBSCRIPTION_GROUP_LOCALIZATION":let We=r.payload,yr=JSON.stringify(r.payload.changes||{});e=`Updating subscription group localization for ${We.locale}`,t=yr;break;case"DELETE_SUBSCRIPTION_GROUP_LOCALIZATION":e="Deleting subscription group localization",t=r.payload.locale;break;case"UPDATE_SUBSCRIPTION":let yt=r.payload,br=JSON.stringify(r.payload.changes||{});e=`Updating subscription "${yt.productId}"`,t=br;break;case"CREATE_SUBSCRIPTION_LOCALIZATION":let Yi=r.payload.localization;e="Creating subscription localization",t=Yi.locale;break;case"UPDATE_SUBSCRIPTION_LOCALIZATION":let ue=r.payload,bt=JSON.stringify(r.payload.changes||{});e=`Updating subscription localization for ${ue.locale}`,t=bt;break;case"DELETE_SUBSCRIPTION_LOCALIZATION":e="Deleting subscription localization",t=r.payload.locale;break;case"CREATE_IAP_LOCALIZATION":let Wi=r.payload.localization;e="Creating IAP localization",t=Wi.locale;break;case"UPDATE_IAP_LOCALIZATION":let vt=r.payload,_t=JSON.stringify(r.payload.changes||{});e=`Updating IAP localization for ${vt.locale}`,t=_t;break;case"DELETE_IAP_LOCALIZATION":e="Deleting IAP localization",t=r.payload.locale;break;case"DELETE_INTRODUCTORY_OFFER":e="Deleting introductory offer",t=`subscription "${r.payload.subscriptionProductId}"`;break;case"CREATE_PROMOTIONAL_OFFER":let Ae=r.payload.offer,vr=Ae.type==="FREE_TRIAL"?"Free trial":pr(Ae.pricing.prices);e=`Creating promotional offer "${Ae.referenceName}" for subscription "${r.payload.subscriptionProductId}"`,t=`Type: ${Ae.type}, Pricing: ${vr}`;break;case"DELETE_PROMOTIONAL_OFFER":e="Deleting promotional offer",t=`"${r.payload.offerId}" subscription "${r.payload.subscriptionProductId}"`;break;default:e="Unknown action type",t=r.type;break}Lf.logger.info(`${e}
41
+ ${t}`)}async function qf(r){for(let e of r)await cv(e)}var Hf=S(C()),Gf=S(C()),Yf=S(C());var Bo=S(require("axios"));var Ie=S(require("fs")),Yo=S(require("path")),$f=S(require("os")),hr=S(C()),Wo=class{constructor(e){this.keyPath=e??Yo.default.join($f.default.homedir(),".storeconfig","key")}getKeyPath(){return this.keyPath}saveKey(e){try{let t=Yo.default.dirname(this.keyPath);Ie.default.existsSync(t)||Ie.default.mkdirSync(t,{recursive:!0}),Ie.default.writeFileSync(this.keyPath,e,"utf8"),hr.logger.debug(`Secret key saved to ${this.keyPath}`)}catch(t){throw new hr.ContextualError("Failed to save secret key",t)}}loadKey(){try{return Ie.default.existsSync(this.keyPath)?Ie.default.readFileSync(this.keyPath,"utf8").trim():null}catch(e){throw new hr.ContextualError("Failed to load secret key file",e)}}hasKey(){return Ie.default.existsSync(this.keyPath)}deleteKey(){try{Ie.default.existsSync(this.keyPath)&&(Ie.default.unlinkSync(this.keyPath),hr.logger.debug(`Secret key deleted from ${this.keyPath}`))}catch(e){throw new hr.ContextualError("Failed to delete secret key",e)}}},gt=new Wo;var Uf=S(C()),Y=Bo.default.create({baseURL:process.env.API_BASE_URL||"http://localhost:3000",timeout:3e4,headers:{"Content-Type":"application/json"}});Y.interceptors.request.use(r=>{let e=gt.loadKey();return e&&(r.headers["X-StoreConfig-ApiKey"]=e),r},r=>Promise.reject(r));Y.interceptors.response.use(r=>r,r=>{if(Bo.default.isAxiosError(r)&&r.response?.data&&r.response.status){let e=r.response.status,t=r.response.data?.message||`API request failed with status ${e}`,i=r.response.data?.details;throw new Uf.ContextualError(t,i)}throw r});var fv=()=>gt.hasKey(),Ff=()=>{if(!fv())throw new Error("Authentication required. Please run 'storeconfig configure' first to set up your secret key")};var dv=5e3,jf=async(r,e,t)=>{let i=-1;for(;;){let{status:n,currentActionIndex:o,currentAction:a,totalActions:s,error:u}=(await pv(r)).data;if(o!==i){t&&o!==i+1&&i>=0&&await hv(t,i+1,o,e);let l=kf(a),d=`Processing action [${o+1}/${s}] ${l}`;e.text=d,i=o}if(n==="completed"){e.succeed("Actions completed successfully");return}if(n==="failed"){let l=`Actions ID '${r}'`;throw u&&(l+=`
42
+ ${u}`),new Error(l)}await new Promise(l=>setTimeout(l,dv))}},pv=async r=>(await Y.get(`/status/${r}`)).data,kf=r=>r?r.type:"Unknown Action",hv=async(r,e,t,i)=>{let n=Math.max(0,e),o=Math.min(r.length,t);for(let a=n;a<o;a++){let s=r[a],u=r.length;if(s){let l=kf(s),d=`Processing action [${a+1}/${u}] ${l}`;i.text=d,await new Promise(p=>setTimeout(p,500))}}};var ki=S(C()),Vo=S(require("inquirer"));var ji=async()=>(await Y.get("/info")).data.data;var zf=async(r,e,t,i=!1,n)=>{let o=await gv();if(o){let u=await mv(o,n);if(u)return{jobId:u,newJobCreated:!1}}return await vv()?(n.start("Processing actions..."),{jobId:(await Y.post("/apply",{plan:r,currentState:e,desiredState:t,dryRun:i})).data.data,newJobCreated:!0}):(ki.logger.warn("Operation cancelled by user"),null)},mv=async(r,e)=>await yv(r)?(e.start(`Tracking progress of ongoing actions with ID: ${r}`),r):(ki.logger.warn("Operation cancelled by user - cannot create new actions while already processing actions"),null),gv=async()=>{let r=await ji(),{currentJob:e}=r;return e&&(e.status==="pending"||e.status==="processing")?e.id:null},yv=async r=>{let{watchOngoing:e}=await Vo.default.prompt([{type:"confirm",name:"watchOngoing",message:`You already have ongoing actions with ID: (${r}). No new actions will be created until the ongoing actions are completed. Would you like to track the ongoing actions?`,default:!0}]);return e},bv=`
43
+ \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
44
+ \u2502 \u26A0\uFE0F CRITICAL WARNING \u2502
45
+ \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
46
+ \u2502 You are about to apply changes directly to App Store \u2502
47
+ \u2502 Connect. These changes will take effect immediately. \u2502
48
+ \u2502 \u2502
49
+ \u2502 Some operations are inherently irreversible \u2014 even if \u2502
50
+ \u2502 performed manually through App Store Connect. \u2502
51
+ \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
52
+ `,vv=async()=>{ki.logger.std(bv);let{confirmed:r}=await Vo.default.prompt([{type:"confirm",name:"confirmed",message:"Do you want to proceed with applying these changes?",default:!1}]);return r};var Wf=S(require("ora")),_v=`
53
+ \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
54
+ \u2502 This may take up to 30 minutes depending on the changes. \u2502
55
+ \u2502 Processing continues on our servers even if CLI is closed. \u2502
56
+ \u2502 You can rerun the same command to check current status. \u2502
57
+ \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
58
+
59
+ `,wv={command:"apply",describe:"Apply the changes to App Store Connect",builder:{file:{alias:"f",describe:`Path to the desired state JSON file. Defaults to ${De.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 r=>{let e=r.preview,t=process.env.dryRun==="true",i=(0,De.validateFileExists)(r.file,{fileDescription:"desired state JSON file"});De.logger.debug(`Processing desired state from ${i}...`),t&&De.logger.debug("Dry run mode enabled - no actual changes will be applied to App Store Connect");let n=(0,Wf.default)("Generating actions...").start();try{let o=(0,Gf.validateAppStoreModel)((0,Yf.removeShortcuts)((0,Hf.readJsonFile)(i)),!1,"apply"),a=await Y.post("/diff",{desiredState:o}),{plan:s,currentState:u}=a.data.data;if(s.length===0){n.succeed("No changes to apply. Your configuration is up to date. Exiting...");return}if(n.stop(),await qf(s),e){De.logger.info("Preview mode - no changes will be applied");return}let l=await zf(s,u,o,t,n);if(l){let{jobId:d,newJobCreated:p}=l;n.prefixText=_v,await jf(d,n,p?s:void 0)}}catch(o){n.stop(),De.logger.error("Apply failed",o),process.exit(1)}}},Bf=wv;var Ur=S(C()),Vf=S(require("fs")),Kf=S(require("inquirer"));var Jf=S(require("ora"));async function Ev(){return(await Y.get("/fetch-apps")).data.data}async function Ov(r){let e=r.map((i,n)=>({name:`${n+1}. ${i.name}`,value:i})),{selectedApp:t}=await Kf.default.prompt([{type:"list",name:"selectedApp",message:"Select the app you want to fetch:",choices:e}]);return Ur.logger.info(`Selected: ${t.name} (ID: ${t.id})`),t.id}var Sv={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 ${Ur.DEFAULT_CONFIG_FILENAME} in current directory.`,demandOption:!1,type:"string"}},handler:async r=>{let e=r.id,t=r.file||Ur.DEFAULT_CONFIG_FILENAME,i=(0,Jf.default)();try{if(!e){i.start("No app ID provided. Fetching available apps...");let a=await Ev();a.length===0&&(i.fail("No IOS apps found in your App Store Connect account"),process.exit(1)),i.stop(),e=await Ov(a)}i.start(`Fetching details for app ID: ${e} and writing to ${t}`);let o=(await Y.post("/fetch",{appId:e})).data.data;Vf.writeFileSync(t,JSON.stringify(o,null,2)),i.succeed(`Successfully fetched app: ${t}`)}catch(n){i.stop(),Ur.logger.error("Fetch failed",n),process.exit(1)}}},Zf=Sv;var dd=S(require("fs")),Se=S(C()),pd=S(C()),hd=S(C());var ed=S(require("inquirer")),zi=S(C());function Xf(r){switch(r){case"inAppPurchase":return"In App Purchase";case"subscription":return"Subscription";case"offer":return"Offer";case"app":return"App"}}function Qf(r){if(r.type!=="offer"||!r.offerType)return`"${r.name}"`;let e=r.offerType.replace(/_/g," ").toLowerCase();return`"${e.charAt(0).toUpperCase()+e.slice(1)}" | belongs to "${r.parentName}"`}async function Pv(r){let e=r.map((n,o)=>{let a=`"${n.name}"`;return n.type==="offer"&&(a=Qf(n)),{name:`${Xf(n.type)}: ${a} (ID: ${n.id})`,value:n}}),{selectedItem:t}=await ed.default.prompt([{type:"list",name:"selectedItem",message:"Select an item:",choices:e}]),i=t.type==="offer"?Qf(t):`"${t.name}"`;return zi.logger.info(`\u2705 Selected: ${Xf(t.type)}: ${i} (ID: ${t.id})`),t}async function rd(r,e=zi.collectPricingItems,t=Pv){let i=e(r);if(i.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(i)}var id=S(require("inquirer")),nd=S(C());function td(r){let e=r.trim();if(!/^\d+(\.\d{1,2})?$/.test(e))return null;let t=Number(e);return!isFinite(t)||t<0?null:t}function Av(r,e,t){return e.map(n=>({price:n,diff:Math.abs(Number(n)-r)})).sort((n,o)=>n.diff-o.diff).slice(0,Math.max(0,t)).map(n=>n.price).sort((n,o)=>Number(n)-Number(o))}async function od(r,e,t){let i;i=await t(r,e.appId,nd.BASE_TERRITORY);let n=Array.from(new Set((i||[]).map(p=>({id:p.id,price:Number(p.price)})).filter(p=>Number.isFinite(p.price)&&p.price>=0).map(p=>({id:p.id,price:p.price.toFixed(2)})))).sort((p,m)=>Number(p.price)-Number(m.price));if(!i.length)throw new Error("No available Apple price points found. This is unexpected. Please try again.");let o=p=>{let m=td(p);if(m===null)return"\u274C Invalid format. Please enter a non-negative number with up to 2 decimals (e.g., 5.99).";let _=m.toFixed(2);if(n.length&&!n.some(f=>f.price===_)){let f=Av(m,n.map(E=>E.price),20),g=`\u274C The price ${_} is not an available Apple price.`;return f.length&&(g+=`
60
+ Closest available prices:
61
+ ${f.join(" | ")}`),g}return!0},{price:a}=await id.default.prompt([{type:"input",name:"price",message:"Enter base price in USD (e.g., 5.99):",validate:o}]),u=td(a).toFixed(2),l=n.find(p=>p.price===u),d=i.find(p=>p.id===l?.id);if(d)return d;throw new Error(`Price point not found for price ${u}`)}var ad=S(require("inquirer"));async function sd(){let{strategy:r}=await ad.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 r}var ud=S(require("inquirer")),ld=S(C());async function cd(r,e){if(r==="apple")return;let t="=".repeat(50),i=["Enter optional Minimum Price in USD so that no price is below this threshold."];ld.logger.info(`
62
+ ${t}
63
+ ${i.join(`
64
+ `)}
65
+ ${t}`);let n=s=>{let u=s.trim();if(u==="")return!0;let l=parseFloat(u);if(isNaN(l)||l<0)return"\u274C Invalid price. Please enter a non-negative number or press Enter to skip.";let d=parseFloat(e);return l>=d?`\u274C Minimum price (${u}) must be less than base price (${e}). Please enter a lower value or press Enter to skip.`:!0},{minimumPrice:o}=await ud.default.prompt([{type:"input",name:"minimumPrice",message:"Minimum price in USD (optional, press Enter to skip):",validate:n}]),a=o.trim();return a===""?void 0:a}async function fd(r){let{appStoreState:e,fetchTerritoryPricePointsForSelectedItem:t}=r,i=await rd(e),n=await od(i,e,t),o=await sd(),a=await cd(o,n.price);return{appId:e.appId,selectedItem:{type:i.type,id:i.id,name:i.name,offerType:i.offerType},basePricePoint:n,pricingStrategy:o,minimumPrice:a}}var Hi=S(C());var md=S(require("ora"));async function Tv(r,e,t){return(await Y.post("/price-points",{selectedItem:r,appId:e,territoryId:t})).data.data.pricePoints}async function Nv(r,e){return(await Y.post("/apply-pricing",{appStoreState:r,pricingRequest:e})).data.data.updatedState}var Mv={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 ${Se.DEFAULT_CONFIG_FILENAME} in current directory.`,demandOption:!1,type:"string"}},handler:async r=>{Se.logger.warn("this command will be available soon")}},gd=Mv;var se=S(C());var yd=S(require("fs"));function Rv(r){return r.item.name}var xv=["Territory","Local Price","Local Currency","USD Price","Relative to USA (%)"];function Iv(r,e){let t=[];t.push(["Name",...xv].join(",")),r.forEach(n=>{n.prices.forEach(o=>{t.push(`${Rv(n)},${o.territory},${o.localPrice},${o.localCurrency},${o.usdPrice.toFixed(2)},${o.usdPercentage.toFixed(0)}`)})});let i=t.join(`
66
+ `);yd.writeFileSync(e,i,"utf8")}function bd(r,e){let t=e.toLowerCase().split(".").pop();if(!t||t!=="csv")throw new Error(`Unsupported file format. Please use ".csv" extension: "${e}"`);Iv(r,e)}var Dv={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 ${se.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 r=>{se.logger.warn("this command will be available soon")}},vd=Dv;var mr=S(C()),wd=S(require("inquirer")),Ed=S(require("fs")),Od=S(require("path")),Lv=[{key:"minimal",name:"Minimal App"},{key:"full",name:"Full App"},{key:"subscription",name:"Subscription"},{key:"in-app-purchase",name:"In-App Purchase"}];function _d(r){let e=Od.parse(r),t=e.ext,i=e.name;return t?`${i}_example${t}`:`${r}_example`}async function Cv(){let r=Lv.map((t,i)=>({name:`${i+1}. ${t.name}`,value:t.key})),{selectedType:e}=await wd.default.prompt([{type:"list",name:"selectedType",message:"Select the example type you want to generate:",choices:r}]);return e}var Sd=[{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"}]}],qv={referenceName:"Premium Subscriptions",localizations:[{locale:"en-US",name:"Premium Subscriptions"},{locale:"es-ES",name:"Suscripciones Premium"}],subscriptions:Sd},Ko=[{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"}]}],Pd={schemaVersion:"1.0.0",appId:"1234567890",versionString:"2.1.17",pricing:{baseTerritory:"USA",prices:[{price:"0.99",territory:"USA"}]},availableTerritories:"worldwide",inAppPurchases:Ko,subscriptionGroups:[qv],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"},$v={...Pd,pricing:{baseTerritory:"USA",prices:[{price:"0.0",territory:"USA"}]},inAppPurchases:void 0,subscriptionGroups:void 0},Uv={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 ${_d(mr.DEFAULT_CONFIG_FILENAME)} in current directory.`,demandOption:!1,type:"string"}},handler:async r=>{let e=r.type,t=r.file||_d(mr.DEFAULT_CONFIG_FILENAME);e||(e=await Cv());let n={minimal:$v,full:Pd,subscription:Sd,iap:Ko,"in-app-purchase":Ko}[e];n||(mr.logger.error(`Unknown example type: ${e}`),process.exit(1));try{Ed.writeFileSync(t,JSON.stringify(n,null,2)),mr.logger.info(`Successfully generated example and wrote to ${t}`)}catch(o){mr.logger.error("Failed to write example file",o),process.exit(1)}}},Ad=Uv;var Gi=S(C());var Td=S(require("inquirer"));async function Nd(){let{secretKey:r}=await Td.default.prompt([{type:"password",name:"secretKey",message:"Enter your StoreConfig Secret Key:",mask:"*"}]);return r.trim()}var Fv={command:"configure",describe:"Configure StoreConfig with the Secret Key",handler:async r=>{try{let e=await Nd();e||(Gi.logger.error("Secret key cannot be empty"),process.exit(1)),gt.saveKey(e),Gi.logger.info("\u2705 Secret key saved successfully! Add Apple credentials now (storeconfig apple) if you haven't already.")}catch(e){Gi.logger.error("Failed to configure secret key",e),process.exit(1)}}},Md=Fv;var Id=S(C());var Rd=S(require("fs")),Ye=S(C());var Jo=class{constructor(){}async configureAppleCredentials(e,t,i){(0,Ye.validateFileExists)(i,{fileDescription:"Apple private key (.p8 file)"});let n=this.readPrivateKeyFile(i);this.validatePrivateKey(n),Ye.logger.info("Sending Apple credentials to backend..."),await this.sendCredentialsToBackend(e,t,n),Ye.logger.info("\u2705 Apple credentials stored successfully!")}readPrivateKeyFile(e){try{return Rd.default.readFileSync(e,"utf8")}catch(t){throw new Ye.ContextualError(`Failed to read private key file at ${e}`,t)}}validatePrivateKey(e){if(!e.includes("BEGIN PRIVATE KEY")&&!e.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(e,t,i){let n=await Y.post("/auth",{keyId:t,issuerId:e,privateKey:i});n.data.message&&Ye.logger.info(n.data.message)}},xd=new Jo;var jv={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 r=>{try{let e=r["issuer-id"],t=r["key-id"],i=r["key-path"];await xd.configureAppleCredentials(e,t,i)}catch(e){Id.logger.error("Failed to add Apple credentials",e),process.exit(1)}}},Dd=jv;var Zo=S(C());var kv={command:"user",describe:"Display current user information and latest job status",builder:{},handler:async()=>{try{let r=await ji(),e="";e+=`Email \u2192 ${r.user.email}`,r.currentJob&&(e+=`
67
+ Latest Actions \u2192 ID: ${r.currentJob.id}, Status: ${r.currentJob.status}`,r.currentJob.error&&(e+=`
68
+ Error: ${r.currentJob.error}`)),Zo.logger.std(e)}catch(r){Zo.logger.error("Failed to fetch user information",r),process.exit(1)}}},Ld=kv;process.env.DOTENV_CONFIG_SILENT="true";Cd.default.config();gr.logger.setOutputModes([{mode:"console",showErrorStack:!1}]);gr.logger.setLevel("info");(0,qd.default)((0,$d.hideBin)(process.argv)).middleware(r=>{let e=["fetch","apply","set-price","compare-price","apple","user"],t=r._[0];if(e.includes(t))try{Ff()}catch(i){gr.logger.error("Authentication required",i),process.exit(1)}}).command(Df).command(Bf).command(Zf).command(gd).command(vd).command(Ad).command(Md).command(Dd).command(Ld).demandCommand(1,"Please specify a command").strict().fail((r,e,t)=>{e?gr.logger.error(e.message):gr.logger.error(r),gr.logger.std(`
69
+ `+t.help()),process.exit(1)}).help().argv;
70
+ /*! Bundled license information:
71
+
72
+ safe-buffer/index.js:
73
+ (*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
74
+ */
75
+ //# sourceMappingURL=cli.js.map