agentica 0.24.0 → 0.26.0

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.
Files changed (3) hide show
  1. package/README.md +56 -17
  2. package/dist/index.mjs +79 -77
  3. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -1,96 +1,98 @@
1
- import ae,{stdin as Si,stdout as Oi}from"node:process";import{promisify as Ri}from"node:util";import*as qe from"node:readline";import Bi from"node:readline";import{WriteStream as yr}from"node:tty";import xe from"events";import br from"child_process";import De from"path";import ge from"fs";import xi from"process";import Se,{existsSync as ot}from"node:fs";import Oe,{rm as _r,appendFile as wr,readFile as at,writeFile as ht}from"node:fs/promises";import we,{join as be}from"node:path";import{exec as vr}from"node:child_process";import Ar from"node:os";import{pipeline as Sr}from"node:stream";import Ti from"stream";import $i from"string_decoder";import lt from"assert";import Or from"buffer";import Ni from"zlib";import Rr from"util";import Br from"crypto";var ct=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ii(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}function xr(u){if(Object.prototype.hasOwnProperty.call(u,"__esModule"))return u;var t=u.default;if(typeof t=="function"){var s=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};s.prototype=t.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(u).forEach(function(r){var i=Object.getOwnPropertyDescriptor(u,r);Object.defineProperty(s,r,i.get?i:{enumerable:!0,get:function(){return u[r]}})}),s}var Dt,Li;function Tr(){if(Li)return Dt;Li=1;const u="\x1B",t=`${u}[`,s="\x07",r={to(e,o){return o?`${t}${o+1};${e+1}H`:`${t}${e+1}G`},move(e,o){let h="";return e<0?h+=`${t}${-e}D`:e>0&&(h+=`${t}${e}C`),o<0?h+=`${t}${-o}A`:o>0&&(h+=`${t}${o}B`),h},up:(e=1)=>`${t}${e}A`,down:(e=1)=>`${t}${e}B`,forward:(e=1)=>`${t}${e}C`,backward:(e=1)=>`${t}${e}D`,nextLine:(e=1)=>`${t}E`.repeat(e),prevLine:(e=1)=>`${t}F`.repeat(e),left:`${t}G`,hide:`${t}?25l`,show:`${t}?25h`,save:`${u}7`,restore:`${u}8`},i={up:(e=1)=>`${t}S`.repeat(e),down:(e=1)=>`${t}T`.repeat(e)},a={screen:`${t}2J`,up:(e=1)=>`${t}1J`.repeat(e),down:(e=1)=>`${t}J`.repeat(e),line:`${t}2K`,lineEnd:`${t}K`,lineStart:`${t}1K`,lines(e){let o="";for(let h=0;h<e;h++)o+=this.line+(h<e-1?r.up():"");return e&&(o+=r.left),o}};return Dt={cursor:r,scroll:i,erase:a,beep:s},Dt}var de=Tr(),Ve={exports:{}},Mi;function $r(){if(Mi)return Ve.exports;Mi=1;let u=process||{},t=u.argv||[],s=u.env||{},r=!(s.NO_COLOR||t.includes("--no-color"))&&(!!s.FORCE_COLOR||t.includes("--color")||u.platform==="win32"||(u.stdout||{}).isTTY&&s.TERM!=="dumb"||!!s.CI),i=(o,h,E=o)=>y=>{let m=""+y,C=m.indexOf(h,o.length);return~C?o+a(m,h,E,C)+h:o+m+h},a=(o,h,E,y)=>{let m="",C=0;do m+=o.substring(C,y)+E,C=y+h.length,y=o.indexOf(h,C);while(~y);return m+o.substring(C)},e=(o=r)=>{let h=o?i:()=>String;return{isColorSupported:o,reset:h("\x1B[0m","\x1B[0m"),bold:h("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:h("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:h("\x1B[3m","\x1B[23m"),underline:h("\x1B[4m","\x1B[24m"),inverse:h("\x1B[7m","\x1B[27m"),hidden:h("\x1B[8m","\x1B[28m"),strikethrough:h("\x1B[9m","\x1B[29m"),black:h("\x1B[30m","\x1B[39m"),red:h("\x1B[31m","\x1B[39m"),green:h("\x1B[32m","\x1B[39m"),yellow:h("\x1B[33m","\x1B[39m"),blue:h("\x1B[34m","\x1B[39m"),magenta:h("\x1B[35m","\x1B[39m"),cyan:h("\x1B[36m","\x1B[39m"),white:h("\x1B[37m","\x1B[39m"),gray:h("\x1B[90m","\x1B[39m"),bgBlack:h("\x1B[40m","\x1B[49m"),bgRed:h("\x1B[41m","\x1B[49m"),bgGreen:h("\x1B[42m","\x1B[49m"),bgYellow:h("\x1B[43m","\x1B[49m"),bgBlue:h("\x1B[44m","\x1B[49m"),bgMagenta:h("\x1B[45m","\x1B[49m"),bgCyan:h("\x1B[46m","\x1B[49m"),bgWhite:h("\x1B[47m","\x1B[49m"),blackBright:h("\x1B[90m","\x1B[39m"),redBright:h("\x1B[91m","\x1B[39m"),greenBright:h("\x1B[92m","\x1B[39m"),yellowBright:h("\x1B[93m","\x1B[39m"),blueBright:h("\x1B[94m","\x1B[39m"),magentaBright:h("\x1B[95m","\x1B[39m"),cyanBright:h("\x1B[96m","\x1B[39m"),whiteBright:h("\x1B[97m","\x1B[39m"),bgBlackBright:h("\x1B[100m","\x1B[49m"),bgRedBright:h("\x1B[101m","\x1B[49m"),bgGreenBright:h("\x1B[102m","\x1B[49m"),bgYellowBright:h("\x1B[103m","\x1B[49m"),bgBlueBright:h("\x1B[104m","\x1B[49m"),bgMagentaBright:h("\x1B[105m","\x1B[49m"),bgCyanBright:h("\x1B[106m","\x1B[49m"),bgWhiteBright:h("\x1B[107m","\x1B[49m")}};return Ve.exports=e(),Ve.exports.createColors=e,Ve.exports}var pe=$r();const I=Ii(pe);function Nr({onlyFirst:u=!1}={}){const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(t,u?void 0:"g")}const Ir=Nr();function Pi(u){if(typeof u!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof u}\``);return u.replace(Ir,"")}function ki(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var Hi={exports:{}};(function(u){var t={};u.exports=t,t.eastAsianWidth=function(r){var i=r.charCodeAt(0),a=r.length==2?r.charCodeAt(1):0,e=i;return 55296<=i&&i<=56319&&56320<=a&&a<=57343&&(i&=1023,a&=1023,e=i<<10|a,e+=65536),e==12288||65281<=e&&e<=65376||65504<=e&&e<=65510?"F":e==8361||65377<=e&&e<=65470||65474<=e&&e<=65479||65482<=e&&e<=65487||65490<=e&&e<=65495||65498<=e&&e<=65500||65512<=e&&e<=65518?"H":4352<=e&&e<=4447||4515<=e&&e<=4519||4602<=e&&e<=4607||9001<=e&&e<=9002||11904<=e&&e<=11929||11931<=e&&e<=12019||12032<=e&&e<=12245||12272<=e&&e<=12283||12289<=e&&e<=12350||12353<=e&&e<=12438||12441<=e&&e<=12543||12549<=e&&e<=12589||12593<=e&&e<=12686||12688<=e&&e<=12730||12736<=e&&e<=12771||12784<=e&&e<=12830||12832<=e&&e<=12871||12880<=e&&e<=13054||13056<=e&&e<=19903||19968<=e&&e<=42124||42128<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||55216<=e&&e<=55238||55243<=e&&e<=55291||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65106||65108<=e&&e<=65126||65128<=e&&e<=65131||110592<=e&&e<=110593||127488<=e&&e<=127490||127504<=e&&e<=127546||127552<=e&&e<=127560||127568<=e&&e<=127569||131072<=e&&e<=194367||177984<=e&&e<=196605||196608<=e&&e<=262141?"W":32<=e&&e<=126||162<=e&&e<=163||165<=e&&e<=166||e==172||e==175||10214<=e&&e<=10221||10629<=e&&e<=10630?"Na":e==161||e==164||167<=e&&e<=168||e==170||173<=e&&e<=174||176<=e&&e<=180||182<=e&&e<=186||188<=e&&e<=191||e==198||e==208||215<=e&&e<=216||222<=e&&e<=225||e==230||232<=e&&e<=234||236<=e&&e<=237||e==240||242<=e&&e<=243||247<=e&&e<=250||e==252||e==254||e==257||e==273||e==275||e==283||294<=e&&e<=295||e==299||305<=e&&e<=307||e==312||319<=e&&e<=322||e==324||328<=e&&e<=331||e==333||338<=e&&e<=339||358<=e&&e<=359||e==363||e==462||e==464||e==466||e==468||e==470||e==472||e==474||e==476||e==593||e==609||e==708||e==711||713<=e&&e<=715||e==717||e==720||728<=e&&e<=731||e==733||e==735||768<=e&&e<=879||913<=e&&e<=929||931<=e&&e<=937||945<=e&&e<=961||963<=e&&e<=969||e==1025||1040<=e&&e<=1103||e==1105||e==8208||8211<=e&&e<=8214||8216<=e&&e<=8217||8220<=e&&e<=8221||8224<=e&&e<=8226||8228<=e&&e<=8231||e==8240||8242<=e&&e<=8243||e==8245||e==8251||e==8254||e==8308||e==8319||8321<=e&&e<=8324||e==8364||e==8451||e==8453||e==8457||e==8467||e==8470||8481<=e&&e<=8482||e==8486||e==8491||8531<=e&&e<=8532||8539<=e&&e<=8542||8544<=e&&e<=8555||8560<=e&&e<=8569||e==8585||8592<=e&&e<=8601||8632<=e&&e<=8633||e==8658||e==8660||e==8679||e==8704||8706<=e&&e<=8707||8711<=e&&e<=8712||e==8715||e==8719||e==8721||e==8725||e==8730||8733<=e&&e<=8736||e==8739||e==8741||8743<=e&&e<=8748||e==8750||8756<=e&&e<=8759||8764<=e&&e<=8765||e==8776||e==8780||e==8786||8800<=e&&e<=8801||8804<=e&&e<=8807||8810<=e&&e<=8811||8814<=e&&e<=8815||8834<=e&&e<=8835||8838<=e&&e<=8839||e==8853||e==8857||e==8869||e==8895||e==8978||9312<=e&&e<=9449||9451<=e&&e<=9547||9552<=e&&e<=9587||9600<=e&&e<=9615||9618<=e&&e<=9621||9632<=e&&e<=9633||9635<=e&&e<=9641||9650<=e&&e<=9651||9654<=e&&e<=9655||9660<=e&&e<=9661||9664<=e&&e<=9665||9670<=e&&e<=9672||e==9675||9678<=e&&e<=9681||9698<=e&&e<=9701||e==9711||9733<=e&&e<=9734||e==9737||9742<=e&&e<=9743||9748<=e&&e<=9749||e==9756||e==9758||e==9792||e==9794||9824<=e&&e<=9825||9827<=e&&e<=9829||9831<=e&&e<=9834||9836<=e&&e<=9837||e==9839||9886<=e&&e<=9887||9918<=e&&e<=9919||9924<=e&&e<=9933||9935<=e&&e<=9953||e==9955||9960<=e&&e<=9983||e==10045||e==10071||10102<=e&&e<=10111||11093<=e&&e<=11097||12872<=e&&e<=12879||57344<=e&&e<=63743||65024<=e&&e<=65039||e==65533||127232<=e&&e<=127242||127248<=e&&e<=127277||127280<=e&&e<=127337||127344<=e&&e<=127386||917760<=e&&e<=917999||983040<=e&&e<=1048573||1048576<=e&&e<=1114109?"A":"N"},t.characterLength=function(r){var i=this.eastAsianWidth(r);return i=="F"||i=="W"||i=="A"?2:1};function s(r){return r.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}t.length=function(r){for(var i=s(r),a=0,e=0;e<i.length;e++)a=a+this.characterLength(i[e]);return a},t.slice=function(r,i,a){textLen=t.length(r),i=i||0,a=a||1,i<0&&(i=textLen+i),a<0&&(a=textLen+a);for(var e="",o=0,h=s(r),E=0;E<h.length;E++){var y=h[E],m=t.length(y);if(o>=i-(m==2?1:0))if(o+m<=a)e+=y;else break;o+=m}return e}})(Hi);var Lr=Hi.exports;const Mr=ki(Lr);var Pr=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g};const kr=ki(Pr);function Te(u,t={}){if(typeof u!="string"||u.length===0||(t={ambiguousIsNarrow:!0,...t},u=Pi(u),u.length===0))return 0;u=u.replace(kr()," ");const s=t.ambiguousIsNarrow?1:2;let r=0;for(const i of u){const a=i.codePointAt(0);if(!(a<=31||a>=127&&a<=159||a>=768&&a<=879))switch(Mr.eastAsianWidth(i)){case"F":case"W":r+=2;break;case"A":r+=s;break;default:r+=1}}return r}const ft=10,ji=(u=0)=>t=>`\x1B[${t+u}m`,Ui=(u=0)=>t=>`\x1B[${38+u};5;${t}m`,zi=(u=0)=>(t,s,r)=>`\x1B[${38+u};2;${t};${s};${r}m`,ne={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(ne.modifier);const Hr=Object.keys(ne.color),jr=Object.keys(ne.bgColor);[...Hr,...jr];function Ur(){const u=new Map;for(const[t,s]of Object.entries(ne)){for(const[r,i]of Object.entries(s))ne[r]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},s[r]=ne[r],u.set(i[0],i[1]);Object.defineProperty(ne,t,{value:s,enumerable:!1})}return Object.defineProperty(ne,"codes",{value:u,enumerable:!1}),ne.color.close="\x1B[39m",ne.bgColor.close="\x1B[49m",ne.color.ansi=ji(),ne.color.ansi256=Ui(),ne.color.ansi16m=zi(),ne.bgColor.ansi=ji(ft),ne.bgColor.ansi256=Ui(ft),ne.bgColor.ansi16m=zi(ft),Object.defineProperties(ne,{rgbToAnsi256:{value:(t,s,r)=>t===s&&s===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(s/255*5)+Math.round(r/255*5),enumerable:!1},hexToRgb:{value:t=>{const s=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!s)return[0,0,0];let[r]=s;r.length===3&&(r=[...r].map(a=>a+a).join(""));const i=Number.parseInt(r,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:t=>ne.rgbToAnsi256(...ne.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value:t=>{if(t<8)return 30+t;if(t<16)return 90+(t-8);let s,r,i;if(t>=232)s=((t-232)*10+8)/255,r=s,i=s;else{t-=16;const o=t%36;s=Math.floor(t/36)/5,r=Math.floor(o/6)/5,i=o%6/5}const a=Math.max(s,r,i)*2;if(a===0)return 30;let e=30+(Math.round(i)<<2|Math.round(r)<<1|Math.round(s));return a===2&&(e+=60),e},enumerable:!1},rgbToAnsi:{value:(t,s,r)=>ne.ansi256ToAnsi(ne.rgbToAnsi256(t,s,r)),enumerable:!1},hexToAnsi:{value:t=>ne.ansi256ToAnsi(ne.hexToAnsi256(t)),enumerable:!1}}),ne}const zr=Ur(),We=new Set(["\x1B","\x9B"]),Gr=39,dt="\x07",Gi="[",qr="]",qi="m",mt=`${qr}8;;`,Vi=u=>`${We.values().next().value}${Gi}${u}${qi}`,Wi=u=>`${We.values().next().value}${mt}${u}${dt}`,Vr=u=>u.split(" ").map(t=>Te(t)),pt=(u,t,s)=>{const r=[...t];let i=!1,a=!1,e=Te(Pi(u[u.length-1]));for(const[o,h]of r.entries()){const E=Te(h);if(e+E<=s?u[u.length-1]+=h:(u.push(h),e=0),We.has(h)&&(i=!0,a=r.slice(o+1).join("").startsWith(mt)),i){a?h===dt&&(i=!1,a=!1):h===qi&&(i=!1);continue}e+=E,e===s&&o<r.length-1&&(u.push(""),e=0)}!e&&u[u.length-1].length>0&&u.length>1&&(u[u.length-2]+=u.pop())},Wr=u=>{const t=u.split(" ");let s=t.length;for(;s>0&&!(Te(t[s-1])>0);)s--;return s===t.length?u:t.slice(0,s).join(" ")+t.slice(s).join("")},Kr=(u,t,s={})=>{if(s.trim!==!1&&u.trim()==="")return"";let r="",i,a;const e=Vr(u);let o=[""];for(const[E,y]of u.split(" ").entries()){s.trim!==!1&&(o[o.length-1]=o[o.length-1].trimStart());let m=Te(o[o.length-1]);if(E!==0&&(m>=t&&(s.wordWrap===!1||s.trim===!1)&&(o.push(""),m=0),(m>0||s.trim===!1)&&(o[o.length-1]+=" ",m++)),s.hard&&e[E]>t){const C=t-m,_=1+Math.floor((e[E]-C-1)/t);Math.floor((e[E]-1)/t)<_&&o.push(""),pt(o,y,t);continue}if(m+e[E]>t&&m>0&&e[E]>0){if(s.wordWrap===!1&&m<t){pt(o,y,t);continue}o.push("")}if(m+e[E]>t&&s.wordWrap===!1){pt(o,y,t);continue}o[o.length-1]+=y}s.trim!==!1&&(o=o.map(E=>Wr(E)));const h=[...o.join(`
2
- `)];for(const[E,y]of h.entries()){if(r+=y,We.has(y)){const{groups:C}=new RegExp(`(?:\\${Gi}(?<code>\\d+)m|\\${mt}(?<uri>.*)${dt})`).exec(h.slice(E).join(""))||{groups:{}};if(C.code!==void 0){const _=Number.parseFloat(C.code);i=_===Gr?void 0:_}else C.uri!==void 0&&(a=C.uri.length===0?void 0:C.uri)}const m=zr.codes.get(Number(i));h[E+1]===`
3
- `?(a&&(r+=Wi("")),i&&m&&(r+=Vi(m))):y===`
4
- `&&(i&&m&&(r+=Vi(i)),a&&(r+=Wi(a)))}return r};function Ki(u,t,s){return String(u).normalize().replace(/\r\n/g,`
1
+ import Q,{stdin as xs,stdout as Ts}from"node:process";import{stripVTControlCharacters as Tr,promisify as $r}from"node:util";import*as We from"node:readline";import $s from"node:readline";import{WriteStream as Nr}from"node:tty";import Te from"events";import Ir from"child_process";import fe from"path";import Ce from"fs";import Ns from"process";import Se,{existsSync as at}from"node:fs";import Oe,{rm as Lr,appendFile as Pr,readFile as ht,writeFile as lt}from"node:fs/promises";import de,{join as we}from"node:path";import{fileURLToPath as Mr}from"node:url";import{spawn as kr}from"node:child_process";import{once as Is,on as jr}from"node:events";import{pipeline as Hr}from"node:stream/promises";import*as Ur from"node:readline/promises";import zr from"node:os";import{pipeline as Gr}from"node:stream";import Ls from"stream";import Ps from"string_decoder";import ct from"assert";import qr from"buffer";import Ms from"zlib";import Wr from"util";import Vr from"crypto";var Dt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ks(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function Kr(s){if(Object.prototype.hasOwnProperty.call(s,"__esModule"))return s;var t=s.default;if(typeof t=="function"){var i=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};i.prototype=t.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(s).forEach(function(n){var r=Object.getOwnPropertyDescriptor(s,n);Object.defineProperty(i,n,r.get?r:{enumerable:!0,get:function(){return s[n]}})}),i}var ft,js;function Yr(){if(js)return ft;js=1;const s="\x1B",t=`${s}[`,i="\x07",n={to(e,u){return u?`${t}${u+1};${e+1}H`:`${t}${e+1}G`},move(e,u){let h="";return e<0?h+=`${t}${-e}D`:e>0&&(h+=`${t}${e}C`),u<0?h+=`${t}${-u}A`:u>0&&(h+=`${t}${u}B`),h},up:(e=1)=>`${t}${e}A`,down:(e=1)=>`${t}${e}B`,forward:(e=1)=>`${t}${e}C`,backward:(e=1)=>`${t}${e}D`,nextLine:(e=1)=>`${t}E`.repeat(e),prevLine:(e=1)=>`${t}F`.repeat(e),left:`${t}G`,hide:`${t}?25l`,show:`${t}?25h`,save:`${s}7`,restore:`${s}8`},r={up:(e=1)=>`${t}S`.repeat(e),down:(e=1)=>`${t}T`.repeat(e)},a={screen:`${t}2J`,up:(e=1)=>`${t}1J`.repeat(e),down:(e=1)=>`${t}J`.repeat(e),line:`${t}2K`,lineEnd:`${t}K`,lineStart:`${t}1K`,lines(e){let u="";for(let h=0;h<e;h++)u+=this.line+(h<e-1?n.up():"");return e&&(u+=n.left),u}};return ft={cursor:n,scroll:r,erase:a,beep:i},ft}var pe=Yr(),Ve={exports:{}},Hs;function Zr(){if(Hs)return Ve.exports;Hs=1;let s=process||{},t=s.argv||[],i=s.env||{},n=!(i.NO_COLOR||t.includes("--no-color"))&&(!!i.FORCE_COLOR||t.includes("--color")||s.platform==="win32"||(s.stdout||{}).isTTY&&i.TERM!=="dumb"||!!i.CI),r=(u,h,m=u)=>y=>{let p=""+y,C=p.indexOf(h,u.length);return~C?u+a(p,h,m,C)+h:u+p+h},a=(u,h,m,y)=>{let p="",C=0;do p+=u.substring(C,y)+m,C=y+h.length,y=u.indexOf(h,C);while(~y);return p+u.substring(C)},e=(u=n)=>{let h=u?r:()=>String;return{isColorSupported:u,reset:h("\x1B[0m","\x1B[0m"),bold:h("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:h("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:h("\x1B[3m","\x1B[23m"),underline:h("\x1B[4m","\x1B[24m"),inverse:h("\x1B[7m","\x1B[27m"),hidden:h("\x1B[8m","\x1B[28m"),strikethrough:h("\x1B[9m","\x1B[29m"),black:h("\x1B[30m","\x1B[39m"),red:h("\x1B[31m","\x1B[39m"),green:h("\x1B[32m","\x1B[39m"),yellow:h("\x1B[33m","\x1B[39m"),blue:h("\x1B[34m","\x1B[39m"),magenta:h("\x1B[35m","\x1B[39m"),cyan:h("\x1B[36m","\x1B[39m"),white:h("\x1B[37m","\x1B[39m"),gray:h("\x1B[90m","\x1B[39m"),bgBlack:h("\x1B[40m","\x1B[49m"),bgRed:h("\x1B[41m","\x1B[49m"),bgGreen:h("\x1B[42m","\x1B[49m"),bgYellow:h("\x1B[43m","\x1B[49m"),bgBlue:h("\x1B[44m","\x1B[49m"),bgMagenta:h("\x1B[45m","\x1B[49m"),bgCyan:h("\x1B[46m","\x1B[49m"),bgWhite:h("\x1B[47m","\x1B[49m"),blackBright:h("\x1B[90m","\x1B[39m"),redBright:h("\x1B[91m","\x1B[39m"),greenBright:h("\x1B[92m","\x1B[39m"),yellowBright:h("\x1B[93m","\x1B[39m"),blueBright:h("\x1B[94m","\x1B[39m"),magentaBright:h("\x1B[95m","\x1B[39m"),cyanBright:h("\x1B[96m","\x1B[39m"),whiteBright:h("\x1B[97m","\x1B[39m"),bgBlackBright:h("\x1B[100m","\x1B[49m"),bgRedBright:h("\x1B[101m","\x1B[49m"),bgGreenBright:h("\x1B[102m","\x1B[49m"),bgYellowBright:h("\x1B[103m","\x1B[49m"),bgBlueBright:h("\x1B[104m","\x1B[49m"),bgMagentaBright:h("\x1B[105m","\x1B[49m"),bgCyanBright:h("\x1B[106m","\x1B[49m"),bgWhiteBright:h("\x1B[107m","\x1B[49m")}};return Ve.exports=e(),Ve.exports.createColors=e,Ve.exports}var Ee=Zr();const I=ks(Ee);function Xr({onlyFirst:s=!1}={}){const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(t,s?void 0:"g")}const Jr=Xr();function Us(s){if(typeof s!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof s}\``);return s.replace(Jr,"")}function zs(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Gs={exports:{}};(function(s){var t={};s.exports=t,t.eastAsianWidth=function(n){var r=n.charCodeAt(0),a=n.length==2?n.charCodeAt(1):0,e=r;return 55296<=r&&r<=56319&&56320<=a&&a<=57343&&(r&=1023,a&=1023,e=r<<10|a,e+=65536),e==12288||65281<=e&&e<=65376||65504<=e&&e<=65510?"F":e==8361||65377<=e&&e<=65470||65474<=e&&e<=65479||65482<=e&&e<=65487||65490<=e&&e<=65495||65498<=e&&e<=65500||65512<=e&&e<=65518?"H":4352<=e&&e<=4447||4515<=e&&e<=4519||4602<=e&&e<=4607||9001<=e&&e<=9002||11904<=e&&e<=11929||11931<=e&&e<=12019||12032<=e&&e<=12245||12272<=e&&e<=12283||12289<=e&&e<=12350||12353<=e&&e<=12438||12441<=e&&e<=12543||12549<=e&&e<=12589||12593<=e&&e<=12686||12688<=e&&e<=12730||12736<=e&&e<=12771||12784<=e&&e<=12830||12832<=e&&e<=12871||12880<=e&&e<=13054||13056<=e&&e<=19903||19968<=e&&e<=42124||42128<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||55216<=e&&e<=55238||55243<=e&&e<=55291||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65106||65108<=e&&e<=65126||65128<=e&&e<=65131||110592<=e&&e<=110593||127488<=e&&e<=127490||127504<=e&&e<=127546||127552<=e&&e<=127560||127568<=e&&e<=127569||131072<=e&&e<=194367||177984<=e&&e<=196605||196608<=e&&e<=262141?"W":32<=e&&e<=126||162<=e&&e<=163||165<=e&&e<=166||e==172||e==175||10214<=e&&e<=10221||10629<=e&&e<=10630?"Na":e==161||e==164||167<=e&&e<=168||e==170||173<=e&&e<=174||176<=e&&e<=180||182<=e&&e<=186||188<=e&&e<=191||e==198||e==208||215<=e&&e<=216||222<=e&&e<=225||e==230||232<=e&&e<=234||236<=e&&e<=237||e==240||242<=e&&e<=243||247<=e&&e<=250||e==252||e==254||e==257||e==273||e==275||e==283||294<=e&&e<=295||e==299||305<=e&&e<=307||e==312||319<=e&&e<=322||e==324||328<=e&&e<=331||e==333||338<=e&&e<=339||358<=e&&e<=359||e==363||e==462||e==464||e==466||e==468||e==470||e==472||e==474||e==476||e==593||e==609||e==708||e==711||713<=e&&e<=715||e==717||e==720||728<=e&&e<=731||e==733||e==735||768<=e&&e<=879||913<=e&&e<=929||931<=e&&e<=937||945<=e&&e<=961||963<=e&&e<=969||e==1025||1040<=e&&e<=1103||e==1105||e==8208||8211<=e&&e<=8214||8216<=e&&e<=8217||8220<=e&&e<=8221||8224<=e&&e<=8226||8228<=e&&e<=8231||e==8240||8242<=e&&e<=8243||e==8245||e==8251||e==8254||e==8308||e==8319||8321<=e&&e<=8324||e==8364||e==8451||e==8453||e==8457||e==8467||e==8470||8481<=e&&e<=8482||e==8486||e==8491||8531<=e&&e<=8532||8539<=e&&e<=8542||8544<=e&&e<=8555||8560<=e&&e<=8569||e==8585||8592<=e&&e<=8601||8632<=e&&e<=8633||e==8658||e==8660||e==8679||e==8704||8706<=e&&e<=8707||8711<=e&&e<=8712||e==8715||e==8719||e==8721||e==8725||e==8730||8733<=e&&e<=8736||e==8739||e==8741||8743<=e&&e<=8748||e==8750||8756<=e&&e<=8759||8764<=e&&e<=8765||e==8776||e==8780||e==8786||8800<=e&&e<=8801||8804<=e&&e<=8807||8810<=e&&e<=8811||8814<=e&&e<=8815||8834<=e&&e<=8835||8838<=e&&e<=8839||e==8853||e==8857||e==8869||e==8895||e==8978||9312<=e&&e<=9449||9451<=e&&e<=9547||9552<=e&&e<=9587||9600<=e&&e<=9615||9618<=e&&e<=9621||9632<=e&&e<=9633||9635<=e&&e<=9641||9650<=e&&e<=9651||9654<=e&&e<=9655||9660<=e&&e<=9661||9664<=e&&e<=9665||9670<=e&&e<=9672||e==9675||9678<=e&&e<=9681||9698<=e&&e<=9701||e==9711||9733<=e&&e<=9734||e==9737||9742<=e&&e<=9743||9748<=e&&e<=9749||e==9756||e==9758||e==9792||e==9794||9824<=e&&e<=9825||9827<=e&&e<=9829||9831<=e&&e<=9834||9836<=e&&e<=9837||e==9839||9886<=e&&e<=9887||9918<=e&&e<=9919||9924<=e&&e<=9933||9935<=e&&e<=9953||e==9955||9960<=e&&e<=9983||e==10045||e==10071||10102<=e&&e<=10111||11093<=e&&e<=11097||12872<=e&&e<=12879||57344<=e&&e<=63743||65024<=e&&e<=65039||e==65533||127232<=e&&e<=127242||127248<=e&&e<=127277||127280<=e&&e<=127337||127344<=e&&e<=127386||917760<=e&&e<=917999||983040<=e&&e<=1048573||1048576<=e&&e<=1114109?"A":"N"},t.characterLength=function(n){var r=this.eastAsianWidth(n);return r=="F"||r=="W"||r=="A"?2:1};function i(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}t.length=function(n){for(var r=i(n),a=0,e=0;e<r.length;e++)a=a+this.characterLength(r[e]);return a},t.slice=function(n,r,a){textLen=t.length(n),r=r||0,a=a||1,r<0&&(r=textLen+r),a<0&&(a=textLen+a);for(var e="",u=0,h=i(n),m=0;m<h.length;m++){var y=h[m],p=t.length(y);if(u>=r-(p==2?1:0))if(u+p<=a)e+=y;else break;u+=p}return e}})(Gs);var Qr=Gs.exports;const en=zs(Qr);var tn=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g};const sn=zs(tn);function $e(s,t={}){if(typeof s!="string"||s.length===0||(t={ambiguousIsNarrow:!0,...t},s=Us(s),s.length===0))return 0;s=s.replace(sn()," ");const i=t.ambiguousIsNarrow?1:2;let n=0;for(const r of s){const a=r.codePointAt(0);if(!(a<=31||a>=127&&a<=159||a>=768&&a<=879))switch(en.eastAsianWidth(r)){case"F":case"W":n+=2;break;case"A":n+=i;break;default:n+=1}}return n}const dt=10,qs=(s=0)=>t=>`\x1B[${t+s}m`,Ws=(s=0)=>t=>`\x1B[${38+s};5;${t}m`,Vs=(s=0)=>(t,i,n)=>`\x1B[${38+s};2;${t};${i};${n}m`,ue={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(ue.modifier);const rn=Object.keys(ue.color),nn=Object.keys(ue.bgColor);[...rn,...nn];function un(){const s=new Map;for(const[t,i]of Object.entries(ue)){for(const[n,r]of Object.entries(i))ue[n]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},i[n]=ue[n],s.set(r[0],r[1]);Object.defineProperty(ue,t,{value:i,enumerable:!1})}return Object.defineProperty(ue,"codes",{value:s,enumerable:!1}),ue.color.close="\x1B[39m",ue.bgColor.close="\x1B[49m",ue.color.ansi=qs(),ue.color.ansi256=Ws(),ue.color.ansi16m=Vs(),ue.bgColor.ansi=qs(dt),ue.bgColor.ansi256=Ws(dt),ue.bgColor.ansi16m=Vs(dt),Object.defineProperties(ue,{rgbToAnsi256:{value:(t,i,n)=>t===i&&i===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(i/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:t=>{const i=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!i)return[0,0,0];let[n]=i;n.length===3&&(n=[...n].map(a=>a+a).join(""));const r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:t=>ue.rgbToAnsi256(...ue.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value:t=>{if(t<8)return 30+t;if(t<16)return 90+(t-8);let i,n,r;if(t>=232)i=((t-232)*10+8)/255,n=i,r=i;else{t-=16;const u=t%36;i=Math.floor(t/36)/5,n=Math.floor(u/6)/5,r=u%6/5}const a=Math.max(i,n,r)*2;if(a===0)return 30;let e=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(i));return a===2&&(e+=60),e},enumerable:!1},rgbToAnsi:{value:(t,i,n)=>ue.ansi256ToAnsi(ue.rgbToAnsi256(t,i,n)),enumerable:!1},hexToAnsi:{value:t=>ue.ansi256ToAnsi(ue.hexToAnsi256(t)),enumerable:!1}}),ue}const on=un(),Ke=new Set(["\x1B","\x9B"]),an=39,pt="\x07",Ks="[",hn="]",Ys="m",mt=`${hn}8;;`,Zs=s=>`${Ke.values().next().value}${Ks}${s}${Ys}`,Xs=s=>`${Ke.values().next().value}${mt}${s}${pt}`,ln=s=>s.split(" ").map(t=>$e(t)),Et=(s,t,i)=>{const n=[...t];let r=!1,a=!1,e=$e(Us(s[s.length-1]));for(const[u,h]of n.entries()){const m=$e(h);if(e+m<=i?s[s.length-1]+=h:(s.push(h),e=0),Ke.has(h)&&(r=!0,a=n.slice(u+1).join("").startsWith(mt)),r){a?h===pt&&(r=!1,a=!1):h===Ys&&(r=!1);continue}e+=m,e===i&&u<n.length-1&&(s.push(""),e=0)}!e&&s[s.length-1].length>0&&s.length>1&&(s[s.length-2]+=s.pop())},cn=s=>{const t=s.split(" ");let i=t.length;for(;i>0&&!($e(t[i-1])>0);)i--;return i===t.length?s:t.slice(0,i).join(" ")+t.slice(i).join("")},Dn=(s,t,i={})=>{if(i.trim!==!1&&s.trim()==="")return"";let n="",r,a;const e=ln(s);let u=[""];for(const[m,y]of s.split(" ").entries()){i.trim!==!1&&(u[u.length-1]=u[u.length-1].trimStart());let p=$e(u[u.length-1]);if(m!==0&&(p>=t&&(i.wordWrap===!1||i.trim===!1)&&(u.push(""),p=0),(p>0||i.trim===!1)&&(u[u.length-1]+=" ",p++)),i.hard&&e[m]>t){const C=t-p,w=1+Math.floor((e[m]-C-1)/t);Math.floor((e[m]-1)/t)<w&&u.push(""),Et(u,y,t);continue}if(p+e[m]>t&&p>0&&e[m]>0){if(i.wordWrap===!1&&p<t){Et(u,y,t);continue}u.push("")}if(p+e[m]>t&&i.wordWrap===!1){Et(u,y,t);continue}u[u.length-1]+=y}i.trim!==!1&&(u=u.map(m=>cn(m)));const h=[...u.join(`
2
+ `)];for(const[m,y]of h.entries()){if(n+=y,Ke.has(y)){const{groups:C}=new RegExp(`(?:\\${Ks}(?<code>\\d+)m|\\${mt}(?<uri>.*)${pt})`).exec(h.slice(m).join(""))||{groups:{}};if(C.code!==void 0){const w=Number.parseFloat(C.code);r=w===an?void 0:w}else C.uri!==void 0&&(a=C.uri.length===0?void 0:C.uri)}const p=on.codes.get(Number(r));h[m+1]===`
3
+ `?(a&&(n+=Xs("")),r&&p&&(n+=Zs(p))):y===`
4
+ `&&(r&&p&&(n+=Zs(r)),a&&(n+=Xs(a)))}return n};function Js(s,t,i){return String(s).normalize().replace(/\r\n/g,`
5
5
  `).split(`
6
- `).map(r=>Kr(r,t,s)).join(`
7
- `)}const Yr=["up","down","left","right","space","enter","cancel"],Ke={actions:new Set(Yr),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]])};function Et(u,t){if(typeof u=="string")return Ke.aliases.get(u)===t;for(const s of u)if(s!==void 0&&Et(s,t))return!0;return!1}function Zr(u,t){if(u===t)return;const s=u.split(`
8
- `),r=t.split(`
9
- `),i=[];for(let a=0;a<Math.max(s.length,r.length);a++)s[a]!==r[a]&&i.push(a);return i}const Xr=globalThis.process.platform.startsWith("win"),gt=Symbol("clack:cancel");function _e(u){return u===gt}function Ye(u,t){const s=u;s.isTTY&&s.setRawMode(t)}function Jr({input:u=Si,output:t=Oi,overwrite:s=!0,hideCursor:r=!0}={}){const i=qe.createInterface({input:u,output:t,prompt:"",tabSize:1});qe.emitKeypressEvents(u,i),u.isTTY&&u.setRawMode(!0);const a=(e,{name:o,sequence:h})=>{const E=String(e);if(Et([E,o,h],"cancel")){r&&t.write(de.cursor.show),process.exit(0);return}if(!s)return;const y=o==="return"?0:-1,m=o==="return"?-1:0;qe.moveCursor(t,y,m,()=>{qe.clearLine(t,1,()=>{u.once("keypress",a)})})};return r&&t.write(de.cursor.hide),u.once("keypress",a),()=>{u.off("keypress",a),r&&t.write(de.cursor.show),u.isTTY&&!Xr&&u.setRawMode(!1),i.terminal=!1,i.close()}}var Qr=Object.defineProperty,en=(u,t,s)=>t in u?Qr(u,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):u[t]=s,Ce=(u,t,s)=>(en(u,typeof t!="symbol"?t+"":t,s),s);class Ze{constructor(t,s=!0){Ce(this,"input"),Ce(this,"output"),Ce(this,"_abortSignal"),Ce(this,"rl"),Ce(this,"opts"),Ce(this,"_render"),Ce(this,"_track",!1),Ce(this,"_prevFrame",""),Ce(this,"_subscribers",new Map),Ce(this,"_cursor",0),Ce(this,"state","initial"),Ce(this,"error",""),Ce(this,"value");const{input:r=Si,output:i=Oi,render:a,signal:e,...o}=t;this.opts=o,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=a.bind(this),this._track=s,this._abortSignal=e,this.input=r,this.output=i}unsubscribe(){this._subscribers.clear()}setSubscriber(t,s){const r=this._subscribers.get(t)??[];r.push(s),this._subscribers.set(t,r)}on(t,s){this.setSubscriber(t,{cb:s})}once(t,s){this.setSubscriber(t,{cb:s,once:!0})}emit(t,...s){const r=this._subscribers.get(t)??[],i=[];for(const a of r)a.cb(...s),a.once&&i.push(()=>r.splice(r.indexOf(a),1));for(const a of i)a()}prompt(){return new Promise((t,s)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),t(gt);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}const r=new yr(0);r._write=(i,a,e)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),e()},this.input.pipe(r),this.rl=Bi.createInterface({input:this.input,output:r,tabSize:2,prompt:"",escapeCodeTimeout:50}),Bi.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),Ye(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(de.cursor.show),this.output.off("resize",this.render),Ye(this.input,!1),t(this.value)}),this.once("cancel",()=>{this.output.write(de.cursor.show),this.output.off("resize",this.render),Ye(this.input,!1),t(gt)})})}onKeypress(t,s){if(this.state==="error"&&(this.state="active"),s?.name&&(!this._track&&Ke.aliases.has(s.name)&&this.emit("cursor",Ke.aliases.get(s.name)),Ke.actions.has(s.name)&&this.emit("cursor",s.name)),t&&(t.toLowerCase()==="y"||t.toLowerCase()==="n")&&this.emit("confirm",t.toLowerCase()==="y"),t===" "&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),t&&this.emit("key",t.toLowerCase()),s?.name==="return"){if(this.opts.validate){const r=this.opts.validate(this.value);r&&(this.error=r instanceof Error?r.message:r,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}Et([t,s?.name,s?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
10
- `),Ye(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){const t=Ki(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
11
- `).length-1;this.output.write(de.cursor.move(-999,t*-1))}render(){const t=Ki(this._render(this)??"",process.stdout.columns,{hard:!0});if(t!==this._prevFrame){if(this.state==="initial")this.output.write(de.cursor.hide);else{const s=Zr(this._prevFrame,t);if(this.restoreCursor(),s&&s?.length===1){const r=s[0];this.output.write(de.cursor.move(0,r)),this.output.write(de.erase.lines(1));const i=t.split(`
12
- `);this.output.write(i[r]),this._prevFrame=t,this.output.write(de.cursor.move(0,i.length-r-1));return}if(s&&s?.length>1){const r=s[0];this.output.write(de.cursor.move(0,r)),this.output.write(de.erase.down());const i=t.split(`
13
- `).slice(r);this.output.write(i.join(`
14
- `)),this._prevFrame=t;return}this.output.write(de.erase.down())}this.output.write(t),this.state==="initial"&&(this.state="active"),this._prevFrame=t}}}class tn extends Ze{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(t){super(t,!1),this.value=!!t.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",s=>{this.output.write(de.cursor.move(0,-1)),this.value=s,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}}var sn=Object.defineProperty,rn=(u,t,s)=>t in u?sn(u,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):u[t]=s,Yi=(u,t,s)=>(rn(u,typeof t!="symbol"?t+"":t,s),s);let nn=class extends Ze{constructor(u){super(u,!1),Yi(this,"options"),Yi(this,"cursor",0),this.options=u.options,this.value=[...u.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:t})=>t===u.cursorAt),0),this.on("key",t=>{t==="a"&&this.toggleAll()}),this.on("cursor",t=>{switch(t){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}})}get _value(){return this.options[this.cursor].value}toggleAll(){const u=this.value.length===this.options.length;this.value=u?[]:this.options.map(t=>t.value)}toggleValue(){const u=this.value.includes(this._value);this.value=u?this.value.filter(t=>t!==this._value):[...this.value,this._value]}};var un=Object.defineProperty,on=(u,t,s)=>t in u?un(u,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):u[t]=s,Zi=(u,t,s)=>(on(u,typeof t!="symbol"?t+"":t,s),s);class an extends Ze{constructor(t){super(t,!1),Zi(this,"options"),Zi(this,"cursor",0),this.options=t.options,this.cursor=this.options.findIndex(({value:s})=>s===t.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",s=>{switch(s){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}}class hn extends Ze{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;const t=this.value.slice(0,this.cursor),[s,...r]=this.value.slice(this.cursor);return`${t}${I.inverse(s)}${r.join("")}`}get cursor(){return this._cursor}constructor(t){super(t),this.on("finalize",()=>{this.value||(this.value=t.defaultValue)})}}function ln(){return ae.platform!=="win32"?ae.env.TERM!=="linux":!!ae.env.CI||!!ae.env.WT_SESSION||!!ae.env.TERMINUS_SUBLIME||ae.env.ConEmuTask==="{cmd::Cmder}"||ae.env.TERM_PROGRAM==="Terminus-Sublime"||ae.env.TERM_PROGRAM==="vscode"||ae.env.TERM==="xterm-256color"||ae.env.TERM==="alacritty"||ae.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const Ct=ln(),me=(u,t)=>Ct?u:t,cn=me("\u25C6","*"),Xi=me("\u25A0","x"),Ji=me("\u25B2","x"),Ft=me("\u25C7","o"),Dn=me("\u250C","T"),Q=me("\u2502","|"),ve=me("\u2514","\u2014"),yt=me("\u25CF",">"),bt=me("\u25CB"," "),fn=me("\u25FB","[\u2022]"),Qi=me("\u25FC","[+]"),dn=me("\u25FB","[ ]"),mn=me("\u25CF","\u2022"),pn=me("\u25C6","*"),En=me("\u25B2","!"),gn=me("\u25A0","x"),Xe=u=>{switch(u){case"initial":case"active":return I.cyan(cn);case"cancel":return I.red(Xi);case"error":return I.yellow(Ji);case"submit":return I.green(Ft)}},_t=u=>{const{cursor:t,options:s,style:r}=u,i=u.maxItems??Number.POSITIVE_INFINITY,a=Math.max(process.stdout.rows-4,0),e=Math.min(a,Math.max(i,5));let o=0;t>=o+e-3?o=Math.max(Math.min(t-e+3,s.length-e),0):t<o+2&&(o=Math.max(t-2,0));const h=e<s.length&&o>0,E=e<s.length&&o+e<s.length;return s.slice(o,o+e).map((y,m,C)=>{const _=m===0&&h,b=m===C.length-1&&E;return _||b?I.dim("..."):r(y,m+o===t)})},Je=u=>new hn({validate:u.validate,placeholder:u.placeholder,defaultValue:u.defaultValue,initialValue:u.initialValue,render(){const t=`${I.gray(Q)}
15
- ${Xe(this.state)} ${u.message}
16
- `,s=u.placeholder?I.inverse(u.placeholder[0])+I.dim(u.placeholder.slice(1)):I.inverse(I.hidden("_")),r=this.value?this.valueWithCursor:s;switch(this.state){case"error":return`${t.trim()}
17
- ${I.yellow(Q)} ${r}
6
+ `).map(n=>Dn(n,t,i)).join(`
7
+ `)}const fn=["up","down","left","right","space","enter","cancel"],Ye={actions:new Set(fn),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]])};function gt(s,t){if(typeof s=="string")return Ye.aliases.get(s)===t;for(const i of s)if(i!==void 0&&gt(i,t))return!0;return!1}function dn(s,t){if(s===t)return;const i=s.split(`
8
+ `),n=t.split(`
9
+ `),r=[];for(let a=0;a<Math.max(i.length,n.length);a++)i[a]!==n[a]&&r.push(a);return r}const pn=globalThis.process.platform.startsWith("win"),Ct=Symbol("clack:cancel");function _e(s){return s===Ct}function Ze(s,t){const i=s;i.isTTY&&i.setRawMode(t)}function mn({input:s=xs,output:t=Ts,overwrite:i=!0,hideCursor:n=!0}={}){const r=We.createInterface({input:s,output:t,prompt:"",tabSize:1});We.emitKeypressEvents(s,r),s.isTTY&&s.setRawMode(!0);const a=(e,{name:u,sequence:h})=>{const m=String(e);if(gt([m,u,h],"cancel")){n&&t.write(pe.cursor.show),process.exit(0);return}if(!i)return;const y=u==="return"?0:-1,p=u==="return"?-1:0;We.moveCursor(t,y,p,()=>{We.clearLine(t,1,()=>{s.once("keypress",a)})})};return n&&t.write(pe.cursor.hide),s.once("keypress",a),()=>{s.off("keypress",a),n&&t.write(pe.cursor.show),s.isTTY&&!pn&&s.setRawMode(!1),r.terminal=!1,r.close()}}var En=Object.defineProperty,gn=(s,t,i)=>t in s?En(s,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):s[t]=i,Fe=(s,t,i)=>(gn(s,typeof t!="symbol"?t+"":t,i),i);class Xe{constructor(t,i=!0){Fe(this,"input"),Fe(this,"output"),Fe(this,"_abortSignal"),Fe(this,"rl"),Fe(this,"opts"),Fe(this,"_render"),Fe(this,"_track",!1),Fe(this,"_prevFrame",""),Fe(this,"_subscribers",new Map),Fe(this,"_cursor",0),Fe(this,"state","initial"),Fe(this,"error",""),Fe(this,"value");const{input:n=xs,output:r=Ts,render:a,signal:e,...u}=t;this.opts=u,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=a.bind(this),this._track=i,this._abortSignal=e,this.input=n,this.output=r}unsubscribe(){this._subscribers.clear()}setSubscriber(t,i){const n=this._subscribers.get(t)??[];n.push(i),this._subscribers.set(t,n)}on(t,i){this.setSubscriber(t,{cb:i})}once(t,i){this.setSubscriber(t,{cb:i,once:!0})}emit(t,...i){const n=this._subscribers.get(t)??[],r=[];for(const a of n)a.cb(...i),a.once&&r.push(()=>n.splice(n.indexOf(a),1));for(const a of r)a()}prompt(){return new Promise((t,i)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),t(Ct);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}const n=new Nr(0);n._write=(r,a,e)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),e()},this.input.pipe(n),this.rl=$s.createInterface({input:this.input,output:n,tabSize:2,prompt:"",escapeCodeTimeout:50}),$s.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),Ze(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(pe.cursor.show),this.output.off("resize",this.render),Ze(this.input,!1),t(this.value)}),this.once("cancel",()=>{this.output.write(pe.cursor.show),this.output.off("resize",this.render),Ze(this.input,!1),t(Ct)})})}onKeypress(t,i){if(this.state==="error"&&(this.state="active"),i?.name&&(!this._track&&Ye.aliases.has(i.name)&&this.emit("cursor",Ye.aliases.get(i.name)),Ye.actions.has(i.name)&&this.emit("cursor",i.name)),t&&(t.toLowerCase()==="y"||t.toLowerCase()==="n")&&this.emit("confirm",t.toLowerCase()==="y"),t===" "&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),t&&this.emit("key",t.toLowerCase()),i?.name==="return"){if(this.opts.validate){const n=this.opts.validate(this.value);n&&(this.error=n instanceof Error?n.message:n,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}gt([t,i?.name,i?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
10
+ `),Ze(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){const t=Js(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
11
+ `).length-1;this.output.write(pe.cursor.move(-999,t*-1))}render(){const t=Js(this._render(this)??"",process.stdout.columns,{hard:!0});if(t!==this._prevFrame){if(this.state==="initial")this.output.write(pe.cursor.hide);else{const i=dn(this._prevFrame,t);if(this.restoreCursor(),i&&i?.length===1){const n=i[0];this.output.write(pe.cursor.move(0,n)),this.output.write(pe.erase.lines(1));const r=t.split(`
12
+ `);this.output.write(r[n]),this._prevFrame=t,this.output.write(pe.cursor.move(0,r.length-n-1));return}if(i&&i?.length>1){const n=i[0];this.output.write(pe.cursor.move(0,n)),this.output.write(pe.erase.down());const r=t.split(`
13
+ `).slice(n);this.output.write(r.join(`
14
+ `)),this._prevFrame=t;return}this.output.write(pe.erase.down())}this.output.write(t),this.state==="initial"&&(this.state="active"),this._prevFrame=t}}}class Cn extends Xe{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(t){super(t,!1),this.value=!!t.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",i=>{this.output.write(pe.cursor.move(0,-1)),this.value=i,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}}var Fn=Object.defineProperty,yn=(s,t,i)=>t in s?Fn(s,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):s[t]=i,Qs=(s,t,i)=>(yn(s,typeof t!="symbol"?t+"":t,i),i);let bn=class extends Xe{constructor(s){super(s,!1),Qs(this,"options"),Qs(this,"cursor",0),this.options=s.options,this.value=[...s.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:t})=>t===s.cursorAt),0),this.on("key",t=>{t==="a"&&this.toggleAll()}),this.on("cursor",t=>{switch(t){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}})}get _value(){return this.options[this.cursor].value}toggleAll(){const s=this.value.length===this.options.length;this.value=s?[]:this.options.map(t=>t.value)}toggleValue(){const s=this.value.includes(this._value);this.value=s?this.value.filter(t=>t!==this._value):[...this.value,this._value]}};var wn=Object.defineProperty,_n=(s,t,i)=>t in s?wn(s,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):s[t]=i,ei=(s,t,i)=>(_n(s,typeof t!="symbol"?t+"":t,i),i);class vn extends Xe{constructor(t){super(t,!1),ei(this,"options"),ei(this,"cursor",0),this.options=t.options,this.cursor=this.options.findIndex(({value:i})=>i===t.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",i=>{switch(i){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}}class An extends Xe{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;const t=this.value.slice(0,this.cursor),[i,...n]=this.value.slice(this.cursor);return`${t}${I.inverse(i)}${n.join("")}`}get cursor(){return this._cursor}constructor(t){super(t),this.on("finalize",()=>{this.value||(this.value=t.defaultValue)})}}function Sn(){return Q.platform!=="win32"?Q.env.TERM!=="linux":!!Q.env.CI||!!Q.env.WT_SESSION||!!Q.env.TERMINUS_SUBLIME||Q.env.ConEmuTask==="{cmd::Cmder}"||Q.env.TERM_PROGRAM==="Terminus-Sublime"||Q.env.TERM_PROGRAM==="vscode"||Q.env.TERM==="xterm-256color"||Q.env.TERM==="alacritty"||Q.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const Ft=Sn(),me=(s,t)=>Ft?s:t,On=me("\u25C6","*"),ti=me("\u25A0","x"),si=me("\u25B2","x"),yt=me("\u25C7","o"),Rn=me("\u250C","T"),ee=me("\u2502","|"),ve=me("\u2514","\u2014"),bt=me("\u25CF",">"),wt=me("\u25CB"," "),Bn=me("\u25FB","[\u2022]"),ii=me("\u25FC","[+]"),xn=me("\u25FB","[ ]"),Tn=me("\u25CF","\u2022"),$n=me("\u25C6","*"),Nn=me("\u25B2","!"),In=me("\u25A0","x"),Je=s=>{switch(s){case"initial":case"active":return I.cyan(On);case"cancel":return I.red(ti);case"error":return I.yellow(si);case"submit":return I.green(yt)}},_t=s=>{const{cursor:t,options:i,style:n}=s,r=s.maxItems??Number.POSITIVE_INFINITY,a=Math.max(process.stdout.rows-4,0),e=Math.min(a,Math.max(r,5));let u=0;t>=u+e-3?u=Math.max(Math.min(t-e+3,i.length-e),0):t<u+2&&(u=Math.max(t-2,0));const h=e<i.length&&u>0,m=e<i.length&&u+e<i.length;return i.slice(u,u+e).map((y,p,C)=>{const w=p===0&&h,b=p===C.length-1&&m;return w||b?I.dim("..."):n(y,p+u===t)})},Qe=s=>new An({validate:s.validate,placeholder:s.placeholder,defaultValue:s.defaultValue,initialValue:s.initialValue,render(){const t=`${I.gray(ee)}
15
+ ${Je(this.state)} ${s.message}
16
+ `,i=s.placeholder?I.inverse(s.placeholder[0])+I.dim(s.placeholder.slice(1)):I.inverse(I.hidden("_")),n=this.value?this.valueWithCursor:i;switch(this.state){case"error":return`${t.trim()}
17
+ ${I.yellow(ee)} ${n}
18
18
  ${I.yellow(ve)} ${I.yellow(this.error)}
19
- `;case"submit":return`${t}${I.gray(Q)} ${I.dim(this.value||u.placeholder)}`;case"cancel":return`${t}${I.gray(Q)} ${I.strikethrough(I.dim(this.value??""))}${this.value?.trim()?`
20
- ${I.gray(Q)}`:""}`;default:return`${t}${I.cyan(Q)} ${r}
19
+ `;case"submit":return`${t}${I.gray(ee)} ${I.dim(this.value||s.placeholder)}`;case"cancel":return`${t}${I.gray(ee)} ${I.strikethrough(I.dim(this.value??""))}${this.value?.trim()?`
20
+ ${I.gray(ee)}`:""}`;default:return`${t}${I.cyan(ee)} ${n}
21
21
  ${I.cyan(ve)}
22
- `}}}).prompt(),es=u=>{const t=u.active??"Yes",s=u.inactive??"No";return new tn({active:t,inactive:s,initialValue:u.initialValue??!0,render(){const r=`${I.gray(Q)}
23
- ${Xe(this.state)} ${u.message}
24
- `,i=this.value?t:s;switch(this.state){case"submit":return`${r}${I.gray(Q)} ${I.dim(i)}`;case"cancel":return`${r}${I.gray(Q)} ${I.strikethrough(I.dim(i))}
25
- ${I.gray(Q)}`;default:return`${r}${I.cyan(Q)} ${this.value?`${I.green(yt)} ${t}`:`${I.dim(bt)} ${I.dim(t)}`} ${I.dim("/")} ${this.value?`${I.dim(bt)} ${I.dim(s)}`:`${I.green(yt)} ${s}`}
22
+ `}}}).prompt(),ri=s=>{const t=s.active??"Yes",i=s.inactive??"No";return new Cn({active:t,inactive:i,initialValue:s.initialValue??!0,render(){const n=`${I.gray(ee)}
23
+ ${Je(this.state)} ${s.message}
24
+ `,r=this.value?t:i;switch(this.state){case"submit":return`${n}${I.gray(ee)} ${I.dim(r)}`;case"cancel":return`${n}${I.gray(ee)} ${I.strikethrough(I.dim(r))}
25
+ ${I.gray(ee)}`;default:return`${n}${I.cyan(ee)} ${this.value?`${I.green(bt)} ${t}`:`${I.dim(wt)} ${I.dim(t)}`} ${I.dim("/")} ${this.value?`${I.dim(wt)} ${I.dim(i)}`:`${I.green(bt)} ${i}`}
26
26
  ${I.cyan(ve)}
27
- `}}}).prompt()},ts=u=>{const t=(s,r)=>{const i=s.label??String(s.value);switch(r){case"selected":return`${I.dim(i)}`;case"active":return`${I.green(yt)} ${i} ${s.hint?I.dim(`(${s.hint})`):""}`;case"cancelled":return`${I.strikethrough(I.dim(i))}`;default:return`${I.dim(bt)} ${I.dim(i)}`}};return new an({options:u.options,initialValue:u.initialValue,render(){const s=`${I.gray(Q)}
28
- ${Xe(this.state)} ${u.message}
29
- `;switch(this.state){case"submit":return`${s}${I.gray(Q)} ${t(this.options[this.cursor],"selected")}`;case"cancel":return`${s}${I.gray(Q)} ${t(this.options[this.cursor],"cancelled")}
30
- ${I.gray(Q)}`;default:return`${s}${I.cyan(Q)} ${_t({cursor:this.cursor,options:this.options,maxItems:u.maxItems,style:(r,i)=>t(r,i?"active":"inactive")}).join(`
31
- ${I.cyan(Q)} `)}
27
+ `}}}).prompt()},ni=s=>{const t=(i,n)=>{const r=i.label??String(i.value);switch(n){case"selected":return`${I.dim(r)}`;case"active":return`${I.green(bt)} ${r} ${i.hint?I.dim(`(${i.hint})`):""}`;case"cancelled":return`${I.strikethrough(I.dim(r))}`;default:return`${I.dim(wt)} ${I.dim(r)}`}};return new vn({options:s.options,initialValue:s.initialValue,render(){const i=`${I.gray(ee)}
28
+ ${Je(this.state)} ${s.message}
29
+ `;switch(this.state){case"submit":return`${i}${I.gray(ee)} ${t(this.options[this.cursor],"selected")}`;case"cancel":return`${i}${I.gray(ee)} ${t(this.options[this.cursor],"cancelled")}
30
+ ${I.gray(ee)}`;default:return`${i}${I.cyan(ee)} ${_t({cursor:this.cursor,options:this.options,maxItems:s.maxItems,style:(n,r)=>t(n,r?"active":"inactive")}).join(`
31
+ ${I.cyan(ee)} `)}
32
32
  ${I.cyan(ve)}
33
- `}}}).prompt()},Cn=u=>{const t=(s,r)=>{const i=s.label??String(s.value);return r==="active"?`${I.cyan(fn)} ${i} ${s.hint?I.dim(`(${s.hint})`):""}`:r==="selected"?`${I.green(Qi)} ${I.dim(i)}`:r==="cancelled"?`${I.strikethrough(I.dim(i))}`:r==="active-selected"?`${I.green(Qi)} ${i} ${s.hint?I.dim(`(${s.hint})`):""}`:r==="submitted"?`${I.dim(i)}`:`${I.dim(dn)} ${I.dim(i)}`};return new nn({options:u.options,initialValues:u.initialValues,required:u.required??!0,cursorAt:u.cursorAt,validate(s){if(this.required&&s.length===0)return`Please select at least one option.
34
- ${I.reset(I.dim(`Press ${I.gray(I.bgWhite(I.inverse(" space ")))} to select, ${I.gray(I.bgWhite(I.inverse(" enter ")))} to submit`))}`},render(){const s=`${I.gray(Q)}
35
- ${Xe(this.state)} ${u.message}
36
- `,r=(i,a)=>{const e=this.value.includes(i.value);return a&&e?t(i,"active-selected"):e?t(i,"selected"):t(i,a?"active":"inactive")};switch(this.state){case"submit":return`${s}${I.gray(Q)} ${this.options.filter(({value:i})=>this.value.includes(i)).map(i=>t(i,"submitted")).join(I.dim(", "))||I.dim("none")}`;case"cancel":{const i=this.options.filter(({value:a})=>this.value.includes(a)).map(a=>t(a,"cancelled")).join(I.dim(", "));return`${s}${I.gray(Q)} ${i.trim()?`${i}
37
- ${I.gray(Q)}`:""}`}case"error":{const i=this.error.split(`
33
+ `}}}).prompt()},Ln=s=>{const t=(i,n)=>{const r=i.label??String(i.value);return n==="active"?`${I.cyan(Bn)} ${r} ${i.hint?I.dim(`(${i.hint})`):""}`:n==="selected"?`${I.green(ii)} ${I.dim(r)}`:n==="cancelled"?`${I.strikethrough(I.dim(r))}`:n==="active-selected"?`${I.green(ii)} ${r} ${i.hint?I.dim(`(${i.hint})`):""}`:n==="submitted"?`${I.dim(r)}`:`${I.dim(xn)} ${I.dim(r)}`};return new bn({options:s.options,initialValues:s.initialValues,required:s.required??!0,cursorAt:s.cursorAt,validate(i){if(this.required&&i.length===0)return`Please select at least one option.
34
+ ${I.reset(I.dim(`Press ${I.gray(I.bgWhite(I.inverse(" space ")))} to select, ${I.gray(I.bgWhite(I.inverse(" enter ")))} to submit`))}`},render(){const i=`${I.gray(ee)}
35
+ ${Je(this.state)} ${s.message}
36
+ `,n=(r,a)=>{const e=this.value.includes(r.value);return a&&e?t(r,"active-selected"):e?t(r,"selected"):t(r,a?"active":"inactive")};switch(this.state){case"submit":return`${i}${I.gray(ee)} ${this.options.filter(({value:r})=>this.value.includes(r)).map(r=>t(r,"submitted")).join(I.dim(", "))||I.dim("none")}`;case"cancel":{const r=this.options.filter(({value:a})=>this.value.includes(a)).map(a=>t(a,"cancelled")).join(I.dim(", "));return`${i}${I.gray(ee)} ${r.trim()?`${r}
37
+ ${I.gray(ee)}`:""}`}case"error":{const r=this.error.split(`
38
38
  `).map((a,e)=>e===0?`${I.yellow(ve)} ${I.yellow(a)}`:` ${a}`).join(`
39
- `);return`${s+I.yellow(Q)} ${_t({options:this.options,cursor:this.cursor,maxItems:u.maxItems,style:r}).join(`
40
- ${I.yellow(Q)} `)}
41
- ${i}
42
- `}default:return`${s}${I.cyan(Q)} ${_t({options:this.options,cursor:this.cursor,maxItems:u.maxItems,style:r}).join(`
43
- ${I.cyan(Q)} `)}
39
+ `);return`${i+I.yellow(ee)} ${_t({options:this.options,cursor:this.cursor,maxItems:s.maxItems,style:n}).join(`
40
+ ${I.yellow(ee)} `)}
41
+ ${r}
42
+ `}default:return`${i}${I.cyan(ee)} ${_t({options:this.options,cursor:this.cursor,maxItems:s.maxItems,style:n}).join(`
43
+ ${I.cyan(ee)} `)}
44
44
  ${I.cyan(ve)}
45
- `}}}).prompt()},is=(u="")=>{process.stdout.write(`${I.gray(ve)} ${I.red(u)}
45
+ `}}}).prompt()},ui=(s="")=>{process.stdout.write(`${I.gray(ve)} ${I.red(s)}
46
46
 
47
- `)},ss=(u="")=>{process.stdout.write(`${I.gray(Dn)} ${u}
48
- `)},Fn=(u="")=>{process.stdout.write(`${I.gray(Q)}
49
- ${I.gray(ve)} ${u}
47
+ `)},oi=(s="")=>{process.stdout.write(`${I.gray(Rn)} ${s}
48
+ `)},Pn=(s="")=>{process.stdout.write(`${I.gray(ee)}
49
+ ${I.gray(ve)} ${s}
50
50
 
51
- `)},fe={message:(u="",{symbol:t=I.gray(Q)}={})=>{const s=[`${I.gray(Q)}`];if(u){const[r,...i]=u.split(`
52
- `);s.push(`${t} ${r}`,...i.map(a=>`${I.gray(Q)} ${a}`))}process.stdout.write(`${s.join(`
51
+ `)},ce={message:(s="",{symbol:t=I.gray(ee)}={})=>{const i=[`${I.gray(ee)}`];if(s){const[n,...r]=s.split(`
52
+ `);i.push(`${t} ${n}`,...r.map(a=>`${I.gray(ee)} ${a}`))}process.stdout.write(`${i.join(`
53
53
  `)}
54
- `)},info:u=>{fe.message(u,{symbol:I.blue(mn)})},success:u=>{fe.message(u,{symbol:I.green(pn)})},step:u=>{fe.message(u,{symbol:I.green(Ft)})},warn:u=>{fe.message(u,{symbol:I.yellow(En)})},warning:u=>{fe.warn(u)},error:u=>{fe.message(u,{symbol:I.red(gn)})}};`${I.gray(Q)}`;const rs=({indicator:u="dots"}={})=>{const t=Ct?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],s=Ct?80:120,r=process.env.CI==="true";let i,a,e=!1,o="",h,E=performance.now();const y=f=>{const d=f>1?"Something went wrong":"Canceled";e&&l(d,f)},m=()=>y(2),C=()=>y(1),_=()=>{process.on("uncaughtExceptionMonitor",m),process.on("unhandledRejection",m),process.on("SIGINT",C),process.on("SIGTERM",C),process.on("exit",y)},b=()=>{process.removeListener("uncaughtExceptionMonitor",m),process.removeListener("unhandledRejection",m),process.removeListener("SIGINT",C),process.removeListener("SIGTERM",C),process.removeListener("exit",y)},A=()=>{if(h===void 0)return;r&&process.stdout.write(`
54
+ `)},info:s=>{ce.message(s,{symbol:I.blue(Tn)})},success:s=>{ce.message(s,{symbol:I.green($n)})},step:s=>{ce.message(s,{symbol:I.green(yt)})},warn:s=>{ce.message(s,{symbol:I.yellow(Nn)})},warning:s=>{ce.warn(s)},error:s=>{ce.message(s,{symbol:I.red(In)})}};`${I.gray(ee)}`;const ai=({indicator:s="dots"}={})=>{const t=Ft?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],i=Ft?80:120,n=process.env.CI==="true";let r,a,e=!1,u="",h,m=performance.now();const y=f=>{const d=f>1?"Something went wrong":"Canceled";e&&l(d,f)},p=()=>y(2),C=()=>y(1),w=()=>{process.on("uncaughtExceptionMonitor",p),process.on("unhandledRejection",p),process.on("SIGINT",C),process.on("SIGTERM",C),process.on("exit",y)},b=()=>{process.removeListener("uncaughtExceptionMonitor",p),process.removeListener("unhandledRejection",p),process.removeListener("SIGINT",C),process.removeListener("SIGTERM",C),process.removeListener("exit",y)},A=()=>{if(h===void 0)return;n&&process.stdout.write(`
55
55
  `);const f=h.split(`
56
- `);process.stdout.write(de.cursor.move(-999,f.length-1)),process.stdout.write(de.erase.down(f.length))},S=f=>f.replace(/\.+$/,""),v=f=>{const d=(performance.now()-f)/1e3,D=Math.floor(d/60),F=Math.floor(d%60);return D>0?`[${D}m ${F}s]`:`[${F}s]`},n=(f="")=>{e=!0,i=Jr(),o=S(f),E=performance.now(),process.stdout.write(`${I.gray(Q)}
57
- `);let d=0,D=0;_(),a=setInterval(()=>{if(r&&o===h)return;A(),h=o;const F=I.magenta(t[d]);if(r)process.stdout.write(`${F} ${o}...`);else if(u==="timer")process.stdout.write(`${F} ${o} ${v(E)}`);else{const R=".".repeat(Math.floor(D)).slice(0,3);process.stdout.write(`${F} ${o}${R}`)}d=d+1<t.length?d+1:0,D=D<t.length?D+.125:0},s)},l=(f="",d=0)=>{e=!1,clearInterval(a),A();const D=d===0?I.green(Ft):d===1?I.red(Xi):I.red(Ji);o=S(f??o),u==="timer"?process.stdout.write(`${D} ${o} ${v(E)}
58
- `):process.stdout.write(`${D} ${o}
59
- `),b(),i()};return{start:n,stop:l,message:(f="")=>{o=S(f??o)}}};var Qe={exports:{}},et={},tt={},ns;function it(){if(ns)return tt;ns=1;class u extends Error{constructor(r,i,a){super(a),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=i,this.exitCode=r,this.nestedError=void 0}}class t extends u{constructor(r){super(1,"commander.invalidArgument",r),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}return tt.CommanderError=u,tt.InvalidArgumentError=t,tt}var us;function wt(){if(us)return et;us=1;const{InvalidArgumentError:u}=it();class t{constructor(i,a){switch(this.description=a||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,i[0]){case"<":this.required=!0,this._name=i.slice(1,-1);break;case"[":this.required=!1,this._name=i.slice(1,-1);break;default:this.required=!0,this._name=i;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(i,a){return a===this.defaultValue||!Array.isArray(a)?[i]:a.concat(i)}default(i,a){return this.defaultValue=i,this.defaultValueDescription=a,this}argParser(i){return this.parseArg=i,this}choices(i){return this.argChoices=i.slice(),this.parseArg=(a,e)=>{if(!this.argChoices.includes(a))throw new u(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(a,e):a},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function s(r){const i=r.name()+(r.variadic===!0?"...":"");return r.required?"<"+i+">":"["+i+"]"}return et.Argument=t,et.humanReadableArgName=s,et}var vt={},At={},os;function as(){if(os)return At;os=1;const{humanReadableArgName:u}=wt();class t{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(r){const i=r.commands.filter(a=>!a._hidden);if(r._hasImplicitHelpCommand()){const[,a,e]=r._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/),o=r.createCommand(a).helpOption(!1);o.description(r._helpCommandDescription),e&&o.arguments(e),i.push(o)}return this.sortSubcommands&&i.sort((a,e)=>a.name().localeCompare(e.name())),i}compareOptions(r,i){const a=e=>e.short?e.short.replace(/^-/,""):e.long.replace(/^--/,"");return a(r).localeCompare(a(i))}visibleOptions(r){const i=r.options.filter(o=>!o.hidden),a=r._hasHelpOption&&r._helpShortFlag&&!r._findOption(r._helpShortFlag),e=r._hasHelpOption&&!r._findOption(r._helpLongFlag);if(a||e){let o;a?e?o=r.createOption(r._helpFlags,r._helpDescription):o=r.createOption(r._helpShortFlag,r._helpDescription):o=r.createOption(r._helpLongFlag,r._helpDescription),i.push(o)}return this.sortOptions&&i.sort(this.compareOptions),i}visibleGlobalOptions(r){if(!this.showGlobalOptions)return[];const i=[];for(let a=r.parent;a;a=a.parent){const e=a.options.filter(o=>!o.hidden);i.push(...e)}return this.sortOptions&&i.sort(this.compareOptions),i}visibleArguments(r){return r._argsDescription&&r._args.forEach(i=>{i.description=i.description||r._argsDescription[i.name()]||""}),r._args.find(i=>i.description)?r._args:[]}subcommandTerm(r){const i=r._args.map(a=>u(a)).join(" ");return r._name+(r._aliases[0]?"|"+r._aliases[0]:"")+(r.options.length?" [options]":"")+(i?" "+i:"")}optionTerm(r){return r.flags}argumentTerm(r){return r.name()}longestSubcommandTermLength(r,i){return i.visibleCommands(r).reduce((a,e)=>Math.max(a,i.subcommandTerm(e).length),0)}longestOptionTermLength(r,i){return i.visibleOptions(r).reduce((a,e)=>Math.max(a,i.optionTerm(e).length),0)}longestGlobalOptionTermLength(r,i){return i.visibleGlobalOptions(r).reduce((a,e)=>Math.max(a,i.optionTerm(e).length),0)}longestArgumentTermLength(r,i){return i.visibleArguments(r).reduce((a,e)=>Math.max(a,i.argumentTerm(e).length),0)}commandUsage(r){let i=r._name;r._aliases[0]&&(i=i+"|"+r._aliases[0]);let a="";for(let e=r.parent;e;e=e.parent)a=e.name()+" "+a;return a+i+" "+r.usage()}commandDescription(r){return r.description()}subcommandDescription(r){return r.summary()||r.description()}optionDescription(r){const i=[];return r.argChoices&&i.push(`choices: ${r.argChoices.map(a=>JSON.stringify(a)).join(", ")}`),r.defaultValue!==void 0&&(r.required||r.optional||r.isBoolean()&&typeof r.defaultValue=="boolean")&&i.push(`default: ${r.defaultValueDescription||JSON.stringify(r.defaultValue)}`),r.presetArg!==void 0&&r.optional&&i.push(`preset: ${JSON.stringify(r.presetArg)}`),r.envVar!==void 0&&i.push(`env: ${r.envVar}`),i.length>0?`${r.description} (${i.join(", ")})`:r.description}argumentDescription(r){const i=[];if(r.argChoices&&i.push(`choices: ${r.argChoices.map(a=>JSON.stringify(a)).join(", ")}`),r.defaultValue!==void 0&&i.push(`default: ${r.defaultValueDescription||JSON.stringify(r.defaultValue)}`),i.length>0){const a=`(${i.join(", ")})`;return r.description?`${r.description} ${a}`:a}return r.description}formatHelp(r,i){const a=i.padWidth(r,i),e=i.helpWidth||80,o=2,h=2;function E(S,v){if(v){const n=`${S.padEnd(a+h)}${v}`;return i.wrap(n,e-o,a+h)}return S}function y(S){return S.join(`
60
- `).replace(/^/gm," ".repeat(o))}let m=[`Usage: ${i.commandUsage(r)}`,""];const C=i.commandDescription(r);C.length>0&&(m=m.concat([i.wrap(C,e,0),""]));const _=i.visibleArguments(r).map(S=>E(i.argumentTerm(S),i.argumentDescription(S)));_.length>0&&(m=m.concat(["Arguments:",y(_),""]));const b=i.visibleOptions(r).map(S=>E(i.optionTerm(S),i.optionDescription(S)));if(b.length>0&&(m=m.concat(["Options:",y(b),""])),this.showGlobalOptions){const S=i.visibleGlobalOptions(r).map(v=>E(i.optionTerm(v),i.optionDescription(v)));S.length>0&&(m=m.concat(["Global Options:",y(S),""]))}const A=i.visibleCommands(r).map(S=>E(i.subcommandTerm(S),i.subcommandDescription(S)));return A.length>0&&(m=m.concat(["Commands:",y(A),""])),m.join(`
61
- `)}padWidth(r,i){return Math.max(i.longestOptionTermLength(r,i),i.longestGlobalOptionTermLength(r,i),i.longestSubcommandTermLength(r,i),i.longestArgumentTermLength(r,i))}wrap(r,i,a,e=40){const o=" \\f\\t\\v\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF",h=new RegExp(`[\\n][${o}]+`);if(r.match(h))return r;const E=i-a;if(E<e)return r;const y=r.slice(0,a),m=r.slice(a).replace(`\r
56
+ `);process.stdout.write(pe.cursor.move(-999,f.length-1)),process.stdout.write(pe.erase.down(f.length))},S=f=>f.replace(/\.+$/,""),v=f=>{const d=(performance.now()-f)/1e3,D=Math.floor(d/60),F=Math.floor(d%60);return D>0?`[${D}m ${F}s]`:`[${F}s]`},o=(f="")=>{e=!0,r=mn(),u=S(f),m=performance.now(),process.stdout.write(`${I.gray(ee)}
57
+ `);let d=0,D=0;w(),a=setInterval(()=>{if(n&&u===h)return;A(),h=u;const F=I.magenta(t[d]);if(n)process.stdout.write(`${F} ${u}...`);else if(s==="timer")process.stdout.write(`${F} ${u} ${v(m)}`);else{const R=".".repeat(Math.floor(D)).slice(0,3);process.stdout.write(`${F} ${u}${R}`)}d=d+1<t.length?d+1:0,D=D<t.length?D+.125:0},i)},l=(f="",d=0)=>{e=!1,clearInterval(a),A();const D=d===0?I.green(yt):d===1?I.red(ti):I.red(si);u=S(f??u),s==="timer"?process.stdout.write(`${D} ${u} ${v(m)}
58
+ `):process.stdout.write(`${D} ${u}
59
+ `),b(),r()};return{start:o,stop:l,message:(f="")=>{u=S(f??u)}}};var et={exports:{}},tt={},st={},hi;function it(){if(hi)return st;hi=1;class s extends Error{constructor(n,r,a){super(a),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=n,this.nestedError=void 0}}class t extends s{constructor(n){super(1,"commander.invalidArgument",n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}return st.CommanderError=s,st.InvalidArgumentError=t,st}var li;function vt(){if(li)return tt;li=1;const{InvalidArgumentError:s}=it();class t{constructor(r,a){switch(this.description=a||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,r[0]){case"<":this.required=!0,this._name=r.slice(1,-1);break;case"[":this.required=!1,this._name=r.slice(1,-1);break;default:this.required=!0,this._name=r;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(r,a){return a===this.defaultValue||!Array.isArray(a)?[r]:a.concat(r)}default(r,a){return this.defaultValue=r,this.defaultValueDescription=a,this}argParser(r){return this.parseArg=r,this}choices(r){return this.argChoices=r.slice(),this.parseArg=(a,e)=>{if(!this.argChoices.includes(a))throw new s(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(a,e):a},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function i(n){const r=n.name()+(n.variadic===!0?"...":"");return n.required?"<"+r+">":"["+r+"]"}return tt.Argument=t,tt.humanReadableArgName=i,tt}var At={},St={},ci;function Di(){if(ci)return St;ci=1;const{humanReadableArgName:s}=vt();class t{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(n){const r=n.commands.filter(a=>!a._hidden);if(n._hasImplicitHelpCommand()){const[,a,e]=n._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/),u=n.createCommand(a).helpOption(!1);u.description(n._helpCommandDescription),e&&u.arguments(e),r.push(u)}return this.sortSubcommands&&r.sort((a,e)=>a.name().localeCompare(e.name())),r}compareOptions(n,r){const a=e=>e.short?e.short.replace(/^-/,""):e.long.replace(/^--/,"");return a(n).localeCompare(a(r))}visibleOptions(n){const r=n.options.filter(u=>!u.hidden),a=n._hasHelpOption&&n._helpShortFlag&&!n._findOption(n._helpShortFlag),e=n._hasHelpOption&&!n._findOption(n._helpLongFlag);if(a||e){let u;a?e?u=n.createOption(n._helpFlags,n._helpDescription):u=n.createOption(n._helpShortFlag,n._helpDescription):u=n.createOption(n._helpLongFlag,n._helpDescription),r.push(u)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(n){if(!this.showGlobalOptions)return[];const r=[];for(let a=n.parent;a;a=a.parent){const e=a.options.filter(u=>!u.hidden);r.push(...e)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(n){return n._argsDescription&&n._args.forEach(r=>{r.description=r.description||n._argsDescription[r.name()]||""}),n._args.find(r=>r.description)?n._args:[]}subcommandTerm(n){const r=n._args.map(a=>s(a)).join(" ");return n._name+(n._aliases[0]?"|"+n._aliases[0]:"")+(n.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(n){return n.flags}argumentTerm(n){return n.name()}longestSubcommandTermLength(n,r){return r.visibleCommands(n).reduce((a,e)=>Math.max(a,r.subcommandTerm(e).length),0)}longestOptionTermLength(n,r){return r.visibleOptions(n).reduce((a,e)=>Math.max(a,r.optionTerm(e).length),0)}longestGlobalOptionTermLength(n,r){return r.visibleGlobalOptions(n).reduce((a,e)=>Math.max(a,r.optionTerm(e).length),0)}longestArgumentTermLength(n,r){return r.visibleArguments(n).reduce((a,e)=>Math.max(a,r.argumentTerm(e).length),0)}commandUsage(n){let r=n._name;n._aliases[0]&&(r=r+"|"+n._aliases[0]);let a="";for(let e=n.parent;e;e=e.parent)a=e.name()+" "+a;return a+r+" "+n.usage()}commandDescription(n){return n.description()}subcommandDescription(n){return n.summary()||n.description()}optionDescription(n){const r=[];return n.argChoices&&r.push(`choices: ${n.argChoices.map(a=>JSON.stringify(a)).join(", ")}`),n.defaultValue!==void 0&&(n.required||n.optional||n.isBoolean()&&typeof n.defaultValue=="boolean")&&r.push(`default: ${n.defaultValueDescription||JSON.stringify(n.defaultValue)}`),n.presetArg!==void 0&&n.optional&&r.push(`preset: ${JSON.stringify(n.presetArg)}`),n.envVar!==void 0&&r.push(`env: ${n.envVar}`),r.length>0?`${n.description} (${r.join(", ")})`:n.description}argumentDescription(n){const r=[];if(n.argChoices&&r.push(`choices: ${n.argChoices.map(a=>JSON.stringify(a)).join(", ")}`),n.defaultValue!==void 0&&r.push(`default: ${n.defaultValueDescription||JSON.stringify(n.defaultValue)}`),r.length>0){const a=`(${r.join(", ")})`;return n.description?`${n.description} ${a}`:a}return n.description}formatHelp(n,r){const a=r.padWidth(n,r),e=r.helpWidth||80,u=2,h=2;function m(S,v){if(v){const o=`${S.padEnd(a+h)}${v}`;return r.wrap(o,e-u,a+h)}return S}function y(S){return S.join(`
60
+ `).replace(/^/gm," ".repeat(u))}let p=[`Usage: ${r.commandUsage(n)}`,""];const C=r.commandDescription(n);C.length>0&&(p=p.concat([r.wrap(C,e,0),""]));const w=r.visibleArguments(n).map(S=>m(r.argumentTerm(S),r.argumentDescription(S)));w.length>0&&(p=p.concat(["Arguments:",y(w),""]));const b=r.visibleOptions(n).map(S=>m(r.optionTerm(S),r.optionDescription(S)));if(b.length>0&&(p=p.concat(["Options:",y(b),""])),this.showGlobalOptions){const S=r.visibleGlobalOptions(n).map(v=>m(r.optionTerm(v),r.optionDescription(v)));S.length>0&&(p=p.concat(["Global Options:",y(S),""]))}const A=r.visibleCommands(n).map(S=>m(r.subcommandTerm(S),r.subcommandDescription(S)));return A.length>0&&(p=p.concat(["Commands:",y(A),""])),p.join(`
61
+ `)}padWidth(n,r){return Math.max(r.longestOptionTermLength(n,r),r.longestGlobalOptionTermLength(n,r),r.longestSubcommandTermLength(n,r),r.longestArgumentTermLength(n,r))}wrap(n,r,a,e=40){const u=" \\f\\t\\v\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF",h=new RegExp(`[\\n][${u}]+`);if(n.match(h))return n;const m=r-a;if(m<e)return n;const y=n.slice(0,a),p=n.slice(a).replace(`\r
62
62
  `,`
63
63
  `),C=" ".repeat(a),b="\\s\u200B",A=new RegExp(`
64
- |.{1,${E-1}}([${b}]|$)|[^${b}]+?([${b}]|$)`,"g"),S=m.match(A)||[];return y+S.map((v,n)=>v===`
65
- `?"":(n>0?C:"")+v.trimEnd()).join(`
66
- `)}}return At.Help=t,At}var $e={},hs;function ls(){if(hs)return $e;hs=1;const{InvalidArgumentError:u}=it();class t{constructor(e,o){this.flags=e,this.description=o||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;const h=i(e);this.short=h.shortFlag,this.long=h.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,o){return this.defaultValue=e,this.defaultValueDescription=o,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let o=e;return typeof e=="string"&&(o={[e]:!0}),this.implied=Object.assign(this.implied||{},o),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,o){return o===this.defaultValue||!Array.isArray(o)?[e]:o.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(o,h)=>{if(!this.argChoices.includes(o))throw new u(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(o,h):o},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return r(this.name().replace(/^no-/,""))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class s{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(o=>{o.negate?this.negativeOptions.set(o.attributeName(),o):this.positiveOptions.set(o.attributeName(),o)}),this.negativeOptions.forEach((o,h)=>{this.positiveOptions.has(h)&&this.dualOptions.add(h)})}valueFromOption(e,o){const h=o.attributeName();if(!this.dualOptions.has(h))return!0;const E=this.negativeOptions.get(h).presetArg,y=E!==void 0?E:!1;return o.negate===(y===e)}}function r(a){return a.split("-").reduce((e,o)=>e+o[0].toUpperCase()+o.slice(1))}function i(a){let e,o;const h=a.split(/[ |,]+/);return h.length>1&&!/^[[<]/.test(h[1])&&(e=h.shift()),o=h.shift(),!e&&/^-[^-]$/.test(o)&&(e=o,o=void 0),{shortFlag:e,longFlag:o}}return $e.Option=t,$e.splitOptionFlags=i,$e.DualOptions=s,$e}var St={},cs;function yn(){if(cs)return St;cs=1;const u=3;function t(r,i){if(Math.abs(r.length-i.length)>u)return Math.max(r.length,i.length);const a=[];for(let e=0;e<=r.length;e++)a[e]=[e];for(let e=0;e<=i.length;e++)a[0][e]=e;for(let e=1;e<=i.length;e++)for(let o=1;o<=r.length;o++){let h=1;r[o-1]===i[e-1]?h=0:h=1,a[o][e]=Math.min(a[o-1][e]+1,a[o][e-1]+1,a[o-1][e-1]+h),o>1&&e>1&&r[o-1]===i[e-2]&&r[o-2]===i[e-1]&&(a[o][e]=Math.min(a[o][e],a[o-2][e-2]+1))}return a[r.length][i.length]}function s(r,i){if(!i||i.length===0)return"";i=Array.from(new Set(i));const a=r.startsWith("--");a&&(r=r.slice(2),i=i.map(E=>E.slice(2)));let e=[],o=u;const h=.4;return i.forEach(E=>{if(E.length<=1)return;const y=t(r,E),m=Math.max(r.length,E.length);(m-y)/m>h&&(y<o?(o=y,e=[E]):y===o&&e.push(E))}),e.sort((E,y)=>E.localeCompare(y)),a&&(e=e.map(E=>`--${E}`)),e.length>1?`
64
+ |.{1,${m-1}}([${b}]|$)|[^${b}]+?([${b}]|$)`,"g"),S=p.match(A)||[];return y+S.map((v,o)=>v===`
65
+ `?"":(o>0?C:"")+v.trimEnd()).join(`
66
+ `)}}return St.Help=t,St}var Ne={},fi;function di(){if(fi)return Ne;fi=1;const{InvalidArgumentError:s}=it();class t{constructor(e,u){this.flags=e,this.description=u||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;const h=r(e);this.short=h.shortFlag,this.long=h.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,u){return this.defaultValue=e,this.defaultValueDescription=u,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let u=e;return typeof e=="string"&&(u={[e]:!0}),this.implied=Object.assign(this.implied||{},u),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,u){return u===this.defaultValue||!Array.isArray(u)?[e]:u.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(u,h)=>{if(!this.argChoices.includes(u))throw new s(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(u,h):u},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return n(this.name().replace(/^no-/,""))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class i{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(u=>{u.negate?this.negativeOptions.set(u.attributeName(),u):this.positiveOptions.set(u.attributeName(),u)}),this.negativeOptions.forEach((u,h)=>{this.positiveOptions.has(h)&&this.dualOptions.add(h)})}valueFromOption(e,u){const h=u.attributeName();if(!this.dualOptions.has(h))return!0;const m=this.negativeOptions.get(h).presetArg,y=m!==void 0?m:!1;return u.negate===(y===e)}}function n(a){return a.split("-").reduce((e,u)=>e+u[0].toUpperCase()+u.slice(1))}function r(a){let e,u;const h=a.split(/[ |,]+/);return h.length>1&&!/^[[<]/.test(h[1])&&(e=h.shift()),u=h.shift(),!e&&/^-[^-]$/.test(u)&&(e=u,u=void 0),{shortFlag:e,longFlag:u}}return Ne.Option=t,Ne.splitOptionFlags=r,Ne.DualOptions=i,Ne}var Ot={},pi;function Mn(){if(pi)return Ot;pi=1;const s=3;function t(n,r){if(Math.abs(n.length-r.length)>s)return Math.max(n.length,r.length);const a=[];for(let e=0;e<=n.length;e++)a[e]=[e];for(let e=0;e<=r.length;e++)a[0][e]=e;for(let e=1;e<=r.length;e++)for(let u=1;u<=n.length;u++){let h=1;n[u-1]===r[e-1]?h=0:h=1,a[u][e]=Math.min(a[u-1][e]+1,a[u][e-1]+1,a[u-1][e-1]+h),u>1&&e>1&&n[u-1]===r[e-2]&&n[u-2]===r[e-1]&&(a[u][e]=Math.min(a[u][e],a[u-2][e-2]+1))}return a[n.length][r.length]}function i(n,r){if(!r||r.length===0)return"";r=Array.from(new Set(r));const a=n.startsWith("--");a&&(n=n.slice(2),r=r.map(m=>m.slice(2)));let e=[],u=s;const h=.4;return r.forEach(m=>{if(m.length<=1)return;const y=t(n,m),p=Math.max(n.length,m.length);(p-y)/p>h&&(y<u?(u=y,e=[m]):y===u&&e.push(m))}),e.sort((m,y)=>m.localeCompare(y)),a&&(e=e.map(m=>`--${m}`)),e.length>1?`
67
67
  (Did you mean one of ${e.join(", ")}?)`:e.length===1?`
68
- (Did you mean ${e[0]}?)`:""}return St.suggestSimilar=s,St}var Ds;function bn(){if(Ds)return vt;Ds=1;const u=xe.EventEmitter,t=br,s=De,r=ge,i=xi,{Argument:a,humanReadableArgName:e}=wt(),{CommanderError:o}=it(),{Help:h}=as(),{Option:E,splitOptionFlags:y,DualOptions:m}=ls(),{suggestSimilar:C}=yn();class _ extends u{constructor(n){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this._args=[],this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=n||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:l=>i.stdout.write(l),writeErr:l=>i.stderr.write(l),getOutHelpWidth:()=>i.stdout.isTTY?i.stdout.columns:void 0,getErrHelpWidth:()=>i.stderr.isTTY?i.stderr.columns:void 0,outputError:(l,f)=>f(l)},this._hidden=!1,this._hasHelpOption=!0,this._helpFlags="-h, --help",this._helpDescription="display help for command",this._helpShortFlag="-h",this._helpLongFlag="--help",this._addImplicitHelpCommand=void 0,this._helpCommandName="help",this._helpCommandnameAndArgs="help [command]",this._helpCommandDescription="display help for command",this._helpConfiguration={}}copyInheritedSettings(n){return this._outputConfiguration=n._outputConfiguration,this._hasHelpOption=n._hasHelpOption,this._helpFlags=n._helpFlags,this._helpDescription=n._helpDescription,this._helpShortFlag=n._helpShortFlag,this._helpLongFlag=n._helpLongFlag,this._helpCommandName=n._helpCommandName,this._helpCommandnameAndArgs=n._helpCommandnameAndArgs,this._helpCommandDescription=n._helpCommandDescription,this._helpConfiguration=n._helpConfiguration,this._exitCallback=n._exitCallback,this._storeOptionsAsProperties=n._storeOptionsAsProperties,this._combineFlagAndOptionalValue=n._combineFlagAndOptionalValue,this._allowExcessArguments=n._allowExcessArguments,this._enablePositionalOptions=n._enablePositionalOptions,this._showHelpAfterError=n._showHelpAfterError,this._showSuggestionAfterError=n._showSuggestionAfterError,this}command(n,l,f){let d=l,D=f;typeof d=="object"&&d!==null&&(D=d,d=null),D=D||{};const[,F,R]=n.match(/([^ ]+) *(.*)/),B=this.createCommand(F);return d&&(B.description(d),B._executableHandler=!0),D.isDefault&&(this._defaultCommandName=B._name),B._hidden=!!(D.noHelp||D.hidden),B._executableFile=D.executableFile||null,R&&B.arguments(R),this.commands.push(B),B.parent=this,B.copyInheritedSettings(this),d?this:B}createCommand(n){return new _(n)}createHelp(){return Object.assign(new h,this.configureHelp())}configureHelp(n){return n===void 0?this._helpConfiguration:(this._helpConfiguration=n,this)}configureOutput(n){return n===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,n),this)}showHelpAfterError(n=!0){return typeof n!="string"&&(n=!!n),this._showHelpAfterError=n,this}showSuggestionAfterError(n=!0){return this._showSuggestionAfterError=!!n,this}addCommand(n,l){if(!n._name)throw new Error(`Command passed to .addCommand() must have a name
69
- - specify the name in Command constructor or using .name()`);return l=l||{},l.isDefault&&(this._defaultCommandName=n._name),(l.noHelp||l.hidden)&&(n._hidden=!0),this.commands.push(n),n.parent=this,this}createArgument(n,l){return new a(n,l)}argument(n,l,f,d){const D=this.createArgument(n,l);return typeof f=="function"?D.default(d).argParser(f):D.default(f),this.addArgument(D),this}arguments(n){return n.split(/ +/).forEach(l=>{this.argument(l)}),this}addArgument(n){const l=this._args.slice(-1)[0];if(l&&l.variadic)throw new Error(`only the last argument can be variadic '${l.name()}'`);if(n.required&&n.defaultValue!==void 0&&n.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${n.name()}'`);return this._args.push(n),this}addHelpCommand(n,l){return n===!1?this._addImplicitHelpCommand=!1:(this._addImplicitHelpCommand=!0,typeof n=="string"&&(this._helpCommandName=n.split(" ")[0],this._helpCommandnameAndArgs=n),this._helpCommandDescription=l||this._helpCommandDescription),this}_hasImplicitHelpCommand(){return this._addImplicitHelpCommand===void 0?this.commands.length&&!this._actionHandler&&!this._findCommand("help"):this._addImplicitHelpCommand}hook(n,l){const f=["preSubcommand","preAction","postAction"];if(!f.includes(n))throw new Error(`Unexpected value for event passed to hook : '${n}'.
70
- Expecting one of '${f.join("', '")}'`);return this._lifeCycleHooks[n]?this._lifeCycleHooks[n].push(l):this._lifeCycleHooks[n]=[l],this}exitOverride(n){return n?this._exitCallback=n:this._exitCallback=l=>{if(l.code!=="commander.executeSubCommandAsync")throw l},this}_exit(n,l,f){this._exitCallback&&this._exitCallback(new o(n,l,f)),i.exit(n)}action(n){const l=f=>{const d=this._args.length,D=f.slice(0,d);return this._storeOptionsAsProperties?D[d]=this:D[d]=this.opts(),D.push(this),n.apply(this,D)};return this._actionHandler=l,this}createOption(n,l){return new E(n,l)}addOption(n){const l=n.name(),f=n.attributeName();if(n.negate){const D=n.long.replace(/^--no-/,"--");this._findOption(D)||this.setOptionValueWithSource(f,n.defaultValue===void 0?!0:n.defaultValue,"default")}else n.defaultValue!==void 0&&this.setOptionValueWithSource(f,n.defaultValue,"default");this.options.push(n);const d=(D,F,R)=>{D==null&&n.presetArg!==void 0&&(D=n.presetArg);const B=this.getOptionValue(f);if(D!==null&&n.parseArg)try{D=n.parseArg(D,B)}catch(x){if(x.code==="commander.invalidArgument"){const M=`${F} ${x.message}`;this.error(M,{exitCode:x.exitCode,code:x.code})}throw x}else D!==null&&n.variadic&&(D=n._concatValue(D,B));D==null&&(n.negate?D=!1:n.isBoolean()||n.optional?D=!0:D=""),this.setOptionValueWithSource(f,D,R)};return this.on("option:"+l,D=>{const F=`error: option '${n.flags}' argument '${D}' is invalid.`;d(D,F,"cli")}),n.envVar&&this.on("optionEnv:"+l,D=>{const F=`error: option '${n.flags}' value '${D}' from env '${n.envVar}' is invalid.`;d(D,F,"env")}),this}_optionEx(n,l,f,d,D){if(typeof l=="object"&&l instanceof E)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");const F=this.createOption(l,f);if(F.makeOptionMandatory(!!n.mandatory),typeof d=="function")F.default(D).argParser(d);else if(d instanceof RegExp){const R=d;d=(B,x)=>{const M=R.exec(B);return M?M[0]:x},F.default(D).argParser(d)}else F.default(d);return this.addOption(F)}option(n,l,f,d){return this._optionEx({},n,l,f,d)}requiredOption(n,l,f,d){return this._optionEx({mandatory:!0},n,l,f,d)}combineFlagAndOptionalValue(n=!0){return this._combineFlagAndOptionalValue=!!n,this}allowUnknownOption(n=!0){return this._allowUnknownOption=!!n,this}allowExcessArguments(n=!0){return this._allowExcessArguments=!!n,this}enablePositionalOptions(n=!0){return this._enablePositionalOptions=!!n,this}passThroughOptions(n=!0){if(this._passThroughOptions=!!n,this.parent&&n&&!this.parent._enablePositionalOptions)throw new Error("passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)");return this}storeOptionsAsProperties(n=!0){if(this._storeOptionsAsProperties=!!n,this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");return this}getOptionValue(n){return this._storeOptionsAsProperties?this[n]:this._optionValues[n]}setOptionValue(n,l){return this.setOptionValueWithSource(n,l,void 0)}setOptionValueWithSource(n,l,f){return this._storeOptionsAsProperties?this[n]=l:this._optionValues[n]=l,this._optionValueSources[n]=f,this}getOptionValueSource(n){return this._optionValueSources[n]}getOptionValueSourceWithGlobals(n){let l;return S(this).forEach(f=>{f.getOptionValueSource(n)!==void 0&&(l=f.getOptionValueSource(n))}),l}_prepareUserArgs(n,l){if(n!==void 0&&!Array.isArray(n))throw new Error("first parameter to parse must be array or undefined");l=l||{},n===void 0&&(n=i.argv,i.versions&&i.versions.electron&&(l.from="electron")),this.rawArgs=n.slice();let f;switch(l.from){case void 0:case"node":this._scriptPath=n[1],f=n.slice(2);break;case"electron":i.defaultApp?(this._scriptPath=n[1],f=n.slice(2)):f=n.slice(1);break;case"user":f=n.slice(0);break;default:throw new Error(`unexpected parse option { from: '${l.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",f}parse(n,l){const f=this._prepareUserArgs(n,l);return this._parseCommand([],f),this}async parseAsync(n,l){const f=this._prepareUserArgs(n,l);return await this._parseCommand([],f),this}_executeSubCommand(n,l){l=l.slice();let f=!1;const d=[".js",".ts",".tsx",".mjs",".cjs"];function D(M,P){const U=s.resolve(M,P);if(r.existsSync(U))return U;if(d.includes(s.extname(P)))return;const G=d.find(Y=>r.existsSync(`${U}${Y}`));if(G)return`${U}${G}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let F=n._executableFile||`${this._name}-${n._name}`,R=this._executableDir||"";if(this._scriptPath){let M;try{M=r.realpathSync(this._scriptPath)}catch{M=this._scriptPath}R=s.resolve(s.dirname(M),R)}if(R){let M=D(R,F);if(!M&&!n._executableFile&&this._scriptPath){const P=s.basename(this._scriptPath,s.extname(this._scriptPath));P!==this._name&&(M=D(R,`${P}-${n._name}`))}F=M||F}f=d.includes(s.extname(F));let B;i.platform!=="win32"?f?(l.unshift(F),l=A(i.execArgv).concat(l),B=t.spawn(i.argv[0],l,{stdio:"inherit"})):B=t.spawn(F,l,{stdio:"inherit"}):(l.unshift(F),l=A(i.execArgv).concat(l),B=t.spawn(i.execPath,l,{stdio:"inherit"})),B.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(P=>{i.on(P,()=>{B.killed===!1&&B.exitCode===null&&B.kill(P)})});const x=this._exitCallback;x?B.on("close",()=>{x(new o(i.exitCode||0,"commander.executeSubCommandAsync","(close)"))}):B.on("close",i.exit.bind(i)),B.on("error",M=>{if(M.code==="ENOENT"){const P=R?`searched for local subcommand relative to directory '${R}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",U=`'${F}' does not exist
71
- - if '${n._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
68
+ (Did you mean ${e[0]}?)`:""}return Ot.suggestSimilar=i,Ot}var mi;function kn(){if(mi)return At;mi=1;const s=Te.EventEmitter,t=Ir,i=fe,n=Ce,r=Ns,{Argument:a,humanReadableArgName:e}=vt(),{CommanderError:u}=it(),{Help:h}=Di(),{Option:m,splitOptionFlags:y,DualOptions:p}=di(),{suggestSimilar:C}=Mn();class w extends s{constructor(o){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this._args=[],this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=o||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:l=>r.stdout.write(l),writeErr:l=>r.stderr.write(l),getOutHelpWidth:()=>r.stdout.isTTY?r.stdout.columns:void 0,getErrHelpWidth:()=>r.stderr.isTTY?r.stderr.columns:void 0,outputError:(l,f)=>f(l)},this._hidden=!1,this._hasHelpOption=!0,this._helpFlags="-h, --help",this._helpDescription="display help for command",this._helpShortFlag="-h",this._helpLongFlag="--help",this._addImplicitHelpCommand=void 0,this._helpCommandName="help",this._helpCommandnameAndArgs="help [command]",this._helpCommandDescription="display help for command",this._helpConfiguration={}}copyInheritedSettings(o){return this._outputConfiguration=o._outputConfiguration,this._hasHelpOption=o._hasHelpOption,this._helpFlags=o._helpFlags,this._helpDescription=o._helpDescription,this._helpShortFlag=o._helpShortFlag,this._helpLongFlag=o._helpLongFlag,this._helpCommandName=o._helpCommandName,this._helpCommandnameAndArgs=o._helpCommandnameAndArgs,this._helpCommandDescription=o._helpCommandDescription,this._helpConfiguration=o._helpConfiguration,this._exitCallback=o._exitCallback,this._storeOptionsAsProperties=o._storeOptionsAsProperties,this._combineFlagAndOptionalValue=o._combineFlagAndOptionalValue,this._allowExcessArguments=o._allowExcessArguments,this._enablePositionalOptions=o._enablePositionalOptions,this._showHelpAfterError=o._showHelpAfterError,this._showSuggestionAfterError=o._showSuggestionAfterError,this}command(o,l,f){let d=l,D=f;typeof d=="object"&&d!==null&&(D=d,d=null),D=D||{};const[,F,R]=o.match(/([^ ]+) *(.*)/),B=this.createCommand(F);return d&&(B.description(d),B._executableHandler=!0),D.isDefault&&(this._defaultCommandName=B._name),B._hidden=!!(D.noHelp||D.hidden),B._executableFile=D.executableFile||null,R&&B.arguments(R),this.commands.push(B),B.parent=this,B.copyInheritedSettings(this),d?this:B}createCommand(o){return new w(o)}createHelp(){return Object.assign(new h,this.configureHelp())}configureHelp(o){return o===void 0?this._helpConfiguration:(this._helpConfiguration=o,this)}configureOutput(o){return o===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,o),this)}showHelpAfterError(o=!0){return typeof o!="string"&&(o=!!o),this._showHelpAfterError=o,this}showSuggestionAfterError(o=!0){return this._showSuggestionAfterError=!!o,this}addCommand(o,l){if(!o._name)throw new Error(`Command passed to .addCommand() must have a name
69
+ - specify the name in Command constructor or using .name()`);return l=l||{},l.isDefault&&(this._defaultCommandName=o._name),(l.noHelp||l.hidden)&&(o._hidden=!0),this.commands.push(o),o.parent=this,this}createArgument(o,l){return new a(o,l)}argument(o,l,f,d){const D=this.createArgument(o,l);return typeof f=="function"?D.default(d).argParser(f):D.default(f),this.addArgument(D),this}arguments(o){return o.split(/ +/).forEach(l=>{this.argument(l)}),this}addArgument(o){const l=this._args.slice(-1)[0];if(l&&l.variadic)throw new Error(`only the last argument can be variadic '${l.name()}'`);if(o.required&&o.defaultValue!==void 0&&o.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${o.name()}'`);return this._args.push(o),this}addHelpCommand(o,l){return o===!1?this._addImplicitHelpCommand=!1:(this._addImplicitHelpCommand=!0,typeof o=="string"&&(this._helpCommandName=o.split(" ")[0],this._helpCommandnameAndArgs=o),this._helpCommandDescription=l||this._helpCommandDescription),this}_hasImplicitHelpCommand(){return this._addImplicitHelpCommand===void 0?this.commands.length&&!this._actionHandler&&!this._findCommand("help"):this._addImplicitHelpCommand}hook(o,l){const f=["preSubcommand","preAction","postAction"];if(!f.includes(o))throw new Error(`Unexpected value for event passed to hook : '${o}'.
70
+ Expecting one of '${f.join("', '")}'`);return this._lifeCycleHooks[o]?this._lifeCycleHooks[o].push(l):this._lifeCycleHooks[o]=[l],this}exitOverride(o){return o?this._exitCallback=o:this._exitCallback=l=>{if(l.code!=="commander.executeSubCommandAsync")throw l},this}_exit(o,l,f){this._exitCallback&&this._exitCallback(new u(o,l,f)),r.exit(o)}action(o){const l=f=>{const d=this._args.length,D=f.slice(0,d);return this._storeOptionsAsProperties?D[d]=this:D[d]=this.opts(),D.push(this),o.apply(this,D)};return this._actionHandler=l,this}createOption(o,l){return new m(o,l)}addOption(o){const l=o.name(),f=o.attributeName();if(o.negate){const D=o.long.replace(/^--no-/,"--");this._findOption(D)||this.setOptionValueWithSource(f,o.defaultValue===void 0?!0:o.defaultValue,"default")}else o.defaultValue!==void 0&&this.setOptionValueWithSource(f,o.defaultValue,"default");this.options.push(o);const d=(D,F,R)=>{D==null&&o.presetArg!==void 0&&(D=o.presetArg);const B=this.getOptionValue(f);if(D!==null&&o.parseArg)try{D=o.parseArg(D,B)}catch(x){if(x.code==="commander.invalidArgument"){const P=`${F} ${x.message}`;this.error(P,{exitCode:x.exitCode,code:x.code})}throw x}else D!==null&&o.variadic&&(D=o._concatValue(D,B));D==null&&(o.negate?D=!1:o.isBoolean()||o.optional?D=!0:D=""),this.setOptionValueWithSource(f,D,R)};return this.on("option:"+l,D=>{const F=`error: option '${o.flags}' argument '${D}' is invalid.`;d(D,F,"cli")}),o.envVar&&this.on("optionEnv:"+l,D=>{const F=`error: option '${o.flags}' value '${D}' from env '${o.envVar}' is invalid.`;d(D,F,"env")}),this}_optionEx(o,l,f,d,D){if(typeof l=="object"&&l instanceof m)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");const F=this.createOption(l,f);if(F.makeOptionMandatory(!!o.mandatory),typeof d=="function")F.default(D).argParser(d);else if(d instanceof RegExp){const R=d;d=(B,x)=>{const P=R.exec(B);return P?P[0]:x},F.default(D).argParser(d)}else F.default(d);return this.addOption(F)}option(o,l,f,d){return this._optionEx({},o,l,f,d)}requiredOption(o,l,f,d){return this._optionEx({mandatory:!0},o,l,f,d)}combineFlagAndOptionalValue(o=!0){return this._combineFlagAndOptionalValue=!!o,this}allowUnknownOption(o=!0){return this._allowUnknownOption=!!o,this}allowExcessArguments(o=!0){return this._allowExcessArguments=!!o,this}enablePositionalOptions(o=!0){return this._enablePositionalOptions=!!o,this}passThroughOptions(o=!0){if(this._passThroughOptions=!!o,this.parent&&o&&!this.parent._enablePositionalOptions)throw new Error("passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)");return this}storeOptionsAsProperties(o=!0){if(this._storeOptionsAsProperties=!!o,this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");return this}getOptionValue(o){return this._storeOptionsAsProperties?this[o]:this._optionValues[o]}setOptionValue(o,l){return this.setOptionValueWithSource(o,l,void 0)}setOptionValueWithSource(o,l,f){return this._storeOptionsAsProperties?this[o]=l:this._optionValues[o]=l,this._optionValueSources[o]=f,this}getOptionValueSource(o){return this._optionValueSources[o]}getOptionValueSourceWithGlobals(o){let l;return S(this).forEach(f=>{f.getOptionValueSource(o)!==void 0&&(l=f.getOptionValueSource(o))}),l}_prepareUserArgs(o,l){if(o!==void 0&&!Array.isArray(o))throw new Error("first parameter to parse must be array or undefined");l=l||{},o===void 0&&(o=r.argv,r.versions&&r.versions.electron&&(l.from="electron")),this.rawArgs=o.slice();let f;switch(l.from){case void 0:case"node":this._scriptPath=o[1],f=o.slice(2);break;case"electron":r.defaultApp?(this._scriptPath=o[1],f=o.slice(2)):f=o.slice(1);break;case"user":f=o.slice(0);break;default:throw new Error(`unexpected parse option { from: '${l.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",f}parse(o,l){const f=this._prepareUserArgs(o,l);return this._parseCommand([],f),this}async parseAsync(o,l){const f=this._prepareUserArgs(o,l);return await this._parseCommand([],f),this}_executeSubCommand(o,l){l=l.slice();let f=!1;const d=[".js",".ts",".tsx",".mjs",".cjs"];function D(P,M){const U=i.resolve(P,M);if(n.existsSync(U))return U;if(d.includes(i.extname(M)))return;const G=d.find(Y=>n.existsSync(`${U}${Y}`));if(G)return`${U}${G}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let F=o._executableFile||`${this._name}-${o._name}`,R=this._executableDir||"";if(this._scriptPath){let P;try{P=n.realpathSync(this._scriptPath)}catch{P=this._scriptPath}R=i.resolve(i.dirname(P),R)}if(R){let P=D(R,F);if(!P&&!o._executableFile&&this._scriptPath){const M=i.basename(this._scriptPath,i.extname(this._scriptPath));M!==this._name&&(P=D(R,`${M}-${o._name}`))}F=P||F}f=d.includes(i.extname(F));let B;r.platform!=="win32"?f?(l.unshift(F),l=A(r.execArgv).concat(l),B=t.spawn(r.argv[0],l,{stdio:"inherit"})):B=t.spawn(F,l,{stdio:"inherit"}):(l.unshift(F),l=A(r.execArgv).concat(l),B=t.spawn(r.execPath,l,{stdio:"inherit"})),B.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(M=>{r.on(M,()=>{B.killed===!1&&B.exitCode===null&&B.kill(M)})});const x=this._exitCallback;x?B.on("close",()=>{x(new u(r.exitCode||0,"commander.executeSubCommandAsync","(close)"))}):B.on("close",r.exit.bind(r)),B.on("error",P=>{if(P.code==="ENOENT"){const M=R?`searched for local subcommand relative to directory '${R}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",U=`'${F}' does not exist
71
+ - if '${o._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
72
72
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
73
- - ${P}`;throw new Error(U)}else if(M.code==="EACCES")throw new Error(`'${F}' not executable`);if(!x)i.exit(1);else{const P=new o(1,"commander.executeSubCommandAsync","(error)");P.nestedError=M,x(P)}}),this.runningCommand=B}_dispatchSubcommand(n,l,f){const d=this._findCommand(n);d||this.help({error:!0});let D;return D=this._chainOrCallSubCommandHook(D,d,"preSubcommand"),D=this._chainOrCall(D,()=>{if(d._executableHandler)this._executeSubCommand(d,l.concat(f));else return d._parseCommand(l,f)}),D}_checkNumberOfArguments(){this._args.forEach((n,l)=>{n.required&&this.args[l]==null&&this.missingArgument(n.name())}),!(this._args.length>0&&this._args[this._args.length-1].variadic)&&this.args.length>this._args.length&&this._excessArguments(this.args)}_processArguments(){const n=(f,d,D)=>{let F=d;if(d!==null&&f.parseArg)try{F=f.parseArg(d,D)}catch(R){if(R.code==="commander.invalidArgument"){const B=`error: command-argument value '${d}' is invalid for argument '${f.name()}'. ${R.message}`;this.error(B,{exitCode:R.exitCode,code:R.code})}throw R}return F};this._checkNumberOfArguments();const l=[];this._args.forEach((f,d)=>{let D=f.defaultValue;f.variadic?d<this.args.length?(D=this.args.slice(d),f.parseArg&&(D=D.reduce((F,R)=>n(f,R,F),f.defaultValue))):D===void 0&&(D=[]):d<this.args.length&&(D=this.args[d],f.parseArg&&(D=n(f,D,f.defaultValue))),l[d]=D}),this.processedArgs=l}_chainOrCall(n,l){return n&&n.then&&typeof n.then=="function"?n.then(()=>l()):l()}_chainOrCallHooks(n,l){let f=n;const d=[];return S(this).reverse().filter(D=>D._lifeCycleHooks[l]!==void 0).forEach(D=>{D._lifeCycleHooks[l].forEach(F=>{d.push({hookedCommand:D,callback:F})})}),l==="postAction"&&d.reverse(),d.forEach(D=>{f=this._chainOrCall(f,()=>D.callback(D.hookedCommand,this))}),f}_chainOrCallSubCommandHook(n,l,f){let d=n;return this._lifeCycleHooks[f]!==void 0&&this._lifeCycleHooks[f].forEach(D=>{d=this._chainOrCall(d,()=>D(this,l))}),d}_parseCommand(n,l){const f=this.parseOptions(l);if(this._parseOptionsEnv(),this._parseOptionsImplied(),n=n.concat(f.operands),l=f.unknown,this.args=n.concat(l),n&&this._findCommand(n[0]))return this._dispatchSubcommand(n[0],n.slice(1),l);if(this._hasImplicitHelpCommand()&&n[0]===this._helpCommandName)return n.length===1&&this.help(),this._dispatchSubcommand(n[1],[],[this._helpLongFlag]);if(this._defaultCommandName)return b(this,l),this._dispatchSubcommand(this._defaultCommandName,n,l);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),b(this,f.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();const d=()=>{f.unknown.length>0&&this.unknownOption(f.unknown[0])},D=`command:${this.name()}`;if(this._actionHandler){d(),this._processArguments();let F;return F=this._chainOrCallHooks(F,"preAction"),F=this._chainOrCall(F,()=>this._actionHandler(this.processedArgs)),this.parent&&(F=this._chainOrCall(F,()=>{this.parent.emit(D,n,l)})),F=this._chainOrCallHooks(F,"postAction"),F}if(this.parent&&this.parent.listenerCount(D))d(),this._processArguments(),this.parent.emit(D,n,l);else if(n.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",n,l);this.listenerCount("command:*")?this.emit("command:*",n,l):this.commands.length?this.unknownCommand():(d(),this._processArguments())}else this.commands.length?(d(),this.help({error:!0})):(d(),this._processArguments())}_findCommand(n){if(n)return this.commands.find(l=>l._name===n||l._aliases.includes(n))}_findOption(n){return this.options.find(l=>l.is(n))}_checkForMissingMandatoryOptions(){for(let n=this;n;n=n.parent)n.options.forEach(l=>{l.mandatory&&n.getOptionValue(l.attributeName())===void 0&&n.missingMandatoryOptionValue(l)})}_checkForConflictingLocalOptions(){const n=this.options.filter(f=>{const d=f.attributeName();return this.getOptionValue(d)===void 0?!1:this.getOptionValueSource(d)!=="default"});n.filter(f=>f.conflictsWith.length>0).forEach(f=>{const d=n.find(D=>f.conflictsWith.includes(D.attributeName()));d&&this._conflictingOption(f,d)})}_checkForConflictingOptions(){for(let n=this;n;n=n.parent)n._checkForConflictingLocalOptions()}parseOptions(n){const l=[],f=[];let d=l;const D=n.slice();function F(B){return B.length>1&&B[0]==="-"}let R=null;for(;D.length;){const B=D.shift();if(B==="--"){d===f&&d.push(B),d.push(...D);break}if(R&&!F(B)){this.emit(`option:${R.name()}`,B);continue}if(R=null,F(B)){const x=this._findOption(B);if(x){if(x.required){const M=D.shift();M===void 0&&this.optionMissingArgument(x),this.emit(`option:${x.name()}`,M)}else if(x.optional){let M=null;D.length>0&&!F(D[0])&&(M=D.shift()),this.emit(`option:${x.name()}`,M)}else this.emit(`option:${x.name()}`);R=x.variadic?x:null;continue}}if(B.length>2&&B[0]==="-"&&B[1]!=="-"){const x=this._findOption(`-${B[1]}`);if(x){x.required||x.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${x.name()}`,B.slice(2)):(this.emit(`option:${x.name()}`),D.unshift(`-${B.slice(2)}`));continue}}if(/^--[^=]+=/.test(B)){const x=B.indexOf("="),M=this._findOption(B.slice(0,x));if(M&&(M.required||M.optional)){this.emit(`option:${M.name()}`,B.slice(x+1));continue}}if(F(B)&&(d=f),(this._enablePositionalOptions||this._passThroughOptions)&&l.length===0&&f.length===0){if(this._findCommand(B)){l.push(B),D.length>0&&f.push(...D);break}else if(B===this._helpCommandName&&this._hasImplicitHelpCommand()){l.push(B),D.length>0&&l.push(...D);break}else if(this._defaultCommandName){f.push(B),D.length>0&&f.push(...D);break}}if(this._passThroughOptions){d.push(B),D.length>0&&d.push(...D);break}d.push(B)}return{operands:l,unknown:f}}opts(){if(this._storeOptionsAsProperties){const n={},l=this.options.length;for(let f=0;f<l;f++){const d=this.options[f].attributeName();n[d]=d===this._versionOptionName?this._version:this[d]}return n}return this._optionValues}optsWithGlobals(){return S(this).reduce((n,l)=>Object.assign(n,l.opts()),{})}error(n,l){this._outputConfiguration.outputError(`${n}
73
+ - ${M}`;throw new Error(U)}else if(P.code==="EACCES")throw new Error(`'${F}' not executable`);if(!x)r.exit(1);else{const M=new u(1,"commander.executeSubCommandAsync","(error)");M.nestedError=P,x(M)}}),this.runningCommand=B}_dispatchSubcommand(o,l,f){const d=this._findCommand(o);d||this.help({error:!0});let D;return D=this._chainOrCallSubCommandHook(D,d,"preSubcommand"),D=this._chainOrCall(D,()=>{if(d._executableHandler)this._executeSubCommand(d,l.concat(f));else return d._parseCommand(l,f)}),D}_checkNumberOfArguments(){this._args.forEach((o,l)=>{o.required&&this.args[l]==null&&this.missingArgument(o.name())}),!(this._args.length>0&&this._args[this._args.length-1].variadic)&&this.args.length>this._args.length&&this._excessArguments(this.args)}_processArguments(){const o=(f,d,D)=>{let F=d;if(d!==null&&f.parseArg)try{F=f.parseArg(d,D)}catch(R){if(R.code==="commander.invalidArgument"){const B=`error: command-argument value '${d}' is invalid for argument '${f.name()}'. ${R.message}`;this.error(B,{exitCode:R.exitCode,code:R.code})}throw R}return F};this._checkNumberOfArguments();const l=[];this._args.forEach((f,d)=>{let D=f.defaultValue;f.variadic?d<this.args.length?(D=this.args.slice(d),f.parseArg&&(D=D.reduce((F,R)=>o(f,R,F),f.defaultValue))):D===void 0&&(D=[]):d<this.args.length&&(D=this.args[d],f.parseArg&&(D=o(f,D,f.defaultValue))),l[d]=D}),this.processedArgs=l}_chainOrCall(o,l){return o&&o.then&&typeof o.then=="function"?o.then(()=>l()):l()}_chainOrCallHooks(o,l){let f=o;const d=[];return S(this).reverse().filter(D=>D._lifeCycleHooks[l]!==void 0).forEach(D=>{D._lifeCycleHooks[l].forEach(F=>{d.push({hookedCommand:D,callback:F})})}),l==="postAction"&&d.reverse(),d.forEach(D=>{f=this._chainOrCall(f,()=>D.callback(D.hookedCommand,this))}),f}_chainOrCallSubCommandHook(o,l,f){let d=o;return this._lifeCycleHooks[f]!==void 0&&this._lifeCycleHooks[f].forEach(D=>{d=this._chainOrCall(d,()=>D(this,l))}),d}_parseCommand(o,l){const f=this.parseOptions(l);if(this._parseOptionsEnv(),this._parseOptionsImplied(),o=o.concat(f.operands),l=f.unknown,this.args=o.concat(l),o&&this._findCommand(o[0]))return this._dispatchSubcommand(o[0],o.slice(1),l);if(this._hasImplicitHelpCommand()&&o[0]===this._helpCommandName)return o.length===1&&this.help(),this._dispatchSubcommand(o[1],[],[this._helpLongFlag]);if(this._defaultCommandName)return b(this,l),this._dispatchSubcommand(this._defaultCommandName,o,l);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),b(this,f.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();const d=()=>{f.unknown.length>0&&this.unknownOption(f.unknown[0])},D=`command:${this.name()}`;if(this._actionHandler){d(),this._processArguments();let F;return F=this._chainOrCallHooks(F,"preAction"),F=this._chainOrCall(F,()=>this._actionHandler(this.processedArgs)),this.parent&&(F=this._chainOrCall(F,()=>{this.parent.emit(D,o,l)})),F=this._chainOrCallHooks(F,"postAction"),F}if(this.parent&&this.parent.listenerCount(D))d(),this._processArguments(),this.parent.emit(D,o,l);else if(o.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",o,l);this.listenerCount("command:*")?this.emit("command:*",o,l):this.commands.length?this.unknownCommand():(d(),this._processArguments())}else this.commands.length?(d(),this.help({error:!0})):(d(),this._processArguments())}_findCommand(o){if(o)return this.commands.find(l=>l._name===o||l._aliases.includes(o))}_findOption(o){return this.options.find(l=>l.is(o))}_checkForMissingMandatoryOptions(){for(let o=this;o;o=o.parent)o.options.forEach(l=>{l.mandatory&&o.getOptionValue(l.attributeName())===void 0&&o.missingMandatoryOptionValue(l)})}_checkForConflictingLocalOptions(){const o=this.options.filter(f=>{const d=f.attributeName();return this.getOptionValue(d)===void 0?!1:this.getOptionValueSource(d)!=="default"});o.filter(f=>f.conflictsWith.length>0).forEach(f=>{const d=o.find(D=>f.conflictsWith.includes(D.attributeName()));d&&this._conflictingOption(f,d)})}_checkForConflictingOptions(){for(let o=this;o;o=o.parent)o._checkForConflictingLocalOptions()}parseOptions(o){const l=[],f=[];let d=l;const D=o.slice();function F(B){return B.length>1&&B[0]==="-"}let R=null;for(;D.length;){const B=D.shift();if(B==="--"){d===f&&d.push(B),d.push(...D);break}if(R&&!F(B)){this.emit(`option:${R.name()}`,B);continue}if(R=null,F(B)){const x=this._findOption(B);if(x){if(x.required){const P=D.shift();P===void 0&&this.optionMissingArgument(x),this.emit(`option:${x.name()}`,P)}else if(x.optional){let P=null;D.length>0&&!F(D[0])&&(P=D.shift()),this.emit(`option:${x.name()}`,P)}else this.emit(`option:${x.name()}`);R=x.variadic?x:null;continue}}if(B.length>2&&B[0]==="-"&&B[1]!=="-"){const x=this._findOption(`-${B[1]}`);if(x){x.required||x.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${x.name()}`,B.slice(2)):(this.emit(`option:${x.name()}`),D.unshift(`-${B.slice(2)}`));continue}}if(/^--[^=]+=/.test(B)){const x=B.indexOf("="),P=this._findOption(B.slice(0,x));if(P&&(P.required||P.optional)){this.emit(`option:${P.name()}`,B.slice(x+1));continue}}if(F(B)&&(d=f),(this._enablePositionalOptions||this._passThroughOptions)&&l.length===0&&f.length===0){if(this._findCommand(B)){l.push(B),D.length>0&&f.push(...D);break}else if(B===this._helpCommandName&&this._hasImplicitHelpCommand()){l.push(B),D.length>0&&l.push(...D);break}else if(this._defaultCommandName){f.push(B),D.length>0&&f.push(...D);break}}if(this._passThroughOptions){d.push(B),D.length>0&&d.push(...D);break}d.push(B)}return{operands:l,unknown:f}}opts(){if(this._storeOptionsAsProperties){const o={},l=this.options.length;for(let f=0;f<l;f++){const d=this.options[f].attributeName();o[d]=d===this._versionOptionName?this._version:this[d]}return o}return this._optionValues}optsWithGlobals(){return S(this).reduce((o,l)=>Object.assign(o,l.opts()),{})}error(o,l){this._outputConfiguration.outputError(`${o}
74
74
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
75
75
  `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
76
- `),this.outputHelp({error:!0}));const f=l||{},d=f.exitCode||1,D=f.code||"commander.error";this._exit(d,D,n)}_parseOptionsEnv(){this.options.forEach(n=>{if(n.envVar&&n.envVar in i.env){const l=n.attributeName();(this.getOptionValue(l)===void 0||["default","config","env"].includes(this.getOptionValueSource(l)))&&(n.required||n.optional?this.emit(`optionEnv:${n.name()}`,i.env[n.envVar]):this.emit(`optionEnv:${n.name()}`))}})}_parseOptionsImplied(){const n=new m(this.options),l=f=>this.getOptionValue(f)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(f));this.options.filter(f=>f.implied!==void 0&&l(f.attributeName())&&n.valueFromOption(this.getOptionValue(f.attributeName()),f)).forEach(f=>{Object.keys(f.implied).filter(d=>!l(d)).forEach(d=>{this.setOptionValueWithSource(d,f.implied[d],"implied")})})}missingArgument(n){const l=`error: missing required argument '${n}'`;this.error(l,{code:"commander.missingArgument"})}optionMissingArgument(n){const l=`error: option '${n.flags}' argument missing`;this.error(l,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(n){const l=`error: required option '${n.flags}' not specified`;this.error(l,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(n,l){const f=F=>{const R=F.attributeName(),B=this.getOptionValue(R),x=this.options.find(P=>P.negate&&R===P.attributeName()),M=this.options.find(P=>!P.negate&&R===P.attributeName());return x&&(x.presetArg===void 0&&B===!1||x.presetArg!==void 0&&B===x.presetArg)?x:M||F},d=F=>{const R=f(F),B=R.attributeName();return this.getOptionValueSource(B)==="env"?`environment variable '${R.envVar}'`:`option '${R.flags}'`},D=`error: ${d(n)} cannot be used with ${d(l)}`;this.error(D,{code:"commander.conflictingOption"})}unknownOption(n){if(this._allowUnknownOption)return;let l="";if(n.startsWith("--")&&this._showSuggestionAfterError){let d=[],D=this;do{const F=D.createHelp().visibleOptions(D).filter(R=>R.long).map(R=>R.long);d=d.concat(F),D=D.parent}while(D&&!D._enablePositionalOptions);l=C(n,d)}const f=`error: unknown option '${n}'${l}`;this.error(f,{code:"commander.unknownOption"})}_excessArguments(n){if(this._allowExcessArguments)return;const l=this._args.length,f=l===1?"":"s",D=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${l} argument${f} but got ${n.length}.`;this.error(D,{code:"commander.excessArguments"})}unknownCommand(){const n=this.args[0];let l="";if(this._showSuggestionAfterError){const d=[];this.createHelp().visibleCommands(this).forEach(D=>{d.push(D.name()),D.alias()&&d.push(D.alias())}),l=C(n,d)}const f=`error: unknown command '${n}'${l}`;this.error(f,{code:"commander.unknownCommand"})}version(n,l,f){if(n===void 0)return this._version;this._version=n,l=l||"-V, --version",f=f||"output the version number";const d=this.createOption(l,f);return this._versionOptionName=d.attributeName(),this.options.push(d),this.on("option:"+d.name(),()=>{this._outputConfiguration.writeOut(`${n}
77
- `),this._exit(0,"commander.version",n)}),this}description(n,l){return n===void 0&&l===void 0?this._description:(this._description=n,l&&(this._argsDescription=l),this)}summary(n){return n===void 0?this._summary:(this._summary=n,this)}alias(n){if(n===void 0)return this._aliases[0];let l=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(l=this.commands[this.commands.length-1]),n===l._name)throw new Error("Command alias can't be the same as its name");return l._aliases.push(n),this}aliases(n){return n===void 0?this._aliases:(n.forEach(l=>this.alias(l)),this)}usage(n){if(n===void 0){if(this._usage)return this._usage;const l=this._args.map(f=>e(f));return[].concat(this.options.length||this._hasHelpOption?"[options]":[],this.commands.length?"[command]":[],this._args.length?l:[]).join(" ")}return this._usage=n,this}name(n){return n===void 0?this._name:(this._name=n,this)}nameFromFilename(n){return this._name=s.basename(n,s.extname(n)),this}executableDir(n){return n===void 0?this._executableDir:(this._executableDir=n,this)}helpInformation(n){const l=this.createHelp();return l.helpWidth===void 0&&(l.helpWidth=n&&n.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),l.formatHelp(this,l)}_getHelpContext(n){n=n||{};const l={error:!!n.error};let f;return l.error?f=d=>this._outputConfiguration.writeErr(d):f=d=>this._outputConfiguration.writeOut(d),l.write=n.write||f,l.command=this,l}outputHelp(n){let l;typeof n=="function"&&(l=n,n=void 0);const f=this._getHelpContext(n);S(this).reverse().forEach(D=>D.emit("beforeAllHelp",f)),this.emit("beforeHelp",f);let d=this.helpInformation(f);if(l&&(d=l(d),typeof d!="string"&&!Buffer.isBuffer(d)))throw new Error("outputHelp callback must return a string or a Buffer");f.write(d),this.emit(this._helpLongFlag),this.emit("afterHelp",f),S(this).forEach(D=>D.emit("afterAllHelp",f))}helpOption(n,l){if(typeof n=="boolean")return this._hasHelpOption=n,this;this._helpFlags=n||this._helpFlags,this._helpDescription=l||this._helpDescription;const f=y(this._helpFlags);return this._helpShortFlag=f.shortFlag,this._helpLongFlag=f.longFlag,this}help(n){this.outputHelp(n);let l=i.exitCode||0;l===0&&n&&typeof n!="function"&&n.error&&(l=1),this._exit(l,"commander.help","(outputHelp)")}addHelpText(n,l){const f=["beforeAll","before","after","afterAll"];if(!f.includes(n))throw new Error(`Unexpected value for position to addHelpText.
78
- Expecting one of '${f.join("', '")}'`);const d=`${n}Help`;return this.on(d,D=>{let F;typeof l=="function"?F=l({error:D.error,command:D.command}):F=l,F&&D.write(`${F}
79
- `)}),this}}function b(v,n){v._hasHelpOption&&n.find(f=>f===v._helpLongFlag||f===v._helpShortFlag)&&(v.outputHelp(),v._exit(0,"commander.helpDisplayed","(outputHelp)"))}function A(v){return v.map(n=>{if(!n.startsWith("--inspect"))return n;let l,f="127.0.0.1",d="9229",D;return(D=n.match(/^(--inspect(-brk)?)$/))!==null?l=D[1]:(D=n.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(l=D[1],/^\d+$/.test(D[3])?d=D[3]:f=D[3]):(D=n.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(l=D[1],f=D[3],d=D[4]),l&&d!=="0"?`${l}=${f}:${parseInt(d)+1}`:n})}function S(v){const n=[];for(let l=v;l;l=l.parent)n.push(l);return n}return vt.Command=_,vt}var fs;function _n(){return fs||(fs=1,function(u,t){const{Argument:s}=wt(),{Command:r}=bn(),{CommanderError:i,InvalidArgumentError:a}=it(),{Help:e}=as(),{Option:o}=ls();t=u.exports=new r,t.program=t,t.Argument=s,t.Command=r,t.CommanderError=i,t.Help=e,t.InvalidArgumentError=a,t.InvalidOptionArgumentError=a,t.Option=o}(Qe,Qe.exports)),Qe.exports}var wn=_n();const vn=Ii(wn),{program:Ku,createCommand:Yu,createArgument:Zu,createOption:Xu,CommanderError:Ju,InvalidArgumentError:Qu,InvalidOptionArgumentError:eo,Command:An,Argument:to,Option:Sn,Help:io}=vn;var Ne={};class On extends Error{method;path;expected;value;fake_expected_typed_value_;constructor(t){super(t.message||`Error on ${t.method}(): invalid type${t.path?` on ${t.path}`:""}, expect to be ${t.expected}`);const s=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,s):this.__proto__=s,this.method=t.method,this.path=t.path,this.expected=t.expected,this.value=t.value}}const Rn={__proto__:null,TypeGuardError:On},Bn=xr(Rn);var ds;function xn(){if(ds)return Ne;ds=1,Object.defineProperty(Ne,"__esModule",{value:!0}),Ne._assertGuard=void 0;const u=Bn,t=(s,r,i)=>{if(s===!0)throw i?i(r):new u.TypeGuardError(r);return!1};return Ne._assertGuard=t,Ne}var re=xn();function ms(u){return u.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join("")}async function Ot(u){try{return await(await import("prettier")).format(u,{parser:"typescript"})}catch{return u}}const ps=Ri(vr),Tn="https://raw.githubusercontent.com/wrtnlabs/connectors/refs/heads/main/connectors-list.json",Rt="@wrtnlabs/connector-";function $n(u){return`${Rt}${u}`}function Nn(u){return u.replace(Rt,"")}async function In(){const u=await(await fetch(Tn)).json();return(()=>{const t=o=>Array.isArray(o.connectors)&&o.connectors.every(h=>typeof h=="object"&&h!==null&&s(h))&&typeof o.version=="string",s=o=>typeof o.name=="string"&&RegExp(/^@wrtnlabs\/connector\x2d(.*)/).test(o.name)&&Array.isArray(o.envList)&&o.envList.every(h=>typeof h=="string"),r=(o,h,E=!0)=>((Array.isArray(o.connectors)||re._assertGuard(E,{method:"typia.assert",path:h+".connectors",expected:"Array<UnwrapTaggedConnectorInfo>",value:o.connectors},e))&&o.connectors.every((y,m)=>(typeof y=="object"&&y!==null||re._assertGuard(E,{method:"typia.assert",path:h+".connectors["+m+"]",expected:"UnwrapTaggedConnectorInfo",value:y},e))&&i(y,h+".connectors["+m+"]",E)||re._assertGuard(E,{method:"typia.assert",path:h+".connectors["+m+"]",expected:"UnwrapTaggedConnectorInfo",value:y},e))||re._assertGuard(E,{method:"typia.assert",path:h+".connectors",expected:"Array<UnwrapTaggedConnectorInfo>",value:o.connectors},e))&&(typeof o.version=="string"||re._assertGuard(E,{method:"typia.assert",path:h+".version",expected:"string",value:o.version},e)),i=(o,h,E=!0)=>(typeof o.name=="string"&&RegExp(/^@wrtnlabs\/connector\x2d(.*)/).test(o.name)||re._assertGuard(E,{method:"typia.assert",path:h+".name",expected:"`@wrtnlabs/connector-${string}`",value:o.name},e))&&((Array.isArray(o.envList)||re._assertGuard(E,{method:"typia.assert",path:h+".envList",expected:"Array<string>",value:o.envList},e))&&o.envList.every((y,m)=>typeof y=="string"||re._assertGuard(E,{method:"typia.assert",path:h+".envList["+m+"]",expected:"string",value:y},e))||re._assertGuard(E,{method:"typia.assert",path:h+".envList",expected:"Array<string>",value:o.envList},e)),a=o=>typeof o=="object"&&o!==null&&t(o);let e;return(o,h)=>(a(o)===!1&&(e=h,((E,y,m=!0)=>(typeof E=="object"&&E!==null||re._assertGuard(!0,{method:"typia.assert",path:y+"",expected:"UnwrapTaggedConnectors",value:E},e))&&r(E,y+"",!0)||re._assertGuard(!0,{method:"typia.assert",path:y+"",expected:"UnwrapTaggedConnectors",value:E},e))(o,"$input",!0)),o)})()(u)}async function Ln(){return(await In()).connectors.map(({name:u,envList:t})=>{const s=Nn(u),r=s.replace("-"," ").toUpperCase();return{packageName:u,serviceName:s,displayName:r,envList:t}})}function Bt(u){return u.map(t=>{const s=ms(t);return`{
80
- name: "${s} Connector",
76
+ `),this.outputHelp({error:!0}));const f=l||{},d=f.exitCode||1,D=f.code||"commander.error";this._exit(d,D,o)}_parseOptionsEnv(){this.options.forEach(o=>{if(o.envVar&&o.envVar in r.env){const l=o.attributeName();(this.getOptionValue(l)===void 0||["default","config","env"].includes(this.getOptionValueSource(l)))&&(o.required||o.optional?this.emit(`optionEnv:${o.name()}`,r.env[o.envVar]):this.emit(`optionEnv:${o.name()}`))}})}_parseOptionsImplied(){const o=new p(this.options),l=f=>this.getOptionValue(f)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(f));this.options.filter(f=>f.implied!==void 0&&l(f.attributeName())&&o.valueFromOption(this.getOptionValue(f.attributeName()),f)).forEach(f=>{Object.keys(f.implied).filter(d=>!l(d)).forEach(d=>{this.setOptionValueWithSource(d,f.implied[d],"implied")})})}missingArgument(o){const l=`error: missing required argument '${o}'`;this.error(l,{code:"commander.missingArgument"})}optionMissingArgument(o){const l=`error: option '${o.flags}' argument missing`;this.error(l,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(o){const l=`error: required option '${o.flags}' not specified`;this.error(l,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(o,l){const f=F=>{const R=F.attributeName(),B=this.getOptionValue(R),x=this.options.find(M=>M.negate&&R===M.attributeName()),P=this.options.find(M=>!M.negate&&R===M.attributeName());return x&&(x.presetArg===void 0&&B===!1||x.presetArg!==void 0&&B===x.presetArg)?x:P||F},d=F=>{const R=f(F),B=R.attributeName();return this.getOptionValueSource(B)==="env"?`environment variable '${R.envVar}'`:`option '${R.flags}'`},D=`error: ${d(o)} cannot be used with ${d(l)}`;this.error(D,{code:"commander.conflictingOption"})}unknownOption(o){if(this._allowUnknownOption)return;let l="";if(o.startsWith("--")&&this._showSuggestionAfterError){let d=[],D=this;do{const F=D.createHelp().visibleOptions(D).filter(R=>R.long).map(R=>R.long);d=d.concat(F),D=D.parent}while(D&&!D._enablePositionalOptions);l=C(o,d)}const f=`error: unknown option '${o}'${l}`;this.error(f,{code:"commander.unknownOption"})}_excessArguments(o){if(this._allowExcessArguments)return;const l=this._args.length,f=l===1?"":"s",D=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${l} argument${f} but got ${o.length}.`;this.error(D,{code:"commander.excessArguments"})}unknownCommand(){const o=this.args[0];let l="";if(this._showSuggestionAfterError){const d=[];this.createHelp().visibleCommands(this).forEach(D=>{d.push(D.name()),D.alias()&&d.push(D.alias())}),l=C(o,d)}const f=`error: unknown command '${o}'${l}`;this.error(f,{code:"commander.unknownCommand"})}version(o,l,f){if(o===void 0)return this._version;this._version=o,l=l||"-V, --version",f=f||"output the version number";const d=this.createOption(l,f);return this._versionOptionName=d.attributeName(),this.options.push(d),this.on("option:"+d.name(),()=>{this._outputConfiguration.writeOut(`${o}
77
+ `),this._exit(0,"commander.version",o)}),this}description(o,l){return o===void 0&&l===void 0?this._description:(this._description=o,l&&(this._argsDescription=l),this)}summary(o){return o===void 0?this._summary:(this._summary=o,this)}alias(o){if(o===void 0)return this._aliases[0];let l=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(l=this.commands[this.commands.length-1]),o===l._name)throw new Error("Command alias can't be the same as its name");return l._aliases.push(o),this}aliases(o){return o===void 0?this._aliases:(o.forEach(l=>this.alias(l)),this)}usage(o){if(o===void 0){if(this._usage)return this._usage;const l=this._args.map(f=>e(f));return[].concat(this.options.length||this._hasHelpOption?"[options]":[],this.commands.length?"[command]":[],this._args.length?l:[]).join(" ")}return this._usage=o,this}name(o){return o===void 0?this._name:(this._name=o,this)}nameFromFilename(o){return this._name=i.basename(o,i.extname(o)),this}executableDir(o){return o===void 0?this._executableDir:(this._executableDir=o,this)}helpInformation(o){const l=this.createHelp();return l.helpWidth===void 0&&(l.helpWidth=o&&o.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),l.formatHelp(this,l)}_getHelpContext(o){o=o||{};const l={error:!!o.error};let f;return l.error?f=d=>this._outputConfiguration.writeErr(d):f=d=>this._outputConfiguration.writeOut(d),l.write=o.write||f,l.command=this,l}outputHelp(o){let l;typeof o=="function"&&(l=o,o=void 0);const f=this._getHelpContext(o);S(this).reverse().forEach(D=>D.emit("beforeAllHelp",f)),this.emit("beforeHelp",f);let d=this.helpInformation(f);if(l&&(d=l(d),typeof d!="string"&&!Buffer.isBuffer(d)))throw new Error("outputHelp callback must return a string or a Buffer");f.write(d),this.emit(this._helpLongFlag),this.emit("afterHelp",f),S(this).forEach(D=>D.emit("afterAllHelp",f))}helpOption(o,l){if(typeof o=="boolean")return this._hasHelpOption=o,this;this._helpFlags=o||this._helpFlags,this._helpDescription=l||this._helpDescription;const f=y(this._helpFlags);return this._helpShortFlag=f.shortFlag,this._helpLongFlag=f.longFlag,this}help(o){this.outputHelp(o);let l=r.exitCode||0;l===0&&o&&typeof o!="function"&&o.error&&(l=1),this._exit(l,"commander.help","(outputHelp)")}addHelpText(o,l){const f=["beforeAll","before","after","afterAll"];if(!f.includes(o))throw new Error(`Unexpected value for position to addHelpText.
78
+ Expecting one of '${f.join("', '")}'`);const d=`${o}Help`;return this.on(d,D=>{let F;typeof l=="function"?F=l({error:D.error,command:D.command}):F=l,F&&D.write(`${F}
79
+ `)}),this}}function b(v,o){v._hasHelpOption&&o.find(f=>f===v._helpLongFlag||f===v._helpShortFlag)&&(v.outputHelp(),v._exit(0,"commander.helpDisplayed","(outputHelp)"))}function A(v){return v.map(o=>{if(!o.startsWith("--inspect"))return o;let l,f="127.0.0.1",d="9229",D;return(D=o.match(/^(--inspect(-brk)?)$/))!==null?l=D[1]:(D=o.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(l=D[1],/^\d+$/.test(D[3])?d=D[3]:f=D[3]):(D=o.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(l=D[1],f=D[3],d=D[4]),l&&d!=="0"?`${l}=${f}:${parseInt(d)+1}`:o})}function S(v){const o=[];for(let l=v;l;l=l.parent)o.push(l);return o}return At.Command=w,At}var Ei;function jn(){return Ei||(Ei=1,function(s,t){const{Argument:i}=vt(),{Command:n}=kn(),{CommanderError:r,InvalidArgumentError:a}=it(),{Help:e}=Di(),{Option:u}=di();t=s.exports=new n,t.program=t,t.Argument=i,t.Command=n,t.CommanderError=r,t.Help=e,t.InvalidArgumentError=a,t.InvalidOptionArgumentError=a,t.Option=u}(et,et.exports)),et.exports}var Hn=jn();const Un=ks(Hn),{program:Po,createCommand:Mo,createArgument:ko,createOption:jo,CommanderError:Ho,InvalidArgumentError:Uo,InvalidOptionArgumentError:zo,Command:zn,Argument:Go,Option:Gn,Help:qo}=Un,qn="0.26.0";var Ie={};class Wn extends Error{method;path;expected;value;fake_expected_typed_value_;constructor(t){super(t.message||`Error on ${t.method}(): invalid type${t.path?` on ${t.path}`:""}, expect to be ${t.expected}`);const i=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,i):this.__proto__=i,this.method=t.method,this.path=t.path,this.expected=t.expected,this.value=t.value}}const Vn={__proto__:null,TypeGuardError:Wn},Kn=Kr(Vn);var gi;function Yn(){if(gi)return Ie;gi=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie._assertGuard=void 0;const s=Kn,t=(i,n,r)=>{if(i===!0)throw r?r(n):new s.TypeGuardError(n);return!1};return Ie._assertGuard=t,Ie}var ne=Yn();const Zn=s=>({start:Q.hrtime.bigint(),command:s.map(t=>Xn(Tr(t))).join(" "),state:{stdout:"",stderr:"",output:""}}),Xn=s=>/[^\w./-]/.test(s)?`'${s.replaceAll("'","'\\''")}'`:s,Jn=({stdin:s,stdout:t,stderr:i,stdio:n=[s,t,i],env:r,preferLocal:a,cwd:e=".",...u})=>{const h=e instanceof URL?Mr(e):de.resolve(e),m=r?{...Q.env,...r}:void 0,y=n[0]?.string;return{...u,input:y,stdio:y===void 0?n:["pipe",...n.slice(1)],env:a?Qn(m??Q.env,h):m,cwd:h}},Qn=({Path:s="",PATH:t=s,...i},n)=>{const r=t.split(de.delimiter),a=Ci([],de.resolve(n)).map(e=>de.join(e,"node_modules/.bin")).filter(e=>!r.includes(e));return{...i,PATH:[...a,t].filter(Boolean).join(de.delimiter)}},Ci=(s,t)=>s.at(-1)===t?s:Ci([...s,t],de.resolve(t,"..")),eu=async(s,t,i)=>await tu(s,i)?[Rt(s),t.map(n=>uu(n)),{...i,shell:!0}]:[s,t,i],tu=async(s,{shell:t,cwd:i,env:n=Q.env})=>Q.platform==="win32"&&!t&&!await su(s,i,n),su=(s,t,{Path:i="",PATH:n=i})=>yi.some(r=>s.toLowerCase().endsWith(r))||nu(s,t,n),iu={},Fi=s=>(...t)=>iu[t.join("\0")]??=s(...t),ru=Fi(Oe.access),nu=Fi(async(s,t,i)=>{const n=i.split(de.delimiter).filter(Boolean).map(r=>r.replace(/^"(.*)"$/,"$1"));try{await Promise.any([t,...n].flatMap(r=>yi.map(a=>ru(`${de.resolve(r,s)}${a}`))))}catch{return!1}return!0}),yi=[".exe",".com"],uu=s=>Rt(Rt(`"${s.replaceAll(/(\\*)"/g,'$1$1\\"').replace(/(\\*)$/,"$1$1")}"`)),Rt=s=>s.replaceAll(/([()\][%!^"`<>&|;, *?])/g,"^$1"),ou=async(s,{input:t},i)=>{const n=await s;t!==void 0&&n.stdin.end(t);const r=Is(n,"close");try{return await Promise.race([r,...n.stdio.filter(Boolean).map(a=>au(a))]),hu(i,wi(n)),_i(i)}catch(a){throw await Promise.allSettled([r]),bi(a,n,i)}},au=async s=>{for await(const[t]of jr(s,"error"))if(!["ERR_STREAM_PREMATURE_CLOSE","EPIPE"].includes(t?.code))throw t},hu=({command:s},{exitCode:t,signalName:i})=>{if(i!==void 0)throw new Re(`Command was terminated with ${i}: ${s}`);if(t!==void 0)throw new Re(`Command failed with exit code ${t}: ${s}`)},bi=(s,t,i)=>Object.assign(lu(s,i),wi(t),_i(i)),lu=(s,{command:t})=>s instanceof Re?s:new Re(`Command failed: ${t}`,{cause:s});class Re extends Error{name="SubprocessError"}const wi=({exitCode:s,signalCode:t})=>({...s<1?{}:{exitCode:s},...t===null?{}:{signalName:t}}),_i=({state:{stdout:s,stderr:t,output:i},command:n,start:r})=>({stdout:Bt(s),stderr:Bt(t),output:Bt(i),command:n,durationMs:Number(Q.hrtime.bigint()-r)/1e6}),Bt=s=>s.at(-1)===`
80
+ `?s.slice(0,s.at(-2)==="\r"?-2:-1):s,cu=async(s,t,i,n)=>{try{["node","node.exe"].includes(s.toLowerCase())&&(s=Q.execPath,t=[...Q.execArgv.filter(a=>!a.startsWith("--inspect")),...t]),[s,t,i]=await eu(s,t,i),[s,t,i]=Du(s,t,i);const r=kr(s,t,i);return vi(r.stdout,n,"stdout"),vi(r.stderr,n,"stderr"),r.once("error",()=>{}),await Is(r,"spawn"),r}catch(r){throw bi(r,{},n)}},Du=(s,t,i)=>i.shell&&t.length>0?[[s,...t].join(" "),[],i]:[s,t,i],vi=(s,{state:t},i)=>{s&&(s.setEncoding("utf8"),t.isIterating||(t.isIterating=!1,s.on("data",n=>{t[i]+=n,t.output+=n})))},fu=async s=>{const[[t,i]]=await Promise.all([Promise.allSettled(s),du(s)]);if(i.reason)throw i.reason.pipedFrom=t.reason??t.value,i.reason;if(t.reason)throw t.reason;return{...i.value,pipedFrom:t.value}},du=async s=>{try{const[{stdout:t},{stdin:i}]=await Promise.all(s.map(({nodeChildProcess:n})=>n));if(i===null)throw new Error('The "stdin" option must be set on the first "spawn()" call in the pipeline.');if(t===null)throw new Error('The "stdout" option must be set on the last "spawn()" call in the pipeline.');Hr(t,i).catch(()=>{})}catch(t){throw await Promise.allSettled(s.map(({nodeChildProcess:i})=>pu(i))),t}},pu=async s=>{const{stdin:t}=await s;t.end()},Ai=async function*(s,{state:t},i){if(t.isIterating===!1)throw new Error(`The subprocess must be iterated right away, for example:
81
+ for await (const line of spawn(...)) { ... }`);t.isIterating=!0;try{const{[i]:n}=await s.nodeChildProcess;if(!n)return;yield*Ur.createInterface({input:n})}finally{await s}},mu=async function*(...s){try{let t=[];for(;s.length>0;){t=s.map((e,u)=>t[u]??Eu(e));const[{value:i,done:n},r]=await Promise.race(t.map((e,u)=>Promise.all([e,u]))),[a]=s.splice(r,1);t.splice(r,1),n||(s.push(a),yield i)}}finally{await Promise.all(s.map(t=>t.return()))}},Eu=async s=>{try{return await s.next()}catch(t){await s.throw(t)}};function xt(s,t,i,n){const[r=[],a={}]=Array.isArray(t)?[t,i]:[[],t],e=Zn([s,...r]),u=Jn(a),h=cu(s,r,u,e);let m=ou(h,u,e);Object.assign(m,{nodeChildProcess:h}),m=n?fu([n,m]):m;const y=Ai(m,e,"stdout"),p=Ai(m,e,"stderr");return Object.assign(m,{nodeChildProcess:h,stdout:y,stderr:p,[Symbol.asyncIterator]:()=>mu(y,p),pipe:(C,w,b)=>xt(C,w,b,m)})}function Si(s){return s.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join("")}async function Tt(s){try{return await(await import("prettier")).format(s,{parser:"typescript"})}catch{return s}}const gu="https://raw.githubusercontent.com/wrtnlabs/connectors/refs/heads/main/connectors-list.json",$t="@wrtnlabs/connector-";function Cu(s){return`${$t}${s}`}function Fu(s){return s.replace($t,"")}async function yu(){const s=await(await fetch(gu)).json();return(()=>{const t=u=>Array.isArray(u.connectors)&&u.connectors.every(h=>typeof h=="object"&&h!==null&&i(h))&&typeof u.version=="string",i=u=>typeof u.name=="string"&&RegExp(/^@wrtnlabs\/connector\x2d(.*)/).test(u.name)&&Array.isArray(u.envList)&&u.envList.every(h=>typeof h=="string"),n=(u,h,m=!0)=>((Array.isArray(u.connectors)||ne._assertGuard(m,{method:"typia.assert",path:h+".connectors",expected:"Array<UnwrapTaggedConnectorInfo>",value:u.connectors},e))&&u.connectors.every((y,p)=>(typeof y=="object"&&y!==null||ne._assertGuard(m,{method:"typia.assert",path:h+".connectors["+p+"]",expected:"UnwrapTaggedConnectorInfo",value:y},e))&&r(y,h+".connectors["+p+"]",m)||ne._assertGuard(m,{method:"typia.assert",path:h+".connectors["+p+"]",expected:"UnwrapTaggedConnectorInfo",value:y},e))||ne._assertGuard(m,{method:"typia.assert",path:h+".connectors",expected:"Array<UnwrapTaggedConnectorInfo>",value:u.connectors},e))&&(typeof u.version=="string"||ne._assertGuard(m,{method:"typia.assert",path:h+".version",expected:"string",value:u.version},e)),r=(u,h,m=!0)=>(typeof u.name=="string"&&RegExp(/^@wrtnlabs\/connector\x2d(.*)/).test(u.name)||ne._assertGuard(m,{method:"typia.assert",path:h+".name",expected:"`@wrtnlabs/connector-${string}`",value:u.name},e))&&((Array.isArray(u.envList)||ne._assertGuard(m,{method:"typia.assert",path:h+".envList",expected:"Array<string>",value:u.envList},e))&&u.envList.every((y,p)=>typeof y=="string"||ne._assertGuard(m,{method:"typia.assert",path:h+".envList["+p+"]",expected:"string",value:y},e))||ne._assertGuard(m,{method:"typia.assert",path:h+".envList",expected:"Array<string>",value:u.envList},e)),a=u=>typeof u=="object"&&u!==null&&t(u);let e;return(u,h)=>(a(u)===!1&&(e=h,((m,y,p=!0)=>(typeof m=="object"&&m!==null||ne._assertGuard(!0,{method:"typia.assert",path:y+"",expected:"UnwrapTaggedConnectors",value:m},e))&&n(m,y+"",!0)||ne._assertGuard(!0,{method:"typia.assert",path:y+"",expected:"UnwrapTaggedConnectors",value:m},e))(u,"$input",!0)),u)})()(s)}async function bu(){return(await yu()).connectors.map(({name:s,envList:t})=>{const i=Fu(s),n=i.replace("-"," ").toUpperCase();return{packageName:s,serviceName:i,displayName:n,envList:t}})}function Nt(s){return s.map(t=>{const i=Si(t);return`{
82
+ name: "${i} Connector",
81
83
  protocol: "class",
82
- application: typia.llm.application<${s}Service, "chatgpt">(),
83
- execute: new ${s}Service(),
84
+ application: typia.llm.application<${i}Service, "chatgpt">(),
85
+ execute: new ${i}Service(),
84
86
  }`}).join(`,
85
- `)}function xt(u){return u.map(t=>`import { ${ms(t)}Service } from "${Rt}${t}";`).join(`
86
- `)}function Tt({content:u,importCode:t,connectorCode:s}){return u.replace("/// INSERT IMPORT HERE",t).replace("/// INSERT CONTROLLER HERE",s)}var he={},$t,Es;function Ie(){if(Es)return $t;Es=1;const u=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"]]);return $t=t=>t?Object.keys(t).map(s=>[u.has(s)?u.get(s):s,t[s]]).reduce((s,r)=>(s[r[0]]=r[1],s),Object.create(null)):{},$t}var Nt={},gs;function It(){if(gs)return Nt;gs=1;const u=typeof process=="object"&&process?process:{stdout:null,stderr:null},t=xe,s=Ti,i=$i.StringDecoder,a=Symbol("EOF"),e=Symbol("maybeEmitEnd"),o=Symbol("emittedEnd"),h=Symbol("emittingEnd"),E=Symbol("emittedError"),y=Symbol("closed"),m=Symbol("read"),C=Symbol("flush"),_=Symbol("flushChunk"),b=Symbol("encoding"),A=Symbol("decoder"),S=Symbol("flowing"),v=Symbol("paused"),n=Symbol("resume"),l=Symbol("buffer"),f=Symbol("pipes"),d=Symbol("bufferLength"),D=Symbol("bufferPush"),F=Symbol("bufferShift"),R=Symbol("objectMode"),B=Symbol("destroyed"),x=Symbol("error"),M=Symbol("emitData"),P=Symbol("emitEnd"),U=Symbol("emitEnd2"),G=Symbol("async"),Y=Symbol("abort"),N=Symbol("aborted"),V=Symbol("signal"),W=z=>Promise.resolve().then(z),ee=ct._MP_NO_ITERATOR_SYMBOLS_!=="1",w=ee&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),c=ee&&Symbol.iterator||Symbol("iterator not implemented"),g=z=>z==="end"||z==="finish"||z==="prefinish",L=z=>z instanceof ArrayBuffer||typeof z=="object"&&z.constructor&&z.constructor.name==="ArrayBuffer"&&z.byteLength>=0,H=z=>!Buffer.isBuffer(z)&&ArrayBuffer.isView(z);class J{constructor(O,T,K){this.src=O,this.dest=T,this.opts=K,this.ondrain=()=>O[n](),T.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}}class $ extends J{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(O,T,K){super(O,T,K),this.proxyErrors=oe=>T.emit("error",oe),O.on("error",this.proxyErrors)}}class q extends s{constructor(O){super(),this[S]=!1,this[v]=!1,this[f]=[],this[l]=[],this[R]=O&&O.objectMode||!1,this[R]?this[b]=null:this[b]=O&&O.encoding||null,this[b]==="buffer"&&(this[b]=null),this[G]=O&&!!O.async||!1,this[A]=this[b]?new i(this[b]):null,this[a]=!1,this[o]=!1,this[h]=!1,this[y]=!1,this[E]=null,this.writable=!0,this.readable=!0,this[d]=0,this[B]=!1,O&&O.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[l]}),O&&O.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[f]}),this[V]=O&&O.signal,this[N]=!1,this[V]&&(this[V].addEventListener("abort",()=>this[Y]()),this[V].aborted&&this[Y]())}get bufferLength(){return this[d]}get encoding(){return this[b]}set encoding(O){if(this[R])throw new Error("cannot set encoding in objectMode");if(this[b]&&O!==this[b]&&(this[A]&&this[A].lastNeed||this[d]))throw new Error("cannot change encoding");this[b]!==O&&(this[A]=O?new i(O):null,this[l].length&&(this[l]=this[l].map(T=>this[A].write(T)))),this[b]=O}setEncoding(O){this.encoding=O}get objectMode(){return this[R]}set objectMode(O){this[R]=this[R]||!!O}get async(){return this[G]}set async(O){this[G]=this[G]||!!O}[Y](){this[N]=!0,this.emit("abort",this[V].reason),this.destroy(this[V].reason)}get aborted(){return this[N]}set aborted(O){}write(O,T,K){if(this[N])return!1;if(this[a])throw new Error("write after end");if(this[B])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof T=="function"&&(K=T,T="utf8"),T||(T="utf8");const oe=this[G]?W:ce=>ce();return!this[R]&&!Buffer.isBuffer(O)&&(H(O)?O=Buffer.from(O.buffer,O.byteOffset,O.byteLength):L(O)?O=Buffer.from(O):typeof O!="string"&&(this.objectMode=!0)),this[R]?(this.flowing&&this[d]!==0&&this[C](!0),this.flowing?this.emit("data",O):this[D](O),this[d]!==0&&this.emit("readable"),K&&oe(K),this.flowing):O.length?(typeof O=="string"&&!(T===this[b]&&!this[A].lastNeed)&&(O=Buffer.from(O,T)),Buffer.isBuffer(O)&&this[b]&&(O=this[A].write(O)),this.flowing&&this[d]!==0&&this[C](!0),this.flowing?this.emit("data",O):this[D](O),this[d]!==0&&this.emit("readable"),K&&oe(K),this.flowing):(this[d]!==0&&this.emit("readable"),K&&oe(K),this.flowing)}read(O){if(this[B])return null;if(this[d]===0||O===0||O>this[d])return this[e](),null;this[R]&&(O=null),this[l].length>1&&!this[R]&&(this.encoding?this[l]=[this[l].join("")]:this[l]=[Buffer.concat(this[l],this[d])]);const T=this[m](O||null,this[l][0]);return this[e](),T}[m](O,T){return O===T.length||O===null?this[F]():(this[l][0]=T.slice(O),T=T.slice(0,O),this[d]-=O),this.emit("data",T),!this[l].length&&!this[a]&&this.emit("drain"),T}end(O,T,K){return typeof O=="function"&&(K=O,O=null),typeof T=="function"&&(K=T,T="utf8"),O&&this.write(O,T),K&&this.once("end",K),this[a]=!0,this.writable=!1,(this.flowing||!this[v])&&this[e](),this}[n](){this[B]||(this[v]=!1,this[S]=!0,this.emit("resume"),this[l].length?this[C]():this[a]?this[e]():this.emit("drain"))}resume(){return this[n]()}pause(){this[S]=!1,this[v]=!0}get destroyed(){return this[B]}get flowing(){return this[S]}get paused(){return this[v]}[D](O){this[R]?this[d]+=1:this[d]+=O.length,this[l].push(O)}[F](){return this[R]?this[d]-=1:this[d]-=this[l][0].length,this[l].shift()}[C](O){do;while(this[_](this[F]())&&this[l].length);!O&&!this[l].length&&!this[a]&&this.emit("drain")}[_](O){return this.emit("data",O),this.flowing}pipe(O,T){if(this[B])return;const K=this[o];return T=T||{},O===u.stdout||O===u.stderr?T.end=!1:T.end=T.end!==!1,T.proxyErrors=!!T.proxyErrors,K?T.end&&O.end():(this[f].push(T.proxyErrors?new $(this,O,T):new J(this,O,T)),this[G]?W(()=>this[n]()):this[n]()),O}unpipe(O){const T=this[f].find(K=>K.dest===O);T&&(this[f].splice(this[f].indexOf(T),1),T.unpipe())}addListener(O,T){return this.on(O,T)}on(O,T){const K=super.on(O,T);return O==="data"&&!this[f].length&&!this.flowing?this[n]():O==="readable"&&this[d]!==0?super.emit("readable"):g(O)&&this[o]?(super.emit(O),this.removeAllListeners(O)):O==="error"&&this[E]&&(this[G]?W(()=>T.call(this,this[E])):T.call(this,this[E])),K}get emittedEnd(){return this[o]}[e](){!this[h]&&!this[o]&&!this[B]&&this[l].length===0&&this[a]&&(this[h]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[y]&&this.emit("close"),this[h]=!1)}emit(O,T,...K){if(O!=="error"&&O!=="close"&&O!==B&&this[B])return;if(O==="data")return!this[R]&&!T?!1:this[G]?W(()=>this[M](T)):this[M](T);if(O==="end")return this[P]();if(O==="close"){if(this[y]=!0,!this[o]&&!this[B])return;const ce=super.emit("close");return this.removeAllListeners("close"),ce}else if(O==="error"){this[E]=T,super.emit(x,T);const ce=!this[V]||this.listeners("error").length?super.emit("error",T):!1;return this[e](),ce}else if(O==="resume"){const ce=super.emit("resume");return this[e](),ce}else if(O==="finish"||O==="prefinish"){const ce=super.emit(O);return this.removeAllListeners(O),ce}const oe=super.emit(O,T,...K);return this[e](),oe}[M](O){for(const K of this[f])K.dest.write(O)===!1&&this.pause();const T=super.emit("data",O);return this[e](),T}[P](){this[o]||(this[o]=!0,this.readable=!1,this[G]?W(()=>this[U]()):this[U]())}[U](){if(this[A]){const T=this[A].end();if(T){for(const K of this[f])K.dest.write(T);super.emit("data",T)}}for(const T of this[f])T.end();const O=super.emit("end");return this.removeAllListeners("end"),O}collect(){const O=[];this[R]||(O.dataLength=0);const T=this.promise();return this.on("data",K=>{O.push(K),this[R]||(O.dataLength+=K.length)}),T.then(()=>O)}concat(){return this[R]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(O=>this[R]?Promise.reject(new Error("cannot concat in objectMode")):this[b]?O.join(""):Buffer.concat(O,O.dataLength))}promise(){return new Promise((O,T)=>{this.on(B,()=>T(new Error("stream destroyed"))),this.on("error",K=>T(K)),this.on("end",()=>O())})}[w](){let O=!1;const T=()=>(this.pause(),O=!0,Promise.resolve({done:!0}));return{next:()=>{if(O)return T();const oe=this.read();if(oe!==null)return Promise.resolve({done:!1,value:oe});if(this[a])return T();let ce=null,Ge=null;const te=Z=>{this.removeListener("data",p),this.removeListener("end",k),this.removeListener(B,j),T(),Ge(Z)},p=Z=>{this.removeListener("error",te),this.removeListener("end",k),this.removeListener(B,j),this.pause(),ce({value:Z,done:!!this[a]})},k=()=>{this.removeListener("error",te),this.removeListener("data",p),this.removeListener(B,j),T(),ce({done:!0})},j=()=>te(new Error("stream destroyed"));return new Promise((Z,X)=>{Ge=X,ce=Z,this.once(B,j),this.once("error",te),this.once("end",k),this.once("data",p)})},throw:T,return:T,[w](){return this}}}[c](){let O=!1;const T=()=>(this.pause(),this.removeListener(x,T),this.removeListener(B,T),this.removeListener("end",T),O=!0,{done:!0}),K=()=>{if(O)return T();const oe=this.read();return oe===null?T():{value:oe}};return this.once("end",T),this.once(x,T),this.once(B,T),{next:K,throw:T,return:T,[c](){return this}}}destroy(O){return this[B]?(O?this.emit("error",O):this.emit(B),this):(this[B]=!0,this[l].length=0,this[d]=0,typeof this.close=="function"&&!this[y]&&this.close(),O?this.emit("error",O):this.emit(B),this)}static isStream(O){return!!O&&(O instanceof q||O instanceof s||O instanceof t&&(typeof O.pipe=="function"||typeof O.write=="function"&&typeof O.end=="function"))}}return Nt.Minipass=q,Nt}var Ee={},Lt,Cs;function Mn(){if(Cs)return Lt;Cs=1;const u=Ni.constants||{ZLIB_VERNUM:4736};return Lt=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},u)),Lt}var Mt,Fs;function ys(){if(Fs)return Mt;Fs=1;const u=typeof process=="object"&&process?process:{stdout:null,stderr:null},t=xe,s=Ti,r=$i.StringDecoder,i=Symbol("EOF"),a=Symbol("maybeEmitEnd"),e=Symbol("emittedEnd"),o=Symbol("emittingEnd"),h=Symbol("emittedError"),E=Symbol("closed"),y=Symbol("read"),m=Symbol("flush"),C=Symbol("flushChunk"),_=Symbol("encoding"),b=Symbol("decoder"),A=Symbol("flowing"),S=Symbol("paused"),v=Symbol("resume"),n=Symbol("bufferLength"),l=Symbol("bufferPush"),f=Symbol("bufferShift"),d=Symbol("objectMode"),D=Symbol("destroyed"),F=Symbol("emitData"),R=Symbol("emitEnd"),B=Symbol("emitEnd2"),x=Symbol("async"),M=w=>Promise.resolve().then(w),P=ct._MP_NO_ITERATOR_SYMBOLS_!=="1",U=P&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),G=P&&Symbol.iterator||Symbol("iterator not implemented"),Y=w=>w==="end"||w==="finish"||w==="prefinish",N=w=>w instanceof ArrayBuffer||typeof w=="object"&&w.constructor&&w.constructor.name==="ArrayBuffer"&&w.byteLength>=0,V=w=>!Buffer.isBuffer(w)&&ArrayBuffer.isView(w);class W{constructor(c,g,L){this.src=c,this.dest=g,this.opts=L,this.ondrain=()=>c[v](),g.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}}class ee extends W{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(c,g,L){super(c,g,L),this.proxyErrors=H=>g.emit("error",H),c.on("error",this.proxyErrors)}}return Mt=class Fr extends s{constructor(c){super(),this[A]=!1,this[S]=!1,this.pipes=[],this.buffer=[],this[d]=c&&c.objectMode||!1,this[d]?this[_]=null:this[_]=c&&c.encoding||null,this[_]==="buffer"&&(this[_]=null),this[x]=c&&!!c.async||!1,this[b]=this[_]?new r(this[_]):null,this[i]=!1,this[e]=!1,this[o]=!1,this[E]=!1,this[h]=null,this.writable=!0,this.readable=!0,this[n]=0,this[D]=!1}get bufferLength(){return this[n]}get encoding(){return this[_]}set encoding(c){if(this[d])throw new Error("cannot set encoding in objectMode");if(this[_]&&c!==this[_]&&(this[b]&&this[b].lastNeed||this[n]))throw new Error("cannot change encoding");this[_]!==c&&(this[b]=c?new r(c):null,this.buffer.length&&(this.buffer=this.buffer.map(g=>this[b].write(g)))),this[_]=c}setEncoding(c){this.encoding=c}get objectMode(){return this[d]}set objectMode(c){this[d]=this[d]||!!c}get async(){return this[x]}set async(c){this[x]=this[x]||!!c}write(c,g,L){if(this[i])throw new Error("write after end");if(this[D])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof g=="function"&&(L=g,g="utf8"),g||(g="utf8");const H=this[x]?M:J=>J();return!this[d]&&!Buffer.isBuffer(c)&&(V(c)?c=Buffer.from(c.buffer,c.byteOffset,c.byteLength):N(c)?c=Buffer.from(c):typeof c!="string"&&(this.objectMode=!0)),this[d]?(this.flowing&&this[n]!==0&&this[m](!0),this.flowing?this.emit("data",c):this[l](c),this[n]!==0&&this.emit("readable"),L&&H(L),this.flowing):c.length?(typeof c=="string"&&!(g===this[_]&&!this[b].lastNeed)&&(c=Buffer.from(c,g)),Buffer.isBuffer(c)&&this[_]&&(c=this[b].write(c)),this.flowing&&this[n]!==0&&this[m](!0),this.flowing?this.emit("data",c):this[l](c),this[n]!==0&&this.emit("readable"),L&&H(L),this.flowing):(this[n]!==0&&this.emit("readable"),L&&H(L),this.flowing)}read(c){if(this[D])return null;if(this[n]===0||c===0||c>this[n])return this[a](),null;this[d]&&(c=null),this.buffer.length>1&&!this[d]&&(this.encoding?this.buffer=[this.buffer.join("")]:this.buffer=[Buffer.concat(this.buffer,this[n])]);const g=this[y](c||null,this.buffer[0]);return this[a](),g}[y](c,g){return c===g.length||c===null?this[f]():(this.buffer[0]=g.slice(c),g=g.slice(0,c),this[n]-=c),this.emit("data",g),!this.buffer.length&&!this[i]&&this.emit("drain"),g}end(c,g,L){return typeof c=="function"&&(L=c,c=null),typeof g=="function"&&(L=g,g="utf8"),c&&this.write(c,g),L&&this.once("end",L),this[i]=!0,this.writable=!1,(this.flowing||!this[S])&&this[a](),this}[v](){this[D]||(this[S]=!1,this[A]=!0,this.emit("resume"),this.buffer.length?this[m]():this[i]?this[a]():this.emit("drain"))}resume(){return this[v]()}pause(){this[A]=!1,this[S]=!0}get destroyed(){return this[D]}get flowing(){return this[A]}get paused(){return this[S]}[l](c){this[d]?this[n]+=1:this[n]+=c.length,this.buffer.push(c)}[f](){return this.buffer.length&&(this[d]?this[n]-=1:this[n]-=this.buffer[0].length),this.buffer.shift()}[m](c){do;while(this[C](this[f]()));!c&&!this.buffer.length&&!this[i]&&this.emit("drain")}[C](c){return c?(this.emit("data",c),this.flowing):!1}pipe(c,g){if(this[D])return;const L=this[e];return g=g||{},c===u.stdout||c===u.stderr?g.end=!1:g.end=g.end!==!1,g.proxyErrors=!!g.proxyErrors,L?g.end&&c.end():(this.pipes.push(g.proxyErrors?new ee(this,c,g):new W(this,c,g)),this[x]?M(()=>this[v]()):this[v]()),c}unpipe(c){const g=this.pipes.find(L=>L.dest===c);g&&(this.pipes.splice(this.pipes.indexOf(g),1),g.unpipe())}addListener(c,g){return this.on(c,g)}on(c,g){const L=super.on(c,g);return c==="data"&&!this.pipes.length&&!this.flowing?this[v]():c==="readable"&&this[n]!==0?super.emit("readable"):Y(c)&&this[e]?(super.emit(c),this.removeAllListeners(c)):c==="error"&&this[h]&&(this[x]?M(()=>g.call(this,this[h])):g.call(this,this[h])),L}get emittedEnd(){return this[e]}[a](){!this[o]&&!this[e]&&!this[D]&&this.buffer.length===0&&this[i]&&(this[o]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[E]&&this.emit("close"),this[o]=!1)}emit(c,g,...L){if(c!=="error"&&c!=="close"&&c!==D&&this[D])return;if(c==="data")return g?this[x]?M(()=>this[F](g)):this[F](g):!1;if(c==="end")return this[R]();if(c==="close"){if(this[E]=!0,!this[e]&&!this[D])return;const J=super.emit("close");return this.removeAllListeners("close"),J}else if(c==="error"){this[h]=g;const J=super.emit("error",g);return this[a](),J}else if(c==="resume"){const J=super.emit("resume");return this[a](),J}else if(c==="finish"||c==="prefinish"){const J=super.emit(c);return this.removeAllListeners(c),J}const H=super.emit(c,g,...L);return this[a](),H}[F](c){for(const L of this.pipes)L.dest.write(c)===!1&&this.pause();const g=super.emit("data",c);return this[a](),g}[R](){this[e]||(this[e]=!0,this.readable=!1,this[x]?M(()=>this[B]()):this[B]())}[B](){if(this[b]){const g=this[b].end();if(g){for(const L of this.pipes)L.dest.write(g);super.emit("data",g)}}for(const g of this.pipes)g.end();const c=super.emit("end");return this.removeAllListeners("end"),c}collect(){const c=[];this[d]||(c.dataLength=0);const g=this.promise();return this.on("data",L=>{c.push(L),this[d]||(c.dataLength+=L.length)}),g.then(()=>c)}concat(){return this[d]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(c=>this[d]?Promise.reject(new Error("cannot concat in objectMode")):this[_]?c.join(""):Buffer.concat(c,c.dataLength))}promise(){return new Promise((c,g)=>{this.on(D,()=>g(new Error("stream destroyed"))),this.on("error",L=>g(L)),this.on("end",()=>c())})}[U](){return{next:()=>{const g=this.read();if(g!==null)return Promise.resolve({done:!1,value:g});if(this[i])return Promise.resolve({done:!0});let L=null,H=null;const J=O=>{this.removeListener("data",$),this.removeListener("end",q),H(O)},$=O=>{this.removeListener("error",J),this.removeListener("end",q),this.pause(),L({value:O,done:!!this[i]})},q=()=>{this.removeListener("error",J),this.removeListener("data",$),L({done:!0})},z=()=>J(new Error("stream destroyed"));return new Promise((O,T)=>{H=T,L=O,this.once(D,z),this.once("error",J),this.once("end",q),this.once("data",$)})}}}[G](){return{next:()=>{const g=this.read();return{value:g,done:g===null}}}}destroy(c){return this[D]?(c?this.emit("error",c):this.emit(D),this):(this[D]=!0,this.buffer.length=0,this[n]=0,typeof this.close=="function"&&!this[E]&&this.close(),c?this.emit("error",c):this.emit(D),this)}static isStream(c){return!!c&&(c instanceof Fr||c instanceof s||c instanceof t&&(typeof c.pipe=="function"||typeof c.write=="function"&&typeof c.end=="function"))}},Mt}var bs;function _s(){if(bs)return Ee;bs=1;const u=lt,t=Or.Buffer,s=Ni,r=Ee.constants=Mn(),i=ys(),a=t.concat,e=Symbol("_superWrite");class o extends Error{constructor(N){super("zlib: "+N.message),this.code=N.code,this.errno=N.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+N.message,Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}}const h=Symbol("opts"),E=Symbol("flushFlag"),y=Symbol("finishFlushFlag"),m=Symbol("fullFlushFlag"),C=Symbol("handle"),_=Symbol("onError"),b=Symbol("sawError"),A=Symbol("level"),S=Symbol("strategy"),v=Symbol("ended");class n extends i{constructor(N,V){if(!N||typeof N!="object")throw new TypeError("invalid options for ZlibBase constructor");super(N),this[b]=!1,this[v]=!1,this[h]=N,this[E]=N.flush,this[y]=N.finishFlush;try{this[C]=new s[V](N)}catch(W){throw new o(W)}this[_]=W=>{this[b]||(this[b]=!0,this.close(),this.emit("error",W))},this[C].on("error",W=>this[_](new o(W))),this.once("end",()=>this.close)}close(){this[C]&&(this[C].close(),this[C]=null,this.emit("close"))}reset(){if(!this[b])return u(this[C],"zlib binding closed"),this[C].reset()}flush(N){this.ended||(typeof N!="number"&&(N=this[m]),this.write(Object.assign(t.alloc(0),{[E]:N})))}end(N,V,W){return N&&this.write(N,V),this.flush(this[y]),this[v]=!0,super.end(null,null,W)}get ended(){return this[v]}write(N,V,W){if(typeof V=="function"&&(W=V,V="utf8"),typeof N=="string"&&(N=t.from(N,V)),this[b])return;u(this[C],"zlib binding closed");const ee=this[C]._handle,w=ee.close;ee.close=()=>{};const c=this[C].close;this[C].close=()=>{},t.concat=H=>H;let g;try{const H=typeof N[E]=="number"?N[E]:this[E];g=this[C]._processChunk(N,H),t.concat=a}catch(H){t.concat=a,this[_](new o(H))}finally{this[C]&&(this[C]._handle=ee,ee.close=w,this[C].close=c,this[C].removeAllListeners("error"))}this[C]&&this[C].on("error",H=>this[_](new o(H)));let L;if(g)if(Array.isArray(g)&&g.length>0){L=this[e](t.from(g[0]));for(let H=1;H<g.length;H++)L=this[e](g[H])}else L=this[e](t.from(g));return W&&W(),L}[e](N){return super.write(N)}}class l extends n{constructor(N,V){N=N||{},N.flush=N.flush||r.Z_NO_FLUSH,N.finishFlush=N.finishFlush||r.Z_FINISH,super(N,V),this[m]=r.Z_FULL_FLUSH,this[A]=N.level,this[S]=N.strategy}params(N,V){if(!this[b]){if(!this[C])throw new Error("cannot switch params when binding is closed");if(!this[C].params)throw new Error("not supported in this implementation");if(this[A]!==N||this[S]!==V){this.flush(r.Z_SYNC_FLUSH),u(this[C],"zlib binding closed");const W=this[C].flush;this[C].flush=(ee,w)=>{this.flush(ee),w()};try{this[C].params(N,V)}finally{this[C].flush=W}this[C]&&(this[A]=N,this[S]=V)}}}}class f extends l{constructor(N){super(N,"Deflate")}}class d extends l{constructor(N){super(N,"Inflate")}}const D=Symbol("_portable");class F extends l{constructor(N){super(N,"Gzip"),this[D]=N&&!!N.portable}[e](N){return this[D]?(this[D]=!1,N[9]=255,super[e](N)):super[e](N)}}class R extends l{constructor(N){super(N,"Gunzip")}}class B extends l{constructor(N){super(N,"DeflateRaw")}}class x extends l{constructor(N){super(N,"InflateRaw")}}class M extends l{constructor(N){super(N,"Unzip")}}class P extends n{constructor(N,V){N=N||{},N.flush=N.flush||r.BROTLI_OPERATION_PROCESS,N.finishFlush=N.finishFlush||r.BROTLI_OPERATION_FINISH,super(N,V),this[m]=r.BROTLI_OPERATION_FLUSH}}class U extends P{constructor(N){super(N,"BrotliCompress")}}class G extends P{constructor(N){super(N,"BrotliDecompress")}}return Ee.Deflate=f,Ee.Inflate=d,Ee.Gzip=F,Ee.Gunzip=R,Ee.DeflateRaw=B,Ee.InflateRaw=x,Ee.Unzip=M,typeof s.BrotliCompress=="function"?(Ee.BrotliCompress=U,Ee.BrotliDecompress=G):Ee.BrotliCompress=Ee.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}},Ee}var Pt,ws;function Le(){return ws||(ws=1,Pt=(process.env.TESTING_TAR_FAKE_PLATFORM||process.platform)!=="win32"?t=>t:t=>t&&t.replace(/\\/g,"/")),Pt}var kt,vs;function Ht(){if(vs)return kt;vs=1;const{Minipass:u}=It(),t=Le(),s=Symbol("slurp");return kt=class extends u{constructor(i,a,e){switch(super(),this.pause(),this.extended=a,this.globalExtended=e,this.header=i,this.startBlockSize=512*Math.ceil(i.size/512),this.blockRemain=this.startBlockSize,this.remain=i.size,this.type=i.type,this.meta=!1,this.ignore=!1,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}this.path=t(i.path),this.mode=i.mode,this.mode&&(this.mode=this.mode&4095),this.uid=i.uid,this.gid=i.gid,this.uname=i.uname,this.gname=i.gname,this.size=i.size,this.mtime=i.mtime,this.atime=i.atime,this.ctime=i.ctime,this.linkpath=t(i.linkpath),this.uname=i.uname,this.gname=i.gname,a&&this[s](a),e&&this[s](e,!0)}write(i){const a=i.length;if(a>this.blockRemain)throw new Error("writing more to entry than is appropriate");const e=this.remain,o=this.blockRemain;return this.remain=Math.max(0,e-a),this.blockRemain=Math.max(0,o-a),this.ignore?!0:e>=a?super.write(i):super.write(i.slice(0,e))}[s](i,a){for(const e in i)i[e]!==null&&i[e]!==void 0&&!(a&&e==="path")&&(this[e]=e==="path"||e==="linkpath"?t(i[e]):i[e])}},kt}var jt={},As;function Ss(){return As||(As=1,function(u){u.name=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]),u.code=new Map(Array.from(u.name).map(t=>[t[1],t[0]]))}(jt)),jt}var Ut,Os;function Pn(){if(Os)return Ut;Os=1;const u=(h,E)=>{if(Number.isSafeInteger(h))h<0?s(h,E):t(h,E);else throw Error("cannot encode number outside of javascript safe integer range");return E},t=(h,E)=>{E[0]=128;for(var y=E.length;y>1;y--)E[y-1]=h&255,h=Math.floor(h/256)},s=(h,E)=>{E[0]=255;var y=!1;h=h*-1;for(var m=E.length;m>1;m--){var C=h&255;h=Math.floor(h/256),y?E[m-1]=e(C):C===0?E[m-1]=0:(y=!0,E[m-1]=o(C))}},r=h=>{const E=h[0],y=E===128?a(h.slice(1,h.length)):E===255?i(h):null;if(y===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(y))throw Error("parsed number outside of javascript safe integer range");return y},i=h=>{for(var E=h.length,y=0,m=!1,C=E-1;C>-1;C--){var _=h[C],b;m?b=e(_):_===0?b=_:(m=!0,b=o(_)),b!==0&&(y-=b*Math.pow(256,E-C-1))}return y},a=h=>{for(var E=h.length,y=0,m=E-1;m>-1;m--){var C=h[m];C!==0&&(y+=C*Math.pow(256,E-m-1))}return y},e=h=>(255^h)&255,o=h=>(255^h)+1&255;return Ut={encode:u,parse:r},Ut}var zt,Rs;function Me(){if(Rs)return zt;Rs=1;const u=Ss(),t=De.posix,s=Pn(),r=Symbol("slurp"),i=Symbol("type");class a{constructor(D,F,R,B){this.cksumValid=!1,this.needPax=!1,this.nullBlock=!1,this.block=null,this.path=null,this.mode=null,this.uid=null,this.gid=null,this.size=null,this.mtime=null,this.cksum=null,this[i]="0",this.linkpath=null,this.uname=null,this.gname=null,this.devmaj=0,this.devmin=0,this.atime=null,this.ctime=null,Buffer.isBuffer(D)?this.decode(D,F||0,R,B):D&&this.set(D)}decode(D,F,R,B){if(F||(F=0),!D||!(D.length>=F+512))throw new Error("need 512 bytes for header");if(this.path=o(D,F,100),this.mode=y(D,F+100,8),this.uid=y(D,F+108,8),this.gid=y(D,F+116,8),this.size=y(D,F+124,12),this.mtime=h(D,F+136,12),this.cksum=y(D,F+148,12),this[r](R),this[r](B,!0),this[i]=o(D,F+156,1),this[i]===""&&(this[i]="0"),this[i]==="0"&&this.path.slice(-1)==="/"&&(this[i]="5"),this[i]==="5"&&(this.size=0),this.linkpath=o(D,F+157,100),D.slice(F+257,F+265).toString()==="ustar\x0000")if(this.uname=o(D,F+265,32),this.gname=o(D,F+297,32),this.devmaj=y(D,F+329,8),this.devmin=y(D,F+337,8),D[F+475]!==0){const M=o(D,F+345,155);this.path=M+"/"+this.path}else{const M=o(D,F+345,130);M&&(this.path=M+"/"+this.path),this.atime=h(D,F+476,12),this.ctime=h(D,F+488,12)}let x=8*32;for(let M=F;M<F+148;M++)x+=D[M];for(let M=F+156;M<F+512;M++)x+=D[M];this.cksumValid=x===this.cksum,this.cksum===null&&x===8*32&&(this.nullBlock=!0)}[r](D,F){for(const R in D)D[R]!==null&&D[R]!==void 0&&!(F&&R==="path")&&(this[R]=D[R])}encode(D,F){if(D||(D=this.block=Buffer.alloc(512),F=0),F||(F=0),!(D.length>=F+512))throw new Error("need 512 bytes for header");const R=this.ctime||this.atime?130:155,B=e(this.path||"",R),x=B[0],M=B[1];this.needPax=B[2],this.needPax=f(D,F,100,x)||this.needPax,this.needPax=b(D,F+100,8,this.mode)||this.needPax,this.needPax=b(D,F+108,8,this.uid)||this.needPax,this.needPax=b(D,F+116,8,this.gid)||this.needPax,this.needPax=b(D,F+124,12,this.size)||this.needPax,this.needPax=n(D,F+136,12,this.mtime)||this.needPax,D[F+156]=this[i].charCodeAt(0),this.needPax=f(D,F+157,100,this.linkpath)||this.needPax,D.write("ustar\x0000",F+257,8),this.needPax=f(D,F+265,32,this.uname)||this.needPax,this.needPax=f(D,F+297,32,this.gname)||this.needPax,this.needPax=b(D,F+329,8,this.devmaj)||this.needPax,this.needPax=b(D,F+337,8,this.devmin)||this.needPax,this.needPax=f(D,F+345,R,M)||this.needPax,D[F+475]!==0?this.needPax=f(D,F+345,155,M)||this.needPax:(this.needPax=f(D,F+345,130,M)||this.needPax,this.needPax=n(D,F+476,12,this.atime)||this.needPax,this.needPax=n(D,F+488,12,this.ctime)||this.needPax);let P=8*32;for(let U=F;U<F+148;U++)P+=D[U];for(let U=F+156;U<F+512;U++)P+=D[U];return this.cksum=P,b(D,F+148,8,this.cksum),this.cksumValid=!0,this.needPax}set(D){for(const F in D)D[F]!==null&&D[F]!==void 0&&(this[F]=D[F])}get type(){return u.name.get(this[i])||this[i]}get typeKey(){return this[i]}set type(D){u.code.has(D)?this[i]=u.code.get(D):this[i]=D}}const e=(d,D)=>{let R=d,B="",x;const M=t.parse(d).root||".";if(Buffer.byteLength(R)<100)x=[R,B,!1];else{B=t.dirname(R),R=t.basename(R);do Buffer.byteLength(R)<=100&&Buffer.byteLength(B)<=D?x=[R,B,!1]:Buffer.byteLength(R)>100&&Buffer.byteLength(B)<=D?x=[R.slice(0,99),B,!0]:(R=t.join(t.basename(B),R),B=t.dirname(B));while(B!==M&&!x);x||(x=[d.slice(0,99),"",!0])}return x},o=(d,D,F)=>d.slice(D,D+F).toString("utf8").replace(/\0.*/,""),h=(d,D,F)=>E(y(d,D,F)),E=d=>d===null?null:new Date(d*1e3),y=(d,D,F)=>d[D]&128?s.parse(d.slice(D,D+F)):C(d,D,F),m=d=>isNaN(d)?null:d,C=(d,D,F)=>m(parseInt(d.slice(D,D+F).toString("utf8").replace(/\0.*$/,"").trim(),8)),_={12:8589934591,8:2097151},b=(d,D,F,R)=>R===null?!1:R>_[F]||R<0?(s.encode(R,d.slice(D,D+F)),!0):(A(d,D,F,R),!1),A=(d,D,F,R)=>d.write(S(R,F),D,F,"ascii"),S=(d,D)=>v(Math.floor(d).toString(8),D),v=(d,D)=>(d.length===D-1?d:new Array(D-d.length-1).join("0")+d+" ")+"\0",n=(d,D,F,R)=>R===null?!1:b(d,D,F,R.getTime()/1e3),l=new Array(156).join("\0"),f=(d,D,F,R)=>R===null?!1:(d.write(R+l,D,F,"utf8"),R.length!==Buffer.byteLength(R)||R.length>F);return zt=a,zt}var Gt,Bs;function qt(){if(Bs)return Gt;Bs=1;const u=Me(),t=De;class s{constructor(o,h){this.atime=o.atime||null,this.charset=o.charset||null,this.comment=o.comment||null,this.ctime=o.ctime||null,this.gid=o.gid||null,this.gname=o.gname||null,this.linkpath=o.linkpath||null,this.mtime=o.mtime||null,this.path=o.path||null,this.size=o.size||null,this.uid=o.uid||null,this.uname=o.uname||null,this.dev=o.dev||null,this.ino=o.ino||null,this.nlink=o.nlink||null,this.global=h||!1}encode(){const o=this.encodeBody();if(o==="")return null;const h=Buffer.byteLength(o),E=512*Math.ceil(1+h/512),y=Buffer.allocUnsafe(E);for(let m=0;m<512;m++)y[m]=0;new u({path:("PaxHeader/"+t.basename(this.path)).slice(0,99),mode:this.mode||420,uid:this.uid||null,gid:this.gid||null,size:h,mtime:this.mtime||null,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime||null,ctime:this.ctime||null}).encode(y),y.write(o,512,h,"utf8");for(let m=h+512;m<y.length;m++)y[m]=0;return y}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(o){if(this[o]===null||this[o]===void 0)return"";const h=this[o]instanceof Date?this[o].getTime()/1e3:this[o],E=" "+(o==="dev"||o==="ino"||o==="nlink"?"SCHILY.":"")+o+"="+h+`
87
- `,y=Buffer.byteLength(E);let m=Math.floor(Math.log(y)/Math.log(10))+1;return y+m>=Math.pow(10,m)&&(m+=1),m+y+E}}s.parse=(e,o,h)=>new s(r(i(e),o),h);const r=(e,o)=>o?Object.keys(e).reduce((h,E)=>(h[E]=e[E],h),o):e,i=e=>e.replace(/\n$/,"").split(`
88
- `).reduce(a,Object.create(null)),a=(e,o)=>{const h=parseInt(o,10);if(h!==Buffer.byteLength(o)+1)return e;o=o.slice((h+" ").length);const E=o.split("="),y=E.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!y)return e;const m=E.join("=");return e[y]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(y)?new Date(m*1e3):/^[0-9]+$/.test(m)?+m:m,e};return Gt=s,Gt}var Vt,xs;function Pe(){return xs||(xs=1,Vt=u=>{let t=u.length-1,s=-1;for(;t>-1&&u.charAt(t)==="/";)s=t,t--;return s===-1?u:u.slice(0,s)}),Vt}var Wt,Ts;function Kt(){return Ts||(Ts=1,Wt=u=>class extends u{warn(t,s,r={}){this.file&&(r.file=this.file),this.cwd&&(r.cwd=this.cwd),r.code=s instanceof Error&&s.code||t,r.tarCode=t,!this.strict&&r.recoverable!==!1?(s instanceof Error&&(r=Object.assign(s,r),s=s.message),this.emit("warn",r.tarCode,s,r)):s instanceof Error?this.emit("error",Object.assign(s,r)):this.emit("error",Object.assign(new Error(`${t}: ${s}`),r))}}),Wt}var Yt,$s;function Ns(){if($s)return Yt;$s=1;const u=["|","<",">","?",":"],t=u.map(i=>String.fromCharCode(61440+i.charCodeAt(0))),s=new Map(u.map((i,a)=>[i,t[a]])),r=new Map(t.map((i,a)=>[i,u[a]]));return Yt={encode:i=>u.reduce((a,e)=>a.split(e).join(s.get(e)),i),decode:i=>t.reduce((a,e)=>a.split(e).join(r.get(e)),i)},Yt}var Zt,Is;function Ls(){if(Is)return Zt;Is=1;const{isAbsolute:u,parse:t}=De.win32;return Zt=s=>{let r="",i=t(s);for(;u(s)||i.root;){const a=s.charAt(0)==="/"&&s.slice(0,4)!=="//?/"?"/":i.root;s=s.slice(a.length),r+=a,i=t(s)}return[r,s]},Zt}var Xt,Ms;function kn(){return Ms||(Ms=1,Xt=(u,t,s)=>(u&=4095,s&&(u=(u|384)&-19),t&&(u&256&&(u|=64),u&32&&(u|=8),u&4&&(u|=1)),u)),Xt}var Jt,Ps;function ks(){if(Ps)return Jt;Ps=1;const{Minipass:u}=It(),t=qt(),s=Me(),r=ge,i=De,a=Le(),e=Pe(),o=(w,c)=>c?(w=a(w).replace(/^\.(\/|$)/,""),e(c)+"/"+w):a(w),h=16*1024*1024,E=Symbol("process"),y=Symbol("file"),m=Symbol("directory"),C=Symbol("symlink"),_=Symbol("hardlink"),b=Symbol("header"),A=Symbol("read"),S=Symbol("lstat"),v=Symbol("onlstat"),n=Symbol("onread"),l=Symbol("onreadlink"),f=Symbol("openfile"),d=Symbol("onopenfile"),D=Symbol("close"),F=Symbol("mode"),R=Symbol("awaitDrain"),B=Symbol("ondrain"),x=Symbol("prefix"),M=Symbol("hadError"),P=Kt(),U=Ns(),G=Ls(),Y=kn(),N=P(class extends u{constructor(c,g){if(g=g||{},super(g),typeof c!="string")throw new TypeError("path is required");this.path=a(c),this.portable=!!g.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||"",this.maxReadSize=g.maxReadSize||h,this.linkCache=g.linkCache||new Map,this.statCache=g.statCache||new Map,this.preservePaths=!!g.preservePaths,this.cwd=a(g.cwd||process.cwd()),this.strict=!!g.strict,this.noPax=!!g.noPax,this.noMtime=!!g.noMtime,this.mtime=g.mtime||null,this.prefix=g.prefix?a(g.prefix):null,this.fd=null,this.blockLen=null,this.blockRemain=null,this.buf=null,this.offset=null,this.length=null,this.pos=null,this.remain=null,typeof g.onwarn=="function"&&this.on("warn",g.onwarn);let L=!1;if(!this.preservePaths){const[H,J]=G(this.path);H&&(this.path=J,L=H)}this.win32=!!g.win32||process.platform==="win32",this.win32&&(this.path=U.decode(this.path.replace(/\\/g,"/")),c=c.replace(/\\/g,"/")),this.absolute=a(g.absolute||i.resolve(this.cwd,c)),this.path===""&&(this.path="./"),L&&this.warn("TAR_ENTRY_INFO",`stripping ${L} from absolute path`,{entry:this,path:L+this.path}),this.statCache.has(this.absolute)?this[v](this.statCache.get(this.absolute)):this[S]()}emit(c,...g){return c==="error"&&(this[M]=!0),super.emit(c,...g)}[S](){r.lstat(this.absolute,(c,g)=>{if(c)return this.emit("error",c);this[v](g)})}[v](c){this.statCache.set(this.absolute,c),this.stat=c,c.isFile()||(c.size=0),this.type=ee(c),this.emit("stat",c),this[E]()}[E](){switch(this.type){case"File":return this[y]();case"Directory":return this[m]();case"SymbolicLink":return this[C]();default:return this.end()}}[F](c){return Y(c,this.type==="Directory",this.portable)}[x](c){return o(c,this.prefix)}[b](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new s({path:this[x](this.path),linkpath:this.type==="Link"?this[x](this.linkpath):this.linkpath,mode:this[F](this.stat.mode),uid:this.portable?null:this.stat.uid,gid:this.portable?null:this.stat.gid,size:this.stat.size,mtime:this.noMtime?null:this.mtime||this.stat.mtime,type:this.type,uname:this.portable?null:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?null:this.stat.atime,ctime:this.portable?null:this.stat.ctime}),this.header.encode()&&!this.noPax&&super.write(new t({atime:this.portable?null:this.header.atime,ctime:this.portable?null:this.header.ctime,gid:this.portable?null:this.header.gid,mtime:this.noMtime?null:this.mtime||this.header.mtime,path:this[x](this.path),linkpath:this.type==="Link"?this[x](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?null:this.header.uid,uname:this.portable?null:this.header.uname,dev:this.portable?null:this.stat.dev,ino:this.portable?null:this.stat.ino,nlink:this.portable?null:this.stat.nlink}).encode()),super.write(this.header.block)}[m](){this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[b](),this.end()}[C](){r.readlink(this.absolute,(c,g)=>{if(c)return this.emit("error",c);this[l](g)})}[l](c){this.linkpath=a(c),this[b](),this.end()}[_](c){this.type="Link",this.linkpath=a(i.relative(this.cwd,c)),this.stat.size=0,this[b](),this.end()}[y](){if(this.stat.nlink>1){const c=this.stat.dev+":"+this.stat.ino;if(this.linkCache.has(c)){const g=this.linkCache.get(c);if(g.indexOf(this.cwd)===0)return this[_](g)}this.linkCache.set(c,this.absolute)}if(this[b](),this.stat.size===0)return this.end();this[f]()}[f](){r.open(this.absolute,"r",(c,g)=>{if(c)return this.emit("error",c);this[d](g)})}[d](c){if(this.fd=c,this[M])return this[D]();this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;const g=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(g),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[A]()}[A](){const{fd:c,buf:g,offset:L,length:H,pos:J}=this;r.read(c,g,L,H,J,($,q)=>{if($)return this[D](()=>this.emit("error",$));this[n](q)})}[D](c){r.close(this.fd,c)}[n](c){if(c<=0&&this.remain>0){const H=new Error("encountered unexpected EOF");return H.path=this.absolute,H.syscall="read",H.code="EOF",this[D](()=>this.emit("error",H))}if(c>this.remain){const H=new Error("did not encounter expected EOF");return H.path=this.absolute,H.syscall="read",H.code="EOF",this[D](()=>this.emit("error",H))}if(c===this.remain)for(let H=c;H<this.length&&c<this.blockRemain;H++)this.buf[H+this.offset]=0,c++,this.remain++;const g=this.offset===0&&c===this.buf.length?this.buf:this.buf.slice(this.offset,this.offset+c);this.write(g)?this[B]():this[R](()=>this[B]())}[R](c){this.once("drain",c)}write(c){if(this.blockRemain<c.length){const g=new Error("writing more data than expected");return g.path=this.absolute,this.emit("error",g)}return this.remain-=c.length,this.blockRemain-=c.length,this.pos+=c.length,this.offset+=c.length,super.write(c)}[B](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[D](c=>c?this.emit("error",c):this.end());this.offset>=this.length&&(this.buf=Buffer.allocUnsafe(Math.min(this.blockRemain,this.buf.length)),this.offset=0),this.length=this.buf.length-this.offset,this[A]()}});class V extends N{[S](){this[v](r.lstatSync(this.absolute))}[C](){this[l](r.readlinkSync(this.absolute))}[f](){this[d](r.openSync(this.absolute,"r"))}[A](){let c=!0;try{const{fd:g,buf:L,offset:H,length:J,pos:$}=this,q=r.readSync(g,L,H,J,$);this[n](q),c=!1}finally{if(c)try{this[D](()=>{})}catch{}}}[R](c){c()}[D](c){r.closeSync(this.fd),c()}}const W=P(class extends u{constructor(c,g){g=g||{},super(g),this.preservePaths=!!g.preservePaths,this.portable=!!g.portable,this.strict=!!g.strict,this.noPax=!!g.noPax,this.noMtime=!!g.noMtime,this.readEntry=c,this.type=c.type,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=g.prefix||null,this.path=a(c.path),this.mode=this[F](c.mode),this.uid=this.portable?null:c.uid,this.gid=this.portable?null:c.gid,this.uname=this.portable?null:c.uname,this.gname=this.portable?null:c.gname,this.size=c.size,this.mtime=this.noMtime?null:g.mtime||c.mtime,this.atime=this.portable?null:c.atime,this.ctime=this.portable?null:c.ctime,this.linkpath=a(c.linkpath),typeof g.onwarn=="function"&&this.on("warn",g.onwarn);let L=!1;if(!this.preservePaths){const[H,J]=G(this.path);H&&(this.path=J,L=H)}this.remain=c.size,this.blockRemain=c.startBlockSize,this.header=new s({path:this[x](this.path),linkpath:this.type==="Link"?this[x](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?null:this.uid,gid:this.portable?null:this.gid,size:this.size,mtime:this.noMtime?null:this.mtime,type:this.type,uname:this.portable?null:this.uname,atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime}),L&&this.warn("TAR_ENTRY_INFO",`stripping ${L} from absolute path`,{entry:this,path:L+this.path}),this.header.encode()&&!this.noPax&&super.write(new t({atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime,gid:this.portable?null:this.gid,mtime:this.noMtime?null:this.mtime,path:this[x](this.path),linkpath:this.type==="Link"?this[x](this.linkpath):this.linkpath,size:this.size,uid:this.portable?null:this.uid,uname:this.portable?null:this.uname,dev:this.portable?null:this.readEntry.dev,ino:this.portable?null:this.readEntry.ino,nlink:this.portable?null:this.readEntry.nlink}).encode()),super.write(this.header.block),c.pipe(this)}[x](c){return o(c,this.prefix)}[F](c){return Y(c,this.type==="Directory",this.portable)}write(c){const g=c.length;if(g>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=g,super.write(c)}end(){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),super.end()}});N.Sync=V,N.Tar=W;const ee=w=>w.isFile()?"File":w.isDirectory()?"Directory":w.isSymbolicLink()?"SymbolicLink":"Unsupported";return Jt=N,Jt}var Qt,Hs;function Hn(){return Hs||(Hs=1,Qt=function(u){u.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),Qt}var ei,js;function Us(){if(js)return ei;js=1,ei=u,u.Node=i,u.create=u;function u(a){var e=this;if(e instanceof u||(e=new u),e.tail=null,e.head=null,e.length=0,a&&typeof a.forEach=="function")a.forEach(function(E){e.push(E)});else if(arguments.length>0)for(var o=0,h=arguments.length;o<h;o++)e.push(arguments[o]);return e}u.prototype.removeNode=function(a){if(a.list!==this)throw new Error("removing node which does not belong to this list");var e=a.next,o=a.prev;return e&&(e.prev=o),o&&(o.next=e),a===this.head&&(this.head=e),a===this.tail&&(this.tail=o),a.list.length--,a.next=null,a.prev=null,a.list=null,e},u.prototype.unshiftNode=function(a){if(a!==this.head){a.list&&a.list.removeNode(a);var e=this.head;a.list=this,a.next=e,e&&(e.prev=a),this.head=a,this.tail||(this.tail=a),this.length++}},u.prototype.pushNode=function(a){if(a!==this.tail){a.list&&a.list.removeNode(a);var e=this.tail;a.list=this,a.prev=e,e&&(e.next=a),this.tail=a,this.head||(this.head=a),this.length++}},u.prototype.push=function(){for(var a=0,e=arguments.length;a<e;a++)s(this,arguments[a]);return this.length},u.prototype.unshift=function(){for(var a=0,e=arguments.length;a<e;a++)r(this,arguments[a]);return this.length},u.prototype.pop=function(){if(this.tail){var a=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,a}},u.prototype.shift=function(){if(this.head){var a=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,a}},u.prototype.forEach=function(a,e){e=e||this;for(var o=this.head,h=0;o!==null;h++)a.call(e,o.value,h,this),o=o.next},u.prototype.forEachReverse=function(a,e){e=e||this;for(var o=this.tail,h=this.length-1;o!==null;h--)a.call(e,o.value,h,this),o=o.prev},u.prototype.get=function(a){for(var e=0,o=this.head;o!==null&&e<a;e++)o=o.next;if(e===a&&o!==null)return o.value},u.prototype.getReverse=function(a){for(var e=0,o=this.tail;o!==null&&e<a;e++)o=o.prev;if(e===a&&o!==null)return o.value},u.prototype.map=function(a,e){e=e||this;for(var o=new u,h=this.head;h!==null;)o.push(a.call(e,h.value,this)),h=h.next;return o},u.prototype.mapReverse=function(a,e){e=e||this;for(var o=new u,h=this.tail;h!==null;)o.push(a.call(e,h.value,this)),h=h.prev;return o},u.prototype.reduce=function(a,e){var o,h=this.head;if(arguments.length>1)o=e;else if(this.head)h=this.head.next,o=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var E=0;h!==null;E++)o=a(o,h.value,E),h=h.next;return o},u.prototype.reduceReverse=function(a,e){var o,h=this.tail;if(arguments.length>1)o=e;else if(this.tail)h=this.tail.prev,o=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var E=this.length-1;h!==null;E--)o=a(o,h.value,E),h=h.prev;return o},u.prototype.toArray=function(){for(var a=new Array(this.length),e=0,o=this.head;o!==null;e++)a[e]=o.value,o=o.next;return a},u.prototype.toArrayReverse=function(){for(var a=new Array(this.length),e=0,o=this.tail;o!==null;e++)a[e]=o.value,o=o.prev;return a},u.prototype.slice=function(a,e){e=e||this.length,e<0&&(e+=this.length),a=a||0,a<0&&(a+=this.length);var o=new u;if(e<a||e<0)return o;a<0&&(a=0),e>this.length&&(e=this.length);for(var h=0,E=this.head;E!==null&&h<a;h++)E=E.next;for(;E!==null&&h<e;h++,E=E.next)o.push(E.value);return o},u.prototype.sliceReverse=function(a,e){e=e||this.length,e<0&&(e+=this.length),a=a||0,a<0&&(a+=this.length);var o=new u;if(e<a||e<0)return o;a<0&&(a=0),e>this.length&&(e=this.length);for(var h=this.length,E=this.tail;E!==null&&h>e;h--)E=E.prev;for(;E!==null&&h>a;h--,E=E.prev)o.push(E.value);return o},u.prototype.splice=function(a,e,...o){a>this.length&&(a=this.length-1),a<0&&(a=this.length+a);for(var h=0,E=this.head;E!==null&&h<a;h++)E=E.next;for(var y=[],h=0;E&&h<e;h++)y.push(E.value),E=this.removeNode(E);E===null&&(E=this.tail),E!==this.head&&E!==this.tail&&(E=E.prev);for(var h=0;h<o.length;h++)E=t(this,E,o[h]);return y},u.prototype.reverse=function(){for(var a=this.head,e=this.tail,o=a;o!==null;o=o.prev){var h=o.prev;o.prev=o.next,o.next=h}return this.head=e,this.tail=a,this};function t(a,e,o){var h=e===a.head?new i(o,null,e,a):new i(o,e,e.next,a);return h.next===null&&(a.tail=h),h.prev===null&&(a.head=h),a.length++,h}function s(a,e){a.tail=new i(e,a.tail,null,a),a.head||(a.head=a.tail),a.length++}function r(a,e){a.head=new i(e,null,a.head,a),a.tail||(a.tail=a.head),a.length++}function i(a,e,o,h){if(!(this instanceof i))return new i(a,e,o,h);this.list=h,this.value=a,e?(e.next=this,this.prev=e):this.prev=null,o?(o.prev=this,this.next=o):this.next=null}try{Hn()(u)}catch{}return ei}var ti,zs;function ii(){if(zs)return ti;zs=1;class u{constructor(w,c){this.path=w||"./",this.absolute=c,this.entry=null,this.stat=null,this.readdir=null,this.pending=!1,this.ignore=!1,this.piped=!1}}const{Minipass:t}=It(),s=_s(),r=Ht(),i=ks(),a=i.Sync,e=i.Tar,o=Us(),h=Buffer.alloc(1024),E=Symbol("onStat"),y=Symbol("ended"),m=Symbol("queue"),C=Symbol("current"),_=Symbol("process"),b=Symbol("processing"),A=Symbol("processJob"),S=Symbol("jobs"),v=Symbol("jobDone"),n=Symbol("addFSEntry"),l=Symbol("addTarEntry"),f=Symbol("stat"),d=Symbol("readdir"),D=Symbol("onreaddir"),F=Symbol("pipe"),R=Symbol("entry"),B=Symbol("entryOpt"),x=Symbol("writeEntryClass"),M=Symbol("write"),P=Symbol("ondrain"),U=ge,G=De,Y=Kt(),N=Le(),V=Y(class extends t{constructor(w){if(super(w),w=w||Object.create(null),this.opt=w,this.file=w.file||"",this.cwd=w.cwd||process.cwd(),this.maxReadSize=w.maxReadSize,this.preservePaths=!!w.preservePaths,this.strict=!!w.strict,this.noPax=!!w.noPax,this.prefix=N(w.prefix||""),this.linkCache=w.linkCache||new Map,this.statCache=w.statCache||new Map,this.readdirCache=w.readdirCache||new Map,this[x]=i,typeof w.onwarn=="function"&&this.on("warn",w.onwarn),this.portable=!!w.portable,this.zip=null,w.gzip||w.brotli){if(w.gzip&&w.brotli)throw new TypeError("gzip and brotli are mutually exclusive");w.gzip&&(typeof w.gzip!="object"&&(w.gzip={}),this.portable&&(w.gzip.portable=!0),this.zip=new s.Gzip(w.gzip)),w.brotli&&(typeof w.brotli!="object"&&(w.brotli={}),this.zip=new s.BrotliCompress(w.brotli)),this.zip.on("data",c=>super.write(c)),this.zip.on("end",c=>super.end()),this.zip.on("drain",c=>this[P]()),this.on("resume",c=>this.zip.resume())}else this.on("drain",this[P]);this.noDirRecurse=!!w.noDirRecurse,this.follow=!!w.follow,this.noMtime=!!w.noMtime,this.mtime=w.mtime||null,this.filter=typeof w.filter=="function"?w.filter:c=>!0,this[m]=new o,this[S]=0,this.jobs=+w.jobs||4,this[b]=!1,this[y]=!1}[M](w){return super.write(w)}add(w){return this.write(w),this}end(w){return w&&this.write(w),this[y]=!0,this[_](),this}write(w){if(this[y])throw new Error("write after end");return w instanceof r?this[l](w):this[n](w),this.flowing}[l](w){const c=N(G.resolve(this.cwd,w.path));if(!this.filter(w.path,w))w.resume();else{const g=new u(w.path,c,!1);g.entry=new e(w,this[B](g)),g.entry.on("end",L=>this[v](g)),this[S]+=1,this[m].push(g)}this[_]()}[n](w){const c=N(G.resolve(this.cwd,w));this[m].push(new u(w,c)),this[_]()}[f](w){w.pending=!0,this[S]+=1;const c=this.follow?"stat":"lstat";U[c](w.absolute,(g,L)=>{w.pending=!1,this[S]-=1,g?this.emit("error",g):this[E](w,L)})}[E](w,c){this.statCache.set(w.absolute,c),w.stat=c,this.filter(w.path,c)||(w.ignore=!0),this[_]()}[d](w){w.pending=!0,this[S]+=1,U.readdir(w.absolute,(c,g)=>{if(w.pending=!1,this[S]-=1,c)return this.emit("error",c);this[D](w,g)})}[D](w,c){this.readdirCache.set(w.absolute,c),w.readdir=c,this[_]()}[_](){if(!this[b]){this[b]=!0;for(let w=this[m].head;w!==null&&this[S]<this.jobs;w=w.next)if(this[A](w.value),w.value.ignore){const c=w.next;this[m].removeNode(w),w.next=c}this[b]=!1,this[y]&&!this[m].length&&this[S]===0&&(this.zip?this.zip.end(h):(super.write(h),super.end()))}}get[C](){return this[m]&&this[m].head&&this[m].head.value}[v](w){this[m].shift(),this[S]-=1,this[_]()}[A](w){if(!w.pending){if(w.entry){w===this[C]&&!w.piped&&this[F](w);return}if(w.stat||(this.statCache.has(w.absolute)?this[E](w,this.statCache.get(w.absolute)):this[f](w)),!!w.stat&&!w.ignore&&!(!this.noDirRecurse&&w.stat.isDirectory()&&!w.readdir&&(this.readdirCache.has(w.absolute)?this[D](w,this.readdirCache.get(w.absolute)):this[d](w),!w.readdir))){if(w.entry=this[R](w),!w.entry){w.ignore=!0;return}w===this[C]&&!w.piped&&this[F](w)}}}[B](w){return{onwarn:(c,g,L)=>this.warn(c,g,L),noPax:this.noPax,cwd:this.cwd,absolute:w.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime,prefix:this.prefix}}[R](w){this[S]+=1;try{return new this[x](w.path,this[B](w)).on("end",()=>this[v](w)).on("error",c=>this.emit("error",c))}catch(c){this.emit("error",c)}}[P](){this[C]&&this[C].entry&&this[C].entry.resume()}[F](w){w.piped=!0,w.readdir&&w.readdir.forEach(L=>{const H=w.path,J=H==="./"?"":H.replace(/\/*$/,"/");this[n](J+L)});const c=w.entry,g=this.zip;g?c.on("data",L=>{g.write(L)||c.pause()}):c.on("data",L=>{super.write(L)||c.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}});class W extends V{constructor(w){super(w),this[x]=a}pause(){}resume(){}[f](w){const c=this.follow?"statSync":"lstatSync";this[E](w,U[c](w.absolute))}[d](w,c){this[D](w,U.readdirSync(w.absolute))}[F](w){const c=w.entry,g=this.zip;w.readdir&&w.readdir.forEach(L=>{const H=w.path,J=H==="./"?"":H.replace(/\/*$/,"/");this[n](J+L)}),g?c.on("data",L=>{g.write(L)}):c.on("data",L=>{super[M](L)})}}return V.Sync=W,ti=V,ti}var Re={},Gs;function ke(){if(Gs)return Re;Gs=1;const u=ys(),t=xe.EventEmitter,s=ge;let r=s.writev;if(!r){const w=process.binding("fs"),c=w.FSReqWrap||w.FSReqCallback;r=(g,L,H,J)=>{const $=(z,O)=>J(z,O,L),q=new c;q.oncomplete=$,w.writeBuffers(g,L,H,q)}}const i=Symbol("_autoClose"),a=Symbol("_close"),e=Symbol("_ended"),o=Symbol("_fd"),h=Symbol("_finished"),E=Symbol("_flags"),y=Symbol("_flush"),m=Symbol("_handleChunk"),C=Symbol("_makeBuf"),_=Symbol("_mode"),b=Symbol("_needDrain"),A=Symbol("_onerror"),S=Symbol("_onopen"),v=Symbol("_onread"),n=Symbol("_onwrite"),l=Symbol("_open"),f=Symbol("_path"),d=Symbol("_pos"),D=Symbol("_queue"),F=Symbol("_read"),R=Symbol("_readSize"),B=Symbol("_reading"),x=Symbol("_remain"),M=Symbol("_size"),P=Symbol("_write"),U=Symbol("_writing"),G=Symbol("_defaultFlag"),Y=Symbol("_errored");class N extends u{constructor(c,g){if(g=g||{},super(g),this.readable=!0,this.writable=!1,typeof c!="string")throw new TypeError("path must be a string");this[Y]=!1,this[o]=typeof g.fd=="number"?g.fd:null,this[f]=c,this[R]=g.readSize||16*1024*1024,this[B]=!1,this[M]=typeof g.size=="number"?g.size:1/0,this[x]=this[M],this[i]=typeof g.autoClose=="boolean"?g.autoClose:!0,typeof this[o]=="number"?this[F]():this[l]()}get fd(){return this[o]}get path(){return this[f]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[l](){s.open(this[f],"r",(c,g)=>this[S](c,g))}[S](c,g){c?this[A](c):(this[o]=g,this.emit("open",g),this[F]())}[C](){return Buffer.allocUnsafe(Math.min(this[R],this[x]))}[F](){if(!this[B]){this[B]=!0;const c=this[C]();if(c.length===0)return process.nextTick(()=>this[v](null,0,c));s.read(this[o],c,0,c.length,null,(g,L,H)=>this[v](g,L,H))}}[v](c,g,L){this[B]=!1,c?this[A](c):this[m](g,L)&&this[F]()}[a](){if(this[i]&&typeof this[o]=="number"){const c=this[o];this[o]=null,s.close(c,g=>g?this.emit("error",g):this.emit("close"))}}[A](c){this[B]=!0,this[a](),this.emit("error",c)}[m](c,g){let L=!1;return this[x]-=c,c>0&&(L=super.write(c<g.length?g.slice(0,c):g)),(c===0||this[x]<=0)&&(L=!1,this[a](),super.end()),L}emit(c,g){switch(c){case"prefinish":case"finish":break;case"drain":typeof this[o]=="number"&&this[F]();break;case"error":return this[Y]?void 0:(this[Y]=!0,super.emit(c,g));default:return super.emit(c,g)}}}class V extends N{[l](){let c=!0;try{this[S](null,s.openSync(this[f],"r")),c=!1}finally{c&&this[a]()}}[F](){let c=!0;try{if(!this[B]){this[B]=!0;do{const g=this[C](),L=g.length===0?0:s.readSync(this[o],g,0,g.length,null);if(!this[m](L,g))break}while(!0);this[B]=!1}c=!1}finally{c&&this[a]()}}[a](){if(this[i]&&typeof this[o]=="number"){const c=this[o];this[o]=null,s.closeSync(c),this.emit("close")}}}class W extends t{constructor(c,g){g=g||{},super(g),this.readable=!1,this.writable=!0,this[Y]=!1,this[U]=!1,this[e]=!1,this[b]=!1,this[D]=[],this[f]=c,this[o]=typeof g.fd=="number"?g.fd:null,this[_]=g.mode===void 0?438:g.mode,this[d]=typeof g.start=="number"?g.start:null,this[i]=typeof g.autoClose=="boolean"?g.autoClose:!0;const L=this[d]!==null?"r+":"w";this[G]=g.flags===void 0,this[E]=this[G]?L:g.flags,this[o]===null&&this[l]()}emit(c,g){if(c==="error"){if(this[Y])return;this[Y]=!0}return super.emit(c,g)}get fd(){return this[o]}get path(){return this[f]}[A](c){this[a](),this[U]=!0,this.emit("error",c)}[l](){s.open(this[f],this[E],this[_],(c,g)=>this[S](c,g))}[S](c,g){this[G]&&this[E]==="r+"&&c&&c.code==="ENOENT"?(this[E]="w",this[l]()):c?this[A](c):(this[o]=g,this.emit("open",g),this[y]())}end(c,g){return c&&this.write(c,g),this[e]=!0,!this[U]&&!this[D].length&&typeof this[o]=="number"&&this[n](null,0),this}write(c,g){return typeof c=="string"&&(c=Buffer.from(c,g)),this[e]?(this.emit("error",new Error("write() after end()")),!1):this[o]===null||this[U]||this[D].length?(this[D].push(c),this[b]=!0,!1):(this[U]=!0,this[P](c),!0)}[P](c){s.write(this[o],c,0,c.length,this[d],(g,L)=>this[n](g,L))}[n](c,g){c?this[A](c):(this[d]!==null&&(this[d]+=g),this[D].length?this[y]():(this[U]=!1,this[e]&&!this[h]?(this[h]=!0,this[a](),this.emit("finish")):this[b]&&(this[b]=!1,this.emit("drain"))))}[y](){if(this[D].length===0)this[e]&&this[n](null,0);else if(this[D].length===1)this[P](this[D].pop());else{const c=this[D];this[D]=[],r(this[o],c,this[d],(g,L)=>this[n](g,L))}}[a](){if(this[i]&&typeof this[o]=="number"){const c=this[o];this[o]=null,s.close(c,g=>g?this.emit("error",g):this.emit("close"))}}}class ee extends W{[l](){let c;if(this[G]&&this[E]==="r+")try{c=s.openSync(this[f],this[E],this[_])}catch(g){if(g.code==="ENOENT")return this[E]="w",this[l]();throw g}else c=s.openSync(this[f],this[E],this[_]);this[S](null,c)}[a](){if(this[i]&&typeof this[o]=="number"){const c=this[o];this[o]=null,s.closeSync(c),this.emit("close")}}[P](c){let g=!0;try{this[n](null,s.writeSync(this[o],c,0,c.length,this[d])),g=!1}finally{if(g)try{this[a]()}catch{}}}}return Re.ReadStream=N,Re.ReadStreamSync=V,Re.WriteStream=W,Re.WriteStreamSync=ee,Re}var si,qs;function ri(){if(qs)return si;qs=1;const u=Kt(),t=Me(),s=xe,r=Us(),i=1024*1024,a=Ht(),e=qt(),o=_s(),{nextTick:h}=xi,E=Buffer.from([31,139]),y=Symbol("state"),m=Symbol("writeEntry"),C=Symbol("readEntry"),_=Symbol("nextEntry"),b=Symbol("processEntry"),A=Symbol("extendedHeader"),S=Symbol("globalExtendedHeader"),v=Symbol("meta"),n=Symbol("emitMeta"),l=Symbol("buffer"),f=Symbol("queue"),d=Symbol("ended"),D=Symbol("emittedEnd"),F=Symbol("emit"),R=Symbol("unzip"),B=Symbol("consumeChunk"),x=Symbol("consumeChunkSub"),M=Symbol("consumeBody"),P=Symbol("consumeMeta"),U=Symbol("consumeHeader"),G=Symbol("consuming"),Y=Symbol("bufferConcat"),N=Symbol("maybeEnd"),V=Symbol("writing"),W=Symbol("aborted"),ee=Symbol("onDone"),w=Symbol("sawValidEntry"),c=Symbol("sawNullBlock"),g=Symbol("sawEOF"),L=Symbol("closeStream"),H=J=>!0;return si=u(class extends s{constructor($){$=$||{},super($),this.file=$.file||"",this[w]=null,this.on(ee,z=>{(this[y]==="begin"||this[w]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),$.ondone?this.on(ee,$.ondone):this.on(ee,z=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!$.strict,this.maxMetaEntrySize=$.maxMetaEntrySize||i,this.filter=typeof $.filter=="function"?$.filter:H;const q=$.file&&($.file.endsWith(".tar.br")||$.file.endsWith(".tbr"));this.brotli=!$.gzip&&$.brotli!==void 0?$.brotli:q?void 0:!1,this.writable=!0,this.readable=!1,this[f]=new r,this[l]=null,this[C]=null,this[m]=null,this[y]="begin",this[v]="",this[A]=null,this[S]=null,this[d]=!1,this[R]=null,this[W]=!1,this[c]=!1,this[g]=!1,this.on("end",()=>this[L]()),typeof $.onwarn=="function"&&this.on("warn",$.onwarn),typeof $.onentry=="function"&&this.on("entry",$.onentry)}[U]($,q){this[w]===null&&(this[w]=!1);let z;try{z=new t($,q,this[A],this[S])}catch(O){return this.warn("TAR_ENTRY_INVALID",O)}if(z.nullBlock)this[c]?(this[g]=!0,this[y]==="begin"&&(this[y]="header"),this[F]("eof")):(this[c]=!0,this[F]("nullBlock"));else if(this[c]=!1,!z.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:z});else if(!z.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:z});else{const O=z.type;if(/^(Symbolic)?Link$/.test(O)&&!z.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:z});else if(!/^(Symbolic)?Link$/.test(O)&&z.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:z});else{const T=this[m]=new a(z,this[A],this[S]);if(!this[w])if(T.remain){const K=()=>{T.invalid||(this[w]=!0)};T.on("end",K)}else this[w]=!0;T.meta?T.size>this.maxMetaEntrySize?(T.ignore=!0,this[F]("ignoredEntry",T),this[y]="ignore",T.resume()):T.size>0&&(this[v]="",T.on("data",K=>this[v]+=K),this[y]="meta"):(this[A]=null,T.ignore=T.ignore||!this.filter(T.path,T),T.ignore?(this[F]("ignoredEntry",T),this[y]=T.remain?"ignore":"header",T.resume()):(T.remain?this[y]="body":(this[y]="header",T.end()),this[C]?this[f].push(T):(this[f].push(T),this[_]())))}}}[L](){h(()=>this.emit("close"))}[b]($){let q=!0;return $?Array.isArray($)?this.emit.apply(this,$):(this[C]=$,this.emit("entry",$),$.emittedEnd||($.on("end",z=>this[_]()),q=!1)):(this[C]=null,q=!1),q}[_](){do;while(this[b](this[f].shift()));if(!this[f].length){const $=this[C];!$||$.flowing||$.size===$.remain?this[V]||this.emit("drain"):$.once("drain",z=>this.emit("drain"))}}[M]($,q){const z=this[m],O=z.blockRemain,T=O>=$.length&&q===0?$:$.slice(q,q+O);return z.write(T),z.blockRemain||(this[y]="header",this[m]=null,z.end()),T.length}[P]($,q){const z=this[m],O=this[M]($,q);return this[m]||this[n](z),O}[F]($,q,z){!this[f].length&&!this[C]?this.emit($,q,z):this[f].push([$,q,z])}[n]($){switch(this[F]("meta",this[v]),$.type){case"ExtendedHeader":case"OldExtendedHeader":this[A]=e.parse(this[v],this[A],!1);break;case"GlobalExtendedHeader":this[S]=e.parse(this[v],this[S],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":this[A]=this[A]||Object.create(null),this[A].path=this[v].replace(/\0.*/,"");break;case"NextFileHasLongLinkpath":this[A]=this[A]||Object.create(null),this[A].linkpath=this[v].replace(/\0.*/,"");break;default:throw new Error("unknown meta: "+$.type)}}abort($){this[W]=!0,this.emit("abort",$),this.warn("TAR_ABORT",$,{recoverable:!1})}write($){if(this[W])return;if((this[R]===null||this.brotli===void 0&&this[R]===!1)&&$){if(this[l]&&($=Buffer.concat([this[l],$]),this[l]=null),$.length<E.length)return this[l]=$,!0;for(let T=0;this[R]===null&&T<E.length;T++)$[T]!==E[T]&&(this[R]=!1);const O=this.brotli===void 0;if(this[R]===!1&&O)if($.length<512)if(this[d])this.brotli=!0;else return this[l]=$,!0;else try{new t($.slice(0,512)),this.brotli=!1}catch{this.brotli=!0}if(this[R]===null||this[R]===!1&&this.brotli){const T=this[d];this[d]=!1,this[R]=this[R]===null?new o.Unzip:new o.BrotliDecompress,this[R].on("data",oe=>this[B](oe)),this[R].on("error",oe=>this.abort(oe)),this[R].on("end",oe=>{this[d]=!0,this[B]()}),this[V]=!0;const K=this[R][T?"end":"write"]($);return this[V]=!1,K}}this[V]=!0,this[R]?this[R].write($):this[B]($),this[V]=!1;const z=this[f].length?!1:this[C]?this[C].flowing:!0;return!z&&!this[f].length&&this[C].once("drain",O=>this.emit("drain")),z}[Y]($){$&&!this[W]&&(this[l]=this[l]?Buffer.concat([this[l],$]):$)}[N](){if(this[d]&&!this[D]&&!this[W]&&!this[G]){this[D]=!0;const $=this[m];if($&&$.blockRemain){const q=this[l]?this[l].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${$.blockRemain} more bytes, only ${q} available)`,{entry:$}),this[l]&&$.write(this[l]),$.end()}this[F](ee)}}[B]($){if(this[G])this[Y]($);else if(!$&&!this[l])this[N]();else{if(this[G]=!0,this[l]){this[Y]($);const q=this[l];this[l]=null,this[x](q)}else this[x]($);for(;this[l]&&this[l].length>=512&&!this[W]&&!this[g];){const q=this[l];this[l]=null,this[x](q)}this[G]=!1}(!this[l]||this[d])&&this[N]()}[x]($){let q=0;const z=$.length;for(;q+512<=z&&!this[W]&&!this[g];)switch(this[y]){case"begin":case"header":this[U]($,q),q+=512;break;case"ignore":case"body":q+=this[M]($,q);break;case"meta":q+=this[P]($,q);break;default:throw new Error("invalid state: "+this[y])}q<z&&(this[l]?this[l]=Buffer.concat([$.slice(q),this[l]]):this[l]=$.slice(q))}end($){this[W]||(this[R]?this[R].end($):(this[d]=!0,this.brotli===void 0&&($=$||Buffer.alloc(0)),this.write($)))}}),si}var ni,Vs;function ui(){if(Vs)return ni;Vs=1;const u=Ie(),t=ri(),s=ge,r=ke(),i=De,a=Pe();ni=(m,C,_)=>{typeof m=="function"?(_=m,C=null,m={}):Array.isArray(m)&&(C=m,m={}),typeof C=="function"&&(_=C,C=null),C?C=Array.from(C):C=[];const b=u(m);if(b.sync&&typeof _=="function")throw new TypeError("callback not supported for sync tar functions");if(!b.file&&typeof _=="function")throw new TypeError("callback only supported with file option");return C.length&&o(b,C),b.noResume||e(b),b.file&&b.sync?h(b):b.file?E(b,_):y(b)};const e=m=>{const C=m.onentry;m.onentry=C?_=>{C(_),_.resume()}:_=>_.resume()},o=(m,C)=>{const _=new Map(C.map(S=>[a(S),!0])),b=m.filter,A=(S,v)=>{const n=v||i.parse(S).root||".",l=S===n?!1:_.has(S)?_.get(S):A(i.dirname(S),n);return _.set(S,l),l};m.filter=b?(S,v)=>b(S,v)&&A(a(S)):S=>A(a(S))},h=m=>{const C=y(m),_=m.file;let b=!0,A;try{const S=s.statSync(_),v=m.maxReadSize||16*1024*1024;if(S.size<v)C.end(s.readFileSync(_));else{let n=0;const l=Buffer.allocUnsafe(v);for(A=s.openSync(_,"r");n<S.size;){const f=s.readSync(A,l,0,v,n);n+=f,C.write(l.slice(0,f))}C.end()}b=!1}finally{if(b&&A)try{s.closeSync(A)}catch{}}},E=(m,C)=>{const _=new t(m),b=m.maxReadSize||16*1024*1024,A=m.file,S=new Promise((v,n)=>{_.on("error",n),_.on("end",v),s.stat(A,(l,f)=>{if(l)n(l);else{const d=new r.ReadStream(A,{readSize:b,size:f.size});d.on("error",n),d.pipe(_)}})});return C?S.then(C,C):S},y=m=>new t(m);return ni}var oi,Ws;function jn(){if(Ws)return oi;Ws=1;const u=Ie(),t=ii(),s=ke(),r=ui(),i=De;oi=(m,C,_)=>{if(typeof C=="function"&&(_=C),Array.isArray(m)&&(C=m,m={}),!C||!Array.isArray(C)||!C.length)throw new TypeError("no files or directories specified");C=Array.from(C);const b=u(m);if(b.sync&&typeof _=="function")throw new TypeError("callback not supported for sync tar functions");if(!b.file&&typeof _=="function")throw new TypeError("callback only supported with file option");return b.file&&b.sync?a(b,C):b.file?e(b,C,_):b.sync?E(b,C):y(b,C)};const a=(m,C)=>{const _=new t.Sync(m),b=new s.WriteStreamSync(m.file,{mode:m.mode||438});_.pipe(b),o(_,C)},e=(m,C,_)=>{const b=new t(m),A=new s.WriteStream(m.file,{mode:m.mode||438});b.pipe(A);const S=new Promise((v,n)=>{A.on("error",n),A.on("close",v),b.on("error",n)});return h(b,C),_?S.then(_,_):S},o=(m,C)=>{C.forEach(_=>{_.charAt(0)==="@"?r({file:i.resolve(m.cwd,_.slice(1)),sync:!0,noResume:!0,onentry:b=>m.add(b)}):m.add(_)}),m.end()},h=(m,C)=>{for(;C.length;){const _=C.shift();if(_.charAt(0)==="@")return r({file:i.resolve(m.cwd,_.slice(1)),noResume:!0,onentry:b=>m.add(b)}).then(b=>h(m,C));m.add(_)}m.end()},E=(m,C)=>{const _=new t.Sync(m);return o(_,C),_},y=(m,C)=>{const _=new t(m);return h(_,C),_};return oi}var ai,Ks;function Ys(){if(Ks)return ai;Ks=1;const u=Ie(),t=ii(),s=ge,r=ke(),i=ui(),a=De,e=Me();ai=(C,_,b)=>{const A=u(C);if(!A.file)throw new TypeError("file is required");if(A.gzip||A.brotli||A.file.endsWith(".br")||A.file.endsWith(".tbr"))throw new TypeError("cannot append to compressed archives");if(!_||!Array.isArray(_)||!_.length)throw new TypeError("no files or directories specified");return _=Array.from(_),A.sync?o(A,_):E(A,_,b)};const o=(C,_)=>{const b=new t.Sync(C);let A=!0,S,v;try{try{S=s.openSync(C.file,"r+")}catch(f){if(f.code==="ENOENT")S=s.openSync(C.file,"w+");else throw f}const n=s.fstatSync(S),l=Buffer.alloc(512);e:for(v=0;v<n.size;v+=512){for(let D=0,F=0;D<512;D+=F){if(F=s.readSync(S,l,D,l.length-D,v+D),v===0&&l[0]===31&&l[1]===139)throw new Error("cannot append to compressed archives");if(!F)break e}const f=new e(l);if(!f.cksumValid)break;const d=512*Math.ceil(f.size/512);if(v+d+512>n.size)break;v+=d,C.mtimeCache&&C.mtimeCache.set(f.path,f.mtime)}A=!1,h(C,b,v,S,_)}finally{if(A)try{s.closeSync(S)}catch{}}},h=(C,_,b,A,S)=>{const v=new r.WriteStreamSync(C.file,{fd:A,start:b});_.pipe(v),y(_,S)},E=(C,_,b)=>{_=Array.from(_);const A=new t(C),S=(n,l,f)=>{const d=(x,M)=>{x?s.close(n,P=>f(x)):f(null,M)};let D=0;if(l===0)return d(null,0);let F=0;const R=Buffer.alloc(512),B=(x,M)=>{if(x)return d(x);if(F+=M,F<512&&M)return s.read(n,R,F,R.length-F,D+F,B);if(D===0&&R[0]===31&&R[1]===139)return d(new Error("cannot append to compressed archives"));if(F<512)return d(null,D);const P=new e(R);if(!P.cksumValid)return d(null,D);const U=512*Math.ceil(P.size/512);if(D+U+512>l||(D+=U+512,D>=l))return d(null,D);C.mtimeCache&&C.mtimeCache.set(P.path,P.mtime),F=0,s.read(n,R,0,512,D,B)};s.read(n,R,0,512,D,B)},v=new Promise((n,l)=>{A.on("error",l);let f="r+";const d=(D,F)=>{if(D&&D.code==="ENOENT"&&f==="r+")return f="w+",s.open(C.file,f,d);if(D)return l(D);s.fstat(F,(R,B)=>{if(R)return s.close(F,()=>l(R));S(F,B.size,(x,M)=>{if(x)return l(x);const P=new r.WriteStream(C.file,{fd:F,start:M});A.pipe(P),P.on("error",l),P.on("close",n),m(A,_)})})};s.open(C.file,f,d)});return b?v.then(b,b):v},y=(C,_)=>{_.forEach(b=>{b.charAt(0)==="@"?i({file:a.resolve(C.cwd,b.slice(1)),sync:!0,noResume:!0,onentry:A=>C.add(A)}):C.add(b)}),C.end()},m=(C,_)=>{for(;_.length;){const b=_.shift();if(b.charAt(0)==="@")return i({file:a.resolve(C.cwd,b.slice(1)),noResume:!0,onentry:A=>C.add(A)}).then(A=>m(C,_));C.add(b)}C.end()};return ai}var hi,Zs;function Un(){if(Zs)return hi;Zs=1;const u=Ie(),t=Ys();hi=(r,i,a)=>{const e=u(r);if(!e.file)throw new TypeError("file is required");if(e.gzip||e.brotli||e.file.endsWith(".br")||e.file.endsWith(".tbr"))throw new TypeError("cannot append to compressed archives");if(!i||!Array.isArray(i)||!i.length)throw new TypeError("no files or directories specified");return i=Array.from(i),s(e),t(e,i,a)};const s=r=>{const i=r.filter;r.mtimeCache||(r.mtimeCache=new Map),r.filter=i?(a,e)=>i(a,e)&&!(r.mtimeCache.get(a)>e.mtime):(a,e)=>!(r.mtimeCache.get(a)>e.mtime)};return hi}var st={exports:{}},li,Xs;function zn(){if(Xs)return li;Xs=1;const{promisify:u}=Rr,t=ge;return li=r=>{if(!r)r={mode:511,fs:t};else if(typeof r=="object")r={mode:511,fs:t,...r};else if(typeof r=="number")r={mode:r,fs:t};else if(typeof r=="string")r={mode:parseInt(r,8),fs:t};else throw new TypeError("invalid options argument");return r.mkdir=r.mkdir||r.fs.mkdir||t.mkdir,r.mkdirAsync=u(r.mkdir),r.stat=r.stat||r.fs.stat||t.stat,r.statAsync=u(r.stat),r.statSync=r.statSync||r.fs.statSync||t.statSync,r.mkdirSync=r.mkdirSync||r.fs.mkdirSync||t.mkdirSync,r},li}var ci,Js;function Gn(){if(Js)return ci;Js=1;const u=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:t,parse:s}=De;return ci=i=>{if(/\0/.test(i))throw Object.assign(new TypeError("path must be a string without null bytes"),{path:i,code:"ERR_INVALID_ARG_VALUE"});if(i=t(i),u==="win32"){const a=/[*|"<>?:]/,{root:e}=s(i);if(a.test(i.substr(e.length)))throw Object.assign(new Error("Illegal characters in path."),{path:i,code:"EINVAL"})}return i},ci}var Di,Qs;function qn(){if(Qs)return Di;Qs=1;const{dirname:u}=De,t=(r,i,a=void 0)=>a===i?Promise.resolve():r.statAsync(i).then(e=>e.isDirectory()?a:void 0,e=>e.code==="ENOENT"?t(r,u(i),i):void 0),s=(r,i,a=void 0)=>{if(a!==i)try{return r.statSync(i).isDirectory()?a:void 0}catch(e){return e.code==="ENOENT"?s(r,u(i),i):void 0}};return Di={findMade:t,findMadeSync:s},Di}var fi,er;function tr(){if(er)return fi;er=1;const{dirname:u}=De,t=(r,i,a)=>{i.recursive=!1;const e=u(r);return e===r?i.mkdirAsync(r,i).catch(o=>{if(o.code!=="EISDIR")throw o}):i.mkdirAsync(r,i).then(()=>a||r,o=>{if(o.code==="ENOENT")return t(e,i).then(h=>t(r,i,h));if(o.code!=="EEXIST"&&o.code!=="EROFS")throw o;return i.statAsync(r).then(h=>{if(h.isDirectory())return a;throw o},()=>{throw o})})},s=(r,i,a)=>{const e=u(r);if(i.recursive=!1,e===r)try{return i.mkdirSync(r,i)}catch(o){if(o.code!=="EISDIR")throw o;return}try{return i.mkdirSync(r,i),a||r}catch(o){if(o.code==="ENOENT")return s(r,i,s(e,i,a));if(o.code!=="EEXIST"&&o.code!=="EROFS")throw o;try{if(!i.statSync(r).isDirectory())throw o}catch{throw o}}};return fi={mkdirpManual:t,mkdirpManualSync:s},fi}var di,ir;function Vn(){if(ir)return di;ir=1;const{dirname:u}=De,{findMade:t,findMadeSync:s}=qn(),{mkdirpManual:r,mkdirpManualSync:i}=tr();return di={mkdirpNative:(o,h)=>(h.recursive=!0,u(o)===o?h.mkdirAsync(o,h):t(h,o).then(y=>h.mkdirAsync(o,h).then(()=>y).catch(m=>{if(m.code==="ENOENT")return r(o,h);throw m}))),mkdirpNativeSync:(o,h)=>{if(h.recursive=!0,u(o)===o)return h.mkdirSync(o,h);const y=s(h,o);try{return h.mkdirSync(o,h),y}catch(m){if(m.code==="ENOENT")return i(o,h);throw m}}},di}var mi,sr;function Wn(){if(sr)return mi;sr=1;const u=ge,s=(process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version).replace(/^v/,"").split("."),r=+s[0]>10||+s[0]==10&&+s[1]>=12;return mi={useNative:r?e=>e.mkdir===u.mkdir:()=>!1,useNativeSync:r?e=>e.mkdirSync===u.mkdirSync:()=>!1},mi}var pi,rr;function Kn(){if(rr)return pi;rr=1;const u=zn(),t=Gn(),{mkdirpNative:s,mkdirpNativeSync:r}=Vn(),{mkdirpManual:i,mkdirpManualSync:a}=tr(),{useNative:e,useNativeSync:o}=Wn(),h=(y,m)=>(y=t(y),m=u(m),e(m)?s(y,m):i(y,m)),E=(y,m)=>(y=t(y),m=u(m),o(m)?r(y,m):a(y,m));return h.sync=E,h.native=(y,m)=>s(t(y),u(m)),h.manual=(y,m)=>i(t(y),u(m)),h.nativeSync=(y,m)=>r(t(y),u(m)),h.manualSync=(y,m)=>a(t(y),u(m)),pi=h,pi}var Ei,nr;function Yn(){if(nr)return Ei;nr=1;const u=ge,t=De,s=u.lchown?"lchown":"chown",r=u.lchownSync?"lchownSync":"chownSync",i=u.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/),a=(v,n,l)=>{try{return u[r](v,n,l)}catch(f){if(f.code!=="ENOENT")throw f}},e=(v,n,l)=>{try{return u.chownSync(v,n,l)}catch(f){if(f.code!=="ENOENT")throw f}},o=i?(v,n,l,f)=>d=>{!d||d.code!=="EISDIR"?f(d):u.chown(v,n,l,f)}:(v,n,l,f)=>f,h=i?(v,n,l)=>{try{return a(v,n,l)}catch(f){if(f.code!=="EISDIR")throw f;e(v,n,l)}}:(v,n,l)=>a(v,n,l),E=process.version;let y=(v,n,l)=>u.readdir(v,n,l),m=(v,n)=>u.readdirSync(v,n);/^v4\./.test(E)&&(y=(v,n,l)=>u.readdir(v,l));const C=(v,n,l,f)=>{u[s](v,n,l,o(v,n,l,d=>{f(d&&d.code!=="ENOENT"?d:null)}))},_=(v,n,l,f,d)=>{if(typeof n=="string")return u.lstat(t.resolve(v,n),(D,F)=>{if(D)return d(D.code!=="ENOENT"?D:null);F.name=n,_(v,F,l,f,d)});if(n.isDirectory())b(t.resolve(v,n.name),l,f,D=>{if(D)return d(D);const F=t.resolve(v,n.name);C(F,l,f,d)});else{const D=t.resolve(v,n.name);C(D,l,f,d)}},b=(v,n,l,f)=>{y(v,{withFileTypes:!0},(d,D)=>{if(d){if(d.code==="ENOENT")return f();if(d.code!=="ENOTDIR"&&d.code!=="ENOTSUP")return f(d)}if(d||!D.length)return C(v,n,l,f);let F=D.length,R=null;const B=x=>{if(!R){if(x)return f(R=x);if(--F===0)return C(v,n,l,f)}};D.forEach(x=>_(v,x,n,l,B))})},A=(v,n,l,f)=>{if(typeof n=="string")try{const d=u.lstatSync(t.resolve(v,n));d.name=n,n=d}catch(d){if(d.code==="ENOENT")return;throw d}n.isDirectory()&&S(t.resolve(v,n.name),l,f),h(t.resolve(v,n.name),l,f)},S=(v,n,l)=>{let f;try{f=m(v,{withFileTypes:!0})}catch(d){if(d.code==="ENOENT")return;if(d.code==="ENOTDIR"||d.code==="ENOTSUP")return h(v,n,l);throw d}return f&&f.length&&f.forEach(d=>A(v,d,n,l)),h(v,n,l)};return Ei=b,b.sync=S,Ei}var ur;function Zn(){if(ur)return st.exports;ur=1;const u=Kn(),t=ge,s=De,r=Yn(),i=Le();class a extends Error{constructor(b,A){super("Cannot extract through symbolic link"),this.path=A,this.symlink=b}get name(){return"SylinkError"}}class e extends Error{constructor(b,A){super(A+": Cannot cd into '"+b+"'"),this.path=b,this.code=A}get name(){return"CwdError"}}const o=(_,b)=>_.get(i(b)),h=(_,b,A)=>_.set(i(b),A),E=(_,b)=>{t.stat(_,(A,S)=>{(A||!S.isDirectory())&&(A=new e(_,A&&A.code||"ENOTDIR")),b(A)})};st.exports=(_,b,A)=>{_=i(_);const S=b.umask,v=b.mode|448,n=(v&S)!==0,l=b.uid,f=b.gid,d=typeof l=="number"&&typeof f=="number"&&(l!==b.processUid||f!==b.processGid),D=b.preserve,F=b.unlink,R=b.cache,B=i(b.cwd),x=(U,G)=>{U?A(U):(h(R,_,!0),G&&d?r(G,l,f,Y=>x(Y)):n?t.chmod(_,v,A):A())};if(R&&o(R,_)===!0)return x();if(_===B)return E(_,x);if(D)return u(_,{mode:v}).then(U=>x(null,U),x);const P=i(s.relative(B,_)).split("/");y(B,P,v,R,F,B,null,x)};const y=(_,b,A,S,v,n,l,f)=>{if(!b.length)return f(null,l);const d=b.shift(),D=i(s.resolve(_+"/"+d));if(o(S,D))return y(D,b,A,S,v,n,l,f);t.mkdir(D,A,m(D,b,A,S,v,n,l,f))},m=(_,b,A,S,v,n,l,f)=>d=>{d?t.lstat(_,(D,F)=>{if(D)D.path=D.path&&i(D.path),f(D);else if(F.isDirectory())y(_,b,A,S,v,n,l,f);else if(v)t.unlink(_,R=>{if(R)return f(R);t.mkdir(_,A,m(_,b,A,S,v,n,l,f))});else{if(F.isSymbolicLink())return f(new a(_,_+"/"+b.join("/")));f(d)}}):(l=l||_,y(_,b,A,S,v,n,l,f))},C=_=>{let b=!1,A="ENOTDIR";try{b=t.statSync(_).isDirectory()}catch(S){A=S.code}finally{if(!b)throw new e(_,A)}};return st.exports.sync=(_,b)=>{_=i(_);const A=b.umask,S=b.mode|448,v=(S&A)!==0,n=b.uid,l=b.gid,f=typeof n=="number"&&typeof l=="number"&&(n!==b.processUid||l!==b.processGid),d=b.preserve,D=b.unlink,F=b.cache,R=i(b.cwd),B=U=>{h(F,_,!0),U&&f&&r.sync(U,n,l),v&&t.chmodSync(_,S)};if(F&&o(F,_)===!0)return B();if(_===R)return C(R),B();if(d)return B(u.sync(_,S));const M=i(s.relative(R,_)).split("/");let P=null;for(let U=M.shift(),G=R;U&&(G+="/"+U);U=M.shift())if(G=i(s.resolve(G)),!o(F,G))try{t.mkdirSync(G,S),P=P||G,h(F,G,!0)}catch{const N=t.lstatSync(G);if(N.isDirectory()){h(F,G,!0);continue}else if(D){t.unlinkSync(G),t.mkdirSync(G,S),P=P||G,h(F,G,!0);continue}else if(N.isSymbolicLink())return new a(G,G+"/"+M.join("/"))}return B(P)},st.exports}var gi,or;function ar(){if(or)return gi;or=1;const u=Object.create(null),{hasOwnProperty:t}=Object.prototype;return gi=s=>(t.call(u,s)||(u[s]=s.normalize("NFD")),u[s]),gi}var Ci,hr;function Xn(){if(hr)return Ci;hr=1;const u=lt,t=ar(),s=Pe(),{join:r}=De,a=(process.env.TESTING_TAR_FAKE_PLATFORM||process.platform)==="win32";return Ci=()=>{const e=new Map,o=new Map,h=A=>A.split("/").slice(0,-1).reduce((v,n)=>(v.length&&(n=r(v[v.length-1],n)),v.push(n||"/"),v),[]),E=new Set,y=A=>{const S=o.get(A);if(!S)throw new Error("function does not have any path reservations");return{paths:S.paths.map(v=>e.get(v)),dirs:[...S.dirs].map(v=>e.get(v))}},m=A=>{const{paths:S,dirs:v}=y(A);return S.every(n=>n[0]===A)&&v.every(n=>n[0]instanceof Set&&n[0].has(A))},C=A=>E.has(A)||!m(A)?!1:(E.add(A),A(()=>_(A)),!0),_=A=>{if(!E.has(A))return!1;const{paths:S,dirs:v}=o.get(A),n=new Set;return S.forEach(l=>{const f=e.get(l);u.equal(f[0],A),f.length===1?e.delete(l):(f.shift(),typeof f[0]=="function"?n.add(f[0]):f[0].forEach(d=>n.add(d)))}),v.forEach(l=>{const f=e.get(l);u(f[0]instanceof Set),f[0].size===1&&f.length===1?e.delete(l):f[0].size===1?(f.shift(),n.add(f[0])):f[0].delete(A)}),E.delete(A),n.forEach(l=>C(l)),!0};return{check:m,reserve:(A,S)=>{A=a?["win32 parallelization disabled"]:A.map(n=>s(r(t(n))).toLowerCase());const v=new Set(A.map(n=>h(n)).reduce((n,l)=>n.concat(l)));return o.set(S,{dirs:v,paths:A}),A.forEach(n=>{const l=e.get(n);l?l.push(S):e.set(n,[S])}),v.forEach(n=>{const l=e.get(n);l?l[l.length-1]instanceof Set?l[l.length-1].add(S):l.push(new Set([S])):e.set(n,[new Set([S])])}),C(S)}}},Ci}var Fi,lr;function Jn(){if(lr)return Fi;lr=1;const t=(process.env.__FAKE_PLATFORM__||process.platform)==="win32",s=ct.__FAKE_TESTING_FS__||ge,{O_CREAT:r,O_TRUNC:i,O_WRONLY:a,UV_FS_O_FILEMAP:e=0}=s.constants,o=t&&!!e,h=512*1024,E=e|i|r|a;return Fi=o?y=>y<h?E:"w":()=>"w",Fi}var yi,cr;function Dr(){if(cr)return yi;cr=1;const u=lt,t=ri(),s=ge,r=ke(),i=De,a=Zn(),e=Ns(),o=Xn(),h=Ls(),E=Le(),y=Pe(),m=ar(),C=Symbol("onEntry"),_=Symbol("checkFs"),b=Symbol("checkFs2"),A=Symbol("pruneCache"),S=Symbol("isReusable"),v=Symbol("makeFs"),n=Symbol("file"),l=Symbol("directory"),f=Symbol("link"),d=Symbol("symlink"),D=Symbol("hardlink"),F=Symbol("unsupported"),R=Symbol("checkPath"),B=Symbol("mkdir"),x=Symbol("onError"),M=Symbol("pending"),P=Symbol("pend"),U=Symbol("unpend"),G=Symbol("ended"),Y=Symbol("maybeClose"),N=Symbol("skip"),V=Symbol("doChown"),W=Symbol("uid"),ee=Symbol("gid"),w=Symbol("checkedCwd"),c=Br,g=Jn(),H=(process.env.TESTING_TAR_FAKE_PLATFORM||process.platform)==="win32",J=1024,$=(te,p)=>{if(!H)return s.unlink(te,p);const k=te+".DELETE."+c.randomBytes(16).toString("hex");s.rename(te,k,j=>{if(j)return p(j);s.unlink(k,p)})},q=te=>{if(!H)return s.unlinkSync(te);const p=te+".DELETE."+c.randomBytes(16).toString("hex");s.renameSync(te,p),s.unlinkSync(p)},z=(te,p,k)=>te===te>>>0?te:p===p>>>0?p:k,O=te=>y(E(m(te))).toLowerCase(),T=(te,p)=>{p=O(p);for(const k of te.keys()){const j=O(k);(j===p||j.indexOf(p+"/")===0)&&te.delete(k)}},K=te=>{for(const p of te.keys())te.delete(p)};class oe extends t{constructor(p){if(p||(p={}),p.ondone=k=>{this[G]=!0,this[Y]()},super(p),this[w]=!1,this.reservations=o(),this.transform=typeof p.transform=="function"?p.transform:null,this.writable=!0,this.readable=!1,this[M]=0,this[G]=!1,this.dirCache=p.dirCache||new Map,typeof p.uid=="number"||typeof p.gid=="number"){if(typeof p.uid!="number"||typeof p.gid!="number")throw new TypeError("cannot set owner without number uid and gid");if(p.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=p.uid,this.gid=p.gid,this.setOwner=!0}else this.uid=null,this.gid=null,this.setOwner=!1;p.preserveOwner===void 0&&typeof p.uid!="number"?this.preserveOwner=process.getuid&&process.getuid()===0:this.preserveOwner=!!p.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():null,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():null,this.maxDepth=typeof p.maxDepth=="number"?p.maxDepth:J,this.forceChown=p.forceChown===!0,this.win32=!!p.win32||H,this.newer=!!p.newer,this.keep=!!p.keep,this.noMtime=!!p.noMtime,this.preservePaths=!!p.preservePaths,this.unlink=!!p.unlink,this.cwd=E(i.resolve(p.cwd||process.cwd())),this.strip=+p.strip||0,this.processUmask=p.noChmod?0:process.umask(),this.umask=typeof p.umask=="number"?p.umask:this.processUmask,this.dmode=p.dmode||511&~this.umask,this.fmode=p.fmode||438&~this.umask,this.on("entry",k=>this[C](k))}warn(p,k,j={}){return(p==="TAR_BAD_ARCHIVE"||p==="TAR_ABORT")&&(j.recoverable=!1),super.warn(p,k,j)}[Y](){this[G]&&this[M]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[R](p){const k=E(p.path),j=k.split("/");if(this.strip){if(j.length<this.strip)return!1;if(p.type==="Link"){const Z=E(p.linkpath).split("/");if(Z.length>=this.strip)p.linkpath=Z.slice(this.strip).join("/");else return!1}j.splice(0,this.strip),p.path=j.join("/")}if(isFinite(this.maxDepth)&&j.length>this.maxDepth)return this.warn("TAR_ENTRY_ERROR","path excessively deep",{entry:p,path:k,depth:j.length,maxDepth:this.maxDepth}),!1;if(!this.preservePaths){if(j.includes("..")||H&&/^[a-z]:\.\.$/i.test(j[0]))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:p,path:k}),!1;const[Z,X]=h(k);Z&&(p.path=X,this.warn("TAR_ENTRY_INFO",`stripping ${Z} from absolute path`,{entry:p,path:k}))}if(i.isAbsolute(p.path)?p.absolute=E(i.resolve(p.path)):p.absolute=E(i.resolve(this.cwd,p.path)),!this.preservePaths&&p.absolute.indexOf(this.cwd+"/")!==0&&p.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:p,path:E(p.path),resolvedPath:p.absolute,cwd:this.cwd}),!1;if(p.absolute===this.cwd&&p.type!=="Directory"&&p.type!=="GNUDumpDir")return!1;if(this.win32){const{root:Z}=i.win32.parse(p.absolute);p.absolute=Z+e.encode(p.absolute.slice(Z.length));const{root:X}=i.win32.parse(p.path);p.path=X+e.encode(p.path.slice(X.length))}return!0}[C](p){if(!this[R](p))return p.resume();switch(u.equal(typeof p.absolute,"string"),p.type){case"Directory":case"GNUDumpDir":p.mode&&(p.mode=p.mode|448);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[_](p);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[F](p)}}[x](p,k){p.name==="CwdError"?this.emit("error",p):(this.warn("TAR_ENTRY_ERROR",p,{entry:k}),this[U](),k.resume())}[B](p,k,j){a(E(p),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:k,noChmod:this.noChmod},j)}[V](p){return this.forceChown||this.preserveOwner&&(typeof p.uid=="number"&&p.uid!==this.processUid||typeof p.gid=="number"&&p.gid!==this.processGid)||typeof this.uid=="number"&&this.uid!==this.processUid||typeof this.gid=="number"&&this.gid!==this.processGid}[W](p){return z(this.uid,p.uid,this.processUid)}[ee](p){return z(this.gid,p.gid,this.processGid)}[n](p,k){const j=p.mode&4095||this.fmode,Z=new r.WriteStream(p.absolute,{flags:g(p.size),mode:j,autoClose:!1});Z.on("error",se=>{Z.fd&&s.close(Z.fd,()=>{}),Z.write=()=>!0,this[x](se,p),k()});let X=1;const ue=se=>{if(se){Z.fd&&s.close(Z.fd,()=>{}),this[x](se,p),k();return}--X===0&&s.close(Z.fd,le=>{le?this[x](le,p):this[U](),k()})};Z.on("finish",se=>{const le=p.absolute,Fe=Z.fd;if(p.mtime&&!this.noMtime){X++;const ye=p.atime||new Date,Ae=p.mtime;s.futimes(Fe,ye,Ae,Be=>Be?s.utimes(le,ye,Ae,ut=>ue(ut&&Be)):ue())}if(this[V](p)){X++;const ye=this[W](p),Ae=this[ee](p);s.fchown(Fe,ye,Ae,Be=>Be?s.chown(le,ye,Ae,ut=>ue(ut&&Be)):ue())}ue()});const ie=this.transform&&this.transform(p)||p;ie!==p&&(ie.on("error",se=>{this[x](se,p),k()}),p.pipe(ie)),ie.pipe(Z)}[l](p,k){const j=p.mode&4095||this.dmode;this[B](p.absolute,j,Z=>{if(Z){this[x](Z,p),k();return}let X=1;const ue=ie=>{--X===0&&(k(),this[U](),p.resume())};p.mtime&&!this.noMtime&&(X++,s.utimes(p.absolute,p.atime||new Date,p.mtime,ue)),this[V](p)&&(X++,s.chown(p.absolute,this[W](p),this[ee](p),ue)),ue()})}[F](p){p.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${p.type}`,{entry:p}),p.resume()}[d](p,k){this[f](p,p.linkpath,"symlink",k)}[D](p,k){const j=E(i.resolve(this.cwd,p.linkpath));this[f](p,j,"link",k)}[P](){this[M]++}[U](){this[M]--,this[Y]()}[N](p){this[U](),p.resume()}[S](p,k){return p.type==="File"&&!this.unlink&&k.isFile()&&k.nlink<=1&&!H}[_](p){this[P]();const k=[p.path];p.linkpath&&k.push(p.linkpath),this.reservations.reserve(k,j=>this[b](p,j))}[A](p){p.type==="SymbolicLink"?K(this.dirCache):p.type!=="Directory"&&T(this.dirCache,p.absolute)}[b](p,k){this[A](p);const j=ie=>{this[A](p),k(ie)},Z=()=>{this[B](this.cwd,this.dmode,ie=>{if(ie){this[x](ie,p),j();return}this[w]=!0,X()})},X=()=>{if(p.absolute!==this.cwd){const ie=E(i.dirname(p.absolute));if(ie!==this.cwd)return this[B](ie,this.dmode,se=>{if(se){this[x](se,p),j();return}ue()})}ue()},ue=()=>{s.lstat(p.absolute,(ie,se)=>{if(se&&(this.keep||this.newer&&se.mtime>p.mtime)){this[N](p),j();return}if(ie||this[S](p,se))return this[v](null,p,j);if(se.isDirectory()){if(p.type==="Directory"){const le=!this.noChmod&&p.mode&&(se.mode&4095)!==p.mode,Fe=ye=>this[v](ye,p,j);return le?s.chmod(p.absolute,p.mode,Fe):Fe()}if(p.absolute!==this.cwd)return s.rmdir(p.absolute,le=>this[v](le,p,j))}if(p.absolute===this.cwd)return this[v](null,p,j);$(p.absolute,le=>this[v](le,p,j))})};this[w]?X():Z()}[v](p,k,j){if(p){this[x](p,k),j();return}switch(k.type){case"File":case"OldFile":case"ContiguousFile":return this[n](k,j);case"Link":return this[D](k,j);case"SymbolicLink":return this[d](k,j);case"Directory":case"GNUDumpDir":return this[l](k,j)}}[f](p,k,j,Z){s[j](k,p.absolute,X=>{X?this[x](X,p):(this[U](),p.resume()),Z()})}}const ce=te=>{try{return[null,te()]}catch(p){return[p,null]}};class Ge extends oe{[v](p,k){return super[v](p,k,()=>{})}[_](p){if(this[A](p),!this[w]){const X=this[B](this.cwd,this.dmode);if(X)return this[x](X,p);this[w]=!0}if(p.absolute!==this.cwd){const X=E(i.dirname(p.absolute));if(X!==this.cwd){const ue=this[B](X,this.dmode);if(ue)return this[x](ue,p)}}const[k,j]=ce(()=>s.lstatSync(p.absolute));if(j&&(this.keep||this.newer&&j.mtime>p.mtime))return this[N](p);if(k||this[S](p,j))return this[v](null,p);if(j.isDirectory()){if(p.type==="Directory"){const ue=!this.noChmod&&p.mode&&(j.mode&4095)!==p.mode,[ie]=ue?ce(()=>{s.chmodSync(p.absolute,p.mode)}):[];return this[v](ie,p)}const[X]=ce(()=>s.rmdirSync(p.absolute));this[v](X,p)}const[Z]=p.absolute===this.cwd?[]:ce(()=>q(p.absolute));this[v](Z,p)}[n](p,k){const j=p.mode&4095||this.fmode,Z=ie=>{let se;try{s.closeSync(X)}catch(le){se=le}(ie||se)&&this[x](ie||se,p),k()};let X;try{X=s.openSync(p.absolute,g(p.size),j)}catch(ie){return Z(ie)}const ue=this.transform&&this.transform(p)||p;ue!==p&&(ue.on("error",ie=>this[x](ie,p)),p.pipe(ue)),ue.on("data",ie=>{try{s.writeSync(X,ie,0,ie.length)}catch(se){Z(se)}}),ue.on("end",ie=>{let se=null;if(p.mtime&&!this.noMtime){const le=p.atime||new Date,Fe=p.mtime;try{s.futimesSync(X,le,Fe)}catch(ye){try{s.utimesSync(p.absolute,le,Fe)}catch{se=ye}}}if(this[V](p)){const le=this[W](p),Fe=this[ee](p);try{s.fchownSync(X,le,Fe)}catch(ye){try{s.chownSync(p.absolute,le,Fe)}catch{se=se||ye}}}Z(se)})}[l](p,k){const j=p.mode&4095||this.dmode,Z=this[B](p.absolute,j);if(Z){this[x](Z,p),k();return}if(p.mtime&&!this.noMtime)try{s.utimesSync(p.absolute,p.atime||new Date,p.mtime)}catch{}if(this[V](p))try{s.chownSync(p.absolute,this[W](p),this[ee](p))}catch{}k(),p.resume()}[B](p,k){try{return a.sync(E(p),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:k})}catch(j){return j}}[f](p,k,j,Z){try{s[j+"Sync"](k,p.absolute),Z(),p.resume()}catch(X){return this[x](X,p)}}}return oe.Sync=Ge,yi=oe,yi}var bi,fr;function Qn(){if(fr)return bi;fr=1;const u=Ie(),t=Dr(),s=ge,r=ke(),i=De,a=Pe();bi=(m,C,_)=>{typeof m=="function"?(_=m,C=null,m={}):Array.isArray(m)&&(C=m,m={}),typeof C=="function"&&(_=C,C=null),C?C=Array.from(C):C=[];const b=u(m);if(b.sync&&typeof _=="function")throw new TypeError("callback not supported for sync tar functions");if(!b.file&&typeof _=="function")throw new TypeError("callback only supported with file option");return C.length&&e(b,C),b.file&&b.sync?o(b):b.file?h(b,_):b.sync?E(b):y(b)};const e=(m,C)=>{const _=new Map(C.map(S=>[a(S),!0])),b=m.filter,A=(S,v)=>{const n=v||i.parse(S).root||".",l=S===n?!1:_.has(S)?_.get(S):A(i.dirname(S),n);return _.set(S,l),l};m.filter=b?(S,v)=>b(S,v)&&A(a(S)):S=>A(a(S))},o=m=>{const C=new t.Sync(m),_=m.file,b=s.statSync(_),A=m.maxReadSize||16*1024*1024;new r.ReadStreamSync(_,{readSize:A,size:b.size}).pipe(C)},h=(m,C)=>{const _=new t(m),b=m.maxReadSize||16*1024*1024,A=m.file,S=new Promise((v,n)=>{_.on("error",n),_.on("close",v),s.stat(A,(l,f)=>{if(l)n(l);else{const d=new r.ReadStream(A,{readSize:b,size:f.size});d.on("error",n),d.pipe(_)}})});return C?S.then(C,C):S},E=m=>new t.Sync(m),y=m=>new t(m);return bi}var dr;function eu(){return dr||(dr=1,he.c=he.create=jn(),he.r=he.replace=Ys(),he.t=he.list=ui(),he.u=he.update=Un(),he.x=he.extract=Qn(),he.Pack=ii(),he.Unpack=Dr(),he.Parse=ri(),he.ReadEntry=Ht(),he.WriteEntry=ks(),he.Header=Me(),he.Pax=qt(),he.types=Ss()),he}var tu=eu();class iu extends Error{}class mr extends Error{}class su extends Error{}class ru extends Error{}const pr=async(u,t)=>{const s=new URL(u),r=we.basename(s.pathname);return{name:r,version:void 0,subdir:void 0,url:s.href,tar:s.href,defaultDir:r,headers:t.auth?{Authorization:`Bearer ${t.auth}`}:void 0}},Er=async(u,t)=>{const s=rt(u),r=await _i(s,t,async()=>(await(await He(`https://api.github.com/repos/${s.repo}`)).json())?.default_branch);return{name:s.repo.replace("/","-"),version:r,subdir:s.subdir,headers:{...t.auth?{Authorization:`Bearer ${t.auth}`}:{},Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"},url:`https://github.com/${s.repo}/tree/${r}${s.subdir}`,tar:`https://api.github.com/repos/${s.repo}/tarball/${r}`}},nu=async(u,t)=>{const s=rt(u),r=await _i(s,t,async()=>(await(await He(`https://gitlab.com/api/v4/projects/${encodeURIComponent(s.repo)}`)).json())?.default_branch);return{name:s.repo.replace("/","-"),version:r,subdir:s.subdir,headers:{...t.auth?{Authorization:`Bearer ${t.auth}`}:{},"sec-fetch-mode":"same-origin"},url:`https://gitlab.com/${s.repo}/tree/${r}${s.subdir}`,tar:`https://gitlab.com/${s.repo}/-/archive/${r}.tar.gz`}},uu=async(u,t)=>{const s=rt(u),r=await _i(s,t,async()=>(await(await He(`https://api.bitbucket.org/2.0/repositories/${s.repo}`)).json())?.mainbranch?.name);return{name:s.repo.replace("/","-"),version:r,subdir:s.subdir,headers:t.auth?{Authorization:`Bearer ${t.auth}`}:{},url:`https://bitbucket.com/${s.repo}/src/${r}${s.subdir}`,tar:`https://bitbucket.org/${s.repo}/get/${r}.tar.gz`}},ou=(u,t)=>{const s=rt(u),r=s.ref||"main";return{name:s.repo.replace("/","-"),version:r,subdir:s.subdir,headers:t.auth?{Authorization:`Bearer ${t.auth}`}:{},url:`https://git.sr.ht/~${s.repo}/tree/${r}/item${s.subdir}`,tar:`https://git.sr.ht/~${s.repo}/archive/${r}.tar.gz`}},au={http:pr,https:pr,github:Er,gh:Er,gitlab:nu,bitbucket:uu,sourcehut:ou};async function _i(u,t,s){if(u.ref)return u.ref;if(t.offline!==!0)try{const r=await s();if(r)return r}catch(r){wi(`Failed to fetch ref for ${u.repo}`,r)}return"main"}const hu=/^([\w-.]+):/;function lu(u,t,s){t||="github";let r=u;const i=u.match(hu);i&&(t=i[1],t!=="http"&&t!=="https"&&(r=u.slice(i[0].length)));const a=s?.[t]||au[t];return{source:r,providerName:t,provider:a}}async function cu(u,t,s={}){const r=t+".json",i=JSON.parse(await Oe.readFile(r,"utf8").catch(()=>"{}")),e=(await He(u,{...s,method:"HEAD"}).catch(()=>{}))?.headers.get("etag");if(i.etag===e&&Se.existsSync(t))return;typeof e=="string"&&(i.etag=e);const o=await He(u,{headers:s.headers});if(o.status>=400)throw new mr(`Failed to download ${u}: ${o.status} ${o.statusText}`);if(o.body==null)throw new mr(`Failed to download ${u}: empty response body`);await Oe.mkdir(we.dirname(t),{recursive:!0});const h=Se.createWriteStream(t);await Ri(Sr)(o.body,h),await Oe.writeFile(r,JSON.stringify(i),"utf8")}const Du=/^(?<repo>[\w\-.]+\/[\w\-.]+)(?<subdir>[^#]+)?(?<ref>#[\w\-./@]+)?/;function rt(u){const t=u.match(Du)?.groups||{};return{repo:t.repo,subdir:t.subdir||"/",ref:t.ref?.slice(1)}}function wi(...u){process.env.DEBUG&&console.debug("[giget]",...u)}async function He(u,t={}){t.headers?.["sec-fetch-mode"]&&(t.mode=t.headers["sec-fetch-mode"]);const s=await fetch(u,t).catch(r=>{throw new Error(`Failed to fetch ${u}`,{cause:r})});if(t.validateStatus&&s.status>=400)throw new Error(`Failed to fetch ${u}: ${s.status} ${s.statusText}`);return s}function fu(){return process.env.XDG_CACHE_HOME?we.resolve(process.env.XDG_CACHE_HOME,"bluwy-giget"):we.resolve(Ar.homedir(),".cache/bluwy-giget")}async function du(u,t,s){s==="/"&&(s=void 0),s&&(s.startsWith("/")&&(s=s.slice(1)),s.endsWith("/")||(s+="/"));let r=!1;if(await Oe.mkdir(t,{recursive:!0}),await tu.extract({file:u,cwd:t,onentry(i){i.path=i.path.split("/").splice(1).join("/"),s&&(i.path.startsWith(s)?(i.path=i.path.slice(s.length-1),r=!0):i.path="")}}),s&&!r)throw await Oe.rm(t,{recursive:!0,force:!0}),new su(`Subdirectory not found in tar: ${s}`)}async function mu(u,t={}){const{source:s,providerName:r,provider:i}=lu(u,t.provider,t.providers);if(!i)throw new iu(`Unsupported provider: ${r}`);const a={...t.providerOptions,offline:t.offline},e=await Promise.resolve().then(()=>i(s,a)).catch(m=>{throw new Error(`The ${r} provider failed with errors`,{cause:m})});e.name=(e.name||"template").replace(/[^\da-z-]/gi,"-"),e.defaultDir=(e.defaultDir||e.name).replace(/[^\da-z-]/gi,"-");const o=we.resolve(fu(),r,e.name),h=we.resolve(o,(e.version||e.name)+".tar.gz");if((t.offline==="prefer"?!Se.existsSync(h):!t.offline)&&(await cu(e.tar,h,{headers:e.headers}).catch(m=>{if(!Se.existsSync(h))throw m;wi("Download error. Using cached version:",m)}),wi(`Downloaded ${e.tar} to ${h}`)),!Se.existsSync(h))throw new Error(`Tarball not found: ${h} (offline: ${t.offline})`);const E=we.resolve(t.cwd||"."),y=we.resolve(E,t.dir||e.defaultDir);if(t.force==="clean")await Oe.rm(y,{recursive:!0,force:!0});else if(!t.force&&Se.existsSync(y)&&Se.readdirSync(y).length>0)throw new ru(`Destination ${y} already exists.`);return await du(h,y,e.subdir),{info:e,source:s,dir:y}}async function je({template:u,project:t}){await mu(`wrtnlabs/agentica.template.${u}`,{provider:"github",dir:t}),await _r(be(t,".github"),{force:!0,recursive:!0})}async function Ue({projectPath:u,dotEnvfileName:t,apiKeys:s}){if(!ot(u))throw new Error(`${u} directory does not exist.`);const r=be(u,t??".env"),i=(ot(r)?`
89
- `:"")+s.map(({key:a,value:e})=>`${a}=${e}`).join(`
90
- `);await wr(r,i)}function pu({packageManager:u,pkg:t}){switch(u){case"npm":return`npm install ${t??""}`;case"yarn":return t!=null?`yarn add ${t}`:"yarn";case"pnpm":return`pnpm install ${t??""}`;case"bun":return`bun install ${t??""}`;default:throw new Error(`Unsupported package manager: ${u}`)}}function Eu({packageManager:u,command:t}){switch(u){case"npm":return`npm run ${t}`;case"yarn":return`yarn ${t}`;case"pnpm":return`pnpm ${t}`;case"bun":return`bun ${t}`;default:throw new Error(`Unsupported package manager: ${u}`)}}function gu(){const u=ae.env.npm_config_user_agent;switch(!0){case u?.startsWith("npm"):return"npm";case u?.startsWith("yarn"):return"yarn";case u?.startsWith("pnpm"):return"pnpm";case u?.startsWith("bun"):return"bun";default:return"npm"}}const Cu=["nodejs","nestjs","react","react-native","standalone","nestjs+react","nodejs+react"];async function ze({packageManager:u,projectAbsolutePath:t,services:s}){const r=s.length>0?[...s.map(e=>$n(e))].join(" "):void 0,i=pu({packageManager:u,pkg:r}),a=rs();a.start("\u{1F4E6} Package installation in progress..."),await ps(i,{cwd:t}),a.stop("\u2705 Package installation completed")}async function vi({packageManager:u,projectAbsolutePath:t}){const s=Eu({packageManager:u,command:"prepare"}),r=rs();r.start("\u{1F4E6} Package installation in progress..."),await ps(s,{cwd:t}),r.stop("\u2705 Package installation completed")}async function Fu({template:u}){const t={template:u,services:[]};{const s=await Je({message:"Enter the project directory path:",placeholder:"./my-agentica-project",validate(i){if(i==="")return"Please enter a directory path";if(i[0]!==".")return"Please enter a relative path.";if(ot(i))return"Directory already exists"}});_e(s)&&ae.exit(0);const r=be(ae.cwd(),s);t.projectAbsolutePath=r}{const s=await ts({message:"Which package manager do you want to use?",initialValue:gu(),options:[{value:"npm",label:"npm"},{value:"pnpm",label:"pnpm"},{value:"yarn",label:`yarn (${pe.blueBright("berry is not supported")})`},{value:"bun",label:"bun"}]});_e(s)&&ae.exit(0),fe.info(`\u{1F4E6} Using ${s} as package manager`),t.packageManager=s}if(t.template==null){const s=await ts({message:"Which project type do you want to start?",options:[{value:"standalone",label:`Standalone ${pe.blueBright("Agent Server")}`},{value:"nodejs",label:`NodeJS ${pe.blueBright("Agent Server")}`},{value:"nestjs",label:`NestJS ${pe.blueBright("Agent Server")}`},{value:"react",label:`React ${pe.blueBright("Application")}`},{value:"react-native",label:`React Native ${pe.blueBright("Application")}`},{value:"nestjs+react",label:`NestJS + React ${pe.blueBright("Agent Server + Client Application")}`},{value:"nodejs+react",label:`NodeJS + React ${pe.blueBright("Agent Server + Client Application")}`}]});_e(s)&&ae.exit(0),t.template=s}if(t.template!=="standalone"){const s=await Je({message:"Server Port(if project is client app, this port mean ws server port):",initialValue:"3000",validate(r){if(Number.isNaN(Number.parseInt(r)))return"Port must be an integer"}});_e(s)&&ae.exit(0),t.port=Number(s)}if(t.template!=="react"){const s=await Ln(),r=s.sort((h,E)=>h.displayName.localeCompare(E.displayName)).map(({displayName:h,serviceName:E})=>({label:h,value:E})),i=await Cn({message:`Which connectors do you want to include? (Press ${pe.cyan("<space>")} to select, ${pe.cyan("<a>")} to select all, ${pe.cyan("<enter>")} to proceed)`,options:r,required:!1});_e(i)&&ae.exit(0),t.services=i;const a=Array.from(new Set(s.filter(h=>i.includes(h.serviceName)).flatMap(h=>h.envList))),e=a.length===0?!1:await es({message:`Do you want to enter environment variables? (Number of environment variables to enter: ${a.length})
91
- ${pe.cyan("If you press <ctrl+c>, you can skip this step.")}`,initialValue:!1}),o=[];if(_e(e)||!e)a.forEach(h=>{o.push({key:h,value:""})}),is("Skipping environment variables input.");else for(let h=0;h<a.length;h++){const E=a[h],y=await Je({message:`${E}: `,defaultValue:""});if(_e(y)){const m=a.splice(h);m.forEach(C=>{o.push({key:C,value:""})}),is(`Skipping environment variables input: ${m.slice(0,3).join(", ")}... (count: ${m.length})`);break}o.push({key:E,value:y})}t.envList=o}{const s=await es({message:"Enter your OpenAI API key?",initialValue:!1});if(_e(s)&&ae.exit(0),s){const r=await Je({message:"Please enter your OPENAI API key:"});_e(r)&&ae.exit(0),t.openAIKey=r}else t.openAIKey=null}try{(()=>{const s=h=>(h.packageManager==="npm"||h.packageManager==="yarn"||h.packageManager==="pnpm"||h.packageManager==="bun")&&typeof h.projectAbsolutePath=="string"&&(h.template==="nodejs"||h.template==="nestjs"||h.template==="react"||h.template==="react-native"||h.template==="standalone"||h.template==="nestjs+react"||h.template==="nodejs+react")&&(h.openAIKey===null||typeof h.openAIKey=="string")&&(h.port===void 0||typeof h.port=="number")&&Array.isArray(h.services)&&h.services.every(E=>typeof E=="string")&&(h.envList===void 0||Array.isArray(h.envList)&&h.envList.every(E=>typeof E=="object"&&E!==null&&r(E))),r=h=>typeof h.key=="string"&&typeof h.value=="string",i=(h,E,y=!0)=>(h.packageManager==="npm"||h.packageManager==="yarn"||h.packageManager==="pnpm"||h.packageManager==="bun"||re._assertGuard(y,{method:"typia.assertGuard",path:E+".packageManager",expected:'("bun" | "npm" | "pnpm" | "yarn")',value:h.packageManager},o))&&(typeof h.projectAbsolutePath=="string"||re._assertGuard(y,{method:"typia.assertGuard",path:E+".projectAbsolutePath",expected:"string",value:h.projectAbsolutePath},o))&&(h.template==="nodejs"||h.template==="nestjs"||h.template==="react"||h.template==="react-native"||h.template==="standalone"||h.template==="nestjs+react"||h.template==="nodejs+react"||re._assertGuard(y,{method:"typia.assertGuard",path:E+".template",expected:'("nestjs" | "nestjs+react" | "nodejs" | "nodejs+react" | "react" | "react-native" | "standalone")',value:h.template},o))&&(h.openAIKey===null||typeof h.openAIKey=="string"||re._assertGuard(y,{method:"typia.assertGuard",path:E+".openAIKey",expected:"(null | string)",value:h.openAIKey},o))&&(h.port===void 0||typeof h.port=="number"||re._assertGuard(y,{method:"typia.assertGuard",path:E+".port",expected:"(number | undefined)",value:h.port},o))&&((Array.isArray(h.services)||re._assertGuard(y,{method:"typia.assertGuard",path:E+".services",expected:"Array<string>",value:h.services},o))&&h.services.every((m,C)=>typeof m=="string"||re._assertGuard(y,{method:"typia.assertGuard",path:E+".services["+C+"]",expected:"string",value:m},o))||re._assertGuard(y,{method:"typia.assertGuard",path:E+".services",expected:"Array<string>",value:h.services},o))&&(h.envList===void 0||(Array.isArray(h.envList)||re._assertGuard(y,{method:"typia.assertGuard",path:E+".envList",expected:"(Array<__type> | undefined)",value:h.envList},o))&&h.envList.every((m,C)=>(typeof m=="object"&&m!==null||re._assertGuard(y,{method:"typia.assertGuard",path:E+".envList["+C+"]",expected:"__type.o1",value:m},o))&&a(m,E+".envList["+C+"]",y)||re._assertGuard(y,{method:"typia.assertGuard",path:E+".envList["+C+"]",expected:"__type.o1",value:m},o))||re._assertGuard(y,{method:"typia.assertGuard",path:E+".envList",expected:"(Array<__type> | undefined)",value:h.envList},o)),a=(h,E,y=!0)=>(typeof h.key=="string"||re._assertGuard(y,{method:"typia.assertGuard",path:E+".key",expected:"string",value:h.key},o))&&(typeof h.value=="string"||re._assertGuard(y,{method:"typia.assertGuard",path:E+".value",expected:"string",value:h.value},o)),e=h=>typeof h=="object"&&h!==null&&s(h);let o;return(h,E)=>{e(h)===!1&&(o=E,((y,m,C=!0)=>(typeof y=="object"&&y!==null||re._assertGuard(!0,{method:"typia.assertGuard",path:m+"",expected:"__type",value:y},o))&&i(y,m+"",!0)||re._assertGuard(!0,{method:"typia.assertGuard",path:m+"",expected:"__type",value:y},o))(h,"$input",!0))}})()(t)}catch(s){throw new Error(`\u274C ${s.toString()}`)}return t}async function yu({projectAbsolutePath:u,context:t}){await je({template:"standalone",project:u}),fe.success("\u2705 Template downloaded");const s=xt(t.services),r=Bt(t.services),i=be(u,"src/index.ts"),a=await at(i,"utf-8"),e=Tt({content:a,importCode:s,connectorCode:r}),o=await Ot(e);await ht(i,o),await Ue({projectPath:u,apiKeys:[{key:"OPENAI_API_KEY",value:t.openAIKey??""},...t.envList??[]]}),fe.success("\u2705 .env created"),await ze({packageManager:t.packageManager,projectAbsolutePath:u,services:t.services}),await vi({packageManager:t.packageManager,projectAbsolutePath:u})}async function gr({projectAbsolutePath:u,context:t}){await je({template:"nodejs",project:u}),fe.success("\u2705 Template downloaded");const s=xt(t.services),r=Bt(t.services),i=be(u,"src/index.ts"),a=await at(i,"utf-8").then(h=>t.services.length===0?h:h.replace(/import \{ BbsArticleService \}.*;\n/g,"").replace(/controllers:\s*\[[\s\S]*?\],\n/,`controllers: [/// INSERT CONTROLLER HERE],
92
- `)),e=Tt({content:a,importCode:s,connectorCode:r}),o=await Ot(e);await ht(i,o),await Ue({projectPath:u,apiKeys:[{key:"OPENAI_API_KEY",value:t.openAIKey??""},{key:"PORT",value:t.port?.toString()??"3000"},...t.envList??[]]}),fe.success("\u2705 .env created"),await ze({packageManager:t.packageManager,projectAbsolutePath:u,services:t.services}),await vi({packageManager:t.packageManager,projectAbsolutePath:u})}async function Cr({projectAbsolutePath:u,context:t}){await je({template:"nestjs",project:u}),fe.success("\u2705 Template downloaded");const s=xt(t.services),r=Bt(t.services),i=be(u,"src/controllers/chat/ChatController.ts"),a=await at(i,"utf-8").then(h=>t.services.length===0?h:h.replace(/import \{ BbsArticleService \}.*;\n/g,"").replace(/controllers:\s*\[[\s\S]*?\],\n/,`controllers: [/// INSERT CONTROLLER HERE],
93
- `)),e=Tt({content:a,importCode:s,connectorCode:r}),o=await Ot(e);await ht(i,o),await Ue({projectPath:u,apiKeys:[{key:"OPENAI_API_KEY",value:t.openAIKey??""},{key:"API_PORT",value:t.port?.toString()??"3000"},...t.envList??[]]}),fe.success("\u2705 .env created"),await ze({packageManager:t.packageManager,projectAbsolutePath:u,services:t.services}),await vi({packageManager:t.packageManager,projectAbsolutePath:u})}async function Ai({projectAbsolutePath:u,context:t}){await je({template:"react",project:u}),fe.success("\u2705 Template downloaded"),await Ue({projectPath:u,apiKeys:[{key:"OPENAI_API_KEY",value:t.openAIKey??""},{key:"VITE_AGENTICA_WS_URL",value:`ws://localhost:${t.port}/chat`}]}),fe.success("\u2705 .env created"),await ze({packageManager:t.packageManager,projectAbsolutePath:u,services:t.services})}async function bu({projectAbsolutePath:u,context:t}){await je({template:"react-native",project:u}),fe.success("\u2705 Template downloaded"),await Ue({projectPath:u,apiKeys:[{key:"OPENAI_API_KEY",value:t.openAIKey??""}]}),fe.success("\u2705 .env created"),await ze({packageManager:t.packageManager,projectAbsolutePath:u,services:t.services})}async function _u({template:u}){ss("Agentica Start Wizard");const t=await Fu({template:u}),{projectAbsolutePath:s}=t;switch(t.template){case"standalone":await yu({projectAbsolutePath:s,context:t});break;case"nodejs":await gr({projectAbsolutePath:s,context:t});break;case"nestjs":await Cr({projectAbsolutePath:s,context:t});break;case"react":await Ai({projectAbsolutePath:s,context:t});break;case"react-native":await bu({projectAbsolutePath:s,context:t});break;case"nestjs+react":await Cr({projectAbsolutePath:be(s,"server"),context:t}),await Ai({projectAbsolutePath:be(s,"client"),context:t});break;case"nodejs+react":await gr({projectAbsolutePath:be(s,"server"),context:t}),await Ai({projectAbsolutePath:be(s,"client"),context:t});break;default:throw t.template,new Error(`\u274C Template ${t.template} not supported`)}Fn(`
94
- \u{1F389} Project ${s} created
95
- \u26A0\uFE0F ${pe.yellow("Note:")} Please implement constructor values for each controller generated in index.ts
96
- `)}const wu="0.24.0",nt=new An;nt.version(wu),nt.command("start").description("Start a new project").addOption(new Sn("-p, --project <project>","The project type").choices(Cu)).action(async u=>{ss(`\u{1F680} ${pe.blueBright("Agentica")} Setup Wizard`),await _u({template:u.project})});function vu(){nt.parse(ae.argv)}export{nt as program,vu as run};
87
+ `)}function It(s){return s.map(t=>`import { ${Si(t)}Service } from "${$t}${t}";`).join(`
88
+ `)}function Lt({content:s,importCode:t,connectorCode:i}){return s.replace("/// INSERT IMPORT HERE",t).replace("/// INSERT CONTROLLER HERE",i)}var he={},Pt,Oi;function Le(){if(Oi)return Pt;Oi=1;const s=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"]]);return Pt=t=>t?Object.keys(t).map(i=>[s.has(i)?s.get(i):i,t[i]]).reduce((i,n)=>(i[n[0]]=n[1],i),Object.create(null)):{},Pt}var Mt={},Ri;function kt(){if(Ri)return Mt;Ri=1;const s=typeof process=="object"&&process?process:{stdout:null,stderr:null},t=Te,i=Ls,r=Ps.StringDecoder,a=Symbol("EOF"),e=Symbol("maybeEmitEnd"),u=Symbol("emittedEnd"),h=Symbol("emittingEnd"),m=Symbol("emittedError"),y=Symbol("closed"),p=Symbol("read"),C=Symbol("flush"),w=Symbol("flushChunk"),b=Symbol("encoding"),A=Symbol("decoder"),S=Symbol("flowing"),v=Symbol("paused"),o=Symbol("resume"),l=Symbol("buffer"),f=Symbol("pipes"),d=Symbol("bufferLength"),D=Symbol("bufferPush"),F=Symbol("bufferShift"),R=Symbol("objectMode"),B=Symbol("destroyed"),x=Symbol("error"),P=Symbol("emitData"),M=Symbol("emitEnd"),U=Symbol("emitEnd2"),G=Symbol("async"),Y=Symbol("abort"),N=Symbol("aborted"),W=Symbol("signal"),V=z=>Promise.resolve().then(z),te=Dt._MP_NO_ITERATOR_SYMBOLS_!=="1",_=te&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),c=te&&Symbol.iterator||Symbol("iterator not implemented"),g=z=>z==="end"||z==="finish"||z==="prefinish",L=z=>z instanceof ArrayBuffer||typeof z=="object"&&z.constructor&&z.constructor.name==="ArrayBuffer"&&z.byteLength>=0,j=z=>!Buffer.isBuffer(z)&&ArrayBuffer.isView(z);class J{constructor(O,T,K){this.src=O,this.dest=T,this.opts=K,this.ondrain=()=>O[o](),T.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}}class $ extends J{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(O,T,K){super(O,T,K),this.proxyErrors=ae=>T.emit("error",ae),O.on("error",this.proxyErrors)}}class q extends i{constructor(O){super(),this[S]=!1,this[v]=!1,this[f]=[],this[l]=[],this[R]=O&&O.objectMode||!1,this[R]?this[b]=null:this[b]=O&&O.encoding||null,this[b]==="buffer"&&(this[b]=null),this[G]=O&&!!O.async||!1,this[A]=this[b]?new r(this[b]):null,this[a]=!1,this[u]=!1,this[h]=!1,this[y]=!1,this[m]=null,this.writable=!0,this.readable=!0,this[d]=0,this[B]=!1,O&&O.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[l]}),O&&O.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[f]}),this[W]=O&&O.signal,this[N]=!1,this[W]&&(this[W].addEventListener("abort",()=>this[Y]()),this[W].aborted&&this[Y]())}get bufferLength(){return this[d]}get encoding(){return this[b]}set encoding(O){if(this[R])throw new Error("cannot set encoding in objectMode");if(this[b]&&O!==this[b]&&(this[A]&&this[A].lastNeed||this[d]))throw new Error("cannot change encoding");this[b]!==O&&(this[A]=O?new r(O):null,this[l].length&&(this[l]=this[l].map(T=>this[A].write(T)))),this[b]=O}setEncoding(O){this.encoding=O}get objectMode(){return this[R]}set objectMode(O){this[R]=this[R]||!!O}get async(){return this[G]}set async(O){this[G]=this[G]||!!O}[Y](){this[N]=!0,this.emit("abort",this[W].reason),this.destroy(this[W].reason)}get aborted(){return this[N]}set aborted(O){}write(O,T,K){if(this[N])return!1;if(this[a])throw new Error("write after end");if(this[B])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof T=="function"&&(K=T,T="utf8"),T||(T="utf8");const ae=this[G]?V:De=>De();return!this[R]&&!Buffer.isBuffer(O)&&(j(O)?O=Buffer.from(O.buffer,O.byteOffset,O.byteLength):L(O)?O=Buffer.from(O):typeof O!="string"&&(this.objectMode=!0)),this[R]?(this.flowing&&this[d]!==0&&this[C](!0),this.flowing?this.emit("data",O):this[D](O),this[d]!==0&&this.emit("readable"),K&&ae(K),this.flowing):O.length?(typeof O=="string"&&!(T===this[b]&&!this[A].lastNeed)&&(O=Buffer.from(O,T)),Buffer.isBuffer(O)&&this[b]&&(O=this[A].write(O)),this.flowing&&this[d]!==0&&this[C](!0),this.flowing?this.emit("data",O):this[D](O),this[d]!==0&&this.emit("readable"),K&&ae(K),this.flowing):(this[d]!==0&&this.emit("readable"),K&&ae(K),this.flowing)}read(O){if(this[B])return null;if(this[d]===0||O===0||O>this[d])return this[e](),null;this[R]&&(O=null),this[l].length>1&&!this[R]&&(this.encoding?this[l]=[this[l].join("")]:this[l]=[Buffer.concat(this[l],this[d])]);const T=this[p](O||null,this[l][0]);return this[e](),T}[p](O,T){return O===T.length||O===null?this[F]():(this[l][0]=T.slice(O),T=T.slice(0,O),this[d]-=O),this.emit("data",T),!this[l].length&&!this[a]&&this.emit("drain"),T}end(O,T,K){return typeof O=="function"&&(K=O,O=null),typeof T=="function"&&(K=T,T="utf8"),O&&this.write(O,T),K&&this.once("end",K),this[a]=!0,this.writable=!1,(this.flowing||!this[v])&&this[e](),this}[o](){this[B]||(this[v]=!1,this[S]=!0,this.emit("resume"),this[l].length?this[C]():this[a]?this[e]():this.emit("drain"))}resume(){return this[o]()}pause(){this[S]=!1,this[v]=!0}get destroyed(){return this[B]}get flowing(){return this[S]}get paused(){return this[v]}[D](O){this[R]?this[d]+=1:this[d]+=O.length,this[l].push(O)}[F](){return this[R]?this[d]-=1:this[d]-=this[l][0].length,this[l].shift()}[C](O){do;while(this[w](this[F]())&&this[l].length);!O&&!this[l].length&&!this[a]&&this.emit("drain")}[w](O){return this.emit("data",O),this.flowing}pipe(O,T){if(this[B])return;const K=this[u];return T=T||{},O===s.stdout||O===s.stderr?T.end=!1:T.end=T.end!==!1,T.proxyErrors=!!T.proxyErrors,K?T.end&&O.end():(this[f].push(T.proxyErrors?new $(this,O,T):new J(this,O,T)),this[G]?V(()=>this[o]()):this[o]()),O}unpipe(O){const T=this[f].find(K=>K.dest===O);T&&(this[f].splice(this[f].indexOf(T),1),T.unpipe())}addListener(O,T){return this.on(O,T)}on(O,T){const K=super.on(O,T);return O==="data"&&!this[f].length&&!this.flowing?this[o]():O==="readable"&&this[d]!==0?super.emit("readable"):g(O)&&this[u]?(super.emit(O),this.removeAllListeners(O)):O==="error"&&this[m]&&(this[G]?V(()=>T.call(this,this[m])):T.call(this,this[m])),K}get emittedEnd(){return this[u]}[e](){!this[h]&&!this[u]&&!this[B]&&this[l].length===0&&this[a]&&(this[h]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[y]&&this.emit("close"),this[h]=!1)}emit(O,T,...K){if(O!=="error"&&O!=="close"&&O!==B&&this[B])return;if(O==="data")return!this[R]&&!T?!1:this[G]?V(()=>this[P](T)):this[P](T);if(O==="end")return this[M]();if(O==="close"){if(this[y]=!0,!this[u]&&!this[B])return;const De=super.emit("close");return this.removeAllListeners("close"),De}else if(O==="error"){this[m]=T,super.emit(x,T);const De=!this[W]||this.listeners("error").length?super.emit("error",T):!1;return this[e](),De}else if(O==="resume"){const De=super.emit("resume");return this[e](),De}else if(O==="finish"||O==="prefinish"){const De=super.emit(O);return this.removeAllListeners(O),De}const ae=super.emit(O,T,...K);return this[e](),ae}[P](O){for(const K of this[f])K.dest.write(O)===!1&&this.pause();const T=super.emit("data",O);return this[e](),T}[M](){this[u]||(this[u]=!0,this.readable=!1,this[G]?V(()=>this[U]()):this[U]())}[U](){if(this[A]){const T=this[A].end();if(T){for(const K of this[f])K.dest.write(T);super.emit("data",T)}}for(const T of this[f])T.end();const O=super.emit("end");return this.removeAllListeners("end"),O}collect(){const O=[];this[R]||(O.dataLength=0);const T=this.promise();return this.on("data",K=>{O.push(K),this[R]||(O.dataLength+=K.length)}),T.then(()=>O)}concat(){return this[R]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(O=>this[R]?Promise.reject(new Error("cannot concat in objectMode")):this[b]?O.join(""):Buffer.concat(O,O.dataLength))}promise(){return new Promise((O,T)=>{this.on(B,()=>T(new Error("stream destroyed"))),this.on("error",K=>T(K)),this.on("end",()=>O())})}[_](){let O=!1;const T=()=>(this.pause(),O=!0,Promise.resolve({done:!0}));return{next:()=>{if(O)return T();const ae=this.read();if(ae!==null)return Promise.resolve({done:!1,value:ae});if(this[a])return T();let De=null,qe=null;const se=Z=>{this.removeListener("data",E),this.removeListener("end",k),this.removeListener(B,H),T(),qe(Z)},E=Z=>{this.removeListener("error",se),this.removeListener("end",k),this.removeListener(B,H),this.pause(),De({value:Z,done:!!this[a]})},k=()=>{this.removeListener("error",se),this.removeListener("data",E),this.removeListener(B,H),T(),De({done:!0})},H=()=>se(new Error("stream destroyed"));return new Promise((Z,X)=>{qe=X,De=Z,this.once(B,H),this.once("error",se),this.once("end",k),this.once("data",E)})},throw:T,return:T,[_](){return this}}}[c](){let O=!1;const T=()=>(this.pause(),this.removeListener(x,T),this.removeListener(B,T),this.removeListener("end",T),O=!0,{done:!0}),K=()=>{if(O)return T();const ae=this.read();return ae===null?T():{value:ae}};return this.once("end",T),this.once(x,T),this.once(B,T),{next:K,throw:T,return:T,[c](){return this}}}destroy(O){return this[B]?(O?this.emit("error",O):this.emit(B),this):(this[B]=!0,this[l].length=0,this[d]=0,typeof this.close=="function"&&!this[y]&&this.close(),O?this.emit("error",O):this.emit(B),this)}static isStream(O){return!!O&&(O instanceof q||O instanceof i||O instanceof t&&(typeof O.pipe=="function"||typeof O.write=="function"&&typeof O.end=="function"))}}return Mt.Minipass=q,Mt}var ge={},jt,Bi;function wu(){if(Bi)return jt;Bi=1;const s=Ms.constants||{ZLIB_VERNUM:4736};return jt=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},s)),jt}var Ht,xi;function Ti(){if(xi)return Ht;xi=1;const s=typeof process=="object"&&process?process:{stdout:null,stderr:null},t=Te,i=Ls,n=Ps.StringDecoder,r=Symbol("EOF"),a=Symbol("maybeEmitEnd"),e=Symbol("emittedEnd"),u=Symbol("emittingEnd"),h=Symbol("emittedError"),m=Symbol("closed"),y=Symbol("read"),p=Symbol("flush"),C=Symbol("flushChunk"),w=Symbol("encoding"),b=Symbol("decoder"),A=Symbol("flowing"),S=Symbol("paused"),v=Symbol("resume"),o=Symbol("bufferLength"),l=Symbol("bufferPush"),f=Symbol("bufferShift"),d=Symbol("objectMode"),D=Symbol("destroyed"),F=Symbol("emitData"),R=Symbol("emitEnd"),B=Symbol("emitEnd2"),x=Symbol("async"),P=_=>Promise.resolve().then(_),M=Dt._MP_NO_ITERATOR_SYMBOLS_!=="1",U=M&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),G=M&&Symbol.iterator||Symbol("iterator not implemented"),Y=_=>_==="end"||_==="finish"||_==="prefinish",N=_=>_ instanceof ArrayBuffer||typeof _=="object"&&_.constructor&&_.constructor.name==="ArrayBuffer"&&_.byteLength>=0,W=_=>!Buffer.isBuffer(_)&&ArrayBuffer.isView(_);class V{constructor(c,g,L){this.src=c,this.dest=g,this.opts=L,this.ondrain=()=>c[v](),g.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}}class te extends V{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(c,g,L){super(c,g,L),this.proxyErrors=j=>g.emit("error",j),c.on("error",this.proxyErrors)}}return Ht=class xr extends i{constructor(c){super(),this[A]=!1,this[S]=!1,this.pipes=[],this.buffer=[],this[d]=c&&c.objectMode||!1,this[d]?this[w]=null:this[w]=c&&c.encoding||null,this[w]==="buffer"&&(this[w]=null),this[x]=c&&!!c.async||!1,this[b]=this[w]?new n(this[w]):null,this[r]=!1,this[e]=!1,this[u]=!1,this[m]=!1,this[h]=null,this.writable=!0,this.readable=!0,this[o]=0,this[D]=!1}get bufferLength(){return this[o]}get encoding(){return this[w]}set encoding(c){if(this[d])throw new Error("cannot set encoding in objectMode");if(this[w]&&c!==this[w]&&(this[b]&&this[b].lastNeed||this[o]))throw new Error("cannot change encoding");this[w]!==c&&(this[b]=c?new n(c):null,this.buffer.length&&(this.buffer=this.buffer.map(g=>this[b].write(g)))),this[w]=c}setEncoding(c){this.encoding=c}get objectMode(){return this[d]}set objectMode(c){this[d]=this[d]||!!c}get async(){return this[x]}set async(c){this[x]=this[x]||!!c}write(c,g,L){if(this[r])throw new Error("write after end");if(this[D])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof g=="function"&&(L=g,g="utf8"),g||(g="utf8");const j=this[x]?P:J=>J();return!this[d]&&!Buffer.isBuffer(c)&&(W(c)?c=Buffer.from(c.buffer,c.byteOffset,c.byteLength):N(c)?c=Buffer.from(c):typeof c!="string"&&(this.objectMode=!0)),this[d]?(this.flowing&&this[o]!==0&&this[p](!0),this.flowing?this.emit("data",c):this[l](c),this[o]!==0&&this.emit("readable"),L&&j(L),this.flowing):c.length?(typeof c=="string"&&!(g===this[w]&&!this[b].lastNeed)&&(c=Buffer.from(c,g)),Buffer.isBuffer(c)&&this[w]&&(c=this[b].write(c)),this.flowing&&this[o]!==0&&this[p](!0),this.flowing?this.emit("data",c):this[l](c),this[o]!==0&&this.emit("readable"),L&&j(L),this.flowing):(this[o]!==0&&this.emit("readable"),L&&j(L),this.flowing)}read(c){if(this[D])return null;if(this[o]===0||c===0||c>this[o])return this[a](),null;this[d]&&(c=null),this.buffer.length>1&&!this[d]&&(this.encoding?this.buffer=[this.buffer.join("")]:this.buffer=[Buffer.concat(this.buffer,this[o])]);const g=this[y](c||null,this.buffer[0]);return this[a](),g}[y](c,g){return c===g.length||c===null?this[f]():(this.buffer[0]=g.slice(c),g=g.slice(0,c),this[o]-=c),this.emit("data",g),!this.buffer.length&&!this[r]&&this.emit("drain"),g}end(c,g,L){return typeof c=="function"&&(L=c,c=null),typeof g=="function"&&(L=g,g="utf8"),c&&this.write(c,g),L&&this.once("end",L),this[r]=!0,this.writable=!1,(this.flowing||!this[S])&&this[a](),this}[v](){this[D]||(this[S]=!1,this[A]=!0,this.emit("resume"),this.buffer.length?this[p]():this[r]?this[a]():this.emit("drain"))}resume(){return this[v]()}pause(){this[A]=!1,this[S]=!0}get destroyed(){return this[D]}get flowing(){return this[A]}get paused(){return this[S]}[l](c){this[d]?this[o]+=1:this[o]+=c.length,this.buffer.push(c)}[f](){return this.buffer.length&&(this[d]?this[o]-=1:this[o]-=this.buffer[0].length),this.buffer.shift()}[p](c){do;while(this[C](this[f]()));!c&&!this.buffer.length&&!this[r]&&this.emit("drain")}[C](c){return c?(this.emit("data",c),this.flowing):!1}pipe(c,g){if(this[D])return;const L=this[e];return g=g||{},c===s.stdout||c===s.stderr?g.end=!1:g.end=g.end!==!1,g.proxyErrors=!!g.proxyErrors,L?g.end&&c.end():(this.pipes.push(g.proxyErrors?new te(this,c,g):new V(this,c,g)),this[x]?P(()=>this[v]()):this[v]()),c}unpipe(c){const g=this.pipes.find(L=>L.dest===c);g&&(this.pipes.splice(this.pipes.indexOf(g),1),g.unpipe())}addListener(c,g){return this.on(c,g)}on(c,g){const L=super.on(c,g);return c==="data"&&!this.pipes.length&&!this.flowing?this[v]():c==="readable"&&this[o]!==0?super.emit("readable"):Y(c)&&this[e]?(super.emit(c),this.removeAllListeners(c)):c==="error"&&this[h]&&(this[x]?P(()=>g.call(this,this[h])):g.call(this,this[h])),L}get emittedEnd(){return this[e]}[a](){!this[u]&&!this[e]&&!this[D]&&this.buffer.length===0&&this[r]&&(this[u]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[m]&&this.emit("close"),this[u]=!1)}emit(c,g,...L){if(c!=="error"&&c!=="close"&&c!==D&&this[D])return;if(c==="data")return g?this[x]?P(()=>this[F](g)):this[F](g):!1;if(c==="end")return this[R]();if(c==="close"){if(this[m]=!0,!this[e]&&!this[D])return;const J=super.emit("close");return this.removeAllListeners("close"),J}else if(c==="error"){this[h]=g;const J=super.emit("error",g);return this[a](),J}else if(c==="resume"){const J=super.emit("resume");return this[a](),J}else if(c==="finish"||c==="prefinish"){const J=super.emit(c);return this.removeAllListeners(c),J}const j=super.emit(c,g,...L);return this[a](),j}[F](c){for(const L of this.pipes)L.dest.write(c)===!1&&this.pause();const g=super.emit("data",c);return this[a](),g}[R](){this[e]||(this[e]=!0,this.readable=!1,this[x]?P(()=>this[B]()):this[B]())}[B](){if(this[b]){const g=this[b].end();if(g){for(const L of this.pipes)L.dest.write(g);super.emit("data",g)}}for(const g of this.pipes)g.end();const c=super.emit("end");return this.removeAllListeners("end"),c}collect(){const c=[];this[d]||(c.dataLength=0);const g=this.promise();return this.on("data",L=>{c.push(L),this[d]||(c.dataLength+=L.length)}),g.then(()=>c)}concat(){return this[d]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(c=>this[d]?Promise.reject(new Error("cannot concat in objectMode")):this[w]?c.join(""):Buffer.concat(c,c.dataLength))}promise(){return new Promise((c,g)=>{this.on(D,()=>g(new Error("stream destroyed"))),this.on("error",L=>g(L)),this.on("end",()=>c())})}[U](){return{next:()=>{const g=this.read();if(g!==null)return Promise.resolve({done:!1,value:g});if(this[r])return Promise.resolve({done:!0});let L=null,j=null;const J=O=>{this.removeListener("data",$),this.removeListener("end",q),j(O)},$=O=>{this.removeListener("error",J),this.removeListener("end",q),this.pause(),L({value:O,done:!!this[r]})},q=()=>{this.removeListener("error",J),this.removeListener("data",$),L({done:!0})},z=()=>J(new Error("stream destroyed"));return new Promise((O,T)=>{j=T,L=O,this.once(D,z),this.once("error",J),this.once("end",q),this.once("data",$)})}}}[G](){return{next:()=>{const g=this.read();return{value:g,done:g===null}}}}destroy(c){return this[D]?(c?this.emit("error",c):this.emit(D),this):(this[D]=!0,this.buffer.length=0,this[o]=0,typeof this.close=="function"&&!this[m]&&this.close(),c?this.emit("error",c):this.emit(D),this)}static isStream(c){return!!c&&(c instanceof xr||c instanceof i||c instanceof t&&(typeof c.pipe=="function"||typeof c.write=="function"&&typeof c.end=="function"))}},Ht}var $i;function Ni(){if($i)return ge;$i=1;const s=ct,t=qr.Buffer,i=Ms,n=ge.constants=wu(),r=Ti(),a=t.concat,e=Symbol("_superWrite");class u extends Error{constructor(N){super("zlib: "+N.message),this.code=N.code,this.errno=N.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+N.message,Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}}const h=Symbol("opts"),m=Symbol("flushFlag"),y=Symbol("finishFlushFlag"),p=Symbol("fullFlushFlag"),C=Symbol("handle"),w=Symbol("onError"),b=Symbol("sawError"),A=Symbol("level"),S=Symbol("strategy"),v=Symbol("ended");class o extends r{constructor(N,W){if(!N||typeof N!="object")throw new TypeError("invalid options for ZlibBase constructor");super(N),this[b]=!1,this[v]=!1,this[h]=N,this[m]=N.flush,this[y]=N.finishFlush;try{this[C]=new i[W](N)}catch(V){throw new u(V)}this[w]=V=>{this[b]||(this[b]=!0,this.close(),this.emit("error",V))},this[C].on("error",V=>this[w](new u(V))),this.once("end",()=>this.close)}close(){this[C]&&(this[C].close(),this[C]=null,this.emit("close"))}reset(){if(!this[b])return s(this[C],"zlib binding closed"),this[C].reset()}flush(N){this.ended||(typeof N!="number"&&(N=this[p]),this.write(Object.assign(t.alloc(0),{[m]:N})))}end(N,W,V){return N&&this.write(N,W),this.flush(this[y]),this[v]=!0,super.end(null,null,V)}get ended(){return this[v]}write(N,W,V){if(typeof W=="function"&&(V=W,W="utf8"),typeof N=="string"&&(N=t.from(N,W)),this[b])return;s(this[C],"zlib binding closed");const te=this[C]._handle,_=te.close;te.close=()=>{};const c=this[C].close;this[C].close=()=>{},t.concat=j=>j;let g;try{const j=typeof N[m]=="number"?N[m]:this[m];g=this[C]._processChunk(N,j),t.concat=a}catch(j){t.concat=a,this[w](new u(j))}finally{this[C]&&(this[C]._handle=te,te.close=_,this[C].close=c,this[C].removeAllListeners("error"))}this[C]&&this[C].on("error",j=>this[w](new u(j)));let L;if(g)if(Array.isArray(g)&&g.length>0){L=this[e](t.from(g[0]));for(let j=1;j<g.length;j++)L=this[e](g[j])}else L=this[e](t.from(g));return V&&V(),L}[e](N){return super.write(N)}}class l extends o{constructor(N,W){N=N||{},N.flush=N.flush||n.Z_NO_FLUSH,N.finishFlush=N.finishFlush||n.Z_FINISH,super(N,W),this[p]=n.Z_FULL_FLUSH,this[A]=N.level,this[S]=N.strategy}params(N,W){if(!this[b]){if(!this[C])throw new Error("cannot switch params when binding is closed");if(!this[C].params)throw new Error("not supported in this implementation");if(this[A]!==N||this[S]!==W){this.flush(n.Z_SYNC_FLUSH),s(this[C],"zlib binding closed");const V=this[C].flush;this[C].flush=(te,_)=>{this.flush(te),_()};try{this[C].params(N,W)}finally{this[C].flush=V}this[C]&&(this[A]=N,this[S]=W)}}}}class f extends l{constructor(N){super(N,"Deflate")}}class d extends l{constructor(N){super(N,"Inflate")}}const D=Symbol("_portable");class F extends l{constructor(N){super(N,"Gzip"),this[D]=N&&!!N.portable}[e](N){return this[D]?(this[D]=!1,N[9]=255,super[e](N)):super[e](N)}}class R extends l{constructor(N){super(N,"Gunzip")}}class B extends l{constructor(N){super(N,"DeflateRaw")}}class x extends l{constructor(N){super(N,"InflateRaw")}}class P extends l{constructor(N){super(N,"Unzip")}}class M extends o{constructor(N,W){N=N||{},N.flush=N.flush||n.BROTLI_OPERATION_PROCESS,N.finishFlush=N.finishFlush||n.BROTLI_OPERATION_FINISH,super(N,W),this[p]=n.BROTLI_OPERATION_FLUSH}}class U extends M{constructor(N){super(N,"BrotliCompress")}}class G extends M{constructor(N){super(N,"BrotliDecompress")}}return ge.Deflate=f,ge.Inflate=d,ge.Gzip=F,ge.Gunzip=R,ge.DeflateRaw=B,ge.InflateRaw=x,ge.Unzip=P,typeof i.BrotliCompress=="function"?(ge.BrotliCompress=U,ge.BrotliDecompress=G):ge.BrotliCompress=ge.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}},ge}var Ut,Ii;function Pe(){return Ii||(Ii=1,Ut=(process.env.TESTING_TAR_FAKE_PLATFORM||process.platform)!=="win32"?t=>t:t=>t&&t.replace(/\\/g,"/")),Ut}var zt,Li;function Gt(){if(Li)return zt;Li=1;const{Minipass:s}=kt(),t=Pe(),i=Symbol("slurp");return zt=class extends s{constructor(r,a,e){switch(super(),this.pause(),this.extended=a,this.globalExtended=e,this.header=r,this.startBlockSize=512*Math.ceil(r.size/512),this.blockRemain=this.startBlockSize,this.remain=r.size,this.type=r.type,this.meta=!1,this.ignore=!1,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}this.path=t(r.path),this.mode=r.mode,this.mode&&(this.mode=this.mode&4095),this.uid=r.uid,this.gid=r.gid,this.uname=r.uname,this.gname=r.gname,this.size=r.size,this.mtime=r.mtime,this.atime=r.atime,this.ctime=r.ctime,this.linkpath=t(r.linkpath),this.uname=r.uname,this.gname=r.gname,a&&this[i](a),e&&this[i](e,!0)}write(r){const a=r.length;if(a>this.blockRemain)throw new Error("writing more to entry than is appropriate");const e=this.remain,u=this.blockRemain;return this.remain=Math.max(0,e-a),this.blockRemain=Math.max(0,u-a),this.ignore?!0:e>=a?super.write(r):super.write(r.slice(0,e))}[i](r,a){for(const e in r)r[e]!==null&&r[e]!==void 0&&!(a&&e==="path")&&(this[e]=e==="path"||e==="linkpath"?t(r[e]):r[e])}},zt}var qt={},Pi;function Mi(){return Pi||(Pi=1,function(s){s.name=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]),s.code=new Map(Array.from(s.name).map(t=>[t[1],t[0]]))}(qt)),qt}var Wt,ki;function _u(){if(ki)return Wt;ki=1;const s=(h,m)=>{if(Number.isSafeInteger(h))h<0?i(h,m):t(h,m);else throw Error("cannot encode number outside of javascript safe integer range");return m},t=(h,m)=>{m[0]=128;for(var y=m.length;y>1;y--)m[y-1]=h&255,h=Math.floor(h/256)},i=(h,m)=>{m[0]=255;var y=!1;h=h*-1;for(var p=m.length;p>1;p--){var C=h&255;h=Math.floor(h/256),y?m[p-1]=e(C):C===0?m[p-1]=0:(y=!0,m[p-1]=u(C))}},n=h=>{const m=h[0],y=m===128?a(h.slice(1,h.length)):m===255?r(h):null;if(y===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(y))throw Error("parsed number outside of javascript safe integer range");return y},r=h=>{for(var m=h.length,y=0,p=!1,C=m-1;C>-1;C--){var w=h[C],b;p?b=e(w):w===0?b=w:(p=!0,b=u(w)),b!==0&&(y-=b*Math.pow(256,m-C-1))}return y},a=h=>{for(var m=h.length,y=0,p=m-1;p>-1;p--){var C=h[p];C!==0&&(y+=C*Math.pow(256,m-p-1))}return y},e=h=>(255^h)&255,u=h=>(255^h)+1&255;return Wt={encode:s,parse:n},Wt}var Vt,ji;function Me(){if(ji)return Vt;ji=1;const s=Mi(),t=fe.posix,i=_u(),n=Symbol("slurp"),r=Symbol("type");class a{constructor(D,F,R,B){this.cksumValid=!1,this.needPax=!1,this.nullBlock=!1,this.block=null,this.path=null,this.mode=null,this.uid=null,this.gid=null,this.size=null,this.mtime=null,this.cksum=null,this[r]="0",this.linkpath=null,this.uname=null,this.gname=null,this.devmaj=0,this.devmin=0,this.atime=null,this.ctime=null,Buffer.isBuffer(D)?this.decode(D,F||0,R,B):D&&this.set(D)}decode(D,F,R,B){if(F||(F=0),!D||!(D.length>=F+512))throw new Error("need 512 bytes for header");if(this.path=u(D,F,100),this.mode=y(D,F+100,8),this.uid=y(D,F+108,8),this.gid=y(D,F+116,8),this.size=y(D,F+124,12),this.mtime=h(D,F+136,12),this.cksum=y(D,F+148,12),this[n](R),this[n](B,!0),this[r]=u(D,F+156,1),this[r]===""&&(this[r]="0"),this[r]==="0"&&this.path.slice(-1)==="/"&&(this[r]="5"),this[r]==="5"&&(this.size=0),this.linkpath=u(D,F+157,100),D.slice(F+257,F+265).toString()==="ustar\x0000")if(this.uname=u(D,F+265,32),this.gname=u(D,F+297,32),this.devmaj=y(D,F+329,8),this.devmin=y(D,F+337,8),D[F+475]!==0){const P=u(D,F+345,155);this.path=P+"/"+this.path}else{const P=u(D,F+345,130);P&&(this.path=P+"/"+this.path),this.atime=h(D,F+476,12),this.ctime=h(D,F+488,12)}let x=8*32;for(let P=F;P<F+148;P++)x+=D[P];for(let P=F+156;P<F+512;P++)x+=D[P];this.cksumValid=x===this.cksum,this.cksum===null&&x===8*32&&(this.nullBlock=!0)}[n](D,F){for(const R in D)D[R]!==null&&D[R]!==void 0&&!(F&&R==="path")&&(this[R]=D[R])}encode(D,F){if(D||(D=this.block=Buffer.alloc(512),F=0),F||(F=0),!(D.length>=F+512))throw new Error("need 512 bytes for header");const R=this.ctime||this.atime?130:155,B=e(this.path||"",R),x=B[0],P=B[1];this.needPax=B[2],this.needPax=f(D,F,100,x)||this.needPax,this.needPax=b(D,F+100,8,this.mode)||this.needPax,this.needPax=b(D,F+108,8,this.uid)||this.needPax,this.needPax=b(D,F+116,8,this.gid)||this.needPax,this.needPax=b(D,F+124,12,this.size)||this.needPax,this.needPax=o(D,F+136,12,this.mtime)||this.needPax,D[F+156]=this[r].charCodeAt(0),this.needPax=f(D,F+157,100,this.linkpath)||this.needPax,D.write("ustar\x0000",F+257,8),this.needPax=f(D,F+265,32,this.uname)||this.needPax,this.needPax=f(D,F+297,32,this.gname)||this.needPax,this.needPax=b(D,F+329,8,this.devmaj)||this.needPax,this.needPax=b(D,F+337,8,this.devmin)||this.needPax,this.needPax=f(D,F+345,R,P)||this.needPax,D[F+475]!==0?this.needPax=f(D,F+345,155,P)||this.needPax:(this.needPax=f(D,F+345,130,P)||this.needPax,this.needPax=o(D,F+476,12,this.atime)||this.needPax,this.needPax=o(D,F+488,12,this.ctime)||this.needPax);let M=8*32;for(let U=F;U<F+148;U++)M+=D[U];for(let U=F+156;U<F+512;U++)M+=D[U];return this.cksum=M,b(D,F+148,8,this.cksum),this.cksumValid=!0,this.needPax}set(D){for(const F in D)D[F]!==null&&D[F]!==void 0&&(this[F]=D[F])}get type(){return s.name.get(this[r])||this[r]}get typeKey(){return this[r]}set type(D){s.code.has(D)?this[r]=s.code.get(D):this[r]=D}}const e=(d,D)=>{let R=d,B="",x;const P=t.parse(d).root||".";if(Buffer.byteLength(R)<100)x=[R,B,!1];else{B=t.dirname(R),R=t.basename(R);do Buffer.byteLength(R)<=100&&Buffer.byteLength(B)<=D?x=[R,B,!1]:Buffer.byteLength(R)>100&&Buffer.byteLength(B)<=D?x=[R.slice(0,99),B,!0]:(R=t.join(t.basename(B),R),B=t.dirname(B));while(B!==P&&!x);x||(x=[d.slice(0,99),"",!0])}return x},u=(d,D,F)=>d.slice(D,D+F).toString("utf8").replace(/\0.*/,""),h=(d,D,F)=>m(y(d,D,F)),m=d=>d===null?null:new Date(d*1e3),y=(d,D,F)=>d[D]&128?i.parse(d.slice(D,D+F)):C(d,D,F),p=d=>isNaN(d)?null:d,C=(d,D,F)=>p(parseInt(d.slice(D,D+F).toString("utf8").replace(/\0.*$/,"").trim(),8)),w={12:8589934591,8:2097151},b=(d,D,F,R)=>R===null?!1:R>w[F]||R<0?(i.encode(R,d.slice(D,D+F)),!0):(A(d,D,F,R),!1),A=(d,D,F,R)=>d.write(S(R,F),D,F,"ascii"),S=(d,D)=>v(Math.floor(d).toString(8),D),v=(d,D)=>(d.length===D-1?d:new Array(D-d.length-1).join("0")+d+" ")+"\0",o=(d,D,F,R)=>R===null?!1:b(d,D,F,R.getTime()/1e3),l=new Array(156).join("\0"),f=(d,D,F,R)=>R===null?!1:(d.write(R+l,D,F,"utf8"),R.length!==Buffer.byteLength(R)||R.length>F);return Vt=a,Vt}var Kt,Hi;function Yt(){if(Hi)return Kt;Hi=1;const s=Me(),t=fe;class i{constructor(u,h){this.atime=u.atime||null,this.charset=u.charset||null,this.comment=u.comment||null,this.ctime=u.ctime||null,this.gid=u.gid||null,this.gname=u.gname||null,this.linkpath=u.linkpath||null,this.mtime=u.mtime||null,this.path=u.path||null,this.size=u.size||null,this.uid=u.uid||null,this.uname=u.uname||null,this.dev=u.dev||null,this.ino=u.ino||null,this.nlink=u.nlink||null,this.global=h||!1}encode(){const u=this.encodeBody();if(u==="")return null;const h=Buffer.byteLength(u),m=512*Math.ceil(1+h/512),y=Buffer.allocUnsafe(m);for(let p=0;p<512;p++)y[p]=0;new s({path:("PaxHeader/"+t.basename(this.path)).slice(0,99),mode:this.mode||420,uid:this.uid||null,gid:this.gid||null,size:h,mtime:this.mtime||null,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime||null,ctime:this.ctime||null}).encode(y),y.write(u,512,h,"utf8");for(let p=h+512;p<y.length;p++)y[p]=0;return y}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(u){if(this[u]===null||this[u]===void 0)return"";const h=this[u]instanceof Date?this[u].getTime()/1e3:this[u],m=" "+(u==="dev"||u==="ino"||u==="nlink"?"SCHILY.":"")+u+"="+h+`
89
+ `,y=Buffer.byteLength(m);let p=Math.floor(Math.log(y)/Math.log(10))+1;return y+p>=Math.pow(10,p)&&(p+=1),p+y+m}}i.parse=(e,u,h)=>new i(n(r(e),u),h);const n=(e,u)=>u?Object.keys(e).reduce((h,m)=>(h[m]=e[m],h),u):e,r=e=>e.replace(/\n$/,"").split(`
90
+ `).reduce(a,Object.create(null)),a=(e,u)=>{const h=parseInt(u,10);if(h!==Buffer.byteLength(u)+1)return e;u=u.slice((h+" ").length);const m=u.split("="),y=m.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!y)return e;const p=m.join("=");return e[y]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(y)?new Date(p*1e3):/^[0-9]+$/.test(p)?+p:p,e};return Kt=i,Kt}var Zt,Ui;function ke(){return Ui||(Ui=1,Zt=s=>{let t=s.length-1,i=-1;for(;t>-1&&s.charAt(t)==="/";)i=t,t--;return i===-1?s:s.slice(0,i)}),Zt}var Xt,zi;function Jt(){return zi||(zi=1,Xt=s=>class extends s{warn(t,i,n={}){this.file&&(n.file=this.file),this.cwd&&(n.cwd=this.cwd),n.code=i instanceof Error&&i.code||t,n.tarCode=t,!this.strict&&n.recoverable!==!1?(i instanceof Error&&(n=Object.assign(i,n),i=i.message),this.emit("warn",n.tarCode,i,n)):i instanceof Error?this.emit("error",Object.assign(i,n)):this.emit("error",Object.assign(new Error(`${t}: ${i}`),n))}}),Xt}var Qt,Gi;function qi(){if(Gi)return Qt;Gi=1;const s=["|","<",">","?",":"],t=s.map(r=>String.fromCharCode(61440+r.charCodeAt(0))),i=new Map(s.map((r,a)=>[r,t[a]])),n=new Map(t.map((r,a)=>[r,s[a]]));return Qt={encode:r=>s.reduce((a,e)=>a.split(e).join(i.get(e)),r),decode:r=>t.reduce((a,e)=>a.split(e).join(n.get(e)),r)},Qt}var es,Wi;function Vi(){if(Wi)return es;Wi=1;const{isAbsolute:s,parse:t}=fe.win32;return es=i=>{let n="",r=t(i);for(;s(i)||r.root;){const a=i.charAt(0)==="/"&&i.slice(0,4)!=="//?/"?"/":r.root;i=i.slice(a.length),n+=a,r=t(i)}return[n,i]},es}var ts,Ki;function vu(){return Ki||(Ki=1,ts=(s,t,i)=>(s&=4095,i&&(s=(s|384)&-19),t&&(s&256&&(s|=64),s&32&&(s|=8),s&4&&(s|=1)),s)),ts}var ss,Yi;function Zi(){if(Yi)return ss;Yi=1;const{Minipass:s}=kt(),t=Yt(),i=Me(),n=Ce,r=fe,a=Pe(),e=ke(),u=(_,c)=>c?(_=a(_).replace(/^\.(\/|$)/,""),e(c)+"/"+_):a(_),h=16*1024*1024,m=Symbol("process"),y=Symbol("file"),p=Symbol("directory"),C=Symbol("symlink"),w=Symbol("hardlink"),b=Symbol("header"),A=Symbol("read"),S=Symbol("lstat"),v=Symbol("onlstat"),o=Symbol("onread"),l=Symbol("onreadlink"),f=Symbol("openfile"),d=Symbol("onopenfile"),D=Symbol("close"),F=Symbol("mode"),R=Symbol("awaitDrain"),B=Symbol("ondrain"),x=Symbol("prefix"),P=Symbol("hadError"),M=Jt(),U=qi(),G=Vi(),Y=vu(),N=M(class extends s{constructor(c,g){if(g=g||{},super(g),typeof c!="string")throw new TypeError("path is required");this.path=a(c),this.portable=!!g.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||"",this.maxReadSize=g.maxReadSize||h,this.linkCache=g.linkCache||new Map,this.statCache=g.statCache||new Map,this.preservePaths=!!g.preservePaths,this.cwd=a(g.cwd||process.cwd()),this.strict=!!g.strict,this.noPax=!!g.noPax,this.noMtime=!!g.noMtime,this.mtime=g.mtime||null,this.prefix=g.prefix?a(g.prefix):null,this.fd=null,this.blockLen=null,this.blockRemain=null,this.buf=null,this.offset=null,this.length=null,this.pos=null,this.remain=null,typeof g.onwarn=="function"&&this.on("warn",g.onwarn);let L=!1;if(!this.preservePaths){const[j,J]=G(this.path);j&&(this.path=J,L=j)}this.win32=!!g.win32||process.platform==="win32",this.win32&&(this.path=U.decode(this.path.replace(/\\/g,"/")),c=c.replace(/\\/g,"/")),this.absolute=a(g.absolute||r.resolve(this.cwd,c)),this.path===""&&(this.path="./"),L&&this.warn("TAR_ENTRY_INFO",`stripping ${L} from absolute path`,{entry:this,path:L+this.path}),this.statCache.has(this.absolute)?this[v](this.statCache.get(this.absolute)):this[S]()}emit(c,...g){return c==="error"&&(this[P]=!0),super.emit(c,...g)}[S](){n.lstat(this.absolute,(c,g)=>{if(c)return this.emit("error",c);this[v](g)})}[v](c){this.statCache.set(this.absolute,c),this.stat=c,c.isFile()||(c.size=0),this.type=te(c),this.emit("stat",c),this[m]()}[m](){switch(this.type){case"File":return this[y]();case"Directory":return this[p]();case"SymbolicLink":return this[C]();default:return this.end()}}[F](c){return Y(c,this.type==="Directory",this.portable)}[x](c){return u(c,this.prefix)}[b](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new i({path:this[x](this.path),linkpath:this.type==="Link"?this[x](this.linkpath):this.linkpath,mode:this[F](this.stat.mode),uid:this.portable?null:this.stat.uid,gid:this.portable?null:this.stat.gid,size:this.stat.size,mtime:this.noMtime?null:this.mtime||this.stat.mtime,type:this.type,uname:this.portable?null:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?null:this.stat.atime,ctime:this.portable?null:this.stat.ctime}),this.header.encode()&&!this.noPax&&super.write(new t({atime:this.portable?null:this.header.atime,ctime:this.portable?null:this.header.ctime,gid:this.portable?null:this.header.gid,mtime:this.noMtime?null:this.mtime||this.header.mtime,path:this[x](this.path),linkpath:this.type==="Link"?this[x](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?null:this.header.uid,uname:this.portable?null:this.header.uname,dev:this.portable?null:this.stat.dev,ino:this.portable?null:this.stat.ino,nlink:this.portable?null:this.stat.nlink}).encode()),super.write(this.header.block)}[p](){this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[b](),this.end()}[C](){n.readlink(this.absolute,(c,g)=>{if(c)return this.emit("error",c);this[l](g)})}[l](c){this.linkpath=a(c),this[b](),this.end()}[w](c){this.type="Link",this.linkpath=a(r.relative(this.cwd,c)),this.stat.size=0,this[b](),this.end()}[y](){if(this.stat.nlink>1){const c=this.stat.dev+":"+this.stat.ino;if(this.linkCache.has(c)){const g=this.linkCache.get(c);if(g.indexOf(this.cwd)===0)return this[w](g)}this.linkCache.set(c,this.absolute)}if(this[b](),this.stat.size===0)return this.end();this[f]()}[f](){n.open(this.absolute,"r",(c,g)=>{if(c)return this.emit("error",c);this[d](g)})}[d](c){if(this.fd=c,this[P])return this[D]();this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;const g=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(g),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[A]()}[A](){const{fd:c,buf:g,offset:L,length:j,pos:J}=this;n.read(c,g,L,j,J,($,q)=>{if($)return this[D](()=>this.emit("error",$));this[o](q)})}[D](c){n.close(this.fd,c)}[o](c){if(c<=0&&this.remain>0){const j=new Error("encountered unexpected EOF");return j.path=this.absolute,j.syscall="read",j.code="EOF",this[D](()=>this.emit("error",j))}if(c>this.remain){const j=new Error("did not encounter expected EOF");return j.path=this.absolute,j.syscall="read",j.code="EOF",this[D](()=>this.emit("error",j))}if(c===this.remain)for(let j=c;j<this.length&&c<this.blockRemain;j++)this.buf[j+this.offset]=0,c++,this.remain++;const g=this.offset===0&&c===this.buf.length?this.buf:this.buf.slice(this.offset,this.offset+c);this.write(g)?this[B]():this[R](()=>this[B]())}[R](c){this.once("drain",c)}write(c){if(this.blockRemain<c.length){const g=new Error("writing more data than expected");return g.path=this.absolute,this.emit("error",g)}return this.remain-=c.length,this.blockRemain-=c.length,this.pos+=c.length,this.offset+=c.length,super.write(c)}[B](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[D](c=>c?this.emit("error",c):this.end());this.offset>=this.length&&(this.buf=Buffer.allocUnsafe(Math.min(this.blockRemain,this.buf.length)),this.offset=0),this.length=this.buf.length-this.offset,this[A]()}});class W extends N{[S](){this[v](n.lstatSync(this.absolute))}[C](){this[l](n.readlinkSync(this.absolute))}[f](){this[d](n.openSync(this.absolute,"r"))}[A](){let c=!0;try{const{fd:g,buf:L,offset:j,length:J,pos:$}=this,q=n.readSync(g,L,j,J,$);this[o](q),c=!1}finally{if(c)try{this[D](()=>{})}catch{}}}[R](c){c()}[D](c){n.closeSync(this.fd),c()}}const V=M(class extends s{constructor(c,g){g=g||{},super(g),this.preservePaths=!!g.preservePaths,this.portable=!!g.portable,this.strict=!!g.strict,this.noPax=!!g.noPax,this.noMtime=!!g.noMtime,this.readEntry=c,this.type=c.type,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=g.prefix||null,this.path=a(c.path),this.mode=this[F](c.mode),this.uid=this.portable?null:c.uid,this.gid=this.portable?null:c.gid,this.uname=this.portable?null:c.uname,this.gname=this.portable?null:c.gname,this.size=c.size,this.mtime=this.noMtime?null:g.mtime||c.mtime,this.atime=this.portable?null:c.atime,this.ctime=this.portable?null:c.ctime,this.linkpath=a(c.linkpath),typeof g.onwarn=="function"&&this.on("warn",g.onwarn);let L=!1;if(!this.preservePaths){const[j,J]=G(this.path);j&&(this.path=J,L=j)}this.remain=c.size,this.blockRemain=c.startBlockSize,this.header=new i({path:this[x](this.path),linkpath:this.type==="Link"?this[x](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?null:this.uid,gid:this.portable?null:this.gid,size:this.size,mtime:this.noMtime?null:this.mtime,type:this.type,uname:this.portable?null:this.uname,atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime}),L&&this.warn("TAR_ENTRY_INFO",`stripping ${L} from absolute path`,{entry:this,path:L+this.path}),this.header.encode()&&!this.noPax&&super.write(new t({atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime,gid:this.portable?null:this.gid,mtime:this.noMtime?null:this.mtime,path:this[x](this.path),linkpath:this.type==="Link"?this[x](this.linkpath):this.linkpath,size:this.size,uid:this.portable?null:this.uid,uname:this.portable?null:this.uname,dev:this.portable?null:this.readEntry.dev,ino:this.portable?null:this.readEntry.ino,nlink:this.portable?null:this.readEntry.nlink}).encode()),super.write(this.header.block),c.pipe(this)}[x](c){return u(c,this.prefix)}[F](c){return Y(c,this.type==="Directory",this.portable)}write(c){const g=c.length;if(g>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=g,super.write(c)}end(){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),super.end()}});N.Sync=W,N.Tar=V;const te=_=>_.isFile()?"File":_.isDirectory()?"Directory":_.isSymbolicLink()?"SymbolicLink":"Unsupported";return ss=N,ss}var is,Xi;function Au(){return Xi||(Xi=1,is=function(s){s.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),is}var rs,Ji;function Qi(){if(Ji)return rs;Ji=1,rs=s,s.Node=r,s.create=s;function s(a){var e=this;if(e instanceof s||(e=new s),e.tail=null,e.head=null,e.length=0,a&&typeof a.forEach=="function")a.forEach(function(m){e.push(m)});else if(arguments.length>0)for(var u=0,h=arguments.length;u<h;u++)e.push(arguments[u]);return e}s.prototype.removeNode=function(a){if(a.list!==this)throw new Error("removing node which does not belong to this list");var e=a.next,u=a.prev;return e&&(e.prev=u),u&&(u.next=e),a===this.head&&(this.head=e),a===this.tail&&(this.tail=u),a.list.length--,a.next=null,a.prev=null,a.list=null,e},s.prototype.unshiftNode=function(a){if(a!==this.head){a.list&&a.list.removeNode(a);var e=this.head;a.list=this,a.next=e,e&&(e.prev=a),this.head=a,this.tail||(this.tail=a),this.length++}},s.prototype.pushNode=function(a){if(a!==this.tail){a.list&&a.list.removeNode(a);var e=this.tail;a.list=this,a.prev=e,e&&(e.next=a),this.tail=a,this.head||(this.head=a),this.length++}},s.prototype.push=function(){for(var a=0,e=arguments.length;a<e;a++)i(this,arguments[a]);return this.length},s.prototype.unshift=function(){for(var a=0,e=arguments.length;a<e;a++)n(this,arguments[a]);return this.length},s.prototype.pop=function(){if(this.tail){var a=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,a}},s.prototype.shift=function(){if(this.head){var a=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,a}},s.prototype.forEach=function(a,e){e=e||this;for(var u=this.head,h=0;u!==null;h++)a.call(e,u.value,h,this),u=u.next},s.prototype.forEachReverse=function(a,e){e=e||this;for(var u=this.tail,h=this.length-1;u!==null;h--)a.call(e,u.value,h,this),u=u.prev},s.prototype.get=function(a){for(var e=0,u=this.head;u!==null&&e<a;e++)u=u.next;if(e===a&&u!==null)return u.value},s.prototype.getReverse=function(a){for(var e=0,u=this.tail;u!==null&&e<a;e++)u=u.prev;if(e===a&&u!==null)return u.value},s.prototype.map=function(a,e){e=e||this;for(var u=new s,h=this.head;h!==null;)u.push(a.call(e,h.value,this)),h=h.next;return u},s.prototype.mapReverse=function(a,e){e=e||this;for(var u=new s,h=this.tail;h!==null;)u.push(a.call(e,h.value,this)),h=h.prev;return u},s.prototype.reduce=function(a,e){var u,h=this.head;if(arguments.length>1)u=e;else if(this.head)h=this.head.next,u=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var m=0;h!==null;m++)u=a(u,h.value,m),h=h.next;return u},s.prototype.reduceReverse=function(a,e){var u,h=this.tail;if(arguments.length>1)u=e;else if(this.tail)h=this.tail.prev,u=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var m=this.length-1;h!==null;m--)u=a(u,h.value,m),h=h.prev;return u},s.prototype.toArray=function(){for(var a=new Array(this.length),e=0,u=this.head;u!==null;e++)a[e]=u.value,u=u.next;return a},s.prototype.toArrayReverse=function(){for(var a=new Array(this.length),e=0,u=this.tail;u!==null;e++)a[e]=u.value,u=u.prev;return a},s.prototype.slice=function(a,e){e=e||this.length,e<0&&(e+=this.length),a=a||0,a<0&&(a+=this.length);var u=new s;if(e<a||e<0)return u;a<0&&(a=0),e>this.length&&(e=this.length);for(var h=0,m=this.head;m!==null&&h<a;h++)m=m.next;for(;m!==null&&h<e;h++,m=m.next)u.push(m.value);return u},s.prototype.sliceReverse=function(a,e){e=e||this.length,e<0&&(e+=this.length),a=a||0,a<0&&(a+=this.length);var u=new s;if(e<a||e<0)return u;a<0&&(a=0),e>this.length&&(e=this.length);for(var h=this.length,m=this.tail;m!==null&&h>e;h--)m=m.prev;for(;m!==null&&h>a;h--,m=m.prev)u.push(m.value);return u},s.prototype.splice=function(a,e,...u){a>this.length&&(a=this.length-1),a<0&&(a=this.length+a);for(var h=0,m=this.head;m!==null&&h<a;h++)m=m.next;for(var y=[],h=0;m&&h<e;h++)y.push(m.value),m=this.removeNode(m);m===null&&(m=this.tail),m!==this.head&&m!==this.tail&&(m=m.prev);for(var h=0;h<u.length;h++)m=t(this,m,u[h]);return y},s.prototype.reverse=function(){for(var a=this.head,e=this.tail,u=a;u!==null;u=u.prev){var h=u.prev;u.prev=u.next,u.next=h}return this.head=e,this.tail=a,this};function t(a,e,u){var h=e===a.head?new r(u,null,e,a):new r(u,e,e.next,a);return h.next===null&&(a.tail=h),h.prev===null&&(a.head=h),a.length++,h}function i(a,e){a.tail=new r(e,a.tail,null,a),a.head||(a.head=a.tail),a.length++}function n(a,e){a.head=new r(e,null,a.head,a),a.tail||(a.tail=a.head),a.length++}function r(a,e,u,h){if(!(this instanceof r))return new r(a,e,u,h);this.list=h,this.value=a,e?(e.next=this,this.prev=e):this.prev=null,u?(u.prev=this,this.next=u):this.next=null}try{Au()(s)}catch{}return rs}var ns,er;function us(){if(er)return ns;er=1;class s{constructor(_,c){this.path=_||"./",this.absolute=c,this.entry=null,this.stat=null,this.readdir=null,this.pending=!1,this.ignore=!1,this.piped=!1}}const{Minipass:t}=kt(),i=Ni(),n=Gt(),r=Zi(),a=r.Sync,e=r.Tar,u=Qi(),h=Buffer.alloc(1024),m=Symbol("onStat"),y=Symbol("ended"),p=Symbol("queue"),C=Symbol("current"),w=Symbol("process"),b=Symbol("processing"),A=Symbol("processJob"),S=Symbol("jobs"),v=Symbol("jobDone"),o=Symbol("addFSEntry"),l=Symbol("addTarEntry"),f=Symbol("stat"),d=Symbol("readdir"),D=Symbol("onreaddir"),F=Symbol("pipe"),R=Symbol("entry"),B=Symbol("entryOpt"),x=Symbol("writeEntryClass"),P=Symbol("write"),M=Symbol("ondrain"),U=Ce,G=fe,Y=Jt(),N=Pe(),W=Y(class extends t{constructor(_){if(super(_),_=_||Object.create(null),this.opt=_,this.file=_.file||"",this.cwd=_.cwd||process.cwd(),this.maxReadSize=_.maxReadSize,this.preservePaths=!!_.preservePaths,this.strict=!!_.strict,this.noPax=!!_.noPax,this.prefix=N(_.prefix||""),this.linkCache=_.linkCache||new Map,this.statCache=_.statCache||new Map,this.readdirCache=_.readdirCache||new Map,this[x]=r,typeof _.onwarn=="function"&&this.on("warn",_.onwarn),this.portable=!!_.portable,this.zip=null,_.gzip||_.brotli){if(_.gzip&&_.brotli)throw new TypeError("gzip and brotli are mutually exclusive");_.gzip&&(typeof _.gzip!="object"&&(_.gzip={}),this.portable&&(_.gzip.portable=!0),this.zip=new i.Gzip(_.gzip)),_.brotli&&(typeof _.brotli!="object"&&(_.brotli={}),this.zip=new i.BrotliCompress(_.brotli)),this.zip.on("data",c=>super.write(c)),this.zip.on("end",c=>super.end()),this.zip.on("drain",c=>this[M]()),this.on("resume",c=>this.zip.resume())}else this.on("drain",this[M]);this.noDirRecurse=!!_.noDirRecurse,this.follow=!!_.follow,this.noMtime=!!_.noMtime,this.mtime=_.mtime||null,this.filter=typeof _.filter=="function"?_.filter:c=>!0,this[p]=new u,this[S]=0,this.jobs=+_.jobs||4,this[b]=!1,this[y]=!1}[P](_){return super.write(_)}add(_){return this.write(_),this}end(_){return _&&this.write(_),this[y]=!0,this[w](),this}write(_){if(this[y])throw new Error("write after end");return _ instanceof n?this[l](_):this[o](_),this.flowing}[l](_){const c=N(G.resolve(this.cwd,_.path));if(!this.filter(_.path,_))_.resume();else{const g=new s(_.path,c,!1);g.entry=new e(_,this[B](g)),g.entry.on("end",L=>this[v](g)),this[S]+=1,this[p].push(g)}this[w]()}[o](_){const c=N(G.resolve(this.cwd,_));this[p].push(new s(_,c)),this[w]()}[f](_){_.pending=!0,this[S]+=1;const c=this.follow?"stat":"lstat";U[c](_.absolute,(g,L)=>{_.pending=!1,this[S]-=1,g?this.emit("error",g):this[m](_,L)})}[m](_,c){this.statCache.set(_.absolute,c),_.stat=c,this.filter(_.path,c)||(_.ignore=!0),this[w]()}[d](_){_.pending=!0,this[S]+=1,U.readdir(_.absolute,(c,g)=>{if(_.pending=!1,this[S]-=1,c)return this.emit("error",c);this[D](_,g)})}[D](_,c){this.readdirCache.set(_.absolute,c),_.readdir=c,this[w]()}[w](){if(!this[b]){this[b]=!0;for(let _=this[p].head;_!==null&&this[S]<this.jobs;_=_.next)if(this[A](_.value),_.value.ignore){const c=_.next;this[p].removeNode(_),_.next=c}this[b]=!1,this[y]&&!this[p].length&&this[S]===0&&(this.zip?this.zip.end(h):(super.write(h),super.end()))}}get[C](){return this[p]&&this[p].head&&this[p].head.value}[v](_){this[p].shift(),this[S]-=1,this[w]()}[A](_){if(!_.pending){if(_.entry){_===this[C]&&!_.piped&&this[F](_);return}if(_.stat||(this.statCache.has(_.absolute)?this[m](_,this.statCache.get(_.absolute)):this[f](_)),!!_.stat&&!_.ignore&&!(!this.noDirRecurse&&_.stat.isDirectory()&&!_.readdir&&(this.readdirCache.has(_.absolute)?this[D](_,this.readdirCache.get(_.absolute)):this[d](_),!_.readdir))){if(_.entry=this[R](_),!_.entry){_.ignore=!0;return}_===this[C]&&!_.piped&&this[F](_)}}}[B](_){return{onwarn:(c,g,L)=>this.warn(c,g,L),noPax:this.noPax,cwd:this.cwd,absolute:_.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime,prefix:this.prefix}}[R](_){this[S]+=1;try{return new this[x](_.path,this[B](_)).on("end",()=>this[v](_)).on("error",c=>this.emit("error",c))}catch(c){this.emit("error",c)}}[M](){this[C]&&this[C].entry&&this[C].entry.resume()}[F](_){_.piped=!0,_.readdir&&_.readdir.forEach(L=>{const j=_.path,J=j==="./"?"":j.replace(/\/*$/,"/");this[o](J+L)});const c=_.entry,g=this.zip;g?c.on("data",L=>{g.write(L)||c.pause()}):c.on("data",L=>{super.write(L)||c.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}});class V extends W{constructor(_){super(_),this[x]=a}pause(){}resume(){}[f](_){const c=this.follow?"statSync":"lstatSync";this[m](_,U[c](_.absolute))}[d](_,c){this[D](_,U.readdirSync(_.absolute))}[F](_){const c=_.entry,g=this.zip;_.readdir&&_.readdir.forEach(L=>{const j=_.path,J=j==="./"?"":j.replace(/\/*$/,"/");this[o](J+L)}),g?c.on("data",L=>{g.write(L)}):c.on("data",L=>{super[P](L)})}}return W.Sync=V,ns=W,ns}var Be={},tr;function je(){if(tr)return Be;tr=1;const s=Ti(),t=Te.EventEmitter,i=Ce;let n=i.writev;if(!n){const _=process.binding("fs"),c=_.FSReqWrap||_.FSReqCallback;n=(g,L,j,J)=>{const $=(z,O)=>J(z,O,L),q=new c;q.oncomplete=$,_.writeBuffers(g,L,j,q)}}const r=Symbol("_autoClose"),a=Symbol("_close"),e=Symbol("_ended"),u=Symbol("_fd"),h=Symbol("_finished"),m=Symbol("_flags"),y=Symbol("_flush"),p=Symbol("_handleChunk"),C=Symbol("_makeBuf"),w=Symbol("_mode"),b=Symbol("_needDrain"),A=Symbol("_onerror"),S=Symbol("_onopen"),v=Symbol("_onread"),o=Symbol("_onwrite"),l=Symbol("_open"),f=Symbol("_path"),d=Symbol("_pos"),D=Symbol("_queue"),F=Symbol("_read"),R=Symbol("_readSize"),B=Symbol("_reading"),x=Symbol("_remain"),P=Symbol("_size"),M=Symbol("_write"),U=Symbol("_writing"),G=Symbol("_defaultFlag"),Y=Symbol("_errored");class N extends s{constructor(c,g){if(g=g||{},super(g),this.readable=!0,this.writable=!1,typeof c!="string")throw new TypeError("path must be a string");this[Y]=!1,this[u]=typeof g.fd=="number"?g.fd:null,this[f]=c,this[R]=g.readSize||16*1024*1024,this[B]=!1,this[P]=typeof g.size=="number"?g.size:1/0,this[x]=this[P],this[r]=typeof g.autoClose=="boolean"?g.autoClose:!0,typeof this[u]=="number"?this[F]():this[l]()}get fd(){return this[u]}get path(){return this[f]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[l](){i.open(this[f],"r",(c,g)=>this[S](c,g))}[S](c,g){c?this[A](c):(this[u]=g,this.emit("open",g),this[F]())}[C](){return Buffer.allocUnsafe(Math.min(this[R],this[x]))}[F](){if(!this[B]){this[B]=!0;const c=this[C]();if(c.length===0)return process.nextTick(()=>this[v](null,0,c));i.read(this[u],c,0,c.length,null,(g,L,j)=>this[v](g,L,j))}}[v](c,g,L){this[B]=!1,c?this[A](c):this[p](g,L)&&this[F]()}[a](){if(this[r]&&typeof this[u]=="number"){const c=this[u];this[u]=null,i.close(c,g=>g?this.emit("error",g):this.emit("close"))}}[A](c){this[B]=!0,this[a](),this.emit("error",c)}[p](c,g){let L=!1;return this[x]-=c,c>0&&(L=super.write(c<g.length?g.slice(0,c):g)),(c===0||this[x]<=0)&&(L=!1,this[a](),super.end()),L}emit(c,g){switch(c){case"prefinish":case"finish":break;case"drain":typeof this[u]=="number"&&this[F]();break;case"error":return this[Y]?void 0:(this[Y]=!0,super.emit(c,g));default:return super.emit(c,g)}}}class W extends N{[l](){let c=!0;try{this[S](null,i.openSync(this[f],"r")),c=!1}finally{c&&this[a]()}}[F](){let c=!0;try{if(!this[B]){this[B]=!0;do{const g=this[C](),L=g.length===0?0:i.readSync(this[u],g,0,g.length,null);if(!this[p](L,g))break}while(!0);this[B]=!1}c=!1}finally{c&&this[a]()}}[a](){if(this[r]&&typeof this[u]=="number"){const c=this[u];this[u]=null,i.closeSync(c),this.emit("close")}}}class V extends t{constructor(c,g){g=g||{},super(g),this.readable=!1,this.writable=!0,this[Y]=!1,this[U]=!1,this[e]=!1,this[b]=!1,this[D]=[],this[f]=c,this[u]=typeof g.fd=="number"?g.fd:null,this[w]=g.mode===void 0?438:g.mode,this[d]=typeof g.start=="number"?g.start:null,this[r]=typeof g.autoClose=="boolean"?g.autoClose:!0;const L=this[d]!==null?"r+":"w";this[G]=g.flags===void 0,this[m]=this[G]?L:g.flags,this[u]===null&&this[l]()}emit(c,g){if(c==="error"){if(this[Y])return;this[Y]=!0}return super.emit(c,g)}get fd(){return this[u]}get path(){return this[f]}[A](c){this[a](),this[U]=!0,this.emit("error",c)}[l](){i.open(this[f],this[m],this[w],(c,g)=>this[S](c,g))}[S](c,g){this[G]&&this[m]==="r+"&&c&&c.code==="ENOENT"?(this[m]="w",this[l]()):c?this[A](c):(this[u]=g,this.emit("open",g),this[y]())}end(c,g){return c&&this.write(c,g),this[e]=!0,!this[U]&&!this[D].length&&typeof this[u]=="number"&&this[o](null,0),this}write(c,g){return typeof c=="string"&&(c=Buffer.from(c,g)),this[e]?(this.emit("error",new Error("write() after end()")),!1):this[u]===null||this[U]||this[D].length?(this[D].push(c),this[b]=!0,!1):(this[U]=!0,this[M](c),!0)}[M](c){i.write(this[u],c,0,c.length,this[d],(g,L)=>this[o](g,L))}[o](c,g){c?this[A](c):(this[d]!==null&&(this[d]+=g),this[D].length?this[y]():(this[U]=!1,this[e]&&!this[h]?(this[h]=!0,this[a](),this.emit("finish")):this[b]&&(this[b]=!1,this.emit("drain"))))}[y](){if(this[D].length===0)this[e]&&this[o](null,0);else if(this[D].length===1)this[M](this[D].pop());else{const c=this[D];this[D]=[],n(this[u],c,this[d],(g,L)=>this[o](g,L))}}[a](){if(this[r]&&typeof this[u]=="number"){const c=this[u];this[u]=null,i.close(c,g=>g?this.emit("error",g):this.emit("close"))}}}class te extends V{[l](){let c;if(this[G]&&this[m]==="r+")try{c=i.openSync(this[f],this[m],this[w])}catch(g){if(g.code==="ENOENT")return this[m]="w",this[l]();throw g}else c=i.openSync(this[f],this[m],this[w]);this[S](null,c)}[a](){if(this[r]&&typeof this[u]=="number"){const c=this[u];this[u]=null,i.closeSync(c),this.emit("close")}}[M](c){let g=!0;try{this[o](null,i.writeSync(this[u],c,0,c.length,this[d])),g=!1}finally{if(g)try{this[a]()}catch{}}}}return Be.ReadStream=N,Be.ReadStreamSync=W,Be.WriteStream=V,Be.WriteStreamSync=te,Be}var os,sr;function as(){if(sr)return os;sr=1;const s=Jt(),t=Me(),i=Te,n=Qi(),r=1024*1024,a=Gt(),e=Yt(),u=Ni(),{nextTick:h}=Ns,m=Buffer.from([31,139]),y=Symbol("state"),p=Symbol("writeEntry"),C=Symbol("readEntry"),w=Symbol("nextEntry"),b=Symbol("processEntry"),A=Symbol("extendedHeader"),S=Symbol("globalExtendedHeader"),v=Symbol("meta"),o=Symbol("emitMeta"),l=Symbol("buffer"),f=Symbol("queue"),d=Symbol("ended"),D=Symbol("emittedEnd"),F=Symbol("emit"),R=Symbol("unzip"),B=Symbol("consumeChunk"),x=Symbol("consumeChunkSub"),P=Symbol("consumeBody"),M=Symbol("consumeMeta"),U=Symbol("consumeHeader"),G=Symbol("consuming"),Y=Symbol("bufferConcat"),N=Symbol("maybeEnd"),W=Symbol("writing"),V=Symbol("aborted"),te=Symbol("onDone"),_=Symbol("sawValidEntry"),c=Symbol("sawNullBlock"),g=Symbol("sawEOF"),L=Symbol("closeStream"),j=J=>!0;return os=s(class extends i{constructor($){$=$||{},super($),this.file=$.file||"",this[_]=null,this.on(te,z=>{(this[y]==="begin"||this[_]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),$.ondone?this.on(te,$.ondone):this.on(te,z=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!$.strict,this.maxMetaEntrySize=$.maxMetaEntrySize||r,this.filter=typeof $.filter=="function"?$.filter:j;const q=$.file&&($.file.endsWith(".tar.br")||$.file.endsWith(".tbr"));this.brotli=!$.gzip&&$.brotli!==void 0?$.brotli:q?void 0:!1,this.writable=!0,this.readable=!1,this[f]=new n,this[l]=null,this[C]=null,this[p]=null,this[y]="begin",this[v]="",this[A]=null,this[S]=null,this[d]=!1,this[R]=null,this[V]=!1,this[c]=!1,this[g]=!1,this.on("end",()=>this[L]()),typeof $.onwarn=="function"&&this.on("warn",$.onwarn),typeof $.onentry=="function"&&this.on("entry",$.onentry)}[U]($,q){this[_]===null&&(this[_]=!1);let z;try{z=new t($,q,this[A],this[S])}catch(O){return this.warn("TAR_ENTRY_INVALID",O)}if(z.nullBlock)this[c]?(this[g]=!0,this[y]==="begin"&&(this[y]="header"),this[F]("eof")):(this[c]=!0,this[F]("nullBlock"));else if(this[c]=!1,!z.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:z});else if(!z.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:z});else{const O=z.type;if(/^(Symbolic)?Link$/.test(O)&&!z.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:z});else if(!/^(Symbolic)?Link$/.test(O)&&z.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:z});else{const T=this[p]=new a(z,this[A],this[S]);if(!this[_])if(T.remain){const K=()=>{T.invalid||(this[_]=!0)};T.on("end",K)}else this[_]=!0;T.meta?T.size>this.maxMetaEntrySize?(T.ignore=!0,this[F]("ignoredEntry",T),this[y]="ignore",T.resume()):T.size>0&&(this[v]="",T.on("data",K=>this[v]+=K),this[y]="meta"):(this[A]=null,T.ignore=T.ignore||!this.filter(T.path,T),T.ignore?(this[F]("ignoredEntry",T),this[y]=T.remain?"ignore":"header",T.resume()):(T.remain?this[y]="body":(this[y]="header",T.end()),this[C]?this[f].push(T):(this[f].push(T),this[w]())))}}}[L](){h(()=>this.emit("close"))}[b]($){let q=!0;return $?Array.isArray($)?this.emit.apply(this,$):(this[C]=$,this.emit("entry",$),$.emittedEnd||($.on("end",z=>this[w]()),q=!1)):(this[C]=null,q=!1),q}[w](){do;while(this[b](this[f].shift()));if(!this[f].length){const $=this[C];!$||$.flowing||$.size===$.remain?this[W]||this.emit("drain"):$.once("drain",z=>this.emit("drain"))}}[P]($,q){const z=this[p],O=z.blockRemain,T=O>=$.length&&q===0?$:$.slice(q,q+O);return z.write(T),z.blockRemain||(this[y]="header",this[p]=null,z.end()),T.length}[M]($,q){const z=this[p],O=this[P]($,q);return this[p]||this[o](z),O}[F]($,q,z){!this[f].length&&!this[C]?this.emit($,q,z):this[f].push([$,q,z])}[o]($){switch(this[F]("meta",this[v]),$.type){case"ExtendedHeader":case"OldExtendedHeader":this[A]=e.parse(this[v],this[A],!1);break;case"GlobalExtendedHeader":this[S]=e.parse(this[v],this[S],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":this[A]=this[A]||Object.create(null),this[A].path=this[v].replace(/\0.*/,"");break;case"NextFileHasLongLinkpath":this[A]=this[A]||Object.create(null),this[A].linkpath=this[v].replace(/\0.*/,"");break;default:throw new Error("unknown meta: "+$.type)}}abort($){this[V]=!0,this.emit("abort",$),this.warn("TAR_ABORT",$,{recoverable:!1})}write($){if(this[V])return;if((this[R]===null||this.brotli===void 0&&this[R]===!1)&&$){if(this[l]&&($=Buffer.concat([this[l],$]),this[l]=null),$.length<m.length)return this[l]=$,!0;for(let T=0;this[R]===null&&T<m.length;T++)$[T]!==m[T]&&(this[R]=!1);const O=this.brotli===void 0;if(this[R]===!1&&O)if($.length<512)if(this[d])this.brotli=!0;else return this[l]=$,!0;else try{new t($.slice(0,512)),this.brotli=!1}catch{this.brotli=!0}if(this[R]===null||this[R]===!1&&this.brotli){const T=this[d];this[d]=!1,this[R]=this[R]===null?new u.Unzip:new u.BrotliDecompress,this[R].on("data",ae=>this[B](ae)),this[R].on("error",ae=>this.abort(ae)),this[R].on("end",ae=>{this[d]=!0,this[B]()}),this[W]=!0;const K=this[R][T?"end":"write"]($);return this[W]=!1,K}}this[W]=!0,this[R]?this[R].write($):this[B]($),this[W]=!1;const z=this[f].length?!1:this[C]?this[C].flowing:!0;return!z&&!this[f].length&&this[C].once("drain",O=>this.emit("drain")),z}[Y]($){$&&!this[V]&&(this[l]=this[l]?Buffer.concat([this[l],$]):$)}[N](){if(this[d]&&!this[D]&&!this[V]&&!this[G]){this[D]=!0;const $=this[p];if($&&$.blockRemain){const q=this[l]?this[l].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${$.blockRemain} more bytes, only ${q} available)`,{entry:$}),this[l]&&$.write(this[l]),$.end()}this[F](te)}}[B]($){if(this[G])this[Y]($);else if(!$&&!this[l])this[N]();else{if(this[G]=!0,this[l]){this[Y]($);const q=this[l];this[l]=null,this[x](q)}else this[x]($);for(;this[l]&&this[l].length>=512&&!this[V]&&!this[g];){const q=this[l];this[l]=null,this[x](q)}this[G]=!1}(!this[l]||this[d])&&this[N]()}[x]($){let q=0;const z=$.length;for(;q+512<=z&&!this[V]&&!this[g];)switch(this[y]){case"begin":case"header":this[U]($,q),q+=512;break;case"ignore":case"body":q+=this[P]($,q);break;case"meta":q+=this[M]($,q);break;default:throw new Error("invalid state: "+this[y])}q<z&&(this[l]?this[l]=Buffer.concat([$.slice(q),this[l]]):this[l]=$.slice(q))}end($){this[V]||(this[R]?this[R].end($):(this[d]=!0,this.brotli===void 0&&($=$||Buffer.alloc(0)),this.write($)))}}),os}var hs,ir;function ls(){if(ir)return hs;ir=1;const s=Le(),t=as(),i=Ce,n=je(),r=fe,a=ke();hs=(p,C,w)=>{typeof p=="function"?(w=p,C=null,p={}):Array.isArray(p)&&(C=p,p={}),typeof C=="function"&&(w=C,C=null),C?C=Array.from(C):C=[];const b=s(p);if(b.sync&&typeof w=="function")throw new TypeError("callback not supported for sync tar functions");if(!b.file&&typeof w=="function")throw new TypeError("callback only supported with file option");return C.length&&u(b,C),b.noResume||e(b),b.file&&b.sync?h(b):b.file?m(b,w):y(b)};const e=p=>{const C=p.onentry;p.onentry=C?w=>{C(w),w.resume()}:w=>w.resume()},u=(p,C)=>{const w=new Map(C.map(S=>[a(S),!0])),b=p.filter,A=(S,v)=>{const o=v||r.parse(S).root||".",l=S===o?!1:w.has(S)?w.get(S):A(r.dirname(S),o);return w.set(S,l),l};p.filter=b?(S,v)=>b(S,v)&&A(a(S)):S=>A(a(S))},h=p=>{const C=y(p),w=p.file;let b=!0,A;try{const S=i.statSync(w),v=p.maxReadSize||16*1024*1024;if(S.size<v)C.end(i.readFileSync(w));else{let o=0;const l=Buffer.allocUnsafe(v);for(A=i.openSync(w,"r");o<S.size;){const f=i.readSync(A,l,0,v,o);o+=f,C.write(l.slice(0,f))}C.end()}b=!1}finally{if(b&&A)try{i.closeSync(A)}catch{}}},m=(p,C)=>{const w=new t(p),b=p.maxReadSize||16*1024*1024,A=p.file,S=new Promise((v,o)=>{w.on("error",o),w.on("end",v),i.stat(A,(l,f)=>{if(l)o(l);else{const d=new n.ReadStream(A,{readSize:b,size:f.size});d.on("error",o),d.pipe(w)}})});return C?S.then(C,C):S},y=p=>new t(p);return hs}var cs,rr;function Su(){if(rr)return cs;rr=1;const s=Le(),t=us(),i=je(),n=ls(),r=fe;cs=(p,C,w)=>{if(typeof C=="function"&&(w=C),Array.isArray(p)&&(C=p,p={}),!C||!Array.isArray(C)||!C.length)throw new TypeError("no files or directories specified");C=Array.from(C);const b=s(p);if(b.sync&&typeof w=="function")throw new TypeError("callback not supported for sync tar functions");if(!b.file&&typeof w=="function")throw new TypeError("callback only supported with file option");return b.file&&b.sync?a(b,C):b.file?e(b,C,w):b.sync?m(b,C):y(b,C)};const a=(p,C)=>{const w=new t.Sync(p),b=new i.WriteStreamSync(p.file,{mode:p.mode||438});w.pipe(b),u(w,C)},e=(p,C,w)=>{const b=new t(p),A=new i.WriteStream(p.file,{mode:p.mode||438});b.pipe(A);const S=new Promise((v,o)=>{A.on("error",o),A.on("close",v),b.on("error",o)});return h(b,C),w?S.then(w,w):S},u=(p,C)=>{C.forEach(w=>{w.charAt(0)==="@"?n({file:r.resolve(p.cwd,w.slice(1)),sync:!0,noResume:!0,onentry:b=>p.add(b)}):p.add(w)}),p.end()},h=(p,C)=>{for(;C.length;){const w=C.shift();if(w.charAt(0)==="@")return n({file:r.resolve(p.cwd,w.slice(1)),noResume:!0,onentry:b=>p.add(b)}).then(b=>h(p,C));p.add(w)}p.end()},m=(p,C)=>{const w=new t.Sync(p);return u(w,C),w},y=(p,C)=>{const w=new t(p);return h(w,C),w};return cs}var Ds,nr;function ur(){if(nr)return Ds;nr=1;const s=Le(),t=us(),i=Ce,n=je(),r=ls(),a=fe,e=Me();Ds=(C,w,b)=>{const A=s(C);if(!A.file)throw new TypeError("file is required");if(A.gzip||A.brotli||A.file.endsWith(".br")||A.file.endsWith(".tbr"))throw new TypeError("cannot append to compressed archives");if(!w||!Array.isArray(w)||!w.length)throw new TypeError("no files or directories specified");return w=Array.from(w),A.sync?u(A,w):m(A,w,b)};const u=(C,w)=>{const b=new t.Sync(C);let A=!0,S,v;try{try{S=i.openSync(C.file,"r+")}catch(f){if(f.code==="ENOENT")S=i.openSync(C.file,"w+");else throw f}const o=i.fstatSync(S),l=Buffer.alloc(512);e:for(v=0;v<o.size;v+=512){for(let D=0,F=0;D<512;D+=F){if(F=i.readSync(S,l,D,l.length-D,v+D),v===0&&l[0]===31&&l[1]===139)throw new Error("cannot append to compressed archives");if(!F)break e}const f=new e(l);if(!f.cksumValid)break;const d=512*Math.ceil(f.size/512);if(v+d+512>o.size)break;v+=d,C.mtimeCache&&C.mtimeCache.set(f.path,f.mtime)}A=!1,h(C,b,v,S,w)}finally{if(A)try{i.closeSync(S)}catch{}}},h=(C,w,b,A,S)=>{const v=new n.WriteStreamSync(C.file,{fd:A,start:b});w.pipe(v),y(w,S)},m=(C,w,b)=>{w=Array.from(w);const A=new t(C),S=(o,l,f)=>{const d=(x,P)=>{x?i.close(o,M=>f(x)):f(null,P)};let D=0;if(l===0)return d(null,0);let F=0;const R=Buffer.alloc(512),B=(x,P)=>{if(x)return d(x);if(F+=P,F<512&&P)return i.read(o,R,F,R.length-F,D+F,B);if(D===0&&R[0]===31&&R[1]===139)return d(new Error("cannot append to compressed archives"));if(F<512)return d(null,D);const M=new e(R);if(!M.cksumValid)return d(null,D);const U=512*Math.ceil(M.size/512);if(D+U+512>l||(D+=U+512,D>=l))return d(null,D);C.mtimeCache&&C.mtimeCache.set(M.path,M.mtime),F=0,i.read(o,R,0,512,D,B)};i.read(o,R,0,512,D,B)},v=new Promise((o,l)=>{A.on("error",l);let f="r+";const d=(D,F)=>{if(D&&D.code==="ENOENT"&&f==="r+")return f="w+",i.open(C.file,f,d);if(D)return l(D);i.fstat(F,(R,B)=>{if(R)return i.close(F,()=>l(R));S(F,B.size,(x,P)=>{if(x)return l(x);const M=new n.WriteStream(C.file,{fd:F,start:P});A.pipe(M),M.on("error",l),M.on("close",o),p(A,w)})})};i.open(C.file,f,d)});return b?v.then(b,b):v},y=(C,w)=>{w.forEach(b=>{b.charAt(0)==="@"?r({file:a.resolve(C.cwd,b.slice(1)),sync:!0,noResume:!0,onentry:A=>C.add(A)}):C.add(b)}),C.end()},p=(C,w)=>{for(;w.length;){const b=w.shift();if(b.charAt(0)==="@")return r({file:a.resolve(C.cwd,b.slice(1)),noResume:!0,onentry:A=>C.add(A)}).then(A=>p(C,w));C.add(b)}C.end()};return Ds}var fs,or;function Ou(){if(or)return fs;or=1;const s=Le(),t=ur();fs=(n,r,a)=>{const e=s(n);if(!e.file)throw new TypeError("file is required");if(e.gzip||e.brotli||e.file.endsWith(".br")||e.file.endsWith(".tbr"))throw new TypeError("cannot append to compressed archives");if(!r||!Array.isArray(r)||!r.length)throw new TypeError("no files or directories specified");return r=Array.from(r),i(e),t(e,r,a)};const i=n=>{const r=n.filter;n.mtimeCache||(n.mtimeCache=new Map),n.filter=r?(a,e)=>r(a,e)&&!(n.mtimeCache.get(a)>e.mtime):(a,e)=>!(n.mtimeCache.get(a)>e.mtime)};return fs}var rt={exports:{}},ds,ar;function Ru(){if(ar)return ds;ar=1;const{promisify:s}=Wr,t=Ce;return ds=n=>{if(!n)n={mode:511,fs:t};else if(typeof n=="object")n={mode:511,fs:t,...n};else if(typeof n=="number")n={mode:n,fs:t};else if(typeof n=="string")n={mode:parseInt(n,8),fs:t};else throw new TypeError("invalid options argument");return n.mkdir=n.mkdir||n.fs.mkdir||t.mkdir,n.mkdirAsync=s(n.mkdir),n.stat=n.stat||n.fs.stat||t.stat,n.statAsync=s(n.stat),n.statSync=n.statSync||n.fs.statSync||t.statSync,n.mkdirSync=n.mkdirSync||n.fs.mkdirSync||t.mkdirSync,n},ds}var ps,hr;function Bu(){if(hr)return ps;hr=1;const s=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:t,parse:i}=fe;return ps=r=>{if(/\0/.test(r))throw Object.assign(new TypeError("path must be a string without null bytes"),{path:r,code:"ERR_INVALID_ARG_VALUE"});if(r=t(r),s==="win32"){const a=/[*|"<>?:]/,{root:e}=i(r);if(a.test(r.substr(e.length)))throw Object.assign(new Error("Illegal characters in path."),{path:r,code:"EINVAL"})}return r},ps}var ms,lr;function xu(){if(lr)return ms;lr=1;const{dirname:s}=fe,t=(n,r,a=void 0)=>a===r?Promise.resolve():n.statAsync(r).then(e=>e.isDirectory()?a:void 0,e=>e.code==="ENOENT"?t(n,s(r),r):void 0),i=(n,r,a=void 0)=>{if(a!==r)try{return n.statSync(r).isDirectory()?a:void 0}catch(e){return e.code==="ENOENT"?i(n,s(r),r):void 0}};return ms={findMade:t,findMadeSync:i},ms}var Es,cr;function Dr(){if(cr)return Es;cr=1;const{dirname:s}=fe,t=(n,r,a)=>{r.recursive=!1;const e=s(n);return e===n?r.mkdirAsync(n,r).catch(u=>{if(u.code!=="EISDIR")throw u}):r.mkdirAsync(n,r).then(()=>a||n,u=>{if(u.code==="ENOENT")return t(e,r).then(h=>t(n,r,h));if(u.code!=="EEXIST"&&u.code!=="EROFS")throw u;return r.statAsync(n).then(h=>{if(h.isDirectory())return a;throw u},()=>{throw u})})},i=(n,r,a)=>{const e=s(n);if(r.recursive=!1,e===n)try{return r.mkdirSync(n,r)}catch(u){if(u.code!=="EISDIR")throw u;return}try{return r.mkdirSync(n,r),a||n}catch(u){if(u.code==="ENOENT")return i(n,r,i(e,r,a));if(u.code!=="EEXIST"&&u.code!=="EROFS")throw u;try{if(!r.statSync(n).isDirectory())throw u}catch{throw u}}};return Es={mkdirpManual:t,mkdirpManualSync:i},Es}var gs,fr;function Tu(){if(fr)return gs;fr=1;const{dirname:s}=fe,{findMade:t,findMadeSync:i}=xu(),{mkdirpManual:n,mkdirpManualSync:r}=Dr();return gs={mkdirpNative:(u,h)=>(h.recursive=!0,s(u)===u?h.mkdirAsync(u,h):t(h,u).then(y=>h.mkdirAsync(u,h).then(()=>y).catch(p=>{if(p.code==="ENOENT")return n(u,h);throw p}))),mkdirpNativeSync:(u,h)=>{if(h.recursive=!0,s(u)===u)return h.mkdirSync(u,h);const y=i(h,u);try{return h.mkdirSync(u,h),y}catch(p){if(p.code==="ENOENT")return r(u,h);throw p}}},gs}var Cs,dr;function $u(){if(dr)return Cs;dr=1;const s=Ce,i=(process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version).replace(/^v/,"").split("."),n=+i[0]>10||+i[0]==10&&+i[1]>=12;return Cs={useNative:n?e=>e.mkdir===s.mkdir:()=>!1,useNativeSync:n?e=>e.mkdirSync===s.mkdirSync:()=>!1},Cs}var Fs,pr;function Nu(){if(pr)return Fs;pr=1;const s=Ru(),t=Bu(),{mkdirpNative:i,mkdirpNativeSync:n}=Tu(),{mkdirpManual:r,mkdirpManualSync:a}=Dr(),{useNative:e,useNativeSync:u}=$u(),h=(y,p)=>(y=t(y),p=s(p),e(p)?i(y,p):r(y,p)),m=(y,p)=>(y=t(y),p=s(p),u(p)?n(y,p):a(y,p));return h.sync=m,h.native=(y,p)=>i(t(y),s(p)),h.manual=(y,p)=>r(t(y),s(p)),h.nativeSync=(y,p)=>n(t(y),s(p)),h.manualSync=(y,p)=>a(t(y),s(p)),Fs=h,Fs}var ys,mr;function Iu(){if(mr)return ys;mr=1;const s=Ce,t=fe,i=s.lchown?"lchown":"chown",n=s.lchownSync?"lchownSync":"chownSync",r=s.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/),a=(v,o,l)=>{try{return s[n](v,o,l)}catch(f){if(f.code!=="ENOENT")throw f}},e=(v,o,l)=>{try{return s.chownSync(v,o,l)}catch(f){if(f.code!=="ENOENT")throw f}},u=r?(v,o,l,f)=>d=>{!d||d.code!=="EISDIR"?f(d):s.chown(v,o,l,f)}:(v,o,l,f)=>f,h=r?(v,o,l)=>{try{return a(v,o,l)}catch(f){if(f.code!=="EISDIR")throw f;e(v,o,l)}}:(v,o,l)=>a(v,o,l),m=process.version;let y=(v,o,l)=>s.readdir(v,o,l),p=(v,o)=>s.readdirSync(v,o);/^v4\./.test(m)&&(y=(v,o,l)=>s.readdir(v,l));const C=(v,o,l,f)=>{s[i](v,o,l,u(v,o,l,d=>{f(d&&d.code!=="ENOENT"?d:null)}))},w=(v,o,l,f,d)=>{if(typeof o=="string")return s.lstat(t.resolve(v,o),(D,F)=>{if(D)return d(D.code!=="ENOENT"?D:null);F.name=o,w(v,F,l,f,d)});if(o.isDirectory())b(t.resolve(v,o.name),l,f,D=>{if(D)return d(D);const F=t.resolve(v,o.name);C(F,l,f,d)});else{const D=t.resolve(v,o.name);C(D,l,f,d)}},b=(v,o,l,f)=>{y(v,{withFileTypes:!0},(d,D)=>{if(d){if(d.code==="ENOENT")return f();if(d.code!=="ENOTDIR"&&d.code!=="ENOTSUP")return f(d)}if(d||!D.length)return C(v,o,l,f);let F=D.length,R=null;const B=x=>{if(!R){if(x)return f(R=x);if(--F===0)return C(v,o,l,f)}};D.forEach(x=>w(v,x,o,l,B))})},A=(v,o,l,f)=>{if(typeof o=="string")try{const d=s.lstatSync(t.resolve(v,o));d.name=o,o=d}catch(d){if(d.code==="ENOENT")return;throw d}o.isDirectory()&&S(t.resolve(v,o.name),l,f),h(t.resolve(v,o.name),l,f)},S=(v,o,l)=>{let f;try{f=p(v,{withFileTypes:!0})}catch(d){if(d.code==="ENOENT")return;if(d.code==="ENOTDIR"||d.code==="ENOTSUP")return h(v,o,l);throw d}return f&&f.length&&f.forEach(d=>A(v,d,o,l)),h(v,o,l)};return ys=b,b.sync=S,ys}var Er;function Lu(){if(Er)return rt.exports;Er=1;const s=Nu(),t=Ce,i=fe,n=Iu(),r=Pe();class a extends Error{constructor(b,A){super("Cannot extract through symbolic link"),this.path=A,this.symlink=b}get name(){return"SylinkError"}}class e extends Error{constructor(b,A){super(A+": Cannot cd into '"+b+"'"),this.path=b,this.code=A}get name(){return"CwdError"}}const u=(w,b)=>w.get(r(b)),h=(w,b,A)=>w.set(r(b),A),m=(w,b)=>{t.stat(w,(A,S)=>{(A||!S.isDirectory())&&(A=new e(w,A&&A.code||"ENOTDIR")),b(A)})};rt.exports=(w,b,A)=>{w=r(w);const S=b.umask,v=b.mode|448,o=(v&S)!==0,l=b.uid,f=b.gid,d=typeof l=="number"&&typeof f=="number"&&(l!==b.processUid||f!==b.processGid),D=b.preserve,F=b.unlink,R=b.cache,B=r(b.cwd),x=(U,G)=>{U?A(U):(h(R,w,!0),G&&d?n(G,l,f,Y=>x(Y)):o?t.chmod(w,v,A):A())};if(R&&u(R,w)===!0)return x();if(w===B)return m(w,x);if(D)return s(w,{mode:v}).then(U=>x(null,U),x);const M=r(i.relative(B,w)).split("/");y(B,M,v,R,F,B,null,x)};const y=(w,b,A,S,v,o,l,f)=>{if(!b.length)return f(null,l);const d=b.shift(),D=r(i.resolve(w+"/"+d));if(u(S,D))return y(D,b,A,S,v,o,l,f);t.mkdir(D,A,p(D,b,A,S,v,o,l,f))},p=(w,b,A,S,v,o,l,f)=>d=>{d?t.lstat(w,(D,F)=>{if(D)D.path=D.path&&r(D.path),f(D);else if(F.isDirectory())y(w,b,A,S,v,o,l,f);else if(v)t.unlink(w,R=>{if(R)return f(R);t.mkdir(w,A,p(w,b,A,S,v,o,l,f))});else{if(F.isSymbolicLink())return f(new a(w,w+"/"+b.join("/")));f(d)}}):(l=l||w,y(w,b,A,S,v,o,l,f))},C=w=>{let b=!1,A="ENOTDIR";try{b=t.statSync(w).isDirectory()}catch(S){A=S.code}finally{if(!b)throw new e(w,A)}};return rt.exports.sync=(w,b)=>{w=r(w);const A=b.umask,S=b.mode|448,v=(S&A)!==0,o=b.uid,l=b.gid,f=typeof o=="number"&&typeof l=="number"&&(o!==b.processUid||l!==b.processGid),d=b.preserve,D=b.unlink,F=b.cache,R=r(b.cwd),B=U=>{h(F,w,!0),U&&f&&n.sync(U,o,l),v&&t.chmodSync(w,S)};if(F&&u(F,w)===!0)return B();if(w===R)return C(R),B();if(d)return B(s.sync(w,S));const P=r(i.relative(R,w)).split("/");let M=null;for(let U=P.shift(),G=R;U&&(G+="/"+U);U=P.shift())if(G=r(i.resolve(G)),!u(F,G))try{t.mkdirSync(G,S),M=M||G,h(F,G,!0)}catch{const N=t.lstatSync(G);if(N.isDirectory()){h(F,G,!0);continue}else if(D){t.unlinkSync(G),t.mkdirSync(G,S),M=M||G,h(F,G,!0);continue}else if(N.isSymbolicLink())return new a(G,G+"/"+P.join("/"))}return B(M)},rt.exports}var bs,gr;function Cr(){if(gr)return bs;gr=1;const s=Object.create(null),{hasOwnProperty:t}=Object.prototype;return bs=i=>(t.call(s,i)||(s[i]=i.normalize("NFD")),s[i]),bs}var ws,Fr;function Pu(){if(Fr)return ws;Fr=1;const s=ct,t=Cr(),i=ke(),{join:n}=fe,a=(process.env.TESTING_TAR_FAKE_PLATFORM||process.platform)==="win32";return ws=()=>{const e=new Map,u=new Map,h=A=>A.split("/").slice(0,-1).reduce((v,o)=>(v.length&&(o=n(v[v.length-1],o)),v.push(o||"/"),v),[]),m=new Set,y=A=>{const S=u.get(A);if(!S)throw new Error("function does not have any path reservations");return{paths:S.paths.map(v=>e.get(v)),dirs:[...S.dirs].map(v=>e.get(v))}},p=A=>{const{paths:S,dirs:v}=y(A);return S.every(o=>o[0]===A)&&v.every(o=>o[0]instanceof Set&&o[0].has(A))},C=A=>m.has(A)||!p(A)?!1:(m.add(A),A(()=>w(A)),!0),w=A=>{if(!m.has(A))return!1;const{paths:S,dirs:v}=u.get(A),o=new Set;return S.forEach(l=>{const f=e.get(l);s.equal(f[0],A),f.length===1?e.delete(l):(f.shift(),typeof f[0]=="function"?o.add(f[0]):f[0].forEach(d=>o.add(d)))}),v.forEach(l=>{const f=e.get(l);s(f[0]instanceof Set),f[0].size===1&&f.length===1?e.delete(l):f[0].size===1?(f.shift(),o.add(f[0])):f[0].delete(A)}),m.delete(A),o.forEach(l=>C(l)),!0};return{check:p,reserve:(A,S)=>{A=a?["win32 parallelization disabled"]:A.map(o=>i(n(t(o))).toLowerCase());const v=new Set(A.map(o=>h(o)).reduce((o,l)=>o.concat(l)));return u.set(S,{dirs:v,paths:A}),A.forEach(o=>{const l=e.get(o);l?l.push(S):e.set(o,[S])}),v.forEach(o=>{const l=e.get(o);l?l[l.length-1]instanceof Set?l[l.length-1].add(S):l.push(new Set([S])):e.set(o,[new Set([S])])}),C(S)}}},ws}var _s,yr;function Mu(){if(yr)return _s;yr=1;const t=(process.env.__FAKE_PLATFORM__||process.platform)==="win32",i=Dt.__FAKE_TESTING_FS__||Ce,{O_CREAT:n,O_TRUNC:r,O_WRONLY:a,UV_FS_O_FILEMAP:e=0}=i.constants,u=t&&!!e,h=512*1024,m=e|r|n|a;return _s=u?y=>y<h?m:"w":()=>"w",_s}var vs,br;function wr(){if(br)return vs;br=1;const s=ct,t=as(),i=Ce,n=je(),r=fe,a=Lu(),e=qi(),u=Pu(),h=Vi(),m=Pe(),y=ke(),p=Cr(),C=Symbol("onEntry"),w=Symbol("checkFs"),b=Symbol("checkFs2"),A=Symbol("pruneCache"),S=Symbol("isReusable"),v=Symbol("makeFs"),o=Symbol("file"),l=Symbol("directory"),f=Symbol("link"),d=Symbol("symlink"),D=Symbol("hardlink"),F=Symbol("unsupported"),R=Symbol("checkPath"),B=Symbol("mkdir"),x=Symbol("onError"),P=Symbol("pending"),M=Symbol("pend"),U=Symbol("unpend"),G=Symbol("ended"),Y=Symbol("maybeClose"),N=Symbol("skip"),W=Symbol("doChown"),V=Symbol("uid"),te=Symbol("gid"),_=Symbol("checkedCwd"),c=Vr,g=Mu(),j=(process.env.TESTING_TAR_FAKE_PLATFORM||process.platform)==="win32",J=1024,$=(se,E)=>{if(!j)return i.unlink(se,E);const k=se+".DELETE."+c.randomBytes(16).toString("hex");i.rename(se,k,H=>{if(H)return E(H);i.unlink(k,E)})},q=se=>{if(!j)return i.unlinkSync(se);const E=se+".DELETE."+c.randomBytes(16).toString("hex");i.renameSync(se,E),i.unlinkSync(E)},z=(se,E,k)=>se===se>>>0?se:E===E>>>0?E:k,O=se=>y(m(p(se))).toLowerCase(),T=(se,E)=>{E=O(E);for(const k of se.keys()){const H=O(k);(H===E||H.indexOf(E+"/")===0)&&se.delete(k)}},K=se=>{for(const E of se.keys())se.delete(E)};class ae extends t{constructor(E){if(E||(E={}),E.ondone=k=>{this[G]=!0,this[Y]()},super(E),this[_]=!1,this.reservations=u(),this.transform=typeof E.transform=="function"?E.transform:null,this.writable=!0,this.readable=!1,this[P]=0,this[G]=!1,this.dirCache=E.dirCache||new Map,typeof E.uid=="number"||typeof E.gid=="number"){if(typeof E.uid!="number"||typeof E.gid!="number")throw new TypeError("cannot set owner without number uid and gid");if(E.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=E.uid,this.gid=E.gid,this.setOwner=!0}else this.uid=null,this.gid=null,this.setOwner=!1;E.preserveOwner===void 0&&typeof E.uid!="number"?this.preserveOwner=process.getuid&&process.getuid()===0:this.preserveOwner=!!E.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():null,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():null,this.maxDepth=typeof E.maxDepth=="number"?E.maxDepth:J,this.forceChown=E.forceChown===!0,this.win32=!!E.win32||j,this.newer=!!E.newer,this.keep=!!E.keep,this.noMtime=!!E.noMtime,this.preservePaths=!!E.preservePaths,this.unlink=!!E.unlink,this.cwd=m(r.resolve(E.cwd||process.cwd())),this.strip=+E.strip||0,this.processUmask=E.noChmod?0:process.umask(),this.umask=typeof E.umask=="number"?E.umask:this.processUmask,this.dmode=E.dmode||511&~this.umask,this.fmode=E.fmode||438&~this.umask,this.on("entry",k=>this[C](k))}warn(E,k,H={}){return(E==="TAR_BAD_ARCHIVE"||E==="TAR_ABORT")&&(H.recoverable=!1),super.warn(E,k,H)}[Y](){this[G]&&this[P]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[R](E){const k=m(E.path),H=k.split("/");if(this.strip){if(H.length<this.strip)return!1;if(E.type==="Link"){const Z=m(E.linkpath).split("/");if(Z.length>=this.strip)E.linkpath=Z.slice(this.strip).join("/");else return!1}H.splice(0,this.strip),E.path=H.join("/")}if(isFinite(this.maxDepth)&&H.length>this.maxDepth)return this.warn("TAR_ENTRY_ERROR","path excessively deep",{entry:E,path:k,depth:H.length,maxDepth:this.maxDepth}),!1;if(!this.preservePaths){if(H.includes("..")||j&&/^[a-z]:\.\.$/i.test(H[0]))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:E,path:k}),!1;const[Z,X]=h(k);Z&&(E.path=X,this.warn("TAR_ENTRY_INFO",`stripping ${Z} from absolute path`,{entry:E,path:k}))}if(r.isAbsolute(E.path)?E.absolute=m(r.resolve(E.path)):E.absolute=m(r.resolve(this.cwd,E.path)),!this.preservePaths&&E.absolute.indexOf(this.cwd+"/")!==0&&E.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:E,path:m(E.path),resolvedPath:E.absolute,cwd:this.cwd}),!1;if(E.absolute===this.cwd&&E.type!=="Directory"&&E.type!=="GNUDumpDir")return!1;if(this.win32){const{root:Z}=r.win32.parse(E.absolute);E.absolute=Z+e.encode(E.absolute.slice(Z.length));const{root:X}=r.win32.parse(E.path);E.path=X+e.encode(E.path.slice(X.length))}return!0}[C](E){if(!this[R](E))return E.resume();switch(s.equal(typeof E.absolute,"string"),E.type){case"Directory":case"GNUDumpDir":E.mode&&(E.mode=E.mode|448);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[w](E);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[F](E)}}[x](E,k){E.name==="CwdError"?this.emit("error",E):(this.warn("TAR_ENTRY_ERROR",E,{entry:k}),this[U](),k.resume())}[B](E,k,H){a(m(E),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:k,noChmod:this.noChmod},H)}[W](E){return this.forceChown||this.preserveOwner&&(typeof E.uid=="number"&&E.uid!==this.processUid||typeof E.gid=="number"&&E.gid!==this.processGid)||typeof this.uid=="number"&&this.uid!==this.processUid||typeof this.gid=="number"&&this.gid!==this.processGid}[V](E){return z(this.uid,E.uid,this.processUid)}[te](E){return z(this.gid,E.gid,this.processGid)}[o](E,k){const H=E.mode&4095||this.fmode,Z=new n.WriteStream(E.absolute,{flags:g(E.size),mode:H,autoClose:!1});Z.on("error",re=>{Z.fd&&i.close(Z.fd,()=>{}),Z.write=()=>!0,this[x](re,E),k()});let X=1;const oe=re=>{if(re){Z.fd&&i.close(Z.fd,()=>{}),this[x](re,E),k();return}--X===0&&i.close(Z.fd,le=>{le?this[x](le,E):this[U](),k()})};Z.on("finish",re=>{const le=E.absolute,ye=Z.fd;if(E.mtime&&!this.noMtime){X++;const be=E.atime||new Date,Ae=E.mtime;i.futimes(ye,be,Ae,xe=>xe?i.utimes(le,be,Ae,ot=>oe(ot&&xe)):oe())}if(this[W](E)){X++;const be=this[V](E),Ae=this[te](E);i.fchown(ye,be,Ae,xe=>xe?i.chown(le,be,Ae,ot=>oe(ot&&xe)):oe())}oe()});const ie=this.transform&&this.transform(E)||E;ie!==E&&(ie.on("error",re=>{this[x](re,E),k()}),E.pipe(ie)),ie.pipe(Z)}[l](E,k){const H=E.mode&4095||this.dmode;this[B](E.absolute,H,Z=>{if(Z){this[x](Z,E),k();return}let X=1;const oe=ie=>{--X===0&&(k(),this[U](),E.resume())};E.mtime&&!this.noMtime&&(X++,i.utimes(E.absolute,E.atime||new Date,E.mtime,oe)),this[W](E)&&(X++,i.chown(E.absolute,this[V](E),this[te](E),oe)),oe()})}[F](E){E.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${E.type}`,{entry:E}),E.resume()}[d](E,k){this[f](E,E.linkpath,"symlink",k)}[D](E,k){const H=m(r.resolve(this.cwd,E.linkpath));this[f](E,H,"link",k)}[M](){this[P]++}[U](){this[P]--,this[Y]()}[N](E){this[U](),E.resume()}[S](E,k){return E.type==="File"&&!this.unlink&&k.isFile()&&k.nlink<=1&&!j}[w](E){this[M]();const k=[E.path];E.linkpath&&k.push(E.linkpath),this.reservations.reserve(k,H=>this[b](E,H))}[A](E){E.type==="SymbolicLink"?K(this.dirCache):E.type!=="Directory"&&T(this.dirCache,E.absolute)}[b](E,k){this[A](E);const H=ie=>{this[A](E),k(ie)},Z=()=>{this[B](this.cwd,this.dmode,ie=>{if(ie){this[x](ie,E),H();return}this[_]=!0,X()})},X=()=>{if(E.absolute!==this.cwd){const ie=m(r.dirname(E.absolute));if(ie!==this.cwd)return this[B](ie,this.dmode,re=>{if(re){this[x](re,E),H();return}oe()})}oe()},oe=()=>{i.lstat(E.absolute,(ie,re)=>{if(re&&(this.keep||this.newer&&re.mtime>E.mtime)){this[N](E),H();return}if(ie||this[S](E,re))return this[v](null,E,H);if(re.isDirectory()){if(E.type==="Directory"){const le=!this.noChmod&&E.mode&&(re.mode&4095)!==E.mode,ye=be=>this[v](be,E,H);return le?i.chmod(E.absolute,E.mode,ye):ye()}if(E.absolute!==this.cwd)return i.rmdir(E.absolute,le=>this[v](le,E,H))}if(E.absolute===this.cwd)return this[v](null,E,H);$(E.absolute,le=>this[v](le,E,H))})};this[_]?X():Z()}[v](E,k,H){if(E){this[x](E,k),H();return}switch(k.type){case"File":case"OldFile":case"ContiguousFile":return this[o](k,H);case"Link":return this[D](k,H);case"SymbolicLink":return this[d](k,H);case"Directory":case"GNUDumpDir":return this[l](k,H)}}[f](E,k,H,Z){i[H](k,E.absolute,X=>{X?this[x](X,E):(this[U](),E.resume()),Z()})}}const De=se=>{try{return[null,se()]}catch(E){return[E,null]}};class qe extends ae{[v](E,k){return super[v](E,k,()=>{})}[w](E){if(this[A](E),!this[_]){const X=this[B](this.cwd,this.dmode);if(X)return this[x](X,E);this[_]=!0}if(E.absolute!==this.cwd){const X=m(r.dirname(E.absolute));if(X!==this.cwd){const oe=this[B](X,this.dmode);if(oe)return this[x](oe,E)}}const[k,H]=De(()=>i.lstatSync(E.absolute));if(H&&(this.keep||this.newer&&H.mtime>E.mtime))return this[N](E);if(k||this[S](E,H))return this[v](null,E);if(H.isDirectory()){if(E.type==="Directory"){const oe=!this.noChmod&&E.mode&&(H.mode&4095)!==E.mode,[ie]=oe?De(()=>{i.chmodSync(E.absolute,E.mode)}):[];return this[v](ie,E)}const[X]=De(()=>i.rmdirSync(E.absolute));this[v](X,E)}const[Z]=E.absolute===this.cwd?[]:De(()=>q(E.absolute));this[v](Z,E)}[o](E,k){const H=E.mode&4095||this.fmode,Z=ie=>{let re;try{i.closeSync(X)}catch(le){re=le}(ie||re)&&this[x](ie||re,E),k()};let X;try{X=i.openSync(E.absolute,g(E.size),H)}catch(ie){return Z(ie)}const oe=this.transform&&this.transform(E)||E;oe!==E&&(oe.on("error",ie=>this[x](ie,E)),E.pipe(oe)),oe.on("data",ie=>{try{i.writeSync(X,ie,0,ie.length)}catch(re){Z(re)}}),oe.on("end",ie=>{let re=null;if(E.mtime&&!this.noMtime){const le=E.atime||new Date,ye=E.mtime;try{i.futimesSync(X,le,ye)}catch(be){try{i.utimesSync(E.absolute,le,ye)}catch{re=be}}}if(this[W](E)){const le=this[V](E),ye=this[te](E);try{i.fchownSync(X,le,ye)}catch(be){try{i.chownSync(E.absolute,le,ye)}catch{re=re||be}}}Z(re)})}[l](E,k){const H=E.mode&4095||this.dmode,Z=this[B](E.absolute,H);if(Z){this[x](Z,E),k();return}if(E.mtime&&!this.noMtime)try{i.utimesSync(E.absolute,E.atime||new Date,E.mtime)}catch{}if(this[W](E))try{i.chownSync(E.absolute,this[V](E),this[te](E))}catch{}k(),E.resume()}[B](E,k){try{return a.sync(m(E),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:k})}catch(H){return H}}[f](E,k,H,Z){try{i[H+"Sync"](k,E.absolute),Z(),E.resume()}catch(X){return this[x](X,E)}}}return ae.Sync=qe,vs=ae,vs}var As,_r;function ku(){if(_r)return As;_r=1;const s=Le(),t=wr(),i=Ce,n=je(),r=fe,a=ke();As=(p,C,w)=>{typeof p=="function"?(w=p,C=null,p={}):Array.isArray(p)&&(C=p,p={}),typeof C=="function"&&(w=C,C=null),C?C=Array.from(C):C=[];const b=s(p);if(b.sync&&typeof w=="function")throw new TypeError("callback not supported for sync tar functions");if(!b.file&&typeof w=="function")throw new TypeError("callback only supported with file option");return C.length&&e(b,C),b.file&&b.sync?u(b):b.file?h(b,w):b.sync?m(b):y(b)};const e=(p,C)=>{const w=new Map(C.map(S=>[a(S),!0])),b=p.filter,A=(S,v)=>{const o=v||r.parse(S).root||".",l=S===o?!1:w.has(S)?w.get(S):A(r.dirname(S),o);return w.set(S,l),l};p.filter=b?(S,v)=>b(S,v)&&A(a(S)):S=>A(a(S))},u=p=>{const C=new t.Sync(p),w=p.file,b=i.statSync(w),A=p.maxReadSize||16*1024*1024;new n.ReadStreamSync(w,{readSize:A,size:b.size}).pipe(C)},h=(p,C)=>{const w=new t(p),b=p.maxReadSize||16*1024*1024,A=p.file,S=new Promise((v,o)=>{w.on("error",o),w.on("close",v),i.stat(A,(l,f)=>{if(l)o(l);else{const d=new n.ReadStream(A,{readSize:b,size:f.size});d.on("error",o),d.pipe(w)}})});return C?S.then(C,C):S},m=p=>new t.Sync(p),y=p=>new t(p);return As}var vr;function ju(){return vr||(vr=1,he.c=he.create=Su(),he.r=he.replace=ur(),he.t=he.list=ls(),he.u=he.update=Ou(),he.x=he.extract=ku(),he.Pack=us(),he.Unpack=wr(),he.Parse=as(),he.ReadEntry=Gt(),he.WriteEntry=Zi(),he.Header=Me(),he.Pax=Yt(),he.types=Mi()),he}var Hu=ju();class Uu extends Error{}class Ar extends Error{}class zu extends Error{}class Gu extends Error{}const Sr=async(s,t)=>{const i=new URL(s),n=de.basename(i.pathname);return{name:n,version:void 0,subdir:void 0,url:i.href,tar:i.href,defaultDir:n,headers:t.auth?{Authorization:`Bearer ${t.auth}`}:void 0}},Or=async(s,t)=>{const i=nt(s),n=await Ss(i,t,async()=>(await(await He(`https://api.github.com/repos/${i.repo}`)).json())?.default_branch);return{name:i.repo.replace("/","-"),version:n,subdir:i.subdir,headers:{...t.auth?{Authorization:`Bearer ${t.auth}`}:{},Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"},url:`https://github.com/${i.repo}/tree/${n}${i.subdir}`,tar:`https://api.github.com/repos/${i.repo}/tarball/${n}`}},qu=async(s,t)=>{const i=nt(s),n=await Ss(i,t,async()=>(await(await He(`https://gitlab.com/api/v4/projects/${encodeURIComponent(i.repo)}`)).json())?.default_branch);return{name:i.repo.replace("/","-"),version:n,subdir:i.subdir,headers:{...t.auth?{Authorization:`Bearer ${t.auth}`}:{},"sec-fetch-mode":"same-origin"},url:`https://gitlab.com/${i.repo}/tree/${n}${i.subdir}`,tar:`https://gitlab.com/${i.repo}/-/archive/${n}.tar.gz`}},Wu=async(s,t)=>{const i=nt(s),n=await Ss(i,t,async()=>(await(await He(`https://api.bitbucket.org/2.0/repositories/${i.repo}`)).json())?.mainbranch?.name);return{name:i.repo.replace("/","-"),version:n,subdir:i.subdir,headers:t.auth?{Authorization:`Bearer ${t.auth}`}:{},url:`https://bitbucket.com/${i.repo}/src/${n}${i.subdir}`,tar:`https://bitbucket.org/${i.repo}/get/${n}.tar.gz`}},Vu=(s,t)=>{const i=nt(s),n=i.ref||"main";return{name:i.repo.replace("/","-"),version:n,subdir:i.subdir,headers:t.auth?{Authorization:`Bearer ${t.auth}`}:{},url:`https://git.sr.ht/~${i.repo}/tree/${n}/item${i.subdir}`,tar:`https://git.sr.ht/~${i.repo}/archive/${n}.tar.gz`}},Ku={http:Sr,https:Sr,github:Or,gh:Or,gitlab:qu,bitbucket:Wu,sourcehut:Vu};async function Ss(s,t,i){if(s.ref)return s.ref;if(t.offline!==!0)try{const n=await i();if(n)return n}catch(n){Os(`Failed to fetch ref for ${s.repo}`,n)}return"main"}const Yu=/^([\w-.]+):/;function Zu(s,t,i){t||="github";let n=s;const r=s.match(Yu);r&&(t=r[1],t!=="http"&&t!=="https"&&(n=s.slice(r[0].length)));const a=i?.[t]||Ku[t];return{source:n,providerName:t,provider:a}}async function Xu(s,t,i={}){const n=t+".json",r=JSON.parse(await Oe.readFile(n,"utf8").catch(()=>"{}")),e=(await He(s,{...i,method:"HEAD"}).catch(()=>{}))?.headers.get("etag");if(r.etag===e&&Se.existsSync(t))return;typeof e=="string"&&(r.etag=e);const u=await He(s,{headers:i.headers});if(u.status>=400)throw new Ar(`Failed to download ${s}: ${u.status} ${u.statusText}`);if(u.body==null)throw new Ar(`Failed to download ${s}: empty response body`);await Oe.mkdir(de.dirname(t),{recursive:!0});const h=Se.createWriteStream(t);await $r(Gr)(u.body,h),await Oe.writeFile(n,JSON.stringify(r),"utf8")}const Ju=/^(?<repo>[\w\-.]+\/[\w\-.]+)(?<subdir>[^#]+)?(?<ref>#[\w\-./@]+)?/;function nt(s){const t=s.match(Ju)?.groups||{};return{repo:t.repo,subdir:t.subdir||"/",ref:t.ref?.slice(1)}}function Os(...s){process.env.DEBUG&&console.debug("[giget]",...s)}async function He(s,t={}){t.headers?.["sec-fetch-mode"]&&(t.mode=t.headers["sec-fetch-mode"]);const i=await fetch(s,t).catch(n=>{throw new Error(`Failed to fetch ${s}`,{cause:n})});if(t.validateStatus&&i.status>=400)throw new Error(`Failed to fetch ${s}: ${i.status} ${i.statusText}`);return i}function Qu(){return process.env.XDG_CACHE_HOME?de.resolve(process.env.XDG_CACHE_HOME,"bluwy-giget"):de.resolve(zr.homedir(),".cache/bluwy-giget")}async function eo(s,t,i){i==="/"&&(i=void 0),i&&(i.startsWith("/")&&(i=i.slice(1)),i.endsWith("/")||(i+="/"));let n=!1;if(await Oe.mkdir(t,{recursive:!0}),await Hu.extract({file:s,cwd:t,onentry(r){r.path=r.path.split("/").splice(1).join("/"),i&&(r.path.startsWith(i)?(r.path=r.path.slice(i.length-1),n=!0):r.path="")}}),i&&!n)throw await Oe.rm(t,{recursive:!0,force:!0}),new zu(`Subdirectory not found in tar: ${i}`)}async function to(s,t={}){const{source:i,providerName:n,provider:r}=Zu(s,t.provider,t.providers);if(!r)throw new Uu(`Unsupported provider: ${n}`);const a={...t.providerOptions,offline:t.offline},e=await Promise.resolve().then(()=>r(i,a)).catch(p=>{throw new Error(`The ${n} provider failed with errors`,{cause:p})});e.name=(e.name||"template").replace(/[^\da-z-]/gi,"-"),e.defaultDir=(e.defaultDir||e.name).replace(/[^\da-z-]/gi,"-");const u=de.resolve(Qu(),n,e.name),h=de.resolve(u,(e.version||e.name)+".tar.gz");if((t.offline==="prefer"?!Se.existsSync(h):!t.offline)&&(await Xu(e.tar,h,{headers:e.headers}).catch(p=>{if(!Se.existsSync(h))throw p;Os("Download error. Using cached version:",p)}),Os(`Downloaded ${e.tar} to ${h}`)),!Se.existsSync(h))throw new Error(`Tarball not found: ${h} (offline: ${t.offline})`);const m=de.resolve(t.cwd||"."),y=de.resolve(m,t.dir||e.defaultDir);if(t.force==="clean")await Oe.rm(y,{recursive:!0,force:!0});else if(!t.force&&Se.existsSync(y)&&Se.readdirSync(y).length>0)throw new Gu(`Destination ${y} already exists.`);return await eo(h,y,e.subdir),{info:e,source:i,dir:y}}async function Ue({template:s,project:t}){await to(`wrtnlabs/agentica.template.${s}`,{provider:"github",dir:t}),await Lr(we(t,".github"),{force:!0,recursive:!0})}async function ze({projectPath:s,dotEnvfileName:t,apiKeys:i}){if(!at(s))throw new Error(`${s} directory does not exist.`);const n=we(s,t??".env"),r=(at(n)?`
91
+ `:"")+i.map(({key:a,value:e})=>`${a}=${e}`).join(`
92
+ `);await Pr(n,r)}function so({packageManager:s,pkg:t}){switch(s){case"npm":return`npm install ${t??""}`.trim();case"yarn":return t!=null?`yarn add ${t}`:"yarn";case"pnpm":return`pnpm install ${t??""}`.trim();case"bun":return`bun install ${t??""}`.trim();default:throw new Error(`Unsupported package manager: ${s}`)}}function io({packageManager:s,command:t}){switch(s){case"npm":return`npm run ${t}`.trim();case"yarn":return`yarn ${t}`.trim();case"pnpm":return`pnpm ${t}`.trim();case"bun":return`bun ${t}`.trim();default:throw new Error(`Unsupported package manager: ${s}`)}}function ro(){const s=Q.env.npm_config_user_agent;switch(!0){case s?.startsWith("npm"):return"npm";case s?.startsWith("yarn"):return"yarn";case s?.startsWith("pnpm"):return"pnpm";case s?.startsWith("bun"):return"bun";default:return"npm"}}const no=["nodejs","nestjs","react","react-native","standalone","nestjs+react","nodejs+react"];async function Ge({packageManager:s,projectAbsolutePath:t,services:i}){const n=i.length>0?[...i.map(u=>Cu(u))].join(" "):void 0,[r,...a]=so({packageManager:s,pkg:n}).split(" "),e=ai();e.start("\u{1F4E6} Package installation in progress...");try{await xt(r,a,{cwd:t})}catch(u){throw u instanceof Re&&(ce.error(`\u274C Package installation failed: ${u.output}`),Q.exit(1)),u}e.stop("\u2705 Package installation completed")}async function Rs({packageManager:s,projectAbsolutePath:t}){const[i,...n]=io({packageManager:s,command:"prepare"}).split(" "),r=ai();r.start("\u{1F4E6} Package installation in progress...");try{await xt(i,n,{cwd:t})}catch(a){throw a instanceof Re&&(ce.error(`\u274C Package installation failed: ${a.output}`),Q.exit(1)),a}r.stop("\u2705 Package installation completed")}async function uo({template:s}){const t={template:s,services:[]};{const i=await Qe({message:"Enter the project directory path:",placeholder:"./my-agentica-project",validate(r){if(r==="")return"Please enter a directory path";if(r[0]!==".")return"Please enter a relative path.";if(at(r))return"Directory already exists"}});_e(i)&&Q.exit(0);const n=we(Q.cwd(),i);t.projectAbsolutePath=n}{const i=await ni({message:"Which package manager do you want to use?",initialValue:ro(),options:[{value:"npm",label:"npm"},{value:"pnpm",label:"pnpm"},{value:"yarn",label:`yarn (${Ee.blueBright("berry is not supported")})`},{value:"bun",label:"bun"}]});_e(i)&&Q.exit(0),ce.info(`\u{1F4E6} Using ${i} as package manager`),t.packageManager=i}if(t.template==null){const i=await ni({message:"Which project type do you want to start?",options:[{value:"standalone",label:`Standalone ${Ee.blueBright("Agent Server")}`},{value:"nodejs",label:`NodeJS ${Ee.blueBright("Agent Server")}`},{value:"nestjs",label:`NestJS ${Ee.blueBright("Agent Server")}`},{value:"react",label:`React ${Ee.blueBright("Application")}`},{value:"react-native",label:`React Native ${Ee.blueBright("Application")}`},{value:"nestjs+react",label:`NestJS + React ${Ee.blueBright("Agent Server + Client Application")}`},{value:"nodejs+react",label:`NodeJS + React ${Ee.blueBright("Agent Server + Client Application")}`}]});_e(i)&&Q.exit(0),t.template=i}if(t.template!=="standalone"){const i=await Qe({message:"Server Port(if project is client app, this port mean ws server port):",initialValue:"3000",validate(n){if(Number.isNaN(Number.parseInt(n)))return"Port must be an integer"}});_e(i)&&Q.exit(0),t.port=Number(i)}if(t.template!=="react"){const i=await bu(),n=i.sort((h,m)=>h.displayName.localeCompare(m.displayName)).map(({displayName:h,serviceName:m})=>({label:h,value:m})),r=await Ln({message:`Which connectors do you want to include? (Press ${Ee.cyan("<space>")} to select, ${Ee.cyan("<a>")} to select all, ${Ee.cyan("<enter>")} to proceed)`,options:n,required:!1});_e(r)&&Q.exit(0),t.services=r;const a=Array.from(new Set(i.filter(h=>r.includes(h.serviceName)).flatMap(h=>h.envList))),e=a.length===0?!1:await ri({message:`Do you want to enter environment variables? (Number of environment variables to enter: ${a.length})
93
+ ${Ee.cyan("If you press <ctrl+c>, you can skip this step.")}`,initialValue:!1}),u=[];if(_e(e)||!e)a.forEach(h=>{u.push({key:h,value:""})}),ui("Skipping environment variables input.");else for(let h=0;h<a.length;h++){const m=a[h],y=await Qe({message:`${m}: `,defaultValue:""});if(_e(y)){const p=a.splice(h);p.forEach(C=>{u.push({key:C,value:""})}),ui(`Skipping environment variables input: ${p.slice(0,3).join(", ")}... (count: ${p.length})`);break}u.push({key:m,value:y})}t.envList=u}{const i=await ri({message:"Enter your OpenAI API key?",initialValue:!1});if(_e(i)&&Q.exit(0),i){const n=await Qe({message:"Please enter your OPENAI API key:"});_e(n)&&Q.exit(0),t.openAIKey=n}else t.openAIKey=null}try{(()=>{const i=h=>(h.packageManager==="npm"||h.packageManager==="yarn"||h.packageManager==="pnpm"||h.packageManager==="bun")&&typeof h.projectAbsolutePath=="string"&&(h.template==="nodejs"||h.template==="nestjs"||h.template==="react"||h.template==="react-native"||h.template==="standalone"||h.template==="nestjs+react"||h.template==="nodejs+react")&&(h.openAIKey===null||typeof h.openAIKey=="string")&&(h.port===void 0||typeof h.port=="number")&&Array.isArray(h.services)&&h.services.every(m=>typeof m=="string")&&(h.envList===void 0||Array.isArray(h.envList)&&h.envList.every(m=>typeof m=="object"&&m!==null&&n(m))),n=h=>typeof h.key=="string"&&typeof h.value=="string",r=(h,m,y=!0)=>(h.packageManager==="npm"||h.packageManager==="yarn"||h.packageManager==="pnpm"||h.packageManager==="bun"||ne._assertGuard(y,{method:"typia.assertGuard",path:m+".packageManager",expected:'("bun" | "npm" | "pnpm" | "yarn")',value:h.packageManager},u))&&(typeof h.projectAbsolutePath=="string"||ne._assertGuard(y,{method:"typia.assertGuard",path:m+".projectAbsolutePath",expected:"string",value:h.projectAbsolutePath},u))&&(h.template==="nodejs"||h.template==="nestjs"||h.template==="react"||h.template==="react-native"||h.template==="standalone"||h.template==="nestjs+react"||h.template==="nodejs+react"||ne._assertGuard(y,{method:"typia.assertGuard",path:m+".template",expected:'("nestjs" | "nestjs+react" | "nodejs" | "nodejs+react" | "react" | "react-native" | "standalone")',value:h.template},u))&&(h.openAIKey===null||typeof h.openAIKey=="string"||ne._assertGuard(y,{method:"typia.assertGuard",path:m+".openAIKey",expected:"(null | string)",value:h.openAIKey},u))&&(h.port===void 0||typeof h.port=="number"||ne._assertGuard(y,{method:"typia.assertGuard",path:m+".port",expected:"(number | undefined)",value:h.port},u))&&((Array.isArray(h.services)||ne._assertGuard(y,{method:"typia.assertGuard",path:m+".services",expected:"Array<string>",value:h.services},u))&&h.services.every((p,C)=>typeof p=="string"||ne._assertGuard(y,{method:"typia.assertGuard",path:m+".services["+C+"]",expected:"string",value:p},u))||ne._assertGuard(y,{method:"typia.assertGuard",path:m+".services",expected:"Array<string>",value:h.services},u))&&(h.envList===void 0||(Array.isArray(h.envList)||ne._assertGuard(y,{method:"typia.assertGuard",path:m+".envList",expected:"(Array<__type> | undefined)",value:h.envList},u))&&h.envList.every((p,C)=>(typeof p=="object"&&p!==null||ne._assertGuard(y,{method:"typia.assertGuard",path:m+".envList["+C+"]",expected:"__type.o1",value:p},u))&&a(p,m+".envList["+C+"]",y)||ne._assertGuard(y,{method:"typia.assertGuard",path:m+".envList["+C+"]",expected:"__type.o1",value:p},u))||ne._assertGuard(y,{method:"typia.assertGuard",path:m+".envList",expected:"(Array<__type> | undefined)",value:h.envList},u)),a=(h,m,y=!0)=>(typeof h.key=="string"||ne._assertGuard(y,{method:"typia.assertGuard",path:m+".key",expected:"string",value:h.key},u))&&(typeof h.value=="string"||ne._assertGuard(y,{method:"typia.assertGuard",path:m+".value",expected:"string",value:h.value},u)),e=h=>typeof h=="object"&&h!==null&&i(h);let u;return(h,m)=>{e(h)===!1&&(u=m,((y,p,C=!0)=>(typeof y=="object"&&y!==null||ne._assertGuard(!0,{method:"typia.assertGuard",path:p+"",expected:"__type",value:y},u))&&r(y,p+"",!0)||ne._assertGuard(!0,{method:"typia.assertGuard",path:p+"",expected:"__type",value:y},u))(h,"$input",!0))}})()(t)}catch(i){throw new Error(`\u274C ${i.toString()}`)}return t}async function oo({projectAbsolutePath:s,context:t}){await Ue({template:"standalone",project:s}),ce.success("\u2705 Template downloaded");const i=It(t.services),n=Nt(t.services),r=we(s,"src/index.ts"),a=await ht(r,"utf-8"),e=Lt({content:a,importCode:i,connectorCode:n}),u=await Tt(e);await lt(r,u),await ze({projectPath:s,apiKeys:[{key:"OPENAI_API_KEY",value:t.openAIKey??""},...t.envList??[]]}),ce.success("\u2705 .env created"),await Ge({packageManager:t.packageManager,projectAbsolutePath:s,services:t.services}),await Rs({packageManager:t.packageManager,projectAbsolutePath:s})}async function Rr({projectAbsolutePath:s,context:t}){await Ue({template:"nodejs",project:s}),ce.success("\u2705 Template downloaded");const i=It(t.services),n=Nt(t.services),r=we(s,"src/index.ts"),a=await ht(r,"utf-8").then(h=>t.services.length===0?h:h.replace(/import \{ BbsArticleService \}.*;\n/g,"").replace(/controllers:\s*\[[\s\S]*?\],\n/,`controllers: [/// INSERT CONTROLLER HERE],
94
+ `)),e=Lt({content:a,importCode:i,connectorCode:n}),u=await Tt(e);await lt(r,u),await ze({projectPath:s,apiKeys:[{key:"OPENAI_API_KEY",value:t.openAIKey??""},{key:"PORT",value:t.port?.toString()??"3000"},...t.envList??[]]}),ce.success("\u2705 .env created"),await Ge({packageManager:t.packageManager,projectAbsolutePath:s,services:t.services}),await Rs({packageManager:t.packageManager,projectAbsolutePath:s})}async function Br({projectAbsolutePath:s,context:t}){await Ue({template:"nestjs",project:s}),ce.success("\u2705 Template downloaded");const i=It(t.services),n=Nt(t.services),r=we(s,"src/controllers/chat/ChatController.ts"),a=await ht(r,"utf-8").then(h=>t.services.length===0?h:h.replace(/import \{ BbsArticleService \}.*;\n/g,"").replace(/controllers:\s*\[[\s\S]*?\],\n/,`controllers: [/// INSERT CONTROLLER HERE],
95
+ `)),e=Lt({content:a,importCode:i,connectorCode:n}),u=await Tt(e);await lt(r,u),await ze({projectPath:s,apiKeys:[{key:"OPENAI_API_KEY",value:t.openAIKey??""},{key:"API_PORT",value:t.port?.toString()??"3000"},...t.envList??[]]}),ce.success("\u2705 .env created"),await Ge({packageManager:t.packageManager,projectAbsolutePath:s,services:t.services}),await Rs({packageManager:t.packageManager,projectAbsolutePath:s})}async function Bs({projectAbsolutePath:s,context:t}){await Ue({template:"react",project:s}),ce.success("\u2705 Template downloaded"),await ze({projectPath:s,apiKeys:[{key:"OPENAI_API_KEY",value:t.openAIKey??""},{key:"VITE_AGENTICA_WS_URL",value:`ws://localhost:${t.port}/chat`}]}),ce.success("\u2705 .env created"),await Ge({packageManager:t.packageManager,projectAbsolutePath:s,services:t.services})}async function ao({projectAbsolutePath:s,context:t}){await Ue({template:"react-native",project:s}),ce.success("\u2705 Template downloaded"),await ze({projectPath:s,apiKeys:[{key:"OPENAI_API_KEY",value:t.openAIKey??""}]}),ce.success("\u2705 .env created"),await Ge({packageManager:t.packageManager,projectAbsolutePath:s,services:t.services})}async function ho({template:s}){oi("Agentica Start Wizard");const t=await uo({template:s}),{projectAbsolutePath:i}=t;switch(t.template){case"standalone":await oo({projectAbsolutePath:i,context:t});break;case"nodejs":await Rr({projectAbsolutePath:i,context:t});break;case"nestjs":await Br({projectAbsolutePath:i,context:t});break;case"react":await Bs({projectAbsolutePath:i,context:t});break;case"react-native":await ao({projectAbsolutePath:i,context:t});break;case"nestjs+react":await Br({projectAbsolutePath:we(i,"server"),context:t}),await Bs({projectAbsolutePath:we(i,"client"),context:t});break;case"nodejs+react":await Rr({projectAbsolutePath:we(i,"server"),context:t}),await Bs({projectAbsolutePath:we(i,"client"),context:t});break;default:throw t.template,new Error(`\u274C Template ${t.template} not supported`)}Pn(`
96
+ \u{1F389} Project ${i} created
97
+ \u26A0\uFE0F ${Ee.yellow("Note:")} Please implement constructor values for each controller generated in index.ts
98
+ `)}const ut=new zn;ut.version(qn),ut.command("start").description("Start a new project").addOption(new Gn("-p, --project <project>","The project type").choices(no)).action(async s=>{oi(`\u{1F680} ${Ee.blueBright("Agentica")} Setup Wizard`),await ho({template:s.project})});function lo(){ut.parse(Q.argv)}export{ut as program,lo as run};