{"version":3,"sources":["../../../../tools/warp_grep/utils/github.ts"],"sourcesContent":["/**\n * GitHub URL parsing utilities\n */\n\n/**\n * Parse GitHub URL or \"owner/repo\" shorthand into owner and repo components.\n * Handles: \"owner/repo\", \"https://github.com/owner/repo\", \"github.com/owner/repo.git\"\n */\nexport function parseGitHubUrl(input: string): { owner: string; repo: string } {\n  input = input.trim();\n\n  // Try URL patterns first\n  const urlPattern = /^(?:https?:\\/\\/)?github\\.com\\/([^\\/]+)\\/([^\\/\\?\\#]+)/;\n  const match = input.match(urlPattern);\n  if (match) {\n    return { owner: match[1], repo: match[2].replace(/\\.git$/, '') };\n  }\n\n  // Try \"owner/repo\" shorthand (reject if owner contains '.', e.g. \"github.com/owner\")\n  const shortPattern = /^([^\\/]+)\\/([^\\/]+)$/;\n  const shortMatch = input.match(shortPattern);\n  if (shortMatch && !shortMatch[1].includes('.')) {\n    return { owner: shortMatch[1], repo: shortMatch[2].replace(/\\.git$/, '') };\n  }\n\n  throw new Error(\n    `Invalid GitHub URL or shorthand: \"${input}\". Expected \"owner/repo\" or \"https://github.com/owner/repo\"`\n  );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQO,SAAS,eAAe,OAAgD;AAC7E,UAAQ,MAAM,KAAK;AAGnB,QAAM,aAAa;AACnB,QAAM,QAAQ,MAAM,MAAM,UAAU;AACpC,MAAI,OAAO;AACT,WAAO,EAAE,OAAO,MAAM,CAAC,GAAG,MAAM,MAAM,CAAC,EAAE,QAAQ,UAAU,EAAE,EAAE;AAAA,EACjE;AAGA,QAAM,eAAe;AACrB,QAAM,aAAa,MAAM,MAAM,YAAY;AAC3C,MAAI,cAAc,CAAC,WAAW,CAAC,EAAE,SAAS,GAAG,GAAG;AAC9C,WAAO,EAAE,OAAO,WAAW,CAAC,GAAG,MAAM,WAAW,CAAC,EAAE,QAAQ,UAAU,EAAE,EAAE;AAAA,EAC3E;AAEA,QAAM,IAAI;AAAA,IACR,qCAAqC,KAAK;AAAA,EAC5C;AACF;","names":[]}