eazy-git 0.2.9 → 0.2.11

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/git.js CHANGED
@@ -24,4 +24,4 @@ ${v}
24
24
  `)}
25
25
  `)},info:(e,t)=>{n.message(e,{...t,symbol:l("blue",xt)})},success:(e,t)=>{n.message(e,{...t,symbol:l("green",Rt)})},step:(e,t)=>{n.message(e,{...t,symbol:l("green",Le)})},warn:(e,t)=>{n.message(e,{...t,symbol:l("yellow",Tt)})},warning:(e,t)=>{n.warn(e,t)},error:(e,t)=>{n.message(e,{...t,symbol:l("red",Ft)})}},Pe=(e="",t)=>{let s=t?.output??process.stdout,i=t?.withGuide??x.withGuide?`${l("gray",Ae)} `:"";s.write(`${i}${l("red",e)}
26
26
 
27
- `)};var Os={light:m("\u2500","-"),heavy:m("\u2501","="),block:m("\u2588","#")};var Vs=`${l("gray",_)} `;import{spawnSync as We}from"child_process";import{existsSync as Lt,readFileSync as At,writeFileSync as Gs,mkdirSync as Ws}from"fs";import kt from"os";import Ve from"path";var Pt=Ve.join(kt.homedir(),".eazy-git"),De=Ve.join(Pt,"config.json"),Oe={language:"es",defaultBaseBranch:"release",aiProvider:"claude"};function Ne(){try{if(Lt(De)){let e=At(De,"utf-8");return{...Oe,...JSON.parse(e)}}}catch{}return{...Oe}}var Ue={welcome:"Bienvenido a",subtitle:"tu CLI de confianza para gestionar ramas en GIT",operationCompleted:"Operacion completada!",operationCancelled:"Operacion cancelada. Saliendo...",unknownCommand:"Comando desconocido",errorExecuting:"Error al ejecutar el comando",version:"eazy-git version",whatToDo:"Que deseas hacer?",addChanges:"Agregar cambios a una rama",createOriginal:"Crear rama original",createTemporal:"Crear rama temporal",notGitRepo:"Este directorio no es un repositorio git",gitNotInstalled:"git no esta instalado en el sistema",currentBranch:"Branch actual",filesChanged:"Archivos con cambios",noChangesPending:"No hay cambios pendientes. Deseas continuar de todas formas?",updatingRefs:"Actualizando referencias remotas...",refsUpdated:"Referencias actualizadas",fetchFailed:"No se pudo hacer fetch (continuando...)",baseBranch:"Desde que branch base quieres crear la rama?",baseBranchRequired:"El branch base es requerido",ticketId:"Cual es el identificador del ticket? (ej: DPW-0000)",ticketRequired:"El ticket es requerido",changeType:"Que tipo de cambio es?",branchExistsLocal:e=>`La rama "${e}" ya existe localmente. Que deseas hacer?`,switchToIt:"Cambiarme a ella y continuar",cancel:"Cancelar",cancelledOp:"Operacion cancelada.",creatingBranch:(e,t)=>`Creando rama ${e} desde origin/${t}...`,branchCreated:e=>`Rama ${e} creada`,errorCreatingBranch:e=>`Error al crear la rama: ${e}`,noFilesToStage:"No hay archivos para stagear.",selectFiles:"Cuales archivos quieres incluir en el commit?",selectAllFiles:"Seleccionar todos los archivos",stagedFiles:"Archivos en stage",stagedCorrect:"Los archivos en stage son correctos?",aiProvider:"Con que IA quieres generar la sugerencia de commit?",generatingCommit:e=>`Generando sugerencia de commit con ${e}...`,aiSuggestionFailed:e=>`No se pudo obtener sugerencia de ${e}. Escribe el mensaje manualmente.`,writeCommitMsg:"Escribe el mensaje de commit:",commitMsgRequired:"El mensaje es requerido",suggestionOf:e=>`Sugerencia de ${e}`,useThisCommit:"Este mensaje de commit te parece bien?",yesUseIt:"Si, usar este",modify:"Modificar",commitSuccess:"Commit realizado correctamente",hookBlocked:"El pre-commit hook bloqueo el commit. Que deseas hacer?",retryHook:"Ya lo corregi, agrega los cambios y vuelve a intentarlo",skipHook:"Saltar el hook (--no-verify)",commitNoHooks:"Commit realizado (sin hooks)",pushToRemote:"Deseas subir la rama al repositorio remoto?",pushSuccess:"Push realizado",pushForceQuestion:"La rama ya existe en el remoto con historial diferente. Deseas forzar el push? (git push -f)",pushForceSuccess:"Push forzado realizado",pushForceError:e=>`Error en el push forzado: ${e}`,pushError:e=>`Error en el push: ${e}`,summaryTitle:"Resumen",summaryBranch:"Rama",summaryFrom:"Desde",summaryCommit:"Commit",summaryFiles:e=>`${e} archivos commiteados`,summaryPush:"Push",summaryPR:"Crear PR",statusModified:"modificado",statusAdded:"agregado",statusDeleted:"eliminado",statusRenamed:"renombrado",statusUntracked:"sin rastrear",commitTypes:{fix:"fix \u2014 correccion de bug",feat:"feat \u2014 nueva funcionalidad",refactor:"refactor \u2014 mejora sin cambio funcional",chore:"chore \u2014 mantenimiento, dependencias",docs:"docs \u2014 documentacion",test:"test \u2014 pruebas",ci:"ci \u2014 integracion continua",perf:"perf \u2014 rendimiento",style:"style \u2014 formato, sin cambio de logica"},selectBranchType:"Selecciona el tipo de rama:",branchFix:"Fix",branchImprovement:"Mejora",branchFeature:"Feature",branchRefactor:"Refactor",creatingOriginalBranch:"Creando rama original...",branchCreatedAndPushed:e=>`Rama "${e}" creada y pusheada correctamente!`,branchCreatedSuccess:e=>`Rama "${e}" creada correctamente!`,mergeBranchQuestion:"A que rama deseas hacer merge?",developDEV:"develop (DEV)",releaseUAT:"release (UAT)",temporalBranchCreated:"Rama temporal creada correctamente",temporalBranchMerged:"Rama temporal mergeada correctamente",conflictsDetected:"Conflictos detectados. Resolvelos manualmente!",branchPushedToRemote:"Rama pusheada al repositorio remoto",removeTemporalBranch:"Deseas eliminar la rama temporal?",temporalBranchDeleted:"Rama temporal eliminada correctamente",errorCreatingTemporal:"Error creando la rama temporal",enterJiraCode:"Ingresa el codigo del ticket JIRA:",jiraRequired:"El codigo JIRA es requerido!",jiraInvalidFormat:"El codigo JIRA debe tener el formato DPW-0000",fetchingRemote:"Obteniendo cambios remotos...",pullingChanges:"Aplicando cambios en tu rama...",pullError:e=>`Error: ${e}`,pushingChanges:"Subiendo cambios al remoto...",pushedSuccess:"Cambios subidos correctamente!",pushedForceSuccess:"Cambios subidos (forzado) correctamente!",pushQuickError:e=>`Error: ${e}`,provideCommitMsg:"Proporciona un mensaje de commit",stagingChanges:"Stageando cambios...",creatingCommit:"Creando commit...",commitCreated:"Commit creado correctamente!",commitError:e=>`Error: ${e}`,switchingPrevBranch:"Cambiando a la rama anterior...",switchedTo:e=>`Cambiado a rama ${e} correctamente!`,checkoutError:e=>`Error: ${e}`,fetchingLatest:"Obteniendo ultimos cambios...",mergingWith:e=>`Mergeando con ${e}...`,pushingMerged:"Subiendo cambios mergeados...",mergeCompleted:"Merge completado correctamente!",mergeError:e=>`Error: ${e}`,removingLastCommit:"Eliminando ultimo commit...",removeLastConfirm:"Esto eliminara el ultimo commit (los cambios se mantienen en staging). Continuar?",lastCommitRemoved:"Ultimo commit eliminado correctamente!",removeLastError:e=>`Error: ${e}`,logError:e=>`Error: ${e}`,settingUpConfig:"Configurando tu entorno",configSaved:"Configuracion guardada",missingConfigValues:"Faltan valores de configuracion requeridos.",errorWritingConfig:"Error escribiendo archivo de configuracion:",currentConfig:"Configuracion actual",useThisConfig:"Deseas usar esta configuracion?",installingDeps:"Instalando dependencias...",depsInstalled:"Todas las dependencias fueron instaladas",authFailed:"Autenticacion fallida",unexpectedError:"Ocurrio un error inesperado",enterEndpoint:"Ingresa la URL del endpoint:",urlRequired:"La URL es requerida!",urlMustBeHttp:"La URL debe usar protocolo HTTP/HTTPS",urlMustHaveHost:"La URL debe incluir un hostname",urlInvalid:"Ingresa una URL valida",enterApiKey:"Ingresa tu apikey:",apiKeyRequired:"El API key es requerido!",enterRegistryName:"Ingresa el nombre del registro NPM (sin caracteres especiales):",registryNameRequired:"El nombre del registro es requerido!",registryNameLettersOnly:"El nombre del registro debe contener solo letras",enterRegistryURL:"Ingresa la URL del registro NPM (sin http/https):",registryURLRequired:"La URL del registro es requerida!",registryURLStartWithName:"La URL debe empezar con un nombre, evita caracteres especiales",registryURLNoProtocol:"La URL no debe incluir protocolo 'http/https' y debe empezar con una letra",registryURLNoSlash:"La URL no debe empezar con '/' y debe empezar con una letra o numero",registryURLNoWWW:"La URL no debe empezar con 'www' y debe empezar con una letra o numero",languageSelect:"Selecciona el idioma de la interfaz:",languageChanged:e=>`Idioma cambiado a: ${e}`,configMenu:"Que deseas configurar?",configLanguage:"Idioma de la interfaz",configDefaultBranch:"Rama base por defecto",configAIProvider:"Proveedor de IA por defecto",configView:"Ver configuracion actual",defaultBranchSet:e=>`Rama base por defecto: ${e}`,aiProviderSet:e=>`Proveedor de IA por defecto: ${e}`};var Be={welcome:"Welcome to",subtitle:"your trusted CLI for GIT branch management",operationCompleted:"Operation completed!",operationCancelled:"Operation cancelled. Exiting...",unknownCommand:"Unknown command",errorExecuting:"Error executing command",version:"eazy-git version",whatToDo:"What would you like to do?",addChanges:"Add Changes to Branch",createOriginal:"Create Original Branch",createTemporal:"Create Temporal Branch",notGitRepo:"This directory is not a git repository",gitNotInstalled:"git is not installed on the system",currentBranch:"Current branch",filesChanged:"Files with changes",noChangesPending:"No pending changes. Do you want to continue anyway?",updatingRefs:"Updating remote references...",refsUpdated:"References updated",fetchFailed:"Could not fetch (continuing...)",baseBranch:"From which base branch do you want to create the branch?",baseBranchRequired:"Base branch is required",ticketId:"What is the ticket identifier? (e.g.: DPW-0000)",ticketRequired:"Ticket is required",changeType:"What type of change is this?",branchExistsLocal:e=>`Branch "${e}" already exists locally. What would you like to do?`,switchToIt:"Switch to it and continue",cancel:"Cancel",cancelledOp:"Operation cancelled.",creatingBranch:(e,t)=>`Creating branch ${e} from origin/${t}...`,branchCreated:e=>`Branch ${e} created`,errorCreatingBranch:e=>`Error creating branch: ${e}`,noFilesToStage:"No files to stage.",selectFiles:"Which files do you want to include in the commit?",selectAllFiles:"Select all files",stagedFiles:"Staged files",stagedCorrect:"Are the staged files correct?",aiProvider:"Which AI do you want to use for the commit suggestion?",generatingCommit:e=>`Generating commit suggestion with ${e}...`,aiSuggestionFailed:e=>`Could not get suggestion from ${e}. Write the message manually.`,writeCommitMsg:"Write the commit message:",commitMsgRequired:"Message is required",suggestionOf:e=>`${e} suggestion`,useThisCommit:"Does this commit message look good?",yesUseIt:"Yes, use it",modify:"Modify",commitSuccess:"Commit created successfully",hookBlocked:"The pre-commit hook blocked the commit. What would you like to do?",retryHook:"I fixed it, re-stage and retry",skipHook:"Skip the hook (--no-verify)",commitNoHooks:"Commit created (without hooks)",pushToRemote:"Do you want to push the branch to the remote repository?",pushSuccess:"Push completed",pushForceQuestion:"The branch already exists on remote with different history. Force push? (git push -f)",pushForceSuccess:"Force push completed",pushForceError:e=>`Error in force push: ${e}`,pushError:e=>`Error in push: ${e}`,summaryTitle:"Summary",summaryBranch:"Branch",summaryFrom:"From",summaryCommit:"Commit",summaryFiles:e=>`${e} files committed`,summaryPush:"Push",summaryPR:"Create PR",statusModified:"modified",statusAdded:"added",statusDeleted:"deleted",statusRenamed:"renamed",statusUntracked:"untracked",commitTypes:{fix:"fix - bug fix",feat:"feat - new feature",refactor:"refactor - improvement without functional change",chore:"chore - maintenance, dependencies",docs:"docs - documentation",test:"test - testing",ci:"ci - continuous integration",perf:"perf - performance",style:"style - formatting, no logic change"},selectBranchType:"Select the branch type:",branchFix:"Fix",branchImprovement:"Improvement",branchFeature:"Feature",branchRefactor:"Refactor",creatingOriginalBranch:"Creating original branch...",branchCreatedAndPushed:e=>`Branch "${e}" created and pushed successfully!`,branchCreatedSuccess:e=>`Branch "${e}" created successfully!`,mergeBranchQuestion:"Which branch do you want to merge into?",developDEV:"develop (DEV)",releaseUAT:"release (UAT)",temporalBranchCreated:"Temporal branch created successfully",temporalBranchMerged:"Temporal branch merged successfully",conflictsDetected:"Conflicts detected. Please resolve them manually!",branchPushedToRemote:"Branch pushed to remote repository",removeTemporalBranch:"Do you want to remove the temporal branch?",temporalBranchDeleted:"Temporal branch deleted successfully",errorCreatingTemporal:"Error creating the temporal branch",enterJiraCode:"Enter the JIRA ticket code:",jiraRequired:"JIRA code is required!",jiraInvalidFormat:"JIRA code must have the format DPW-0000",fetchingRemote:"Fetching remote changes...",pullingChanges:"Pulling changes into your branch...",pullError:e=>`Error: ${e}`,pushingChanges:"Pushing changes to remote...",pushedSuccess:"Changes pushed successfully!",pushedForceSuccess:"Changes pushed (force) successfully!",pushQuickError:e=>`Error: ${e}`,provideCommitMsg:"Please provide a commit message",stagingChanges:"Staging changes...",creatingCommit:"Creating commit...",commitCreated:"Commit created successfully!",commitError:e=>`Error: ${e}`,switchingPrevBranch:"Switching to previous branch...",switchedTo:e=>`Successfully switched to ${e} branch!`,checkoutError:e=>`Error: ${e}`,fetchingLatest:"Fetching latest changes...",mergingWith:e=>`Merging with ${e}...`,pushingMerged:"Pushing merged changes...",mergeCompleted:"Merge completed successfully!",mergeError:e=>`Error: ${e}`,removingLastCommit:"Removing last commit...",removeLastConfirm:"This will remove the last commit (changes will remain in staging). Continue?",lastCommitRemoved:"Last commit removed successfully!",removeLastError:e=>`Error: ${e}`,logError:e=>`Error: ${e}`,settingUpConfig:"Setting up your configuration",configSaved:"Configuration saved",missingConfigValues:"Missing required configuration values.",errorWritingConfig:"Error writing configuration file:",currentConfig:"Current configuration",useThisConfig:"Would you like to use this configuration?",installingDeps:"Installing dependencies...",depsInstalled:"All dependencies were installed",authFailed:"Authentication failed",unexpectedError:"An unexpected error occurred",enterEndpoint:"Enter your endpoint URL:",urlRequired:"URL is required!",urlMustBeHttp:"URL must use HTTP/HTTPS protocol",urlMustHaveHost:"URL must include a hostname",urlInvalid:"Please enter a valid URL",enterApiKey:"Enter your apikey:",apiKeyRequired:"API key is required!",enterRegistryName:"Enter your NPM registry name (without special characters):",registryNameRequired:"Registry name is required!",registryNameLettersOnly:"Registry name must contain only letters",enterRegistryURL:"Enter your NPM registry URL (without http/https):",registryURLRequired:"Registry URL is required!",registryURLStartWithName:"URL must start with a name only, avoid special characters",registryURLNoProtocol:"URL must not include 'http/https' protocol and must start with a letter",registryURLNoSlash:"URL must not start with '/' and must begin with a letter or number",registryURLNoWWW:"URL must not start with 'www' and must begin with a letter or number",languageSelect:"Select the interface language:",languageChanged:e=>`Language changed to: ${e}`,configMenu:"What would you like to configure?",configLanguage:"Interface language",configDefaultBranch:"Default base branch",configAIProvider:"Default AI provider",configView:"View current configuration",defaultBranchSet:e=>`Default base branch: ${e}`,aiProviderSet:e=>`Default AI provider: ${e}`};var Ge={es:Ue,en:Be};function a(e,...t){let i=Ne().language||"es",c=(Ge[i]||Ge.es)[e];return typeof c=="function"?c(...t):c||e}function X(){if(n.step(a("fetchingRemote")),We("git",["fetch"],{stdio:"inherit"}).status!==0){n.error(a("pullError","fetch failed"));return}n.step(a("pullingChanges")),We("git",["pull","origin","HEAD"],{stdio:"inherit"}).status!==0&&n.error(a("pullError","pull failed"))}import{spawnSync as Dt}from"child_process";function Z(e){let t=e.includes("-f")||e.includes("--force")||e.includes("-force");n.step(a("pushingChanges")),Dt("git",t?["push","-f","origin","HEAD"]:["push","origin","HEAD"],{stdio:"inherit"}).status===0?n.success(t?a("pushedForceSuccess"):a("pushedSuccess")):n.error(a("pushQuickError","push failed"))}import{spawnSync as Ot}from"child_process";function ee(e){if(G(e))return Pe(a("operationCancelled")),process.exit(0)}async function te(){let e=await ke({message:a("removeLastConfirm")});if(ee(e),!e)return;n.step(a("removingLastCommit")),Ot("git",["reset","--soft","HEAD~1"],{stdio:"inherit"}).status===0?n.success(a("lastCommitRemoved")):n.error(a("removeLastError","reset failed"))}import{spawnSync as se}from"child_process";function ie(e){let t=e[0]??"develop";if(n.step(a("fetchingLatest")),se("git",["fetch"],{stdio:"inherit"}),n.step(a("mergingWith",t)),se("git",["merge",`origin/${t}`],{stdio:"inherit"}).status!==0){n.error(a("mergeError","merge failed"));return}n.step(a("pushingMerged")),se("git",["push","origin","HEAD"],{stdio:"inherit"}).status===0?n.success(a("mergeCompleted")):n.error(a("mergeError","push failed"))}import{spawnSync as je}from"child_process";function re(e){let t=e[0];t||(n.error(a("provideCommitMsg")),process.exit(1)),n.step(a("stagingChanges")),je("git",["add","."],{stdio:"inherit"}),n.step(a("creatingCommit")),je("git",["commit","-m",t],{stdio:"inherit"}).status===0?n.success(a("commitCreated")):n.error(a("commitError","commit failed"))}import{spawnSync as Vt}from"child_process";function ne(){Vt("git",["log"],{stdio:"inherit"}).status!==0&&(n.error(a("logError","git log failed")),process.exit(1))}import{spawnSync as Nt}from"child_process";function W(e){let t=e[0]||"-",s=t==="-";s&&n.step(a("switchingPrevBranch")),Nt("git",["checkout",t],{stdio:"inherit"}).status===0?n.success(a("switchedTo",s?"previous":t)):(n.error(a("checkoutError","checkout failed")),process.exit(1))}import{existsSync as Ut}from"fs";import{join as Bt}from"path";import{execSync as Gt}from"child_process";var Wt=()=>{try{Gt("git --version",{stdio:"ignore"})}catch{n.error(a("gitNotInstalled")),process.exit(1)}let e=Bt(process.cwd(),".git");Ut(e)||(n.error(a("notGitRepo")),process.exit(1))},qe=Wt;qe();var He=process.argv[1].split("/").pop(),j=process.argv.slice(2),jt={pull:X,push:()=>Z(j),removelast:te,mergewith:()=>ie(j),commit:()=>re(j),checkout:()=>W(j),back:()=>W("-"),log:ne};async function qt(){try{let e=jt[He];e||(n.error(`${a("unknownCommand")}: ${He}`),process.exit(1)),await e(),process.exit(0)}catch(e){n.error(`${a("errorExecuting")}: ${e.message}`),process.exit(1)}}qt();
27
+ `)};var Os={light:m("\u2500","-"),heavy:m("\u2501","="),block:m("\u2588","#")};var Vs=`${l("gray",_)} `;import{spawnSync as We}from"child_process";import{existsSync as Lt,readFileSync as At,writeFileSync as Gs,mkdirSync as Ws}from"fs";import kt from"os";import Ve from"path";var Pt=Ve.join(kt.homedir(),".eazy-git"),De=Ve.join(Pt,"config.json"),Oe={language:"es",defaultBaseBranch:"release",aiProvider:"claude"};function Ne(){try{if(Lt(De)){let e=At(De,"utf-8");return{...Oe,...JSON.parse(e)}}}catch{}return{...Oe}}var Ue={welcome:"Bienvenido a",subtitle:"tu CLI de confianza para gestionar ramas en GIT",operationCompleted:"Operacion completada!",operationCancelled:"Operacion cancelada. Saliendo...",unknownCommand:"Comando desconocido",errorExecuting:"Error al ejecutar el comando",version:"eazy-git version",whatToDo:"Que deseas hacer?",addChanges:"Agregar cambios a una rama",createOriginal:"Crear rama original",createTemporal:"Crear rama temporal",notGitRepo:"Este directorio no es un repositorio git",gitNotInstalled:"git no esta instalado en el sistema",currentBranch:"Branch actual",filesChanged:"Archivos con cambios",noChangesPending:"No hay cambios pendientes. Deseas continuar de todas formas?",updatingRefs:"Actualizando referencias remotas...",refsUpdated:"Referencias actualizadas",fetchFailed:"No se pudo hacer fetch (continuando...)",baseBranch:"Desde que branch base quieres crear la rama?",baseBranchRequired:"El branch base es requerido",ticketId:"Cual es el identificador del ticket? (ej: DPW-0000)",ticketRequired:"El ticket es requerido",changeType:"Que tipo de cambio es?",branchExistsLocal:e=>`La rama "${e}" ya existe localmente. Que deseas hacer?`,switchToIt:"Cambiarme a ella y continuar",cancel:"Cancelar",cancelledOp:"Operacion cancelada.",creatingBranch:(e,t)=>`Creando rama ${e} desde origin/${t}...`,branchCreated:e=>`Rama ${e} creada`,errorCreatingBranch:e=>`Error al crear la rama: ${e}`,noFilesToStage:"No hay archivos para stagear.",selectFiles:"Cuales archivos quieres incluir en el commit?",selectAllFiles:"Seleccionar todos los archivos",stagedFiles:"Archivos en stage",stagedCorrect:"Los archivos en stage son correctos?",aiProvider:"Con que IA quieres generar la sugerencia de commit?",generatingCommit:e=>`Generando sugerencia de commit con ${e}...`,aiSuggestionFailed:e=>`No se pudo obtener sugerencia de ${e}. Escribe el mensaje manualmente.`,writeCommitMsg:"Escribe el mensaje de commit:",commitMsgRequired:"El mensaje es requerido",suggestionOf:e=>`Sugerencia de ${e}`,useThisCommit:"Este mensaje de commit te parece bien?",yesUseIt:"Si, usar este",modify:"Modificar",commitSuccess:"Commit realizado correctamente",hookBlocked:"El pre-commit hook bloqueo el commit. Que deseas hacer?",retryHook:"Ya lo corregi, agrega los cambios y vuelve a intentarlo",skipHook:"Saltar el hook (--no-verify)",commitNoHooks:"Commit realizado (sin hooks)",pushToRemote:"Deseas subir la rama al repositorio remoto?",pushSuccess:"Push realizado",pushForceQuestion:"La rama ya existe en el remoto con historial diferente. Deseas forzar el push? (git push -f)",pushForceSuccess:"Push forzado realizado",pushForceError:e=>`Error en el push forzado: ${e}`,pushError:e=>`Error en el push: ${e}`,summaryTitle:"Resumen",summaryBranch:"Rama",summaryFrom:"Desde",summaryCommit:"Commit",summaryFiles:e=>`${e} archivos commiteados`,summaryPush:"Push",summaryPR:"Crear PR",statusModified:"modificado",statusAdded:"agregado",statusDeleted:"eliminado",statusRenamed:"renombrado",statusUntracked:"sin rastrear",commitTypes:{fix:"fix \u2014 correccion de bug",feat:"feat \u2014 nueva funcionalidad",refactor:"refactor \u2014 mejora sin cambio funcional",chore:"chore \u2014 mantenimiento, dependencias",docs:"docs \u2014 documentacion",test:"test \u2014 pruebas",ci:"ci \u2014 integracion continua",perf:"perf \u2014 rendimiento",style:"style \u2014 formato, sin cambio de logica"},selectBranchType:"Selecciona el tipo de rama:",branchFix:"Fix",branchImprovement:"Mejora",branchFeature:"Feature",branchRefactor:"Refactor",creatingOriginalBranch:"Creando rama original...",branchCreatedAndPushed:e=>`Rama "${e}" creada y pusheada correctamente!`,branchCreatedSuccess:e=>`Rama "${e}" creada correctamente!`,mergeBranchQuestion:"A que rama deseas hacer merge?",developDEV:"develop (DEV)",releaseUAT:"release (UAT)",temporalBranchCreated:"Rama temporal creada correctamente",temporalBranchMerged:"Rama temporal mergeada correctamente",conflictsDetected:"Conflictos detectados. Resolvelos manualmente!",branchPushedToRemote:"Rama pusheada al repositorio remoto",removeTemporalBranch:"Deseas eliminar la rama temporal?",temporalBranchDeleted:"Rama temporal eliminada correctamente",errorCreatingTemporal:"Error creando la rama temporal",enterJiraCode:"Ingresa el codigo del ticket JIRA:",jiraRequired:"El codigo JIRA es requerido!",jiraInvalidFormat:"El codigo JIRA debe tener el formato DPW-0000",fetchingRemote:"Obteniendo cambios remotos...",pullingChanges:"Aplicando cambios en tu rama...",pullError:e=>`Error: ${e}`,pushingChanges:"Subiendo cambios al remoto...",pushedSuccess:"Cambios subidos correctamente!",pushedForceSuccess:"Cambios subidos (forzado) correctamente!",pushQuickError:e=>`Error: ${e}`,provideCommitMsg:"Proporciona un mensaje de commit",stagingChanges:"Stageando cambios...",creatingCommit:"Creando commit...",commitCreated:"Commit creado correctamente!",commitError:e=>`Error: ${e}`,switchingPrevBranch:"Cambiando a la rama anterior...",switchedTo:e=>`Cambiado a rama ${e} correctamente!`,checkoutError:e=>`Error: ${e}`,fetchingLatest:"Obteniendo ultimos cambios...",mergingWith:e=>`Mergeando con ${e}...`,pushingMerged:"Subiendo cambios mergeados...",mergeCompleted:"Merge completado correctamente!",mergeError:e=>`Error: ${e}`,removingLastCommit:"Eliminando ultimo commit...",removeLastConfirm:"Esto eliminara el ultimo commit (los cambios se mantienen en staging). Continuar?",lastCommitRemoved:"Ultimo commit eliminado correctamente!",removeLastError:e=>`Error: ${e}`,logError:e=>`Error: ${e}`,settingUpConfig:"Configurando tu entorno",configSaved:"Configuracion guardada",missingConfigValues:"Faltan valores de configuracion requeridos.",errorWritingConfig:"Error escribiendo archivo de configuracion:",currentConfig:"Configuracion actual",useThisConfig:"Deseas usar esta configuracion?",installingDeps:"Instalando dependencias...",depsInstalled:"Todas las dependencias fueron instaladas",authFailed:"Autenticacion fallida",unexpectedError:"Ocurrio un error inesperado",enterEndpoint:"Ingresa la URL del endpoint:",urlRequired:"La URL es requerida!",urlMustBeHttp:"La URL debe usar protocolo HTTP/HTTPS",urlMustHaveHost:"La URL debe incluir un hostname",urlInvalid:"Ingresa una URL valida",enterApiKey:"Ingresa tu apikey:",apiKeyRequired:"El API key es requerido!",enterRegistryName:"Ingresa el nombre del registro NPM (sin caracteres especiales):",registryNameRequired:"El nombre del registro es requerido!",registryNameLettersOnly:"El nombre del registro debe contener solo letras",enterRegistryURL:"Ingresa la URL del registro NPM (sin http/https):",registryURLRequired:"La URL del registro es requerida!",registryURLStartWithName:"La URL debe empezar con un nombre, evita caracteres especiales",registryURLNoProtocol:"La URL no debe incluir protocolo 'http/https' y debe empezar con una letra",registryURLNoSlash:"La URL no debe empezar con '/' y debe empezar con una letra o numero",registryURLNoWWW:"La URL no debe empezar con 'www' y debe empezar con una letra o numero",languageSelect:"Selecciona el idioma de la interfaz:",languageChanged:e=>`Idioma cambiado a: ${e}`,configMenu:"Que deseas configurar?",configLanguage:"Cambiar idioma",configDefaultBranch:"Rama base por defecto",configAIProvider:"Proveedor de IA por defecto",configView:"Ver configuracion actual",defaultBranchSet:e=>`Rama base por defecto: ${e}`,aiProviderSet:e=>`Proveedor de IA por defecto: ${e}`,goBack:"Volver"};var Be={welcome:"Welcome to",subtitle:"your trusted CLI for GIT branch management",operationCompleted:"Operation completed!",operationCancelled:"Operation cancelled. Exiting...",unknownCommand:"Unknown command",errorExecuting:"Error executing command",version:"eazy-git version",whatToDo:"What would you like to do?",addChanges:"Add Changes to Branch",createOriginal:"Create Original Branch",createTemporal:"Create Temporal Branch",notGitRepo:"This directory is not a git repository",gitNotInstalled:"git is not installed on the system",currentBranch:"Current branch",filesChanged:"Files with changes",noChangesPending:"No pending changes. Do you want to continue anyway?",updatingRefs:"Updating remote references...",refsUpdated:"References updated",fetchFailed:"Could not fetch (continuing...)",baseBranch:"From which base branch do you want to create the branch?",baseBranchRequired:"Base branch is required",ticketId:"What is the ticket identifier? (e.g.: DPW-0000)",ticketRequired:"Ticket is required",changeType:"What type of change is this?",branchExistsLocal:e=>`Branch "${e}" already exists locally. What would you like to do?`,switchToIt:"Switch to it and continue",cancel:"Cancel",cancelledOp:"Operation cancelled.",creatingBranch:(e,t)=>`Creating branch ${e} from origin/${t}...`,branchCreated:e=>`Branch ${e} created`,errorCreatingBranch:e=>`Error creating branch: ${e}`,noFilesToStage:"No files to stage.",selectFiles:"Which files do you want to include in the commit?",selectAllFiles:"Select all files",stagedFiles:"Staged files",stagedCorrect:"Are the staged files correct?",aiProvider:"Which AI do you want to use for the commit suggestion?",generatingCommit:e=>`Generating commit suggestion with ${e}...`,aiSuggestionFailed:e=>`Could not get suggestion from ${e}. Write the message manually.`,writeCommitMsg:"Write the commit message:",commitMsgRequired:"Message is required",suggestionOf:e=>`${e} suggestion`,useThisCommit:"Does this commit message look good?",yesUseIt:"Yes, use it",modify:"Modify",commitSuccess:"Commit created successfully",hookBlocked:"The pre-commit hook blocked the commit. What would you like to do?",retryHook:"I fixed it, re-stage and retry",skipHook:"Skip the hook (--no-verify)",commitNoHooks:"Commit created (without hooks)",pushToRemote:"Do you want to push the branch to the remote repository?",pushSuccess:"Push completed",pushForceQuestion:"The branch already exists on remote with different history. Force push? (git push -f)",pushForceSuccess:"Force push completed",pushForceError:e=>`Error in force push: ${e}`,pushError:e=>`Error in push: ${e}`,summaryTitle:"Summary",summaryBranch:"Branch",summaryFrom:"From",summaryCommit:"Commit",summaryFiles:e=>`${e} files committed`,summaryPush:"Push",summaryPR:"Create PR",statusModified:"modified",statusAdded:"added",statusDeleted:"deleted",statusRenamed:"renamed",statusUntracked:"untracked",commitTypes:{fix:"fix - bug fix",feat:"feat - new feature",refactor:"refactor - improvement without functional change",chore:"chore - maintenance, dependencies",docs:"docs - documentation",test:"test - testing",ci:"ci - continuous integration",perf:"perf - performance",style:"style - formatting, no logic change"},selectBranchType:"Select the branch type:",branchFix:"Fix",branchImprovement:"Improvement",branchFeature:"Feature",branchRefactor:"Refactor",creatingOriginalBranch:"Creating original branch...",branchCreatedAndPushed:e=>`Branch "${e}" created and pushed successfully!`,branchCreatedSuccess:e=>`Branch "${e}" created successfully!`,mergeBranchQuestion:"Which branch do you want to merge into?",developDEV:"develop (DEV)",releaseUAT:"release (UAT)",temporalBranchCreated:"Temporal branch created successfully",temporalBranchMerged:"Temporal branch merged successfully",conflictsDetected:"Conflicts detected. Please resolve them manually!",branchPushedToRemote:"Branch pushed to remote repository",removeTemporalBranch:"Do you want to remove the temporal branch?",temporalBranchDeleted:"Temporal branch deleted successfully",errorCreatingTemporal:"Error creating the temporal branch",enterJiraCode:"Enter the JIRA ticket code:",jiraRequired:"JIRA code is required!",jiraInvalidFormat:"JIRA code must have the format DPW-0000",fetchingRemote:"Fetching remote changes...",pullingChanges:"Pulling changes into your branch...",pullError:e=>`Error: ${e}`,pushingChanges:"Pushing changes to remote...",pushedSuccess:"Changes pushed successfully!",pushedForceSuccess:"Changes pushed (force) successfully!",pushQuickError:e=>`Error: ${e}`,provideCommitMsg:"Please provide a commit message",stagingChanges:"Staging changes...",creatingCommit:"Creating commit...",commitCreated:"Commit created successfully!",commitError:e=>`Error: ${e}`,switchingPrevBranch:"Switching to previous branch...",switchedTo:e=>`Successfully switched to ${e} branch!`,checkoutError:e=>`Error: ${e}`,fetchingLatest:"Fetching latest changes...",mergingWith:e=>`Merging with ${e}...`,pushingMerged:"Pushing merged changes...",mergeCompleted:"Merge completed successfully!",mergeError:e=>`Error: ${e}`,removingLastCommit:"Removing last commit...",removeLastConfirm:"This will remove the last commit (changes will remain in staging). Continue?",lastCommitRemoved:"Last commit removed successfully!",removeLastError:e=>`Error: ${e}`,logError:e=>`Error: ${e}`,settingUpConfig:"Setting up your configuration",configSaved:"Configuration saved",missingConfigValues:"Missing required configuration values.",errorWritingConfig:"Error writing configuration file:",currentConfig:"Current configuration",useThisConfig:"Would you like to use this configuration?",installingDeps:"Installing dependencies...",depsInstalled:"All dependencies were installed",authFailed:"Authentication failed",unexpectedError:"An unexpected error occurred",enterEndpoint:"Enter your endpoint URL:",urlRequired:"URL is required!",urlMustBeHttp:"URL must use HTTP/HTTPS protocol",urlMustHaveHost:"URL must include a hostname",urlInvalid:"Please enter a valid URL",enterApiKey:"Enter your apikey:",apiKeyRequired:"API key is required!",enterRegistryName:"Enter your NPM registry name (without special characters):",registryNameRequired:"Registry name is required!",registryNameLettersOnly:"Registry name must contain only letters",enterRegistryURL:"Enter your NPM registry URL (without http/https):",registryURLRequired:"Registry URL is required!",registryURLStartWithName:"URL must start with a name only, avoid special characters",registryURLNoProtocol:"URL must not include 'http/https' protocol and must start with a letter",registryURLNoSlash:"URL must not start with '/' and must begin with a letter or number",registryURLNoWWW:"URL must not start with 'www' and must begin with a letter or number",languageSelect:"Select the interface language:",languageChanged:e=>`Language changed to: ${e}`,configMenu:"What would you like to configure?",configLanguage:"Change language",configDefaultBranch:"Default base branch",configAIProvider:"Default AI provider",configView:"View current configuration",defaultBranchSet:e=>`Default base branch: ${e}`,aiProviderSet:e=>`Default AI provider: ${e}`,goBack:"Go back"};var Ge={es:Ue,en:Be};function a(e,...t){let i=Ne().language||"es",c=(Ge[i]||Ge.es)[e];return typeof c=="function"?c(...t):c||e}function X(){if(n.step(a("fetchingRemote")),We("git",["fetch"],{stdio:"inherit"}).status!==0){n.error(a("pullError","fetch failed"));return}n.step(a("pullingChanges")),We("git",["pull","origin","HEAD"],{stdio:"inherit"}).status!==0&&n.error(a("pullError","pull failed"))}import{spawnSync as Dt}from"child_process";function Z(e){let t=e.includes("-f")||e.includes("--force")||e.includes("-force");n.step(a("pushingChanges")),Dt("git",t?["push","-f","origin","HEAD"]:["push","origin","HEAD"],{stdio:"inherit"}).status===0?n.success(t?a("pushedForceSuccess"):a("pushedSuccess")):n.error(a("pushQuickError","push failed"))}import{spawnSync as Ot}from"child_process";function ee(e){if(G(e))return Pe(a("operationCancelled")),process.exit(0)}async function te(){let e=await ke({message:a("removeLastConfirm")});if(ee(e),!e)return;n.step(a("removingLastCommit")),Ot("git",["reset","--soft","HEAD~1"],{stdio:"inherit"}).status===0?n.success(a("lastCommitRemoved")):n.error(a("removeLastError","reset failed"))}import{spawnSync as se}from"child_process";function ie(e){let t=e[0]??"develop";if(n.step(a("fetchingLatest")),se("git",["fetch"],{stdio:"inherit"}),n.step(a("mergingWith",t)),se("git",["merge",`origin/${t}`],{stdio:"inherit"}).status!==0){n.error(a("mergeError","merge failed"));return}n.step(a("pushingMerged")),se("git",["push","origin","HEAD"],{stdio:"inherit"}).status===0?n.success(a("mergeCompleted")):n.error(a("mergeError","push failed"))}import{spawnSync as je}from"child_process";function re(e){let t=e[0];t||(n.error(a("provideCommitMsg")),process.exit(1)),n.step(a("stagingChanges")),je("git",["add","."],{stdio:"inherit"}),n.step(a("creatingCommit")),je("git",["commit","-m",t],{stdio:"inherit"}).status===0?n.success(a("commitCreated")):n.error(a("commitError","commit failed"))}import{spawnSync as Vt}from"child_process";function ne(){Vt("git",["log"],{stdio:"inherit"}).status!==0&&(n.error(a("logError","git log failed")),process.exit(1))}import{spawnSync as Nt}from"child_process";function W(e){let t=e[0]||"-",s=t==="-";s&&n.step(a("switchingPrevBranch")),Nt("git",["checkout",t],{stdio:"inherit"}).status===0?n.success(a("switchedTo",s?"previous":t)):(n.error(a("checkoutError","checkout failed")),process.exit(1))}import{existsSync as Ut}from"fs";import{join as Bt}from"path";import{execSync as Gt}from"child_process";var Wt=()=>{try{Gt("git --version",{stdio:"ignore"})}catch{n.error(a("gitNotInstalled")),process.exit(1)}let e=Bt(process.cwd(),".git");Ut(e)||(n.error(a("notGitRepo")),process.exit(1))},qe=Wt;qe();var He=process.argv[1].split("/").pop(),j=process.argv.slice(2),jt={pull:X,push:()=>Z(j),removelast:te,mergewith:()=>ie(j),commit:()=>re(j),checkout:()=>W(j),back:()=>W("-"),log:ne};async function qt(){try{let e=jt[He];e||(n.error(`${a("unknownCommand")}: ${He}`),process.exit(1)),await e(),process.exit(0)}catch(e){n.error(`${a("errorExecuting")}: ${e.message}`),process.exit(1)}}qt();
package/dist/index.js CHANGED
@@ -1,46 +1,46 @@
1
1
  #!/usr/bin/env node
2
- var dr=Object.create;var nt=Object.defineProperty;var mr=Object.getOwnPropertyDescriptor;var pr=Object.getOwnPropertyNames;var gr=Object.getPrototypeOf,fr=Object.prototype.hasOwnProperty;var we=(e,t)=>()=>(e&&(t=e(e=0)),t);var $r=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),yr=(e,t)=>{for(var s in t)nt(e,s,{get:t[s],enumerable:!0})},vr=(e,t,s,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of pr(t))!fr.call(e,i)&&i!==s&&nt(e,i,{get:()=>t[i],enumerable:!(r=mr(t,i))||r.enumerable});return e};var Wt=(e,t,s)=>(s=e!=null?dr(gr(e)):{},vr(t||!e||!e.__esModule?nt(s,"default",{value:e,enumerable:!0}):s,e));var qt,Ht,Kt,zt=we(()=>{qt=(()=>{let e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return t=>{let s=0;for(e.lastIndex=0;e.test(t);)s+=1;return t.length-s}})(),Ht=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,Kt=e=>e===8987||e===9001||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141});var br,wr,Jt,Cr,Yt,Ir,Sr,Er,Qt,Xt,Zt=we(()=>{zt();br=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,wr=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Jt=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,Cr=/\t{1,1000}/y,Yt=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,Ir=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Sr=/\p{M}+/gu,Er={limit:1/0,ellipsis:""},Qt=(e,t={},s={})=>{let r=t.limit??1/0,i=t.ellipsis??"",o=t?.ellipsisWidth??(i?Qt(i,Er,s).width:0),a=0,l=s.controlWidth??0,c=s.tabWidth??8,u=s.emojiWidth??2,d=2,g=s.regularWidth??1,p=s.wideWidth??d,y=[[Ir,g],[br,a],[wr,l],[Cr,c],[Yt,u],[Jt,p]],m=0,b=0,$=e.length,v=0,C=!1,T=$,R=Math.max(0,r-o),x=0,L=0,M=0,k=0;e:for(;;){if(L>x||b>=$&&b>m){let N=e.slice(x,L)||e.slice(m,b);v=0;for(let W of N.replaceAll(Sr,"")){let w=W.codePointAt(0)||0;if(Ht(w)?k=d:Kt(w)?k=p:k=g,M+k>R&&(T=Math.min(T,Math.max(x,m)+v)),M+k>r){C=!0;break e}v+=W.length,M+=k}x=L=0}if(b>=$)break e;for(let N=0,W=y.length;N<W;N++){let[w,O]=y[N];if(w.lastIndex=b,w.test(e)){if(v=w===Jt?qt(e.slice(b,w.lastIndex)):w===Yt?1:w.lastIndex-b,k=v*O,M+k>R&&(T=Math.min(T,b+Math.floor((R-M)/O))),M+k>r){C=!0;break e}M+=k,x=m,L=b,b=m=w.lastIndex;continue e}}b+=1}return{width:C?R:M,index:C?T:$,truncated:C,ellipsed:C&&r>=o}},Xt=Qt});var xr,Tr,j,ot=we(()=>{Zt();xr={limit:1/0,ellipsis:"",ellipsisWidth:0},Tr=(e,t={})=>Xt(e,xr,t).width,j=Tr});function se(e,t,s){return String(e).normalize().split(Mr).map(r=>Fr(r,t,s)).join(`
3
- `)}var ke,is,Rr,ct,ns,_r,os,lt,es,ts,ss,rs,at,Ar,Fr,Mr,ut=we(()=>{ot();ke="\x1B",is="\x9B",Rr=39,ct="\x07",ns="[",_r="]",os="m",lt=`${_r}8;;`,es=new RegExp(`(?:\\${ns}(?<code>\\d+)m|\\${lt}(?<uri>.*)${ct})`,"y"),ts=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},ss=e=>`${ke}${ns}${e}${os}`,rs=e=>`${ke}${lt}${e}${ct}`,at=(e,t,s)=>{let r=t[Symbol.iterator](),i=!1,o=!1,a=e.at(-1),l=a===void 0?0:j(a),c=r.next(),u=r.next(),d=0;for(;!c.done;){let g=c.value,p=j(g);l+p<=s?e[e.length-1]+=g:(e.push(g),l=0),(g===ke||g===is)&&(i=!0,o=t.startsWith(lt,d+1)),i?o?g===ct&&(i=!1,o=!1):g===os&&(i=!1):(l+=p,l===s&&!u.done&&(e.push(""),l=0)),c=u,u=r.next(),d+=g.length}a=e.at(-1),!l&&a!==void 0&&a.length&&e.length>1&&(e[e.length-2]+=e.pop())},Ar=e=>{let t=e.split(" "),s=t.length;for(;s&&!j(t[s-1]);)s--;return s===t.length?e:t.slice(0,s).join(" ")+t.slice(s).join("")},Fr=(e,t,s={})=>{if(s.trim!==!1&&e.trim()==="")return"";let r="",i,o,a=e.split(" "),l=[""],c=0;for(let g=0;g<a.length;g++){let p=a[g];if(s.trim!==!1){let m=l.at(-1)??"",b=m.trimStart();m.length!==b.length&&(l[l.length-1]=b,c=j(b))}g!==0&&(c>=t&&(s.wordWrap===!1||s.trim===!1)&&(l.push(""),c=0),(c||s.trim===!1)&&(l[l.length-1]+=" ",c++));let y=j(p);if(s.hard&&y>t){let m=t-c,b=1+Math.floor((y-m-1)/t);Math.floor((y-1)/t)<b&&l.push(""),at(l,p,t),c=j(l.at(-1)??"");continue}if(c+y>t&&c&&y){if(s.wordWrap===!1&&c<t){at(l,p,t),c=j(l.at(-1)??"");continue}l.push(""),c=0}if(c+y>t&&s.wordWrap===!1){at(l,p,t),c=j(l.at(-1)??"");continue}l[l.length-1]+=p,c+=y}s.trim!==!1&&(l=l.map(g=>Ar(g)));let u=l.join(`
4
- `),d=!1;for(let g=0;g<u.length;g++){let p=u[g];if(r+=p,d)d=!1;else if(d=p>="\uD800"&&p<="\uDBFF",d)continue;if(p===ke||p===is){es.lastIndex=g+1;let m=es.exec(u)?.groups;if(m?.code!==void 0){let b=Number.parseFloat(m.code);i=b===Rr?void 0:b}else m?.uri!==void 0&&(o=m.uri.length===0?void 0:m.uri)}if(u[g+1]===`
2
+ var dr=Object.create;var nt=Object.defineProperty;var mr=Object.getOwnPropertyDescriptor;var pr=Object.getOwnPropertyNames;var gr=Object.getPrototypeOf,fr=Object.prototype.hasOwnProperty;var Ie=(e,t)=>()=>(e&&(t=e(e=0)),t);var $r=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),yr=(e,t)=>{for(var s in t)nt(e,s,{get:t[s],enumerable:!0})},vr=(e,t,s,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of pr(t))!fr.call(e,i)&&i!==s&&nt(e,i,{get:()=>t[i],enumerable:!(r=mr(t,i))||r.enumerable});return e};var Wt=(e,t,s)=>(s=e!=null?dr(gr(e)):{},vr(t||!e||!e.__esModule?nt(s,"default",{value:e,enumerable:!0}):s,e));var qt,Ht,Kt,zt=Ie(()=>{qt=(()=>{let e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return t=>{let s=0;for(e.lastIndex=0;e.test(t);)s+=1;return t.length-s}})(),Ht=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,Kt=e=>e===8987||e===9001||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141});var br,wr,Jt,Cr,Yt,Ir,Sr,Er,Qt,Xt,Zt=Ie(()=>{zt();br=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,wr=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Jt=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,Cr=/\t{1,1000}/y,Yt=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,Ir=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Sr=/\p{M}+/gu,Er={limit:1/0,ellipsis:""},Qt=(e,t={},s={})=>{let r=t.limit??1/0,i=t.ellipsis??"",o=t?.ellipsisWidth??(i?Qt(i,Er,s).width:0),a=0,l=s.controlWidth??0,c=s.tabWidth??8,u=s.emojiWidth??2,d=2,g=s.regularWidth??1,p=s.wideWidth??d,y=[[Ir,g],[br,a],[wr,l],[Cr,c],[Yt,u],[Jt,p]],m=0,b=0,$=e.length,v=0,C=!1,R=$,T=Math.max(0,r-o),x=0,L=0,M=0,B=0;e:for(;;){if(L>x||b>=$&&b>m){let N=e.slice(x,L)||e.slice(m,b);v=0;for(let W of N.replaceAll(Sr,"")){let w=W.codePointAt(0)||0;if(Ht(w)?B=d:Kt(w)?B=p:B=g,M+B>T&&(R=Math.min(R,Math.max(x,m)+v)),M+B>r){C=!0;break e}v+=W.length,M+=B}x=L=0}if(b>=$)break e;for(let N=0,W=y.length;N<W;N++){let[w,O]=y[N];if(w.lastIndex=b,w.test(e)){if(v=w===Jt?qt(e.slice(b,w.lastIndex)):w===Yt?1:w.lastIndex-b,B=v*O,M+B>T&&(R=Math.min(R,b+Math.floor((T-M)/O))),M+B>r){C=!0;break e}M+=B,x=m,L=b,b=m=w.lastIndex;continue e}}b+=1}return{width:C?T:M,index:C?R:$,truncated:C,ellipsed:C&&r>=o}},Xt=Qt});var xr,Rr,j,ot=Ie(()=>{Zt();xr={limit:1/0,ellipsis:"",ellipsisWidth:0},Rr=(e,t={})=>Xt(e,xr,t).width,j=Rr});function se(e,t,s){return String(e).normalize().split(Mr).map(r=>Fr(r,t,s)).join(`
3
+ `)}var Pe,is,Tr,ct,ns,_r,os,lt,es,ts,ss,rs,at,Ar,Fr,Mr,ut=Ie(()=>{ot();Pe="\x1B",is="\x9B",Tr=39,ct="\x07",ns="[",_r="]",os="m",lt=`${_r}8;;`,es=new RegExp(`(?:\\${ns}(?<code>\\d+)m|\\${lt}(?<uri>.*)${ct})`,"y"),ts=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},ss=e=>`${Pe}${ns}${e}${os}`,rs=e=>`${Pe}${lt}${e}${ct}`,at=(e,t,s)=>{let r=t[Symbol.iterator](),i=!1,o=!1,a=e.at(-1),l=a===void 0?0:j(a),c=r.next(),u=r.next(),d=0;for(;!c.done;){let g=c.value,p=j(g);l+p<=s?e[e.length-1]+=g:(e.push(g),l=0),(g===Pe||g===is)&&(i=!0,o=t.startsWith(lt,d+1)),i?o?g===ct&&(i=!1,o=!1):g===os&&(i=!1):(l+=p,l===s&&!u.done&&(e.push(""),l=0)),c=u,u=r.next(),d+=g.length}a=e.at(-1),!l&&a!==void 0&&a.length&&e.length>1&&(e[e.length-2]+=e.pop())},Ar=e=>{let t=e.split(" "),s=t.length;for(;s&&!j(t[s-1]);)s--;return s===t.length?e:t.slice(0,s).join(" ")+t.slice(s).join("")},Fr=(e,t,s={})=>{if(s.trim!==!1&&e.trim()==="")return"";let r="",i,o,a=e.split(" "),l=[""],c=0;for(let g=0;g<a.length;g++){let p=a[g];if(s.trim!==!1){let m=l.at(-1)??"",b=m.trimStart();m.length!==b.length&&(l[l.length-1]=b,c=j(b))}g!==0&&(c>=t&&(s.wordWrap===!1||s.trim===!1)&&(l.push(""),c=0),(c||s.trim===!1)&&(l[l.length-1]+=" ",c++));let y=j(p);if(s.hard&&y>t){let m=t-c,b=1+Math.floor((y-m-1)/t);Math.floor((y-1)/t)<b&&l.push(""),at(l,p,t),c=j(l.at(-1)??"");continue}if(c+y>t&&c&&y){if(s.wordWrap===!1&&c<t){at(l,p,t),c=j(l.at(-1)??"");continue}l.push(""),c=0}if(c+y>t&&s.wordWrap===!1){at(l,p,t),c=j(l.at(-1)??"");continue}l[l.length-1]+=p,c+=y}s.trim!==!1&&(l=l.map(g=>Ar(g)));let u=l.join(`
4
+ `),d=!1;for(let g=0;g<u.length;g++){let p=u[g];if(r+=p,d)d=!1;else if(d=p>="\uD800"&&p<="\uDBFF",d)continue;if(p===Pe||p===is){es.lastIndex=g+1;let m=es.exec(u)?.groups;if(m?.code!==void 0){let b=Number.parseFloat(m.code);i=b===Tr?void 0:b}else m?.uri!==void 0&&(o=m.uri.length===0?void 0:m.uri)}if(u[g+1]===`
5
5
  `){o&&(r+=rs(""));let y=i?ts(i):void 0;i&&y&&(r+=ss(y))}else p===`
6
- `&&(i&&ts(i)&&(r+=ss(i)),o&&(r+=rs(o)))}return r},Mr=/\r?\n/});var mt=$r((pn,as)=>{"use strict";var ht="\x1B",D=`${ht}[`,Or="\x07",dt={to(e,t){return t?`${D}${t+1};${e+1}H`:`${D}${e+1}G`},move(e,t){let s="";return e<0?s+=`${D}${-e}D`:e>0&&(s+=`${D}${e}C`),t<0?s+=`${D}${-t}A`:t>0&&(s+=`${D}${t}B`),s},up:(e=1)=>`${D}${e}A`,down:(e=1)=>`${D}${e}B`,forward:(e=1)=>`${D}${e}C`,backward:(e=1)=>`${D}${e}D`,nextLine:(e=1)=>`${D}E`.repeat(e),prevLine:(e=1)=>`${D}F`.repeat(e),left:`${D}G`,hide:`${D}?25l`,show:`${D}?25h`,save:`${ht}7`,restore:`${ht}8`},Br={up:(e=1)=>`${D}S`.repeat(e),down:(e=1)=>`${D}T`.repeat(e)},kr={screen:`${D}2J`,up:(e=1)=>`${D}1J`.repeat(e),down:(e=1)=>`${D}J`.repeat(e),line:`${D}2K`,lineEnd:`${D}K`,lineStart:`${D}1K`,lines(e){let t="";for(let s=0;s<e;s++)t+=this.line+(s<e-1?dt.up():"");return e&&(t+=dt.left),t}};as.exports={cursor:dt,scroll:Br,erase:kr,beep:Or}});import{styleText as Ce}from"node:util";import{stdout as $t,stdin as hs}from"node:process";import*as ae from"node:readline";import Lr from"node:readline";import{ReadStream as cs}from"node:tty";function oe(e,t,s){if(!s.some(a=>!a.disabled))return e;let r=e+t,i=Math.max(s.length-1,0),o=r<0?i:r>i?0:r;return s[o].disabled?oe(o,t<0?-1:1,s):o}function Le(e,t,s,r){let i=r.split(`
6
+ `&&(i&&ts(i)&&(r+=ss(i)),o&&(r+=rs(o)))}return r},Mr=/\r?\n/});var mt=$r((pn,as)=>{"use strict";var ht="\x1B",D=`${ht}[`,Or="\x07",dt={to(e,t){return t?`${D}${t+1};${e+1}H`:`${D}${e+1}G`},move(e,t){let s="";return e<0?s+=`${D}${-e}D`:e>0&&(s+=`${D}${e}C`),t<0?s+=`${D}${-t}A`:t>0&&(s+=`${D}${t}B`),s},up:(e=1)=>`${D}${e}A`,down:(e=1)=>`${D}${e}B`,forward:(e=1)=>`${D}${e}C`,backward:(e=1)=>`${D}${e}D`,nextLine:(e=1)=>`${D}E`.repeat(e),prevLine:(e=1)=>`${D}F`.repeat(e),left:`${D}G`,hide:`${D}?25l`,show:`${D}?25h`,save:`${ht}7`,restore:`${ht}8`},kr={up:(e=1)=>`${D}S`.repeat(e),down:(e=1)=>`${D}T`.repeat(e)},Br={screen:`${D}2J`,up:(e=1)=>`${D}1J`.repeat(e),down:(e=1)=>`${D}J`.repeat(e),line:`${D}2K`,lineEnd:`${D}K`,lineStart:`${D}1K`,lines(e){let t="";for(let s=0;s<e;s++)t+=this.line+(s<e-1?dt.up():"");return e&&(t+=dt.left),t}};as.exports={cursor:dt,scroll:kr,erase:Br,beep:Or}});import{styleText as Se}from"node:util";import{stdout as $t,stdin as hs}from"node:process";import*as ae from"node:readline";import Lr from"node:readline";import{ReadStream as cs}from"node:tty";function oe(e,t,s){if(!s.some(a=>!a.disabled))return e;let r=e+t,i=Math.max(s.length-1,0),o=r<0?i:r>i?0:r;return s[o].disabled?oe(o,t<0?-1:1,s):o}function Ne(e,t,s,r){let i=r.split(`
7
7
  `),o=0,a=e;for(let c of i){if(a<=c.length)break;a-=c.length+1,o++}for(o=Math.max(0,Math.min(i.length-1,o+s)),a=Math.min(a,i[o].length)+t;a<0&&o>0;)o--,a+=i[o].length+1;for(;a>i[o].length&&o<i.length-1;)a-=i[o].length+1,o++;a=Math.max(0,Math.min(i[o].length,a));let l=0;for(let c=0;c<o;c++)l+=i[c].length+1;return l+a}function ds(e){if(e.aliases!==void 0){let t=e.aliases;for(let s in t){if(!Object.hasOwn(t,s))continue;let r=t[s];I.actions.has(r)&&(I.aliases.has(s)||I.aliases.set(s,r))}}if(e.messages!==void 0){let t=e.messages;t.cancel!==void 0&&(I.messages.cancel=t.cancel),t.error!==void 0&&(I.messages.error=t.error)}if(e.withGuide!==void 0&&(I.withGuide=e.withGuide!==!1),e.date!==void 0){let t=e.date;t.monthNames!==void 0&&(I.date.monthNames=[...t.monthNames]),t.messages!==void 0&&(t.messages.required!==void 0&&(I.date.messages.required=t.messages.required),t.messages.invalidMonth!==void 0&&(I.date.messages.invalidMonth=t.messages.invalidMonth),t.messages.invalidDay!==void 0&&(I.date.messages.invalidDay=t.messages.invalidDay),t.messages.afterMin!==void 0&&(I.date.messages.afterMin=t.messages.afterMin),t.messages.beforeMax!==void 0&&(I.date.messages.beforeMax=t.messages.beforeMax))}}function yt(e,t){if(typeof e=="string")return I.aliases.get(e)===t;for(let s of e)if(s!==void 0&&yt(s,t))return!0;return!1}function Dr(e,t){if(e===t)return;let s=e.split(`
8
8
  `),r=t.split(`
9
- `),i=Math.max(s.length,r.length),o=[];for(let a=0;a<i;a++)s[a]!==r[a]&&o.push(a);return{lines:o,numLinesBefore:s.length,numLinesAfter:r.length,numLines:i}}function Ie(e){return e===gt}function Pe(e,t){let s=e;s.isTTY&&s.setRawMode(t)}function ms({input:e=hs,output:t=$t,overwrite:s=!0,hideCursor:r=!0}={}){let i=ae.createInterface({input:e,output:t,prompt:"",tabSize:1});ae.emitKeypressEvents(e,i),e instanceof cs&&e.isTTY&&e.setRawMode(!0);let o=(a,{name:l,sequence:c})=>{let u=String(a);if(yt([u,l,c],"cancel")){r&&t.write(K.cursor.show),process.exit(0);return}if(!s)return;ae.moveCursor(t,l==="return"?0:-1,l==="return"?-1:0,()=>{ae.clearLine(t,1,()=>{e.once("keypress",o)})})};return r&&t.write(K.cursor.hide),e.once("keypress",o),()=>{e.off("keypress",o),r&&t.write(K.cursor.show),e instanceof cs&&e.isTTY&&!Vr&&e.setRawMode(!1),i.terminal=!1,i.close()}}function G(e,t,s,r=s,i=s,o){let a=he(e??$t);return se(t,a-s.length,{hard:!0,trim:!1}).split(`
9
+ `),i=Math.max(s.length,r.length),o=[];for(let a=0;a<i;a++)s[a]!==r[a]&&o.push(a);return{lines:o,numLinesBefore:s.length,numLinesAfter:r.length,numLines:i}}function Ee(e){return e===gt}function De(e,t){let s=e;s.isTTY&&s.setRawMode(t)}function ms({input:e=hs,output:t=$t,overwrite:s=!0,hideCursor:r=!0}={}){let i=ae.createInterface({input:e,output:t,prompt:"",tabSize:1});ae.emitKeypressEvents(e,i),e instanceof cs&&e.isTTY&&e.setRawMode(!0);let o=(a,{name:l,sequence:c})=>{let u=String(a);if(yt([u,l,c],"cancel")){r&&t.write(K.cursor.show),process.exit(0);return}if(!s)return;ae.moveCursor(t,l==="return"?0:-1,l==="return"?-1:0,()=>{ae.clearLine(t,1,()=>{e.once("keypress",o)})})};return r&&t.write(K.cursor.hide),e.once("keypress",o),()=>{e.off("keypress",o),r&&t.write(K.cursor.show),e instanceof cs&&e.isTTY&&!Vr&&e.setRawMode(!1),i.terminal=!1,i.close()}}function G(e,t,s,r=s,i=s,o){let a=me(e??$t);return se(t,a-s.length,{hard:!0,trim:!1}).split(`
10
10
  `).map((l,c,u)=>{let d=o?o(l,c):l;return c===0?`${r}${d}`:c===u.length-1?`${i}${d}`:`${s}${d}`}).join(`
11
- `)}function Ur(e,t){if(e===void 0||t.length===0)return 0;let s=t.findIndex(r=>r.value===e);return s!==-1?s:0}function Gr(e,t){return(t.label??String(t.value)).toLowerCase().includes(e.toLowerCase())}function jr(e,t){if(t)return e?t:t[0]}function ls(e){return[...e].map(t=>Wr[t])}function qr(e){let t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(new Date(2e3,0,15)),s=[],r="/";for(let i of t)i.type==="literal"?r=i.value.trim()||i.value:(i.type==="year"||i.type==="month"||i.type==="day")&&s.push({type:i.type,len:i.type==="year"?4:2});return{segments:s,separator:r}}function pt(e){return Number.parseInt((e||"0").replace(/_/g,"0"),10)||0}function Ne(e){return{year:pt(e.year),month:pt(e.month),day:pt(e.day)}}function ft(e,t){return new Date(e||2001,t||1,0).getDate()}function ps(e){let{year:t,month:s,day:r}=Ne(e);if(!t||t<0||t>9999||!s||s<1||s>12||!r||r<1)return;let i=new Date(Date.UTC(t,s-1,r));if(!(i.getUTCFullYear()!==t||i.getUTCMonth()!==s-1||i.getUTCDate()!==r))return{year:t,month:s,day:r}}function us(e){let t=ps(e);return t?new Date(Date.UTC(t.year,t.month-1,t.day)):void 0}function Hr(e,t,s,r){let i=s?{year:s.getUTCFullYear(),month:s.getUTCMonth()+1,day:s.getUTCDate()}:null,o=r?{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate()}:null;return e==="year"?{min:i?.year??1,max:o?.year??9999}:e==="month"?{min:i&&t.year===i.year?i.month:1,max:o&&t.year===o.year?o.month:12}:{min:i&&t.year===i.year&&t.month===i.month?i.day:1,max:o&&t.year===o.year&&t.month===o.month?o.day:ft(t.year,t.month)}}var K,Pr,Nr,I,Vr,gt,he,vt,ne,bt,De,Wr,Ve,Ue,Ge,gs,je,We,qe,He,wt=we(()=>{ut();K=Wt(mt(),1);Pr=["up","down","left","right","space","enter","cancel"],Nr=["January","February","March","April","May","June","July","August","September","October","November","December"],I={actions:new Set(Pr),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"},withGuide:!0,date:{monthNames:[...Nr],messages:{required:"Please enter a valid date",invalidMonth:"There are only 12 months in a year",invalidDay:(e,t)=>`There are only ${e} days in ${t}`,afterMin:e=>`Date must be on or after ${e.toISOString().slice(0,10)}`,beforeMax:e=>`Date must be on or before ${e.toISOString().slice(0,10)}`}}};Vr=globalThis.process.platform.startsWith("win"),gt=Symbol("clack:cancel");he=e=>"columns"in e&&typeof e.columns=="number"?e.columns:80,vt=e=>"rows"in e&&typeof e.rows=="number"?e.rows:20;ne=class{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;state="initial";error="";value;userInput="";constructor(e,t=!0){let{input:s=hs,output:r=$t,render:i,signal:o,...a}=e;this.opts=a,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=i.bind(this),this._track=t,this._abortSignal=o,this.input=s,this.output=r}unsubscribe(){this._subscribers.clear()}setSubscriber(e,t){let s=this._subscribers.get(e)??[];s.push(t),this._subscribers.set(e,s)}on(e,t){this.setSubscriber(e,{cb:t})}once(e,t){this.setSubscriber(e,{cb:t,once:!0})}emit(e,...t){let s=this._subscribers.get(e)??[],r=[];for(let i of s)i.cb(...t),i.once&&r.push(()=>s.splice(s.indexOf(i),1));for(let i of r)i()}prompt(){return new Promise(e=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),e(gt);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}this.rl=Lr.createInterface({input:this.input,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0&&this._setUserInput(this.opts.initialUserInput,!0),this.input.on("keypress",this.onKeypress),Pe(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(K.cursor.show),this.output.off("resize",this.render),Pe(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(K.cursor.show),this.output.off("resize",this.render),Pe(this.input,!1),e(gt)})})}_isActionKey(e,t){return e===" "}_shouldSubmit(e,t){return!0}_setValue(e){this.value=e,this.emit("value",this.value)}_setUserInput(e,t){this.userInput=e??"",this.emit("userInput",this.userInput),t&&this._track&&this.rl&&(this.rl.write(this.userInput),this._cursor=this.rl.cursor)}_clearUserInput(){this.rl?.write(null,{ctrl:!0,name:"u"}),this._setUserInput("")}onKeypress(e,t){if(this._track&&t.name!=="return"&&(t.name&&this._isActionKey(e,t)&&this.rl?.write(null,{ctrl:!0,name:"h"}),this._cursor=this.rl?.cursor??0,this._setUserInput(this.rl?.line)),this.state==="error"&&(this.state="active"),t?.name&&(!this._track&&I.aliases.has(t.name)&&this.emit("cursor",I.aliases.get(t.name)),I.actions.has(t.name)&&this.emit("cursor",t.name)),e&&(e.toLowerCase()==="y"||e.toLowerCase()==="n")&&this.emit("confirm",e.toLowerCase()==="y"),this.emit("key",e?.toLowerCase(),t),t?.name==="return"&&this._shouldSubmit(e,t)){if(this.opts.validate){let s=this.opts.validate(this.value);s&&(this.error=s instanceof Error?s.message:s,this.state="error",this.rl?.write(this.userInput))}this.state!=="error"&&(this.state="submit")}yt([e,t?.name,t?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
12
- `),Pe(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=se(this._prevFrame,process.stdout.columns,{hard:!0,trim:!1}).split(`
11
+ `)}function Ur(e,t){if(e===void 0||t.length===0)return 0;let s=t.findIndex(r=>r.value===e);return s!==-1?s:0}function Gr(e,t){return(t.label??String(t.value)).toLowerCase().includes(e.toLowerCase())}function jr(e,t){if(t)return e?t:t[0]}function ls(e){return[...e].map(t=>Wr[t])}function qr(e){let t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(new Date(2e3,0,15)),s=[],r="/";for(let i of t)i.type==="literal"?r=i.value.trim()||i.value:(i.type==="year"||i.type==="month"||i.type==="day")&&s.push({type:i.type,len:i.type==="year"?4:2});return{segments:s,separator:r}}function pt(e){return Number.parseInt((e||"0").replace(/_/g,"0"),10)||0}function Ve(e){return{year:pt(e.year),month:pt(e.month),day:pt(e.day)}}function ft(e,t){return new Date(e||2001,t||1,0).getDate()}function ps(e){let{year:t,month:s,day:r}=Ve(e);if(!t||t<0||t>9999||!s||s<1||s>12||!r||r<1)return;let i=new Date(Date.UTC(t,s-1,r));if(!(i.getUTCFullYear()!==t||i.getUTCMonth()!==s-1||i.getUTCDate()!==r))return{year:t,month:s,day:r}}function us(e){let t=ps(e);return t?new Date(Date.UTC(t.year,t.month-1,t.day)):void 0}function Hr(e,t,s,r){let i=s?{year:s.getUTCFullYear(),month:s.getUTCMonth()+1,day:s.getUTCDate()}:null,o=r?{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate()}:null;return e==="year"?{min:i?.year??1,max:o?.year??9999}:e==="month"?{min:i&&t.year===i.year?i.month:1,max:o&&t.year===o.year?o.month:12}:{min:i&&t.year===i.year&&t.month===i.month?i.day:1,max:o&&t.year===o.year&&t.month===o.month?o.day:ft(t.year,t.month)}}var K,Pr,Nr,I,Vr,gt,me,vt,ne,bt,Ue,Wr,Ge,je,We,gs,qe,He,Ke,ze,wt=Ie(()=>{ut();K=Wt(mt(),1);Pr=["up","down","left","right","space","enter","cancel"],Nr=["January","February","March","April","May","June","July","August","September","October","November","December"],I={actions:new Set(Pr),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"},withGuide:!0,date:{monthNames:[...Nr],messages:{required:"Please enter a valid date",invalidMonth:"There are only 12 months in a year",invalidDay:(e,t)=>`There are only ${e} days in ${t}`,afterMin:e=>`Date must be on or after ${e.toISOString().slice(0,10)}`,beforeMax:e=>`Date must be on or before ${e.toISOString().slice(0,10)}`}}};Vr=globalThis.process.platform.startsWith("win"),gt=Symbol("clack:cancel");me=e=>"columns"in e&&typeof e.columns=="number"?e.columns:80,vt=e=>"rows"in e&&typeof e.rows=="number"?e.rows:20;ne=class{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;state="initial";error="";value;userInput="";constructor(e,t=!0){let{input:s=hs,output:r=$t,render:i,signal:o,...a}=e;this.opts=a,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=i.bind(this),this._track=t,this._abortSignal=o,this.input=s,this.output=r}unsubscribe(){this._subscribers.clear()}setSubscriber(e,t){let s=this._subscribers.get(e)??[];s.push(t),this._subscribers.set(e,s)}on(e,t){this.setSubscriber(e,{cb:t})}once(e,t){this.setSubscriber(e,{cb:t,once:!0})}emit(e,...t){let s=this._subscribers.get(e)??[],r=[];for(let i of s)i.cb(...t),i.once&&r.push(()=>s.splice(s.indexOf(i),1));for(let i of r)i()}prompt(){return new Promise(e=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),e(gt);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}this.rl=Lr.createInterface({input:this.input,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0&&this._setUserInput(this.opts.initialUserInput,!0),this.input.on("keypress",this.onKeypress),De(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(K.cursor.show),this.output.off("resize",this.render),De(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(K.cursor.show),this.output.off("resize",this.render),De(this.input,!1),e(gt)})})}_isActionKey(e,t){return e===" "}_shouldSubmit(e,t){return!0}_setValue(e){this.value=e,this.emit("value",this.value)}_setUserInput(e,t){this.userInput=e??"",this.emit("userInput",this.userInput),t&&this._track&&this.rl&&(this.rl.write(this.userInput),this._cursor=this.rl.cursor)}_clearUserInput(){this.rl?.write(null,{ctrl:!0,name:"u"}),this._setUserInput("")}onKeypress(e,t){if(this._track&&t.name!=="return"&&(t.name&&this._isActionKey(e,t)&&this.rl?.write(null,{ctrl:!0,name:"h"}),this._cursor=this.rl?.cursor??0,this._setUserInput(this.rl?.line)),this.state==="error"&&(this.state="active"),t?.name&&(!this._track&&I.aliases.has(t.name)&&this.emit("cursor",I.aliases.get(t.name)),I.actions.has(t.name)&&this.emit("cursor",t.name)),e&&(e.toLowerCase()==="y"||e.toLowerCase()==="n")&&this.emit("confirm",e.toLowerCase()==="y"),this.emit("key",e?.toLowerCase(),t),t?.name==="return"&&this._shouldSubmit(e,t)){if(this.opts.validate){let s=this.opts.validate(this.value);s&&(this.error=s instanceof Error?s.message:s,this.state="error",this.rl?.write(this.userInput))}this.state!=="error"&&(this.state="submit")}yt([e,t?.name,t?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
12
+ `),De(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=se(this._prevFrame,process.stdout.columns,{hard:!0,trim:!1}).split(`
13
13
  `).length-1;this.output.write(K.cursor.move(-999,e*-1))}render(){let e=se(this._render(this)??"",process.stdout.columns,{hard:!0,trim:!1});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(K.cursor.hide);else{let t=Dr(this._prevFrame,e),s=vt(this.output);if(this.restoreCursor(),t){let r=Math.max(0,t.numLinesAfter-s),i=Math.max(0,t.numLinesBefore-s),o=t.lines.find(a=>a>=r);if(o===void 0){this._prevFrame=e;return}if(t.lines.length===1){this.output.write(K.cursor.move(0,o-i)),this.output.write(K.erase.lines(1));let a=e.split(`
14
14
  `);this.output.write(a[o]),this._prevFrame=e,this.output.write(K.cursor.move(0,a.length-o-1));return}else if(t.lines.length>1){if(r<i)o=r;else{let l=o-i;l>0&&this.output.write(K.cursor.move(0,l))}this.output.write(K.erase.down());let a=e.split(`
15
15
  `).slice(o);this.output.write(a.join(`
16
- `)),this._prevFrame=e;return}}this.output.write(K.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}};bt=class extends ne{filteredOptions;multiple;isNavigating=!1;selectedValues=[];focusedValue;#t=0;#i="";#e;#n;#a;get cursor(){return this.#t}get userInputWithCursor(){if(!this.userInput)return Ce(["inverse","hidden"],"_");if(this._cursor>=this.userInput.length)return`${this.userInput}\u2588`;let e=this.userInput.slice(0,this._cursor),[t,...s]=this.userInput.slice(this._cursor);return`${e}${Ce("inverse",t)}${s.join("")}`}get options(){return typeof this.#n=="function"?this.#n():this.#n}constructor(e){super(e),this.#n=e.options,this.#a=e.placeholder;let t=this.options;this.filteredOptions=[...t],this.multiple=e.multiple===!0,this.#e=typeof e.options=="function"?e.filter:e.filter??Gr;let s;if(e.initialValue&&Array.isArray(e.initialValue)?this.multiple?s=e.initialValue:s=e.initialValue.slice(0,1):!this.multiple&&this.options.length>0&&(s=[this.options[0].value]),s)for(let r of s){let i=t.findIndex(o=>o.value===r);i!==-1&&(this.toggleSelected(r),this.#t=i)}this.focusedValue=this.options[this.#t]?.value,this.on("key",(r,i)=>this.#s(r,i)),this.on("userInput",r=>this.#r(r))}_isActionKey(e,t){return e===" "||this.multiple&&this.isNavigating&&t.name==="space"&&e!==void 0&&e!==""}#s(e,t){let s=t.name==="up",r=t.name==="down",i=t.name==="return",o=this.userInput===""||this.userInput===" ",a=this.#a,l=this.options,c=a!==void 0&&a!==""&&l.some(u=>!u.disabled&&(this.#e?this.#e(a,u):!0));if(t.name==="tab"&&o&&c){this.userInput===" "&&this._clearUserInput(),this._setUserInput(a,!0),this.isNavigating=!1;return}s||r?(this.#t=oe(this.#t,s?-1:1,this.filteredOptions),this.focusedValue=this.filteredOptions[this.#t]?.value,this.multiple||(this.selectedValues=[this.focusedValue]),this.isNavigating=!0):i?this.value=jr(this.multiple,this.selectedValues):this.multiple?this.focusedValue!==void 0&&(t.name==="tab"||this.isNavigating&&t.name==="space")?this.toggleSelected(this.focusedValue):this.isNavigating=!1:(this.focusedValue&&(this.selectedValues=[this.focusedValue]),this.isNavigating=!1)}deselectAll(){this.selectedValues=[]}toggleSelected(e){this.filteredOptions.length!==0&&(this.multiple?this.selectedValues.includes(e)?this.selectedValues=this.selectedValues.filter(t=>t!==e):this.selectedValues=[...this.selectedValues,e]:this.selectedValues=[e])}#r(e){if(e!==this.#i){this.#i=e;let t=this.options;e&&this.#e?this.filteredOptions=t.filter(i=>this.#e?.(e,i)):this.filteredOptions=[...t];let s=Ur(this.focusedValue,this.filteredOptions);this.#t=oe(s,0,this.filteredOptions);let r=this.filteredOptions[this.#t];r&&!r.disabled?this.focusedValue=r.value:this.focusedValue=void 0,this.multiple||(this.focusedValue!==void 0?this.toggleSelected(this.focusedValue):this.deselectAll())}}},De=class extends ne{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(t){super(t,!1),this.value=!!t.initialValue,this.on("userInput",()=>{this.value=this._value}),this.on("confirm",s=>{this.output.write(K.cursor.move(0,-1)),this.value=s,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}},Wr={Y:{type:"year",len:4},M:{type:"month",len:2},D:{type:"day",len:2}};Ve=class extends ne{#t;#i;#e;#n;#a;#s={segmentIndex:0,positionInSegment:0};#r=!0;#o=null;inlineError="";get segmentCursor(){return{...this.#s}}get segmentValues(){return{...this.#e}}get segments(){return this.#t}get separator(){return this.#i}get formattedValue(){return this.#h(this.#e)}#h(t){return this.#t.map(s=>t[s.type]).join(this.#i)}#c(){this._setUserInput(this.#h(this.#e)),this._setValue(us(this.#e)??void 0)}constructor(t){let s=t.format?{segments:ls(t.format),separator:t.separator??"/"}:qr(t.locale),r=t.separator??s.separator,i=t.format?ls(t.format):s.segments,o=t.initialValue??t.defaultValue,a=o?{year:String(o.getUTCFullYear()).padStart(4,"0"),month:String(o.getUTCMonth()+1).padStart(2,"0"),day:String(o.getUTCDate()).padStart(2,"0")}:{year:"____",month:"__",day:"__"},l=i.map(c=>a[c.type]).join(r);super({...t,initialUserInput:l},!1),this.#t=i,this.#i=r,this.#e=a,this.#n=t.minDate,this.#a=t.maxDate,this.#c(),this.on("cursor",c=>this.#p(c)),this.on("key",(c,u)=>this.#g(c,u)),this.on("finalize",()=>this.#f(t))}#l(){let t=Math.max(0,Math.min(this.#s.segmentIndex,this.#t.length-1)),s=this.#t[t];if(s)return this.#s.positionInSegment=Math.max(0,Math.min(this.#s.positionInSegment,s.len-1)),{segment:s,index:t}}#u(t){this.inlineError="",this.#o=null;let s=this.#l();s&&(this.#s.segmentIndex=Math.max(0,Math.min(this.#t.length-1,s.index+t)),this.#s.positionInSegment=0,this.#r=!0)}#d(t){let s=this.#l();if(!s)return;let{segment:r}=s,i=this.#e[r.type],o=!i||i.replace(/_/g,"")==="",a=Number.parseInt((i||"0").replace(/_/g,"0"),10)||0,l=Hr(r.type,Ne(this.#e),this.#n,this.#a),c;o?c=t===1?l.min:l.max:c=Math.max(Math.min(l.max,a+t),l.min),this.#e={...this.#e,[r.type]:c.toString().padStart(r.len,"0")},this.#r=!0,this.#o=null,this.#c()}#p(t){if(t)switch(t){case"right":return this.#u(1);case"left":return this.#u(-1);case"up":return this.#d(1);case"down":return this.#d(-1)}}#g(t,s){if(s?.name==="backspace"||s?.sequence==="\x7F"||s?.sequence==="\b"||t==="\x7F"||t==="\b"){this.inlineError="";let r=this.#l();if(!r)return;if(!this.#e[r.segment.type].replace(/_/g,"")){this.#u(-1);return}this.#e[r.segment.type]="_".repeat(r.segment.len),this.#r=!0,this.#s.positionInSegment=0,this.#c();return}if(s?.name==="tab"){this.inlineError="";let r=this.#l();if(!r)return;let i=s.shift?-1:1,o=r.index+i;o>=0&&o<this.#t.length&&(this.#s.segmentIndex=o,this.#s.positionInSegment=0,this.#r=!0);return}if(t&&/^[0-9]$/.test(t)){let r=this.#l();if(!r)return;let{segment:i}=r,o=!this.#e[i.type].replace(/_/g,"");if(this.#r&&this.#o!==null&&!o){let y=this.#o+t,m={...this.#e,[i.type]:y},b=this.#m(m,i);if(b){this.inlineError=b,this.#o=null,this.#r=!1;return}this.inlineError="",this.#e[i.type]=y,this.#o=null,this.#r=!1,this.#c(),r.index<this.#t.length-1&&(this.#s.segmentIndex=r.index+1,this.#s.positionInSegment=0,this.#r=!0);return}this.#r&&!o&&(this.#e[i.type]="_".repeat(i.len),this.#s.positionInSegment=0),this.#r=!1,this.#o=null;let a=this.#e[i.type],l=a.indexOf("_"),c=l>=0?l:Math.min(this.#s.positionInSegment,i.len-1);if(c<0||c>=i.len)return;let u=a.slice(0,c)+t+a.slice(c+1),d=!1;if(c===0&&a==="__"&&(i.type==="month"||i.type==="day")){let y=Number.parseInt(t,10);u=`0${t}`,d=y<=(i.type==="month"?1:2)}if(i.type==="year"&&(u=(a.replace(/_/g,"")+t).padStart(i.len,"_")),!u.includes("_")){let y={...this.#e,[i.type]:u},m=this.#m(y,i);if(m){this.inlineError=m;return}}this.inlineError="",this.#e[i.type]=u;let g=u.includes("_")?void 0:ps(this.#e);if(g){let{year:y,month:m}=g,b=ft(y,m);this.#e={year:String(Math.max(0,Math.min(9999,y))).padStart(4,"0"),month:String(Math.max(1,Math.min(12,m))).padStart(2,"0"),day:String(Math.max(1,Math.min(b,g.day))).padStart(2,"0")}}this.#c();let p=u.indexOf("_");d?(this.#r=!0,this.#o=t):p>=0?this.#s.positionInSegment=p:l>=0&&r.index<this.#t.length-1?(this.#s.segmentIndex=r.index+1,this.#s.positionInSegment=0,this.#r=!0):this.#s.positionInSegment=Math.min(c+1,i.len-1)}}#m(t,s){let{month:r,day:i}=Ne(t);if(s.type==="month"&&(r<0||r>12))return I.date.messages.invalidMonth;if(s.type==="day"&&(i<0||i>31))return I.date.messages.invalidDay(31,"any month")}#f(t){let{year:s,month:r,day:i}=Ne(this.#e);if(s&&r&&i){let o=ft(s,r);this.#e={...this.#e,day:String(Math.min(i,o)).padStart(2,"0")}}this.value=us(this.#e)??t.defaultValue??void 0}},Ue=class extends ne{options;cursor=0;#t;getGroupItems(t){return this.options.filter(s=>s.group===t)}isGroupSelected(t){let s=this.getGroupItems(t),r=this.value;return r===void 0?!1:s.every(i=>r.includes(i.value))}toggleValue(){let t=this.options[this.cursor];if(this.value===void 0&&(this.value=[]),t.group===!0){let s=t.value,r=this.getGroupItems(s);this.isGroupSelected(s)?this.value=this.value.filter(i=>r.findIndex(o=>o.value===i)===-1):this.value=[...this.value,...r.map(i=>i.value)],this.value=Array.from(new Set(this.value))}else{let s=this.value.includes(t.value);this.value=s?this.value.filter(r=>r!==t.value):[...this.value,t.value]}}constructor(t){super(t,!1);let{options:s}=t;this.#t=t.selectableGroups!==!1,this.options=Object.entries(s).flatMap(([r,i])=>[{value:r,group:!0,label:r},...i.map(o=>({...o,group:r}))]),this.value=[...t.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:r})=>r===t.cursorAt),this.#t?0:1),this.on("cursor",r=>{switch(r){case"left":case"up":{this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;let i=this.options[this.cursor]?.group===!0;!this.#t&&i&&(this.cursor=this.cursor===0?this.options.length-1:this.cursor-1);break}case"down":case"right":{this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;let i=this.options[this.cursor]?.group===!0;!this.#t&&i&&(this.cursor=this.cursor===this.options.length-1?0:this.cursor+1);break}case"space":this.toggleValue();break}})}},Ge=class extends ne{#t=!1;#i;focused="editor";get userInputWithCursor(){if(this.state==="submit")return this.userInput;let t=this.userInput;if(this.cursor>=t.length)return`${t}\u2588`;let s=t.slice(0,this.cursor),r=t[this.cursor],i=t.slice(this.cursor+1);return r===`
16
+ `)),this._prevFrame=e;return}}this.output.write(K.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}};bt=class extends ne{filteredOptions;multiple;isNavigating=!1;selectedValues=[];focusedValue;#t=0;#i="";#e;#n;#a;get cursor(){return this.#t}get userInputWithCursor(){if(!this.userInput)return Se(["inverse","hidden"],"_");if(this._cursor>=this.userInput.length)return`${this.userInput}\u2588`;let e=this.userInput.slice(0,this._cursor),[t,...s]=this.userInput.slice(this._cursor);return`${e}${Se("inverse",t)}${s.join("")}`}get options(){return typeof this.#n=="function"?this.#n():this.#n}constructor(e){super(e),this.#n=e.options,this.#a=e.placeholder;let t=this.options;this.filteredOptions=[...t],this.multiple=e.multiple===!0,this.#e=typeof e.options=="function"?e.filter:e.filter??Gr;let s;if(e.initialValue&&Array.isArray(e.initialValue)?this.multiple?s=e.initialValue:s=e.initialValue.slice(0,1):!this.multiple&&this.options.length>0&&(s=[this.options[0].value]),s)for(let r of s){let i=t.findIndex(o=>o.value===r);i!==-1&&(this.toggleSelected(r),this.#t=i)}this.focusedValue=this.options[this.#t]?.value,this.on("key",(r,i)=>this.#s(r,i)),this.on("userInput",r=>this.#r(r))}_isActionKey(e,t){return e===" "||this.multiple&&this.isNavigating&&t.name==="space"&&e!==void 0&&e!==""}#s(e,t){let s=t.name==="up",r=t.name==="down",i=t.name==="return",o=this.userInput===""||this.userInput===" ",a=this.#a,l=this.options,c=a!==void 0&&a!==""&&l.some(u=>!u.disabled&&(this.#e?this.#e(a,u):!0));if(t.name==="tab"&&o&&c){this.userInput===" "&&this._clearUserInput(),this._setUserInput(a,!0),this.isNavigating=!1;return}s||r?(this.#t=oe(this.#t,s?-1:1,this.filteredOptions),this.focusedValue=this.filteredOptions[this.#t]?.value,this.multiple||(this.selectedValues=[this.focusedValue]),this.isNavigating=!0):i?this.value=jr(this.multiple,this.selectedValues):this.multiple?this.focusedValue!==void 0&&(t.name==="tab"||this.isNavigating&&t.name==="space")?this.toggleSelected(this.focusedValue):this.isNavigating=!1:(this.focusedValue&&(this.selectedValues=[this.focusedValue]),this.isNavigating=!1)}deselectAll(){this.selectedValues=[]}toggleSelected(e){this.filteredOptions.length!==0&&(this.multiple?this.selectedValues.includes(e)?this.selectedValues=this.selectedValues.filter(t=>t!==e):this.selectedValues=[...this.selectedValues,e]:this.selectedValues=[e])}#r(e){if(e!==this.#i){this.#i=e;let t=this.options;e&&this.#e?this.filteredOptions=t.filter(i=>this.#e?.(e,i)):this.filteredOptions=[...t];let s=Ur(this.focusedValue,this.filteredOptions);this.#t=oe(s,0,this.filteredOptions);let r=this.filteredOptions[this.#t];r&&!r.disabled?this.focusedValue=r.value:this.focusedValue=void 0,this.multiple||(this.focusedValue!==void 0?this.toggleSelected(this.focusedValue):this.deselectAll())}}},Ue=class extends ne{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(t){super(t,!1),this.value=!!t.initialValue,this.on("userInput",()=>{this.value=this._value}),this.on("confirm",s=>{this.output.write(K.cursor.move(0,-1)),this.value=s,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}},Wr={Y:{type:"year",len:4},M:{type:"month",len:2},D:{type:"day",len:2}};Ge=class extends ne{#t;#i;#e;#n;#a;#s={segmentIndex:0,positionInSegment:0};#r=!0;#o=null;inlineError="";get segmentCursor(){return{...this.#s}}get segmentValues(){return{...this.#e}}get segments(){return this.#t}get separator(){return this.#i}get formattedValue(){return this.#h(this.#e)}#h(t){return this.#t.map(s=>t[s.type]).join(this.#i)}#c(){this._setUserInput(this.#h(this.#e)),this._setValue(us(this.#e)??void 0)}constructor(t){let s=t.format?{segments:ls(t.format),separator:t.separator??"/"}:qr(t.locale),r=t.separator??s.separator,i=t.format?ls(t.format):s.segments,o=t.initialValue??t.defaultValue,a=o?{year:String(o.getUTCFullYear()).padStart(4,"0"),month:String(o.getUTCMonth()+1).padStart(2,"0"),day:String(o.getUTCDate()).padStart(2,"0")}:{year:"____",month:"__",day:"__"},l=i.map(c=>a[c.type]).join(r);super({...t,initialUserInput:l},!1),this.#t=i,this.#i=r,this.#e=a,this.#n=t.minDate,this.#a=t.maxDate,this.#c(),this.on("cursor",c=>this.#p(c)),this.on("key",(c,u)=>this.#g(c,u)),this.on("finalize",()=>this.#f(t))}#l(){let t=Math.max(0,Math.min(this.#s.segmentIndex,this.#t.length-1)),s=this.#t[t];if(s)return this.#s.positionInSegment=Math.max(0,Math.min(this.#s.positionInSegment,s.len-1)),{segment:s,index:t}}#u(t){this.inlineError="",this.#o=null;let s=this.#l();s&&(this.#s.segmentIndex=Math.max(0,Math.min(this.#t.length-1,s.index+t)),this.#s.positionInSegment=0,this.#r=!0)}#d(t){let s=this.#l();if(!s)return;let{segment:r}=s,i=this.#e[r.type],o=!i||i.replace(/_/g,"")==="",a=Number.parseInt((i||"0").replace(/_/g,"0"),10)||0,l=Hr(r.type,Ve(this.#e),this.#n,this.#a),c;o?c=t===1?l.min:l.max:c=Math.max(Math.min(l.max,a+t),l.min),this.#e={...this.#e,[r.type]:c.toString().padStart(r.len,"0")},this.#r=!0,this.#o=null,this.#c()}#p(t){if(t)switch(t){case"right":return this.#u(1);case"left":return this.#u(-1);case"up":return this.#d(1);case"down":return this.#d(-1)}}#g(t,s){if(s?.name==="backspace"||s?.sequence==="\x7F"||s?.sequence==="\b"||t==="\x7F"||t==="\b"){this.inlineError="";let r=this.#l();if(!r)return;if(!this.#e[r.segment.type].replace(/_/g,"")){this.#u(-1);return}this.#e[r.segment.type]="_".repeat(r.segment.len),this.#r=!0,this.#s.positionInSegment=0,this.#c();return}if(s?.name==="tab"){this.inlineError="";let r=this.#l();if(!r)return;let i=s.shift?-1:1,o=r.index+i;o>=0&&o<this.#t.length&&(this.#s.segmentIndex=o,this.#s.positionInSegment=0,this.#r=!0);return}if(t&&/^[0-9]$/.test(t)){let r=this.#l();if(!r)return;let{segment:i}=r,o=!this.#e[i.type].replace(/_/g,"");if(this.#r&&this.#o!==null&&!o){let y=this.#o+t,m={...this.#e,[i.type]:y},b=this.#m(m,i);if(b){this.inlineError=b,this.#o=null,this.#r=!1;return}this.inlineError="",this.#e[i.type]=y,this.#o=null,this.#r=!1,this.#c(),r.index<this.#t.length-1&&(this.#s.segmentIndex=r.index+1,this.#s.positionInSegment=0,this.#r=!0);return}this.#r&&!o&&(this.#e[i.type]="_".repeat(i.len),this.#s.positionInSegment=0),this.#r=!1,this.#o=null;let a=this.#e[i.type],l=a.indexOf("_"),c=l>=0?l:Math.min(this.#s.positionInSegment,i.len-1);if(c<0||c>=i.len)return;let u=a.slice(0,c)+t+a.slice(c+1),d=!1;if(c===0&&a==="__"&&(i.type==="month"||i.type==="day")){let y=Number.parseInt(t,10);u=`0${t}`,d=y<=(i.type==="month"?1:2)}if(i.type==="year"&&(u=(a.replace(/_/g,"")+t).padStart(i.len,"_")),!u.includes("_")){let y={...this.#e,[i.type]:u},m=this.#m(y,i);if(m){this.inlineError=m;return}}this.inlineError="",this.#e[i.type]=u;let g=u.includes("_")?void 0:ps(this.#e);if(g){let{year:y,month:m}=g,b=ft(y,m);this.#e={year:String(Math.max(0,Math.min(9999,y))).padStart(4,"0"),month:String(Math.max(1,Math.min(12,m))).padStart(2,"0"),day:String(Math.max(1,Math.min(b,g.day))).padStart(2,"0")}}this.#c();let p=u.indexOf("_");d?(this.#r=!0,this.#o=t):p>=0?this.#s.positionInSegment=p:l>=0&&r.index<this.#t.length-1?(this.#s.segmentIndex=r.index+1,this.#s.positionInSegment=0,this.#r=!0):this.#s.positionInSegment=Math.min(c+1,i.len-1)}}#m(t,s){let{month:r,day:i}=Ve(t);if(s.type==="month"&&(r<0||r>12))return I.date.messages.invalidMonth;if(s.type==="day"&&(i<0||i>31))return I.date.messages.invalidDay(31,"any month")}#f(t){let{year:s,month:r,day:i}=Ve(this.#e);if(s&&r&&i){let o=ft(s,r);this.#e={...this.#e,day:String(Math.min(i,o)).padStart(2,"0")}}this.value=us(this.#e)??t.defaultValue??void 0}},je=class extends ne{options;cursor=0;#t;getGroupItems(t){return this.options.filter(s=>s.group===t)}isGroupSelected(t){let s=this.getGroupItems(t),r=this.value;return r===void 0?!1:s.every(i=>r.includes(i.value))}toggleValue(){let t=this.options[this.cursor];if(this.value===void 0&&(this.value=[]),t.group===!0){let s=t.value,r=this.getGroupItems(s);this.isGroupSelected(s)?this.value=this.value.filter(i=>r.findIndex(o=>o.value===i)===-1):this.value=[...this.value,...r.map(i=>i.value)],this.value=Array.from(new Set(this.value))}else{let s=this.value.includes(t.value);this.value=s?this.value.filter(r=>r!==t.value):[...this.value,t.value]}}constructor(t){super(t,!1);let{options:s}=t;this.#t=t.selectableGroups!==!1,this.options=Object.entries(s).flatMap(([r,i])=>[{value:r,group:!0,label:r},...i.map(o=>({...o,group:r}))]),this.value=[...t.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:r})=>r===t.cursorAt),this.#t?0:1),this.on("cursor",r=>{switch(r){case"left":case"up":{this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;let i=this.options[this.cursor]?.group===!0;!this.#t&&i&&(this.cursor=this.cursor===0?this.options.length-1:this.cursor-1);break}case"down":case"right":{this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;let i=this.options[this.cursor]?.group===!0;!this.#t&&i&&(this.cursor=this.cursor===this.options.length-1?0:this.cursor+1);break}case"space":this.toggleValue();break}})}},We=class extends ne{#t=!1;#i;focused="editor";get userInputWithCursor(){if(this.state==="submit")return this.userInput;let t=this.userInput;if(this.cursor>=t.length)return`${t}\u2588`;let s=t.slice(0,this.cursor),r=t[this.cursor],i=t.slice(this.cursor+1);return r===`
17
17
  `?`${s}\u2588
18
- ${i}`:`${s}${Ce("inverse",r)}${i}`}get cursor(){return this._cursor}#e(t){if(this.userInput.length===0){this._setUserInput(t);return}this._setUserInput(this.userInput.slice(0,this.cursor)+t+this.userInput.slice(this.cursor))}#n(t){let s=this.value??"";switch(t){case"up":this._cursor=Le(this._cursor,0,-1,s);return;case"down":this._cursor=Le(this._cursor,0,1,s);return;case"left":this._cursor=Le(this._cursor,-1,0,s);return;case"right":this._cursor=Le(this._cursor,1,0,s);return}}_shouldSubmit(t,s){if(this.#i)return this.focused==="submit"?!0:(this.#e(`
18
+ ${i}`:`${s}${Se("inverse",r)}${i}`}get cursor(){return this._cursor}#e(t){if(this.userInput.length===0){this._setUserInput(t);return}this._setUserInput(this.userInput.slice(0,this.cursor)+t+this.userInput.slice(this.cursor))}#n(t){let s=this.value??"";switch(t){case"up":this._cursor=Ne(this._cursor,0,-1,s);return;case"down":this._cursor=Ne(this._cursor,0,1,s);return;case"left":this._cursor=Ne(this._cursor,-1,0,s);return;case"right":this._cursor=Ne(this._cursor,1,0,s);return}}_shouldSubmit(t,s){if(this.#i)return this.focused==="submit"?!0:(this.#e(`
19
19
  `),this._cursor++,!1);let r=this.#t;return this.#t=!0,r?(this.userInput[this.cursor-1]===`
20
20
  `&&(this._setUserInput(this.userInput.slice(0,this.cursor-1)+this.userInput.slice(this.cursor)),this._cursor--),!0):(this.#e(`
21
- `),this._cursor++,!1)}constructor(t){super(t,!1),this.#i=t.showSubmit??!1,this.on("key",(s,r)=>{if(r?.name&&I.actions.has(r.name)){this.#n(r.name);return}if(s===" "&&this.#i){this.focused=this.focused==="editor"?"submit":"editor";return}if(r?.name!=="return"){if(this.#t=!1,r?.name==="backspace"&&this.cursor>0){this._setUserInput(this.userInput.slice(0,this.cursor-1)+this.userInput.slice(this.cursor)),this._cursor--;return}if(r?.name==="delete"&&this.cursor<this.userInput.length){this._setUserInput(this.userInput.slice(0,this.cursor)+this.userInput.slice(this.cursor+1));return}s&&(this.#i&&this.focused==="submit"&&(this.focused="editor"),this.#e(s??""),this._cursor++)}}),this.on("userInput",s=>{this._setValue(s)}),this.on("finalize",()=>{this.value||(this.value=t.defaultValue),this.value===void 0&&(this.value="")})}},gs=class extends ne{options;cursor=0;get _value(){return this.options[this.cursor].value}get _enabledOptions(){return this.options.filter(e=>e.disabled!==!0)}toggleAll(){let e=this._enabledOptions,t=this.value!==void 0&&this.value.length===e.length;this.value=t?[]:e.map(s=>s.value)}toggleInvert(){let e=this.value;if(!e)return;let t=this._enabledOptions.filter(s=>!e.includes(s.value));this.value=t.map(s=>s.value)}toggleValue(){this.value===void 0&&(this.value=[]);let e=this.value.includes(this._value);this.value=e?this.value.filter(t=>t!==this._value):[...this.value,this._value]}constructor(e){super(e,!1),this.options=e.options,this.value=[...e.initialValues??[]];let t=Math.max(this.options.findIndex(({value:s})=>s===e.cursorAt),0);this.cursor=this.options[t].disabled?oe(t,1,this.options):t,this.on("key",s=>{s==="a"&&this.toggleAll(),s==="i"&&this.toggleInvert()}),this.on("cursor",s=>{switch(s){case"left":case"up":this.cursor=oe(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=oe(this.cursor,1,this.options);break;case"space":this.toggleValue();break}})}},je=class extends ne{_mask="\u2022";get cursor(){return this._cursor}get masked(){return this.userInput.replaceAll(/./g,this._mask)}get userInputWithCursor(){if(this.state==="submit"||this.state==="cancel")return this.masked;let t=this.userInput;if(this.cursor>=t.length)return`${this.masked}${Ce(["inverse","hidden"],"_")}`;let s=this.masked,r=s.slice(0,this.cursor),i=s.slice(this.cursor);return`${r}${Ce("inverse",i[0])}${i.slice(1)}`}clear(){this._clearUserInput()}constructor({mask:t,...s}){super(s),this._mask=t??"\u2022",this.on("userInput",r=>{this._setValue(r)})}},We=class extends ne{options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){this.value=this._selectedValue.value}constructor(t){super(t,!1),this.options=t.options;let s=this.options.findIndex(({value:i})=>i===t.initialValue),r=s===-1?0:s;this.cursor=this.options[r].disabled?oe(r,1,this.options):r,this.changeValue(),this.on("cursor",i=>{switch(i){case"left":case"up":this.cursor=oe(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=oe(this.cursor,1,this.options);break}this.changeValue()})}},qe=class extends ne{options;cursor=0;constructor(t){super(t,!1),this.options=t.options;let s=t.caseSensitive===!0,r=this.options.map(({value:[i]})=>s?i:i?.toLowerCase());this.cursor=Math.max(r.indexOf(t.initialValue),0),this.on("key",(i,o)=>{if(!i)return;let a=s&&o.shift?i.toUpperCase():i;if(!r.includes(a))return;let l=this.options.find(({value:[c]})=>s?c===a:c?.toLowerCase()===i);l&&(this.value=l.value,this.state="submit",this.emit("submit"))})}},He=class extends ne{get userInputWithCursor(){if(this.state==="submit")return this.userInput;let t=this.userInput;if(this.cursor>=t.length)return`${this.userInput}\u2588`;let s=t.slice(0,this.cursor),[r,...i]=t.slice(this.cursor);return`${s}${Ce("inverse",r)}${i.join("")}`}get cursor(){return this._cursor}constructor(t){super({...t,initialUserInput:t.initialUserInput??t.initialValue}),this.on("userInput",s=>{this._setValue(s)}),this.on("finalize",()=>{this.value||(this.value=t.defaultValue),this.value===void 0&&(this.value="")})}}});var Ms={};yr(Ms,{S_BAR:()=>f,S_BAR_END:()=>V,S_BAR_END_RIGHT:()=>xs,S_BAR_H:()=>Ye,S_BAR_START:()=>xt,S_BAR_START_RIGHT:()=>Es,S_CHECKBOX_ACTIVE:()=>Je,S_CHECKBOX_INACTIVE:()=>Ee,S_CHECKBOX_SELECTED:()=>me,S_CONNECT_LEFT:()=>Rs,S_CORNER_BOTTOM_LEFT:()=>_t,S_CORNER_BOTTOM_RIGHT:()=>Rt,S_CORNER_TOP_LEFT:()=>_s,S_CORNER_TOP_RIGHT:()=>Tt,S_ERROR:()=>Ot,S_INFO:()=>At,S_PASSWORD_MASK:()=>Ts,S_RADIO_ACTIVE:()=>Fe,S_RADIO_INACTIVE:()=>pe,S_STEP_ACTIVE:()=>Ss,S_STEP_CANCEL:()=>St,S_STEP_ERROR:()=>Et,S_STEP_SUBMIT:()=>ge,S_SUCCESS:()=>Ft,S_WARN:()=>Mt,autocomplete:()=>Fs,autocompleteMultiselect:()=>Xr,box:()=>si,cancel:()=>Me,confirm:()=>le,date:()=>ri,group:()=>ai,groupMultiselect:()=>ci,intro:()=>kt,isCI:()=>It,isCancel:()=>Ie,isTTY:()=>Is,limitOptions:()=>ce,log:()=>E,multiline:()=>li,multiselect:()=>Pt,note:()=>fe,outro:()=>Lt,password:()=>di,path:()=>mi,progress:()=>gi,select:()=>H,selectKey:()=>fi,settings:()=>I,spinner:()=>$e,stream:()=>de,symbol:()=>J,symbolBar:()=>Bt,taskLog:()=>vi,tasks:()=>$i,text:()=>ue,unicode:()=>ze,unicodeOr:()=>_,updateSettings:()=>ds});import{styleText as n,stripVTControlCharacters as Ct}from"node:util";import X from"node:process";import{existsSync as Kr,lstatSync as fs,readdirSync as zr}from"node:fs";import{dirname as $s,join as Jr}from"node:path";function Yr(){return X.platform!=="win32"?X.env.TERM!=="linux":!!X.env.CI||!!X.env.WT_SESSION||!!X.env.TERMINUS_SUBLIME||X.env.ConEmuTask==="{cmd::Cmder}"||X.env.TERM_PROGRAM==="Terminus-Sublime"||X.env.TERM_PROGRAM==="vscode"||X.env.TERM==="xterm-256color"||X.env.TERM==="alacritty"||X.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}function vs(e){return e.label??String(e.value??"")}function As(e,t){if(!e)return!0;let s=(t.label??String(t.value??"")).toLowerCase(),r=(t.hint??"").toLowerCase(),i=String(t.value).toLowerCase(),o=e.toLowerCase();return s.includes(o)||r.includes(o)||i.includes(o)}function Qr(e,t){let s=[];for(let r of t)e.includes(r.value)&&s.push(r);return s}function bs(e,t,s,r){let i=s,o=s;return r==="center"?i=Math.floor((t-e)/2):r==="right"&&(i=t-e-s),o=t-i-e,[i,o]}function ii(e,t){let s=e.segmentValues,r=e.segmentCursor;if(t==="submit"||t==="cancel")return e.formattedValue;let i=n("gray",e.separator);return e.segments.map((o,a)=>{let l=a===r.segmentIndex&&!["submit","cancel"].includes(t),c=oi[o.type];return ni(s[o.type],{isActive:l,label:c})}).join(i)}function ni(e,t){let s=!e||e.replace(/_/g,"")==="";return t.isActive?n("inverse",s?t.label:e.replace(/_/g," ")):s?n("dim",t.label):e.replace(/_/g,n("dim"," "))}function gi({style:e="heavy",max:t=100,size:s=40,...r}={}){let i=$e(r),o=0,a="",l=Math.max(1,t),c=Math.max(1,s),u=y=>{switch(y){case"initial":case"active":return m=>n("magenta",m);case"error":case"cancel":return m=>n("red",m);case"submit":return m=>n("green",m);default:return m=>n("magenta",m)}},d=(y,m)=>{let b=Math.floor(o/l*c);return`${u(y)(ws[e].repeat(b))}${n("dim",ws[e].repeat(c-b))} ${m}`},g=(y="")=>{a=y,i.start(d("initial",y))},p=(y=1,m)=>{o=Math.min(l,y+o),i.message(d("active",m??a)),a=m??a};return{start:g,stop:i.stop,cancel:i.cancel,error:i.error,clear:i.clear,advance:p,isCancelled:i.isCancelled,message:y=>p(0,y)}}var Se,ze,It,Is,_,Ss,St,Et,ge,xt,f,V,Es,xs,Fe,pe,Je,me,Ee,Ts,Ye,Tt,Rs,Rt,_t,_s,At,Ft,Mt,Ot,J,Bt,ys,ce,Fs,Xr,Zr,ei,ti,si,le,ri,oi,ai,ci,E,Me,kt,Lt,li,Ae,Pt,ui,hi,fe,di,mi,pi,$e,ws,Ke,H,fi,Cs,de,$i,yi,vi,ue,Z=we(()=>{wt();wt();ut();ot();Se=Wt(mt(),1);ze=Yr(),It=()=>process.env.CI==="true",Is=e=>e.isTTY===!0,_=(e,t)=>ze?e:t,Ss=_("\u25C6","*"),St=_("\u25A0","x"),Et=_("\u25B2","x"),ge=_("\u25C7","o"),xt=_("\u250C","T"),f=_("\u2502","|"),V=_("\u2514","\u2014"),Es=_("\u2510","T"),xs=_("\u2518","\u2014"),Fe=_("\u25CF",">"),pe=_("\u25CB"," "),Je=_("\u25FB","[\u2022]"),me=_("\u25FC","[+]"),Ee=_("\u25FB","[ ]"),Ts=_("\u25AA","\u2022"),Ye=_("\u2500","-"),Tt=_("\u256E","+"),Rs=_("\u251C","+"),Rt=_("\u256F","+"),_t=_("\u2570","+"),_s=_("\u256D","+"),At=_("\u25CF","\u2022"),Ft=_("\u25C6","*"),Mt=_("\u25B2","!"),Ot=_("\u25A0","x"),J=e=>{switch(e){case"initial":case"active":return n("cyan",Ss);case"cancel":return n("red",St);case"error":return n("yellow",Et);case"submit":return n("green",ge)}},Bt=e=>{switch(e){case"initial":case"active":return n("cyan",f);case"cancel":return n("red",f);case"error":return n("yellow",f);case"submit":return n("green",f)}},ys=(e,t,s,r,i,o=!1)=>{let a=t,l=0;if(o)for(let c=r-1;c>=s&&(a-=e[c].length,l++,!(a<=i));c--);else for(let c=s;c<r&&(a-=e[c].length,l++,!(a<=i));c++);return{lineCount:a,removals:l}},ce=({cursor:e,options:t,style:s,output:r=process.stdout,maxItems:i=Number.POSITIVE_INFINITY,columnPadding:o=0,rowPadding:a=4})=>{let l=he(r)-o,c=vt(r),u=n("dim","..."),d=Math.max(c-a,0),g=Math.max(Math.min(i,d),5),p=0;e>=g-3&&(p=Math.max(Math.min(e-g+3,t.length-g),0));let y=g<t.length&&p>0,m=g<t.length&&p+g<t.length,b=Math.min(p+g,t.length),$=[],v=0;y&&v++,m&&v++;let C=p+(y?1:0),T=b-(m?1:0);for(let x=C;x<T;x++){let L=se(s(t[x],x===e),l,{hard:!0,trim:!1}).split(`
22
- `);$.push(L),v+=L.length}if(v>d){let x=0,L=0,M=v,k=e-C,N=d,W=()=>ys($,M,0,k,N),w=()=>ys($,M,k+1,$.length,N,!0);y?({lineCount:M,removals:x}=W(),M>N&&(m||(N-=1),{lineCount:M,removals:L}=w())):(m||(N-=1),{lineCount:M,removals:L}=w(),M>N&&(N-=1,{lineCount:M,removals:x}=W())),x>0&&(y=!0,$.splice(0,x)),L>0&&(m=!0,$.splice($.length-L,L))}let R=[];y&&R.push(u);for(let x of $)for(let L of x)R.push(L);return m&&R.push(u),R};Fs=e=>new bt({options:e.options,initialValue:e.initialValue?[e.initialValue]:void 0,initialUserInput:e.initialUserInput,placeholder:e.placeholder,filter:e.filter??((t,s)=>As(t,s)),signal:e.signal,input:e.input,output:e.output,validate:e.validate,render(){let t=e.withGuide??I.withGuide,s=t?[`${n("gray",f)}`,`${J(this.state)} ${e.message}`]:[`${J(this.state)} ${e.message}`],r=this.userInput,i=this.options,o=e.placeholder,a=r===""&&o!==void 0,l=(c,u)=>{let d=vs(c),g=c.hint&&c.value===this.focusedValue?n("dim",` (${c.hint})`):"";switch(u){case"active":return`${n("green",Fe)} ${d}${g}`;case"inactive":return`${n("dim",pe)} ${n("dim",d)}`;case"disabled":return`${n("gray",pe)} ${n(["strikethrough","gray"],d)}`}};switch(this.state){case"submit":{let c=Qr(this.selectedValues,i),u=c.length>0?` ${n("dim",c.map(vs).join(", "))}`:"",d=t?n("gray",f):"";return`${s.join(`
21
+ `),this._cursor++,!1)}constructor(t){super(t,!1),this.#i=t.showSubmit??!1,this.on("key",(s,r)=>{if(r?.name&&I.actions.has(r.name)){this.#n(r.name);return}if(s===" "&&this.#i){this.focused=this.focused==="editor"?"submit":"editor";return}if(r?.name!=="return"){if(this.#t=!1,r?.name==="backspace"&&this.cursor>0){this._setUserInput(this.userInput.slice(0,this.cursor-1)+this.userInput.slice(this.cursor)),this._cursor--;return}if(r?.name==="delete"&&this.cursor<this.userInput.length){this._setUserInput(this.userInput.slice(0,this.cursor)+this.userInput.slice(this.cursor+1));return}s&&(this.#i&&this.focused==="submit"&&(this.focused="editor"),this.#e(s??""),this._cursor++)}}),this.on("userInput",s=>{this._setValue(s)}),this.on("finalize",()=>{this.value||(this.value=t.defaultValue),this.value===void 0&&(this.value="")})}},gs=class extends ne{options;cursor=0;get _value(){return this.options[this.cursor].value}get _enabledOptions(){return this.options.filter(e=>e.disabled!==!0)}toggleAll(){let e=this._enabledOptions,t=this.value!==void 0&&this.value.length===e.length;this.value=t?[]:e.map(s=>s.value)}toggleInvert(){let e=this.value;if(!e)return;let t=this._enabledOptions.filter(s=>!e.includes(s.value));this.value=t.map(s=>s.value)}toggleValue(){this.value===void 0&&(this.value=[]);let e=this.value.includes(this._value);this.value=e?this.value.filter(t=>t!==this._value):[...this.value,this._value]}constructor(e){super(e,!1),this.options=e.options,this.value=[...e.initialValues??[]];let t=Math.max(this.options.findIndex(({value:s})=>s===e.cursorAt),0);this.cursor=this.options[t].disabled?oe(t,1,this.options):t,this.on("key",s=>{s==="a"&&this.toggleAll(),s==="i"&&this.toggleInvert()}),this.on("cursor",s=>{switch(s){case"left":case"up":this.cursor=oe(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=oe(this.cursor,1,this.options);break;case"space":this.toggleValue();break}})}},qe=class extends ne{_mask="\u2022";get cursor(){return this._cursor}get masked(){return this.userInput.replaceAll(/./g,this._mask)}get userInputWithCursor(){if(this.state==="submit"||this.state==="cancel")return this.masked;let t=this.userInput;if(this.cursor>=t.length)return`${this.masked}${Se(["inverse","hidden"],"_")}`;let s=this.masked,r=s.slice(0,this.cursor),i=s.slice(this.cursor);return`${r}${Se("inverse",i[0])}${i.slice(1)}`}clear(){this._clearUserInput()}constructor({mask:t,...s}){super(s),this._mask=t??"\u2022",this.on("userInput",r=>{this._setValue(r)})}},He=class extends ne{options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){this.value=this._selectedValue.value}constructor(t){super(t,!1),this.options=t.options;let s=this.options.findIndex(({value:i})=>i===t.initialValue),r=s===-1?0:s;this.cursor=this.options[r].disabled?oe(r,1,this.options):r,this.changeValue(),this.on("cursor",i=>{switch(i){case"left":case"up":this.cursor=oe(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=oe(this.cursor,1,this.options);break}this.changeValue()})}},Ke=class extends ne{options;cursor=0;constructor(t){super(t,!1),this.options=t.options;let s=t.caseSensitive===!0,r=this.options.map(({value:[i]})=>s?i:i?.toLowerCase());this.cursor=Math.max(r.indexOf(t.initialValue),0),this.on("key",(i,o)=>{if(!i)return;let a=s&&o.shift?i.toUpperCase():i;if(!r.includes(a))return;let l=this.options.find(({value:[c]})=>s?c===a:c?.toLowerCase()===i);l&&(this.value=l.value,this.state="submit",this.emit("submit"))})}},ze=class extends ne{get userInputWithCursor(){if(this.state==="submit")return this.userInput;let t=this.userInput;if(this.cursor>=t.length)return`${this.userInput}\u2588`;let s=t.slice(0,this.cursor),[r,...i]=t.slice(this.cursor);return`${s}${Se("inverse",r)}${i.join("")}`}get cursor(){return this._cursor}constructor(t){super({...t,initialUserInput:t.initialUserInput??t.initialValue}),this.on("userInput",s=>{this._setValue(s)}),this.on("finalize",()=>{this.value||(this.value=t.defaultValue),this.value===void 0&&(this.value="")})}}});var Ms={};yr(Ms,{S_BAR:()=>f,S_BAR_END:()=>V,S_BAR_END_RIGHT:()=>xs,S_BAR_H:()=>Xe,S_BAR_START:()=>xt,S_BAR_START_RIGHT:()=>Es,S_CHECKBOX_ACTIVE:()=>Qe,S_CHECKBOX_INACTIVE:()=>Re,S_CHECKBOX_SELECTED:()=>ge,S_CONNECT_LEFT:()=>Ts,S_CORNER_BOTTOM_LEFT:()=>_t,S_CORNER_BOTTOM_RIGHT:()=>Tt,S_CORNER_TOP_LEFT:()=>_s,S_CORNER_TOP_RIGHT:()=>Rt,S_ERROR:()=>Ot,S_INFO:()=>At,S_PASSWORD_MASK:()=>Rs,S_RADIO_ACTIVE:()=>Oe,S_RADIO_INACTIVE:()=>fe,S_STEP_ACTIVE:()=>Ss,S_STEP_CANCEL:()=>St,S_STEP_ERROR:()=>Et,S_STEP_SUBMIT:()=>$e,S_SUCCESS:()=>Ft,S_WARN:()=>Mt,autocomplete:()=>Fs,autocompleteMultiselect:()=>Xr,box:()=>si,cancel:()=>ke,confirm:()=>le,date:()=>ri,group:()=>ai,groupMultiselect:()=>ci,intro:()=>Bt,isCI:()=>It,isCancel:()=>Ee,isTTY:()=>Is,limitOptions:()=>ce,log:()=>E,multiline:()=>li,multiselect:()=>Pt,note:()=>ye,outro:()=>Lt,password:()=>di,path:()=>mi,progress:()=>gi,select:()=>q,selectKey:()=>fi,settings:()=>I,spinner:()=>ve,stream:()=>pe,symbol:()=>J,symbolBar:()=>kt,taskLog:()=>vi,tasks:()=>$i,text:()=>ue,unicode:()=>Ye,unicodeOr:()=>F,updateSettings:()=>ds});import{styleText as n,stripVTControlCharacters as Ct}from"node:util";import X from"node:process";import{existsSync as Kr,lstatSync as fs,readdirSync as zr}from"node:fs";import{dirname as $s,join as Jr}from"node:path";function Yr(){return X.platform!=="win32"?X.env.TERM!=="linux":!!X.env.CI||!!X.env.WT_SESSION||!!X.env.TERMINUS_SUBLIME||X.env.ConEmuTask==="{cmd::Cmder}"||X.env.TERM_PROGRAM==="Terminus-Sublime"||X.env.TERM_PROGRAM==="vscode"||X.env.TERM==="xterm-256color"||X.env.TERM==="alacritty"||X.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}function vs(e){return e.label??String(e.value??"")}function As(e,t){if(!e)return!0;let s=(t.label??String(t.value??"")).toLowerCase(),r=(t.hint??"").toLowerCase(),i=String(t.value).toLowerCase(),o=e.toLowerCase();return s.includes(o)||r.includes(o)||i.includes(o)}function Qr(e,t){let s=[];for(let r of t)e.includes(r.value)&&s.push(r);return s}function bs(e,t,s,r){let i=s,o=s;return r==="center"?i=Math.floor((t-e)/2):r==="right"&&(i=t-e-s),o=t-i-e,[i,o]}function ii(e,t){let s=e.segmentValues,r=e.segmentCursor;if(t==="submit"||t==="cancel")return e.formattedValue;let i=n("gray",e.separator);return e.segments.map((o,a)=>{let l=a===r.segmentIndex&&!["submit","cancel"].includes(t),c=oi[o.type];return ni(s[o.type],{isActive:l,label:c})}).join(i)}function ni(e,t){let s=!e||e.replace(/_/g,"")==="";return t.isActive?n("inverse",s?t.label:e.replace(/_/g," ")):s?n("dim",t.label):e.replace(/_/g,n("dim"," "))}function gi({style:e="heavy",max:t=100,size:s=40,...r}={}){let i=ve(r),o=0,a="",l=Math.max(1,t),c=Math.max(1,s),u=y=>{switch(y){case"initial":case"active":return m=>n("magenta",m);case"error":case"cancel":return m=>n("red",m);case"submit":return m=>n("green",m);default:return m=>n("magenta",m)}},d=(y,m)=>{let b=Math.floor(o/l*c);return`${u(y)(ws[e].repeat(b))}${n("dim",ws[e].repeat(c-b))} ${m}`},g=(y="")=>{a=y,i.start(d("initial",y))},p=(y=1,m)=>{o=Math.min(l,y+o),i.message(d("active",m??a)),a=m??a};return{start:g,stop:i.stop,cancel:i.cancel,error:i.error,clear:i.clear,advance:p,isCancelled:i.isCancelled,message:y=>p(0,y)}}var xe,Ye,It,Is,F,Ss,St,Et,$e,xt,f,V,Es,xs,Oe,fe,Qe,ge,Re,Rs,Xe,Rt,Ts,Tt,_t,_s,At,Ft,Mt,Ot,J,kt,ys,ce,Fs,Xr,Zr,ei,ti,si,le,ri,oi,ai,ci,E,ke,Bt,Lt,li,Me,Pt,ui,hi,ye,di,mi,pi,ve,ws,Je,q,fi,Cs,pe,$i,yi,vi,ue,Z=Ie(()=>{wt();wt();ut();ot();xe=Wt(mt(),1);Ye=Yr(),It=()=>process.env.CI==="true",Is=e=>e.isTTY===!0,F=(e,t)=>Ye?e:t,Ss=F("\u25C6","*"),St=F("\u25A0","x"),Et=F("\u25B2","x"),$e=F("\u25C7","o"),xt=F("\u250C","T"),f=F("\u2502","|"),V=F("\u2514","\u2014"),Es=F("\u2510","T"),xs=F("\u2518","\u2014"),Oe=F("\u25CF",">"),fe=F("\u25CB"," "),Qe=F("\u25FB","[\u2022]"),ge=F("\u25FC","[+]"),Re=F("\u25FB","[ ]"),Rs=F("\u25AA","\u2022"),Xe=F("\u2500","-"),Rt=F("\u256E","+"),Ts=F("\u251C","+"),Tt=F("\u256F","+"),_t=F("\u2570","+"),_s=F("\u256D","+"),At=F("\u25CF","\u2022"),Ft=F("\u25C6","*"),Mt=F("\u25B2","!"),Ot=F("\u25A0","x"),J=e=>{switch(e){case"initial":case"active":return n("cyan",Ss);case"cancel":return n("red",St);case"error":return n("yellow",Et);case"submit":return n("green",$e)}},kt=e=>{switch(e){case"initial":case"active":return n("cyan",f);case"cancel":return n("red",f);case"error":return n("yellow",f);case"submit":return n("green",f)}},ys=(e,t,s,r,i,o=!1)=>{let a=t,l=0;if(o)for(let c=r-1;c>=s&&(a-=e[c].length,l++,!(a<=i));c--);else for(let c=s;c<r&&(a-=e[c].length,l++,!(a<=i));c++);return{lineCount:a,removals:l}},ce=({cursor:e,options:t,style:s,output:r=process.stdout,maxItems:i=Number.POSITIVE_INFINITY,columnPadding:o=0,rowPadding:a=4})=>{let l=me(r)-o,c=vt(r),u=n("dim","..."),d=Math.max(c-a,0),g=Math.max(Math.min(i,d),5),p=0;e>=g-3&&(p=Math.max(Math.min(e-g+3,t.length-g),0));let y=g<t.length&&p>0,m=g<t.length&&p+g<t.length,b=Math.min(p+g,t.length),$=[],v=0;y&&v++,m&&v++;let C=p+(y?1:0),R=b-(m?1:0);for(let x=C;x<R;x++){let L=se(s(t[x],x===e),l,{hard:!0,trim:!1}).split(`
22
+ `);$.push(L),v+=L.length}if(v>d){let x=0,L=0,M=v,B=e-C,N=d,W=()=>ys($,M,0,B,N),w=()=>ys($,M,B+1,$.length,N,!0);y?({lineCount:M,removals:x}=W(),M>N&&(m||(N-=1),{lineCount:M,removals:L}=w())):(m||(N-=1),{lineCount:M,removals:L}=w(),M>N&&(N-=1,{lineCount:M,removals:x}=W())),x>0&&(y=!0,$.splice(0,x)),L>0&&(m=!0,$.splice($.length-L,L))}let T=[];y&&T.push(u);for(let x of $)for(let L of x)T.push(L);return m&&T.push(u),T};Fs=e=>new bt({options:e.options,initialValue:e.initialValue?[e.initialValue]:void 0,initialUserInput:e.initialUserInput,placeholder:e.placeholder,filter:e.filter??((t,s)=>As(t,s)),signal:e.signal,input:e.input,output:e.output,validate:e.validate,render(){let t=e.withGuide??I.withGuide,s=t?[`${n("gray",f)}`,`${J(this.state)} ${e.message}`]:[`${J(this.state)} ${e.message}`],r=this.userInput,i=this.options,o=e.placeholder,a=r===""&&o!==void 0,l=(c,u)=>{let d=vs(c),g=c.hint&&c.value===this.focusedValue?n("dim",` (${c.hint})`):"";switch(u){case"active":return`${n("green",Oe)} ${d}${g}`;case"inactive":return`${n("dim",fe)} ${n("dim",d)}`;case"disabled":return`${n("gray",fe)} ${n(["strikethrough","gray"],d)}`}};switch(this.state){case"submit":{let c=Qr(this.selectedValues,i),u=c.length>0?` ${n("dim",c.map(vs).join(", "))}`:"",d=t?n("gray",f):"";return`${s.join(`
23
23
  `)}
24
24
  ${d}${u}`}case"cancel":{let c=r?` ${n(["strikethrough","dim"],r)}`:"",u=t?n("gray",f):"";return`${s.join(`
25
25
  `)}
26
- ${u}${c}`}default:{let c=this.state==="error"?"yellow":"cyan",u=t?`${n(c,f)} `:"",d=t?n(c,V):"",g="";if(this.isNavigating||a){let C=a?o:r;g=C!==""?` ${n("dim",C)}`:""}else g=` ${this.userInputWithCursor}`;let p=this.filteredOptions.length!==i.length?n("dim",` (${this.filteredOptions.length} match${this.filteredOptions.length===1?"":"es"})`):"",y=this.filteredOptions.length===0&&r?[`${u}${n("yellow","No matches found")}`]:[],m=this.state==="error"?[`${u}${n("yellow",this.error)}`]:[];t&&s.push(`${u.trimEnd()}`),s.push(`${u}${n("dim","Search:")}${g}${p}`,...y,...m);let b=[`${n("dim","\u2191/\u2193")} to select`,`${n("dim","Enter:")} confirm`,`${n("dim","Type:")} to search`],$=[`${u}${b.join(" \u2022 ")}`,d],v=this.filteredOptions.length===0?[]:ce({cursor:this.cursor,options:this.filteredOptions,columnPadding:t?3:0,rowPadding:s.length+$.length,style:(C,T)=>l(C,C.disabled?"disabled":T?"active":"inactive"),maxItems:e.maxItems,output:e.output});return[...s,...v.map(C=>`${u}${C}`),...$].join(`
27
- `)}}}}).prompt(),Xr=e=>{let t=(r,i,o,a)=>{let l=o.includes(r.value),c=r.label??String(r.value??""),u=r.hint&&a!==void 0&&r.value===a?n("dim",` (${r.hint})`):"",d=l?n("green",me):n("dim",Ee);return r.disabled?`${n("gray",Ee)} ${n(["strikethrough","gray"],c)}`:i?`${d} ${c}${u}`:`${d} ${n("dim",c)}`},s=new bt({options:e.options,multiple:!0,placeholder:e.placeholder,filter:e.filter??((r,i)=>As(r,i)),validate:()=>{if(e.required&&s.selectedValues.length===0)return"Please select at least one item"},initialValue:e.initialValues,signal:e.signal,input:e.input,output:e.output,render(){let r=e.withGuide??I.withGuide,i=`${r?`${n("gray",f)}
26
+ ${u}${c}`}default:{let c=this.state==="error"?"yellow":"cyan",u=t?`${n(c,f)} `:"",d=t?n(c,V):"",g="";if(this.isNavigating||a){let C=a?o:r;g=C!==""?` ${n("dim",C)}`:""}else g=` ${this.userInputWithCursor}`;let p=this.filteredOptions.length!==i.length?n("dim",` (${this.filteredOptions.length} match${this.filteredOptions.length===1?"":"es"})`):"",y=this.filteredOptions.length===0&&r?[`${u}${n("yellow","No matches found")}`]:[],m=this.state==="error"?[`${u}${n("yellow",this.error)}`]:[];t&&s.push(`${u.trimEnd()}`),s.push(`${u}${n("dim","Search:")}${g}${p}`,...y,...m);let b=[`${n("dim","\u2191/\u2193")} to select`,`${n("dim","Enter:")} confirm`,`${n("dim","Type:")} to search`],$=[`${u}${b.join(" \u2022 ")}`,d],v=this.filteredOptions.length===0?[]:ce({cursor:this.cursor,options:this.filteredOptions,columnPadding:t?3:0,rowPadding:s.length+$.length,style:(C,R)=>l(C,C.disabled?"disabled":R?"active":"inactive"),maxItems:e.maxItems,output:e.output});return[...s,...v.map(C=>`${u}${C}`),...$].join(`
27
+ `)}}}}).prompt(),Xr=e=>{let t=(r,i,o,a)=>{let l=o.includes(r.value),c=r.label??String(r.value??""),u=r.hint&&a!==void 0&&r.value===a?n("dim",` (${r.hint})`):"",d=l?n("green",ge):n("dim",Re);return r.disabled?`${n("gray",Re)} ${n(["strikethrough","gray"],c)}`:i?`${d} ${c}${u}`:`${d} ${n("dim",c)}`},s=new bt({options:e.options,multiple:!0,placeholder:e.placeholder,filter:e.filter??((r,i)=>As(r,i)),validate:()=>{if(e.required&&s.selectedValues.length===0)return"Please select at least one item"},initialValue:e.initialValues,signal:e.signal,input:e.input,output:e.output,render(){let r=e.withGuide??I.withGuide,i=`${r?`${n("gray",f)}
28
28
  `:""}${J(this.state)} ${e.message}
29
29
  `,o=this.userInput,a=e.placeholder,l=o===""&&a!==void 0,c=this.isNavigating||l?n("dim",l?a:o):this.userInputWithCursor,u=this.options,d=this.filteredOptions.length!==u.length?n("dim",` (${this.filteredOptions.length} match${this.filteredOptions.length===1?"":"es"})`):"";switch(this.state){case"submit":return`${i}${r?`${n("gray",f)} `:""}${n("dim",`${this.selectedValues.length} items selected`)}`;case"cancel":return`${i}${r?`${n("gray",f)} `:""}${n(["strikethrough","dim"],o)}`;default:{let g=this.state==="error"?"yellow":"cyan",p=r?`${n(g,f)} `:"",y=r?n(g,V):"",m=[`${n("dim","\u2191/\u2193")} to navigate`,`${n("dim",this.isNavigating?"Space/Tab:":"Tab:")} select`,`${n("dim","Enter:")} confirm`,`${n("dim","Type:")} to search`],b=this.filteredOptions.length===0&&o?[`${p}${n("yellow","No matches found")}`]:[],$=this.state==="error"?[`${p}${n("yellow",this.error)}`]:[],v=[...`${i}${r?n(g,f):""}`.split(`
30
- `),`${p}${n("dim","Search:")} ${c}${d}`,...b,...$],C=[`${p}${m.join(" \u2022 ")}`,y],T=ce({cursor:this.cursor,options:this.filteredOptions,style:(R,x)=>t(R,x,this.selectedValues,this.focusedValue),maxItems:e.maxItems,output:e.output,rowPadding:v.length+C.length});return[...v,...T.map(R=>`${p}${R}`),...C].join(`
31
- `)}}}});return s.prompt()},Zr=[_s,Tt,_t,Rt],ei=[xt,Es,V,xs];ti=e=>e,si=(e="",t="",s)=>{let r=s?.output??process.stdout,i=he(r),o=2,a=s?.titlePadding??1,l=s?.contentPadding??2,c=s?.width===void 0||s.width==="auto"?1:Math.min(1,s.width),u=s?.withGuide??I.withGuide?`${f} `:"",d=s?.formatBorder??ti,g=(s?.rounded?Zr:ei).map(d),p=d(Ye),y=d(f),m=j(u),b=j(t),$=i-m,v=Math.floor(i*c)-m;if(s?.width==="auto"){let N=e.split(`
32
- `),W=b+a*2;for(let O of N){let q=j(O)+l*2;q>W&&(W=q)}let w=W+o;w<v&&(v=w)}v%2!==0&&(v<$?v++:v--);let C=v-o,T=C-a*2,R=b>T?`${t.slice(0,T-3)}...`:t,[x,L]=bs(j(R),C,a,s?.titleAlign),M=se(e,C-l*2,{hard:!0,trim:!1});r.write(`${u}${g[0]}${p.repeat(x)}${R}${p.repeat(L)}${g[1]}
33
- `);let k=M.split(`
34
- `);for(let N of k){let[W,w]=bs(j(N),C,l,s?.contentAlign);r.write(`${u}${y}${" ".repeat(W)}${N}${" ".repeat(w)}${y}
30
+ `),`${p}${n("dim","Search:")} ${c}${d}`,...b,...$],C=[`${p}${m.join(" \u2022 ")}`,y],R=ce({cursor:this.cursor,options:this.filteredOptions,style:(T,x)=>t(T,x,this.selectedValues,this.focusedValue),maxItems:e.maxItems,output:e.output,rowPadding:v.length+C.length});return[...v,...R.map(T=>`${p}${T}`),...C].join(`
31
+ `)}}}});return s.prompt()},Zr=[_s,Rt,_t,Tt],ei=[xt,Es,V,xs];ti=e=>e,si=(e="",t="",s)=>{let r=s?.output??process.stdout,i=me(r),o=2,a=s?.titlePadding??1,l=s?.contentPadding??2,c=s?.width===void 0||s.width==="auto"?1:Math.min(1,s.width),u=s?.withGuide??I.withGuide?`${f} `:"",d=s?.formatBorder??ti,g=(s?.rounded?Zr:ei).map(d),p=d(Xe),y=d(f),m=j(u),b=j(t),$=i-m,v=Math.floor(i*c)-m;if(s?.width==="auto"){let N=e.split(`
32
+ `),W=b+a*2;for(let O of N){let H=j(O)+l*2;H>W&&(W=H)}let w=W+o;w<v&&(v=w)}v%2!==0&&(v<$?v++:v--);let C=v-o,R=C-a*2,T=b>R?`${t.slice(0,R-3)}...`:t,[x,L]=bs(j(T),C,a,s?.titleAlign),M=se(e,C-l*2,{hard:!0,trim:!1});r.write(`${u}${g[0]}${p.repeat(x)}${T}${p.repeat(L)}${g[1]}
33
+ `);let B=M.split(`
34
+ `);for(let N of B){let[W,w]=bs(j(N),C,l,s?.contentAlign);r.write(`${u}${y}${" ".repeat(W)}${N}${" ".repeat(w)}${y}
35
35
  `)}r.write(`${u}${g[2]}${p.repeat(C)}${g[3]}
36
- `)},le=e=>{let t=e.active??"Yes",s=e.inactive??"No";return new De({active:t,inactive:s,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue??!0,render(){let r=e.withGuide??I.withGuide,i=`${J(this.state)} `,o=r?`${n("gray",f)} `:"",a=G(e.output,e.message,o,i),l=`${r?`${n("gray",f)}
36
+ `)},le=e=>{let t=e.active??"Yes",s=e.inactive??"No";return new Ue({active:t,inactive:s,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue??!0,render(){let r=e.withGuide??I.withGuide,i=`${J(this.state)} `,o=r?`${n("gray",f)} `:"",a=G(e.output,e.message,o,i),l=`${r?`${n("gray",f)}
37
37
  `:""}${a}
38
38
  `,c=this.value?t:s;switch(this.state){case"submit":{let u=r?`${n("gray",f)} `:"";return`${l}${u}${n("dim",c)}`}case"cancel":{let u=r?`${n("gray",f)} `:"";return`${l}${u}${n(["strikethrough","dim"],c)}${r?`
39
- ${n("gray",f)}`:""}`}default:{let u=r?`${n("cyan",f)} `:"",d=r?n("cyan",V):"";return`${l}${u}${this.value?`${n("green",Fe)} ${t}`:`${n("dim",pe)} ${n("dim",t)}`}${e.vertical?r?`
39
+ ${n("gray",f)}`:""}`}default:{let u=r?`${n("cyan",f)} `:"",d=r?n("cyan",V):"";return`${l}${u}${this.value?`${n("green",Oe)} ${t}`:`${n("dim",fe)} ${n("dim",t)}`}${e.vertical?r?`
40
40
  ${n("cyan",f)} `:`
41
- `:` ${n("dim","/")} `}${this.value?`${n("dim",pe)} ${n("dim",s)}`:`${n("green",Fe)} ${s}`}
41
+ `:` ${n("dim","/")} `}${this.value?`${n("dim",fe)} ${n("dim",s)}`:`${n("green",Oe)} ${s}`}
42
42
  ${d}
43
- `}}}}).prompt()},ri=e=>{let t=e.validate;return new Ve({...e,validate(s){if(s===void 0)return e.defaultValue!==void 0?void 0:t?t(s):I.date.messages.required;let r=i=>i.toISOString().slice(0,10);if(e.minDate&&r(s)<r(e.minDate))return I.date.messages.afterMin(e.minDate);if(e.maxDate&&r(s)>r(e.maxDate))return I.date.messages.beforeMax(e.maxDate);if(t)return t(s)},render(){let s=(e?.withGuide??I.withGuide)!==!1,r=`${`${s?`${n("gray",f)}
43
+ `}}}}).prompt()},ri=e=>{let t=e.validate;return new Ge({...e,validate(s){if(s===void 0)return e.defaultValue!==void 0?void 0:t?t(s):I.date.messages.required;let r=i=>i.toISOString().slice(0,10);if(e.minDate&&r(s)<r(e.minDate))return I.date.messages.afterMin(e.minDate);if(e.maxDate&&r(s)>r(e.maxDate))return I.date.messages.beforeMax(e.maxDate);if(t)return t(s)},render(){let s=(e?.withGuide??I.withGuide)!==!1,r=`${`${s?`${n("gray",f)}
44
44
  `:""}${J(this.state)} `}${e.message}
45
45
  `,i=this.state!=="initial"?this.state:"active",o=ii(this,i),a=this.value instanceof Date?this.formattedValue:"";switch(this.state){case"error":{let l=this.error?` ${n("yellow",this.error)}`:"",c=s?`${n("yellow",f)} `:"",u=s?n("yellow",V):"";return`${r.trim()}
46
46
  ${c}${o}
@@ -49,8 +49,8 @@ ${u}${l}
49
49
  ${c}`:""}`}default:{let l=s?`${n("cyan",f)} `:"",c=s?n("cyan",V):"",u=s?`${n("cyan",f)} `:"",d=this.inlineError?`
50
50
  ${u}${n("yellow",this.inlineError)}`:"";return`${r}${l}${o}${d}
51
51
  ${c}
52
- `}}}}).prompt()};oi={year:"yyyy",month:"mm",day:"dd"},ai=async(e,t)=>{let s={},r=Object.keys(e);for(let i of r){let o=e[i],a=await o({results:s})?.catch(l=>{throw l});if(typeof t?.onCancel=="function"&&Ie(a)){s[i]="canceled",t.onCancel({results:s});continue}s[i]=a}return s},ci=e=>{let{selectableGroups:t=!0,groupSpacing:s=0}=e,r=(o,a,l=[])=>{let c=o.label??String(o.value),u=typeof o.group=="string",d=u&&(l[l.indexOf(o)+1]??{group:!0}),g=u&&d&&d.group===!0,p="",y="";u&&(t?(p=g?`${V} `:`${f} `,y=g?" ":`${f} `):p=" ");let m="";if(s>0&&!u&&(m=`
53
- `.repeat(s)),a==="active")return G(e.output,`${c}${o.hint?` ${n("dim",`(${o.hint})`)}`:""}`,`${m}${n("dim",p)} `,`${m}${n("dim",p)}${n("cyan",Je)} `,`${m}${n("dim",y)} `);if(a==="group-active")return G(e.output,c,`${m}${p} `,`${m}${p}${n("cyan",Je)} `,`${m}${y} `,$=>n("dim",$));if(a==="group-active-selected")return G(e.output,c,`${m}${p} `,`${m}${p}${n("green",me)} `,`${m}${y} `,$=>n("dim",$));if(a==="selected"){let $=u||t?n("green",me):"";return G(e.output,`${c}${o.hint?` (${o.hint})`:""}`,`${m}${n("dim",p)} `,`${m}${n("dim",p)}${$} `,`${m}${n("dim",y)} `,v=>n("dim",v))}if(a==="cancelled")return`${n(["strikethrough","dim"],c)}`;if(a==="active-selected")return G(e.output,`${c}${o.hint?` ${n("dim",`(${o.hint})`)}`:""}`,`${m}${n("dim",p)} `,`${m}${n("dim",p)}${n("green",me)} `,`${m}${n("dim",y)} `);if(a==="submitted")return`${n("dim",c)}`;let b=u||t?n("dim",Ee):"";return G(e.output,c,`${m}${n("dim",p)} `,`${m}${n("dim",p)}${b} `,`${m}${n("dim",y)} `,$=>n("dim",$))},i=e.required??!0;return new Ue({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValues:e.initialValues,required:i,cursorAt:e.cursorAt,selectableGroups:t,validate(o){if(i&&(o===void 0||o.length===0))return`Please select at least one option.
52
+ `}}}}).prompt()};oi={year:"yyyy",month:"mm",day:"dd"},ai=async(e,t)=>{let s={},r=Object.keys(e);for(let i of r){let o=e[i],a=await o({results:s})?.catch(l=>{throw l});if(typeof t?.onCancel=="function"&&Ee(a)){s[i]="canceled",t.onCancel({results:s});continue}s[i]=a}return s},ci=e=>{let{selectableGroups:t=!0,groupSpacing:s=0}=e,r=(o,a,l=[])=>{let c=o.label??String(o.value),u=typeof o.group=="string",d=u&&(l[l.indexOf(o)+1]??{group:!0}),g=u&&d&&d.group===!0,p="",y="";u&&(t?(p=g?`${V} `:`${f} `,y=g?" ":`${f} `):p=" ");let m="";if(s>0&&!u&&(m=`
53
+ `.repeat(s)),a==="active")return G(e.output,`${c}${o.hint?` ${n("dim",`(${o.hint})`)}`:""}`,`${m}${n("dim",p)} `,`${m}${n("dim",p)}${n("cyan",Qe)} `,`${m}${n("dim",y)} `);if(a==="group-active")return G(e.output,c,`${m}${p} `,`${m}${p}${n("cyan",Qe)} `,`${m}${y} `,$=>n("dim",$));if(a==="group-active-selected")return G(e.output,c,`${m}${p} `,`${m}${p}${n("green",ge)} `,`${m}${y} `,$=>n("dim",$));if(a==="selected"){let $=u||t?n("green",ge):"";return G(e.output,`${c}${o.hint?` (${o.hint})`:""}`,`${m}${n("dim",p)} `,`${m}${n("dim",p)}${$} `,`${m}${n("dim",y)} `,v=>n("dim",v))}if(a==="cancelled")return`${n(["strikethrough","dim"],c)}`;if(a==="active-selected")return G(e.output,`${c}${o.hint?` ${n("dim",`(${o.hint})`)}`:""}`,`${m}${n("dim",p)} `,`${m}${n("dim",p)}${n("green",ge)} `,`${m}${n("dim",y)} `);if(a==="submitted")return`${n("dim",c)}`;let b=u||t?n("dim",Re):"";return G(e.output,c,`${m}${n("dim",p)} `,`${m}${n("dim",p)}${b} `,`${m}${n("dim",y)} `,$=>n("dim",$))},i=e.required??!0;return new je({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValues:e.initialValues,required:i,cursorAt:e.cursorAt,selectableGroups:t,validate(o){if(i&&(o===void 0||o.length===0))return`Please select at least one option.
54
54
  ${n("reset",n("dim",`Press ${n(["gray","bgWhite","inverse"]," space ")} to select, ${n("gray",n(["bgWhite","inverse"]," enter "))} to submit`))}`},render(){let o=e.withGuide??I.withGuide,a=`${o?`${n("gray",f)}
55
55
  `:""}${J(this.state)} ${e.message}
56
56
  `,l=this.value??[],c=(u,d)=>{let g=this.options,p=l.includes(u.value)||u.group===!0&&this.isGroupSelected(`${u.value}`);return!d&&typeof u.group=="string"&&this.options[this.cursor].value===u.group?r(u,p?"group-active-selected":"group-active",g):d&&p?r(u,"active-selected",g):p?r(u,"selected",g):r(u,d?"active":"inactive",g)};switch(this.state){case"submit":{let u=this.options.filter(({value:g})=>l.includes(g)).map(g=>r(g,"submitted")),d=u.length===0?"":` ${u.join(n("dim",", "))}`;return`${a}${o?n("gray",f):""}${d}`}case"cancel":{let u=this.options.filter(({value:d})=>l.includes(d)).map(d=>r(d,"cancelled")).join(n("dim",", "));return`${a}${o?`${n("gray",f)} `:""}${u.trim()?`${u}${o?`
@@ -68,23 +68,23 @@ ${o?n("cyan",V):""}
68
68
  `}}}}).prompt()},E={message:(e=[],{symbol:t=n("gray",f),secondarySymbol:s=n("gray",f),output:r=process.stdout,spacing:i=1,withGuide:o}={})=>{let a=[],l=o??I.withGuide,c=l?s:"",u=l?`${t} `:"",d=l?`${s} `:"";for(let p=0;p<i;p++)a.push(c);let g=Array.isArray(e)?e:e.split(`
69
69
  `);if(g.length>0){let[p,...y]=g;p.length>0?a.push(`${u}${p}`):a.push(l?t:"");for(let m of y)m.length>0?a.push(`${d}${m}`):a.push(l?s:"")}r.write(`${a.join(`
70
70
  `)}
71
- `)},info:(e,t)=>{E.message(e,{...t,symbol:n("blue",At)})},success:(e,t)=>{E.message(e,{...t,symbol:n("green",Ft)})},step:(e,t)=>{E.message(e,{...t,symbol:n("green",ge)})},warn:(e,t)=>{E.message(e,{...t,symbol:n("yellow",Mt)})},warning:(e,t)=>{E.warn(e,t)},error:(e,t)=>{E.message(e,{...t,symbol:n("red",Ot)})}},Me=(e="",t)=>{let s=t?.output??process.stdout,r=t?.withGuide??I.withGuide?`${n("gray",V)} `:"";s.write(`${r}${n("red",e)}
71
+ `)},info:(e,t)=>{E.message(e,{...t,symbol:n("blue",At)})},success:(e,t)=>{E.message(e,{...t,symbol:n("green",Ft)})},step:(e,t)=>{E.message(e,{...t,symbol:n("green",$e)})},warn:(e,t)=>{E.message(e,{...t,symbol:n("yellow",Mt)})},warning:(e,t)=>{E.warn(e,t)},error:(e,t)=>{E.message(e,{...t,symbol:n("red",Ot)})}},ke=(e="",t)=>{let s=t?.output??process.stdout,r=t?.withGuide??I.withGuide?`${n("gray",V)} `:"";s.write(`${r}${n("red",e)}
72
72
 
73
- `)},kt=(e="",t)=>{let s=t?.output??process.stdout,r=t?.withGuide??I.withGuide?`${n("gray",xt)} `:"";s.write(`${r}${e}
73
+ `)},Bt=(e="",t)=>{let s=t?.output??process.stdout,r=t?.withGuide??I.withGuide?`${n("gray",xt)} `:"";s.write(`${r}${e}
74
74
  `)},Lt=(e="",t)=>{let s=t?.output??process.stdout,r=t?.withGuide??I.withGuide?`${n("gray",f)}
75
75
  ${n("gray",V)} `:"";s.write(`${r}${e}
76
76
 
77
- `)},li=e=>new Ge({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,showSubmit:e.showSubmit,output:e.output,signal:e.signal,input:e.input,render(){let t=e?.withGuide??I.withGuide,s=`${`${t?`${n("gray",f)}
77
+ `)},li=e=>new We({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,showSubmit:e.showSubmit,output:e.output,signal:e.signal,input:e.input,render(){let t=e?.withGuide??I.withGuide,s=`${`${t?`${n("gray",f)}
78
78
  `:""}${J(this.state)} `}${e.message}
79
79
  `,r=e.placeholder?n("inverse",e.placeholder[0])+n("dim",e.placeholder.slice(1)):n(["inverse","hidden"],"_"),i=this.userInput?this.userInputWithCursor:r,o=this.value??"",a=e.showSubmit?`
80
80
  ${n(this.focused==="submit"?"cyan":"dim","[ submit ]")}`:"";switch(this.state){case"error":{let l=`${n("yellow",f)} `,c=t?G(e.output,i,l,void 0):i,u=n("yellow",V);return`${s}${c}
81
81
  ${u} ${n("yellow",this.error)}${a}
82
82
  `}case"submit":{let l=`${n("gray",f)} `,c=t?G(e.output,o,l,void 0,void 0,u=>n("dim",u)):o?n("dim",o):"";return`${s}${c}`}case"cancel":{let l=`${n("gray",f)} `,c=t?G(e.output,o,l,void 0,void 0,u=>n(["strikethrough","dim"],u)):o?n(["strikethrough","dim"],o):"";return`${s}${c}`}default:{let l=t?`${n("cyan",f)} `:"",c=t?n("cyan",V):"",u=t?G(e.output,i,l):i;return`${s}${u}
83
83
  ${c}${a}
84
- `}}}}).prompt(),Ae=(e,t)=>e.split(`
84
+ `}}}}).prompt(),Me=(e,t)=>e.split(`
85
85
  `).map(s=>t(s)).join(`
86
- `),Pt=e=>{let t=(r,i)=>{let o=r.label??String(r.value);return i==="disabled"?`${n("gray",Ee)} ${Ae(o,a=>n(["strikethrough","gray"],a))}${r.hint?` ${n("dim",`(${r.hint??"disabled"})`)}`:""}`:i==="active"?`${n("cyan",Je)} ${o}${r.hint?` ${n("dim",`(${r.hint})`)}`:""}`:i==="selected"?`${n("green",me)} ${Ae(o,a=>n("dim",a))}${r.hint?` ${n("dim",`(${r.hint})`)}`:""}`:i==="cancelled"?`${Ae(o,a=>n(["strikethrough","dim"],a))}`:i==="active-selected"?`${n("green",me)} ${o}${r.hint?` ${n("dim",`(${r.hint})`)}`:""}`:i==="submitted"?`${Ae(o,a=>n("dim",a))}`:`${n("dim",Ee)} ${Ae(o,a=>n("dim",a))}`},s=e.required??!0;return new gs({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValues:e.initialValues,required:s,cursorAt:e.cursorAt,validate(r){if(s&&(r===void 0||r.length===0))return`Please select at least one option.
87
- ${n("reset",n("dim",`Press ${n(["gray","bgWhite","inverse"]," space ")} to select, ${n("gray",n("bgWhite",n("inverse"," enter ")))} to submit`))}`},render(){let r=e.withGuide??I.withGuide,i=G(e.output,e.message,r?`${Bt(this.state)} `:"",`${J(this.state)} `),o=`${r?`${n("gray",f)}
86
+ `),Pt=e=>{let t=(r,i)=>{let o=r.label??String(r.value);return i==="disabled"?`${n("gray",Re)} ${Me(o,a=>n(["strikethrough","gray"],a))}${r.hint?` ${n("dim",`(${r.hint??"disabled"})`)}`:""}`:i==="active"?`${n("cyan",Qe)} ${o}${r.hint?` ${n("dim",`(${r.hint})`)}`:""}`:i==="selected"?`${n("green",ge)} ${Me(o,a=>n("dim",a))}${r.hint?` ${n("dim",`(${r.hint})`)}`:""}`:i==="cancelled"?`${Me(o,a=>n(["strikethrough","dim"],a))}`:i==="active-selected"?`${n("green",ge)} ${o}${r.hint?` ${n("dim",`(${r.hint})`)}`:""}`:i==="submitted"?`${Me(o,a=>n("dim",a))}`:`${n("dim",Re)} ${Me(o,a=>n("dim",a))}`},s=e.required??!0;return new gs({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValues:e.initialValues,required:s,cursorAt:e.cursorAt,validate(r){if(s&&(r===void 0||r.length===0))return`Please select at least one option.
87
+ ${n("reset",n("dim",`Press ${n(["gray","bgWhite","inverse"]," space ")} to select, ${n("gray",n("bgWhite",n("inverse"," enter ")))} to submit`))}`},render(){let r=e.withGuide??I.withGuide,i=G(e.output,e.message,r?`${kt(this.state)} `:"",`${J(this.state)} `),o=`${r?`${n("gray",f)}
88
88
  `:""}${i}
89
89
  `,a=this.value??[],l=(c,u)=>{if(c.disabled)return t(c,"disabled");let d=a.includes(c.value);return u&&d?t(c,"active-selected"):d?t(c,"selected"):t(c,u?"active":"inactive")};switch(this.state){case"submit":{let c=this.options.filter(({value:d})=>a.includes(d)).map(d=>t(d,"submitted")).join(n("dim",", "))||n("dim","none"),u=G(e.output,c,r?`${n("gray",f)} `:"");return`${o}${u}`}case"cancel":{let c=this.options.filter(({value:d})=>a.includes(d)).map(d=>t(d,"cancelled")).join(n("dim",", "));if(c.trim()==="")return`${o}${n("gray",f)}`;let u=G(e.output,c,r?`${n("gray",f)} `:"");return`${o}${u}${r?`
90
90
  ${n("gray",f)}`:""}`}case"error":{let c=r?`${n("yellow",f)} `:"",u=this.error.split(`
@@ -99,13 +99,13 @@ ${u}
99
99
  ${c}`)}
100
100
  ${r?n("cyan",V):""}
101
101
  `}}}}).prompt()},ui=e=>n("dim",e),hi=(e,t,s)=>{let r={hard:!0,trim:!1},i=se(e,t,r).split(`
102
- `),o=i.reduce((c,u)=>Math.max(j(u),c),0),a=i.map(s).reduce((c,u)=>Math.max(j(u),c),0),l=t-(a-o);return se(e,l,r)},fe=(e="",t="",s)=>{let r=s?.output??X.stdout,i=s?.withGuide??I.withGuide,o=s?.format??ui,a=["",...hi(e,he(r)-6,o).split(`
102
+ `),o=i.reduce((c,u)=>Math.max(j(u),c),0),a=i.map(s).reduce((c,u)=>Math.max(j(u),c),0),l=t-(a-o);return se(e,l,r)},ye=(e="",t="",s)=>{let r=s?.output??X.stdout,i=s?.withGuide??I.withGuide,o=s?.format??ui,a=["",...hi(e,me(r)-6,o).split(`
103
103
  `).map(o),""],l=j(t),c=Math.max(a.reduce((p,y)=>{let m=j(y);return m>p?m:p},0),l)+2,u=a.map(p=>`${n("gray",f)} ${p}${" ".repeat(c-j(p))}${n("gray",f)}`).join(`
104
104
  `),d=i?`${n("gray",f)}
105
- `:"",g=i?Rs:_t;r.write(`${d}${n("green",ge)} ${n("reset",t)} ${n("gray",Ye.repeat(Math.max(c-l-1,1))+Tt)}
105
+ `:"",g=i?Ts:_t;r.write(`${d}${n("green",$e)} ${n("reset",t)} ${n("gray",Xe.repeat(Math.max(c-l-1,1))+Rt)}
106
106
  ${u}
107
- ${n("gray",g+Ye.repeat(c+2)+Rt)}
108
- `)},di=e=>new je({validate:e.validate,mask:e.mask??Ts,signal:e.signal,input:e.input,output:e.output,render(){let t=e.withGuide??I.withGuide,s=`${t?`${n("gray",f)}
107
+ ${n("gray",g+Xe.repeat(c+2)+Tt)}
108
+ `)},di=e=>new qe({validate:e.validate,mask:e.mask??Rs,signal:e.signal,input:e.input,output:e.output,render(){let t=e.withGuide??I.withGuide,s=`${t?`${n("gray",f)}
109
109
  `:""}${J(this.state)} ${e.message}
110
110
  `,r=this.userInputWithCursor,i=this.masked;switch(this.state){case"error":{let o=t?`${n("yellow",f)} `:"",a=t?`${n("yellow",V)} `:"",l=i??"";return e.clearOnError&&this.clear(),`${s.trim()}
111
111
  ${o}${l}
@@ -113,47 +113,47 @@ ${a}${n("yellow",this.error)}
113
113
  `}case"submit":{let o=t?`${n("gray",f)} `:"",a=i?n("dim",i):"";return`${s}${o}${a}`}case"cancel":{let o=t?`${n("gray",f)} `:"",a=i?n(["strikethrough","dim"],i):"";return`${s}${o}${a}${i&&t?`
114
114
  ${n("gray",f)}`:""}`}default:{let o=t?`${n("cyan",f)} `:"",a=t?n("cyan",V):"";return`${s}${o}${r}
115
115
  ${a}
116
- `}}}}).prompt(),mi=e=>{let t=e.validate;return Fs({...e,initialUserInput:e.initialValue??e.root??process.cwd(),maxItems:5,validate(s){if(!Array.isArray(s)){if(!s)return"Please select a path";if(t)return t(s)}},options(){let s=this.userInput;if(s==="")return[];try{let r;Kr(s)?fs(s).isDirectory()&&(!e.directory||s.endsWith("/"))?r=s:r=$s(s):r=$s(s);let i=s.length>1&&s.endsWith("/")?s.slice(0,-1):s;return zr(r).map(o=>{let a=Jr(r,o),l=fs(a);return{name:o,path:a,isDirectory:l.isDirectory()}}).filter(({path:o,isDirectory:a})=>o.startsWith(i)&&(a||!e.directory)).map(o=>({value:o.path}))}catch{return[]}}})},pi=e=>n("magenta",e),$e=({indicator:e="dots",onCancel:t,output:s=process.stdout,cancelMessage:r,errorMessage:i,frames:o=ze?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],delay:a=ze?80:120,signal:l,...c}={})=>{let u=It(),d,g,p=!1,y=!1,m="",b,$=performance.now(),v=he(s),C=c?.styleFrame??pi,T=S=>{let B=S>1?i??I.messages.error:r??I.messages.cancel;y=S===1,p&&(q(B,S),y&&typeof t=="function"&&t())},R=()=>T(2),x=()=>T(1),L=()=>{process.on("uncaughtExceptionMonitor",R),process.on("unhandledRejection",R),process.on("SIGINT",x),process.on("SIGTERM",x),process.on("exit",T),l&&l.addEventListener("abort",x)},M=()=>{process.removeListener("uncaughtExceptionMonitor",R),process.removeListener("unhandledRejection",R),process.removeListener("SIGINT",x),process.removeListener("SIGTERM",x),process.removeListener("exit",T),l&&l.removeEventListener("abort",x)},k=()=>{if(b===void 0)return;u&&s.write(`
116
+ `}}}}).prompt(),mi=e=>{let t=e.validate;return Fs({...e,initialUserInput:e.initialValue??e.root??process.cwd(),maxItems:5,validate(s){if(!Array.isArray(s)){if(!s)return"Please select a path";if(t)return t(s)}},options(){let s=this.userInput;if(s==="")return[];try{let r;Kr(s)?fs(s).isDirectory()&&(!e.directory||s.endsWith("/"))?r=s:r=$s(s):r=$s(s);let i=s.length>1&&s.endsWith("/")?s.slice(0,-1):s;return zr(r).map(o=>{let a=Jr(r,o),l=fs(a);return{name:o,path:a,isDirectory:l.isDirectory()}}).filter(({path:o,isDirectory:a})=>o.startsWith(i)&&(a||!e.directory)).map(o=>({value:o.path}))}catch{return[]}}})},pi=e=>n("magenta",e),ve=({indicator:e="dots",onCancel:t,output:s=process.stdout,cancelMessage:r,errorMessage:i,frames:o=Ye?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],delay:a=Ye?80:120,signal:l,...c}={})=>{let u=It(),d,g,p=!1,y=!1,m="",b,$=performance.now(),v=me(s),C=c?.styleFrame??pi,R=S=>{let k=S>1?i??I.messages.error:r??I.messages.cancel;y=S===1,p&&(H(k,S),y&&typeof t=="function"&&t())},T=()=>R(2),x=()=>R(1),L=()=>{process.on("uncaughtExceptionMonitor",T),process.on("unhandledRejection",T),process.on("SIGINT",x),process.on("SIGTERM",x),process.on("exit",R),l&&l.addEventListener("abort",x)},M=()=>{process.removeListener("uncaughtExceptionMonitor",T),process.removeListener("unhandledRejection",T),process.removeListener("SIGINT",x),process.removeListener("SIGTERM",x),process.removeListener("exit",R),l&&l.removeEventListener("abort",x)},B=()=>{if(b===void 0)return;u&&s.write(`
117
117
  `);let S=se(b,v,{hard:!0,trim:!1}).split(`
118
- `);S.length>1&&s.write(Se.cursor.up(S.length-1)),s.write(Se.cursor.to(0)),s.write(Se.erase.down())},N=S=>S.replace(/\.+$/,""),W=S=>{let B=(performance.now()-S)/1e3,z=Math.floor(B/60),Q=Math.floor(B%60);return z>0?`[${z}m ${Q}s]`:`[${Q}s]`},w=c.withGuide??I.withGuide,O=(S="")=>{p=!0,d=ms({output:s}),m=N(S),$=performance.now(),w&&s.write(`${n("gray",f)}
119
- `);let B=0,z=0;L(),g=setInterval(()=>{if(u&&m===b)return;k(),b=m;let Q=C(o[B]),ie;if(u)ie=`${Q} ${m}...`;else if(e==="timer")ie=`${Q} ${m} ${W($)}`;else{let it=".".repeat(Math.floor(z)).slice(0,3);ie=`${Q} ${m}${it}`}let be=se(ie,v,{hard:!0,trim:!1});s.write(be),B=B+1<o.length?B+1:0,z=z<4?z+.125:0},a)},q=(S="",B=0,z=!1)=>{if(!p)return;p=!1,clearInterval(g),k();let Q=B===0?n("green",ge):B===1?n("red",St):n("red",Et);m=S??m,z||(e==="timer"?s.write(`${Q} ${m} ${W($)}
118
+ `);S.length>1&&s.write(xe.cursor.up(S.length-1)),s.write(xe.cursor.to(0)),s.write(xe.erase.down())},N=S=>S.replace(/\.+$/,""),W=S=>{let k=(performance.now()-S)/1e3,z=Math.floor(k/60),Q=Math.floor(k%60);return z>0?`[${z}m ${Q}s]`:`[${Q}s]`},w=c.withGuide??I.withGuide,O=(S="")=>{p=!0,d=ms({output:s}),m=N(S),$=performance.now(),w&&s.write(`${n("gray",f)}
119
+ `);let k=0,z=0;L(),g=setInterval(()=>{if(u&&m===b)return;B(),b=m;let Q=C(o[k]),ie;if(u)ie=`${Q} ${m}...`;else if(e==="timer")ie=`${Q} ${m} ${W($)}`;else{let Ce=".".repeat(Math.floor(z)).slice(0,3);ie=`${Q} ${m}${Ce}`}let de=se(ie,v,{hard:!0,trim:!1});s.write(de),k=k+1<o.length?k+1:0,z=z<4?z+.125:0},a)},H=(S="",k=0,z=!1)=>{if(!p)return;p=!1,clearInterval(g),B();let Q=k===0?n("green",$e):k===1?n("red",St):n("red",Et);m=S??m,z||(e==="timer"?s.write(`${Q} ${m} ${W($)}
120
120
  `):s.write(`${Q} ${m}
121
- `)),M(),d()};return{start:O,stop:(S="")=>q(S,0),message:(S="")=>{m=N(S??m)},cancel:(S="")=>q(S,1),error:(S="")=>q(S,2),clear:()=>q("",0,!0),get isCancelled(){return y}}},ws={light:_("\u2500","-"),heavy:_("\u2501","="),block:_("\u2588","#")};Ke=(e,t)=>e.includes(`
121
+ `)),M(),d()};return{start:O,stop:(S="")=>H(S,0),message:(S="")=>{m=N(S??m)},cancel:(S="")=>H(S,1),error:(S="")=>H(S,2),clear:()=>H("",0,!0),get isCancelled(){return y}}},ws={light:F("\u2500","-"),heavy:F("\u2501","="),block:F("\u2588","#")};Je=(e,t)=>e.includes(`
122
122
  `)?e.split(`
123
123
  `).map(s=>t(s)).join(`
124
- `):t(e),H=e=>{let t=(s,r)=>{let i=s.label??String(s.value);switch(r){case"disabled":return`${n("gray",pe)} ${Ke(i,o=>n("gray",o))}${s.hint?` ${n("dim",`(${s.hint??"disabled"})`)}`:""}`;case"selected":return`${Ke(i,o=>n("dim",o))}`;case"active":return`${n("green",Fe)} ${i}${s.hint?` ${n("dim",`(${s.hint})`)}`:""}`;case"cancelled":return`${Ke(i,o=>n(["strikethrough","dim"],o))}`;default:return`${n("dim",pe)} ${Ke(i,o=>n("dim",o))}`}};return new We({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue,render(){let s=e.withGuide??I.withGuide,r=`${J(this.state)} `,i=`${Bt(this.state)} `,o=G(e.output,e.message,i,r),a=`${s?`${n("gray",f)}
124
+ `):t(e),q=e=>{let t=(s,r)=>{let i=s.label??String(s.value);switch(r){case"disabled":return`${n("gray",fe)} ${Je(i,o=>n("gray",o))}${s.hint?` ${n("dim",`(${s.hint??"disabled"})`)}`:""}`;case"selected":return`${Je(i,o=>n("dim",o))}`;case"active":return`${n("green",Oe)} ${i}${s.hint?` ${n("dim",`(${s.hint})`)}`:""}`;case"cancelled":return`${Je(i,o=>n(["strikethrough","dim"],o))}`;default:return`${n("dim",fe)} ${Je(i,o=>n("dim",o))}`}};return new He({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue,render(){let s=e.withGuide??I.withGuide,r=`${J(this.state)} `,i=`${kt(this.state)} `,o=G(e.output,e.message,i,r),a=`${s?`${n("gray",f)}
125
125
  `:""}${o}
126
126
  `;switch(this.state){case"submit":{let l=s?`${n("gray",f)} `:"",c=G(e.output,t(this.options[this.cursor],"selected"),l);return`${a}${c}`}case"cancel":{let l=s?`${n("gray",f)} `:"",c=G(e.output,t(this.options[this.cursor],"cancelled"),l);return`${a}${c}${s?`
127
127
  ${n("gray",f)}`:""}`}default:{let l=s?`${n("cyan",f)} `:"",c=s?n("cyan",V):"",u=a.split(`
128
128
  `).length,d=s?2:1;return`${a}${l}${ce({output:e.output,cursor:this.cursor,options:this.options,maxItems:e.maxItems,columnPadding:l.length,rowPadding:u+d,style:(g,p)=>t(g,g.disabled?"disabled":p?"active":"inactive")}).join(`
129
129
  ${l}`)}
130
130
  ${c}
131
- `}}}}).prompt()},fi=e=>{let t=(s,r="inactive")=>{let i=s.label??String(s.value);return r==="selected"?`${n("dim",i)}`:r==="cancelled"?`${n(["strikethrough","dim"],i)}`:r==="active"?`${n(["bgCyan","gray"],` ${s.value} `)} ${i}${s.hint?` ${n("dim",`(${s.hint})`)}`:""}`:`${n(["gray","bgWhite","inverse"],` ${s.value} `)} ${i}${s.hint?` ${n("dim",`(${s.hint})`)}`:""}`};return new qe({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue,caseSensitive:e.caseSensitive,render(){let s=e.withGuide??I.withGuide,r=`${s?`${n("gray",f)}
131
+ `}}}}).prompt()},fi=e=>{let t=(s,r="inactive")=>{let i=s.label??String(s.value);return r==="selected"?`${n("dim",i)}`:r==="cancelled"?`${n(["strikethrough","dim"],i)}`:r==="active"?`${n(["bgCyan","gray"],` ${s.value} `)} ${i}${s.hint?` ${n("dim",`(${s.hint})`)}`:""}`:`${n(["gray","bgWhite","inverse"],` ${s.value} `)} ${i}${s.hint?` ${n("dim",`(${s.hint})`)}`:""}`};return new Ke({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue,caseSensitive:e.caseSensitive,render(){let s=e.withGuide??I.withGuide,r=`${s?`${n("gray",f)}
132
132
  `:""}${J(this.state)} ${e.message}
133
133
  `;switch(this.state){case"submit":{let i=s?`${n("gray",f)} `:"",o=this.options.find(l=>l.value===this.value)??e.options[0],a=G(e.output,t(o,"selected"),i);return`${r}${a}`}case"cancel":{let i=s?`${n("gray",f)} `:"",o=G(e.output,t(this.options[0],"cancelled"),i);return`${r}${o}${s?`
134
134
  ${n("gray",f)}`:""}`}default:{let i=s?`${n("cyan",f)} `:"",o=s?n("cyan",V):"",a=this.options.map((l,c)=>G(e.output,t(l,c===this.cursor?"active":"inactive"),i)).join(`
135
135
  `);return`${r}${a}
136
136
  ${o}
137
- `}}}}).prompt()},Cs=`${n("gray",f)} `,de={message:async(e,{symbol:t=n("gray",f)}={})=>{process.stdout.write(`${n("gray",f)}
137
+ `}}}}).prompt()},Cs=`${n("gray",f)} `,pe={message:async(e,{symbol:t=n("gray",f)}={})=>{process.stdout.write(`${n("gray",f)}
138
138
  ${t} `);let s=3;for await(let r of e){r=r.replace(/\n/g,`
139
139
  ${Cs}`),r.includes(`
140
140
  `)&&(s=3+Ct(r.slice(r.lastIndexOf(`
141
141
  `))).length);let i=Ct(r).length;s+i<process.stdout.columns?(s+=i,process.stdout.write(r)):(process.stdout.write(`
142
142
  ${Cs}${r.trimStart()}`),s=3+Ct(r.trimStart()).length)}process.stdout.write(`
143
- `)},info:e=>de.message(e,{symbol:n("blue",At)}),success:e=>de.message(e,{symbol:n("green",Ft)}),step:e=>de.message(e,{symbol:n("green",ge)}),warn:e=>de.message(e,{symbol:n("yellow",Mt)}),warning:e=>de.warn(e),error:e=>de.message(e,{symbol:n("red",Ot)})},$i=async(e,t)=>{for(let s of e){if(s.enabled===!1)continue;let r=$e(t);r.start(s.title);let i=await s.task(r.message);r.stop(i||s.title)}},yi=e=>e.replace(/\x1b\[(?:\d+;)*\d*[ABCDEFGHfJKSTsu]|\x1b\[(s|u)/g,""),vi=e=>{let t=e.output??process.stdout,s=he(t),r=n("gray",f),i=e.spacing??1,o=3,a=e.retainLog===!0,l=!It()&&Is(t);t.write(`${r}
144
- `),t.write(`${n("green",ge)} ${e.title}
143
+ `)},info:e=>pe.message(e,{symbol:n("blue",At)}),success:e=>pe.message(e,{symbol:n("green",Ft)}),step:e=>pe.message(e,{symbol:n("green",$e)}),warn:e=>pe.message(e,{symbol:n("yellow",Mt)}),warning:e=>pe.warn(e),error:e=>pe.message(e,{symbol:n("red",Ot)})},$i=async(e,t)=>{for(let s of e){if(s.enabled===!1)continue;let r=ve(t);r.start(s.title);let i=await s.task(r.message);r.stop(i||s.title)}},yi=e=>e.replace(/\x1b\[(?:\d+;)*\d*[ABCDEFGHfJKSTsu]|\x1b\[(s|u)/g,""),vi=e=>{let t=e.output??process.stdout,s=me(t),r=n("gray",f),i=e.spacing??1,o=3,a=e.retainLog===!0,l=!It()&&Is(t);t.write(`${r}
144
+ `),t.write(`${n("green",$e)} ${e.title}
145
145
  `);for(let $=0;$<i;$++)t.write(`${r}
146
- `);let c=[{value:"",full:""}],u=!1,d=$=>{if(c.length===0)return;let v=0;$&&(v+=i+2);for(let C of c){let{value:T,result:R}=C,x=R?.message??T;if(x.length===0)continue;R===void 0&&C.header!==void 0&&C.header!==""&&(x+=`
146
+ `);let c=[{value:"",full:""}],u=!1,d=$=>{if(c.length===0)return;let v=0;$&&(v+=i+2);for(let C of c){let{value:R,result:T}=C,x=T?.message??R;if(x.length===0)continue;T===void 0&&C.header!==void 0&&C.header!==""&&(x+=`
147
147
  ${C.header}`);let L=x.split(`
148
- `).reduce((M,k)=>k===""?M+1:M+Math.ceil((k.length+o)/s),0);v+=L}v>0&&(v+=1,t.write(Se.erase.lines(v)))},g=($,v,C)=>{let T=C?`${$.full}
148
+ `).reduce((M,B)=>B===""?M+1:M+Math.ceil((B.length+o)/s),0);v+=L}v>0&&(v+=1,t.write(xe.erase.lines(v)))},g=($,v,C)=>{let R=C?`${$.full}
149
149
  ${$.value}`:$.value;$.header!==void 0&&$.header!==""&&E.message($.header.split(`
150
- `).map(R=>n("bold",R)),{output:t,secondarySymbol:r,symbol:r,spacing:0}),E.message(T.split(`
151
- `).map(R=>n("dim",R)),{output:t,secondarySymbol:r,symbol:r,spacing:v??i})},p=()=>{for(let $ of c){let{header:v,value:C,full:T}=$;(v===void 0||v.length===0)&&C.length===0||g($,void 0,a===!0&&T.length>0)}},y=($,v,C)=>{if(d(!1),(C?.raw!==!0||!u)&&$.value!==""&&($.value+=`
152
- `),$.value+=yi(v),u=C?.raw===!0,e.limit!==void 0){let T=$.value.split(`
153
- `),R=T.length-e.limit;if(R>0){let x=T.splice(0,R);a&&($.full+=($.full===""?"":`
150
+ `).map(T=>n("bold",T)),{output:t,secondarySymbol:r,symbol:r,spacing:0}),E.message(R.split(`
151
+ `).map(T=>n("dim",T)),{output:t,secondarySymbol:r,symbol:r,spacing:v??i})},p=()=>{for(let $ of c){let{header:v,value:C,full:R}=$;(v===void 0||v.length===0)&&C.length===0||g($,void 0,a===!0&&R.length>0)}},y=($,v,C)=>{if(d(!1),(C?.raw!==!0||!u)&&$.value!==""&&($.value+=`
152
+ `),$.value+=yi(v),u=C?.raw===!0,e.limit!==void 0){let R=$.value.split(`
153
+ `),T=R.length-e.limit;if(T>0){let x=R.splice(0,T);a&&($.full+=($.full===""?"":`
154
154
  `)+x.join(`
155
- `))}$.value=T.join(`
156
- `)}l&&m()},m=()=>{for(let $ of c)$.result?$.result.status==="error"?E.error($.result.message,{output:t,secondarySymbol:r,spacing:0}):E.success($.result.message,{output:t,secondarySymbol:r,spacing:0}):$.value!==""&&g($,0)},b=($,v)=>{d(!1),$.result=v,l&&m()};return{message($,v){y(c[0],$,v)},group($){let v={header:$,value:"",full:""};return c.push(v),{message(C,T){y(v,C,T)},error(C){b(v,{status:"error",message:C})},success(C){b(v,{status:"success",message:C})}}},error($,v){d(!0),E.error($,{output:t,secondarySymbol:r,spacing:1}),v?.showLog!==!1&&p(),c.splice(1,c.length-1),c[0].value="",c[0].full=""},success($,v){d(!0),E.success($,{output:t,secondarySymbol:r,spacing:1}),v?.showLog===!0&&p(),c.splice(1,c.length-1),c[0].value="",c[0].full=""}}},ue=e=>new He({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,output:e.output,signal:e.signal,input:e.input,render(){let t=e?.withGuide??I.withGuide,s=`${`${t?`${n("gray",f)}
155
+ `))}$.value=R.join(`
156
+ `)}l&&m()},m=()=>{for(let $ of c)$.result?$.result.status==="error"?E.error($.result.message,{output:t,secondarySymbol:r,spacing:0}):E.success($.result.message,{output:t,secondarySymbol:r,spacing:0}):$.value!==""&&g($,0)},b=($,v)=>{d(!1),$.result=v,l&&m()};return{message($,v){y(c[0],$,v)},group($){let v={header:$,value:"",full:""};return c.push(v),{message(C,R){y(v,C,R)},error(C){b(v,{status:"error",message:C})},success(C){b(v,{status:"success",message:C})}}},error($,v){d(!0),E.error($,{output:t,secondarySymbol:r,spacing:1}),v?.showLog!==!1&&p(),c.splice(1,c.length-1),c[0].value="",c[0].full=""},success($,v){d(!0),E.success($,{output:t,secondarySymbol:r,spacing:1}),v?.showLog===!0&&p(),c.splice(1,c.length-1),c[0].value="",c[0].full=""}}},ue=e=>new ze({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,output:e.output,signal:e.signal,input:e.input,render(){let t=e?.withGuide??I.withGuide,s=`${`${t?`${n("gray",f)}
157
157
  `:""}${J(this.state)} `}${e.message}
158
158
  `,r=e.placeholder?n("inverse",e.placeholder[0])+n("dim",e.placeholder.slice(1)):n(["inverse","hidden"],"_"),i=this.userInput?this.userInputWithCursor:r,o=this.value??"";switch(this.state){case"error":{let a=this.error?` ${n("yellow",this.error)}`:"",l=t?`${n("yellow",f)} `:"",c=t?n("yellow",V):"";return`${s.trim()}
159
159
  ${l}${i}
@@ -161,12 +161,12 @@ ${c}${a}
161
161
  `}case"submit":{let a=o?` ${n("dim",o)}`:"",l=t?n("gray",f):"";return`${s}${l}${a}`}case"cancel":{let a=o?` ${n(["strikethrough","dim"],o)}`:"",l=t?n("gray",f):"";return`${s}${l}${a}${o.trim()?`
162
162
  ${l}`:""}`}default:{let a=t?`${n("cyan",f)} `:"",l=t?n("cyan",V):"";return`${s}${a}${i}
163
163
  ${l}
164
- `}}}}).prompt()});Z();Z();import{spawnSync as tr}from"child_process";Z();Z();import{existsSync as Bs,readFileSync as bi,writeFileSync as wi,mkdirSync as Ci}from"fs";import Ii from"os";import ks from"path";var Nt=ks.join(Ii.homedir(),".eazy-git"),Dt=ks.join(Nt,"config.json"),Os={language:"es",defaultBaseBranch:"release",aiProvider:"claude"};function Y(){try{if(Bs(Dt)){let e=bi(Dt,"utf-8");return{...Os,...JSON.parse(e)}}}catch{}return{...Os}}function Qe(e){let s={...Y(),...e};return Bs(Nt)||Ci(Nt,{recursive:!0}),wi(Dt,JSON.stringify(s,null,2)),s}var Ls={welcome:"Bienvenido a",subtitle:"tu CLI de confianza para gestionar ramas en GIT",operationCompleted:"Operacion completada!",operationCancelled:"Operacion cancelada. Saliendo...",unknownCommand:"Comando desconocido",errorExecuting:"Error al ejecutar el comando",version:"eazy-git version",whatToDo:"Que deseas hacer?",addChanges:"Agregar cambios a una rama",createOriginal:"Crear rama original",createTemporal:"Crear rama temporal",notGitRepo:"Este directorio no es un repositorio git",gitNotInstalled:"git no esta instalado en el sistema",currentBranch:"Branch actual",filesChanged:"Archivos con cambios",noChangesPending:"No hay cambios pendientes. Deseas continuar de todas formas?",updatingRefs:"Actualizando referencias remotas...",refsUpdated:"Referencias actualizadas",fetchFailed:"No se pudo hacer fetch (continuando...)",baseBranch:"Desde que branch base quieres crear la rama?",baseBranchRequired:"El branch base es requerido",ticketId:"Cual es el identificador del ticket? (ej: DPW-0000)",ticketRequired:"El ticket es requerido",changeType:"Que tipo de cambio es?",branchExistsLocal:e=>`La rama "${e}" ya existe localmente. Que deseas hacer?`,switchToIt:"Cambiarme a ella y continuar",cancel:"Cancelar",cancelledOp:"Operacion cancelada.",creatingBranch:(e,t)=>`Creando rama ${e} desde origin/${t}...`,branchCreated:e=>`Rama ${e} creada`,errorCreatingBranch:e=>`Error al crear la rama: ${e}`,noFilesToStage:"No hay archivos para stagear.",selectFiles:"Cuales archivos quieres incluir en el commit?",selectAllFiles:"Seleccionar todos los archivos",stagedFiles:"Archivos en stage",stagedCorrect:"Los archivos en stage son correctos?",aiProvider:"Con que IA quieres generar la sugerencia de commit?",generatingCommit:e=>`Generando sugerencia de commit con ${e}...`,aiSuggestionFailed:e=>`No se pudo obtener sugerencia de ${e}. Escribe el mensaje manualmente.`,writeCommitMsg:"Escribe el mensaje de commit:",commitMsgRequired:"El mensaje es requerido",suggestionOf:e=>`Sugerencia de ${e}`,useThisCommit:"Este mensaje de commit te parece bien?",yesUseIt:"Si, usar este",modify:"Modificar",commitSuccess:"Commit realizado correctamente",hookBlocked:"El pre-commit hook bloqueo el commit. Que deseas hacer?",retryHook:"Ya lo corregi, agrega los cambios y vuelve a intentarlo",skipHook:"Saltar el hook (--no-verify)",commitNoHooks:"Commit realizado (sin hooks)",pushToRemote:"Deseas subir la rama al repositorio remoto?",pushSuccess:"Push realizado",pushForceQuestion:"La rama ya existe en el remoto con historial diferente. Deseas forzar el push? (git push -f)",pushForceSuccess:"Push forzado realizado",pushForceError:e=>`Error en el push forzado: ${e}`,pushError:e=>`Error en el push: ${e}`,summaryTitle:"Resumen",summaryBranch:"Rama",summaryFrom:"Desde",summaryCommit:"Commit",summaryFiles:e=>`${e} archivos commiteados`,summaryPush:"Push",summaryPR:"Crear PR",statusModified:"modificado",statusAdded:"agregado",statusDeleted:"eliminado",statusRenamed:"renombrado",statusUntracked:"sin rastrear",commitTypes:{fix:"fix \u2014 correccion de bug",feat:"feat \u2014 nueva funcionalidad",refactor:"refactor \u2014 mejora sin cambio funcional",chore:"chore \u2014 mantenimiento, dependencias",docs:"docs \u2014 documentacion",test:"test \u2014 pruebas",ci:"ci \u2014 integracion continua",perf:"perf \u2014 rendimiento",style:"style \u2014 formato, sin cambio de logica"},selectBranchType:"Selecciona el tipo de rama:",branchFix:"Fix",branchImprovement:"Mejora",branchFeature:"Feature",branchRefactor:"Refactor",creatingOriginalBranch:"Creando rama original...",branchCreatedAndPushed:e=>`Rama "${e}" creada y pusheada correctamente!`,branchCreatedSuccess:e=>`Rama "${e}" creada correctamente!`,mergeBranchQuestion:"A que rama deseas hacer merge?",developDEV:"develop (DEV)",releaseUAT:"release (UAT)",temporalBranchCreated:"Rama temporal creada correctamente",temporalBranchMerged:"Rama temporal mergeada correctamente",conflictsDetected:"Conflictos detectados. Resolvelos manualmente!",branchPushedToRemote:"Rama pusheada al repositorio remoto",removeTemporalBranch:"Deseas eliminar la rama temporal?",temporalBranchDeleted:"Rama temporal eliminada correctamente",errorCreatingTemporal:"Error creando la rama temporal",enterJiraCode:"Ingresa el codigo del ticket JIRA:",jiraRequired:"El codigo JIRA es requerido!",jiraInvalidFormat:"El codigo JIRA debe tener el formato DPW-0000",fetchingRemote:"Obteniendo cambios remotos...",pullingChanges:"Aplicando cambios en tu rama...",pullError:e=>`Error: ${e}`,pushingChanges:"Subiendo cambios al remoto...",pushedSuccess:"Cambios subidos correctamente!",pushedForceSuccess:"Cambios subidos (forzado) correctamente!",pushQuickError:e=>`Error: ${e}`,provideCommitMsg:"Proporciona un mensaje de commit",stagingChanges:"Stageando cambios...",creatingCommit:"Creando commit...",commitCreated:"Commit creado correctamente!",commitError:e=>`Error: ${e}`,switchingPrevBranch:"Cambiando a la rama anterior...",switchedTo:e=>`Cambiado a rama ${e} correctamente!`,checkoutError:e=>`Error: ${e}`,fetchingLatest:"Obteniendo ultimos cambios...",mergingWith:e=>`Mergeando con ${e}...`,pushingMerged:"Subiendo cambios mergeados...",mergeCompleted:"Merge completado correctamente!",mergeError:e=>`Error: ${e}`,removingLastCommit:"Eliminando ultimo commit...",removeLastConfirm:"Esto eliminara el ultimo commit (los cambios se mantienen en staging). Continuar?",lastCommitRemoved:"Ultimo commit eliminado correctamente!",removeLastError:e=>`Error: ${e}`,logError:e=>`Error: ${e}`,settingUpConfig:"Configurando tu entorno",configSaved:"Configuracion guardada",missingConfigValues:"Faltan valores de configuracion requeridos.",errorWritingConfig:"Error escribiendo archivo de configuracion:",currentConfig:"Configuracion actual",useThisConfig:"Deseas usar esta configuracion?",installingDeps:"Instalando dependencias...",depsInstalled:"Todas las dependencias fueron instaladas",authFailed:"Autenticacion fallida",unexpectedError:"Ocurrio un error inesperado",enterEndpoint:"Ingresa la URL del endpoint:",urlRequired:"La URL es requerida!",urlMustBeHttp:"La URL debe usar protocolo HTTP/HTTPS",urlMustHaveHost:"La URL debe incluir un hostname",urlInvalid:"Ingresa una URL valida",enterApiKey:"Ingresa tu apikey:",apiKeyRequired:"El API key es requerido!",enterRegistryName:"Ingresa el nombre del registro NPM (sin caracteres especiales):",registryNameRequired:"El nombre del registro es requerido!",registryNameLettersOnly:"El nombre del registro debe contener solo letras",enterRegistryURL:"Ingresa la URL del registro NPM (sin http/https):",registryURLRequired:"La URL del registro es requerida!",registryURLStartWithName:"La URL debe empezar con un nombre, evita caracteres especiales",registryURLNoProtocol:"La URL no debe incluir protocolo 'http/https' y debe empezar con una letra",registryURLNoSlash:"La URL no debe empezar con '/' y debe empezar con una letra o numero",registryURLNoWWW:"La URL no debe empezar con 'www' y debe empezar con una letra o numero",languageSelect:"Selecciona el idioma de la interfaz:",languageChanged:e=>`Idioma cambiado a: ${e}`,configMenu:"Que deseas configurar?",configLanguage:"Idioma de la interfaz",configDefaultBranch:"Rama base por defecto",configAIProvider:"Proveedor de IA por defecto",configView:"Ver configuracion actual",defaultBranchSet:e=>`Rama base por defecto: ${e}`,aiProviderSet:e=>`Proveedor de IA por defecto: ${e}`};var Ps={welcome:"Welcome to",subtitle:"your trusted CLI for GIT branch management",operationCompleted:"Operation completed!",operationCancelled:"Operation cancelled. Exiting...",unknownCommand:"Unknown command",errorExecuting:"Error executing command",version:"eazy-git version",whatToDo:"What would you like to do?",addChanges:"Add Changes to Branch",createOriginal:"Create Original Branch",createTemporal:"Create Temporal Branch",notGitRepo:"This directory is not a git repository",gitNotInstalled:"git is not installed on the system",currentBranch:"Current branch",filesChanged:"Files with changes",noChangesPending:"No pending changes. Do you want to continue anyway?",updatingRefs:"Updating remote references...",refsUpdated:"References updated",fetchFailed:"Could not fetch (continuing...)",baseBranch:"From which base branch do you want to create the branch?",baseBranchRequired:"Base branch is required",ticketId:"What is the ticket identifier? (e.g.: DPW-0000)",ticketRequired:"Ticket is required",changeType:"What type of change is this?",branchExistsLocal:e=>`Branch "${e}" already exists locally. What would you like to do?`,switchToIt:"Switch to it and continue",cancel:"Cancel",cancelledOp:"Operation cancelled.",creatingBranch:(e,t)=>`Creating branch ${e} from origin/${t}...`,branchCreated:e=>`Branch ${e} created`,errorCreatingBranch:e=>`Error creating branch: ${e}`,noFilesToStage:"No files to stage.",selectFiles:"Which files do you want to include in the commit?",selectAllFiles:"Select all files",stagedFiles:"Staged files",stagedCorrect:"Are the staged files correct?",aiProvider:"Which AI do you want to use for the commit suggestion?",generatingCommit:e=>`Generating commit suggestion with ${e}...`,aiSuggestionFailed:e=>`Could not get suggestion from ${e}. Write the message manually.`,writeCommitMsg:"Write the commit message:",commitMsgRequired:"Message is required",suggestionOf:e=>`${e} suggestion`,useThisCommit:"Does this commit message look good?",yesUseIt:"Yes, use it",modify:"Modify",commitSuccess:"Commit created successfully",hookBlocked:"The pre-commit hook blocked the commit. What would you like to do?",retryHook:"I fixed it, re-stage and retry",skipHook:"Skip the hook (--no-verify)",commitNoHooks:"Commit created (without hooks)",pushToRemote:"Do you want to push the branch to the remote repository?",pushSuccess:"Push completed",pushForceQuestion:"The branch already exists on remote with different history. Force push? (git push -f)",pushForceSuccess:"Force push completed",pushForceError:e=>`Error in force push: ${e}`,pushError:e=>`Error in push: ${e}`,summaryTitle:"Summary",summaryBranch:"Branch",summaryFrom:"From",summaryCommit:"Commit",summaryFiles:e=>`${e} files committed`,summaryPush:"Push",summaryPR:"Create PR",statusModified:"modified",statusAdded:"added",statusDeleted:"deleted",statusRenamed:"renamed",statusUntracked:"untracked",commitTypes:{fix:"fix - bug fix",feat:"feat - new feature",refactor:"refactor - improvement without functional change",chore:"chore - maintenance, dependencies",docs:"docs - documentation",test:"test - testing",ci:"ci - continuous integration",perf:"perf - performance",style:"style - formatting, no logic change"},selectBranchType:"Select the branch type:",branchFix:"Fix",branchImprovement:"Improvement",branchFeature:"Feature",branchRefactor:"Refactor",creatingOriginalBranch:"Creating original branch...",branchCreatedAndPushed:e=>`Branch "${e}" created and pushed successfully!`,branchCreatedSuccess:e=>`Branch "${e}" created successfully!`,mergeBranchQuestion:"Which branch do you want to merge into?",developDEV:"develop (DEV)",releaseUAT:"release (UAT)",temporalBranchCreated:"Temporal branch created successfully",temporalBranchMerged:"Temporal branch merged successfully",conflictsDetected:"Conflicts detected. Please resolve them manually!",branchPushedToRemote:"Branch pushed to remote repository",removeTemporalBranch:"Do you want to remove the temporal branch?",temporalBranchDeleted:"Temporal branch deleted successfully",errorCreatingTemporal:"Error creating the temporal branch",enterJiraCode:"Enter the JIRA ticket code:",jiraRequired:"JIRA code is required!",jiraInvalidFormat:"JIRA code must have the format DPW-0000",fetchingRemote:"Fetching remote changes...",pullingChanges:"Pulling changes into your branch...",pullError:e=>`Error: ${e}`,pushingChanges:"Pushing changes to remote...",pushedSuccess:"Changes pushed successfully!",pushedForceSuccess:"Changes pushed (force) successfully!",pushQuickError:e=>`Error: ${e}`,provideCommitMsg:"Please provide a commit message",stagingChanges:"Staging changes...",creatingCommit:"Creating commit...",commitCreated:"Commit created successfully!",commitError:e=>`Error: ${e}`,switchingPrevBranch:"Switching to previous branch...",switchedTo:e=>`Successfully switched to ${e} branch!`,checkoutError:e=>`Error: ${e}`,fetchingLatest:"Fetching latest changes...",mergingWith:e=>`Merging with ${e}...`,pushingMerged:"Pushing merged changes...",mergeCompleted:"Merge completed successfully!",mergeError:e=>`Error: ${e}`,removingLastCommit:"Removing last commit...",removeLastConfirm:"This will remove the last commit (changes will remain in staging). Continue?",lastCommitRemoved:"Last commit removed successfully!",removeLastError:e=>`Error: ${e}`,logError:e=>`Error: ${e}`,settingUpConfig:"Setting up your configuration",configSaved:"Configuration saved",missingConfigValues:"Missing required configuration values.",errorWritingConfig:"Error writing configuration file:",currentConfig:"Current configuration",useThisConfig:"Would you like to use this configuration?",installingDeps:"Installing dependencies...",depsInstalled:"All dependencies were installed",authFailed:"Authentication failed",unexpectedError:"An unexpected error occurred",enterEndpoint:"Enter your endpoint URL:",urlRequired:"URL is required!",urlMustBeHttp:"URL must use HTTP/HTTPS protocol",urlMustHaveHost:"URL must include a hostname",urlInvalid:"Please enter a valid URL",enterApiKey:"Enter your apikey:",apiKeyRequired:"API key is required!",enterRegistryName:"Enter your NPM registry name (without special characters):",registryNameRequired:"Registry name is required!",registryNameLettersOnly:"Registry name must contain only letters",enterRegistryURL:"Enter your NPM registry URL (without http/https):",registryURLRequired:"Registry URL is required!",registryURLStartWithName:"URL must start with a name only, avoid special characters",registryURLNoProtocol:"URL must not include 'http/https' protocol and must start with a letter",registryURLNoSlash:"URL must not start with '/' and must begin with a letter or number",registryURLNoWWW:"URL must not start with 'www' and must begin with a letter or number",languageSelect:"Select the interface language:",languageChanged:e=>`Language changed to: ${e}`,configMenu:"What would you like to configure?",configLanguage:"Interface language",configDefaultBranch:"Default base branch",configAIProvider:"Default AI provider",configView:"View current configuration",defaultBranchSet:e=>`Default base branch: ${e}`,aiProviderSet:e=>`Default AI provider: ${e}`};var Xe={es:Ls,en:Ps};function h(e,...t){let r=Y().language||"es",o=(Xe[r]||Xe.es)[e];return typeof o=="function"?o(...t):o||e}function Ns(){let t=Y().language||"es";return(Xe[t]||Xe.es).commitTypes}function Ds(){return[{value:"es",label:"Espanol"},{value:"en",label:"English"}]}function A(e){if(Ie(e))return Me(h("operationCancelled")),process.exit(0)}var Vs=(e=0)=>t=>`\x1B[${t+e}m`,Us=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,Gs=(e=0)=>(t,s,r)=>`\x1B[${38+e};2;${t};${s};${r}m`,P={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]}},qn=Object.keys(P.modifier),Si=Object.keys(P.color),Ei=Object.keys(P.bgColor),Hn=[...Si,...Ei];function xi(){let e=new Map;for(let[t,s]of Object.entries(P)){for(let[r,i]of Object.entries(s))P[r]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},s[r]=P[r],e.set(i[0],i[1]);Object.defineProperty(P,t,{value:s,enumerable:!1})}return Object.defineProperty(P,"codes",{value:e,enumerable:!1}),P.color.close="\x1B[39m",P.bgColor.close="\x1B[49m",P.color.ansi=Vs(),P.color.ansi256=Us(),P.color.ansi16m=Gs(),P.bgColor.ansi=Vs(10),P.bgColor.ansi256=Us(10),P.bgColor.ansi16m=Gs(10),Object.defineProperties(P,{rgbToAnsi256:{value(t,s,r){return t===s&&s===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(s/255*5)+Math.round(r/255*5)},enumerable:!1},hexToRgb:{value(t){let s=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!s)return[0,0,0];let[r]=s;r.length===3&&(r=[...r].map(o=>o+o).join(""));let i=Number.parseInt(r,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:t=>P.rgbToAnsi256(...P.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let s,r,i;if(t>=232)s=((t-232)*10+8)/255,r=s,i=s;else{t-=16;let l=t%36;s=Math.floor(t/36)/5,r=Math.floor(l/6)/5,i=l%6/5}let o=Math.max(s,r,i)*2;if(o===0)return 30;let a=30+(Math.round(i)<<2|Math.round(r)<<1|Math.round(s));return o===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(t,s,r)=>P.ansi256ToAnsi(P.rgbToAnsi256(t,s,r)),enumerable:!1},hexToAnsi:{value:t=>P.ansi256ToAnsi(P.hexToAnsi256(t)),enumerable:!1}}),P}var Ti=xi(),re=Ti;import Vt from"node:process";import Ri from"node:os";import js from"node:tty";function ee(e,t=globalThis.Deno?globalThis.Deno.args:Vt.argv){let s=e.startsWith("-")?"":e.length===1?"-":"--",r=t.indexOf(s+e),i=t.indexOf("--");return r!==-1&&(i===-1||r<i)}var{env:U}=Vt,Ze;ee("no-color")||ee("no-colors")||ee("color=false")||ee("color=never")?Ze=0:(ee("color")||ee("colors")||ee("color=true")||ee("color=always"))&&(Ze=1);function _i(){if("FORCE_COLOR"in U)return U.FORCE_COLOR==="true"?1:U.FORCE_COLOR==="false"?0:U.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(U.FORCE_COLOR,10),3)}function Ai(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Fi(e,{streamIsTTY:t,sniffFlags:s=!0}={}){let r=_i();r!==void 0&&(Ze=r);let i=s?Ze:r;if(i===0)return 0;if(s){if(ee("color=16m")||ee("color=full")||ee("color=truecolor"))return 3;if(ee("color=256"))return 2}if("TF_BUILD"in U&&"AGENT_NAME"in U)return 1;if(e&&!t&&i===void 0)return 0;let o=i||0;if(U.TERM==="dumb")return o;if(Vt.platform==="win32"){let a=Ri.release().split(".");return Number(a[0])>=10&&Number(a[2])>=10586?Number(a[2])>=14931?3:2:1}if("CI"in U)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(a=>a in U)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(a=>a in U)||U.CI_NAME==="codeship"?1:o;if("TEAMCITY_VERSION"in U)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(U.TEAMCITY_VERSION)?1:0;if(U.COLORTERM==="truecolor"||U.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in U){let a=Number.parseInt((U.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(U.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(U.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(U.TERM)||"COLORTERM"in U?1:o}function Ws(e,t={}){let s=Fi(e,{streamIsTTY:e&&e.isTTY,...t});return Ai(s)}var Mi={stdout:Ws({isTTY:js.isatty(1)}),stderr:Ws({isTTY:js.isatty(2)})},qs=Mi;function Hs(e,t,s){let r=e.indexOf(t);if(r===-1)return e;let i=t.length,o=0,a="";do a+=e.slice(o,r)+t+s,o=r+i,r=e.indexOf(t,o);while(r!==-1);return a+=e.slice(o),a}function Ks(e,t,s,r){let i=0,o="";do{let a=e[r-1]==="\r";o+=e.slice(i,a?r-1:r)+t+(a?`\r
164
+ `}}}}).prompt()});Z();Z();import{spawnSync as tr}from"child_process";Z();Z();import{existsSync as ks,readFileSync as bi,writeFileSync as wi,mkdirSync as Ci}from"fs";import Ii from"os";import Bs from"path";var Nt=Bs.join(Ii.homedir(),".eazy-git"),Dt=Bs.join(Nt,"config.json"),Os={language:"es",defaultBaseBranch:"release",aiProvider:"claude"};function Y(){try{if(ks(Dt)){let e=bi(Dt,"utf-8");return{...Os,...JSON.parse(e)}}}catch{}return{...Os}}function Ze(e){let s={...Y(),...e};return ks(Nt)||Ci(Nt,{recursive:!0}),wi(Dt,JSON.stringify(s,null,2)),s}var Ls={welcome:"Bienvenido a",subtitle:"tu CLI de confianza para gestionar ramas en GIT",operationCompleted:"Operacion completada!",operationCancelled:"Operacion cancelada. Saliendo...",unknownCommand:"Comando desconocido",errorExecuting:"Error al ejecutar el comando",version:"eazy-git version",whatToDo:"Que deseas hacer?",addChanges:"Agregar cambios a una rama",createOriginal:"Crear rama original",createTemporal:"Crear rama temporal",notGitRepo:"Este directorio no es un repositorio git",gitNotInstalled:"git no esta instalado en el sistema",currentBranch:"Branch actual",filesChanged:"Archivos con cambios",noChangesPending:"No hay cambios pendientes. Deseas continuar de todas formas?",updatingRefs:"Actualizando referencias remotas...",refsUpdated:"Referencias actualizadas",fetchFailed:"No se pudo hacer fetch (continuando...)",baseBranch:"Desde que branch base quieres crear la rama?",baseBranchRequired:"El branch base es requerido",ticketId:"Cual es el identificador del ticket? (ej: DPW-0000)",ticketRequired:"El ticket es requerido",changeType:"Que tipo de cambio es?",branchExistsLocal:e=>`La rama "${e}" ya existe localmente. Que deseas hacer?`,switchToIt:"Cambiarme a ella y continuar",cancel:"Cancelar",cancelledOp:"Operacion cancelada.",creatingBranch:(e,t)=>`Creando rama ${e} desde origin/${t}...`,branchCreated:e=>`Rama ${e} creada`,errorCreatingBranch:e=>`Error al crear la rama: ${e}`,noFilesToStage:"No hay archivos para stagear.",selectFiles:"Cuales archivos quieres incluir en el commit?",selectAllFiles:"Seleccionar todos los archivos",stagedFiles:"Archivos en stage",stagedCorrect:"Los archivos en stage son correctos?",aiProvider:"Con que IA quieres generar la sugerencia de commit?",generatingCommit:e=>`Generando sugerencia de commit con ${e}...`,aiSuggestionFailed:e=>`No se pudo obtener sugerencia de ${e}. Escribe el mensaje manualmente.`,writeCommitMsg:"Escribe el mensaje de commit:",commitMsgRequired:"El mensaje es requerido",suggestionOf:e=>`Sugerencia de ${e}`,useThisCommit:"Este mensaje de commit te parece bien?",yesUseIt:"Si, usar este",modify:"Modificar",commitSuccess:"Commit realizado correctamente",hookBlocked:"El pre-commit hook bloqueo el commit. Que deseas hacer?",retryHook:"Ya lo corregi, agrega los cambios y vuelve a intentarlo",skipHook:"Saltar el hook (--no-verify)",commitNoHooks:"Commit realizado (sin hooks)",pushToRemote:"Deseas subir la rama al repositorio remoto?",pushSuccess:"Push realizado",pushForceQuestion:"La rama ya existe en el remoto con historial diferente. Deseas forzar el push? (git push -f)",pushForceSuccess:"Push forzado realizado",pushForceError:e=>`Error en el push forzado: ${e}`,pushError:e=>`Error en el push: ${e}`,summaryTitle:"Resumen",summaryBranch:"Rama",summaryFrom:"Desde",summaryCommit:"Commit",summaryFiles:e=>`${e} archivos commiteados`,summaryPush:"Push",summaryPR:"Crear PR",statusModified:"modificado",statusAdded:"agregado",statusDeleted:"eliminado",statusRenamed:"renombrado",statusUntracked:"sin rastrear",commitTypes:{fix:"fix \u2014 correccion de bug",feat:"feat \u2014 nueva funcionalidad",refactor:"refactor \u2014 mejora sin cambio funcional",chore:"chore \u2014 mantenimiento, dependencias",docs:"docs \u2014 documentacion",test:"test \u2014 pruebas",ci:"ci \u2014 integracion continua",perf:"perf \u2014 rendimiento",style:"style \u2014 formato, sin cambio de logica"},selectBranchType:"Selecciona el tipo de rama:",branchFix:"Fix",branchImprovement:"Mejora",branchFeature:"Feature",branchRefactor:"Refactor",creatingOriginalBranch:"Creando rama original...",branchCreatedAndPushed:e=>`Rama "${e}" creada y pusheada correctamente!`,branchCreatedSuccess:e=>`Rama "${e}" creada correctamente!`,mergeBranchQuestion:"A que rama deseas hacer merge?",developDEV:"develop (DEV)",releaseUAT:"release (UAT)",temporalBranchCreated:"Rama temporal creada correctamente",temporalBranchMerged:"Rama temporal mergeada correctamente",conflictsDetected:"Conflictos detectados. Resolvelos manualmente!",branchPushedToRemote:"Rama pusheada al repositorio remoto",removeTemporalBranch:"Deseas eliminar la rama temporal?",temporalBranchDeleted:"Rama temporal eliminada correctamente",errorCreatingTemporal:"Error creando la rama temporal",enterJiraCode:"Ingresa el codigo del ticket JIRA:",jiraRequired:"El codigo JIRA es requerido!",jiraInvalidFormat:"El codigo JIRA debe tener el formato DPW-0000",fetchingRemote:"Obteniendo cambios remotos...",pullingChanges:"Aplicando cambios en tu rama...",pullError:e=>`Error: ${e}`,pushingChanges:"Subiendo cambios al remoto...",pushedSuccess:"Cambios subidos correctamente!",pushedForceSuccess:"Cambios subidos (forzado) correctamente!",pushQuickError:e=>`Error: ${e}`,provideCommitMsg:"Proporciona un mensaje de commit",stagingChanges:"Stageando cambios...",creatingCommit:"Creando commit...",commitCreated:"Commit creado correctamente!",commitError:e=>`Error: ${e}`,switchingPrevBranch:"Cambiando a la rama anterior...",switchedTo:e=>`Cambiado a rama ${e} correctamente!`,checkoutError:e=>`Error: ${e}`,fetchingLatest:"Obteniendo ultimos cambios...",mergingWith:e=>`Mergeando con ${e}...`,pushingMerged:"Subiendo cambios mergeados...",mergeCompleted:"Merge completado correctamente!",mergeError:e=>`Error: ${e}`,removingLastCommit:"Eliminando ultimo commit...",removeLastConfirm:"Esto eliminara el ultimo commit (los cambios se mantienen en staging). Continuar?",lastCommitRemoved:"Ultimo commit eliminado correctamente!",removeLastError:e=>`Error: ${e}`,logError:e=>`Error: ${e}`,settingUpConfig:"Configurando tu entorno",configSaved:"Configuracion guardada",missingConfigValues:"Faltan valores de configuracion requeridos.",errorWritingConfig:"Error escribiendo archivo de configuracion:",currentConfig:"Configuracion actual",useThisConfig:"Deseas usar esta configuracion?",installingDeps:"Instalando dependencias...",depsInstalled:"Todas las dependencias fueron instaladas",authFailed:"Autenticacion fallida",unexpectedError:"Ocurrio un error inesperado",enterEndpoint:"Ingresa la URL del endpoint:",urlRequired:"La URL es requerida!",urlMustBeHttp:"La URL debe usar protocolo HTTP/HTTPS",urlMustHaveHost:"La URL debe incluir un hostname",urlInvalid:"Ingresa una URL valida",enterApiKey:"Ingresa tu apikey:",apiKeyRequired:"El API key es requerido!",enterRegistryName:"Ingresa el nombre del registro NPM (sin caracteres especiales):",registryNameRequired:"El nombre del registro es requerido!",registryNameLettersOnly:"El nombre del registro debe contener solo letras",enterRegistryURL:"Ingresa la URL del registro NPM (sin http/https):",registryURLRequired:"La URL del registro es requerida!",registryURLStartWithName:"La URL debe empezar con un nombre, evita caracteres especiales",registryURLNoProtocol:"La URL no debe incluir protocolo 'http/https' y debe empezar con una letra",registryURLNoSlash:"La URL no debe empezar con '/' y debe empezar con una letra o numero",registryURLNoWWW:"La URL no debe empezar con 'www' y debe empezar con una letra o numero",languageSelect:"Selecciona el idioma de la interfaz:",languageChanged:e=>`Idioma cambiado a: ${e}`,configMenu:"Que deseas configurar?",configLanguage:"Cambiar idioma",configDefaultBranch:"Rama base por defecto",configAIProvider:"Proveedor de IA por defecto",configView:"Ver configuracion actual",defaultBranchSet:e=>`Rama base por defecto: ${e}`,aiProviderSet:e=>`Proveedor de IA por defecto: ${e}`,goBack:"Volver"};var Ps={welcome:"Welcome to",subtitle:"your trusted CLI for GIT branch management",operationCompleted:"Operation completed!",operationCancelled:"Operation cancelled. Exiting...",unknownCommand:"Unknown command",errorExecuting:"Error executing command",version:"eazy-git version",whatToDo:"What would you like to do?",addChanges:"Add Changes to Branch",createOriginal:"Create Original Branch",createTemporal:"Create Temporal Branch",notGitRepo:"This directory is not a git repository",gitNotInstalled:"git is not installed on the system",currentBranch:"Current branch",filesChanged:"Files with changes",noChangesPending:"No pending changes. Do you want to continue anyway?",updatingRefs:"Updating remote references...",refsUpdated:"References updated",fetchFailed:"Could not fetch (continuing...)",baseBranch:"From which base branch do you want to create the branch?",baseBranchRequired:"Base branch is required",ticketId:"What is the ticket identifier? (e.g.: DPW-0000)",ticketRequired:"Ticket is required",changeType:"What type of change is this?",branchExistsLocal:e=>`Branch "${e}" already exists locally. What would you like to do?`,switchToIt:"Switch to it and continue",cancel:"Cancel",cancelledOp:"Operation cancelled.",creatingBranch:(e,t)=>`Creating branch ${e} from origin/${t}...`,branchCreated:e=>`Branch ${e} created`,errorCreatingBranch:e=>`Error creating branch: ${e}`,noFilesToStage:"No files to stage.",selectFiles:"Which files do you want to include in the commit?",selectAllFiles:"Select all files",stagedFiles:"Staged files",stagedCorrect:"Are the staged files correct?",aiProvider:"Which AI do you want to use for the commit suggestion?",generatingCommit:e=>`Generating commit suggestion with ${e}...`,aiSuggestionFailed:e=>`Could not get suggestion from ${e}. Write the message manually.`,writeCommitMsg:"Write the commit message:",commitMsgRequired:"Message is required",suggestionOf:e=>`${e} suggestion`,useThisCommit:"Does this commit message look good?",yesUseIt:"Yes, use it",modify:"Modify",commitSuccess:"Commit created successfully",hookBlocked:"The pre-commit hook blocked the commit. What would you like to do?",retryHook:"I fixed it, re-stage and retry",skipHook:"Skip the hook (--no-verify)",commitNoHooks:"Commit created (without hooks)",pushToRemote:"Do you want to push the branch to the remote repository?",pushSuccess:"Push completed",pushForceQuestion:"The branch already exists on remote with different history. Force push? (git push -f)",pushForceSuccess:"Force push completed",pushForceError:e=>`Error in force push: ${e}`,pushError:e=>`Error in push: ${e}`,summaryTitle:"Summary",summaryBranch:"Branch",summaryFrom:"From",summaryCommit:"Commit",summaryFiles:e=>`${e} files committed`,summaryPush:"Push",summaryPR:"Create PR",statusModified:"modified",statusAdded:"added",statusDeleted:"deleted",statusRenamed:"renamed",statusUntracked:"untracked",commitTypes:{fix:"fix - bug fix",feat:"feat - new feature",refactor:"refactor - improvement without functional change",chore:"chore - maintenance, dependencies",docs:"docs - documentation",test:"test - testing",ci:"ci - continuous integration",perf:"perf - performance",style:"style - formatting, no logic change"},selectBranchType:"Select the branch type:",branchFix:"Fix",branchImprovement:"Improvement",branchFeature:"Feature",branchRefactor:"Refactor",creatingOriginalBranch:"Creating original branch...",branchCreatedAndPushed:e=>`Branch "${e}" created and pushed successfully!`,branchCreatedSuccess:e=>`Branch "${e}" created successfully!`,mergeBranchQuestion:"Which branch do you want to merge into?",developDEV:"develop (DEV)",releaseUAT:"release (UAT)",temporalBranchCreated:"Temporal branch created successfully",temporalBranchMerged:"Temporal branch merged successfully",conflictsDetected:"Conflicts detected. Please resolve them manually!",branchPushedToRemote:"Branch pushed to remote repository",removeTemporalBranch:"Do you want to remove the temporal branch?",temporalBranchDeleted:"Temporal branch deleted successfully",errorCreatingTemporal:"Error creating the temporal branch",enterJiraCode:"Enter the JIRA ticket code:",jiraRequired:"JIRA code is required!",jiraInvalidFormat:"JIRA code must have the format DPW-0000",fetchingRemote:"Fetching remote changes...",pullingChanges:"Pulling changes into your branch...",pullError:e=>`Error: ${e}`,pushingChanges:"Pushing changes to remote...",pushedSuccess:"Changes pushed successfully!",pushedForceSuccess:"Changes pushed (force) successfully!",pushQuickError:e=>`Error: ${e}`,provideCommitMsg:"Please provide a commit message",stagingChanges:"Staging changes...",creatingCommit:"Creating commit...",commitCreated:"Commit created successfully!",commitError:e=>`Error: ${e}`,switchingPrevBranch:"Switching to previous branch...",switchedTo:e=>`Successfully switched to ${e} branch!`,checkoutError:e=>`Error: ${e}`,fetchingLatest:"Fetching latest changes...",mergingWith:e=>`Merging with ${e}...`,pushingMerged:"Pushing merged changes...",mergeCompleted:"Merge completed successfully!",mergeError:e=>`Error: ${e}`,removingLastCommit:"Removing last commit...",removeLastConfirm:"This will remove the last commit (changes will remain in staging). Continue?",lastCommitRemoved:"Last commit removed successfully!",removeLastError:e=>`Error: ${e}`,logError:e=>`Error: ${e}`,settingUpConfig:"Setting up your configuration",configSaved:"Configuration saved",missingConfigValues:"Missing required configuration values.",errorWritingConfig:"Error writing configuration file:",currentConfig:"Current configuration",useThisConfig:"Would you like to use this configuration?",installingDeps:"Installing dependencies...",depsInstalled:"All dependencies were installed",authFailed:"Authentication failed",unexpectedError:"An unexpected error occurred",enterEndpoint:"Enter your endpoint URL:",urlRequired:"URL is required!",urlMustBeHttp:"URL must use HTTP/HTTPS protocol",urlMustHaveHost:"URL must include a hostname",urlInvalid:"Please enter a valid URL",enterApiKey:"Enter your apikey:",apiKeyRequired:"API key is required!",enterRegistryName:"Enter your NPM registry name (without special characters):",registryNameRequired:"Registry name is required!",registryNameLettersOnly:"Registry name must contain only letters",enterRegistryURL:"Enter your NPM registry URL (without http/https):",registryURLRequired:"Registry URL is required!",registryURLStartWithName:"URL must start with a name only, avoid special characters",registryURLNoProtocol:"URL must not include 'http/https' protocol and must start with a letter",registryURLNoSlash:"URL must not start with '/' and must begin with a letter or number",registryURLNoWWW:"URL must not start with 'www' and must begin with a letter or number",languageSelect:"Select the interface language:",languageChanged:e=>`Language changed to: ${e}`,configMenu:"What would you like to configure?",configLanguage:"Change language",configDefaultBranch:"Default base branch",configAIProvider:"Default AI provider",configView:"View current configuration",defaultBranchSet:e=>`Default base branch: ${e}`,aiProviderSet:e=>`Default AI provider: ${e}`,goBack:"Go back"};var et={es:Ls,en:Ps};function h(e,...t){let r=Y().language||"es",o=(et[r]||et.es)[e];return typeof o=="function"?o(...t):o||e}function Ns(){let t=Y().language||"es";return(et[t]||et.es).commitTypes}function Ds(){return[{value:"es",label:"Espanol"},{value:"en",label:"English"}]}function A(e){if(Ee(e))return ke(h("operationCancelled")),process.exit(0)}var Vs=(e=0)=>t=>`\x1B[${t+e}m`,Us=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,Gs=(e=0)=>(t,s,r)=>`\x1B[${38+e};2;${t};${s};${r}m`,P={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]}},qn=Object.keys(P.modifier),Si=Object.keys(P.color),Ei=Object.keys(P.bgColor),Hn=[...Si,...Ei];function xi(){let e=new Map;for(let[t,s]of Object.entries(P)){for(let[r,i]of Object.entries(s))P[r]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},s[r]=P[r],e.set(i[0],i[1]);Object.defineProperty(P,t,{value:s,enumerable:!1})}return Object.defineProperty(P,"codes",{value:e,enumerable:!1}),P.color.close="\x1B[39m",P.bgColor.close="\x1B[49m",P.color.ansi=Vs(),P.color.ansi256=Us(),P.color.ansi16m=Gs(),P.bgColor.ansi=Vs(10),P.bgColor.ansi256=Us(10),P.bgColor.ansi16m=Gs(10),Object.defineProperties(P,{rgbToAnsi256:{value(t,s,r){return t===s&&s===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(s/255*5)+Math.round(r/255*5)},enumerable:!1},hexToRgb:{value(t){let s=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!s)return[0,0,0];let[r]=s;r.length===3&&(r=[...r].map(o=>o+o).join(""));let i=Number.parseInt(r,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:t=>P.rgbToAnsi256(...P.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let s,r,i;if(t>=232)s=((t-232)*10+8)/255,r=s,i=s;else{t-=16;let l=t%36;s=Math.floor(t/36)/5,r=Math.floor(l/6)/5,i=l%6/5}let o=Math.max(s,r,i)*2;if(o===0)return 30;let a=30+(Math.round(i)<<2|Math.round(r)<<1|Math.round(s));return o===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(t,s,r)=>P.ansi256ToAnsi(P.rgbToAnsi256(t,s,r)),enumerable:!1},hexToAnsi:{value:t=>P.ansi256ToAnsi(P.hexToAnsi256(t)),enumerable:!1}}),P}var Ri=xi(),re=Ri;import Vt from"node:process";import Ti from"node:os";import js from"node:tty";function ee(e,t=globalThis.Deno?globalThis.Deno.args:Vt.argv){let s=e.startsWith("-")?"":e.length===1?"-":"--",r=t.indexOf(s+e),i=t.indexOf("--");return r!==-1&&(i===-1||r<i)}var{env:U}=Vt,tt;ee("no-color")||ee("no-colors")||ee("color=false")||ee("color=never")?tt=0:(ee("color")||ee("colors")||ee("color=true")||ee("color=always"))&&(tt=1);function _i(){if("FORCE_COLOR"in U)return U.FORCE_COLOR==="true"?1:U.FORCE_COLOR==="false"?0:U.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(U.FORCE_COLOR,10),3)}function Ai(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Fi(e,{streamIsTTY:t,sniffFlags:s=!0}={}){let r=_i();r!==void 0&&(tt=r);let i=s?tt:r;if(i===0)return 0;if(s){if(ee("color=16m")||ee("color=full")||ee("color=truecolor"))return 3;if(ee("color=256"))return 2}if("TF_BUILD"in U&&"AGENT_NAME"in U)return 1;if(e&&!t&&i===void 0)return 0;let o=i||0;if(U.TERM==="dumb")return o;if(Vt.platform==="win32"){let a=Ti.release().split(".");return Number(a[0])>=10&&Number(a[2])>=10586?Number(a[2])>=14931?3:2:1}if("CI"in U)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(a=>a in U)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(a=>a in U)||U.CI_NAME==="codeship"?1:o;if("TEAMCITY_VERSION"in U)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(U.TEAMCITY_VERSION)?1:0;if(U.COLORTERM==="truecolor"||U.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in U){let a=Number.parseInt((U.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(U.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(U.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(U.TERM)||"COLORTERM"in U?1:o}function Ws(e,t={}){let s=Fi(e,{streamIsTTY:e&&e.isTTY,...t});return Ai(s)}var Mi={stdout:Ws({isTTY:js.isatty(1)}),stderr:Ws({isTTY:js.isatty(2)})},qs=Mi;function Hs(e,t,s){let r=e.indexOf(t);if(r===-1)return e;let i=t.length,o=0,a="";do a+=e.slice(o,r)+t+s,o=r+i,r=e.indexOf(t,o);while(r!==-1);return a+=e.slice(o),a}function Ks(e,t,s,r){let i=0,o="";do{let a=e[r-1]==="\r";o+=e.slice(i,a?r-1:r)+t+(a?`\r
165
165
  `:`
166
166
  `)+s,i=r+1,r=e.indexOf(`
167
- `,i)}while(r!==-1);return o+=e.slice(i),o}var{stdout:zs,stderr:Js}=qs,Ut=Symbol("GENERATOR"),xe=Symbol("STYLER"),Oe=Symbol("IS_EMPTY"),Ys=["ansi","ansi","ansi256","ansi16m"],Te=Object.create(null),Oi=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let s=zs?zs.level:0;e.level=t.level===void 0?s:t.level};var Bi=e=>{let t=(...s)=>s.join(" ");return Oi(t,e),Object.setPrototypeOf(t,Be.prototype),t};function Be(e){return Bi(e)}Object.setPrototypeOf(Be.prototype,Function.prototype);for(let[e,t]of Object.entries(re))Te[e]={get(){let s=et(this,jt(t.open,t.close,this[xe]),this[Oe]);return Object.defineProperty(this,e,{value:s}),s}};Te.visible={get(){let e=et(this,this[xe],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var Gt=(e,t,s,...r)=>e==="rgb"?t==="ansi16m"?re[s].ansi16m(...r):t==="ansi256"?re[s].ansi256(re.rgbToAnsi256(...r)):re[s].ansi(re.rgbToAnsi(...r)):e==="hex"?Gt("rgb",t,s,...re.hexToRgb(...r)):re[s][e](...r),ki=["rgb","hex","ansi256"];for(let e of ki){Te[e]={get(){let{level:s}=this;return function(...r){let i=jt(Gt(e,Ys[s],"color",...r),re.color.close,this[xe]);return et(this,i,this[Oe])}}};let t="bg"+e[0].toUpperCase()+e.slice(1);Te[t]={get(){let{level:s}=this;return function(...r){let i=jt(Gt(e,Ys[s],"bgColor",...r),re.bgColor.close,this[xe]);return et(this,i,this[Oe])}}}}var Li=Object.defineProperties(()=>{},{...Te,level:{enumerable:!0,get(){return this[Ut].level},set(e){this[Ut].level=e}}}),jt=(e,t,s)=>{let r,i;return s===void 0?(r=e,i=t):(r=s.openAll+e,i=t+s.closeAll),{open:e,close:t,openAll:r,closeAll:i,parent:s}},et=(e,t,s)=>{let r=(...i)=>Pi(r,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(r,Li),r[Ut]=e,r[xe]=t,r[Oe]=s,r},Pi=(e,t)=>{if(e.level<=0||!t)return e[Oe]?"":t;let s=e[xe];if(s===void 0)return t;let{openAll:r,closeAll:i}=s;if(t.includes("\x1B"))for(;s!==void 0;)t=Hs(t,s.close,s.open),s=s.parent;let o=t.indexOf(`
168
- `);return o!==-1&&(t=Ks(t,i,r,o)),r+t+i};Object.defineProperties(Be.prototype,Te);var Ni=Be(),so=Be({level:Js?Js.level:0});var ye=Ni;var Re={primary:"#57d7c4",secondary:"#199288",muted:"#9ca3af",success:"#06D6A0",error:"#EF4444",warning:"#F59E0B"},F={primary:e=>ye.hex(Re.primary)(e),secondary:e=>ye.hex(Re.secondary)(e),muted:e=>ye.hex(Re.muted)(e),success:e=>ye.hex(Re.success)(e),error:e=>ye.hex(Re.error)(e),warning:e=>ye.hex(Re.warning)(e)};var Di=async()=>{let e=await H({message:F.secondary(h("selectBranchType")),options:[{value:"fix",label:h("branchFix")},{value:"improvement",label:h("branchImprovement")},{value:"feature",label:h("branchFeature")},{value:"refactor",label:h("branchRefactor")}]});return A(e),e},Qs=Di;Z();var Vi=e=>/^[A-Z]{3}-\d{4}$/.test(e),Xs=Vi;var Ui=async()=>{let e=await ue({message:F.secondary(h("enterJiraCode")),placeholder:"DPW-0000",initialValue:"",validate(t){if(!t?.trim())return h("jiraRequired");if(!Xs(t))return h("jiraInvalidFormat")}});return A(e),e},Zs=Ui;var Gi=async()=>{let e=await Qs(),t=await Zs();return`${e}/${t}`},er=Gi;var ji=async()=>{let e=Y(),t=await er(),s=$e();try{s.start(h("creatingOriginalBranch")),tr("git",["checkout","-b",t,`origin/${e.defaultBaseBranch}`],{stdio:"inherit"}),tr("git",["push","origin",t],{stdio:"inherit"}),s.stop(h("branchCreatedAndPushed",t)),E.success(h("branchCreatedSuccess",t))}catch(r){s.stop(""),E.error(h("errorCreatingBranch",r.message))}},sr=ji;Z();import{spawnSync as _e}from"child_process";Z();var Wi=async()=>{let e=await H({message:F.secondary(h("mergeBranchQuestion")),options:[{value:"develop",label:h("developDEV")},{value:"release",label:h("releaseUAT")}],required:!0,initialValue:"develop"});return A(e),e},rr=Wi;import{execSync as qi}from"child_process";var Hi=()=>qi("git rev-parse --abbrev-ref HEAD").toString().trim(),ir=Hi;var Ki=async()=>{try{let e=await rr(),t=ir(),s=`${t}-${e}`;if(_e("git",["checkout","-b",s,`origin/${e}`],{stdio:"inherit"}),E.success(h("temporalBranchCreated")),_e("git",["merge",`origin/${t}`],{stdio:"inherit"}),E.success(h("temporalBranchMerged")),_e("git",["status","--porcelain"],{encoding:"utf-8"}).stdout.includes("UU")){E.warn(h("conflictsDetected"));return}_e("git",["push","origin",s],{stdio:"inherit"}),E.info(h("branchPushedToRemote"));let i=await le({message:h("removeTemporalBranch")});A(i),i&&(_e("git",["checkout",t],{stdio:"inherit"}),_e("git",["branch","-D",s],{stdio:"inherit"}),E.info(h("temporalBranchDeleted")))}catch(e){E.error(`${h("errorCreatingTemporal")}: ${e.message}`)}},nr=Ki;Z();import{execSync as ve,spawnSync as te,spawn as zi}from"child_process";function or(e){let t=e.slice(3).trim();return t.includes(" -> ")?t.split(" -> ")[1].trim():t}function ar(){let e=ve("git status --short",{encoding:"utf-8"}).trim();return e?e.split(`
169
- `):[]}var Ji=async()=>{let e=Y(),t=Ns(),s=Object.entries(t).map(([w,O])=>({value:w,label:O})),r={M:h("statusModified"),A:h("statusAdded"),D:h("statusDeleted"),R:h("statusRenamed"),"??":h("statusUntracked")},i=ve("git rev-parse --abbrev-ref HEAD",{encoding:"utf-8"}).trim(),o=ar();if(E.info(`${h("currentBranch")}: ${i}`),E.info(`${h("filesChanged")}: ${o.length}`),o.length===0){let w=await le({message:h("noChangesPending")});if(A(w),!w)return}let a=$e();a.start(h("updatingRefs"));try{ve("git fetch --quiet"),a.stop(h("refsUpdated"))}catch{a.stop(h("fetchFailed"))}let l=await ue({message:F.secondary(h("baseBranch")),placeholder:e.defaultBaseBranch,initialValue:e.defaultBaseBranch,validate:w=>w?.trim()?void 0:h("baseBranchRequired")});A(l);let c=await ue({message:F.secondary(h("ticketId")),placeholder:"DPW-0000",validate:w=>w?.trim()?void 0:h("ticketRequired")});A(c);let u=await H({message:F.secondary(h("changeType")),options:s});A(u);let d=`${u}/${c}`;if(te("git",["branch","--list",d],{encoding:"utf-8"}).stdout.trim()){let w=await H({message:F.secondary(h("branchExistsLocal",d)),options:[{value:"checkout",label:h("switchToIt")},{value:"cancel",label:h("cancel")}]});if(A(w),w==="cancel"){E.warn(h("cancelledOp"));return}te("git",["checkout",d],{stdio:"inherit"})}else try{a.start(h("creatingBranch",d,l)),te("git",["checkout","-b",d,`origin/${l}`],{stdio:"pipe"}),a.stop(h("branchCreated",d))}catch(w){a.stop(""),E.error(h("errorCreatingBranch",w.message));return}let p=!1;for(;!p;){let w=ar();if(w.length===0){E.warn(h("noFilesToStage"));return}let O="__select_all__",q=w.map(ie=>{let be=ie.slice(0,2).trim(),it=or(ie),hr=r[be]??be;return{value:ie,label:it,hint:hr}}),S=await Pt({message:F.secondary(h("selectFiles")),options:[{value:O,label:F.primary(h("selectAllFiles"))},...q],required:!0});A(S);let B=S.includes(O)?w:S;te("git",["restore","--staged","."],{encoding:"utf-8"});for(let ie of B){let be=or(ie);te("git",["add",be],{encoding:"utf-8"})}let z=ve("git status --short",{encoding:"utf-8"}).trim();fe(z,h("stagedFiles"));let Q=await le({message:h("stagedCorrect")});A(Q),p=Q,p||te("git",["restore","--staged","."],{encoding:"utf-8"})}let y=ve("git diff --cached",{encoding:"utf-8"}),m=`Analiza el siguiente git diff y sugiere UN SOLO mensaje de commit en formato convencional.
167
+ `,i)}while(r!==-1);return o+=e.slice(i),o}var{stdout:zs,stderr:Js}=qs,Ut=Symbol("GENERATOR"),Te=Symbol("STYLER"),Be=Symbol("IS_EMPTY"),Ys=["ansi","ansi","ansi256","ansi16m"],_e=Object.create(null),Oi=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let s=zs?zs.level:0;e.level=t.level===void 0?s:t.level};var ki=e=>{let t=(...s)=>s.join(" ");return Oi(t,e),Object.setPrototypeOf(t,Le.prototype),t};function Le(e){return ki(e)}Object.setPrototypeOf(Le.prototype,Function.prototype);for(let[e,t]of Object.entries(re))_e[e]={get(){let s=st(this,jt(t.open,t.close,this[Te]),this[Be]);return Object.defineProperty(this,e,{value:s}),s}};_e.visible={get(){let e=st(this,this[Te],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var Gt=(e,t,s,...r)=>e==="rgb"?t==="ansi16m"?re[s].ansi16m(...r):t==="ansi256"?re[s].ansi256(re.rgbToAnsi256(...r)):re[s].ansi(re.rgbToAnsi(...r)):e==="hex"?Gt("rgb",t,s,...re.hexToRgb(...r)):re[s][e](...r),Bi=["rgb","hex","ansi256"];for(let e of Bi){_e[e]={get(){let{level:s}=this;return function(...r){let i=jt(Gt(e,Ys[s],"color",...r),re.color.close,this[Te]);return st(this,i,this[Be])}}};let t="bg"+e[0].toUpperCase()+e.slice(1);_e[t]={get(){let{level:s}=this;return function(...r){let i=jt(Gt(e,Ys[s],"bgColor",...r),re.bgColor.close,this[Te]);return st(this,i,this[Be])}}}}var Li=Object.defineProperties(()=>{},{..._e,level:{enumerable:!0,get(){return this[Ut].level},set(e){this[Ut].level=e}}}),jt=(e,t,s)=>{let r,i;return s===void 0?(r=e,i=t):(r=s.openAll+e,i=t+s.closeAll),{open:e,close:t,openAll:r,closeAll:i,parent:s}},st=(e,t,s)=>{let r=(...i)=>Pi(r,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(r,Li),r[Ut]=e,r[Te]=t,r[Be]=s,r},Pi=(e,t)=>{if(e.level<=0||!t)return e[Be]?"":t;let s=e[Te];if(s===void 0)return t;let{openAll:r,closeAll:i}=s;if(t.includes("\x1B"))for(;s!==void 0;)t=Hs(t,s.close,s.open),s=s.parent;let o=t.indexOf(`
168
+ `);return o!==-1&&(t=Ks(t,i,r,o)),r+t+i};Object.defineProperties(Le.prototype,_e);var Ni=Le(),so=Le({level:Js?Js.level:0});var be=Ni;var Ae={primary:"#57d7c4",secondary:"#199288",muted:"#9ca3af",success:"#06D6A0",error:"#EF4444",warning:"#F59E0B"},_={primary:e=>be.hex(Ae.primary)(e),secondary:e=>be.hex(Ae.secondary)(e),muted:e=>be.hex(Ae.muted)(e),success:e=>be.hex(Ae.success)(e),error:e=>be.hex(Ae.error)(e),warning:e=>be.hex(Ae.warning)(e)};var Di=async()=>{let e=await q({message:_.secondary(h("selectBranchType")),options:[{value:"fix",label:h("branchFix")},{value:"improvement",label:h("branchImprovement")},{value:"feature",label:h("branchFeature")},{value:"refactor",label:h("branchRefactor")}]});return A(e),e},Qs=Di;Z();var Vi=e=>/^[A-Z]{3}-\d{4}$/.test(e),Xs=Vi;var Ui=async()=>{let e=await ue({message:_.secondary(h("enterJiraCode")),placeholder:"DPW-0000",initialValue:"",validate(t){if(!t?.trim())return h("jiraRequired");if(!Xs(t))return h("jiraInvalidFormat")}});return A(e),e},Zs=Ui;var Gi=async()=>{let e=await Qs(),t=await Zs();return`${e}/${t}`},er=Gi;var ji=async()=>{let e=Y(),t=await er(),s=ve();try{s.start(h("creatingOriginalBranch")),tr("git",["checkout","-b",t,`origin/${e.defaultBaseBranch}`],{stdio:"inherit"}),tr("git",["push","origin",t],{stdio:"inherit"}),s.stop(h("branchCreatedAndPushed",t)),E.success(h("branchCreatedSuccess",t))}catch(r){s.stop(""),E.error(h("errorCreatingBranch",r.message))}},sr=ji;Z();import{spawnSync as Fe}from"child_process";Z();var Wi=async()=>{let e=await q({message:_.secondary(h("mergeBranchQuestion")),options:[{value:"develop",label:h("developDEV")},{value:"release",label:h("releaseUAT")}],required:!0,initialValue:"develop"});return A(e),e},rr=Wi;import{execSync as qi}from"child_process";var Hi=()=>qi("git rev-parse --abbrev-ref HEAD").toString().trim(),ir=Hi;var Ki=async()=>{try{let e=await rr(),t=ir(),s=`${t}-${e}`;if(Fe("git",["checkout","-b",s,`origin/${e}`],{stdio:"inherit"}),E.success(h("temporalBranchCreated")),Fe("git",["merge",`origin/${t}`],{stdio:"inherit"}),E.success(h("temporalBranchMerged")),Fe("git",["status","--porcelain"],{encoding:"utf-8"}).stdout.includes("UU")){E.warn(h("conflictsDetected"));return}Fe("git",["push","origin",s],{stdio:"inherit"}),E.info(h("branchPushedToRemote"));let i=await le({message:h("removeTemporalBranch")});A(i),i&&(Fe("git",["checkout",t],{stdio:"inherit"}),Fe("git",["branch","-D",s],{stdio:"inherit"}),E.info(h("temporalBranchDeleted")))}catch(e){E.error(`${h("errorCreatingTemporal")}: ${e.message}`)}},nr=Ki;Z();import{execSync as we,spawnSync as te,spawn as zi}from"child_process";function or(e){let t=e.match(/^[MADRCU? ]{2}\s+(.+)$/),s=t?t[1]:e.replace(/^[MADRCU? ]+\s+/,"");return s.includes(" -> ")?s.split(" -> ")[1].trim():s.trim()}function ar(){let e=we("git status --short",{encoding:"utf-8"}).trim();return e?e.split(`
169
+ `):[]}var Ji=async()=>{let e=Y(),t=Ns(),s=Object.entries(t).map(([w,O])=>({value:w,label:O})),r={M:h("statusModified"),A:h("statusAdded"),D:h("statusDeleted"),R:h("statusRenamed"),"??":h("statusUntracked")},i=we("git rev-parse --abbrev-ref HEAD",{encoding:"utf-8"}).trim(),o=ar();if(E.info(`${h("currentBranch")}: ${i}`),E.info(`${h("filesChanged")}: ${o.length}`),o.length===0){let w=await le({message:h("noChangesPending")});if(A(w),!w)return}let a=ve();a.start(h("updatingRefs"));try{we("git fetch --quiet"),a.stop(h("refsUpdated"))}catch{a.stop(h("fetchFailed"))}let l=await ue({message:_.secondary(h("baseBranch")),placeholder:e.defaultBaseBranch,initialValue:e.defaultBaseBranch,validate:w=>w?.trim()?void 0:h("baseBranchRequired")});A(l);let c=await ue({message:_.secondary(h("ticketId")),placeholder:"DPW-0000",validate:w=>w?.trim()?void 0:h("ticketRequired")});A(c);let u=await q({message:_.secondary(h("changeType")),options:s});A(u);let d=`${u}/${c}`;if(te("git",["branch","--list",d],{encoding:"utf-8"}).stdout.trim()){let w=await q({message:_.secondary(h("branchExistsLocal",d)),options:[{value:"checkout",label:h("switchToIt")},{value:"cancel",label:h("cancel")}]});if(A(w),w==="cancel"){E.warn(h("cancelledOp"));return}te("git",["checkout",d],{stdio:"inherit"})}else try{a.start(h("creatingBranch",d,l)),te("git",["checkout","-b",d,`origin/${l}`],{stdio:"pipe"}),a.stop(h("branchCreated",d))}catch(w){a.stop(""),E.error(h("errorCreatingBranch",w.message));return}let p=!1;for(;!p;){let w=ar();if(w.length===0){E.warn(h("noFilesToStage"));return}let O="__select_all__",H=w.map(ie=>{let de=ie.slice(0,2).trim(),Ce=or(ie),hr=r[de]??de;return{value:ie,label:Ce,hint:hr}}),S=await Pt({message:_.secondary(h("selectFiles")),options:[{value:O,label:_.primary(h("selectAllFiles"))},...H],required:!0});A(S);let k=S.includes(O)?w:S;te("git",["restore","--staged","."],{encoding:"utf-8"});for(let ie of k){let de=or(ie),Ce=te("git",["add","--",de],{encoding:"utf-8"});Ce.status!==0&&E.error(`git add failed for ${de}: ${Ce.stderr}`)}let z=we("git status --short",{encoding:"utf-8"}).trim();ye(z,h("stagedFiles"));let Q=await le({message:h("stagedCorrect")});A(Q),p=Q,p||te("git",["restore","--staged","."],{encoding:"utf-8"})}let y=we("git diff --cached",{encoding:"utf-8"}),m=`Analiza el siguiente git diff y sugiere UN SOLO mensaje de commit en formato convencional.
170
170
 
171
171
  Formato requerido: ${u}(${c}): descripcion en ingles
172
172
  Reglas:
@@ -177,10 +177,10 @@ Reglas:
177
177
  - Responde UNICAMENTE con el mensaje de commit, sin explicaciones, sin comillas, sin markdown
178
178
 
179
179
  Git diff:
180
- ${y}`,b=await H({message:F.secondary(h("aiProvider")),options:[{value:"claude",label:"Claude"},{value:"opencode",label:"Opencode"}],initialValue:e.aiProvider});A(b);let $={claude:{binary:"claude",args:["-p",m],label:"Claude"},opencode:{binary:"opencode",args:["run",m],label:"Opencode"}},{binary:v,args:C,label:T}=$[b];a.start(h("generatingCommit",T));let R=await new Promise(w=>{let O="",q="",S=zi(v,C,{stdio:["ignore","pipe","pipe"]});S.stdout.on("data",B=>{O+=B}),S.stderr.on("data",B=>{q+=B}),S.on("close",B=>w({status:B,stdout:O,stderr:q,error:null})),S.on("error",B=>w({status:1,stdout:"",stderr:"",error:B}))});a.stop("");let x;if(R.error||R.status!==0){E.warn(h("aiSuggestionFailed",T));let w=await ue({message:F.secondary(h("writeCommitMsg")),initialValue:`${u}(${c}): `,validate:O=>O?.trim()?void 0:h("commitMsgRequired")});A(w),x=w}else{let w=R.stdout.trim();fe(w,h("suggestionOf",T));let O=await H({message:F.secondary(h("useThisCommit")),options:[{value:"yes",label:h("yesUseIt")},{value:"modify",label:h("modify")}]});if(A(O),O==="yes")x=w;else{let q=await ue({message:F.secondary(h("writeCommitMsg")),initialValue:w,validate:S=>S?.trim()?void 0:h("commitMsgRequired")});A(q),x=q}}let L=!1;for(;!L;)if(te("git",["commit","-m",x],{stdio:"inherit"}).status===0)E.success(h("commitSuccess")),L=!0;else{let O=await H({message:F.secondary(h("hookBlocked")),options:[{value:"retry",label:h("retryHook")},{value:"noverify",label:h("skipHook")},{value:"cancel",label:h("cancel")}]});if(A(O),O==="cancel")return;O==="noverify"&&(te("git",["commit","--no-verify","-m",x],{stdio:"inherit"}),E.success(h("commitNoHooks")),L=!0),O==="retry"&&te("git",["add","-u"],{stdio:"inherit"})}let M=await le({message:h("pushToRemote")});A(M);let k="";if(M){let w=(S=!1)=>{te("git",S?["push","-f","origin",d]:["push","-u","origin",d],{stdio:"inherit"})},O=()=>{let S=ve("git remote get-url origin",{encoding:"utf-8"}).trim(),B=S.match(/[:/]([^/]+\/[^/]+?)(\.git)?$/),z=B?B[1]:"";return S.includes("github.com")?`https://github.com/${z}/compare/${d}?expand=1`:S.includes("bitbucket.org")?`https://bitbucket.org/${z}/pull-requests/new?source=${d}`:S.includes("gitlab.com")?`https://gitlab.com/${z}/-/merge_requests/new?merge_request[source_branch]=${d}`:""};if(te("git",["push","-u","origin",d],{stdio:"inherit"}).status===0)E.success(h("pushSuccess")),k=O();else{let S=await le({message:h("pushForceQuestion")});A(S),S&&(te("git",["push","-f","origin",d],{stdio:"inherit"}).status===0?(E.success(h("pushForceSuccess")),k=O()):E.error(h("pushForceError","push failed")))}}let N=ve('git diff --name-only HEAD~1 HEAD 2>/dev/null || git show --name-only --format="" HEAD',{encoding:"utf-8"}).trim().split(`
181
- `).filter(Boolean).length,W=[`${h("summaryBranch")}: ${d}`,`${h("summaryFrom")}: origin/${l}`,`${h("summaryCommit")}: ${x}`,`${h("summaryFiles",N)}`,...M&&k?[`${h("summaryPush")}: origin/${d}`,`${h("summaryPR")}: ${k}`]:[]];fe(W.join(`
182
- `),h("summaryTitle"))},cr=Ji;Z();async function tt(){let e=await H({message:F.secondary(h("configMenu")),options:[{value:"language",label:h("configLanguage")},{value:"defaultBranch",label:h("configDefaultBranch")},{value:"aiProvider",label:h("configAIProvider")},{value:"view",label:h("configView")}]});if(A(e),e==="language"){let t=await H({message:F.secondary(h("languageSelect")),options:Ds(),initialValue:Y().language});A(t),Qe({language:t}),E.success(h("languageChanged",t))}if(e==="defaultBranch"){let{text:t}=await Promise.resolve().then(()=>(Z(),Ms)),s=await t({message:F.secondary(h("baseBranch")),initialValue:Y().defaultBaseBranch,validate:r=>r?.trim()?void 0:h("baseBranchRequired")});A(s),Qe({defaultBaseBranch:s}),E.success(h("defaultBranchSet",s))}if(e==="aiProvider"){let t=await H({message:F.secondary(h("aiProvider")),options:[{value:"claude",label:"Claude"},{value:"opencode",label:"Opencode"}],initialValue:Y().aiProvider});A(t),Qe({aiProvider:t}),E.success(h("aiProviderSet",t))}if(e==="view"){let t=Y(),s=Object.entries(t).map(([r,i])=>` ${r}: ${i}`).join(`
183
- `);fe(s,F.secondary(h("currentConfig")))}}import{readFileSync as Yi}from"fs";import{fileURLToPath as Qi}from"url";import{dirname as Xi,resolve as Zi}from"path";var en=()=>{let e=Qi(import.meta.url),t=Xi(e);return JSON.parse(Yi(Zi(t,"../package.json"),"utf8"))?.version},lr=en;Z();import{existsSync as tn}from"fs";import{join as sn}from"path";import{execSync as rn}from"child_process";var nn=()=>{try{rn("git --version",{stdio:"ignore"})}catch{E.error(h("gitNotInstalled")),process.exit(1)}let e=sn(process.cwd(),".git");tn(e)||(E.error(h("notGitRepo")),process.exit(1))},ur=nn;var rt=process.argv.slice(2);(rt.includes("-v")||rt.includes("--version"))&&(console.log(`${h("version")}: ${lr()}`),process.exit(0));(rt.includes("config")||rt.includes("--config"))&&(await tt(),process.exit(0));ur();kt(F.primary(`
180
+ ${y}`,b=await q({message:_.secondary(h("aiProvider")),options:[{value:"claude",label:"Claude"},{value:"opencode",label:"Opencode"}],initialValue:e.aiProvider});A(b);let $={claude:{binary:"claude",args:["-p",m],label:"Claude"},opencode:{binary:"opencode",args:["run",m],label:"Opencode"}},{binary:v,args:C,label:R}=$[b];a.start(h("generatingCommit",R));let T=await new Promise(w=>{let O="",H="",S=zi(v,C,{stdio:["ignore","pipe","pipe"]});S.stdout.on("data",k=>{O+=k}),S.stderr.on("data",k=>{H+=k}),S.on("close",k=>w({status:k,stdout:O,stderr:H,error:null})),S.on("error",k=>w({status:1,stdout:"",stderr:"",error:k}))});a.stop("");let x;if(T.error||T.status!==0){E.warn(h("aiSuggestionFailed",R));let w=await ue({message:_.secondary(h("writeCommitMsg")),initialValue:`${u}(${c}): `,validate:O=>O?.trim()?void 0:h("commitMsgRequired")});A(w),x=w}else{let w=T.stdout.trim();ye(w,h("suggestionOf",R));let O=await q({message:_.secondary(h("useThisCommit")),options:[{value:"yes",label:h("yesUseIt")},{value:"modify",label:h("modify")}]});if(A(O),O==="yes")x=w;else{let H=await ue({message:_.secondary(h("writeCommitMsg")),initialValue:w,validate:S=>S?.trim()?void 0:h("commitMsgRequired")});A(H),x=H}}let L=!1;for(;!L;)if(te("git",["commit","-m",x],{stdio:"inherit"}).status===0)E.success(h("commitSuccess")),L=!0;else{let O=await q({message:_.secondary(h("hookBlocked")),options:[{value:"retry",label:h("retryHook")},{value:"noverify",label:h("skipHook")},{value:"cancel",label:h("cancel")}]});if(A(O),O==="cancel")return;O==="noverify"&&(te("git",["commit","--no-verify","-m",x],{stdio:"inherit"}),E.success(h("commitNoHooks")),L=!0),O==="retry"&&te("git",["add","-u"],{stdio:"inherit"})}let M=await le({message:h("pushToRemote")});A(M);let B="";if(M){let w=(S=!1)=>{te("git",S?["push","-f","origin",d]:["push","-u","origin",d],{stdio:"inherit"})},O=()=>{let S=we("git remote get-url origin",{encoding:"utf-8"}).trim(),k=S.match(/[:/]([^/]+\/[^/]+?)(\.git)?$/),z=k?k[1]:"";return S.includes("github.com")?`https://github.com/${z}/compare/${d}?expand=1`:S.includes("bitbucket.org")?`https://bitbucket.org/${z}/pull-requests/new?source=${d}`:S.includes("gitlab.com")?`https://gitlab.com/${z}/-/merge_requests/new?merge_request[source_branch]=${d}`:""};if(te("git",["push","-u","origin",d],{stdio:"inherit"}).status===0)E.success(h("pushSuccess")),B=O();else{let S=await le({message:h("pushForceQuestion")});A(S),S&&(te("git",["push","-f","origin",d],{stdio:"inherit"}).status===0?(E.success(h("pushForceSuccess")),B=O()):E.error(h("pushForceError","push failed")))}}let N=we('git diff --name-only HEAD~1 HEAD 2>/dev/null || git show --name-only --format="" HEAD',{encoding:"utf-8"}).trim().split(`
181
+ `).filter(Boolean).length,W=[`${h("summaryBranch")}: ${d}`,`${h("summaryFrom")}: origin/${l}`,`${h("summaryCommit")}: ${x}`,`${h("summaryFiles",N)}`,...M&&B?[`${h("summaryPush")}: origin/${d}`,`${h("summaryPR")}: ${B}`]:[]];ye(W.join(`
182
+ `),h("summaryTitle"))},cr=Ji;Z();async function he(){let e=await q({message:_.secondary(h("configMenu")),options:[{value:"language",label:h("configLanguage")},{value:"defaultBranch",label:h("configDefaultBranch")},{value:"aiProvider",label:h("configAIProvider")},{value:"view",label:h("configView")}]});if(A(e),e==="language"){let t=await q({message:_.secondary(h("languageSelect")),options:Ds(),initialValue:Y().language});return A(t),Ze({language:t}),E.success(h("languageChanged",t)),he()}if(e==="defaultBranch"){let{text:t}=await Promise.resolve().then(()=>(Z(),Ms)),s=await t({message:_.secondary(h("baseBranch")),initialValue:Y().defaultBaseBranch,validate:r=>r?.trim()?void 0:h("baseBranchRequired")});return A(s),Ze({defaultBaseBranch:s}),E.success(h("defaultBranchSet",s)),he()}if(e==="aiProvider"){let t=await q({message:_.secondary(h("aiProvider")),options:[{value:"claude",label:"Claude"},{value:"opencode",label:"Opencode"}],initialValue:Y().aiProvider});return A(t),Ze({aiProvider:t}),E.success(h("aiProviderSet",t)),he()}if(e==="view"){let t=Y(),s=Object.entries(t).map(([i,o])=>` ${i}: ${o}`).join(`
183
+ `);ye(s,_.secondary(h("currentConfig")));let r=await q({message:_.secondary(""),options:[{value:"back",label:_.muted(h("goBack"))}]});return A(r),he()}}import{readFileSync as Yi}from"fs";import{fileURLToPath as Qi}from"url";import{dirname as Xi,resolve as Zi}from"path";var en=()=>{let e=Qi(import.meta.url),t=Xi(e);return JSON.parse(Yi(Zi(t,"../package.json"),"utf8"))?.version},lr=en;Z();import{existsSync as tn}from"fs";import{join as sn}from"path";import{execSync as rn}from"child_process";var nn=()=>{try{rn("git --version",{stdio:"ignore"})}catch{E.error(h("gitNotInstalled")),process.exit(1)}let e=sn(process.cwd(),".git");tn(e)||(E.error(h("notGitRepo")),process.exit(1))},ur=nn;var it=process.argv.slice(2);(it.includes("-v")||it.includes("--version"))&&(console.log(`${h("version")}: ${lr()}`),process.exit(0));(it.includes("config")||it.includes("--config"))&&(await he(),process.exit(0));ur();Bt(_.primary(`
184
184
  ${h("welcome")}
185
185
 
186
186
  .-------------------------------------------------------------------------------.
@@ -194,5 +194,5 @@ ${y}`,b=await H({message:F.secondary(h("aiProvider")),options:[{value:"claude",l
194
194
  |\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591 |
195
195
  '-------------------------------------------------------------------------------'
196
196
 
197
- ${F.muted(h("subtitle"))}
198
- `));var st=await H({message:F.secondary(h("whatToDo")),options:[{value:"ACB",label:h("addChanges")},{value:"CRO",label:h("createOriginal")},{value:"CRT",label:h("createTemporal")},{value:"CFG",label:h("configMenu")}],required:!0,initialValue:"ACB"});st==="ACB"?await cr():st==="CRO"?await sr():st==="CRT"?await nr():st==="CFG"?await tt():(Me(h("operationCancelled")),process.exit(0));Lt(F.success(h("operationCompleted")));
197
+ ${_.muted(h("subtitle"))}
198
+ `));var rt=await q({message:_.secondary(h("whatToDo")),options:[{value:"ACB",label:h("addChanges")},{value:"CRO",label:h("createOriginal")},{value:"CRT",label:h("createTemporal")},{value:"CFG",label:h("configMenu")}],required:!0,initialValue:"ACB"});rt==="ACB"?await cr():rt==="CRO"?await sr():rt==="CRT"?await nr():rt==="CFG"?await he():(ke(h("operationCancelled")),process.exit(0));Lt(_.success(h("operationCompleted")));
package/dist/install.js CHANGED
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
- var Vt=Object.create;var Pe=Object.defineProperty;var jt=Object.getOwnPropertyDescriptor;var Gt=Object.getOwnPropertyNames;var Wt=Object.getPrototypeOf,qt=Object.prototype.hasOwnProperty;var Ht=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Kt=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Gt(t))!qt.call(e,i)&&i!==r&&Pe(e,i,{get:()=>t[i],enumerable:!(s=jt(t,i))||s.enumerable});return e};var ke=(e,t,r)=>(r=e!=null?Vt(Wt(e)):{},Kt(t||!e||!e.__esModule?Pe(r,"default",{value:e,enumerable:!0}):r,e));var Ie=Ht((vs,Ze)=>{"use strict";var we="\x1B",y=`${we}[`,ar="\x07",Ce={to(e,t){return t?`${y}${t+1};${e+1}H`:`${y}${e+1}G`},move(e,t){let r="";return e<0?r+=`${y}${-e}D`:e>0&&(r+=`${y}${e}C`),t<0?r+=`${y}${-t}A`:t>0&&(r+=`${y}${t}B`),r},up:(e=1)=>`${y}${e}A`,down:(e=1)=>`${y}${e}B`,forward:(e=1)=>`${y}${e}C`,backward:(e=1)=>`${y}${e}D`,nextLine:(e=1)=>`${y}E`.repeat(e),prevLine:(e=1)=>`${y}F`.repeat(e),left:`${y}G`,hide:`${y}?25l`,show:`${y}?25h`,save:`${we}7`,restore:`${we}8`},ur={up:(e=1)=>`${y}S`.repeat(e),down:(e=1)=>`${y}T`.repeat(e)},lr={screen:`${y}2J`,up:(e=1)=>`${y}1J`.repeat(e),down:(e=1)=>`${y}J`.repeat(e),line:`${y}2K`,lineEnd:`${y}K`,lineStart:`${y}1K`,lines(e){let t="";for(let r=0;r<e;r++)t+=this.line+(r<e-1?Ce.up():"");return e&&(t+=Ce.left),t}};Ze.exports={cursor:Ce,scroll:ur,erase:lr,beep:ar}});import{existsSync as us}from"fs";import{styleText as cr}from"node:util";import{stdout as Ee,stdin as et}from"node:process";import*as H from"node:readline";import hr from"node:readline";var Be=(()=>{let e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return t=>{let r=0;for(e.lastIndex=0;e.test(t);)r+=1;return t.length-r}})(),Ue=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,De=e=>e===8987||e===9001||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141;var zt=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,Yt=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Ve=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,Jt=/\t{1,1000}/y,je=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,Qt=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Zt=/\p{M}+/gu,Xt={limit:1/0,ellipsis:""},Ge=(e,t={},r={})=>{let s=t.limit??1/0,i=t.ellipsis??"",n=t?.ellipsisWidth??(i?Ge(i,Xt,r).width:0),o=0,a=r.controlWidth??0,c=r.tabWidth??8,g=r.emojiWidth??2,v=2,m=r.regularWidth??1,d=r.wideWidth??v,I=[[Qt,m],[zt,o],[Yt,a],[Jt,c],[je,g],[Ve,d]],h=0,f=0,U=e.length,G=0,W=!1,P=U,D=Math.max(0,s-n),_=0,Q=0,k=0,T=0;e:for(;;){if(Q>_||f>=U&&f>h){let q=e.slice(_,Q)||e.slice(h,f);G=0;for(let z of q.replaceAll(Zt,"")){let M=z.codePointAt(0)||0;if(Ue(M)?T=v:De(M)?T=d:T=m,k+T>D&&(P=Math.min(P,Math.max(_,h)+G)),k+T>s){W=!0;break e}G+=z.length,k+=T}_=Q=0}if(f>=U)break e;for(let q=0,z=I.length;q<z;q++){let[M,ue]=I[q];if(M.lastIndex=f,M.test(e)){if(G=M===Ve?Be(e.slice(f,M.lastIndex)):M===je?1:M.lastIndex-f,T=G*ue,k+T>D&&(P=Math.min(P,f+Math.floor((D-k)/ue))),k+T>s){W=!0;break e}k+=T,_=h,Q=f,f=h=M.lastIndex;continue e}}f+=1}return{width:W?D:k,index:W?P:U,truncated:W,ellipsed:W&&s>=n}},We=Ge;var er={limit:1/0,ellipsis:"",ellipsisWidth:0},tr=(e,t={})=>We(e,er,t).width,B=tr;var ce="\x1B",Ye="\x9B",rr=39,ve="\x07",Je="[",sr="]",Qe="m",be=`${sr}8;;`,qe=new RegExp(`(?:\\${Je}(?<code>\\d+)m|\\${be}(?<uri>.*)${ve})`,"y"),He=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},Ke=e=>`${ce}${Je}${e}${Qe}`,ze=e=>`${ce}${be}${e}${ve}`,ye=(e,t,r)=>{let s=t[Symbol.iterator](),i=!1,n=!1,o=e.at(-1),a=o===void 0?0:B(o),c=s.next(),g=s.next(),v=0;for(;!c.done;){let m=c.value,d=B(m);a+d<=r?e[e.length-1]+=m:(e.push(m),a=0),(m===ce||m===Ye)&&(i=!0,n=t.startsWith(be,v+1)),i?n?m===ve&&(i=!1,n=!1):m===Qe&&(i=!1):(a+=d,a===r&&!g.done&&(e.push(""),a=0)),c=g,g=s.next(),v+=m.length}o=e.at(-1),!a&&o!==void 0&&o.length&&e.length>1&&(e[e.length-2]+=e.pop())},ir=e=>{let t=e.split(" "),r=t.length;for(;r&&!B(t[r-1]);)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},nr=(e,t,r={})=>{if(r.trim!==!1&&e.trim()==="")return"";let s="",i,n,o=e.split(" "),a=[""],c=0;for(let m=0;m<o.length;m++){let d=o[m];if(r.trim!==!1){let h=a.at(-1)??"",f=h.trimStart();h.length!==f.length&&(a[a.length-1]=f,c=B(f))}m!==0&&(c>=t&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),c=0),(c||r.trim===!1)&&(a[a.length-1]+=" ",c++));let I=B(d);if(r.hard&&I>t){let h=t-c,f=1+Math.floor((I-h-1)/t);Math.floor((I-1)/t)<f&&a.push(""),ye(a,d,t),c=B(a.at(-1)??"");continue}if(c+I>t&&c&&I){if(r.wordWrap===!1&&c<t){ye(a,d,t),c=B(a.at(-1)??"");continue}a.push(""),c=0}if(c+I>t&&r.wordWrap===!1){ye(a,d,t),c=B(a.at(-1)??"");continue}a[a.length-1]+=d,c+=I}r.trim!==!1&&(a=a.map(m=>ir(m)));let g=a.join(`
2
+ var Vt=Object.create;var ke=Object.defineProperty;var jt=Object.getOwnPropertyDescriptor;var Gt=Object.getOwnPropertyNames;var Wt=Object.getPrototypeOf,qt=Object.prototype.hasOwnProperty;var Ht=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Kt=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Gt(t))!qt.call(e,i)&&i!==r&&ke(e,i,{get:()=>t[i],enumerable:!(s=jt(t,i))||s.enumerable});return e};var Pe=(e,t,r)=>(r=e!=null?Vt(Wt(e)):{},Kt(t||!e||!e.__esModule?ke(r,"default",{value:e,enumerable:!0}):r,e));var Ie=Ht((vs,Ze)=>{"use strict";var we="\x1B",y=`${we}[`,ar="\x07",Ce={to(e,t){return t?`${y}${t+1};${e+1}H`:`${y}${e+1}G`},move(e,t){let r="";return e<0?r+=`${y}${-e}D`:e>0&&(r+=`${y}${e}C`),t<0?r+=`${y}${-t}A`:t>0&&(r+=`${y}${t}B`),r},up:(e=1)=>`${y}${e}A`,down:(e=1)=>`${y}${e}B`,forward:(e=1)=>`${y}${e}C`,backward:(e=1)=>`${y}${e}D`,nextLine:(e=1)=>`${y}E`.repeat(e),prevLine:(e=1)=>`${y}F`.repeat(e),left:`${y}G`,hide:`${y}?25l`,show:`${y}?25h`,save:`${we}7`,restore:`${we}8`},ur={up:(e=1)=>`${y}S`.repeat(e),down:(e=1)=>`${y}T`.repeat(e)},lr={screen:`${y}2J`,up:(e=1)=>`${y}1J`.repeat(e),down:(e=1)=>`${y}J`.repeat(e),line:`${y}2K`,lineEnd:`${y}K`,lineStart:`${y}1K`,lines(e){let t="";for(let r=0;r<e;r++)t+=this.line+(r<e-1?Ce.up():"");return e&&(t+=Ce.left),t}};Ze.exports={cursor:Ce,scroll:ur,erase:lr,beep:ar}});import{existsSync as us}from"fs";import{styleText as cr}from"node:util";import{stdout as Ee,stdin as et}from"node:process";import*as H from"node:readline";import hr from"node:readline";var Be=(()=>{let e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return t=>{let r=0;for(e.lastIndex=0;e.test(t);)r+=1;return t.length-r}})(),Ue=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,De=e=>e===8987||e===9001||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141;var zt=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,Yt=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Ve=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,Jt=/\t{1,1000}/y,je=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,Qt=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Zt=/\p{M}+/gu,Xt={limit:1/0,ellipsis:""},Ge=(e,t={},r={})=>{let s=t.limit??1/0,i=t.ellipsis??"",n=t?.ellipsisWidth??(i?Ge(i,Xt,r).width:0),o=0,a=r.controlWidth??0,c=r.tabWidth??8,g=r.emojiWidth??2,v=2,m=r.regularWidth??1,d=r.wideWidth??v,I=[[Qt,m],[zt,o],[Yt,a],[Jt,c],[je,g],[Ve,d]],h=0,f=0,U=e.length,G=0,W=!1,k=U,D=Math.max(0,s-n),_=0,Q=0,P=0,T=0;e:for(;;){if(Q>_||f>=U&&f>h){let q=e.slice(_,Q)||e.slice(h,f);G=0;for(let z of q.replaceAll(Zt,"")){let M=z.codePointAt(0)||0;if(Ue(M)?T=v:De(M)?T=d:T=m,P+T>D&&(k=Math.min(k,Math.max(_,h)+G)),P+T>s){W=!0;break e}G+=z.length,P+=T}_=Q=0}if(f>=U)break e;for(let q=0,z=I.length;q<z;q++){let[M,ue]=I[q];if(M.lastIndex=f,M.test(e)){if(G=M===Ve?Be(e.slice(f,M.lastIndex)):M===je?1:M.lastIndex-f,T=G*ue,P+T>D&&(k=Math.min(k,f+Math.floor((D-P)/ue))),P+T>s){W=!0;break e}P+=T,_=h,Q=f,f=h=M.lastIndex;continue e}}f+=1}return{width:W?D:P,index:W?k:U,truncated:W,ellipsed:W&&s>=n}},We=Ge;var er={limit:1/0,ellipsis:"",ellipsisWidth:0},tr=(e,t={})=>We(e,er,t).width,B=tr;var ce="\x1B",Ye="\x9B",rr=39,ve="\x07",Je="[",sr="]",Qe="m",be=`${sr}8;;`,qe=new RegExp(`(?:\\${Je}(?<code>\\d+)m|\\${be}(?<uri>.*)${ve})`,"y"),He=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},Ke=e=>`${ce}${Je}${e}${Qe}`,ze=e=>`${ce}${be}${e}${ve}`,ye=(e,t,r)=>{let s=t[Symbol.iterator](),i=!1,n=!1,o=e.at(-1),a=o===void 0?0:B(o),c=s.next(),g=s.next(),v=0;for(;!c.done;){let m=c.value,d=B(m);a+d<=r?e[e.length-1]+=m:(e.push(m),a=0),(m===ce||m===Ye)&&(i=!0,n=t.startsWith(be,v+1)),i?n?m===ve&&(i=!1,n=!1):m===Qe&&(i=!1):(a+=d,a===r&&!g.done&&(e.push(""),a=0)),c=g,g=s.next(),v+=m.length}o=e.at(-1),!a&&o!==void 0&&o.length&&e.length>1&&(e[e.length-2]+=e.pop())},ir=e=>{let t=e.split(" "),r=t.length;for(;r&&!B(t[r-1]);)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},nr=(e,t,r={})=>{if(r.trim!==!1&&e.trim()==="")return"";let s="",i,n,o=e.split(" "),a=[""],c=0;for(let m=0;m<o.length;m++){let d=o[m];if(r.trim!==!1){let h=a.at(-1)??"",f=h.trimStart();h.length!==f.length&&(a[a.length-1]=f,c=B(f))}m!==0&&(c>=t&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),c=0),(c||r.trim===!1)&&(a[a.length-1]+=" ",c++));let I=B(d);if(r.hard&&I>t){let h=t-c,f=1+Math.floor((I-h-1)/t);Math.floor((I-1)/t)<f&&a.push(""),ye(a,d,t),c=B(a.at(-1)??"");continue}if(c+I>t&&c&&I){if(r.wordWrap===!1&&c<t){ye(a,d,t),c=B(a.at(-1)??"");continue}a.push(""),c=0}if(c+I>t&&r.wordWrap===!1){ye(a,d,t),c=B(a.at(-1)??"");continue}a[a.length-1]+=d,c+=I}r.trim!==!1&&(a=a.map(m=>ir(m)));let g=a.join(`
3
3
  `),v=!1;for(let m=0;m<g.length;m++){let d=g[m];if(s+=d,v)v=!1;else if(v=d>="\uD800"&&d<="\uDBFF",v)continue;if(d===ce||d===Ye){qe.lastIndex=m+1;let h=qe.exec(g)?.groups;if(h?.code!==void 0){let f=Number.parseFloat(h.code);i=f===rr?void 0:f}else h?.uri!==void 0&&(n=h.uri.length===0?void 0:h.uri)}if(g[m+1]===`
4
4
  `){n&&(s+=ze(""));let I=i?He(i):void 0;i&&I&&(s+=Ke(I))}else d===`
5
5
  `&&(i&&He(i)&&(s+=Ke(i)),n&&(s+=ze(n)))}return s},or=/\r?\n/;function Y(e,t,r){return String(e).normalize().split(or).map(s=>nr(s,t,r)).join(`
6
- `)}var x=ke(Ie(),1);import{ReadStream as Xe}from"node:tty";var mr=["up","down","left","right","space","enter","cancel"],dr=["January","February","March","April","May","June","July","August","September","October","November","December"],R={actions:new Set(mr),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"},withGuide:!0,date:{monthNames:[...dr],messages:{required:"Please enter a valid date",invalidMonth:"There are only 12 months in a year",invalidDay:(e,t)=>`There are only ${e} days in ${t}`,afterMin:e=>`Date must be on or after ${e.toISOString().slice(0,10)}`,beforeMax:e=>`Date must be on or before ${e.toISOString().slice(0,10)}`}}};function xe(e,t){if(typeof e=="string")return R.aliases.get(e)===t;for(let r of e)if(r!==void 0&&xe(r,t))return!0;return!1}function pr(e,t){if(e===t)return;let r=e.split(`
6
+ `)}var x=Pe(Ie(),1);import{ReadStream as Xe}from"node:tty";var mr=["up","down","left","right","space","enter","cancel"],dr=["January","February","March","April","May","June","July","August","September","October","November","December"],R={actions:new Set(mr),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"},withGuide:!0,date:{monthNames:[...dr],messages:{required:"Please enter a valid date",invalidMonth:"There are only 12 months in a year",invalidDay:(e,t)=>`There are only ${e} days in ${t}`,afterMin:e=>`Date must be on or after ${e.toISOString().slice(0,10)}`,beforeMax:e=>`Date must be on or before ${e.toISOString().slice(0,10)}`}}};function xe(e,t){if(typeof e=="string")return R.aliases.get(e)===t;for(let r of e)if(r!==void 0&&xe(r,t))return!0;return!1}function pr(e,t){if(e===t)return;let r=e.split(`
7
7
  `),s=t.split(`
8
8
  `),i=Math.max(r.length,s.length),n=[];for(let o=0;o<i;o++)r[o]!==s[o]&&n.push(o);return{lines:n,numLinesBefore:r.length,numLinesAfter:s.length,numLines:i}}var gr=globalThis.process.platform.startsWith("win"),Se=Symbol("clack:cancel");function pe(e){return e===Se}function he(e,t){let r=e;r.isTTY&&r.setRawMode(t)}function tt({input:e=et,output:t=Ee,overwrite:r=!0,hideCursor:s=!0}={}){let i=H.createInterface({input:e,output:t,prompt:"",tabSize:1});H.emitKeypressEvents(e,i),e instanceof Xe&&e.isTTY&&e.setRawMode(!0);let n=(o,{name:a,sequence:c})=>{let g=String(o);if(xe([g,a,c],"cancel")){s&&t.write(x.cursor.show),process.exit(0);return}if(!r)return;H.moveCursor(t,a==="return"?0:-1,a==="return"?-1:0,()=>{H.clearLine(t,1,()=>{e.once("keypress",n)})})};return s&&t.write(x.cursor.hide),e.once("keypress",n),()=>{e.off("keypress",n),s&&t.write(x.cursor.show),e instanceof Xe&&e.isTTY&&!gr&&e.setRawMode(!1),i.terminal=!1,i.close()}}var Re=e=>"columns"in e&&typeof e.columns=="number"?e.columns:80,rt=e=>"rows"in e&&typeof e.rows=="number"?e.rows:20;function st(e,t,r,s=r,i=r,n){let o=Re(e??Ee);return Y(t,o-r.length,{hard:!0,trim:!1}).split(`
9
9
  `).map((a,c,g)=>{let v=n?n(a,c):a;return c===0?`${s}${v}`:c===g.length-1?`${i}${v}`:`${r}${v}`}).join(`
@@ -12,7 +12,7 @@ var Vt=Object.create;var Pe=Object.defineProperty;var jt=Object.getOwnPropertyDe
12
12
  `).length-1;this.output.write(x.cursor.move(-999,e*-1))}render(){let e=Y(this._render(this)??"",process.stdout.columns,{hard:!0,trim:!1});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(x.cursor.hide);else{let t=pr(this._prevFrame,e),r=rt(this.output);if(this.restoreCursor(),t){let s=Math.max(0,t.numLinesAfter-r),i=Math.max(0,t.numLinesBefore-r),n=t.lines.find(o=>o>=s);if(n===void 0){this._prevFrame=e;return}if(t.lines.length===1){this.output.write(x.cursor.move(0,n-i)),this.output.write(x.erase.lines(1));let o=e.split(`
13
13
  `);this.output.write(o[n]),this._prevFrame=e,this.output.write(x.cursor.move(0,o.length-n-1));return}else if(t.lines.length>1){if(s<i)n=s;else{let a=n-i;a>0&&this.output.write(x.cursor.move(0,a))}this.output.write(x.erase.down());let o=e.split(`
14
14
  `).slice(n);this.output.write(o.join(`
15
- `)),this._prevFrame=e;return}}this.output.write(x.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}};var me=class extends it{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(t){super(t,!1),this.value=!!t.initialValue,this.on("userInput",()=>{this.value=this._value}),this.on("confirm",r=>{this.output.write(x.cursor.move(0,-1)),this.value=r,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var de=class extends it{get userInputWithCursor(){if(this.state==="submit")return this.userInput;let t=this.userInput;if(this.cursor>=t.length)return`${this.userInput}\u2588`;let r=t.slice(0,this.cursor),[s,...i]=t.slice(this.cursor);return`${r}${cr("inverse",s)}${i.join("")}`}get cursor(){return this._cursor}constructor(t){super({...t,initialUserInput:t.initialUserInput??t.initialValue}),this.on("userInput",r=>{this._setValue(r)}),this.on("finalize",()=>{this.value||(this.value=t.defaultValue),this.value===void 0&&(this.value="")})}};import{styleText as u,stripVTControlCharacters as Bs}from"node:util";import O from"node:process";var se=ke(Ie(),1);function fr(){return O.platform!=="win32"?O.env.TERM!=="linux":!!O.env.CI||!!O.env.WT_SESSION||!!O.env.TERMINUS_SUBLIME||O.env.ConEmuTask==="{cmd::Cmder}"||O.env.TERM_PROGRAM==="Terminus-Sublime"||O.env.TERM_PROGRAM==="vscode"||O.env.TERM==="xterm-256color"||O.env.TERM==="alacritty"||O.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Te=fr(),$r=()=>process.env.CI==="true";var p=(e,t)=>Te?e:t,yr=p("\u25C6","*"),at=p("\u25A0","x"),ut=p("\u25B2","x"),_e=p("\u25C7","o"),vr=p("\u250C","T"),E=p("\u2502","|"),ie=p("\u2514","\u2014"),js=p("\u2510","T"),Gs=p("\u2518","\u2014"),nt=p("\u25CF",">"),ot=p("\u25CB"," "),Ws=p("\u25FB","[\u2022]"),qs=p("\u25FC","[+]"),Hs=p("\u25FB","[ ]"),Ks=p("\u25AA","\u2022"),zs=p("\u2500","-"),Ys=p("\u256E","+"),Js=p("\u251C","+"),Qs=p("\u256F","+"),Zs=p("\u2570","+"),Xs=p("\u256D","+"),br=p("\u25CF","\u2022"),wr=p("\u25C6","*"),Cr=p("\u25B2","!"),Ir=p("\u25A0","x"),lt=e=>{switch(e){case"initial":case"active":return u("cyan",yr);case"cancel":return u("red",at);case"error":return u("yellow",ut);case"submit":return u("green",_e)}};var ct=e=>{let t=e.active??"Yes",r=e.inactive??"No";return new me({active:t,inactive:r,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue??!0,render(){let s=e.withGuide??R.withGuide,i=`${lt(this.state)} `,n=s?`${u("gray",E)} `:"",o=st(e.output,e.message,n,i),a=`${s?`${u("gray",E)}
15
+ `)),this._prevFrame=e;return}}this.output.write(x.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}};var me=class extends it{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(t){super(t,!1),this.value=!!t.initialValue,this.on("userInput",()=>{this.value=this._value}),this.on("confirm",r=>{this.output.write(x.cursor.move(0,-1)),this.value=r,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var de=class extends it{get userInputWithCursor(){if(this.state==="submit")return this.userInput;let t=this.userInput;if(this.cursor>=t.length)return`${this.userInput}\u2588`;let r=t.slice(0,this.cursor),[s,...i]=t.slice(this.cursor);return`${r}${cr("inverse",s)}${i.join("")}`}get cursor(){return this._cursor}constructor(t){super({...t,initialUserInput:t.initialUserInput??t.initialValue}),this.on("userInput",r=>{this._setValue(r)}),this.on("finalize",()=>{this.value||(this.value=t.defaultValue),this.value===void 0&&(this.value="")})}};import{styleText as u,stripVTControlCharacters as Bs}from"node:util";import O from"node:process";var se=Pe(Ie(),1);function fr(){return O.platform!=="win32"?O.env.TERM!=="linux":!!O.env.CI||!!O.env.WT_SESSION||!!O.env.TERMINUS_SUBLIME||O.env.ConEmuTask==="{cmd::Cmder}"||O.env.TERM_PROGRAM==="Terminus-Sublime"||O.env.TERM_PROGRAM==="vscode"||O.env.TERM==="xterm-256color"||O.env.TERM==="alacritty"||O.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Te=fr(),$r=()=>process.env.CI==="true";var p=(e,t)=>Te?e:t,yr=p("\u25C6","*"),at=p("\u25A0","x"),ut=p("\u25B2","x"),_e=p("\u25C7","o"),vr=p("\u250C","T"),E=p("\u2502","|"),ie=p("\u2514","\u2014"),js=p("\u2510","T"),Gs=p("\u2518","\u2014"),nt=p("\u25CF",">"),ot=p("\u25CB"," "),Ws=p("\u25FB","[\u2022]"),qs=p("\u25FC","[+]"),Hs=p("\u25FB","[ ]"),Ks=p("\u25AA","\u2022"),zs=p("\u2500","-"),Ys=p("\u256E","+"),Js=p("\u251C","+"),Qs=p("\u256F","+"),Zs=p("\u2570","+"),Xs=p("\u256D","+"),br=p("\u25CF","\u2022"),wr=p("\u25C6","*"),Cr=p("\u25B2","!"),Ir=p("\u25A0","x"),lt=e=>{switch(e){case"initial":case"active":return u("cyan",yr);case"cancel":return u("red",at);case"error":return u("yellow",ut);case"submit":return u("green",_e)}};var ct=e=>{let t=e.active??"Yes",r=e.inactive??"No";return new me({active:t,inactive:r,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue??!0,render(){let s=e.withGuide??R.withGuide,i=`${lt(this.state)} `,n=s?`${u("gray",E)} `:"",o=st(e.output,e.message,n,i),a=`${s?`${u("gray",E)}
16
16
  `:""}${o}
17
17
  `,c=this.value?t:r;switch(this.state){case"submit":{let g=s?`${u("gray",E)} `:"";return`${a}${g}${u("dim",c)}`}case"cancel":{let g=s?`${u("gray",E)} `:"";return`${a}${g}${u(["strikethrough","dim"],c)}${s?`
18
18
  ${u("gray",E)}`:""}`}default:{let g=s?`${u("cyan",E)} `:"",v=s?u("cyan",ie):"";return`${a}${g}${this.value?`${u("green",nt)} ${t}`:`${u("dim",ot)} ${u("dim",t)}`}${e.vertical?s?`
@@ -28,12 +28,12 @@ ${v}
28
28
  `)},dt=(e="",t)=>{let r=t?.output??process.stdout,s=t?.withGuide??R.withGuide?`${u("gray",E)}
29
29
  ${u("gray",ie)} `:"";r.write(`${s}${e}
30
30
 
31
- `)};var Sr=e=>u("magenta",e),pt=({indicator:e="dots",onCancel:t,output:r=process.stdout,cancelMessage:s,errorMessage:i,frames:n=Te?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],delay:o=Te?80:120,signal:a,...c}={})=>{let g=$r(),v,m,d=!1,I=!1,h="",f,U=performance.now(),G=Re(r),W=c?.styleFrame??Sr,P=b=>{let F=b>1?i??R.messages.error:s??R.messages.cancel;I=b===1,d&&(re(F,b),I&&typeof t=="function"&&t())},D=()=>P(2),_=()=>P(1),Q=()=>{process.on("uncaughtExceptionMonitor",D),process.on("unhandledRejection",D),process.on("SIGINT",_),process.on("SIGTERM",_),process.on("exit",P),a&&a.addEventListener("abort",_)},k=()=>{process.removeListener("uncaughtExceptionMonitor",D),process.removeListener("unhandledRejection",D),process.removeListener("SIGINT",_),process.removeListener("SIGTERM",_),process.removeListener("exit",P),a&&a.removeEventListener("abort",_)},T=()=>{if(f===void 0)return;g&&r.write(`
31
+ `)};var Sr=e=>u("magenta",e),pt=({indicator:e="dots",onCancel:t,output:r=process.stdout,cancelMessage:s,errorMessage:i,frames:n=Te?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],delay:o=Te?80:120,signal:a,...c}={})=>{let g=$r(),v,m,d=!1,I=!1,h="",f,U=performance.now(),G=Re(r),W=c?.styleFrame??Sr,k=b=>{let F=b>1?i??R.messages.error:s??R.messages.cancel;I=b===1,d&&(re(F,b),I&&typeof t=="function"&&t())},D=()=>k(2),_=()=>k(1),Q=()=>{process.on("uncaughtExceptionMonitor",D),process.on("unhandledRejection",D),process.on("SIGINT",_),process.on("SIGTERM",_),process.on("exit",k),a&&a.addEventListener("abort",_)},P=()=>{process.removeListener("uncaughtExceptionMonitor",D),process.removeListener("unhandledRejection",D),process.removeListener("SIGINT",_),process.removeListener("SIGTERM",_),process.removeListener("exit",k),a&&a.removeEventListener("abort",_)},T=()=>{if(f===void 0)return;g&&r.write(`
32
32
  `);let b=Y(f,G,{hard:!0,trim:!1}).split(`
33
33
  `);b.length>1&&r.write(se.cursor.up(b.length-1)),r.write(se.cursor.to(0)),r.write(se.erase.down())},q=b=>b.replace(/\.+$/,""),z=b=>{let F=(performance.now()-b)/1e3,V=Math.floor(F/60),j=Math.floor(F%60);return V>0?`[${V}m ${j}s]`:`[${j}s]`},M=c.withGuide??R.withGuide,ue=(b="")=>{d=!0,v=tt({output:r}),h=q(b),U=performance.now(),M&&r.write(`${u("gray",E)}
34
34
  `);let F=0,V=0;Q(),m=setInterval(()=>{if(g&&h===f)return;T(),f=h;let j=W(n[F]),le;if(g)le=`${j} ${h}...`;else if(e==="timer")le=`${j} ${h} ${z(U)}`;else{let Dt=".".repeat(Math.floor(V)).slice(0,3);le=`${j} ${h}${Dt}`}let Ut=Y(le,G,{hard:!0,trim:!1});r.write(Ut),F=F+1<n.length?F+1:0,V=V<4?V+.125:0},o)},re=(b="",F=0,V=!1)=>{if(!d)return;d=!1,clearInterval(m),T();let j=F===0?u("green",_e):F===1?u("red",at):u("red",ut);h=b??h,V||(e==="timer"?r.write(`${j} ${h} ${z(U)}
35
35
  `):r.write(`${j} ${h}
36
- `)),k(),v()};return{start:ue,stop:(b="")=>re(b,0),message:(b="")=>{h=q(b??h)},cancel:(b="")=>re(b,1),error:(b="")=>re(b,2),clear:()=>re("",0,!0),get isCancelled(){return I}}},ei={light:p("\u2500","-"),heavy:p("\u2501","="),block:p("\u2588","#")};var ti=`${u("gray",E)} `;var K=e=>new de({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,output:e.output,signal:e.signal,input:e.input,render(){let t=e?.withGuide??R.withGuide,r=`${`${t?`${u("gray",E)}
36
+ `)),P(),v()};return{start:ue,stop:(b="")=>re(b,0),message:(b="")=>{h=q(b??h)},cancel:(b="")=>re(b,1),error:(b="")=>re(b,2),clear:()=>re("",0,!0),get isCancelled(){return I}}},ei={light:p("\u2500","-"),heavy:p("\u2501","="),block:p("\u2588","#")};var ti=`${u("gray",E)} `;var K=e=>new de({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,output:e.output,signal:e.signal,input:e.input,render(){let t=e?.withGuide??R.withGuide,r=`${`${t?`${u("gray",E)}
37
37
  `:""}${lt(this.state)} `}${e.message}
38
38
  `,s=e.placeholder?u("inverse",e.placeholder[0])+u("dim",e.placeholder.slice(1)):u(["inverse","hidden"],"_"),i=this.userInput?this.userInputWithCursor:s,n=this.value??"";switch(this.state){case"error":{let o=this.error?` ${u("yellow",this.error)}`:"",a=t?`${u("yellow",E)} `:"",c=t?u("yellow",ie):"";return`${r.trim()}
39
39
  ${a}${i}
@@ -41,11 +41,11 @@ ${c}${o}
41
41
  `}case"submit":{let o=n?` ${u("dim",n)}`:"",a=t?u("gray",E):"";return`${r}${a}${o}`}case"cancel":{let o=n?` ${u(["strikethrough","dim"],n)}`:"",a=t?u("gray",E):"";return`${r}${a}${o}${n.trim()?`
42
42
  ${a}`:""}`}default:{let o=t?`${u("cyan",E)} `:"",a=t?u("cyan",ie):"";return`${r}${o}${i}
43
43
  ${a}
44
- `}}}}).prompt();import ls from"os";import cs from"path";import{existsSync as Er,readFileSync as xr,writeFileSync as ni,mkdirSync as oi}from"fs";import Rr from"os";import $t from"path";var Tr=$t.join(Rr.homedir(),".eazy-git"),gt=$t.join(Tr,"config.json"),ft={language:"es",defaultBaseBranch:"release",aiProvider:"claude"};function yt(){try{if(Er(gt)){let e=xr(gt,"utf-8");return{...ft,...JSON.parse(e)}}}catch{}return{...ft}}var vt={welcome:"Bienvenido a",subtitle:"tu CLI de confianza para gestionar ramas en GIT",operationCompleted:"Operacion completada!",operationCancelled:"Operacion cancelada. Saliendo...",unknownCommand:"Comando desconocido",errorExecuting:"Error al ejecutar el comando",version:"eazy-git version",whatToDo:"Que deseas hacer?",addChanges:"Agregar cambios a una rama",createOriginal:"Crear rama original",createTemporal:"Crear rama temporal",notGitRepo:"Este directorio no es un repositorio git",gitNotInstalled:"git no esta instalado en el sistema",currentBranch:"Branch actual",filesChanged:"Archivos con cambios",noChangesPending:"No hay cambios pendientes. Deseas continuar de todas formas?",updatingRefs:"Actualizando referencias remotas...",refsUpdated:"Referencias actualizadas",fetchFailed:"No se pudo hacer fetch (continuando...)",baseBranch:"Desde que branch base quieres crear la rama?",baseBranchRequired:"El branch base es requerido",ticketId:"Cual es el identificador del ticket? (ej: DPW-0000)",ticketRequired:"El ticket es requerido",changeType:"Que tipo de cambio es?",branchExistsLocal:e=>`La rama "${e}" ya existe localmente. Que deseas hacer?`,switchToIt:"Cambiarme a ella y continuar",cancel:"Cancelar",cancelledOp:"Operacion cancelada.",creatingBranch:(e,t)=>`Creando rama ${e} desde origin/${t}...`,branchCreated:e=>`Rama ${e} creada`,errorCreatingBranch:e=>`Error al crear la rama: ${e}`,noFilesToStage:"No hay archivos para stagear.",selectFiles:"Cuales archivos quieres incluir en el commit?",selectAllFiles:"Seleccionar todos los archivos",stagedFiles:"Archivos en stage",stagedCorrect:"Los archivos en stage son correctos?",aiProvider:"Con que IA quieres generar la sugerencia de commit?",generatingCommit:e=>`Generando sugerencia de commit con ${e}...`,aiSuggestionFailed:e=>`No se pudo obtener sugerencia de ${e}. Escribe el mensaje manualmente.`,writeCommitMsg:"Escribe el mensaje de commit:",commitMsgRequired:"El mensaje es requerido",suggestionOf:e=>`Sugerencia de ${e}`,useThisCommit:"Este mensaje de commit te parece bien?",yesUseIt:"Si, usar este",modify:"Modificar",commitSuccess:"Commit realizado correctamente",hookBlocked:"El pre-commit hook bloqueo el commit. Que deseas hacer?",retryHook:"Ya lo corregi, agrega los cambios y vuelve a intentarlo",skipHook:"Saltar el hook (--no-verify)",commitNoHooks:"Commit realizado (sin hooks)",pushToRemote:"Deseas subir la rama al repositorio remoto?",pushSuccess:"Push realizado",pushForceQuestion:"La rama ya existe en el remoto con historial diferente. Deseas forzar el push? (git push -f)",pushForceSuccess:"Push forzado realizado",pushForceError:e=>`Error en el push forzado: ${e}`,pushError:e=>`Error en el push: ${e}`,summaryTitle:"Resumen",summaryBranch:"Rama",summaryFrom:"Desde",summaryCommit:"Commit",summaryFiles:e=>`${e} archivos commiteados`,summaryPush:"Push",summaryPR:"Crear PR",statusModified:"modificado",statusAdded:"agregado",statusDeleted:"eliminado",statusRenamed:"renombrado",statusUntracked:"sin rastrear",commitTypes:{fix:"fix \u2014 correccion de bug",feat:"feat \u2014 nueva funcionalidad",refactor:"refactor \u2014 mejora sin cambio funcional",chore:"chore \u2014 mantenimiento, dependencias",docs:"docs \u2014 documentacion",test:"test \u2014 pruebas",ci:"ci \u2014 integracion continua",perf:"perf \u2014 rendimiento",style:"style \u2014 formato, sin cambio de logica"},selectBranchType:"Selecciona el tipo de rama:",branchFix:"Fix",branchImprovement:"Mejora",branchFeature:"Feature",branchRefactor:"Refactor",creatingOriginalBranch:"Creando rama original...",branchCreatedAndPushed:e=>`Rama "${e}" creada y pusheada correctamente!`,branchCreatedSuccess:e=>`Rama "${e}" creada correctamente!`,mergeBranchQuestion:"A que rama deseas hacer merge?",developDEV:"develop (DEV)",releaseUAT:"release (UAT)",temporalBranchCreated:"Rama temporal creada correctamente",temporalBranchMerged:"Rama temporal mergeada correctamente",conflictsDetected:"Conflictos detectados. Resolvelos manualmente!",branchPushedToRemote:"Rama pusheada al repositorio remoto",removeTemporalBranch:"Deseas eliminar la rama temporal?",temporalBranchDeleted:"Rama temporal eliminada correctamente",errorCreatingTemporal:"Error creando la rama temporal",enterJiraCode:"Ingresa el codigo del ticket JIRA:",jiraRequired:"El codigo JIRA es requerido!",jiraInvalidFormat:"El codigo JIRA debe tener el formato DPW-0000",fetchingRemote:"Obteniendo cambios remotos...",pullingChanges:"Aplicando cambios en tu rama...",pullError:e=>`Error: ${e}`,pushingChanges:"Subiendo cambios al remoto...",pushedSuccess:"Cambios subidos correctamente!",pushedForceSuccess:"Cambios subidos (forzado) correctamente!",pushQuickError:e=>`Error: ${e}`,provideCommitMsg:"Proporciona un mensaje de commit",stagingChanges:"Stageando cambios...",creatingCommit:"Creando commit...",commitCreated:"Commit creado correctamente!",commitError:e=>`Error: ${e}`,switchingPrevBranch:"Cambiando a la rama anterior...",switchedTo:e=>`Cambiado a rama ${e} correctamente!`,checkoutError:e=>`Error: ${e}`,fetchingLatest:"Obteniendo ultimos cambios...",mergingWith:e=>`Mergeando con ${e}...`,pushingMerged:"Subiendo cambios mergeados...",mergeCompleted:"Merge completado correctamente!",mergeError:e=>`Error: ${e}`,removingLastCommit:"Eliminando ultimo commit...",removeLastConfirm:"Esto eliminara el ultimo commit (los cambios se mantienen en staging). Continuar?",lastCommitRemoved:"Ultimo commit eliminado correctamente!",removeLastError:e=>`Error: ${e}`,logError:e=>`Error: ${e}`,settingUpConfig:"Configurando tu entorno",configSaved:"Configuracion guardada",missingConfigValues:"Faltan valores de configuracion requeridos.",errorWritingConfig:"Error escribiendo archivo de configuracion:",currentConfig:"Configuracion actual",useThisConfig:"Deseas usar esta configuracion?",installingDeps:"Instalando dependencias...",depsInstalled:"Todas las dependencias fueron instaladas",authFailed:"Autenticacion fallida",unexpectedError:"Ocurrio un error inesperado",enterEndpoint:"Ingresa la URL del endpoint:",urlRequired:"La URL es requerida!",urlMustBeHttp:"La URL debe usar protocolo HTTP/HTTPS",urlMustHaveHost:"La URL debe incluir un hostname",urlInvalid:"Ingresa una URL valida",enterApiKey:"Ingresa tu apikey:",apiKeyRequired:"El API key es requerido!",enterRegistryName:"Ingresa el nombre del registro NPM (sin caracteres especiales):",registryNameRequired:"El nombre del registro es requerido!",registryNameLettersOnly:"El nombre del registro debe contener solo letras",enterRegistryURL:"Ingresa la URL del registro NPM (sin http/https):",registryURLRequired:"La URL del registro es requerida!",registryURLStartWithName:"La URL debe empezar con un nombre, evita caracteres especiales",registryURLNoProtocol:"La URL no debe incluir protocolo 'http/https' y debe empezar con una letra",registryURLNoSlash:"La URL no debe empezar con '/' y debe empezar con una letra o numero",registryURLNoWWW:"La URL no debe empezar con 'www' y debe empezar con una letra o numero",languageSelect:"Selecciona el idioma de la interfaz:",languageChanged:e=>`Idioma cambiado a: ${e}`,configMenu:"Que deseas configurar?",configLanguage:"Idioma de la interfaz",configDefaultBranch:"Rama base por defecto",configAIProvider:"Proveedor de IA por defecto",configView:"Ver configuracion actual",defaultBranchSet:e=>`Rama base por defecto: ${e}`,aiProviderSet:e=>`Proveedor de IA por defecto: ${e}`};var bt={welcome:"Welcome to",subtitle:"your trusted CLI for GIT branch management",operationCompleted:"Operation completed!",operationCancelled:"Operation cancelled. Exiting...",unknownCommand:"Unknown command",errorExecuting:"Error executing command",version:"eazy-git version",whatToDo:"What would you like to do?",addChanges:"Add Changes to Branch",createOriginal:"Create Original Branch",createTemporal:"Create Temporal Branch",notGitRepo:"This directory is not a git repository",gitNotInstalled:"git is not installed on the system",currentBranch:"Current branch",filesChanged:"Files with changes",noChangesPending:"No pending changes. Do you want to continue anyway?",updatingRefs:"Updating remote references...",refsUpdated:"References updated",fetchFailed:"Could not fetch (continuing...)",baseBranch:"From which base branch do you want to create the branch?",baseBranchRequired:"Base branch is required",ticketId:"What is the ticket identifier? (e.g.: DPW-0000)",ticketRequired:"Ticket is required",changeType:"What type of change is this?",branchExistsLocal:e=>`Branch "${e}" already exists locally. What would you like to do?`,switchToIt:"Switch to it and continue",cancel:"Cancel",cancelledOp:"Operation cancelled.",creatingBranch:(e,t)=>`Creating branch ${e} from origin/${t}...`,branchCreated:e=>`Branch ${e} created`,errorCreatingBranch:e=>`Error creating branch: ${e}`,noFilesToStage:"No files to stage.",selectFiles:"Which files do you want to include in the commit?",selectAllFiles:"Select all files",stagedFiles:"Staged files",stagedCorrect:"Are the staged files correct?",aiProvider:"Which AI do you want to use for the commit suggestion?",generatingCommit:e=>`Generating commit suggestion with ${e}...`,aiSuggestionFailed:e=>`Could not get suggestion from ${e}. Write the message manually.`,writeCommitMsg:"Write the commit message:",commitMsgRequired:"Message is required",suggestionOf:e=>`${e} suggestion`,useThisCommit:"Does this commit message look good?",yesUseIt:"Yes, use it",modify:"Modify",commitSuccess:"Commit created successfully",hookBlocked:"The pre-commit hook blocked the commit. What would you like to do?",retryHook:"I fixed it, re-stage and retry",skipHook:"Skip the hook (--no-verify)",commitNoHooks:"Commit created (without hooks)",pushToRemote:"Do you want to push the branch to the remote repository?",pushSuccess:"Push completed",pushForceQuestion:"The branch already exists on remote with different history. Force push? (git push -f)",pushForceSuccess:"Force push completed",pushForceError:e=>`Error in force push: ${e}`,pushError:e=>`Error in push: ${e}`,summaryTitle:"Summary",summaryBranch:"Branch",summaryFrom:"From",summaryCommit:"Commit",summaryFiles:e=>`${e} files committed`,summaryPush:"Push",summaryPR:"Create PR",statusModified:"modified",statusAdded:"added",statusDeleted:"deleted",statusRenamed:"renamed",statusUntracked:"untracked",commitTypes:{fix:"fix - bug fix",feat:"feat - new feature",refactor:"refactor - improvement without functional change",chore:"chore - maintenance, dependencies",docs:"docs - documentation",test:"test - testing",ci:"ci - continuous integration",perf:"perf - performance",style:"style - formatting, no logic change"},selectBranchType:"Select the branch type:",branchFix:"Fix",branchImprovement:"Improvement",branchFeature:"Feature",branchRefactor:"Refactor",creatingOriginalBranch:"Creating original branch...",branchCreatedAndPushed:e=>`Branch "${e}" created and pushed successfully!`,branchCreatedSuccess:e=>`Branch "${e}" created successfully!`,mergeBranchQuestion:"Which branch do you want to merge into?",developDEV:"develop (DEV)",releaseUAT:"release (UAT)",temporalBranchCreated:"Temporal branch created successfully",temporalBranchMerged:"Temporal branch merged successfully",conflictsDetected:"Conflicts detected. Please resolve them manually!",branchPushedToRemote:"Branch pushed to remote repository",removeTemporalBranch:"Do you want to remove the temporal branch?",temporalBranchDeleted:"Temporal branch deleted successfully",errorCreatingTemporal:"Error creating the temporal branch",enterJiraCode:"Enter the JIRA ticket code:",jiraRequired:"JIRA code is required!",jiraInvalidFormat:"JIRA code must have the format DPW-0000",fetchingRemote:"Fetching remote changes...",pullingChanges:"Pulling changes into your branch...",pullError:e=>`Error: ${e}`,pushingChanges:"Pushing changes to remote...",pushedSuccess:"Changes pushed successfully!",pushedForceSuccess:"Changes pushed (force) successfully!",pushQuickError:e=>`Error: ${e}`,provideCommitMsg:"Please provide a commit message",stagingChanges:"Staging changes...",creatingCommit:"Creating commit...",commitCreated:"Commit created successfully!",commitError:e=>`Error: ${e}`,switchingPrevBranch:"Switching to previous branch...",switchedTo:e=>`Successfully switched to ${e} branch!`,checkoutError:e=>`Error: ${e}`,fetchingLatest:"Fetching latest changes...",mergingWith:e=>`Merging with ${e}...`,pushingMerged:"Pushing merged changes...",mergeCompleted:"Merge completed successfully!",mergeError:e=>`Error: ${e}`,removingLastCommit:"Removing last commit...",removeLastConfirm:"This will remove the last commit (changes will remain in staging). Continue?",lastCommitRemoved:"Last commit removed successfully!",removeLastError:e=>`Error: ${e}`,logError:e=>`Error: ${e}`,settingUpConfig:"Setting up your configuration",configSaved:"Configuration saved",missingConfigValues:"Missing required configuration values.",errorWritingConfig:"Error writing configuration file:",currentConfig:"Current configuration",useThisConfig:"Would you like to use this configuration?",installingDeps:"Installing dependencies...",depsInstalled:"All dependencies were installed",authFailed:"Authentication failed",unexpectedError:"An unexpected error occurred",enterEndpoint:"Enter your endpoint URL:",urlRequired:"URL is required!",urlMustBeHttp:"URL must use HTTP/HTTPS protocol",urlMustHaveHost:"URL must include a hostname",urlInvalid:"Please enter a valid URL",enterApiKey:"Enter your apikey:",apiKeyRequired:"API key is required!",enterRegistryName:"Enter your NPM registry name (without special characters):",registryNameRequired:"Registry name is required!",registryNameLettersOnly:"Registry name must contain only letters",enterRegistryURL:"Enter your NPM registry URL (without http/https):",registryURLRequired:"Registry URL is required!",registryURLStartWithName:"URL must start with a name only, avoid special characters",registryURLNoProtocol:"URL must not include 'http/https' protocol and must start with a letter",registryURLNoSlash:"URL must not start with '/' and must begin with a letter or number",registryURLNoWWW:"URL must not start with 'www' and must begin with a letter or number",languageSelect:"Select the interface language:",languageChanged:e=>`Language changed to: ${e}`,configMenu:"What would you like to configure?",configLanguage:"Interface language",configDefaultBranch:"Default base branch",configAIProvider:"Default AI provider",configView:"View current configuration",defaultBranchSet:e=>`Default base branch: ${e}`,aiProviderSet:e=>`Default AI provider: ${e}`};var wt={es:vt,en:bt};function l(e,...t){let s=yt().language||"es",n=(wt[s]||wt.es)[e];return typeof n=="function"?n(...t):n||e}function L(e){if(pe(e))return ht(l("operationCancelled")),process.exit(0)}var Ct=(e=0)=>t=>`\x1B[${t+e}m`,It=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,St=(e=0)=>(t,r,s)=>`\x1B[${38+e};2;${t};${r};${s}m`,$={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]}},vi=Object.keys($.modifier),_r=Object.keys($.color),Mr=Object.keys($.bgColor),bi=[..._r,...Mr];function Fr(){let e=new Map;for(let[t,r]of Object.entries($)){for(let[s,i]of Object.entries(r))$[s]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[s]=$[s],e.set(i[0],i[1]);Object.defineProperty($,t,{value:r,enumerable:!1})}return Object.defineProperty($,"codes",{value:e,enumerable:!1}),$.color.close="\x1B[39m",$.bgColor.close="\x1B[49m",$.color.ansi=Ct(),$.color.ansi256=It(),$.color.ansi16m=St(),$.bgColor.ansi=Ct(10),$.bgColor.ansi256=It(10),$.bgColor.ansi16m=St(10),Object.defineProperties($,{rgbToAnsi256:{value(t,r,s){return t===r&&r===s?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(s/255*5)},enumerable:!1},hexToRgb:{value(t){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!r)return[0,0,0];let[s]=r;s.length===3&&(s=[...s].map(n=>n+n).join(""));let i=Number.parseInt(s,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:t=>$.rgbToAnsi256(...$.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,s,i;if(t>=232)r=((t-232)*10+8)/255,s=r,i=r;else{t-=16;let a=t%36;r=Math.floor(t/36)/5,s=Math.floor(a/6)/5,i=a%6/5}let n=Math.max(r,s,i)*2;if(n===0)return 30;let o=30+(Math.round(i)<<2|Math.round(s)<<1|Math.round(r));return n===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(t,r,s)=>$.ansi256ToAnsi($.rgbToAnsi256(t,r,s)),enumerable:!1},hexToAnsi:{value:t=>$.ansi256ToAnsi($.hexToAnsi256(t)),enumerable:!1}}),$}var Ar=Fr(),N=Ar;import Me from"node:process";import Or from"node:os";import Et from"node:tty";function A(e,t=globalThis.Deno?globalThis.Deno.args:Me.argv){let r=e.startsWith("-")?"":e.length===1?"-":"--",s=t.indexOf(r+e),i=t.indexOf("--");return s!==-1&&(i===-1||s<i)}var{env:w}=Me,ge;A("no-color")||A("no-colors")||A("color=false")||A("color=never")?ge=0:(A("color")||A("colors")||A("color=true")||A("color=always"))&&(ge=1);function Lr(){if("FORCE_COLOR"in w)return w.FORCE_COLOR==="true"?1:w.FORCE_COLOR==="false"?0:w.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(w.FORCE_COLOR,10),3)}function Nr(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Pr(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let s=Lr();s!==void 0&&(ge=s);let i=r?ge:s;if(i===0)return 0;if(r){if(A("color=16m")||A("color=full")||A("color=truecolor"))return 3;if(A("color=256"))return 2}if("TF_BUILD"in w&&"AGENT_NAME"in w)return 1;if(e&&!t&&i===void 0)return 0;let n=i||0;if(w.TERM==="dumb")return n;if(Me.platform==="win32"){let o=Or.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in w)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(o=>o in w)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(o=>o in w)||w.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in w)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(w.TEAMCITY_VERSION)?1:0;if(w.COLORTERM==="truecolor"||w.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in w){let o=Number.parseInt((w.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(w.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(w.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(w.TERM)||"COLORTERM"in w?1:n}function xt(e,t={}){let r=Pr(e,{streamIsTTY:e&&e.isTTY,...t});return Nr(r)}var kr={stdout:xt({isTTY:Et.isatty(1)}),stderr:xt({isTTY:Et.isatty(2)})},Rt=kr;function Tt(e,t,r){let s=e.indexOf(t);if(s===-1)return e;let i=t.length,n=0,o="";do o+=e.slice(n,s)+t+r,n=s+i,s=e.indexOf(t,n);while(s!==-1);return o+=e.slice(n),o}function _t(e,t,r,s){let i=0,n="";do{let o=e[s-1]==="\r";n+=e.slice(i,o?s-1:s)+t+(o?`\r
44
+ `}}}}).prompt();import ls from"os";import cs from"path";import{existsSync as Er,readFileSync as xr,writeFileSync as ni,mkdirSync as oi}from"fs";import Rr from"os";import $t from"path";var Tr=$t.join(Rr.homedir(),".eazy-git"),gt=$t.join(Tr,"config.json"),ft={language:"es",defaultBaseBranch:"release",aiProvider:"claude"};function yt(){try{if(Er(gt)){let e=xr(gt,"utf-8");return{...ft,...JSON.parse(e)}}}catch{}return{...ft}}var vt={welcome:"Bienvenido a",subtitle:"tu CLI de confianza para gestionar ramas en GIT",operationCompleted:"Operacion completada!",operationCancelled:"Operacion cancelada. Saliendo...",unknownCommand:"Comando desconocido",errorExecuting:"Error al ejecutar el comando",version:"eazy-git version",whatToDo:"Que deseas hacer?",addChanges:"Agregar cambios a una rama",createOriginal:"Crear rama original",createTemporal:"Crear rama temporal",notGitRepo:"Este directorio no es un repositorio git",gitNotInstalled:"git no esta instalado en el sistema",currentBranch:"Branch actual",filesChanged:"Archivos con cambios",noChangesPending:"No hay cambios pendientes. Deseas continuar de todas formas?",updatingRefs:"Actualizando referencias remotas...",refsUpdated:"Referencias actualizadas",fetchFailed:"No se pudo hacer fetch (continuando...)",baseBranch:"Desde que branch base quieres crear la rama?",baseBranchRequired:"El branch base es requerido",ticketId:"Cual es el identificador del ticket? (ej: DPW-0000)",ticketRequired:"El ticket es requerido",changeType:"Que tipo de cambio es?",branchExistsLocal:e=>`La rama "${e}" ya existe localmente. Que deseas hacer?`,switchToIt:"Cambiarme a ella y continuar",cancel:"Cancelar",cancelledOp:"Operacion cancelada.",creatingBranch:(e,t)=>`Creando rama ${e} desde origin/${t}...`,branchCreated:e=>`Rama ${e} creada`,errorCreatingBranch:e=>`Error al crear la rama: ${e}`,noFilesToStage:"No hay archivos para stagear.",selectFiles:"Cuales archivos quieres incluir en el commit?",selectAllFiles:"Seleccionar todos los archivos",stagedFiles:"Archivos en stage",stagedCorrect:"Los archivos en stage son correctos?",aiProvider:"Con que IA quieres generar la sugerencia de commit?",generatingCommit:e=>`Generando sugerencia de commit con ${e}...`,aiSuggestionFailed:e=>`No se pudo obtener sugerencia de ${e}. Escribe el mensaje manualmente.`,writeCommitMsg:"Escribe el mensaje de commit:",commitMsgRequired:"El mensaje es requerido",suggestionOf:e=>`Sugerencia de ${e}`,useThisCommit:"Este mensaje de commit te parece bien?",yesUseIt:"Si, usar este",modify:"Modificar",commitSuccess:"Commit realizado correctamente",hookBlocked:"El pre-commit hook bloqueo el commit. Que deseas hacer?",retryHook:"Ya lo corregi, agrega los cambios y vuelve a intentarlo",skipHook:"Saltar el hook (--no-verify)",commitNoHooks:"Commit realizado (sin hooks)",pushToRemote:"Deseas subir la rama al repositorio remoto?",pushSuccess:"Push realizado",pushForceQuestion:"La rama ya existe en el remoto con historial diferente. Deseas forzar el push? (git push -f)",pushForceSuccess:"Push forzado realizado",pushForceError:e=>`Error en el push forzado: ${e}`,pushError:e=>`Error en el push: ${e}`,summaryTitle:"Resumen",summaryBranch:"Rama",summaryFrom:"Desde",summaryCommit:"Commit",summaryFiles:e=>`${e} archivos commiteados`,summaryPush:"Push",summaryPR:"Crear PR",statusModified:"modificado",statusAdded:"agregado",statusDeleted:"eliminado",statusRenamed:"renombrado",statusUntracked:"sin rastrear",commitTypes:{fix:"fix \u2014 correccion de bug",feat:"feat \u2014 nueva funcionalidad",refactor:"refactor \u2014 mejora sin cambio funcional",chore:"chore \u2014 mantenimiento, dependencias",docs:"docs \u2014 documentacion",test:"test \u2014 pruebas",ci:"ci \u2014 integracion continua",perf:"perf \u2014 rendimiento",style:"style \u2014 formato, sin cambio de logica"},selectBranchType:"Selecciona el tipo de rama:",branchFix:"Fix",branchImprovement:"Mejora",branchFeature:"Feature",branchRefactor:"Refactor",creatingOriginalBranch:"Creando rama original...",branchCreatedAndPushed:e=>`Rama "${e}" creada y pusheada correctamente!`,branchCreatedSuccess:e=>`Rama "${e}" creada correctamente!`,mergeBranchQuestion:"A que rama deseas hacer merge?",developDEV:"develop (DEV)",releaseUAT:"release (UAT)",temporalBranchCreated:"Rama temporal creada correctamente",temporalBranchMerged:"Rama temporal mergeada correctamente",conflictsDetected:"Conflictos detectados. Resolvelos manualmente!",branchPushedToRemote:"Rama pusheada al repositorio remoto",removeTemporalBranch:"Deseas eliminar la rama temporal?",temporalBranchDeleted:"Rama temporal eliminada correctamente",errorCreatingTemporal:"Error creando la rama temporal",enterJiraCode:"Ingresa el codigo del ticket JIRA:",jiraRequired:"El codigo JIRA es requerido!",jiraInvalidFormat:"El codigo JIRA debe tener el formato DPW-0000",fetchingRemote:"Obteniendo cambios remotos...",pullingChanges:"Aplicando cambios en tu rama...",pullError:e=>`Error: ${e}`,pushingChanges:"Subiendo cambios al remoto...",pushedSuccess:"Cambios subidos correctamente!",pushedForceSuccess:"Cambios subidos (forzado) correctamente!",pushQuickError:e=>`Error: ${e}`,provideCommitMsg:"Proporciona un mensaje de commit",stagingChanges:"Stageando cambios...",creatingCommit:"Creando commit...",commitCreated:"Commit creado correctamente!",commitError:e=>`Error: ${e}`,switchingPrevBranch:"Cambiando a la rama anterior...",switchedTo:e=>`Cambiado a rama ${e} correctamente!`,checkoutError:e=>`Error: ${e}`,fetchingLatest:"Obteniendo ultimos cambios...",mergingWith:e=>`Mergeando con ${e}...`,pushingMerged:"Subiendo cambios mergeados...",mergeCompleted:"Merge completado correctamente!",mergeError:e=>`Error: ${e}`,removingLastCommit:"Eliminando ultimo commit...",removeLastConfirm:"Esto eliminara el ultimo commit (los cambios se mantienen en staging). Continuar?",lastCommitRemoved:"Ultimo commit eliminado correctamente!",removeLastError:e=>`Error: ${e}`,logError:e=>`Error: ${e}`,settingUpConfig:"Configurando tu entorno",configSaved:"Configuracion guardada",missingConfigValues:"Faltan valores de configuracion requeridos.",errorWritingConfig:"Error escribiendo archivo de configuracion:",currentConfig:"Configuracion actual",useThisConfig:"Deseas usar esta configuracion?",installingDeps:"Instalando dependencias...",depsInstalled:"Todas las dependencias fueron instaladas",authFailed:"Autenticacion fallida",unexpectedError:"Ocurrio un error inesperado",enterEndpoint:"Ingresa la URL del endpoint:",urlRequired:"La URL es requerida!",urlMustBeHttp:"La URL debe usar protocolo HTTP/HTTPS",urlMustHaveHost:"La URL debe incluir un hostname",urlInvalid:"Ingresa una URL valida",enterApiKey:"Ingresa tu apikey:",apiKeyRequired:"El API key es requerido!",enterRegistryName:"Ingresa el nombre del registro NPM (sin caracteres especiales):",registryNameRequired:"El nombre del registro es requerido!",registryNameLettersOnly:"El nombre del registro debe contener solo letras",enterRegistryURL:"Ingresa la URL del registro NPM (sin http/https):",registryURLRequired:"La URL del registro es requerida!",registryURLStartWithName:"La URL debe empezar con un nombre, evita caracteres especiales",registryURLNoProtocol:"La URL no debe incluir protocolo 'http/https' y debe empezar con una letra",registryURLNoSlash:"La URL no debe empezar con '/' y debe empezar con una letra o numero",registryURLNoWWW:"La URL no debe empezar con 'www' y debe empezar con una letra o numero",languageSelect:"Selecciona el idioma de la interfaz:",languageChanged:e=>`Idioma cambiado a: ${e}`,configMenu:"Que deseas configurar?",configLanguage:"Cambiar idioma",configDefaultBranch:"Rama base por defecto",configAIProvider:"Proveedor de IA por defecto",configView:"Ver configuracion actual",defaultBranchSet:e=>`Rama base por defecto: ${e}`,aiProviderSet:e=>`Proveedor de IA por defecto: ${e}`,goBack:"Volver"};var bt={welcome:"Welcome to",subtitle:"your trusted CLI for GIT branch management",operationCompleted:"Operation completed!",operationCancelled:"Operation cancelled. Exiting...",unknownCommand:"Unknown command",errorExecuting:"Error executing command",version:"eazy-git version",whatToDo:"What would you like to do?",addChanges:"Add Changes to Branch",createOriginal:"Create Original Branch",createTemporal:"Create Temporal Branch",notGitRepo:"This directory is not a git repository",gitNotInstalled:"git is not installed on the system",currentBranch:"Current branch",filesChanged:"Files with changes",noChangesPending:"No pending changes. Do you want to continue anyway?",updatingRefs:"Updating remote references...",refsUpdated:"References updated",fetchFailed:"Could not fetch (continuing...)",baseBranch:"From which base branch do you want to create the branch?",baseBranchRequired:"Base branch is required",ticketId:"What is the ticket identifier? (e.g.: DPW-0000)",ticketRequired:"Ticket is required",changeType:"What type of change is this?",branchExistsLocal:e=>`Branch "${e}" already exists locally. What would you like to do?`,switchToIt:"Switch to it and continue",cancel:"Cancel",cancelledOp:"Operation cancelled.",creatingBranch:(e,t)=>`Creating branch ${e} from origin/${t}...`,branchCreated:e=>`Branch ${e} created`,errorCreatingBranch:e=>`Error creating branch: ${e}`,noFilesToStage:"No files to stage.",selectFiles:"Which files do you want to include in the commit?",selectAllFiles:"Select all files",stagedFiles:"Staged files",stagedCorrect:"Are the staged files correct?",aiProvider:"Which AI do you want to use for the commit suggestion?",generatingCommit:e=>`Generating commit suggestion with ${e}...`,aiSuggestionFailed:e=>`Could not get suggestion from ${e}. Write the message manually.`,writeCommitMsg:"Write the commit message:",commitMsgRequired:"Message is required",suggestionOf:e=>`${e} suggestion`,useThisCommit:"Does this commit message look good?",yesUseIt:"Yes, use it",modify:"Modify",commitSuccess:"Commit created successfully",hookBlocked:"The pre-commit hook blocked the commit. What would you like to do?",retryHook:"I fixed it, re-stage and retry",skipHook:"Skip the hook (--no-verify)",commitNoHooks:"Commit created (without hooks)",pushToRemote:"Do you want to push the branch to the remote repository?",pushSuccess:"Push completed",pushForceQuestion:"The branch already exists on remote with different history. Force push? (git push -f)",pushForceSuccess:"Force push completed",pushForceError:e=>`Error in force push: ${e}`,pushError:e=>`Error in push: ${e}`,summaryTitle:"Summary",summaryBranch:"Branch",summaryFrom:"From",summaryCommit:"Commit",summaryFiles:e=>`${e} files committed`,summaryPush:"Push",summaryPR:"Create PR",statusModified:"modified",statusAdded:"added",statusDeleted:"deleted",statusRenamed:"renamed",statusUntracked:"untracked",commitTypes:{fix:"fix - bug fix",feat:"feat - new feature",refactor:"refactor - improvement without functional change",chore:"chore - maintenance, dependencies",docs:"docs - documentation",test:"test - testing",ci:"ci - continuous integration",perf:"perf - performance",style:"style - formatting, no logic change"},selectBranchType:"Select the branch type:",branchFix:"Fix",branchImprovement:"Improvement",branchFeature:"Feature",branchRefactor:"Refactor",creatingOriginalBranch:"Creating original branch...",branchCreatedAndPushed:e=>`Branch "${e}" created and pushed successfully!`,branchCreatedSuccess:e=>`Branch "${e}" created successfully!`,mergeBranchQuestion:"Which branch do you want to merge into?",developDEV:"develop (DEV)",releaseUAT:"release (UAT)",temporalBranchCreated:"Temporal branch created successfully",temporalBranchMerged:"Temporal branch merged successfully",conflictsDetected:"Conflicts detected. Please resolve them manually!",branchPushedToRemote:"Branch pushed to remote repository",removeTemporalBranch:"Do you want to remove the temporal branch?",temporalBranchDeleted:"Temporal branch deleted successfully",errorCreatingTemporal:"Error creating the temporal branch",enterJiraCode:"Enter the JIRA ticket code:",jiraRequired:"JIRA code is required!",jiraInvalidFormat:"JIRA code must have the format DPW-0000",fetchingRemote:"Fetching remote changes...",pullingChanges:"Pulling changes into your branch...",pullError:e=>`Error: ${e}`,pushingChanges:"Pushing changes to remote...",pushedSuccess:"Changes pushed successfully!",pushedForceSuccess:"Changes pushed (force) successfully!",pushQuickError:e=>`Error: ${e}`,provideCommitMsg:"Please provide a commit message",stagingChanges:"Staging changes...",creatingCommit:"Creating commit...",commitCreated:"Commit created successfully!",commitError:e=>`Error: ${e}`,switchingPrevBranch:"Switching to previous branch...",switchedTo:e=>`Successfully switched to ${e} branch!`,checkoutError:e=>`Error: ${e}`,fetchingLatest:"Fetching latest changes...",mergingWith:e=>`Merging with ${e}...`,pushingMerged:"Pushing merged changes...",mergeCompleted:"Merge completed successfully!",mergeError:e=>`Error: ${e}`,removingLastCommit:"Removing last commit...",removeLastConfirm:"This will remove the last commit (changes will remain in staging). Continue?",lastCommitRemoved:"Last commit removed successfully!",removeLastError:e=>`Error: ${e}`,logError:e=>`Error: ${e}`,settingUpConfig:"Setting up your configuration",configSaved:"Configuration saved",missingConfigValues:"Missing required configuration values.",errorWritingConfig:"Error writing configuration file:",currentConfig:"Current configuration",useThisConfig:"Would you like to use this configuration?",installingDeps:"Installing dependencies...",depsInstalled:"All dependencies were installed",authFailed:"Authentication failed",unexpectedError:"An unexpected error occurred",enterEndpoint:"Enter your endpoint URL:",urlRequired:"URL is required!",urlMustBeHttp:"URL must use HTTP/HTTPS protocol",urlMustHaveHost:"URL must include a hostname",urlInvalid:"Please enter a valid URL",enterApiKey:"Enter your apikey:",apiKeyRequired:"API key is required!",enterRegistryName:"Enter your NPM registry name (without special characters):",registryNameRequired:"Registry name is required!",registryNameLettersOnly:"Registry name must contain only letters",enterRegistryURL:"Enter your NPM registry URL (without http/https):",registryURLRequired:"Registry URL is required!",registryURLStartWithName:"URL must start with a name only, avoid special characters",registryURLNoProtocol:"URL must not include 'http/https' protocol and must start with a letter",registryURLNoSlash:"URL must not start with '/' and must begin with a letter or number",registryURLNoWWW:"URL must not start with 'www' and must begin with a letter or number",languageSelect:"Select the interface language:",languageChanged:e=>`Language changed to: ${e}`,configMenu:"What would you like to configure?",configLanguage:"Change language",configDefaultBranch:"Default base branch",configAIProvider:"Default AI provider",configView:"View current configuration",defaultBranchSet:e=>`Default base branch: ${e}`,aiProviderSet:e=>`Default AI provider: ${e}`,goBack:"Go back"};var wt={es:vt,en:bt};function l(e,...t){let s=yt().language||"es",n=(wt[s]||wt.es)[e];return typeof n=="function"?n(...t):n||e}function L(e){if(pe(e))return ht(l("operationCancelled")),process.exit(0)}var Ct=(e=0)=>t=>`\x1B[${t+e}m`,It=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,St=(e=0)=>(t,r,s)=>`\x1B[${38+e};2;${t};${r};${s}m`,$={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]}},vi=Object.keys($.modifier),_r=Object.keys($.color),Mr=Object.keys($.bgColor),bi=[..._r,...Mr];function Fr(){let e=new Map;for(let[t,r]of Object.entries($)){for(let[s,i]of Object.entries(r))$[s]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[s]=$[s],e.set(i[0],i[1]);Object.defineProperty($,t,{value:r,enumerable:!1})}return Object.defineProperty($,"codes",{value:e,enumerable:!1}),$.color.close="\x1B[39m",$.bgColor.close="\x1B[49m",$.color.ansi=Ct(),$.color.ansi256=It(),$.color.ansi16m=St(),$.bgColor.ansi=Ct(10),$.bgColor.ansi256=It(10),$.bgColor.ansi16m=St(10),Object.defineProperties($,{rgbToAnsi256:{value(t,r,s){return t===r&&r===s?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(s/255*5)},enumerable:!1},hexToRgb:{value(t){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!r)return[0,0,0];let[s]=r;s.length===3&&(s=[...s].map(n=>n+n).join(""));let i=Number.parseInt(s,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:t=>$.rgbToAnsi256(...$.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,s,i;if(t>=232)r=((t-232)*10+8)/255,s=r,i=r;else{t-=16;let a=t%36;r=Math.floor(t/36)/5,s=Math.floor(a/6)/5,i=a%6/5}let n=Math.max(r,s,i)*2;if(n===0)return 30;let o=30+(Math.round(i)<<2|Math.round(s)<<1|Math.round(r));return n===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(t,r,s)=>$.ansi256ToAnsi($.rgbToAnsi256(t,r,s)),enumerable:!1},hexToAnsi:{value:t=>$.ansi256ToAnsi($.hexToAnsi256(t)),enumerable:!1}}),$}var Ar=Fr(),N=Ar;import Me from"node:process";import Or from"node:os";import Et from"node:tty";function A(e,t=globalThis.Deno?globalThis.Deno.args:Me.argv){let r=e.startsWith("-")?"":e.length===1?"-":"--",s=t.indexOf(r+e),i=t.indexOf("--");return s!==-1&&(i===-1||s<i)}var{env:w}=Me,ge;A("no-color")||A("no-colors")||A("color=false")||A("color=never")?ge=0:(A("color")||A("colors")||A("color=true")||A("color=always"))&&(ge=1);function Lr(){if("FORCE_COLOR"in w)return w.FORCE_COLOR==="true"?1:w.FORCE_COLOR==="false"?0:w.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(w.FORCE_COLOR,10),3)}function Nr(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function kr(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let s=Lr();s!==void 0&&(ge=s);let i=r?ge:s;if(i===0)return 0;if(r){if(A("color=16m")||A("color=full")||A("color=truecolor"))return 3;if(A("color=256"))return 2}if("TF_BUILD"in w&&"AGENT_NAME"in w)return 1;if(e&&!t&&i===void 0)return 0;let n=i||0;if(w.TERM==="dumb")return n;if(Me.platform==="win32"){let o=Or.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in w)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(o=>o in w)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(o=>o in w)||w.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in w)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(w.TEAMCITY_VERSION)?1:0;if(w.COLORTERM==="truecolor"||w.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in w){let o=Number.parseInt((w.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(w.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(w.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(w.TERM)||"COLORTERM"in w?1:n}function xt(e,t={}){let r=kr(e,{streamIsTTY:e&&e.isTTY,...t});return Nr(r)}var Pr={stdout:xt({isTTY:Et.isatty(1)}),stderr:xt({isTTY:Et.isatty(2)})},Rt=Pr;function Tt(e,t,r){let s=e.indexOf(t);if(s===-1)return e;let i=t.length,n=0,o="";do o+=e.slice(n,s)+t+r,n=s+i,s=e.indexOf(t,n);while(s!==-1);return o+=e.slice(n),o}function _t(e,t,r,s){let i=0,n="";do{let o=e[s-1]==="\r";n+=e.slice(i,o?s-1:s)+t+(o?`\r
45
45
  `:`
46
46
  `)+r,i=s+1,s=e.indexOf(`
47
47
  `,i)}while(s!==-1);return n+=e.slice(i),n}var{stdout:Mt,stderr:Ft}=Rt,Fe=Symbol("GENERATOR"),Z=Symbol("STYLER"),ne=Symbol("IS_EMPTY"),At=["ansi","ansi","ansi256","ansi16m"],X=Object.create(null),Br=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=Mt?Mt.level:0;e.level=t.level===void 0?r:t.level};var Ur=e=>{let t=(...r)=>r.join(" ");return Br(t,e),Object.setPrototypeOf(t,oe.prototype),t};function oe(e){return Ur(e)}Object.setPrototypeOf(oe.prototype,Function.prototype);for(let[e,t]of Object.entries(N))X[e]={get(){let r=fe(this,Oe(t.open,t.close,this[Z]),this[ne]);return Object.defineProperty(this,e,{value:r}),r}};X.visible={get(){let e=fe(this,this[Z],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var Ae=(e,t,r,...s)=>e==="rgb"?t==="ansi16m"?N[r].ansi16m(...s):t==="ansi256"?N[r].ansi256(N.rgbToAnsi256(...s)):N[r].ansi(N.rgbToAnsi(...s)):e==="hex"?Ae("rgb",t,r,...N.hexToRgb(...s)):N[r][e](...s),Dr=["rgb","hex","ansi256"];for(let e of Dr){X[e]={get(){let{level:r}=this;return function(...s){let i=Oe(Ae(e,At[r],"color",...s),N.color.close,this[Z]);return fe(this,i,this[ne])}}};let t="bg"+e[0].toUpperCase()+e.slice(1);X[t]={get(){let{level:r}=this;return function(...s){let i=Oe(Ae(e,At[r],"bgColor",...s),N.bgColor.close,this[Z]);return fe(this,i,this[ne])}}}}var Vr=Object.defineProperties(()=>{},{...X,level:{enumerable:!0,get(){return this[Fe].level},set(e){this[Fe].level=e}}}),Oe=(e,t,r)=>{let s,i;return r===void 0?(s=e,i=t):(s=r.openAll+e,i=t+r.closeAll),{open:e,close:t,openAll:s,closeAll:i,parent:r}},fe=(e,t,r)=>{let s=(...i)=>jr(s,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(s,Vr),s[Fe]=e,s[Z]=t,s[ne]=r,s},jr=(e,t)=>{if(e.level<=0||!t)return e[ne]?"":t;let r=e[Z];if(r===void 0)return t;let{openAll:s,closeAll:i}=r;if(t.includes("\x1B"))for(;r!==void 0;)t=Tt(t,r.close,r.open),r=r.parent;let n=t.indexOf(`
48
- `);return n!==-1&&(t=_t(t,i,s,n)),s+t+i};Object.defineProperties(oe.prototype,X);var Gr=oe(),Mi=oe({level:Ft?Ft.level:0});var J=Gr;var ee={primary:"#57d7c4",secondary:"#199288",muted:"#9ca3af",success:"#06D6A0",error:"#EF4444",warning:"#F59E0B"},C={primary:e=>J.hex(ee.primary)(e),secondary:e=>J.hex(ee.secondary)(e),muted:e=>J.hex(ee.muted)(e),success:e=>J.hex(ee.success)(e),error:e=>J.hex(ee.error)(e),warning:e=>J.hex(ee.warning)(e)};var Wr=async()=>{let e=await ct({message:C.secondary(l("useThisConfig"))});return L(e),e},Ot=Wr;import{writeFileSync as Jr}from"fs";import Qr from"os";import Zr from"path";var qr=async()=>{let e=await K({message:C.secondary(l("enterEndpoint")),placeholder:"",initialValue:"",required:!0,validate(t){if(!t?.trim())return l("urlRequired");try{let r=new URL(t);return r.protocol.startsWith("http")?r.hostname?void 0:l("urlMustHaveHost"):l("urlMustBeHttp")}catch{return l("urlInvalid")}}});return L(e),e},Lt=qr;var Hr=async()=>{let e=await K({message:C.secondary(l("enterApiKey")),placeholder:"",initialValue:"",required:!0,validate(t){if(!t?.trim())return l("apiKeyRequired")}});return L(e),e},Nt=Hr;var Kr=async()=>{let e=await K({message:C.secondary(l("enterRegistryName")),placeholder:"",initialValue:"",required:!0,validate(t){if(!t?.trim())return l("registryNameRequired");if(!/^[a-zA-Z]+$/.test(t))return l("registryNameLettersOnly")}});return L(e),e},Pt=Kr;var zr=async()=>{let e=await K({message:C.secondary(l("enterRegistryURL")),placeholder:"",initialValue:"",required:!0,validate(t){if(!t?.trim())return l("registryURLRequired");if(!/^[a-zA-Z0-9]/.test(t[0].trim()))return l("registryURLStartWithName");if(t.startsWith("http"))return l("registryURLNoProtocol");if(t.startsWith("/"))return l("registryURLNoSlash");if(t.startsWith("www"))return l("registryURLNoWWW")}});return L(e),e},kt=zr;var Yr=e=>!e||typeof e!="string"||e?.trim()?.length===0,ae=Yr;var Xr=async()=>{mt(C.primary(l("settingUpConfig")));let e=await Lt(),t=await Nt(),r=await Pt(),s=await kt();if(ae(e)||ae(t)||ae(r)||ae(s)){S.error(l("missingConfigValues")),process.exit(1);return}let i={endpoint:e,apikey:t,registryName:r,registryURL:s},n=`export default ${JSON.stringify(i,null,2)}`;try{let o=Zr.join(Qr.homedir(),"config.js");Jr(o,n),S.success(C.primary(l("configSaved")))}catch(o){S.error(`${l("errorWritingConfig")} ${o.message}`),process.exit(1)}return i},$e=Xr;import{writeFileSync as es}from"fs";import{execSync as ts}from"child_process";async function te({endpoint:e,apikey:t,registryName:r,registryURL:s}){let i=pt();try{i.start(l("installingDeps"));let o=await(await fetch(e,{method:"POST",headers:{apikey:t}})).text(),a=`registry=https://registry.npmjs.org/
48
+ `);return n!==-1&&(t=_t(t,i,s,n)),s+t+i};Object.defineProperties(oe.prototype,X);var Gr=oe(),Mi=oe({level:Ft?Ft.level:0});var J=Gr;var ee={primary:"#57d7c4",secondary:"#199288",muted:"#9ca3af",success:"#06D6A0",error:"#EF4444",warning:"#F59E0B"},C={primary:e=>J.hex(ee.primary)(e),secondary:e=>J.hex(ee.secondary)(e),muted:e=>J.hex(ee.muted)(e),success:e=>J.hex(ee.success)(e),error:e=>J.hex(ee.error)(e),warning:e=>J.hex(ee.warning)(e)};var Wr=async()=>{let e=await ct({message:C.secondary(l("useThisConfig"))});return L(e),e},Ot=Wr;import{writeFileSync as Jr}from"fs";import Qr from"os";import Zr from"path";var qr=async()=>{let e=await K({message:C.secondary(l("enterEndpoint")),placeholder:"",initialValue:"",required:!0,validate(t){if(!t?.trim())return l("urlRequired");try{let r=new URL(t);return r.protocol.startsWith("http")?r.hostname?void 0:l("urlMustHaveHost"):l("urlMustBeHttp")}catch{return l("urlInvalid")}}});return L(e),e},Lt=qr;var Hr=async()=>{let e=await K({message:C.secondary(l("enterApiKey")),placeholder:"",initialValue:"",required:!0,validate(t){if(!t?.trim())return l("apiKeyRequired")}});return L(e),e},Nt=Hr;var Kr=async()=>{let e=await K({message:C.secondary(l("enterRegistryName")),placeholder:"",initialValue:"",required:!0,validate(t){if(!t?.trim())return l("registryNameRequired");if(!/^[a-zA-Z]+$/.test(t))return l("registryNameLettersOnly")}});return L(e),e},kt=Kr;var zr=async()=>{let e=await K({message:C.secondary(l("enterRegistryURL")),placeholder:"",initialValue:"",required:!0,validate(t){if(!t?.trim())return l("registryURLRequired");if(!/^[a-zA-Z0-9]/.test(t[0].trim()))return l("registryURLStartWithName");if(t.startsWith("http"))return l("registryURLNoProtocol");if(t.startsWith("/"))return l("registryURLNoSlash");if(t.startsWith("www"))return l("registryURLNoWWW")}});return L(e),e},Pt=zr;var Yr=e=>!e||typeof e!="string"||e?.trim()?.length===0,ae=Yr;var Xr=async()=>{mt(C.primary(l("settingUpConfig")));let e=await Lt(),t=await Nt(),r=await kt(),s=await Pt();if(ae(e)||ae(t)||ae(r)||ae(s)){S.error(l("missingConfigValues")),process.exit(1);return}let i={endpoint:e,apikey:t,registryName:r,registryURL:s},n=`export default ${JSON.stringify(i,null,2)}`;try{let o=Zr.join(Qr.homedir(),"config.js");Jr(o,n),S.success(C.primary(l("configSaved")))}catch(o){S.error(`${l("errorWritingConfig")} ${o.message}`),process.exit(1)}return i},$e=Xr;import{writeFileSync as es}from"fs";import{execSync as ts}from"child_process";async function te({endpoint:e,apikey:t,registryName:r,registryURL:s}){let i=pt();try{i.start(l("installingDeps"));let o=await(await fetch(e,{method:"POST",headers:{apikey:t}})).text(),a=`registry=https://registry.npmjs.org/
49
49
  @${r}:registry=https://${s}/
50
50
  //${s}/:always-auth=true
51
51
  //${s}/:_authToken=${o}
package/dist/run.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- var W=Object.create;var I=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var q=Object.getPrototypeOf,H=Object.prototype.hasOwnProperty;var z=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var K=(e,t,r,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of j(t))!H.call(e,o)&&o!==r&&I(e,o,{get:()=>t[o],enumerable:!(c=G(t,o))||c.enumerable});return e};var S=(e,t,r)=>(r=e!=null?W(q(e)):{},K(t||!e||!e.__esModule?I(r,"default",{value:e,enumerable:!0}):r,e));var f=z((Ae,C)=>{"use strict";var p="\x1B",i=`${p}[`,ee="\x07",g={to(e,t){return t?`${i}${t+1};${e+1}H`:`${i}${e+1}G`},move(e,t){let r="";return e<0?r+=`${i}${-e}D`:e>0&&(r+=`${i}${e}C`),t<0?r+=`${i}${-t}A`:t>0&&(r+=`${i}${t}B`),r},up:(e=1)=>`${i}${e}A`,down:(e=1)=>`${i}${e}B`,forward:(e=1)=>`${i}${e}C`,backward:(e=1)=>`${i}${e}D`,nextLine:(e=1)=>`${i}E`.repeat(e),prevLine:(e=1)=>`${i}F`.repeat(e),left:`${i}G`,hide:`${i}?25l`,show:`${i}?25h`,save:`${p}7`,restore:`${p}8`},te={up:(e=1)=>`${i}S`.repeat(e),down:(e=1)=>`${i}T`.repeat(e)},se={screen:`${i}2J`,up:(e=1)=>`${i}1J`.repeat(e),down:(e=1)=>`${i}J`.repeat(e),line:`${i}2K`,lineEnd:`${i}K`,lineStart:`${i}1K`,lines(e){let t="";for(let r=0;r<e;r++)t+=this.line+(r<e-1?g.up():"");return e&&(t+=g.left),t}};C.exports={cursor:g,scroll:te,erase:se,beep:ee}});var Y="\x07",Q="[",X="]";var Z=`${X}8;;`,Me=new RegExp(`(?:\\${Q}(?<code>\\d+)m|\\${Z}(?<uri>.*)${Y})`,"y");var E=S(f(),1);var re=["up","down","left","right","space","enter","cancel"],ne=["January","February","March","April","May","June","July","August","September","October","November","December"],$={actions:new Set(re),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"},withGuide:!0,date:{monthNames:[...ne],messages:{required:"Please enter a valid date",invalidMonth:"There are only 12 months in a year",invalidDay:(e,t)=>`There are only ${e} days in ${t}`,afterMin:e=>`Date must be on or after ${e.toISOString().slice(0,10)}`,beforeMax:e=>`Date must be on or before ${e.toISOString().slice(0,10)}`}}};var Pe=globalThis.process.platform.startsWith("win"),De=Symbol("clack:cancel");import{styleText as u,stripVTControlCharacters as tt}from"node:util";import a from"node:process";var _=S(f(),1);function oe(){return a.platform!=="win32"?a.env.TERM!=="linux":!!a.env.CI||!!a.env.WT_SESSION||!!a.env.TERMINUS_SUBLIME||a.env.ConEmuTask==="{cmd::Cmder}"||a.env.TERM_PROGRAM==="Terminus-Sublime"||a.env.TERM_PROGRAM==="vscode"||a.env.TERM==="xterm-256color"||a.env.TERM==="alacritty"||a.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var ue=oe();var s=(e,t)=>ue?e:t,nt=s("\u25C6","*"),at=s("\u25A0","x"),ot=s("\u25B2","x"),ce=s("\u25C7","o"),ut=s("\u250C","T"),y=s("\u2502","|"),ct=s("\u2514","\u2014"),lt=s("\u2510","T"),ht=s("\u2518","\u2014"),dt=s("\u25CF",">"),mt=s("\u25CB"," "),pt=s("\u25FB","[\u2022]"),gt=s("\u25FC","[+]"),ft=s("\u25FB","[ ]"),$t=s("\u25AA","\u2022"),yt=s("\u2500","-"),vt=s("\u256E","+"),bt=s("\u251C","+"),wt=s("\u256F","+"),It=s("\u2570","+"),St=s("\u256D","+"),le=s("\u25CF","\u2022"),he=s("\u25C6","*"),de=s("\u25B2","!"),me=s("\u25A0","x");var n={message:(e=[],{symbol:t=u("gray",y),secondarySymbol:r=u("gray",y),output:c=process.stdout,spacing:o=1,withGuide:h}={})=>{let l=[],d=h??$.withGuide,V=d?r:"",N=d?`${t} `:"",U=d?`${r} `:"";for(let m=0;m<o;m++)l.push(V);let b=Array.isArray(e)?e:e.split(`
2
+ var G=Object.create;var I=Object.defineProperty;var W=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var q=Object.getPrototypeOf,H=Object.prototype.hasOwnProperty;var z=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var K=(e,t,r,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of j(t))!H.call(e,o)&&o!==r&&I(e,o,{get:()=>t[o],enumerable:!(c=W(t,o))||c.enumerable});return e};var S=(e,t,r)=>(r=e!=null?G(q(e)):{},K(t||!e||!e.__esModule?I(r,"default",{value:e,enumerable:!0}):r,e));var f=z((Ae,C)=>{"use strict";var p="\x1B",i=`${p}[`,ee="\x07",g={to(e,t){return t?`${i}${t+1};${e+1}H`:`${i}${e+1}G`},move(e,t){let r="";return e<0?r+=`${i}${-e}D`:e>0&&(r+=`${i}${e}C`),t<0?r+=`${i}${-t}A`:t>0&&(r+=`${i}${t}B`),r},up:(e=1)=>`${i}${e}A`,down:(e=1)=>`${i}${e}B`,forward:(e=1)=>`${i}${e}C`,backward:(e=1)=>`${i}${e}D`,nextLine:(e=1)=>`${i}E`.repeat(e),prevLine:(e=1)=>`${i}F`.repeat(e),left:`${i}G`,hide:`${i}?25l`,show:`${i}?25h`,save:`${p}7`,restore:`${p}8`},te={up:(e=1)=>`${i}S`.repeat(e),down:(e=1)=>`${i}T`.repeat(e)},se={screen:`${i}2J`,up:(e=1)=>`${i}1J`.repeat(e),down:(e=1)=>`${i}J`.repeat(e),line:`${i}2K`,lineEnd:`${i}K`,lineStart:`${i}1K`,lines(e){let t="";for(let r=0;r<e;r++)t+=this.line+(r<e-1?g.up():"");return e&&(t+=g.left),t}};C.exports={cursor:g,scroll:te,erase:se,beep:ee}});var Y="\x07",Q="[",X="]";var Z=`${X}8;;`,Me=new RegExp(`(?:\\${Q}(?<code>\\d+)m|\\${Z}(?<uri>.*)${Y})`,"y");var E=S(f(),1);var re=["up","down","left","right","space","enter","cancel"],ne=["January","February","March","April","May","June","July","August","September","October","November","December"],$={actions:new Set(re),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"},withGuide:!0,date:{monthNames:[...ne],messages:{required:"Please enter a valid date",invalidMonth:"There are only 12 months in a year",invalidDay:(e,t)=>`There are only ${e} days in ${t}`,afterMin:e=>`Date must be on or after ${e.toISOString().slice(0,10)}`,beforeMax:e=>`Date must be on or before ${e.toISOString().slice(0,10)}`}}};var Pe=globalThis.process.platform.startsWith("win"),De=Symbol("clack:cancel");import{styleText as u,stripVTControlCharacters as tt}from"node:util";import a from"node:process";var _=S(f(),1);function oe(){return a.platform!=="win32"?a.env.TERM!=="linux":!!a.env.CI||!!a.env.WT_SESSION||!!a.env.TERMINUS_SUBLIME||a.env.ConEmuTask==="{cmd::Cmder}"||a.env.TERM_PROGRAM==="Terminus-Sublime"||a.env.TERM_PROGRAM==="vscode"||a.env.TERM==="xterm-256color"||a.env.TERM==="alacritty"||a.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var ue=oe();var s=(e,t)=>ue?e:t,nt=s("\u25C6","*"),at=s("\u25A0","x"),ot=s("\u25B2","x"),ce=s("\u25C7","o"),ut=s("\u250C","T"),y=s("\u2502","|"),ct=s("\u2514","\u2014"),lt=s("\u2510","T"),ht=s("\u2518","\u2014"),dt=s("\u25CF",">"),mt=s("\u25CB"," "),pt=s("\u25FB","[\u2022]"),gt=s("\u25FC","[+]"),ft=s("\u25FB","[ ]"),$t=s("\u25AA","\u2022"),yt=s("\u2500","-"),vt=s("\u256E","+"),bt=s("\u251C","+"),wt=s("\u256F","+"),It=s("\u2570","+"),St=s("\u256D","+"),le=s("\u25CF","\u2022"),he=s("\u25C6","*"),de=s("\u25B2","!"),me=s("\u25A0","x");var n={message:(e=[],{symbol:t=u("gray",y),secondarySymbol:r=u("gray",y),output:c=process.stdout,spacing:o=1,withGuide:h}={})=>{let l=[],d=h??$.withGuide,V=d?r:"",N=d?`${t} `:"",U=d?`${r} `:"";for(let m=0;m<o;m++)l.push(V);let b=Array.isArray(e)?e:e.split(`
3
3
  `);if(b.length>0){let[m,...B]=b;m.length>0?l.push(`${N}${m}`):l.push(d?t:"");for(let w of B)w.length>0?l.push(`${U}${w}`):l.push(d?r:"")}c.write(`${l.join(`
4
4
  `)}
5
- `)},info:(e,t)=>{n.message(e,{...t,symbol:u("blue",le)})},success:(e,t)=>{n.message(e,{...t,symbol:u("green",he)})},step:(e,t)=>{n.message(e,{...t,symbol:u("green",ce)})},warn:(e,t)=>{n.message(e,{...t,symbol:u("yellow",de)})},warning:(e,t)=>{n.warn(e,t)},error:(e,t)=>{n.message(e,{...t,symbol:u("red",me)})}};var Ct={light:s("\u2500","-"),heavy:s("\u2501","="),block:s("\u2588","#")};var Et=`${u("gray",y)} `;import{execSync as x}from"child_process";async function R(){try{x("npm run dev",{stdio:"inherit"})}catch(e){n.error(`Error: ${e.message}`),process.exit(1)}}async function T(){try{x("rm -rf .next && npm run dev",{stdio:"inherit"})}catch(e){n.error(`Error: ${e.message}`),process.exit(1)}}import{existsSync as pe,readFileSync as ge,writeFileSync as Lt,mkdirSync as At}from"fs";import fe from"os";import L from"path";var $e=L.join(fe.homedir(),".eazy-git"),F=L.join($e,"config.json"),M={language:"es",defaultBaseBranch:"release",aiProvider:"claude"};function A(){try{if(pe(F)){let e=ge(F,"utf-8");return{...M,...JSON.parse(e)}}}catch{}return{...M}}var k={welcome:"Bienvenido a",subtitle:"tu CLI de confianza para gestionar ramas en GIT",operationCompleted:"Operacion completada!",operationCancelled:"Operacion cancelada. Saliendo...",unknownCommand:"Comando desconocido",errorExecuting:"Error al ejecutar el comando",version:"eazy-git version",whatToDo:"Que deseas hacer?",addChanges:"Agregar cambios a una rama",createOriginal:"Crear rama original",createTemporal:"Crear rama temporal",notGitRepo:"Este directorio no es un repositorio git",gitNotInstalled:"git no esta instalado en el sistema",currentBranch:"Branch actual",filesChanged:"Archivos con cambios",noChangesPending:"No hay cambios pendientes. Deseas continuar de todas formas?",updatingRefs:"Actualizando referencias remotas...",refsUpdated:"Referencias actualizadas",fetchFailed:"No se pudo hacer fetch (continuando...)",baseBranch:"Desde que branch base quieres crear la rama?",baseBranchRequired:"El branch base es requerido",ticketId:"Cual es el identificador del ticket? (ej: DPW-0000)",ticketRequired:"El ticket es requerido",changeType:"Que tipo de cambio es?",branchExistsLocal:e=>`La rama "${e}" ya existe localmente. Que deseas hacer?`,switchToIt:"Cambiarme a ella y continuar",cancel:"Cancelar",cancelledOp:"Operacion cancelada.",creatingBranch:(e,t)=>`Creando rama ${e} desde origin/${t}...`,branchCreated:e=>`Rama ${e} creada`,errorCreatingBranch:e=>`Error al crear la rama: ${e}`,noFilesToStage:"No hay archivos para stagear.",selectFiles:"Cuales archivos quieres incluir en el commit?",selectAllFiles:"Seleccionar todos los archivos",stagedFiles:"Archivos en stage",stagedCorrect:"Los archivos en stage son correctos?",aiProvider:"Con que IA quieres generar la sugerencia de commit?",generatingCommit:e=>`Generando sugerencia de commit con ${e}...`,aiSuggestionFailed:e=>`No se pudo obtener sugerencia de ${e}. Escribe el mensaje manualmente.`,writeCommitMsg:"Escribe el mensaje de commit:",commitMsgRequired:"El mensaje es requerido",suggestionOf:e=>`Sugerencia de ${e}`,useThisCommit:"Este mensaje de commit te parece bien?",yesUseIt:"Si, usar este",modify:"Modificar",commitSuccess:"Commit realizado correctamente",hookBlocked:"El pre-commit hook bloqueo el commit. Que deseas hacer?",retryHook:"Ya lo corregi, agrega los cambios y vuelve a intentarlo",skipHook:"Saltar el hook (--no-verify)",commitNoHooks:"Commit realizado (sin hooks)",pushToRemote:"Deseas subir la rama al repositorio remoto?",pushSuccess:"Push realizado",pushForceQuestion:"La rama ya existe en el remoto con historial diferente. Deseas forzar el push? (git push -f)",pushForceSuccess:"Push forzado realizado",pushForceError:e=>`Error en el push forzado: ${e}`,pushError:e=>`Error en el push: ${e}`,summaryTitle:"Resumen",summaryBranch:"Rama",summaryFrom:"Desde",summaryCommit:"Commit",summaryFiles:e=>`${e} archivos commiteados`,summaryPush:"Push",summaryPR:"Crear PR",statusModified:"modificado",statusAdded:"agregado",statusDeleted:"eliminado",statusRenamed:"renombrado",statusUntracked:"sin rastrear",commitTypes:{fix:"fix \u2014 correccion de bug",feat:"feat \u2014 nueva funcionalidad",refactor:"refactor \u2014 mejora sin cambio funcional",chore:"chore \u2014 mantenimiento, dependencias",docs:"docs \u2014 documentacion",test:"test \u2014 pruebas",ci:"ci \u2014 integracion continua",perf:"perf \u2014 rendimiento",style:"style \u2014 formato, sin cambio de logica"},selectBranchType:"Selecciona el tipo de rama:",branchFix:"Fix",branchImprovement:"Mejora",branchFeature:"Feature",branchRefactor:"Refactor",creatingOriginalBranch:"Creando rama original...",branchCreatedAndPushed:e=>`Rama "${e}" creada y pusheada correctamente!`,branchCreatedSuccess:e=>`Rama "${e}" creada correctamente!`,mergeBranchQuestion:"A que rama deseas hacer merge?",developDEV:"develop (DEV)",releaseUAT:"release (UAT)",temporalBranchCreated:"Rama temporal creada correctamente",temporalBranchMerged:"Rama temporal mergeada correctamente",conflictsDetected:"Conflictos detectados. Resolvelos manualmente!",branchPushedToRemote:"Rama pusheada al repositorio remoto",removeTemporalBranch:"Deseas eliminar la rama temporal?",temporalBranchDeleted:"Rama temporal eliminada correctamente",errorCreatingTemporal:"Error creando la rama temporal",enterJiraCode:"Ingresa el codigo del ticket JIRA:",jiraRequired:"El codigo JIRA es requerido!",jiraInvalidFormat:"El codigo JIRA debe tener el formato DPW-0000",fetchingRemote:"Obteniendo cambios remotos...",pullingChanges:"Aplicando cambios en tu rama...",pullError:e=>`Error: ${e}`,pushingChanges:"Subiendo cambios al remoto...",pushedSuccess:"Cambios subidos correctamente!",pushedForceSuccess:"Cambios subidos (forzado) correctamente!",pushQuickError:e=>`Error: ${e}`,provideCommitMsg:"Proporciona un mensaje de commit",stagingChanges:"Stageando cambios...",creatingCommit:"Creando commit...",commitCreated:"Commit creado correctamente!",commitError:e=>`Error: ${e}`,switchingPrevBranch:"Cambiando a la rama anterior...",switchedTo:e=>`Cambiado a rama ${e} correctamente!`,checkoutError:e=>`Error: ${e}`,fetchingLatest:"Obteniendo ultimos cambios...",mergingWith:e=>`Mergeando con ${e}...`,pushingMerged:"Subiendo cambios mergeados...",mergeCompleted:"Merge completado correctamente!",mergeError:e=>`Error: ${e}`,removingLastCommit:"Eliminando ultimo commit...",removeLastConfirm:"Esto eliminara el ultimo commit (los cambios se mantienen en staging). Continuar?",lastCommitRemoved:"Ultimo commit eliminado correctamente!",removeLastError:e=>`Error: ${e}`,logError:e=>`Error: ${e}`,settingUpConfig:"Configurando tu entorno",configSaved:"Configuracion guardada",missingConfigValues:"Faltan valores de configuracion requeridos.",errorWritingConfig:"Error escribiendo archivo de configuracion:",currentConfig:"Configuracion actual",useThisConfig:"Deseas usar esta configuracion?",installingDeps:"Instalando dependencias...",depsInstalled:"Todas las dependencias fueron instaladas",authFailed:"Autenticacion fallida",unexpectedError:"Ocurrio un error inesperado",enterEndpoint:"Ingresa la URL del endpoint:",urlRequired:"La URL es requerida!",urlMustBeHttp:"La URL debe usar protocolo HTTP/HTTPS",urlMustHaveHost:"La URL debe incluir un hostname",urlInvalid:"Ingresa una URL valida",enterApiKey:"Ingresa tu apikey:",apiKeyRequired:"El API key es requerido!",enterRegistryName:"Ingresa el nombre del registro NPM (sin caracteres especiales):",registryNameRequired:"El nombre del registro es requerido!",registryNameLettersOnly:"El nombre del registro debe contener solo letras",enterRegistryURL:"Ingresa la URL del registro NPM (sin http/https):",registryURLRequired:"La URL del registro es requerida!",registryURLStartWithName:"La URL debe empezar con un nombre, evita caracteres especiales",registryURLNoProtocol:"La URL no debe incluir protocolo 'http/https' y debe empezar con una letra",registryURLNoSlash:"La URL no debe empezar con '/' y debe empezar con una letra o numero",registryURLNoWWW:"La URL no debe empezar con 'www' y debe empezar con una letra o numero",languageSelect:"Selecciona el idioma de la interfaz:",languageChanged:e=>`Idioma cambiado a: ${e}`,configMenu:"Que deseas configurar?",configLanguage:"Idioma de la interfaz",configDefaultBranch:"Rama base por defecto",configAIProvider:"Proveedor de IA por defecto",configView:"Ver configuracion actual",defaultBranchSet:e=>`Rama base por defecto: ${e}`,aiProviderSet:e=>`Proveedor de IA por defecto: ${e}`};var P={welcome:"Welcome to",subtitle:"your trusted CLI for GIT branch management",operationCompleted:"Operation completed!",operationCancelled:"Operation cancelled. Exiting...",unknownCommand:"Unknown command",errorExecuting:"Error executing command",version:"eazy-git version",whatToDo:"What would you like to do?",addChanges:"Add Changes to Branch",createOriginal:"Create Original Branch",createTemporal:"Create Temporal Branch",notGitRepo:"This directory is not a git repository",gitNotInstalled:"git is not installed on the system",currentBranch:"Current branch",filesChanged:"Files with changes",noChangesPending:"No pending changes. Do you want to continue anyway?",updatingRefs:"Updating remote references...",refsUpdated:"References updated",fetchFailed:"Could not fetch (continuing...)",baseBranch:"From which base branch do you want to create the branch?",baseBranchRequired:"Base branch is required",ticketId:"What is the ticket identifier? (e.g.: DPW-0000)",ticketRequired:"Ticket is required",changeType:"What type of change is this?",branchExistsLocal:e=>`Branch "${e}" already exists locally. What would you like to do?`,switchToIt:"Switch to it and continue",cancel:"Cancel",cancelledOp:"Operation cancelled.",creatingBranch:(e,t)=>`Creating branch ${e} from origin/${t}...`,branchCreated:e=>`Branch ${e} created`,errorCreatingBranch:e=>`Error creating branch: ${e}`,noFilesToStage:"No files to stage.",selectFiles:"Which files do you want to include in the commit?",selectAllFiles:"Select all files",stagedFiles:"Staged files",stagedCorrect:"Are the staged files correct?",aiProvider:"Which AI do you want to use for the commit suggestion?",generatingCommit:e=>`Generating commit suggestion with ${e}...`,aiSuggestionFailed:e=>`Could not get suggestion from ${e}. Write the message manually.`,writeCommitMsg:"Write the commit message:",commitMsgRequired:"Message is required",suggestionOf:e=>`${e} suggestion`,useThisCommit:"Does this commit message look good?",yesUseIt:"Yes, use it",modify:"Modify",commitSuccess:"Commit created successfully",hookBlocked:"The pre-commit hook blocked the commit. What would you like to do?",retryHook:"I fixed it, re-stage and retry",skipHook:"Skip the hook (--no-verify)",commitNoHooks:"Commit created (without hooks)",pushToRemote:"Do you want to push the branch to the remote repository?",pushSuccess:"Push completed",pushForceQuestion:"The branch already exists on remote with different history. Force push? (git push -f)",pushForceSuccess:"Force push completed",pushForceError:e=>`Error in force push: ${e}`,pushError:e=>`Error in push: ${e}`,summaryTitle:"Summary",summaryBranch:"Branch",summaryFrom:"From",summaryCommit:"Commit",summaryFiles:e=>`${e} files committed`,summaryPush:"Push",summaryPR:"Create PR",statusModified:"modified",statusAdded:"added",statusDeleted:"deleted",statusRenamed:"renamed",statusUntracked:"untracked",commitTypes:{fix:"fix - bug fix",feat:"feat - new feature",refactor:"refactor - improvement without functional change",chore:"chore - maintenance, dependencies",docs:"docs - documentation",test:"test - testing",ci:"ci - continuous integration",perf:"perf - performance",style:"style - formatting, no logic change"},selectBranchType:"Select the branch type:",branchFix:"Fix",branchImprovement:"Improvement",branchFeature:"Feature",branchRefactor:"Refactor",creatingOriginalBranch:"Creating original branch...",branchCreatedAndPushed:e=>`Branch "${e}" created and pushed successfully!`,branchCreatedSuccess:e=>`Branch "${e}" created successfully!`,mergeBranchQuestion:"Which branch do you want to merge into?",developDEV:"develop (DEV)",releaseUAT:"release (UAT)",temporalBranchCreated:"Temporal branch created successfully",temporalBranchMerged:"Temporal branch merged successfully",conflictsDetected:"Conflicts detected. Please resolve them manually!",branchPushedToRemote:"Branch pushed to remote repository",removeTemporalBranch:"Do you want to remove the temporal branch?",temporalBranchDeleted:"Temporal branch deleted successfully",errorCreatingTemporal:"Error creating the temporal branch",enterJiraCode:"Enter the JIRA ticket code:",jiraRequired:"JIRA code is required!",jiraInvalidFormat:"JIRA code must have the format DPW-0000",fetchingRemote:"Fetching remote changes...",pullingChanges:"Pulling changes into your branch...",pullError:e=>`Error: ${e}`,pushingChanges:"Pushing changes to remote...",pushedSuccess:"Changes pushed successfully!",pushedForceSuccess:"Changes pushed (force) successfully!",pushQuickError:e=>`Error: ${e}`,provideCommitMsg:"Please provide a commit message",stagingChanges:"Staging changes...",creatingCommit:"Creating commit...",commitCreated:"Commit created successfully!",commitError:e=>`Error: ${e}`,switchingPrevBranch:"Switching to previous branch...",switchedTo:e=>`Successfully switched to ${e} branch!`,checkoutError:e=>`Error: ${e}`,fetchingLatest:"Fetching latest changes...",mergingWith:e=>`Merging with ${e}...`,pushingMerged:"Pushing merged changes...",mergeCompleted:"Merge completed successfully!",mergeError:e=>`Error: ${e}`,removingLastCommit:"Removing last commit...",removeLastConfirm:"This will remove the last commit (changes will remain in staging). Continue?",lastCommitRemoved:"Last commit removed successfully!",removeLastError:e=>`Error: ${e}`,logError:e=>`Error: ${e}`,settingUpConfig:"Setting up your configuration",configSaved:"Configuration saved",missingConfigValues:"Missing required configuration values.",errorWritingConfig:"Error writing configuration file:",currentConfig:"Current configuration",useThisConfig:"Would you like to use this configuration?",installingDeps:"Installing dependencies...",depsInstalled:"All dependencies were installed",authFailed:"Authentication failed",unexpectedError:"An unexpected error occurred",enterEndpoint:"Enter your endpoint URL:",urlRequired:"URL is required!",urlMustBeHttp:"URL must use HTTP/HTTPS protocol",urlMustHaveHost:"URL must include a hostname",urlInvalid:"Please enter a valid URL",enterApiKey:"Enter your apikey:",apiKeyRequired:"API key is required!",enterRegistryName:"Enter your NPM registry name (without special characters):",registryNameRequired:"Registry name is required!",registryNameLettersOnly:"Registry name must contain only letters",enterRegistryURL:"Enter your NPM registry URL (without http/https):",registryURLRequired:"Registry URL is required!",registryURLStartWithName:"URL must start with a name only, avoid special characters",registryURLNoProtocol:"URL must not include 'http/https' protocol and must start with a letter",registryURLNoSlash:"URL must not start with '/' and must begin with a letter or number",registryURLNoWWW:"URL must not start with 'www' and must begin with a letter or number",languageSelect:"Select the interface language:",languageChanged:e=>`Language changed to: ${e}`,configMenu:"What would you like to configure?",configLanguage:"Interface language",configDefaultBranch:"Default base branch",configAIProvider:"Default AI provider",configView:"View current configuration",defaultBranchSet:e=>`Default base branch: ${e}`,aiProviderSet:e=>`Default AI provider: ${e}`};var D={es:k,en:P};function v(e,...t){let c=A().language||"es",h=(D[c]||D.es)[e];return typeof h=="function"?h(...t):h||e}var O=process.argv[1].split("/").pop(),ye={run:R,runrun:T};async function ve(){try{let e=ye[O];e||(n.error(`${v("unknownCommand")}: ${O}`),process.exit(1)),await e(),process.exit(0)}catch(e){n.error(`${v("errorExecuting")}: ${e.message}`),process.exit(1)}}ve();
5
+ `)},info:(e,t)=>{n.message(e,{...t,symbol:u("blue",le)})},success:(e,t)=>{n.message(e,{...t,symbol:u("green",he)})},step:(e,t)=>{n.message(e,{...t,symbol:u("green",ce)})},warn:(e,t)=>{n.message(e,{...t,symbol:u("yellow",de)})},warning:(e,t)=>{n.warn(e,t)},error:(e,t)=>{n.message(e,{...t,symbol:u("red",me)})}};var Ct={light:s("\u2500","-"),heavy:s("\u2501","="),block:s("\u2588","#")};var Et=`${u("gray",y)} `;import{execSync as x}from"child_process";async function R(){try{x("npm run dev",{stdio:"inherit"})}catch(e){n.error(`Error: ${e.message}`),process.exit(1)}}async function T(){try{x("rm -rf .next && npm run dev",{stdio:"inherit"})}catch(e){n.error(`Error: ${e.message}`),process.exit(1)}}import{existsSync as pe,readFileSync as ge,writeFileSync as Lt,mkdirSync as At}from"fs";import fe from"os";import L from"path";var $e=L.join(fe.homedir(),".eazy-git"),F=L.join($e,"config.json"),M={language:"es",defaultBaseBranch:"release",aiProvider:"claude"};function A(){try{if(pe(F)){let e=ge(F,"utf-8");return{...M,...JSON.parse(e)}}}catch{}return{...M}}var k={welcome:"Bienvenido a",subtitle:"tu CLI de confianza para gestionar ramas en GIT",operationCompleted:"Operacion completada!",operationCancelled:"Operacion cancelada. Saliendo...",unknownCommand:"Comando desconocido",errorExecuting:"Error al ejecutar el comando",version:"eazy-git version",whatToDo:"Que deseas hacer?",addChanges:"Agregar cambios a una rama",createOriginal:"Crear rama original",createTemporal:"Crear rama temporal",notGitRepo:"Este directorio no es un repositorio git",gitNotInstalled:"git no esta instalado en el sistema",currentBranch:"Branch actual",filesChanged:"Archivos con cambios",noChangesPending:"No hay cambios pendientes. Deseas continuar de todas formas?",updatingRefs:"Actualizando referencias remotas...",refsUpdated:"Referencias actualizadas",fetchFailed:"No se pudo hacer fetch (continuando...)",baseBranch:"Desde que branch base quieres crear la rama?",baseBranchRequired:"El branch base es requerido",ticketId:"Cual es el identificador del ticket? (ej: DPW-0000)",ticketRequired:"El ticket es requerido",changeType:"Que tipo de cambio es?",branchExistsLocal:e=>`La rama "${e}" ya existe localmente. Que deseas hacer?`,switchToIt:"Cambiarme a ella y continuar",cancel:"Cancelar",cancelledOp:"Operacion cancelada.",creatingBranch:(e,t)=>`Creando rama ${e} desde origin/${t}...`,branchCreated:e=>`Rama ${e} creada`,errorCreatingBranch:e=>`Error al crear la rama: ${e}`,noFilesToStage:"No hay archivos para stagear.",selectFiles:"Cuales archivos quieres incluir en el commit?",selectAllFiles:"Seleccionar todos los archivos",stagedFiles:"Archivos en stage",stagedCorrect:"Los archivos en stage son correctos?",aiProvider:"Con que IA quieres generar la sugerencia de commit?",generatingCommit:e=>`Generando sugerencia de commit con ${e}...`,aiSuggestionFailed:e=>`No se pudo obtener sugerencia de ${e}. Escribe el mensaje manualmente.`,writeCommitMsg:"Escribe el mensaje de commit:",commitMsgRequired:"El mensaje es requerido",suggestionOf:e=>`Sugerencia de ${e}`,useThisCommit:"Este mensaje de commit te parece bien?",yesUseIt:"Si, usar este",modify:"Modificar",commitSuccess:"Commit realizado correctamente",hookBlocked:"El pre-commit hook bloqueo el commit. Que deseas hacer?",retryHook:"Ya lo corregi, agrega los cambios y vuelve a intentarlo",skipHook:"Saltar el hook (--no-verify)",commitNoHooks:"Commit realizado (sin hooks)",pushToRemote:"Deseas subir la rama al repositorio remoto?",pushSuccess:"Push realizado",pushForceQuestion:"La rama ya existe en el remoto con historial diferente. Deseas forzar el push? (git push -f)",pushForceSuccess:"Push forzado realizado",pushForceError:e=>`Error en el push forzado: ${e}`,pushError:e=>`Error en el push: ${e}`,summaryTitle:"Resumen",summaryBranch:"Rama",summaryFrom:"Desde",summaryCommit:"Commit",summaryFiles:e=>`${e} archivos commiteados`,summaryPush:"Push",summaryPR:"Crear PR",statusModified:"modificado",statusAdded:"agregado",statusDeleted:"eliminado",statusRenamed:"renombrado",statusUntracked:"sin rastrear",commitTypes:{fix:"fix \u2014 correccion de bug",feat:"feat \u2014 nueva funcionalidad",refactor:"refactor \u2014 mejora sin cambio funcional",chore:"chore \u2014 mantenimiento, dependencias",docs:"docs \u2014 documentacion",test:"test \u2014 pruebas",ci:"ci \u2014 integracion continua",perf:"perf \u2014 rendimiento",style:"style \u2014 formato, sin cambio de logica"},selectBranchType:"Selecciona el tipo de rama:",branchFix:"Fix",branchImprovement:"Mejora",branchFeature:"Feature",branchRefactor:"Refactor",creatingOriginalBranch:"Creando rama original...",branchCreatedAndPushed:e=>`Rama "${e}" creada y pusheada correctamente!`,branchCreatedSuccess:e=>`Rama "${e}" creada correctamente!`,mergeBranchQuestion:"A que rama deseas hacer merge?",developDEV:"develop (DEV)",releaseUAT:"release (UAT)",temporalBranchCreated:"Rama temporal creada correctamente",temporalBranchMerged:"Rama temporal mergeada correctamente",conflictsDetected:"Conflictos detectados. Resolvelos manualmente!",branchPushedToRemote:"Rama pusheada al repositorio remoto",removeTemporalBranch:"Deseas eliminar la rama temporal?",temporalBranchDeleted:"Rama temporal eliminada correctamente",errorCreatingTemporal:"Error creando la rama temporal",enterJiraCode:"Ingresa el codigo del ticket JIRA:",jiraRequired:"El codigo JIRA es requerido!",jiraInvalidFormat:"El codigo JIRA debe tener el formato DPW-0000",fetchingRemote:"Obteniendo cambios remotos...",pullingChanges:"Aplicando cambios en tu rama...",pullError:e=>`Error: ${e}`,pushingChanges:"Subiendo cambios al remoto...",pushedSuccess:"Cambios subidos correctamente!",pushedForceSuccess:"Cambios subidos (forzado) correctamente!",pushQuickError:e=>`Error: ${e}`,provideCommitMsg:"Proporciona un mensaje de commit",stagingChanges:"Stageando cambios...",creatingCommit:"Creando commit...",commitCreated:"Commit creado correctamente!",commitError:e=>`Error: ${e}`,switchingPrevBranch:"Cambiando a la rama anterior...",switchedTo:e=>`Cambiado a rama ${e} correctamente!`,checkoutError:e=>`Error: ${e}`,fetchingLatest:"Obteniendo ultimos cambios...",mergingWith:e=>`Mergeando con ${e}...`,pushingMerged:"Subiendo cambios mergeados...",mergeCompleted:"Merge completado correctamente!",mergeError:e=>`Error: ${e}`,removingLastCommit:"Eliminando ultimo commit...",removeLastConfirm:"Esto eliminara el ultimo commit (los cambios se mantienen en staging). Continuar?",lastCommitRemoved:"Ultimo commit eliminado correctamente!",removeLastError:e=>`Error: ${e}`,logError:e=>`Error: ${e}`,settingUpConfig:"Configurando tu entorno",configSaved:"Configuracion guardada",missingConfigValues:"Faltan valores de configuracion requeridos.",errorWritingConfig:"Error escribiendo archivo de configuracion:",currentConfig:"Configuracion actual",useThisConfig:"Deseas usar esta configuracion?",installingDeps:"Instalando dependencias...",depsInstalled:"Todas las dependencias fueron instaladas",authFailed:"Autenticacion fallida",unexpectedError:"Ocurrio un error inesperado",enterEndpoint:"Ingresa la URL del endpoint:",urlRequired:"La URL es requerida!",urlMustBeHttp:"La URL debe usar protocolo HTTP/HTTPS",urlMustHaveHost:"La URL debe incluir un hostname",urlInvalid:"Ingresa una URL valida",enterApiKey:"Ingresa tu apikey:",apiKeyRequired:"El API key es requerido!",enterRegistryName:"Ingresa el nombre del registro NPM (sin caracteres especiales):",registryNameRequired:"El nombre del registro es requerido!",registryNameLettersOnly:"El nombre del registro debe contener solo letras",enterRegistryURL:"Ingresa la URL del registro NPM (sin http/https):",registryURLRequired:"La URL del registro es requerida!",registryURLStartWithName:"La URL debe empezar con un nombre, evita caracteres especiales",registryURLNoProtocol:"La URL no debe incluir protocolo 'http/https' y debe empezar con una letra",registryURLNoSlash:"La URL no debe empezar con '/' y debe empezar con una letra o numero",registryURLNoWWW:"La URL no debe empezar con 'www' y debe empezar con una letra o numero",languageSelect:"Selecciona el idioma de la interfaz:",languageChanged:e=>`Idioma cambiado a: ${e}`,configMenu:"Que deseas configurar?",configLanguage:"Cambiar idioma",configDefaultBranch:"Rama base por defecto",configAIProvider:"Proveedor de IA por defecto",configView:"Ver configuracion actual",defaultBranchSet:e=>`Rama base por defecto: ${e}`,aiProviderSet:e=>`Proveedor de IA por defecto: ${e}`,goBack:"Volver"};var P={welcome:"Welcome to",subtitle:"your trusted CLI for GIT branch management",operationCompleted:"Operation completed!",operationCancelled:"Operation cancelled. Exiting...",unknownCommand:"Unknown command",errorExecuting:"Error executing command",version:"eazy-git version",whatToDo:"What would you like to do?",addChanges:"Add Changes to Branch",createOriginal:"Create Original Branch",createTemporal:"Create Temporal Branch",notGitRepo:"This directory is not a git repository",gitNotInstalled:"git is not installed on the system",currentBranch:"Current branch",filesChanged:"Files with changes",noChangesPending:"No pending changes. Do you want to continue anyway?",updatingRefs:"Updating remote references...",refsUpdated:"References updated",fetchFailed:"Could not fetch (continuing...)",baseBranch:"From which base branch do you want to create the branch?",baseBranchRequired:"Base branch is required",ticketId:"What is the ticket identifier? (e.g.: DPW-0000)",ticketRequired:"Ticket is required",changeType:"What type of change is this?",branchExistsLocal:e=>`Branch "${e}" already exists locally. What would you like to do?`,switchToIt:"Switch to it and continue",cancel:"Cancel",cancelledOp:"Operation cancelled.",creatingBranch:(e,t)=>`Creating branch ${e} from origin/${t}...`,branchCreated:e=>`Branch ${e} created`,errorCreatingBranch:e=>`Error creating branch: ${e}`,noFilesToStage:"No files to stage.",selectFiles:"Which files do you want to include in the commit?",selectAllFiles:"Select all files",stagedFiles:"Staged files",stagedCorrect:"Are the staged files correct?",aiProvider:"Which AI do you want to use for the commit suggestion?",generatingCommit:e=>`Generating commit suggestion with ${e}...`,aiSuggestionFailed:e=>`Could not get suggestion from ${e}. Write the message manually.`,writeCommitMsg:"Write the commit message:",commitMsgRequired:"Message is required",suggestionOf:e=>`${e} suggestion`,useThisCommit:"Does this commit message look good?",yesUseIt:"Yes, use it",modify:"Modify",commitSuccess:"Commit created successfully",hookBlocked:"The pre-commit hook blocked the commit. What would you like to do?",retryHook:"I fixed it, re-stage and retry",skipHook:"Skip the hook (--no-verify)",commitNoHooks:"Commit created (without hooks)",pushToRemote:"Do you want to push the branch to the remote repository?",pushSuccess:"Push completed",pushForceQuestion:"The branch already exists on remote with different history. Force push? (git push -f)",pushForceSuccess:"Force push completed",pushForceError:e=>`Error in force push: ${e}`,pushError:e=>`Error in push: ${e}`,summaryTitle:"Summary",summaryBranch:"Branch",summaryFrom:"From",summaryCommit:"Commit",summaryFiles:e=>`${e} files committed`,summaryPush:"Push",summaryPR:"Create PR",statusModified:"modified",statusAdded:"added",statusDeleted:"deleted",statusRenamed:"renamed",statusUntracked:"untracked",commitTypes:{fix:"fix - bug fix",feat:"feat - new feature",refactor:"refactor - improvement without functional change",chore:"chore - maintenance, dependencies",docs:"docs - documentation",test:"test - testing",ci:"ci - continuous integration",perf:"perf - performance",style:"style - formatting, no logic change"},selectBranchType:"Select the branch type:",branchFix:"Fix",branchImprovement:"Improvement",branchFeature:"Feature",branchRefactor:"Refactor",creatingOriginalBranch:"Creating original branch...",branchCreatedAndPushed:e=>`Branch "${e}" created and pushed successfully!`,branchCreatedSuccess:e=>`Branch "${e}" created successfully!`,mergeBranchQuestion:"Which branch do you want to merge into?",developDEV:"develop (DEV)",releaseUAT:"release (UAT)",temporalBranchCreated:"Temporal branch created successfully",temporalBranchMerged:"Temporal branch merged successfully",conflictsDetected:"Conflicts detected. Please resolve them manually!",branchPushedToRemote:"Branch pushed to remote repository",removeTemporalBranch:"Do you want to remove the temporal branch?",temporalBranchDeleted:"Temporal branch deleted successfully",errorCreatingTemporal:"Error creating the temporal branch",enterJiraCode:"Enter the JIRA ticket code:",jiraRequired:"JIRA code is required!",jiraInvalidFormat:"JIRA code must have the format DPW-0000",fetchingRemote:"Fetching remote changes...",pullingChanges:"Pulling changes into your branch...",pullError:e=>`Error: ${e}`,pushingChanges:"Pushing changes to remote...",pushedSuccess:"Changes pushed successfully!",pushedForceSuccess:"Changes pushed (force) successfully!",pushQuickError:e=>`Error: ${e}`,provideCommitMsg:"Please provide a commit message",stagingChanges:"Staging changes...",creatingCommit:"Creating commit...",commitCreated:"Commit created successfully!",commitError:e=>`Error: ${e}`,switchingPrevBranch:"Switching to previous branch...",switchedTo:e=>`Successfully switched to ${e} branch!`,checkoutError:e=>`Error: ${e}`,fetchingLatest:"Fetching latest changes...",mergingWith:e=>`Merging with ${e}...`,pushingMerged:"Pushing merged changes...",mergeCompleted:"Merge completed successfully!",mergeError:e=>`Error: ${e}`,removingLastCommit:"Removing last commit...",removeLastConfirm:"This will remove the last commit (changes will remain in staging). Continue?",lastCommitRemoved:"Last commit removed successfully!",removeLastError:e=>`Error: ${e}`,logError:e=>`Error: ${e}`,settingUpConfig:"Setting up your configuration",configSaved:"Configuration saved",missingConfigValues:"Missing required configuration values.",errorWritingConfig:"Error writing configuration file:",currentConfig:"Current configuration",useThisConfig:"Would you like to use this configuration?",installingDeps:"Installing dependencies...",depsInstalled:"All dependencies were installed",authFailed:"Authentication failed",unexpectedError:"An unexpected error occurred",enterEndpoint:"Enter your endpoint URL:",urlRequired:"URL is required!",urlMustBeHttp:"URL must use HTTP/HTTPS protocol",urlMustHaveHost:"URL must include a hostname",urlInvalid:"Please enter a valid URL",enterApiKey:"Enter your apikey:",apiKeyRequired:"API key is required!",enterRegistryName:"Enter your NPM registry name (without special characters):",registryNameRequired:"Registry name is required!",registryNameLettersOnly:"Registry name must contain only letters",enterRegistryURL:"Enter your NPM registry URL (without http/https):",registryURLRequired:"Registry URL is required!",registryURLStartWithName:"URL must start with a name only, avoid special characters",registryURLNoProtocol:"URL must not include 'http/https' protocol and must start with a letter",registryURLNoSlash:"URL must not start with '/' and must begin with a letter or number",registryURLNoWWW:"URL must not start with 'www' and must begin with a letter or number",languageSelect:"Select the interface language:",languageChanged:e=>`Language changed to: ${e}`,configMenu:"What would you like to configure?",configLanguage:"Change language",configDefaultBranch:"Default base branch",configAIProvider:"Default AI provider",configView:"View current configuration",defaultBranchSet:e=>`Default base branch: ${e}`,aiProviderSet:e=>`Default AI provider: ${e}`,goBack:"Go back"};var D={es:k,en:P};function v(e,...t){let c=A().language||"es",h=(D[c]||D.es)[e];return typeof h=="function"?h(...t):h||e}var O=process.argv[1].split("/").pop(),ye={run:R,runrun:T};async function ve(){try{let e=ye[O];e||(n.error(`${v("unknownCommand")}: ${O}`),process.exit(1)),await e(),process.exit(0)}catch(e){n.error(`${v("errorExecuting")}: ${e.message}`),process.exit(1)}}ve();
package/package.json CHANGED
@@ -1,8 +1,16 @@
1
1
  {
2
2
  "name": "eazy-git",
3
- "version": "0.2.9",
3
+ "version": "0.2.11",
4
4
  "main": "dist/index.js",
5
5
  "type": "module",
6
+ "imports": {
7
+ "#config/*": "./src/config/*",
8
+ "#i18n/*": "./src/i18n/*",
9
+ "#ui/*": "./src/ui/*",
10
+ "#utils/*": "./src/utils/*",
11
+ "#actions/*": "./src/actions/*",
12
+ "#getters/*": "./src/getters/*"
13
+ },
6
14
  "author": "Jaime Torres",
7
15
  "license": "MIT",
8
16
  "description": "CLI tool that simplifies branch management in Git. It automates common workflows and maintains a consistent branch structure.",