-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrth-cli.js
More file actions
138 lines (132 loc) · 252 KB
/
rth-cli.js
File metadata and controls
138 lines (132 loc) · 252 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
"use strict";var mm=Object.create;var Ns=Object.defineProperty;var Dm=Object.getOwnPropertyDescriptor;var hm=Object.getOwnPropertyNames;var gm=Object.getPrototypeOf,Fm=Object.prototype.hasOwnProperty;var j=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var ym=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of hm(t))!Fm.call(e,o)&&o!==n&&Ns(e,o,{get:()=>t[o],enumerable:!(r=Dm(t,o))||r.enumerable});return e};var R=(e,t,n)=>(n=e!=null?mm(gm(e)):{},ym(t||!e||!e.__esModule?Ns(n,"default",{value:e,enumerable:!0}):n,e));var Sa=j((OE,Ea)=>{"use strict";Ea.exports=Ym;function Km(e){let t={defaultWidth:0,output:process.stdout,tty:require("tty")};return e?(Object.keys(t).forEach(function(n){e[n]||(e[n]=t[n])}),e):t}function Ym(e){let t=Km(e);if(t.output.getWindowSize)return t.output.getWindowSize()[0]||t.defaultWidth;if(t.tty.getWindowSize)return t.tty.getWindowSize()[1]||t.defaultWidth;if(t.output.columns)return t.output.columns;if(process.env.CLI_WIDTH){let n=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(n)&&n!==0)return n}return t.defaultWidth}});var $a=j((tS,Ua)=>{var lD=require("stream"),Oo=class extends lD{#t=null;constructor(t={}){super(t),this.writable=this.readable=!0,this.muted=!1,this.on("pipe",this._onpipe),this.replace=t.replace,this._prompt=t.prompt||null,this._hadControl=!1}#n(t,n){return this._dest?this._dest[t]:this._src?this._src[t]:n}#e(t,...n){typeof this._dest?.[t]=="function"&&this._dest[t](...n),typeof this._src?.[t]=="function"&&this._src[t](...n)}get isTTY(){return this.#t!==null?this.#t:this.#n("isTTY",!1)}set isTTY(t){this.#t=t}get rows(){return this.#n("rows")}get columns(){return this.#n("columns")}mute(){this.muted=!0}unmute(){this.muted=!1}_onpipe(t){this._src=t}pipe(t,n){return this._dest=t,super.pipe(t,n)}pause(){if(this._src)return this._src.pause()}resume(){if(this._src)return this._src.resume()}write(t){if(this.muted){if(!this.replace)return!0;if(t.match(/^\u001b/))return t.indexOf(this._prompt)===0&&(t=t.slice(this._prompt.length),t=t.replace(/./g,this.replace),t=this._prompt+t),this._hadControl=!0,this.emit("data",t);this._prompt&&this._hadControl&&t.indexOf(this._prompt)===0&&(this._hadControl=!1,this.emit("data",this._prompt),t=t.slice(this._prompt.length)),t=t.toString().replace(/./g,this.replace)}this.emit("data",t)}end(t){this.muted&&(t&&this.replace?t=t.toString().replace(/./g,this.replace):t=null),t&&this.emit("data",t),this.emit("end")}destroy(...t){return this.#e("destroy",...t)}destroySoon(...t){return this.#e("destroySoon",...t)}close(...t){return this.#e("close",...t)}};Ua.exports=Oo});var ku=j((F2,vu)=>{vu.exports=Iu;Iu.sync=lh;var Ru=require("fs");function uh(e,t){var n=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!n||(n=n.split(";"),n.indexOf("")!==-1))return!0;for(var r=0;r<n.length;r++){var o=n[r].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o)return!0}return!1}function Lu(e,t,n){return!e.isSymbolicLink()&&!e.isFile()?!1:uh(t,n)}function Iu(e,t,n){Ru.stat(e,function(r,o){n(r,r?!1:Lu(o,e,t))})}function lh(e,t){return Lu(Ru.statSync(e),e,t)}});var $u=j((y2,Uu)=>{Uu.exports=Nu;Nu.sync=ch;var Pu=require("fs");function Nu(e,t,n){Pu.stat(e,function(r,o){n(r,r?!1:Mu(o,t))})}function ch(e,t){return Mu(Pu.statSync(e),t)}function Mu(e,t){return e.isFile()&&fh(e,t)}function fh(e,t){var n=e.mode,r=e.uid,o=e.gid,i=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),s=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),u=parseInt("010",8),l=parseInt("001",8),c=a|u,f=n&l||n&u&&o===s||n&a&&r===i||n&c&&i===0;return f}});var _u=j((w2,ju)=>{var b2=require("fs"),Qn;process.platform==="win32"||global.TESTING_WINDOWS?Qn=ku():Qn=$u();ju.exports=Qo;Qo.sync=dh;function Qo(e,t,n){if(typeof t=="function"&&(n=t,t={}),!n){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(r,o){Qo(e,t||{},function(i,s){i?o(i):r(s)})})}Qn(e,t||{},function(r,o){r&&(r.code==="EACCES"||t&&t.ignoreErrors)&&(r=null,o=!1),n(r,o)})}function dh(e,t){try{return Qn.sync(e,t||{})}catch(n){if(t&&t.ignoreErrors||n.code==="EACCES")return!1;throw n}}});var Yu=j((E2,Ku)=>{var ct=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Vu=require("path"),ph=ct?";":":",Gu=_u(),Wu=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),zu=(e,t)=>{let n=t.colon||ph,r=e.match(/\//)||ct&&e.match(/\\/)?[""]:[...ct?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(n)],o=ct?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=ct?o.split(n):[""];return ct&&e.indexOf(".")!==-1&&i[0]!==""&&i.unshift(""),{pathEnv:r,pathExt:i,pathExtExe:o}},Hu=(e,t,n)=>{typeof t=="function"&&(n=t,t={}),t||(t={});let{pathEnv:r,pathExt:o,pathExtExe:i}=zu(e,t),s=[],a=l=>new Promise((c,f)=>{if(l===r.length)return t.all&&s.length?c(s):f(Wu(e));let d=r[l],p=/^".*"$/.test(d)?d.slice(1,-1):d,m=Vu.join(p,e),g=!p&&/^\.[\\\/]/.test(e)?e.slice(0,2)+m:m;c(u(g,l,0))}),u=(l,c,f)=>new Promise((d,p)=>{if(f===o.length)return d(a(c+1));let m=o[f];Gu(l+m,{pathExt:i},(g,F)=>{if(!g&&F)if(t.all)s.push(l+m);else return d(l+m);return d(u(l,c,f+1))})});return n?a(0).then(l=>n(null,l),n):a(0)},mh=(e,t)=>{t=t||{};let{pathEnv:n,pathExt:r,pathExtExe:o}=zu(e,t),i=[];for(let s=0;s<n.length;s++){let a=n[s],u=/^".*"$/.test(a)?a.slice(1,-1):a,l=Vu.join(u,e),c=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+l:l;for(let f=0;f<r.length;f++){let d=c+r[f];try{if(Gu.sync(d,{pathExt:o}))if(t.all)i.push(d);else return d}catch{}}}if(t.all&&i.length)return i;if(t.nothrow)return null;throw Wu(e)};Ku.exports=Hu;Hu.sync=mh});var Ju=j((S2,Zo)=>{"use strict";var qu=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"};Zo.exports=qu;Zo.exports.default=qu});var el=j((x2,Zu)=>{"use strict";var Xu=require("path"),Dh=Yu(),hh=Ju();function Qu(e,t){let n=e.options.env||process.env,r=process.cwd(),o=e.options.cwd!=null,i=o&&process.chdir!==void 0&&!process.chdir.disabled;if(i)try{process.chdir(e.options.cwd)}catch{}let s;try{s=Dh.sync(e.command,{path:n[hh({env:n})],pathExt:t?Xu.delimiter:void 0})}catch{}finally{i&&process.chdir(r)}return s&&(s=Xu.resolve(o?e.options.cwd:"",s)),s}function gh(e){return Qu(e)||Qu(e,!0)}Zu.exports=gh});var tl=j((C2,ti)=>{"use strict";var ei=/([()\][%!^"`<>&|;, *?])/g;function Fh(e){return e=e.replace(ei,"^$1"),e}function yh(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(ei,"^$1"),t&&(e=e.replace(ei,"^$1")),e}ti.exports.command=Fh;ti.exports.argument=yh});var rl=j((A2,nl)=>{"use strict";nl.exports=/^#!(.*)/});var il=j((B2,ol)=>{"use strict";var bh=rl();ol.exports=(e="")=>{let t=e.match(bh);if(!t)return null;let[n,r]=t[0].replace(/#! ?/,"").split(" "),o=n.split("/").pop();return o==="env"?r:r?`${o} ${r}`:o}});var al=j((T2,sl)=>{"use strict";var ni=require("fs"),wh=il();function Eh(e){let n=Buffer.alloc(150),r;try{r=ni.openSync(e,"r"),ni.readSync(r,n,0,150,0),ni.closeSync(r)}catch{}return wh(n.toString())}sl.exports=Eh});var fl=j((O2,cl)=>{"use strict";var Sh=require("path"),ul=el(),ll=tl(),xh=al(),Ch=process.platform==="win32",Ah=/\.(?:com|exe)$/i,Bh=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Th(e){e.file=ul(e);let t=e.file&&xh(e.file);return t?(e.args.unshift(e.file),e.command=t,ul(e)):e.file}function Oh(e){if(!Ch)return e;let t=Th(e),n=!Ah.test(t);if(e.options.forceShell||n){let r=Bh.test(t);e.command=Sh.normalize(e.command),e.command=ll.command(e.command),e.args=e.args.map(i=>ll.argument(i,r));let o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function Rh(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);let r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:Oh(r)}cl.exports=Rh});var ml=j((R2,pl)=>{"use strict";var ri=process.platform==="win32";function oi(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function Lh(e,t){if(!ri)return;let n=e.emit;e.emit=function(r,o){if(r==="exit"){let i=dl(o,t);if(i)return n.call(e,"error",i)}return n.apply(e,arguments)}}function dl(e,t){return ri&&e===1&&!t.file?oi(t.original,"spawn"):null}function Ih(e,t){return ri&&e===1&&!t.file?oi(t.original,"spawnSync"):null}pl.exports={hookChildProcess:Lh,verifyENOENT:dl,verifyENOENTSync:Ih,notFoundError:oi}});var gl=j((L2,ft)=>{"use strict";var Dl=require("child_process"),ii=fl(),si=ml();function hl(e,t,n){let r=ii(e,t,n),o=Dl.spawn(r.command,r.args,r.options);return si.hookChildProcess(o,r),o}function vh(e,t,n){let r=ii(e,t,n),o=Dl.spawnSync(r.command,r.args,r.options);return o.error=o.error||si.verifyENOENTSync(o.status,r),o}ft.exports=hl;ft.exports.spawn=hl;ft.exports.sync=vh;ft.exports._parse=ii;ft.exports._enoent=si});var Zp=j((RR,Qp)=>{"use strict";var Lb=/^xn--/,Ib=/[^\0-\x7F]/,vb=/[\x2E\u3002\uFF0E\uFF61]/g,kb={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Cs=35,ce=Math.floor,As=String.fromCharCode;function Re(e){throw new RangeError(kb[e])}function Pb(e,t){let n=[],r=e.length;for(;r--;)n[r]=t(e[r]);return n}function Kp(e,t){let n=e.split("@"),r="";n.length>1&&(r=n[0]+"@",e=n[1]),e=e.replace(vb,".");let o=e.split("."),i=Pb(o,t).join(".");return r+i}function Yp(e){let t=[],n=0,r=e.length;for(;n<r;){let o=e.charCodeAt(n++);if(o>=55296&&o<=56319&&n<r){let i=e.charCodeAt(n++);(i&64512)==56320?t.push(((o&1023)<<10)+(i&1023)+65536):(t.push(o),n--)}else t.push(o)}return t}var Nb=e=>String.fromCodePoint(...e),Mb=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:36},Hp=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},qp=function(e,t,n){let r=0;for(e=n?ce(e/700):e>>1,e+=ce(e/t);e>Cs*26>>1;r+=36)e=ce(e/Cs);return ce(r+(Cs+1)*e/(e+38))},Jp=function(e){let t=[],n=e.length,r=0,o=128,i=72,s=e.lastIndexOf("-");s<0&&(s=0);for(let a=0;a<s;++a)e.charCodeAt(a)>=128&&Re("not-basic"),t.push(e.charCodeAt(a));for(let a=s>0?s+1:0;a<n;){let u=r;for(let c=1,f=36;;f+=36){a>=n&&Re("invalid-input");let d=Mb(e.charCodeAt(a++));d>=36&&Re("invalid-input"),d>ce((2147483647-r)/c)&&Re("overflow"),r+=d*c;let p=f<=i?1:f>=i+26?26:f-i;if(d<p)break;let m=36-p;c>ce(2147483647/m)&&Re("overflow"),c*=m}let l=t.length+1;i=qp(r-u,l,u==0),ce(r/l)>2147483647-o&&Re("overflow"),o+=ce(r/l),r%=l,t.splice(r++,0,o)}return String.fromCodePoint(...t)},Xp=function(e){let t=[];e=Yp(e);let n=e.length,r=128,o=0,i=72;for(let u of e)u<128&&t.push(As(u));let s=t.length,a=s;for(s&&t.push("-");a<n;){let u=2147483647;for(let c of e)c>=r&&c<u&&(u=c);let l=a+1;u-r>ce((2147483647-o)/l)&&Re("overflow"),o+=(u-r)*l,r=u;for(let c of e)if(c<r&&++o>2147483647&&Re("overflow"),c===r){let f=o;for(let d=36;;d+=36){let p=d<=i?1:d>=i+26?26:d-i;if(f<p)break;let m=f-p,g=36-p;t.push(As(Hp(p+m%g,0))),f=ce(m/g)}t.push(As(Hp(f,0))),i=qp(o,l,a===s),o=0,++a}++o,++r}return t.join("")},Ub=function(e){return Kp(e,function(t){return Lb.test(t)?Jp(t.slice(4).toLowerCase()):t})},$b=function(e){return Kp(e,function(t){return Ib.test(t)?"xn--"+Xp(t):t})},jb={version:"2.3.1",ucs2:{decode:Yp,encode:Nb},decode:Jp,encode:Xp,toASCII:$b,toUnicode:Ub};Qp.exports=jb});var sm=j((_R,Ls)=>{var im=require("crypto"),eo=require("fs"),Rs=8192;function uw(e){let t=eo.openSync(e,"r"),n=im.createHash("md5"),r=Buffer.alloc(Rs);try{let o;do o=eo.readSync(t,r,0,Rs),n.update(r.slice(0,o));while(o===Rs)}finally{eo.closeSync(t)}return n.digest("hex")}function lw(e){return new Promise((t,n)=>{let r=im.createHash("md5"),o=eo.createReadStream(e);o.on("error",i=>{n(i)}),r.once("readable",()=>{t(r.read().toString("hex"))}),o.pipe(r)})}Ls.exports=lw;Ls.exports.sync=uw});var Ms={aiAnalysisFailed:"Could not analyze project with AI",aiAnalyzingProject:"AI is analyzing your project",aiDetectionResult:"AI detection result",buildCommand:"Build command",buildCommandMustStartWith:'The build command must start with "{{prefix}}".',cannotBeAbsolutePath:"It cannot be an absolute path.",confirmAutoDeployWhenPush:"Do you want to deploy automatically when you push to Git",confirmCorrectDirectory:"Is this the correct directory for your project",confirmNeedBuild:"Does your site need to be built for deployment",confirmUseAiDetect:"Do you want to use AI to automatically detect the build configuration",confirmUseDetectedConfig:"Use detected configuration",createNewSite:"Create a new site",currentWorkingDirectory:"Current working directory",domainNotProvidedByRetinbox:'"{{domain}}" is not provided by Retinbox.',done:"Done.",enterBuildCommand:"Enter the build command",enterDeployScriptName:"Enter a name for the deploy script",enterNewDomainName:"Enter a new domain name",enterOnlyDomainNamePart:"Please enter only the domain name part. E.g. example.com",enterOutputDirectory:"Enter the output directory",enterYourApiKey:"Enter your API key",fetchingYourSiteList:"Fetching your site list",invalidApiKey:"Invalid API key.",mightBeRetinboxDomain:'"{{domain}}" might be a Retinbox domain.',myOwnDomainName:"My own domain name",needSetUpEnvVarOnGitPlatform:'You will need to set up the environment variable "{{envVar}}" on {{gitPlatform}}.',noAccessToSite:'You do not have access to the site "{{domain}}".',noBuildNeeded:"No build needed",noItIsNativeHtmlCssJs:"No, it is native HTML/CSS/JS.",noIWantConfigureManually:"No, I want to configure manually",notRootOfGitOrNode:"This is not the root directory of a Git repository or a Node.js project.",outputDirectory:"Output directory",ownDomain:"Own domain",retinboxDomain:"Retinbox domain",retinboxFreeDomainName:"Retinbox free domain name",scriptAlreadyExistsInPackageJson:'The script "{{script}}" already exists in package.json.',scriptNameCannotContainSpaces:"The script name cannot contain spaces.",scriptNotExistInPackageJson:'The script "{{script}}" does not exist in package.json.',selectSiteToDeploy:"Select the site to deploy",skip:"Skip",useCdToNavigateToCorrectDirectory:'Please use "cd" to navigate to the correct directory and try again.',whatTypeOfDomainNameWillNewSiteUse:"What type of domain name will your new site use",yesAllowAiReadFiles:"Yes, allow AI to read files in this project",yesItUsesFramework:"Yes, it uses a framework like React or Vue.",yesUseTheseConfigurations:"Yes, use these configurations",youCanNowDeployByRunning:'You can now deploy your site by running "{{command}}".',yourPremiumSubscriptionExpired:"Your premium subscription has expired."};var Us={aiAnalysisFailed:"\u65E0\u6CD5\u4F7F\u7528 AI \u5206\u6790\u9879\u76EE",aiAnalyzingProject:"AI \u6B63\u5728\u5206\u6790\u60A8\u7684\u9879\u76EE",aiDetectionResult:"AI \u68C0\u6D4B\u7ED3\u679C",buildCommand:"\u6784\u5EFA\u547D\u4EE4",buildCommandMustStartWith:'\u6784\u5EFA\u547D\u4EE4\u5FC5\u987B\u4EE5 "{{prefix}}" \u5F00\u5934\u3002',cannotBeAbsolutePath:"\u4E0D\u80FD\u662F\u7EDD\u5BF9\u8DEF\u5F84\u3002",confirmAutoDeployWhenPush:"\u60A8\u60F3\u5728\u63A8\u9001\u5230 Git \u65F6\u81EA\u52A8\u90E8\u7F72\u5417",confirmCorrectDirectory:"\u8FD9\u662F\u60A8\u7684\u9879\u76EE\u6240\u5728\u7684\u76EE\u5F55\u5417",confirmNeedBuild:"\u60A8\u7684\u7F51\u7AD9\u662F\u5426\u9700\u8981\u6784\u5EFA\u624D\u80FD\u90E8\u7F72",confirmUseAiDetect:"\u60A8\u662F\u5426\u5E0C\u671B\u4F7F\u7528 AI \u81EA\u52A8\u68C0\u6D4B\u6784\u5EFA\u914D\u7F6E",confirmUseDetectedConfig:"\u4F7F\u7528\u68C0\u6D4B\u5230\u7684\u914D\u7F6E",createNewSite:"\u521B\u5EFA\u65B0\u7F51\u7AD9",currentWorkingDirectory:"\u5F53\u524D\u76EE\u5F55",domainNotProvidedByRetinbox:'"{{domain}}" \u4E0D\u662F\u70ED\u94C1\u76D2\u63D0\u4F9B\u7684\u57DF\u540D\u3002',done:"\u5B8C\u6210\u3002",enterBuildCommand:"\u8F93\u5165\u6784\u5EFA\u547D\u4EE4",enterDeployScriptName:"\u8F93\u5165\u90E8\u7F72\u811A\u672C\u7684\u540D\u79F0",enterNewDomainName:"\u8F93\u5165\u65B0\u57DF\u540D",enterOnlyDomainNamePart:"\u8BF7\u53EA\u8F93\u5165\u57DF\u540D\u7684\u90E8\u5206\u3002\u4F8B\u5982: example.com",enterOutputDirectory:"\u8F93\u5165\u8981\u4E0A\u4F20\u7684\u76EE\u5F55\u8DEF\u5F84",enterYourApiKey:"\u8F93\u5165\u60A8\u7684 API \u5BC6\u94A5",fetchingYourSiteList:"\u6B63\u5728\u83B7\u53D6\u60A8\u7684\u7F51\u7AD9\u5217\u8868",invalidApiKey:"\u65E0\u6548\u7684 API \u5BC6\u94A5\u3002",mightBeRetinboxDomain:'"{{domain}}" \u53EF\u80FD\u662F\u70ED\u94C1\u76D2\u7684\u57DF\u540D\u3002',myOwnDomainName:"\u6211\u81EA\u5DF1\u7684\u57DF\u540D",needSetUpEnvVarOnGitPlatform:'\u60A8\u9700\u8981\u5728 {{gitPlatform}} \u4E0A\u8BBE\u7F6E\u73AF\u5883\u53D8\u91CF "{{envVar}}"\u3002',noAccessToSite:'\u60A8\u6CA1\u6709\u8BBF\u95EE\u7F51\u7AD9 "{{domain}}" \u7684\u6743\u9650\u3002',noBuildNeeded:"\u65E0\u9700\u6784\u5EFA",noItIsNativeHtmlCssJs:"\u4E0D\uFF0C\u5B83\u662F\u539F\u751F HTML/CSS/JS\u3002",noIWantConfigureManually:"\u4E0D\uFF0C\u6211\u8981\u624B\u52A8\u914D\u7F6E",notRootOfGitOrNode:"\u8FD9\u4E0D\u662F Git \u4ED3\u5E93\u6216 Node.js \u9879\u76EE\u7684\u6839\u76EE\u5F55\u3002",outputDirectory:"\u8F93\u51FA\u76EE\u5F55",ownDomain:"\u81EA\u5DF1\u7684",retinboxDomain:"\u70ED\u94C1\u76D2\u7684",retinboxFreeDomainName:"\u70ED\u94C1\u76D2\u7684\u514D\u8D39\u57DF\u540D",scriptAlreadyExistsInPackageJson:'package.json \u4E2D\u5DF2\u7ECF\u5B58\u5728\u811A\u672C "{{script}}"\u3002',scriptNameCannotContainSpaces:"\u811A\u672C\u540D\u79F0\u4E0D\u80FD\u5305\u542B\u7A7A\u683C\u3002",scriptNotExistInPackageJson:'package.json \u4E2D\u4E0D\u5B58\u5728\u811A\u672C "{{script}}"\u3002',selectSiteToDeploy:"\u9009\u62E9\u8981\u90E8\u7F72\u7684\u7F51\u7AD9",skip:"\u8DF3\u8FC7",useCdToNavigateToCorrectDirectory:'\u8BF7\u4F7F\u7528 "cd" \u5207\u6362\u5230\u6B63\u786E\u7684\u76EE\u5F55\uFF0C\u7136\u540E\u91CD\u65B0\u6267\u884C\u6B64\u547D\u4EE4\u3002',whatTypeOfDomainNameWillNewSiteUse:"\u60A8\u7684\u65B0\u7F51\u7AD9\u8981\u4F7F\u7528\u54EA\u79CD\u7C7B\u578B\u7684\u57DF\u540D",yesAllowAiReadFiles:"\u662F\uFF0C\u5141\u8BB8 AI \u8BFB\u53D6\u6B64\u9879\u76EE\u7684\u6587\u4EF6",yesItUsesFramework:"\u662F\uFF0C\u5B83\u4F7F\u7528\u50CF React \u6216 Vue \u8FD9\u6837\u7684\u6846\u67B6\u3002",yesUseTheseConfigurations:"\u662F\uFF0C\u4F7F\u7528\u8FD9\u4E9B\u914D\u7F6E",youCanNowDeployByRunning:'\u60A8\u73B0\u5728\u53EF\u4EE5\u901A\u8FC7\u6267\u884C "{{command}}" \u6765\u90E8\u7F72\u60A8\u7684\u7F51\u7AD9\u3002',yourPremiumSubscriptionExpired:"\u60A8\u7684\u9AD8\u7EA7\u8D26\u53F7\u5DF2\u8FC7\u671F\u3002"};var $s={aiAnalysisFailed:"\u7121\u6CD5\u4F7F\u7528 AI \u5206\u6790\u5C08\u6848",aiAnalyzingProject:"AI \u6B63\u5728\u5206\u6790\u60A8\u7684\u5C08\u6848",aiDetectionResult:"AI \u6AA2\u6E2C\u7D50\u679C",buildCommand:"\u69CB\u5EFA\u547D\u4EE4",buildCommandMustStartWith:'\u69CB\u5EFA\u547D\u4EE4\u5FC5\u9808\u4EE5 "{{prefix}}" \u958B\u982D\u3002',cannotBeAbsolutePath:"\u4E0D\u80FD\u662F\u7D55\u5C0D\u8DEF\u5F91\u3002",confirmAutoDeployWhenPush:"\u60A8\u60F3\u5728\u63A8\u9001\u5230 Git \u6642\u81EA\u52D5\u90E8\u7F72\u55CE",confirmCorrectDirectory:"\u9019\u662F\u60A8\u7684\u5C08\u6848\u6240\u5728\u7684\u76EE\u9304\u55CE",confirmNeedBuild:"\u60A8\u7684\u7DB2\u7AD9\u662F\u5426\u9700\u8981\u69CB\u5EFA\u624D\u80FD\u90E8\u7F72",confirmUseAiDetect:"\u60A8\u662F\u5426\u5E0C\u671B\u4F7F\u7528 AI \u81EA\u52D5\u6AA2\u6E2C\u69CB\u5EFA\u914D\u7F6E",confirmUseDetectedConfig:"\u4F7F\u7528\u6AA2\u6E2C\u5230\u7684\u914D\u7F6E",createNewSite:"\u5275\u5EFA\u65B0\u7DB2\u7AD9",currentWorkingDirectory:"\u7576\u524D\u76EE\u9304",domainNotProvidedByRetinbox:'"{{domain}}" \u4E0D\u662F\u71B1\u9435\u76D2\u63D0\u4F9B\u7684\u57DF\u540D\u3002',done:"\u5B8C\u6210\u3002",enterBuildCommand:"\u8F38\u5165\u69CB\u5EFA\u547D\u4EE4",enterDeployScriptName:"\u8F38\u5165\u90E8\u7F72\u8173\u672C\u7684\u540D\u7A31",enterNewDomainName:"\u8F38\u5165\u65B0\u57DF\u540D",enterOnlyDomainNamePart:"\u8ACB\u53EA\u8F38\u5165\u57DF\u540D\u7684\u90E8\u5206\u3002\u4F8B\u5982: example.com",enterOutputDirectory:"\u8F38\u5165\u8981\u4E0A\u8F09\u7684\u76EE\u9304\u8DEF\u5F91",enterYourApiKey:"\u8F38\u5165\u60A8\u7684 API \u91D1\u9470",fetchingYourSiteList:"\u6B63\u5728\u53D6\u5F97\u60A8\u7684\u7DB2\u7AD9\u5217\u8868",invalidApiKey:"\u7121\u6548\u7684 API \u91D1\u9470\u3002",mightBeRetinboxDomain:'"{{domain}}" \u53EF\u80FD\u662F\u71B1\u9435\u76D2\u7684\u57DF\u540D\u3002',myOwnDomainName:"\u6211\u81EA\u5DF1\u7684\u57DF\u540D",needSetUpEnvVarOnGitPlatform:'\u60A8\u9700\u8981\u5728 {{gitPlatform}} \u4E0A\u8A2D\u7F6E\u74B0\u5883\u8B8A\u91CF "{{envVar}}"\u3002',noAccessToSite:'\u60A8\u6C92\u6709\u8A2A\u554F\u7DB2\u7AD9 "{{domain}}" \u7684\u6B0A\u9650\u3002',noBuildNeeded:"\u7121\u9700\u69CB\u5EFA",noItIsNativeHtmlCssJs:"\u4E0D\uFF0C\u5B83\u662F\u539F\u751F HTML/CSS/JS\u3002",noIWantConfigureManually:"\u4E0D\uFF0C\u6211\u8981\u624B\u52A8\u914D\u7F6E",notRootOfGitOrNode:"\u9019\u4E0D\u662F Git \u5009\u5EAB\u6216 Node.js \u5C08\u6848\u7684\u6839\u76EE\u9304\u3002",outputDirectory:"\u8F38\u51FA\u76EE\u9304",ownDomain:"\u81EA\u5DF1\u7684",retinboxDomain:"\u71B1\u9435\u76D2\u7684",retinboxFreeDomainName:"\u71B1\u9435\u76D2\u7684\u514D\u8CBB\u57DF\u540D",scriptAlreadyExistsInPackageJson:'package.json \u4E2D\u5DF2\u7D93\u5B58\u5728\u8173\u672C "{{script}}"\u3002',scriptNameCannotContainSpaces:"\u8173\u672C\u540D\u7A31\u4E0D\u80FD\u5305\u542B\u7A7A\u683C\u3002",scriptNotExistInPackageJson:'package.json \u4E2D\u4E0D\u5B58\u5728\u8173\u672C "{{script}}"\u3002',selectSiteToDeploy:"\u9078\u64C7\u8981\u90E8\u7F72\u7684\u7DB2\u7AD9",skip:"\u8DF3\u904E",useCdToNavigateToCorrectDirectory:'\u8ACB\u4F7F\u7528 "cd" \u5207\u63DB\u5230\u6B63\u78BA\u7684\u76EE\u9304\uFF0C\u7136\u5F8C\u91CD\u65B0\u57F7\u884C\u6B64\u547D\u4EE4\u3002',whatTypeOfDomainNameWillNewSiteUse:"\u60A8\u7684\u65B0\u7DB2\u7AD9\u8981\u4F7F\u7528\u54EA\u7A2E\u985E\u578B\u7684\u57DF\u540D",yesAllowAiReadFiles:"\u662F\uFF0C\u5141\u8A31 AI \u8B80\u53D6\u6B64\u5C08\u6848\u7684\u6A94\u6848",yesItUsesFramework:"\u662F\uFF0C\u5B83\u4F7F\u7528\u50CF React \u6216 Vue \u9019\u6A23\u7684\u6846\u67B6\u3002",yesUseTheseConfigurations:"\u662F\uFF0C\u4F7F\u7528\u9019\u4E9B\u914D\u7F6E",youCanNowDeployByRunning:'\u60A8\u73FE\u5728\u53EF\u4EE5\u900F\u904E\u57F7\u884C "{{command}}" \u4F86\u90E8\u7F72\u60A8\u7684\u7DB2\u7AD9\u3002',yourPremiumSubscriptionExpired:"\u60A8\u7684\u9AD8\u7D1A\u5E33\u865F\u5DF2\u904E\u671F\u3002"};var C=e=>typeof e=="string",Pt=()=>{let e,t,n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n},js=e=>e==null?"":""+e,bm=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},wm=/###/g,_s=e=>e&&e.indexOf("###")>-1?e.replace(wm,"."):e,Vs=e=>!e||C(e),Nt=(e,t,n)=>{let r=C(t)?t.split("."):t,o=0;for(;o<r.length-1;){if(Vs(e))return{};let i=_s(r[o]);!e[i]&&n&&(e[i]=new n),Object.prototype.hasOwnProperty.call(e,i)?e=e[i]:e={},++o}return Vs(e)?{}:{obj:e,k:_s(r[o])}},Gs=(e,t,n)=>{let{obj:r,k:o}=Nt(e,t,Object);if(r!==void 0||t.length===1){r[o]=n;return}let i=t[t.length-1],s=t.slice(0,t.length-1),a=Nt(e,s,Object);for(;a.obj===void 0&&s.length;)i=`${s[s.length-1]}.${i}`,s=s.slice(0,s.length-1),a=Nt(e,s,Object),a?.obj&&typeof a.obj[`${a.k}.${i}`]<"u"&&(a.obj=void 0);a.obj[`${a.k}.${i}`]=n},Em=(e,t,n,r)=>{let{obj:o,k:i}=Nt(e,t,Object);o[i]=o[i]||[],o[i].push(n)},gn=(e,t)=>{let{obj:n,k:r}=Nt(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},Sm=(e,t,n)=>{let r=gn(e,n);return r!==void 0?r:gn(t,n)},Xs=(e,t,n)=>{for(let r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?C(e[r])||e[r]instanceof String||C(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Xs(e[r],t[r],n):e[r]=t[r]);return e},Ze=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),xm={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},Cm=e=>C(e)?e.replace(/[&<>"'\/]/g,t=>xm[t]):e,ao=class{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){let n=this.regExpMap.get(t);if(n!==void 0)return n;let r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}},Am=[" ",",","?","!",";"],Bm=new ao(20),Tm=(e,t,n)=>{t=t||"",n=n||"";let r=Am.filter(s=>t.indexOf(s)<0&&n.indexOf(s)<0);if(r.length===0)return!0;let o=Bm.getRegExp(`(${r.map(s=>s==="?"?"\\?":s).join("|")})`),i=!o.test(e);if(!i){let s=e.indexOf(n);s>0&&!o.test(e.substring(0,s))&&(i=!0)}return i},uo=(e,t,n=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;let r=t.split(n),o=e;for(let i=0;i<r.length;){if(!o||typeof o!="object")return;let s,a="";for(let u=i;u<r.length;++u)if(u!==i&&(a+=n),a+=r[u],s=o[a],s!==void 0){if(["string","number","boolean"].indexOf(typeof s)>-1&&u<r.length-1)continue;i+=u-i+1;break}o=s}return o},Mt=e=>e?.replace("_","-"),Om={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}},lo=class e{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||Om,this.options=n,this.debug=n.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,o){return o&&!this.debug?null:(C(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new e(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new e(this.logger,t)}},re=new lo,et=class{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);let o=this.observers[r].get(n)||0;this.observers[r].set(n,o+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t,...n){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([o,i])=>{for(let s=0;s<i;s++)o(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([o,i])=>{for(let s=0;s<i;s++)o.apply(o,[t,...n])})}},Fn=class extends et{constructor(t,n={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){let n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r,o={}){let i=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,s=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure,a;t.indexOf(".")>-1?a=t.split("."):(a=[t,n],r&&(Array.isArray(r)?a.push(...r):C(r)&&i?a.push(...r.split(i)):a.push(r)));let u=gn(this.data,a);return!u&&!n&&!r&&t.indexOf(".")>-1&&(t=a[0],n=a[1],r=a.slice(2).join(".")),u||!s||!C(r)?u:uo(this.data?.[t]?.[n],r,i)}addResource(t,n,r,o,i={silent:!1}){let s=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,a=[t,n];r&&(a=a.concat(s?r.split(s):r)),t.indexOf(".")>-1&&(a=t.split("."),o=n,n=a[1]),this.addNamespaces(n),Gs(this.data,a,o),i.silent||this.emit("added",t,n,r,o)}addResources(t,n,r,o={silent:!1}){for(let i in r)(C(r[i])||Array.isArray(r[i]))&&this.addResource(t,n,i,r[i],{silent:!0});o.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,o,i,s={silent:!1,skipCopy:!1}){let a=[t,n];t.indexOf(".")>-1&&(a=t.split("."),o=r,r=n,n=a[1]),this.addNamespaces(n);let u=gn(this.data,a)||{};s.skipCopy||(r=JSON.parse(JSON.stringify(r))),o?Xs(u,r,i):u={...u,...r},Gs(this.data,a,u),s.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){let n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(o=>n[o]&&Object.keys(n[o]).length>0)}toJSON(){return this.data}},Qs={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(i=>{t=this.processors[i]?.process(t,n,r,o)??t}),t}},Zs=Symbol("i18next/PATH_KEY");function Rm(){let e=[],t=Object.create(null),n;return t.get=(r,o)=>(n?.revoke?.(),o===Zs?e:(e.push(o),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function co(e,t){let{[Zs]:n}=e(Rm());return n.join(t?.keySeparator??".")}var Ws={},io=e=>!C(e)&&typeof e!="boolean"&&typeof e!="number",yn=class e extends et{constructor(t,n={}){super(),bm(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=re.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){let r={...n};if(t==null)return!1;let o=this.resolve(t,r);if(o?.res===void 0)return!1;let i=io(o.res);return!(r.returnObjects===!1&&i)}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");let o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,i=n.ns||this.options.defaultNS||[],s=r&&t.indexOf(r)>-1,a=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!Tm(t,r,o);if(s&&!a){let u=t.match(this.interpolator.nestingRegexp);if(u&&u.length>0)return{key:t,namespaces:C(i)?[i]:i};let l=t.split(r);(r!==o||r===o&&this.options.ns.indexOf(l[0])>-1)&&(i=l.shift()),t=l.join(o)}return{key:t,namespaces:C(i)?[i]:i}}translate(t,n,r){let o=typeof n=="object"?{...n}:n;if(typeof o!="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),typeof o=="object"&&(o={...o}),o||(o={}),t==null)return"";typeof t=="function"&&(t=co(t,{...this.options,...o})),Array.isArray(t)||(t=[String(t)]);let i=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,{key:a,namespaces:u}=this.extractFromKey(t[t.length-1],o),l=u[u.length-1],c=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;c===void 0&&(c=":");let f=o.lng||this.language,d=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(f?.toLowerCase()==="cimode")return d?i?{res:`${l}${c}${a}`,usedKey:a,exactUsedKey:a,usedLng:f,usedNS:l,usedParams:this.getUsedParamsDetails(o)}:`${l}${c}${a}`:i?{res:a,usedKey:a,exactUsedKey:a,usedLng:f,usedNS:l,usedParams:this.getUsedParamsDetails(o)}:a;let p=this.resolve(t,o),m=p?.res,g=p?.usedKey||a,F=p?.exactUsedKey||a,y=["[object Number]","[object Function]","[object RegExp]"],b=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,h=!this.i18nFormat||this.i18nFormat.handleAsObject,S=o.count!==void 0&&!C(o.count),w=e.hasDefaultValue(o),E=S?this.pluralResolver.getSuffix(f,o.count,o):"",D=o.ordinal&&S?this.pluralResolver.getSuffix(f,o.count,{ordinal:!1}):"",T=S&&!o.ordinal&&o.count===0,L=T&&o[`defaultValue${this.options.pluralSeparator}zero`]||o[`defaultValue${E}`]||o[`defaultValue${D}`]||o.defaultValue,O=m;h&&!m&&w&&(O=L);let $=io(O),we=Object.prototype.toString.apply(O);if(h&&O&&$&&y.indexOf(we)<0&&!(C(b)&&Array.isArray(O))){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");let N=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,O,{...o,ns:u}):`key '${a} (${this.language})' returned an object instead of string.`;return i?(p.res=N,p.usedParams=this.getUsedParamsDetails(o),p):N}if(s){let N=Array.isArray(O),A=N?[]:{},v=N?F:g;for(let z in O)if(Object.prototype.hasOwnProperty.call(O,z)){let W=`${v}${s}${z}`;w&&!m?A[z]=this.translate(W,{...o,defaultValue:io(L)?L[z]:void 0,joinArrays:!1,ns:u}):A[z]=this.translate(W,{...o,joinArrays:!1,ns:u}),A[z]===W&&(A[z]=O[z])}m=A}}else if(h&&C(b)&&Array.isArray(m))m=m.join(b),m&&(m=this.extendTranslation(m,t,o,r));else{let N=!1,A=!1;!this.isValidLookup(m)&&w&&(N=!0,m=L),this.isValidLookup(m)||(A=!0,m=a);let z=(o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&A?void 0:m,W=w&&L!==m&&this.options.updateMissing;if(A||N||W){if(this.logger.log(W?"updateKey":"missingKey",f,l,a,W?L:m),s){let H=this.resolve(a,{...o,keySeparator:!1});H&&H.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let vt=[],Dn=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Dn&&Dn[0])for(let H=0;H<Dn.length;H++)vt.push(Dn[H]);else this.options.saveMissingTo==="all"?vt=this.languageUtils.toResolveHierarchy(o.lng||this.language):vt.push(o.lng||this.language);let ks=(H,Ie,kt)=>{let Ps=w&&kt!==m?kt:z;this.options.missingKeyHandler?this.options.missingKeyHandler(H,l,Ie,Ps,W,o):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(H,l,Ie,Ps,W,o),this.emit("missingKey",H,l,Ie,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&S?vt.forEach(H=>{let Ie=this.pluralResolver.getSuffixes(H,o);T&&o[`defaultValue${this.options.pluralSeparator}zero`]&&Ie.indexOf(`${this.options.pluralSeparator}zero`)<0&&Ie.push(`${this.options.pluralSeparator}zero`),Ie.forEach(kt=>{ks([H],a+kt,o[`defaultValue${kt}`]||L)})}):ks(vt,a,L))}m=this.extendTranslation(m,t,o,p,r),A&&m===a&&this.options.appendNamespaceToMissingKey&&(m=`${l}${c}${a}`),(A||N)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${c}${a}`:a,N?m:void 0,o))}return i?(p.res=m,p.usedParams=this.getUsedParamsDetails(o),p):m}extendTranslation(t,n,r,o,i){if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});let u=C(t)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),l;if(u){let f=t.match(this.interpolator.nestingRegexp);l=f&&f.length}let c=r.replace&&!C(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(c={...this.options.interpolation.defaultVariables,...c}),t=this.interpolator.interpolate(t,c,r.lng||this.language||o.usedLng,r),u){let f=t.match(this.interpolator.nestingRegexp),d=f&&f.length;l<d&&(r.nest=!1)}!r.lng&&o&&o.res&&(r.lng=this.language||o.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,(...f)=>i?.[0]===f[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${f[0]} in key: ${n[0]}`),null):this.translate(...f,n),r)),r.interpolation&&this.interpolator.reset()}let s=r.postProcess||this.options.postProcess,a=C(s)?[s]:s;return t!=null&&a?.length&&r.applyPostProcessor!==!1&&(t=Qs.handle(a,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t,n={}){let r,o,i,s,a;return C(t)&&(t=[t]),t.forEach(u=>{if(this.isValidLookup(r))return;let l=this.extractFromKey(u,n),c=l.key;o=c;let f=l.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));let d=n.count!==void 0&&!C(n.count),p=d&&!n.ordinal&&n.count===0,m=n.context!==void 0&&(C(n.context)||typeof n.context=="number")&&n.context!=="",g=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(F=>{this.isValidLookup(r)||(a=F,!Ws[`${g[0]}-${F}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(a)&&(Ws[`${g[0]}-${F}`]=!0,this.logger.warn(`key "${o}" for languages "${g.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),g.forEach(y=>{if(this.isValidLookup(r))return;s=y;let b=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(b,c,y,F,n);else{let S;d&&(S=this.pluralResolver.getSuffix(y,n.count,n));let w=`${this.options.pluralSeparator}zero`,E=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(n.ordinal&&S.indexOf(E)===0&&b.push(c+S.replace(E,this.options.pluralSeparator)),b.push(c+S),p&&b.push(c+w)),m){let D=`${c}${this.options.contextSeparator||"_"}${n.context}`;b.push(D),d&&(n.ordinal&&S.indexOf(E)===0&&b.push(D+S.replace(E,this.options.pluralSeparator)),b.push(D+S),p&&b.push(D+w))}}let h;for(;h=b.pop();)this.isValidLookup(r)||(i=h,r=this.getResource(y,F,h,n))}))})}),{res:r,usedKey:o,exactUsedKey:i,usedLng:s,usedNS:a}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r,o={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,n,r,o):this.resourceStore.getResource(t,n,r,o)}getUsedParamsDetails(t={}){let n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!C(t.replace),o=r?t.replace:t;if(r&&typeof t.count<"u"&&(o.count=t.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!r){o={...o};for(let i of n)delete o[i]}return o}static hasDefaultValue(t){let n="defaultValue";for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}},bn=class{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=re.create("languageUtils")}getScriptPartFromCode(t){if(t=Mt(t),!t||t.indexOf("-")<0)return null;let n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=Mt(t),!t||t.indexOf("-")<0)return t;let n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(C(t)&&t.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;let o=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(o))&&(n=o)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;let o=this.getScriptPartFromCode(r);if(this.isSupportedCode(o))return n=o;let i=this.getLanguagePartFromCode(r);if(this.isSupportedCode(i))return n=i;n=this.options.supportedLngs.find(s=>{if(s===i)return s;if(!(s.indexOf("-")<0&&i.indexOf("-")<0)&&(s.indexOf("-")>0&&i.indexOf("-")<0&&s.substring(0,s.indexOf("-"))===i||s.indexOf(i)===0&&i.length>1))return s})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),C(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){let r=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),o=[],i=s=>{s&&(this.isSupportedCode(s)?o.push(s):this.logger.warn(`rejecting language code not found in supportedLngs: ${s}`))};return C(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(t))):C(t)&&i(this.formatLanguageCode(t)),r.forEach(s=>{o.indexOf(s)<0&&i(this.formatLanguageCode(s))}),o}},zs={zero:0,one:1,two:2,few:3,many:4,other:5},Hs={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})},fo=class{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=re.create("pluralResolver"),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){let r=Mt(t==="dev"?"en":t),o=n.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:r,type:o});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let s;try{s=new Intl.PluralRules(r,{type:o})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Hs;if(!t.match(/-|_/))return Hs;let u=this.languageUtils.getLanguagePartFromCode(t);s=this.getRule(u,n)}return this.pluralRulesCache[i]=s,s}needsPlural(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,n,r={}){return this.getSuffixes(t,r).map(o=>`${n}${o}`)}getSuffixes(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((o,i)=>zs[o]-zs[i]).map(o=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${o}`):[]}getSuffix(t,n,r={}){let o=this.getRule(t,r);return o?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${o.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}},Ks=(e,t,n,r=".",o=!0)=>{let i=Sm(e,t,n);return!i&&o&&C(n)&&(i=uo(e,n,r),i===void 0&&(i=uo(t,n,r))),i},so=e=>e.replace(/\$/g,"$$$$"),wn=class{constructor(t={}){this.logger=re.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(n=>n),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});let{escape:n,escapeValue:r,useRawValueToEscape:o,prefix:i,prefixEscaped:s,suffix:a,suffixEscaped:u,formatSeparator:l,unescapeSuffix:c,unescapePrefix:f,nestingPrefix:d,nestingPrefixEscaped:p,nestingSuffix:m,nestingSuffixEscaped:g,nestingOptionsSeparator:F,maxReplaces:y,alwaysFormat:b}=t.interpolation;this.escape=n!==void 0?n:Cm,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=i?Ze(i):s||"{{",this.suffix=a?Ze(a):u||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=d?Ze(d):p||Ze("$t("),this.nestingSuffix=m?Ze(m):g||Ze(")"),this.nestingOptionsSeparator=F||",",this.maxReplaces=y||1e3,this.alwaysFormat=b!==void 0?b:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let t=(n,r)=>n?.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,n,r,o){let i,s,a,u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=p=>{if(p.indexOf(this.formatSeparator)<0){let y=Ks(n,u,p,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(y,void 0,r,{...o,...n,interpolationkey:p}):y}let m=p.split(this.formatSeparator),g=m.shift().trim(),F=m.join(this.formatSeparator).trim();return this.format(Ks(n,u,g,this.options.keySeparator,this.options.ignoreJSONStructure),F,r,{...o,...n,interpolationkey:g})};this.resetRegExp();let c=o?.missingInterpolationHandler||this.options.missingInterpolationHandler,f=o?.interpolation?.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:p=>so(p)},{regex:this.regexp,safeValue:p=>this.escapeValue?so(this.escape(p)):so(p)}].forEach(p=>{for(a=0;i=p.regex.exec(t);){let m=i[1].trim();if(s=l(m),s===void 0)if(typeof c=="function"){let F=c(t,i,o);s=C(F)?F:""}else if(o&&Object.prototype.hasOwnProperty.call(o,m))s="";else if(f){s=i[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${t}`),s="";else!C(s)&&!this.useRawValueToEscape&&(s=js(s));let g=p.safeValue(s);if(t=t.replace(i[0],g),f?(p.regex.lastIndex+=s.length,p.regex.lastIndex-=i[0].length):p.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),t}nest(t,n,r={}){let o,i,s,a=(u,l)=>{let c=this.nestingOptionsSeparator;if(u.indexOf(c)<0)return u;let f=u.split(new RegExp(`${c}[ ]*{`)),d=`{${f[1]}`;u=f[0],d=this.interpolate(d,s);let p=d.match(/'/g),m=d.match(/"/g);((p?.length??0)%2===0&&!m||m.length%2!==0)&&(d=d.replace(/'/g,'"'));try{s=JSON.parse(d),l&&(s={...l,...s})}catch(g){return this.logger.warn(`failed parsing options string in nesting for key ${u}`,g),`${u}${c}${d}`}return s.defaultValue&&s.defaultValue.indexOf(this.prefix)>-1&&delete s.defaultValue,u};for(;o=this.nestingRegexp.exec(t);){let u=[];s={...r},s=s.replace&&!C(s.replace)?s.replace:s,s.applyPostProcessor=!1,delete s.defaultValue;let l=/{.*}/.test(o[1])?o[1].lastIndexOf("}")+1:o[1].indexOf(this.formatSeparator);if(l!==-1&&(u=o[1].slice(l).split(this.formatSeparator).map(c=>c.trim()).filter(Boolean),o[1]=o[1].slice(0,l)),i=n(a.call(this,o[1].trim(),s),s),i&&o[0]===t&&!C(i))return i;C(i)||(i=js(i)),i||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${t}`),i=""),u.length&&(i=u.reduce((c,f)=>this.format(c,f,r.lng,{...r,interpolationkey:o[1].trim()}),i.trim())),t=t.replace(o[0],i),this.regexp.lastIndex=0}return t}},Lm=e=>{let t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){let r=e.split("(");t=r[0].toLowerCase().trim();let o=r[1].substring(0,r[1].length-1);t==="currency"&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):t==="relativetime"&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach(s=>{if(s){let[a,...u]=s.split(":"),l=u.join(":").trim().replace(/^'+|'+$/g,""),c=a.trim();n[c]||(n[c]=l),l==="false"&&(n[c]=!1),l==="true"&&(n[c]=!0),isNaN(l)||(n[c]=parseInt(l,10))}})}return{formatName:t,formatOptions:n}},Ys=e=>{let t={};return(n,r,o)=>{let i=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(i={...i,[o.interpolationkey]:void 0});let s=r+JSON.stringify(i),a=t[s];return a||(a=e(Mt(r),o),t[s]=a),a(n)}},Im=e=>(t,n,r)=>e(Mt(n),r)(t),po=class{constructor(t={}){this.logger=re.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";let r=n.cacheInBuiltFormats?Ys:Im;this.formats={number:r((o,i)=>{let s=new Intl.NumberFormat(o,{...i});return a=>s.format(a)}),currency:r((o,i)=>{let s=new Intl.NumberFormat(o,{...i,style:"currency"});return a=>s.format(a)}),datetime:r((o,i)=>{let s=new Intl.DateTimeFormat(o,{...i});return a=>s.format(a)}),relativetime:r((o,i)=>{let s=new Intl.RelativeTimeFormat(o,{...i});return a=>s.format(a,i.range||"day")}),list:r((o,i)=>{let s=new Intl.ListFormat(o,{...i});return a=>s.format(a)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=Ys(n)}format(t,n,r,o={}){let i=n.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find(a=>a.indexOf(")")>-1)){let a=i.findIndex(u=>u.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,a)].join(this.formatSeparator)}return i.reduce((a,u)=>{let{formatName:l,formatOptions:c}=Lm(u);if(this.formats[l]){let f=a;try{let d=o?.formatParams?.[o.interpolationkey]||{},p=d.locale||d.lng||o.locale||o.lng||r;f=this.formats[l](a,p,{...c,...o,...d})}catch(d){this.logger.warn(d)}return f}else this.logger.warn(`there was no format function for ${l}`);return a},t)}},vm=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},mo=class extends et{constructor(t,n,r,o={}){super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=o,this.logger=re.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,o.backend,o)}queueLoad(t,n,r,o){let i={},s={},a={},u={};return t.forEach(l=>{let c=!0;n.forEach(f=>{let d=`${l}|${f}`;!r.reload&&this.store.hasResourceBundle(l,f)?this.state[d]=2:this.state[d]<0||(this.state[d]===1?s[d]===void 0&&(s[d]=!0):(this.state[d]=1,c=!1,s[d]===void 0&&(s[d]=!0),i[d]===void 0&&(i[d]=!0),u[f]===void 0&&(u[f]=!0)))}),c||(a[l]=!0)}),(Object.keys(i).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(i),pending:Object.keys(s),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(u)}}loaded(t,n,r){let o=t.split("|"),i=o[0],s=o[1];n&&this.emit("failedLoading",i,s,n),!n&&r&&this.store.addResourceBundle(i,s,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);let a={};this.queue.forEach(u=>{Em(u.loaded,[i],s),vm(u,t),n&&u.errors.push(n),u.pendingCount===0&&!u.done&&(Object.keys(u.loaded).forEach(l=>{a[l]||(a[l]={});let c=u.loaded[l];c.length&&c.forEach(f=>{a[l][f]===void 0&&(a[l][f]=!0)})}),u.done=!0,u.errors.length?u.callback(u.errors):u.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(u=>!u.done)}read(t,n,r,o=0,i=this.retryTimeout,s){if(!t.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:o,wait:i,callback:s});return}this.readingCalls++;let a=(l,c)=>{if(this.readingCalls--,this.waitingReads.length>0){let f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(l&&c&&o<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,o+1,i*2,s)},i);return}s(l,c)},u=this.backend[r].bind(this.backend);if(u.length===2){try{let l=u(t,n);l&&typeof l.then=="function"?l.then(c=>a(null,c)).catch(a):a(null,l)}catch(l){a(l)}return}return u(t,n,a)}prepareLoading(t,n,r={},o){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();C(t)&&(t=this.languageUtils.toResolveHierarchy(t)),C(n)&&(n=[n]);let i=this.queueLoad(t,n,r,o);if(!i.toLoad.length)return i.pending.length||o(),null;i.toLoad.forEach(s=>{this.loadOne(s)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t,n=""){let r=t.split("|"),o=r[0],i=r[1];this.read(o,i,"read",void 0,void 0,(s,a)=>{s&&this.logger.warn(`${n}loading namespace ${i} for language ${o} failed`,s),!s&&a&&this.logger.log(`${n}loaded namespace ${i} for language ${o}`,a),this.loaded(t,s,a)})}saveMissing(t,n,r,o,i,s={},a=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend?.create){let u={...s,isUpdate:i},l=this.backend.create.bind(this.backend);if(l.length<6)try{let c;l.length===5?c=l(t,n,r,o,u):c=l(t,n,r,o),c&&typeof c.then=="function"?c.then(f=>a(null,f)).catch(a):a(null,c)}catch(c){a(c)}else l(t,n,r,o,a,u)}!t||!t[0]||this.store.addResource(t[0],n,r,o)}}},qs=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),C(e[1])&&(t.defaultValue=e[1]),C(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){let n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Js=e=>(C(e.ns)&&(e.ns=[e.ns]),C(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),C(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e),hn=()=>{},km=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})},Do=class e extends et{constructor(t={},n){if(super(),this.options=Js(t),this.services={},this.logger=re,this.modules={external:[]},km(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(t={},n){this.isInitializing=!0,typeof t=="function"&&(n=t,t={}),t.defaultNS==null&&t.ns&&(C(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));let r=qs();this.options={...r,...this.options,...Js(t)},this.options.interpolation={...r.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=r.overloadTranslationOptionHandler);let o=l=>l?typeof l=="function"?new l:l:null;if(!this.options.isClone){this.modules.logger?re.init(o(this.modules.logger),this.options):re.init(null,this.options);let l;this.modules.formatter?l=this.modules.formatter:l=po;let c=new bn(this.options);this.store=new Fn(this.options.resources,this.options);let f=this.services;f.logger=re,f.resourceStore=this.store,f.languageUtils=c,f.pluralResolver=new fo(c,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),l&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(f.formatter=o(l),f.formatter.init&&f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new wn(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new mo(o(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",(p,...m)=>{this.emit(p,...m)}),this.modules.languageDetector&&(f.languageDetector=o(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=o(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new yn(this.services,this.options),this.translator.on("*",(p,...m)=>{this.emit(p,...m)}),this.modules.external.forEach(p=>{p.init&&p.init(this)})}if(this.format=this.options.interpolation.format,n||(n=hn),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&l[0]!=="dev"&&(this.options.lng=l[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(l=>{this[l]=(...c)=>this.store[l](...c)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(l=>{this[l]=(...c)=>(this.store[l](...c),this)});let a=Pt(),u=()=>{let l=(c,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),a.resolve(f),n(c,f)};if(this.languages&&!this.isInitialized)return l(null,this.t.bind(this));this.changeLanguage(this.options.lng,l)};return this.options.resources||!this.options.initAsync?u():setTimeout(u,0),a}loadResources(t,n=hn){let r=n,o=C(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(o?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();let i=[],s=a=>{if(!a||a==="cimode")return;this.services.languageUtils.toResolveHierarchy(a).forEach(l=>{l!=="cimode"&&i.indexOf(l)<0&&i.push(l)})};o?s(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(u=>s(u)),this.options.preload?.forEach?.(a=>s(a)),this.services.backendConnector.load(i,this.options.ns,a=>{!a&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(a)})}else r(null)}reloadResources(t,n,r){let o=Pt();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=hn),this.services.backendConnector.reload(t,n,i=>{o.resolve(),r(i)}),o}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&Qs.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1)){for(let n=0;n<this.languages.length;n++){let r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,n){this.isLanguageChangingTo=t;let r=Pt();this.emit("languageChanging",t);let o=a=>{this.language=a,this.languages=this.services.languageUtils.toResolveHierarchy(a),this.resolvedLanguage=void 0,this.setResolvedLanguage(a)},i=(a,u)=>{u?this.isLanguageChangingTo===t&&(o(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,r.resolve((...l)=>this.t(...l)),n&&n(a,(...l)=>this.t(...l))},s=a=>{!t&&!a&&this.services.languageDetector&&(a=[]);let u=C(a)?a:a&&a[0],l=this.store.hasLanguageSomeTranslations(u)?u:this.services.languageUtils.getBestMatchFromCodes(C(a)?[a]:a);l&&(this.language||o(l),this.translator.language||this.translator.changeLanguage(l),this.services.languageDetector?.cacheUserLanguage?.(l)),this.loadResources(l,c=>{i(c,l)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(t),r}getFixedT(t,n,r){let o=(i,s,...a)=>{let u;typeof s!="object"?u=this.options.overloadTranslationOptionHandler([i,s].concat(a)):u={...s},u.lng=u.lng||o.lng,u.lngs=u.lngs||o.lngs,u.ns=u.ns||o.ns,u.keyPrefix!==""&&(u.keyPrefix=u.keyPrefix||r||o.keyPrefix);let l=this.options.keySeparator||".",c;return u.keyPrefix&&Array.isArray(i)?c=i.map(f=>(typeof f=="function"&&(f=co(f,{...this.options,...s})),`${u.keyPrefix}${l}${f}`)):(typeof i=="function"&&(i=co(i,{...this.options,...s})),c=u.keyPrefix?`${u.keyPrefix}${l}${i}`:i),this.t(c,u)};return C(t)?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=r,o}t(...t){return this.translator?.translate(...t)}exists(...t){return this.translator?.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;let r=n.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;let s=(a,u)=>{let l=this.services.backendConnector.state[`${a}|${u}`];return l===-1||l===0||l===2};if(n.precheck){let a=n.precheck(this,s);if(a!==void 0)return a}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||s(r,t)&&(!o||s(i,t)))}loadNamespaces(t,n){let r=Pt();return this.options.ns?(C(t)&&(t=[t]),t.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){let r=Pt();C(t)&&(t=[t]);let o=this.options.preload||[],i=t.filter(s=>o.indexOf(s)<0&&this.services.languageUtils.isSupportedCode(s));return i.length?(this.options.preload=o.concat(i),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";try{let o=new Intl.Locale(t);if(o&&o.getTextInfo){let i=o.getTextInfo();if(i&&i.direction)return i.direction}}catch{}let n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services?.languageUtils||new bn(qs());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){let r=new e(t,n);return r.createInstance=e.createInstance,r}cloneInstance(t={},n=hn){let r=t.forkResourceStore;r&&delete t.forkResourceStore;let o={...this.options,...t,isClone:!0},i=new e(o);if((t.debug!==void 0||t.prefix!==void 0)&&(i.logger=i.logger.clone(t)),["store","services","language"].forEach(a=>{i[a]=this[a]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},r){let a=Object.keys(this.store.data).reduce((u,l)=>(u[l]={...this.store.data[l]},u[l]=Object.keys(u[l]).reduce((c,f)=>(c[f]={...u[l][f]},c),u[l]),u),{});i.store=new Fn(a,o),i.services.resourceStore=i.store}return t.interpolation&&(i.services.interpolator=new wn(o)),i.translator=new yn(i.services,o),i.translator.on("*",(a,...u)=>{i.emit(a,...u)}),i.init(o,n),i.translator.options=o,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}},M=Do.createInstance(),Lw=M.createInstance,Iw=M.dir,vw=M.init,kw=M.loadResources,Pw=M.reloadResources,Nw=M.use,Mw=M.changeLanguage,Uw=M.getFixedT,x=M.t,$w=M.exists,jw=M.setDefaultNamespace,_w=M.hasLoadedNamespace,Vw=M.loadNamespaces,Gw=M.loadLanguages;var Pm={"en-US":{translation:Ms},"zh-CN":{translation:Us},"zh-TW":{translation:$s}};async function ea(e){await M.init({fallbackLng:"en-US",interpolation:{escapeValue:!1},lng:e??"en-US",resources:Pm})}var fe=R(require("fs"),1),ho=R(require("path"),1),En=process.argv.includes("--dev"),Ut=En?JSON.parse(fe.default.readFileSync("package.json","utf-8")).version:"5.0.3";function Sn(){return fe.default.existsSync("bun.lock")||fe.default.existsSync("bun.lockb")?"bun":fe.default.existsSync("pnpm-lock.yaml")?"pnpm":fe.default.existsSync("yarn.lock")?"yarn":(fe.default.existsSync("package-lock.json"),"npm")}function xn(e){let t=[];for(let n in e){let r=e[n];r&&t.push(n+"="+encodeURIComponent(r))}return t.join("&")}function Cn(){let e=process.argv.slice(2),t={build:"",outdir:"",site:""};for(let n=0;n<e.length;n++){let r=e[n];r.startsWith("--")||(console.error("Invalid argument:",r),process.exit(1));let o=r.substring(2),i=e[n+1];i?.startsWith("--")||(t[o]=i,n++)}return t}async function go(e,t,n=e){try{let r=await fe.default.promises.readdir(e);for(let o of r){if(o.startsWith("."))continue;let i=ho.default.posix.join(e,o);if(i.includes("node_modules"))continue;let s=await fe.default.promises.stat(i);s.isDirectory()?await go(i,t,n):s.isFile()&&t.add(ho.default.posix.relative(n,i))}}catch(r){r instanceof Error&&console.error(r.message),console.error(`Failed to read local files in ${e}`),process.exit(1)}}var ta=En?process.env.RTH_BACKEND_DEV:"https://api.retiehe.com/backend",Ee=En?process.env.RTH_BACKEND_DEV:"https://api-overseas.retiehe.com/backend",na=`Mozilla/5.0 (${process.platform}) RTHHostHelper/${Ut}`;async function ra(e){let{domain:t,messages:n,toolResults:r,username:o}=e,i={domain:t,username:o};n&&(i.messages=n),r&&(i.toolResults=r);let s=await fetch(Ee+"/host-ai-v3/analyze-local-project",ve({body:i}));if(!s.ok)throw new Error(s.status.toString());let a=s.body?.getReader();if(!a)throw new Error("No response body");let u=new TextDecoder,l="",c="",f={};for(;;){let{done:p,value:m}=await a.read();if(p)break;l+=u.decode(m,{stream:!0});let g=l.split(`
`);l=g.pop()||"";for(let F of g){if(!F.trim())continue;let y=JSON.parse(F);y.type==="content"?(c+=y.content||"",process.stdout.write(y.content||"")):y.type==="tool_calls"?f={messages:y.messages,toolCalls:y.toolCalls}:y.type==="error"&&(f={error:y.error})}}if(f.toolCalls||f.error)return f;let d=/\{[\s\S]*\}/.exec(c);return d?JSON.parse(d[0]):{error:c||"No response"}}async function oa(e){let{domain:t,username:n}=e,r=await fetch(Ee+"/host-v3/site",ve({body:{domain:t,username:n}}));if(!r.ok)throw new Error(r.status.toString());return await r.json()}async function Fo(e){let{domain:t,filenames:n,username:r}=e,o=await fetch(Ee+"/host-v3/site/content",ve({body:{domain:t,keys:Array.from(n),type:"undefined",username:r}}));if(!o.ok)throw new Error(o.status.toString());return await o.json()}function ve(e){let{body:t,headers:n=yo(),isFormData:r,method:o="POST"}=e,i;if(r){i=new FormData;for(let s in t){let a=t[s];if(!(!a&&a!==0)){if(typeof a=="number"){i.append(s,a.toString());continue}if(typeof a=="string"||a instanceof Blob){i.append(s,a);continue}console.warn("Unknown type:",s,a)}}}else i=JSON.stringify(t),n["Content-Type"]="application/json";return{body:i,headers:n,method:o}}function yo(){return{"Accept-Language":M.language,Authorization:"Bearer "+process.env.RTH_API_KEY,"User-Agent":na}}async function ia(e){let{domain:t,username:n}=e,r=await fetch(Ee+"/host-v3/site/content?"+xn({domain:t,username:n}),{headers:yo()});if(!r.ok)throw r.status===403?new Error(x("noAccessToSite",{domain:t})):new Error(r.status.toString());let o=await r.json();if(o.alert||!o.result)throw new Error(o.alert);return o.result}async function sa(e){let t=await fetch(Ee+"/host-v3/sites?"+xn({username:e}),{headers:yo()});if(!t.ok)throw new Error(t.status.toString());return await t.json()}async function aa(e){let{content:t,domain:n,username:r}=e,o=await fetch(Ee+"/host-v3/site/content",ve({body:{content:t,domain:n,username:r}}));if(!o.ok)throw new Error(o.status.toString());return await o.json()}async function ua(e){let t=await fetch(ta+"/counter-v2/event",ve({body:{event:e,subject:"autodeploy"}}));if(!t.ok)throw new Error(t.status.toString())}async function la(e){let{content:t,domain:n,key:r,username:o}=e,i=await fetch(Ee+"/host-v3/site/content",ve({body:{content:t,domain:n,key:r,type:"string",username:o}}));if(!i.ok)throw new Error(i.status.toString());return await i.json()}async function ca(e){let{content:t,domain:n,filename:r,username:o}=e,i=await fetch(Ee+"/host-v3/site/content",ve({body:{content:t,domain:n,key:r,type:"object",username:o},isFormData:!0}));if(!i.ok)throw new Error(i.status.toString());return await i.json()}async function tt(e){let t=await fetch(ta+"/api-key-v2/verification?"+xn({key:e}),{headers:{"User-Agent":na}});if(!t.ok)switch(t.status){case 402:throw new Error(x("yourPremiumSubscriptionExpired"));case 404:throw new Error(x("invalidApiKey"));default:throw new Error(t.status.toString())}return await t.json()}var bo=R(require("fs"),1),An=R(require("path"),1),Nm=10;async function fa(e,t){let n,r;for(let o=0;o<Nm;o++){let i=await ra({domain:e,messages:n,toolResults:r,username:t}),s=i.toolCalls;if(!s||s.length===0)return{build:i.build,error:i.error,output:i.output};let a=s.find(u=>u.function.name==="return_analyze_project_result");if(a)try{let u=JSON.parse(a.function.arguments||"{}");return{build:u.build,error:u.error,output:u.output}}catch{return{error:"Failed to parse analyze project result."}}n=i.messages,r=[];for(let u of s){console.info(u.function.name,u.function.arguments);let l=await Mm(u);r.push(l)}}return{error:"Max iterations reached without answer"}}async function Mm(e){let{id:t}=e,n=e.function.name,r=JSON.parse(e.function.arguments);switch(n){case"list_local_files":{let o=r.directory||".",i=await Um(o);return{content:JSON.stringify({files:i}),toolCallId:t}}case"read_local_file":return{content:await $m(r.path),toolCallId:t};case"return_analyze_project_result":return{content:e.function.arguments||"{}",toolCallId:t};default:return{content:`Error: Unknown local tool: ${n}`,toolCallId:t}}}async function Um(e){let t=[],n=An.default.resolve(e);async function r(o){let i=await bo.default.promises.readdir(o,{withFileTypes:!0});for(let s of i){let a=An.default.join(o,s.name),u=An.default.relative(n,a);if(s.isDirectory()){if(s.name==="node_modules"||s.name.startsWith("."))continue;await r(a)}else t.push(u)}}return await r(n),t.sort()}async function $m(e){try{return await bo.default.promises.readFile(e,"utf8")}catch(t){return`Error: ${t instanceof Error?t.message:String(t)}`}}var da=Object.freeze({"gitee-go":`version: '1.0'
name: deploy
displayName: \u90E8\u7F72\u5230\u70ED\u94C1\u76D2\u7F51\u9875\u6258\u7BA1
triggers:
trigger: auto
push:
branches:
prefix:
- ''
variables:
global:
- RTH_API_KEY
stages:
- name: deploy
displayName: \u90E8\u7F72
strategy: naturally
trigger: auto
steps:
- step: build@nodejs
name: deploy
displayName: \u90E8\u7F72\u5230\u70ED\u94C1\u76D2\u7F51\u9875\u6258\u7BA1
nodeVersion: 20.10.0
commands:
- |
npm config set registry https://registry.npmmirror.com
cli=$(mktemp)
trap 'rm -f $cli' EXIT
curl -fsSL https://host.retiehe.com/cli -o $cli
node $cli --site {{site}} --build {{build}} --outdir {{outdir}}
strategy: {}
`,"github-actions":`name: Deploy to Retinbox Web Hosting
on: push
jobs:
deploy:
runs-on: ubuntu-latest
container:
image: shangzheny/rth-host-helper:latest
steps:
- name: Deploy to Retinbox Web Hosting
uses: rthsoftware/host-auto-deploy@master
env:
RTH_API_KEY: \${{ secrets.RTH_API_KEY }}
with:
site: "{{site}}"
build: "{{build}}"
outdir: "{{outdir}}"
`,"gitlab-ci":`deploy:
stage: deploy
image: shangzheny/rth-host-helper:latest
script:
- |
cli=$(mktemp)
trap 'rm -f $cli' EXIT
curl -fsSL https://host.retiehe.com/cli -o $cli
node $cli --site {{site}} --build {{build}} --outdir {{outdir}}
`});var $t=(e,t=[])=>e.name==="up"||t.includes("vim")&&e.name==="k"||t.includes("emacs")&&e.ctrl&&e.name==="p",Bn=(e,t=[])=>e.name==="down"||t.includes("vim")&&e.name==="j"||t.includes("emacs")&&e.ctrl&&e.name==="n";var jt=e=>e.name==="backspace",_t=e=>e.name==="tab",wo=e=>"1234567890".includes(e.name),ke=e=>e.name==="enter"||e.name==="return";var Tn=class extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(t){super(),this.cause=t?.cause}},On=class extends Error{name="CancelPromptError";message="Prompt was canceled"},Vt=class extends Error{name="ExitPromptError"},Rn=class extends Error{name="HookError"},nt=class extends Error{name="ValidationError"};var ha=require("node:async_hooks");var Ln=require("node:async_hooks");var pa=new Ln.AsyncLocalStorage;function jm(e){return{rl:e,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function ma(e,t){let n=jm(e);return pa.run(n,()=>{function r(o){n.handleChange=()=>{n.index=0,o()},n.handleChange()}return t(r)})}function Pe(){let e=pa.getStore();if(!e)throw new Rn("[Inquirer] Hook functions can only be called from within a prompt");return e}function Eo(){return Pe().rl}function So(e){let t=(...n)=>{let r=Pe(),o=!1,i=r.handleChange;r.handleChange=()=>{o=!0};let s=e(...n);return o&&i(),r.handleChange=i,s};return Ln.AsyncResource.bind(t)}function rt(e){let t=Pe(),{index:n}=t,r={get(){return t.hooks[n]},set(i){t.hooks[n]=i},initialized:n in t.hooks},o=e(r);return t.index++,o}function Da(){Pe().handleChange()}var Ne={queue(e){let t=Pe(),{index:n}=t;t.hooksEffect.push(()=>{t.hooksCleanup[n]?.();let r=e(Eo());if(r!=null&&typeof r!="function")throw new nt("useEffect return value must be a cleanup function or nothing.");t.hooksCleanup[n]=r})},run(){let e=Pe();So(()=>{e.hooksEffect.forEach(t=>{t()}),e.hooksEffect.length=0})()},clearAll(){let e=Pe();e.hooksCleanup.forEach(t=>{t?.()}),e.hooksEffect.length=0,e.hooksCleanup.length=0}};function _(e){return rt(t=>{let n=ha.AsyncResource.bind(function(i){t.get()!==i&&(t.set(i),Da())});if(t.initialized)return[t.get(),n];let r=typeof e=="function"?e():e;return t.set(r),[r,n]})}function de(e,t){rt(n=>{let r=n.get();(!Array.isArray(r)||t.some((i,s)=>!Object.is(i,r[s])))&&Ne.queue(e),n.set(t)})}var q=require("node:util");var Q=R(require("node:process"),1);function _m(){return Q.default.platform!=="win32"?Q.default.env.TERM!=="linux":!!Q.default.env.WT_SESSION||!!Q.default.env.TERMINUS_SUBLIME||Q.default.env.ConEmuTask==="{cmd::Cmder}"||Q.default.env.TERM_PROGRAM==="Terminus-Sublime"||Q.default.env.TERM_PROGRAM==="vscode"||Q.default.env.TERM==="xterm-256color"||Q.default.env.TERM==="alacritty"||Q.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var ga={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},Fa={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},Vm={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},Gm={...ga,...Fa},Wm={...ga,...Vm},zm=_m(),Hm=zm?Gm:Wm,ot=Hm,fE=Object.entries(Fa);var ya={prefix:{idle:(0,q.styleText)("blue","?"),done:(0,q.styleText)("green",ot.tick)},spinner:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"].map(e=>(0,q.styleText)("yellow",e))},style:{answer:e=>(0,q.styleText)("cyan",e),message:e=>(0,q.styleText)("bold",e),error:e=>(0,q.styleText)("red",`> ${e}`),defaultAnswer:e=>(0,q.styleText)("dim",`(${e})`),help:e=>(0,q.styleText)("dim",e),highlight:e=>(0,q.styleText)("cyan",e),key:e=>(0,q.styleText)("cyan",(0,q.styleText)("bold",`<${e}>`))}};function ba(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function wa(...e){let t={};for(let n of e)for(let[r,o]of Object.entries(n)){let i=t[r];t[r]=ba(i)&&ba(o)?wa(i,o):o}return t}function pe(...e){let t=[ya,...e.filter(n=>n!=null)];return wa(...t)}function Me({status:e="idle",theme:t}){let[n,r]=_(!1),[o,i]=_(0),{prefix:s,spinner:a}=pe(t);return de(()=>{if(e==="loading"){let l,c=-1,f=setTimeout(()=>{r(!0),l=setInterval(()=>{c=c+1,i(c%a.frames.length)},a.interval)},300);return()=>{clearTimeout(f),clearInterval(l)}}else r(!1)},[e]),n?a.frames[o]:typeof s=="string"?s:s[e==="loading"?"idle":e]??s.idle}function Gt(e,t){return rt(n=>{let r=n.get();if(!r||r.dependencies.length!==t.length||r.dependencies.some((o,i)=>o!==t[i])){let o=e();return n.set({value:o,dependencies:t}),o}return r.value})}function Ue(e){return _({current:e})[0]}function $e(e){let t=Ue(e);t.current=e,de(n=>{let r=!1,o=So((i,s)=>{r||t.current(s,n)});return n.input.on("keypress",o),()=>{r=!0,n.input.removeListener("keypress",o)}},[])}var Ma=R(Sa(),1);function xo({onlyFirst:e=!1}={}){let o="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(o,e?void 0:"g")}var qm=xo();function Wt(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(qm,"")}function xa(e){return e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||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||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}function Ca(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function Aa(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e>=94192&&e<=94198||e>=94208&&e<=101589||e>=101631&&e<=101662||e>=101760&&e<=101874||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128728||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129674||e>=129678&&e<=129734||e===129736||e>=129741&&e<=129756||e>=129759&&e<=129770||e>=129775&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}function Jm(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function Ba(e,{ambiguousAsWide:t=!1}={}){return Jm(e),Ca(e)||Aa(e)||t&&xa(e)?2:1}var Ta=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\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?|[\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](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\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-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;var Xm=new Intl.Segmenter,Qm=/^\p{Default_Ignorable_Code_Point}$/u;function je(e,t={}){if(typeof e!="string"||e.length===0)return 0;let{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:r=!1}=t;if(r||(e=Wt(e)),e.length===0)return 0;let o=0,i={ambiguousAsWide:!n};for(let{segment:s}of Xm.segment(e)){let a=s.codePointAt(0);if(!(a<=31||a>=127&&a<=159)&&!(a>=8203&&a<=8207||a===65279)&&!(a>=768&&a<=879||a>=6832&&a<=6911||a>=7616&&a<=7679||a>=8400&&a<=8447||a>=65056&&a<=65071)&&!(a>=55296&&a<=57343)&&!(a>=65024&&a<=65039)&&!Qm.test(s)){if(Ta().test(s)){o+=2;continue}o+=Ba(a,i)}}return o}var Oa=(e=0)=>t=>`\x1B[${t+e}m`,Ra=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,La=(e=0)=>(t,n,r)=>`\x1B[${38+e};2;${t};${n};${r}m`,I={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]}},VE=Object.keys(I.modifier),Zm=Object.keys(I.color),eD=Object.keys(I.bgColor),GE=[...Zm,...eD];function tD(){let e=new Map;for(let[t,n]of Object.entries(I)){for(let[r,o]of Object.entries(n))I[r]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},n[r]=I[r],e.set(o[0],o[1]);Object.defineProperty(I,t,{value:n,enumerable:!1})}return Object.defineProperty(I,"codes",{value:e,enumerable:!1}),I.color.close="\x1B[39m",I.bgColor.close="\x1B[49m",I.color.ansi=Oa(),I.color.ansi256=Ra(),I.color.ansi16m=La(),I.bgColor.ansi=Oa(10),I.bgColor.ansi256=Ra(10),I.bgColor.ansi16m=La(10),Object.defineProperties(I,{rgbToAnsi256:{value(t,n,r){return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},enumerable:!1},hexToRgb:{value(t){let n=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!n)return[0,0,0];let[r]=n;r.length===3&&(r=[...r].map(i=>i+i).join(""));let o=Number.parseInt(r,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:t=>I.rgbToAnsi256(...I.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let n,r,o;if(t>=232)n=((t-232)*10+8)/255,r=n,o=n;else{t-=16;let a=t%36;n=Math.floor(t/36)/5,r=Math.floor(a/6)/5,o=a%6/5}let i=Math.max(n,r,o)*2;if(i===0)return 30;let s=30+(Math.round(o)<<2|Math.round(r)<<1|Math.round(n));return i===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(t,n,r)=>I.ansi256ToAnsi(I.rgbToAnsi256(t,n,r)),enumerable:!1},hexToAnsi:{value:t=>I.ansi256ToAnsi(I.hexToAnsi256(t)),enumerable:!1}}),I}var nD=tD(),Ia=nD;var vn=new Set(["\x1B","\x9B"]),rD=39,Ao="\x07",Pa="[",oD="]",Na="m",In=`${oD}8;;`,va=e=>`${vn.values().next().value}${Pa}${e}${Na}`,ka=e=>`${vn.values().next().value}${In}${e}${Ao}`,iD=e=>e.split(" ").map(t=>je(t)),Co=(e,t,n)=>{let r=[...t],o=!1,i=!1,s=je(Wt(e.at(-1)));for(let[a,u]of r.entries()){let l=je(u);if(s+l<=n?e[e.length-1]+=u:(e.push(u),s=0),vn.has(u)&&(o=!0,i=r.slice(a+1,a+1+In.length).join("")===In),o){i?u===Ao&&(o=!1,i=!1):u===Na&&(o=!1);continue}s+=l,s===n&&a<r.length-1&&(e.push(""),s=0)}!s&&e.at(-1).length>0&&e.length>1&&(e[e.length-2]+=e.pop())},sD=e=>{let t=e.split(" "),n=t.length;for(;n>0&&!(je(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(" ")+t.slice(n).join("")},aD=(e,t,n={})=>{if(n.trim!==!1&&e.trim()==="")return"";let r="",o,i,s=iD(e),a=[""];for(let[f,d]of e.split(" ").entries()){n.trim!==!1&&(a[a.length-1]=a.at(-1).trimStart());let p=je(a.at(-1));if(f!==0&&(p>=t&&(n.wordWrap===!1||n.trim===!1)&&(a.push(""),p=0),(p>0||n.trim===!1)&&(a[a.length-1]+=" ",p++)),n.hard&&s[f]>t){let m=t-p,g=1+Math.floor((s[f]-m-1)/t);Math.floor((s[f]-1)/t)<g&&a.push(""),Co(a,d,t);continue}if(p+s[f]>t&&p>0&&s[f]>0){if(n.wordWrap===!1&&p<t){Co(a,d,t);continue}a.push("")}if(p+s[f]>t&&n.wordWrap===!1){Co(a,d,t);continue}a[a.length-1]+=d}n.trim!==!1&&(a=a.map(f=>sD(f)));let u=a.join(`
`),l=[...u],c=0;for(let[f,d]of l.entries()){if(r+=d,vn.has(d)){let{groups:m}=new RegExp(`(?:\\${Pa}(?<code>\\d+)m|\\${In}(?<uri>.*)${Ao})`).exec(u.slice(c))||{groups:{}};if(m.code!==void 0){let g=Number.parseFloat(m.code);o=g===rD?void 0:g}else m.uri!==void 0&&(i=m.uri.length===0?void 0:m.uri)}let p=Ia.codes.get(Number(o));l[f+1]===`
`?(i&&(r+=ka("")),o&&p&&(r+=va(p))):d===`
`&&(o&&p&&(r+=va(o)),i&&(r+=ka(i))),c+=d.length}return r};function Bo(e,t,n){return String(e).normalize().replaceAll(`\r
`,`
`).split(`
`).map(r=>aD(r,t,n)).join(`
`)}function zt(e,t){return e.split(`
`).flatMap(n=>Bo(n,t,{trim:!1,hard:!0}).split(`
`).map(r=>r.trimEnd())).join(`
`)}function kn(){return(0,Ma.default)({defaultWidth:80,output:Eo().output})}function uD({active:e,renderedItems:t,pageSize:n,loop:r}){let o=Ue({lastPointer:e,lastActive:void 0}),{lastPointer:i,lastActive:s}=o.current,a=Math.floor(n/2),u=t.reduce((f,d)=>f+d.length,0),l=t.slice(0,e).reduce((f,d)=>f+d.length,0),c=l;if(u>n)if(r)c=i,s!=null&&s<e&&e-s<n&&(c=Math.min(a,Math.abs(e-s)===1?Math.min(i+(t[s]?.length??0),Math.max(l,i)):i+e-s));else{let f=t.slice(e).reduce((d,p)=>d+p.length,0);c=f<n-a?n-f:Math.min(l,a)}return o.current.lastPointer=c,o.current.lastActive=e,c}function To({items:e,active:t,renderItem:n,pageSize:r,loop:o=!0}){let i=kn(),s=y=>(y%e.length+e.length)%e.length,a=e.map((y,b)=>y==null?[]:zt(n({item:y,index:b,isActive:b===t}),i).split(`
`)),u=a.reduce((y,b)=>y+b.length,0),l=y=>a[y]??[],c=uD({active:t,renderedItems:a,pageSize:r,loop:o}),f=l(t).slice(0,r),d=c+f.length<=r?c:r-f.length,p=Array.from({length:r});p.splice(d,f.length,...f);let m=new Set([t]),g=d+f.length,F=s(t+1);for(;g<r&&!m.has(F)&&(o&&u>r?F!==t:F>t);){let b=l(F).slice(0,r-g);p.splice(g,b.length,...b),m.add(F),g+=b.length,F=s(F+1)}for(g=d-1,F=s(t-1);g>=0&&!m.has(F)&&(o&&u>r?F!==t:F<t);){let y=l(F),b=y.slice(Math.max(0,y.length-g-1));p.splice(g-b.length+1,b.length,...b),m.add(F),g-=b.length,F=s(F-1)}return p.filter(y=>typeof y=="string").join(`
`)}var za=R(require("node:readline"),1),Ha=require("node:async_hooks"),Ka=R($a(),1);var _e=[];_e.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&_e.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&_e.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var Pn=e=>!!e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function",Ro=Symbol.for("signal-exit emitter"),Lo=globalThis,cD=Object.defineProperty.bind(Object),Io=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Lo[Ro])return Lo[Ro];cD(Lo,Ro,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,n){this.listeners[t].push(n)}removeListener(t,n){let r=this.listeners[t],o=r.indexOf(n);o!==-1&&(o===0&&r.length===1?r.length=0:r.splice(o,1))}emit(t,n,r){if(this.emitted[t])return!1;this.emitted[t]=!0;let o=!1;for(let i of this.listeners[t])o=i(n,r)===!0||o;return t==="exit"&&(o=this.emit("afterExit",n,r)||o),o}},Nn=class{},fD=e=>({onExit(t,n){return e.onExit(t,n)},load(){return e.load()},unload(){return e.unload()}}),vo=class extends Nn{onExit(){return()=>{}}load(){}unload(){}},ko=class extends Nn{#t=Po.platform==="win32"?"SIGINT":"SIGHUP";#n=new Io;#e;#r;#i;#o={};#s=!1;constructor(t){super(),this.#e=t,this.#o={};for(let n of _e)this.#o[n]=()=>{let r=this.#e.listeners(n),{count:o}=this.#n,i=t;if(typeof i.__signal_exit_emitter__=="object"&&typeof i.__signal_exit_emitter__.count=="number"&&(o+=i.__signal_exit_emitter__.count),r.length===o){this.unload();let s=this.#n.emit("exit",null,n),a=n==="SIGHUP"?this.#t:n;s||t.kill(t.pid,a)}};this.#i=t.reallyExit,this.#r=t.emit}onExit(t,n){if(!Pn(this.#e))return()=>{};this.#s===!1&&this.load();let r=n?.alwaysLast?"afterExit":"exit";return this.#n.on(r,t),()=>{this.#n.removeListener(r,t),this.#n.listeners.exit.length===0&&this.#n.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#s){this.#s=!0,this.#n.count+=1;for(let t of _e)try{let n=this.#o[t];n&&this.#e.on(t,n)}catch{}this.#e.emit=(t,...n)=>this.#u(t,...n),this.#e.reallyExit=t=>this.#a(t)}}unload(){this.#s&&(this.#s=!1,_e.forEach(t=>{let n=this.#o[t];if(!n)throw new Error("Listener not defined for signal: "+t);try{this.#e.removeListener(t,n)}catch{}}),this.#e.emit=this.#r,this.#e.reallyExit=this.#i,this.#n.count-=1)}#a(t){return Pn(this.#e)?(this.#e.exitCode=t||0,this.#n.emit("exit",this.#e.exitCode,null),this.#i.call(this.#e,this.#e.exitCode)):0}#u(t,...n){let r=this.#r;if(t==="exit"&&Pn(this.#e)){typeof n[0]=="number"&&(this.#e.exitCode=n[0]);let o=r.call(this.#e,t,...n);return this.#n.emit("exit",this.#e.exitCode,null),o}else return r.call(this.#e,t,...n)}},Po=globalThis.process,{onExit:Mn,load:oS,unload:iS}=fD(Pn(Po)?new ko(Po):new vo);var Wa=require("node:util");var _a="\x1B[?25l",Va="\x1B[?25h",No=(e=1)=>e>0?`\x1B[${e}A`:"",Mo=(e=1)=>e>0?`\x1B[${e}B`:"",Uo=(e,t)=>typeof t=="number"&&!Number.isNaN(t)?`\x1B[${t+1};${e+1}H`:`\x1B[${e+1}G`,ja="\x1B[2K",$o=e=>e>0?(ja+No(1)).repeat(e-1)+ja+"\x1B[G":"";var Ga=e=>e.split(`
`).length,dD=e=>e.split(`
`).pop()??"",Ht=class{height=0;extraLinesUnderPrompt=0;cursorPos;rl;constructor(t){this.rl=t,this.cursorPos=t.getCursorPos()}write(t){this.rl.output.unmute(),this.rl.output.write(t),this.rl.output.mute()}render(t,n=""){let r=dD(t),o=(0,Wa.stripVTControlCharacters)(r),i=o;this.rl.line.length>0&&(i=i.slice(0,-this.rl.line.length)),this.rl.setPrompt(i),this.cursorPos=this.rl.getCursorPos();let s=kn();t=zt(t,s),n=zt(n,s),o.length%s===0&&(t+=`
`);let a=t+(n?`
`+n:""),l=Math.floor(o.length/s)-this.cursorPos.rows+(n?Ga(n):0);l>0&&(a+=No(l)),a+=Uo(this.cursorPos.cols),this.write(Mo(this.extraLinesUnderPrompt)+$o(this.height)+a),this.extraLinesUnderPrompt=l,this.height=Ga(a)}checkCursorPos(){let t=this.rl.getCursorPos();t.cols!==this.cursorPos.cols&&(this.write(Uo(t.cols)),this.cursorPos=t)}done({clearContent:t}){this.rl.setPrompt("");let n=Mo(this.extraLinesUnderPrompt);n+=t?$o(this.height):`
`,n+=Va,this.write(n),this.rl.close()}};var Un=class extends Promise{static withResolver(){let t,n;return{promise:new Promise((o,i)=>{t=o,n=i}),resolve:t,reject:n}}};function pD(){let e=Error.prepareStackTrace,t=[];try{Error.prepareStackTrace=(n,r)=>{let o=r.slice(1);return t=o,o},new Error().stack}catch{return t}return Error.prepareStackTrace=e,t}function Ve(e){let t=pD();return(r,o={})=>{let{input:i=process.stdin,signal:s}=o,a=new Set,u=new Ka.default;u.pipe(o.output??process.stdout);let l=za.createInterface({terminal:!0,input:i,output:u}),c=new Ht(l),{promise:f,resolve:d,reject:p}=Un.withResolver(),m=()=>p(new On);if(s){let y=()=>p(new Tn({cause:s.reason}));if(s.aborted)return y(),Object.assign(f,{cancel:m});s.addEventListener("abort",y),a.add(()=>s.removeEventListener("abort",y))}a.add(Mn((y,b)=>{p(new Vt(`User force closed the prompt with ${y} ${b}`))}));let g=()=>p(new Vt("User force closed the prompt with SIGINT"));l.on("SIGINT",g),a.add(()=>l.removeListener("SIGINT",g));let F=()=>c.checkCursorPos();return l.input.on("keypress",F),a.add(()=>l.input.removeListener("keypress",F)),ma(l,y=>{let b=Ha.AsyncResource.bind(()=>Ne.clearAll());return l.on("close",b),a.add(()=>l.removeListener("close",b)),y(()=>{try{let h=e(r,E=>{setImmediate(()=>d(E))});if(h===void 0){let E=t[1]?.getFileName();throw new Error(`Prompt functions must return a string.
at ${E}`)}let[S,w]=typeof h=="string"?[h]:h;c.render(S,w),Ne.run()}catch(h){p(h)}}),Object.assign(f.then(h=>(Ne.clearAll(),h),h=>{throw Ne.clearAll(),h}).finally(()=>{a.forEach(h=>h()),c.done({clearContent:!!o.clearPromptOnDone}),u.end()}).then(()=>f),{cancel:m})})}}var Ya=require("node:util");var me=class{separator=(0,Ya.styleText)("dim",Array.from({length:15}).join(ot.line));type="separator";constructor(t){t&&(this.separator=t)}static isSeparator(t){return!!(t&&typeof t=="object"&&"type"in t&&t.type==="separator")}};function qa(e,t){let n=t!==!1;return/^(y|yes)/i.test(e)?n=!0:/^(n|no)/i.test(e)&&(n=!1),n}function Ja(e){return e?"Yes":"No"}var jo=Ve((e,t)=>{let{transformer:n=Ja}=e,[r,o]=_("idle"),[i,s]=_(""),a=pe(e.theme),u=Me({status:r,theme:a});$e((d,p)=>{if(r==="idle")if(ke(d)){let m=qa(i,e.default);s(n(m)),o("done"),t(m)}else if(_t(d)){let m=Ja(!qa(i,e.default));p.clearLine(0),p.write(m),s(m)}else s(p.line)});let l=i,c="";r==="done"?l=a.style.answer(i):c=` ${a.style.defaultAnswer(e.default===!1?"y/N":"Y/n")}`;let f=a.style.message(e.message,r);return`${u} ${f}${c} ${l}`});var mD={validationFailureMode:"keep"},Ge=Ve((e,t)=>{let{prefill:n="tab"}=e,r=pe(mD,e.theme),[o,i]=_("idle"),[s="",a]=_(e.default),[u,l]=_(),[c,f]=_(""),d=Me({status:o,theme:r});async function p(b){let{required:h,pattern:S,patternError:w="Invalid input"}=e;return h&&!b?"You must provide a value":S&&!S.test(b)?w:typeof e.validate=="function"?await e.validate(b)||"You must provide a valid value":!0}$e(async(b,h)=>{if(o==="idle")if(ke(b)){let S=c||s;i("loading");let w=await p(S);w===!0?(f(S),i("done"),t(S)):(r.validationFailureMode==="clear"?f(""):h.write(c),l(w),i("idle"))}else jt(b)&&!c?a(void 0):_t(b)&&!c?(a(void 0),h.clearLine(0),h.write(s),f(s)):(f(h.line),l(void 0))}),de(b=>{n==="editable"&&s&&(b.write(s),f(s))},[]);let m=r.style.message(e.message,o),g=c;typeof e.transformer=="function"?g=e.transformer(c,{isFinal:o==="done"}):o==="done"&&(g=r.style.answer(c));let F;s&&o!=="done"&&!c&&(F=r.style.defaultAnswer(s));let y="";return u&&(y=r.style.error(u)),[[d,m,F,g].filter(b=>b!==void 0).join(" "),y]});var st=require("node:util");var DD={icon:{cursor:ot.pointer},style:{disabled:e=>(0,st.styleText)("dim",`- ${e}`),description:e=>(0,st.styleText)("cyan",e),keysHelpTip:e=>e.map(([t,n])=>`${(0,st.styleText)("bold",t)} ${(0,st.styleText)("dim",n)}`).join((0,st.styleText)("dim"," \u2022 "))},indexMode:"hidden",keybindings:[]};function it(e){return!me.isSeparator(e)&&!e.disabled}function hD(e){return e.map(t=>{if(me.isSeparator(t))return t;if(typeof t!="object"||t===null||!("value"in t)){let o=String(t);return{value:t,name:o,short:o,disabled:!1}}let n=t.name??String(t.value),r={value:t.value,name:n,short:t.short??n,disabled:t.disabled??!1};return t.description&&(r.description=t.description),r})}var De=Ve((e,t)=>{let{loop:n=!0,pageSize:r=7}=e,o=pe(DD,e.theme),{keybindings:i}=o,[s,a]=_("idle"),u=Me({status:s,theme:o}),l=Ue(),c=!i.includes("vim"),f=Gt(()=>hD(e.choices),[e.choices]),d=Gt(()=>{let D=f.findIndex(it),T=f.findLastIndex(it);if(D===-1)throw new nt("[select prompt] No selectable choices. All choices are disabled.");return{first:D,last:T}},[f]),p=Gt(()=>"default"in e?f.findIndex(D=>it(D)&&D.value===e.default):-1,[e.default,f]),[m,g]=_(p===-1?d.first:p),F=f[m];$e((D,T)=>{if(clearTimeout(l.current),ke(D))a("done"),t(F.value);else if($t(D,i)||Bn(D,i)){if(T.clearLine(0),n||$t(D,i)&&m!==d.first||Bn(D,i)&&m!==d.last){let L=$t(D,i)?-1:1,O=m;do O=(O+L+f.length)%f.length;while(!it(f[O]));g(O)}}else if(wo(D)&&!Number.isNaN(Number(T.line))){let L=Number(T.line)-1,O=-1,$=f.findIndex(N=>me.isSeparator(N)?!1:(O++,O===L)),we=f[$];we!=null&&it(we)&&g($),l.current=setTimeout(()=>{T.clearLine(0)},700)}else if(jt(D))T.clearLine(0);else if(c){let L=T.line.toLowerCase(),O=f.findIndex($=>me.isSeparator($)||!it($)?!1:$.name.toLowerCase().startsWith(L));O!==-1&&g(O),l.current=setTimeout(()=>{T.clearLine(0)},700)}}),de(()=>()=>{clearTimeout(l.current)},[]);let y=o.style.message(e.message,s),b=o.style.keysHelpTip([["\u2191\u2193","navigate"],["\u23CE","select"]]),h=0,S=To({items:f,active:m,renderItem({item:D,isActive:T,index:L}){if(me.isSeparator(D))return h++,` ${D.separator}`;let O=o.indexMode==="number"?`${L+1-h}. `:"";if(D.disabled){let N=typeof D.disabled=="string"?D.disabled:"(disabled)";return o.style.disabled(`${O}${D.name} ${N}`)}let $=T?o.style.highlight:N=>N,we=T?o.icon.cursor:" ";return $(`${we} ${O}${D.name}`)},pageSize:r,loop:n});if(s==="done")return[u,y,o.style.answer(F.short)].filter(Boolean).join(" ");let{description:w}=F;return`${[[u,y].filter(Boolean).join(" "),S," ",w?o.style.description(w):"",b].filter(Boolean).join(`
`).trimEnd()}${_a}`});function P(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}var Xa=require("node:url"),at=(e,t)=>{let n=Vo(gD(e));if(typeof n!="string")throw new TypeError(`${t} must be a string or a file URL: ${n}.`);return n},gD=e=>_o(e)?e.toString():e,_o=e=>typeof e!="string"&&e&&Object.getPrototypeOf(e)===String.prototype,Vo=e=>e instanceof URL?(0,Xa.fileURLToPath)(e):e;var $n=(e,t=[],n={})=>{let r=at(e,"First argument"),[o,i]=P(t)?[[],t]:[t,n];if(!Array.isArray(o))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${o}`);if(o.some(u=>typeof u=="object"&&u!==null))throw new TypeError(`Second argument must be an array of strings: ${o}`);let s=o.map(String),a=s.find(u=>u.includes("\0"));if(a!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${a}`);if(!P(i))throw new TypeError(`Last argument must be an options object: ${i}`);return[r,s,i]};var su=require("node:child_process");var Qa=require("node:string_decoder"),{toString:Za}=Object.prototype,eu=e=>Za.call(e)==="[object ArrayBuffer]",U=e=>Za.call(e)==="[object Uint8Array]",he=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),FD=new TextEncoder,tu=e=>FD.encode(e),yD=new TextDecoder,jn=e=>yD.decode(e),nu=(e,t)=>bD(e,t).join(""),bD=(e,t)=>{if(t==="utf8"&&e.every(i=>typeof i=="string"))return e;let n=new Qa.StringDecoder(t),r=e.map(i=>typeof i=="string"?tu(i):i).map(i=>n.write(i)),o=n.end();return o===""?r:[...r,o]},Kt=e=>e.length===1&&U(e[0])?e[0]:Go(wD(e)),wD=e=>e.map(t=>typeof t=="string"?tu(t):t),Go=e=>{let t=new Uint8Array(ED(e)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t},ED=e=>{let t=0;for(let n of e)t+=n.length;return t};var au=e=>Array.isArray(e)&&Array.isArray(e.raw),uu=(e,t)=>{let n=[];for(let[i,s]of e.entries())n=SD({templates:e,expressions:t,tokens:n,index:i,template:s});if(n.length===0)throw new TypeError("Template script must not be empty");let[r,...o]=n;return[r,o,{}]},SD=({templates:e,expressions:t,tokens:n,index:r,template:o})=>{if(o===void 0)throw new TypeError(`Invalid backslash sequence: ${e.raw[r]}`);let{nextTokens:i,leadingWhitespaces:s,trailingWhitespaces:a}=xD(o,e.raw[r]),u=ou(n,i,s);if(r===t.length)return u;let l=t[r],c=Array.isArray(l)?l.map(f=>iu(f)):[iu(l)];return ou(u,c,a)},xD=(e,t)=>{if(t.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let n=[],r=0,o=ru.has(t[0]);for(let s=0,a=0;s<e.length;s+=1,a+=1){let u=t[a];if(ru.has(u))r!==s&&n.push(e.slice(r,s)),r=s+1;else if(u==="\\"){let l=t[a+1];l===`
`?(s-=1,a+=1):l==="u"&&t[a+2]==="{"?a=t.indexOf("}",a+3):a+=CD[l]??1}}let i=r===e.length;return i||n.push(e.slice(r)),{nextTokens:n,leadingWhitespaces:o,trailingWhitespaces:i}},ru=new Set([" "," ","\r",`
`]),CD={x:3,u:5},ou=(e,t,n)=>n||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],iu=e=>{let t=typeof e;if(t==="string")return e;if(t==="number")return String(e);if(P(e)&&("stdout"in e||"isMaxBuffer"in e))return AD(e);throw e instanceof su.ChildProcess||Object.prototype.toString.call(e)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${t}" in template expression`)},AD=({stdout:e})=>{if(typeof e=="string")return e;if(U(e))return jn(e);throw e===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof e}" stdout in template expression`)};var yd=require("node:child_process");var cu=require("node:util");var _n=R(require("node:process"),1),Z=e=>Vn.includes(e),Vn=[_n.default.stdin,_n.default.stdout,_n.default.stderr],J=["stdin","stdout","stderr"],Gn=e=>J[e]??`stdio[${e}]`;var fu=e=>{let t={...e};for(let n of Ho)t[n]=Wo(e,n);return t},Wo=(e,t)=>{let n=Array.from({length:BD(e)+1}),r=TD(e[t],n,t);return vD(r,t)},BD=({stdio:e})=>Array.isArray(e)?Math.max(e.length,J.length):J.length,TD=(e,t,n)=>P(e)?OD(e,t,n):t.fill(e),OD=(e,t,n)=>{for(let r of Object.keys(e).sort(RD))for(let o of LD(r,n,t))t[o]=e[r];return t},RD=(e,t)=>lu(e)<lu(t)?1:-1,lu=e=>e==="stdout"||e==="stderr"?0:e==="all"?2:1,LD=(e,t,n)=>{if(e==="ipc")return[n.length-1];let r=zo(e);if(r===void 0||r===0)throw new TypeError(`"${t}.${e}" is invalid.
It must be "${t}.stdout", "${t}.stderr", "${t}.all", "${t}.ipc", or "${t}.fd3", "${t}.fd4" (and so on).`);if(r>=n.length)throw new TypeError(`"${t}.${e}" is invalid: that file descriptor does not exist.
Please set the "stdio" option to ensure that file descriptor exists.`);return r==="all"?[1,2]:[r]},zo=e=>{if(e==="all")return e;if(J.includes(e))return J.indexOf(e);let t=ID.exec(e);if(t!==null)return Number(t[1])},ID=/^fd(\d+)$/,vD=(e,t)=>e.map(n=>n===void 0?PD[t]:n),kD=(0,cu.debuglog)("execa").enabled?"full":"none",PD={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:kD,stripFinalNewline:!0},Ho=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],ge=(e,t)=>t==="ipc"?e.at(-1):e[t];var ut=({verbose:e},t)=>Ko(e,t)!=="none",lt=({verbose:e},t)=>!["none","short"].includes(Ko(e,t)),du=({verbose:e},t)=>{let n=Ko(e,t);return Wn(n)?n:void 0},Ko=(e,t)=>t===void 0?ND(e):ge(e,t),ND=e=>e.find(t=>Wn(t))??zn.findLast(t=>e.includes(t)),Wn=e=>typeof e=="function",zn=["none","short","full"];var Bu=require("node:util");var pu=require("node:process"),mu=require("node:util"),Du=(e,t)=>{let n=[e,...t],r=n.join(" "),o=n.map(i=>VD(hu(i))).join(" ");return{command:r,escapedCommand:o}},Yt=e=>(0,mu.stripVTControlCharacters)(e).split(`
`).map(t=>hu(t)).join(`
`),hu=e=>e.replaceAll($D,t=>MD(t)),MD=e=>{let t=jD[e];if(t!==void 0)return t;let n=e.codePointAt(0),r=n.toString(16);return n<=_D?`\\u${r.padStart(4,"0")}`:`\\U${r}`},UD=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},$D=UD(),jD={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},_D=65535,VD=e=>GD.test(e)?e:pu.platform==="win32"?`"${e.replaceAll('"','""')}"`:`'${e.replaceAll("'","'\\''")}'`,GD=/^[\w./-]+$/;var Yo=R(require("node:process"),1);function qo(){let{env:e}=Yo.default,{TERM:t,TERM_PROGRAM:n}=e;return Yo.default.platform!=="win32"?t!=="linux":!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||e.ConEmuTask==="{cmd::Cmder}"||n==="Terminus-Sublime"||n==="vscode"||t==="xterm-256color"||t==="alacritty"||t==="rxvt-unicode"||t==="rxvt-unicode-256color"||e.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var gu={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},Fu={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},WD={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},zD={...gu,...Fu},HD={...gu,...WD},KD=qo(),YD=KD?zD:HD,Hn=YD,fx=Object.entries(Fu);var yu=R(require("node:tty"),1),qD=yu.default?.WriteStream?.prototype?.hasColors?.()??!1,B=(e,t)=>{if(!qD)return o=>o;let n=`\x1B[${e}m`,r=`\x1B[${t}m`;return o=>{let i=o+"",s=i.indexOf(r);if(s===-1)return n+i+r;let a=n,u=0,c=(t===22?r:"")+n;for(;s!==-1;)a+=i.slice(u,s)+c,u=s+r.length,s=i.indexOf(r,u);return a+=i.slice(u)+r,a}},px=B(0,0),bu=B(1,22),mx=B(2,22),Dx=B(3,23),hx=B(4,24),gx=B(53,55),Fx=B(7,27),yx=B(8,28),bx=B(9,29),wx=B(30,39),Ex=B(31,39),Sx=B(32,39),xx=B(33,39),Cx=B(34,39),Ax=B(35,39),Bx=B(36,39),Tx=B(37,39),Kn=B(90,39),Ox=B(40,49),Rx=B(41,49),Lx=B(42,49),Ix=B(43,49),vx=B(44,49),kx=B(45,49),Px=B(46,49),Nx=B(47,49),Mx=B(100,49),wu=B(91,39),Ux=B(92,39),Eu=B(93,39),$x=B(94,39),jx=B(95,39),_x=B(96,39),Vx=B(97,39),Gx=B(101,49),Wx=B(102,49),zx=B(103,49),Hx=B(104,49),Kx=B(105,49),Yx=B(106,49),qx=B(107,49);var Cu=({type:e,message:t,timestamp:n,piped:r,commandId:o,result:{failed:i=!1}={},options:{reject:s=!0}})=>{let a=JD(n),u=XD[e]({failed:i,reject:s,piped:r}),l=QD[e]({reject:s});return`${Kn(`[${a}]`)} ${Kn(`[${o}]`)} ${l(u)} ${l(t)}`},JD=e=>`${Yn(e.getHours(),2)}:${Yn(e.getMinutes(),2)}:${Yn(e.getSeconds(),2)}.${Yn(e.getMilliseconds(),3)}`,Yn=(e,t)=>String(e).padStart(t,"0"),Su=({failed:e,reject:t})=>e?t?Hn.cross:Hn.warning:Hn.tick,XD={command:({piped:e})=>e?"|":"$",output:()=>" ",ipc:()=>"*",error:Su,duration:Su},xu=e=>e,QD={command:()=>bu,output:()=>xu,ipc:()=>xu,error:({reject:e})=>e?wu:Eu,duration:()=>Kn};var Au=(e,t,n)=>{let r=du(t,n);return e.map(({verboseLine:o,verboseObject:i})=>ZD(o,i,r)).filter(o=>o!==void 0).map(o=>eh(o)).join("")},ZD=(e,t,n)=>{if(n===void 0)return e;let r=n(e,t);if(typeof r=="string")return r},eh=e=>e.endsWith(`
`)?e:`${e}
`;var oe=({type:e,verboseMessage:t,fdNumber:n,verboseInfo:r,result:o})=>{let i=th({type:e,result:o,verboseInfo:r}),s=nh(t,i),a=Au(s,r,n);a!==""&&console.warn(a.slice(0,-1))},th=({type:e,result:t,verboseInfo:{escapedCommand:n,commandId:r,rawOptions:{piped:o=!1,...i}}})=>({type:e,escapedCommand:n,commandId:`${r}`,timestamp:new Date,piped:o,result:t,options:i}),nh=(e,t)=>e.split(`
`).map(n=>rh({...t,message:n})),rh=e=>({verboseLine:Cu(e),verboseObject:e}),qn=e=>{let t=typeof e=="string"?e:(0,Bu.inspect)(e);return Yt(t).replaceAll(" "," ".repeat(oh))},oh=2;var Tu=(e,t)=>{ut(t)&&oe({type:"command",verboseMessage:e,verboseInfo:t})};var Ou=(e,t,n)=>{ah(e);let r=ih(e);return{verbose:e,escapedCommand:t,commandId:r,rawOptions:n}},ih=e=>ut({verbose:e})?sh++:void 0,sh=0n,ah=e=>{for(let t of e){if(t===!1)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(t===!0)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!zn.includes(t)&&!Wn(t)){let n=zn.map(r=>`'${r}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${t}. Allowed values are: ${n} or a function.`)}}};var Jo=require("node:process"),Jn=()=>Jo.hrtime.bigint(),Xo=e=>Number(Jo.hrtime.bigint()-e)/1e6;var Xn=(e,t,n)=>{let r=Jn(),{command:o,escapedCommand:i}=Du(e,t),s=Wo(n,"verbose"),a=Ou(s,i,{...n});return Tu(i,a),{command:o,escapedCommand:i,startTime:r,verboseInfo:a}};var Gc=R(require("node:path"),1),wi=R(require("node:process"),1),Wc=R(gl(),1);var qt=R(require("node:process"),1),Se=R(require("node:path"),1);function Zn(e={}){let{env:t=process.env,platform:n=process.platform}=e;return n!=="win32"?"PATH":Object.keys(t).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"}var Fl=require("node:util"),ui=require("node:child_process"),ai=R(require("node:path"),1),yl=require("node:url"),v2=(0,Fl.promisify)(ui.execFile);function er(e){return e instanceof URL?(0,yl.fileURLToPath)(e):e}function bl(e){return{*[Symbol.iterator](){let t=ai.default.resolve(er(e)),n;for(;n!==t;)yield t,n=t,t=ai.default.resolve(t,"..")}}}var k2=10*1024*1024;var kh=({cwd:e=qt.default.cwd(),path:t=qt.default.env[Zn()],preferLocal:n=!0,execPath:r=qt.default.execPath,addExecPath:o=!0}={})=>{let i=Se.default.resolve(er(e)),s=[],a=t.split(Se.default.delimiter);return n&&Ph(s,a,i),o&&Nh(s,a,r,i),t===""||t===Se.default.delimiter?`${s.join(Se.default.delimiter)}${t}`:[...s,t].join(Se.default.delimiter)},Ph=(e,t,n)=>{for(let r of bl(n)){let o=Se.default.join(r,"node_modules/.bin");t.includes(o)||e.push(o)}},Nh=(e,t,n,r)=>{let o=Se.default.resolve(r,er(n),"..");t.includes(o)||e.push(o)},wl=({env:e=qt.default.env,...t}={})=>{e={...e};let n=Zn({env:e});return t.path=e[n],e[n]=kh(t),e};var Ml=require("node:timers/promises");var El=(e,t,n)=>{let r=n?dt:xe,o=e instanceof ee?{}:{cause:e};return new r(t,o)},ee=class extends Error{},Sl=(e,t)=>{Object.defineProperty(e.prototype,"name",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,Cl,{value:!0,writable:!1,enumerable:!1,configurable:!1})},xl=e=>tr(e)&&Cl in e,Cl=Symbol("isExecaError"),tr=e=>Object.prototype.toString.call(e)==="[object Error]",xe=class extends Error{};Sl(xe,xe.name);var dt=class extends Error{};Sl(dt,dt.name);var pt=require("node:os");var Ll=require("node:os");var Al=()=>{let e=Tl-Bl+1;return Array.from({length:e},Mh)},Mh=(e,t)=>({name:`SIGRT${t+1}`,number:Bl+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),Bl=34,Tl=64;var Rl=require("node:os");var Ol=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var li=()=>{let e=Al();return[...Ol,...e].map(Uh)},Uh=({name:e,number:t,description:n,action:r,forced:o=!1,standard:i})=>{let{signals:{[e]:s}}=Rl.constants,a=s!==void 0;return{name:e,number:a?s:t,description:n,supported:a,action:r,forced:o,standard:i}};var $h=()=>{let e=li();return Object.fromEntries(e.map(jh))},jh=({name:e,number:t,description:n,supported:r,action:o,forced:i,standard:s})=>[e,{name:e,number:t,description:n,supported:r,action:o,forced:i,standard:s}],Il=$h(),_h=()=>{let e=li(),t=65,n=Array.from({length:t},(r,o)=>Vh(o,e));return Object.assign({},...n)},Vh=(e,t)=>{let n=Gh(e,t);if(n===void 0)return{};let{name:r,description:o,supported:i,action:s,forced:a,standard:u}=n;return{[e]:{name:r,number:e,description:o,supported:i,action:s,forced:a,standard:u}}},Gh=(e,t)=>{let n=t.find(({name:r})=>Ll.constants.signals[r]===e);return n!==void 0?n:t.find(r=>r.number===e)},K2=_h();var kl=e=>{let t="option `killSignal`";if(e===0)throw new TypeError(`Invalid ${t}: 0 cannot be used.`);return Nl(e,t)},Pl=e=>e===0?e:Nl(e,"`subprocess.kill()`'s argument"),Nl=(e,t)=>{if(Number.isInteger(e))return Wh(e,t);if(typeof e=="string")return Hh(e,t);throw new TypeError(`Invalid ${t} ${String(e)}: it must be a string or an integer.
${ci()}`)},Wh=(e,t)=>{if(vl.has(e))return vl.get(e);throw new TypeError(`Invalid ${t} ${e}: this signal integer does not exist.
${ci()}`)},zh=()=>new Map(Object.entries(pt.constants.signals).reverse().map(([e,t])=>[t,e])),vl=zh(),Hh=(e,t)=>{if(e in pt.constants.signals)return e;throw e.toUpperCase()in pt.constants.signals?new TypeError(`Invalid ${t} '${e}': please rename it to '${e.toUpperCase()}'.`):new TypeError(`Invalid ${t} '${e}': this signal name does not exist.
${ci()}`)},ci=()=>`Available signal names: ${Kh()}.
Available signal numbers: ${Yh()}.`,Kh=()=>Object.keys(pt.constants.signals).sort().map(e=>`'${e}'`).join(", "),Yh=()=>[...new Set(Object.values(pt.constants.signals).sort((e,t)=>e-t))].join(", "),nr=e=>Il[e].description;var Ul=e=>{if(e===!1)return e;if(e===!0)return qh;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},qh=1e3*5,$l=({kill:e,options:{forceKillAfterDelay:t,killSignal:n},onInternalError:r,context:o,controller:i},s,a)=>{let{signal:u,error:l}=Jh(s,a,n);Xh(l,r);let c=e(u);return Qh({kill:e,signal:u,forceKillAfterDelay:t,killSignal:n,killResult:c,context:o,controller:i}),c},Jh=(e,t,n)=>{let[r=n,o]=tr(e)?[void 0,e]:[e,t];if(typeof r!="string"&&!Number.isInteger(r))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(r)}`);if(o!==void 0&&!tr(o))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${o}`);return{signal:Pl(r),error:o}},Xh=(e,t)=>{e!==void 0&&t.reject(e)},Qh=async({kill:e,signal:t,forceKillAfterDelay:n,killSignal:r,killResult:o,context:i,controller:s})=>{t===r&&o&&fi({kill:e,forceKillAfterDelay:n,context:i,controllerSignal:s.signal})},fi=async({kill:e,forceKillAfterDelay:t,context:n,controllerSignal:r})=>{if(t!==!1)try{await(0,Ml.setTimeout)(t,void 0,{signal:r}),e("SIGKILL")&&(n.isForcefullyTerminated??=!0)}catch{}};var jl=require("node:events"),rr=async(e,t)=>{e.aborted||await(0,jl.once)(e,"abort",{signal:t})};var _l=({cancelSignal:e})=>{if(e!==void 0&&Object.prototype.toString.call(e)!=="[object AbortSignal]")throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(e)}`)},Vl=({subprocess:e,cancelSignal:t,gracefulCancel:n,context:r,controller:o})=>t===void 0||n?[]:[Zh(e,t,r,o)],Zh=async(e,t,n,{signal:r})=>{throw await rr(t,r),n.terminationReason??="cancel",e.kill(),t.reason};var wc=require("node:timers/promises");var yc=require("node:util");var mt=({methodName:e,isSubprocess:t,ipc:n,isConnected:r})=>{eg(e,t,n),di(e,t,r)},eg=(e,t,n)=>{if(!n)throw new Error(`${te(e,t)} can only be used if the \`ipc\` option is \`true\`.`)},di=(e,t,n)=>{if(!n)throw new Error(`${te(e,t)} cannot be used: the ${Ce(t)} has already exited or disconnected.`)},Gl=e=>{throw new Error(`${te("getOneMessage",e)} could not complete: the ${Ce(e)} exited or disconnected.`)},Wl=e=>{throw new Error(`${te("sendMessage",e)} failed: the ${Ce(e)} is sending a message too, instead of listening to incoming messages.
This can be fixed by both sending a message and listening to incoming messages at the same time:
const [receivedMessage] = await Promise.all([
${te("getOneMessage",e)},
${te("sendMessage",e,"message, {strict: true}")},
]);`)},or=(e,t)=>new Error(`${te("sendMessage",t)} failed when sending an acknowledgment response to the ${Ce(t)}.`,{cause:e}),zl=e=>{throw new Error(`${te("sendMessage",e)} failed: the ${Ce(e)} is not listening to incoming messages.`)},Hl=e=>{throw new Error(`${te("sendMessage",e)} failed: the ${Ce(e)} exited without listening to incoming messages.`)},Kl=()=>new Error(`\`cancelSignal\` aborted: the ${Ce(!0)} disconnected.`),Yl=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},ql=({error:e,methodName:t,isSubprocess:n})=>{if(e.code==="EPIPE")throw new Error(`${te(t,n)} cannot be used: the ${Ce(n)} is disconnecting.`,{cause:e})},Jl=({error:e,methodName:t,isSubprocess:n,message:r})=>{if(tg(e))throw new Error(`${te(t,n)}'s argument type is invalid: the message cannot be serialized: ${String(r)}.`,{cause:e})},tg=({code:e,message:t})=>ng.has(e)||rg.some(n=>t.includes(n)),ng=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),rg=["could not be cloned","circular structure","call stack size exceeded"],te=(e,t,n="")=>e==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${og(t)}${e}(${n})`,og=e=>e?"":"subprocess.",Ce=e=>e?"parent process":"subprocess",Dt=e=>{e.connected&&e.disconnect()};var ie=()=>{let e={},t=new Promise((n,r)=>{Object.assign(e,{resolve:n,reject:r})});return Object.assign(t,e)};var sr=(e,t="stdin")=>{let{options:r,fileDescriptors:o}=se.get(e),i=Xl(o,t,!0),s=e.stdio[i];if(s===null)throw new TypeError(Ql(i,t,r,!0));return s},ht=(e,t="stdout")=>{let{options:r,fileDescriptors:o}=se.get(e),i=Xl(o,t,!1),s=i==="all"?e.all:e.stdio[i];if(s==null)throw new TypeError(Ql(i,t,r,!1));return s},se=new WeakMap,Xl=(e,t,n)=>{let r=ig(t,n);return sg(r,t,n,e),r},ig=(e,t)=>{let n=zo(e);if(n!==void 0)return n;let{validOptions:r,defaultValue:o}=t?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${Jt(t)}" must not be "${e}".
It must be ${r} or "fd3", "fd4" (and so on).
It is optional and defaults to "${o}".`)},sg=(e,t,n,r)=>{let o=r[Zl(e)];if(o===void 0)throw new TypeError(`"${Jt(n)}" must not be ${t}. That file descriptor does not exist.
Please set the "stdio" option to ensure that file descriptor exists.`);if(o.direction==="input"&&!n)throw new TypeError(`"${Jt(n)}" must not be ${t}. It must be a readable stream, not writable.`);if(o.direction!=="input"&&n)throw new TypeError(`"${Jt(n)}" must not be ${t}. It must be a writable stream, not readable.`)},Ql=(e,t,n,r)=>{if(e==="all"&&!n.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:o,optionValue:i}=ag(e,n);return`The "${o}: ${ir(i)}" option is incompatible with using "${Jt(r)}: ${ir(t)}".
Please set this option with "pipe" instead.`},ag=(e,{stdin:t,stdout:n,stderr:r,stdio:o})=>{let i=Zl(e);return i===0&&t!==void 0?{optionName:"stdin",optionValue:t}:i===1&&n!==void 0?{optionName:"stdout",optionValue:n}:i===2&&r!==void 0?{optionName:"stderr",optionValue:r}:{optionName:`stdio[${i}]`,optionValue:o[i]}},Zl=e=>e==="all"?1:e,Jt=e=>e?"to":"from",ir=e=>typeof e=="string"?`'${e}'`:typeof e=="number"?`${e}`:"Stream";var dc=require("node:events");var ec=require("node:events"),We=(e,t,n)=>{let r=e.getMaxListeners();r===0||r===Number.POSITIVE_INFINITY||(e.setMaxListeners(r+t),(0,ec.addAbortListener)(n,()=>{e.setMaxListeners(e.getMaxListeners()-t)}))};var fc=require("node:events");var rc=require("node:events"),oc=require("node:timers/promises");var ar=(e,t)=>{t&&pi(e)},pi=e=>{e.refCounted()},ur=(e,t)=>{t&&mi(e)},mi=e=>{e.unrefCounted()},tc=(e,t)=>{t&&(mi(e),mi(e))},nc=(e,t)=>{t&&(pi(e),pi(e))};var ic=async({anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r},o)=>{if(uc(o)||cc(o))return;lr.has(e)||lr.set(e,[]);let i=lr.get(e);if(i.push(o),!(i.length>1))for(;i.length>0;){await lc(e,r,o),await oc.scheduler.yield();let s=await ac({wrappedMessage:i[0],anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r});i.shift(),r.emit("message",s),r.emit("message:done")}},sc=async({anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r,boundOnMessage:o})=>{Di();let i=lr.get(e);for(;i?.length>0;)await(0,rc.once)(r,"message:done");e.removeListener("message",o),nc(t,n),r.connected=!1,r.emit("disconnect")},lr=new WeakMap;var Ae=(e,t,n)=>{if(cr.has(e))return cr.get(e);let r=new fc.EventEmitter;return r.connected=!0,cr.set(e,r),ug({ipcEmitter:r,anyProcess:e,channel:t,isSubprocess:n}),r},cr=new WeakMap,ug=({ipcEmitter:e,anyProcess:t,channel:n,isSubprocess:r})=>{let o=ic.bind(void 0,{anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:e});t.on("message",o),t.once("disconnect",sc.bind(void 0,{anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:e,boundOnMessage:o})),tc(n,r)},fr=e=>{let t=cr.get(e);return t===void 0?e.channel!==null:t.connected};var pc=({anyProcess:e,channel:t,isSubprocess:n,message:r,strict:o})=>{if(!o)return r;let i=Ae(e,t,n),s=mr(e,i);return{id:lg++,type:pr,message:r,hasListeners:s}},lg=0n,mc=(e,t)=>{if(!(t?.type!==pr||t.hasListeners))for(let{id:n}of e)n!==void 0&&dr[n].resolve({isDeadlock:!0,hasListeners:!1})},ac=async({wrappedMessage:e,anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:o})=>{if(e?.type!==pr||!t.connected)return e;let{id:i,message:s}=e,a={id:i,type:hc,message:mr(t,o)};try{await Dr({anyProcess:t,channel:n,isSubprocess:r,ipc:!0},a)}catch(u){o.emit("strict:error",u)}return s},uc=e=>{if(e?.type!==hc)return!1;let{id:t,message:n}=e;return dr[t]?.resolve({isDeadlock:!1,hasListeners:n}),!0},Dc=async(e,t,n)=>{if(e?.type!==pr)return;let r=ie();dr[e.id]=r;let o=new AbortController;try{let{isDeadlock:i,hasListeners:s}=await Promise.race([r,cg(t,n,o)]);i&&Wl(n),s||zl(n)}finally{o.abort(),delete dr[e.id]}},dr={},cg=async(e,t,{signal:n})=>{We(e,1,n),await(0,dc.once)(e,"disconnect",{signal:n}),Hl(t)},pr="execa:ipc:request",hc="execa:ipc:response";var gc=(e,t,n)=>{Xt.has(e)||Xt.set(e,new Set);let r=Xt.get(e),o=ie(),i=n?t.id:void 0,s={onMessageSent:o,id:i};return r.add(s),{outgoingMessages:r,outgoingMessage:s}},Fc=({outgoingMessages:e,outgoingMessage:t})=>{e.delete(t),t.onMessageSent.resolve()},lc=async(e,t,n)=>{for(;!mr(e,t)&&Xt.get(e)?.size>0;){let r=[...Xt.get(e)];mc(r,n),await Promise.all(r.map(({onMessageSent:o})=>o))}},Xt=new WeakMap,mr=(e,t)=>t.listenerCount("message")>fg(e),fg=e=>se.has(e)&&!ge(se.get(e).options.buffer,"ipc")?1:0;var Dr=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},o,{strict:i=!1}={})=>{let s="sendMessage";return mt({methodName:s,isSubprocess:n,ipc:r,isConnected:e.connected}),dg({anyProcess:e,channel:t,methodName:s,isSubprocess:n,message:o,strict:i})},dg=async({anyProcess:e,channel:t,methodName:n,isSubprocess:r,message:o,strict:i})=>{let s=pc({anyProcess:e,channel:t,isSubprocess:r,message:o,strict:i}),a=gc(e,s,i);try{await gi({anyProcess:e,methodName:n,isSubprocess:r,wrappedMessage:s,message:o})}catch(u){throw Dt(e),u}finally{Fc(a)}},gi=async({anyProcess:e,methodName:t,isSubprocess:n,wrappedMessage:r,message:o})=>{let i=pg(e);try{await Promise.all([Dc(r,e,n),i(r)])}catch(s){throw ql({error:s,methodName:t,isSubprocess:n}),Jl({error:s,methodName:t,isSubprocess:n,message:o}),s}},pg=e=>{if(hi.has(e))return hi.get(e);let t=(0,yc.promisify)(e.send.bind(e));return hi.set(e,t),t},hi=new WeakMap;var Ec=(e,t)=>{let n="cancelSignal";return di(n,!1,e.connected),gi({anyProcess:e,methodName:n,isSubprocess:!1,wrappedMessage:{type:xc,message:t},message:t})},Sc=async({anyProcess:e,channel:t,isSubprocess:n,ipc:r})=>(await mg({anyProcess:e,channel:t,isSubprocess:n,ipc:r}),Fi.signal),mg=async({anyProcess:e,channel:t,isSubprocess:n,ipc:r})=>{if(!bc){if(bc=!0,!r){Yl();return}if(t===null){Di();return}Ae(e,t,n),await wc.scheduler.yield()}},bc=!1,cc=e=>e?.type!==xc?!1:(Fi.abort(e.message),!0),xc="execa:ipc:cancel",Di=()=>{Fi.abort(Kl())},Fi=new AbortController;var Cc=({gracefulCancel:e,cancelSignal:t,ipc:n,serialization:r})=>{if(e){if(t===void 0)throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!n)throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(r==="json")throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},Ac=({subprocess:e,cancelSignal:t,gracefulCancel:n,forceKillAfterDelay:r,context:o,controller:i})=>n?[Dg({subprocess:e,cancelSignal:t,forceKillAfterDelay:r,context:o,controller:i})]:[],Dg=async({subprocess:e,cancelSignal:t,forceKillAfterDelay:n,context:r,controller:{signal:o}})=>{await rr(t,o);let i=hg(t);throw await Ec(e,i),fi({kill:e.kill,forceKillAfterDelay:n,context:r,controllerSignal:o}),r.terminationReason??="gracefulCancel",t.reason},hg=({reason:e})=>{if(!(e instanceof DOMException))return e;let t=new Error(e.message);return Object.defineProperty(t,"stack",{value:e.stack,enumerable:!1,configurable:!0,writable:!0}),t};var Bc=require("node:timers/promises");var Tc=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},Oc=(e,t,n,r)=>t===0||t===void 0?[]:[gg(e,t,n,r)],gg=async(e,t,n,{signal:r})=>{throw await(0,Bc.setTimeout)(t,void 0,{signal:r}),n.terminationReason??="timeout",e.kill(),new ee};var hr=require("node:process"),yi=R(require("node:path"),1);var Rc=({options:e})=>{if(e.node===!1)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...e,node:!0}}},Lc=(e,t,{node:n=!1,nodePath:r=hr.execPath,nodeOptions:o=hr.execArgv.filter(u=>!u.startsWith("--inspect")),cwd:i,execPath:s,...a})=>{if(s!==void 0)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let u=at(r,'The "nodePath" option'),l=yi.default.resolve(i,u),c={...a,nodePath:l,node:n,cwd:i};if(!n)return[e,t,c];if(yi.default.basename(e,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[l,[...o,e,...t],{ipc:!0,...c,shell:!1}]};var Ic=require("node:v8"),vc=({ipcInput:e,ipc:t,serialization:n})=>{if(e!==void 0){if(!t)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");bg[n](e)}},Fg=e=>{try{(0,Ic.serialize)(e)}catch(t){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:t})}},yg=e=>{try{JSON.stringify(e)}catch(t){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:t})}},bg={advanced:Fg,json:yg},kc=async(e,t)=>{t!==void 0&&await e.sendMessage(t)};var Nc=({encoding:e})=>{if(bi.has(e))return;let t=Eg(e);if(t!==void 0)throw new TypeError(`Invalid option \`encoding: ${gr(e)}\`.
Please rename it to ${gr(t)}.`);let n=[...bi].map(r=>gr(r)).join(", ");throw new TypeError(`Invalid option \`encoding: ${gr(e)}\`.
Please rename it to one of: ${n}.`)},wg=new Set(["utf8","utf16le"]),K=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),bi=new Set([...wg,...K]),Eg=e=>{if(e===null)return"buffer";if(typeof e!="string")return;let t=e.toLowerCase();if(t in Pc)return Pc[t];if(bi.has(t))return t},Pc={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},gr=e=>typeof e=="string"?`"${e}"`:String(e);var Mc=require("node:fs"),Uc=R(require("node:path"),1),$c=R(require("node:process"),1);var jc=(e=_c())=>{let t=at(e,'The "cwd" option');return Uc.default.resolve(t)},_c=()=>{try{return $c.default.cwd()}catch(e){throw e.message=`The current directory does not exist.
${e.message}`,e}},Vc=(e,t)=>{if(t===_c())return e;let n;try{n=(0,Mc.statSync)(t)}catch(r){return`The "cwd" option is invalid: ${t}.
${r.message}
${e}`}return n.isDirectory()?e:`The "cwd" option is not a directory: ${t}.
${e}`};var Fr=(e,t,n)=>{n.cwd=jc(n.cwd);let[r,o,i]=Lc(e,t,n),{command:s,args:a,options:u}=Wc.default._parse(r,o,i),l=fu(u),c=Sg(l);return Tc(c),Nc(c),vc(c),_l(c),Cc(c),c.shell=Vo(c.shell),c.env=xg(c),c.killSignal=kl(c.killSignal),c.forceKillAfterDelay=Ul(c.forceKillAfterDelay),c.lines=c.lines.map((f,d)=>f&&!K.has(c.encoding)&&c.buffer[d]),wi.default.platform==="win32"&&Gc.default.basename(s,".exe")==="cmd"&&a.unshift("/q"),{file:s,commandArguments:a,options:c}},Sg=({extendEnv:e=!0,preferLocal:t=!1,cwd:n,localDir:r=n,encoding:o="utf8",reject:i=!0,cleanup:s=!0,all:a=!1,windowsHide:u=!0,killSignal:l="SIGTERM",forceKillAfterDelay:c=!0,gracefulCancel:f=!1,ipcInput:d,ipc:p=d!==void 0||f,serialization:m="advanced",...g})=>({...g,extendEnv:e,preferLocal:t,cwd:n,localDirectory:r,encoding:o,reject:i,cleanup:s,all:a,windowsHide:u,killSignal:l,forceKillAfterDelay:c,gracefulCancel:f,ipcInput:d,ipc:p,serialization:m}),xg=({env:e,extendEnv:t,preferLocal:n,node:r,localDirectory:o,nodePath:i})=>{let s=t?{...wi.default.env,...e}:e;return n||r?wl({env:s,cwd:o,execPath:i,preferLocal:n,addExecPath:r}):s};var yr=(e,t,n)=>n.shell&&t.length>0?[[e,...t].join(" "),[],n]:[e,t,n];var pf=require("node:util");function gt(e){if(typeof e=="string")return Cg(e);if(!(ArrayBuffer.isView(e)&&e.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return Ag(e)}var Cg=e=>e.at(-1)===zc?e.slice(0,e.at(-2)===Hc?-2:-1):e,Ag=e=>e.at(-1)===Bg?e.subarray(0,e.at(-2)===Tg?-2:-1):e,zc=`
`,Bg=zc.codePointAt(0),Hc="\r",Tg=Hc.codePointAt(0);var of=require("node:events"),sf=require("node:stream/promises");function ne(e,{checkOpen:t=!0}={}){return e!==null&&typeof e=="object"&&(e.writable||e.readable||!t||e.writable===void 0&&e.readable===void 0)&&typeof e.pipe=="function"}function Ei(e,{checkOpen:t=!0}={}){return ne(e,{checkOpen:t})&&(e.writable||!t)&&typeof e.write=="function"&&typeof e.end=="function"&&typeof e.writable=="boolean"&&typeof e.writableObjectMode=="boolean"&&typeof e.destroy=="function"&&typeof e.destroyed=="boolean"}function ze(e,{checkOpen:t=!0}={}){return ne(e,{checkOpen:t})&&(e.readable||!t)&&typeof e.read=="function"&&typeof e.readable=="boolean"&&typeof e.readableObjectMode=="boolean"&&typeof e.destroy=="function"&&typeof e.destroyed=="boolean"}function Si(e,t){return Ei(e,t)&&ze(e,t)}var Og=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),xi=class{#t;#n;#e=!1;#r=void 0;constructor(t,n){this.#t=t,this.#n=n}next(){let t=()=>this.#i();return this.#r=this.#r?this.#r.then(t,t):t(),this.#r}return(t){let n=()=>this.#o(t);return this.#r?this.#r.then(n,n):n()}async#i(){if(this.#e)return{done:!0,value:void 0};let t;try{t=await this.#t.read()}catch(n){throw this.#r=void 0,this.#e=!0,this.#t.releaseLock(),n}return t.done&&(this.#r=void 0,this.#e=!0,this.#t.releaseLock()),t}async#o(t){if(this.#e)return{done:!0,value:t};if(this.#e=!0,!this.#n){let n=this.#t.cancel(t);return this.#t.releaseLock(),await n,{done:!0,value:t}}return this.#t.releaseLock(),{done:!0,value:t}}},Ci=Symbol();function Kc(){return this[Ci].next()}Object.defineProperty(Kc,"name",{value:"next"});function Yc(e){return this[Ci].return(e)}Object.defineProperty(Yc,"name",{value:"return"});var Rg=Object.create(Og,{next:{enumerable:!0,configurable:!0,writable:!0,value:Kc},return:{enumerable:!0,configurable:!0,writable:!0,value:Yc}});function Ai({preventCancel:e=!1}={}){let t=this.getReader(),n=new xi(t,e),r=Object.create(Rg);return r[Ci]=n,r}var qc=e=>{if(ze(e,{checkOpen:!1})&&Qt.on!==void 0)return Ig(e);if(typeof e?.[Symbol.asyncIterator]=="function")return e;if(Lg.call(e)==="[object ReadableStream]")return Ai.call(e);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:Lg}=Object.prototype,Ig=async function*(e){let t=new AbortController,n={};vg(e,t,n);try{for await(let[r]of Qt.on(e,"data",{signal:t.signal}))yield r}catch(r){if(n.error!==void 0)throw n.error;if(!t.signal.aborted)throw r}finally{e.destroy()}},vg=async(e,t,n)=>{try{await Qt.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(r){n.error=r}finally{t.abort()}},Qt={};var Ft=async(e,{init:t,convertChunk:n,getSize:r,truncateChunk:o,addChunk:i,getFinalChunk:s,finalize:a},{maxBuffer:u=Number.POSITIVE_INFINITY}={})=>{let l=qc(e),c=t();c.length=0;try{for await(let f of l){let d=Pg(f),p=n[d](f,c);Qc({convertedChunk:p,state:c,getSize:r,truncateChunk:o,addChunk:i,maxBuffer:u})}return kg({state:c,convertChunk:n,getSize:r,truncateChunk:o,addChunk:i,getFinalChunk:s,maxBuffer:u}),a(c)}catch(f){let d=typeof f=="object"&&f!==null?f:new Error(f);throw d.bufferedData=a(c),d}},kg=({state:e,getSize:t,truncateChunk:n,addChunk:r,getFinalChunk:o,maxBuffer:i})=>{let s=o(e);s!==void 0&&Qc({convertedChunk:s,state:e,getSize:t,truncateChunk:n,addChunk:r,maxBuffer:i})},Qc=({convertedChunk:e,state:t,getSize:n,truncateChunk:r,addChunk:o,maxBuffer:i})=>{let s=n(e),a=t.length+s;if(a<=i){Jc(e,t,o,a);return}let u=r(e,i-t.length);throw u!==void 0&&Jc(u,t,o,i),new ae},Jc=(e,t,n,r)=>{t.contents=n(e,t,r),t.length=r},Pg=e=>{let t=typeof e;if(t==="string")return"string";if(t!=="object"||e===null)return"others";if(globalThis.Buffer?.isBuffer(e))return"buffer";let n=Xc.call(e);return n==="[object ArrayBuffer]"?"arrayBuffer":n==="[object DataView]"?"dataView":Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&Xc.call(e.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:Xc}=Object.prototype,ae=class extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}};var Fe=e=>e,Zt=()=>{},br=({contents:e})=>e,wr=e=>{throw new Error(`Streams in object mode are not supported: ${String(e)}`)},Er=e=>e.length;async function Sr(e,t){return Ft(e,$g,t)}var Ng=()=>({contents:[]}),Mg=()=>1,Ug=(e,{contents:t})=>(t.push(e),t),$g={init:Ng,convertChunk:{string:Fe,buffer:Fe,arrayBuffer:Fe,dataView:Fe,typedArray:Fe,others:Fe},getSize:Mg,truncateChunk:Zt,addChunk:Ug,getFinalChunk:Zt,finalize:br};async function xr(e,t){return Ft(e,Yg,t)}var jg=()=>({contents:new ArrayBuffer(0)}),_g=e=>Vg.encode(e),Vg=new TextEncoder,Zc=e=>new Uint8Array(e),ef=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),Gg=(e,t)=>e.slice(0,t),Wg=(e,{contents:t,length:n},r)=>{let o=rf()?Hg(t,r):zg(t,r);return new Uint8Array(o).set(e,n),o},zg=(e,t)=>{if(t<=e.byteLength)return e;let n=new ArrayBuffer(nf(t));return new Uint8Array(n).set(new Uint8Array(e),0),n},Hg=(e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;let n=new ArrayBuffer(t,{maxByteLength:nf(t)});return new Uint8Array(n).set(new Uint8Array(e),0),n},nf=e=>tf**Math.ceil(Math.log(e)/Math.log(tf)),tf=2,Kg=({contents:e,length:t})=>rf()?e:e.slice(0,t),rf=()=>"resize"in ArrayBuffer.prototype,Yg={init:jg,convertChunk:{string:_g,buffer:Zc,arrayBuffer:Zc,dataView:ef,typedArray:ef,others:wr},getSize:Er,truncateChunk:Gg,addChunk:Wg,getFinalChunk:Zt,finalize:Kg};async function Ar(e,t){return Ft(e,Zg,t)}var qg=()=>({contents:"",textDecoder:new TextDecoder}),Cr=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),Jg=(e,{contents:t})=>t+e,Xg=(e,t)=>e.slice(0,t),Qg=({textDecoder:e})=>{let t=e.decode();return t===""?void 0:t},Zg={init:qg,convertChunk:{string:Fe,buffer:Cr,arrayBuffer:Cr,dataView:Cr,typedArray:Cr,others:wr},getSize:Er,truncateChunk:Xg,addChunk:Jg,getFinalChunk:Qg,finalize:br};Object.assign(Qt,{on:of.on,finished:sf.finished});var af=({error:e,stream:t,readableObjectMode:n,lines:r,encoding:o,fdNumber:i})=>{if(!(e instanceof ae))throw e;if(i==="all")return e;let s=e0(n,r,o);throw e.maxBufferInfo={fdNumber:i,unit:s},t.destroy(),e},e0=(e,t,n)=>e?"objects":t?"lines":n==="buffer"?"bytes":"characters",uf=(e,t,n)=>{if(t.length!==n)return;let r=new ae;throw r.maxBufferInfo={fdNumber:"ipc"},r},lf=(e,t)=>{let{streamName:n,threshold:r,unit:o}=t0(e,t);return`Command's ${n} was larger than ${r} ${o}`},t0=(e,t)=>{if(e?.maxBufferInfo===void 0)return{streamName:"output",threshold:t[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:n,unit:r}}=e;delete e.maxBufferInfo;let o=ge(t,n);return n==="ipc"?{streamName:"IPC output",threshold:o,unit:"messages"}:{streamName:Gn(n),threshold:o,unit:r}},cf=(e,t,n)=>e?.code==="ENOBUFS"&&t!==null&&t.some(r=>r!==null&&r.length>Br(n)),ff=(e,t,n)=>{if(!t)return e;let r=Br(n);return e.length>r?e.slice(0,r):e},Br=([,e])=>e;var mf=({stdio:e,all:t,ipcOutput:n,originalError:r,signal:o,signalDescription:i,exitCode:s,escapedCommand:a,timedOut:u,isCanceled:l,isGracefullyCanceled:c,isMaxBuffer:f,isForcefullyTerminated:d,forceKillAfterDelay:p,killSignal:m,maxBuffer:g,timeout:F,cwd:y})=>{let b=r?.code,h=n0({originalError:r,timedOut:u,timeout:F,isMaxBuffer:f,maxBuffer:g,errorCode:b,signal:o,signalDescription:i,exitCode:s,isCanceled:l,isGracefullyCanceled:c,isForcefullyTerminated:d,forceKillAfterDelay:p,killSignal:m}),S=o0(r,y),w=S===void 0?"":`
${S}`,E=`${h}: ${a}${w}`,D=t===void 0?[e[2],e[1]]:[t],T=[E,...D,...e.slice(3),n.map(L=>i0(L)).join(`
`)].map(L=>Yt(gt(s0(L)))).filter(Boolean).join(`
`);return{originalMessage:S,shortMessage:E,message:T}},n0=({originalError:e,timedOut:t,timeout:n,isMaxBuffer:r,maxBuffer:o,errorCode:i,signal:s,signalDescription:a,exitCode:u,isCanceled:l,isGracefullyCanceled:c,isForcefullyTerminated:f,forceKillAfterDelay:d,killSignal:p})=>{let m=r0(f,d);return t?`Command timed out after ${n} milliseconds${m}`:c?s===void 0?`Command was gracefully canceled with exit code ${u}`:f?`Command was gracefully canceled${m}`:`Command was gracefully canceled with ${s} (${a})`:l?`Command was canceled${m}`:r?`${lf(e,o)}${m}`:i!==void 0?`Command failed with ${i}${m}`:f?`Command was killed with ${p} (${nr(p)})${m}`:s!==void 0?`Command was killed with ${s} (${a})`:u!==void 0?`Command failed with exit code ${u}`:"Command failed"},r0=(e,t)=>e?` and was forcefully terminated after ${t} milliseconds`:"",o0=(e,t)=>{if(e instanceof ee)return;let n=xl(e)?e.originalMessage:String(e?.message??e),r=Yt(Vc(n,t));return r===""?void 0:r},i0=e=>typeof e=="string"?e:(0,pf.inspect)(e),s0=e=>Array.isArray(e)?e.map(t=>gt(df(t))).filter(Boolean).join(`
`):df(e),df=e=>typeof e=="string"?e:U(e)?jn(e):"";var Tr=({command:e,escapedCommand:t,stdio:n,all:r,ipcOutput:o,options:{cwd:i},startTime:s})=>Df({command:e,escapedCommand:t,cwd:i,durationMs:Xo(s),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:n[1],stderr:n[2],all:r,stdio:n,ipcOutput:o,pipedFrom:[]}),yt=({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:o,startTime:i,isSync:s})=>en({error:e,command:t,escapedCommand:n,startTime:i,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:r.length}),ipcOutput:[],options:o,isSync:s}),en=({error:e,command:t,escapedCommand:n,startTime:r,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:u,exitCode:l,signal:c,stdio:f,all:d,ipcOutput:p,options:{timeoutDuration:m,timeout:g=m,forceKillAfterDelay:F,killSignal:y,cwd:b,maxBuffer:h},isSync:S})=>{let{exitCode:w,signal:E,signalDescription:D}=u0(l,c),{originalMessage:T,shortMessage:L,message:O}=mf({stdio:f,all:d,ipcOutput:p,originalError:e,signal:E,signalDescription:D,exitCode:w,escapedCommand:n,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:u,forceKillAfterDelay:F,killSignal:y,maxBuffer:h,timeout:g,cwd:b}),$=El(e,O,S);return Object.assign($,a0({error:$,command:t,escapedCommand:n,startTime:r,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:u,exitCode:w,signal:E,signalDescription:D,stdio:f,all:d,ipcOutput:p,cwd:b,originalMessage:T,shortMessage:L})),$},a0=({error:e,command:t,escapedCommand:n,startTime:r,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:u,exitCode:l,signal:c,signalDescription:f,stdio:d,all:p,ipcOutput:m,cwd:g,originalMessage:F,shortMessage:y})=>Df({shortMessage:y,originalMessage:F,command:t,escapedCommand:n,cwd:g,durationMs:Xo(r),failed:!0,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isTerminated:c!==void 0,isMaxBuffer:a,isForcefullyTerminated:u,exitCode:l,signal:c,signalDescription:f,code:e.cause?.code,stdout:d[1],stderr:d[2],all:p,stdio:d,ipcOutput:m,pipedFrom:[]}),Df=e=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0)),u0=(e,t)=>{let n=e===null?void 0:e,r=t===null?void 0:t,o=r===void 0?void 0:nr(t);return{exitCode:n,signal:r,signalDescription:o}};var hf=e=>Number.isFinite(e)?e:0;function l0(e){return{days:Math.trunc(e/864e5),hours:Math.trunc(e/36e5%24),minutes:Math.trunc(e/6e4%60),seconds:Math.trunc(e/1e3%60),milliseconds:Math.trunc(e%1e3),microseconds:Math.trunc(hf(e*1e3)%1e3),nanoseconds:Math.trunc(hf(e*1e6)%1e3)}}function c0(e){return{days:e/86400000n,hours:e/3600000n%24n,minutes:e/60000n%60n,seconds:e/1000n%60n,milliseconds:e%1000n,microseconds:0n,nanoseconds:0n}}function Bi(e){switch(typeof e){case"number":{if(Number.isFinite(e))return l0(e);break}case"bigint":return c0(e)}throw new TypeError("Expected a finite number or bigint")}var f0=e=>e===0||e===0n,d0=(e,t)=>t===1||t===1n?e:`${e}s`,p0=1e-7,m0=24n*60n*60n*1000n;function Ti(e,t){let n=typeof e=="bigint";if(!n&&!Number.isFinite(e))throw new TypeError("Expected a finite number or bigint");t={...t};let r=e<0?"-":"";e=e<0?-e:e,t.colonNotation&&(t.compact=!1,t.formatSubMilliseconds=!1,t.separateMilliseconds=!1,t.verbose=!1),t.compact&&(t.unitCount=1,t.secondsDecimalDigits=0,t.millisecondsDecimalDigits=0);let o=[],i=(c,f)=>{let d=Math.floor(c*10**f+p0);return(Math.round(d)/10**f).toFixed(f)},s=(c,f,d,p)=>{if(!((o.length===0||!t.colonNotation)&&f0(c)&&!(t.colonNotation&&d==="m"))){if(p??=String(c),t.colonNotation){let m=p.includes(".")?p.split(".")[0].length:p.length,g=o.length>0?2:1;p="0".repeat(Math.max(0,g-m))+p}else p+=t.verbose?" "+d0(f,c):d;o.push(p)}},a=Bi(e),u=BigInt(a.days);if(t.hideYearAndDays?s(BigInt(u)*24n+BigInt(a.hours),"hour","h"):(t.hideYear?s(u,"day","d"):(s(u/365n,"year","y"),s(u%365n,"day","d")),s(Number(a.hours),"hour","h")),s(Number(a.minutes),"minute","m"),!t.hideSeconds)if(t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3&&!t.subSecondsAsDecimals){let c=Number(a.seconds),f=Number(a.milliseconds),d=Number(a.microseconds),p=Number(a.nanoseconds);if(s(c,"second","s"),t.formatSubMilliseconds)s(f,"millisecond","ms"),s(d,"microsecond","\xB5s"),s(p,"nanosecond","ns");else{let m=f+d/1e3+p/1e6,g=typeof t.millisecondsDecimalDigits=="number"?t.millisecondsDecimalDigits:0,F=m>=1?Math.round(m):Math.ceil(m),y=g?m.toFixed(g):F;s(Number.parseFloat(y),"millisecond","ms",y)}}else{let c=(n?Number(e%m0):e)/1e3%60,f=typeof t.secondsDecimalDigits=="number"?t.secondsDecimalDigits:1,d=i(c,f),p=t.keepDecimalsOnWholeSeconds?d:d.replace(/\.0+$/,"");s(Number.parseFloat(p),"second","s",p)}if(o.length===0)return r+"0"+(t.verbose?" milliseconds":"ms");let l=t.colonNotation?":":" ";return typeof t.unitCount=="number"&&(o=o.slice(0,Math.max(t.unitCount,1))),r+o.join(l)}var gf=(e,t)=>{e.failed&&oe({type:"error",verboseMessage:e.shortMessage,verboseInfo:t,result:e})};var Ff=(e,t)=>{ut(t)&&(gf(e,t),D0(e,t))},D0=(e,t)=>{let n=`(done in ${Ti(e.durationMs)})`;oe({type:"duration",verboseMessage:n,verboseInfo:t,result:e})};var bt=(e,t,{reject:n})=>{if(Ff(e,t),e.failed&&n)throw e;return e};var Ni=require("node:fs");var wf=(e,t)=>He(e)?"asyncGenerator":xf(e)?"generator":Or(e)?"fileUrl":b0(e)?"filePath":S0(e)?"webStream":ne(e,{checkOpen:!1})?"native":U(e)?"uint8Array":x0(e)?"asyncIterable":C0(e)?"iterable":Li(e)?Ef({transform:e},t):y0(e)?h0(e,t):"native",h0=(e,t)=>Si(e.transform,{checkOpen:!1})?g0(e,t):Li(e.transform)?Ef(e,t):F0(e,t),g0=(e,t)=>(Sf(e,t,"Duplex stream"),"duplex"),Ef=(e,t)=>(Sf(e,t,"web TransformStream"),"webTransform"),Sf=({final:e,binary:t,objectMode:n},r,o)=>{yf(e,`${r}.final`,o),yf(t,`${r}.binary`,o),Oi(n,`${r}.objectMode`)},yf=(e,t,n)=>{if(e!==void 0)throw new TypeError(`The \`${t}\` option can only be defined when using a generator, not a ${n}.`)},F0=({transform:e,final:t,binary:n,objectMode:r},o)=>{if(e!==void 0&&!bf(e))throw new TypeError(`The \`${o}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(Si(t,{checkOpen:!1}))throw new TypeError(`The \`${o}.final\` option must not be a Duplex stream.`);if(Li(t))throw new TypeError(`The \`${o}.final\` option must not be a web TransformStream.`);if(t!==void 0&&!bf(t))throw new TypeError(`The \`${o}.final\` option must be a generator.`);return Oi(n,`${o}.binary`),Oi(r,`${o}.objectMode`),He(e)||He(t)?"asyncGenerator":"generator"},Oi=(e,t)=>{if(e!==void 0&&typeof e!="boolean")throw new TypeError(`The \`${t}\` option must use a boolean.`)},bf=e=>He(e)||xf(e),He=e=>Object.prototype.toString.call(e)==="[object AsyncGeneratorFunction]",xf=e=>Object.prototype.toString.call(e)==="[object GeneratorFunction]",y0=e=>P(e)&&(e.transform!==void 0||e.final!==void 0),Or=e=>Object.prototype.toString.call(e)==="[object URL]",Cf=e=>Or(e)&&e.protocol!=="file:",b0=e=>P(e)&&Object.keys(e).length>0&&Object.keys(e).every(t=>w0.has(t))&&Ri(e.file),w0=new Set(["file","append"]),Ri=e=>typeof e=="string",Af=(e,t)=>e==="native"&&typeof t=="string"&&!E0.has(t),E0=new Set(["ipc","ignore","inherit","overlapped","pipe"]),Bf=e=>Object.prototype.toString.call(e)==="[object ReadableStream]",Rr=e=>Object.prototype.toString.call(e)==="[object WritableStream]",S0=e=>Bf(e)||Rr(e),Li=e=>Bf(e?.readable)&&Rr(e?.writable),x0=e=>Tf(e)&&typeof e[Symbol.asyncIterator]=="function",C0=e=>Tf(e)&&typeof e[Symbol.iterator]=="function",Tf=e=>typeof e=="object"&&e!==null,X=new Set(["generator","asyncGenerator","duplex","webTransform"]),Lr=new Set(["fileUrl","filePath","fileNumber"]),Ii=new Set(["fileUrl","filePath"]),Of=new Set([...Ii,"webStream","nodeStream"]),Rf=new Set(["webTransform","duplex"]),Be={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"};var vi=(e,t,n,r)=>r==="output"?A0(e,t,n):B0(e,t,n),A0=(e,t,n)=>{let r=t!==0&&n[t-1].value.readableObjectMode;return{writableObjectMode:r,readableObjectMode:e??r}},B0=(e,t,n)=>{let r=t===0?e===!0:n[t-1].value.readableObjectMode,o=t!==n.length-1&&(e??r);return{writableObjectMode:r,readableObjectMode:o}},Lf=(e,t)=>{let n=e.findLast(({type:r})=>X.has(r));return n===void 0?!1:t==="input"?n.value.writableObjectMode:n.value.readableObjectMode};var If=(e,t,n,r)=>[...e.filter(({type:o})=>!X.has(o)),...T0(e,t,n,r)],T0=(e,t,n,{encoding:r})=>{let o=e.filter(({type:s})=>X.has(s)),i=Array.from({length:o.length});for(let[s,a]of Object.entries(o))i[s]=O0({stdioItem:a,index:Number(s),newTransforms:i,optionName:t,direction:n,encoding:r});return v0(i,n)},O0=({stdioItem:e,stdioItem:{type:t},index:n,newTransforms:r,optionName:o,direction:i,encoding:s})=>t==="duplex"?R0({stdioItem:e,optionName:o}):t==="webTransform"?L0({stdioItem:e,index:n,newTransforms:r,direction:i}):I0({stdioItem:e,index:n,newTransforms:r,direction:i,encoding:s}),R0=({stdioItem:e,stdioItem:{value:{transform:t,transform:{writableObjectMode:n,readableObjectMode:r},objectMode:o=r}},optionName:i})=>{if(o&&!r)throw new TypeError(`The \`${i}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!o&&r)throw new TypeError(`The \`${i}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...e,value:{transform:t,writableObjectMode:n,readableObjectMode:r}}},L0=({stdioItem:e,stdioItem:{value:t},index:n,newTransforms:r,direction:o})=>{let{transform:i,objectMode:s}=P(t)?t:{transform:t},{writableObjectMode:a,readableObjectMode:u}=vi(s,n,r,o);return{...e,value:{transform:i,writableObjectMode:a,readableObjectMode:u}}},I0=({stdioItem:e,stdioItem:{value:t},index:n,newTransforms:r,direction:o,encoding:i})=>{let{transform:s,final:a,binary:u=!1,preserveNewlines:l=!1,objectMode:c}=P(t)?t:{transform:t},f=u||K.has(i),{writableObjectMode:d,readableObjectMode:p}=vi(c,n,r,o);return{...e,value:{transform:s,final:a,binary:f,preserveNewlines:l,writableObjectMode:d,readableObjectMode:p}}},v0=(e,t)=>t==="input"?e.reverse():e;var Ir=R(require("node:process"),1);var vf=(e,t,n)=>{let r=e.map(o=>k0(o,t));if(r.includes("input")&&r.includes("output"))throw new TypeError(`The \`${n}\` option must not be an array of both readable and writable values.`);return r.find(Boolean)??M0},k0=({type:e,value:t},n)=>P0[n]??kf[e](t),P0=["input","output","output"],wt=()=>{},ki=()=>"input",kf={generator:wt,asyncGenerator:wt,fileUrl:wt,filePath:wt,iterable:ki,asyncIterable:ki,uint8Array:ki,webStream:e=>Rr(e)?"output":"input",nodeStream(e){return ze(e,{checkOpen:!1})?Ei(e,{checkOpen:!1})?void 0:"input":"output"},webTransform:wt,duplex:wt,native(e){let t=N0(e);if(t!==void 0)return t;if(ne(e,{checkOpen:!1}))return kf.nodeStream(e)}},N0=e=>{if([0,Ir.default.stdin].includes(e))return"input";if([1,2,Ir.default.stdout,Ir.default.stderr].includes(e))return"output"},M0="output";var Pf=(e,t)=>t&&!e.includes("ipc")?[...e,"ipc"]:e;var Nf=({stdio:e,ipc:t,buffer:n,...r},o,i)=>{let s=U0(e,r).map((a,u)=>Mf(a,u));return i?j0(s,n,o):Pf(s,t)},U0=(e,t)=>{if(e===void 0)return J.map(r=>t[r]);if($0(t))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${J.map(r=>`\`${r}\``).join(", ")}`);if(typeof e=="string")return[e,e,e];if(!Array.isArray(e))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);let n=Math.max(e.length,J.length);return Array.from({length:n},(r,o)=>e[o])},$0=e=>J.some(t=>e[t]!==void 0),Mf=(e,t)=>Array.isArray(e)?e.map(n=>Mf(n,t)):e??(t>=J.length?"ignore":"pipe"),j0=(e,t,n)=>e.map((r,o)=>!t[o]&&o!==0&&!lt(n,o)&&_0(r)?"ignore":r),_0=e=>e==="pipe"||Array.isArray(e)&&e.every(t=>t==="pipe");var $f=require("node:fs"),jf=R(require("node:tty"),1);var _f=({stdioItem:e,stdioItem:{type:t},isStdioArray:n,fdNumber:r,direction:o,isSync:i})=>!n||t!=="native"?e:i?V0({stdioItem:e,fdNumber:r,direction:o}):z0({stdioItem:e,fdNumber:r}),V0=({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r,direction:o})=>{let i=G0({value:t,optionName:n,fdNumber:r,direction:o});if(i!==void 0)return i;if(ne(t,{checkOpen:!1}))throw new TypeError(`The \`${n}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return e},G0=({value:e,optionName:t,fdNumber:n,direction:r})=>{let o=W0(e,n);if(o!==void 0){if(r==="output")return{type:"fileNumber",value:o,optionName:t};if(jf.default.isatty(o))throw new TypeError(`The \`${t}: ${ir(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:he((0,$f.readFileSync)(o)),optionName:t}}},W0=(e,t)=>{if(e==="inherit")return t;if(typeof e=="number")return e;let n=Vn.indexOf(e);if(n!==-1)return n},z0=({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r})=>t==="inherit"?{type:"nodeStream",value:Uf(r,t,n),optionName:n}:typeof t=="number"?{type:"nodeStream",value:Uf(t,t,n),optionName:n}:ne(t,{checkOpen:!1})?{type:"nodeStream",value:t,optionName:n}:e,Uf=(e,t,n)=>{let r=Vn[e];if(r===void 0)throw new TypeError(`The \`${n}: ${t}\` option is invalid: no such standard stream.`);return r};var Vf=({input:e,inputFile:t},n)=>n===0?[...H0(e),...Y0(t)]:[],H0=e=>e===void 0?[]:[{type:K0(e),value:e,optionName:"input"}],K0=e=>{if(ze(e,{checkOpen:!1}))return"nodeStream";if(typeof e=="string")return"string";if(U(e))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},Y0=e=>e===void 0?[]:[{...q0(e),optionName:"inputFile"}],q0=e=>{if(Or(e))return{type:"fileUrl",value:e};if(Ri(e))return{type:"filePath",value:{file:e}};throw new Error("The `inputFile` option must be a file path string or a file URL.")};var Gf=e=>e.filter((t,n)=>e.every((r,o)=>t.value!==r.value||n>=o||t.type==="generator"||t.type==="asyncGenerator")),Wf=({stdioItem:{type:e,value:t,optionName:n},direction:r,fileDescriptors:o,isSync:i})=>{let s=J0(o,e);if(s.length!==0){if(i){X0({otherStdioItems:s,type:e,value:t,optionName:n,direction:r});return}if(Of.has(e))return zf({otherStdioItems:s,type:e,value:t,optionName:n,direction:r});Rf.has(e)&&Z0({otherStdioItems:s,type:e,value:t,optionName:n})}},J0=(e,t)=>e.flatMap(({direction:n,stdioItems:r})=>r.filter(o=>o.type===t).map((o=>({...o,direction:n})))),X0=({otherStdioItems:e,type:t,value:n,optionName:r,direction:o})=>{Ii.has(t)&&zf({otherStdioItems:e,type:t,value:n,optionName:r,direction:o})},zf=({otherStdioItems:e,type:t,value:n,optionName:r,direction:o})=>{let i=e.filter(a=>Q0(a,n));if(i.length===0)return;let s=i.find(a=>a.direction!==o);return Hf(s,r,t),o==="output"?i[0].stream:void 0},Q0=({type:e,value:t},n)=>e==="filePath"?t.file===n.file:e==="fileUrl"?t.href===n.href:t===n,Z0=({otherStdioItems:e,type:t,value:n,optionName:r})=>{let o=e.find(({value:{transform:i}})=>i===n.transform);Hf(o,r,t)},Hf=(e,t,n)=>{if(e!==void 0)throw new TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${Be[n]} that is the same.`)};var vr=(e,t,n,r)=>{let i=Nf(t,n,r).map((a,u)=>eF({stdioOption:a,fdNumber:u,options:t,isSync:r})),s=uF({initialFileDescriptors:i,addProperties:e,options:t,isSync:r});return t.stdio=s.map(({stdioItems:a})=>fF(a)),s},eF=({stdioOption:e,fdNumber:t,options:n,isSync:r})=>{let o=Gn(t),{stdioItems:i,isStdioArray:s}=tF({stdioOption:e,fdNumber:t,options:n,optionName:o}),a=vf(i,t,o),u=i.map(f=>_f({stdioItem:f,isStdioArray:s,fdNumber:t,direction:a,isSync:r})),l=If(u,o,a,n),c=Lf(l,a);return aF(l,c),{direction:a,objectMode:c,stdioItems:l}},tF=({stdioOption:e,fdNumber:t,options:n,optionName:r})=>{let i=[...(Array.isArray(e)?e:[e]).map(u=>nF(u,r)),...Vf(n,t)],s=Gf(i),a=s.length>1;return rF(s,a,r),iF(s),{stdioItems:s,isStdioArray:a}},nF=(e,t)=>({type:wf(e,t),value:e,optionName:t}),rF=(e,t,n)=>{if(e.length===0)throw new TypeError(`The \`${n}\` option must not be an empty array.`);if(t){for(let{value:r,optionName:o}of e)if(oF.has(r))throw new Error(`The \`${o}\` option must not include \`${r}\`.`)}},oF=new Set(["ignore","ipc"]),iF=e=>{for(let t of e)sF(t)},sF=({type:e,value:t,optionName:n})=>{if(Cf(t))throw new TypeError(`The \`${n}: URL\` option must use the \`file:\` scheme.
For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(Af(e,t))throw new TypeError(`The \`${n}: { file: '...' }\` option must be used instead of \`${n}: '...'\`.`)},aF=(e,t)=>{if(!t)return;let n=e.find(({type:r})=>Lr.has(r));if(n!==void 0)throw new TypeError(`The \`${n.optionName}\` option cannot use both files and transforms in objectMode.`)},uF=({initialFileDescriptors:e,addProperties:t,options:n,isSync:r})=>{let o=[];try{for(let i of e)o.push(lF({fileDescriptor:i,fileDescriptors:o,addProperties:t,options:n,isSync:r}));return o}catch(i){throw Pi(o),i}},lF=({fileDescriptor:{direction:e,objectMode:t,stdioItems:n},fileDescriptors:r,addProperties:o,options:i,isSync:s})=>{let a=n.map(u=>cF({stdioItem:u,addProperties:o,direction:e,options:i,fileDescriptors:r,isSync:s}));return{direction:e,objectMode:t,stdioItems:a}},cF=({stdioItem:e,addProperties:t,direction:n,options:r,fileDescriptors:o,isSync:i})=>{let s=Wf({stdioItem:e,direction:n,fileDescriptors:o,isSync:i});return s!==void 0?{...e,stream:s}:{...e,...t[n][e.type](e,r)}},Pi=e=>{for(let{stdioItems:t}of e)for(let{stream:n}of t)n!==void 0&&!Z(n)&&n.destroy()},fF=e=>{if(e.length>1)return e.some(({value:r})=>r==="overlapped")?"overlapped":"pipe";let[{type:t,value:n}]=e;return t==="native"?n:"pipe"};var Yf=(e,t)=>vr(pF,e,t,!0),ue=({type:e,optionName:t})=>{qf(t,Be[e])},dF=({optionName:e,value:t})=>((t==="ipc"||t==="overlapped")&&qf(e,`"${t}"`),{}),qf=(e,t)=>{throw new TypeError(`The \`${e}\` option cannot be ${t} with synchronous methods.`)},Kf={generator(){},asyncGenerator:ue,webStream:ue,nodeStream:ue,webTransform:ue,duplex:ue,asyncIterable:ue,native:dF},pF={input:{...Kf,fileUrl:({value:e})=>({contents:[he((0,Ni.readFileSync)(e))]}),filePath:({value:{file:e}})=>({contents:[he((0,Ni.readFileSync)(e))]}),fileNumber:ue,iterable:({value:e})=>({contents:[...e]}),string:({value:e})=>({contents:[e]}),uint8Array:({value:e})=>({contents:[e]})},output:{...Kf,fileUrl:({value:e})=>({path:e}),filePath:({value:{file:e,append:t}})=>({path:e,append:t}),fileNumber:({value:e})=>({path:e}),iterable:ue,string:ue,uint8Array:ue}};var ye=(e,{stripFinalNewline:t},n)=>Mi(t,n)&&e!==void 0&&!Array.isArray(e)?gt(e):e,Mi=(e,t)=>t==="all"?e[1]||e[2]:e[t];var nn=require("node:stream");var kr=(e,t,n,r)=>e||n?void 0:Xf(t,r),$i=(e,t,n)=>n?e.flatMap(r=>Jf(r,t)):Jf(e,t),Jf=(e,t)=>{let{transform:n,final:r}=Xf(t,{});return[...n(e),...r()]},Xf=(e,t)=>(t.previousChunks="",{transform:mF.bind(void 0,t,e),final:hF.bind(void 0,t)}),mF=function*(e,t,n){if(typeof n!="string"){yield n;return}let{previousChunks:r}=e,o=-1;for(let i=0;i<n.length;i+=1)if(n[i]===`
`){let s=DF(n,i,t,e),a=n.slice(o+1,i+1-s);r.length>0&&(a=Ui(r,a),r=""),yield a,o=i}o!==n.length-1&&(r=Ui(r,n.slice(o+1))),e.previousChunks=r},DF=(e,t,n,r)=>n?0:(r.isWindowsNewline=t!==0&&e[t-1]==="\r",r.isWindowsNewline?2:1),hF=function*({previousChunks:e}){e.length>0&&(yield e)},Qf=({binary:e,preserveNewlines:t,readableObjectMode:n,state:r})=>e||t||n?void 0:{transform:gF.bind(void 0,r)},gF=function*({isWindowsNewline:e=!1},t){let{unixNewline:n,windowsNewline:r,LF:o,concatBytes:i}=typeof t=="string"?FF:bF;if(t.at(-1)===o){yield t;return}yield i(t,e?r:n)},Ui=(e,t)=>`${e}${t}`,FF={windowsNewline:`\r
`,unixNewline:`
`,LF:`
`,concatBytes:Ui},yF=(e,t)=>{let n=new Uint8Array(e.length+t.length);return n.set(e,0),n.set(t,e.length),n},bF={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:yF};var Zf=require("node:buffer");var ed=(e,t)=>e?void 0:wF.bind(void 0,t),wF=function*(e,t){if(typeof t!="string"&&!U(t)&&!Zf.Buffer.isBuffer(t))throw new TypeError(`The \`${e}\` option's transform must use "objectMode: true" to receive as input: ${typeof t}.`);yield t},td=(e,t)=>e?EF.bind(void 0,t):SF.bind(void 0,t),EF=function*(e,t){nd(e,t),yield t},SF=function*(e,t){if(nd(e,t),typeof t!="string"&&!U(t))throw new TypeError(`The \`${e}\` option's function must yield a string or an Uint8Array, not ${typeof t}.`);yield t},nd=(e,t)=>{if(t==null)throw new TypeError(`The \`${e}\` option's function must not call \`yield ${t}\`.
Instead, \`yield\` should either be called with a value, or not be called at all. For example:
if (condition) { yield value; }`)};var rd=require("node:buffer"),od=require("node:string_decoder");var Pr=(e,t,n)=>{if(n)return;if(e)return{transform:xF.bind(void 0,new TextEncoder)};let r=new od.StringDecoder(t);return{transform:CF.bind(void 0,r),final:AF.bind(void 0,r)}},xF=function*(e,t){rd.Buffer.isBuffer(t)?yield he(t):typeof t=="string"?yield e.encode(t):yield t},CF=function*(e,t){yield U(t)?e.write(t):t},AF=function*(e){let t=e.end();t!==""&&(yield t)};var ji=require("node:util"),_i=(0,ji.callbackify)(async(e,t,n,r)=>{t.currentIterable=e(...n);try{for await(let o of t.currentIterable)r.push(o)}finally{delete t.currentIterable}}),Nr=async function*(e,t,n){if(n===t.length){yield e;return}let{transform:r=TF}=t[n];for await(let o of r(e))yield*Nr(o,t,n+1)},id=async function*(e){for(let[t,{final:n}]of Object.entries(e))yield*BF(n,Number(t),e)},BF=async function*(e,t,n){if(e!==void 0)for await(let r of e())yield*Nr(r,n,t+1)},sd=(0,ji.callbackify)(async({currentIterable:e},t)=>{if(e!==void 0){await(t?e.throw(t):e.return());return}if(t)throw t}),TF=function*(e){yield e};var Vi=(e,t,n,r)=>{try{for(let o of e(...t))n.push(o);r()}catch(o){r(o)}},ad=(e,t)=>[...t.flatMap(n=>[...Ke(n,e,0)]),...tn(e)],Ke=function*(e,t,n){if(n===t.length){yield e;return}let{transform:r=RF}=t[n];for(let o of r(e))yield*Ke(o,t,n+1)},tn=function*(e){for(let[t,{final:n}]of Object.entries(e))yield*OF(n,Number(t),e)},OF=function*(e,t,n){if(e!==void 0)for(let r of e())yield*Ke(r,n,t+1)},RF=function*(e){yield e};var Gi=({value:e,value:{transform:t,final:n,writableObjectMode:r,readableObjectMode:o},optionName:i},{encoding:s})=>{let a={},u=ud(e,s,i),l=He(t),c=He(n),f=l?_i.bind(void 0,Nr,a):Vi.bind(void 0,Ke),d=l||c?_i.bind(void 0,id,a):Vi.bind(void 0,tn),p=l||c?sd.bind(void 0,a):void 0;return{stream:new nn.Transform({writableObjectMode:r,writableHighWaterMark:(0,nn.getDefaultHighWaterMark)(r),readableObjectMode:o,readableHighWaterMark:(0,nn.getDefaultHighWaterMark)(o),transform(g,F,y){f([g,u,0],this,y)},flush(g){d([u],this,g)},destroy:p})}},Mr=(e,t,n,r)=>{let o=t.filter(({type:s})=>s==="generator"),i=r?o.reverse():o;for(let{value:s,optionName:a}of i){let u=ud(s,n,a);e=ad(u,e)}return e},ud=({transform:e,final:t,binary:n,writableObjectMode:r,readableObjectMode:o,preserveNewlines:i},s,a)=>{let u={};return[{transform:ed(r,a)},Pr(n,s,r),kr(n,i,r,u),{transform:e,final:t},{transform:td(o,a)},Qf({binary:n,preserveNewlines:i,readableObjectMode:o,state:u})].filter(Boolean)};var ld=(e,t)=>{for(let n of LF(e))IF(e,n,t)},LF=e=>new Set(Object.entries(e).filter(([,{direction:t}])=>t==="input").map(([t])=>Number(t))),IF=(e,t,n)=>{let{stdioItems:r}=e[t],o=r.filter(({contents:a})=>a!==void 0);if(o.length===0)return;if(t!==0){let[{type:a,optionName:u}]=o;throw new TypeError(`Only the \`stdin\` option, not \`${u}\`, can be ${Be[a]} with synchronous methods.`)}let s=o.map(({contents:a})=>a).map(a=>vF(a,r));n.input=Kt(s)},vF=(e,t)=>{let n=Mr(e,t,"utf8",!0);return kF(n),Kt(n)},kF=e=>{let t=e.find(n=>typeof n!="string"&&!U(n));if(t!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${t}.`)};var $r=require("node:fs");var Ur=({stdioItems:e,encoding:t,verboseInfo:n,fdNumber:r})=>r!=="all"&<(n,r)&&!K.has(t)&&PF(r)&&(e.some(({type:o,value:i})=>o==="native"&&NF.has(i))||e.every(({type:o})=>X.has(o))),PF=e=>e===1||e===2,NF=new Set(["pipe","overlapped"]),cd=async(e,t,n,r)=>{for await(let o of e)MF(t)||dd(o,n,r)},fd=(e,t,n)=>{for(let r of e)dd(r,t,n)},MF=e=>e._readableState.pipes.length>0,dd=(e,t,n)=>{let r=qn(e);oe({type:"output",verboseMessage:r,fdNumber:t,verboseInfo:n})};var pd=({fileDescriptors:e,syncResult:{output:t},options:n,isMaxBuffer:r,verboseInfo:o})=>{if(t===null)return{output:Array.from({length:3})};let i={},s=new Set([]);return{output:t.map((u,l)=>UF({result:u,fileDescriptors:e,fdNumber:l,state:i,outputFiles:s,isMaxBuffer:r,verboseInfo:o},n)),...i}},UF=({result:e,fileDescriptors:t,fdNumber:n,state:r,outputFiles:o,isMaxBuffer:i,verboseInfo:s},{buffer:a,encoding:u,lines:l,stripFinalNewline:c,maxBuffer:f})=>{if(e===null)return;let d=ff(e,i,f),p=he(d),{stdioItems:m,objectMode:g}=t[n],F=$F([p],m,u,r),{serializedResult:y,finalResult:b=y}=jF({chunks:F,objectMode:g,encoding:u,lines:l,stripFinalNewline:c,fdNumber:n});_F({serializedResult:y,fdNumber:n,state:r,verboseInfo:s,encoding:u,stdioItems:m,objectMode:g});let h=a[n]?b:void 0;try{return r.error===void 0&&VF(y,m,o),h}catch(S){return r.error=S,h}},$F=(e,t,n,r)=>{try{return Mr(e,t,n,!1)}catch(o){return r.error=o,e}},jF=({chunks:e,objectMode:t,encoding:n,lines:r,stripFinalNewline:o,fdNumber:i})=>{if(t)return{serializedResult:e};if(n==="buffer")return{serializedResult:Kt(e)};let s=nu(e,n);return r[i]?{serializedResult:s,finalResult:$i(s,!o[i],t)}:{serializedResult:s}},_F=({serializedResult:e,fdNumber:t,state:n,verboseInfo:r,encoding:o,stdioItems:i,objectMode:s})=>{if(!Ur({stdioItems:i,encoding:o,verboseInfo:r,fdNumber:t}))return;let a=$i(e,!1,s);try{fd(a,t,r)}catch(u){n.error??=u}},VF=(e,t,n)=>{for(let{path:r,append:o}of t.filter(({type:i})=>Lr.has(i))){let i=typeof r=="string"?r:r.toString();o||n.has(i)?(0,$r.appendFileSync)(r,e):(n.add(i),(0,$r.writeFileSync)(r,e))}};var md=([,e,t],n)=>{if(n.all)return e===void 0?t:t===void 0?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,ye(t,n,"all")]:Array.isArray(t)?[ye(e,n,"all"),...t]:U(e)&&U(t)?Go([e,t]):`${e}${t}`};var jr=require("node:events");var Dd=async(e,t)=>{let[n,r]=await GF(e);return t.isForcefullyTerminated??=!1,[n,r]},GF=async e=>{let[t,n]=await Promise.allSettled([(0,jr.once)(e,"spawn"),(0,jr.once)(e,"exit")]);return t.status==="rejected"?[]:n.status==="rejected"?hd(e):n.value},hd=async e=>{try{return await(0,jr.once)(e,"exit")}catch{return hd(e)}},gd=async e=>{let[t,n]=await e;if(!WF(t,n)&&Wi(t,n))throw new ee;return[t,n]},WF=(e,t)=>e===void 0&&t===void 0,Wi=(e,t)=>e!==0||t!==null;var Fd=({error:e,status:t,signal:n,output:r},{maxBuffer:o})=>{let i=zF(e,t,n),s=i?.code==="ETIMEDOUT",a=cf(i,r,o);return{resultError:i,exitCode:t,signal:n,timedOut:s,isMaxBuffer:a}},zF=(e,t,n)=>e!==void 0?e:Wi(t,n)?new ee:void 0;var bd=(e,t,n)=>{let{file:r,commandArguments:o,command:i,escapedCommand:s,startTime:a,verboseInfo:u,options:l,fileDescriptors:c}=HF(e,t,n),f=qF({file:r,commandArguments:o,options:l,command:i,escapedCommand:s,verboseInfo:u,fileDescriptors:c,startTime:a});return bt(f,u,l)},HF=(e,t,n)=>{let{command:r,escapedCommand:o,startTime:i,verboseInfo:s}=Xn(e,t,n),a=KF(n),{file:u,commandArguments:l,options:c}=Fr(e,t,a);YF(c);let f=Yf(c,s);return{file:u,commandArguments:l,command:r,escapedCommand:o,startTime:i,verboseInfo:s,options:c,fileDescriptors:f}},KF=e=>e.node&&!e.ipc?{...e,ipc:!1}:e,YF=({ipc:e,ipcInput:t,detached:n,cancelSignal:r})=>{t&&_r("ipcInput"),e&&_r("ipc: true"),n&&_r("detached: true"),r&&_r("cancelSignal")},_r=e=>{throw new TypeError(`The "${e}" option cannot be used with synchronous methods.`)},qF=({file:e,commandArguments:t,options:n,command:r,escapedCommand:o,verboseInfo:i,fileDescriptors:s,startTime:a})=>{let u=JF({file:e,commandArguments:t,options:n,command:r,escapedCommand:o,fileDescriptors:s,startTime:a});if(u.failed)return u;let{resultError:l,exitCode:c,signal:f,timedOut:d,isMaxBuffer:p}=Fd(u,n),{output:m,error:g=l}=pd({fileDescriptors:s,syncResult:u,options:n,isMaxBuffer:p,verboseInfo:i}),F=m.map((b,h)=>ye(b,n,h)),y=ye(md(m,n),n,"all");return QF({error:g,exitCode:c,signal:f,timedOut:d,isMaxBuffer:p,stdio:F,all:y,options:n,command:r,escapedCommand:o,startTime:a})},JF=({file:e,commandArguments:t,options:n,command:r,escapedCommand:o,fileDescriptors:i,startTime:s})=>{try{ld(i,n);let a=XF(n);return(0,yd.spawnSync)(...yr(e,t,a))}catch(a){return yt({error:a,command:r,escapedCommand:o,fileDescriptors:i,options:n,startTime:s,isSync:!0})}},XF=({encoding:e,maxBuffer:t,...n})=>({...n,encoding:"buffer",maxBuffer:Br(t)}),QF=({error:e,exitCode:t,signal:n,timedOut:r,isMaxBuffer:o,stdio:i,all:s,options:a,command:u,escapedCommand:l,startTime:c})=>e===void 0?Tr({command:u,escapedCommand:l,stdio:i,all:s,ipcOutput:[],options:a,startTime:c}):en({error:e,command:u,escapedCommand:l,timedOut:r,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:o,isForcefullyTerminated:!1,exitCode:t,signal:n,stdio:i,all:s,ipcOutput:[],options:a,startTime:c,isSync:!0});var Bp=require("node:events"),Tp=require("node:child_process");var Hi=R(require("node:process"),1);var Et=require("node:events");var wd=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:o=!0,filter:i}={})=>(mt({methodName:"getOneMessage",isSubprocess:n,ipc:r,isConnected:fr(e)}),ZF({anyProcess:e,channel:t,isSubprocess:n,filter:i,reference:o})),ZF=async({anyProcess:e,channel:t,isSubprocess:n,filter:r,reference:o})=>{ar(t,o);let i=Ae(e,t,n),s=new AbortController;try{return await Promise.race([ey(i,r,s),ty(i,n,s),ny(i,n,s)])}catch(a){throw Dt(e),a}finally{s.abort(),ur(t,o)}},ey=async(e,t,{signal:n})=>{if(t===void 0){let[r]=await(0,Et.once)(e,"message",{signal:n});return r}for await(let[r]of(0,Et.on)(e,"message",{signal:n}))if(t(r))return r},ty=async(e,t,{signal:n})=>{await(0,Et.once)(e,"disconnect",{signal:n}),Gl(t)},ny=async(e,t,{signal:n})=>{let[r]=await(0,Et.once)(e,"strict:error",{signal:n});throw or(r,t)};var rn=require("node:events");var Sd=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:o=!0}={})=>zi({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:!n,reference:o}),zi=({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:o,reference:i})=>{mt({methodName:"getEachMessage",isSubprocess:n,ipc:r,isConnected:fr(e)}),ar(t,i);let s=Ae(e,t,n),a=new AbortController,u={};return ry(e,s,a),oy({ipcEmitter:s,isSubprocess:n,controller:a,state:u}),iy({anyProcess:e,channel:t,ipcEmitter:s,isSubprocess:n,shouldAwait:o,controller:a,state:u,reference:i})},ry=async(e,t,n)=>{try{await(0,rn.once)(t,"disconnect",{signal:n.signal}),n.abort()}catch{}},oy=async({ipcEmitter:e,isSubprocess:t,controller:n,state:r})=>{try{let[o]=await(0,rn.once)(e,"strict:error",{signal:n.signal});r.error=or(o,t),n.abort()}catch{}},iy=async function*({anyProcess:e,channel:t,ipcEmitter:n,isSubprocess:r,shouldAwait:o,controller:i,state:s,reference:a}){try{for await(let[u]of(0,rn.on)(n,"message",{signal:i.signal}))Ed(s),yield u}catch{Ed(s)}finally{i.abort(),ur(t,a),r||Dt(e),o&&await e}},Ed=({error:e})=>{if(e)throw e};var xd=(e,{ipc:t})=>{Object.assign(e,Ad(e,!1,t))},Cd=()=>{let e=Hi.default,t=!0,n=Hi.default.channel!==void 0;return{...Ad(e,t,n),getCancelSignal:Sc.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n})}},Ad=(e,t,n)=>({sendMessage:Dr.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getOneMessage:wd.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getEachMessage:Sd.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n})});var Bd=require("node:child_process"),Te=require("node:stream");var Td=({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:o,startTime:i,verboseInfo:s})=>{Pi(r);let a=new Bd.ChildProcess;sy(a,r),Object.assign(a,{readable:ay,writable:uy,duplex:ly});let u=yt({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:o,startTime:i,isSync:!1}),l=cy(u,s,o);return{subprocess:a,promise:l}},sy=(e,t)=>{let n=on(),r=on(),o=on(),i=Array.from({length:t.length-3},on),s=on(),a=[n,r,o,...i];Object.assign(e,{stdin:n,stdout:r,stderr:o,all:s,stdio:a})},on=()=>{let e=new Te.PassThrough;return e.end(),e},ay=()=>new Te.Readable({read(){}}),uy=()=>new Te.Writable({write(){}}),ly=()=>new Te.Duplex({read(){},write(){}}),cy=async(e,t,n)=>bt(e,t,n);var St=require("node:fs"),Rd=require("node:buffer"),le=require("node:stream");var Ld=(e,t)=>vr(fy,e,t,!1),sn=({type:e,optionName:t})=>{throw new TypeError(`The \`${t}\` option cannot be ${Be[e]}.`)},Od={fileNumber:sn,generator:Gi,asyncGenerator:Gi,nodeStream:({value:e})=>({stream:e}),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:n}}){let r=t||n;return{stream:le.Duplex.fromWeb(e,{objectMode:r})}},duplex:({value:{transform:e}})=>({stream:e}),native(){}},fy={input:{...Od,fileUrl:({value:e})=>({stream:(0,St.createReadStream)(e)}),filePath:({value:{file:e}})=>({stream:(0,St.createReadStream)(e)}),webStream:({value:e})=>({stream:le.Readable.fromWeb(e)}),iterable:({value:e})=>({stream:le.Readable.from(e)}),asyncIterable:({value:e})=>({stream:le.Readable.from(e)}),string:({value:e})=>({stream:le.Readable.from(e)}),uint8Array:({value:e})=>({stream:le.Readable.from(Rd.Buffer.from(e))})},output:{...Od,fileUrl:({value:e})=>({stream:(0,St.createWriteStream)(e)}),filePath:({value:{file:e,append:t}})=>({stream:(0,St.createWriteStream)(e,t?{flags:"a"}:{})}),webStream:({value:e})=>({stream:le.Writable.fromWeb(e)}),iterable:sn,asyncIterable:sn,string:sn,uint8Array:sn}};var an=require("node:events"),Gr=require("node:stream"),qi=require("node:stream/promises");function Ye(e){if(!Array.isArray(e))throw new TypeError(`Expected an array, got \`${typeof e}\`.`);for(let o of e)Yi(o);let t=e.some(({readableObjectMode:o})=>o),n=dy(e,t),r=new Ki({objectMode:t,writableHighWaterMark:n,readableHighWaterMark:n});for(let o of e)r.add(o);return r}var dy=(e,t)=>{if(e.length===0)return(0,Gr.getDefaultHighWaterMark)(t);let n=e.filter(({readableObjectMode:r})=>r===t).map(({readableHighWaterMark:r})=>r);return Math.max(...n)},Ki=class extends Gr.PassThrough{#t=new Set([]);#n=new Set([]);#e=new Set([]);#r;#i=Symbol("unpipe");#o=new WeakMap;add(t){if(Yi(t),this.#t.has(t))return;this.#t.add(t),this.#r??=py(this,this.#t,this.#i);let n=hy({passThroughStream:this,stream:t,streams:this.#t,ended:this.#n,aborted:this.#e,onFinished:this.#r,unpipeEvent:this.#i});this.#o.set(t,n),t.pipe(this,{end:!1})}async remove(t){if(Yi(t),!this.#t.has(t))return!1;let n=this.#o.get(t);return n===void 0?!1:(this.#o.delete(t),t.unpipe(this),await n,!0)}},py=async(e,t,n)=>{Vr(e,Id);let r=new AbortController;try{await Promise.race([my(e,r),Dy(e,t,n,r)])}finally{r.abort(),Vr(e,-Id)}},my=async(e,{signal:t})=>{try{await(0,qi.finished)(e,{signal:t,cleanup:!0})}catch(n){throw kd(e,n),n}},Dy=async(e,t,n,{signal:r})=>{for await(let[o]of(0,an.on)(e,"unpipe",{signal:r}))t.has(o)&&o.emit(n)},Yi=e=>{if(typeof e?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},hy=async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:o,onFinished:i,unpipeEvent:s})=>{Vr(e,vd);let a=new AbortController;try{await Promise.race([gy(i,t,a),Fy({passThroughStream:e,stream:t,streams:n,ended:r,aborted:o,controller:a}),yy({stream:t,streams:n,ended:r,aborted:o,unpipeEvent:s,controller:a})])}finally{a.abort(),Vr(e,-vd)}n.size>0&&n.size===r.size+o.size&&(r.size===0&&o.size>0?Ji(e):by(e))},gy=async(e,t,{signal:n})=>{try{await e,n.aborted||Ji(t)}catch(r){n.aborted||kd(t,r)}},Fy=async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:o,controller:{signal:i}})=>{try{await(0,qi.finished)(t,{signal:i,cleanup:!0,readable:!0,writable:!1}),n.has(t)&&r.add(t)}catch(s){if(i.aborted||!n.has(t))return;Pd(s)?o.add(t):Nd(e,s)}},yy=async({stream:e,streams:t,ended:n,aborted:r,unpipeEvent:o,controller:{signal:i}})=>{if(await(0,an.once)(e,o,{signal:i}),!e.readable)return(0,an.once)(i,"abort",{signal:i});t.delete(e),n.delete(e),r.delete(e)},by=e=>{e.writable&&e.end()},kd=(e,t)=>{Pd(t)?Ji(e):Nd(e,t)},Pd=e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE",Ji=e=>{(e.readable||e.writable)&&e.destroy()},Nd=(e,t)=>{e.destroyed||(e.once("error",wy),e.destroy(t))},wy=()=>{},Vr=(e,t)=>{let n=e.getMaxListeners();n!==0&&n!==Number.POSITIVE_INFINITY&&e.setMaxListeners(n+t)},Id=2,vd=1;var Xi=require("node:stream/promises");var xt=(e,t)=>{e.pipe(t),Ey(e,t),Sy(e,t)},Ey=async(e,t)=>{if(!(Z(e)||Z(t))){try{await(0,Xi.finished)(e,{cleanup:!0,readable:!0,writable:!1})}catch{}Qi(t)}},Qi=e=>{e.writable&&e.end()},Sy=async(e,t)=>{if(!(Z(e)||Z(t))){try{await(0,Xi.finished)(t,{cleanup:!0,readable:!1,writable:!0})}catch{}Zi(e)}},Zi=e=>{e.readable&&e.destroy()};var Md=(e,t,n)=>{let r=new Map;for(let[o,{stdioItems:i,direction:s}]of Object.entries(t)){for(let{stream:a}of i.filter(({type:u})=>X.has(u)))xy(e,a,s,o);for(let{stream:a}of i.filter(({type:u})=>!X.has(u)))Ay({subprocess:e,stream:a,direction:s,fdNumber:o,pipeGroups:r,controller:n})}for(let[o,i]of r.entries()){let s=i.length===1?i[0]:Ye(i);xt(s,o)}},xy=(e,t,n,r)=>{n==="output"?xt(e.stdio[r],t):xt(t,e.stdio[r]);let o=Cy[r];o!==void 0&&(e[o]=t),e.stdio[r]=t},Cy=["stdin","stdout","stderr"],Ay=({subprocess:e,stream:t,direction:n,fdNumber:r,pipeGroups:o,controller:i})=>{if(t===void 0)return;By(t,i);let[s,a]=n==="output"?[t,e.stdio[r]]:[e.stdio[r],t],u=o.get(s)??[];o.set(s,[...u,a])},By=(e,{signal:t})=>{Z(e)&&We(e,Ty,t)},Ty=2;var Ud=require("node:events");var $d=(e,{cleanup:t,detached:n},{signal:r})=>{if(!t||n)return;let o=Mn(()=>{e.kill()});(0,Ud.addAbortListener)(r,()=>{o()})};var _d=({source:e,sourcePromise:t,boundOptions:n,createNested:r},...o)=>{let i=Jn(),{destination:s,destinationStream:a,destinationError:u,from:l,unpipeSignal:c}=Oy(n,r,o),{sourceStream:f,sourceError:d}=Ly(e,l),{options:p,fileDescriptors:m}=se.get(e);return{sourcePromise:t,sourceStream:f,sourceOptions:p,sourceError:d,destination:s,destinationStream:a,destinationError:u,unpipeSignal:c,fileDescriptors:m,startTime:i}},Oy=(e,t,n)=>{try{let{destination:r,pipeOptions:{from:o,to:i,unpipeSignal:s}={}}=Ry(e,t,...n),a=sr(r,i);return{destination:r,destinationStream:a,from:o,unpipeSignal:s}}catch(r){return{destinationError:r}}},Ry=(e,t,n,...r)=>{if(Array.isArray(n))return{destination:t(jd,e)(n,...r),pipeOptions:e};if(typeof n=="string"||n instanceof URL||_o(n)){if(Object.keys(e).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[o,i,s]=$n(n,...r);return{destination:t(jd)(o,i,s),pipeOptions:s}}if(se.has(n)){if(Object.keys(e).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:n,pipeOptions:r[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${n}`)},jd=({options:e})=>({options:{...e,stdin:"pipe",piped:!0}}),Ly=(e,t)=>{try{return{sourceStream:ht(e,t)}}catch(n){return{sourceError:n}}};var Gd=({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r,fileDescriptors:o,sourceOptions:i,startTime:s})=>{let a=Iy({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r});if(a!==void 0)throw es({error:a,fileDescriptors:o,sourceOptions:i,startTime:s})},Iy=({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r})=>{if(t!==void 0&&r!==void 0)return r;if(r!==void 0)return Zi(e),r;if(t!==void 0)return Qi(n),t},es=({error:e,fileDescriptors:t,sourceOptions:n,startTime:r})=>yt({error:e,command:Vd,escapedCommand:Vd,fileDescriptors:t,options:n,startTime:r,isSync:!1}),Vd="source.pipe(destination)";var Wd=async e=>{let[{status:t,reason:n,value:r=n},{status:o,reason:i,value:s=i}]=await e;if(s.pipedFrom.includes(r)||s.pipedFrom.push(r),o==="rejected")throw s;if(t==="rejected")throw r;return s};var zd=require("node:stream/promises");var Hd=(e,t,n)=>{let r=Wr.has(t)?ky(e,t):vy(e,t);return We(e,Ny,n.signal),We(t,My,n.signal),Py(t),r},vy=(e,t)=>{let n=Ye([e]);return xt(n,t),Wr.set(t,n),n},ky=(e,t)=>{let n=Wr.get(t);return n.add(e),n},Py=async e=>{try{await(0,zd.finished)(e,{cleanup:!0,readable:!1,writable:!0})}catch{}Wr.delete(e)},Wr=new WeakMap,Ny=2,My=1;var Kd=require("node:util");var Yd=(e,t)=>e===void 0?[]:[Uy(e,t)],Uy=async(e,{sourceStream:t,mergedStream:n,fileDescriptors:r,sourceOptions:o,startTime:i})=>{await(0,Kd.aborted)(e,t),await n.remove(t);let s=new Error("Pipe canceled by `unpipeSignal` option.");throw es({error:s,fileDescriptors:r,sourceOptions:o,startTime:i})};var zr=(e,...t)=>{if(P(t[0]))return zr.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});let{destination:n,...r}=_d(e,...t),o=$y({...r,destination:n});return o.pipe=zr.bind(void 0,{...e,source:n,sourcePromise:o,boundOptions:{}}),o},$y=async({sourcePromise:e,sourceStream:t,sourceOptions:n,sourceError:r,destination:o,destinationStream:i,destinationError:s,unpipeSignal:a,fileDescriptors:u,startTime:l})=>{let c=jy(e,o);Gd({sourceStream:t,sourceError:r,destinationStream:i,destinationError:s,fileDescriptors:u,sourceOptions:n,startTime:l});let f=new AbortController;try{let d=Hd(t,i,f);return await Promise.race([Wd(c),...Yd(a,{sourceStream:t,mergedStream:d,sourceOptions:n,fileDescriptors:u,startTime:l})])}finally{f.abort()}},jy=(e,t)=>Promise.allSettled([e,t]);var Zd=require("node:timers/promises");var Jd=require("node:events"),Xd=require("node:stream");var Hr=({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:r,encoding:o,preserveNewlines:i})=>{let s=new AbortController;return _y(t,s),Qd({stream:e,controller:s,binary:n,shouldEncode:!e.readableObjectMode&&r,encoding:o,shouldSplit:!e.readableObjectMode,preserveNewlines:i})},_y=async(e,t)=>{try{await e}catch{}finally{t.abort()}},ts=({stream:e,onStreamEnd:t,lines:n,encoding:r,stripFinalNewline:o,allMixed:i})=>{let s=new AbortController;Vy(t,s,e);let a=e.readableObjectMode&&!i;return Qd({stream:e,controller:s,binary:r==="buffer",shouldEncode:!a,encoding:r,shouldSplit:!a&&n,preserveNewlines:!o})},Vy=async(e,t,n)=>{try{await e}catch{n.destroy()}finally{t.abort()}},Qd=({stream:e,controller:t,binary:n,shouldEncode:r,encoding:o,shouldSplit:i,preserveNewlines:s})=>{let a=(0,Jd.on)(e,"data",{signal:t.signal,highWaterMark:qd,highWatermark:qd});return Gy({onStdoutChunk:a,controller:t,binary:n,shouldEncode:r,encoding:o,shouldSplit:i,preserveNewlines:s})},ns=(0,Xd.getDefaultHighWaterMark)(!0),qd=ns,Gy=async function*({onStdoutChunk:e,controller:t,binary:n,shouldEncode:r,encoding:o,shouldSplit:i,preserveNewlines:s}){let a=Wy({binary:n,shouldEncode:r,encoding:o,shouldSplit:i,preserveNewlines:s});try{for await(let[u]of e)yield*Ke(u,a,0)}catch(u){if(!t.signal.aborted)throw u}finally{yield*tn(a)}},Wy=({binary:e,shouldEncode:t,encoding:n,shouldSplit:r,preserveNewlines:o})=>[Pr(e,n,!t),kr(e,o,!r,{})].filter(Boolean);var ep=async({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,buffer:o,maxBuffer:i,lines:s,allMixed:a,stripFinalNewline:u,verboseInfo:l,streamInfo:c})=>{let f=zy({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:a,verboseInfo:l,streamInfo:c});if(!o){await Promise.all([Hy(e),f]);return}let d=Mi(u,n),p=ts({stream:e,onStreamEnd:t,lines:s,encoding:r,stripFinalNewline:d,allMixed:a}),[m]=await Promise.all([Ky({stream:e,iterable:p,fdNumber:n,encoding:r,maxBuffer:i,lines:s}),f]);return m},zy=async({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:o,verboseInfo:i,streamInfo:{fileDescriptors:s}})=>{if(!Ur({stdioItems:s[n]?.stdioItems,encoding:r,verboseInfo:i,fdNumber:n}))return;let a=ts({stream:e,onStreamEnd:t,lines:!0,encoding:r,stripFinalNewline:!0,allMixed:o});await cd(a,e,n,i)},Hy=async e=>{await(0,Zd.setImmediate)(),e.readableFlowing===null&&e.resume()},Ky=async({stream:e,stream:{readableObjectMode:t},iterable:n,fdNumber:r,encoding:o,maxBuffer:i,lines:s})=>{try{return t||s?await Sr(n,{maxBuffer:i}):o==="buffer"?new Uint8Array(await xr(n,{maxBuffer:i})):await Ar(n,{maxBuffer:i})}catch(a){return tp(af({error:a,stream:e,readableObjectMode:t,lines:s,encoding:o,fdNumber:r}))}},rs=async e=>{try{return await e}catch(t){return tp(t)}},tp=({bufferedData:e})=>eu(e)?new Uint8Array(e):e;var rp=require("node:stream/promises"),un=async(e,t,n,{isSameDirection:r,stopOnExit:o=!1}={})=>{let i=Yy(e,n),s=new AbortController;try{await Promise.race([...o?[n.exitPromise]:[],(0,rp.finished)(e,{cleanup:!0,signal:s.signal})])}catch(a){i.stdinCleanedUp||Xy(a,t,n,r)}finally{s.abort()}},Yy=(e,{originalStreams:[t],subprocess:n})=>{let r={stdinCleanedUp:!1};return e===t&&qy(e,n,r),r},qy=(e,t,n)=>{let{_destroy:r}=e;e._destroy=(...o)=>{Jy(t,n),r.call(e,...o)}},Jy=({exitCode:e,signalCode:t},n)=>{(e!==null||t!==null)&&(n.stdinCleanedUp=!0)},Xy=(e,t,n,r)=>{if(!Qy(e,t,n,r))throw e},Qy=(e,t,n,r=!0)=>n.propagating?np(e)||Kr(e):(n.propagating=!0,os(n,t)===r?np(e):Kr(e)),os=({fileDescriptors:e},t)=>t!=="all"&&e[t].direction==="input",Kr=e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE",np=e=>e?.code==="EPIPE";var op=({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:o,stripFinalNewline:i,verboseInfo:s,streamInfo:a})=>e.stdio.map((u,l)=>is({stream:u,fdNumber:l,encoding:t,buffer:n[l],maxBuffer:r[l],lines:o[l],allMixed:!1,stripFinalNewline:i,verboseInfo:s,streamInfo:a})),is=async({stream:e,fdNumber:t,encoding:n,buffer:r,maxBuffer:o,lines:i,allMixed:s,stripFinalNewline:a,verboseInfo:u,streamInfo:l})=>{if(!e)return;let c=un(e,t,l);if(os(l,t)){await c;return}let[f]=await Promise.all([ep({stream:e,onStreamEnd:c,fdNumber:t,encoding:n,buffer:r,maxBuffer:o,lines:i,allMixed:s,stripFinalNewline:a,verboseInfo:u,streamInfo:l}),c]);return f};var ip=({stdout:e,stderr:t},{all:n})=>n&&(e||t)?Ye([e,t].filter(Boolean)):void 0,sp=({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:o,stripFinalNewline:i,verboseInfo:s,streamInfo:a})=>is({...Zy(e,n),fdNumber:"all",encoding:t,maxBuffer:r[1]+r[2],lines:o[1]||o[2],allMixed:eb(e),stripFinalNewline:i,verboseInfo:s,streamInfo:a}),Zy=({stdout:e,stderr:t,all:n},[,r,o])=>{let i=r||o;return i?r?o?{stream:n,buffer:i}:{stream:e,buffer:i}:{stream:t,buffer:i}:{stream:n,buffer:i}},eb=({all:e,stdout:t,stderr:n})=>e&&t&&n&&t.readableObjectMode!==n.readableObjectMode;var fp=require("node:events");var ap=e=>lt(e,"ipc"),up=(e,t)=>{let n=qn(e);oe({type:"ipc",verboseMessage:n,fdNumber:"ipc",verboseInfo:t})};var lp=async({subprocess:e,buffer:t,maxBuffer:n,ipc:r,ipcOutput:o,verboseInfo:i})=>{if(!r)return o;let s=ap(i),a=ge(t,"ipc"),u=ge(n,"ipc");for await(let l of zi({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:r,shouldAwait:!1,reference:!0}))a&&(uf(e,o,u),o.push(l)),s&&up(l,i);return o},cp=async(e,t)=>(await Promise.allSettled([e]),t);var dp=async({subprocess:e,options:{encoding:t,buffer:n,maxBuffer:r,lines:o,timeoutDuration:i,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:u,stripFinalNewline:l,ipc:c,ipcInput:f},context:d,verboseInfo:p,fileDescriptors:m,originalStreams:g,onInternalError:F,controller:y})=>{let b=Dd(e,d),h={originalStreams:g,fileDescriptors:m,subprocess:e,exitPromise:b,propagating:!1},S=op({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:o,stripFinalNewline:l,verboseInfo:p,streamInfo:h}),w=sp({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:o,stripFinalNewline:l,verboseInfo:p,streamInfo:h}),E=[],D=lp({subprocess:e,buffer:n,maxBuffer:r,ipc:c,ipcOutput:E,verboseInfo:p}),T=tb(g,e,h),L=nb(m,h);try{return await Promise.race([Promise.all([{},gd(b),Promise.all(S),w,D,kc(e,f),...T,...L]),F,rb(e,y),...Oc(e,i,d,y),...Vl({subprocess:e,cancelSignal:s,gracefulCancel:a,context:d,controller:y}),...Ac({subprocess:e,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:u,context:d,controller:y})])}catch(O){return d.terminationReason??="other",Promise.all([{error:O},b,Promise.all(S.map($=>rs($))),rs(w),cp(D,E),Promise.allSettled(T),Promise.allSettled(L)])}},tb=(e,t,n)=>e.map((r,o)=>r===t.stdio[o]?void 0:un(r,o,n)),nb=(e,t)=>e.flatMap(({stdioItems:n},r)=>n.filter(({value:o,stream:i=o})=>ne(i,{checkOpen:!1})&&!Z(i)).map(({type:o,value:i,stream:s=i})=>un(s,r,t,{isSameDirection:X.has(o),stopOnExit:o==="native"}))),rb=async(e,{signal:t})=>{let[n]=await(0,fp.once)(e,"error",{signal:t});throw n};var pp=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),ln=(e,t,n)=>{let r=e[n];r.has(t)||r.set(t,[]);let o=r.get(t),i=ie();return o.push(i),{resolve:i.resolve.bind(i),promises:o}},Ct=async({resolve:e,promises:t},n)=>{e();let[r]=await Promise.race([Promise.allSettled([!0,n]),Promise.all([!1,...t])]);return!r};var Dp=require("node:stream"),hp=require("node:util");var ss=require("node:stream/promises");var as=async e=>{if(e!==void 0)try{await us(e)}catch{}},mp=async e=>{if(e!==void 0)try{await ls(e)}catch{}},us=async e=>{await(0,ss.finished)(e,{cleanup:!0,readable:!1,writable:!0})},ls=async e=>{await(0,ss.finished)(e,{cleanup:!0,readable:!0,writable:!1})},Yr=async(e,t)=>{if(await e,t)throw t},qr=(e,t,n)=>{n&&!Kr(n)?e.destroy(n):t&&e.destroy()};var gp=({subprocess:e,concurrentStreams:t,encoding:n},{from:r,binary:o=!0,preserveNewlines:i=!0}={})=>{let s=o||K.has(n),{subprocessStdout:a,waitReadableDestroy:u}=cs(e,r,t),{readableEncoding:l,readableObjectMode:c,readableHighWaterMark:f}=fs(a,s),{read:d,onStdoutDataDone:p}=ds({subprocessStdout:a,subprocess:e,binary:s,encoding:n,preserveNewlines:i}),m=new Dp.Readable({read:d,destroy:(0,hp.callbackify)(ms.bind(void 0,{subprocessStdout:a,subprocess:e,waitReadableDestroy:u})),highWaterMark:f,objectMode:c,encoding:l});return ps({subprocessStdout:a,onStdoutDataDone:p,readable:m,subprocess:e}),m},cs=(e,t,n)=>{let r=ht(e,t),o=ln(n,r,"readableDestroy");return{subprocessStdout:r,waitReadableDestroy:o}},fs=({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n},r)=>r?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:ns},ds=({subprocessStdout:e,subprocess:t,binary:n,encoding:r,preserveNewlines:o})=>{let i=ie(),s=Hr({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:!n,encoding:r,preserveNewlines:o});return{read(){ob(this,s,i)},onStdoutDataDone:i}},ob=async(e,t,n)=>{try{let{value:r,done:o}=await t.next();o?n.resolve():e.push(r)}catch{}},ps=async({subprocessStdout:e,onStdoutDataDone:t,readable:n,subprocess:r,subprocessStdin:o})=>{try{await ls(e),await r,await as(o),await t,n.readable&&n.push(null)}catch(i){await as(o),Fp(n,i)}},ms=async({subprocessStdout:e,subprocess:t,waitReadableDestroy:n},r)=>{await Ct(n,t)&&(Fp(e,r),await Yr(t,r))},Fp=(e,t)=>{qr(e,e.readable,t)};var yp=require("node:stream"),Ds=require("node:util");var bp=({subprocess:e,concurrentStreams:t},{to:n}={})=>{let{subprocessStdin:r,waitWritableFinal:o,waitWritableDestroy:i}=hs(e,n,t),s=new yp.Writable({...gs(r,e,o),destroy:(0,Ds.callbackify)(ys.bind(void 0,{subprocessStdin:r,subprocess:e,waitWritableFinal:o,waitWritableDestroy:i})),highWaterMark:r.writableHighWaterMark,objectMode:r.writableObjectMode});return Fs(r,s),s},hs=(e,t,n)=>{let r=sr(e,t),o=ln(n,r,"writableFinal"),i=ln(n,r,"writableDestroy");return{subprocessStdin:r,waitWritableFinal:o,waitWritableDestroy:i}},gs=(e,t,n)=>({write:ib.bind(void 0,e),final:(0,Ds.callbackify)(sb.bind(void 0,e,t,n))}),ib=(e,t,n,r)=>{e.write(t,n)?r():e.once("drain",r)},sb=async(e,t,n)=>{await Ct(n,t)&&(e.writable&&e.end(),await t)},Fs=async(e,t,n)=>{try{await us(e),t.writable&&t.end()}catch(r){await mp(n),wp(t,r)}},ys=async({subprocessStdin:e,subprocess:t,waitWritableFinal:n,waitWritableDestroy:r},o)=>{await Ct(n,t),await Ct(r,t)&&(wp(e,o),await Yr(t,o))},wp=(e,t)=>{qr(e,e.writable,t)};var Ep=require("node:stream"),Sp=require("node:util");var xp=({subprocess:e,concurrentStreams:t,encoding:n},{from:r,to:o,binary:i=!0,preserveNewlines:s=!0}={})=>{let a=i||K.has(n),{subprocessStdout:u,waitReadableDestroy:l}=cs(e,r,t),{subprocessStdin:c,waitWritableFinal:f,waitWritableDestroy:d}=hs(e,o,t),{readableEncoding:p,readableObjectMode:m,readableHighWaterMark:g}=fs(u,a),{read:F,onStdoutDataDone:y}=ds({subprocessStdout:u,subprocess:e,binary:a,encoding:n,preserveNewlines:s}),b=new Ep.Duplex({read:F,...gs(c,e,f),destroy:(0,Sp.callbackify)(ab.bind(void 0,{subprocessStdout:u,subprocessStdin:c,subprocess:e,waitReadableDestroy:l,waitWritableFinal:f,waitWritableDestroy:d})),readableHighWaterMark:g,writableHighWaterMark:c.writableHighWaterMark,readableObjectMode:m,writableObjectMode:c.writableObjectMode,encoding:p});return ps({subprocessStdout:u,onStdoutDataDone:y,readable:b,subprocess:e,subprocessStdin:c}),Fs(c,b,u),b},ab=async({subprocessStdout:e,subprocessStdin:t,subprocess:n,waitReadableDestroy:r,waitWritableFinal:o,waitWritableDestroy:i},s)=>{await Promise.all([ms({subprocessStdout:e,subprocess:n,waitReadableDestroy:r},s),ys({subprocessStdin:t,subprocess:n,waitWritableFinal:o,waitWritableDestroy:i},s)])};var bs=(e,t,{from:n,binary:r=!1,preserveNewlines:o=!1}={})=>{let i=r||K.has(t),s=ht(e,n),a=Hr({subprocessStdout:s,subprocess:e,binary:i,shouldEncode:!0,encoding:t,preserveNewlines:o});return ub(a,s,e)},ub=async function*(e,t,n){try{yield*e}finally{t.readable&&t.destroy(),await n}};var Cp=(e,{encoding:t})=>{let n=pp();e.readable=gp.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.writable=bp.bind(void 0,{subprocess:e,concurrentStreams:n}),e.duplex=xp.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.iterable=bs.bind(void 0,e,t),e[Symbol.asyncIterator]=bs.bind(void 0,e,t,{})};var Ap=(e,t)=>{for(let[n,r]of cb){let o=r.value.bind(t);Reflect.defineProperty(e,n,{...r,value:o})}},lb=(async()=>{})().constructor.prototype,cb=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(lb,e)]);var Op=(e,t,n,r)=>{let{file:o,commandArguments:i,command:s,escapedCommand:a,startTime:u,verboseInfo:l,options:c,fileDescriptors:f}=fb(e,t,n),{subprocess:d,promise:p}=pb({file:o,commandArguments:i,options:c,startTime:u,verboseInfo:l,command:s,escapedCommand:a,fileDescriptors:f});return d.pipe=zr.bind(void 0,{source:d,sourcePromise:p,boundOptions:{},createNested:r}),Ap(d,p),se.set(d,{options:c,fileDescriptors:f}),d},fb=(e,t,n)=>{let{command:r,escapedCommand:o,startTime:i,verboseInfo:s}=Xn(e,t,n),{file:a,commandArguments:u,options:l}=Fr(e,t,n),c=db(l),f=Ld(c,s);return{file:a,commandArguments:u,command:r,escapedCommand:o,startTime:i,verboseInfo:s,options:c,fileDescriptors:f}},db=({timeout:e,signal:t,...n})=>{if(t!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...n,timeoutDuration:e}},pb=({file:e,commandArguments:t,options:n,startTime:r,verboseInfo:o,command:i,escapedCommand:s,fileDescriptors:a})=>{let u;try{u=(0,Tp.spawn)(...yr(e,t,n))}catch(m){return Td({error:m,command:i,escapedCommand:s,fileDescriptors:a,options:n,startTime:r,verboseInfo:o})}let l=new AbortController;(0,Bp.setMaxListeners)(Number.POSITIVE_INFINITY,l.signal);let c=[...u.stdio];Md(u,a,l),$d(u,n,l);let f={},d=ie();u.kill=$l.bind(void 0,{kill:u.kill.bind(u),options:n,onInternalError:d,context:f,controller:l}),u.all=ip(u,n),Cp(u,n),xd(u,n);let p=mb({subprocess:u,options:n,startTime:r,verboseInfo:o,fileDescriptors:a,originalStreams:c,command:i,escapedCommand:s,context:f,onInternalError:d,controller:l});return{subprocess:u,promise:p}},mb=async({subprocess:e,options:t,startTime:n,verboseInfo:r,fileDescriptors:o,originalStreams:i,command:s,escapedCommand:a,context:u,onInternalError:l,controller:c})=>{let[f,[d,p],m,g,F]=await dp({subprocess:e,options:t,context:u,verboseInfo:r,fileDescriptors:o,originalStreams:i,onInternalError:l,controller:c});c.abort(),l.resolve();let y=m.map((S,w)=>ye(S,t,w)),b=ye(g,t,"all"),h=Db({errorInfo:f,exitCode:d,signal:p,stdio:y,all:b,ipcOutput:F,context:u,options:t,command:s,escapedCommand:a,startTime:n});return bt(h,r,t)},Db=({errorInfo:e,exitCode:t,signal:n,stdio:r,all:o,ipcOutput:i,context:s,options:a,command:u,escapedCommand:l,startTime:c})=>"error"in e?en({error:e.error,command:u,escapedCommand:l,timedOut:s.terminationReason==="timeout",isCanceled:s.terminationReason==="cancel"||s.terminationReason==="gracefulCancel",isGracefullyCanceled:s.terminationReason==="gracefulCancel",isMaxBuffer:e.error instanceof ae,isForcefullyTerminated:s.isForcefullyTerminated,exitCode:t,signal:n,stdio:r,all:o,ipcOutput:i,options:a,startTime:c,isSync:!1}):Tr({command:u,escapedCommand:l,stdio:r,all:o,ipcOutput:i,options:a,startTime:c});var Jr=(e,t)=>{let n=Object.fromEntries(Object.entries(t).map(([r,o])=>[r,hb(r,e[r],o)]));return{...e,...n}},hb=(e,t,n)=>gb.has(e)&&P(t)&&P(n)?{...t,...n}:n,gb=new Set(["env",...Ho]);var Oe=(e,t,n,r)=>{let o=(s,a,u)=>Oe(s,a,n,u),i=(...s)=>Fb({mapArguments:e,deepOptions:n,boundOptions:t,setBoundExeca:r,createNested:o},...s);return r!==void 0&&r(i,o,t),i},Fb=({mapArguments:e,deepOptions:t={},boundOptions:n={},setBoundExeca:r,createNested:o},i,...s)=>{if(P(i))return o(e,Jr(n,i),r);let{file:a,commandArguments:u,options:l,isSync:c}=yb({mapArguments:e,firstArgument:i,nextArguments:s,deepOptions:t,boundOptions:n});return c?bd(a,u,l):Op(a,u,l,o)},yb=({mapArguments:e,firstArgument:t,nextArguments:n,deepOptions:r,boundOptions:o})=>{let i=au(t)?uu(t,n):[t,...n],[s,a,u]=$n(...i),l=Jr(Jr(r,o),u),{file:c=s,commandArguments:f=a,options:d=l,isSync:p=!1}=e({file:s,commandArguments:a,options:l});return{file:c,commandArguments:f,options:d,isSync:p}};var Rp=({file:e,commandArguments:t})=>Ip(e,t),Lp=({file:e,commandArguments:t})=>({...Ip(e,t),isSync:!0}),Ip=(e,t)=>{if(t.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${e} ${t}.`);let[n,...r]=bb(e);return{file:n,commandArguments:r}},bb=e=>{if(typeof e!="string")throw new TypeError(`The command must be a string: ${String(e)}.`);let t=e.trim();if(t==="")return[];let n=[];for(let r of t.split(wb)){let o=n.at(-1);o&&o.endsWith("\\")?n[n.length-1]=`${o.slice(0,-1)} ${r}`:n.push(r)}return n},wb=/ +/g;var vp=(e,t,n)=>{e.sync=t(Eb,n),e.s=e.sync},kp=({options:e})=>Pp(e),Eb=({options:e})=>({...Pp(e),isSync:!0}),Pp=e=>({options:{...Sb(e),...e}}),Sb=({input:e,inputFile:t,stdio:n})=>e===void 0&&t===void 0&&n===void 0?{stdin:"inherit"}:{},Np={preferLocal:!0};var At=Oe(()=>({})),sR=Oe(()=>({isSync:!0})),aR=Oe(Rp),uR=Oe(Lp),lR=Oe(Rc),cR=Oe(kp,{},Np,vp),{sendMessage:fR,getOneMessage:dR,getEachMessage:pR,getCancelSignal:mR}=Cd();var V=R(require("fs"),1);function fn(e,t=!1){let n=e.length,r=0,o="",i=0,s=16,a=0,u=0,l=0,c=0,f=0;function d(h,S){let w=0,E=0;for(;w<h||!S;){let D=e.charCodeAt(r);if(D>=48&&D<=57)E=E*16+D-48;else if(D>=65&&D<=70)E=E*16+D-65+10;else if(D>=97&&D<=102)E=E*16+D-97+10;else break;r++,w++}return w<h&&(E=-1),E}function p(h){r=h,o="",i=0,s=16,f=0}function m(){let h=r;if(e.charCodeAt(r)===48)r++;else for(r++;r<e.length&&Bt(e.charCodeAt(r));)r++;if(r<e.length&&e.charCodeAt(r)===46)if(r++,r<e.length&&Bt(e.charCodeAt(r)))for(r++;r<e.length&&Bt(e.charCodeAt(r));)r++;else return f=3,e.substring(h,r);let S=r;if(r<e.length&&(e.charCodeAt(r)===69||e.charCodeAt(r)===101))if(r++,(r<e.length&&e.charCodeAt(r)===43||e.charCodeAt(r)===45)&&r++,r<e.length&&Bt(e.charCodeAt(r))){for(r++;r<e.length&&Bt(e.charCodeAt(r));)r++;S=r}else f=3;return e.substring(h,S)}function g(){let h="",S=r;for(;;){if(r>=n){h+=e.substring(S,r),f=2;break}let w=e.charCodeAt(r);if(w===34){h+=e.substring(S,r),r++;break}if(w===92){if(h+=e.substring(S,r),r++,r>=n){f=2;break}switch(e.charCodeAt(r++)){case 34:h+='"';break;case 92:h+="\\";break;case 47:h+="/";break;case 98:h+="\b";break;case 102:h+="\f";break;case 110:h+=`
`;break;case 114:h+="\r";break;case 116:h+=" ";break;case 117:let D=d(4,!0);D>=0?h+=String.fromCharCode(D):f=4;break;default:f=5}S=r;continue}if(w>=0&&w<=31)if(cn(w)){h+=e.substring(S,r),f=2;break}else f=6;r++}return h}function F(){if(o="",f=0,i=r,u=a,c=l,r>=n)return i=n,s=17;let h=e.charCodeAt(r);if(ws(h)){do r++,o+=String.fromCharCode(h),h=e.charCodeAt(r);while(ws(h));return s=15}if(cn(h))return r++,o+=String.fromCharCode(h),h===13&&e.charCodeAt(r)===10&&(r++,o+=`
`),a++,l=r,s=14;switch(h){case 123:return r++,s=1;case 125:return r++,s=2;case 91:return r++,s=3;case 93:return r++,s=4;case 58:return r++,s=6;case 44:return r++,s=5;case 34:return r++,o=g(),s=10;case 47:let S=r-1;if(e.charCodeAt(r+1)===47){for(r+=2;r<n&&!cn(e.charCodeAt(r));)r++;return o=e.substring(S,r),s=12}if(e.charCodeAt(r+1)===42){r+=2;let w=n-1,E=!1;for(;r<w;){let D=e.charCodeAt(r);if(D===42&&e.charCodeAt(r+1)===47){r+=2,E=!0;break}r++,cn(D)&&(D===13&&e.charCodeAt(r)===10&&r++,a++,l=r)}return E||(r++,f=1),o=e.substring(S,r),s=13}return o+=String.fromCharCode(h),r++,s=16;case 45:if(o+=String.fromCharCode(h),r++,r===n||!Bt(e.charCodeAt(r)))return s=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return o+=m(),s=11;default:for(;r<n&&y(h);)r++,h=e.charCodeAt(r);if(i!==r){switch(o=e.substring(i,r),o){case"true":return s=8;case"false":return s=9;case"null":return s=7}return s=16}return o+=String.fromCharCode(h),r++,s=16}}function y(h){if(ws(h)||cn(h))return!1;switch(h){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function b(){let h;do h=F();while(h>=12&&h<=15);return h}return{setPosition:p,getPosition:()=>r,scan:t?b:F,getToken:()=>s,getTokenValue:()=>o,getTokenOffset:()=>i,getTokenLength:()=>r-i,getTokenStartLine:()=>u,getTokenStartCharacter:()=>i-c,getTokenError:()=>f}}function ws(e){return e===32||e===9}function cn(e){return e===10||e===13}function Bt(e){return e>=48&&e<=57}var Mp;(function(e){e[e.lineFeed=10]="lineFeed",e[e.carriageReturn=13]="carriageReturn",e[e.space=32]="space",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.asterisk=42]="asterisk",e[e.backslash=92]="backslash",e[e.closeBrace=125]="closeBrace",e[e.closeBracket=93]="closeBracket",e[e.colon=58]="colon",e[e.comma=44]="comma",e[e.dot=46]="dot",e[e.doubleQuote=34]="doubleQuote",e[e.minus=45]="minus",e[e.openBrace=123]="openBrace",e[e.openBracket=91]="openBracket",e[e.plus=43]="plus",e[e.slash=47]="slash",e[e.formFeed=12]="formFeed",e[e.tab=9]="tab"})(Mp||(Mp={}));var Y=new Array(20).fill(0).map((e,t)=>" ".repeat(t)),Tt=200,Es={" ":{"\n":new Array(Tt).fill(0).map((e,t)=>`
`+" ".repeat(t)),"\r":new Array(Tt).fill(0).map((e,t)=>"\r"+" ".repeat(t)),"\r\n":new Array(Tt).fill(0).map((e,t)=>`\r
`+" ".repeat(t))}," ":{"\n":new Array(Tt).fill(0).map((e,t)=>`
`+" ".repeat(t)),"\r":new Array(Tt).fill(0).map((e,t)=>"\r"+" ".repeat(t)),"\r\n":new Array(Tt).fill(0).map((e,t)=>`\r
`+" ".repeat(t))}},Up=[`
`,"\r",`\r
`];function Ss(e,t,n){let r,o,i,s,a;if(t){for(s=t.offset,a=s+t.length,i=s;i>0&&!dn(e,i-1);)i--;let w=a;for(;w<e.length&&!dn(e,w);)w++;o=e.substring(i,w),r=Cb(o,n)}else o=e,r=0,i=0,s=0,a=e.length;let u=Ab(n,e),l=Up.includes(u),c=0,f=0,d;n.insertSpaces?d=Y[n.tabSize||4]??Ot(Y[1],n.tabSize||4):d=" ";let p=d===" "?" ":" ",m=fn(o,!1),g=!1;function F(){if(c>1)return Ot(u,c)+Ot(d,r+f);let w=d.length*(r+f);return!l||w>Es[p][u].length?u+Ot(d,r+f):w<=0?u:Es[p][u][w]}function y(){let w=m.scan();for(c=0;w===15||w===14;)w===14&&n.keepLines?c+=1:w===14&&(c=1),w=m.scan();return g=w===16||m.getTokenError()!==0,w}let b=[];function h(w,E,D){!g&&(!t||E<a&&D>s)&&e.substring(E,D)!==w&&b.push({offset:E,length:D-E,content:w})}let S=y();if(n.keepLines&&c>0&&h(Ot(u,c),0,0),S!==17){let w=m.getTokenOffset()+i,E=d.length*r<20&&n.insertSpaces?Y[d.length*r]:Ot(d,r);h(E,i,w)}for(;S!==17;){let w=m.getTokenOffset()+m.getTokenLength()+i,E=y(),D="",T=!1;for(;c===0&&(E===12||E===13);){let O=m.getTokenOffset()+i;h(Y[1],w,O),w=m.getTokenOffset()+m.getTokenLength()+i,T=E===12,D=T?F():"",E=y()}if(E===2)S!==1&&f--,n.keepLines&&c>0||!n.keepLines&&S!==1?D=F():n.keepLines&&(D=Y[1]);else if(E===4)S!==3&&f--,n.keepLines&&c>0||!n.keepLines&&S!==3?D=F():n.keepLines&&(D=Y[1]);else{switch(S){case 3:case 1:f++,n.keepLines&&c>0||!n.keepLines?D=F():D=Y[1];break;case 5:n.keepLines&&c>0||!n.keepLines?D=F():D=Y[1];break;case 12:D=F();break;case 13:c>0?D=F():T||(D=Y[1]);break;case 6:n.keepLines&&c>0?D=F():T||(D=Y[1]);break;case 10:n.keepLines&&c>0?D=F():E===6&&!T&&(D="");break;case 7:case 8:case 9:case 11:case 2:case 4:n.keepLines&&c>0?D=F():(E===12||E===13)&&!T?D=Y[1]:E!==5&&E!==17&&(g=!0);break;case 16:g=!0;break}c>0&&(E===12||E===13)&&(D=F())}E===17&&(n.keepLines&&c>0?D=F():D=n.insertFinalNewline?u:"");let L=m.getTokenOffset()+i;h(D,w,L),S=E}return b}function Ot(e,t){let n="";for(let r=0;r<t;r++)n+=e;return n}function Cb(e,t){let n=0,r=0,o=t.tabSize||4;for(;n<e.length;){let i=e.charAt(n);if(i===Y[1])r++;else if(i===" ")r+=o;else break;n++}return Math.floor(r/o)}function Ab(e,t){for(let n=0;n<t.length;n++){let r=t.charAt(n);if(r==="\r")return n+1<t.length&&t.charAt(n+1)===`
`?`\r
`:"\r";if(r===`
`)return`
`}return e&&e.eol||`
`}function dn(e,t){return`\r
`.indexOf(e.charAt(t))!==-1}var Xr;(function(e){e.DEFAULT={allowTrailingComma:!1}})(Xr||(Xr={}));function xs(e,t=[],n=Xr.DEFAULT){let r={type:"array",offset:-1,length:-1,children:[],parent:void 0};function o(u){r.type==="property"&&(r.length=u-r.offset,r=r.parent)}function i(u){return r.children.push(u),u}$p(e,{onObjectBegin:u=>{r=i({type:"object",offset:u,length:-1,parent:r,children:[]})},onObjectProperty:(u,l,c)=>{r=i({type:"property",offset:l,length:-1,parent:r,children:[]}),r.children.push({type:"string",value:u,offset:l,length:c,parent:r})},onObjectEnd:(u,l)=>{o(u+l),r.length=u+l-r.offset,r=r.parent,o(u+l)},onArrayBegin:(u,l)=>{r=i({type:"array",offset:u,length:-1,parent:r,children:[]})},onArrayEnd:(u,l)=>{r.length=u+l-r.offset,r=r.parent,o(u+l)},onLiteralValue:(u,l,c)=>{i({type:Tb(u),offset:l,length:c,parent:r,value:u}),o(l+c)},onSeparator:(u,l,c)=>{r.type==="property"&&(u===":"?r.colonOffset=l:u===","&&o(l))},onError:(u,l,c)=>{t.push({error:u,offset:l,length:c})}},n);let a=r.children[0];return a&&delete a.parent,a}function Qr(e,t){if(!e)return;let n=e;for(let r of t)if(typeof r=="string"){if(n.type!=="object"||!Array.isArray(n.children))return;let o=!1;for(let i of n.children)if(Array.isArray(i.children)&&i.children[0].value===r&&i.children.length===2){n=i.children[1],o=!0;break}if(!o)return}else{let o=r;if(n.type!=="array"||o<0||!Array.isArray(n.children)||o>=n.children.length)return;n=n.children[o]}return n}function $p(e,t,n=Xr.DEFAULT){let r=fn(e,!1),o=[],i=0;function s(A){return A?()=>i===0&&A(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function a(A){return A?v=>i===0&&A(v,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function u(A){return A?v=>i===0&&A(v,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>o.slice()):()=>!0}function l(A){return A?()=>{i>0?i++:A(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>o.slice())===!1&&(i=1)}:()=>!0}function c(A){return A?()=>{i>0&&i--,i===0&&A(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter())}:()=>!0}let f=l(t.onObjectBegin),d=u(t.onObjectProperty),p=c(t.onObjectEnd),m=l(t.onArrayBegin),g=c(t.onArrayEnd),F=u(t.onLiteralValue),y=a(t.onSeparator),b=s(t.onComment),h=a(t.onError),S=n&&n.disallowComments,w=n&&n.allowTrailingComma;function E(){for(;;){let A=r.scan();switch(r.getTokenError()){case 4:D(14);break;case 5:D(15);break;case 3:D(13);break;case 1:S||D(11);break;case 2:D(12);break;case 6:D(16);break}switch(A){case 12:case 13:S?D(10):b();break;case 16:D(1);break;case 15:case 14:break;default:return A}}}function D(A,v=[],z=[]){if(h(A),v.length+z.length>0){let W=r.getToken();for(;W!==17;){if(v.indexOf(W)!==-1){E();break}else if(z.indexOf(W)!==-1)break;W=E()}}}function T(A){let v=r.getTokenValue();return A?F(v):(d(v),o.push(v)),E(),!0}function L(){switch(r.getToken()){case 11:let A=r.getTokenValue(),v=Number(A);isNaN(v)&&(D(2),v=0),F(v);break;case 7:F(null);break;case 8:F(!0);break;case 9:F(!1);break;default:return!1}return E(),!0}function O(){return r.getToken()!==10?(D(3,[],[2,5]),!1):(T(!1),r.getToken()===6?(y(":"),E(),N()||D(4,[],[2,5])):D(5,[],[2,5]),o.pop(),!0)}function $(){f(),E();let A=!1;for(;r.getToken()!==2&&r.getToken()!==17;){if(r.getToken()===5){if(A||D(4,[],[]),y(","),E(),r.getToken()===2&&w)break}else A&&D(6,[],[]);O()||D(4,[],[2,5]),A=!0}return p(),r.getToken()!==2?D(7,[2],[]):E(),!0}function we(){m(),E();let A=!0,v=!1;for(;r.getToken()!==4&&r.getToken()!==17;){if(r.getToken()===5){if(v||D(4,[],[]),y(","),E(),r.getToken()===4&&w)break}else v&&D(6,[],[]);A?(o.push(0),A=!1):o[o.length-1]++,N()||D(4,[],[4,5]),v=!0}return g(),A||o.pop(),r.getToken()!==4?D(8,[4],[]):E(),!0}function N(){switch(r.getToken()){case 3:return we();case 1:return $();case 10:return T(!0);default:return L()}}return E(),r.getToken()===17?n.allowEmptyContent?!0:(D(4,[],[]),!1):N()?(r.getToken()!==17&&D(9,[],[]),!0):(D(4,[],[]),!1)}function Tb(e){switch(typeof e){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(e){if(Array.isArray(e))return"array"}else return"null";return"object"}default:return"null"}}function jp(e,t,n,r){let o=t.slice(),s=xs(e,[]),a,u;for(;o.length>0&&(u=o.pop(),a=Qr(s,o),a===void 0&&n!==void 0);)typeof u=="string"?n={[u]:n}:n=[n];if(a)if(a.type==="object"&&typeof u=="string"&&Array.isArray(a.children)){let l=Qr(a,[u]);if(l!==void 0)if(n===void 0){if(!l.parent)throw new Error("Malformed AST");let c=a.children.indexOf(l.parent),f,d=l.parent.offset+l.parent.length;if(c>0){let p=a.children[c-1];f=p.offset+p.length}else f=a.offset+1,a.children.length>1&&(d=a.children[1].offset);return qe(e,{offset:f,length:d-f,content:""},r)}else return qe(e,{offset:l.offset,length:l.length,content:JSON.stringify(n)},r);else{if(n===void 0)return[];let c=`${JSON.stringify(u)}: ${JSON.stringify(n)}`,f=r.getInsertionIndex?r.getInsertionIndex(a.children.map(p=>p.children[0].value)):a.children.length,d;if(f>0){let p=a.children[f-1];d={offset:p.offset+p.length,length:0,content:","+c}}else a.children.length===0?d={offset:a.offset+1,length:0,content:c}:d={offset:a.offset+1,length:0,content:c+","};return qe(e,d,r)}}else if(a.type==="array"&&typeof u=="number"&&Array.isArray(a.children)){let l=u;if(l===-1){let c=`${JSON.stringify(n)}`,f;if(a.children.length===0)f={offset:a.offset+1,length:0,content:c};else{let d=a.children[a.children.length-1];f={offset:d.offset+d.length,length:0,content:","+c}}return qe(e,f,r)}else if(n===void 0&&a.children.length>=0){let c=u,f=a.children[c],d;if(a.children.length===1)d={offset:a.offset+1,length:a.length-2,content:""};else if(a.children.length-1===c){let p=a.children[c-1],m=p.offset+p.length,g=a.offset+a.length;d={offset:m,length:g-2-m,content:""}}else d={offset:f.offset,length:a.children[c+1].offset-f.offset,content:""};return qe(e,d,r)}else if(n!==void 0){let c,f=`${JSON.stringify(n)}`;if(!r.isArrayInsertion&&a.children.length>u){let d=a.children[u];c={offset:d.offset,length:d.length,content:f}}else if(a.children.length===0||u===0)c={offset:a.offset+1,length:0,content:a.children.length===0?f:f+","};else{let d=u>a.children.length?a.children.length:u,p=a.children[d-1];c={offset:p.offset+p.length,length:0,content:","+f}}return qe(e,c,r)}else throw new Error(`Can not ${n===void 0?"remove":r.isArrayInsertion?"insert":"modify"} Array index ${l} as length is not sufficient`)}else throw new Error(`Can not add ${typeof u!="number"?"index":"property"} to parent of type ${a.type}`);else{if(n===void 0)throw new Error("Can not delete in empty document");return qe(e,{offset:s?s.offset:0,length:s?s.length:0,content:JSON.stringify(n)},r)}}function qe(e,t,n){if(!n.formattingOptions)return[t];let r=Zr(e,t),o=t.offset,i=t.offset+t.content.length;if(t.length===0||t.content.length===0){for(;o>0&&!dn(r,o-1);)o--;for(;i<r.length&&!dn(r,i);)i++}let s=Ss(r,{offset:o,length:i-o},{...n.formattingOptions,keepLines:!1});for(let u=s.length-1;u>=0;u--){let l=s[u];r=Zr(r,l),o=Math.min(o,l.offset),i=Math.max(i,l.offset+l.length),i+=l.content.length-l.length}let a=e.length-(r.length-i)-o;return[{offset:o,length:a,content:r.substring(o,i)}]}function Zr(e,t){return e.substring(0,t.offset)+t.content+e.substring(t.offset+t.length)}var _p;(function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter"})(_p||(_p={}));var Vp;(function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.Unknown=16]="Unknown",e[e.EOF=17]="EOF"})(Vp||(Vp={}));var Gp;(function(e){e[e.InvalidSymbol=1]="InvalidSymbol",e[e.InvalidNumberFormat=2]="InvalidNumberFormat",e[e.PropertyNameExpected=3]="PropertyNameExpected",e[e.ValueExpected=4]="ValueExpected",e[e.ColonExpected=5]="ColonExpected",e[e.CommaExpected=6]="CommaExpected",e[e.CloseBraceExpected=7]="CloseBraceExpected",e[e.CloseBracketExpected=8]="CloseBracketExpected",e[e.EndOfFileExpected=9]="EndOfFileExpected",e[e.InvalidCommentToken=10]="InvalidCommentToken",e[e.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=12]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",e[e.InvalidUnicode=14]="InvalidUnicode",e[e.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",e[e.InvalidCharacter=16]="InvalidCharacter"})(Gp||(Gp={}));function Wp(e,t,n,r){return jp(e,t,n,r)}function zp(e,t){let n=t.slice(0).sort((o,i)=>{let s=o.offset-i.offset;return s===0?o.length-i.length:s}),r=e.length;for(let o=n.length-1;o>=0;o--){let i=n[o];if(i.offset+i.length<=r)e=Zr(e,i);else throw new Error("Overlapping edit");r=i.offset}return e}var pn=R(require("path"),1),tm=R(Zp(),1),_b="f=$(mktemp); trap 'rm -f $f' EXIT; curl -fsSL https://host.retiehe.com/cli -o $f && node $f {{args}}",Vb='powershell -c "$f=New-TemporaryFile; iwr https://host.retiehe.com/cli -OutFile $f; node $f {{args}}; rm $f -Force"',Ts="package.json",k,Os,Lt,Le,be,mn,Rt;function Gb(){k={build:"",outdir:"",site:""},Os=V.default.existsSync(".git"),Lt=V.default.existsSync("package.json"),Le=null,be="{}",mn="npm",Rt=null}async function nm(){Gb(),await qb(),await ow(),await Qb(),Lt&&(mn=Sn()),await zb(),await Xb(),await Hb()||(await Yb(),await Jb()),await Zb(),await aw(),await sw()}async function em(e,t,n,r){try{let o=[];if(V.default.existsSync(e)){let a=await V.default.promises.readFile(e,"utf8");o.push(...a.split(/\r?\n/))}else r&&o.push(r,"");let i=n?`${t}=${n}`:t,s=!1;for(let a=0;a<o.length;a++){let u=o[a];if(n){if(u.startsWith(`${t}=`)){o[a]=i,s=!0;break}}else if(u===t){s=!0;break}}s||(o.at(-1)?.trim()===""&&o.pop(),o.push(i,"")),await V.default.promises.writeFile(e,o.join(`
`),"utf8")}catch(o){o instanceof Error&&console.error(o.message),console.error(`Failed to write to "${e}".`),process.exit(1)}}function Wb(e,t){let n=tw(be),r=Wp(be,["scripts",e],t,{formattingOptions:n});be=zp(be,r),Le=JSON.parse(be)}async function zb(){let e=await Ge({default:process.env.RTH_API_KEY,message:x("enterYourApiKey")+":",required:!0,transformer:t=>"*".repeat(t.length),validate:async t=>{try{if(!t.trim())return!1;let{username:n}=await tt(t);return Rt=n,!0}catch(n){return n instanceof Error?n.message:!1}}});await iw(e)}async function Hb(){if(!Lt||!Rt||!await De({choices:[{name:x("yesAllowAiReadFiles"),short:"Yes",value:!0},{name:x("noIWantConfigureManually"),short:"No",value:!1}],message:x("confirmUseAiDetect")+"?"}))return!1;console.info(x("aiAnalyzingProject")+"...");try{let t=await fa(k.site,Rt);return t.error?(console.error(x("aiAnalysisFailed")+": "+t.error),!1):!t.build&&!t.output?(console.error(x("aiAnalysisFailed")),!1):(console.info(x("aiDetectionResult")+":"),t.build?console.info(x("buildCommand")+": "+t.build):console.info(x("buildCommand")+": "+x("noBuildNeeded")),console.info(x("outputDirectory")+": "+(t.output||".")),await De({choices:[{name:x("yesUseTheseConfigurations"),short:"Yes",value:!0},{name:x("noIWantConfigureManually"),short:"No",value:!1}],message:x("confirmUseDetectedConfig")+"?"})?(k.build=t.build||"",k.outdir=t.output||".",!0):!1)}catch(t){if(t instanceof Error&&t.name==="ExitPromptError")throw t;let n=t instanceof Error?t.message:String(t);return console.warn(x("aiAnalysisFailed")+": "+n),!1}}async function Kb(){let e="none";if(Os){let{stdout:n}=await At("git",["remote","get-url","origin"]);n.includes("github")?e="github":n.includes("gitlab")?e="gitlab":n.includes("gitee")&&(e="gitee")}return await De({choices:[{name:x("skip"),value:"none"},{value:"GitHub"},{value:"GitLab"},{value:"Gitee"}],default:e,message:x("confirmAutoDeployWhenPush")+"?"})}async function Yb(){if(!Lt)return;let e=ew();if(!await De({choices:[{name:x("yesItUsesFramework"),short:"Yes",value:!0},{name:x("noItIsNativeHtmlCssJs"),short:"No",value:!1}],default:!!e,message:x("confirmNeedBuild")+"?"}))return;let n=/^(npm|yarn|pnpm|bun)\s+run\s+/i,r=i=>{i=i.trim().replace(n,"");let s=i.split(/\s+/);for(let a of s)if(!a.startsWith("-"))return a;return s[0]},o=await Ge({default:e?`${mn} run ${e}`:void 0,message:x("enterBuildCommand")+":",required:!0,validate:i=>{let s=i.trim();if(!s)return!1;if(!n.test(s))return x("buildCommandMustStartWith",{prefix:`${mn} run`});let a=r(s);return om(a)?!0:x("scriptNotExistInPackageJson",{script:a})}});k.build=r(o)}async function qb(){let e=await De({choices:[{name:"English",value:"en-US"},{name:"\u7B80\u4F53\u4E2D\u6587",value:"zh-CN"},{name:"\u7E41\u9AD4\u4E2D\u6587",value:"zh-TW"}],message:"Select a language:"});await M.changeLanguage(e)}async function Jb(){let e=await nw(),t=await Ge({default:e,message:x("enterOutputDirectory")+":",required:!0,validate:n=>{let r=n.trim();return r?r.startsWith("/")?x("cannotBeAbsolutePath"):!0:!1}});k.outdir=t}async function Xb(){if(!Rt)throw new Error("API key is not set.");let e=Rt;console.info(x("fetchingYourSiteList")+"...");let t=(await sa(e)).results;if(console.info(x("done")),t.length>0){t.sort();let o=await De({choices:[...t.map(i=>({name:i.domain,value:i.domain})),{name:x("createNewSite"),value:null}],message:x("selectSiteToDeploy")+":"});if(o){k.site=o;return}}let n=await De({choices:[{name:x("retinboxFreeDomainName"),short:x("retinboxDomain"),value:"rth-domain"},{name:x("myOwnDomainName"),short:x("ownDomain"),value:"own-domain"}],message:x("whatTypeOfDomainNameWillNewSiteUse")+"?"}),r=await Ge({message:x("enterNewDomainName")+":",required:!0,validate:async o=>{try{let i=o.trim();if(!i)return!1;if(i.includes("/"))return x("enterOnlyDomainNamePart");let s=null,a=i.split(".");if(n==="rth-domain"){if(a.length!==1&&(a.length!==3||!a[1].includes("rth")))return x("domainNotProvidedByRetinbox",{domain:i});s=a[0]}else if(i.includes(".")){if(a[a.length-2].includes("rth"))return x("mightBeRetinboxDomain",{domain:i});s=i}if(!s)return!1;s.startsWith("www.")&&(s=s.substring(4)),encodeURIComponent(s).includes("%")&&(s=tm.default.toASCII(s));let u=await oa({domain:s,username:e});return u.success?!0:u.alert||!1}catch(i){return i instanceof Error?i.message:!1}}});k.site=r}async function Qb(){let e=process.cwd();console.info(x("currentWorkingDirectory")+":",e),!Os&&!Lt&&console.warn(x("notRootOfGitOrNode")),await jo({message:x("confirmCorrectDirectory")+"?"})||(console.info(x("useCdToNavigateToCorrectDirectory")),process.exit(1))}async function Zb(){let e=await Kb();switch(e){case"GitHub":{let t=process.cwd(),n=pn.default.join(t,".github","workflows"),r=Bs("github-actions");await V.default.promises.mkdir(n,{recursive:!0}),await V.default.promises.writeFile(pn.default.join(n,"deploy.yml"),r,"utf8");break}case"GitLab":{let t=Bs("gitlab-ci");await V.default.promises.writeFile(".gitlab-ci.yml",t,"utf8");break}case"Gitee":{let t=process.cwd(),n=pn.default.join(t,".workflow"),r=Bs("gitee-go");await V.default.promises.mkdir(n,{recursive:!0}),await V.default.promises.writeFile(pn.default.join(n,"deploy.yml"),r,"utf8");break}default:break}e!=="none"&&console.info(x("needSetUpEnvVarOnGitPlatform",{envVar:"RTH_API_KEY",gitPlatform:e}))}function Bs(e){return da[e].replace("{{site}}",k.site).replace("{{build}}",k.build).replace("{{outdir}}",k.outdir)}function ew(){let e=Le?.scripts;return e?e.build?"build":e.dist?"dist":rm(t=>/(next|ng|react-scripts|vite)\s+build/i.test(t)):null}function tw(e){let t=e.match(/^[ \t]+/gm);if(!t||t.length===0)return{insertSpaces:!0,tabSize:2};let n=t[0];return n.includes(" ")?{insertSpaces:!1,tabSize:1}:{insertSpaces:!0,tabSize:n.length}}async function nw(){if(!Lt||!k.build)return".";if(k.build.includes("vite")){try{let e=await V.default.promises.readFile("vite.config.js","utf8"),t=/outDir: ['"](.+)['"]/.exec(e);if(t)return t[1]}catch{}return"dist"}return k.build.includes("next")?"out":k.build.includes("react-scripts")?"build":k.build.includes("hexo")?"public":"dist"}async function rw(){let e=rm(t=>t.includes("https://host.retiehe.com/cli")||t.startsWith("npx -y rth-host-helper"));return e||(Le?.scripts?.deploy?Le?.scripts?.["deploy:rth"]?await Ge({default:"deploy",message:x("enterDeployScriptName")+":",required:!0,validate:t=>t.trim()?t.includes(" ")?x("scriptNameCannotContainSpaces"):om(t)?x("scriptAlreadyExistsInPackageJson",{script:t}):!0:!1}):"deploy:rth":"deploy")}function rm(e){let t=Le?.scripts;if(!t)return null;for(let n in t){let r=t[n];if(r&&e(r))return n}return null}function om(e){return!!Le?.scripts?.[e]}async function ow(){try{if(!V.default.existsSync(Ts))return;be=await V.default.promises.readFile(Ts,"utf8"),Le=JSON.parse(be)}catch{}}async function iw(e){let t=".env";await em(t,"RTH_API_KEY",e,"# Do not push this file to Git."),await em(".gitignore",t),process.env.RTH_API_KEY=e}async function sw(){await V.default.promises.writeFile(Ts,be,"utf8")}async function aw(){let e=process.platform==="win32",t=[];k.site&&t.push("--site",k.site),k.build&&t.push("--build",k.build),k.outdir&&t.push("--outdir",k.outdir);let n=await rw(),o=(e?Vb:_b).replace("{{args}}",t.join(" "));Wb(n,o),console.info(x("youCanNowDeployByRunning",{command:`${mn} run ${n}`}))}var no=R(require("fs/promises"),1),lm=R(sm(),1),It=R(require("path"),1),cw=1024,am=500,fw=1048576,G,Is,Je,cm,Qe,Xe;function dw(){G=Cn();let e=["site","outdir"];for(let n of e)G[n]||(console.error("Missing argument:",n),ww());G.outdir.startsWith("/")&&(console.error("`outdir` must be a relative path. It should not start with `/`."),process.exit(1));let t=process.env.RTH_API_KEY;t||(console.error("Missing environment variable: RTH_API_KEY"),process.exit(1)),cm=t,Is=new Map,Je=new Set,Qe={},Xe=""}async function fm(){dw(),await pw(),await Sw(),await Dw(),await Ew(),await mw(),await bw(),console.info("Done.")}async function pw(){if(!G.build){console.info("No build script provided. Skipping build.");return}let e=Sn();await hw(e)||(e="npm");try{{console.info("Installing dependencies...");let{stdout:t}=await At(e,["install"]);console.info(t)}{console.info("Building site...");let{stdout:t}=await At(e,["run",G.build]);console.info(t)}}catch(t){t instanceof xe?console.error(t.stderr):t instanceof Error&&console.error(t.message),process.exit(1)}}async function mw(){try{console.info("Cleaning remote files...");let e=new Set;for(let n in Qe)n.endsWith("/")||n.endsWith(".rth")||Je.has(n)||e.add(n);if(e.size===0){console.info("Already clean.");return}for(let n of e)console.info("Deleting:",n);let t=await Fo({domain:G.site,filenames:e,username:Xe});to(t),console.info("Remote files cleaned.")}catch(e){e instanceof Error&&console.error(e.message),console.error("Failed to clean remote files."),process.exit(1)}}async function Dw(){try{console.info("Getting current site content..."),Qe=await ia({domain:G.site,username:Xe}),console.info("Site content retrieved.")}catch(e){e instanceof Error&&console.error(e.message),process.exit(1)}}async function hw(e){try{return await At(e,["-v"]),!0}catch{return!1}}async function gw(e){try{let t=Qe[e];if(!t?.url)return!0;let n=t.url.split("/")[2];return await(0,lm.default)(It.default.posix.join(G.outdir,e))!==n}catch(t){return t instanceof Error&&console.error(t.message),console.error("Failed to check if file changed:",e),!0}}function um(e){if(e.includes(".min.")||(Is.get(e)||0)>100*cw&&!/\.(html?|php)$/i.test(e))return!1;let n=It.default.extname(e).toLowerCase();return/\.(html?|css|[cm]?js|json|md|php|rth|txt|vue|webmanifest|xml)$/i.test(n)}function Fw(e){if(["bun.lock","bun.lockb","package.json","package-lock.json","pnpm-lock.yaml","tsconfig.json","yarn.lock"].includes(e))return!0;let n=It.default.extname(e).toLowerCase();return/\.(docx?|exe|jsx|less|pptx?|sass|scss|tsx?|vue|xlsx?)$/i.test(n)}async function yw(e){let t=await no.default.readFile(e);return new Blob([t])}async function bw(){try{await ua(G.site)}catch(e){e instanceof Error&&console.error(e.message)}}function ww(){console.error("Usage: rth-host-helper --site <site> --build <build> --outdir <outdir>"),process.exit(1)}function to(e){if(e.errorLog&&console.error(e.errorLog),e.alert&&console.error(e.alert),e.success||(console.error("Failed to update site content."),process.exit(1)),e.modified)for(let t in e.modified)Qe[t]=e.modified[t];else console.info("No files modified.")}async function Ew(){try{console.info("Reading local directory..."),await go(G.outdir,Je),Je.size===0&&(console.error("No files to upload."),process.exit(1)),Je.size>am&&(console.error(`Number of files: ${Je.size}/${am}`),console.error("Too many files to upload. Make sure `outdir` is correct. Do not upload node_modules."),process.exit(1));let e=new Set,t=new Set;for(let r of Je){if(Fw(r)){console.warn("Skipped:",r,"- not for browsers");continue}let o=await no.default.stat(It.default.posix.join(G.outdir,r));if(Is.set(r,o.size),o.size>5*fw){console.warn("Skipped:",r,"- too large");continue}if(!um(r))if(await gw(r))t.add(r);else{console.warn("Skipped:",r,"- not changed");continue}e.add(r)}if(t.size>0){console.info("Deleting old files...");let r=await Fo({domain:G.site,filenames:t,username:Xe});to(r),console.info("Old files deleted.")}let n=!1;for(let r of e){console.info("Uploading:",r);let o=It.default.posix.join(G.outdir,r);if(um(r))n=!0,Qe[r]=await no.default.readFile(o,"utf8");else{let i=await yw(o);if(i.size===0){console.warn("Skipped:",r,"- empty file");continue}let s=await ca({content:i,domain:G.site,filename:r,username:Xe});to(s)}}if(n){console.info("Uploading site content...");let r=await aa({content:Qe,domain:G.site,username:Xe});to(r)}console.info("All files uploaded.")}catch(e){e instanceof Error&&(console.error(e.message),e.cause&&console.error(e.cause)),console.error("Failed to upload files."),process.exit(1)}}async function Sw(){try{console.info("Verifying API key...");let{username:e}=await tt(cm);Xe=e,console.info("API key verified.")}catch(e){e instanceof Error&&console.error(e.message),process.exit(1)}}var ro=R(require("fs"),1),oo=R(require("path"),1),xw=300,vs=new Map;async function Cw(e){let{domain:t,filename:n,outdir:r,username:o}=e,i=oo.default.posix.join(r,n);try{if(!ro.default.existsSync(i)){console.info("File deleted:",n);return}let s=await ro.default.promises.readFile(i,"utf8");console.info("Saving:",n);let a=await la({content:s,domain:t,key:n,username:o});a.success?console.info("Saved:",n):console.error("Failed to save:",n,a.alert||a.errorLog)}catch(s){s instanceof Error&&console.error("Error saving "+n+":",s.message)}}function Aw(e){let t=e.toLowerCase();return t.endsWith(".php")||t.endsWith(".node.js")}async function dm(){let e=Cn(),{outdir:t,site:n}=e;if(!n||!t){console.error("Usage: rth-host-helper --watch --site <site> --outdir <outdir>"),process.exit(1);return}let r=process.env.RTH_API_KEY;if(!r){console.error("Missing environment variable: RTH_API_KEY"),process.exit(1);return}console.info("Verifying API key...");let o;try{o=(await tt(r)).username,console.info("API key verified.")}catch(s){s instanceof Error&&console.error(s.message),process.exit(1);return}console.info('Watching "'+t+'" for .php and .node.js changes...');let i=ro.default.watch(t,{recursive:!0},(s,a)=>{if(!a)return;let u=a.split(oo.default.sep).join(oo.default.posix.sep);if(!Aw(u))return;let l=vs.get(u);l&&clearTimeout(l);let c=setTimeout(()=>{vs.delete(u),Cw({domain:n,filename:u,outdir:t,username:o})},xw);vs.set(u,c)});i.on("error",s=>{console.error("Watcher error:",s.message)}),process.on("SIGINT",()=>{console.info(`
Stopping watcher...`),i.close(),process.exit(0)})}var pm=require("process");(async()=>{(process.argv.includes("-v")||process.argv.includes("--version"))&&(console.info(Ut),process.exit(0));try{(0,pm.loadEnvFile)()}catch{}console.info("Retinbox Web Hosting CLI "+Ut),await ea();try{if(process.argv.includes("--init"))await nm();else if(process.argv.includes("--watch")){await dm();return}else await fm()}catch(e){e instanceof Error&&e.name==="ExitPromptError"&&process.exit(0),console.error(e instanceof Error?e.message:e)}process.exit(0)})();