@ksconsole/smartgit
Version:
smartgit helps you write better commit messages with AI
25 lines • 132 kB
JavaScript
#!/usr/bin/env node
import Cu from"tty";import{Buffer as nn}from"node:buffer";import W from"node:path";import Ye,{ChildProcess as rn}from"node:child_process";import y,{stdin as Ve,stdout as Je}from"node:process";import on from"child_process";import q from"path";import ju from"fs";import Xe from"node:url";import sn,{constants as Ze}from"node:os";import Qe from"assert";import uD from"events";import{createWriteStream as an,createReadStream as cn}from"node:fs";import ln from"buffer";import Lu from"stream";import eD from"util";import{debuglog as Fn}from"node:util";import*as fu from"node:readline";import DD from"node:readline";import{WriteStream as Cn}from"node:tty";import T from"fs/promises";import tD from"os";import fn from"https";import En from"net";import dn from"tls";import pn,{fileURLToPath as hn,pathToFileURL as mn}from"url";import gn from"http";const Bn="known-flag",An="unknown-flag",yn="argument",{stringify:Z}=JSON,bn=/\B([A-Z])/g,wn=u=>u.replace(bn,"-$1").toLowerCase(),{hasOwnProperty:$n}=Object.prototype,Q=(u,e)=>$n.call(u,e),vn=u=>Array.isArray(u),nD=u=>typeof u=="function"?[u,!1]:vn(u)?[u[0],!0]:nD(u.type),xn=(u,e)=>u===Boolean?e!=="false":e,Sn=(u,e)=>typeof e=="boolean"?e:u===Number&&e===""?Number.NaN:u(e),On=/[\s.:=]/,Tn=u=>{const e=`Flag name ${Z(u)}`;if(u.length===0)throw new Error(`${e} cannot be empty`);if(u.length===1)throw new Error(`${e} must be longer than a character`);const D=u.match(On);if(D)throw new Error(`${e} cannot contain ${Z(D?.[0])}`)},In=u=>{const e={},D=(t,r)=>{if(Q(e,t))throw new Error(`Duplicate flags named ${Z(t)}`);e[t]=r};for(const t in u){if(!Q(u,t))continue;Tn(t);const r=u[t],o=[[],...nD(r),r];D(t,o);const n=wn(t);if(t!==n&&D(n,o),"alias"in r&&typeof r.alias=="string"){const{alias:s}=r,i=`Flag alias ${Z(s)} for flag ${Z(t)}`;if(s.length===0)throw new Error(`${i} cannot be empty`);if(s.length>1)throw new Error(`${i} must be a single character`);D(s,o)}}return e},Pn=(u,e)=>{const D={};for(const t in u){if(!Q(u,t))continue;const[r,,o,n]=e[t];if(r.length===0&&"default"in n){let{default:s}=n;typeof s=="function"&&(s=s()),D[t]=s}else D[t]=o?r:r.pop()}return D},Eu="--",Rn=/[.:=]/,_n=/^-{1,2}\w/,kn=u=>{if(!_n.test(u))return;const e=!u.startsWith(Eu);let D=u.slice(e?1:2),t;const r=D.match(Rn);if(r){const{index:o}=r;t=D.slice(o+1),D=D.slice(0,o)}return[D,t,e]},Mn=(u,{onFlag:e,onArgument:D})=>{let t;const r=(o,n)=>{if(typeof t!="function")return!0;t(o,n),t=void 0};for(let o=0;o<u.length;o+=1){const n=u[o];if(n===Eu){r();const i=u.slice(o+1);D?.(i,[o],!0);break}const s=kn(n);if(s){if(r(),!e)continue;const[i,c,F]=s;if(F)for(let a=0;a<i.length;a+=1){r();const l=a===i.length-1;t=e(i[a],l?c:void 0,[o,a+1,l])}else t=e(i,c,[o])}else r(n,[o])&&D?.([n],[o])}r()},jn=(u,e)=>{for(const[D,t,r]of e.reverse()){if(t){const o=u[D];let n=o.slice(0,t);if(r||(n+=o.slice(t+1)),n!=="-"){u[D]=n;continue}}u.splice(D,1)}},Ln=(u,e=process.argv.slice(2),{ignore:D}={})=>{const t=[],r=In(u),o={},n=[];return n[Eu]=[],Mn(e,{onFlag(s,i,c){const F=Q(r,s);if(!D?.(F?Bn:An,s,i)){if(F){const[a,l]=r[s],C=xn(l,i),f=(E,d)=>{t.push(c),d&&t.push(d),a.push(Sn(l,E||""))};return C===void 0?f:f(C)}Q(o,s)||(o[s]=[]),o[s].push(i===void 0?!0:i),t.push(c)}},onArgument(s,i,c){D?.(yn,e[i[0]])||(n.push(...s),c?(n[Eu]=s,e.splice(i[0])):t.push(i))}}),jn(e,t),{flags:Pn(u,r),unknownFlags:o,_:n}};var Nn=Object.create,du=Object.defineProperty,Gn=Object.defineProperties,Un=Object.getOwnPropertyDescriptor,Wn=Object.getOwnPropertyDescriptors,qn=Object.getOwnPropertyNames,rD=Object.getOwnPropertySymbols,Hn=Object.getPrototypeOf,oD=Object.prototype.hasOwnProperty,Kn=Object.prototype.propertyIsEnumerable,sD=(u,e,D)=>e in u?du(u,e,{enumerable:!0,configurable:!0,writable:!0,value:D}):u[e]=D,pu=(u,e)=>{for(var D in e||(e={}))oD.call(e,D)&&sD(u,D,e[D]);if(rD)for(var D of rD(e))Kn.call(e,D)&&sD(u,D,e[D]);return u},Nu=(u,e)=>Gn(u,Wn(e)),zn=u=>du(u,"__esModule",{value:!0}),Yn=(u,e)=>()=>(u&&(e=u(u=0)),e),Vn=(u,e)=>()=>(e||u((e={exports:{}}).exports,e),e.exports),Jn=(u,e,D,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of qn(e))!oD.call(u,r)&&(D||r!=="default")&&du(u,r,{get:()=>e[r],enumerable:!(t=Un(e,r))||t.enumerable});return u},Xn=(u,e)=>Jn(zn(du(u!=null?Nn(Hn(u)):{},"default",!e&&u&&u.__esModule?{get:()=>u.default,enumerable:!0}:{value:u,enumerable:!0})),u),S=Yn(()=>{}),Zn=Vn((u,e)=>{S(),e.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDC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F93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[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C]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B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\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});S(),S(),S();var Qn=u=>{var e,D,t;let r=(e=process.stdout.columns)!=null?e:Number.POSITIVE_INFINITY;return typeof u=="function"&&(u=u(r)),u||(u={}),Array.isArray(u)?{columns:u,stdoutColumns:r}:{columns:(D=u.columns)!=null?D:[],stdoutColumns:(t=u.stdoutColumns)!=null?t:r}};S(),S(),S(),S(),S();function ur({onlyFirst:u=!1}={}){let e=["[\\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(e,u?void 0:"g")}function iD(u){if(typeof u!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof u}\``);return u.replace(ur(),"")}S();function er(u){return Number.isInteger(u)?u>=4352&&(u<=4447||u===9001||u===9002||11904<=u&&u<=12871&&u!==12351||12880<=u&&u<=19903||19968<=u&&u<=42182||43360<=u&&u<=43388||44032<=u&&u<=55203||63744<=u&&u<=64255||65040<=u&&u<=65049||65072<=u&&u<=65131||65281<=u&&u<=65376||65504<=u&&u<=65510||110592<=u&&u<=110593||127488<=u&&u<=127569||131072<=u&&u<=262141):!1}var Dr=Xn(Zn(),1);function M(u){if(typeof u!="string"||u.length===0||(u=iD(u),u.length===0))return 0;u=u.replace((0,Dr.default)()," ");let e=0;for(let D=0;D<u.length;D++){let t=u.codePointAt(D);t<=31||t>=127&&t<=159||t>=768&&t<=879||(t>65535&&D++,e+=er(t)?2:1)}return e}var aD=u=>Math.max(...u.split(`
`).map(M)),tr=u=>{let e=[];for(let D of u){let{length:t}=D,r=t-e.length;for(let o=0;o<r;o+=1)e.push(0);for(let o=0;o<t;o+=1){let n=aD(D[o]);n>e[o]&&(e[o]=n)}}return e};S();var cD=/^\d+%$/,lD={width:"auto",align:"left",contentWidth:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,horizontalPadding:0,paddingLeftString:"",paddingRightString:""},nr=(u,e)=>{var D;let t=[];for(let r=0;r<u.length;r+=1){let o=(D=e[r])!=null?D:"auto";if(typeof o=="number"||o==="auto"||o==="content-width"||typeof o=="string"&&cD.test(o)){t.push(Nu(pu({},lD),{width:o,contentWidth:u[r]}));continue}if(o&&typeof o=="object"){let n=Nu(pu(pu({},lD),o),{contentWidth:u[r]});n.horizontalPadding=n.paddingLeft+n.paddingRight,t.push(n);continue}throw new Error(`Invalid column width: ${JSON.stringify(o)}`)}return t};function rr(u,e){for(let D of u){let{width:t}=D;if(t==="content-width"&&(D.width=D.contentWidth),t==="auto"){let i=Math.min(20,D.contentWidth);D.width=i,D.autoOverflow=D.contentWidth-i}if(typeof t=="string"&&cD.test(t)){let i=Number.parseFloat(t.slice(0,-1))/100;D.width=Math.floor(e*i)-(D.paddingLeft+D.paddingRight)}let{horizontalPadding:r}=D,o=1,n=o+r;if(n>=e){let i=n-e,c=Math.ceil(D.paddingLeft/r*i),F=i-c;D.paddingLeft-=c,D.paddingRight-=F,D.horizontalPadding=D.paddingLeft+D.paddingRight}D.paddingLeftString=D.paddingLeft?" ".repeat(D.paddingLeft):"",D.paddingRightString=D.paddingRight?" ".repeat(D.paddingRight):"";let s=e-D.horizontalPadding;D.width=Math.max(Math.min(D.width,s),o)}}var FD=()=>Object.assign([],{columns:0});function or(u,e){let D=[FD()],[t]=D;for(let r of u){let o=r.width+r.horizontalPadding;t.columns+o>e&&(t=FD(),D.push(t)),t.push(r),t.columns+=o}for(let r of D){let o=r.reduce((l,C)=>l+C.width+C.horizontalPadding,0),n=e-o;if(n===0)continue;let s=r.filter(l=>"autoOverflow"in l),i=s.filter(l=>l.autoOverflow>0),c=i.reduce((l,C)=>l+C.autoOverflow,0),F=Math.min(c,n);for(let l of i){let C=Math.floor(l.autoOverflow/c*F);l.width+=C,n-=C}let a=Math.floor(n/s.length);for(let l=0;l<s.length;l+=1){let C=s[l];l===s.length-1?C.width+=n:C.width+=a,n-=a}}return D}function sr(u,e,D){let t=nr(D,e);return rr(t,u),or(t,u)}S(),S(),S();var Gu=10,CD=(u=0)=>e=>`\x1B[${e+u}m`,fD=(u=0)=>e=>`\x1B[${38+u};5;${e}m`,ED=(u=0)=>(e,D,t)=>`\x1B[${38+u};2;${e};${D};${t}m`;function ir(){let u=new Map,e={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],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],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[D,t]of Object.entries(e)){for(let[r,o]of Object.entries(t))e[r]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},t[r]=e[r],u.set(o[0],o[1]);Object.defineProperty(e,D,{value:t,enumerable:!1})}return Object.defineProperty(e,"codes",{value:u,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",e.color.ansi=CD(),e.color.ansi256=fD(),e.color.ansi16m=ED(),e.bgColor.ansi=CD(Gu),e.bgColor.ansi256=fD(Gu),e.bgColor.ansi16m=ED(Gu),Object.defineProperties(e,{rgbToAnsi256:{value:(D,t,r)=>D===t&&t===r?D<8?16:D>248?231:Math.round((D-8)/247*24)+232:16+36*Math.round(D/255*5)+6*Math.round(t/255*5)+Math.round(r/255*5),enumerable:!1},hexToRgb:{value:D=>{let t=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(D.toString(16));if(!t)return[0,0,0];let{colorString:r}=t.groups;r.length===3&&(r=r.split("").map(n=>n+n).join(""));let o=Number.parseInt(r,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:D=>e.rgbToAnsi256(...e.hexToRgb(D)),enumerable:!1},ansi256ToAnsi:{value:D=>{if(D<8)return 30+D;if(D<16)return 90+(D-8);let t,r,o;if(D>=232)t=((D-232)*10+8)/255,r=t,o=t;else{D-=16;let i=D%36;t=Math.floor(D/36)/5,r=Math.floor(i/6)/5,o=i%6/5}let n=Math.max(t,r,o)*2;if(n===0)return 30;let s=30+(Math.round(o)<<2|Math.round(r)<<1|Math.round(t));return n===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(D,t,r)=>e.ansi256ToAnsi(e.rgbToAnsi256(D,t,r)),enumerable:!1},hexToAnsi:{value:D=>e.ansi256ToAnsi(e.hexToAnsi256(D)),enumerable:!1}}),e}var ar=ir(),cr=ar,hu=new Set(["\x1B","\x9B"]),lr=39,Uu="\x07",dD="[",Fr="]",pD="m",Wu=`${Fr}8;;`,hD=u=>`${hu.values().next().value}${dD}${u}${pD}`,mD=u=>`${hu.values().next().value}${Wu}${u}${Uu}`,Cr=u=>u.split(" ").map(e=>M(e)),qu=(u,e,D)=>{let t=[...e],r=!1,o=!1,n=M(iD(u[u.length-1]));for(let[s,i]of t.entries()){let c=M(i);if(n+c<=D?u[u.length-1]+=i:(u.push(i),n=0),hu.has(i)&&(r=!0,o=t.slice(s+1).join("").startsWith(Wu)),r){o?i===Uu&&(r=!1,o=!1):i===pD&&(r=!1);continue}n+=c,n===D&&s<t.length-1&&(u.push(""),n=0)}!n&&u[u.length-1].length>0&&u.length>1&&(u[u.length-2]+=u.pop())},fr=u=>{let e=u.split(" "),D=e.length;for(;D>0&&!(M(e[D-1])>0);)D--;return D===e.length?u:e.slice(0,D).join(" ")+e.slice(D).join("")},Er=(u,e,D={})=>{if(D.trim!==!1&&u.trim()==="")return"";let t="",r,o,n=Cr(u),s=[""];for(let[c,F]of u.split(" ").entries()){D.trim!==!1&&(s[s.length-1]=s[s.length-1].trimStart());let a=M(s[s.length-1]);if(c!==0&&(a>=e&&(D.wordWrap===!1||D.trim===!1)&&(s.push(""),a=0),(a>0||D.trim===!1)&&(s[s.length-1]+=" ",a++)),D.hard&&n[c]>e){let l=e-a,C=1+Math.floor((n[c]-l-1)/e);Math.floor((n[c]-1)/e)<C&&s.push(""),qu(s,F,e);continue}if(a+n[c]>e&&a>0&&n[c]>0){if(D.wordWrap===!1&&a<e){qu(s,F,e);continue}s.push("")}if(a+n[c]>e&&D.wordWrap===!1){qu(s,F,e);continue}s[s.length-1]+=F}D.trim!==!1&&(s=s.map(c=>fr(c)));let i=[...s.join(`
`)];for(let[c,F]of i.entries()){if(t+=F,hu.has(F)){let{groups:l}=new RegExp(`(?:\\${dD}(?<code>\\d+)m|\\${Wu}(?<uri>.*)${Uu})`).exec(i.slice(c).join(""))||{groups:{}};if(l.code!==void 0){let C=Number.parseFloat(l.code);r=C===lr?void 0:C}else l.uri!==void 0&&(o=l.uri.length===0?void 0:l.uri)}let a=cr.codes.get(Number(r));i[c+1]===`
`?(o&&(t+=mD("")),r&&a&&(t+=hD(a))):F===`
`&&(r&&a&&(t+=hD(r)),o&&(t+=mD(o)))}return t};function dr(u,e,D){return String(u).normalize().replace(/\r\n/g,`
`).split(`
`).map(t=>Er(t,e,D)).join(`
`)}var gD=u=>Array.from({length:u}).fill("");function pr(u,e){let D=[],t=0;for(let r of u){let o=0,n=r.map(i=>{var c;let F=(c=e[t])!=null?c:"";t+=1,i.preprocess&&(F=i.preprocess(F)),aD(F)>i.width&&(F=dr(F,i.width,{hard:!0}));let a=F.split(`
`);if(i.postprocess){let{postprocess:l}=i;a=a.map((C,f)=>l.call(i,C,f))}return i.paddingTop&&a.unshift(...gD(i.paddingTop)),i.paddingBottom&&a.push(...gD(i.paddingBottom)),a.length>o&&(o=a.length),Nu(pu({},i),{lines:a})}),s=[];for(let i=0;i<o;i+=1){let c=n.map(F=>{var a;let l=(a=F.lines[i])!=null?a:"",C=Number.isFinite(F.width)?" ".repeat(F.width-M(l)):"",f=F.paddingLeftString;return F.align==="right"&&(f+=C),f+=l,F.align==="left"&&(f+=C),f+F.paddingRightString}).join("");s.push(c)}D.push(s.join(`
`))}return D.join(`
`)}function hr(u,e){if(!u||u.length===0)return"";let D=tr(u),t=D.length;if(t===0)return"";let{stdoutColumns:r,columns:o}=Qn(e);if(o.length>t)throw new Error(`${o.length} columns defined, but only ${t} columns found`);let n=sr(r,o,D);return u.map(s=>pr(n,s)).join(`
`)}S();var mr=["<",">","=",">=","<="];function gr(u){if(!mr.includes(u))throw new TypeError(`Invalid breakpoint operator: ${u}`)}function Br(u){let e=Object.keys(u).map(D=>{let[t,r]=D.split(" ");gr(t);let o=Number.parseInt(r,10);if(Number.isNaN(o))throw new TypeError(`Invalid breakpoint value: ${r}`);let n=u[D];return{operator:t,breakpoint:o,value:n}}).sort((D,t)=>t.breakpoint-D.breakpoint);return D=>{var t;return(t=e.find(({operator:r,breakpoint:o})=>r==="="&&D===o||r===">"&&D>o||r==="<"&&D<o||r===">="&&D>=o||r==="<="&&D<=o))==null?void 0:t.value}}const Ar=u=>u.replace(/[\W_]([a-z\d])?/gi,(e,D)=>D?D.toUpperCase():""),yr=u=>u.replace(/\B([A-Z])/g,"-$1").toLowerCase(),br={"> 80":[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"auto"}],"> 40":[{width:"auto",paddingLeft:2,paddingRight:8,preprocess:u=>u.trim()},{width:"100%",paddingLeft:2,paddingBottom:1}],"> 0":{stdoutColumns:1e3,columns:[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"content-width"}]}};function wr(u){let e=!1;return{type:"table",data:{tableData:Object.keys(u).sort((D,t)=>D.localeCompare(t)).map(D=>{const t=u[D],r="alias"in t;return r&&(e=!0),{name:D,flag:t,flagFormatted:`--${yr(D)}`,aliasesEnabled:e,aliasFormatted:r?`-${t.alias}`:void 0}}).map(D=>(D.aliasesEnabled=e,[{type:"flagName",data:D},{type:"flagDescription",data:D}])),tableBreakpoints:br}}}const BD=u=>!u||(u.version??(u.help?u.help.version:void 0)),AD=u=>{const e="parent"in u&&u.parent?.name;return(e?`${e} `:"")+u.name};function $r(u){const e=[];u.name&&e.push(AD(u));const D=BD(u)??("parent"in u&&BD(u.parent));if(D&&e.push(`v${D}`),e.length!==0)return{id:"name",type:"text",data:`${e.join(" ")}
`}}function vr(u){const{help:e}=u;if(!(!e||!e.description))return{id:"description",type:"text",data:`${e.description}
`}}function xr(u){const e=u.help||{};if("usage"in e)return e.usage?{id:"usage",type:"section",data:{title:"Usage:",body:Array.isArray(e.usage)?e.usage.join(`
`):e.usage}}:void 0;if(u.name){const D=[],t=[AD(u)];if(u.flags&&Object.keys(u.flags).length>0&&t.push("[flags...]"),u.parameters&&u.parameters.length>0){const{parameters:r}=u,o=r.indexOf("--"),n=o>-1&&r.slice(o+1).some(s=>s.startsWith("<"));t.push(r.map(s=>s!=="--"?s:n?"--":"[--]").join(" "))}if(t.length>1&&D.push(t.join(" ")),"commands"in u&&u.commands?.length&&D.push(`${u.name} <command>`),D.length>0)return{id:"usage",type:"section",data:{title:"Usage:",body:D.join(`
`)}}}}function Sr(u){return!("commands"in u)||!u.commands?.length?void 0:{id:"commands",type:"section",data:{title:"Commands:",body:{type:"table",data:{tableData:u.commands.map(e=>[e.options.name,e.options.help?e.options.help.description:""]),tableOptions:[{width:"content-width",paddingLeft:2,paddingRight:8}]}},indentBody:0}}}function Or(u){if(!(!u.flags||Object.keys(u.flags).length===0))return{id:"flags",type:"section",data:{title:"Flags:",body:wr(u.flags),indentBody:0}}}function Tr(u){const{help:e}=u;if(!e||!e.examples||e.examples.length===0)return;let{examples:D}=e;if(Array.isArray(D)&&(D=D.join(`
`)),D)return{id:"examples",type:"section",data:{title:"Examples:",body:D}}}function Ir(u){if(!("alias"in u)||!u.alias)return;const{alias:e}=u;return{id:"aliases",type:"section",data:{title:"Aliases:",body:Array.isArray(e)?e.join(", "):e}}}const Pr=u=>[$r,vr,xr,Sr,Or,Tr,Ir].map(e=>e(u)).filter(Boolean),Rr=Cu.WriteStream.prototype.hasColors();class _r{text(e){return e}bold(e){return Rr?`\x1B[1m${e}\x1B[22m`:e.toLocaleUpperCase()}indentText({text:e,spaces:D}){return e.replace(/^/gm," ".repeat(D))}heading(e){return this.bold(e)}section({title:e,body:D,indentBody:t=2}){return`${(e?`${this.heading(e)}
`:"")+(D?this.indentText({text:this.render(D),spaces:t}):"")}
`}table({tableData:e,tableOptions:D,tableBreakpoints:t}){return hr(e.map(r=>r.map(o=>this.render(o))),t?Br(t):D)}flagParameter(e){return e===Boolean?"":e===String?"<string>":e===Number?"<number>":Array.isArray(e)?this.flagParameter(e[0]):"<value>"}flagOperator(e){return" "}flagName(e){const{flag:D,flagFormatted:t,aliasesEnabled:r,aliasFormatted:o}=e;let n="";if(o?n+=`${o}, `:r&&(n+=" "),n+=t,"placeholder"in D&&typeof D.placeholder=="string")n+=`${this.flagOperator(e)}${D.placeholder}`;else{const s=this.flagParameter("type"in D?D.type:D);s&&(n+=`${this.flagOperator(e)}${s}`)}return n}flagDefault(e){return JSON.stringify(e)}flagDescription({flag:e}){let D="description"in e?e.description??"":"";if("default"in e){let{default:t}=e;typeof t=="function"&&(t=t()),t&&(D+=` (default: ${this.flagDefault(t)})`)}return D}render(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.map(D=>this.render(D)).join(`
`);if("type"in e&&this[e.type]){const D=this[e.type];if(typeof D=="function")return D.call(this,e.data)}throw new Error(`Invalid node type: ${JSON.stringify(e)}`)}}const Hu=/^[\w.-]+$/,{stringify:R}=JSON,kr=/[|\\{}()[\]^$+*?.]/;function Ku(u){const e=[];let D,t;for(const r of u){if(t)throw new Error(`Invalid parameter: Spread parameter ${R(t)} must be last`);const o=r[0],n=r[r.length-1];let s;if(o==="<"&&n===">"&&(s=!0,D))throw new Error(`Invalid parameter: Required parameter ${R(r)} cannot come after optional parameter ${R(D)}`);if(o==="["&&n==="]"&&(s=!1,D=r),s===void 0)throw new Error(`Invalid parameter: ${R(r)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);let i=r.slice(1,-1);const c=i.slice(-3)==="...";c&&(t=r,i=i.slice(0,-3));const F=i.match(kr);if(F)throw new Error(`Invalid parameter: ${R(r)}. Invalid character found ${R(F[0])}`);e.push({name:i,required:s,spread:c})}return e}function zu(u,e,D,t){for(let r=0;r<e.length;r+=1){const{name:o,required:n,spread:s}=e[r],i=Ar(o);if(i in u)throw new Error(`Invalid parameter: ${R(o)} is used more than once.`);const c=s?D.slice(r):D[r];if(s&&(r=e.length),n&&(!c||s&&c.length===0))return console.error(`Error: Missing required parameter ${R(o)}
`),t(),process.exit(1);u[i]=c}}function Mr(u){return u===void 0||u!==!1}function yD(u,e,D,t){const r={...e.flags},o=e.version;o&&(r.version={type:Boolean,description:"Show version"});const{help:n}=e,s=Mr(n);s&&!("help"in r)&&(r.help={type:Boolean,alias:"h",description:"Show help"});const i=Ln(r,t,{ignore:e.ignoreArgv}),c=()=>{console.log(e.version)};if(o&&i.flags.version===!0)return c(),process.exit(0);const F=new _r,a=s&&n?.render?n.render:f=>F.render(f),l=f=>{const E=Pr({...e,...f?{help:f}:{},flags:r});console.log(a(E,F))};if(s&&i.flags.help===!0)return l(),process.exit(0);if(e.parameters){let{parameters:f}=e,E=i._;const d=f.indexOf("--"),h=f.slice(d+1),$=Object.create(null);if(d>-1&&h.length>0){f=f.slice(0,d);const P=i._["--"];E=E.slice(0,-P.length||void 0),zu($,Ku(f),E,l),zu($,Ku(h),P,l)}else zu($,Ku(f),E,l);Object.assign(i._,$)}const C={...i,showVersion:c,showHelp:l};return typeof D=="function"&&D(C),{command:u,...C}}function jr(u,e){const D=new Map;for(const t of e){const r=[t.options.name],{alias:o}=t.options;o&&(Array.isArray(o)?r.push(...o):r.push(o));for(const n of r){if(D.has(n))throw new Error(`Duplicate command name found: ${R(n)}`);D.set(n,t)}}return D.get(u)}function Lr(u,e,D=process.argv.slice(2)){if(!u)throw new Error("Options is required");if("name"in u&&(!u.name||!Hu.test(u.name)))throw new Error(`Invalid script name: ${R(u.name)}`);const t=D[0];if(u.commands&&Hu.test(t)){const r=jr(t,u.commands);if(r)return yD(r.options.name,{...r.options,parent:u},r.callback,D.slice(1))}return yD(void 0,u,e,D)}function bD(u,e){if(!u)throw new Error("Command options are required");const{name:D}=u;if(u.name===void 0)throw new Error("Command name is required");if(!Hu.test(D))throw new Error(`Invalid command name ${JSON.stringify(D)}. Command names must be one word.`);return{options:u,callback:e}}var wD="1.0.5",Nr="smartgit helps you write better commit messages with AI",w=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function j(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var H={exports:{}},Yu,$D;function Gr(){if($D)return Yu;$D=1,Yu=t,t.sync=r;var u=ju;function e(o,n){var s=n.pathExt!==void 0?n.pathExt:process.env.PATHEXT;if(!s||(s=s.split(";"),s.indexOf("")!==-1))return!0;for(var i=0;i<s.length;i++){var c=s[i].toLowerCase();if(c&&o.substr(-c.length).toLowerCase()===c)return!0}return!1}function D(o,n,s){return!o.isSymbolicLink()&&!o.isFile()?!1:e(n,s)}function t(o,n,s){u.stat(o,function(i,c){s(i,i?!1:D(c,o,n))})}function r(o,n){return D(u.statSync(o),o,n)}return Yu}var Vu,vD;function Ur(){if(vD)return Vu;vD=1,Vu=e,e.sync=D;var u=ju;function e(o,n,s){u.stat(o,function(i,c){s(i,i?!1:t(c,n))})}function D(o,n){return t(u.statSync(o),n)}function t(o,n){return o.isFile()&&r(o,n)}function r(o,n){var s=o.mode,i=o.uid,c=o.gid,F=n.uid!==void 0?n.uid:process.getuid&&process.getuid(),a=n.gid!==void 0?n.gid:process.getgid&&process.getgid(),l=parseInt("100",8),C=parseInt("010",8),f=parseInt("001",8),E=l|C,d=s&f||s&C&&c===a||s&l&&i===F||s&E&&F===0;return d}return Vu}var mu;process.platform==="win32"||w.TESTING_WINDOWS?mu=Gr():mu=Ur();var Wr=Ju;Ju.sync=qr;function Ju(u,e,D){if(typeof e=="function"&&(D=e,e={}),!D){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(t,r){Ju(u,e||{},function(o,n){o?r(o):t(n)})})}mu(u,e||{},function(t,r){t&&(t.code==="EACCES"||e&&e.ignoreErrors)&&(t=null,r=!1),D(t,r)})}function qr(u,e){try{return mu.sync(u,e||{})}catch(D){if(e&&e.ignoreErrors||D.code==="EACCES")return!1;throw D}}const K=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",xD=q,Hr=K?";":":",SD=Wr,OD=u=>Object.assign(new Error(`not found: ${u}`),{code:"ENOENT"}),TD=(u,e)=>{const D=e.colon||Hr,t=u.match(/\//)||K&&u.match(/\\/)?[""]:[...K?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(D)],r=K?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=K?r.split(D):[""];return K&&u.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:t,pathExt:o,pathExtExe:r}},ID=(u,e,D)=>{typeof e=="function"&&(D=e,e={}),e||(e={});const{pathEnv:t,pathExt:r,pathExtExe:o}=TD(u,e),n=[],s=c=>new Promise((F,a)=>{if(c===t.length)return e.all&&n.length?F(n):a(OD(u));const l=t[c],C=/^".*"$/.test(l)?l.slice(1,-1):l,f=xD.join(C,u),E=!C&&/^\.[\\\/]/.test(u)?u.slice(0,2)+f:f;F(i(E,c,0))}),i=(c,F,a)=>new Promise((l,C)=>{if(a===r.length)return l(s(F+1));const f=r[a];SD(c+f,{pathExt:o},(E,d)=>{if(!E&&d)if(e.all)n.push(c+f);else return l(c+f);return l(i(c,F,a+1))})});return D?s(0).then(c=>D(null,c),D):s(0)},Kr=(u,e)=>{e=e||{};const{pathEnv:D,pathExt:t,pathExtExe:r}=TD(u,e),o=[];for(let n=0;n<D.length;n++){const s=D[n],i=/^".*"$/.test(s)?s.slice(1,-1):s,c=xD.join(i,u),F=!i&&/^\.[\\\/]/.test(u)?u.slice(0,2)+c:c;for(let a=0;a<t.length;a++){const l=F+t[a];try{if(SD.sync(l,{pathExt:r}))if(e.all)o.push(l);else return l}catch{}}}if(e.all&&o.length)return o;if(e.nothrow)return null;throw OD(u)};var zr=ID;ID.sync=Kr;var Xu={exports:{}};const PD=(u={})=>{const e=u.env||process.env;return(u.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(t=>t.toUpperCase()==="PATH")||"Path"};Xu.exports=PD,Xu.exports.default=PD;var Yr=Xu.exports;const RD=q,Vr=zr,Jr=Yr;function _D(u,e){const D=u.options.env||process.env,t=process.cwd(),r=u.options.cwd!=null,o=r&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(u.options.cwd)}catch{}let n;try{n=Vr.sync(u.command,{path:D[Jr({env:D})],pathExt:e?RD.delimiter:void 0})}catch{}finally{o&&process.chdir(t)}return n&&(n=RD.resolve(r?u.options.cwd:"",n)),n}function Xr(u){return _D(u)||_D(u,!0)}var Zr=Xr,Zu={};const Qu=/([()\][%!^"`<>&|;, *?])/g;function Qr(u){return u=u.replace(Qu,"^$1"),u}function uo(u,e){return u=`${u}`,u=u.replace(/(\\*)"/g,'$1$1\\"'),u=u.replace(/(\\*)$/,"$1$1"),u=`"${u}"`,u=u.replace(Qu,"^$1"),e&&(u=u.replace(Qu,"^$1")),u}Zu.command=Qr,Zu.argument=uo;var eo=/^#!(.*)/;const Do=eo;var to=(u="")=>{const e=u.match(Do);if(!e)return null;const[D,t]=e[0].replace(/#! ?/,"").split(" "),r=D.split("/").pop();return r==="env"?t:t?`${r} ${t}`:r};const ue=ju,no=to;function ro(u){const D=Buffer.alloc(150);let t;try{t=ue.openSync(u,"r"),ue.readSync(t,D,0,150,0),ue.closeSync(t)}catch{}return no(D.toString())}var oo=ro;const so=q,kD=Zr,MD=Zu,io=oo,ao=process.platform==="win32",co=/\.(?:com|exe)$/i,lo=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Fo(u){u.file=kD(u);const e=u.file&&io(u.file);return e?(u.args.unshift(u.file),u.command=e,kD(u)):u.file}function Co(u){if(!ao)return u;const e=Fo(u),D=!co.test(e);if(u.options.forceShell||D){const t=lo.test(e);u.command=so.normalize(u.command),u.command=MD.command(u.command),u.args=u.args.map(o=>MD.argument(o,t));const r=[u.command].concat(u.args).join(" ");u.args=["/d","/s","/c",`"${r}"`],u.command=process.env.comspec||"cmd.exe",u.options.windowsVerbatimArguments=!0}return u}function fo(u,e,D){e&&!Array.isArray(e)&&(D=e,e=null),e=e?e.slice(0):[],D=Object.assign({},D);const t={command:u,args:e,options:D,file:void 0,original:{command:u,args:e}};return D.shell?t:Co(t)}var Eo=fo;const ee=process.platform==="win32";function De(u,e){return Object.assign(new Error(`${e} ${u.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${u.command}`,path:u.command,spawnargs:u.args})}function po(u,e){if(!ee)return;const D=u.emit;u.emit=function(t,r){if(t==="exit"){const o=jD(r,e);if(o)return D.call(u,"error",o)}return D.apply(u,arguments)}}function jD(u,e){return ee&&u===1&&!e.file?De(e.original,"spawn"):null}function ho(u,e){return ee&&u===1&&!e.file?De(e.original,"spawnSync"):null}var mo={hookChildProcess:po,verifyENOENT:jD,verifyENOENTSync:ho,notFoundError:De};const LD=on,te=Eo,ne=mo;function ND(u,e,D){const t=te(u,e,D),r=LD.spawn(t.command,t.args,t.options);return ne.hookChildProcess(r,t),r}function go(u,e,D){const t=te(u,e,D),r=LD.spawnSync(t.command,t.args,t.options);return r.error=r.error||ne.verifyENOENTSync(r.status,t),r}H.exports=ND,H.exports.spawn=ND,H.exports.sync=go,H.exports._parse=te,H.exports._enoent=ne;var Bo=H.exports,Ao=j(Bo);function yo(u){const e=typeof u=="string"?`
`:`
`.charCodeAt(),D=typeof u=="string"?"\r":"\r".charCodeAt();return u[u.length-1]===e&&(u=u.slice(0,-1)),u[u.length-1]===D&&(u=u.slice(0,-1)),u}function GD(u={}){const{env:e=process.env,platform:D=process.platform}=u;return D!=="win32"?"PATH":Object.keys(e).reverse().find(t=>t.toUpperCase()==="PATH")||"Path"}function bo(u={}){const{cwd:e=y.cwd(),path:D=y.env[GD()],execPath:t=y.execPath}=u;let r;const o=t instanceof URL?Xe.fileURLToPath(t):t,n=e instanceof URL?Xe.fileURLToPath(e):e;let s=W.resolve(n);const i=[];for(;r!==s;)i.push(W.join(s,"node_modules/.bin")),r=s,s=W.resolve(s,"..");return i.push(W.resolve(n,o,"..")),[...i,D].join(W.delimiter)}function wo({env:u=y.env,...e}={}){u={...u};const D=GD({env:u});return e.path=u[D],u[D]=bo(e),u}const $o=(u,e,D,t)=>{if(D==="length"||D==="prototype"||D==="arguments"||D==="caller")return;const r=Object.getOwnPropertyDescriptor(u,D),o=Object.getOwnPropertyDescriptor(e,D);!vo(r,o)&&t||Object.defineProperty(u,D,o)},vo=function(u,e){return u===void 0||u.configurable||u.writable===e.writable&&u.enumerable===e.enumerable&&u.configurable===e.configurable&&(u.writable||u.value===e.value)},xo=(u,e)=>{const D=Object.getPrototypeOf(e);D!==Object.getPrototypeOf(u)&&Object.setPrototypeOf(u,D)},So=(u,e)=>`/* Wrapped ${u}*/
${e}`,Oo=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),To=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Io=(u,e,D)=>{const t=D===""?"":`with ${D.trim()}() `,r=So.bind(null,t,e.toString());Object.defineProperty(r,"name",To),Object.defineProperty(u,"toString",{...Oo,value:r})};function Po(u,e,{ignoreNonConfigurable:D=!1}={}){const{name:t}=u;for(const r of Reflect.ownKeys(e))$o(u,e,r,D);return xo(u,e),Io(u,e,t),u}const gu=new WeakMap,UD=(u,e={})=>{if(typeof u!="function")throw new TypeError("Expected a function");let D,t=0;const r=u.displayName||u.name||"<anonymous>",o=function(...n){if(gu.set(o,++t),t===1)D=u.apply(this,n),u=null;else if(e.throw===!0)throw new Error(`Function \`${r}\` can only be called once`);return D};return Po(o,u),gu.set(o,t),o};UD.callCount=u=>{if(!gu.has(u))throw new Error(`The given function \`${u.name}\` is not wrapped by the \`onetime\` package`);return gu.get(u)};const Ro=()=>{const u=qD-WD+1;return Array.from({length:u},_o)},_o=(u,e)=>({name:`SIGRT${e+1}`,number:WD+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),WD=34,qD=64,ko=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}],HD=()=>{const u=Ro();return[...ko,...u].map(Mo)},Mo=({name:u,number:e,description:D,action:t,forced:r=!1,standard:o})=>{const{signals:{[u]:n}}=Ze,s=n!==void 0;return{name:u,number:s?n:e,description:D,supported:s,action:t,forced:r,standard:o}},jo=()=>{const u=HD();return Object.fromEntries(u.map(Lo))},Lo=({name:u,number:e,description:D,supported:t,action:r,forced:o,standard:n})=>[u,{name:u,number:e,description:D,supported:t,action:r,forced:o,standard:n}],No=jo(),Go=()=>{const u=HD(),e=qD+1,D=Array.from({length:e},(t,r)=>Uo(r,u));return Object.assign({},...D)},Uo=(u,e)=>{const D=Wo(u,e);if(D===void 0)return{};const{name:t,description:r,supported:o,action:n,forced:s,standard:i}=D;return{[u]:{name:t,number:u,description:r,supported:o,action:n,forced:s,standard:i}}},Wo