@open-mercato/cezar 0.9.1-pr669.755 → 0.9.1-pr669.765
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/skills.d.ts +2 -0
- package/dist/skills.js +2 -1
- package/dist/skills.js.map +1 -1
- package/package.json +1 -1
- package/web/dist/assets/{compare-variants-BbzWDz6V.js → compare-variants-DFmk8ywc.js} +1 -1
- package/web/dist/assets/{diff-CYDGlOeN.js → diff-Cru108Ob.js} +2 -2
- package/web/dist/assets/{diff-view-BNIrpcFK.js → diff-view-BxgOxwEX.js} +1 -1
- package/web/dist/assets/{git-toolbar-6qI1cvJ3.js → git-toolbar-BZ1nFOSn.js} +1 -1
- package/web/dist/assets/{github-BVk_Q3kK.js → github-Du7pz4J2.js} +1 -1
- package/web/dist/assets/index-B4FnnuuW.js +30 -0
- package/web/dist/assets/index-Lz_3un5h.css +2 -0
- package/web/dist/assets/{repo-git-BBYx9GU2.js → repo-git-CNavkyoo.js} +1 -1
- package/web/dist/assets/{run-diff-CEIzgLNs.js → run-diff-BiSarcbn.js} +1 -1
- package/web/dist/assets/{run-header-Bfo1QVI-.js → run-header-D6xzGJKA.js} +1 -1
- package/web/dist/assets/{skills-Dfx2h_9P.js → skills-CdOeKVl2.js} +1 -1
- package/web/dist/assets/{task-changes-CvzMzFZG.js → task-changes-CslPVfgB.js} +1 -1
- package/web/dist/assets/{task-commits-CF2eZbWj.js → task-commits-C2x9rub7.js} +1 -1
- package/web/dist/assets/{task-files-BuHe5s0G.js → task-files-7MynyZiE.js} +1 -1
- package/web/dist/assets/{task-thread-yeHDcFkT.js → task-thread-CYCrBbsQ.js} +1 -1
- package/web/dist/assets/{use-desktop-Ci80dn2i.js → use-desktop-VJlEigWx.js} +1 -1
- package/web/dist/assets/{workflows-BIm1UVwL.js → workflows-BAV3iIVz.js} +1 -1
- package/web/dist/index.html +2 -2
- package/web/dist/assets/index-DZ8L77uG.css +0 -2
- package/web/dist/assets/index-DqzfHNfi.js +0 -30
package/dist/skills.d.ts
CHANGED
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
export interface Skill {
|
|
10
10
|
name: string;
|
|
11
11
|
description?: string;
|
|
12
|
+
/** Advisory composer hint: untouched run-mode choices default to interactive, in-place execution. */
|
|
13
|
+
interactive?: true;
|
|
12
14
|
body: string;
|
|
13
15
|
path: string;
|
|
14
16
|
source: 'ai' | 'cezar' | 'agents' | 'global' | 'team';
|
package/dist/skills.js
CHANGED
|
@@ -178,7 +178,8 @@ async function readMarkdownSkills(dir, source) {
|
|
|
178
178
|
const description = typeof frontmatter.description === 'string' && frontmatter.description.trim()
|
|
179
179
|
? frontmatter.description.trim()
|
|
180
180
|
: undefined;
|
|
181
|
-
|
|
181
|
+
const interactive = frontmatter.interactive === 'true' ? true : undefined;
|
|
182
|
+
skills.push({ name, description, interactive, body, path: absPath, source });
|
|
182
183
|
}
|
|
183
184
|
return skills;
|
|
184
185
|
}
|
package/dist/skills.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skills.js","sourceRoot":"","sources":["../src/skills.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"skills.js","sourceRoot":"","sources":["../src/skills.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE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6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-mercato/cezar",
|
|
3
|
-
"version": "0.9.1-pr669.
|
|
3
|
+
"version": "0.9.1-pr669.765",
|
|
4
4
|
"description": "Local cockpit for running and tracking AI agent tasks in your repo. Uses your logged-in `claude` CLI and `gh` — zero config, zero database.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,s as t,u as n}from"./bundle-mjs-BegPhL5c.js";import{$t as r,A as i,An as a,B as o,Nn as s,On as c,Tt as l,a as u,i as d,k as f,pt as p,t as m}from"./centered-state-DC3UgTEo.js";import{t as h}from"./utils-B8xGEgP3.js";import{t as g}from"./search-x-CbHLclyX.js";import{i as _,n as v,r as y,t as b}from"./run-diff-
|
|
1
|
+
import{a as e,s as t,u as n}from"./bundle-mjs-BegPhL5c.js";import{$t as r,A as i,An as a,B as o,Nn as s,On as c,Tt as l,a as u,i as d,k as f,pt as p,t as m}from"./centered-state-DC3UgTEo.js";import{t as h}from"./utils-B8xGEgP3.js";import{t as g}from"./search-x-CbHLclyX.js";import{i as _,n as v,r as y,t as b}from"./run-diff-BiSarcbn.js";import{c as x,t as S}from"./project-router-C87COYR7.js";import{At as C,Ot as w,X as T,Xt as E,Y as D,Z as O,_ as k,an as A,d as j,f as M,g as N,h as P,ht as F,m as I,p as L,t as R,u as z,x as B}from"./index-B4FnnuuW.js";var V=n(t(),1),H=e();function U(){let{groupId:e}=c(),t=o(e),n=s();if((0,V.useEffect)(()=>{e&&n.invalidateQueries({queryKey:i.groups.detail(e)})},[n,e,(p().data??[]).filter(t=>t.groupId===e).map(e=>`${e.id}:${e.status}:${e.archived}`).sort().join(`,`)]),t.isPending)return(0,H.jsx)(D,{});if(t.isError){let e=t.error instanceof l&&t.error.status===404;return(0,H.jsx)(`div`,{"data-route":`compare`,className:`flex min-h-full flex-col`,children:(0,H.jsx)(m,{icon:e?(0,H.jsx)(g,{}):(0,H.jsx)(E,{}),tone:e?`neutral`:`danger`,title:e?`No such variant group`:`Could not load the variants`,subtitle:e?`No runs share this group id. The group may have been deleted, or a winner was already picked and the others removed.`:t.error.message,actions:(0,H.jsx)(u,{asChild:!0,variant:`outline`,children:(0,H.jsx)(S,{to:`/`,children:`Back to tasks`})})})})}return(0,H.jsx)(W,{groupId:e,variants:t.data.runs})}function W({groupId:e,variants:t}){let n=x(),o=s(),[c,l]=(0,V.useState)(null),u=t.every(e=>T.has(e.status)),p=t[0]?F(t[0]):``,m=a({mutationFn:t=>r(e,t),onSuccess:(t,r)=>{o.invalidateQueries({queryKey:i.runs.all}),o.invalidateQueries({queryKey:i.groups.detail(e)}),n(`/tasks/${t.winner?.id??r}`)},onError:e=>d(e.message,{tone:`danger`})});return(0,H.jsxs)(`div`,{"data-route":`compare`,className:`mx-auto flex w-full max-w-6xl flex-col gap-4 px-4 py-5 md:px-6`,children:[(0,H.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,H.jsxs)(`h1`,{className:`flex items-center gap-2 text-xl font-semibold`,children:[(0,H.jsx)(E,{className:`size-5 shrink-0 text-violet`,"aria-hidden":`true`}),(0,H.jsx)(`span`,{className:`min-w-0 truncate`,title:p,children:p})]}),(0,H.jsxs)(`p`,{className:`text-[13px] text-muted-foreground`,children:[t.length,` variants of the same task, each in its own worktree — pick the diff you want to keep. The others are cancelled and archived, their worktrees and branches removed.`]})]}),(0,H.jsx)(`div`,{"data-slot":`compare-columns`,className:h(`grid grid-cols-1 gap-3`,t.length>=3?`md:grid-cols-3`:`md:grid-cols-2`),children:t.map(e=>(0,H.jsx)(G,{variant:e,allTerminal:u,pickPending:m.isPending,onPick:()=>l(e)},e.id))}),(0,H.jsx)(`section`,{"aria-label":`Full diffs`,className:`flex flex-col gap-2`,children:t.map(e=>(0,H.jsx)(K,{variant:e},e.id))}),(0,H.jsx)(z,{open:c!==null,onOpenChange:e=>!e&&l(null),children:(0,H.jsxs)(L,{children:[(0,H.jsxs)(N,{children:[(0,H.jsxs)(k,{children:[`Pick variant `,c?.variant,`?`]}),(0,H.jsxs)(I,{children:[`Variant `,c?.variant,`'s changes go to the review gate. The other`,` `,t.length-1==1?`variant is`:`${t.length-1} variants are`,` `,`cancelled if still open, archived, and their worktrees and branches removed. There is no undo.`]})]}),(0,H.jsxs)(P,{children:[(0,H.jsx)(M,{children:`Keep comparing`}),(0,H.jsxs)(j,{"data-slot":`confirm-pick`,onClick:()=>{c&&m.mutate(c.id),l(null)},children:[(0,H.jsx)(f,{"aria-hidden":`true`}),`Pick variant `,c?.variant]})]})]})})]})}function G({variant:e,allTerminal:t,pickPending:n,onPick:r}){let i=C(e),a=O(e.costUsd);return(0,H.jsxs)(`article`,{"data-slot":`variant-column`,"data-variant":e.variant,className:`flex min-w-0 flex-col gap-3 rounded-lg border border-border bg-card p-3.5 shadow-xs`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{"data-slot":`variant-letter`,"aria-label":`Variant ${e.variant}`,className:`inline-flex size-6 shrink-0 items-center justify-center rounded-full bg-violet/15 font-mono text-xs font-semibold text-violet`,children:e.variant}),(0,H.jsx)(R,{dot:i.tone,pulse:i.pulse,children:i.label}),(0,H.jsxs)(`span`,{className:`ml-auto shrink-0 font-mono text-[11px] text-soft-foreground tabular-nums`,children:[w(e.tokensUsed),a?` · ${a}`:``]})]}),(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,H.jsx)(`span`,{className:`text-[10.5px] font-semibold tracking-[0.04em] text-soft-foreground uppercase`,children:`git diff --stat`}),(0,H.jsx)(`pre`,{"data-slot":`variant-diffstat`,className:`max-h-36 overflow-auto rounded-md bg-muted/60 px-2.5 py-2 font-mono text-[11px] leading-[1.6] whitespace-pre text-muted-foreground`,children:e.diffStat.trimEnd()||`(no changes)`})]}),(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,H.jsx)(`span`,{className:`text-[10.5px] font-semibold tracking-[0.04em] text-soft-foreground uppercase`,children:`Progress`}),e.handoffExcerpt?(0,H.jsx)(`div`,{"data-slot":`variant-progress`,className:`max-h-28 min-w-0 overflow-hidden text-[12.5px] text-muted-foreground [mask-image:linear-gradient(to_bottom,black_75%,transparent)]`,children:(0,H.jsx)(B,{children:e.handoffExcerpt})}):(0,H.jsx)(`p`,{"data-slot":`variant-progress`,className:`text-xs text-soft-foreground`,children:`(no progress notes)`})]}),(0,H.jsxs)(u,{"data-slot":`variant-pick`,title:t?`Keep variant ${e.variant}'s changes and archive the others`:`Every variant must finish before you can pick`,disabled:!t||n,onClick:r,children:[(0,H.jsx)(f,{"aria-hidden":`true`}),`Pick this one`]})]})}function K({variant:e}){let[t,n]=(0,V.useState)(!1);return(0,H.jsxs)(v,{open:t,onOpenChange:n,"data-slot":`variant-diff`,"data-variant":e.variant,className:`min-w-0 overflow-hidden rounded-lg border border-border bg-card`,children:[(0,H.jsxs)(_,{className:`flex w-full items-center gap-2 px-3.5 py-2.5 text-left text-[13px] font-medium hover:bg-muted/50`,children:[(0,H.jsx)(A,{className:h(`size-3.5 shrink-0 text-soft-foreground transition-transform`,t&&`rotate-90`),"aria-hidden":`true`}),`Variant `,e.variant,` — full diff`]}),(0,H.jsx)(y,{children:(0,H.jsx)(`div`,{className:`border-t border-border/50 px-3 py-3`,children:(0,H.jsx)(b,{runId:e.id})})})]})}export{U as CompareVariantsRoute};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/diff-view-
|
|
2
|
-
import{a as e,i as t,s as n,u as r}from"./bundle-mjs-BegPhL5c.js";import{t as i}from"./utils-B8xGEgP3.js";import{rt as a}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/diff-view-BxgOxwEX.js","assets/bundle-mjs-BegPhL5c.js","assets/utils-B8xGEgP3.js","assets/index-B4FnnuuW.js","assets/centered-state-DC3UgTEo.js","assets/search-x-CbHLclyX.js","assets/triangle-alert-CHtGkjPK.js","assets/textarea-BhdkPlu6.js","assets/dist-C7YIGUSB.js","assets/project-router-C87COYR7.js","assets/chunk-BO2N2NFS-DtrdTCWa.js","assets/lib-uHpeUPzK.js","assets/index-Lz_3un5h.css","assets/lib-DPEZDBUN.js","assets/image-preview-B6kVovYD.js","assets/zoomable-image-Bb6ydBLq.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e,i as t,s as n,u as r}from"./bundle-mjs-BegPhL5c.js";import{t as i}from"./utils-B8xGEgP3.js";import{rt as a}from"./index-B4FnnuuW.js";import{n as o,t as s}from"./image-preview-B6kVovYD.js";var c=r(n(),1),l=e();function u(e){let[n,r]=(0,c.useState)(null);return(0,c.useEffect)(()=>{let e=!1;return t(()=>import(`./diff-view-BxgOxwEX.js`).then(t=>{e||r({View:t.DiffView})},()=>{e||r(`failed`)}),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15])),()=>{e=!0}},[]),e.files.length===0?(0,l.jsx)(`p`,{"data-slot":`diff-empty`,className:i(`px-1 text-xs text-soft-foreground`,e.className),children:`No changes.`}):n===`failed`?(0,l.jsx)(d,{...e}):n===null?(0,l.jsx)(`p`,{"data-slot":`diff-loading`,className:i(`px-1 text-xs text-soft-foreground`,e.className),children:`Loading diff…`}):(0,l.jsx)(n.View,{...e})}function d({files:e,wrap:t=!1,imageSrc:n,onOpenInApp:r,viewRef:o,className:s}){let u={adds:e.reduce((e,t)=>e+t.adds,0),dels:e.reduce((e,t)=>e+t.dels,0),files:e.length},d=(0,c.useRef)(null);return(0,c.useImperativeHandle)(o,()=>({scrollToPath:e=>{for(let t of d.current?.querySelectorAll(`[data-slot="diff-file"]`)??[])if(t.dataset.path===e){t.scrollIntoView({block:`start`,behavior:`smooth`});return}}})),(0,l.jsxs)(`div`,{ref:d,"data-slot":`diff`,"data-fallback":`true`,className:i(`flex min-w-0 flex-col gap-3`,s),children:[(0,l.jsxs)(`p`,{"data-slot":`diff-totals`,className:`flex items-center gap-2 px-1 text-xs text-muted-foreground`,children:[(0,l.jsxs)(`span`,{children:[u.files,` `,u.files===1?`file`:`files`,` changed`]}),(0,l.jsx)(a,{stat:u})]}),e.map(e=>(0,l.jsx)(f,{file:e,wrap:t,imageSrc:n,onOpenInApp:r},`${e.oldPath??``}→${e.path}`))]})}function f({file:e,wrap:t,imageSrc:n,onOpenInApp:r}){return(0,l.jsxs)(`section`,{"data-slot":`diff-file`,"data-path":e.path,className:`min-w-0 overflow-clip rounded-md border border-border bg-card`,children:[(0,l.jsxs)(`header`,{className:`flex items-center gap-2 border-b border-border/50 px-3 py-2`,children:[(0,l.jsx)(`span`,{"data-slot":`diff-file-path`,className:`min-w-0 truncate font-mono text-xs font-medium`,children:e.oldPath?`${e.oldPath} → ${e.path}`:e.path}),(0,l.jsx)(`span`,{className:`ml-auto shrink-0`,children:(0,l.jsx)(a,{stat:{adds:e.adds,dels:e.dels,files:1},className:`text-[11px]`})})]}),o(e)?(0,l.jsx)(s,{file:e,imageSrc:n,onOpenInApp:r}):e.binary?(0,l.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`Binary file — no text diff.`}):e.patch===``?(0,l.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`No content changes (metadata only).`}):(0,l.jsx)(`pre`,{className:i(`py-2 font-mono text-xs leading-[1.7]`,t?`break-words whitespace-pre-wrap`:`overflow-x-auto whitespace-pre`),children:e.patch.split(`
|
|
3
3
|
`).map((e,t)=>(0,l.jsxs)(`span`,{className:i(`block px-4`,e.startsWith(`+`)&&!e.startsWith(`+++`)&&`bg-diff-add`,e.startsWith(`-`)&&!e.startsWith(`---`)&&`bg-diff-del`,e.startsWith(`@@`)&&`text-soft-foreground`),children:[e,e===``?` `:``]},t))})]})}export{u as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,s as t,u as n}from"./bundle-mjs-BegPhL5c.js";import{t as r}from"./utils-B8xGEgP3.js";import{C as i,S as a,an as o,rt as s,w as c}from"./index-
|
|
1
|
+
import{a as e,s as t,u as n}from"./bundle-mjs-BegPhL5c.js";import{t as r}from"./utils-B8xGEgP3.js";import{C as i,S as a,an as o,rt as s,w as c}from"./index-B4FnnuuW.js";import{t as l}from"./lib-DPEZDBUN.js";import{n as u,t as d}from"./image-preview-B6kVovYD.js";var f=n(t(),1),p=44;function m(e){if(e.binary===!0||e.patch===``)return 1;let t=e.patch.split(`
|
|
2
2
|
`),n=t.findIndex(e=>e.startsWith(`@@`));return n===-1?t.length:t.length-n}function h(e){return m(e)*20+p}function g(e){return e.reduce((e,t)=>e+m(t),0)}function _(e,t){let n=new URLSearchParams(e).get(`diff`);return n===`flat`||n===`virtual`?n:t>1500?`virtual`:`flat`}function v(e){return`${e.oldPath??``}→${e.path}`}function y(e){let t=0;for(let n of e.split(`
|
|
3
3
|
`))n.length>t&&(t=n.length);return t}var b=/[A-Za-z0-9_]+|\s+|[^\sA-Za-z0-9_]+/g,x=300,S=.3;function C(e,t){if(e===t)return null;let n=e.match(b)??[],r=t.match(b)??[];if(n.length===0||r.length===0||n.length>x||r.length>x)return null;let i=r.length+1,a=new Uint16Array((n.length+1)*i);for(let e=1;e<=n.length;e++)for(let t=1;t<=r.length;t++)a[e*i+t]=n[e-1]===r[t-1]?(a[(e-1)*i+(t-1)]??0)+1:Math.max(a[(e-1)*i+t]??0,a[e*i+(t-1)]??0);if((a[n.length*i+r.length]??0)/Math.max(n.length,r.length)<S)return null;let o=Array(n.length).fill(!1),s=Array(r.length).fill(!1),c=n.length,l=r.length;for(;c>0&&l>0;)n[c-1]===r[l-1]?(o[c-1]=!0,s[l-1]=!0,c--,l--):(a[(c-1)*i+l]??0)>=(a[c*i+(l-1)]??0)?c--:l--;return{del:w(n,o),add:w(r,s)}}function w(e,t){let n=[];return e.forEach((e,r)=>{let i=!(t[r]??!1),a=n[n.length-1];a&&a.changed===i?a.text+=e:n.push({text:e,changed:i})}),n}function T(e,t,n){if(!t||t.length===0)return e?e.map(e=>({text:e.content,color:e.color,changed:!1})):n===``?[]:[{text:n,changed:!1}];if(!e||e.length===0)return t.map(e=>({text:e.text,changed:e.changed}));let r=[],i=0,a=0,o=0,s=0;for(;i<e.length&&o<t.length;){let n=e[i],c=t[o],l=n.content.length-a,u=c.text.length-s,d=Math.min(l,u);d>0&&(r.push({text:n.content.slice(a,a+d),color:n.color,changed:c.changed}),a+=d,s+=d),n.content.length-a<=0&&(i++,a=0),c.text.length-s<=0&&(o++,s=0)}for(;i<e.length;){let t=e[i],n=t.content.slice(a);n!==``&&r.push({text:n,color:t.color,changed:!1}),i++,a=0}return r}var E=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/,D=`… (patch truncated)`;function O(e){let t=[],n=!1,r=null,i=0,a=0,o=e.split(`
|
|
4
4
|
`);o.at(-1)===``&&o.pop();for(let e of o){let o=E.exec(e);if(o){r={header:e,oldStart:Number(o[1]),oldCount:o[2]===void 0?1:Number(o[2]),newStart:Number(o[3]),newCount:o[4]===void 0?1:Number(o[4]),lines:[]},i=r.oldStart,a=r.newStart,t.push(r);continue}if(e.includes(D)){n=!0,r=null;continue}r&&(e.startsWith(`+`)?r.lines.push({kind:`add`,text:e.slice(1),newLine:a++}):e.startsWith(`-`)?r.lines.push({kind:`del`,text:e.slice(1),oldLine:i++}):e.startsWith(`\\`)||r.lines.push({kind:`context`,text:e.slice(1),oldLine:i++,newLine:a++}))}return{hunks:t,truncated:n}}function k(e,t=!1){let n=[],r=e[0];if(!r)return n;r.newStart>1&&n.push({beforeHunk:0,count:r.newStart-1,oldStart:1,newStart:1});for(let t=1;t<e.length;t++){let r=e[t-1],i=e[t],a=r.oldStart+r.oldCount,o=r.newStart+r.newCount,s=i.newStart-o;s>0&&n.push({beforeHunk:t,count:s,oldStart:a,newStart:o})}if(t){let t=e[e.length-1];n.push({beforeHunk:e.length,oldStart:t.oldStart+t.oldCount,newStart:t.newStart+t.newCount})}return n}function A(e,t){let n=e.count===void 0?t.length:e.newStart+e.count-1,r=e.oldStart-e.newStart,i=[];for(let a=e.newStart;a<=Math.min(n,t.length);a++)i.push({kind:`context`,text:t[a-1]??``,oldLine:a+r,newLine:a});return i}function j(e,t){let n=Array(e.length),r=Array(t.length),i=Math.min(e.length,t.length);for(let a=0;a<i;a++){let i=C(e[a].text,t[a].text);i&&(n[a]=i.del,r[a]=i.add)}return{dels:e,adds:t,delSpans:n,addSpans:r}}function M(e,t,n){let r=0;for(;r<e.lines.length;){let i=e.lines[r];if(i.kind===`del`||i.kind===`add`){let t=[],i=[];for(;r<e.lines.length&&e.lines[r].kind===`del`;)t.push(e.lines[r++]);for(;r<e.lines.length&&e.lines[r].kind===`add`;)i.push(e.lines[r++]);n(j(t,i))}else t(i),r++}}function N(e,t=[],n){let r=new Map(t.map(e=>[e.beforeHunk,e])),i=[],a=e=>{let t=r.get(e);if(!t)return;let a=n?.get(e);if(a)for(let e of a)i.push({type:`line`,cell:{line:e}});else i.push({type:`gap`,gap:t})};return e.forEach((e,t)=>{a(t),i.push({type:`hunk`,hunk:e}),M(e,e=>i.push({type:`line`,cell:{line:e}}),e=>{e.dels.forEach((t,n)=>i.push({type:`line`,cell:{line:t,spans:e.delSpans[n]}})),e.adds.forEach((t,n)=>i.push({type:`line`,cell:{line:t,spans:e.addSpans[n]}}))})}),a(e.length),i}function P(e,t=[],n){let r=new Map(t.map(e=>[e.beforeHunk,e])),i=[],a=e=>{let t=r.get(e);if(!t)return;let a=n?.get(e);if(a)for(let e of a)i.push({type:`pair`,left:{line:e},right:{line:e}});else i.push({type:`gap`,gap:t})};return e.forEach((e,t)=>{a(t),i.push({type:`hunk`,hunk:e}),M(e,e=>i.push({type:`pair`,left:{line:e},right:{line:e}}),e=>{let t=Math.max(e.dels.length,e.adds.length);for(let n=0;n<t;n++){let t=e.dels[n],r=e.adds[n];i.push({type:`pair`,...t?{left:{line:t,spans:e.delSpans[n]}}:{},...r?{right:{line:r,spans:e.addSpans[n]}}:{}})}})}),a(e.length),i}var F=e(),I=1500,L=new Map;function R(e,t){if(e){for(let n of e.querySelectorAll(`[data-slot="diff-file"]`))if(n.dataset.path===t)return n}}function z({files:e,mode:t=`unified`,wrap:n=!1,loadFileText:i,imageSrc:a,onOpenInApp:o,viewRef:c,className:l}){let u=(0,f.useMemo)(()=>({adds:e.reduce((e,t)=>e+t.adds,0),dels:e.reduce((e,t)=>e+t.dels,0),files:e.length}),[e]),[d,p]=(0,f.useState)(()=>new Set),[m,y]=(0,f.useState)(()=>new Map),b=(0,f.useCallback)(e=>{p(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n})},[]),x=(0,f.useCallback)(async(e,t)=>{if(!i)return;let n=await i(e.path);if(n===null)return;let r=A(t,n.split(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,s as t,u as n}from"./bundle-mjs-BegPhL5c.js";import{a as r}from"./centered-state-DC3UgTEo.js";import{n as i,r as a,t as o}from"./utils-B8xGEgP3.js";import{t as s}from"./ellipsis-vertical-DFAnsUi4.js";import{n as c}from"./tab-link-CoNQGOQ7.js";import{t as l}from"./file-vT36R94R.js";import{i as u,n as d,r as f}from"./use-desktop-
|
|
1
|
+
import{a as e,s as t,u as n}from"./bundle-mjs-BegPhL5c.js";import{a as r}from"./centered-state-DC3UgTEo.js";import{n as i,r as a,t as o}from"./utils-B8xGEgP3.js";import{t as s}from"./ellipsis-vertical-DFAnsUi4.js";import{n as c}from"./tab-link-CoNQGOQ7.js";import{t as l}from"./file-vT36R94R.js";import{i as u,n as d,r as f}from"./use-desktop-VJlEigWx.js";import{t as p}from"./git-pull-request-BvjQwr12.js";import{t as m}from"./square-terminal-DRmz43dF.js";import{t as h}from"./upload-Dx__Y6Lu.js";import{an as g,dt as _,lt as v,mt as y,nn as b,rt as x,ut as S}from"./index-B4FnnuuW.js";var C=a(`file-diff`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M9 10h6`,key:`9gxzsh`}],[`path`,{d:`M12 13V7`,key:`h0r20n`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}]]),w=n(t(),1),T=e();function E({root:e,selected:t,onSelect:n}){return(0,T.jsx)(`nav`,{"data-slot":`changes-tree`,"aria-label":`Changed files`,className:`min-w-0 text-[13px]`,children:(0,T.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,T.jsx)(O,{dir:e,depth:0,selected:t,onSelect:n},e.path)),e.files.map(e=>(0,T.jsx)(A,{file:e,depth:0,selected:t,onSelect:n},e.path))]})})}function D({adds:e,dels:t}){return(0,T.jsxs)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-[11px] font-medium tabular-nums`,children:[e>0?(0,T.jsxs)(`span`,{className:`text-success`,children:[`+`,e]}):null,e>0&&t>0?` `:null,t>0?(0,T.jsxs)(`span`,{className:`text-danger`,children:[`−`,t]}):null]})}function O({dir:e,depth:t,selected:n,onSelect:r}){let[i,a]=(0,w.useState)(!0);return(0,T.jsxs)(`li`,{children:[(0,T.jsxs)(`button`,{type:`button`,"data-slot":`tree-dir`,"data-path":e.path,"data-state":i?`open`:`closed`,"aria-expanded":i,onClick:()=>a(e=>!e),className:`flex w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left text-muted-foreground hover:bg-muted hover:text-foreground`,style:{paddingLeft:`${6+t*14}px`},children:[(0,T.jsx)(g,{"aria-hidden":`true`,className:o(`size-3.5 shrink-0 transition-transform`,i&&`rotate-90`)}),(0,T.jsx)(b,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,T.jsx)(`span`,{className:`min-w-0 truncate font-medium`,children:e.name}),(0,T.jsx)(D,{adds:e.adds,dels:e.dels})]}),i?(0,T.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,T.jsx)(O,{dir:e,depth:t+1,selected:n,onSelect:r},e.path)),e.files.map(e=>(0,T.jsx)(A,{file:e,depth:t+1,selected:n,onSelect:r},e.path))]}):null]})}var k={added:`text-success`,deleted:`text-danger`};function A({file:e,depth:t,selected:n,onSelect:r}){let i=n===e.path;return(0,T.jsx)(`li`,{children:(0,T.jsxs)(`button`,{type:`button`,"data-slot":`tree-file`,"data-path":e.path,"aria-current":i?`true`:void 0,onClick:()=>r(e.path),className:o(`flex w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left hover:bg-muted`,i?`bg-muted font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${24+t*14}px`},children:[(0,T.jsx)(l,{"aria-hidden":`true`,className:o(`size-3.5 shrink-0`,k[e.status])}),(0,T.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name}),(0,T.jsx)(D,{adds:e.adds,dels:e.dels})]})})}function j(e,t){return{kind:`dir`,name:e,path:t,dirs:[],files:[],adds:0,dels:0,fileCount:0}}function M(e){let t=e;for(;t.files.length===0&&t.dirs.length===1;){let e=t.dirs[0];t={...e,name:`${t.name}/${e.name}`}}return{...t,dirs:t.dirs.map(M)}}var N=(e,t)=>e.name.localeCompare(t.name);function P(e){let t=j(``,``),n=new Map([[``,t]]),r=e=>{let t=n.get(e);if(t)return t;let i=e.lastIndexOf(`/`),a=r(i===-1?``:e.slice(0,i)),o=j(i===-1?e:e.slice(i+1),e);return a.dirs.push(o),n.set(e,o),o};for(let t of e){let e=t.path.lastIndexOf(`/`);r(e===-1?``:t.path.slice(0,e)).files.push({kind:`file`,name:e===-1?t.path:t.path.slice(e+1),path:t.path,status:t.status,adds:t.adds,dels:t.dels,binary:t.binary})}let i=e=>{e.dirs.forEach(i),e.adds=e.files.reduce((e,t)=>e+t.adds,0)+e.dirs.reduce((e,t)=>e+t.adds,0),e.dels=e.files.reduce((e,t)=>e+t.dels,0)+e.dirs.reduce((e,t)=>e+t.dels,0),e.fileCount=e.files.length+e.dirs.reduce((e,t)=>e+t.fileCount,0),e.dirs.sort(N),e.files.sort(N)};return i(t),{...t,dirs:t.dirs.map(M)}}function F({bar:e,branch:t,stat:n,mode:i,wrap:a,onModeChange:o,onWrapChange:c,onAction:l}){return(0,T.jsxs)(`div`,{"data-slot":`git-toolbar`,className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 border-b border-border px-4 py-2 md:px-6`,children:[t?(0,T.jsx)(d,{branch:t}):null,n?(0,T.jsx)(R,{stat:n}):null,(0,T.jsxs)(`span`,{className:`ml-auto flex items-center gap-1`,children:[(0,T.jsx)(`span`,{className:`hidden items-center gap-1 md:flex`,children:(0,T.jsx)(f,{mode:i,wrap:a,onModeChange:o,onWrapChange:c})}),e.secondary.map(e=>(0,T.jsx)(L,{action:e,variant:`outline`,onAction:l},e.id)),(0,T.jsx)(L,{action:e.primary,variant:`primary`,onAction:l}),e.menu.length>0?(0,T.jsxs)(v,{children:[(0,T.jsx)(y,{asChild:!0,children:(0,T.jsx)(r,{variant:`ghost`,size:`icon-sm`,"aria-label":`More git actions`,children:(0,T.jsx)(s,{"aria-hidden":`true`})})}),(0,T.jsx)(S,{align:`end`,"data-slot":`git-toolbar-menu`,children:e.menu.map(e=>(0,T.jsxs)(_,{disabled:!e.enabled,title:e.reason,onSelect:()=>l(e.id),children:[I[e.id],e.label]},e.id))})]}):null]})]})}var I={commit:(0,T.jsx)(u,{"aria-hidden":`true`}),push:(0,T.jsx)(h,{"aria-hidden":`true`}),"create-pr":(0,T.jsx)(p,{"aria-hidden":`true`}),"view-pr":(0,T.jsx)(c,{"aria-hidden":`true`}),"open-terminal":(0,T.jsx)(m,{"aria-hidden":`true`})};function L({action:e,variant:t,onAction:n}){return e.id===`view-pr`?i(e.href)?(0,T.jsx)(r,{asChild:!0,variant:t,size:`sm`,"data-action":e.id,children:(0,T.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,children:[I[e.id],e.label]})}):(0,T.jsxs)(r,{variant:t,size:`sm`,"data-action":e.id,disabled:!0,title:`View PR unavailable — the recorded PR link is not an http(s) URL`,children:[I[e.id],e.label]}):(0,T.jsxs)(r,{variant:t,size:`sm`,"data-action":e.id,disabled:!e.enabled,title:e.enabled?void 0:e.reason,onClick:()=>n(e.id),children:[I[e.id],e.label]})}function R({stat:e}){return(0,T.jsx)(`span`,{"data-slot":`changes-stat`,children:(0,T.jsx)(x,{stat:{adds:z(e.adds),dels:z(e.dels),files:e.files}})})}function z(e){let[t,n]=(0,w.useState)(e),r=(0,w.useRef)(e);return(0,w.useEffect)(()=>{let t=r.current;if(t===e)return;if(typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches||typeof requestAnimationFrame!=`function`){r.current=e,n(e);return}let i=performance.now(),a=0,o=s=>{let c=Math.min(1,(s-i)/350),l=1-(1-c)**3;n(Math.round(t+(e-t)*l)),c<1?a=requestAnimationFrame(o):r.current=e};return a=requestAnimationFrame(o),()=>{cancelAnimationFrame(a),r.current=e,n(e)}},[e]),t}export{C as a,E as i,F as n,P as r,R as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,s as t,u as n}from"./bundle-mjs-BegPhL5c.js";import{A as r,An as i,Ft as a,Ht as o,L as s,Nn as c,On as l,R as u,Ut as d,Vt as f,Wt as p,a as m,bt as h,ht as g,i as _,jn as v,k as y,qt as b,rn as ee,t as x,vt as S,z as C,zn as w}from"./centered-state-DC3UgTEo.js";import{n as T,r as E,t as D}from"./utils-B8xGEgP3.js";import{t as O}from"./arrow-left-BmHnLe4M.js";import{n as k,t as A}from"./tab-link-CoNQGOQ7.js";import{t as j}from"./git-pull-request-BvjQwr12.js";import{t as M}from"./refresh-cw-BgVxWSof.js";import{t as N}from"./triangle-alert-CHtGkjPK.js";import{n as P,t as F}from"./textarea-BhdkPlu6.js";import{r as te,t as I}from"./project-router-C87COYR7.js";import{A as ne,Bt as L,Ct as re,D as R,E as ie,Et as z,F as B,Ft as V,Gt as ae,H,Ht as oe,It as U,J as se,Jt as W,Kt as ce,L as G,M as le,Mt as K,N as q,Nt as J,O as ue,P as de,Pt as fe,Qt as pe,R as me,Rt as he,St as ge,Tt as _e,Ut as ve,Vt as ye,Wt as be,Yt as xe,an as Se,bt as Ce,j as we,jt as Te,k as Ee,kt as Y,on as De,qt as Oe,rn as ke,vt as Ae,wt as je,x as Me,y as Ne,z as Pe}from"./index-DqzfHNfi.js";import{t as Fe}from"./diff-CYDGlOeN.js";var Ie=E(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Le=E(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),Re=E(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),ze=E(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),X=n(t(),1),Z=e();function Q({className:e,...t}){return(0,Z.jsx)(`div`,{"data-slot":`skeleton`,className:D(`animate-pulse rounded-md bg-accent`,e),...t})}function Be(e){return`${e.kind===`pr`?`Address GitHub pull request`:`Fix GitHub issue`} #${e.number}: ${e.title}\n\n${e.url}`}function Ve(e,t=[]){let n=Be(e);return e.body?.trim()&&(n+=`\n\n---\n\n${e.body.trim()}`),t.length&&(n+=He(t)),n}function He(e){return`\n\nUse these skills where relevant: ${e.join(`, `)}.`}function Ue(e,t){return e.replace(/\{\{\s*number\s*\}\}/gi,()=>`#${t.number}`).replace(/\{\{\s*title\s*\}\}/gi,()=>t.title).replace(/\{\{\s*url\s*\}\}/gi,()=>t.url)}function We(e,t){if(e.includes(t.url))return!0;let n=t.kind===`pr`?String.raw`(?:pull\s+request|pr)`:String.raw`issue`;return new RegExp(String.raw`\b${n}\s*#?\s*${t.number}\b`,`i`).test(e)}function Ge(e,t,n){let r=(n??``).trim();if(!r)return Ve(e,t);let i=Be(e),a=r.startsWith(i)?i+Ue(r.slice(i.length),e):Ue(r,e),o=We(a,e)?a:`${i}\n\n${a}`;return t.length?o+He(t):o}function Ke(e){let t=[];for(let n of e.slice(0,8)){let e=new Set(t.map(e=>e.id)),r=n;for(let t=2;e.has(r);t++)r=`${n}-${t}`;t.push({id:r,name:n,skill:n,prompt:`{{task}}`})}return t}function qe(e,t,n,r,i={}){return t?{...i,workflow:t,task:Ge(e,n,r)}:n.length?{...i,steps:Ke(n),task:Ge(e,[],r)}:{...i,workflow:`quick-task`,task:Ge(e,[],r)}}function Je(e){let t=new Set;for(let n of e)for(let e of n.labels)t.add(e);return[...t].sort((e,t)=>e.toLowerCase().localeCompare(t.toLowerCase()))}function Ye(e,t={}){let n=(t.query??``).trim().toLowerCase(),r=t.labels??[],i=n.replace(/^#/,``),a=i!==``&&/^\d+$/.test(i);return e.filter(e=>r.length>0&&!r.every(t=>e.labels.includes(t))?!1:n===``?!0:a?String(e.number).includes(i):`#${e.number} ${e.title} ${e.author} ${e.body}`.toLowerCase().includes(n))}function Xe(e){if(!e||!/^[0-9a-fA-F]{6}$/.test(e))return{borderColor:`var(--border)`,color:`var(--muted-foreground)`};let t=`#${e}`;return{backgroundColor:`${t}22`,borderColor:`${t}66`,color:`color-mix(in srgb, ${t} 50%, var(--foreground))`}}var Ze={workflow:null,skills:[]},Qe=`cez-followup-selection`;function $e(e){let t=e&&typeof e==`object`?e:{};return{workflow:typeof t.workflow==`string`?t.workflow:null,skills:Array.isArray(t.skills)?t.skills.filter(e=>typeof e==`string`):[]}}function et(){try{let e=localStorage.getItem(Qe);return e?$e(JSON.parse(e)):{...Ze}}catch{return{...Ze}}}function tt(e){try{localStorage.setItem(Qe,JSON.stringify(e))}catch{}}var nt=`cez-followup-prompt:`;function rt(e){try{return localStorage.getItem(nt+e)??``}catch{return``}}function it(e,t){try{t===``?localStorage.removeItem(nt+e):localStorage.setItem(nt+e,t)}catch{}}function at({item:e,workflows:t,skills:n,workflow:o,onWorkflowChange:s,selectedSkills:l,onSkillsChange:u,engine:d,onEngineChange:f,queuedRunId:p,onQueued:h}){let g=c(),v=S(),b=e.kind===`pr`?`PR`:`issue`,x=l.filter(e=>n.some(t=>t.name===e)),[C]=(0,X.useState)(()=>Be(e)),[w,T]=(0,X.useState)(()=>rt(e.url)||C),E=Pe(d),D=(0,X.useRef)(null);(0,X.useEffect)(()=>{it(e.url,w===C?``:w)},[e.url,w,C]);let O=(0,X.useMemo)(()=>ne(v.data?.promptTemplates),[v.data?.promptTemplates]),k=e=>{let t=D.current,n=w===C?w.length:t?.selectionStart??w.length,r=Ee(w,n,e);T(r.text),requestAnimationFrame(()=>{D.current?.focus(),D.current?.setSelectionRange(r.caret,r.caret)})},A=ue(O,x),j=(0,X.useRef)(w);j.current=w;let M=(0,X.useRef)(``);(0,X.useEffect)(()=>{let e=we(j.current,M.current,A,C);M.current=e.applied,e.text!==j.current&&T(e.text)},[A,C]);let N=i({mutationFn:async()=>E.canRun?a(qe(e,o,x,w,me(E))):null,onSuccess:t=>{if(t===null)return;let n=`runs`in t?t.runs[0]:t;n&&h(e.url,n.id),_(`Added to the queue — ${b} #${e.number}`),x.length>0&&v.data!==void 0&&ee({skillUsage:x.reduce((e,t)=>Ae(e,t),v.data.skillUsage)}).then(()=>g.invalidateQueries({queryKey:r.uiState})).catch(()=>{}),it(e.url,``),T(C),M.current=``,g.invalidateQueries({queryKey:r.runs.all})},onError:e=>_(e.message,{tone:`danger`})}),te=e=>{ie({key:e.key,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,repeat:e.repeat,isComposing:e.nativeEvent.isComposing})&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),!N.isPending&&E.canRun&&N.mutate())},L=e=>u(l.includes(e)?l.filter(t=>t!==e):[...l,e]);return(0,Z.jsxs)(`section`,{"data-slot":`gh-hand`,className:`mt-7 rounded-lg border border-border bg-card p-4`,children:[(0,Z.jsxs)(`h3`,{className:`flex items-center gap-1.5 text-[11px] font-semibold tracking-[.04em] text-soft-foreground uppercase`,children:[(0,Z.jsx)(ce,{"aria-hidden":`true`,className:`size-3.5 text-violet`}),`Hand this to the agent`]}),(0,Z.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(ot,{workflows:t,value:o,onChange:s}),(0,Z.jsx)(st,{skills:n,skillUsage:v.data?.skillUsage,selected:x,onToggle:L}),(0,Z.jsx)(G,{pick:d,onChange:f,disabled:N.isPending||!E.canRun}),!E.providerPending&&!E.canRun?(0,Z.jsxs)(`span`,{"data-slot":`gh-provider-gate`,className:`inline-flex flex-wrap items-center gap-1 text-xs text-muted-foreground`,children:[E.providerError?`Provider authentication could not be verified.`:`Connect an agent provider to run this item.`,(0,Z.jsx)(I,{to:`/settings/agents#providers`,className:`font-medium text-foreground underline underline-offset-4`,children:`Configure providers`})]}):null,(0,Z.jsx)(le,{templates:O,onInsert:k})]}),x.length>0?(0,Z.jsx)(`div`,{"data-slot":`gh-skill-chips`,className:`mt-2.5 flex flex-wrap gap-1.5`,children:x.map(e=>(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`gh-skill-chip`,"data-skill":e,onClick:()=>L(e),title:`Remove this skill`,className:`inline-flex items-center gap-1 rounded-full border border-border bg-muted px-2 py-px font-mono text-[11px] font-medium text-foreground transition-colors hover:bg-danger/10 hover:text-danger`,children:[e,(0,Z.jsx)(P,{"aria-hidden":`true`,className:`size-3`})]},e))}):null,(0,Z.jsx)(F,{ref:D,"data-slot":`gh-custom-prompt`,"aria-label":`Custom prompt`,"aria-keyshortcuts":`Control+Enter Meta+Enter`,value:w,onChange:e=>T(e.target.value),onKeyDown:te,placeholder:`Instructions for the agent… (#${e.number} and its link are always sent)`,className:`mt-3 min-h-20 text-[13px]`}),(0,Z.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-2.5`,children:[(0,Z.jsxs)(m,{variant:`contrast`,"data-action":`gh-run`,disabled:N.isPending||!E.canRun,onClick:()=>N.mutate(),children:[(0,Z.jsx)(pe,{"aria-hidden":`true`,className:`size-3.5`}),`Run agent on this `,b]}),(0,Z.jsx)(`kbd`,{"aria-hidden":`true`,className:`rounded-[5px] border border-b-2 border-border bg-card px-[5px] py-px font-mono text-[10.5px] font-medium text-muted-foreground`,children:R()}),p?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`span`,{"data-slot":`gh-queued`,className:`flex items-center gap-1 text-xs font-medium text-success`,children:[(0,Z.jsx)(y,{"aria-hidden":`true`,className:`size-3.5`}),`queued`]}),(0,Z.jsx)(I,{to:`/tasks/${p}`,"data-slot":`gh-view-run`,className:`text-xs font-semibold text-violet hover:underline`,children:`View task →`})]}):null]})]})}function ot({workflows:e,value:t,onChange:n}){let[r,i]=(0,X.useState)(!1),[a,o]=(0,X.useState)(``),s=(0,X.useRef)(null),c=_e(e,a);return(0,Z.jsxs)(q,{open:r,onOpenChange:e=>{i(e),e||o(``)},children:[(0,Z.jsx)(B,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`gh-workflow-trigger`,"aria-label":`Choose a workflow`,className:D(H,t&&`border-foreground/60 font-mono text-[11.5px] font-semibold text-foreground`),children:[(0,Z.jsx)(Oe,{"aria-hidden":`true`,className:`size-3 shrink-0 text-violet`}),(0,Z.jsx)(`span`,{className:`max-w-44 truncate`,children:t??`workflow`}),(0,Z.jsx)(De,{"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,Z.jsx)(de,{align:`start`,sideOffset:8,className:`w-[320px] max-w-[calc(100vw-2rem)] p-0`,children:(0,Z.jsxs)(Te,{shouldFilter:!1,children:[(0,Z.jsx)(fe,{placeholder:`search workflows…`,value:a,onValueChange:o,onInput:()=>s.current?.scrollTo(0,0)}),(0,Z.jsxs)(U,{ref:s,"data-slot":`gh-workflow-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[c.length===0?(0,Z.jsx)(K,{children:`Nothing matches.`}):null,(0,Z.jsx)(J,{children:c.map(e=>{let r=t===e.name;return(0,Z.jsxs)(V,{value:`workflow ${e.name}`,keywords:z(e.name,e.description),"data-slot":`gh-workflow-option`,"data-workflow":e.name,onSelect:()=>{n(r?null:e.name),i(!1)},children:[(0,Z.jsx)(`span`,{className:`shrink-0 font-mono text-xs`,children:e.name}),e.description?(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,r?(0,Z.jsx)(y,{"aria-hidden":`true`,className:`ml-auto size-3.5 shrink-0 text-primary`}):null]},e.name)})})]})]})})]})}function st({skills:e,skillUsage:t,selected:n,onToggle:r}){let[i,a]=(0,X.useState)(!1),[o,s]=(0,X.useState)(``),[c,l]=(0,X.useState)(null),u=(0,X.useRef)(null),{mostUsed:d,project:f,global:p}=re(je(e,o,t),t),m=(e,t)=>{let i=n.includes(e.name);return(0,Z.jsxs)(V,{value:`skill ${e.name} ${e.path}`,keywords:z(e.name,e.description),"data-slot":`gh-skill-option`,"data-skill":e.name,"data-selected":i?`true`:void 0,onSelect:()=>r(e.name),children:[(0,Z.jsx)(`span`,{className:D(`shrink-0 font-mono text-xs`,t&&`font-semibold`),children:e.name}),e.description?(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,(0,Z.jsx)(`button`,{type:`button`,"data-slot":`gh-skill-view`,"aria-label":`View skill ${e.name}`,title:`View skill`,onClick:t=>{t.preventDefault(),t.stopPropagation(),l(e)},className:`ml-auto shrink-0 rounded-sm p-0.5 text-soft-foreground transition-colors hover:text-foreground`,children:(0,Z.jsx)(ke,{"aria-hidden":`true`,className:`size-3.5`})}),i?(0,Z.jsx)(y,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}):null]},e.path)};return e.length===0?null:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Ne,{skill:c,onClose:()=>l(null)}),(0,Z.jsxs)(q,{open:i,onOpenChange:e=>{a(e),e||s(``)},children:[(0,Z.jsx)(B,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`gh-skills-trigger`,"aria-label":`Choose skills`,className:D(H,n.length>0&&`border-foreground/60 font-semibold text-foreground`),children:[(0,Z.jsx)(W,{"aria-hidden":`true`,className:`size-3 shrink-0 text-violet`}),`skills`,n.length>0?` · ${n.length}`:``,(0,Z.jsx)(De,{"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,Z.jsx)(de,{align:`start`,sideOffset:8,className:`w-[336px] max-w-[calc(100vw-2rem)] p-0`,children:(0,Z.jsxs)(Te,{shouldFilter:!1,children:[(0,Z.jsx)(fe,{placeholder:`search skills…`,value:o,onValueChange:s,onInput:()=>u.current?.scrollTo(0,0)}),(0,Z.jsxs)(U,{ref:u,"data-slot":`gh-skill-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[d.length===0&&f.length===0&&p.length===0?(0,Z.jsx)(K,{children:`Nothing matches.`}):null,d.length>0?(0,Z.jsx)(J,{heading:`Most used`,children:d.map(e=>m(e,Ce(e)))}):null,f.length>0?(0,Z.jsx)(J,{heading:`Project skills`,children:f.map(e=>m(e,!0))}):null,p.length>0?(0,Z.jsx)(J,{heading:`Global`,children:p.map(e=>m(e,!1))}):null]})]})})]})]})}var ct=30,lt=1e3;function ut(){return S().data?.githubView===`prs`?(0,Z.jsx)(te,{to:`/github/prs`,replace:!0}):(0,Z.jsx)(dt,{view:`issues`})}function dt({view:e,changes:t=!1}){let{n}=l(),a=s(),u=s({limit:lt},a.data?.available===!0),d=u.data?.available?u.data:a.data,p=u.data?.available===!0,v=c(),y=e=>{v.setQueryData(r.uiState,t=>({...t,githubView:e})),ee({githubView:e}).then(e=>v.setQueryData(r.uiState,e)).catch(e=>{_(e instanceof Error?e.message:String(e),{tone:`danger`}),v.invalidateQueries({queryKey:r.uiState})})},b=(0,X.useRef)(null),C=i({mutationFn:()=>f({refresh:!0}),onSuccess:e=>{v.setQueryData(r.github({}),e),v.invalidateQueries({queryKey:r.github({limit:lt})});let t=b.current;if(!t){v.removeQueries({queryKey:[`github`,`comments`]});return}let n=r.githubComments(t.kind,t.number);o(t.kind,t.number,{refresh:!0}).then(e=>v.setQueryData(n,e)).catch(()=>{}),v.removeQueries({queryKey:[`github`,`comments`],predicate:e=>e.queryHash!==w(n)})},onError:e=>_(e.message,{tone:`danger`})}),T=h(),E=g(),O=S(),[k,P]=(0,X.useState)(()=>et().workflow),[F,te]=(0,X.useState)(()=>et().skills),[I,ne]=(0,X.useState)({runner:null,model:null});(0,X.useEffect)(()=>{tt({workflow:k,skills:[...F]})},[k,F]);let L=T.data?.workflows;(0,X.useEffect)(()=>{L&&k!==null&&!L.some(e=>e.name===k)&&P(null)},[L,k]);let re=E.data,R=O.data?.skillUsage,ie=(0,X.useMemo)(()=>ge(re??[],R),[re,R]),[z,B]=(0,X.useState)(new Map),[V,ae]=(0,X.useState)(``),[H,oe]=(0,X.useState)([]);if(!d)return a.isError?(0,Z.jsx)(`div`,{"data-route":`github`,className:`flex min-h-full flex-col`,children:(0,Z.jsx)(x,{icon:(0,Z.jsx)(N,{}),tone:`danger`,title:`Could not load GitHub`,subtitle:a.error.message})}):(0,Z.jsx)(se,{});if(b.current=null,!d.available)return(0,Z.jsx)(`div`,{"data-route":`github`,className:`flex min-h-full flex-col`,children:(0,Z.jsx)(x,{icon:(0,Z.jsx)(he,{}),tone:`neutral`,title:`GitHub is unavailable here`,subtitle:d.reason??`unknown reason`,actions:(0,Z.jsx)(m,{variant:`outline`,"data-action":`gh-retry`,disabled:C.isPending,onClick:()=>C.mutate(),children:`Try again`}),children:(0,Z.jsxs)(`p`,{className:`text-xs leading-relaxed text-soft-foreground`,children:[`The tab needs the `,(0,Z.jsx)(`span`,{className:`font-mono`,children:`gh`}),` CLI, logged in (`,(0,Z.jsx)(`span`,{className:`font-mono`,children:`gh auth login`}),`), and a repo with a GitHub remote. Everything else in cezar works without it.`]})})});let U=e===`issues`?d.issues:d.prs,W=d.labelColors??{},ce=Je(U),G=Ye(U,{query:V,labels:H}),le=V.trim()!==``||H.length>0,K=n===void 0?null:Number.parseInt(n,10),q=K===null?G[0]??null:U.find(e=>e.number===K)??null;b.current=q?{kind:q.kind,number:q.number}:null;let J=e===`issues`?`/github`:`/github/prs`;return(0,Z.jsxs)(`div`,{"data-route":`github`,className:`flex h-full min-h-0 items-stretch`,children:[(0,Z.jsxs)(`section`,{"data-slot":`gh-list`,className:D(`w-full min-h-0 flex-col overflow-y-auto overscroll-contain border-border md:flex md:w-[360px] md:shrink-0 md:border-r`,n===void 0?`flex`:`hidden`),children:[(0,Z.jsxs)(`header`,{"data-slot":`gh-header`,className:`sticky top-0 z-10 border-b border-border bg-background/95 px-4 pt-3 backdrop-blur`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,Z.jsx)(`h1`,{className:`text-lg font-semibold`,children:`GitHub`}),d.repo?(0,Z.jsx)(`span`,{"data-slot":`gh-repo`,className:`min-w-0 truncate font-mono text-[11px] text-soft-foreground`,children:d.repo}):null,(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`gh-refresh`,title:`Refresh from GitHub`,disabled:C.isPending,onClick:()=>C.mutate(),className:`ml-auto flex shrink-0 items-center gap-1 rounded-full border border-border px-1.5 py-px text-[10px] font-medium text-soft-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-55`,children:[(0,Z.jsx)(M,{"aria-hidden":`true`,className:D(`size-[9px]`,C.isPending&&`motion-safe:animate-spin`)}),d.syncedAt?`synced ${Y(d.syncedAt)} ago`:`refresh`]})]}),(0,Z.jsxs)(`div`,{"data-slot":`gh-tabs`,className:`mt-2.5 flex items-end gap-1`,children:[(0,Z.jsxs)(A,{to:`/github`,active:e===`issues`,onClick:()=>y(`issues`),children:[`Issues · `,ft(d.issues.length,p)]}),(0,Z.jsxs)(A,{to:`/github/prs`,active:e===`prs`,onClick:()=>y(`prs`),children:[`Pull requests · `,ft(d.prs.length,p)]})]}),(0,Z.jsxs)(`div`,{className:`mt-2.5 flex items-center gap-2 pb-3`,children:[(0,Z.jsxs)(`div`,{className:`relative min-w-0 flex-1`,children:[(0,Z.jsx)(xe,{"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-soft-foreground`}),(0,Z.jsx)(`input`,{type:`search`,"data-slot":`gh-search`,"aria-label":`Search ${e}`,placeholder:`Search #id, title, author…`,value:V,onChange:e=>ae(e.target.value),className:`w-full rounded-md border border-input bg-card py-1 pr-2 pl-7 text-[13px] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`})]}),(0,Z.jsx)(mt,{options:ce,colors:W,selected:H,onChange:oe})]})]}),G.length===0?(0,Z.jsx)(`p`,{className:`px-4 py-4 text-sm text-soft-foreground`,children:le?`No ${e===`issues`?`issues`:`pull requests`} match your filter.`:`No open ${e===`issues`?`issues`:`pull requests`}.`}):(0,Z.jsx)(`ul`,{"data-slot":`gh-rows`,className:`flex flex-col gap-0.5 px-2 py-2`,children:G.map(t=>(0,Z.jsx)(pt,{item:t,view:e,colors:W,active:q?.url===t.url,queued:z.has(t.url)},t.url))})]}),(0,Z.jsx)(`section`,{"data-slot":`gh-detail`,className:D(`min-w-0 min-h-0 flex-1 flex-col overflow-y-auto overscroll-contain`,n===void 0?`hidden md:flex`:`flex`),children:q?(0,Z.jsx)(gt,{item:q,listPath:J,colors:W,changes:t,children:(0,Z.jsx)(at,{item:q,workflows:T.data?.workflows??[],skills:ie,workflow:k,onWorkflowChange:P,selectedSkills:F,onSkillsChange:te,engine:I,onEngineChange:ne,queuedRunId:z.get(q.url)??null,onQueued:(e,t)=>B(n=>new Map(n).set(e,t))},q.url)}):(0,Z.jsx)(x,{icon:e===`issues`?(0,Z.jsx)(Le,{}):(0,Z.jsx)(j,{}),tone:`neutral`,heading:`h2`,title:K===null?`Nothing selected`:`Not in the open list`,subtitle:K===null?`No open ${e===`issues`?`issues`:`pull requests`} to show.`:`#${K} is not among the open ${e===`issues`?`issues`:`pull requests`} — it may be closed, or still outside the fetched batch.`})})]})}function ft(e,t){return`${e}${!t&&e>=ct?`+`:``}`}function pt({item:e,view:t,colors:n,active:r,queued:i}){let a=e.kind===`issue`?Le:j;return(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(I,{to:`${t===`issues`?`/github/issues`:`/github/prs`}/${e.number}`,draggable:!0,onDragStart:t=>{try{t.dataTransfer.setData(`text/plain`,Ve(e)),t.dataTransfer.effectAllowed=`copy`}catch{}},"data-slot":`gh-row`,"data-number":e.number,"aria-current":r?`page`:void 0,title:`Drag into the composer to prefill a task`,className:D(`flex flex-col gap-1 rounded-md px-2.5 py-2 transition-colors hover:bg-muted`,r&&`bg-muted`),children:[(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Z.jsx)(a,{"aria-hidden":`true`,className:D(`size-3.5 shrink-0`,e.kind===`issue`?`text-success`:`text-violet`)}),(0,Z.jsx)(`span`,{className:D(`min-w-0 truncate text-[13px] font-medium`,r&&`font-semibold`),children:e.title})]}),(0,Z.jsxs)(`span`,{className:`flex items-center gap-2 pl-[22px] font-mono text-[10.5px] text-muted-foreground`,children:[(0,Z.jsxs)(`span`,{children:[`#`,e.number]}),(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:e.author}),(0,Z.jsx)(`span`,{children:Y(e.createdAt)}),(0,Z.jsx)(Mt,{count:e.comments}),e.checks?(0,Z.jsx)(Pt,{checks:e.checks}):null,i?(0,Z.jsx)(`span`,{"data-slot":`gh-queued-flag`,className:`font-sans font-medium text-violet`,children:`↗ run queued`}):null]}),e.labels.length>0?(0,Z.jsx)(`span`,{className:`flex flex-wrap gap-1 pl-[22px]`,children:e.labels.map(e=>(0,Z.jsx)(ht,{label:e,color:n[e]},e))}):null]})})}function mt({options:e,colors:t,selected:n,onChange:r}){let[i,a]=(0,X.useState)(!1),o=e=>r(n.includes(e)?n.filter(t=>t!==e):[...n,e]);return(0,Z.jsxs)(q,{open:i,onOpenChange:a,children:[(0,Z.jsx)(B,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`gh-label-filter`,disabled:e.length===0,className:D(`flex shrink-0 items-center gap-1 rounded-md border border-input bg-card px-2 py-1 text-[12px] font-medium text-muted-foreground transition-colors hover:text-foreground disabled:opacity-50`,n.length>0&&`border-primary/60 text-foreground`),children:[(0,Z.jsx)(ze,{"aria-hidden":`true`,className:`size-3.5`}),n.length>0?`Labels · ${n.length}`:`Labels`]})}),(0,Z.jsx)(de,{align:`end`,sideOffset:6,className:`w-60 p-0`,children:(0,Z.jsxs)(Te,{children:[(0,Z.jsx)(fe,{placeholder:`Filter labels…`}),(0,Z.jsxs)(U,{className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[(0,Z.jsx)(K,{children:`No labels.`}),n.length>0?(0,Z.jsxs)(V,{value:`__clear__`,onSelect:()=>r([]),className:`text-soft-foreground`,children:[`Clear `,n.length,` filter`,n.length>1?`s`:``]}):null,e.map(e=>{let r=n.includes(e);return(0,Z.jsxs)(V,{value:e,onSelect:()=>o(e),children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`size-2.5 shrink-0 rounded-full border`,style:Xe(t[e])}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e}),r?(0,Z.jsx)(y,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}):null]},e)})]})]})})]})}function ht({label:e,color:t}){return(0,Z.jsx)(`span`,{"data-slot":`gh-label`,"data-label":e,style:Xe(t),className:`rounded-full border px-1.5 py-px text-[10px] font-medium`,children:e})}function gt({item:e,listPath:t,colors:n,children:r,changes:i}){let a=e.kind===`pr`?`pull request`:`issue`,o=e.kind===`pr`&&!!(e.additions||e.deletions);return(0,Z.jsxs)(`article`,{"data-slot":`gh-detail-inner`,className:`min-w-0 px-4 py-4 md:px-7 md:py-5`,children:[(0,Z.jsxs)(I,{to:t,"data-slot":`gh-back`,className:`mb-3 inline-flex items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground md:hidden`,children:[(0,Z.jsx)(O,{"aria-hidden":`true`,className:`size-3.5`}),`Back to the list`]}),(0,Z.jsxs)(`p`,{"data-slot":`gh-meta`,className:`flex flex-wrap items-center gap-x-1.5 font-mono text-[10.5px] text-soft-foreground`,children:[(0,Z.jsxs)(`span`,{children:[`#`,e.number]}),`·`,(0,Z.jsx)(`span`,{children:a}),`·`,(0,Z.jsxs)(`span`,{children:[`opened by `,e.author]}),`·`,(0,Z.jsxs)(`span`,{children:[Y(e.createdAt),` ago`]}),e.comments?(0,Z.jsxs)(Z.Fragment,{children:[`·`,(0,Z.jsx)(Mt,{count:e.comments})]}):null,o?(0,Z.jsxs)(Z.Fragment,{children:[`·`,(0,Z.jsxs)(`span`,{"data-slot":`gh-diffstat`,children:[(0,Z.jsxs)(`span`,{className:`text-success`,children:[`+`,e.additions??0]}),` `,(0,Z.jsxs)(`span`,{className:`text-danger`,children:[`−`,e.deletions??0]})]})]}):null,`·`,T(e.url)?(0,Z.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-open-link`,className:`inline-flex items-center gap-0.5 text-muted-foreground hover:text-foreground hover:underline`,children:[`open on GitHub`,(0,Z.jsx)(k,{"aria-hidden":`true`,className:`size-2.5`})]}):(0,Z.jsx)(`span`,{"data-slot":`gh-open-link`,className:`text-muted-foreground`,children:`open on GitHub`})]}),(0,Z.jsx)(`h2`,{className:`mt-2 text-xl leading-snug font-semibold`,children:e.title}),e.kind===`pr`?(0,Z.jsxs)(`nav`,{"aria-label":`Pull request detail`,className:`mt-4 flex border-b border-border`,children:[(0,Z.jsx)(A,{to:`/github/prs/${e.number}`,active:!i,children:`Conversation`}),(0,Z.jsx)(A,{to:`/github/prs/${e.number}/changes`,active:i,children:`Changes`})]}):null,e.labels.length>0||e.checks?(0,Z.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-1.5`,children:[e.labels.map(e=>(0,Z.jsx)(ht,{label:e,color:n[e]},e)),e.checks?(0,Z.jsx)(Nt,{checks:e.checks,url:e.url}):null]}):null,i&&e.kind===`pr`?(0,Z.jsx)(vt,{item:e}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{"data-slot":`gh-body`,className:`mt-5 text-sm`,children:e.body?(0,Z.jsx)(Me,{children:e.body}):(0,Z.jsx)(`p`,{className:`text-soft-foreground`,children:`(no description)`})}),(0,Z.jsx)(yt,{item:e,colors:n}),e.kind===`pr`?(0,Z.jsx)(_t,{number:e.number}):null,r]})]})}var $={squash:`Squash and merge`,merge:`Create a merge commit`,rebase:`Rebase and merge`};function _t({number:e}){let t=c(),n=v({queryKey:r.githubMergeState(e),queryFn:({signal:t})=>p(e,{},{signal:t}),retry:!1}),a=n.data?.available?n.data.mergeState:null,[o,s]=(0,X.useState)(null),[l,u]=(0,X.useState)(!1),d=i({mutationFn:()=>p(e,{refresh:!0}),onSuccess:n=>t.setQueryData(r.githubMergeState(e),n),onError:e=>_(e instanceof Error?e.message:String(e),{tone:`danger`})}),f=o&&a?.methods.includes(o)?o:a?.defaultMethod??a?.methods[0]??null,h=i({mutationFn:()=>{if(!a||!f)throw Error(`No merge method is available.`);return b(e,{method:f,expectedHeadSha:a.headSha})},onSuccess:()=>{u(!1),_(`Pull request #${e} merged`),t.invalidateQueries({queryKey:r.githubMergeState(e)}),t.invalidateQueries({queryKey:r.github({})}),t.invalidateQueries({queryKey:r.github({limit:lt})}),t.invalidateQueries({queryKey:r.githubComments(`pr`,e)})},onError:n=>{_(n instanceof Error?n.message:String(n),{tone:`danger`}),t.invalidateQueries({queryKey:r.githubMergeState(e)})}});if(n.isPending)return(0,Z.jsx)(Q,{"data-slot":`gh-merge-loading`,className:`mt-6 h-32 w-full`});if(!a)return(0,Z.jsxs)(`section`,{"data-slot":`gh-merge-unavailable`,className:`mt-6 rounded-lg border border-border bg-card p-4 text-sm`,children:[(0,Z.jsx)(`p`,{className:`font-medium`,children:`Merge status unavailable`}),(0,Z.jsx)(`p`,{className:`mt-1 text-xs text-soft-foreground`,children:n.data?.available===!1?n.data.reason:`GitHub could not load merge requirements.`})]});let g=a.state===`merged`?`Merged`:a.state===`closed`?`Closed`:a.isDraft?`Draft`:a.mergeable===`conflicting`?`Conflicts must be resolved`:a.canMerge?`Ready to merge`:`Merge blocked`;return(0,Z.jsxs)(`section`,{"data-slot":`gh-merge-box`,"aria-live":`polite`,className:`mt-6 rounded-lg border border-border bg-card p-4`,children:[(0,Z.jsxs)(`div`,{className:`flex items-start gap-3`,children:[a.canMerge?(0,Z.jsx)(y,{"aria-hidden":`true`,className:`mt-0.5 size-5 shrink-0 text-success`}):(0,Z.jsx)(N,{"aria-hidden":`true`,className:`mt-0.5 size-5 shrink-0 text-warning`}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Z.jsx)(`h3`,{className:`font-semibold`,children:g}),(0,Z.jsxs)(m,{type:`button`,variant:`ghost`,size:`sm`,disabled:d.isPending,onClick:()=>d.mutate(),children:[(0,Z.jsx)(M,{"aria-hidden":`true`,className:D(`size-3.5`,d.isPending&&`animate-spin`)}),`Refresh`]})]}),(0,Z.jsxs)(`p`,{className:`mt-1 font-mono text-[11px] text-soft-foreground`,children:[a.headRef,` (`,a.headSha.slice(0,7),`) → `,a.baseRef]}),(0,Z.jsxs)(`ul`,{className:`mt-3 space-y-2 text-xs`,children:[(0,Z.jsxs)(`li`,{children:[`Reviews: `,a.reviewDecision.replaceAll(`-`,` `)]}),(0,Z.jsxs)(`li`,{children:[`Conflicts: `,a.mergeable===`conflicting`?`present`:a.mergeable===`mergeable`?`none`:`unknown`]}),a.checks.length===0?(0,Z.jsx)(`li`,{children:`No checks configured`}):a.checks.map(e=>(0,Z.jsxs)(`li`,{className:`flex items-center justify-between gap-3`,children:[(0,Z.jsxs)(`span`,{children:[e.name,` · `,e.state,e.required===!0?` · required`:e.required===null?` · requiredness unknown`:``]}),e.url&&T(e.url)?(0,Z.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`text-muted-foreground underline`,children:`details`}):null]},e.name)),a.blockers.map(e=>(0,Z.jsx)(`li`,{className:`text-soft-foreground`,children:e.message},e.code))]}),a.state===`open`&&a.methods.length>0?(0,Z.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2 sm:flex-row`,children:[(0,Z.jsx)(`select`,{"aria-label":`Merge method`,value:f??``,onChange:e=>s(e.target.value),className:`h-9 min-w-0 flex-1 rounded-md border border-input bg-background px-3 text-sm`,children:a.methods.map(e=>(0,Z.jsx)(`option`,{value:e,children:$[e]},e))}),(0,Z.jsx)(m,{disabled:!a.canMerge||!f,onClick:()=>u(!0),children:f?$[f]:`Merge`})]}):null]})]}),(0,Z.jsx)(L,{open:l,onOpenChange:u,children:(0,Z.jsxs)(ye,{"data-slot":`gh-merge-confirm`,showCloseButton:!1,children:[(0,Z.jsxs)(be,{children:[(0,Z.jsxs)(ae,{children:[f?$[f]:`Merge`,` pull request #`,e,`?`]}),(0,Z.jsxs)(oe,{children:[`This will merge “`,a.title,`” into `,a.baseRef,`. GitHub will re-check the exact reviewed head before changing the repository.`]})]}),h.error?(0,Z.jsx)(`p`,{className:`text-sm text-danger`,children:h.error.message}):null,(0,Z.jsxs)(ve,{children:[(0,Z.jsx)(m,{variant:`outline`,disabled:h.isPending,onClick:()=>u(!1),children:`Cancel`}),(0,Z.jsx)(m,{disabled:h.isPending,onClick:()=>h.mutate(),children:h.isPending?`Merging…`:f?$[f]:`Merge`})]})]})})]})}function vt({item:e}){let t=c(),n=C(e.number),[r,i]=(0,X.useState)(``),[a,o]=(0,X.useState)(null),s=n.data,l=s?.available?s.files.filter(e=>e.path.toLowerCase().includes(r.toLowerCase())):[],u=l.findIndex(e=>e.path===a);(0,X.useEffect)(()=>{l.length>0&&!l.some(e=>e.path===a)&&o(l[0].path)},[s?.available?s.headSha:``,r]);let f=async()=>{let n=s?.available?s.headSha:null,r=await d(e.number,{refresh:!0});t.setQueryData([`github`,`pr-changes`,e.number],r),r.available&&n&&n!==r.headSha&&(o(r.files[0]?.path??null),_(`The reviewed revision changed.`))};if(n.isPending)return(0,Z.jsx)(`p`,{"aria-live":`polite`,className:`mt-6 text-sm text-muted-foreground`,children:`Loading changed files…`});if(n.isError||!s)return(0,Z.jsx)(`p`,{className:`mt-6 text-sm text-danger`,children:`Changed files could not be loaded.`});if(!s.available)return(0,Z.jsx)(`p`,{className:`mt-6 text-sm text-muted-foreground`,children:s.reason});let p=l.map(e=>({path:e.path,...e.previousPath?{oldPath:e.previousPath}:{},status:e.status===`removed`?`deleted`:e.status===`changed`?`modified`:e.status,adds:e.additions,dels:e.deletions,binary:e.patchUnavailableReason===`binary`,patch:e.patch??``})),h=T(e.url)?`${e.url}/files`:null,g=l.find(e=>e.path===a);return(0,Z.jsxs)(`section`,{"data-slot":`gh-pr-changes`,className:`mt-5 min-w-0`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[(0,Z.jsxs)(`strong`,{children:[s.files.length,` changed files`]}),(0,Z.jsxs)(`span`,{className:`text-success`,children:[`+`,s.additions]}),(0,Z.jsxs)(`span`,{className:`text-danger`,children:[`−`,s.deletions]}),(0,Z.jsxs)(`span`,{className:`font-mono text-muted-foreground`,title:s.headSha,children:[`head `,s.headSha.slice(0,8)]}),(0,Z.jsx)(m,{type:`button`,variant:`outline`,size:`sm`,className:`ml-auto min-h-11`,onClick:()=>void f(),children:`Refresh`})]}),s.truncated?(0,Z.jsxs)(`p`,{role:`status`,className:`mt-3 rounded-md border border-warning/40 bg-warning/10 p-3 text-xs`,children:[s.reason??`This response is incomplete.`,` `,h?(0,Z.jsx)(`a`,{href:h,target:`_blank`,rel:`noopener noreferrer`,className:`underline`,children:`Open all files on GitHub`}):null]}):null,(0,Z.jsxs)(`div`,{className:`mt-4 grid min-w-0 gap-4 lg:grid-cols-[240px_minmax(0,1fr)]`,children:[(0,Z.jsxs)(`aside`,{className:`min-w-0`,children:[(0,Z.jsx)(`input`,{"aria-label":`Filter changed files`,value:r,onChange:e=>i(e.target.value),placeholder:`Filter files…`,className:`min-h-11 w-full rounded-md border border-input bg-background px-3 text-sm`}),(0,Z.jsx)(`select`,{"aria-label":`Select changed file`,value:a??``,onChange:e=>o(e.target.value),className:`mt-2 min-h-11 w-full rounded-md border border-input bg-background px-2 text-sm lg:hidden`,children:l.map(e=>(0,Z.jsx)(`option`,{children:e.path},e.path))}),(0,Z.jsx)(`ul`,{className:`mt-2 hidden max-h-[60vh] overflow-auto lg:block`,children:l.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>o(e.path),className:D(`min-h-11 w-full truncate rounded px-2 text-left text-xs`,a===e.path&&`bg-muted font-medium`),title:e.path,children:[e.status,` · `,e.path,` `,(0,Z.jsxs)(`span`,{className:`text-success`,children:[`+`,e.additions]}),` `,(0,Z.jsxs)(`span`,{className:`text-danger`,children:[`−`,e.deletions]})]})},e.path))})]}),(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[(0,Z.jsxs)(`div`,{className:`mb-2 flex justify-end gap-1`,children:[(0,Z.jsx)(m,{"aria-label":`Previous file`,variant:`outline`,size:`icon`,className:`min-h-11 min-w-11`,disabled:u<=0,onClick:()=>o(l[u-1]?.path??null),children:(0,Z.jsx)(Ie,{})}),(0,Z.jsx)(m,{"aria-label":`Next file`,variant:`outline`,size:`icon`,className:`min-h-11 min-w-11`,disabled:u<0||u>=l.length-1,onClick:()=>o(l[u+1]?.path??null),children:(0,Z.jsx)(Se,{})})]}),l.length===0?(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No changed files match this filter.`}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Fe,{files:p.filter(e=>e.path===a),wrap:!0,className:`min-w-0`}),g&&!g.patch?(0,Z.jsxs)(`p`,{className:`rounded-b border border-border p-3 text-xs text-muted-foreground`,children:[`Patch unavailable: `,g.patchUnavailableReason??`not-provided`,`.`]}):null]})]})]})]})}function yt({item:e,colors:t}){let n=u(e.kind,e.number),r=n.data,i=(0,X.useMemo)(()=>{let e=[...(r?.comments??[]).map(e=>({row:`comment`,comment:e})),...(r?.events??[]).map(e=>({row:`event`,event:e}))],t=e=>{let t=Date.parse(bt(e));return Number.isNaN(t)?-1/0:t};return e.sort((e,n)=>t(e)-t(n))},[r?.comments,r?.events]);return n.isPending?(0,Z.jsxs)(`section`,{"data-slot":`gh-thread-loading`,className:`mt-6 border-t border-border pt-5`,children:[(0,Z.jsx)(Q,{className:`mb-3 h-3 w-24`}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Z.jsx)(Q,{className:`h-14 w-full`}),(0,Z.jsx)(Q,{className:`h-14 w-full`})]})]}):!r||!r.available?(0,Z.jsxs)(`section`,{"data-slot":`gh-thread-error`,className:`mt-6 border-t border-border pt-5 text-xs text-soft-foreground`,children:[(0,Z.jsxs)(`span`,{children:[`Couldn’t load comments — `,r?.reason??(n.error instanceof Error?n.error.message:`could not load comments`),`. `]}),(0,Z.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-0.5 text-muted-foreground hover:text-foreground hover:underline`,children:[`open on GitHub`,(0,Z.jsx)(k,{"aria-hidden":`true`,className:`size-2.5`})]})]}):i.length===0?null:(0,Z.jsxs)(`section`,{"data-slot":`gh-thread`,className:`mt-6 border-t border-border pt-5`,children:[(0,Z.jsxs)(`h3`,{"data-slot":`gh-thread-header`,className:`mb-4 text-[11px] font-semibold tracking-wide text-soft-foreground uppercase`,children:[`Activity · `,r.comments.length,` comment`,r.comments.length===1?``:`s`]}),(0,Z.jsx)(`ul`,{className:`flex flex-col gap-5`,children:xt(i).map(e=>e.group===`commits`?(0,Z.jsx)(St,{commits:e.commits,colors:t},e.commits[0].id):e.entry.row===`comment`?(0,Z.jsx)(Ot,{comment:e.entry.comment},`${e.entry.comment.kind}-${e.entry.comment.id}`):(0,Z.jsx)(wt,{event:e.entry.event,colors:t},e.entry.event.id))}),r.truncated?(0,Z.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-thread-truncated`,className:`mt-4 inline-flex items-center gap-0.5 text-xs text-soft-foreground hover:text-foreground hover:underline`,children:[`thread truncated — open on GitHub`,(0,Z.jsx)(k,{"aria-hidden":`true`,className:`size-2.5`})]}):null]})}var bt=e=>e.row===`comment`?e.comment.createdAt:e.event.createdAt;function xt(e){let t=[],n=[],r=()=>{n.length!==0&&(n.length===1?t.push({group:`single`,entry:{row:`event`,event:n[0]}}):t.push({group:`commits`,commits:n}),n=[])};for(let i of e){if(i.row===`event`&&i.event.kind===`committed`&&i.row===`event`){let e=n[n.length-1];e&&e.actor!==i.event.actor&&r(),n.push(i.event);continue}r(),t.push({group:`single`,entry:i})}return r(),t}function St({commits:e,colors:t}){let[n,r]=(0,X.useState)(!1),i=e[0]?.actor??`?`;return n?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`li`,{"data-slot":`gh-commit-group`,"data-open":`true`,className:`min-w-0`,children:(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":!0,onClick:()=>r(!1),className:`flex items-center gap-1.5 font-mono text-[11px] text-soft-foreground hover:text-foreground`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:Ct.committed}),(0,Z.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:i}),(0,Z.jsxs)(`span`,{children:[`added `,e.length,` commits`]})]})}),e.map(e=>(0,Z.jsx)(wt,{event:e,colors:t},e.id))]}):(0,Z.jsx)(`li`,{"data-slot":`gh-commit-group`,"data-open":`false`,className:`min-w-0`,children:(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":!1,onClick:()=>r(!0),className:`flex items-center gap-1.5 font-mono text-[11px] text-soft-foreground hover:text-foreground`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:Ct.committed}),(0,Z.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:i}),(0,Z.jsxs)(`span`,{children:[`added `,e.length,` commits`]}),(0,Z.jsx)(`span`,{className:`shrink-0`,children:Y(e[e.length-1].createdAt)})]})})}var Ct={committed:`⚙`,labeled:`◆`,unlabeled:`◇`,assigned:`◍`,unassigned:`◌`,merged:`⑃`,closed:`⊘`,reopened:`⊙`,head_ref_force_pushed:`↻`,"cross-referenced":`↗`,renamed:`✎`};function wt({event:e,colors:t}){return(0,Z.jsxs)(`li`,{"data-slot":`gh-event-row`,"data-kind":e.kind,className:D(`flex min-w-0 items-center gap-1.5 font-mono text-[11px] text-soft-foreground`,e.kind===`merged`&&`text-accent-foreground`),children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0`,children:Ct[e.kind]}),(0,Z.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:e.actor}),(0,Z.jsx)(Tt,{event:e,colors:t}),(0,Z.jsx)(`span`,{className:`shrink-0`,children:Y(e.createdAt)}),e.url?(0,Z.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`open ${e.kind} on GitHub`,className:`ml-auto shrink-0 text-muted-foreground hover:text-foreground`,children:(0,Z.jsx)(k,{"aria-hidden":`true`,className:`size-2.5`})}):null]})}function Tt({event:e,colors:t}){switch(e.kind){case`committed`:return(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`shrink-0`,children:`committed`}),e.sha?(0,Z.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e.sha.slice(0,7)}):null,e.message?(0,Z.jsx)(`span`,{className:`truncate font-sans text-foreground`,children:e.message}):null,(0,Z.jsx)(Et,{checks:e.checks})]});case`labeled`:case`unlabeled`:return(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`shrink-0`,children:e.kind===`labeled`?`added the`:`removed the`}),e.label?(0,Z.jsx)(`span`,{"data-slot":`gh-event-label`,style:Xe(e.label.color??t[e.label.name]),className:`max-w-[12rem] truncate rounded-full border px-1.5 py-px font-sans text-[10px]`,children:e.label.name}):null,(0,Z.jsx)(`span`,{className:`shrink-0`,children:`label`})]});case`assigned`:case`unassigned`:return(0,Z.jsxs)(`span`,{className:`truncate`,children:[e.kind===`assigned`?`assigned`:`unassigned`,` `,e.subject??`someone`]});case`merged`:return(0,Z.jsx)(`span`,{children:`merged this`});case`closed`:return(0,Z.jsx)(`span`,{children:`closed this`});case`reopened`:return(0,Z.jsx)(`span`,{children:`reopened this`});case`head_ref_force_pushed`:return(0,Z.jsx)(`span`,{children:`force-pushed`});case`renamed`:return(0,Z.jsxs)(`span`,{className:`truncate`,children:[`renamed this to `,e.subject??`—`]});case`cross-referenced`:return(0,Z.jsxs)(`span`,{className:`truncate`,children:[`referenced this in `,e.refNumber?`#${e.refNumber}`:`another thread`,e.refTitle?` ${e.refTitle}`:``]})}}function Et({checks:e}){return e?(0,Z.jsx)(`span`,{"data-slot":`gh-commit-checks`,"data-checks":e,"aria-label":`checks ${e}`,className:D(`shrink-0`,jt[e]),children:At[e]}):null}var Dt={approved:{label:`approved`,tone:`border-success/40 text-success`},changes_requested:{label:`changes requested`,tone:`border-danger/40 text-danger`},commented:{label:`commented`,tone:`border-border text-muted-foreground`},dismissed:{label:`dismissed`,tone:`border-border text-muted-foreground`}};function Ot({comment:e}){let t=e.reviewState?Dt[e.reviewState]:null;return(0,Z.jsxs)(`li`,{"data-slot":`gh-thread-entry`,"data-kind":e.kind,className:`min-w-0`,children:[(0,Z.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1.5 font-mono text-[11px] text-soft-foreground`,children:[(0,Z.jsx)(kt,{url:e.avatarUrl,login:e.author}),(0,Z.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:e.author}),(0,Z.jsx)(`span`,{children:Y(e.createdAt)}),t?(0,Z.jsx)(`span`,{"data-slot":`gh-review-chip`,"data-review-state":e.reviewState,className:D(`rounded-full border px-1.5 py-px font-sans text-[10px] font-medium`,t.tone),children:t.label}):null,(0,Z.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`open comment on GitHub`,className:`ml-auto shrink-0 text-muted-foreground hover:text-foreground`,children:(0,Z.jsx)(k,{"aria-hidden":`true`,className:`size-2.5`})})]}),(0,Z.jsx)(`div`,{"data-slot":`gh-thread-body`,className:`text-sm`,children:e.body?(0,Z.jsx)(Me,{children:e.body}):(0,Z.jsx)(`p`,{className:`text-soft-foreground`,children:`(no body)`})})]})}function kt({url:e,login:t}){let[n,r]=(0,X.useState)(!1);return e&&!n?(0,Z.jsx)(`img`,{src:e,alt:``,width:16,height:16,loading:`lazy`,onError:()=>r(!0),"data-slot":`gh-avatar`,className:`size-4 shrink-0 rounded-full`}):(0,Z.jsx)(`span`,{"data-slot":`gh-avatar-fallback`,"aria-hidden":`true`,className:`flex size-4 shrink-0 items-center justify-center rounded-full bg-muted text-[8px] font-semibold text-muted-foreground uppercase`,children:t.slice(0,1)||`?`})}var At={passing:`✓`,failing:`✗`,pending:`○`},jt={passing:`text-success`,failing:`text-danger`,pending:`text-muted-foreground`};function Mt({count:e}){return e?(0,Z.jsxs)(`span`,{"data-slot":`gh-comment-count`,"data-count":e,"aria-label":`${e} comment${e===1?``:`s`}`,className:`inline-flex shrink-0 items-center gap-0.5`,children:[(0,Z.jsx)(Re,{"aria-hidden":`true`,className:`size-3`}),e]}):null}function Nt({checks:e,url:t}){let n=D(`text-[11px] font-medium`,jt[e],t&&`hover:underline`),r=`${At[e]} checks ${e}`;return t?(0,Z.jsx)(`a`,{href:`${t}/checks`,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-checks`,"data-checks":e,className:n,children:r}):(0,Z.jsx)(`span`,{"data-slot":`gh-checks`,"data-checks":e,className:n,children:r})}function Pt({checks:e}){return(0,Z.jsx)(`span`,{"data-slot":`gh-row-checks`,"data-checks":e,title:`checks ${e}`,"aria-label":`checks ${e}`,className:D(`shrink-0 font-sans text-[11px] font-semibold`,jt[e]),children:At[e]})}export{ut as GithubIndexRoute,dt as GithubRoute};
|
|
1
|
+
import{a as e,s as t,u as n}from"./bundle-mjs-BegPhL5c.js";import{A as r,An as i,Ft as a,Ht as o,L as s,Nn as c,On as l,R as u,Ut as d,Vt as f,Wt as p,a as m,bt as h,ht as g,i as _,jn as v,k as y,qt as b,rn as ee,t as x,vt as S,z as C,zn as w}from"./centered-state-DC3UgTEo.js";import{n as T,r as E,t as D}from"./utils-B8xGEgP3.js";import{t as O}from"./arrow-left-BmHnLe4M.js";import{n as k,t as A}from"./tab-link-CoNQGOQ7.js";import{t as j}from"./git-pull-request-BvjQwr12.js";import{t as M}from"./refresh-cw-BgVxWSof.js";import{t as N}from"./triangle-alert-CHtGkjPK.js";import{n as P,t as F}from"./textarea-BhdkPlu6.js";import{r as te,t as I}from"./project-router-C87COYR7.js";import{A as ne,Bt as L,Ct as re,D as R,E as ie,Et as z,F as B,Ft as V,Gt as ae,H,Ht as oe,It as U,J as se,Jt as W,Kt as ce,L as G,M as le,Mt as K,N as q,Nt as J,O as ue,P as de,Pt as fe,Qt as pe,R as me,Rt as he,St as ge,Tt as _e,Ut as ve,Vt as ye,Wt as be,Yt as xe,an as Se,bt as Ce,j as we,jt as Te,k as Ee,kt as Y,on as De,qt as Oe,rn as ke,vt as Ae,wt as je,x as Me,y as Ne,z as Pe}from"./index-B4FnnuuW.js";import{t as Fe}from"./diff-Cru108Ob.js";var Ie=E(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Le=E(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),Re=E(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),ze=E(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),X=n(t(),1),Z=e();function Q({className:e,...t}){return(0,Z.jsx)(`div`,{"data-slot":`skeleton`,className:D(`animate-pulse rounded-md bg-accent`,e),...t})}function Be(e){return`${e.kind===`pr`?`Address GitHub pull request`:`Fix GitHub issue`} #${e.number}: ${e.title}\n\n${e.url}`}function Ve(e,t=[]){let n=Be(e);return e.body?.trim()&&(n+=`\n\n---\n\n${e.body.trim()}`),t.length&&(n+=He(t)),n}function He(e){return`\n\nUse these skills where relevant: ${e.join(`, `)}.`}function Ue(e,t){return e.replace(/\{\{\s*number\s*\}\}/gi,()=>`#${t.number}`).replace(/\{\{\s*title\s*\}\}/gi,()=>t.title).replace(/\{\{\s*url\s*\}\}/gi,()=>t.url)}function We(e,t){if(e.includes(t.url))return!0;let n=t.kind===`pr`?String.raw`(?:pull\s+request|pr)`:String.raw`issue`;return new RegExp(String.raw`\b${n}\s*#?\s*${t.number}\b`,`i`).test(e)}function Ge(e,t,n){let r=(n??``).trim();if(!r)return Ve(e,t);let i=Be(e),a=r.startsWith(i)?i+Ue(r.slice(i.length),e):Ue(r,e),o=We(a,e)?a:`${i}\n\n${a}`;return t.length?o+He(t):o}function Ke(e){let t=[];for(let n of e.slice(0,8)){let e=new Set(t.map(e=>e.id)),r=n;for(let t=2;e.has(r);t++)r=`${n}-${t}`;t.push({id:r,name:n,skill:n,prompt:`{{task}}`})}return t}function qe(e,t,n,r,i={}){return t?{...i,workflow:t,task:Ge(e,n,r)}:n.length?{...i,steps:Ke(n),task:Ge(e,[],r)}:{...i,workflow:`quick-task`,task:Ge(e,[],r)}}function Je(e){let t=new Set;for(let n of e)for(let e of n.labels)t.add(e);return[...t].sort((e,t)=>e.toLowerCase().localeCompare(t.toLowerCase()))}function Ye(e,t={}){let n=(t.query??``).trim().toLowerCase(),r=t.labels??[],i=n.replace(/^#/,``),a=i!==``&&/^\d+$/.test(i);return e.filter(e=>r.length>0&&!r.every(t=>e.labels.includes(t))?!1:n===``?!0:a?String(e.number).includes(i):`#${e.number} ${e.title} ${e.author} ${e.body}`.toLowerCase().includes(n))}function Xe(e){if(!e||!/^[0-9a-fA-F]{6}$/.test(e))return{borderColor:`var(--border)`,color:`var(--muted-foreground)`};let t=`#${e}`;return{backgroundColor:`${t}22`,borderColor:`${t}66`,color:`color-mix(in srgb, ${t} 50%, var(--foreground))`}}var Ze={workflow:null,skills:[]},Qe=`cez-followup-selection`;function $e(e){let t=e&&typeof e==`object`?e:{};return{workflow:typeof t.workflow==`string`?t.workflow:null,skills:Array.isArray(t.skills)?t.skills.filter(e=>typeof e==`string`):[]}}function et(){try{let e=localStorage.getItem(Qe);return e?$e(JSON.parse(e)):{...Ze}}catch{return{...Ze}}}function tt(e){try{localStorage.setItem(Qe,JSON.stringify(e))}catch{}}var nt=`cez-followup-prompt:`;function rt(e){try{return localStorage.getItem(nt+e)??``}catch{return``}}function it(e,t){try{t===``?localStorage.removeItem(nt+e):localStorage.setItem(nt+e,t)}catch{}}function at({item:e,workflows:t,skills:n,workflow:o,onWorkflowChange:s,selectedSkills:l,onSkillsChange:u,engine:d,onEngineChange:f,queuedRunId:p,onQueued:h}){let g=c(),v=S(),b=e.kind===`pr`?`PR`:`issue`,x=l.filter(e=>n.some(t=>t.name===e)),[C]=(0,X.useState)(()=>Be(e)),[w,T]=(0,X.useState)(()=>rt(e.url)||C),E=Pe(d),D=(0,X.useRef)(null);(0,X.useEffect)(()=>{it(e.url,w===C?``:w)},[e.url,w,C]);let O=(0,X.useMemo)(()=>ne(v.data?.promptTemplates),[v.data?.promptTemplates]),k=e=>{let t=D.current,n=w===C?w.length:t?.selectionStart??w.length,r=Ee(w,n,e);T(r.text),requestAnimationFrame(()=>{D.current?.focus(),D.current?.setSelectionRange(r.caret,r.caret)})},A=ue(O,x),j=(0,X.useRef)(w);j.current=w;let M=(0,X.useRef)(``);(0,X.useEffect)(()=>{let e=we(j.current,M.current,A,C);M.current=e.applied,e.text!==j.current&&T(e.text)},[A,C]);let N=i({mutationFn:async()=>E.canRun?a(qe(e,o,x,w,me(E))):null,onSuccess:t=>{if(t===null)return;let n=`runs`in t?t.runs[0]:t;n&&h(e.url,n.id),_(`Added to the queue — ${b} #${e.number}`),x.length>0&&v.data!==void 0&&ee({skillUsage:x.reduce((e,t)=>Ae(e,t),v.data.skillUsage)}).then(()=>g.invalidateQueries({queryKey:r.uiState})).catch(()=>{}),it(e.url,``),T(C),M.current=``,g.invalidateQueries({queryKey:r.runs.all})},onError:e=>_(e.message,{tone:`danger`})}),te=e=>{ie({key:e.key,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,repeat:e.repeat,isComposing:e.nativeEvent.isComposing})&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),!N.isPending&&E.canRun&&N.mutate())},L=e=>u(l.includes(e)?l.filter(t=>t!==e):[...l,e]);return(0,Z.jsxs)(`section`,{"data-slot":`gh-hand`,className:`mt-7 rounded-lg border border-border bg-card p-4`,children:[(0,Z.jsxs)(`h3`,{className:`flex items-center gap-1.5 text-[11px] font-semibold tracking-[.04em] text-soft-foreground uppercase`,children:[(0,Z.jsx)(ce,{"aria-hidden":`true`,className:`size-3.5 text-violet`}),`Hand this to the agent`]}),(0,Z.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(ot,{workflows:t,value:o,onChange:s}),(0,Z.jsx)(st,{skills:n,skillUsage:v.data?.skillUsage,selected:x,onToggle:L}),(0,Z.jsx)(G,{pick:d,onChange:f,disabled:N.isPending||!E.canRun}),!E.providerPending&&!E.canRun?(0,Z.jsxs)(`span`,{"data-slot":`gh-provider-gate`,className:`inline-flex flex-wrap items-center gap-1 text-xs text-muted-foreground`,children:[E.providerError?`Provider authentication could not be verified.`:`Connect an agent provider to run this item.`,(0,Z.jsx)(I,{to:`/settings/agents#providers`,className:`font-medium text-foreground underline underline-offset-4`,children:`Configure providers`})]}):null,(0,Z.jsx)(le,{templates:O,onInsert:k})]}),x.length>0?(0,Z.jsx)(`div`,{"data-slot":`gh-skill-chips`,className:`mt-2.5 flex flex-wrap gap-1.5`,children:x.map(e=>(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`gh-skill-chip`,"data-skill":e,onClick:()=>L(e),title:`Remove this skill`,className:`inline-flex items-center gap-1 rounded-full border border-border bg-muted px-2 py-px font-mono text-[11px] font-medium text-foreground transition-colors hover:bg-danger/10 hover:text-danger`,children:[e,(0,Z.jsx)(P,{"aria-hidden":`true`,className:`size-3`})]},e))}):null,(0,Z.jsx)(F,{ref:D,"data-slot":`gh-custom-prompt`,"aria-label":`Custom prompt`,"aria-keyshortcuts":`Control+Enter Meta+Enter`,value:w,onChange:e=>T(e.target.value),onKeyDown:te,placeholder:`Instructions for the agent… (#${e.number} and its link are always sent)`,className:`mt-3 min-h-20 text-[13px]`}),(0,Z.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-2.5`,children:[(0,Z.jsxs)(m,{variant:`contrast`,"data-action":`gh-run`,disabled:N.isPending||!E.canRun,onClick:()=>N.mutate(),children:[(0,Z.jsx)(pe,{"aria-hidden":`true`,className:`size-3.5`}),`Run agent on this `,b]}),(0,Z.jsx)(`kbd`,{"aria-hidden":`true`,className:`rounded-[5px] border border-b-2 border-border bg-card px-[5px] py-px font-mono text-[10.5px] font-medium text-muted-foreground`,children:R()}),p?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`span`,{"data-slot":`gh-queued`,className:`flex items-center gap-1 text-xs font-medium text-success`,children:[(0,Z.jsx)(y,{"aria-hidden":`true`,className:`size-3.5`}),`queued`]}),(0,Z.jsx)(I,{to:`/tasks/${p}`,"data-slot":`gh-view-run`,className:`text-xs font-semibold text-violet hover:underline`,children:`View task →`})]}):null]})]})}function ot({workflows:e,value:t,onChange:n}){let[r,i]=(0,X.useState)(!1),[a,o]=(0,X.useState)(``),s=(0,X.useRef)(null),c=_e(e,a);return(0,Z.jsxs)(q,{open:r,onOpenChange:e=>{i(e),e||o(``)},children:[(0,Z.jsx)(B,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`gh-workflow-trigger`,"aria-label":`Choose a workflow`,className:D(H,t&&`border-foreground/60 font-mono text-[11.5px] font-semibold text-foreground`),children:[(0,Z.jsx)(Oe,{"aria-hidden":`true`,className:`size-3 shrink-0 text-violet`}),(0,Z.jsx)(`span`,{className:`max-w-44 truncate`,children:t??`workflow`}),(0,Z.jsx)(De,{"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,Z.jsx)(de,{align:`start`,sideOffset:8,className:`w-[320px] max-w-[calc(100vw-2rem)] p-0`,children:(0,Z.jsxs)(Te,{shouldFilter:!1,children:[(0,Z.jsx)(fe,{placeholder:`search workflows…`,value:a,onValueChange:o,onInput:()=>s.current?.scrollTo(0,0)}),(0,Z.jsxs)(U,{ref:s,"data-slot":`gh-workflow-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[c.length===0?(0,Z.jsx)(K,{children:`Nothing matches.`}):null,(0,Z.jsx)(J,{children:c.map(e=>{let r=t===e.name;return(0,Z.jsxs)(V,{value:`workflow ${e.name}`,keywords:z(e.name,e.description),"data-slot":`gh-workflow-option`,"data-workflow":e.name,onSelect:()=>{n(r?null:e.name),i(!1)},children:[(0,Z.jsx)(`span`,{className:`shrink-0 font-mono text-xs`,children:e.name}),e.description?(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,r?(0,Z.jsx)(y,{"aria-hidden":`true`,className:`ml-auto size-3.5 shrink-0 text-primary`}):null]},e.name)})})]})]})})]})}function st({skills:e,skillUsage:t,selected:n,onToggle:r}){let[i,a]=(0,X.useState)(!1),[o,s]=(0,X.useState)(``),[c,l]=(0,X.useState)(null),u=(0,X.useRef)(null),{mostUsed:d,project:f,global:p}=re(je(e,o,t),t),m=(e,t)=>{let i=n.includes(e.name);return(0,Z.jsxs)(V,{value:`skill ${e.name} ${e.path}`,keywords:z(e.name,e.description),"data-slot":`gh-skill-option`,"data-skill":e.name,"data-selected":i?`true`:void 0,onSelect:()=>r(e.name),children:[(0,Z.jsx)(`span`,{className:D(`shrink-0 font-mono text-xs`,t&&`font-semibold`),children:e.name}),e.description?(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,(0,Z.jsx)(`button`,{type:`button`,"data-slot":`gh-skill-view`,"aria-label":`View skill ${e.name}`,title:`View skill`,onClick:t=>{t.preventDefault(),t.stopPropagation(),l(e)},className:`ml-auto shrink-0 rounded-sm p-0.5 text-soft-foreground transition-colors hover:text-foreground`,children:(0,Z.jsx)(ke,{"aria-hidden":`true`,className:`size-3.5`})}),i?(0,Z.jsx)(y,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}):null]},e.path)};return e.length===0?null:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Ne,{skill:c,onClose:()=>l(null)}),(0,Z.jsxs)(q,{open:i,onOpenChange:e=>{a(e),e||s(``)},children:[(0,Z.jsx)(B,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`gh-skills-trigger`,"aria-label":`Choose skills`,className:D(H,n.length>0&&`border-foreground/60 font-semibold text-foreground`),children:[(0,Z.jsx)(W,{"aria-hidden":`true`,className:`size-3 shrink-0 text-violet`}),`skills`,n.length>0?` · ${n.length}`:``,(0,Z.jsx)(De,{"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,Z.jsx)(de,{align:`start`,sideOffset:8,className:`w-[336px] max-w-[calc(100vw-2rem)] p-0`,children:(0,Z.jsxs)(Te,{shouldFilter:!1,children:[(0,Z.jsx)(fe,{placeholder:`search skills…`,value:o,onValueChange:s,onInput:()=>u.current?.scrollTo(0,0)}),(0,Z.jsxs)(U,{ref:u,"data-slot":`gh-skill-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[d.length===0&&f.length===0&&p.length===0?(0,Z.jsx)(K,{children:`Nothing matches.`}):null,d.length>0?(0,Z.jsx)(J,{heading:`Most used`,children:d.map(e=>m(e,Ce(e)))}):null,f.length>0?(0,Z.jsx)(J,{heading:`Project skills`,children:f.map(e=>m(e,!0))}):null,p.length>0?(0,Z.jsx)(J,{heading:`Global`,children:p.map(e=>m(e,!1))}):null]})]})})]})]})}var ct=30,lt=1e3;function ut(){return S().data?.githubView===`prs`?(0,Z.jsx)(te,{to:`/github/prs`,replace:!0}):(0,Z.jsx)(dt,{view:`issues`})}function dt({view:e,changes:t=!1}){let{n}=l(),a=s(),u=s({limit:lt},a.data?.available===!0),d=u.data?.available?u.data:a.data,p=u.data?.available===!0,v=c(),y=e=>{v.setQueryData(r.uiState,t=>({...t,githubView:e})),ee({githubView:e}).then(e=>v.setQueryData(r.uiState,e)).catch(e=>{_(e instanceof Error?e.message:String(e),{tone:`danger`}),v.invalidateQueries({queryKey:r.uiState})})},b=(0,X.useRef)(null),C=i({mutationFn:()=>f({refresh:!0}),onSuccess:e=>{v.setQueryData(r.github({}),e),v.invalidateQueries({queryKey:r.github({limit:lt})});let t=b.current;if(!t){v.removeQueries({queryKey:[`github`,`comments`]});return}let n=r.githubComments(t.kind,t.number);o(t.kind,t.number,{refresh:!0}).then(e=>v.setQueryData(n,e)).catch(()=>{}),v.removeQueries({queryKey:[`github`,`comments`],predicate:e=>e.queryHash!==w(n)})},onError:e=>_(e.message,{tone:`danger`})}),T=h(),E=g(),O=S(),[k,P]=(0,X.useState)(()=>et().workflow),[F,te]=(0,X.useState)(()=>et().skills),[I,ne]=(0,X.useState)({runner:null,model:null});(0,X.useEffect)(()=>{tt({workflow:k,skills:[...F]})},[k,F]);let L=T.data?.workflows;(0,X.useEffect)(()=>{L&&k!==null&&!L.some(e=>e.name===k)&&P(null)},[L,k]);let re=E.data,R=O.data?.skillUsage,ie=(0,X.useMemo)(()=>ge(re??[],R),[re,R]),[z,B]=(0,X.useState)(new Map),[V,ae]=(0,X.useState)(``),[H,oe]=(0,X.useState)([]);if(!d)return a.isError?(0,Z.jsx)(`div`,{"data-route":`github`,className:`flex min-h-full flex-col`,children:(0,Z.jsx)(x,{icon:(0,Z.jsx)(N,{}),tone:`danger`,title:`Could not load GitHub`,subtitle:a.error.message})}):(0,Z.jsx)(se,{});if(b.current=null,!d.available)return(0,Z.jsx)(`div`,{"data-route":`github`,className:`flex min-h-full flex-col`,children:(0,Z.jsx)(x,{icon:(0,Z.jsx)(he,{}),tone:`neutral`,title:`GitHub is unavailable here`,subtitle:d.reason??`unknown reason`,actions:(0,Z.jsx)(m,{variant:`outline`,"data-action":`gh-retry`,disabled:C.isPending,onClick:()=>C.mutate(),children:`Try again`}),children:(0,Z.jsxs)(`p`,{className:`text-xs leading-relaxed text-soft-foreground`,children:[`The tab needs the `,(0,Z.jsx)(`span`,{className:`font-mono`,children:`gh`}),` CLI, logged in (`,(0,Z.jsx)(`span`,{className:`font-mono`,children:`gh auth login`}),`), and a repo with a GitHub remote. Everything else in cezar works without it.`]})})});let U=e===`issues`?d.issues:d.prs,W=d.labelColors??{},ce=Je(U),G=Ye(U,{query:V,labels:H}),le=V.trim()!==``||H.length>0,K=n===void 0?null:Number.parseInt(n,10),q=K===null?G[0]??null:U.find(e=>e.number===K)??null;b.current=q?{kind:q.kind,number:q.number}:null;let J=e===`issues`?`/github`:`/github/prs`;return(0,Z.jsxs)(`div`,{"data-route":`github`,className:`flex h-full min-h-0 items-stretch`,children:[(0,Z.jsxs)(`section`,{"data-slot":`gh-list`,className:D(`w-full min-h-0 flex-col overflow-y-auto overscroll-contain border-border md:flex md:w-[360px] md:shrink-0 md:border-r`,n===void 0?`flex`:`hidden`),children:[(0,Z.jsxs)(`header`,{"data-slot":`gh-header`,className:`sticky top-0 z-10 border-b border-border bg-background/95 px-4 pt-3 backdrop-blur`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,Z.jsx)(`h1`,{className:`text-lg font-semibold`,children:`GitHub`}),d.repo?(0,Z.jsx)(`span`,{"data-slot":`gh-repo`,className:`min-w-0 truncate font-mono text-[11px] text-soft-foreground`,children:d.repo}):null,(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`gh-refresh`,title:`Refresh from GitHub`,disabled:C.isPending,onClick:()=>C.mutate(),className:`ml-auto flex shrink-0 items-center gap-1 rounded-full border border-border px-1.5 py-px text-[10px] font-medium text-soft-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-55`,children:[(0,Z.jsx)(M,{"aria-hidden":`true`,className:D(`size-[9px]`,C.isPending&&`motion-safe:animate-spin`)}),d.syncedAt?`synced ${Y(d.syncedAt)} ago`:`refresh`]})]}),(0,Z.jsxs)(`div`,{"data-slot":`gh-tabs`,className:`mt-2.5 flex items-end gap-1`,children:[(0,Z.jsxs)(A,{to:`/github`,active:e===`issues`,onClick:()=>y(`issues`),children:[`Issues · `,ft(d.issues.length,p)]}),(0,Z.jsxs)(A,{to:`/github/prs`,active:e===`prs`,onClick:()=>y(`prs`),children:[`Pull requests · `,ft(d.prs.length,p)]})]}),(0,Z.jsxs)(`div`,{className:`mt-2.5 flex items-center gap-2 pb-3`,children:[(0,Z.jsxs)(`div`,{className:`relative min-w-0 flex-1`,children:[(0,Z.jsx)(xe,{"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-soft-foreground`}),(0,Z.jsx)(`input`,{type:`search`,"data-slot":`gh-search`,"aria-label":`Search ${e}`,placeholder:`Search #id, title, author…`,value:V,onChange:e=>ae(e.target.value),className:`w-full rounded-md border border-input bg-card py-1 pr-2 pl-7 text-[13px] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`})]}),(0,Z.jsx)(mt,{options:ce,colors:W,selected:H,onChange:oe})]})]}),G.length===0?(0,Z.jsx)(`p`,{className:`px-4 py-4 text-sm text-soft-foreground`,children:le?`No ${e===`issues`?`issues`:`pull requests`} match your filter.`:`No open ${e===`issues`?`issues`:`pull requests`}.`}):(0,Z.jsx)(`ul`,{"data-slot":`gh-rows`,className:`flex flex-col gap-0.5 px-2 py-2`,children:G.map(t=>(0,Z.jsx)(pt,{item:t,view:e,colors:W,active:q?.url===t.url,queued:z.has(t.url)},t.url))})]}),(0,Z.jsx)(`section`,{"data-slot":`gh-detail`,className:D(`min-w-0 min-h-0 flex-1 flex-col overflow-y-auto overscroll-contain`,n===void 0?`hidden md:flex`:`flex`),children:q?(0,Z.jsx)(gt,{item:q,listPath:J,colors:W,changes:t,children:(0,Z.jsx)(at,{item:q,workflows:T.data?.workflows??[],skills:ie,workflow:k,onWorkflowChange:P,selectedSkills:F,onSkillsChange:te,engine:I,onEngineChange:ne,queuedRunId:z.get(q.url)??null,onQueued:(e,t)=>B(n=>new Map(n).set(e,t))},q.url)}):(0,Z.jsx)(x,{icon:e===`issues`?(0,Z.jsx)(Le,{}):(0,Z.jsx)(j,{}),tone:`neutral`,heading:`h2`,title:K===null?`Nothing selected`:`Not in the open list`,subtitle:K===null?`No open ${e===`issues`?`issues`:`pull requests`} to show.`:`#${K} is not among the open ${e===`issues`?`issues`:`pull requests`} — it may be closed, or still outside the fetched batch.`})})]})}function ft(e,t){return`${e}${!t&&e>=ct?`+`:``}`}function pt({item:e,view:t,colors:n,active:r,queued:i}){let a=e.kind===`issue`?Le:j;return(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(I,{to:`${t===`issues`?`/github/issues`:`/github/prs`}/${e.number}`,draggable:!0,onDragStart:t=>{try{t.dataTransfer.setData(`text/plain`,Ve(e)),t.dataTransfer.effectAllowed=`copy`}catch{}},"data-slot":`gh-row`,"data-number":e.number,"aria-current":r?`page`:void 0,title:`Drag into the composer to prefill a task`,className:D(`flex flex-col gap-1 rounded-md px-2.5 py-2 transition-colors hover:bg-muted`,r&&`bg-muted`),children:[(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Z.jsx)(a,{"aria-hidden":`true`,className:D(`size-3.5 shrink-0`,e.kind===`issue`?`text-success`:`text-violet`)}),(0,Z.jsx)(`span`,{className:D(`min-w-0 truncate text-[13px] font-medium`,r&&`font-semibold`),children:e.title})]}),(0,Z.jsxs)(`span`,{className:`flex items-center gap-2 pl-[22px] font-mono text-[10.5px] text-muted-foreground`,children:[(0,Z.jsxs)(`span`,{children:[`#`,e.number]}),(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:e.author}),(0,Z.jsx)(`span`,{children:Y(e.createdAt)}),(0,Z.jsx)(Mt,{count:e.comments}),e.checks?(0,Z.jsx)(Pt,{checks:e.checks}):null,i?(0,Z.jsx)(`span`,{"data-slot":`gh-queued-flag`,className:`font-sans font-medium text-violet`,children:`↗ run queued`}):null]}),e.labels.length>0?(0,Z.jsx)(`span`,{className:`flex flex-wrap gap-1 pl-[22px]`,children:e.labels.map(e=>(0,Z.jsx)(ht,{label:e,color:n[e]},e))}):null]})})}function mt({options:e,colors:t,selected:n,onChange:r}){let[i,a]=(0,X.useState)(!1),o=e=>r(n.includes(e)?n.filter(t=>t!==e):[...n,e]);return(0,Z.jsxs)(q,{open:i,onOpenChange:a,children:[(0,Z.jsx)(B,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`gh-label-filter`,disabled:e.length===0,className:D(`flex shrink-0 items-center gap-1 rounded-md border border-input bg-card px-2 py-1 text-[12px] font-medium text-muted-foreground transition-colors hover:text-foreground disabled:opacity-50`,n.length>0&&`border-primary/60 text-foreground`),children:[(0,Z.jsx)(ze,{"aria-hidden":`true`,className:`size-3.5`}),n.length>0?`Labels · ${n.length}`:`Labels`]})}),(0,Z.jsx)(de,{align:`end`,sideOffset:6,className:`w-60 p-0`,children:(0,Z.jsxs)(Te,{children:[(0,Z.jsx)(fe,{placeholder:`Filter labels…`}),(0,Z.jsxs)(U,{className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[(0,Z.jsx)(K,{children:`No labels.`}),n.length>0?(0,Z.jsxs)(V,{value:`__clear__`,onSelect:()=>r([]),className:`text-soft-foreground`,children:[`Clear `,n.length,` filter`,n.length>1?`s`:``]}):null,e.map(e=>{let r=n.includes(e);return(0,Z.jsxs)(V,{value:e,onSelect:()=>o(e),children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`size-2.5 shrink-0 rounded-full border`,style:Xe(t[e])}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e}),r?(0,Z.jsx)(y,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}):null]},e)})]})]})})]})}function ht({label:e,color:t}){return(0,Z.jsx)(`span`,{"data-slot":`gh-label`,"data-label":e,style:Xe(t),className:`rounded-full border px-1.5 py-px text-[10px] font-medium`,children:e})}function gt({item:e,listPath:t,colors:n,children:r,changes:i}){let a=e.kind===`pr`?`pull request`:`issue`,o=e.kind===`pr`&&!!(e.additions||e.deletions);return(0,Z.jsxs)(`article`,{"data-slot":`gh-detail-inner`,className:`min-w-0 px-4 py-4 md:px-7 md:py-5`,children:[(0,Z.jsxs)(I,{to:t,"data-slot":`gh-back`,className:`mb-3 inline-flex items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground md:hidden`,children:[(0,Z.jsx)(O,{"aria-hidden":`true`,className:`size-3.5`}),`Back to the list`]}),(0,Z.jsxs)(`p`,{"data-slot":`gh-meta`,className:`flex flex-wrap items-center gap-x-1.5 font-mono text-[10.5px] text-soft-foreground`,children:[(0,Z.jsxs)(`span`,{children:[`#`,e.number]}),`·`,(0,Z.jsx)(`span`,{children:a}),`·`,(0,Z.jsxs)(`span`,{children:[`opened by `,e.author]}),`·`,(0,Z.jsxs)(`span`,{children:[Y(e.createdAt),` ago`]}),e.comments?(0,Z.jsxs)(Z.Fragment,{children:[`·`,(0,Z.jsx)(Mt,{count:e.comments})]}):null,o?(0,Z.jsxs)(Z.Fragment,{children:[`·`,(0,Z.jsxs)(`span`,{"data-slot":`gh-diffstat`,children:[(0,Z.jsxs)(`span`,{className:`text-success`,children:[`+`,e.additions??0]}),` `,(0,Z.jsxs)(`span`,{className:`text-danger`,children:[`−`,e.deletions??0]})]})]}):null,`·`,T(e.url)?(0,Z.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-open-link`,className:`inline-flex items-center gap-0.5 text-muted-foreground hover:text-foreground hover:underline`,children:[`open on GitHub`,(0,Z.jsx)(k,{"aria-hidden":`true`,className:`size-2.5`})]}):(0,Z.jsx)(`span`,{"data-slot":`gh-open-link`,className:`text-muted-foreground`,children:`open on GitHub`})]}),(0,Z.jsx)(`h2`,{className:`mt-2 text-xl leading-snug font-semibold`,children:e.title}),e.kind===`pr`?(0,Z.jsxs)(`nav`,{"aria-label":`Pull request detail`,className:`mt-4 flex border-b border-border`,children:[(0,Z.jsx)(A,{to:`/github/prs/${e.number}`,active:!i,children:`Conversation`}),(0,Z.jsx)(A,{to:`/github/prs/${e.number}/changes`,active:i,children:`Changes`})]}):null,e.labels.length>0||e.checks?(0,Z.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-1.5`,children:[e.labels.map(e=>(0,Z.jsx)(ht,{label:e,color:n[e]},e)),e.checks?(0,Z.jsx)(Nt,{checks:e.checks,url:e.url}):null]}):null,i&&e.kind===`pr`?(0,Z.jsx)(vt,{item:e}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{"data-slot":`gh-body`,className:`mt-5 text-sm`,children:e.body?(0,Z.jsx)(Me,{children:e.body}):(0,Z.jsx)(`p`,{className:`text-soft-foreground`,children:`(no description)`})}),(0,Z.jsx)(yt,{item:e,colors:n}),e.kind===`pr`?(0,Z.jsx)(_t,{number:e.number}):null,r]})]})}var $={squash:`Squash and merge`,merge:`Create a merge commit`,rebase:`Rebase and merge`};function _t({number:e}){let t=c(),n=v({queryKey:r.githubMergeState(e),queryFn:({signal:t})=>p(e,{},{signal:t}),retry:!1}),a=n.data?.available?n.data.mergeState:null,[o,s]=(0,X.useState)(null),[l,u]=(0,X.useState)(!1),d=i({mutationFn:()=>p(e,{refresh:!0}),onSuccess:n=>t.setQueryData(r.githubMergeState(e),n),onError:e=>_(e instanceof Error?e.message:String(e),{tone:`danger`})}),f=o&&a?.methods.includes(o)?o:a?.defaultMethod??a?.methods[0]??null,h=i({mutationFn:()=>{if(!a||!f)throw Error(`No merge method is available.`);return b(e,{method:f,expectedHeadSha:a.headSha})},onSuccess:()=>{u(!1),_(`Pull request #${e} merged`),t.invalidateQueries({queryKey:r.githubMergeState(e)}),t.invalidateQueries({queryKey:r.github({})}),t.invalidateQueries({queryKey:r.github({limit:lt})}),t.invalidateQueries({queryKey:r.githubComments(`pr`,e)})},onError:n=>{_(n instanceof Error?n.message:String(n),{tone:`danger`}),t.invalidateQueries({queryKey:r.githubMergeState(e)})}});if(n.isPending)return(0,Z.jsx)(Q,{"data-slot":`gh-merge-loading`,className:`mt-6 h-32 w-full`});if(!a)return(0,Z.jsxs)(`section`,{"data-slot":`gh-merge-unavailable`,className:`mt-6 rounded-lg border border-border bg-card p-4 text-sm`,children:[(0,Z.jsx)(`p`,{className:`font-medium`,children:`Merge status unavailable`}),(0,Z.jsx)(`p`,{className:`mt-1 text-xs text-soft-foreground`,children:n.data?.available===!1?n.data.reason:`GitHub could not load merge requirements.`})]});let g=a.state===`merged`?`Merged`:a.state===`closed`?`Closed`:a.isDraft?`Draft`:a.mergeable===`conflicting`?`Conflicts must be resolved`:a.canMerge?`Ready to merge`:`Merge blocked`;return(0,Z.jsxs)(`section`,{"data-slot":`gh-merge-box`,"aria-live":`polite`,className:`mt-6 rounded-lg border border-border bg-card p-4`,children:[(0,Z.jsxs)(`div`,{className:`flex items-start gap-3`,children:[a.canMerge?(0,Z.jsx)(y,{"aria-hidden":`true`,className:`mt-0.5 size-5 shrink-0 text-success`}):(0,Z.jsx)(N,{"aria-hidden":`true`,className:`mt-0.5 size-5 shrink-0 text-warning`}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Z.jsx)(`h3`,{className:`font-semibold`,children:g}),(0,Z.jsxs)(m,{type:`button`,variant:`ghost`,size:`sm`,disabled:d.isPending,onClick:()=>d.mutate(),children:[(0,Z.jsx)(M,{"aria-hidden":`true`,className:D(`size-3.5`,d.isPending&&`animate-spin`)}),`Refresh`]})]}),(0,Z.jsxs)(`p`,{className:`mt-1 font-mono text-[11px] text-soft-foreground`,children:[a.headRef,` (`,a.headSha.slice(0,7),`) → `,a.baseRef]}),(0,Z.jsxs)(`ul`,{className:`mt-3 space-y-2 text-xs`,children:[(0,Z.jsxs)(`li`,{children:[`Reviews: `,a.reviewDecision.replaceAll(`-`,` `)]}),(0,Z.jsxs)(`li`,{children:[`Conflicts: `,a.mergeable===`conflicting`?`present`:a.mergeable===`mergeable`?`none`:`unknown`]}),a.checks.length===0?(0,Z.jsx)(`li`,{children:`No checks configured`}):a.checks.map(e=>(0,Z.jsxs)(`li`,{className:`flex items-center justify-between gap-3`,children:[(0,Z.jsxs)(`span`,{children:[e.name,` · `,e.state,e.required===!0?` · required`:e.required===null?` · requiredness unknown`:``]}),e.url&&T(e.url)?(0,Z.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`text-muted-foreground underline`,children:`details`}):null]},e.name)),a.blockers.map(e=>(0,Z.jsx)(`li`,{className:`text-soft-foreground`,children:e.message},e.code))]}),a.state===`open`&&a.methods.length>0?(0,Z.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2 sm:flex-row`,children:[(0,Z.jsx)(`select`,{"aria-label":`Merge method`,value:f??``,onChange:e=>s(e.target.value),className:`h-9 min-w-0 flex-1 rounded-md border border-input bg-background px-3 text-sm`,children:a.methods.map(e=>(0,Z.jsx)(`option`,{value:e,children:$[e]},e))}),(0,Z.jsx)(m,{disabled:!a.canMerge||!f,onClick:()=>u(!0),children:f?$[f]:`Merge`})]}):null]})]}),(0,Z.jsx)(L,{open:l,onOpenChange:u,children:(0,Z.jsxs)(ye,{"data-slot":`gh-merge-confirm`,showCloseButton:!1,children:[(0,Z.jsxs)(be,{children:[(0,Z.jsxs)(ae,{children:[f?$[f]:`Merge`,` pull request #`,e,`?`]}),(0,Z.jsxs)(oe,{children:[`This will merge “`,a.title,`” into `,a.baseRef,`. GitHub will re-check the exact reviewed head before changing the repository.`]})]}),h.error?(0,Z.jsx)(`p`,{className:`text-sm text-danger`,children:h.error.message}):null,(0,Z.jsxs)(ve,{children:[(0,Z.jsx)(m,{variant:`outline`,disabled:h.isPending,onClick:()=>u(!1),children:`Cancel`}),(0,Z.jsx)(m,{disabled:h.isPending,onClick:()=>h.mutate(),children:h.isPending?`Merging…`:f?$[f]:`Merge`})]})]})})]})}function vt({item:e}){let t=c(),n=C(e.number),[r,i]=(0,X.useState)(``),[a,o]=(0,X.useState)(null),s=n.data,l=s?.available?s.files.filter(e=>e.path.toLowerCase().includes(r.toLowerCase())):[],u=l.findIndex(e=>e.path===a);(0,X.useEffect)(()=>{l.length>0&&!l.some(e=>e.path===a)&&o(l[0].path)},[s?.available?s.headSha:``,r]);let f=async()=>{let n=s?.available?s.headSha:null,r=await d(e.number,{refresh:!0});t.setQueryData([`github`,`pr-changes`,e.number],r),r.available&&n&&n!==r.headSha&&(o(r.files[0]?.path??null),_(`The reviewed revision changed.`))};if(n.isPending)return(0,Z.jsx)(`p`,{"aria-live":`polite`,className:`mt-6 text-sm text-muted-foreground`,children:`Loading changed files…`});if(n.isError||!s)return(0,Z.jsx)(`p`,{className:`mt-6 text-sm text-danger`,children:`Changed files could not be loaded.`});if(!s.available)return(0,Z.jsx)(`p`,{className:`mt-6 text-sm text-muted-foreground`,children:s.reason});let p=l.map(e=>({path:e.path,...e.previousPath?{oldPath:e.previousPath}:{},status:e.status===`removed`?`deleted`:e.status===`changed`?`modified`:e.status,adds:e.additions,dels:e.deletions,binary:e.patchUnavailableReason===`binary`,patch:e.patch??``})),h=T(e.url)?`${e.url}/files`:null,g=l.find(e=>e.path===a);return(0,Z.jsxs)(`section`,{"data-slot":`gh-pr-changes`,className:`mt-5 min-w-0`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[(0,Z.jsxs)(`strong`,{children:[s.files.length,` changed files`]}),(0,Z.jsxs)(`span`,{className:`text-success`,children:[`+`,s.additions]}),(0,Z.jsxs)(`span`,{className:`text-danger`,children:[`−`,s.deletions]}),(0,Z.jsxs)(`span`,{className:`font-mono text-muted-foreground`,title:s.headSha,children:[`head `,s.headSha.slice(0,8)]}),(0,Z.jsx)(m,{type:`button`,variant:`outline`,size:`sm`,className:`ml-auto min-h-11`,onClick:()=>void f(),children:`Refresh`})]}),s.truncated?(0,Z.jsxs)(`p`,{role:`status`,className:`mt-3 rounded-md border border-warning/40 bg-warning/10 p-3 text-xs`,children:[s.reason??`This response is incomplete.`,` `,h?(0,Z.jsx)(`a`,{href:h,target:`_blank`,rel:`noopener noreferrer`,className:`underline`,children:`Open all files on GitHub`}):null]}):null,(0,Z.jsxs)(`div`,{className:`mt-4 grid min-w-0 gap-4 lg:grid-cols-[240px_minmax(0,1fr)]`,children:[(0,Z.jsxs)(`aside`,{className:`min-w-0`,children:[(0,Z.jsx)(`input`,{"aria-label":`Filter changed files`,value:r,onChange:e=>i(e.target.value),placeholder:`Filter files…`,className:`min-h-11 w-full rounded-md border border-input bg-background px-3 text-sm`}),(0,Z.jsx)(`select`,{"aria-label":`Select changed file`,value:a??``,onChange:e=>o(e.target.value),className:`mt-2 min-h-11 w-full rounded-md border border-input bg-background px-2 text-sm lg:hidden`,children:l.map(e=>(0,Z.jsx)(`option`,{children:e.path},e.path))}),(0,Z.jsx)(`ul`,{className:`mt-2 hidden max-h-[60vh] overflow-auto lg:block`,children:l.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>o(e.path),className:D(`min-h-11 w-full truncate rounded px-2 text-left text-xs`,a===e.path&&`bg-muted font-medium`),title:e.path,children:[e.status,` · `,e.path,` `,(0,Z.jsxs)(`span`,{className:`text-success`,children:[`+`,e.additions]}),` `,(0,Z.jsxs)(`span`,{className:`text-danger`,children:[`−`,e.deletions]})]})},e.path))})]}),(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[(0,Z.jsxs)(`div`,{className:`mb-2 flex justify-end gap-1`,children:[(0,Z.jsx)(m,{"aria-label":`Previous file`,variant:`outline`,size:`icon`,className:`min-h-11 min-w-11`,disabled:u<=0,onClick:()=>o(l[u-1]?.path??null),children:(0,Z.jsx)(Ie,{})}),(0,Z.jsx)(m,{"aria-label":`Next file`,variant:`outline`,size:`icon`,className:`min-h-11 min-w-11`,disabled:u<0||u>=l.length-1,onClick:()=>o(l[u+1]?.path??null),children:(0,Z.jsx)(Se,{})})]}),l.length===0?(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No changed files match this filter.`}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Fe,{files:p.filter(e=>e.path===a),wrap:!0,className:`min-w-0`}),g&&!g.patch?(0,Z.jsxs)(`p`,{className:`rounded-b border border-border p-3 text-xs text-muted-foreground`,children:[`Patch unavailable: `,g.patchUnavailableReason??`not-provided`,`.`]}):null]})]})]})]})}function yt({item:e,colors:t}){let n=u(e.kind,e.number),r=n.data,i=(0,X.useMemo)(()=>{let e=[...(r?.comments??[]).map(e=>({row:`comment`,comment:e})),...(r?.events??[]).map(e=>({row:`event`,event:e}))],t=e=>{let t=Date.parse(bt(e));return Number.isNaN(t)?-1/0:t};return e.sort((e,n)=>t(e)-t(n))},[r?.comments,r?.events]);return n.isPending?(0,Z.jsxs)(`section`,{"data-slot":`gh-thread-loading`,className:`mt-6 border-t border-border pt-5`,children:[(0,Z.jsx)(Q,{className:`mb-3 h-3 w-24`}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Z.jsx)(Q,{className:`h-14 w-full`}),(0,Z.jsx)(Q,{className:`h-14 w-full`})]})]}):!r||!r.available?(0,Z.jsxs)(`section`,{"data-slot":`gh-thread-error`,className:`mt-6 border-t border-border pt-5 text-xs text-soft-foreground`,children:[(0,Z.jsxs)(`span`,{children:[`Couldn’t load comments — `,r?.reason??(n.error instanceof Error?n.error.message:`could not load comments`),`. `]}),(0,Z.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-0.5 text-muted-foreground hover:text-foreground hover:underline`,children:[`open on GitHub`,(0,Z.jsx)(k,{"aria-hidden":`true`,className:`size-2.5`})]})]}):i.length===0?null:(0,Z.jsxs)(`section`,{"data-slot":`gh-thread`,className:`mt-6 border-t border-border pt-5`,children:[(0,Z.jsxs)(`h3`,{"data-slot":`gh-thread-header`,className:`mb-4 text-[11px] font-semibold tracking-wide text-soft-foreground uppercase`,children:[`Activity · `,r.comments.length,` comment`,r.comments.length===1?``:`s`]}),(0,Z.jsx)(`ul`,{className:`flex flex-col gap-5`,children:xt(i).map(e=>e.group===`commits`?(0,Z.jsx)(St,{commits:e.commits,colors:t},e.commits[0].id):e.entry.row===`comment`?(0,Z.jsx)(Ot,{comment:e.entry.comment},`${e.entry.comment.kind}-${e.entry.comment.id}`):(0,Z.jsx)(wt,{event:e.entry.event,colors:t},e.entry.event.id))}),r.truncated?(0,Z.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-thread-truncated`,className:`mt-4 inline-flex items-center gap-0.5 text-xs text-soft-foreground hover:text-foreground hover:underline`,children:[`thread truncated — open on GitHub`,(0,Z.jsx)(k,{"aria-hidden":`true`,className:`size-2.5`})]}):null]})}var bt=e=>e.row===`comment`?e.comment.createdAt:e.event.createdAt;function xt(e){let t=[],n=[],r=()=>{n.length!==0&&(n.length===1?t.push({group:`single`,entry:{row:`event`,event:n[0]}}):t.push({group:`commits`,commits:n}),n=[])};for(let i of e){if(i.row===`event`&&i.event.kind===`committed`&&i.row===`event`){let e=n[n.length-1];e&&e.actor!==i.event.actor&&r(),n.push(i.event);continue}r(),t.push({group:`single`,entry:i})}return r(),t}function St({commits:e,colors:t}){let[n,r]=(0,X.useState)(!1),i=e[0]?.actor??`?`;return n?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`li`,{"data-slot":`gh-commit-group`,"data-open":`true`,className:`min-w-0`,children:(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":!0,onClick:()=>r(!1),className:`flex items-center gap-1.5 font-mono text-[11px] text-soft-foreground hover:text-foreground`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:Ct.committed}),(0,Z.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:i}),(0,Z.jsxs)(`span`,{children:[`added `,e.length,` commits`]})]})}),e.map(e=>(0,Z.jsx)(wt,{event:e,colors:t},e.id))]}):(0,Z.jsx)(`li`,{"data-slot":`gh-commit-group`,"data-open":`false`,className:`min-w-0`,children:(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":!1,onClick:()=>r(!0),className:`flex items-center gap-1.5 font-mono text-[11px] text-soft-foreground hover:text-foreground`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:Ct.committed}),(0,Z.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:i}),(0,Z.jsxs)(`span`,{children:[`added `,e.length,` commits`]}),(0,Z.jsx)(`span`,{className:`shrink-0`,children:Y(e[e.length-1].createdAt)})]})})}var Ct={committed:`⚙`,labeled:`◆`,unlabeled:`◇`,assigned:`◍`,unassigned:`◌`,merged:`⑃`,closed:`⊘`,reopened:`⊙`,head_ref_force_pushed:`↻`,"cross-referenced":`↗`,renamed:`✎`};function wt({event:e,colors:t}){return(0,Z.jsxs)(`li`,{"data-slot":`gh-event-row`,"data-kind":e.kind,className:D(`flex min-w-0 items-center gap-1.5 font-mono text-[11px] text-soft-foreground`,e.kind===`merged`&&`text-accent-foreground`),children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0`,children:Ct[e.kind]}),(0,Z.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:e.actor}),(0,Z.jsx)(Tt,{event:e,colors:t}),(0,Z.jsx)(`span`,{className:`shrink-0`,children:Y(e.createdAt)}),e.url?(0,Z.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`open ${e.kind} on GitHub`,className:`ml-auto shrink-0 text-muted-foreground hover:text-foreground`,children:(0,Z.jsx)(k,{"aria-hidden":`true`,className:`size-2.5`})}):null]})}function Tt({event:e,colors:t}){switch(e.kind){case`committed`:return(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`shrink-0`,children:`committed`}),e.sha?(0,Z.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e.sha.slice(0,7)}):null,e.message?(0,Z.jsx)(`span`,{className:`truncate font-sans text-foreground`,children:e.message}):null,(0,Z.jsx)(Et,{checks:e.checks})]});case`labeled`:case`unlabeled`:return(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`shrink-0`,children:e.kind===`labeled`?`added the`:`removed the`}),e.label?(0,Z.jsx)(`span`,{"data-slot":`gh-event-label`,style:Xe(e.label.color??t[e.label.name]),className:`max-w-[12rem] truncate rounded-full border px-1.5 py-px font-sans text-[10px]`,children:e.label.name}):null,(0,Z.jsx)(`span`,{className:`shrink-0`,children:`label`})]});case`assigned`:case`unassigned`:return(0,Z.jsxs)(`span`,{className:`truncate`,children:[e.kind===`assigned`?`assigned`:`unassigned`,` `,e.subject??`someone`]});case`merged`:return(0,Z.jsx)(`span`,{children:`merged this`});case`closed`:return(0,Z.jsx)(`span`,{children:`closed this`});case`reopened`:return(0,Z.jsx)(`span`,{children:`reopened this`});case`head_ref_force_pushed`:return(0,Z.jsx)(`span`,{children:`force-pushed`});case`renamed`:return(0,Z.jsxs)(`span`,{className:`truncate`,children:[`renamed this to `,e.subject??`—`]});case`cross-referenced`:return(0,Z.jsxs)(`span`,{className:`truncate`,children:[`referenced this in `,e.refNumber?`#${e.refNumber}`:`another thread`,e.refTitle?` ${e.refTitle}`:``]})}}function Et({checks:e}){return e?(0,Z.jsx)(`span`,{"data-slot":`gh-commit-checks`,"data-checks":e,"aria-label":`checks ${e}`,className:D(`shrink-0`,jt[e]),children:At[e]}):null}var Dt={approved:{label:`approved`,tone:`border-success/40 text-success`},changes_requested:{label:`changes requested`,tone:`border-danger/40 text-danger`},commented:{label:`commented`,tone:`border-border text-muted-foreground`},dismissed:{label:`dismissed`,tone:`border-border text-muted-foreground`}};function Ot({comment:e}){let t=e.reviewState?Dt[e.reviewState]:null;return(0,Z.jsxs)(`li`,{"data-slot":`gh-thread-entry`,"data-kind":e.kind,className:`min-w-0`,children:[(0,Z.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1.5 font-mono text-[11px] text-soft-foreground`,children:[(0,Z.jsx)(kt,{url:e.avatarUrl,login:e.author}),(0,Z.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:e.author}),(0,Z.jsx)(`span`,{children:Y(e.createdAt)}),t?(0,Z.jsx)(`span`,{"data-slot":`gh-review-chip`,"data-review-state":e.reviewState,className:D(`rounded-full border px-1.5 py-px font-sans text-[10px] font-medium`,t.tone),children:t.label}):null,(0,Z.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`open comment on GitHub`,className:`ml-auto shrink-0 text-muted-foreground hover:text-foreground`,children:(0,Z.jsx)(k,{"aria-hidden":`true`,className:`size-2.5`})})]}),(0,Z.jsx)(`div`,{"data-slot":`gh-thread-body`,className:`text-sm`,children:e.body?(0,Z.jsx)(Me,{children:e.body}):(0,Z.jsx)(`p`,{className:`text-soft-foreground`,children:`(no body)`})})]})}function kt({url:e,login:t}){let[n,r]=(0,X.useState)(!1);return e&&!n?(0,Z.jsx)(`img`,{src:e,alt:``,width:16,height:16,loading:`lazy`,onError:()=>r(!0),"data-slot":`gh-avatar`,className:`size-4 shrink-0 rounded-full`}):(0,Z.jsx)(`span`,{"data-slot":`gh-avatar-fallback`,"aria-hidden":`true`,className:`flex size-4 shrink-0 items-center justify-center rounded-full bg-muted text-[8px] font-semibold text-muted-foreground uppercase`,children:t.slice(0,1)||`?`})}var At={passing:`✓`,failing:`✗`,pending:`○`},jt={passing:`text-success`,failing:`text-danger`,pending:`text-muted-foreground`};function Mt({count:e}){return e?(0,Z.jsxs)(`span`,{"data-slot":`gh-comment-count`,"data-count":e,"aria-label":`${e} comment${e===1?``:`s`}`,className:`inline-flex shrink-0 items-center gap-0.5`,children:[(0,Z.jsx)(Re,{"aria-hidden":`true`,className:`size-3`}),e]}):null}function Nt({checks:e,url:t}){let n=D(`text-[11px] font-medium`,jt[e],t&&`hover:underline`),r=`${At[e]} checks ${e}`;return t?(0,Z.jsx)(`a`,{href:`${t}/checks`,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-checks`,"data-checks":e,className:n,children:r}):(0,Z.jsx)(`span`,{"data-slot":`gh-checks`,"data-checks":e,className:n,children:r})}function Pt({checks:e}){return(0,Z.jsx)(`span`,{"data-slot":`gh-row-checks`,"data-checks":e,title:`checks ${e}`,"aria-label":`checks ${e}`,className:D(`shrink-0 font-sans text-[11px] font-semibold`,jt[e]),children:At[e]})}export{ut as GithubIndexRoute,dt as GithubRoute};
|