@datadog/create-apps 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +30 -23
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -30,15 +30,15 @@ ${Rt(t)}`}},Rt=e=>`While running ${e.filter(t=>t!==Jn.SpecialToken.EndOfInput&&t
|
|
|
30
30
|
`)}).join(`
|
|
31
31
|
|
|
32
32
|
`)),e=e.replace(/(`+)((?:.|[\n])*?)\1/g,(r,o,i)=>t.code(o+i+o)),e=e.replace(/(\*\*)((?:.|[\n])*?)\1/g,(r,o,i)=>t.bold(o+i+o)),e?`${e}
|
|
33
|
-
`:""}Ne.formatMarkdownish=hi;Ne.richFormat=Di;Ne.textFormat=pi});var $=B(ie=>{"use strict";Object.defineProperty(ie,"__esModule",{value:!0});var $n=et(),eo=Symbol("clipanion/isOption");function
|
|
33
|
+
`:""}Ne.formatMarkdownish=hi;Ne.richFormat=Di;Ne.textFormat=pi});var $=B(ie=>{"use strict";Object.defineProperty(ie,"__esModule",{value:!0});var $n=et(),eo=Symbol("clipanion/isOption");function mi(e){return{...e,[eo]:!0}}function Ai(e,t){return typeof e>"u"?[e,t]:typeof e=="object"&&e!==null&&!Array.isArray(e)?[void 0,e]:[e,t]}function jt(e,{mergeName:t=!1}={}){let n=e.match(/^([^:]+): (.*)$/m);if(!n)return"validation failed";let[,r,o]=n;return t&&(o=o[0].toLowerCase()+o.slice(1)),o=r!=="."||!t?`${r.replace(/^\.(\[|$)/,"$1")}: ${o}`:`: ${o}`,o}function to(e,t){return t.length===1?new $n.UsageError(`${e}${jt(t[0],{mergeName:!0})}`):new $n.UsageError(`${e}:
|
|
34
34
|
${t.map(n=>`
|
|
35
|
-
- ${jt(n)}`).join("")}`)}function gi(e,t,n){if(typeof n>"u")return t;let r=[],o=[],i=s=>{let a=t;return t=s,i.bind(null,a)};if(!n(t,{errors:r,coercions:o,coercion:i}))throw to(`Invalid value for ${e}`,r);for(let[,s]of o)s();return t}ie.applyValidator=gi;ie.cleanValidationError=jt;ie.formatError=to;ie.isOptionSymbol=eo;ie.makeCommandOption=Ai;ie.rerouteArguments=mi});var co=B(A=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0});var Fi=/^[a-zA-Z_][a-zA-Z0-9_]*$/;function b(e){return e===null?"null":e===void 0?"undefined":e===""?"an empty string":typeof e=="symbol"?`<${e.toString()}>`:Array.isArray(e)?"an array":JSON.stringify(e)}function ye(e,t){if(e.length===0)return"nothing";if(e.length===1)return b(e[0]);let n=e.slice(0,-1),r=e[e.length-1],o=e.length>2?`, ${t} `:` ${t} `;return`${n.map(i=>b(i)).join(", ")}${o}${b(r)}`}function se(e,t){var n,r,o;return typeof t=="number"?`${(n=e?.p)!==null&&n!==void 0?n:"."}[${t}]`:Fi.test(t)?`${(r=e?.p)!==null&&r!==void 0?r:""}.${t}`:`${(o=e?.p)!==null&&o!==void 0?o:"."}[${JSON.stringify(t)}]`}function Ht(e,t,n){return e===1?t:n}var Ei=/^#[0-9a-f]{6}$/i,Ci=/^#[0-9a-f]{6}([0-9a-f]{2})?$/i,yi=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,bi=/^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}$/i,no=/^(?:[1-9]\d{3}(-?)(?:(?:0[1-9]|1[0-2])\1(?:0[1-9]|1\d|2[0-8])|(?:0[13-9]|1[0-2])\1(?:29|30)|(?:0[13578]|1[02])(?:\1)31|00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[0-5]))|(?:[1-9]\d(?:0[48]|[2468][048]|[13579][26])|(?:[2468][048]|[13579][26])00)(?:(-?)02(?:\2)29|-?366))T(?:[01]\d|2[0-3])(:?)[0-5]\d(?:\3[0-5]\d)?(?:Z|[+-][01]\d(?:\3[0-5]\d)?)$/;function m({errors:e,p:t}={},n){return e?.push(`${t??"."}: ${n}`),!1}function vi(e,t){return n=>{e[t]=n}}function Z(e,t){return n=>{let r=e[t];return e[t]=n,Z(e,t).bind(null,r)}}function Re(e,t,n){let r=()=>(e(n()),o),o=()=>(e(t),r);return r}function Gt(){return E({test:(e,t)=>!0})}function oo(e){return E({test:(t,n)=>t!==e?m(n,`Expected ${b(e)} (got ${b(t)})`):!0})}function ro(){return E({test:(e,t)=>typeof e!="string"?m(t,`Expected a string (got ${b(e)})`):!0})}function Bi(e){let t=Array.isArray(e)?e:Object.values(e),n=t.every(o=>typeof o=="string"||typeof o=="number"),r=new Set(t);return r.size===1?oo([...r][0]):E({test:(o,i)=>r.has(o)?!0:n?m(i,`Expected one of ${ye(t,"or")} (got ${b(o)})`):m(i,`Expected a valid enumeration value (got ${b(o)})`)})}var wi=new Map([["true",!0],["True",!0],["1",!0],[1,!0],["false",!1],["False",!1],["0",!1],[0,!1]]);function xi(){return E({test:(e,t)=>{var n;if(typeof e!="boolean"){if(typeof t?.coercions<"u"){if(typeof t?.coercion>"u")return m(t,"Unbound coercion result");let r=wi.get(e);if(typeof r<"u")return t.coercions.push([(n=t.p)!==null&&n!==void 0?n:".",t.coercion.bind(null,r)]),!0}return m(t,`Expected a boolean (got ${b(e)})`)}return!0}})}function Oi(){return E({test:(e,t)=>{var n;if(typeof e!="number"){if(typeof t?.coercions<"u"){if(typeof t?.coercion>"u")return m(t,"Unbound coercion result");let r;if(typeof e=="string"){let o;try{o=JSON.parse(e)}catch{}if(typeof o=="number")if(JSON.stringify(o)===e)r=o;else return m(t,`Received a number that can't be safely represented by the runtime (${e})`)}if(typeof r<"u")return t.coercions.push([(n=t.p)!==null&&n!==void 0?n:".",t.coercion.bind(null,r)]),!0}return m(t,`Expected a number (got ${b(e)})`)}return!0}})}function Pi(e){return E({test:(t,n)=>{var r;if(typeof n?.coercions>"u")return m(n,"The isPayload predicate can only be used with coercion enabled");if(typeof n.coercion>"u")return m(n,"Unbound coercion result");if(typeof t!="string")return m(n,`Expected a string (got ${b(t)})`);let o;try{o=JSON.parse(t)}catch{return m(n,`Expected a JSON string (got ${b(t)})`)}let i={value:o};return e(o,Object.assign(Object.assign({},n),{coercion:Z(i,"value")}))?(n.coercions.push([(r=n.p)!==null&&r!==void 0?r:".",n.coercion.bind(null,i.value)]),!0):!1}})}function ki(){return E({test:(e,t)=>{var n;if(!(e instanceof Date)){if(typeof t?.coercions<"u"){if(typeof t?.coercion>"u")return m(t,"Unbound coercion result");let r;if(typeof e=="string"&&no.test(e))r=new Date(e);else{let o;if(typeof e=="string"){let i;try{i=JSON.parse(e)}catch{}typeof i=="number"&&(o=i)}else typeof e=="number"&&(o=e);if(typeof o<"u")if(Number.isSafeInteger(o)||!Number.isSafeInteger(o*1e3))r=new Date(o*1e3);else return m(t,`Received a timestamp that can't be safely represented by the runtime (${e})`)}if(typeof r<"u")return t.coercions.push([(n=t.p)!==null&&n!==void 0?n:".",t.coercion.bind(null,r)]),!0}return m(t,`Expected a date (got ${b(e)})`)}return!0}})}function tt(e,{delimiter:t}={}){return E({test:(n,r)=>{var o;let i=n;if(typeof n=="string"&&typeof t<"u"&&typeof r?.coercions<"u"){if(typeof r?.coercion>"u")return m(r,"Unbound coercion result");n=n.split(t)}if(!Array.isArray(n))return m(r,`Expected an array (got ${b(n)})`);let u=!0;for(let s=0,a=n.length;s<a&&(u=e(n[s],Object.assign(Object.assign({},r),{p:se(r,s),coercion:Z(n,s)}))&&u,!(!u&&r?.errors==null));++s);return n!==i&&r.coercions.push([(o=r.p)!==null&&o!==void 0?o:".",r.coercion.bind(null,n)]),u}})}function Si(e,{delimiter:t}={}){let n=tt(e,{delimiter:t});return E({test:(r,o)=>{var i,u;if(Object.getPrototypeOf(r).toString()==="[object Set]")if(typeof o?.coercions<"u"){if(typeof o?.coercion>"u")return m(o,"Unbound coercion result");let s=[...r],a=[...r];if(!n(a,Object.assign(Object.assign({},o),{coercion:void 0})))return!1;let c=()=>a.some((d,l)=>d!==s[l])?new Set(a):r;return o.coercions.push([(i=o.p)!==null&&i!==void 0?i:".",Re(o.coercion,r,c)]),!0}else{let s=!0;for(let a of r)if(s=e(a,Object.assign({},o))&&s,!s&&o?.errors==null)break;return s}if(typeof o?.coercions<"u"){if(typeof o?.coercion>"u")return m(o,"Unbound coercion result");let s={value:r};return n(r,Object.assign(Object.assign({},o),{coercion:Z(s,"value")}))?(o.coercions.push([(u=o.p)!==null&&u!==void 0?u:".",Re(o.coercion,r,()=>new Set(s.value))]),!0):!1}return m(o,`Expected a set (got ${b(r)})`)}})}function Ii(e,t){let n=tt(nt([e,t])),r=ot(t,{keys:e});return E({test:(o,i)=>{var u,s,a;if(Object.getPrototypeOf(o).toString()==="[object Map]")if(typeof i?.coercions<"u"){if(typeof i?.coercion>"u")return m(i,"Unbound coercion result");let c=[...o],d=[...o];if(!n(d,Object.assign(Object.assign({},i),{coercion:void 0})))return!1;let l=()=>d.some((D,p)=>D[0]!==c[p][0]||D[1]!==c[p][1])?new Map(d):o;return i.coercions.push([(u=i.p)!==null&&u!==void 0?u:".",Re(i.coercion,o,l)]),!0}else{let c=!0;for(let[d,l]of o)if(c=e(d,Object.assign({},i))&&c,!c&&i?.errors==null||(c=t(l,Object.assign(Object.assign({},i),{p:se(i,d)}))&&c,!c&&i?.errors==null))break;return c}if(typeof i?.coercions<"u"){if(typeof i?.coercion>"u")return m(i,"Unbound coercion result");let c={value:o};return Array.isArray(o)?n(o,Object.assign(Object.assign({},i),{coercion:void 0}))?(i.coercions.push([(s=i.p)!==null&&s!==void 0?s:".",Re(i.coercion,o,()=>new Map(c.value))]),!0):!1:r(o,Object.assign(Object.assign({},i),{coercion:Z(c,"value")}))?(i.coercions.push([(a=i.p)!==null&&a!==void 0?a:".",Re(i.coercion,o,()=>new Map(Object.entries(c.value)))]),!0):!1}return m(i,`Expected a map (got ${b(o)})`)}})}function nt(e,{delimiter:t}={}){let n=uo(e.length);return E({test:(r,o)=>{var i;if(typeof r=="string"&&typeof t<"u"&&typeof o?.coercions<"u"){if(typeof o?.coercion>"u")return m(o,"Unbound coercion result");r=r.split(t),o.coercions.push([(i=o.p)!==null&&i!==void 0?i:".",o.coercion.bind(null,r)])}if(!Array.isArray(r))return m(o,`Expected a tuple (got ${b(r)})`);let u=n(r,Object.assign({},o));for(let s=0,a=r.length;s<a&&s<e.length&&(u=e[s](r[s],Object.assign(Object.assign({},o),{p:se(o,s),coercion:Z(r,s)}))&&u,!(!u&&o?.errors==null));++s);return u}})}function ot(e,{keys:t=null}={}){let n=tt(nt([t??ro(),e]));return E({test:(r,o)=>{var i;if(Array.isArray(r)&&typeof o?.coercions<"u")return typeof o?.coercion>"u"?m(o,"Unbound coercion result"):n(r,Object.assign(Object.assign({},o),{coercion:void 0}))?(r=Object.fromEntries(r),o.coercions.push([(i=o.p)!==null&&i!==void 0?i:".",o.coercion.bind(null,r)]),!0):!1;if(typeof r!="object"||r===null)return m(o,`Expected an object (got ${b(r)})`);let u=Object.keys(r),s=!0;for(let a=0,c=u.length;a<c&&(s||o?.errors!=null);++a){let d=u[a],l=r[d];if(d==="__proto__"||d==="constructor"){s=m(Object.assign(Object.assign({},o),{p:se(o,d)}),"Unsafe property name");continue}if(t!==null&&!t(d,o)){s=!1;continue}if(!e(l,Object.assign(Object.assign({},o),{p:se(o,d),coercion:Z(r,d)}))){s=!1;continue}}return s}})}function Ti(e,t={}){return ot(e,t)}function io(e,{extra:t=null}={}){let n=Object.keys(e),r=E({test:(o,i)=>{if(typeof o!="object"||o===null)return m(i,`Expected an object (got ${b(o)})`);let u=new Set([...n,...Object.keys(o)]),s={},a=!0;for(let c of u){if(c==="constructor"||c==="__proto__")a=m(Object.assign(Object.assign({},i),{p:se(i,c)}),"Unsafe property name");else{let d=Object.prototype.hasOwnProperty.call(e,c)?e[c]:void 0,l=Object.prototype.hasOwnProperty.call(o,c)?o[c]:void 0;typeof d<"u"?a=d(l,Object.assign(Object.assign({},i),{p:se(i,c),coercion:Z(o,c)}))&&a:t===null?a=m(Object.assign(Object.assign({},i),{p:se(i,c)}),`Extraneous property (got ${b(l)})`):Object.defineProperty(s,c,{enumerable:!0,get:()=>l,set:vi(o,c)})}if(!a&&i?.errors==null)break}return t!==null&&(a||i?.errors!=null)&&(a=t(s,i)&&a),a}});return Object.assign(r,{properties:e})}function Ni(e){return io(e,{extra:ot(Gt())})}var Ri=e=>E({test:(t,n)=>t instanceof e?!0:m(n,`Expected an instance of ${e.name} (got ${b(t)})`)}),Li=(e,{exclusive:t=!1}={})=>E({test:(n,r)=>{var o,i,u;let s=[],a=typeof r?.errors<"u"?[]:void 0;for(let c=0,d=e.length;c<d;++c){let l=typeof r?.errors<"u"?[]:void 0,D=typeof r?.coercions<"u"?[]:void 0;if(e[c](n,Object.assign(Object.assign({},r),{errors:l,coercions:D,p:`${(o=r?.p)!==null&&o!==void 0?o:"."}#${c+1}`}))){if(s.push([`#${c+1}`,D]),!t)break}else a?.push(l[0])}if(s.length===1){let[,c]=s[0];return typeof c<"u"&&((i=r?.coercions)===null||i===void 0||i.push(...c)),!0}return s.length>1?m(r,`Expected to match exactly a single predicate (matched ${s.join(", ")})`):(u=r?.errors)===null||u===void 0||u.push(...a),!1}});function so(e){return()=>e}function E({test:e}){return so(e)()}var ue=class extends Error{constructor({errors:t}={}){let n="Type mismatch";if(t&&t.length>0){n+=`
|
|
35
|
+
- ${jt(n)}`).join("")}`)}function gi(e,t,n){if(typeof n>"u")return t;let r=[],o=[],i=s=>{let a=t;return t=s,i.bind(null,a)};if(!n(t,{errors:r,coercions:o,coercion:i}))throw to(`Invalid value for ${e}`,r);for(let[,s]of o)s();return t}ie.applyValidator=gi;ie.cleanValidationError=jt;ie.formatError=to;ie.isOptionSymbol=eo;ie.makeCommandOption=mi;ie.rerouteArguments=Ai});var co=B(m=>{"use strict";Object.defineProperty(m,"__esModule",{value:!0});var Fi=/^[a-zA-Z_][a-zA-Z0-9_]*$/;function b(e){return e===null?"null":e===void 0?"undefined":e===""?"an empty string":typeof e=="symbol"?`<${e.toString()}>`:Array.isArray(e)?"an array":JSON.stringify(e)}function ye(e,t){if(e.length===0)return"nothing";if(e.length===1)return b(e[0]);let n=e.slice(0,-1),r=e[e.length-1],o=e.length>2?`, ${t} `:` ${t} `;return`${n.map(i=>b(i)).join(", ")}${o}${b(r)}`}function se(e,t){var n,r,o;return typeof t=="number"?`${(n=e?.p)!==null&&n!==void 0?n:"."}[${t}]`:Fi.test(t)?`${(r=e?.p)!==null&&r!==void 0?r:""}.${t}`:`${(o=e?.p)!==null&&o!==void 0?o:"."}[${JSON.stringify(t)}]`}function Ht(e,t,n){return e===1?t:n}var Ei=/^#[0-9a-f]{6}$/i,Ci=/^#[0-9a-f]{6}([0-9a-f]{2})?$/i,yi=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,bi=/^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}$/i,no=/^(?:[1-9]\d{3}(-?)(?:(?:0[1-9]|1[0-2])\1(?:0[1-9]|1\d|2[0-8])|(?:0[13-9]|1[0-2])\1(?:29|30)|(?:0[13578]|1[02])(?:\1)31|00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[0-5]))|(?:[1-9]\d(?:0[48]|[2468][048]|[13579][26])|(?:[2468][048]|[13579][26])00)(?:(-?)02(?:\2)29|-?366))T(?:[01]\d|2[0-3])(:?)[0-5]\d(?:\3[0-5]\d)?(?:Z|[+-][01]\d(?:\3[0-5]\d)?)$/;function A({errors:e,p:t}={},n){return e?.push(`${t??"."}: ${n}`),!1}function vi(e,t){return n=>{e[t]=n}}function Z(e,t){return n=>{let r=e[t];return e[t]=n,Z(e,t).bind(null,r)}}function Re(e,t,n){let r=()=>(e(n()),o),o=()=>(e(t),r);return r}function Gt(){return E({test:(e,t)=>!0})}function oo(e){return E({test:(t,n)=>t!==e?A(n,`Expected ${b(e)} (got ${b(t)})`):!0})}function ro(){return E({test:(e,t)=>typeof e!="string"?A(t,`Expected a string (got ${b(e)})`):!0})}function Bi(e){let t=Array.isArray(e)?e:Object.values(e),n=t.every(o=>typeof o=="string"||typeof o=="number"),r=new Set(t);return r.size===1?oo([...r][0]):E({test:(o,i)=>r.has(o)?!0:n?A(i,`Expected one of ${ye(t,"or")} (got ${b(o)})`):A(i,`Expected a valid enumeration value (got ${b(o)})`)})}var wi=new Map([["true",!0],["True",!0],["1",!0],[1,!0],["false",!1],["False",!1],["0",!1],[0,!1]]);function xi(){return E({test:(e,t)=>{var n;if(typeof e!="boolean"){if(typeof t?.coercions<"u"){if(typeof t?.coercion>"u")return A(t,"Unbound coercion result");let r=wi.get(e);if(typeof r<"u")return t.coercions.push([(n=t.p)!==null&&n!==void 0?n:".",t.coercion.bind(null,r)]),!0}return A(t,`Expected a boolean (got ${b(e)})`)}return!0}})}function ki(){return E({test:(e,t)=>{var n;if(typeof e!="number"){if(typeof t?.coercions<"u"){if(typeof t?.coercion>"u")return A(t,"Unbound coercion result");let r;if(typeof e=="string"){let o;try{o=JSON.parse(e)}catch{}if(typeof o=="number")if(JSON.stringify(o)===e)r=o;else return A(t,`Received a number that can't be safely represented by the runtime (${e})`)}if(typeof r<"u")return t.coercions.push([(n=t.p)!==null&&n!==void 0?n:".",t.coercion.bind(null,r)]),!0}return A(t,`Expected a number (got ${b(e)})`)}return!0}})}function Oi(e){return E({test:(t,n)=>{var r;if(typeof n?.coercions>"u")return A(n,"The isPayload predicate can only be used with coercion enabled");if(typeof n.coercion>"u")return A(n,"Unbound coercion result");if(typeof t!="string")return A(n,`Expected a string (got ${b(t)})`);let o;try{o=JSON.parse(t)}catch{return A(n,`Expected a JSON string (got ${b(t)})`)}let i={value:o};return e(o,Object.assign(Object.assign({},n),{coercion:Z(i,"value")}))?(n.coercions.push([(r=n.p)!==null&&r!==void 0?r:".",n.coercion.bind(null,i.value)]),!0):!1}})}function Pi(){return E({test:(e,t)=>{var n;if(!(e instanceof Date)){if(typeof t?.coercions<"u"){if(typeof t?.coercion>"u")return A(t,"Unbound coercion result");let r;if(typeof e=="string"&&no.test(e))r=new Date(e);else{let o;if(typeof e=="string"){let i;try{i=JSON.parse(e)}catch{}typeof i=="number"&&(o=i)}else typeof e=="number"&&(o=e);if(typeof o<"u")if(Number.isSafeInteger(o)||!Number.isSafeInteger(o*1e3))r=new Date(o*1e3);else return A(t,`Received a timestamp that can't be safely represented by the runtime (${e})`)}if(typeof r<"u")return t.coercions.push([(n=t.p)!==null&&n!==void 0?n:".",t.coercion.bind(null,r)]),!0}return A(t,`Expected a date (got ${b(e)})`)}return!0}})}function tt(e,{delimiter:t}={}){return E({test:(n,r)=>{var o;let i=n;if(typeof n=="string"&&typeof t<"u"&&typeof r?.coercions<"u"){if(typeof r?.coercion>"u")return A(r,"Unbound coercion result");n=n.split(t)}if(!Array.isArray(n))return A(r,`Expected an array (got ${b(n)})`);let u=!0;for(let s=0,a=n.length;s<a&&(u=e(n[s],Object.assign(Object.assign({},r),{p:se(r,s),coercion:Z(n,s)}))&&u,!(!u&&r?.errors==null));++s);return n!==i&&r.coercions.push([(o=r.p)!==null&&o!==void 0?o:".",r.coercion.bind(null,n)]),u}})}function Si(e,{delimiter:t}={}){let n=tt(e,{delimiter:t});return E({test:(r,o)=>{var i,u;if(Object.getPrototypeOf(r).toString()==="[object Set]")if(typeof o?.coercions<"u"){if(typeof o?.coercion>"u")return A(o,"Unbound coercion result");let s=[...r],a=[...r];if(!n(a,Object.assign(Object.assign({},o),{coercion:void 0})))return!1;let c=()=>a.some((d,l)=>d!==s[l])?new Set(a):r;return o.coercions.push([(i=o.p)!==null&&i!==void 0?i:".",Re(o.coercion,r,c)]),!0}else{let s=!0;for(let a of r)if(s=e(a,Object.assign({},o))&&s,!s&&o?.errors==null)break;return s}if(typeof o?.coercions<"u"){if(typeof o?.coercion>"u")return A(o,"Unbound coercion result");let s={value:r};return n(r,Object.assign(Object.assign({},o),{coercion:Z(s,"value")}))?(o.coercions.push([(u=o.p)!==null&&u!==void 0?u:".",Re(o.coercion,r,()=>new Set(s.value))]),!0):!1}return A(o,`Expected a set (got ${b(r)})`)}})}function Ii(e,t){let n=tt(nt([e,t])),r=ot(t,{keys:e});return E({test:(o,i)=>{var u,s,a;if(Object.getPrototypeOf(o).toString()==="[object Map]")if(typeof i?.coercions<"u"){if(typeof i?.coercion>"u")return A(i,"Unbound coercion result");let c=[...o],d=[...o];if(!n(d,Object.assign(Object.assign({},i),{coercion:void 0})))return!1;let l=()=>d.some((D,p)=>D[0]!==c[p][0]||D[1]!==c[p][1])?new Map(d):o;return i.coercions.push([(u=i.p)!==null&&u!==void 0?u:".",Re(i.coercion,o,l)]),!0}else{let c=!0;for(let[d,l]of o)if(c=e(d,Object.assign({},i))&&c,!c&&i?.errors==null||(c=t(l,Object.assign(Object.assign({},i),{p:se(i,d)}))&&c,!c&&i?.errors==null))break;return c}if(typeof i?.coercions<"u"){if(typeof i?.coercion>"u")return A(i,"Unbound coercion result");let c={value:o};return Array.isArray(o)?n(o,Object.assign(Object.assign({},i),{coercion:void 0}))?(i.coercions.push([(s=i.p)!==null&&s!==void 0?s:".",Re(i.coercion,o,()=>new Map(c.value))]),!0):!1:r(o,Object.assign(Object.assign({},i),{coercion:Z(c,"value")}))?(i.coercions.push([(a=i.p)!==null&&a!==void 0?a:".",Re(i.coercion,o,()=>new Map(Object.entries(c.value)))]),!0):!1}return A(i,`Expected a map (got ${b(o)})`)}})}function nt(e,{delimiter:t}={}){let n=uo(e.length);return E({test:(r,o)=>{var i;if(typeof r=="string"&&typeof t<"u"&&typeof o?.coercions<"u"){if(typeof o?.coercion>"u")return A(o,"Unbound coercion result");r=r.split(t),o.coercions.push([(i=o.p)!==null&&i!==void 0?i:".",o.coercion.bind(null,r)])}if(!Array.isArray(r))return A(o,`Expected a tuple (got ${b(r)})`);let u=n(r,Object.assign({},o));for(let s=0,a=r.length;s<a&&s<e.length&&(u=e[s](r[s],Object.assign(Object.assign({},o),{p:se(o,s),coercion:Z(r,s)}))&&u,!(!u&&o?.errors==null));++s);return u}})}function ot(e,{keys:t=null}={}){let n=tt(nt([t??ro(),e]));return E({test:(r,o)=>{var i;if(Array.isArray(r)&&typeof o?.coercions<"u")return typeof o?.coercion>"u"?A(o,"Unbound coercion result"):n(r,Object.assign(Object.assign({},o),{coercion:void 0}))?(r=Object.fromEntries(r),o.coercions.push([(i=o.p)!==null&&i!==void 0?i:".",o.coercion.bind(null,r)]),!0):!1;if(typeof r!="object"||r===null)return A(o,`Expected an object (got ${b(r)})`);let u=Object.keys(r),s=!0;for(let a=0,c=u.length;a<c&&(s||o?.errors!=null);++a){let d=u[a],l=r[d];if(d==="__proto__"||d==="constructor"){s=A(Object.assign(Object.assign({},o),{p:se(o,d)}),"Unsafe property name");continue}if(t!==null&&!t(d,o)){s=!1;continue}if(!e(l,Object.assign(Object.assign({},o),{p:se(o,d),coercion:Z(r,d)}))){s=!1;continue}}return s}})}function Ti(e,t={}){return ot(e,t)}function io(e,{extra:t=null}={}){let n=Object.keys(e),r=E({test:(o,i)=>{if(typeof o!="object"||o===null)return A(i,`Expected an object (got ${b(o)})`);let u=new Set([...n,...Object.keys(o)]),s={},a=!0;for(let c of u){if(c==="constructor"||c==="__proto__")a=A(Object.assign(Object.assign({},i),{p:se(i,c)}),"Unsafe property name");else{let d=Object.prototype.hasOwnProperty.call(e,c)?e[c]:void 0,l=Object.prototype.hasOwnProperty.call(o,c)?o[c]:void 0;typeof d<"u"?a=d(l,Object.assign(Object.assign({},i),{p:se(i,c),coercion:Z(o,c)}))&&a:t===null?a=A(Object.assign(Object.assign({},i),{p:se(i,c)}),`Extraneous property (got ${b(l)})`):Object.defineProperty(s,c,{enumerable:!0,get:()=>l,set:vi(o,c)})}if(!a&&i?.errors==null)break}return t!==null&&(a||i?.errors!=null)&&(a=t(s,i)&&a),a}});return Object.assign(r,{properties:e})}function Ni(e){return io(e,{extra:ot(Gt())})}var Ri=e=>E({test:(t,n)=>t instanceof e?!0:A(n,`Expected an instance of ${e.name} (got ${b(t)})`)}),Li=(e,{exclusive:t=!1}={})=>E({test:(n,r)=>{var o,i,u;let s=[],a=typeof r?.errors<"u"?[]:void 0;for(let c=0,d=e.length;c<d;++c){let l=typeof r?.errors<"u"?[]:void 0,D=typeof r?.coercions<"u"?[]:void 0;if(e[c](n,Object.assign(Object.assign({},r),{errors:l,coercions:D,p:`${(o=r?.p)!==null&&o!==void 0?o:"."}#${c+1}`}))){if(s.push([`#${c+1}`,D]),!t)break}else a?.push(l[0])}if(s.length===1){let[,c]=s[0];return typeof c<"u"&&((i=r?.coercions)===null||i===void 0||i.push(...c)),!0}return s.length>1?A(r,`Expected to match exactly a single predicate (matched ${s.join(", ")})`):(u=r?.errors)===null||u===void 0||u.push(...a),!1}});function so(e){return()=>e}function E({test:e}){return so(e)()}var ue=class extends Error{constructor({errors:t}={}){let n="Type mismatch";if(t&&t.length>0){n+=`
|
|
36
36
|
`;for(let r of t)n+=`
|
|
37
|
-
- ${r}`}super(n)}};function Mi(e,t){if(!t(e))throw new ue}function ji(e,t){let n=[];if(!t(e,{errors:n}))throw new ue({errors:n})}function Hi(e,t){}function Gi(e,t,{coerce:n=!1,errors:r,throw:o}={}){let i=r?[]:void 0;if(!n){if(t(e,{errors:i}))return o?e:{value:e,errors:void 0};if(o)throw new ue({errors:i});return{value:void 0,errors:i??!0}}let u={value:e},s=Z(u,"value"),a=[];if(!t(e,{errors:i,coercion:s,coercions:a})){if(o)throw new ue({errors:i});return{value:void 0,errors:i??!0}}for(let[,c]of a)c();return o?u.value:{value:u.value,errors:void 0}}function Ui(e,t){let n=nt(e);return((...r)=>{if(!n(r))throw new ue;return t(...r)})}function zi(e){return E({test:(t,n)=>t.length>=e?!0:m(n,`Expected to have a length of at least ${e} elements (got ${t.length})`)})}function Qi(e){return E({test:(t,n)=>t.length<=e?!0:m(n,`Expected to have a length of at most ${e} elements (got ${t.length})`)})}function uo(e){return E({test:(t,n)=>t.length!==e?m(n,`Expected to have a length of exactly ${e} elements (got ${t.length})`):!0})}function Yi({map:e}={}){return E({test:(t,n)=>{let r=new Set,o=new Set;for(let i=0,u=t.length;i<u;++i){let s=t[i],a=typeof e<"u"?e(s):s;if(r.has(a)){if(o.has(a))continue;m(n,`Expected to contain unique elements; got a duplicate with ${b(t)}`),o.add(a)}else r.add(a)}return o.size===0}})}function Ki(){return E({test:(e,t)=>e<=0?!0:m(t,`Expected to be negative (got ${e})`)})}function qi(){return E({test:(e,t)=>e>=0?!0:m(t,`Expected to be positive (got ${e})`)})}function Wi(e){return E({test:(t,n)=>t>=e?!0:m(n,`Expected to be at least ${e} (got ${t})`)})}function Vi(e){return E({test:(t,n)=>t<=e?!0:m(n,`Expected to be at most ${e} (got ${t})`)})}function Zi(e,t){return E({test:(n,r)=>n>=e&&n<=t?!0:m(r,`Expected to be in the [${e}; ${t}] range (got ${n})`)})}function Xi(e,t){return E({test:(n,r)=>n>=e&&n<t?!0:m(r,`Expected to be in the [${e}; ${t}[ range (got ${n})`)})}function Ji({unsafe:e=!1}={}){return E({test:(t,n)=>t!==Math.round(t)?m(n,`Expected to be an integer (got ${t})`):!e&&!Number.isSafeInteger(t)?m(n,`Expected to be a safe integer (got ${t})`):!0})}function _i(e){return E({test:(t,n)=>e.test(t)?!0:m(n,`Expected to match the pattern ${e.toString()} (got ${b(t)})`)})}function $i(){return E({test:(e,t)=>e!==e.toLowerCase()?m(t,`Expected to be all-lowercase (got ${e})`):!0})}function es(){return E({test:(e,t)=>e!==e.toUpperCase()?m(t,`Expected to be all-uppercase (got ${e})`):!0})}function ts(){return E({test:(e,t)=>bi.test(e)?!0:m(t,`Expected to be a valid UUID v4 (got ${b(e)})`)})}function ns(){return E({test:(e,t)=>no.test(e)?!0:m(t,`Expected to be a valid ISO 8601 date string (got ${b(e)})`)})}function os({alpha:e=!1}){return E({test:(t,n)=>(e?Ei.test(t):Ci.test(t))?!0:m(n,`Expected to be a valid hexadecimal color string (got ${b(t)})`)})}function rs(){return E({test:(e,t)=>yi.test(e)?!0:m(t,`Expected to be a valid base 64 string (got ${b(e)})`)})}function is(e=Gt()){return E({test:(t,n)=>{let r;try{r=JSON.parse(t)}catch{return m(n,`Expected to be a valid JSON string (got ${b(t)})`)}return e(r,n)}})}function ao(e,...t){let n=Array.isArray(t[0])?t[0]:t;return E({test:(r,o)=>{var i,u;let s={value:r},a=typeof o?.coercions<"u"?Z(s,"value"):void 0,c=typeof o?.coercions<"u"?[]:void 0;if(!e(r,Object.assign(Object.assign({},o),{coercion:a,coercions:c})))return!1;let d=[];if(typeof c<"u")for(let[,l]of c)d.push(l());try{if(typeof o?.coercions<"u"){if(s.value!==r){if(typeof o?.coercion>"u")return m(o,"Unbound coercion result");o.coercions.push([(i=o.p)!==null&&i!==void 0?i:".",o.coercion.bind(null,s.value)])}(u=o?.coercions)===null||u===void 0||u.push(...c)}return n.every(l=>l(s.value,o))}finally{for(let l of d)l()}}})}function ss(e,...t){let n=Array.isArray(t[0])?t[0]:t;return ao(e,n)}function us(e){return E({test:(t,n)=>typeof t>"u"?!0:e(t,n)})}function as(e){return E({test:(t,n)=>t===null?!0:e(t,n)})}var rt={missing:(e,t)=>e.has(t),undefined:(e,t,n)=>e.has(t)&&typeof n[t]<"u",nil:(e,t,n)=>e.has(t)&&n[t]!=null,falsy:(e,t,n)=>e.has(t)&&!!n[t]};function cs(e,t){var n;let r=new Set(e),o=rt[(n=t?.missingIf)!==null&&n!==void 0?n:"missing"];return E({test:(i,u)=>{let s=new Set(Object.keys(i)),a=[];for(let c of r)o(s,c,i)||a.push(c);return a.length>0?m(u,`Missing required ${Ht(a.length,"property","properties")} ${ye(a,"and")}`):!0}})}function ls(e,t){var n;let r=new Set(e),o=rt[(n=t?.missingIf)!==null&&n!==void 0?n:"missing"];return E({test:(i,u)=>Object.keys(i).some(c=>o(r,c,i))?!0:m(u,`Missing at least one property from ${ye(Array.from(r),"or")}`)})}function ds(e,t){var n;let r=new Set(e),o=rt[(n=t?.missingIf)!==null&&n!==void 0?n:"missing"];return E({test:(i,u)=>{let s=new Set(Object.keys(i)),a=[];for(let c of r)o(s,c,i)&&a.push(c);return a.length>0?m(u,`Forbidden ${Ht(a.length,"property","properties")} ${ye(a,"and")}`):!0}})}function Ds(e,t){var n;let r=new Set(e),o=rt[(n=t?.missingIf)!==null&&n!==void 0?n:"missing"];return E({test:(i,u)=>{let s=new Set(Object.keys(i)),a=[];for(let c of r)o(s,c,i)&&a.push(c);return a.length>1?m(u,`Mutually exclusive properties ${ye(a,"and")}`):!0}})}(function(e){e.Forbids="Forbids",e.Requires="Requires"})(A.KeyRelationship||(A.KeyRelationship={}));var ps={[A.KeyRelationship.Forbids]:{expect:!1,message:"forbids using"},[A.KeyRelationship.Requires]:{expect:!0,message:"requires using"}};function fs(e,t,n,{ignore:r=[]}={}){let o=new Set(r),i=new Set(n),u=ps[t],s=t===A.KeyRelationship.Forbids?"or":"and";return E({test:(a,c)=>{let d=new Set(Object.keys(a));if(!d.has(e)||o.has(a[e]))return!0;let l=[];for(let D of i)(d.has(D)&&!o.has(a[D]))!==u.expect&&l.push(D);return l.length>=1?m(c,`Property "${e}" ${u.message} ${Ht(l.length,"property","properties")} ${ye(l,s)}`):!0}})}A.TypeAssertionError=ue;A.applyCascade=ss;A.as=Gi;A.assert=Mi;A.assertWithErrors=ji;A.cascade=ao;A.fn=Ui;A.hasAtLeastOneKey=ls;A.hasExactLength=uo;A.hasForbiddenKeys=ds;A.hasKeyRelationship=fs;A.hasMaxLength=Qi;A.hasMinLength=zi;A.hasMutuallyExclusiveKeys=Ds;A.hasRequiredKeys=cs;A.hasUniqueItems=Yi;A.isArray=tt;A.isAtLeast=Wi;A.isAtMost=Vi;A.isBase64=rs;A.isBoolean=xi;A.isDate=ki;A.isDict=Ti;A.isEnum=Bi;A.isHexColor=os;A.isISO8601=ns;A.isInExclusiveRange=Xi;A.isInInclusiveRange=Zi;A.isInstanceOf=Ri;A.isInteger=Ji;A.isJSON=is;A.isLiteral=oo;A.isLowerCase=$i;A.isMap=Ii;A.isNegative=Ki;A.isNullable=as;A.isNumber=Oi;A.isObject=io;A.isOneOf=Li;A.isOptional=us;A.isPartial=Ni;A.isPayload=Pi;A.isPositive=qi;A.isRecord=ot;A.isSet=Si;A.isString=ro;A.isTuple=nt;A.isUUID4=ts;A.isUnknown=Gt;A.isUpperCase=es;A.makeTrait=so;A.makeValidator=E;A.matchesRegExp=_i;A.softAssert=Hi});var ae=B(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});var lo=$();function hs(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if(n!=="default"){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var Le=class{constructor(){this.help=!1}static Usage(t){return t}async catch(t){throw t}async validateAndExecute(){let n=this.constructor.schema;if(Array.isArray(n)){let{isDict:o,isUnknown:i,applyCascade:u}=await Promise.resolve().then(function(){return hs(co())}),s=u(o(i()),n),a=[],c=[];if(!s(this,{errors:a,coercions:c}))throw lo.formatError("Invalid option schema",a);for(let[,l]of c)l()}else if(n!=null)throw new Error("Invalid command schema");let r=await this.execute();return typeof r<"u"?r:0}};Le.isOption=lo.isOptionSymbol;Le.Default=[];Ut.Command=Le});var ct=B(w=>{"use strict";Object.defineProperty(w,"__esModule",{value:!0});var f=$e(),ut=et();function R(e){f.IS_DEBUG&&console.log(e)}var Do={candidateUsage:null,requiredOptions:[],errorMessage:null,ignoreOptions:!1,path:[],positionals:[],options:[],remainder:null,selectedIndex:f.HELP_COMMAND_INDEX,tokens:[]};function Qt(){let e={nodes:[]};for(let t=0;t<f.NodeType.CustomNode;++t)e.nodes.push(L());return e}function po(e){let t=Qt(),n=[],r=t.nodes.length;for(let o of e){n.push(r);for(let i=0;i<o.nodes.length;++i)Yt(i)||t.nodes.push(Co(o.nodes[i],r));r+=o.nodes.length-f.NodeType.CustomNode+1}for(let o of n)de(t,f.NodeType.InitialNode,o);return t}function G(e,t){return e.nodes.push(t),e.nodes.length-1}function fo(e){let t=new Set,n=r=>{if(t.has(r))return;t.add(r);let o=e.nodes[r];for(let u of Object.values(o.statics))for(let{to:s}of u)n(s);for(let[,{to:u}]of o.dynamics)n(u);for(let{to:u}of o.shortcuts)n(u);let i=new Set(o.shortcuts.map(({to:u})=>u));for(;o.shortcuts.length>0;){let{to:u}=o.shortcuts.shift(),s=e.nodes[u];for(let[a,c]of Object.entries(s.statics)){let d=Object.prototype.hasOwnProperty.call(o.statics,a)?o.statics[a]:o.statics[a]=[];for(let l of c)d.some(({to:D})=>l.to===D)||d.push(l)}for(let[a,c]of s.dynamics)o.dynamics.some(([d,{to:l}])=>a===d&&c.to===l)||o.dynamics.push([a,c]);for(let a of s.shortcuts)i.has(a.to)||(o.shortcuts.push(a),i.add(a.to))}};n(f.NodeType.InitialNode)}function ho(e,{prefix:t=""}={}){if(f.IS_DEBUG){R(`${t}Nodes are:`);for(let n=0;n<e.nodes.length;++n)R(`${t} ${n}: ${JSON.stringify(e.nodes[n])}`)}}function Ao(e,t,n=!1){R(`Running a vm on ${JSON.stringify(t)}`);let r=[{node:f.NodeType.InitialNode,state:{candidateUsage:null,requiredOptions:[],errorMessage:null,ignoreOptions:!1,options:[],path:[],positionals:[],remainder:null,selectedIndex:null,tokens:[]}}];ho(e,{prefix:" "});let o=[f.SpecialToken.StartOfInput,...t];for(let i=0;i<o.length;++i){let u=o[i],s=u===f.SpecialToken.EndOfInput||u===f.SpecialToken.EndOfPartialInput,a=i-1;R(` Processing ${JSON.stringify(u)}`);let c=[];for(let{node:d,state:l}of r){R(` Current node is ${d}`);let D=e.nodes[d];if(d===f.NodeType.ErrorNode){c.push({node:d,state:l});continue}console.assert(D.shortcuts.length===0,"Shortcuts should have been eliminated by now");let p=Object.prototype.hasOwnProperty.call(D.statics,u);if(!n||i<o.length-1||p)if(p){let h=D.statics[u];for(let{to:g,reducer:F}of h)c.push({node:g,state:typeof F<"u"?Me(st,F,l,u,a):l}),R(` Static transition to ${g} found`)}else R(" No static transition found");else{let h=!1;for(let g of Object.keys(D.statics))if(g.startsWith(u)){if(u===g)for(let{to:F,reducer:C}of D.statics[g])c.push({node:F,state:typeof C<"u"?Me(st,C,l,u,a):l}),R(` Static transition to ${F} found`);else for(let{to:F}of D.statics[g])c.push({node:F,state:{...l,remainder:g.slice(u.length)}}),R(` Static transition to ${F} found (partial match)`);h=!0}h||R(" No partial static transition found")}if(!s)for(let[h,{to:g,reducer:F}]of D.dynamics)Me(yo,h,l,u,a)&&(c.push({node:g,state:typeof F<"u"?Me(st,F,l,u,a):l}),R(` Dynamic transition to ${g} found (via ${h})`))}if(c.length===0&&s&&t.length===1)return[{node:f.NodeType.InitialNode,state:Do}];if(c.length===0)throw new ut.UnknownSyntaxError(t,r.filter(({node:d})=>d!==f.NodeType.ErrorNode).map(({state:d})=>({usage:d.candidateUsage,reason:null})));if(c.every(({node:d})=>d===f.NodeType.ErrorNode))throw new ut.UnknownSyntaxError(t,c.map(({state:d})=>({usage:d.candidateUsage,reason:d.errorMessage})));r=mo(c)}if(r.length>0){R(" Results:");for(let i of r)R(` - ${i.node} -> ${JSON.stringify(i.state)}`)}else R(" No results");return r}function As(e,t,{endToken:n=f.SpecialToken.EndOfInput}={}){let r=Ao(e,[...t,n]);return go(t,r.map(({state:o})=>o))}function mo(e){let t=0;for(let{state:n}of e)n.path.length>t&&(t=n.path.length);return e.filter(({state:n})=>n.path.length===t)}function go(e,t){let n=t.filter(l=>l.selectedIndex!==null);if(n.length===0)throw new Error;let r=n.filter(l=>l.selectedIndex===f.HELP_COMMAND_INDEX||l.requiredOptions.every(D=>D.some(p=>l.options.find(h=>h.name===p))));if(r.length===0)throw new ut.UnknownSyntaxError(e,n.map(l=>({usage:l.candidateUsage,reason:null})));let o=0;for(let l of r)l.path.length>o&&(o=l.path.length);let i=r.filter(l=>l.path.length===o),u=l=>l.positionals.filter(({extra:D})=>!D).length+l.options.length,s=i.map(l=>({state:l,positionalCount:u(l)})),a=0;for(let{positionalCount:l}of s)l>a&&(a=l);let c=s.filter(({positionalCount:l})=>l===a).map(({state:l})=>l),d=Fo(c);if(d.length>1)throw new ut.AmbiguousSyntaxError(e,d.map(l=>l.candidateUsage));return d[0]}function Fo(e){let t=[],n=[];for(let r of e)r.selectedIndex===f.HELP_COMMAND_INDEX?n.push(r):t.push(r);return n.length>0&&t.push({...Do,path:Eo(...n.map(r=>r.path)),options:n.reduce((r,o)=>r.concat(o.options),[])}),t}function Eo(e,t,...n){return t===void 0?Array.from(e):Eo(e.filter((r,o)=>r===t[o]),...n)}function L(){return{dynamics:[],shortcuts:[],statics:{}}}function Yt(e){return e===f.NodeType.SuccessNode||e===f.NodeType.ErrorNode}function it(e,t=0){return{to:Yt(e.to)?e.to:e.to>=f.NodeType.CustomNode?e.to+t-f.NodeType.CustomNode+1:e.to+t,reducer:e.reducer}}function Co(e,t=0){let n=L();for(let[r,o]of e.dynamics)n.dynamics.push([r,it(o,t)]);for(let r of e.shortcuts)n.shortcuts.push(it(r,t));for(let[r,o]of Object.entries(e.statics))n.statics[r]=o.map(i=>it(i,t));return n}function k(e,t,n,r,o){e.nodes[t].dynamics.push([n,{to:r,reducer:o}])}function de(e,t,n,r){e.nodes[t].shortcuts.push({to:n,reducer:r})}function I(e,t,n,r,o){(Object.prototype.hasOwnProperty.call(e.nodes[t].statics,n)?e.nodes[t].statics[n]:e.nodes[t].statics[n]=[]).push({to:r,reducer:o})}function Me(e,t,n,r,o){if(Array.isArray(t)){let[i,...u]=t;return e[i](n,r,o,...u)}else return e[t](n,r,o)}var yo={always:()=>!0,isOptionLike:(e,t)=>!e.ignoreOptions&&t!=="-"&&t.startsWith("-"),isNotOptionLike:(e,t)=>e.ignoreOptions||t==="-"||!t.startsWith("-"),isOption:(e,t,n,r)=>!e.ignoreOptions&&t===r,isBatchOption:(e,t,n,r)=>!e.ignoreOptions&&f.BATCH_REGEX.test(t)&&[...t.slice(1)].every(o=>r.has(`-${o}`)),isBoundOption:(e,t,n,r,o)=>{let i=t.match(f.BINDING_REGEX);return!e.ignoreOptions&&!!i&&f.OPTION_REGEX.test(i[1])&&r.has(i[1])&&o.filter(u=>u.nameSet.includes(i[1])).every(u=>u.allowBinding)},isNegatedOption:(e,t,n,r)=>!e.ignoreOptions&&t===`--no-${r.slice(2)}`,isHelp:(e,t)=>!e.ignoreOptions&&f.HELP_REGEX.test(t),isUnsupportedOption:(e,t,n,r)=>!e.ignoreOptions&&t.startsWith("-")&&f.OPTION_REGEX.test(t)&&!r.has(t),isInvalidOption:(e,t)=>!e.ignoreOptions&&t.startsWith("-")&&!f.OPTION_REGEX.test(t)},st={setCandidateState:(e,t,n,r)=>({...e,...r}),setSelectedIndex:(e,t,n,r)=>({...e,selectedIndex:r}),pushBatch:(e,t,n,r)=>{let o=e.options.slice(),i=e.tokens.slice();for(let u=1;u<t.length;++u){let s=r.get(`-${t[u]}`),a=u===1?[0,2]:[u,u+1];o.push({name:s,value:!0}),i.push({segmentIndex:n,type:"option",option:s,slice:a})}return{...e,options:o,tokens:i}},pushBound:(e,t,n)=>{let[,r,o]=t.match(f.BINDING_REGEX),i=e.options.concat({name:r,value:o}),u=e.tokens.concat([{segmentIndex:n,type:"option",slice:[0,r.length],option:r},{segmentIndex:n,type:"assign",slice:[r.length,r.length+1]},{segmentIndex:n,type:"value",slice:[r.length+1,r.length+o.length+1]}]);return{...e,options:i,tokens:u}},pushPath:(e,t,n)=>{let r=e.path.concat(t),o=e.tokens.concat({segmentIndex:n,type:"path"});return{...e,path:r,tokens:o}},pushPositional:(e,t,n)=>{let r=e.positionals.concat({value:t,extra:!1}),o=e.tokens.concat({segmentIndex:n,type:"positional"});return{...e,positionals:r,tokens:o}},pushExtra:(e,t,n)=>{let r=e.positionals.concat({value:t,extra:!0}),o=e.tokens.concat({segmentIndex:n,type:"positional"});return{...e,positionals:r,tokens:o}},pushExtraNoLimits:(e,t,n)=>{let r=e.positionals.concat({value:t,extra:X}),o=e.tokens.concat({segmentIndex:n,type:"positional"});return{...e,positionals:r,tokens:o}},pushTrue:(e,t,n,r)=>{let o=e.options.concat({name:r,value:!0}),i=e.tokens.concat({segmentIndex:n,type:"option",option:r});return{...e,options:o,tokens:i}},pushFalse:(e,t,n,r)=>{let o=e.options.concat({name:r,value:!1}),i=e.tokens.concat({segmentIndex:n,type:"option",option:r});return{...e,options:o,tokens:i}},pushUndefined:(e,t,n,r)=>{let o=e.options.concat({name:t,value:void 0}),i=e.tokens.concat({segmentIndex:n,type:"option",option:t});return{...e,options:o,tokens:i}},pushStringValue:(e,t,n)=>{var r;let o=e.options[e.options.length-1],i=e.options.slice(),u=e.tokens.concat({segmentIndex:n,type:"value"});return o.value=((r=o.value)!==null&&r!==void 0?r:[]).concat([t]),{...e,options:i,tokens:u}},setStringValue:(e,t,n)=>{let r=e.options[e.options.length-1],o=e.options.slice(),i=e.tokens.concat({segmentIndex:n,type:"value"});return r.value=t,{...e,options:o,tokens:i}},inhibateOptions:e=>({...e,ignoreOptions:!0}),useHelp:(e,t,n,r)=>{let[,,o]=t.match(f.HELP_REGEX);return typeof o<"u"?{...e,options:[{name:"-c",value:String(r)},{name:"-i",value:o}]}:{...e,options:[{name:"-c",value:String(r)}]}},setError:(e,t,n,r)=>t===f.SpecialToken.EndOfInput||t===f.SpecialToken.EndOfPartialInput?{...e,errorMessage:`${r}.`}:{...e,errorMessage:`${r} ("${t}").`},setOptionArityError:(e,t)=>{let n=e.options[e.options.length-1];return{...e,errorMessage:`Not enough arguments to option ${n.name}.`}}},X=Symbol(),at=class{constructor(t,n){this.allOptionNames=new Map,this.arity={leading:[],trailing:[],extra:[],proxy:!1},this.options=[],this.paths=[],this.cliIndex=t,this.cliOpts=n}addPath(t){this.paths.push(t)}setArity({leading:t=this.arity.leading,trailing:n=this.arity.trailing,extra:r=this.arity.extra,proxy:o=this.arity.proxy}){Object.assign(this.arity,{leading:t,trailing:n,extra:r,proxy:o})}addPositional({name:t="arg",required:n=!0}={}){if(!n&&this.arity.extra===X)throw new Error("Optional parameters cannot be declared when using .rest() or .proxy()");if(!n&&this.arity.trailing.length>0)throw new Error("Optional parameters cannot be declared after the required trailing positional arguments");!n&&this.arity.extra!==X?this.arity.extra.push(t):this.arity.extra!==X&&this.arity.extra.length===0?this.arity.leading.push(t):this.arity.trailing.push(t)}addRest({name:t="arg",required:n=0}={}){if(this.arity.extra===X)throw new Error("Infinite lists cannot be declared multiple times in the same command");if(this.arity.trailing.length>0)throw new Error("Infinite lists cannot be declared after the required trailing positional arguments");for(let r=0;r<n;++r)this.addPositional({name:t});this.arity.extra=X}addProxy({required:t=0}={}){this.addRest({required:t}),this.arity.proxy=!0}addOption({names:t,description:n,arity:r=0,hidden:o=!1,required:i=!1,allowBinding:u=!0}){if(!u&&r>1)throw new Error("The arity cannot be higher than 1 when the option only supports the --arg=value syntax");if(!Number.isInteger(r))throw new Error(`The arity must be an integer, got ${r}`);if(r<0)throw new Error(`The arity must be positive, got ${r}`);let s=t.reduce((a,c)=>c.length>a.length?c:a,"");for(let a of t)this.allOptionNames.set(a,s);this.options.push({preferredName:s,nameSet:t,description:n,arity:r,hidden:o,required:i,allowBinding:u})}setContext(t){this.context=t}usage({detailed:t=!0,inlineOptions:n=!0}={}){let r=[this.cliOpts.binaryName],o=[];if(this.paths.length>0&&r.push(...this.paths[0]),t){for(let{preferredName:u,nameSet:s,arity:a,hidden:c,description:d,required:l}of this.options){if(c)continue;let D=[];for(let h=0;h<a;++h)D.push(` #${h}`);let p=`${s.join(",")}${D.join("")}`;!n&&d?o.push({preferredName:u,nameSet:s,definition:p,description:d,required:l}):r.push(l?`<${p}>`:`[${p}]`)}r.push(...this.arity.leading.map(u=>`<${u}>`)),this.arity.extra===X?r.push("..."):r.push(...this.arity.extra.map(u=>`[${u}]`)),r.push(...this.arity.trailing.map(u=>`<${u}>`))}return{usage:r.join(" "),options:o}}compile(){if(typeof this.context>"u")throw new Error("Assertion failed: No context attached");let t=Qt(),n=f.NodeType.InitialNode,r=this.usage().usage,o=this.options.filter(s=>s.required).map(s=>s.nameSet);n=G(t,L()),I(t,f.NodeType.InitialNode,f.SpecialToken.StartOfInput,n,["setCandidateState",{candidateUsage:r,requiredOptions:o}]);let i=this.arity.proxy?"always":"isNotOptionLike",u=this.paths.length>0?this.paths:[[]];for(let s of u){let a=n;if(s.length>0){let D=G(t,L());de(t,a,D),this.registerOptions(t,D),a=D}for(let D=0;D<s.length;++D){let p=G(t,L());if(I(t,a,s[D],p,"pushPath"),a=p,D+1<s.length){let h=G(t,L());k(t,a,"isHelp",h,["useHelp",this.cliIndex]),I(t,h,f.SpecialToken.EndOfInput,f.NodeType.SuccessNode,["setSelectedIndex",f.HELP_COMMAND_INDEX])}}if(this.arity.leading.length>0||!this.arity.proxy){let D=G(t,L());k(t,a,"isHelp",D,["useHelp",this.cliIndex]),k(t,D,"always",D,"pushExtra"),I(t,D,f.SpecialToken.EndOfInput,f.NodeType.SuccessNode,["setSelectedIndex",f.HELP_COMMAND_INDEX]),this.registerOptions(t,a)}this.arity.leading.length>0&&(I(t,a,f.SpecialToken.EndOfInput,f.NodeType.ErrorNode,["setError","Not enough positional arguments"]),I(t,a,f.SpecialToken.EndOfPartialInput,f.NodeType.SuccessNode,["setSelectedIndex",this.cliIndex]));let c=a;for(let D=0;D<this.arity.leading.length;++D){let p=G(t,L());(!this.arity.proxy||D+1!==this.arity.leading.length)&&this.registerOptions(t,p),(this.arity.trailing.length>0||D+1!==this.arity.leading.length)&&(I(t,p,f.SpecialToken.EndOfInput,f.NodeType.ErrorNode,["setError","Not enough positional arguments"]),I(t,p,f.SpecialToken.EndOfPartialInput,f.NodeType.SuccessNode,["setSelectedIndex",this.cliIndex])),k(t,c,"isNotOptionLike",p,"pushPositional"),c=p}let d=c;if(this.arity.extra===X||this.arity.extra.length>0){let D=G(t,L());if(de(t,c,D),this.arity.extra===X){let p=G(t,L());this.arity.proxy||this.registerOptions(t,p),k(t,c,i,p,"pushExtraNoLimits"),k(t,p,i,p,"pushExtraNoLimits"),de(t,p,D)}else for(let p=0;p<this.arity.extra.length;++p){let h=G(t,L());(!this.arity.proxy||p>0)&&this.registerOptions(t,h),k(t,d,i,h,"pushExtra"),de(t,h,D),d=h}d=D}this.arity.trailing.length>0&&(I(t,d,f.SpecialToken.EndOfInput,f.NodeType.ErrorNode,["setError","Not enough positional arguments"]),I(t,d,f.SpecialToken.EndOfPartialInput,f.NodeType.SuccessNode,["setSelectedIndex",this.cliIndex]));let l=d;for(let D=0;D<this.arity.trailing.length;++D){let p=G(t,L());this.arity.proxy||this.registerOptions(t,p),D+1<this.arity.trailing.length&&(I(t,p,f.SpecialToken.EndOfInput,f.NodeType.ErrorNode,["setError","Not enough positional arguments"]),I(t,p,f.SpecialToken.EndOfPartialInput,f.NodeType.SuccessNode,["setSelectedIndex",this.cliIndex])),k(t,l,"isNotOptionLike",p,"pushPositional"),l=p}k(t,l,i,f.NodeType.ErrorNode,["setError","Extraneous positional argument"]),I(t,l,f.SpecialToken.EndOfInput,f.NodeType.SuccessNode,["setSelectedIndex",this.cliIndex]),I(t,l,f.SpecialToken.EndOfPartialInput,f.NodeType.SuccessNode,["setSelectedIndex",this.cliIndex])}return{machine:t,context:this.context}}registerOptions(t,n){k(t,n,["isOption","--"],n,"inhibateOptions"),k(t,n,["isBatchOption",this.allOptionNames],n,["pushBatch",this.allOptionNames]),k(t,n,["isBoundOption",this.allOptionNames,this.options],n,"pushBound"),k(t,n,["isUnsupportedOption",this.allOptionNames],f.NodeType.ErrorNode,["setError","Unsupported option name"]),k(t,n,["isInvalidOption"],f.NodeType.ErrorNode,["setError","Invalid option name"]);for(let r of this.options)if(r.arity===0)for(let o of r.nameSet)k(t,n,["isOption",o],n,["pushTrue",r.preferredName]),o.startsWith("--")&&!o.startsWith("--no-")&&k(t,n,["isNegatedOption",o],n,["pushFalse",r.preferredName]);else{let o=G(t,L());for(let i of r.nameSet)k(t,n,["isOption",i],o,["pushUndefined",r.preferredName]);for(let i=0;i<r.arity;++i){let u=G(t,L());I(t,o,f.SpecialToken.EndOfInput,f.NodeType.ErrorNode,"setOptionArityError"),I(t,o,f.SpecialToken.EndOfPartialInput,f.NodeType.ErrorNode,"setOptionArityError"),k(t,o,"isOptionLike",f.NodeType.ErrorNode,"setOptionArityError");let s=r.arity===1?"setStringValue":"pushStringValue";k(t,o,"isNotOptionLike",u,s),o=u}de(t,o,n)}}},zt=class e{constructor({binaryName:t="..."}={}){this.builders=[],this.opts={binaryName:t}}static build(t,n={}){return new e(n).commands(t).compile()}getBuilderByIndex(t){if(!(t>=0&&t<this.builders.length))throw new Error(`Assertion failed: Out-of-bound command index (${t})`);return this.builders[t]}commands(t){for(let n of t)n(this.command());return this}command(){let t=new at(this.builders.length,this.opts);return this.builders.push(t),t}compile(){let t=[],n=[];for(let o of this.builders){let{machine:i,context:u}=o.compile();t.push(i),n.push(u)}let r=po(t);return fo(r),{machine:r,contexts:n,process:(o,{partial:i}={})=>{let u=i?f.SpecialToken.EndOfPartialInput:f.SpecialToken.EndOfInput;return As(r,o,{endToken:u})}}}};w.CliBuilder=zt;w.CommandBuilder=at;w.NoLimits=X;w.aggregateHelpStates=Fo;w.cloneNode=Co;w.cloneTransition=it;w.debug=R;w.debugMachine=ho;w.execute=Me;w.injectNode=G;w.isTerminalNode=Yt;w.makeAnyOfMachine=po;w.makeNode=L;w.makeStateMachine=Qt;w.reducers=st;w.registerDynamic=k;w.registerShortcut=de;w.registerStatic=I;w.runMachineInternal=Ao;w.selectBestState=go;w.simplifyMachine=fo;w.tests=yo;w.trimSmallerBranches=mo});var vo=B(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});var ms=require("tty");function gs(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var Kt=gs(ms);function Fs(){return Kt.default&&"getColorDepth"in Kt.default.WriteStream.prototype?Kt.default.WriteStream.prototype.getColorDepth():process.env.FORCE_COLOR==="0"?1:process.env.FORCE_COLOR==="1"||typeof process.stdout<"u"&&process.stdout.isTTY?8:1}var bo;function Es(e){let t=bo;if(typeof t>"u"){if(e.stdout===process.stdout&&e.stderr===process.stderr)return null;let{AsyncLocalStorage:n}=require("async_hooks");t=bo=new n;let r=process.stdout._write;process.stdout._write=function(i,u,s){let a=t.getStore();return typeof a>"u"?r.call(this,i,u,s):a.stdout.write(i,u,s)};let o=process.stderr._write;process.stderr._write=function(i,u,s){let a=t.getStore();return typeof a>"u"?o.call(this,i,u,s):a.stderr.write(i,u,s)}}return n=>t.run(e,n)}lt.getCaptureActivator=Es;lt.getDefaultColorDepth=Fs});var Bo=B(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});var Cs=ae(),qt=class e extends Cs.Command{constructor(t){super(),this.contexts=t,this.commands=[]}static from(t,n){let r=new e(n);r.path=t.path;for(let o of t.options)switch(o.name){case"-c":r.commands.push(Number(o.value));break;case"-i":r.index=Number(o.value);break}return r}async execute(){let t=this.commands;if(typeof this.index<"u"&&this.index>=0&&this.index<t.length&&(t=[t[this.index]]),t.length===0)this.context.stdout.write(this.cli.usage());else if(t.length===1)this.context.stdout.write(this.cli.usage(this.contexts[t[0]].commandClass,{detailed:!0}));else if(t.length>1){this.context.stdout.write(`Multiple commands match your selection:
|
|
37
|
+
- ${r}`}super(n)}};function Mi(e,t){if(!t(e))throw new ue}function ji(e,t){let n=[];if(!t(e,{errors:n}))throw new ue({errors:n})}function Hi(e,t){}function Gi(e,t,{coerce:n=!1,errors:r,throw:o}={}){let i=r?[]:void 0;if(!n){if(t(e,{errors:i}))return o?e:{value:e,errors:void 0};if(o)throw new ue({errors:i});return{value:void 0,errors:i??!0}}let u={value:e},s=Z(u,"value"),a=[];if(!t(e,{errors:i,coercion:s,coercions:a})){if(o)throw new ue({errors:i});return{value:void 0,errors:i??!0}}for(let[,c]of a)c();return o?u.value:{value:u.value,errors:void 0}}function Ui(e,t){let n=nt(e);return((...r)=>{if(!n(r))throw new ue;return t(...r)})}function zi(e){return E({test:(t,n)=>t.length>=e?!0:A(n,`Expected to have a length of at least ${e} elements (got ${t.length})`)})}function Qi(e){return E({test:(t,n)=>t.length<=e?!0:A(n,`Expected to have a length of at most ${e} elements (got ${t.length})`)})}function uo(e){return E({test:(t,n)=>t.length!==e?A(n,`Expected to have a length of exactly ${e} elements (got ${t.length})`):!0})}function Yi({map:e}={}){return E({test:(t,n)=>{let r=new Set,o=new Set;for(let i=0,u=t.length;i<u;++i){let s=t[i],a=typeof e<"u"?e(s):s;if(r.has(a)){if(o.has(a))continue;A(n,`Expected to contain unique elements; got a duplicate with ${b(t)}`),o.add(a)}else r.add(a)}return o.size===0}})}function Ki(){return E({test:(e,t)=>e<=0?!0:A(t,`Expected to be negative (got ${e})`)})}function qi(){return E({test:(e,t)=>e>=0?!0:A(t,`Expected to be positive (got ${e})`)})}function Wi(e){return E({test:(t,n)=>t>=e?!0:A(n,`Expected to be at least ${e} (got ${t})`)})}function Vi(e){return E({test:(t,n)=>t<=e?!0:A(n,`Expected to be at most ${e} (got ${t})`)})}function Zi(e,t){return E({test:(n,r)=>n>=e&&n<=t?!0:A(r,`Expected to be in the [${e}; ${t}] range (got ${n})`)})}function Xi(e,t){return E({test:(n,r)=>n>=e&&n<t?!0:A(r,`Expected to be in the [${e}; ${t}[ range (got ${n})`)})}function Ji({unsafe:e=!1}={}){return E({test:(t,n)=>t!==Math.round(t)?A(n,`Expected to be an integer (got ${t})`):!e&&!Number.isSafeInteger(t)?A(n,`Expected to be a safe integer (got ${t})`):!0})}function _i(e){return E({test:(t,n)=>e.test(t)?!0:A(n,`Expected to match the pattern ${e.toString()} (got ${b(t)})`)})}function $i(){return E({test:(e,t)=>e!==e.toLowerCase()?A(t,`Expected to be all-lowercase (got ${e})`):!0})}function es(){return E({test:(e,t)=>e!==e.toUpperCase()?A(t,`Expected to be all-uppercase (got ${e})`):!0})}function ts(){return E({test:(e,t)=>bi.test(e)?!0:A(t,`Expected to be a valid UUID v4 (got ${b(e)})`)})}function ns(){return E({test:(e,t)=>no.test(e)?!0:A(t,`Expected to be a valid ISO 8601 date string (got ${b(e)})`)})}function os({alpha:e=!1}){return E({test:(t,n)=>(e?Ei.test(t):Ci.test(t))?!0:A(n,`Expected to be a valid hexadecimal color string (got ${b(t)})`)})}function rs(){return E({test:(e,t)=>yi.test(e)?!0:A(t,`Expected to be a valid base 64 string (got ${b(e)})`)})}function is(e=Gt()){return E({test:(t,n)=>{let r;try{r=JSON.parse(t)}catch{return A(n,`Expected to be a valid JSON string (got ${b(t)})`)}return e(r,n)}})}function ao(e,...t){let n=Array.isArray(t[0])?t[0]:t;return E({test:(r,o)=>{var i,u;let s={value:r},a=typeof o?.coercions<"u"?Z(s,"value"):void 0,c=typeof o?.coercions<"u"?[]:void 0;if(!e(r,Object.assign(Object.assign({},o),{coercion:a,coercions:c})))return!1;let d=[];if(typeof c<"u")for(let[,l]of c)d.push(l());try{if(typeof o?.coercions<"u"){if(s.value!==r){if(typeof o?.coercion>"u")return A(o,"Unbound coercion result");o.coercions.push([(i=o.p)!==null&&i!==void 0?i:".",o.coercion.bind(null,s.value)])}(u=o?.coercions)===null||u===void 0||u.push(...c)}return n.every(l=>l(s.value,o))}finally{for(let l of d)l()}}})}function ss(e,...t){let n=Array.isArray(t[0])?t[0]:t;return ao(e,n)}function us(e){return E({test:(t,n)=>typeof t>"u"?!0:e(t,n)})}function as(e){return E({test:(t,n)=>t===null?!0:e(t,n)})}var rt={missing:(e,t)=>e.has(t),undefined:(e,t,n)=>e.has(t)&&typeof n[t]<"u",nil:(e,t,n)=>e.has(t)&&n[t]!=null,falsy:(e,t,n)=>e.has(t)&&!!n[t]};function cs(e,t){var n;let r=new Set(e),o=rt[(n=t?.missingIf)!==null&&n!==void 0?n:"missing"];return E({test:(i,u)=>{let s=new Set(Object.keys(i)),a=[];for(let c of r)o(s,c,i)||a.push(c);return a.length>0?A(u,`Missing required ${Ht(a.length,"property","properties")} ${ye(a,"and")}`):!0}})}function ls(e,t){var n;let r=new Set(e),o=rt[(n=t?.missingIf)!==null&&n!==void 0?n:"missing"];return E({test:(i,u)=>Object.keys(i).some(c=>o(r,c,i))?!0:A(u,`Missing at least one property from ${ye(Array.from(r),"or")}`)})}function ds(e,t){var n;let r=new Set(e),o=rt[(n=t?.missingIf)!==null&&n!==void 0?n:"missing"];return E({test:(i,u)=>{let s=new Set(Object.keys(i)),a=[];for(let c of r)o(s,c,i)&&a.push(c);return a.length>0?A(u,`Forbidden ${Ht(a.length,"property","properties")} ${ye(a,"and")}`):!0}})}function Ds(e,t){var n;let r=new Set(e),o=rt[(n=t?.missingIf)!==null&&n!==void 0?n:"missing"];return E({test:(i,u)=>{let s=new Set(Object.keys(i)),a=[];for(let c of r)o(s,c,i)&&a.push(c);return a.length>1?A(u,`Mutually exclusive properties ${ye(a,"and")}`):!0}})}(function(e){e.Forbids="Forbids",e.Requires="Requires"})(m.KeyRelationship||(m.KeyRelationship={}));var ps={[m.KeyRelationship.Forbids]:{expect:!1,message:"forbids using"},[m.KeyRelationship.Requires]:{expect:!0,message:"requires using"}};function fs(e,t,n,{ignore:r=[]}={}){let o=new Set(r),i=new Set(n),u=ps[t],s=t===m.KeyRelationship.Forbids?"or":"and";return E({test:(a,c)=>{let d=new Set(Object.keys(a));if(!d.has(e)||o.has(a[e]))return!0;let l=[];for(let D of i)(d.has(D)&&!o.has(a[D]))!==u.expect&&l.push(D);return l.length>=1?A(c,`Property "${e}" ${u.message} ${Ht(l.length,"property","properties")} ${ye(l,s)}`):!0}})}m.TypeAssertionError=ue;m.applyCascade=ss;m.as=Gi;m.assert=Mi;m.assertWithErrors=ji;m.cascade=ao;m.fn=Ui;m.hasAtLeastOneKey=ls;m.hasExactLength=uo;m.hasForbiddenKeys=ds;m.hasKeyRelationship=fs;m.hasMaxLength=Qi;m.hasMinLength=zi;m.hasMutuallyExclusiveKeys=Ds;m.hasRequiredKeys=cs;m.hasUniqueItems=Yi;m.isArray=tt;m.isAtLeast=Wi;m.isAtMost=Vi;m.isBase64=rs;m.isBoolean=xi;m.isDate=Pi;m.isDict=Ti;m.isEnum=Bi;m.isHexColor=os;m.isISO8601=ns;m.isInExclusiveRange=Xi;m.isInInclusiveRange=Zi;m.isInstanceOf=Ri;m.isInteger=Ji;m.isJSON=is;m.isLiteral=oo;m.isLowerCase=$i;m.isMap=Ii;m.isNegative=Ki;m.isNullable=as;m.isNumber=ki;m.isObject=io;m.isOneOf=Li;m.isOptional=us;m.isPartial=Ni;m.isPayload=Oi;m.isPositive=qi;m.isRecord=ot;m.isSet=Si;m.isString=ro;m.isTuple=nt;m.isUUID4=ts;m.isUnknown=Gt;m.isUpperCase=es;m.makeTrait=so;m.makeValidator=E;m.matchesRegExp=_i;m.softAssert=Hi});var ae=B(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});var lo=$();function hs(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if(n!=="default"){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var Le=class{constructor(){this.help=!1}static Usage(t){return t}async catch(t){throw t}async validateAndExecute(){let n=this.constructor.schema;if(Array.isArray(n)){let{isDict:o,isUnknown:i,applyCascade:u}=await Promise.resolve().then(function(){return hs(co())}),s=u(o(i()),n),a=[],c=[];if(!s(this,{errors:a,coercions:c}))throw lo.formatError("Invalid option schema",a);for(let[,l]of c)l()}else if(n!=null)throw new Error("Invalid command schema");let r=await this.execute();return typeof r<"u"?r:0}};Le.isOption=lo.isOptionSymbol;Le.Default=[];Ut.Command=Le});var ct=B(w=>{"use strict";Object.defineProperty(w,"__esModule",{value:!0});var f=$e(),ut=et();function R(e){f.IS_DEBUG&&console.log(e)}var Do={candidateUsage:null,requiredOptions:[],errorMessage:null,ignoreOptions:!1,path:[],positionals:[],options:[],remainder:null,selectedIndex:f.HELP_COMMAND_INDEX,tokens:[]};function Qt(){let e={nodes:[]};for(let t=0;t<f.NodeType.CustomNode;++t)e.nodes.push(L());return e}function po(e){let t=Qt(),n=[],r=t.nodes.length;for(let o of e){n.push(r);for(let i=0;i<o.nodes.length;++i)Yt(i)||t.nodes.push(Co(o.nodes[i],r));r+=o.nodes.length-f.NodeType.CustomNode+1}for(let o of n)de(t,f.NodeType.InitialNode,o);return t}function G(e,t){return e.nodes.push(t),e.nodes.length-1}function fo(e){let t=new Set,n=r=>{if(t.has(r))return;t.add(r);let o=e.nodes[r];for(let u of Object.values(o.statics))for(let{to:s}of u)n(s);for(let[,{to:u}]of o.dynamics)n(u);for(let{to:u}of o.shortcuts)n(u);let i=new Set(o.shortcuts.map(({to:u})=>u));for(;o.shortcuts.length>0;){let{to:u}=o.shortcuts.shift(),s=e.nodes[u];for(let[a,c]of Object.entries(s.statics)){let d=Object.prototype.hasOwnProperty.call(o.statics,a)?o.statics[a]:o.statics[a]=[];for(let l of c)d.some(({to:D})=>l.to===D)||d.push(l)}for(let[a,c]of s.dynamics)o.dynamics.some(([d,{to:l}])=>a===d&&c.to===l)||o.dynamics.push([a,c]);for(let a of s.shortcuts)i.has(a.to)||(o.shortcuts.push(a),i.add(a.to))}};n(f.NodeType.InitialNode)}function ho(e,{prefix:t=""}={}){if(f.IS_DEBUG){R(`${t}Nodes are:`);for(let n=0;n<e.nodes.length;++n)R(`${t} ${n}: ${JSON.stringify(e.nodes[n])}`)}}function mo(e,t,n=!1){R(`Running a vm on ${JSON.stringify(t)}`);let r=[{node:f.NodeType.InitialNode,state:{candidateUsage:null,requiredOptions:[],errorMessage:null,ignoreOptions:!1,options:[],path:[],positionals:[],remainder:null,selectedIndex:null,tokens:[]}}];ho(e,{prefix:" "});let o=[f.SpecialToken.StartOfInput,...t];for(let i=0;i<o.length;++i){let u=o[i],s=u===f.SpecialToken.EndOfInput||u===f.SpecialToken.EndOfPartialInput,a=i-1;R(` Processing ${JSON.stringify(u)}`);let c=[];for(let{node:d,state:l}of r){R(` Current node is ${d}`);let D=e.nodes[d];if(d===f.NodeType.ErrorNode){c.push({node:d,state:l});continue}console.assert(D.shortcuts.length===0,"Shortcuts should have been eliminated by now");let p=Object.prototype.hasOwnProperty.call(D.statics,u);if(!n||i<o.length-1||p)if(p){let h=D.statics[u];for(let{to:g,reducer:F}of h)c.push({node:g,state:typeof F<"u"?Me(st,F,l,u,a):l}),R(` Static transition to ${g} found`)}else R(" No static transition found");else{let h=!1;for(let g of Object.keys(D.statics))if(g.startsWith(u)){if(u===g)for(let{to:F,reducer:C}of D.statics[g])c.push({node:F,state:typeof C<"u"?Me(st,C,l,u,a):l}),R(` Static transition to ${F} found`);else for(let{to:F}of D.statics[g])c.push({node:F,state:{...l,remainder:g.slice(u.length)}}),R(` Static transition to ${F} found (partial match)`);h=!0}h||R(" No partial static transition found")}if(!s)for(let[h,{to:g,reducer:F}]of D.dynamics)Me(yo,h,l,u,a)&&(c.push({node:g,state:typeof F<"u"?Me(st,F,l,u,a):l}),R(` Dynamic transition to ${g} found (via ${h})`))}if(c.length===0&&s&&t.length===1)return[{node:f.NodeType.InitialNode,state:Do}];if(c.length===0)throw new ut.UnknownSyntaxError(t,r.filter(({node:d})=>d!==f.NodeType.ErrorNode).map(({state:d})=>({usage:d.candidateUsage,reason:null})));if(c.every(({node:d})=>d===f.NodeType.ErrorNode))throw new ut.UnknownSyntaxError(t,c.map(({state:d})=>({usage:d.candidateUsage,reason:d.errorMessage})));r=Ao(c)}if(r.length>0){R(" Results:");for(let i of r)R(` - ${i.node} -> ${JSON.stringify(i.state)}`)}else R(" No results");return r}function ms(e,t,{endToken:n=f.SpecialToken.EndOfInput}={}){let r=mo(e,[...t,n]);return go(t,r.map(({state:o})=>o))}function Ao(e){let t=0;for(let{state:n}of e)n.path.length>t&&(t=n.path.length);return e.filter(({state:n})=>n.path.length===t)}function go(e,t){let n=t.filter(l=>l.selectedIndex!==null);if(n.length===0)throw new Error;let r=n.filter(l=>l.selectedIndex===f.HELP_COMMAND_INDEX||l.requiredOptions.every(D=>D.some(p=>l.options.find(h=>h.name===p))));if(r.length===0)throw new ut.UnknownSyntaxError(e,n.map(l=>({usage:l.candidateUsage,reason:null})));let o=0;for(let l of r)l.path.length>o&&(o=l.path.length);let i=r.filter(l=>l.path.length===o),u=l=>l.positionals.filter(({extra:D})=>!D).length+l.options.length,s=i.map(l=>({state:l,positionalCount:u(l)})),a=0;for(let{positionalCount:l}of s)l>a&&(a=l);let c=s.filter(({positionalCount:l})=>l===a).map(({state:l})=>l),d=Fo(c);if(d.length>1)throw new ut.AmbiguousSyntaxError(e,d.map(l=>l.candidateUsage));return d[0]}function Fo(e){let t=[],n=[];for(let r of e)r.selectedIndex===f.HELP_COMMAND_INDEX?n.push(r):t.push(r);return n.length>0&&t.push({...Do,path:Eo(...n.map(r=>r.path)),options:n.reduce((r,o)=>r.concat(o.options),[])}),t}function Eo(e,t,...n){return t===void 0?Array.from(e):Eo(e.filter((r,o)=>r===t[o]),...n)}function L(){return{dynamics:[],shortcuts:[],statics:{}}}function Yt(e){return e===f.NodeType.SuccessNode||e===f.NodeType.ErrorNode}function it(e,t=0){return{to:Yt(e.to)?e.to:e.to>=f.NodeType.CustomNode?e.to+t-f.NodeType.CustomNode+1:e.to+t,reducer:e.reducer}}function Co(e,t=0){let n=L();for(let[r,o]of e.dynamics)n.dynamics.push([r,it(o,t)]);for(let r of e.shortcuts)n.shortcuts.push(it(r,t));for(let[r,o]of Object.entries(e.statics))n.statics[r]=o.map(i=>it(i,t));return n}function P(e,t,n,r,o){e.nodes[t].dynamics.push([n,{to:r,reducer:o}])}function de(e,t,n,r){e.nodes[t].shortcuts.push({to:n,reducer:r})}function I(e,t,n,r,o){(Object.prototype.hasOwnProperty.call(e.nodes[t].statics,n)?e.nodes[t].statics[n]:e.nodes[t].statics[n]=[]).push({to:r,reducer:o})}function Me(e,t,n,r,o){if(Array.isArray(t)){let[i,...u]=t;return e[i](n,r,o,...u)}else return e[t](n,r,o)}var yo={always:()=>!0,isOptionLike:(e,t)=>!e.ignoreOptions&&t!=="-"&&t.startsWith("-"),isNotOptionLike:(e,t)=>e.ignoreOptions||t==="-"||!t.startsWith("-"),isOption:(e,t,n,r)=>!e.ignoreOptions&&t===r,isBatchOption:(e,t,n,r)=>!e.ignoreOptions&&f.BATCH_REGEX.test(t)&&[...t.slice(1)].every(o=>r.has(`-${o}`)),isBoundOption:(e,t,n,r,o)=>{let i=t.match(f.BINDING_REGEX);return!e.ignoreOptions&&!!i&&f.OPTION_REGEX.test(i[1])&&r.has(i[1])&&o.filter(u=>u.nameSet.includes(i[1])).every(u=>u.allowBinding)},isNegatedOption:(e,t,n,r)=>!e.ignoreOptions&&t===`--no-${r.slice(2)}`,isHelp:(e,t)=>!e.ignoreOptions&&f.HELP_REGEX.test(t),isUnsupportedOption:(e,t,n,r)=>!e.ignoreOptions&&t.startsWith("-")&&f.OPTION_REGEX.test(t)&&!r.has(t),isInvalidOption:(e,t)=>!e.ignoreOptions&&t.startsWith("-")&&!f.OPTION_REGEX.test(t)},st={setCandidateState:(e,t,n,r)=>({...e,...r}),setSelectedIndex:(e,t,n,r)=>({...e,selectedIndex:r}),pushBatch:(e,t,n,r)=>{let o=e.options.slice(),i=e.tokens.slice();for(let u=1;u<t.length;++u){let s=r.get(`-${t[u]}`),a=u===1?[0,2]:[u,u+1];o.push({name:s,value:!0}),i.push({segmentIndex:n,type:"option",option:s,slice:a})}return{...e,options:o,tokens:i}},pushBound:(e,t,n)=>{let[,r,o]=t.match(f.BINDING_REGEX),i=e.options.concat({name:r,value:o}),u=e.tokens.concat([{segmentIndex:n,type:"option",slice:[0,r.length],option:r},{segmentIndex:n,type:"assign",slice:[r.length,r.length+1]},{segmentIndex:n,type:"value",slice:[r.length+1,r.length+o.length+1]}]);return{...e,options:i,tokens:u}},pushPath:(e,t,n)=>{let r=e.path.concat(t),o=e.tokens.concat({segmentIndex:n,type:"path"});return{...e,path:r,tokens:o}},pushPositional:(e,t,n)=>{let r=e.positionals.concat({value:t,extra:!1}),o=e.tokens.concat({segmentIndex:n,type:"positional"});return{...e,positionals:r,tokens:o}},pushExtra:(e,t,n)=>{let r=e.positionals.concat({value:t,extra:!0}),o=e.tokens.concat({segmentIndex:n,type:"positional"});return{...e,positionals:r,tokens:o}},pushExtraNoLimits:(e,t,n)=>{let r=e.positionals.concat({value:t,extra:X}),o=e.tokens.concat({segmentIndex:n,type:"positional"});return{...e,positionals:r,tokens:o}},pushTrue:(e,t,n,r)=>{let o=e.options.concat({name:r,value:!0}),i=e.tokens.concat({segmentIndex:n,type:"option",option:r});return{...e,options:o,tokens:i}},pushFalse:(e,t,n,r)=>{let o=e.options.concat({name:r,value:!1}),i=e.tokens.concat({segmentIndex:n,type:"option",option:r});return{...e,options:o,tokens:i}},pushUndefined:(e,t,n,r)=>{let o=e.options.concat({name:t,value:void 0}),i=e.tokens.concat({segmentIndex:n,type:"option",option:t});return{...e,options:o,tokens:i}},pushStringValue:(e,t,n)=>{var r;let o=e.options[e.options.length-1],i=e.options.slice(),u=e.tokens.concat({segmentIndex:n,type:"value"});return o.value=((r=o.value)!==null&&r!==void 0?r:[]).concat([t]),{...e,options:i,tokens:u}},setStringValue:(e,t,n)=>{let r=e.options[e.options.length-1],o=e.options.slice(),i=e.tokens.concat({segmentIndex:n,type:"value"});return r.value=t,{...e,options:o,tokens:i}},inhibateOptions:e=>({...e,ignoreOptions:!0}),useHelp:(e,t,n,r)=>{let[,,o]=t.match(f.HELP_REGEX);return typeof o<"u"?{...e,options:[{name:"-c",value:String(r)},{name:"-i",value:o}]}:{...e,options:[{name:"-c",value:String(r)}]}},setError:(e,t,n,r)=>t===f.SpecialToken.EndOfInput||t===f.SpecialToken.EndOfPartialInput?{...e,errorMessage:`${r}.`}:{...e,errorMessage:`${r} ("${t}").`},setOptionArityError:(e,t)=>{let n=e.options[e.options.length-1];return{...e,errorMessage:`Not enough arguments to option ${n.name}.`}}},X=Symbol(),at=class{constructor(t,n){this.allOptionNames=new Map,this.arity={leading:[],trailing:[],extra:[],proxy:!1},this.options=[],this.paths=[],this.cliIndex=t,this.cliOpts=n}addPath(t){this.paths.push(t)}setArity({leading:t=this.arity.leading,trailing:n=this.arity.trailing,extra:r=this.arity.extra,proxy:o=this.arity.proxy}){Object.assign(this.arity,{leading:t,trailing:n,extra:r,proxy:o})}addPositional({name:t="arg",required:n=!0}={}){if(!n&&this.arity.extra===X)throw new Error("Optional parameters cannot be declared when using .rest() or .proxy()");if(!n&&this.arity.trailing.length>0)throw new Error("Optional parameters cannot be declared after the required trailing positional arguments");!n&&this.arity.extra!==X?this.arity.extra.push(t):this.arity.extra!==X&&this.arity.extra.length===0?this.arity.leading.push(t):this.arity.trailing.push(t)}addRest({name:t="arg",required:n=0}={}){if(this.arity.extra===X)throw new Error("Infinite lists cannot be declared multiple times in the same command");if(this.arity.trailing.length>0)throw new Error("Infinite lists cannot be declared after the required trailing positional arguments");for(let r=0;r<n;++r)this.addPositional({name:t});this.arity.extra=X}addProxy({required:t=0}={}){this.addRest({required:t}),this.arity.proxy=!0}addOption({names:t,description:n,arity:r=0,hidden:o=!1,required:i=!1,allowBinding:u=!0}){if(!u&&r>1)throw new Error("The arity cannot be higher than 1 when the option only supports the --arg=value syntax");if(!Number.isInteger(r))throw new Error(`The arity must be an integer, got ${r}`);if(r<0)throw new Error(`The arity must be positive, got ${r}`);let s=t.reduce((a,c)=>c.length>a.length?c:a,"");for(let a of t)this.allOptionNames.set(a,s);this.options.push({preferredName:s,nameSet:t,description:n,arity:r,hidden:o,required:i,allowBinding:u})}setContext(t){this.context=t}usage({detailed:t=!0,inlineOptions:n=!0}={}){let r=[this.cliOpts.binaryName],o=[];if(this.paths.length>0&&r.push(...this.paths[0]),t){for(let{preferredName:u,nameSet:s,arity:a,hidden:c,description:d,required:l}of this.options){if(c)continue;let D=[];for(let h=0;h<a;++h)D.push(` #${h}`);let p=`${s.join(",")}${D.join("")}`;!n&&d?o.push({preferredName:u,nameSet:s,definition:p,description:d,required:l}):r.push(l?`<${p}>`:`[${p}]`)}r.push(...this.arity.leading.map(u=>`<${u}>`)),this.arity.extra===X?r.push("..."):r.push(...this.arity.extra.map(u=>`[${u}]`)),r.push(...this.arity.trailing.map(u=>`<${u}>`))}return{usage:r.join(" "),options:o}}compile(){if(typeof this.context>"u")throw new Error("Assertion failed: No context attached");let t=Qt(),n=f.NodeType.InitialNode,r=this.usage().usage,o=this.options.filter(s=>s.required).map(s=>s.nameSet);n=G(t,L()),I(t,f.NodeType.InitialNode,f.SpecialToken.StartOfInput,n,["setCandidateState",{candidateUsage:r,requiredOptions:o}]);let i=this.arity.proxy?"always":"isNotOptionLike",u=this.paths.length>0?this.paths:[[]];for(let s of u){let a=n;if(s.length>0){let D=G(t,L());de(t,a,D),this.registerOptions(t,D),a=D}for(let D=0;D<s.length;++D){let p=G(t,L());if(I(t,a,s[D],p,"pushPath"),a=p,D+1<s.length){let h=G(t,L());P(t,a,"isHelp",h,["useHelp",this.cliIndex]),I(t,h,f.SpecialToken.EndOfInput,f.NodeType.SuccessNode,["setSelectedIndex",f.HELP_COMMAND_INDEX])}}if(this.arity.leading.length>0||!this.arity.proxy){let D=G(t,L());P(t,a,"isHelp",D,["useHelp",this.cliIndex]),P(t,D,"always",D,"pushExtra"),I(t,D,f.SpecialToken.EndOfInput,f.NodeType.SuccessNode,["setSelectedIndex",f.HELP_COMMAND_INDEX]),this.registerOptions(t,a)}this.arity.leading.length>0&&(I(t,a,f.SpecialToken.EndOfInput,f.NodeType.ErrorNode,["setError","Not enough positional arguments"]),I(t,a,f.SpecialToken.EndOfPartialInput,f.NodeType.SuccessNode,["setSelectedIndex",this.cliIndex]));let c=a;for(let D=0;D<this.arity.leading.length;++D){let p=G(t,L());(!this.arity.proxy||D+1!==this.arity.leading.length)&&this.registerOptions(t,p),(this.arity.trailing.length>0||D+1!==this.arity.leading.length)&&(I(t,p,f.SpecialToken.EndOfInput,f.NodeType.ErrorNode,["setError","Not enough positional arguments"]),I(t,p,f.SpecialToken.EndOfPartialInput,f.NodeType.SuccessNode,["setSelectedIndex",this.cliIndex])),P(t,c,"isNotOptionLike",p,"pushPositional"),c=p}let d=c;if(this.arity.extra===X||this.arity.extra.length>0){let D=G(t,L());if(de(t,c,D),this.arity.extra===X){let p=G(t,L());this.arity.proxy||this.registerOptions(t,p),P(t,c,i,p,"pushExtraNoLimits"),P(t,p,i,p,"pushExtraNoLimits"),de(t,p,D)}else for(let p=0;p<this.arity.extra.length;++p){let h=G(t,L());(!this.arity.proxy||p>0)&&this.registerOptions(t,h),P(t,d,i,h,"pushExtra"),de(t,h,D),d=h}d=D}this.arity.trailing.length>0&&(I(t,d,f.SpecialToken.EndOfInput,f.NodeType.ErrorNode,["setError","Not enough positional arguments"]),I(t,d,f.SpecialToken.EndOfPartialInput,f.NodeType.SuccessNode,["setSelectedIndex",this.cliIndex]));let l=d;for(let D=0;D<this.arity.trailing.length;++D){let p=G(t,L());this.arity.proxy||this.registerOptions(t,p),D+1<this.arity.trailing.length&&(I(t,p,f.SpecialToken.EndOfInput,f.NodeType.ErrorNode,["setError","Not enough positional arguments"]),I(t,p,f.SpecialToken.EndOfPartialInput,f.NodeType.SuccessNode,["setSelectedIndex",this.cliIndex])),P(t,l,"isNotOptionLike",p,"pushPositional"),l=p}P(t,l,i,f.NodeType.ErrorNode,["setError","Extraneous positional argument"]),I(t,l,f.SpecialToken.EndOfInput,f.NodeType.SuccessNode,["setSelectedIndex",this.cliIndex]),I(t,l,f.SpecialToken.EndOfPartialInput,f.NodeType.SuccessNode,["setSelectedIndex",this.cliIndex])}return{machine:t,context:this.context}}registerOptions(t,n){P(t,n,["isOption","--"],n,"inhibateOptions"),P(t,n,["isBatchOption",this.allOptionNames],n,["pushBatch",this.allOptionNames]),P(t,n,["isBoundOption",this.allOptionNames,this.options],n,"pushBound"),P(t,n,["isUnsupportedOption",this.allOptionNames],f.NodeType.ErrorNode,["setError","Unsupported option name"]),P(t,n,["isInvalidOption"],f.NodeType.ErrorNode,["setError","Invalid option name"]);for(let r of this.options)if(r.arity===0)for(let o of r.nameSet)P(t,n,["isOption",o],n,["pushTrue",r.preferredName]),o.startsWith("--")&&!o.startsWith("--no-")&&P(t,n,["isNegatedOption",o],n,["pushFalse",r.preferredName]);else{let o=G(t,L());for(let i of r.nameSet)P(t,n,["isOption",i],o,["pushUndefined",r.preferredName]);for(let i=0;i<r.arity;++i){let u=G(t,L());I(t,o,f.SpecialToken.EndOfInput,f.NodeType.ErrorNode,"setOptionArityError"),I(t,o,f.SpecialToken.EndOfPartialInput,f.NodeType.ErrorNode,"setOptionArityError"),P(t,o,"isOptionLike",f.NodeType.ErrorNode,"setOptionArityError");let s=r.arity===1?"setStringValue":"pushStringValue";P(t,o,"isNotOptionLike",u,s),o=u}de(t,o,n)}}},zt=class e{constructor({binaryName:t="..."}={}){this.builders=[],this.opts={binaryName:t}}static build(t,n={}){return new e(n).commands(t).compile()}getBuilderByIndex(t){if(!(t>=0&&t<this.builders.length))throw new Error(`Assertion failed: Out-of-bound command index (${t})`);return this.builders[t]}commands(t){for(let n of t)n(this.command());return this}command(){let t=new at(this.builders.length,this.opts);return this.builders.push(t),t}compile(){let t=[],n=[];for(let o of this.builders){let{machine:i,context:u}=o.compile();t.push(i),n.push(u)}let r=po(t);return fo(r),{machine:r,contexts:n,process:(o,{partial:i}={})=>{let u=i?f.SpecialToken.EndOfPartialInput:f.SpecialToken.EndOfInput;return ms(r,o,{endToken:u})}}}};w.CliBuilder=zt;w.CommandBuilder=at;w.NoLimits=X;w.aggregateHelpStates=Fo;w.cloneNode=Co;w.cloneTransition=it;w.debug=R;w.debugMachine=ho;w.execute=Me;w.injectNode=G;w.isTerminalNode=Yt;w.makeAnyOfMachine=po;w.makeNode=L;w.makeStateMachine=Qt;w.reducers=st;w.registerDynamic=P;w.registerShortcut=de;w.registerStatic=I;w.runMachineInternal=mo;w.selectBestState=go;w.simplifyMachine=fo;w.tests=yo;w.trimSmallerBranches=Ao});var vo=B(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});var As=require("tty");function gs(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var Kt=gs(As);function Fs(){return Kt.default&&"getColorDepth"in Kt.default.WriteStream.prototype?Kt.default.WriteStream.prototype.getColorDepth():process.env.FORCE_COLOR==="0"?1:process.env.FORCE_COLOR==="1"||typeof process.stdout<"u"&&process.stdout.isTTY?8:1}var bo;function Es(e){let t=bo;if(typeof t>"u"){if(e.stdout===process.stdout&&e.stderr===process.stderr)return null;let{AsyncLocalStorage:n}=require("async_hooks");t=bo=new n;let r=process.stdout._write;process.stdout._write=function(i,u,s){let a=t.getStore();return typeof a>"u"?r.call(this,i,u,s):a.stdout.write(i,u,s)};let o=process.stderr._write;process.stderr._write=function(i,u,s){let a=t.getStore();return typeof a>"u"?o.call(this,i,u,s):a.stderr.write(i,u,s)}}return n=>t.run(e,n)}lt.getCaptureActivator=Es;lt.getDefaultColorDepth=Fs});var Bo=B(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});var Cs=ae(),qt=class e extends Cs.Command{constructor(t){super(),this.contexts=t,this.commands=[]}static from(t,n){let r=new e(n);r.path=t.path;for(let o of t.options)switch(o.name){case"-c":r.commands.push(Number(o.value));break;case"-i":r.index=Number(o.value);break}return r}async execute(){let t=this.commands;if(typeof this.index<"u"&&this.index>=0&&this.index<t.length&&(t=[t[this.index]]),t.length===0)this.context.stdout.write(this.cli.usage());else if(t.length===1)this.context.stdout.write(this.cli.usage(this.contexts[t[0]].commandClass,{detailed:!0}));else if(t.length>1){this.context.stdout.write(`Multiple commands match your selection:
|
|
38
38
|
`),this.context.stdout.write(`
|
|
39
39
|
`);let n=0;for(let r of this.commands)this.context.stdout.write(this.cli.usage(this.contexts[r].commandClass,{prefix:`${n++}. `.padStart(5)}));this.context.stdout.write(`
|
|
40
40
|
`),this.context.stdout.write(`Run again with -h=<index> to see the longer details of any of those commands.
|
|
41
|
-
`)}}};Wt.HelpCommand=qt});var
|
|
41
|
+
`)}}};Wt.HelpCommand=qt});var Po=B(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});var ys=$e(),bs=ct(),U=Mt(),ko=vo(),dt=ae(),vs=Bo(),wo=Symbol("clipanion/errorCommand");async function Bs(...e){let{resolvedOptions:t,resolvedCommandClasses:n,resolvedArgv:r,resolvedContext:o}=Oo(e);return be.from(n,t).runExit(r,o)}async function ws(...e){let{resolvedOptions:t,resolvedCommandClasses:n,resolvedArgv:r,resolvedContext:o}=Oo(e);return be.from(n,t).run(r,o)}function Oo(e){let t,n,r,o;switch(typeof process<"u"&&typeof process.argv<"u"&&(r=process.argv.slice(2)),e.length){case 1:n=e[0];break;case 2:e[0]&&e[0].prototype instanceof dt.Command||Array.isArray(e[0])?(n=e[0],Array.isArray(e[1])?r=e[1]:o=e[1]):(t=e[0],n=e[1]);break;case 3:Array.isArray(e[2])?(t=e[0],n=e[1],r=e[2]):e[0]&&e[0].prototype instanceof dt.Command||Array.isArray(e[0])?(n=e[0],r=e[1],o=e[2]):(t=e[0],n=e[1],o=e[2]);break;default:t=e[0],n=e[1],r=e[2],o=e[3];break}if(typeof r>"u")throw new Error("The argv parameter must be provided when running Clipanion outside of a Node context");return{resolvedOptions:t,resolvedCommandClasses:n,resolvedArgv:r,resolvedContext:o}}var be=class e{constructor({binaryLabel:t,binaryName:n="...",binaryVersion:r,enableCapture:o=!1,enableColors:i}={}){this.registrations=new Map,this.builder=new bs.CliBuilder({binaryName:n}),this.binaryLabel=t,this.binaryName=n,this.binaryVersion=r,this.enableCapture=o,this.enableColors=i}static from(t,n={}){let r=new e(n),o=Array.isArray(t)?t:[t];for(let i of o)r.register(i);return r}register(t){var n;let r=new Map,o=new t;for(let a in o){let c=o[a];typeof c=="object"&&c!==null&&c[dt.Command.isOption]&&r.set(a,c)}let i=this.builder.command(),u=i.cliIndex,s=(n=t.paths)!==null&&n!==void 0?n:o.paths;if(typeof s<"u")for(let a of s)i.addPath(a);this.registrations.set(t,{specs:r,builder:i,index:u});for(let[a,{definition:c}]of r.entries())c(i,a);i.setContext({commandClass:t})}process(t,n){let{input:r,context:o,partial:i}=typeof t=="object"&&Array.isArray(t)?{input:t,context:n}:t,{contexts:u,process:s}=this.builder.compile(),a=s(r,{partial:i}),c={...e.defaultContext,...o};switch(a.selectedIndex){case ys.HELP_COMMAND_INDEX:{let d=vs.HelpCommand.from(a,u);return d.context=c,d.tokens=a.tokens,d}default:{let{commandClass:d}=u[a.selectedIndex],l=this.registrations.get(d);if(typeof l>"u")throw new Error("Assertion failed: Expected the command class to have been registered.");let D=new d;D.context=c,D.tokens=a.tokens,D.path=a.path;try{for(let[p,{transformer:h}]of l.specs.entries())D[p]=h(l.builder,p,a,c);return D}catch(p){throw p[wo]=D,p}}break}}async run(t,n){var r,o;let i,u={...e.defaultContext,...n},s=(r=this.enableColors)!==null&&r!==void 0?r:u.colorDepth>1;if(!Array.isArray(t))i=t;else try{i=this.process(t,u)}catch(d){return u.stdout.write(this.error(d,{colored:s})),1}if(i.help)return u.stdout.write(this.usage(i,{colored:s,detailed:!0})),0;i.context=u,i.cli={binaryLabel:this.binaryLabel,binaryName:this.binaryName,binaryVersion:this.binaryVersion,enableCapture:this.enableCapture,enableColors:this.enableColors,definitions:()=>this.definitions(),definition:d=>this.definition(d),error:(d,l)=>this.error(d,l),format:d=>this.format(d),process:(d,l)=>this.process(d,{...u,...l}),run:(d,l)=>this.run(d,{...u,...l}),usage:(d,l)=>this.usage(d,l)};let a=this.enableCapture&&(o=ko.getCaptureActivator(u))!==null&&o!==void 0?o:xo,c;try{c=await a(()=>i.validateAndExecute().catch(d=>i.catch(d).then(()=>0)))}catch(d){return u.stdout.write(this.error(d,{colored:s,command:i})),1}return c}async runExit(t,n){process.exitCode=await this.run(t,n)}definition(t,{colored:n=!1}={}){if(!t.usage)return null;let{usage:r}=this.getUsageByRegistration(t,{detailed:!1}),{usage:o,options:i}=this.getUsageByRegistration(t,{detailed:!0,inlineOptions:!1}),u=typeof t.usage.category<"u"?U.formatMarkdownish(t.usage.category,{format:this.format(n),paragraphs:!1}):void 0,s=typeof t.usage.description<"u"?U.formatMarkdownish(t.usage.description,{format:this.format(n),paragraphs:!1}):void 0,a=typeof t.usage.details<"u"?U.formatMarkdownish(t.usage.details,{format:this.format(n),paragraphs:!0}):void 0,c=typeof t.usage.examples<"u"?t.usage.examples.map(([d,l])=>[U.formatMarkdownish(d,{format:this.format(n),paragraphs:!1}),l.replace(/\$0/g,this.binaryName)]):void 0;return{path:r,usage:o,category:u,description:s,details:a,examples:c,options:i}}definitions({colored:t=!1}={}){let n=[];for(let r of this.registrations.keys()){let o=this.definition(r,{colored:t});o&&n.push(o)}return n}usage(t=null,{colored:n,detailed:r=!1,prefix:o="$ "}={}){var i;if(t===null){for(let a of this.registrations.keys()){let c=a.paths,d=typeof a.usage<"u";if(!c||c.length===0||c.length===1&&c[0].length===0||((i=c?.some(p=>p.length===0))!==null&&i!==void 0?i:!1))if(t){t=null;break}else t=a;else if(d){t=null;continue}}t&&(r=!0)}let u=t!==null&&t instanceof dt.Command?t.constructor:t,s="";if(u)if(r){let{description:a="",details:c="",examples:d=[]}=u.usage||{};a!==""&&(s+=U.formatMarkdownish(a,{format:this.format(n),paragraphs:!1}).replace(/^./,p=>p.toUpperCase()),s+=`
|
|
42
42
|
`),(c!==""||d.length>0)&&(s+=`${this.format(n).header("Usage")}
|
|
43
43
|
`,s+=`
|
|
44
44
|
`);let{usage:l,options:D}=this.getUsageByRegistration(u,{inlineOptions:!1});if(s+=`${this.format(n).bold(o)}${l}
|
|
@@ -67,10 +67,10 @@ ${t.map(n=>`
|
|
|
67
67
|
`,s+=U.formatMarkdownish("You can also print more details about any of these commands by calling them with the `-h,--help` flag right after the command name.",{format:this.format(n),paragraphs:!0})}return s}error(t,n){var r,{colored:o,command:i=(r=t[wo])!==null&&r!==void 0?r:null}=n===void 0?{}:n;(!t||typeof t!="object"||!("stack"in t))&&(t=new Error(`Execution failed with a non-error rejection (rejected value: ${JSON.stringify(t)})`));let u="",s=t.name.replace(/([a-z])([A-Z])/g,"$1 $2");s==="Error"&&(s="Internal Error"),u+=`${this.format(o).error(s)}: ${t.message}
|
|
68
68
|
`;let a=t.clipanion;return typeof a<"u"?a.type==="usage"&&(u+=`
|
|
69
69
|
`,u+=this.usage(i)):t.stack&&(u+=`${t.stack.replace(/^.*\n/,"")}
|
|
70
|
-
`),u}format(t){var n;return((n=t??this.enableColors)!==null&&n!==void 0?n:e.defaultContext.colorDepth>1)?U.richFormat:U.textFormat}getUsageByRegistration(t,n){let r=this.registrations.get(t);if(typeof r>"u")throw new Error("Assertion failed: Unregistered command");return this.getUsageByIndex(r.index,n)}getUsageByIndex(t,n){return this.builder.getBuilderByIndex(t).usage(n)}};be.defaultContext={env:process.env,stdin:process.stdin,stdout:process.stdout,stderr:process.stderr,colorDepth:
|
|
71
|
-
`)}};Dt.paths=[["--clipanion=definitions"]];Vt.DefinitionsCommand=Dt});var Io=B(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});var
|
|
70
|
+
`),u}format(t){var n;return((n=t??this.enableColors)!==null&&n!==void 0?n:e.defaultContext.colorDepth>1)?U.richFormat:U.textFormat}getUsageByRegistration(t,n){let r=this.registrations.get(t);if(typeof r>"u")throw new Error("Assertion failed: Unregistered command");return this.getUsageByIndex(r.index,n)}getUsageByIndex(t,n){return this.builder.getBuilderByIndex(t).usage(n)}};be.defaultContext={env:process.env,stdin:process.stdin,stdout:process.stdout,stderr:process.stderr,colorDepth:ko.getDefaultColorDepth()};function xo(e){return e()}je.Cli=be;je.run=ws;je.runExit=Bs});var So=B(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});var xs=ae(),Dt=class extends xs.Command{async execute(){this.context.stdout.write(`${JSON.stringify(this.cli.definitions(),null,2)}
|
|
71
|
+
`)}};Dt.paths=[["--clipanion=definitions"]];Vt.DefinitionsCommand=Dt});var Io=B(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});var ks=ae(),pt=class extends ks.Command{async execute(){this.context.stdout.write(this.cli.usage())}};pt.paths=[["-h"],["--help"]];Zt.HelpCommand=pt});var Jt=B(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});var Os=$();function Ps(e={}){return Os.makeCommandOption({definition(t,n){var r;t.addProxy({name:(r=e.name)!==null&&r!==void 0?r:n,required:e.required})},transformer(t,n,r){return r.positionals.map(({value:o})=>o)}})}Xt.Proxy=Ps});var To=B(_t=>{"use strict";Object.defineProperty(_t,"__esModule",{value:!0});var Ss=ae(),Is=Jt(),ft=class extends Ss.Command{constructor(){super(...arguments),this.args=Is.Proxy()}async execute(){this.context.stdout.write(`${JSON.stringify(this.cli.process(this.args).tokens,null,2)}
|
|
72
72
|
`)}};ft.paths=[["--clipanion=tokens"]];_t.TokensCommand=ft});var No=B($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});var Ts=ae(),ht=class extends Ts.Command{async execute(){var t;this.context.stdout.write(`${(t=this.cli.binaryVersion)!==null&&t!==void 0?t:"<unknown>"}
|
|
73
|
-
`)}};ht.paths=[["-v"],["--version"]];$t.VersionCommand=ht});var Ro=B(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});var Ns=So(),Rs=Io(),Ls=To(),Ms=No();ve.DefinitionsCommand=Ns.DefinitionsCommand;ve.HelpCommand=Rs.HelpCommand;ve.TokensCommand=Ls.TokensCommand;ve.VersionCommand=Ms.VersionCommand});var Lo=B(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});var en=$();function js(e,t,n){let[r,o]=en.rerouteArguments(t,n??{}),{arity:i=1}=o,u=e.split(","),s=new Set(u);return en.makeCommandOption({definition(a){a.addOption({names:u,arity:i,hidden:o?.hidden,description:o?.description,required:o.required})},transformer(a,c,d){let l,D=typeof r<"u"?[...r]:void 0;for(let{name:p,value:h}of d.options)s.has(p)&&(l=p,D=D??[],D.push(h));return typeof D<"u"?en.applyValidator(l??c,D,o.validator):D}})}tn.Array=js});var jo=B(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});var Mo=$();function Hs(e,t,n){let[r,o]=Mo.rerouteArguments(t,n??{}),i=e.split(","),u=new Set(i);return Mo.makeCommandOption({definition(s){s.addOption({names:i,allowBinding:!1,arity:0,hidden:o.hidden,description:o.description,required:o.required})},transformer(s,a,c){let d=r;for(let{name:l,value:D}of c.options)u.has(l)&&(d=D);return d}})}nn.Boolean=Hs});var Go=B(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});var Ho=$();function Gs(e,t,n){let[r,o]=Ho.rerouteArguments(t,n??{}),i=e.split(","),u=new Set(i);return Ho.makeCommandOption({definition(s){s.addOption({names:i,allowBinding:!1,arity:0,hidden:o.hidden,description:o.description,required:o.required})},transformer(s,a,c){let d=r;for(let{name:l,value:D}of c.options)u.has(l)&&(d??(d=0),D?d+=1:d=0);return d}})}on.Counter=Gs});var Uo=B(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});var Us=ct(),zs=$();function Qs(e={}){return zs.makeCommandOption({definition(t,n){var r;t.addRest({name:(r=e.name)!==null&&r!==void 0?r:n,required:e.required})},transformer(t,n,r){let o=u=>{let s=r.positionals[u];return s.extra===Us.NoLimits||s.extra===!1&&u<t.arity.leading.length},i=0;for(;i<r.positionals.length&&o(i);)i+=1;return r.positionals.splice(0,i).map(({value:u})=>u)}})}rn.Rest=Qs});var zo=B(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});var Ys=ct(),He=$();function Ks(e,t,n){let[r,o]=He.rerouteArguments(t,n??{}),{arity:i=1}=o,u=e.split(","),s=new Set(u);return He.makeCommandOption({definition(a){a.addOption({names:u,arity:o.tolerateBoolean?0:i,hidden:o.hidden,description:o.description,required:o.required})},transformer(a,c,d,l){let D,p=r;typeof o.env<"u"&&l.env[o.env]&&(D=o.env,p=l.env[o.env]);for(let{name:h,value:g}of d.options)s.has(h)&&(D=h,p=g);return typeof p=="string"?He.applyValidator(D??c,p,o.validator):p}})}function qs(e={}){let{required:t=!0}=e;return He.makeCommandOption({definition(n,r){var o;n.addPositional({name:(o=e.name)!==null&&o!==void 0?o:r,required:e.required})},transformer(n,r,o){var i;for(let u=0;u<o.positionals.length;++u){if(o.positionals[u].extra===Ys.NoLimits||t&&o.positionals[u].extra===!0||!t&&o.positionals[u].extra===!1)continue;let[s]=o.positionals.splice(u,1);return He.applyValidator((i=e.name)!==null&&i!==void 0?i:r,s.value,e.validator)}}})}function Ws(e,...t){return typeof e=="string"?Ks(e,...t):qs(e)}sn.String=Ws});var Qo=B(M=>{"use strict";Object.defineProperty(M,"__esModule",{value:!0});var Be=$(),Vs=Jt(),Zs=Lo(),Xs=jo(),Js=Go(),_s=Uo(),$s=zo();M.applyValidator=Be.applyValidator;M.cleanValidationError=Be.cleanValidationError;M.formatError=Be.formatError;M.isOptionSymbol=Be.isOptionSymbol;M.makeCommandOption=Be.makeCommandOption;M.rerouteArguments=Be.rerouteArguments;M.Proxy=Vs.Proxy;M.Array=Zs.Array;M.Boolean=Xs.Boolean;M.Counter=Js.Counter;M.Rest=_s.Rest;M.String=$s.String});var an=B(J=>{"use strict";Object.defineProperty(J,"__esModule",{value:!0});var eu=et(),tu=Mt(),nu=ae(),un=ko(),ou=Ro(),ru=Qo();J.UsageError=eu.UsageError;J.formatMarkdownish=tu.formatMarkdownish;J.Command=nu.Command;J.Cli=un.Cli;J.run=un.run;J.runExit=un.runExit;J.Builtins=ou;J.Option=ru});var sr=B((Bc,ir)=>{"use strict";ir.exports=pu;function Du(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 pu(e){let t=Du(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 Dr=B((Tc,dr)=>{dr.exports=()=>/[#*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\uDC70\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-\uDED7\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\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\uDD3D\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-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\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]|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\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 vr=B((Xc,br)=>{var Ou=require("stream"),gn=class extends Ou{#n=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}#t(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.#n!==null?this.#n:this.#t("isTTY",!1)}set isTTY(t){this.#n=t}get rows(){return this.#t("rows")}get columns(){return this.#t("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)}};br.exports=gn});var Xe=Q(an());var W=Q(an()),_r=Q(require("node:path"));var we=require("node:util");var ce=require("node:util"),ee=e=>(0,ce.styleText)(["bgMagenta","white","bold"],e),T=e=>(0,ce.styleText)(["dim"],e),Yo=e=>(0,ce.styleText)(["bold"],e),cn=e=>(0,ce.styleText)(["bold","green"],e),De=e=>(0,ce.styleText)(["bold","red"],e),j=e=>(0,ce.styleText)(["bold","cyan"],e),v=e=>(0,ce.styleText)(["magentaBright","bold"],e);var Ko=`
|
|
73
|
+
`)}};ht.paths=[["-v"],["--version"]];$t.VersionCommand=ht});var Ro=B(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});var Ns=So(),Rs=Io(),Ls=To(),Ms=No();ve.DefinitionsCommand=Ns.DefinitionsCommand;ve.HelpCommand=Rs.HelpCommand;ve.TokensCommand=Ls.TokensCommand;ve.VersionCommand=Ms.VersionCommand});var Lo=B(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});var en=$();function js(e,t,n){let[r,o]=en.rerouteArguments(t,n??{}),{arity:i=1}=o,u=e.split(","),s=new Set(u);return en.makeCommandOption({definition(a){a.addOption({names:u,arity:i,hidden:o?.hidden,description:o?.description,required:o.required})},transformer(a,c,d){let l,D=typeof r<"u"?[...r]:void 0;for(let{name:p,value:h}of d.options)s.has(p)&&(l=p,D=D??[],D.push(h));return typeof D<"u"?en.applyValidator(l??c,D,o.validator):D}})}tn.Array=js});var jo=B(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});var Mo=$();function Hs(e,t,n){let[r,o]=Mo.rerouteArguments(t,n??{}),i=e.split(","),u=new Set(i);return Mo.makeCommandOption({definition(s){s.addOption({names:i,allowBinding:!1,arity:0,hidden:o.hidden,description:o.description,required:o.required})},transformer(s,a,c){let d=r;for(let{name:l,value:D}of c.options)u.has(l)&&(d=D);return d}})}nn.Boolean=Hs});var Go=B(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});var Ho=$();function Gs(e,t,n){let[r,o]=Ho.rerouteArguments(t,n??{}),i=e.split(","),u=new Set(i);return Ho.makeCommandOption({definition(s){s.addOption({names:i,allowBinding:!1,arity:0,hidden:o.hidden,description:o.description,required:o.required})},transformer(s,a,c){let d=r;for(let{name:l,value:D}of c.options)u.has(l)&&(d??(d=0),D?d+=1:d=0);return d}})}on.Counter=Gs});var Uo=B(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});var Us=ct(),zs=$();function Qs(e={}){return zs.makeCommandOption({definition(t,n){var r;t.addRest({name:(r=e.name)!==null&&r!==void 0?r:n,required:e.required})},transformer(t,n,r){let o=u=>{let s=r.positionals[u];return s.extra===Us.NoLimits||s.extra===!1&&u<t.arity.leading.length},i=0;for(;i<r.positionals.length&&o(i);)i+=1;return r.positionals.splice(0,i).map(({value:u})=>u)}})}rn.Rest=Qs});var zo=B(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});var Ys=ct(),He=$();function Ks(e,t,n){let[r,o]=He.rerouteArguments(t,n??{}),{arity:i=1}=o,u=e.split(","),s=new Set(u);return He.makeCommandOption({definition(a){a.addOption({names:u,arity:o.tolerateBoolean?0:i,hidden:o.hidden,description:o.description,required:o.required})},transformer(a,c,d,l){let D,p=r;typeof o.env<"u"&&l.env[o.env]&&(D=o.env,p=l.env[o.env]);for(let{name:h,value:g}of d.options)s.has(h)&&(D=h,p=g);return typeof p=="string"?He.applyValidator(D??c,p,o.validator):p}})}function qs(e={}){let{required:t=!0}=e;return He.makeCommandOption({definition(n,r){var o;n.addPositional({name:(o=e.name)!==null&&o!==void 0?o:r,required:e.required})},transformer(n,r,o){var i;for(let u=0;u<o.positionals.length;++u){if(o.positionals[u].extra===Ys.NoLimits||t&&o.positionals[u].extra===!0||!t&&o.positionals[u].extra===!1)continue;let[s]=o.positionals.splice(u,1);return He.applyValidator((i=e.name)!==null&&i!==void 0?i:r,s.value,e.validator)}}})}function Ws(e,...t){return typeof e=="string"?Ks(e,...t):qs(e)}sn.String=Ws});var Qo=B(M=>{"use strict";Object.defineProperty(M,"__esModule",{value:!0});var Be=$(),Vs=Jt(),Zs=Lo(),Xs=jo(),Js=Go(),_s=Uo(),$s=zo();M.applyValidator=Be.applyValidator;M.cleanValidationError=Be.cleanValidationError;M.formatError=Be.formatError;M.isOptionSymbol=Be.isOptionSymbol;M.makeCommandOption=Be.makeCommandOption;M.rerouteArguments=Be.rerouteArguments;M.Proxy=Vs.Proxy;M.Array=Zs.Array;M.Boolean=Xs.Boolean;M.Counter=Js.Counter;M.Rest=_s.Rest;M.String=$s.String});var an=B(J=>{"use strict";Object.defineProperty(J,"__esModule",{value:!0});var eu=et(),tu=Mt(),nu=ae(),un=Po(),ou=Ro(),ru=Qo();J.UsageError=eu.UsageError;J.formatMarkdownish=tu.formatMarkdownish;J.Command=nu.Command;J.Cli=un.Cli;J.run=un.run;J.runExit=un.runExit;J.Builtins=ou;J.Option=ru});var sr=B((Bc,ir)=>{"use strict";ir.exports=pu;function Du(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 pu(e){let t=Du(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 Dr=B((Tc,dr)=>{dr.exports=()=>/[#*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\uDC70\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-\uDED7\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\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\uDD3D\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-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\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]|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\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 vr=B((Xc,br)=>{var ku=require("stream"),gn=class extends ku{#n=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}#t(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.#n!==null?this.#n:this.#t("isTTY",!1)}set isTTY(t){this.#n=t}get rows(){return this.#t("rows")}get columns(){return this.#t("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)}};br.exports=gn});var Xe=Q(an());var W=Q(an()),_r=Q(require("node:path"));var we=require("node:util");var ce=require("node:util"),ee=e=>(0,ce.styleText)(["bgMagenta","white","bold"],e),T=e=>(0,ce.styleText)(["dim"],e),Yo=e=>(0,ce.styleText)(["bold"],e),cn=e=>(0,ce.styleText)(["bold","green"],e),De=e=>(0,ce.styleText)(["bold","red"],e),j=e=>(0,ce.styleText)(["bold","cyan"],e),v=e=>(0,ce.styleText)(["magentaBright","bold"],e);var Ko=`
|
|
74
74
|
${ee(" ")}
|
|
75
75
|
${ee(" \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 ")}
|
|
76
76
|
${ee(" \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588\u2588 ")}
|
|
@@ -89,31 +89,31 @@ ${ee("
|
|
|
89
89
|
`;function qo(e,t=2,n=1){let o=Math.max(...e.map(s=>(0,we.stripVTControlCharacters)(s).length))+t*2,i=`|${" ".repeat(o+2)}|`,u=[` .\xB7${"\xAF".repeat(o-4)}\xB7. `];for(let s=0;s<n-1;s++)u.push(i);for(let[s,a]of e.entries()){let c=(0,we.stripVTControlCharacters)(a).length,d=o-t-c,l=s===0?"/":s===e.length-1?"\\":"|",D=s===0?"\\":s===e.length-1?"/":"|";u.push(`${l}${" ".repeat(t)}${a}${" ".repeat(d)}${D}`)}for(let s=0;s<n-1;s++)u.push(i);return u.push(` \xB7.${"_".repeat(o-4)}.\xB7 `),u}var Wo=()=>{let e=["",j(" Good Bye!"),"\u{1F44B} until next time!",""],t=qo(e);return Zo(t)},Vo=e=>{let t=[`${j(e.name)} is ready!`,"","Next steps:",` 1. ${cn(`cd ${e.directory}`)}`,` 2. ${cn("npm run dev")}`],n=qo(t);return Zo(n)},Zo=e=>{let t=[` ${v("___")}`,` ${v("___ (DATADOG\\")}`,` ${v("/DATAD) __/O/_/___ \\DAT\\ADOG\\")}`,` ${v("/DATADOGDATADOGDATADOGDATA| \\ATA)")}`,v("(DATADOGD TADOGDATADOGDATAD\\ |TA/"),v("(DATADOGD) )ATADOGDATADOGDAT)"),` ${v("\\DATADOG) )DATADOGDATADOG\xAF\xAF\\")}`,` ${v("\\DATAD/ )OGDA/\xAF\xAF\xAFTADOGDA .|")}`,` ${v(" \xAF\xAF\xAF /DATADO .GDATADOGD\\")}`,` ${v("|DATADOGDATADOGDATADOGDATA\\")}`,` ${v("|DATADOGDATADOGDATADOG\xAF\xAF\xAF\xAFD)")}`,` ${v("\\DATADOGDATADOGDATADO\\__/DA)")}`,` ${v("\\DATADOGDATADOGDATADOGDATA) __.")}`,` ${v("\\DATADOG\\ \\DATADOG/ |A/ ____/TADOG|")}`,` ${v(")DATADOGD\\_ _/ATADOGDATADOGDAT|")}`,` ${v(")DATADO |OGDATADOGDATADOGDATADOG/|D|")}`,` ${v("/DATADOG |DATADOGDATADOGDA/\\TADO/ |A|")}`,` ${v("/DATADOGD |ATADOGDATADOGDA/ \\GD/ |T|")}`,` ${v("/D\\._ \xAF\\ATA |DATAD/\\DOGDAT/ \\/ |A|")}`,` ${v("/DATADOG\\ \\DA |TADO/ \\GD/ |D|")}`,` ${v("(DATADOGDA\\ \\| |TAD/ \\/ |O|")}`,` ${v("(DATADOGDAT\\ \\ |AD/ ___/DATADOG|")}`,` ${v("\\DATADOGDAT) |A| _/DATADOG/\xAF")}`,` ${v("\\DATADOGDA) |T/\xAF")}`,` ${v("\\DATADO/")}`,` ${v("\xAF\xAF\xAF")}`],n=e.length-3,r=12-e.length,o=[],u=36+Math.max(...e.map(s=>(0,we.stripVTControlCharacters)(s).length));for(let[s,a]of t.entries()){let c=s-r;if(c>=0&&c<e.length){let d=e[c]||"",l=u-((0,we.stripVTControlCharacters)(a).length+(0,we.stripVTControlCharacters)(d).length);c===n&&(d=d.replace(/^./,"< "),l-=1);let D=" ".repeat(l);o.push(`${a}${D}${d}`)}else o.push(a)}return`
|
|
90
90
|
${o.join(`
|
|
91
91
|
`)}
|
|
92
|
-
`};var Ge=(e,t=[])=>e.name==="up"||t.includes("vim")&&e.name==="k"||t.includes("emacs")&&e.ctrl&&e.name==="p",At=(e,t=[])=>e.name==="down"||t.includes("vim")&&e.name==="j"||t.includes("emacs")&&e.ctrl&&e.name==="n";var Ue=e=>e.name==="backspace",ze=e=>e.name==="tab",ln=e=>"1234567890".includes(e.name),pe=e=>e.name==="enter"||e.name==="return";var mt=class extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(t){super(),this.cause=t?.cause}},gt=class extends Error{name="CancelPromptError";message="Prompt was canceled"},Qe=class extends Error{name="ExitPromptError"},Ft=class extends Error{name="HookError"},xe=class extends Error{name="ValidationError"};var $o=require("node:async_hooks");var Et=require("node:async_hooks");var Xo=new Et.AsyncLocalStorage;function iu(e){return{rl:e,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function Jo(e,t){let n=iu(e);return Xo.run(n,()=>{function r(o){n.handleChange=()=>{n.index=0,o()},n.handleChange()}return t(r)})}function fe(){let e=Xo.getStore();if(!e)throw new Ft("[Inquirer] Hook functions can only be called from within a prompt");return e}function dn(){return fe().rl}function Dn(e){let t=(...n)=>{let r=fe(),o=!1,i=r.handleChange;r.handleChange=()=>{o=!0};let u=e(...n);return o&&i(),r.handleChange=i,u};return Et.AsyncResource.bind(t)}function Oe(e){let t=fe(),{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 _o(){fe().handleChange()}var he={queue(e){let t=fe(),{index:n}=t;t.hooksEffect.push(()=>{t.hooksCleanup[n]?.();let r=e(dn());if(r!=null&&typeof r!="function")throw new xe("useEffect return value must be a cleanup function or nothing.");t.hooksCleanup[n]=r})},run(){let e=fe();Dn(()=>{e.hooksEffect.forEach(t=>{t()}),e.hooksEffect.length=0})()},clearAll(){let e=fe();e.hooksCleanup.forEach(t=>{t?.()}),e.hooksEffect.length=0,e.hooksCleanup.length=0}};function N(e){return Oe(t=>{let n=$o.AsyncResource.bind(function(i){t.get()!==i&&(t.set(i),_o())});if(t.initialized)return[t.get(),n];let r=typeof e=="function"?e():e;return t.set(r),[r,n]})}function te(e,t){Oe(n=>{let r=n.get();(!Array.isArray(r)||t.some((i,u)=>!Object.is(i,r[u])))&&he.queue(e),n.set(t)})}var K=require("node:util");var q=Q(require("node:process"),1);function su(){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 er={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"},tr={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"},uu={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"},au={...er,...tr},cu={...er,...uu},lu=su(),du=lu?au:cu,Pe=du,uc=Object.entries(tr);var nr={prefix:{idle:(0,K.styleText)("blue","?"),done:(0,K.styleText)("green",Pe.tick)},spinner:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"].map(e=>(0,K.styleText)("yellow",e))},style:{answer:e=>(0,K.styleText)("cyan",e),message:e=>(0,K.styleText)("bold",e),error:e=>(0,K.styleText)("red",`> ${e}`),defaultAnswer:e=>(0,K.styleText)("dim",`(${e})`),help:e=>(0,K.styleText)("dim",e),highlight:e=>(0,K.styleText)("cyan",e),key:e=>(0,K.styleText)("cyan",(0,K.styleText)("bold",`<${e}>`))}};function or(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 rr(...e){let t={};for(let n of e)for(let[r,o]of Object.entries(n)){let i=t[r];t[r]=or(i)&&or(o)?rr(i,o):o}return t}function ne(...e){let t=[nr,...e.filter(n=>n!=null)];return rr(...t)}function Ae({status:e="idle",theme:t}){let[n,r]=N(!1),[o,i]=N(0),{prefix:u,spinner:s}=ne(t);return te(()=>{if(e==="loading"){let c,d=-1,l=setTimeout(()=>{r(!0),c=setInterval(()=>{d=d+1,i(d%s.frames.length)},s.interval)},300);return()=>{clearTimeout(l),clearInterval(c)}}else r(!1)},[e]),n?s.frames[o]:typeof u=="string"?u:u[e==="loading"?"idle":e]??u.idle}function Ye(e,t){return Oe(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 me(e){return N({current:e})[0]}function ge(e){let t=me(e);t.current=e,te(n=>{let r=!1,o=Dn((i,u)=>{r||t.current(u,n)});return n.input.on("keypress",o),()=>{r=!0,n.input.removeListener("keypress",o)}},[])}var yr=Q(sr(),1);function pn({onlyFirst:e=!1}={}){let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}var fu=pn();function Ke(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(fu,"")}function ur(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 ar(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function cr(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===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||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<=128727||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<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}function hu(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function lr(e,{ambiguousAsWide:t=!1}={}){return hu(e),ar(e)||cr(e)||t&&ur(e)?2:1}var pr=Q(Dr(),1),Au=new Intl.Segmenter,mu=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function Fe(e,t={}){if(typeof e!="string"||e.length===0)return 0;let{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:r=!1}=t;if(r||(e=Ke(e)),e.length===0)return 0;let o=0,i={ambiguousAsWide:!n};for(let{segment:u}of Au.segment(e)){let s=u.codePointAt(0);if(!(s<=31||s>=127&&s<=159)&&!(s>=8203&&s<=8207||s===65279)&&!(s>=768&&s<=879||s>=6832&&s<=6911||s>=7616&&s<=7679||s>=8400&&s<=8447||s>=65056&&s<=65071)&&!(s>=55296&&s<=57343)&&!(s>=65024&&s<=65039)&&!mu.test(u)){if((0,pr.default)().test(u)){o+=2;continue}o+=lr(s,i)}}return o}var fr=(e=0)=>t=>`\x1B[${t+e}m`,hr=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,Ar=(e=0)=>(t,n,r)=>`\x1B[${38+e};2;${t};${n};${r}m`,x={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]}},Mc=Object.keys(x.modifier),gu=Object.keys(x.color),Fu=Object.keys(x.bgColor),jc=[...gu,...Fu];function Eu(){let e=new Map;for(let[t,n]of Object.entries(x)){for(let[r,o]of Object.entries(n))x[r]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},n[r]=x[r],e.set(o[0],o[1]);Object.defineProperty(x,t,{value:n,enumerable:!1})}return Object.defineProperty(x,"codes",{value:e,enumerable:!1}),x.color.close="\x1B[39m",x.bgColor.close="\x1B[49m",x.color.ansi=fr(),x.color.ansi256=hr(),x.color.ansi16m=Ar(),x.bgColor.ansi=fr(10),x.bgColor.ansi256=hr(10),x.bgColor.ansi16m=Ar(10),Object.defineProperties(x,{rgbToAnsi256:{value:(t,n,r)=>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=>x.rgbToAnsi256(...x.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 s=t%36;n=Math.floor(t/36)/5,r=Math.floor(s/6)/5,o=s%6/5}let i=Math.max(n,r,o)*2;if(i===0)return 30;let u=30+(Math.round(o)<<2|Math.round(r)<<1|Math.round(n));return i===2&&(u+=60),u},enumerable:!1},rgbToAnsi:{value:(t,n,r)=>x.ansi256ToAnsi(x.rgbToAnsi256(t,n,r)),enumerable:!1},hexToAnsi:{value:t=>x.ansi256ToAnsi(x.hexToAnsi256(t)),enumerable:!1}}),x}var Cu=Eu(),mr=Cu;var yt=new Set(["\x1B","\x9B"]),yu=39,hn="\x07",Er="[",bu="]",Cr="m",Ct=`${bu}8;;`,gr=e=>`${yt.values().next().value}${Er}${e}${Cr}`,Fr=e=>`${yt.values().next().value}${Ct}${e}${hn}`,vu=e=>e.split(" ").map(t=>Fe(t)),fn=(e,t,n)=>{let r=[...t],o=!1,i=!1,u=Fe(Ke(e.at(-1)));for(let[s,a]of r.entries()){let c=Fe(a);if(u+c<=n?e[e.length-1]+=a:(e.push(a),u=0),yt.has(a)&&(o=!0,i=r.slice(s+1,s+1+Ct.length).join("")===Ct),o){i?a===hn&&(o=!1,i=!1):a===Cr&&(o=!1);continue}u+=c,u===n&&s<r.length-1&&(e.push(""),u=0)}!u&&e.at(-1).length>0&&e.length>1&&(e[e.length-2]+=e.pop())},Bu=e=>{let t=e.split(" "),n=t.length;for(;n>0&&!(Fe(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(" ")+t.slice(n).join("")},wu=(e,t,n={})=>{if(n.trim!==!1&&e.trim()==="")return"";let r="",o,i,u=vu(e),s=[""];for(let[l,D]of e.split(" ").entries()){n.trim!==!1&&(s[s.length-1]=s.at(-1).trimStart());let p=Fe(s.at(-1));if(l!==0&&(p>=t&&(n.wordWrap===!1||n.trim===!1)&&(s.push(""),p=0),(p>0||n.trim===!1)&&(s[s.length-1]+=" ",p++)),n.hard&&u[l]>t){let h=t-p,g=1+Math.floor((u[l]-h-1)/t);Math.floor((u[l]-1)/t)<g&&s.push(""),fn(s,D,t);continue}if(p+u[l]>t&&p>0&&u[l]>0){if(n.wordWrap===!1&&p<t){fn(s,D,t);continue}s.push("")}if(p+u[l]>t&&n.wordWrap===!1){fn(s,D,t);continue}s[s.length-1]+=D}n.trim!==!1&&(s=s.map(l=>Bu(l)));let a=s.join(`
|
|
93
|
-
`),c=[...a],d=0;for(let[l,D]of c.entries()){if(r+=D,yt.has(D)){let{groups:h}=new RegExp(`(?:\\${Er}(?<code>\\d+)m|\\${Ct}(?<uri>.*)${hn})`).exec(a.slice(d))||{groups:{}};if(h.code!==void 0){let g=Number.parseFloat(h.code);o=g===yu?void 0:g}else h.uri!==void 0&&(i=h.uri.length===0?void 0:h.uri)}let p=
|
|
92
|
+
`};var Ge=(e,t=[])=>e.name==="up"||t.includes("vim")&&e.name==="k"||t.includes("emacs")&&e.ctrl&&e.name==="p",mt=(e,t=[])=>e.name==="down"||t.includes("vim")&&e.name==="j"||t.includes("emacs")&&e.ctrl&&e.name==="n";var Ue=e=>e.name==="backspace",ze=e=>e.name==="tab",ln=e=>"1234567890".includes(e.name),pe=e=>e.name==="enter"||e.name==="return";var At=class extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(t){super(),this.cause=t?.cause}},gt=class extends Error{name="CancelPromptError";message="Prompt was canceled"},Qe=class extends Error{name="ExitPromptError"},Ft=class extends Error{name="HookError"},xe=class extends Error{name="ValidationError"};var $o=require("node:async_hooks");var Et=require("node:async_hooks");var Xo=new Et.AsyncLocalStorage;function iu(e){return{rl:e,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function Jo(e,t){let n=iu(e);return Xo.run(n,()=>{function r(o){n.handleChange=()=>{n.index=0,o()},n.handleChange()}return t(r)})}function fe(){let e=Xo.getStore();if(!e)throw new Ft("[Inquirer] Hook functions can only be called from within a prompt");return e}function dn(){return fe().rl}function Dn(e){let t=(...n)=>{let r=fe(),o=!1,i=r.handleChange;r.handleChange=()=>{o=!0};let u=e(...n);return o&&i(),r.handleChange=i,u};return Et.AsyncResource.bind(t)}function ke(e){let t=fe(),{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 _o(){fe().handleChange()}var he={queue(e){let t=fe(),{index:n}=t;t.hooksEffect.push(()=>{t.hooksCleanup[n]?.();let r=e(dn());if(r!=null&&typeof r!="function")throw new xe("useEffect return value must be a cleanup function or nothing.");t.hooksCleanup[n]=r})},run(){let e=fe();Dn(()=>{e.hooksEffect.forEach(t=>{t()}),e.hooksEffect.length=0})()},clearAll(){let e=fe();e.hooksCleanup.forEach(t=>{t?.()}),e.hooksEffect.length=0,e.hooksCleanup.length=0}};function N(e){return ke(t=>{let n=$o.AsyncResource.bind(function(i){t.get()!==i&&(t.set(i),_o())});if(t.initialized)return[t.get(),n];let r=typeof e=="function"?e():e;return t.set(r),[r,n]})}function te(e,t){ke(n=>{let r=n.get();(!Array.isArray(r)||t.some((i,u)=>!Object.is(i,r[u])))&&he.queue(e),n.set(t)})}var K=require("node:util");var q=Q(require("node:process"),1);function su(){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 er={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"},tr={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"},uu={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"},au={...er,...tr},cu={...er,...uu},lu=su(),du=lu?au:cu,Oe=du,uc=Object.entries(tr);var nr={prefix:{idle:(0,K.styleText)("blue","?"),done:(0,K.styleText)("green",Oe.tick)},spinner:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"].map(e=>(0,K.styleText)("yellow",e))},style:{answer:e=>(0,K.styleText)("cyan",e),message:e=>(0,K.styleText)("bold",e),error:e=>(0,K.styleText)("red",`> ${e}`),defaultAnswer:e=>(0,K.styleText)("dim",`(${e})`),help:e=>(0,K.styleText)("dim",e),highlight:e=>(0,K.styleText)("cyan",e),key:e=>(0,K.styleText)("cyan",(0,K.styleText)("bold",`<${e}>`))}};function or(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 rr(...e){let t={};for(let n of e)for(let[r,o]of Object.entries(n)){let i=t[r];t[r]=or(i)&&or(o)?rr(i,o):o}return t}function ne(...e){let t=[nr,...e.filter(n=>n!=null)];return rr(...t)}function me({status:e="idle",theme:t}){let[n,r]=N(!1),[o,i]=N(0),{prefix:u,spinner:s}=ne(t);return te(()=>{if(e==="loading"){let c,d=-1,l=setTimeout(()=>{r(!0),c=setInterval(()=>{d=d+1,i(d%s.frames.length)},s.interval)},300);return()=>{clearTimeout(l),clearInterval(c)}}else r(!1)},[e]),n?s.frames[o]:typeof u=="string"?u:u[e==="loading"?"idle":e]??u.idle}function Ye(e,t){return ke(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 Ae(e){return N({current:e})[0]}function ge(e){let t=Ae(e);t.current=e,te(n=>{let r=!1,o=Dn((i,u)=>{r||t.current(u,n)});return n.input.on("keypress",o),()=>{r=!0,n.input.removeListener("keypress",o)}},[])}var yr=Q(sr(),1);function pn({onlyFirst:e=!1}={}){let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}var fu=pn();function Ke(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(fu,"")}function ur(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 ar(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function cr(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===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||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<=128727||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<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}function hu(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function lr(e,{ambiguousAsWide:t=!1}={}){return hu(e),ar(e)||cr(e)||t&&ur(e)?2:1}var pr=Q(Dr(),1),mu=new Intl.Segmenter,Au=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function Fe(e,t={}){if(typeof e!="string"||e.length===0)return 0;let{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:r=!1}=t;if(r||(e=Ke(e)),e.length===0)return 0;let o=0,i={ambiguousAsWide:!n};for(let{segment:u}of mu.segment(e)){let s=u.codePointAt(0);if(!(s<=31||s>=127&&s<=159)&&!(s>=8203&&s<=8207||s===65279)&&!(s>=768&&s<=879||s>=6832&&s<=6911||s>=7616&&s<=7679||s>=8400&&s<=8447||s>=65056&&s<=65071)&&!(s>=55296&&s<=57343)&&!(s>=65024&&s<=65039)&&!Au.test(u)){if((0,pr.default)().test(u)){o+=2;continue}o+=lr(s,i)}}return o}var fr=(e=0)=>t=>`\x1B[${t+e}m`,hr=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,mr=(e=0)=>(t,n,r)=>`\x1B[${38+e};2;${t};${n};${r}m`,x={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]}},Mc=Object.keys(x.modifier),gu=Object.keys(x.color),Fu=Object.keys(x.bgColor),jc=[...gu,...Fu];function Eu(){let e=new Map;for(let[t,n]of Object.entries(x)){for(let[r,o]of Object.entries(n))x[r]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},n[r]=x[r],e.set(o[0],o[1]);Object.defineProperty(x,t,{value:n,enumerable:!1})}return Object.defineProperty(x,"codes",{value:e,enumerable:!1}),x.color.close="\x1B[39m",x.bgColor.close="\x1B[49m",x.color.ansi=fr(),x.color.ansi256=hr(),x.color.ansi16m=mr(),x.bgColor.ansi=fr(10),x.bgColor.ansi256=hr(10),x.bgColor.ansi16m=mr(10),Object.defineProperties(x,{rgbToAnsi256:{value:(t,n,r)=>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=>x.rgbToAnsi256(...x.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 s=t%36;n=Math.floor(t/36)/5,r=Math.floor(s/6)/5,o=s%6/5}let i=Math.max(n,r,o)*2;if(i===0)return 30;let u=30+(Math.round(o)<<2|Math.round(r)<<1|Math.round(n));return i===2&&(u+=60),u},enumerable:!1},rgbToAnsi:{value:(t,n,r)=>x.ansi256ToAnsi(x.rgbToAnsi256(t,n,r)),enumerable:!1},hexToAnsi:{value:t=>x.ansi256ToAnsi(x.hexToAnsi256(t)),enumerable:!1}}),x}var Cu=Eu(),Ar=Cu;var yt=new Set(["\x1B","\x9B"]),yu=39,hn="\x07",Er="[",bu="]",Cr="m",Ct=`${bu}8;;`,gr=e=>`${yt.values().next().value}${Er}${e}${Cr}`,Fr=e=>`${yt.values().next().value}${Ct}${e}${hn}`,vu=e=>e.split(" ").map(t=>Fe(t)),fn=(e,t,n)=>{let r=[...t],o=!1,i=!1,u=Fe(Ke(e.at(-1)));for(let[s,a]of r.entries()){let c=Fe(a);if(u+c<=n?e[e.length-1]+=a:(e.push(a),u=0),yt.has(a)&&(o=!0,i=r.slice(s+1,s+1+Ct.length).join("")===Ct),o){i?a===hn&&(o=!1,i=!1):a===Cr&&(o=!1);continue}u+=c,u===n&&s<r.length-1&&(e.push(""),u=0)}!u&&e.at(-1).length>0&&e.length>1&&(e[e.length-2]+=e.pop())},Bu=e=>{let t=e.split(" "),n=t.length;for(;n>0&&!(Fe(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(" ")+t.slice(n).join("")},wu=(e,t,n={})=>{if(n.trim!==!1&&e.trim()==="")return"";let r="",o,i,u=vu(e),s=[""];for(let[l,D]of e.split(" ").entries()){n.trim!==!1&&(s[s.length-1]=s.at(-1).trimStart());let p=Fe(s.at(-1));if(l!==0&&(p>=t&&(n.wordWrap===!1||n.trim===!1)&&(s.push(""),p=0),(p>0||n.trim===!1)&&(s[s.length-1]+=" ",p++)),n.hard&&u[l]>t){let h=t-p,g=1+Math.floor((u[l]-h-1)/t);Math.floor((u[l]-1)/t)<g&&s.push(""),fn(s,D,t);continue}if(p+u[l]>t&&p>0&&u[l]>0){if(n.wordWrap===!1&&p<t){fn(s,D,t);continue}s.push("")}if(p+u[l]>t&&n.wordWrap===!1){fn(s,D,t);continue}s[s.length-1]+=D}n.trim!==!1&&(s=s.map(l=>Bu(l)));let a=s.join(`
|
|
93
|
+
`),c=[...a],d=0;for(let[l,D]of c.entries()){if(r+=D,yt.has(D)){let{groups:h}=new RegExp(`(?:\\${Er}(?<code>\\d+)m|\\${Ct}(?<uri>.*)${hn})`).exec(a.slice(d))||{groups:{}};if(h.code!==void 0){let g=Number.parseFloat(h.code);o=g===yu?void 0:g}else h.uri!==void 0&&(i=h.uri.length===0?void 0:h.uri)}let p=Ar.codes.get(Number(o));c[l+1]===`
|
|
94
94
|
`?(i&&(r+=Fr("")),o&&p&&(r+=gr(p))):D===`
|
|
95
|
-
`&&(o&&p&&(r+=gr(o)),i&&(r+=Fr(i))),d+=D.length}return r};function
|
|
95
|
+
`&&(o&&p&&(r+=gr(o)),i&&(r+=Fr(i))),d+=D.length}return r};function mn(e,t,n){return String(e).normalize().replaceAll(`\r
|
|
96
96
|
`,`
|
|
97
97
|
`).split(`
|
|
98
98
|
`).map(r=>wu(r,t,n)).join(`
|
|
99
99
|
`)}function qe(e,t){return e.split(`
|
|
100
|
-
`).flatMap(n=>
|
|
100
|
+
`).flatMap(n=>mn(n,t,{trim:!1,hard:!0}).split(`
|
|
101
101
|
`).map(r=>r.trimEnd())).join(`
|
|
102
|
-
`)}function bt(){return(0,yr.default)({defaultWidth:80,output:dn().output})}function xu({active:e,renderedItems:t,pageSize:n,loop:r}){let o=
|
|
102
|
+
`)}function bt(){return(0,yr.default)({defaultWidth:80,output:dn().output})}function xu({active:e,renderedItems:t,pageSize:n,loop:r}){let o=Ae({lastPointer:e,lastActive:void 0}),{lastPointer:i,lastActive:u}=o.current,s=Math.floor(n/2),a=t.reduce((l,D)=>l+D.length,0),c=t.slice(0,e).reduce((l,D)=>l+D.length,0),d=c;if(a>n)if(r)d=i,u!=null&&u<e&&e-u<n&&(d=Math.min(s,Math.abs(e-u)===1?Math.min(i+(t[u]?.length??0),Math.max(c,i)):i+e-u));else{let l=t.slice(e).reduce((D,p)=>D+p.length,0);d=l<n-s?n-l:Math.min(c,s)}return o.current.lastPointer=d,o.current.lastActive=e,d}function An({items:e,active:t,renderItem:n,pageSize:r,loop:o=!0}){let i=bt(),u=C=>(C%e.length+e.length)%e.length,s=e.map((C,y)=>C==null?[]:qe(n({item:C,index:y,isActive:y===t}),i).split(`
|
|
103
103
|
`)),a=s.reduce((C,y)=>C+y.length,0),c=C=>s[C]??[],d=xu({active:t,renderedItems:s,pageSize:r,loop:o}),l=c(t).slice(0,r),D=d+l.length<=r?d:r-l.length,p=Array.from({length:r});p.splice(D,l.length,...l);let h=new Set([t]),g=D+l.length,F=u(t+1);for(;g<r&&!h.has(F)&&(o&&a>r?F!==t:F>t);){let y=c(F).slice(0,r-g);p.splice(g,y.length,...y),h.add(F),g+=y.length,F=u(F+1)}for(g=D-1,F=u(t-1);g>=0&&!h.has(F)&&(o&&a>r?F!==t:F<t);){let C=c(F),y=C.slice(Math.max(0,C.length-g-1));p.splice(g-y.length+1,y.length,...y),h.add(F),g-=y.length,F=u(F-1)}return p.filter(C=>typeof C=="string").join(`
|
|
104
|
-
`)}var Sr=Q(require("node:readline"),1),Ir=require("node:async_hooks"),Tr=Q(vr(),1);var Ee=[];Ee.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&Ee.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Ee.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var vt=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",Fn=Symbol.for("signal-exit emitter"),En=globalThis,
|
|
104
|
+
`)}var Sr=Q(require("node:readline"),1),Ir=require("node:async_hooks"),Tr=Q(vr(),1);var Ee=[];Ee.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&Ee.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Ee.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var vt=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",Fn=Symbol.for("signal-exit emitter"),En=globalThis,Ou=Object.defineProperty.bind(Object),Cn=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(En[Fn])return En[Fn];Ou(En,Fn,{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}},Bt=class{},Pu=e=>({onExit(t,n){return e.onExit(t,n)},load(){return e.load()},unload(){return e.unload()}}),yn=class extends Bt{onExit(){return()=>{}}load(){}unload(){}},bn=class extends Bt{#n=vn.platform==="win32"?"SIGINT":"SIGHUP";#t=new Cn;#e;#i;#s;#r={};#o=!1;constructor(t){super(),this.#e=t,this.#r={};for(let n of Ee)this.#r[n]=()=>{let r=this.#e.listeners(n),{count:o}=this.#t,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 u=this.#t.emit("exit",null,n),s=n==="SIGHUP"?this.#n:n;u||t.kill(t.pid,s)}};this.#s=t.reallyExit,this.#i=t.emit}onExit(t,n){if(!vt(this.#e))return()=>{};this.#o===!1&&this.load();let r=n?.alwaysLast?"afterExit":"exit";return this.#t.on(r,t),()=>{this.#t.removeListener(r,t),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#o){this.#o=!0,this.#t.count+=1;for(let t of Ee)try{let n=this.#r[t];n&&this.#e.on(t,n)}catch{}this.#e.emit=(t,...n)=>this.#a(t,...n),this.#e.reallyExit=t=>this.#u(t)}}unload(){this.#o&&(this.#o=!1,Ee.forEach(t=>{let n=this.#r[t];if(!n)throw new Error("Listener not defined for signal: "+t);try{this.#e.removeListener(t,n)}catch{}}),this.#e.emit=this.#i,this.#e.reallyExit=this.#s,this.#t.count-=1)}#u(t){return vt(this.#e)?(this.#e.exitCode=t||0,this.#t.emit("exit",this.#e.exitCode,null),this.#s.call(this.#e,this.#e.exitCode)):0}#a(t,...n){let r=this.#i;if(t==="exit"&&vt(this.#e)){typeof n[0]=="number"&&(this.#e.exitCode=n[0]);let o=r.call(this.#e,t,...n);return this.#t.emit("exit",this.#e.exitCode,null),o}else return r.call(this.#e,t,...n)}},vn=globalThis.process,{onExit:Br,load:$c,unload:el}=Pu(vt(vn)?new bn(vn):new yn);var Pr=require("node:util");var xr="\x1B[?25l",kr="\x1B[?25h",Bn=(e=1)=>e>0?`\x1B[${e}A`:"",wn=(e=1)=>e>0?`\x1B[${e}B`:"",xn=(e,t)=>typeof t=="number"&&!Number.isNaN(t)?`\x1B[${t+1};${e+1}H`:`\x1B[${e+1}G`,wr="\x1B[2K",kn=e=>e>0?(wr+Bn(1)).repeat(e-1)+wr+"\x1B[G":"";var Or=e=>e.split(`
|
|
105
105
|
`).length,Su=e=>e.split(`
|
|
106
|
-
`).pop()??"",We=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=Su(t),o=(0,
|
|
106
|
+
`).pop()??"",We=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=Su(t),o=(0,Pr.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 u=bt();t=qe(t,u),n=qe(n,u),o.length%u===0&&(t+=`
|
|
107
107
|
`);let s=t+(n?`
|
|
108
|
-
`+n:""),c=Math.floor(o.length/u)-this.cursorPos.rows+(n?
|
|
109
|
-
`,n+=
|
|
110
|
-
at ${Je}`)}let[V,_]=typeof
|
|
108
|
+
`+n:""),c=Math.floor(o.length/u)-this.cursorPos.rows+(n?Or(n):0);c>0&&(s+=Bn(c)),s+=xn(this.cursorPos.cols),this.write(wn(this.extraLinesUnderPrompt)+kn(this.height)+s),this.extraLinesUnderPrompt=c,this.height=Or(s)}checkCursorPos(){let t=this.rl.getCursorPos();t.cols!==this.cursorPos.cols&&(this.write(xn(t.cols)),this.cursorPos=t)}done({clearContent:t}){this.rl.setPrompt("");let n=wn(this.extraLinesUnderPrompt);n+=t?kn(this.height):`
|
|
109
|
+
`,n+=kr,this.write(n),this.rl.close()}};var wt=class extends Promise{static withResolver(){let t,n;return{promise:new Promise((o,i)=>{t=o,n=i}),resolve:t,reject:n}}};function Iu(){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 Ce(e){let t=Iu();return(r,o={})=>{let{input:i=process.stdin,signal:u}=o,s=new Set,a=new Tr.default;a.pipe(o.output??process.stdout);let c=Sr.createInterface({terminal:!0,input:i,output:a}),d=new We(c),{promise:l,resolve:D,reject:p}=wt.withResolver(),h=()=>p(new gt);if(u){let C=()=>p(new At({cause:u.reason}));if(u.aborted)return C(),Object.assign(l,{cancel:h});u.addEventListener("abort",C),s.add(()=>u.removeEventListener("abort",C))}s.add(Br((C,y)=>{p(new Qe(`User force closed the prompt with ${C} ${y}`))}));let g=()=>p(new Qe("User force closed the prompt with SIGINT"));c.on("SIGINT",g),s.add(()=>c.removeListener("SIGINT",g));let F=()=>d.checkCursorPos();return c.input.on("keypress",F),s.add(()=>c.input.removeListener("keypress",F)),Jo(c,C=>{let y=Ir.AsyncResource.bind(()=>he.clearAll());return c.on("close",y),s.add(()=>c.removeListener("close",y)),C(()=>{try{let k=e(r,Je=>{setImmediate(()=>D(Je))});if(k===void 0){let Je=t[1]?.getFileName();throw new Error(`Prompt functions must return a string.
|
|
110
|
+
at ${Je}`)}let[V,_]=typeof k=="string"?[k]:k;d.render(V,_),he.run()}catch(k){p(k)}}),Object.assign(l.then(k=>(he.clearAll(),k),k=>{throw he.clearAll(),k}).finally(()=>{s.forEach(k=>k()),d.done({clearContent:!!o.clearPromptOnDone}),a.end()}).then(()=>l),{cancel:h})})}}var Nr=require("node:util");var oe=class{separator=(0,Nr.styleText)("dim",Array.from({length:15}).join(Oe.line));type="separator";constructor(t){t&&(this.separator=t)}static isSeparator(t){return!!(t&&typeof t=="object"&&"type"in t&&t.type==="separator")}};function Rr(e,t){let n=t!==!1;return/^(y|yes)/i.test(e)?n=!0:/^(n|no)/i.test(e)&&(n=!1),n}function Lr(e){return e?"Yes":"No"}var Ve=Ce((e,t)=>{let{transformer:n=Lr}=e,[r,o]=N("idle"),[i,u]=N(""),s=ne(e.theme),a=me({status:r,theme:s});ge((D,p)=>{if(r==="idle")if(pe(D)){let h=Rr(i,e.default);u(n(h)),o("done"),t(h)}else if(ze(D)){let h=Lr(!Rr(i,e.default));p.clearLine(0),p.write(h),u(h)}else u(p.line)});let c=i,d="";r==="done"?c=s.style.answer(i):d=` ${s.style.defaultAnswer(e.default===!1?"y/N":"Y/n")}`;let l=s.style.message(e.message,r);return`${a} ${l}${d} ${c}`});var Tu={validationFailureMode:"keep"},On=Ce((e,t)=>{let{prefill:n="tab"}=e,r=ne(Tu,e.theme),[o,i]=N("idle"),[u="",s]=N(e.default),[a,c]=N(),[d,l]=N(""),D=me({status:o,theme:r});async function p(y){let{required:k,pattern:V,patternError:_="Invalid input"}=e;return k&&!y?"You must provide a value":V&&!V.test(y)?_:typeof e.validate=="function"?await e.validate(y)||"You must provide a valid value":!0}ge(async(y,k)=>{if(o==="idle")if(pe(y)){let V=d||u;i("loading");let _=await p(V);_===!0?(l(V),i("done"),t(V)):(r.validationFailureMode==="clear"?l(""):k.write(d),c(_),i("idle"))}else Ue(y)&&!d?s(void 0):ze(y)&&!d?(s(void 0),k.clearLine(0),k.write(u),l(u)):(l(k.line),c(void 0))}),te(y=>{n==="editable"&&u&&(y.write(u),l(u))},[]);let h=r.style.message(e.message,o),g=d;typeof e.transformer=="function"?g=e.transformer(d,{isFinal:o==="done"}):o==="done"&&(g=r.style.answer(d));let F;u&&o!=="done"&&!d&&(F=r.style.defaultAnswer(u));let C="";return a&&(C=r.style.error(a)),[[D,h,F,g].filter(y=>y!==void 0).join(" "),C]});var Se=require("node:util");var Nu={icon:{cursor:Oe.pointer},style:{disabled:e=>(0,Se.styleText)("dim",`- ${e}`),description:e=>(0,Se.styleText)("cyan",e),keysHelpTip:e=>e.map(([t,n])=>`${(0,Se.styleText)("bold",t)} ${(0,Se.styleText)("dim",n)}`).join((0,Se.styleText)("dim"," \u2022 "))},indexMode:"hidden",keybindings:[]};function Pe(e){return!oe.isSeparator(e)&&!e.disabled}function Ru(e){return e.map(t=>{if(oe.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 Pn=Ce((e,t)=>{let{loop:n=!0,pageSize:r=7}=e,o=ne(Nu,e.theme),{keybindings:i}=o,[u,s]=N("idle"),a=me({status:u,theme:o}),c=Ae(),d=!i.includes("vim"),l=Ye(()=>Ru(e.choices),[e.choices]),D=Ye(()=>{let O=l.findIndex(Pe),z=l.findLastIndex(Pe);if(O===-1)throw new xe("[select prompt] No selectable choices. All choices are disabled.");return{first:O,last:z}},[l]),p=Ye(()=>"default"in e?l.findIndex(O=>Pe(O)&&O.value===e.default):-1,[e.default,l]),[h,g]=N(p===-1?D.first:p),F=l[h];ge((O,z)=>{if(clearTimeout(c.current),pe(O))s("done"),t(F.value);else if(Ge(O,i)||mt(O,i)){if(z.clearLine(0),n||Ge(O,i)&&h!==D.first||mt(O,i)&&h!==D.last){let le=Ge(O,i)?-1:1,H=h;do H=(H+le+l.length)%l.length;while(!Pe(l[H]));g(H)}}else if(ln(O)&&!Number.isNaN(Number(z.line))){let le=Number(z.line)-1,H=-1,re=l.findIndex(Ie=>oe.isSeparator(Ie)?!1:(H++,H===le)),_e=l[re];_e!=null&&Pe(_e)&&g(re),c.current=setTimeout(()=>{z.clearLine(0)},700)}else if(Ue(O))z.clearLine(0);else if(d){let le=z.line.toLowerCase(),H=l.findIndex(re=>oe.isSeparator(re)||!Pe(re)?!1:re.name.toLowerCase().startsWith(le));H!==-1&&g(H),c.current=setTimeout(()=>{z.clearLine(0)},700)}}),te(()=>()=>{clearTimeout(c.current)},[]);let C=o.style.message(e.message,u),y=o.style.keysHelpTip([["\u2191\u2193","navigate"],["\u23CE","select"]]),k=0,V=An({items:l,active:h,renderItem({item:O,isActive:z,index:le}){if(oe.isSeparator(O))return k++,` ${O.separator}`;let H=o.indexMode==="number"?`${le+1-k}. `:"";if(O.disabled){let Ie=typeof O.disabled=="string"?O.disabled:"(disabled)";return o.style.disabled(`${H}${O.name} ${Ie}`)}let re=z?o.style.highlight:Ie=>Ie,_e=z?o.icon.cursor:" ";return re(`${_e} ${H}${O.name}`)},pageSize:r,loop:n});if(u==="done")return[a,C,o.style.answer(F.short)].filter(Boolean).join(" ");let{description:_}=F;return`${[[a,C].filter(Boolean).join(" "),V," ",_?o.style.description(_):"",y].filter(Boolean).join(`
|
|
111
111
|
`).trimEnd()}${xr}`});var Hr=require("node:child_process");var Mr=require("node:child_process");function jr(e){try{return(0,Mr.execSync)("git rev-parse --is-inside-work-tree",{cwd:e,stdio:["ignore","pipe","ignore"],encoding:"utf-8"}).trim()==="true"}catch{return!1}}function Lu(e,t){let n=e.postScaffoldCommands;if(!n)return{commands:[],gitInitSkipped:!1};let r=n.setup??[],o=n.gitInit??[],i=o.length>0&&jr(t);return{commands:i?[...r]:[...r,...o],gitInitSkipped:i}}async function Gr(e,t,n=!1,r=!1){let{commands:o,gitInitSkipped:i}=Lu(t,e);if(o.length===0){i&&(console.log(),console.log(T(`Existing git repo detected at ${e} \u2014 skipping git setup commands.`)));return}if(console.log(),i&&console.log(T(`Existing git repo detected at ${e} \u2014 skipping git setup commands.`)),console.log("The following commands will be executed:"),o.forEach(d=>{console.log(` ${T("$")} ${d}`)}),console.log(),!(!n&&(r||await Ve({message:"Continue?",default:!0})))){console.log(T(`
|
|
112
112
|
Skipped post-scaffold commands. You can run them manually later.`));return}console.log(),console.log("Running post-scaffold commands..."),console.log();let s=0,a;for(let d of o)try{console.log(` ${T("$")} ${d}`),(0,Hr.execSync)(d,{cwd:e,stdio:"inherit"}),s++}catch(l){a=l instanceof Error?l.message:String(l);break}if(!a)return;let c=o[s];console.error(De(`
|
|
113
113
|
Failed to execute command: ${c}
|
|
114
114
|
${a}
|
|
115
115
|
`)),console.error(De(`\u26A0\uFE0F Aborting post-scaffold commands.
|
|
116
|
-
`)),console.log("Command execution status:"),o.forEach((d,l)=>{l<s?console.log(` \u2713 ${T(d)}`):console.log(l===s?` \u2717 ${De(d)}`:` - ${T(d)} ${T("(skipped)")}`)}),console.log(),console.log("You can run the remaining commands manually from your project directory:"),console.log(` ${T("cd")} ${e}`),o.slice(s).forEach(d=>{console.log(` ${T("$")} ${d}`)}),console.log()}var xt=Q(require("node:fs")),
|
|
116
|
+
`)),console.log("Command execution status:"),o.forEach((d,l)=>{l<s?console.log(` \u2713 ${T(d)}`):console.log(l===s?` \u2717 ${De(d)}`:` - ${T(d)} ${T("(skipped)")}`)}),console.log(),console.log("You can run the remaining commands manually from your project directory:"),console.log(` ${T("cd")} ${e}`),o.slice(s).forEach(d=>{console.log(` ${T("$")} ${d}`)}),console.log()}var xt=Q(require("node:fs")),kt=Q(require("node:path"));function Ur(e){return e?/^[a-z0-9][a-z0-9-]*$/.test(e)?!0:"Directory name must start with a lowercase letter or number and contain only lowercase letters, numbers, and hyphens.":"The directory name cannot be empty."}async function Mu(e,t){if(!xt.default.existsSync(e))return;if(t){console.log(T("Deleting directory.")),xt.default.rmSync(e,{force:!0,recursive:!0});return}if(console.log(),await Ve({message:`Directory ${j(e)} already exists. Overwrite?`,default:!1}))console.log(T("Deleting directory.")),xt.default.rmSync(e,{force:!0,recursive:!0});else throw console.log(T("Cancelled.")),new Error("Operation cancelled by user")}async function zr(e,t){let n;if(e){let i=kt.default.basename(e),u=Ur(i);if(u!==!0)throw new Error(u);n=e}else n=await On({message:"Enter the directory name for your app:",validate:i=>Ur(i)});let r=kt.default.basename(n),o=kt.default.resolve(process.cwd(),n);return await Mu(o,t),{name:r,directory:n}}var Zn=Q(require("node:fs/promises")),Xn=Q(require("node:path"));var Sn={};S(Sn,{contents:()=>Hu,filepath:()=>ju});var ju="./src/App.tsx",Hu=e=>`function App() {
|
|
117
117
|
return (
|
|
118
118
|
<div style={{ padding: '2rem', textAlign: 'center' }}>
|
|
119
119
|
<h1>Welcome to ${e.name}</h1>
|
|
@@ -140,6 +140,10 @@ Backend functions are Datadog-managed server-side functions. They do not ship to
|
|
|
140
140
|
- Deployed apps call backend functions through the embedded Datadog runtime bridge.
|
|
141
141
|
- Backend functions do not run in the user's local Node.js process.
|
|
142
142
|
|
|
143
|
+
## Backend helper library
|
|
144
|
+
|
|
145
|
+
Datadog provides \`@datadog/apps-backend\`, a library of tools to make backend function development easier. Check it out when working on backend functions.
|
|
146
|
+
|
|
143
147
|
## Security rules
|
|
144
148
|
|
|
145
149
|
- Keep privileged Datadog API calls, third-party calls, and secret-dependent work in backend functions.
|
|
@@ -335,6 +339,7 @@ For backend implementation details, read \`backend-functions.md\`.
|
|
|
335
339
|
|
|
336
340
|
- \`@datadog/vite-plugin\`: Vite integration for local development, build, and deploy.
|
|
337
341
|
- \`@datadog/action-catalog\`: typed Action Catalog client for backend functions.
|
|
342
|
+
- \`@datadog/apps-backend\`: Datadog-provided helpers for backend function development.
|
|
338
343
|
|
|
339
344
|
Preserve the existing package manager and lockfile style.
|
|
340
345
|
|
|
@@ -345,19 +350,21 @@ Check release notes before changing versions:
|
|
|
345
350
|
\`\`\`bash
|
|
346
351
|
npm view @datadog/vite-plugin version repository.url homepage
|
|
347
352
|
npm view @datadog/action-catalog version repository.url homepage
|
|
353
|
+
npm view @datadog/apps-backend version repository.url homepage
|
|
348
354
|
\`\`\`
|
|
349
355
|
|
|
350
356
|
Inspect the current app:
|
|
351
357
|
|
|
352
358
|
\`\`\`bash
|
|
353
|
-
npm outdated @datadog/vite-plugin @datadog/action-catalog
|
|
354
|
-
npm ls @datadog/vite-plugin @datadog/action-catalog
|
|
359
|
+
npm outdated @datadog/vite-plugin @datadog/action-catalog @datadog/apps-backend
|
|
360
|
+
npm ls @datadog/vite-plugin @datadog/action-catalog @datadog/apps-backend
|
|
355
361
|
\`\`\`
|
|
356
362
|
|
|
357
363
|
## Upgrade
|
|
358
364
|
|
|
359
365
|
\`\`\`bash
|
|
360
366
|
npm install @datadog/action-catalog@latest
|
|
367
|
+
npm install @datadog/apps-backend@latest
|
|
361
368
|
npm install -D @datadog/vite-plugin@latest
|
|
362
369
|
\`\`\`
|
|
363
370
|
|
|
@@ -651,7 +658,7 @@ if (appRoot) {
|
|
|
651
658
|
} else {
|
|
652
659
|
console.error('Missing #app div for createRoot.');
|
|
653
660
|
}
|
|
654
|
-
`;var qn={};S(qn,{contents:()=>ha,filepath:()=>fa});var fa="./package.json",ha=e=>{let t={name:e.name,version:"0.0.1",private:!0,engines:{node:"^20.19.0 || >=22.12.0"},scripts:{dev:"vite",build:"vite build",upload:"DD_APPS_UPLOAD_ASSETS=1 vite build",lint:"eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0","lint:fix":"eslint . --ext ts,tsx --fix",preview:"vite preview",typecheck:"tsc --noEmit"},dependencies:{"@datadog/action-catalog":"^0.0.3","@tanstack/react-query":"^5.101.2",react:"^19.2.3","react-dom":"^19.2.3"},optionalDependencies:{"@napi-rs/keyring":"^1.3.0"},devDependencies:{"@datadog/vite-plugin":"^3.2.1","@types/node":"^24.12.2","@types/react":"^19.2.9","@types/react-dom":"^19.2.3","@typescript-eslint/eslint-plugin":"^8.54.0","@typescript-eslint/parser":"^8.54.0","@vitejs/plugin-react":"^5.1.2",eslint:"^9.39.2","eslint-plugin-react-hooks":"^7.0.1","eslint-plugin-react-refresh":"^0.4.26",typescript:"^5.9.3",vite:"^7.3.1"}};return JSON.stringify(t,null,2)};var Wn={};S(Wn,{contents:()=>
|
|
661
|
+
`;var qn={};S(qn,{contents:()=>ha,filepath:()=>fa});var fa="./package.json",ha=e=>{let t={name:e.name,version:"0.0.1",private:!0,engines:{node:"^20.19.0 || >=22.12.0"},scripts:{dev:"vite",build:"vite build",upload:"DD_APPS_UPLOAD_ASSETS=1 vite build",lint:"eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0","lint:fix":"eslint . --ext ts,tsx --fix",preview:"vite preview",typecheck:"tsc --noEmit"},dependencies:{"@datadog/action-catalog":"^0.0.3","@datadog/apps-backend":"^0.0.1","@tanstack/react-query":"^5.101.2",react:"^19.2.3","react-dom":"^19.2.3"},optionalDependencies:{"@napi-rs/keyring":"^1.3.0"},devDependencies:{"@datadog/vite-plugin":"^3.2.1","@types/node":"^24.12.2","@types/react":"^19.2.9","@types/react-dom":"^19.2.3","@typescript-eslint/eslint-plugin":"^8.54.0","@typescript-eslint/parser":"^8.54.0","@vitejs/plugin-react":"^5.1.2",eslint:"^9.39.2","eslint-plugin-react-hooks":"^7.0.1","eslint-plugin-react-refresh":"^0.4.26",typescript:"^5.9.3",vite:"^7.3.1"}};return JSON.stringify(t,null,2)};var Wn={};S(Wn,{contents:()=>Aa,filepath:()=>ma});var ma="./tsconfig.json",Aa=e=>JSON.stringify({compilerOptions:{target:"ES2020",useDefineForClassFields:!0,lib:["ES2020","DOM","DOM.Iterable"],module:"ESNext",skipLibCheck:!0,moduleResolution:"bundler",allowImportingTsExtensions:!0,resolveJsonModule:!0,isolatedModules:!0,noEmit:!0,jsx:"react-jsx",strict:!0,noUnusedLocals:!0,noUnusedParameters:!0,noFallthroughCasesInSwitch:!0},include:["src"]},null,2);var Vn={};S(Vn,{contents:()=>Fa,filepath:()=>ga});var Qr=require("node:crypto"),ga="./vite.config.ts",Fa=e=>{let t=(0,Qr.createHash)("md5").update(`${Math.random().toString()}:${e.name}`).digest("hex"),n="";return(e.rumConfig?.applicationId||e.rumConfig?.clientToken)&&(n=`
|
|
655
662
|
rum: {
|
|
656
663
|
enable: true,
|
|
657
664
|
sdk: {
|
|
@@ -710,5 +717,5 @@ export default defineConfig({
|
|
|
710
717
|
});
|
|
711
718
|
`};var Yr={name:"Vite & React",description:"A basic React application bundled with Vite.",requiresRumConfig:!0,postScaffoldCommands:{setup:["npm install"],gitInit:["git init","git add .",'git commit -m "Initial commit"']}};var Kr={metadata:Yr,files:[Sn,Hn,Ln,In,Tn,Nn,Rn,jn,Mn,Gn,Un,Qn,zn,Yn,Kn,qn,Wn,Vn]};var Ze={"vite-react":Kr};function Ca(e,t){let n=[];return typeof e!="object"||e===null?(n.push(`[${t}] metadata.json must be a valid JSON object`),n):(!("name"in e)||typeof e.name!="string"?n.push(`[${t}] metadata.json is missing required "name" field (string)`):e.name.trim()===""&&n.push(`[${t}] metadata.json "name" field cannot be empty`),!("description"in e)||typeof e.description!="string"?n.push(`[${t}] metadata.json is missing required "description" field (string)`):e.description.trim()===""&&n.push(`[${t}] metadata.json "description" field cannot be empty`),n)}function ya(e,t){let n=[];return typeof e!="object"||e===null?(n.push(`[${t}] must export an object`),n):("filepath"in e?typeof e.filepath!="string"&&n.push(`[${t}] "filepath" must be a string, got ${typeof e.filepath}`):n.push(`[${t}] missing required export "filepath"`),"contents"in e?typeof e.contents!="function"&&n.push(`[${t}] "contents" must be a function, got ${typeof e.contents}`):n.push(`[${t}] missing required export "contents"`),n)}var qr=["npm","yarn","git"],Wr=["|",">","<","$(","`","&&","||",";"];function ba(e){let t=e.trim(),r=t.split(/\s+/)[0];if(!r||!qr.includes(r))return!1;for(let o of Wr)if(t.includes(o))return!1;return!0}function va(e,t){let n=[];if(!e.postScaffoldCommands)return n;let r=[...e.postScaffoldCommands.setup??[],...e.postScaffoldCommands.gitInit??[]];for(let o of r)if(!ba(o)){let i=qr.join(", "),u=Wr.join(", ");n.push(`[${t}] Unsafe post-scaffold command: "${o}".
|
|
712
719
|
Only ${i} commands without dangerous patterns (${u}) are allowed.`)}return n}function Vr(){let e=[];for(let[t,n]of Object.entries(Ze)){e.push(...Ca(n.metadata,t)),e.push(...va(n.metadata,t));for(let r of n.files)e.push(...ya(r,n.metadata.name))}if(e.length>0){let t=["Template validation errors:",...e.map(n=>` - ${n}`)].join(`
|
|
713
|
-
`);return console.log(t),1}return 0}function Zr(e){let t=Ze[e];if(!t){let n=Object.keys(Ze).join(", ");throw new Error(De(`Unknown template "${e}". Available templates: ${n}`))}return t}async function Xr(){let e=Object.values(Ze).map(t=>({name:t.metadata.name,value:t,description:t.metadata.description}));if(e.length===0)throw new Error(De("No templates found."));return
|
|
714
|
-
${T(r)}`,value:n}))})}async function Jr(e,t){let n=t.map(async({filepath:r,contents:o})=>{let i=Xn.default.join(e,r);await Zn.default.mkdir(Xn.default.dirname(i),{recursive:!0}),await Zn.default.writeFile(i,o,Buffer.isBuffer(o)?void 0:{encoding:"utf-8"})});await Promise.all(n)}var
|
|
720
|
+
`);return console.log(t),1}return 0}function Zr(e){let t=Ze[e];if(!t){let n=Object.keys(Ze).join(", ");throw new Error(De(`Unknown template "${e}". Available templates: ${n}`))}return t}async function Xr(){let e=Object.values(Ze).map(t=>({name:t.metadata.name,value:t,description:t.metadata.description}));if(e.length===0)throw new Error(De("No templates found."));return Pn({message:"Select a template",choices:e.map(({name:t,value:n,description:r})=>({name:`${Yo(t)}
|
|
721
|
+
${T(r)}`,value:n}))})}async function Jr(e,t){let n=t.map(async({filepath:r,contents:o})=>{let i=Xn.default.join(e,r);await Zn.default.mkdir(Xn.default.dirname(i),{recursive:!0}),await Zn.default.writeFile(i,o,Buffer.isBuffer(o)?void 0:{encoding:"utf-8"})});await Promise.all(n)}var Ot=class extends W.Command{static paths=[W.Command.Default];static usage=W.Command.Usage({description:"Create a new Datadog App",examples:[["Create a new app interactively","npm init @datadog/apps my-app"],["Create a new app non-interactively","npm init @datadog/apps my-app --template vite-react -y"]]});directory=W.Option.String({required:!1});template=W.Option.String("--template",{required:!1,description:"Template to use (e.g., vite-react)"});yes=W.Option.Boolean("--yes,-y",{description:"Accept all defaults without prompting"});overwrite=W.Option.Boolean("--overwrite",{description:"Overwrite existing directory without prompting"});validate=W.Option.Boolean("--validate",{description:"Validate templates and exit"});skipPostScaffold=W.Option.Boolean("--skip-post-scaffold",{description:"Skip post-scaffold commands"});async execute(){if(console.log(Ko),console.log(),console.log(),this.validate)return Vr();try{let t=await zr(this.directory,this.overwrite),n=_r.default.resolve(process.cwd(),t.directory),r=this.template?Zr(this.template):await Xr(),o=r.metadata;console.log(),console.log(),console.log(`Creating ${j(t.name)} in ${j(n)}...`),console.log(),console.log();let i=r.files.map(u=>({filepath:u.filepath,contents:u.contents({name:t.name})}));return await Jr(n,i),await Gr(n,o,this.skipPostScaffold,this.yes),console.log(Vo(t)),0}catch(t){if(t instanceof Error&&t.name==="ExitPromptError")console.log(Wo());else throw t;return 1}}};var $r="0.0.9";var Pt=new Xe.Cli({binaryLabel:"create-apps",binaryName:"npm init @datadog/apps",binaryVersion:$r});Pt.register(Ot);Pt.register(Xe.Builtins.HelpCommand);Pt.register(Xe.Builtins.VersionCommand);Pt.runExit(process.argv.slice(2));
|