import{l6 as Z,p6 as _,q6 as w}from"./cli-0.5.12-ecgx5n54.mjs";import{$6 as Y,Jaa as W,L7 as T,Maa as V,R8 as D,a7 as U,eba as j,l7 as $,v8 as k}from"./cli-0.5.12-g4wb8mj2.mjs";import{fga as N,iga as M}from"./cli-0.5.12-p5ps8gf0.mjs";import{Gia as X,rma as O}from"./cli-0.5.12-c8f4daey.mjs";O();j();M();w();D();U();T();import{realpath as v}from"fs/promises";async function b(){try{let q=await Z();if(!q){N("Not in a GitHub repository, skipping path mapping update");return}let A=X(),z=$(A)??A,B;try{B=(await v(z)).normalize("NFC")}catch{B=z}let J=q.toLowerCase(),L=V().githubRepoPaths?.[J]??[];if(L[0]===B){N(`Path ${B} already tracked for repo ${J}`);return}let E=L.filter((S)=>S!==B),H=[B,...E];W((S)=>({...S,githubRepoPaths:{...S.githubRepoPaths,[J]:H}})),N(`Added ${B} to tracked paths for repo ${J}`)}catch(q){N(`Error updating repo path mapping: ${q}`)}}function y(q){let A=V(),I=q.toLowerCase();return A.githubRepoPaths?.[I]??[]}async function P(q){let A=await Promise.all(q.map(k));return q.filter((I,z)=>A[z])}async function d(q,A){try{let I=await Y(q);if(!I)return!1;let z=_(I);if(!z)return!1;return z.toLowerCase()===A.toLowerCase()}catch{return!1}}function c(q,A){let I=V(),z=q.toLowerCase(),B=I.githubRepoPaths?.[z]??[],J=B.filter((L)=>L!==A);if(J.length===B.length)return;let Q={...I.githubRepoPaths};if(J.length===0)delete Q[z];else Q[z]=J;W((L)=>({...L,githubRepoPaths:Q})),N(`Removed ${A} from tracked paths for repo ${z}`)}
export{b as Bb,y as Cb,P as Db,d as Eb,c as Fb};
