@wjarka/cezarion 0.18.0-dev.6295 → 0.18.0-dev.6311
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/package.json +2 -2
- package/web/dist/assets/{activity-motion-DjMpx0QL.js → activity-motion-EQnubAye.js} +1 -1
- package/web/dist/assets/{activity-route-CE2cYbQO.js → activity-route-r8W5w3yi.js} +1 -1
- package/web/dist/assets/{agent-accounts-BNlpWTOY.js → agent-accounts-DnFoFuBJ.js} +1 -1
- package/web/dist/assets/commit-diff-panel-D5znh9KC.js +1 -0
- package/web/dist/assets/{diff-D81T6FlH.js → diff-chMTLAOx.js} +2 -2
- package/web/dist/assets/{diff-view-Sqk3iny_.js → diff-view-BW1lfwHY.js} +3 -3
- package/web/dist/assets/{file-preview-CFvc38AT.js → file-preview-CHkgDXDV.js} +1 -1
- package/web/dist/assets/git-toolbar-C341Gf_9.js +1 -0
- package/web/dist/assets/github-BCvTNEUj.js +1 -0
- package/web/dist/assets/{global-activity-route-9DUVLRv0.js → global-activity-route-BTB-eVuo.js} +1 -1
- package/web/dist/assets/{index-CCrif8vP.css → index-CrlovI4F.css} +1 -1
- package/web/dist/assets/index-CyyH67ZV.js +17 -0
- package/web/dist/assets/{preview-pane-connected-DVlhmoyi.js → preview-pane-connected-DT7LGLl1.js} +3 -3
- package/web/dist/assets/prompt-template-menu-B8VpFfKO.js +1 -0
- package/web/dist/assets/queries-sEwd08S5.js +1 -0
- package/web/dist/assets/reference-chip-DMgD6d01.js +1 -0
- package/web/dist/assets/repo-git-DbRTlhfY.js +1 -0
- package/web/dist/assets/{report-reader-BdYHFEdw.js → report-reader-BWiwqjkj.js} +1 -1
- package/web/dist/assets/{reports-CWlWhffn.js → reports-Dshiq6sf.js} +1 -1
- package/web/dist/assets/run-header-CfnMPD0X.js +2 -0
- package/web/dist/assets/{skills-B2Cc1jJi.js → skills-C9220-7a.js} +1 -1
- package/web/dist/assets/task-changes-DZjJTxlb.js +1 -0
- package/web/dist/assets/task-commits-BD4B1joH.js +1 -0
- package/web/dist/assets/{task-files-CjqaWaul.js → task-files-DsZVyYC-.js} +1 -1
- package/web/dist/assets/task-github-item-CBKDdiMH.js +1 -0
- package/web/dist/assets/task-thread-CI3Vr8ly.js +9 -0
- package/web/dist/assets/{thread-state-B6Ar3fj6.js → thread-state-VqLmoI6u.js} +1 -1
- package/web/dist/assets/use-desktop-DeG3Ha7y.js +1 -0
- package/web/dist/assets/use-hand-to-agent-state-ulIFVdrs.js +1 -0
- package/web/dist/assets/{workflows-B32GiY9u.js → workflows-Dlef9w9O.js} +1 -1
- package/web/dist/index.html +7 -7
- package/web/dist/assets/commit-diff-panel-DBrsQdXO.js +0 -1
- package/web/dist/assets/git-toolbar-CZAj0VNk.js +0 -1
- package/web/dist/assets/github-Cdg3-sQK.js +0 -1
- package/web/dist/assets/index-s7PhnzDS.js +0 -17
- package/web/dist/assets/popover-G6KGT-qq.js +0 -1
- package/web/dist/assets/prompt-template-menu-D4-inlE4.js +0 -1
- package/web/dist/assets/queries-D2MPDhtr.js +0 -1
- package/web/dist/assets/reference-chip-Drpbf-MP.js +0 -1
- package/web/dist/assets/repo-git-CwibBYwB.js +0 -1
- package/web/dist/assets/run-header-Dc5892Cu.js +0 -2
- package/web/dist/assets/task-changes-CN0VE5bZ.js +0 -1
- package/web/dist/assets/task-commits-ycrhlORw.js +0 -1
- package/web/dist/assets/task-github-item-CezPgdB9.js +0 -1
- package/web/dist/assets/task-thread-BfsMGE4k.js +0 -9
- package/web/dist/assets/use-hand-to-agent-state-BOTjwkGM.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{d as t,t as n,u as r}from"./button-CS5tOblf.js";import{i,t as a}from"./react-runtime-CCIEwYL0.js";import{Bt as o,C as s,Kr as c,Sr as l,nt as u,r as d,rt as f,tn as p}from"./project-scope-context-DSkcNKO7.js";import{$t as m,M as h,O as g,P as _,Pt as v,Rt as y,Tt as b,et as x,h as S,jt as C,n as w,rt as T}from"./queries-sEwd08S5.js";import{t as E}from"./useQuery-8pHkglP4.js";import{a as D,et as O,o as k,r as A}from"./use-desktop-DeG3Ha7y.js";import{n as j}from"./toaster-CRVRHlMR.js";import{A as M,Z as ee,_ as N,b as P,ct as F,d as I,ft as te,h as ne,l as L,mt as re,ot as ie,r as ae,rt as oe,u as se,ut as ce}from"./design-icons-DmYTv2r1.js";import{t as le}from"./eye-B8okNWXU.js";import{a as ue,i as R}from"./format-BNCkW110.js";import{t as de}from"./message-square-B-MD-8rD.js";import{t as fe}from"./play-CmVAj_fu.js";import{a as pe,i as me,o as he,r as ge,s as _e,t as ve}from"./dialog-Dw7fMdDQ.js";import{d as z,t as ye,y as B}from"./prompt-template-menu-B8VpFfKO.js";import{t as V}from"./project-router-BFKfAFvq.js";import{B as be,E as xe,I as Se,L as H,M as Ce,O as we,P as Te,R as Ee,S as De,T as Oe,a as ke,b as Ae,f as je,h as Me,i as Ne,l as Pe,m as Fe,n as Ie,p as Le,r as U,s as Re,t as ze,u as Be,w as Ve,x as He,z as Ue}from"./agent-accounts-DnFoFuBJ.js";import{d as We,f as Ge,i as Ke,s as qe,t as Je,u as Ye}from"./skills-DFBiAuJG.js";import{F as Xe,L as Ze,X as Qe,Y as $e,et,hn as tt}from"./index-CyyH67ZV.js";import{t as nt}from"./diff-chMTLAOx.js";import{t as rt}from"./tab-link-DDpdYMnv.js";var W=e(i(),1),G=a(),it={squash:`Squash and merge`,merge:`Create a merge commit`,rebase:`Rebase and merge`};function K({state:e}){let t=`size-4 shrink-0`;return e===`passing`?(0,G.jsx)(L,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-passing`,className:r(t,`text-success`)}):e===`failing`?(0,G.jsx)(N,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-failing`,className:r(t,`text-danger`)}):e===`pending`?(0,G.jsx)(ue,{"aria-hidden":`true`,"data-slot":`gh-merge-status-pending`,className:r(t,`animate-spin text-warning`)}):(0,G.jsx)(ne,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-unknown`,className:r(t,`text-soft-foreground`)})}function at(e){return e?.available?e.mergeState:null}function ot(e,t){return e&&t?.methods.includes(e)?e:t?.defaultMethod??t?.methods[0]??null}function st(e){return e.state===`merged`?`Merged`:e.state===`closed`?`Closed`:e.isDraft?`Draft`:e.mergeable===`conflicting`?`Conflicts must be resolved`:e.canMerge?`Ready to merge`:e.eligibility===`unknown`?`Merge blocked · Requirements unknown`:`Merge blocked`}function ct(e){return e===`approved`||e===`not-required`?`passing`:e===`unknown`?`unknown`:`failing`}function lt(e){return e===`mergeable`?`passing`:e===`conflicting`?`failing`:`unknown`}function ut(e){return e===`conflicting`?`present`:e===`mergeable`?`none`:`unknown`}function dt(e){return e===!0?` · required`:e===null?` · requiredness unknown`:``}function ft(e){return e?.available===!1?e.reason:`GitHub could not load merge requirements.`}function pt(e,t,n){return!!(e&&(t.canMerge||t.canOverride&&n))}function q(e){return e?it[e]:`Merge`}function mt(e){return e===`conflicting`?`true`:void 0}function ht({check:e}){return(0,G.jsxs)(`li`,{className:`flex items-center justify-between gap-3`,children:[(0,G.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(K,{state:e.state}),(0,G.jsxs)(`span`,{children:[e.name,` · `,e.state,dt(e.required)]})]}),e.url&&t(e.url)?(0,G.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`text-muted-foreground underline`,children:`details`}):null]})}function gt({reason:e}){return(0,G.jsxs)(`section`,{"data-slot":`gh-merge-unavailable`,className:`mt-6 rounded-lg border border-border bg-card p-4 text-sm`,children:[(0,G.jsx)(`p`,{className:`font-medium`,children:`Merge status unavailable`}),(0,G.jsx)(`p`,{className:`mt-1 text-xs text-soft-foreground`,children:e})]})}function _t({state:e,selectedMethod:t,overrideRules:i,mergeEnabled:a,refreshPending:o,onRefresh:s,onRunAgent:c,onConfirm:l,onMethodChange:u,onOverrideChange:d}){let f=st(e),p=ct(e.reviewDecision),m=lt(e.mergeable);return(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[e.canMerge?(0,G.jsx)(L,{size:16,"aria-hidden":`true`,className:`mt-0.5 size-5 shrink-0 text-success`}):(0,G.jsx)(F,{size:16,"aria-hidden":`true`,className:`mt-0.5 size-5 shrink-0 text-warning`}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,G.jsx)(`h3`,{className:`font-semibold`,children:f}),(0,G.jsxs)(n,{type:`button`,variant:`ghost`,size:`sm`,disabled:o,onClick:s,children:[(0,G.jsx)(ee,{size:16,"aria-hidden":`true`,className:r(`size-3.5`,o&&`animate-spin`)}),`Refresh`]})]}),(0,G.jsxs)(`p`,{className:`mt-1 font-mono text-[11px] text-soft-foreground`,children:[e.headRef,` (`,e.headSha.slice(0,7),`) → `,e.baseRef]}),(0,G.jsxs)(`ul`,{className:`mt-3 space-y-2 text-xs`,children:[(0,G.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(K,{state:p}),(0,G.jsxs)(`span`,{children:[`Reviews: `,e.reviewDecision.replaceAll(`-`,` `)]})]}),(0,G.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(K,{state:m}),(0,G.jsxs)(`span`,{children:[`Conflicts: `,ut(e.mergeable)]})]}),e.checks.length===0?(0,G.jsx)(`li`,{children:`No checks configured`}):e.checks.map(e=>(0,G.jsx)(ht,{check:e},e.name)),e.blockers.map(e=>(0,G.jsx)(`li`,{className:`text-soft-foreground`,children:e.message},e.code))]}),e.mergeable===`conflicting`&&c?(0,G.jsx)(n,{className:`mt-4`,onClick:c,children:`Run agent on this PR`}):null,e.canOverride?(0,G.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 rounded-md border border-warning/40 bg-warning/5 p-3 text-xs`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:i,onChange:e=>d(e.target.checked),className:`mt-0.5 size-4 accent-accent-strong`}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`span`,{className:`block font-medium`,children:`Merge without waiting for requirements`}),(0,G.jsx)(`span`,{className:`mt-0.5 block text-soft-foreground`,children:`GitHub will allow this only if your permissions can bypass the repository rules.`})]})]}):null,e.eligibility===`unknown`?(0,G.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:`GitHub could not confirm review and branch-protection requirements. Passing checks do not establish merge readiness.`}):null,e.state===`open`&&e.methods.length>0?(0,G.jsxs)(`div`,{className:`mt-4 flex flex-col flex-wrap gap-2 sm:flex-row`,children:[(0,G.jsx)(`select`,{"aria-label":`Merge method`,value:t??``,onChange:e=>u(e.target.value),className:`h-9 min-w-0 flex-1 rounded-md border border-input bg-background px-3 text-sm`,children:e.methods.map(e=>(0,G.jsx)(`option`,{value:e,children:it[e]},e))}),(0,G.jsx)(n,{disabled:!a,onClick:l,children:q(t)})]}):null]})]})}function vt({number:e,state:t,selectedMethod:r,confirming:i,overrideRules:a,mergePending:o,mergeError:s,onOpenChange:c,onMerge:l}){return(0,G.jsx)(ve,{open:i,onOpenChange:c,children:(0,G.jsxs)(ge,{"data-slot":`gh-merge-confirm`,showCloseButton:!1,children:[(0,G.jsxs)(he,{children:[(0,G.jsxs)(_e,{children:[q(r),` pull request #`,e,`?`]}),(0,G.jsx)(me,{asChild:!0,children:(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`p`,{children:[`This will merge “`,t.title,`” into `,t.baseRef,`. GitHub will re-check the exact reviewed head before changing the repository.`]}),a&&t.canOverride?(0,G.jsx)(`p`,{"data-slot":`gh-bypass-warning`,className:`mt-4 text-sm text-warning`,children:`You are asking GitHub to bypass unmet repository requirements; GitHub may refuse if your permissions do not allow it.`}):null]})})]}),s?(0,G.jsx)(`p`,{className:`text-sm text-danger`,children:s.message}):null,(0,G.jsxs)(pe,{children:[(0,G.jsx)(n,{variant:`outline`,disabled:o,onClick:()=>c(!1),children:`Cancel`}),(0,G.jsx)(n,{disabled:o,onClick:l,children:o?`Merging…`:q(r)})]})]})})}function yt({number:e,onRunAgent:t}){let n=c(),r=T(),i=E({queryKey:w.githubMergeState(e),queryFn:({signal:t})=>f(e,{},{signal:t}),retry:!1}),a=at(i.data),[s,l]=(0,W.useState)(null),[u,d]=(0,W.useState)(!1),[p,h]=(0,W.useState)(!1),g=m({mutationFn:t=>f(e,{refresh:!0}),onSuccess:(e,t)=>n.setQueryData(t,e),onError:e=>j(e instanceof Error?e.message:String(e),{tone:`danger`})}),_=ot(s,a),v=()=>({mergeState:w.githubMergeState(e),list:w.githubPages(50),comments:w.githubComments(`pr`,e),item:w.githubItem(`pr`,e),refStatus:r===void 0?void 0:w.githubRefStatusOf(r)}),y=m({mutationFn:t=>{if(!a||!_)throw Error(`No merge method is available.`);return o(e,{method:_,expectedHeadSha:a.headSha,...p&&a.canOverride?{overrideRules:!0}:{}})},onSuccess:(t,r)=>{d(!1),j(`Pull request #${e} merged`),n.invalidateQueries({queryKey:r.mergeState}),n.invalidateQueries({queryKey:r.list}),n.invalidateQueries({queryKey:r.comments}),n.invalidateQueries({queryKey:r.item}),r.refStatus&&n.invalidateQueries({queryKey:r.refStatus})},onError:(e,t)=>{j(e instanceof Error?e.message:String(e),{tone:`danger`}),n.invalidateQueries({queryKey:t.mergeState})}});return i.isPending?(0,G.jsx)(B,{"data-slot":`gh-merge-loading`,className:`mt-6 h-32 w-full`}):a?(0,G.jsxs)(`section`,{"data-slot":`gh-merge-box`,"data-eligibility":a.eligibility,"data-conflicting":mt(a.mergeable),"aria-live":`polite`,className:`mt-6 rounded-lg border border-border bg-card p-4`,children:[(0,G.jsx)(_t,{state:a,selectedMethod:_,overrideRules:p,mergeEnabled:pt(_,a,p),refreshPending:g.isPending,onRefresh:()=>g.mutate(w.githubMergeState(e)),onRunAgent:t,onConfirm:()=>d(!0),onMethodChange:l,onOverrideChange:h}),(0,G.jsx)(vt,{number:e,state:a,selectedMethod:_,confirming:u,overrideRules:p,mergePending:y.isPending,mergeError:y.error,onOpenChange:d,onMerge:()=>y.mutate(v())})]}):(0,G.jsx)(gt,{reason:ft(i.data)})}function bt(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 xt(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))||t.assignees?.length&&!e.assignees?.some(e=>t.assignees.some(t=>t.toLowerCase()===e.toLowerCase()))||t.author!==void 0&&e.author.toLowerCase()!==t.author.toLowerCase()||t.includeNumbers&&!t.includeNumbers.has(e.number)||t.excludeNumbers?.has(e.number)||t.projectId&&e.projectIds!==void 0&&!e.projectIds.includes(t.projectId)?!1:n===``?!0:a?String(e.number).includes(i):`#${e.number} ${e.title} ${e.author} ${e.body??``}`.toLowerCase().includes(n))}function St(e,t){let n=e.trim();if(n===``)return!1;let r=n.replace(/^#/,``);return/^\d+$/.test(r)?!t.some(e=>e.number===Number(r)):t.length===0}function J(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))`}}function Ct({label:e,color:t,plain:n=!1}){return(0,G.jsx)(`span`,{"data-slot":`gh-label`,"data-label":e,style:n?void 0:J(t),className:n?`text-[11px] font-normal text-muted-foreground`:`rounded-full border px-1.5 py-px text-[12px] font-medium`,children:e})}function wt(e){return e===`pr`?`pull request`:`issue`}function Tt(e,t,n){return e===`pr`&&!!(t||n)}function Et({backLink:e}){return e?(0,G.jsxs)(V,{to:e.to,"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,G.jsx)(ae,{size:16,"aria-hidden":`true`,className:`size-3.5`}),`Back to the list`]}):null}function Dt({item:e,kindWord:n,commentCount:r,hasDiffStat:i,additions:a,deletions:o}){return(0,G.jsxs)(`p`,{"data-slot":`gh-meta`,className:`flex flex-wrap items-center gap-x-1.5 font-mono text-[11px] text-soft-foreground`,children:[(0,G.jsxs)(`span`,{children:[`#`,e.number]}),`·`,(0,G.jsx)(`span`,{children:n}),`·`,(0,G.jsxs)(`span`,{children:[`opened by `,e.author]}),`·`,(0,G.jsxs)(`span`,{children:[R(e.createdAt),` ago`]}),r?(0,G.jsxs)(G.Fragment,{children:[`·`,(0,G.jsx)(Jt,{count:r})]}):null,i?(0,G.jsxs)(G.Fragment,{children:[`·`,(0,G.jsxs)(`span`,{"data-slot":`gh-diffstat`,children:[(0,G.jsxs)(`span`,{className:`text-success`,children:[`+`,a??0]}),` `,(0,G.jsxs)(`span`,{className:`text-danger`,children:[`−`,o??0]})]})]}):null,`·`,t(e.url)?(0,G.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,G.jsx)(O,{"aria-hidden":`true`,className:`size-2.5`})]}):(0,G.jsx)(`span`,{"data-slot":`gh-open-link`,className:`text-muted-foreground`,children:`open on GitHub`})]})}function Ot({item:e,subNav:t,changes:n}){return e.kind===`pr`?t?(0,G.jsxs)(`nav`,{"aria-label":`Pull request detail`,className:`mt-4 flex border-b border-border`,children:[(0,G.jsx)(rt,{to:z(`prs`,t.filter,e.number),active:!n,children:`Conversation`}),(0,G.jsx)(rt,{to:z(`prs`,t.filter,e.number,`/changes`),active:n,children:`Changes`})]}):(0,G.jsx)(V,{to:z(`prs`,null,e.number,`/changes`),"data-slot":`gh-files-changed`,className:`mt-3 inline-flex items-center gap-1 text-xs font-medium text-muted-foreground hover:text-foreground hover:underline`,children:`Files changed`}):null}function kt({item:e,colors:t,checks:n}){return e.labels.length>0||n?(0,G.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-1.5`,children:[e.labels.map(e=>(0,G.jsx)(Ct,{label:e,color:t[e]},e)),n?(0,G.jsx)(Yt,{checks:n,url:e.url}):null]}):null}function At({item:e,colors:t,body:n}){return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{"data-slot":`gh-body`,className:`mt-5 text-sm`,children:n?(0,G.jsx)(Ze,{children:n}):(0,G.jsx)(`p`,{className:`text-soft-foreground`,children:`(no description)`})}),(0,G.jsx)(Nt,{item:e,colors:t})]})}function jt({item:e,colors:t,checks:n,comments:r,backLink:i,subNav:a,onRunAgent:o,afterHeading:s,children:c}){let l=a?.changes??!1,u=wt(e.kind),d=g(e.kind,e.number,!l).data?.detail,f=d?.body??e.body,p=d?.additions??e.additions,m=d?.deletions??e.deletions,h=Tt(e.kind,p,m),_=r??e.comments;return(0,G.jsxs)(`article`,{"data-slot":`gh-detail-inner`,className:`min-w-0 px-4 py-4 md:px-7 md:py-5`,children:[(0,G.jsx)(Et,{backLink:i}),(0,G.jsxs)(`div`,{"data-slot":`gh-description-card`,className:e.kind===`pr`?`rounded-xl border border-border bg-card p-6`:void 0,children:[e.kind===`pr`?(0,G.jsxs)(`h2`,{className:`mb-4 text-[22px] leading-snug font-normal`,children:[`#`,e.number,` `,e.title]}):null,(0,G.jsx)(Dt,{item:e,kindWord:u,commentCount:_,hasDiffStat:h,additions:p,deletions:m}),e.kind===`pr`?null:(0,G.jsx)(`h2`,{className:`mt-2 text-[22px] leading-snug font-normal`,children:e.title}),s,(0,G.jsx)(Ot,{item:e,subNav:a,changes:l}),(0,G.jsx)(kt,{item:e,colors:t,checks:n}),l&&e.kind===`pr`?(0,G.jsx)(Mt,{item:e}):(0,G.jsx)(At,{item:e,colors:t,body:f})]}),e.kind===`pr`?(0,G.jsx)(yt,{number:e.number,onRunAgent:o}):null,c]})}function Mt({item:e}){let i=c(),a=h(e.number),[o,s]=(0,W.useState)(``),[l,d]=(0,W.useState)(null),f=a.data,p=f?.available?f.files.filter(e=>e.path.toLowerCase().includes(o.toLowerCase())):[],m=p.findIndex(e=>e.path===l);(0,W.useEffect)(()=>{p.length>0&&!p.some(e=>e.path===l)&&d(p[0].path)},[f?.available?f.headSha:``,o]);let g=async()=>{let t=f?.available?f.headSha:null,n=w.githubPrChanges(e.number),r=await u(e.number,{refresh:!0});i.setQueryData(n,r),r.available&&t&&t!==r.headSha&&(d(r.files[0]?.path??null),j(`The reviewed revision changed.`))};if(a.isPending)return(0,G.jsx)(`p`,{"aria-live":`polite`,className:`mt-6 text-sm text-muted-foreground`,children:`Loading changed files…`});if(a.isError||!f)return(0,G.jsx)(`p`,{className:`mt-6 text-sm text-danger`,children:`Changed files could not be loaded.`});if(!f.available)return(0,G.jsx)(`p`,{className:`mt-6 text-sm text-muted-foreground`,children:f.reason});let _=p.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??``})),v=t(e.url)?`${e.url}/files`:null,y=p.find(e=>e.path===l);return(0,G.jsxs)(`section`,{"data-slot":`gh-pr-changes`,className:`mt-5 min-w-0`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[(0,G.jsxs)(`strong`,{children:[f.files.length,` changed files`]}),(0,G.jsxs)(`span`,{className:`text-success`,children:[`+`,f.additions]}),(0,G.jsxs)(`span`,{className:`text-danger`,children:[`−`,f.deletions]}),(0,G.jsxs)(`span`,{className:`font-mono text-muted-foreground`,title:f.headSha,children:[`head `,f.headSha.slice(0,8)]}),(0,G.jsx)(n,{type:`button`,variant:`outline`,size:`sm`,className:`ml-auto min-h-11`,onClick:()=>void g(),children:`Refresh`})]}),f.truncated?(0,G.jsxs)(`p`,{role:`status`,className:`mt-3 rounded-md border border-warning/40 bg-warning/10 p-3 text-xs`,children:[f.reason??`This response is incomplete.`,` `,v?(0,G.jsx)(`a`,{href:v,target:`_blank`,rel:`noopener noreferrer`,className:`underline`,children:`Open all files on GitHub`}):null]}):null,(0,G.jsxs)(`div`,{className:`mt-4 grid min-w-0 gap-4 lg:grid-cols-[240px_minmax(0,1fr)]`,children:[(0,G.jsxs)(`aside`,{className:`min-w-0`,children:[(0,G.jsx)(`input`,{"aria-label":`Filter changed files`,value:o,onChange:e=>s(e.target.value),placeholder:`Filter files…`,className:`min-h-11 w-full rounded-md border border-input bg-background px-3 text-sm`}),(0,G.jsx)(`select`,{"aria-label":`Select changed file`,value:l??``,onChange:e=>d(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:p.map(e=>(0,G.jsx)(`option`,{children:e.path},e.path))}),(0,G.jsx)(`ul`,{className:`mt-2 hidden max-h-[60vh] overflow-auto lg:block`,children:p.map(e=>(0,G.jsx)(`li`,{children:(0,G.jsxs)(`button`,{type:`button`,onClick:()=>d(e.path),className:r(`min-h-11 w-full truncate rounded px-2 text-left text-xs`,l===e.path&&`bg-muted font-medium`),title:e.path,children:[e.status,` · `,e.path,` `,(0,G.jsxs)(`span`,{className:`text-success`,children:[`+`,e.additions]}),` `,(0,G.jsxs)(`span`,{className:`text-danger`,children:[`−`,e.deletions]})]})},e.path))})]}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsxs)(`div`,{className:`mb-2 flex justify-end gap-1`,children:[(0,G.jsx)(n,{"aria-label":`Previous file`,variant:`outline`,size:`icon`,className:`min-h-11 min-w-11`,disabled:m<=0,onClick:()=>d(p[m-1]?.path??null),children:(0,G.jsx)(tt,{})}),(0,G.jsx)(n,{"aria-label":`Next file`,variant:`outline`,size:`icon`,className:`min-h-11 min-w-11`,disabled:m<0||m>=p.length-1,onClick:()=>d(p[m+1]?.path??null),children:(0,G.jsx)(I,{size:16})})]}),p.length===0?(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No changed files match this filter.`}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(nt,{files:_.filter(e=>e.path===l),wrap:!0,className:`min-w-0`}),y&&!y.patch?(0,G.jsxs)(`p`,{className:`rounded-b border border-border p-3 text-xs text-muted-foreground`,children:[`Patch unavailable: `,y.patchUnavailableReason??`not-provided`,`.`]}):null]})]})]})]})}function Nt({item:e,colors:t}){let n=g(e.kind,e.number),r=n.data,i=(0,W.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(Pt(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,G.jsxs)(`section`,{"data-slot":`gh-thread-loading`,className:`mt-6 border-t border-border pt-5`,children:[(0,G.jsx)(B,{className:`mb-3 h-3 w-24`}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,G.jsx)(B,{className:`h-14 w-full`}),(0,G.jsx)(B,{className:`h-14 w-full`})]})]}):!r||!r.available?(0,G.jsxs)(`section`,{"data-slot":`gh-thread-error`,className:`mt-6 border-t border-border pt-5 text-xs text-soft-foreground`,children:[(0,G.jsxs)(`span`,{children:[`Couldn’t load comments — `,r?.reason??(n.error instanceof Error?n.error.message:`could not load comments`),`. `]}),(0,G.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,G.jsx)(O,{"aria-hidden":`true`,className:`size-2.5`})]})]}):i.length===0?null:(0,G.jsxs)(`section`,{"data-slot":`gh-thread`,className:`mt-6 border-t border-border pt-5`,children:[(0,G.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,G.jsx)(`ul`,{className:`flex flex-col gap-5`,children:Ft(i).map(e=>e.group===`commits`?(0,G.jsx)(It,{commits:e.commits,colors:t},e.commits[0].id):e.entry.row===`comment`?(0,G.jsx)(Kt,{comment:e.entry.comment},`${e.entry.comment.kind}-${e.entry.comment.id}`):(0,G.jsx)(Lt,{event:e.entry.event,colors:t},e.entry.event.id))}),r.truncated?(0,G.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,G.jsx)(O,{"aria-hidden":`true`,className:`size-2.5`})]}):null]})}var Pt=e=>e.row===`comment`?e.comment.createdAt:e.event.createdAt;function Ft(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 It({commits:e,colors:t}){let[n,r]=(0,W.useState)(!1),i=e[0]?.actor??`?`;return n?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`li`,{"data-slot":`gh-commit-group`,"data-open":`true`,className:`min-w-0`,children:(0,G.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,G.jsx)(`span`,{"aria-hidden":`true`,children:Y.committed}),(0,G.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:i}),(0,G.jsxs)(`span`,{children:[`added `,e.length,` commits`]})]})}),e.map(e=>(0,G.jsx)(Lt,{event:e,colors:t},e.id))]}):(0,G.jsx)(`li`,{"data-slot":`gh-commit-group`,"data-open":`false`,className:`min-w-0`,children:(0,G.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,G.jsx)(`span`,{"aria-hidden":`true`,children:Y.committed}),(0,G.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:i}),(0,G.jsxs)(`span`,{children:[`added `,e.length,` commits`]}),(0,G.jsx)(`span`,{className:`shrink-0`,children:R(e[e.length-1].createdAt)})]})})}var Y={committed:`⚙`,labeled:`◆`,unlabeled:`◇`,assigned:`◍`,unassigned:`◌`,merged:`⑃`,closed:`⊘`,reopened:`⊙`,head_ref_force_pushed:`↻`,"cross-referenced":`↗`,renamed:`✎`};function Lt({event:e,colors:t}){return(0,G.jsxs)(`li`,{"data-slot":`gh-event-row`,"data-kind":e.kind,className:r(`flex min-w-0 items-center gap-1.5 font-mono text-[11px] text-soft-foreground`,e.kind===`merged`&&`text-accent-foreground`),children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0`,children:Y[e.kind]}),(0,G.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:e.actor}),(0,G.jsx)(Ut,{event:e,colors:t}),(0,G.jsx)(`span`,{className:`shrink-0`,children:R(e.createdAt)}),e.url?(0,G.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,G.jsx)(O,{"aria-hidden":`true`,className:`size-2.5`})}):null]})}function Rt({event:e}){return(0,G.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,G.jsx)(`span`,{className:`shrink-0`,children:`committed`}),e.sha?(0,G.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e.sha.slice(0,7)}):null,e.message?(0,G.jsx)(`span`,{className:`truncate font-sans text-foreground`,children:e.message}):null,(0,G.jsx)(Wt,{checks:e.checks})]})}function zt({event:e,colors:t}){return(0,G.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,G.jsx)(`span`,{className:`shrink-0`,children:e.kind===`labeled`?`added the`:`removed the`}),e.label?(0,G.jsx)(`span`,{"data-slot":`gh-event-label`,style:J(e.label.color??t[e.label.name]),className:`max-w-[12rem] truncate rounded-full border px-1.5 py-px font-sans text-[12px]`,children:e.label.name}):null,(0,G.jsx)(`span`,{className:`shrink-0`,children:`label`})]})}function Bt({event:e}){return(0,G.jsxs)(`span`,{className:`truncate`,children:[e.kind===`assigned`?`assigned`:`unassigned`,` `,e.subject??`someone`]})}function Vt({event:e}){return(0,G.jsxs)(`span`,{className:`truncate`,children:[`referenced this in `,e.refNumber?`#${e.refNumber}`:`another thread`,e.refTitle?` ${e.refTitle}`:``]})}var Ht={committed:e=>(0,G.jsx)(Rt,{event:e}),labeled:(e,t)=>(0,G.jsx)(zt,{event:e,colors:t}),unlabeled:(e,t)=>(0,G.jsx)(zt,{event:e,colors:t}),assigned:e=>(0,G.jsx)(Bt,{event:e}),unassigned:e=>(0,G.jsx)(Bt,{event:e}),merged:()=>(0,G.jsx)(`span`,{children:`merged this`}),closed:()=>(0,G.jsx)(`span`,{children:`closed this`}),reopened:()=>(0,G.jsx)(`span`,{children:`reopened this`}),head_ref_force_pushed:()=>(0,G.jsx)(`span`,{children:`force-pushed`}),renamed:e=>(0,G.jsxs)(`span`,{className:`truncate`,children:[`renamed this to `,e.subject??`—`]}),"cross-referenced":e=>(0,G.jsx)(Vt,{event:e})};function Ut({event:e,colors:t}){return Ht[e.kind]?.(e,t)??null}function Wt({checks:e}){return e?(0,G.jsx)(`span`,{"data-slot":`gh-commit-checks`,"data-checks":e,"aria-label":`checks ${e}`,className:r(`shrink-0`,Z[e]),children:X[e]}):null}var Gt={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 Kt({comment:e}){let t=e.reviewState?Gt[e.reviewState]:null;return(0,G.jsxs)(`li`,{"data-slot":`gh-thread-entry`,"data-kind":e.kind,className:`min-w-0`,children:[(0,G.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1.5 font-mono text-[11px] text-soft-foreground`,children:[(0,G.jsx)(qt,{url:e.avatarUrl,login:e.author}),(0,G.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:e.author}),(0,G.jsx)(`span`,{children:R(e.createdAt)}),t?(0,G.jsx)(`span`,{"data-slot":`gh-review-chip`,"data-review-state":e.reviewState,className:r(`rounded-full border px-1.5 py-px font-sans text-[12px] font-medium`,t.tone),children:t.label}):null,(0,G.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,G.jsx)(O,{"aria-hidden":`true`,className:`size-2.5`})})]}),(0,G.jsx)(`div`,{"data-slot":`gh-thread-body`,className:`text-sm`,children:e.body?(0,G.jsx)(Ze,{children:e.body}):(0,G.jsx)(`p`,{className:`text-soft-foreground`,children:`(no body)`})})]})}function qt({url:e,login:t}){let[n,r]=(0,W.useState)(!1);return e&&!n?(0,G.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,G.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 X={passing:`✓`,failing:`✗`,pending:`○`},Z={passing:`text-success`,failing:`text-danger`,pending:`text-muted-foreground`};function Jt({count:e}){return e?(0,G.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,G.jsx)(de,{"aria-hidden":`true`,className:`size-3`}),e]}):null}function Yt({checks:e,url:t}){let n=r(`text-[11px] font-medium`,Z[e],t&&`hover:underline`),i=`${X[e]} checks ${e}`;return t?(0,G.jsx)(`a`,{href:`${t}/checks`,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-checks`,"data-checks":e,className:n,children:i}):(0,G.jsx)(`span`,{"data-slot":`gh-checks`,"data-checks":e,className:n,children:i})}function Xt({checks:e}){return(0,G.jsx)(`span`,{"data-slot":`gh-row-checks`,"data-checks":e,title:`checks ${e}`,"aria-label":`checks ${e}`,className:r(`shrink-0 font-sans text-[11px] font-semibold`,Z[e]),children:X[e]})}function Zt(e){return`${e.kind===`pr`?`Address GitHub pull request`:`Fix GitHub issue`} #${e.number}: ${e.title}\n\n${e.url}`}function Qt(e,t=[]){let n=Zt(e);return e.body?.trim()&&(n+=`\n\n---\n\n${e.body.trim()}`),t.length&&(n+=$t(t)),n}function $t(e){return`\n\nUse these skills where relevant: ${e.join(`, `)}.`}function en(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 tn(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 Q(e,t,n){let r=(n??``).trim();if(!r)return Qt(e,t);let i=Zt(e),a=r.startsWith(i)?i+en(r.slice(i.length),e):en(r,e),o=tn(a,e)?a:`${i}\n\n${a}`;return t.length?o+$t(t):o}function nn(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 rn(e,t,n,r,i={}){return t?{...i,workflow:t,task:Q(e,n,r)}:n.length?{...i,steps:nn(n),task:Q(e,[],r)}:{...i,workflow:`quick-task`,task:Q(e,[],r)}}function an(e){let t=x(),n=S(),r=l(t.data),i=n.data?.defaultRunner,a=xe(e.runner,r,i??r[0]??`claude`),o=b(a),s=n.data?.modelsLocked===!0,{accounts:c,repoAccount:u}=Ie(),d=c.some(t=>t.provider===a&&t.id===e.account)?e.account:null,f=Oe(s?null:e.model,a,n.data?.defaultModels,o.data),p=Ae(a,f,o.data);return{runner:a,runnerExplicit:e.runner!==null,model:f,effort:s?``:Ve(e.effort,p),effortOptions:p,runners:r,defaultRunner:i,canRun:t.isSuccess&&r.length>0,modelsLocked:s,providerPending:t.isPending,providerError:t.isError,accounts:c,account:d,repoAccount:u}}function on(e){return{runner:we(e.runner,e.defaultRunner,e.runnerExplicit),model:e.modelsLocked?void 0:e.model||void 0,effort:e.modelsLocked?void 0:e.effort||void 0}}function sn(e){return{...on(e),...e.account?{agentProfile:e.account}:{}}}function cn({pick:e,onChange:t,disabled:n=!1,accounts:r=!1,layout:i}){let a=(0,W.useRef)(null),o=(0,W.useRef)(null),[s,c]=(0,W.useState)(()=>typeof window<`u`&&window.innerWidth<=767);(0,W.useLayoutEffect)(()=>{let e=a.current;if(i!==`row`||!e)return;let t=()=>{let t=window.innerWidth<=767||e.getBoundingClientRect().width<550,n=document.activeElement;o.current=n instanceof HTMLElement&&e.contains(n)?n:null,c(t)};t();let n=typeof ResizeObserver>`u`?null:new ResizeObserver(t);return n?.observe(e),window.addEventListener(`resize`,t),()=>{n?.disconnect(),window.removeEventListener(`resize`,t)}},[i]),(0,W.useLayoutEffect)(()=>{let e=o.current;o.current=null,e&&e.isConnected&&document.activeElement!==e&&e.focus()},[s]);let l=an(e),{runner:u,model:d,effort:f,effortOptions:p,runners:m,canRun:h,modelsLocked:g}=l,_=S(),v=b(u),y=De(u,v.data,[e.model,_.data?.defaultModels?.[u]]),x=n||!h,C=r?l.accounts:[],w=m.length>1||m.some(e=>ze(C,e))?(0,G.jsx)(ke,{icon:(0,G.jsx)(ie,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,runners:m,value:u,accounts:C,account:r?l.account:null,repoAccount:r?l.repoAccount:void 0,disabled:x,onPick:(n,i)=>t(r?{runner:n,account:i,model:n===u?e.model:null,effort:e.effort}:{runner:n,account:null,model:null,effort:e.effort})},`runner`):null,T=(0,G.jsx)(U,{icon:(0,G.jsx)(P,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,slot:`model-pill`,ariaLabel:`Model`,label:d===``?`Default`:y.find(e=>e.id===d).label,value:d,disabled:x,readOnly:g===!0,disabledHint:g?`Model selection is locked to native coding-agent settings.`:void 0,onPick:n=>{let r=Ae(u,n,v.data);t({...e,model:n,effort:e.effort===null?null:Ve(e.effort,r)})},options:y.map(e=>({value:e.id,label:e.label,desc:e.desc})),status:He(u,v.data,v.isError,v.isFetching)},`model`),E=(0,G.jsx)(U,{icon:(0,G.jsx)(M,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,slot:`effort-pill`,ariaLabel:`Effort`,label:p.find(e=>e.value===f)?.label??`auto`,value:f,disabled:x,readOnly:g===!0,disabledHint:g?`Effort selection is locked to native coding-agent settings.`:void 0,onPick:n=>t({...e,effort:n}),options:p.map(e=>({value:e.value,label:e.label,desc:e.desc}))},`effort`);return i===`row`?(0,G.jsx)(`div`,{ref:a,"data-slot":`engine-row-box`,children:(0,G.jsx)(`div`,{"data-slot":`engine-row`,className:`engine-row`,role:`group`,"aria-label":`Agent settings`,children:(0,G.jsx)(Ne,{children:s?[w,E,T]:[w,T,E]})})}):(0,G.jsxs)(Ne,{children:[w,T,E]})}var ln={workflow:null,skills:[]},un=`cez-followup-selection`;function dn(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 fn(){try{let e=localStorage.getItem(un);return e?dn(JSON.parse(e)):{...ln}}catch{return{...ln}}}function pn(e){try{localStorage.setItem(un,JSON.stringify(e))}catch{}}var $=`cez-followup-prompt:`;function mn(e){try{return localStorage.getItem($+e)??``}catch{return``}}function hn(e,t){try{t===``?localStorage.removeItem($+e):localStorage.setItem($+e,t)}catch{}}function gn({item:e,workflows:r,skills:i,workflow:a,onWorkflowChange:o,selectedSkills:l,onSkillsChange:u,engine:d,onEngineChange:f,queuedRunId:h,onQueued:g}){let y=c(),b=v(),x=_().data?.capabilities.automations===!0,S=e.kind===`pr`?`PR`:`issue`,C=l.filter(e=>i.some(t=>t.name===e)),[T]=(0,W.useState)(()=>Zt(e)),[E,D]=(0,W.useState)(()=>mn(e.url)||T),O=an(d),k=(0,W.useRef)(null),A=(0,W.useRef)(null);(0,W.useEffect)(()=>{hn(e.url,E===T?``:E)},[e.url,E,T]);let M=(0,W.useMemo)(()=>Me(je(b.data?.promptTemplates),{automations:x}),[b.data?.promptTemplates,x]),ee=e=>{let t=k.current,n=Fe({prompt:E,base:T,selectionStart:t?.selectionStart??null,focused:document.activeElement===t,remembered:A.current}),r=Be(E,n,e);D(r.text),A.current=r.caret,requestAnimationFrame(()=>{k.current?.focus(),k.current?.setSelectionRange(r.caret,r.caret)})},N=Pe(M,C),P=(0,W.useRef)(E);P.current=E;let F=(0,W.useRef)(``);(0,W.useEffect)(()=>{let e=Le(P.current,F.current,N,T);F.current=e.applied,e.text!==P.current&&D(e.text)},[N,T]);let I=m({mutationFn:async()=>O.canRun?s(rn(e,a,C,E,sn(O))):null,onSuccess:t=>{if(t===null)return;let n=t;n&&g(e.url,n.id),j(`Added to the queue — ${S} #${e.number}`),C.length>0&&b.data!==void 0&&p({skillUsage:C.reduce((e,t)=>Je(e,t),b.data.skillUsage)}).then(()=>y.invalidateQueries({queryKey:w.uiState})).catch(()=>{}),hn(e.url,``),D(T),F.current=``,y.invalidateQueries({queryKey:w.runs.all})},onError:e=>j(e.message,{tone:`danger`})}),te=e=>{$e({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(),!I.isPending&&O.canRun&&I.mutate())},ne=e=>u(l.includes(e)?l.filter(t=>t!==e):[...l,e]);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`section`,{"data-slot":`gh-hand`,className:`mt-7 rounded-lg border border-border bg-card p-4`,children:[(0,G.jsx)(`h3`,{className:`text-xl font-normal text-foreground`,children:`Hand this to the agent`}),(0,G.jsxs)(`label`,{className:`gh-field gh-prompt-field`,children:[(0,G.jsx)(`span`,{children:`Instructions for the agent`}),(0,G.jsx)(et,{ref:k,"data-slot":`gh-custom-prompt`,"aria-label":`Custom prompt`,"aria-keyshortcuts":`Control+Enter Meta+Enter`,value:E,onChange:e=>D(e.target.value),onSelect:e=>{A.current=e.currentTarget.selectionStart},onKeyDown:te,placeholder:`Instructions for the agent… (#${e.number} and its link are always sent)`,className:`mt-3 min-h-20 text-[13px]`})]}),(0,G.jsx)(ye,{templates:M,onInsert:ee}),(0,G.jsxs)(`div`,{className:`gh-handoff-settings`,children:[(0,G.jsxs)(`div`,{className:`gh-field`,children:[(0,G.jsx)(`span`,{children:`Workflow`}),(0,G.jsx)(_n,{workflows:r,value:a,onChange:o})]}),(0,G.jsxs)(`div`,{className:`gh-field`,children:[(0,G.jsx)(`span`,{children:`Skills · select one or more`}),(0,G.jsx)(yn,{skills:i,skillUsage:b.data?.skillUsage,selected:C,onToggle:ne})]}),C.length>0?(0,G.jsx)(`div`,{"data-slot":`gh-skill-chips`,className:`mt-2.5 flex flex-wrap gap-1.5`,children:C.map(e=>(0,G.jsxs)(`button`,{type:`button`,"data-slot":`gh-skill-chip`,"data-skill":e,onClick:()=>ne(e),title:`Remove this skill`,className:`inline-flex min-h-11 items-center gap-2 rounded-lg border border-border bg-card px-3 text-xs font-medium text-foreground transition-colors hover:bg-danger/10 hover:text-danger`,children:[e,(0,G.jsx)(re,{size:16,"aria-hidden":`true`,className:`size-3`})]},e))}):null,(0,G.jsx)(cn,{layout:`row`,pick:d,onChange:f,disabled:I.isPending||!O.canRun,accounts:!0}),(0,G.jsxs)(`div`,{className:`gh-field`,children:[(0,G.jsx)(`span`,{children:`Account`}),(0,G.jsx)(vn,{resolved:O,disabled:I.isPending||!O.canRun,onPick:e=>f({...d,account:e})})]}),!O.providerPending&&!O.canRun?(0,G.jsxs)(`span`,{"data-slot":`gh-provider-gate`,className:`inline-flex flex-wrap items-center gap-1 text-xs text-muted-foreground`,children:[O.providerError?`Provider authentication could not be verified.`:`Connect an agent provider to run this item.`,(0,G.jsx)(V,{to:`/settings/agents#providers`,className:`font-medium text-foreground underline underline-offset-4`,children:`Configure providers`})]}):null]}),(0,G.jsxs)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:[e.kind===`pr`?`PR`:`Issue`,` number and link remain attached to the task. Edit the prompt before starting. Cmd/Ctrl+Enter submits; Enter adds a new line.`]})]}),(0,G.jsxs)(`div`,{"data-slot":`gh-handoff-actions`,className:`mt-[22px] flex flex-wrap items-center gap-2.5`,children:[t(e.url)?(0,G.jsx)(n,{asChild:!0,variant:`outline`,children:(0,G.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,children:`Open in GitHub`})}):null,(0,G.jsxs)(n,{variant:`primary`,"data-action":`gh-run`,disabled:I.isPending||!O.canRun,onClick:()=>I.mutate(),children:[(0,G.jsx)(fe,{"aria-hidden":`true`,className:`size-3.5`}),`Run agent on this `,S]}),(0,G.jsx)(`kbd`,{"aria-hidden":`true`,className:`rounded-[5px] border border-b-2 border-border bg-card px-[5px] py-px font-mono text-[11px] font-medium text-muted-foreground`,children:Qe()}),h?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`span`,{"data-slot":`gh-queued`,className:`flex items-center gap-1 text-xs font-medium text-success`,children:[(0,G.jsx)(L,{size:16,"aria-hidden":`true`,className:`size-3.5`}),`queued`]}),(0,G.jsx)(V,{to:`/tasks/${h}`,"data-slot":`gh-view-run`,className:`text-xs font-semibold text-accent-text hover:underline`,children:`View task →`})]}):null]})]})}function _n({workflows:e,value:t,onChange:n}){let[i,a]=(0,W.useState)(!1),[o,s]=(0,W.useState)(``),c=(0,W.useRef)(null),l=We(e,o);return(0,G.jsxs)(A,{open:i,onOpenChange:e=>{a(e),e||s(``)},children:[(0,G.jsx)(k,{asChild:!0,children:(0,G.jsxs)(`button`,{type:`button`,"data-slot":`gh-workflow-trigger`,"aria-label":`Choose a workflow`,className:r(Re,t&&`border-foreground/60 font-mono text-[11px] font-semibold text-foreground`),children:[(0,G.jsx)(te,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0 text-accent-icon`}),(0,G.jsx)(`span`,{className:`min-w-0 max-w-44 truncate`,children:t??`workflow`}),(0,G.jsx)(se,{size:16,"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,G.jsx)(D,{align:`start`,sideOffset:8,className:`w-[320px] max-w-[calc(100vw-2rem)] p-0`,children:(0,G.jsxs)(Te,{shouldFilter:!1,children:[(0,G.jsx)(Ee,{placeholder:`search workflows…`,value:o,onValueChange:s,onInput:()=>c.current?.scrollTo(0,0)}),(0,G.jsxs)(be,{ref:c,"data-slot":`gh-workflow-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[l.length===0?(0,G.jsx)(Se,{children:`Nothing matches.`}):null,(0,G.jsx)(H,{children:l.map(e=>{let r=t===e.name;return(0,G.jsxs)(Ue,{value:`workflow ${e.name}`,keywords:Ge(e.name,e.description),"data-slot":`gh-workflow-option`,"data-workflow":e.name,onSelect:()=>{n(r?null:e.name),a(!1)},children:[(0,G.jsx)(`span`,{className:`shrink-0 font-mono text-xs`,children:e.name}),e.description?(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,r?(0,G.jsx)(L,{size:16,"aria-hidden":`true`,className:`ml-auto size-3.5 shrink-0 text-link-foreground`}):null]},e.name)})})]})]})})]})}function vn({resolved:e,disabled:t,onPick:n}){let r=e.accounts.filter(t=>t.provider===e.runner),i=[...r.some(e=>e.id==="default")?[]:[{value:Ce,label:`Default`}],...r.map(e=>({value:e.id,label:e.label,desc:e.configDir}))],a=e.account??e.repoAccount?.[e.runner]??`default`;return(0,G.jsx)(U,{icon:(0,G.jsx)(ce,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),slot:`account-pill`,ariaLabel:`Account`,label:i.find(e=>e.value===a)?.label??`Default`,value:a,options:i,disabled:t,onPick:n})}function yn({skills:e,skillUsage:t,selected:n,onToggle:i}){let[a,o]=(0,W.useState)(!1),[s,c]=(0,W.useState)(``),[l,u]=(0,W.useState)(null),d=(0,W.useRef)(null),{mostUsed:f,project:p,global:m,ranked:h}=Ye(e,s,t),g=(e,t)=>{let a=n.includes(e.name);return(0,G.jsxs)(Ue,{value:`skill ${e.name} ${e.path}`,keywords:Ge(e.name,e.description),"data-slot":`gh-skill-option`,"data-skill":e.name,"data-selected":a?`true`:void 0,onSelect:()=>i(e.name),children:[(0,G.jsx)(`span`,{className:r(`shrink-0 font-mono text-xs`,t&&`font-semibold`),children:e.name}),e.description?(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,(0,G.jsx)(`button`,{type:`button`,"data-slot":`gh-skill-view`,"aria-label":`View skill ${e.name}`,title:`View skill`,onClick:t=>{t.preventDefault(),t.stopPropagation(),u(e)},className:`ml-auto shrink-0 rounded-sm p-0.5 text-soft-foreground transition-colors hover:text-foreground`,children:(0,G.jsx)(le,{"aria-hidden":`true`,className:`size-3.5`})}),a?(0,G.jsx)(L,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-link-foreground`}):null]},e.path)};return e.length===0?null:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Xe,{skill:l,onClose:()=>u(null)}),(0,G.jsxs)(A,{open:a,onOpenChange:e=>{o(e),e||c(``)},children:[(0,G.jsx)(k,{asChild:!0,children:(0,G.jsxs)(`button`,{type:`button`,"data-slot":`gh-skills-trigger`,"aria-label":`Choose skills`,className:r(Re,n.length>0&&`border-foreground/60 font-semibold text-foreground`),children:[(0,G.jsx)(oe,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0 text-accent-icon`}),`skills`,n.length>0?` · ${n.length}`:``,(0,G.jsx)(se,{size:16,"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,G.jsx)(D,{align:`start`,sideOffset:8,className:`w-[336px] max-w-[calc(100vw-2rem)] p-0`,children:(0,G.jsxs)(Te,{shouldFilter:!1,children:[(0,G.jsx)(Ee,{placeholder:`search skills…`,value:s,onValueChange:c,onInput:()=>d.current?.scrollTo(0,0)}),(0,G.jsxs)(be,{ref:d,"data-slot":`gh-skill-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[(h?h.length===0:f.length===0&&p.length===0&&m.length===0)?(0,G.jsx)(Se,{children:`Nothing matches.`}):null,h?h.length>0?(0,G.jsx)(H,{children:h.map(e=>g(e,Ke(e)))}):null:(0,G.jsxs)(G.Fragment,{children:[f.length>0?(0,G.jsx)(H,{heading:`Most used`,children:f.map(e=>g(e,Ke(e)))}):null,p.length>0?(0,G.jsx)(H,{heading:`Project skills`,children:p.map(e=>g(e,!0))}):null,m.length>0?(0,G.jsx)(H,{heading:`Global`,children:m.map(e=>g(e,!1))}):null]})]})]})})]})]})}var bn=new WeakMap;function xn(){let e=fn(),t={workflow:e.workflow,selectedSkills:e.skills,engine:{runner:null,model:null,effort:null,account:null},queued:new Map},n=new Set;return{snapshot:()=>t,subscribe:e=>(n.add(e),()=>{n.delete(e)}),update:e=>{t={...t,...e},(e.workflow!==void 0||e.selectedSkills!==void 0)&&pn({workflow:t.workflow,skills:[...t.selectedSkills]}),n.forEach(e=>e())}}}function Sn(){let e=c(),{projectId:t}=d(),n=bn.get(e);n||bn.set(e,n=new Map);let r=n.get(t);r||n.set(t,r=xn());let{snapshot:i,subscribe:a,update:o}=r,s=(0,W.useSyncExternalStore)(a,i,i),l=y(),u=C(),f=v(),p=l.data?.workflows;(0,W.useEffect)(()=>{p&&s.workflow!==null&&!p.some(e=>e.name===s.workflow)&&o({workflow:null})},[o,p,s.workflow]);let m=(0,W.useMemo)(()=>qe(u.data??[],f.data?.skillUsage),[u.data,f.data?.skillUsage]);return{...s,workflows:l,skillList:m,setWorkflow:e=>o({workflow:e}),setSelectedSkills:e=>o({selectedSkills:e}),setEngine:e=>o({engine:e}),onQueued:(e,t)=>o({queued:new Map(i().queued).set(e,t)})}}export{Jt as a,Ft as c,J as d,St as f,Xt as i,bt as l,gn as n,jt as o,Qt as r,Ct as s,Sn as t,xt as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{E as t,t as n,u as r}from"./button-CS5tOblf.js";import{i,t as a}from"./react-runtime-CCIEwYL0.js";import{A as o,Kr as s,T as c,Xt as l,i as u,qt as d}from"./project-scope-context-DSkcNKO7.js";import{$t as f,Pt as p,Rt as ee,jt as te,n as ne}from"./queries-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{E as t,t as n,u as r}from"./button-CS5tOblf.js";import{i,t as a}from"./react-runtime-CCIEwYL0.js";import{A as o,Kr as s,T as c,Xt as l,i as u,qt as d}from"./project-scope-context-DSkcNKO7.js";import{$t as f,Pt as p,Rt as ee,jt as te,n as ne}from"./queries-sEwd08S5.js";import{n as m}from"./toaster-CRVRHlMR.js";import{C as h,Q as g,S as re,X as _,a as ie,ct as ae,dt as oe,l as se,lt as v,mt as y,n as b,rt as ce,st as x,u as le,x as S,y as C}from"./design-icons-DmYTv2r1.js";import{i as w,p as ue,r as T,t as E}from"./dropdown-menu-D7f0O7xR.js";import{a as D,c as O,i as k,n as A,o as j,r as M,s as N,t as P}from"./alert-dialog-h-3h9B4l.js";import{i as F,o as de,r as I,s as L,t as R}from"./dialog-Dw7fMdDQ.js";import{t as z}from"./input-DIwJvCgi.js";import{_ as fe,a as B,d as pe,g as me,h as V,i as he,l as ge,m as H,o as _e,p as ve,r as ye,s as be,t as U,v as W}from"./sortable.esm-zp_qkYGV.js";import{i as G,l as xe,s as Se}from"./skills-DFBiAuJG.js";import{t as Ce}from"./centered-state-BmsqxbI8.js";import{O as we,et as K}from"./index-CyyH67ZV.js";import{n as Te}from"./skill-empty-hint-YDmkqgo-.js";var q=e(i(),1);function J(e){let t=[];for(let n of e){if(n.command||!n.skill||n.prompt!==void 0&&n.prompt!==`{{task}}`||n.name!==void 0&&n.name!==n.skill||n.timeoutMs!==void 0||n.model||n.effort!==void 0||n.runner||n.agentProfile||n.allowedTools||n.bashAllowlist||n.onFail)return null;t.push(n.skill)}return t.length?t:null}function Ee(e,t){let n=new Set(t.map(e=>e.id)),r=e;for(let t=2;n.has(r);t++)r=`${e}-${t}`;return{id:r,name:e,skill:e,prompt:`{{task}}`}}function De(e,t,n){let r=[...e];return r.splice(Math.max(0,Math.min(n,r.length)),0,t),r}function Oe(e,t,n){if(t===n||t<0||t>=e.length||n<0||n>=e.length)return[...e];let r=[...e],[i]=r.splice(t,1);return i===void 0?[...e]:(r.splice(n,0,i),r)}function ke(e,t){return e.filter((e,n)=>n!==t)}function Y(e){let t=String(e),n=/^[A-Za-z0-9._][A-Za-z0-9 ._/-]*$/.test(t)&&!t.endsWith(` `),r=/^(true|false|yes|no|on|off|null|~)$/i.test(t)||/^[-+.]?\d/.test(t);return n&&!r?t:JSON.stringify(t)}function X(e,t,n){let r=` `.repeat(n);return t.includes(`
|
|
2
2
|
`)?[`${r}${e}: |`,...t.split(`
|
|
3
3
|
`).map(e=>`${r} ${e}`)]:[`${r}${e}: ${Y(t)}`]}function Ae(e){let t=[];return e.name&&e.name!==e.id&&t.push(` name: ${Y(e.name)}`),e.skill&&t.push(` skill: ${Y(e.skill)}`),t}function Z(e){let t=[];return e.model&&t.push(` model: ${Y(e.model)}`),e.timeoutMs!==void 0&&t.push(` timeoutMs: ${e.timeoutMs}`),e.effort!==void 0&&t.push(` effort: ${Y(e.effort)}`),e.runner&&t.push(` runner: ${Y(e.runner)}`),e.agentProfile&&t.push(` agentProfile: ${Y(e.agentProfile)}`),t}function je(e){let t=[];return e.allowedTools&&t.push(` allowedTools: [${e.allowedTools.map(Y).join(`, `)}]`),e.bashAllowlist&&t.push(` bashAllowlist: [${e.bashAllowlist.map(Y).join(`, `)}]`),t}function Me(e){return e.onFail?[` onFail:`,` retry: ${Y(e.onFail.retry)}`,` max: ${e.onFail.max??2}`]:[]}function Ne(e){return[` - id: ${Y(e.id)}`,...Ae(e),...e.prompt?X(`prompt`,e.prompt,4):[],...Z(e),...je(e),...e.command?X(`command`,e.command,4):[],...Me(e)]}function Pe(e,t,n){let r=[`name: ${Y(e.trim()||`my-workflow`)}`];t.trim()&&r.push(...X(`description`,t.trim(),0));let i=J(n);if(i){r.push(`skills:`);for(let e of i)r.push(` - ${Y(e)}`)}else if(n.length){r.push(`steps:`);for(let e of n)r.push(...Ne(e))}else r.push(`skills: []`);return`${r.join(`
|
|
4
4
|
`)}\n`}function Fe(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||`workflow`}function Ie(e){let t=J(e)?`skill`:`step`;return`${e.length} ${t}${e.length===1?``:`s`}`}function Le(e,t){let n=new Set,r=[];for(let t of e.steps.slice(0,8)){let e=t.id||`step`,i=e;for(let t=2;n.has(i);t++)i=`${e}-${t}`;n.add(i),r.push({...t,id:i})}return{name:e.name?.trim()||t,steps:r}}function Re(e,t,n){let r=J(n);return{name:e.trim(),...t.trim()?{description:t.trim()}:{},...r?{skills:r}:{steps:[...n]}}}var Q=a();function ze({workflows:e,draft:t,trimmedName:n,nameRef:r,onDraft:i,onLoadWorkflow:a}){return(0,Q.jsxs)(`section`,{"data-slot":`wb-metadata`,className:`flex min-w-0 flex-col gap-3`,children:[(0,Q.jsxs)(`div`,{"data-slot":`wb-load`,className:`flex flex-col items-start gap-2`,children:[(0,Q.jsx)(`label`,{htmlFor:`workflow-load`,className:`text-xs text-muted-foreground`,children:`Load an existing workflow`}),(0,Q.jsxs)(`div`,{className:`relative max-w-full`,children:[(0,Q.jsx)(le,{"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3.5 size-4 text-muted-foreground`}),(0,Q.jsxs)(`select`,{id:`workflow-load`,value:e.some(e=>e.name===n)?n:``,onChange:t=>{let n=e.find(e=>e.name===t.target.value);n&&a(n)},className:`h-11 max-w-full rounded-lg border border-border bg-card pl-9 pr-3 text-xs font-medium appearance-none focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,Q.jsx)(`option`,{value:``,disabled:!0,children:`Choose a workflow`}),e.map(e=>(0,Q.jsx)(`option`,{value:e.name,"data-slot":`wb-load-option`,"data-name":e.name,children:e.name},e.name))]})]})]}),(0,Q.jsx)(`label`,{htmlFor:`workflow-name`,className:`text-xs font-semibold`,children:`Workflow name`}),(0,Q.jsx)(z,{id:`workflow-name`,ref:r,"data-slot":`wb-name`,"aria-label":`Workflow name`,spellCheck:!1,value:t.name,onChange:e=>i({...t,name:e.target.value}),className:`h-12 bg-card text-sm`}),(0,Q.jsx)(`label`,{htmlFor:`workflow-description`,className:`text-xs font-semibold`,children:`Description`}),(0,Q.jsx)(K,{id:`workflow-description`,"data-slot":`wb-description`,"aria-label":`Description`,value:t.description,onChange:e=>i({...t,description:e.target.value}),className:`min-h-[72px] bg-card p-3.5 text-sm`})]})}function Be({savedFile:e,autoOpen:t,onImportToggle:r,onExport:i,onAutoToggle:a,onDeleteRequest:o}){return(0,Q.jsxs)(`div`,{"data-slot":`wb-actions`,className:`grid grid-cols-[max-content_max-content] items-center justify-start gap-2 sm:flex sm:flex-wrap [&_button]:min-h-11 [&_button]:border [&_button]:border-border [&_button]:bg-card`,children:[(0,Q.jsxs)(n,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-import`,className:`col-span-2 justify-self-start`,onClick:r,children:[(0,Q.jsx)(v,{"aria-hidden":`true`,className:`size-3`}),`Import`]}),(0,Q.jsxs)(n,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-export`,className:`col-span-2 justify-self-start`,title:`Download workflow.yaml`,onClick:i,children:[(0,Q.jsx)(S,{"aria-hidden":`true`,className:`size-3`}),`Export`]}),(0,Q.jsxs)(n,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-auto`,"aria-expanded":t,title:`Describe a chain — the agent builds it`,onClick:a,children:[(0,Q.jsx)(oe,{"aria-hidden":`true`,className:`size-3`}),`Auto`]}),e?(0,Q.jsxs)(n,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-delete`,className:`text-danger hover:text-danger`,title:`Delete the saved workflow file`,onClick:o,children:[(0,Q.jsx)(x,{"aria-hidden":`true`,className:`size-3`}),`Delete`]}):null]})}function Ve({text:e,onTextChange:t,pending:r,onRun:i,onCancel:a}){return(0,Q.jsxs)(`div`,{"data-slot":`wb-auto-panel`,className:`rounded-xl border border-border bg-card p-5 [&_button]:min-h-11`,children:[(0,Q.jsx)(`h2`,{className:`text-lg font-normal`,children:`Build a chain from a prompt`}),(0,Q.jsx)(`p`,{className:`mt-4 text-[13px] leading-relaxed text-muted-foreground`,children:`Describe the outcome. An agent proposes a title and ordered skill/check steps. Review the result, edit it, then Save.`}),(0,Q.jsx)(K,{"data-slot":`wb-auto-text`,"aria-label":`Describe the chain to build`,rows:3,autoFocus:!0,placeholder:`e.g. Fix the bug, run the tests, then review the diff for regressions.`,value:e,onChange:e=>t(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),i())},className:`mt-4 min-h-[108px] bg-background p-4 text-sm`}),(0,Q.jsxs)(`div`,{className:`mt-3 flex items-center gap-1.5`,children:[(0,Q.jsxs)(n,{type:`button`,variant:`primary`,size:`sm`,"data-slot":`wb-auto-run`,disabled:r||e.trim()===``,onClick:i,children:[(0,Q.jsx)(oe,{"aria-hidden":`true`,className:`size-3`}),r?`Building…`:`Build chain`]}),(0,Q.jsxs)(n,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-auto-cancel`,onClick:a,children:[(0,Q.jsx)(y,{"aria-hidden":`true`,className:`size-4`}),`Cancel`]})]}),(0,Q.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:`Creates an editable draft. Review the generated name and steps before saving.`})]})}function He({open:e,onOpenChange:t,text:r,onTextChange:i,error:a,pending:o,onRun:s,onCancel:c}){return(0,Q.jsx)(R,{open:e,onOpenChange:t,children:(0,Q.jsxs)(I,{showCloseButton:!1,"data-slot":`wb-import-panel`,className:`max-md:translate-x-0 max-md:translate-y-0 sm:max-w-[660px] rounded-xl border border-border bg-card p-5 [&_button]:min-h-11`,children:[(0,Q.jsx)(L,{className:`text-xl font-normal`,children:`Import workflow YAML`}),(0,Q.jsx)(F,{className:`sr-only`,children:`Paste a portable workflow definition to import.`}),(0,Q.jsx)(K,{"data-slot":`wb-import-text`,"aria-label":`Workflow YAML to import`,rows:4,spellCheck:!1,placeholder:`name: my-flow
|
package/web/dist/index.html
CHANGED
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
}
|
|
48
48
|
})()
|
|
49
49
|
</script>
|
|
50
|
-
<script type="module" crossorigin src="/assets/index-
|
|
50
|
+
<script type="module" crossorigin src="/assets/index-CyyH67ZV.js"></script>
|
|
51
51
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-QTnfLwEv.js">
|
|
52
52
|
<link rel="modulepreload" crossorigin href="/assets/react-runtime-CCIEwYL0.js">
|
|
53
53
|
<link rel="modulepreload" crossorigin href="/assets/bundle-mjs-BT31bpU6.js">
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
<link rel="modulepreload" crossorigin href="/assets/useQuery-8pHkglP4.js">
|
|
60
60
|
<link rel="modulepreload" crossorigin href="/assets/ws-CEQH0TUT.js">
|
|
61
61
|
<link rel="modulepreload" crossorigin href="/assets/toaster-CRVRHlMR.js">
|
|
62
|
-
<link rel="modulepreload" crossorigin href="/assets/queries-
|
|
62
|
+
<link rel="modulepreload" crossorigin href="/assets/queries-sEwd08S5.js">
|
|
63
63
|
<link rel="modulepreload" crossorigin href="/assets/cez-idle-NomdGTfa.js">
|
|
64
64
|
<link rel="modulepreload" crossorigin href="/assets/createLucideIcon-BHp8sXmF.js">
|
|
65
65
|
<link rel="modulepreload" crossorigin href="/assets/es2015-CX0rgbM5.js">
|
|
@@ -67,24 +67,24 @@
|
|
|
67
67
|
<link rel="modulepreload" crossorigin href="/assets/dist-DvNdR7gM.js">
|
|
68
68
|
<link rel="modulepreload" crossorigin href="/assets/dropdown-menu-D7f0O7xR.js">
|
|
69
69
|
<link rel="modulepreload" crossorigin href="/assets/attention-VmnPpwJx.js">
|
|
70
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
70
|
+
<link rel="modulepreload" crossorigin href="/assets/use-desktop-DeG3Ha7y.js">
|
|
71
71
|
<link rel="modulepreload" crossorigin href="/assets/nav-row-styles-CEA9c88Q.js">
|
|
72
72
|
<link rel="modulepreload" crossorigin href="/assets/eye-B8okNWXU.js">
|
|
73
73
|
<link rel="modulepreload" crossorigin href="/assets/format-BNCkW110.js">
|
|
74
74
|
<link rel="modulepreload" crossorigin href="/assets/play-CmVAj_fu.js">
|
|
75
|
-
<link rel="modulepreload" crossorigin href="/assets/reference-chip-
|
|
75
|
+
<link rel="modulepreload" crossorigin href="/assets/reference-chip-DMgD6d01.js">
|
|
76
76
|
<link rel="modulepreload" crossorigin href="/assets/alert-dialog-h-3h9B4l.js">
|
|
77
77
|
<link rel="modulepreload" crossorigin href="/assets/dialog-Dw7fMdDQ.js">
|
|
78
78
|
<link rel="modulepreload" crossorigin href="/assets/input-DIwJvCgi.js">
|
|
79
79
|
<link rel="modulepreload" crossorigin href="/assets/project-router-BFKfAFvq.js">
|
|
80
|
-
<link rel="modulepreload" crossorigin href="/assets/agent-accounts-
|
|
80
|
+
<link rel="modulepreload" crossorigin href="/assets/agent-accounts-DnFoFuBJ.js">
|
|
81
81
|
<link rel="modulepreload" crossorigin href="/assets/skills-DFBiAuJG.js">
|
|
82
|
-
<link rel="modulepreload" crossorigin href="/assets/prompt-template-menu-
|
|
82
|
+
<link rel="modulepreload" crossorigin href="/assets/prompt-template-menu-B8VpFfKO.js">
|
|
83
83
|
<link rel="modulepreload" crossorigin href="/assets/sortable.esm-zp_qkYGV.js">
|
|
84
84
|
<link rel="modulepreload" crossorigin href="/assets/centered-state-BmsqxbI8.js">
|
|
85
85
|
<link rel="modulepreload" crossorigin href="/assets/lib-BxQXEXDF.js">
|
|
86
86
|
<link rel="modulepreload" crossorigin href="/assets/chunk-BO2N2NFS-DE6qKn3r.js">
|
|
87
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
87
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CrlovI4F.css">
|
|
88
88
|
</head>
|
|
89
89
|
<body>
|
|
90
90
|
<div id="root"></div>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./button-CS5tOblf.js";import{i as n,t as r}from"./react-runtime-CCIEwYL0.js";import{i}from"./project-scope-context-DSkcNKO7.js";import{M as a,ct as o,r as s}from"./design-icons-DmYTv2r1.js";import{n as c}from"./diff-controls-BHF0Pvdc.js";import{u as l}from"./reference-chip-Drpbf-MP.js";import{t as u}from"./project-router-BFKfAFvq.js";import{t as d}from"./centered-state-BmsqxbI8.js";import{Nt as f,yt as p}from"./index-s7PhnzDS.js";import{t as m}from"./diff-D81T6FlH.js";var h=e(n(),1),g=r();function _({commit:e,sha:n,backTo:r,backLabel:_,slot:v,className:y,diffClassName:b}){let x=p(),[S,C]=(0,h.useState)(`unified`),[w,T]=(0,h.useState)(!1),E=e.isError&&e.error instanceof i&&e.error.status===409,D=x?S:`unified`,O=!x||w;return(0,g.jsxs)(`section`,{"data-slot":v,"data-sha":n,className:y,children:[(0,g.jsxs)(`div`,{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:[(0,g.jsx)(t,{asChild:!0,variant:`ghost`,size:`sm`,"data-slot":`commit-back`,children:(0,g.jsxs)(u,{to:r,children:[(0,g.jsx)(s,{size:16,"aria-hidden":`true`}),_]})}),e.data?(0,g.jsx)(f,{stat:e.data.stat}):null,(0,g.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,g.jsx)(c,{mode:S,wrap:w,onModeChange:C,onWrapChange:T})})]}),e.isPending?(0,g.jsx)(`p`,{"data-slot":`commit-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading commit…`}):e.isError?(0,g.jsx)(d,{icon:E?(0,g.jsx)(l,{}):(0,g.jsx)(o,{size:16}),tone:E?`neutral`:`danger`,heading:`h2`,title:E?`Commit not found`:`Could not load the commit`,subtitle:e.error.message}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(`div`,{"data-slot":`commit-meta`,className:`border-b border-border px-4 py-3 md:px-6`,children:[(0,g.jsx)(`h2`,{className:`text-sm font-semibold`,children:e.data.subject}),(0,g.jsxs)(`p`,{className:`mt-0.5 text-[11px] text-soft-foreground`,children:[e.data.author,` · `,e.data.when,` ·`,` `,(0,g.jsx)(`span`,{className:`font-mono select-all`,children:e.data.sha})]})]}),e.data.files.length===0?(0,g.jsx)(d,{icon:(0,g.jsx)(a,{size:16}),tone:`neutral`,heading:`h2`,title:`No file changes`,subtitle:`This commit carries no diff of its own — a merge commit's changes live on the commits it merged.`}):(0,g.jsx)(`div`,{className:b,children:(0,g.jsx)(m,{files:e.data.files,mode:D,wrap:O,className:`min-w-0`})})]})]})}export{_ as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{d as t,t as n,u as r}from"./button-CS5tOblf.js";import{i,t as a}from"./react-runtime-CCIEwYL0.js";import{Z as o}from"./popover-G6KGT-qq.js";import{E as s,I as c,M as l,d as u,lt as d}from"./design-icons-DmYTv2r1.js";import{t as f}from"./createLucideIcon-BHp8sXmF.js";import{n as p,r as m,t as h}from"./diff-controls-BHF0Pvdc.js";import{i as g,p as _,r as v,t as y}from"./dropdown-menu-D7f0O7xR.js";import{Nt as b,nn as x}from"./index-s7PhnzDS.js";var S=f(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),C=f(`file`,[[`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:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),w=e(i(),1),T=a();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:i}){let[a,o]=(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":a?`open`:`closed`,"aria-expanded":a,onClick:()=>o(e=>!e),className:`flex min-h-11 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)(u,{size:16,"aria-hidden":`true`,className:r(`size-3.5 shrink-0 transition-transform motion-reduce:transition-none`,a&&`rotate-90`)}),(0,T.jsx)(s,{size:16,"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})]}),a?(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:i},e.path)),e.files.map(e=>(0,T.jsx)(A,{file:e,depth:t+1,selected:n,onSelect:i},e.path))]}):null]})}var k={added:`text-success`,deleted:`text-danger`};function A({file:e,depth:t,selected:n,onSelect:i}){let a=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":a?`true`:void 0,onClick:()=>i(e.path),className:r(`flex min-h-11 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left hover:bg-muted`,a?`bg-muted font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${24+t*14}px`},children:[(0,T.jsx)(C,{"aria-hidden":`true`,className:r(`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,healthReady:t,branch:i,stat:a,mode:o,wrap:s,preview:c=!1,onModeChange:l,onWrapChange:u,onPreviewChange:d,onAction:f}){return(0,T.jsxs)(`div`,{"data-slot":`git-toolbar`,"data-health-ready":t,className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 px-[18px] py-[22px] md:px-9 [&_button]:min-h-11`,children:[i?(0,T.jsx)(h,{branch:i}):null,a?(0,T.jsx)(R,{stat:a}):null,d?(0,T.jsx)(`span`,{className:`ml-auto flex items-center`,children:(0,T.jsx)(m,{preview:c,onPreviewChange:d})}):null,(0,T.jsxs)(`span`,{className:r(`flex items-center gap-1`,d?`max-md:ml-auto`:`ml-auto`),children:[(0,T.jsx)(`span`,{className:`hidden items-center gap-1 md:flex`,children:(0,T.jsx)(p,{mode:o,wrap:s,onModeChange:l,onWrapChange:u})}),e.secondary.map(e=>(0,T.jsx)(L,{action:e,variant:`outline`,onAction:f},e.id)),(0,T.jsx)(L,{action:e.primary,variant:`primary`,onAction:f}),e.menu.length>0?(0,T.jsxs)(y,{children:[(0,T.jsx)(_,{asChild:!0,children:(0,T.jsx)(n,{variant:`ghost`,size:`icon-sm`,"aria-label":`More git actions`,children:(0,T.jsx)(S,{"aria-hidden":`true`})})}),(0,T.jsx)(v,{align:`end`,"data-slot":`git-toolbar-menu`,children:e.menu.map(e=>(0,T.jsxs)(g,{disabled:!e.enabled,title:e.reason,onSelect:()=>f(e.id),children:[I[e.id],e.label]},e.id))})]}):null]})]})}var I={commit:(0,T.jsx)(l,{size:16,"aria-hidden":`true`}),push:(0,T.jsx)(d,{size:16,"aria-hidden":`true`}),"create-pr":(0,T.jsx)(c,{size:16,"aria-hidden":`true`}),"view-pr":(0,T.jsx)(o,{"aria-hidden":`true`}),"open-terminal":(0,T.jsx)(x,{"aria-hidden":`true`})};function L({action:e,variant:r,onAction:i}){return e.id===`view-pr`?t(e.href)?(0,T.jsx)(n,{asChild:!0,variant:r,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)(n,{variant:r,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)(n,{variant:r,size:`sm`,"data-action":e.id,disabled:!e.enabled,title:e.enabled?void 0:e.reason,onClick:()=>i(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)(b,{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{E as i,F as n,P as r,R as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{E as t,L as n,M as r,t as i,u as a}from"./button-CS5tOblf.js";import{i as o,t as s}from"./react-runtime-CCIEwYL0.js";import{$ as c,Bn as l,Kr as u,Q as d,X as f,et as p,ti as m,tn as h}from"./project-scope-context-DSkcNKO7.js";import{$t as g,D as _,E as v,N as y,P as ee,Pt as te,X as b,j as ne,k as x,l as S,n as C}from"./queries-D2MPDhtr.js";import{G as w,R as T,i as E,r as D,t as O}from"./popover-G6KGT-qq.js";import{n as k}from"./toaster-CRVRHlMR.js";import{I as A,L as j,Q as M,Z as N,ct as P,l as F,m as I,r as re,u as L}from"./design-icons-DmYTv2r1.js";import{l as ie,n as ae}from"./nav-row-styles-CEA9c88Q.js";import{a as R,i as z}from"./format-BNCkW110.js";import{_ as oe,a as se,d as B,f as ce,h as le,i as ue,m as de,n as fe,o as pe,p as me,r as he,v as ge}from"./prompt-template-menu-D4-inlE4.js";import{r as _e,t as V}from"./project-router-BFKfAFvq.js";import"./attention-VmnPpwJx.js";import{B as ve,I as ye,P as be,R as xe,z as H}from"./agent-accounts-BNlpWTOY.js";import{t as U}from"./centered-state-BmsqxbI8.js";import{C as Se,Xt as Ce,Z as we,at as Te,hn as Ee,it as De,mn as Oe,s as ke,yt as Ae}from"./index-s7PhnzDS.js";import{a as je,d as Me,f as Ne,i as Pe,l as Fe,n as Ie,o as Le,r as Re,s as ze,t as Be,u as W}from"./use-hand-to-agent-state-BOTjwkGM.js";import{t as G}from"./tab-link-DDpdYMnv.js";var K=e(o(),1),q=`cez-github-list-width`;function J(e){if(e==null||e===``||typeof e==`string`&&e.trim()===``)return 360;let t=typeof e==`number`?e:Number(e);return Number.isFinite(t)?Math.min(520,Math.max(280,Math.round(t))):360}function Ve(){try{let e=localStorage.getItem(q);return e===null?360:J(e)}catch{return 360}}function He(e){try{localStorage.setItem(q,String(J(e)))}catch{}}var Y=s();function Ue({number:e,repo:t}){let n=r();return(0,Y.jsx)(We,{number:e,repo:t,scope:n},JSON.stringify([n,t,e]))}function We({number:e,repo:t,scope:n}){let r=(0,K.useId)(),a=(0,K.useId)(),[o,s]=(0,K.useState)(!1),c=o?Ee:Oe,u=b(n,!0,n==="default"),d=S(`#${e}`,!0),f=(0,K.useMemo)(()=>de(w(u.data??[],d.data?.pages.flatMap(e=>e.runs)??[]),e,t,n),[u.data,d.data,e,t,n]);return(0,Y.jsxs)(`section`,{"aria-labelledby":r,className:`mt-4 min-w-0 rounded-lg border border-border p-3`,children:[(0,Y.jsx)(`h3`,{id:r,className:`text-xs font-semibold text-muted-foreground`,children:(0,Y.jsxs)(`button`,{type:`button`,"aria-expanded":o,"aria-controls":a,onClick:()=>s(e=>!e),className:`flex min-h-11 w-full items-center gap-2 rounded-md px-2 text-left hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,children:[(0,Y.jsx)(c,{"aria-hidden":`true`,className:`size-4 shrink-0`}),(0,Y.jsxs)(`span`,{children:[`Linked tasks`,u.data?` (${f.length}${d.hasNextPage||d.isError?`+`:``})`:``]})]})}),(0,Y.jsx)(`div`,{id:a,children:o?(0,Y.jsxs)(Y.Fragment,{children:[u.isPending?(0,Y.jsx)(`p`,{role:`status`,className:`mt-2 text-xs text-muted-foreground`,children:`Loading linked tasks…`}):null,u.isError?(0,Y.jsxs)(`div`,{className:`mt-2 text-xs text-muted-foreground`,children:[(0,Y.jsx)(`p`,{role:`status`,children:`Couldn’t load linked tasks. Check your connection and try again.`}),(0,Y.jsx)(i,{variant:`outline`,className:`mt-2 min-h-11`,onClick:()=>void u.refetch(),disabled:u.isFetching,children:`Retry linked tasks`})]}):null,u.data&&f.length===0&&!u.isError?(0,Y.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`No linked tasks yet.`}):null,f.length>0?(0,Y.jsx)(`ul`,{className:`mt-2 flex flex-col gap-1`,children:f.map(e=>{let t=l(e);return(0,Y.jsx)(`li`,{children:(0,Y.jsxs)(V,{to:`/tasks/${encodeURIComponent(e.id)}`,className:`flex min-h-11 min-w-0 flex-col justify-center gap-1 rounded-md px-2 py-2 hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,children:[(0,Y.jsx)(`span`,{className:`text-sm font-medium break-words [overflow-wrap:anywhere]`,children:T(e)}),(0,Y.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted-foreground`,children:[(0,Y.jsx)(Ce,{tone:t.tone,shape:t.shape,pulse:t.pulse,role:`img`,"aria-label":t.label,title:t.label}),e.archived?(0,Y.jsx)(`span`,{className:`rounded border border-border px-1`,children:`Archived`}):null,(0,Y.jsx)(`time`,{dateTime:e.createdAt,children:new Date(e.createdAt).toLocaleDateString()})]})]})},e.id)})}):null,d.isError?(0,Y.jsxs)(`div`,{className:`mt-2 text-xs text-muted-foreground`,children:[(0,Y.jsx)(`p`,{role:`status`,children:`Couldn’t load older archived linked tasks.`}),(0,Y.jsx)(i,{variant:`outline`,className:`mt-2 min-h-11`,onClick:()=>void d.refetch(),disabled:d.isFetching,children:`Retry older linked tasks`})]}):d.hasNextPage?(0,Y.jsx)(i,{variant:`outline`,className:`mt-2 min-h-11`,onClick:()=>void d.fetchNextPage(),disabled:d.isFetchingNextPage,children:d.isFetchingNextPage?`Loading older linked tasks…`:`Show older linked tasks`}):null]}):null})]})}var X=`w-44 max-w-full`,Z=`min-h-11 min-w-11 rounded-md border border-input bg-card px-3 text-sm text-foreground focus-visible:outline-ring disabled:opacity-50`;function Ge(e,t){let n=new Map;for(let t of e)for(let e of t.assignees??[])n.set(e.toLowerCase(),e);for(let e of t)n.set(e.toLowerCase(),e);return[...n.values()].sort((e,t)=>e.localeCompare(t))}function Ke(e,t){return!!e&&t.length===1&&t[0]?.toLowerCase()===e.toLowerCase()}function qe(e){let t=` Previous memberships are shown; issues with unknown membership remain visible.`;return e.projectsState===`refreshing`&&e.projects?`Refreshing project boards.${t}`:e.projectsState===`unavailable`&&e.projects?`${e.projectsReason}${t}`:e.projects?``:e.projectsReason??(e.projectsState===`refreshing`?`Project memberships pending.`:`Project boards unavailable.`)}function Je(e){return[e.viewerLogin?``:`GitHub login unavailable.`,qe(e)].filter(Boolean).join(` `)}function Ye({options:e,assignees:t,onAssigneesChange:n}){return(0,Y.jsxs)(O,{children:[(0,Y.jsx)(E,{asChild:!0,children:(0,Y.jsxs)(`button`,{type:`button`,className:Z,disabled:e.length===0,children:[`Assignee`,t.length?` · ${t.length}`:``,(0,Y.jsx)(L,{size:12,"aria-hidden":`true`,className:`ml-1 inline size-3 shrink-0 align-[-1px] text-soft-foreground`})]})}),(0,Y.jsx)(D,{align:`start`,className:`w-64 max-w-[calc(100vw-2rem)] p-2`,children:(0,Y.jsxs)(`fieldset`,{className:`max-h-[min(16rem,var(--radix-popover-content-available-height))] overflow-y-auto`,children:[(0,Y.jsx)(`legend`,{className:`px-2 text-xs text-muted-foreground`,children:`Match any selected assignee`}),e.map(e=>{let r=t.some(t=>t.toLowerCase()===e.toLowerCase());return(0,Y.jsxs)(`label`,{className:`flex min-h-11 cursor-pointer items-center gap-2 rounded px-2 hover:bg-muted`,children:[(0,Y.jsx)(`input`,{type:`checkbox`,checked:r,onChange:()=>n(r?t.filter(t=>t.toLowerCase()!==e.toLowerCase()):[...t,e])}),(0,Y.jsx)(`span`,{className:`break-all text-sm`,children:e})]},e.toLowerCase())})]})})]})}function Xe({data:e,projectId:t,onProjectChange:n,pickerRef:r}){return e.projects?.length?(0,Y.jsxs)(`select`,{ref:r,"aria-label":`Project board`,className:`${Z} ${X}`,value:t,onChange:e=>n(e.target.value),children:[(0,Y.jsx)(`option`,{value:``,children:`All boards`}),e.projects.map(e=>(0,Y.jsx)(`option`,{value:e.id,children:e.title},e.id))]}):e.projects||e.projectsState?(0,Y.jsx)(`select`,{ref:r,"aria-label":`Project board`,className:`${Z} ${X}`,disabled:!0,value:``,children:(0,Y.jsx)(`option`,{value:``,children:e.projects?`No boards`:e.projectsState===`refreshing`?`Loading boards…`:`Boards unavailable`})}):null}function Ze({data:e,message:t,lastMessage:n,hasMessage:r,statusOpen:i,setStatusOpen:a,triggerRef:o,contentRef:s}){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{role:`status`,className:`sr-only`,children:t}),(0,Y.jsxs)(O,{open:i,onOpenChange:a,children:[(0,Y.jsx)(E,{asChild:!0,children:(0,Y.jsx)(`button`,{ref:o,type:`button`,className:`${Z} inline-flex items-center justify-center ${t?``:`invisible`}`,"aria-label":`Project board status`,tabIndex:t?void 0:-1,children:e.projectsState===`refreshing`?(0,Y.jsx)(N,{size:14,"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}):(0,Y.jsx)(P,{size:14,"aria-hidden":`true`,className:`size-3.5`})})}),(0,Y.jsx)(D,{ref:s,align:`start`,"data-slot":`gh-issue-status`,onCloseAutoFocus:e=>{r||e.preventDefault()},className:`w-72 max-w-[calc(100vw-2rem)] p-3 text-xs text-muted-foreground`,children:t||n.current})]})]})}function Qe({data:e,assignees:t,projectId:n,onAssigneesChange:r,onProjectChange:i}){let[a,o]=(0,K.useState)(!1),s=(0,K.useRef)(null),c=(0,K.useRef)(null),l=(0,K.useRef)(null),u=(0,K.useRef)(null),d=Ge(e.issues,t),f=Ke(e.viewerLogin,t),p=Je(e),m=p!==``,h=(0,K.useRef)(p);m&&(h.current=p);let g=(0,K.useRef)(!m);g.current=!m;let _=()=>(l.current&&!l.current.disabled?l.current:u.current)?.focus();return(0,K.useEffect)(()=>{let e=s.current;if(!e)return;let t=e=>{g.current&&!e.relatedTarget&&requestAnimationFrame(()=>{(!document.activeElement||document.activeElement===document.body)&&_()})};return e.addEventListener(`blur`,t),()=>e.removeEventListener(`blur`,t)},[]),(0,K.useEffect)(()=>{if(m)return;let e=document.activeElement,t=!!e&&(e===s.current||!!c.current?.contains(e));o(!1),t&&_()},[m]),(0,Y.jsxs)(`div`,{className:`contents`,"data-slot":`gh-issue-filters`,children:[(0,Y.jsx)(Ye,{options:d,assignees:t,onAssigneesChange:r}),(0,Y.jsx)(`button`,{ref:u,type:`button`,className:`${Z} aria-pressed:border-foreground aria-pressed:bg-foreground aria-pressed:text-background`,disabled:!e.viewerLogin,"aria-pressed":f,onClick:()=>r(f?[]:[e.viewerLogin]),children:`Assigned to me`}),(0,Y.jsx)(Xe,{data:e,projectId:n,onProjectChange:i,pickerRef:l}),(0,Y.jsx)(Ze,{data:e,message:p,lastMessage:h,hasMessage:m,statusOpen:a,setStatusOpen:o,triggerRef:s,contentRef:c})]})}function $e({onRefresh:e,refreshing:t}){let n=De(r());return(0,Y.jsxs)(`div`,{"data-route":`github`,"data-slot":`github-filter-screen`,className:ae,children:[(0,Y.jsxs)(`div`,{className:`mb-[16px] flex items-center gap-[8px]`,children:[(0,Y.jsx)(`h1`,{className:a(ie,`min-w-0 flex-1`),children:`GitHub`}),(0,Y.jsx)(`button`,{type:`button`,"data-slot":`gh-screen-refresh`,"aria-label":`Refresh from GitHub`,title:`Refresh from GitHub`,disabled:t,onClick:e,className:`-my-2 -mr-[10px] flex size-11 shrink-0 items-center justify-center rounded-md text-soft-foreground hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-60`,children:(0,Y.jsx)(N,{size:17,"aria-hidden":`true`,className:a(`size-[17px]`,t&&`motion-safe:animate-spin`)})})]}),(0,Y.jsx)(Te,{model:n,variant:`screen`})]})}function et(e){let t=getComputedStyle(e).overflowY;return t===`auto`||t===`scroll`?e:e.closest(`[data-slot="main"]`)??e}function tt(e){let[t,n]=(0,K.useState)(null);return(0,K.useLayoutEffect)(()=>{if(!e){n(null);return}let t=()=>n(et(e));t();let r=typeof window.matchMedia==`function`?window.matchMedia(`(min-width: 768px)`):null;r?.addEventListener(`change`,t);let i=typeof ResizeObserver>`u`?null:new ResizeObserver(t);return i?.observe(e),()=>{r?.removeEventListener(`change`,t),i?.disconnect()}},[e]),t}function nt(e,t){let[n,r]=(0,K.useState)(0);return(0,K.useLayoutEffect)(()=>{let n=()=>{!e||!t||r(Math.max(0,Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop)))};return n(),window.addEventListener(`resize`,n),()=>window.removeEventListener(`resize`,n)},[e,t]),n}function rt(e,t,n){let[r,i]=(0,K.useState)(null),a=(0,K.useRef)(n);return(0,K.useEffect)(()=>{a.current=n}),(0,K.useEffect)(()=>{if(!e||!r||!t||typeof IntersectionObserver>`u`)return;let n=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&a.current()},{root:t.getAttribute(`data-slot`)===`main`?null:t,rootMargin:`0px 0px 600px 0px`});return n.observe(r),()=>n.disconnect()},[e,r,t]),i}function it(e,t,n,r,i){let[a,o]=(0,K.useState)(null),[s,c]=(0,K.useState)(null),l=tt(a),u=(0,K.useRef)(null);u.current=l;let d=nt(s,l),f=e===`issues`?n?.issues.length??0:n?.prs.length??0,p=t.hasNextPage&&r===null&&f>0;return{listEl:a,setListEl:o,setRowsEl:c,scrollOwner:l,scrollOwnerRef:u,startMargin:d,pagingAvailable:p,manualPaging:p&&i,loadMoreRef:rt(p&&!i&&!t.isFetchingNextPage&&!t.isFetchNextPageError,l,()=>void t.fetchNextPage())}}var at=100;function ot(e,t,n,r,i){if(!e?.available||t!==`prs`)return[];let a=new Set;n!==null&&Number.isInteger(n)&&a.add(n);for(let t of[...r,...i,...e.prs]){if(a.size>=at)break;a.add(t.number)}return[...a]}function st(e,t,n,r,i,a){let o=ot(n,e,r,i,a),s=v(o,e===`prs`),c=s.data?.available?s.data.checks:void 0,l=_(e===`issues`?`issue`:`pr`,(0,K.useMemo)(()=>(t.data?.pages??[]).map(t=>(e===`issues`?t.issues:t.prs).map(e=>e.number)),[t.data,e]),n?.available===!0&&n.commentsDeferred===!0),u=(0,K.useMemo)(()=>new Set(n?.commentsDeferred?(e===`issues`?n.issues:n.prs).map(e=>e.number):[]),[n,e]);return{checkPrNumbers:o,checksMap:c,commentsOf:e=>l[e.number]??(u.has(e.number)?void 0:e.comments)}}function ct(e){let[t,n]=Se(),r=t.get(`filter`),i=le(e,r);return{rawFilterParam:r,filter:i,activeFilter:i??`all`,setFilterParam:e=>n(t=>{let n=new URLSearchParams(t);return e===null?n.delete(`filter`):n.set(`filter`,e),n})}}function lt(e,t,{filter:n,activeFilter:r,setFilterParam:i}){let[a,o]=(0,K.useState)(``),[s,c]=(0,K.useState)([]),[l,u]=(0,K.useState)([]),{setProjectFilter:d,activeProject:f}=ut(t),p=e===`issues`&&r===`assigned`,m=p?t?.viewerLogin?[t.viewerLogin]:[]:l;return{query:a,setQuery:o,labelFilter:s,setLabelFilter:c,setProjectFilter:d,activeProject:f,isAssignedFilter:p,effectiveAssignees:m,changeAssignees:e=>{u(e),p&&i(`all`)},clearFilters:()=>{o(``),c([]),u([]),d(``),n!==null&&n!==`all`&&i(`all`)},filtering:a.trim()!==``||s.length>0||e===`issues`&&(m.length>0||f!==``)||n!==null&&n!==`all`,narrowing:a.trim()!==``||s.length>0||e===`issues`&&(!p&&l.length>0||f!==``)}}function ut(e){let[t,n]=(0,K.useState)(``),r=e?.projectsState===`refreshing`||e?.projectsState===`unavailable`,i=r||e?.projects?.some(e=>e.id===t)?t:``;return(0,K.useEffect)(()=>{e&&!r&&t&&!i&&n(``)},[e,t,i,r]),{setProjectFilter:n,activeProject:i}}function dt(e,t,{filter:n,activeFilter:i},a){let o=r(),s=e===`issues`&&(i===`no-task`||i===`has-task`),c=b(o,s,o==="default"),l=(0,K.useMemo)(()=>c.data?me(c.data,t?.repo,o):null,[c.data,t?.repo,o]),u=ce(e,n)?ge(n):null,d=y(`pr`,u??``,u!==null&&t?.available===!0),f=u!==null&&d.data?.available?d.data.items:null,p=(0,K.useMemo)(()=>t?.available?e===`issues`?t.issues:t.prs:[],[t,e]),m=(0,K.useMemo)(()=>f?oe(f,p):null,[f,p]),h=ft({view:e,gh:t,activeFilter:i,isAssignedFilter:a,taskFilter:s,taskNumbers:l,runsQuery:c,backedQuery:u,filterHits:f,filterSearch:d});return{backedQuery:u,filterSearch:d,fullList:p,filterRows:m,filterGate:h,openItems:(0,K.useMemo)(()=>h?[]:m??p,[h,m,p]),narrow:(0,K.useMemo)(()=>e===`issues`?i===`no-task`&&l?{excludeNumbers:l}:i===`has-task`&&l?{includeNumbers:l}:{}:i===`mine`&&t?.viewerLogin?{author:t.viewerLogin}:f?{includeNumbers:new Set(f.map(e=>e.number))}:{},[e,i,l,t?.viewerLogin,f])}}function ft({view:e,gh:t,activeFilter:n,isAssignedFilter:r,taskFilter:i,taskNumbers:a,runsQuery:o,backedQuery:s,filterHits:c,filterSearch:l}){return t?.available?(r||e===`prs`&&n===`mine`)&&!t.viewerLogin?{kind:`blocked`,message:`GitHub login unavailable, so this filter cannot be applied.`}:i&&!a?o.isError?{kind:`blocked`,message:`The task list is unavailable, so this filter cannot be applied.`}:{kind:`loading`,message:`Loading tasks…`}:s!==null&&!c?l.data?.available===!1?{kind:`blocked`,message:`GitHub could not be searched: ${l.data.reason??`unknown reason`}.`}:l.isError?{kind:`blocked`,message:`GitHub could not be searched: ${l.error instanceof Error?l.error.message:`the search request failed`}.`}:{kind:`loading`,message:`Searching GitHub…`}:null:null}function Q(e,t){return t?p(t.kind,t.number,{refresh:!0}).then(n=>(e.setQueryData(t.key,n),!0)).catch(()=>!1):Promise.resolve(!0)}function pt(e,t,n,{filterGate:r,filterRows:i,fullList:a}){let o=C.github()[0],s=t===void 0?null:Number.parseInt(t,10),c=!r&&n.data?.available?n.data.items.find(e=>e.number===s):void 0,l=i&&s!==null&&!a.some(e=>e.number===s)?i.find(e=>e.number===s):void 0,u=c??l,[d,f]=(0,K.useState)(null);return(0,K.useEffect)(()=>{u&&f({scope:o,view:e,item:u})},[o,e,u]),{selectedNumber:s,remoteDetail:u??(d?.scope===o&&d.view===e&&d.item.number===s?d.item:null)}}function mt(e,t,n,{fullList:r,filterRows:i},a){let o=u(),s=(0,K.useRef)(null),c=e===`issues`?`issue`:`pr`,l=t?.available===!0&&n!==null&&Number.isSafeInteger(n)&&n>0&&!r.some(e=>e.number===n)&&!i?.some(e=>e.number===n)&&a===null,d=x(c,n??0,l),f=l&&d.data?.available&&d.data.item?.kind===c?d.data.item:null;s.current=l&&n!==null?{kind:c,number:n,key:C.githubItem(c,n)}:null;let[p,m]=(0,K.useState)(!1);return{exactWanted:l,exactItem:d,exactDetail:f,exactTargetRef:s,retryingExact:p,retryExact:()=>{m(!0),Q(o,s.current).then(e=>{m(!1),e||k(`Could not reach GitHub for #${n}`,{tone:`danger`})})}}}function ht(e,t,n){let r=u(),i=(0,K.useRef)(null);return{refresh:g({mutationFn:e=>(Q(r,e),f({refresh:!0,limit:50})),onSuccess:async a=>{await r.cancelQueries({queryKey:C.githubPages(50),exact:!0}),r.setQueryData(C.githubPages(50),{pages:[a],pageParams:[{}]}),r.invalidateQueries({queryKey:C.githubChecks(t)});let o=e===`issues`?`issue`:`pr`,s=(e===`issues`?a.issues:a.prs).map(e=>e.number),l=C.githubCommentCounts(o,s);r.removeQueries({queryKey:C.githubCommentCounts(o,[]).slice(0,4),predicate:e=>e.queryHash!==m(l)}),a.available&&a.commentsDeferred&&s.length>0&&d(o,s,{refresh:!0}).then(e=>r.setQueryData(l,e)).catch(()=>{}),r.invalidateQueries({queryKey:C.githubSearch(e===`issues`?`issue`:`pr`,n)}),r.invalidateQueries({queryKey:C.githubSearch(`pr`,pe)}),r.invalidateQueries({queryKey:C.githubSearch(`pr`,he)});let u=i.current;if(!u){r.removeQueries({queryKey:[`github`,`comments`]});return}let f=C.githubComments(u.kind,u.number);c(u.kind,u.number,{refresh:!0}).then(e=>r.setQueryData(f,e)).catch(()=>{}),r.removeQueries({queryKey:[`github`,`comments`],predicate:e=>e.queryHash!==m(f)})},onError:e=>k(e.message,{tone:`danger`})}),openThreadRef:i}}var gt=350;function _t(e,t){let[n,r]=(0,K.useState)(e);return(0,K.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function vt(e,t,{query:n,labelFilter:r,effectiveAssignees:i,activeProject:a},{openItems:o,narrow:s,filterGate:c}){let l=_t(n,gt),u=(0,K.useMemo)(()=>W(o,{query:l,labels:r,...s,...e===`issues`?{assignees:i,projectId:a}:{}}),[o,l,r,e,i,a,s]),d=n.trim()===l.trim(),f=t?.available===!0&&!c&&d&&Ne(l,u),p=y(e===`issues`?`issue`:`pr`,l,f),m=W(o,{query:n,labels:r,...s,...e===`issues`?{assignees:i,projectId:a}:{}}),h=f&&p.data?.available?p.data:null,g=new Set(m.map(e=>e.number)),_=yt(e,h,a,i);return{debouncedQuery:l,searchWanted:f,forgeSearch:p,items:m,searchPayload:h,metadataFailure:_,searchHits:h&&!_?W(h.items,{labels:r,...s,...e===`issues`?{assignees:i,projectId:a}:{}}).filter(e=>!g.has(e.number)):[],...bt(n,d,f,p)}}function yt(e,t,n,r){return e===`issues`&&t?n&&t.items.some(e=>e.projectIds===void 0)?t.projectsReason??`Project board data is incomplete. Refresh to try again.`:r.length&&t.items.some(e=>e.assignees===void 0)?`Assignee data is incomplete. Refresh to try again.`:null:null}function bt(e,t,n,r){return{searching:e.trim()!==``&&!t||n&&r.isPending,searchFailed:n&&(r.data?.available===!1||r.isError),searchFailureReason:r.data?.available===!1?r.data.reason??`unknown reason`:r.error instanceof Error?r.error.message:`the search request failed`}}function xt({width:e,onWidthChange:t}){let n=(0,K.useRef)(null),r=t=>{t.button===0&&(n.current={x:t.clientX,width:e},t.currentTarget.setPointerCapture(t.pointerId),t.preventDefault(),t.currentTarget.focus())},i=e=>{let r=n.current;r&&t(J(r.width+(e.clientX-r.x)))},a=e=>{n.current&&(n.current=null,e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId))};return(0,Y.jsx)(`div`,{"data-slot":`gh-list-resize-handle`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize the GitHub list`,"aria-valuenow":e,"aria-valuemin":280,"aria-valuemax":520,tabIndex:0,onPointerDown:r,onPointerMove:i,onPointerUp:a,onPointerCancel:a,onKeyDown:n=>{let r=n.key===`ArrowLeft`?e-16:n.key===`ArrowRight`?e+16:n.key===`Home`?280:n.key===`End`?520:null;r!==null&&(n.preventDefault(),t(J(r)))},onDoubleClick:()=>t(360),title:`Drag to resize the GitHub list — double-click to reset`,className:`absolute inset-y-0 -right-[2px] z-20 hidden w-[5px] cursor-col-resize touch-none bg-transparent transition-colors hover:bg-accent-strong/40 focus-visible:bg-accent-strong/60 focus-visible:outline-none md:block`})}function St({view:e,changes:n=!1,index:r=!1}){let{n:i}=t(),a=ct(e),{rawFilterParam:o,activeFilter:s}=a,c=Ae(),{pages:l,data:u}=ne(50),d=ee().data?.capabilities?.automations===!0,f=wt(),p=Be(),m=Ct({index:r,isDesktop:c,rawFilterParam:o,n:i,rememberedView:te().data?.githubView}),h=Tt(u?.available===!0&&!m.filterScreen),[g,_]=(0,K.useState)(!1),v=lt(e,u,a),y=dt(e,u,a,v.isAssignedFilter),b=vt(e,u,v,y),x=pt(e,i,b.forgeSearch,y),S=mt(e,u,x.selectedNumber,y,x.remoteDetail),C=st(e,l,u,x.selectedNumber,b.searchHits,y.openItems),{refresh:w,openThreadRef:T}=ht(e,C.checkPrNumbers,b.debouncedQuery),E=it(e,l,u,y.backedQuery,v.narrowing);if(m.restorePrs)return(0,Y.jsx)(_e,{to:`/github/prs`,replace:!0});if(!u)return l.isError?(0,Y.jsx)(`div`,{"data-route":`github`,className:`flex min-h-full flex-col`,children:(0,Y.jsx)(U,{icon:(0,Y.jsx)(P,{size:16}),tone:`danger`,title:`Could not load GitHub`,subtitle:l.error.message})}):(0,Y.jsx)(we,{});T.current=null;let D=()=>w.mutate(S.exactTargetRef.current);if(m.filterScreen&&u.available)return(0,Y.jsx)($e,{onRefresh:D,refreshing:w.isPending});if(!u.available)return(0,Y.jsx)(At,{reason:u.reason,refreshing:w.isPending,onRetry:D});let{labelColors:O,labelOptions:k}=Et(u,b.searchPayload,y.openItems,y.fullList),A=Dt({number:x.selectedNumber,items:b.items,searchHits:b.searchHits,fullList:y.fullList,filterRows:y.filterRows,remoteDetail:x.remoteDetail,exactDetail:S.exactDetail});T.current=A?{kind:A.kind,number:A.number}:null;let{linkFilter:j,listPath:M}=Ot(e,o,s,c),N={view:e,filter:j,colors:O,selected:A,queued:p.queued,checksMap:C.checksMap,commentsOf:C.commentsOf},F=kt(e,v,y.filterGate,b);return(0,Y.jsxs)(`div`,{ref:h.routeRef,"data-route":`github`,className:`flex min-h-full flex-col gap-3 px-[18px] pt-[18px] pb-[calc(90px+env(safe-area-inset-bottom))] md:gap-[22px] md:px-7 md:pt-4 md:pb-4`,children:[(0,Y.jsx)(jt,{view:e,activeFilter:s,isDesktop:c,rawFilterParam:o,n:i,gh:u}),(0,Y.jsxs)(`div`,{ref:h.workspaceRef,"data-slot":`gh-workspace`,"data-stacked":h.panesStacked,className:`flex min-h-0 min-w-0 flex-1 flex-col gap-3 md:h-[calc(var(--gh-workspace-height,calc(100dvh-4rem))-1rem)] md:flex-none md:gap-[22px]`,children:[(0,Y.jsxs)(`header`,{"data-slot":`gh-header`,className:`flex shrink-0 flex-col gap-3 bg-background md:gap-[22px]`,children:[(0,Y.jsx)(Mt,{view:e,isDesktop:c,gh:u,automationsAvailable:d,onSaveView:f,refreshing:w.isPending,onRefresh:D}),(0,Y.jsx)(Nt,{view:e,gh:u,filters:v,labelOptions:k,labelColors:O,searchPayload:b.searchPayload})]}),(0,Y.jsxs)(`div`,{"data-slot":`gh-panes`,className:`flex min-h-0 min-w-0 flex-1 flex-col items-start gap-[22px] md:flex-row md:items-stretch md:overflow-hidden`,children:[(0,Y.jsx)(Ft,{view:e,n:i,rows:N,verdict:F,search:b,sidebar:y,list:l,paging:E,width:h.githubListWidth,onWidthChange:h.changeGithubListWidth,expanded:g,onExpandedChange:_}),(0,Y.jsx)(Vt,{view:e,n:i,selected:A,selectedNumber:x.selectedNumber,exact:S,repo:u.repo,rows:N,listPath:M,changes:n,handToAgent:p})]})]})]})}function Ct({index:e,isDesktop:t,rawFilterParam:n,n:r,rememberedView:i}){return{filterScreen:e&&!t&&n===null&&r===void 0,restorePrs:e&&t&&n===null&&i===`prs`}}function wt(){let e=u();return t=>{e.setQueryData(C.uiState,e=>({...e,githubView:t})),h({githubView:t}).then(t=>e.setQueryData(C.uiState,t)).catch(t=>{k(t instanceof Error?t.message:String(t),{tone:`danger`}),e.invalidateQueries({queryKey:C.uiState})})}}function Tt(e){let[t,n]=(0,K.useState)(Ve),[r,i]=(0,K.useState)(!0),a=(0,K.useRef)(null),o=(0,K.useRef)(null);return(0,K.useEffect)(()=>{if(!e)return;let n=a.current,r=o.current,s=n?.closest(`[data-slot="main"]`);if(!n||!r||!s)return;let c=window.matchMedia(`(min-width: 768px)`),l=!1,u=()=>{if(l=c.matches&&r.clientWidth>=t+22+360,i(!l),!l||s.clientHeight<1){n.style.removeProperty(`--gh-workspace-height`);return}n.style.setProperty(`--gh-workspace-height`,`${Math.round(s.clientHeight)}px`)};u();let d=new ResizeObserver(u);d.observe(s),d.observe(r);let f=e=>{if(!l||e.ctrlKey||!e.deltaY||Math.abs(e.deltaX)>Math.abs(e.deltaY)||r.getBoundingClientRect().top<=s.getBoundingClientRect().top+1||!(e.target instanceof Element)||!e.target.closest(`[data-slot="gh-panes"]`))return;e.preventDefault();let t=e.deltaMode===1?16:e.deltaMode===2?s.clientHeight:1;s.scrollTop+=e.deltaY*t};return r.addEventListener(`wheel`,f,{passive:!1}),c.addEventListener(`change`,u),()=>{r.removeEventListener(`wheel`,f),d.disconnect(),c.removeEventListener(`change`,u)}},[e,t]),{githubListWidth:t,changeGithubListWidth:e=>{let t=J(e);n(t),He(t)},panesStacked:r,routeRef:a,workspaceRef:o}}function Et(e,t,n,r){return{labelColors:{...t?.labelColors,...e.labelColors},labelOptions:Fe([...n,...r,...t?.items??[]])}}function Dt({number:e,items:t,searchHits:n,fullList:r,filterRows:i,remoteDetail:a,exactDetail:o}){return e===null?t[0]??n[0]??null:r.find(t=>t.number===e)??i?.find(t=>t.number===e)??a??o??null}function Ot(e,t,n,r){let i=t===null?null:n;return{linkFilter:i,listPath:B(e,i??(e===`issues`&&!r?`all`:null))}}function kt(e,{query:t,filtering:n},r,{searching:i,searchFailed:a,searchFailureReason:o,metadataFailure:s,searchHits:c,searchPayload:l,items:u}){let d=e===`issues`?`issues`:`pull requests`;return r?(0,Y.jsxs)(`p`,{role:`status`,className:`flex items-center gap-1.5`,"data-slot":`gh-filter-gate`,"data-kind":r.kind,children:[r.kind===`loading`?(0,Y.jsx)(R,{"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}):null,r.message]}):n?i?(0,Y.jsxs)(`p`,{className:`flex items-center gap-1.5`,children:[(0,Y.jsx)(R,{"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}),`Searching GitHub for “`,t.trim(),`”…`]}):a?c.length>0?(0,Y.jsxs)(`p`,{role:`status`,children:[`Showing previous results. GitHub could not be refreshed: `,o,`. Use Refresh to try again.`]}):u.length>0?(0,Y.jsxs)(`p`,{children:[`GitHub could not be searched: `,o,`.`]}):(0,Y.jsxs)(`p`,{children:[`No open `,d,` match your filter, and GitHub could not be searched: `,o,`.`]}):s?(0,Y.jsxs)(`p`,{role:`status`,children:[`Cannot apply the selected filters to GitHub results: `,s]}):c.length>0?null:l?.truncated?(0,Y.jsx)(`p`,{children:`No matches within GitHub’s first matches. Narrow your search to check more specific results.`}):l&&u.length>0?(0,Y.jsxs)(`p`,{children:[`No additional `,d,` match your filter on GitHub.`]}):l?(0,Y.jsxs)(`p`,{children:[`No `,d,` match your filter — open, closed or merged.`]}):(0,Y.jsxs)(`p`,{children:[`No open `,d,` match your filter.`]}):(0,Y.jsxs)(`p`,{children:[`No open `,d,`.`]})}function At({reason:e,refreshing:t,onRetry:r}){return(0,Y.jsx)(`div`,{"data-route":`github`,className:`flex min-h-full flex-col`,children:(0,Y.jsx)(U,{icon:(0,Y.jsx)(j,{}),tone:`neutral`,title:`GitHub is unavailable here`,subtitle:e??`unknown reason`,actions:(0,Y.jsx)(i,{variant:`outline`,"data-action":`gh-retry`,disabled:t,onClick:r,children:`Try again`}),children:(0,Y.jsxs)(`p`,{className:`text-xs leading-relaxed text-soft-foreground`,children:[`The tab needs the `,(0,Y.jsx)(`span`,{className:`font-mono`,children:`gh`}),` CLI, logged in (`,(0,Y.jsx)(`span`,{className:`font-mono`,children:`gh auth login`}),`), and a repo with a GitHub remote. Everything else in `,n(`cezar`),` works without it.`]})})})}function jt({view:e,activeFilter:t,isDesktop:n,rawFilterParam:r,n:i,gh:a}){return(0,Y.jsxs)(`div`,{"data-slot":`gh-masthead`,className:`flex min-w-0 shrink-0 flex-col gap-1 md:flex-row md:items-baseline md:gap-3`,children:[(0,Y.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight md:text-[15px] md:tracking-normal`,children:n?`${e===`issues`?`Issues`:`Pull requests`} · ${fe[t]}`:`GitHub`}),r!==null&&i===void 0?(0,Y.jsxs)(`div`,{"data-slot":`gh-filter-context`,className:`flex min-w-0 items-center gap-3 md:hidden`,children:[(0,Y.jsxs)(V,{to:`/github`,"data-slot":`gh-back-filters`,className:`inline-flex min-h-11 items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground`,children:[(0,Y.jsx)(re,{size:16,"aria-hidden":`true`,className:`size-3.5`}),`Back to filters`]}),t===`all`?null:(0,Y.jsx)(`span`,{"data-slot":`gh-active-filter`,className:`truncate text-xs text-soft-foreground`,children:[...ue,...se].find(e=>e.id===t)?.label})]}):null,a.repo?(0,Y.jsxs)(`span`,{className:`min-w-0 truncate text-[13px] text-muted-foreground md:text-[11px] md:text-soft-foreground`,children:[(0,Y.jsx)(`span`,{"data-slot":`gh-repo`,children:a.repo}),(0,Y.jsxs)(`span`,{"data-slot":`gh-synced`,children:[` · `,a.syncedAt?`Synced ${z(a.syncedAt)} ago`:`Not synced yet`]})]}):null]})}function Mt({view:e,isDesktop:t,gh:n,automationsAvailable:r,onSaveView:i,refreshing:o,onRefresh:s}){return(0,Y.jsxs)(`div`,{"data-slot":`gh-tabs`,className:`flex min-h-11 flex-wrap items-center gap-3`,children:[(0,Y.jsxs)(G,{to:t?`/github`:`/github?filter=all`,active:e===`issues`,onClick:()=>i(`issues`),children:[`Issues · `,n.issuesTotal??n.issues.length]}),(0,Y.jsxs)(G,{to:`/github/prs`,active:e===`prs`,onClick:()=>i(`prs`),children:[`Pull requests · `,n.prsTotal??n.prs.length]}),r?(0,Y.jsx)(V,{to:`/automations/new`,className:`gh-utility`,children:`Set up automations`}):null,(0,Y.jsxs)(`button`,{type:`button`,"data-slot":`gh-refresh`,title:`Refresh from GitHub`,disabled:o,onClick:s,className:`gh-utility`,children:[(0,Y.jsx)(N,{size:16,"aria-hidden":`true`,className:a(`size-3.5`,o&&`motion-safe:animate-spin`)}),`Refresh`]})]})}function Nt({view:e,gh:t,filters:n,labelOptions:r,labelColors:i,searchPayload:a}){return(0,Y.jsxs)(`div`,{"data-slot":`gh-filter-toolbar`,className:`flex flex-wrap items-center gap-2.5`,children:[(0,Y.jsxs)(`div`,{className:`relative min-w-0 basis-full md:flex-1 md:basis-auto`,children:[(0,Y.jsx)(M,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-soft-foreground`}),(0,Y.jsx)(`input`,{type:`search`,"data-slot":`gh-search`,"aria-label":`Search ${e}`,placeholder:e===`issues`?`Filter issues…`:`Filter pull requests…`,value:n.query,onChange:e=>n.setQuery(e.target.value),className:`min-h-11 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,Y.jsx)(qt,{options:r,colors:i,selected:n.labelFilter,onChange:n.setLabelFilter}),e===`issues`?(0,Y.jsx)(Qe,{data:{...t,issues:[...t.issues,...a?.items??[]]},assignees:n.effectiveAssignees,projectId:n.activeProject,onAssigneesChange:n.changeAssignees,onProjectChange:n.setProjectFilter}):null,(0,Y.jsx)(`button`,{type:`button`,disabled:!n.filtering,className:`min-h-11 min-w-11 rounded-md border border-border bg-card px-4 text-xs disabled:opacity-50`,onClick:n.clearFilters,children:`Clear filters`})]})}function $(e,t){return e.kind===`pr`?t?.[e.number]??e.checks:e.checks}function Pt(e,t){return(0,Y.jsx)(Kt,{item:e,view:t.view,filter:t.filter,colors:t.colors,active:t.selected?.url===e.url,queued:t.queued.has(e.url),checks:$(e,t.checksMap),comments:t.commentsOf(e)})}function Ft({view:e,n:t,rows:n,verdict:r,search:i,sidebar:a,list:o,paging:s,width:c,onWidthChange:l,expanded:u,onExpandedChange:d}){let{items:f,searchHits:p}=i,m=e===`issues`&&t!==void 0&&!u;return(0,Y.jsxs)(`section`,{ref:s.setListEl,"data-slot":`gh-list`,"data-mobile-preview":m||void 0,style:{"--github-list-width":`${c}px`},className:`relative flex w-full min-h-0 min-w-0 flex-col rounded-lg border border-border bg-card p-3 md:w-[var(--github-list-width)] md:shrink-0 md:overflow-x-hidden md:overflow-y-auto`,children:[f.length===0?r&&(0,Y.jsx)(`div`,{"data-slot":`gh-empty`,className:`px-4 py-4 text-sm text-soft-foreground`,children:r}):(0,Y.jsx)(It,{items:f,rows:n,compactPreview:m,paging:s}),s.pagingAvailable?(0,Y.jsx)(Lt,{view:e,list:o,paging:s}):null,(0,Y.jsx)(Rt,{backedQuery:a.backedQuery,filterSearch:a.filterSearch}),(0,Y.jsx)(zt,{view:e,n:t,count:f.length,expanded:u,onExpandedChange:d}),f.length>0&&i.searchWanted&&r?(0,Y.jsx)(`div`,{"data-slot":`gh-search-status`,role:`status`,className:`px-4 py-4 text-sm text-soft-foreground`,children:r}):null,p.length>0?(0,Y.jsx)(Bt,{hits:p,searchPayload:i.searchPayload,rows:n}):null,(0,Y.jsx)(xt,{width:c,onWidthChange:l})]})}function It({items:e,rows:t,compactPreview:n,paging:r}){let{setRowsEl:i,scrollOwner:a,listEl:o,scrollOwnerRef:s,startMargin:c}=r,l=e.map((e,r)=>(0,Y.jsx)(`div`,{role:`listitem`,"data-slot":`gh-row-item`,"data-divided":r>0||void 0,"data-compact-hidden":n&&r>=2&&t.selected?.url!==e.url||void 0,children:Pt(e,t)},e.url));return(0,Y.jsx)(`div`,{ref:i,"data-slot":`gh-rows`,"data-virtualized":a?`true`:void 0,role:`list`,children:a?(0,Y.jsx)(ke,{scrollRef:s,startMargin:c,children:l},a===o?`list`:`main`):l})}function Lt({view:e,list:t,paging:n}){return(0,Y.jsx)(`div`,{ref:n.loadMoreRef,"data-slot":`gh-load-more`,className:`flex min-h-6 items-center justify-center gap-1.5 px-4 pb-3 text-xs text-soft-foreground`,children:t.isFetchingNextPage?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(R,{"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}),`Loading more…`]}):t.isFetchNextPageError?(0,Y.jsxs)(Y.Fragment,{children:[`Could not load more.`,(0,Y.jsx)(`button`,{type:`button`,"data-slot":`gh-load-more-retry`,onClick:()=>void t.fetchNextPage(),className:`font-medium text-accent-text hover:underline`,children:`Retry`})]}):n.manualPaging?(0,Y.jsxs)(Y.Fragment,{children:[`Filters cover the loaded `,e===`issues`?`issues`:`pull requests`,`.`,(0,Y.jsx)(`button`,{type:`button`,"data-slot":`gh-load-more-manual`,onClick:()=>void t.fetchNextPage(),className:`font-medium text-accent-text hover:underline`,children:`Load more`})]}):null})}function Rt({backedQuery:e,filterSearch:t}){return e!==null&&t.data?.available&&t.data.truncated?(0,Y.jsxs)(`div`,{"data-slot":`gh-filter-note`,role:`status`,className:`px-4 py-3 text-xs text-soft-foreground`,children:[`Showing the first `,t.data.items.length,` matches from GitHub search; more may exist.`]}):null}function zt({view:e,n:t,count:n,expanded:r,onExpandedChange:a}){return e===`issues`&&t!==void 0&&n>2?(0,Y.jsx)(i,{variant:`outline`,className:`mt-2 self-start md:hidden`,"data-slot":`gh-expand-list`,"aria-expanded":r,onClick:()=>a(e=>!e),children:r?`Show fewer issues`:`View all ${n} issues`}):null}function Bt({hits:e,searchPayload:t,rows:n}){return(0,Y.jsxs)(`div`,{"data-slot":`gh-search-hits`,children:[(0,Y.jsxs)(`p`,{className:`px-4 pt-2 pb-1 text-[11px] font-medium tracking-wide text-soft-foreground uppercase`,children:[`Found on GitHub`,t?.truncated?` (first matches)`:``]}),(0,Y.jsx)(`ul`,{className:`flex flex-col gap-0.5 px-2 pb-2`,children:e.map(e=>(0,Y.jsx)(`li`,{children:Pt(e,n)},e.url))})]})}function Vt({view:e,n:t,selected:n,selectedNumber:r,exact:i,repo:o,rows:s,listPath:c,changes:l,handToAgent:u}){let{exactWanted:d,exactItem:f}=i;return(0,Y.jsx)(`section`,{"data-slot":`gh-detail`,className:a(`w-full min-w-0 min-h-0 flex-1 flex-col rounded-lg border border-border bg-card md:overflow-y-auto`,t===void 0?`hidden md:flex`:`flex`),children:n?(0,Y.jsx)(Ht,{item:n,n:t,repo:o,rows:s,listPath:c,changes:l,handToAgent:u}):d&&f.isPending?(0,Y.jsx)(`div`,{"data-slot":`gh-detail-loading`,className:`flex min-h-full flex-1 flex-col`,children:(0,Y.jsx)(U,{icon:(0,Y.jsx)(R,{className:`motion-safe:animate-spin`}),tone:`neutral`,heading:`h2`,title:`Loading #${r}…`,subtitle:`It is not among the open items, so the tab is asking GitHub for it.`})}):d&&(f.isError||f.data?.available===!1)?(0,Y.jsx)(Ut,{number:r,exact:i}):(0,Y.jsx)(Wt,{view:e,number:r})})}function Ht({item:e,n:t,repo:n,rows:r,listPath:i,changes:a,handToAgent:o}){let{workflows:s,skillList:c,workflow:l,setWorkflow:u,selectedSkills:d,setSelectedSkills:f,engine:p,setEngine:m,queued:h,onQueued:g}=o;return(0,Y.jsx)(Le,{item:e,comments:r.commentsOf(e),afterHeading:e.kind===`issue`?(0,Y.jsx)(Ue,{number:e.number,repo:n},t??`list`):void 0,backLink:{to:i},subNav:{filter:r.filter,changes:a},onRunAgent:Gt,colors:r.colors,checks:$(e,r.checksMap),children:(0,Y.jsx)(Ie,{item:e,workflows:s.data?.workflows??[],skills:c,workflow:l,onWorkflowChange:u,selectedSkills:d,onSkillsChange:f,engine:p,onEngineChange:m,queuedRunId:h.get(e.url)??null,onQueued:g},e.url)})}function Ut({number:e,exact:t}){let{exactItem:n,retryingExact:r,retryExact:a}=t;return(0,Y.jsx)(U,{icon:(0,Y.jsx)(P,{size:16}),tone:n.isError?`danger`:`neutral`,heading:`h2`,title:`Could not load #${e}`,subtitle:n.data?.available===!1?n.data.reason:n.error instanceof Error?n.error.message:`The request failed.`,actions:(0,Y.jsx)(i,{variant:`outline`,disabled:r,onClick:a,children:`Retry`})})}function Wt({view:e,number:t}){return(0,Y.jsx)(U,{icon:e===`issues`?(0,Y.jsx)(I,{size:16}):(0,Y.jsx)(A,{size:16}),tone:`neutral`,heading:`h2`,title:t===null?`Nothing selected`:`Not found`,subtitle:t===null?`No open ${e===`issues`?`issues`:`pull requests`} to show.`:`#${t} is not among the open ${e===`issues`?`issues`:`pull requests`}. Search for ${t} above to look it up on GitHub, closed and merged included.`})}function Gt(){let e=document.querySelector(`[data-slot="gh-detail-inner"] [data-slot="gh-custom-prompt"]`);e?.scrollIntoView({block:`center`}),e?.focus({preventScroll:!0})}function Kt({item:e,view:t,filter:n,colors:r,active:i,queued:o,checks:s,comments:l}){let d=e.kind===`issue`?I:A,f=u(),p=()=>{f.prefetchQuery({queryKey:C.githubComments(e.kind,e.number),queryFn:({signal:t})=>c(e.kind,e.number,{},{signal:t}),staleTime:6e4})};return(0,Y.jsxs)(V,{to:B(t,n,e.number),draggable:!0,onDragStart:t=>{try{t.dataTransfer.setData(`text/plain`,Re(e)),t.dataTransfer.effectAllowed=`copy`}catch{}},onMouseEnter:p,onFocus:p,"data-slot":`gh-row`,"data-number":e.number,"data-kind":e.kind,"aria-current":i?`page`:void 0,title:`Drag into the composer to prefill a task`,className:a(`flex flex-col gap-2 rounded-md px-3 py-4 transition-colors hover:bg-muted`,i&&`bg-accent-strong/10 text-accent-text`),children:[(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-start gap-2 md:items-center`,children:[(0,Y.jsx)(d,{"aria-hidden":`true`,"data-slot":`gh-row-icon`,className:a(`mt-0.5 size-3.5 shrink-0 md:mt-0`,e.kind===`issue`?`text-success`:`text-accent-icon`)}),(0,Y.jsx)(`span`,{"data-slot":`gh-row-title`,className:a(`line-clamp-2 min-w-0 text-[13px] font-medium md:block md:truncate`,i&&`font-semibold`),children:e.title})]}),(0,Y.jsxs)(`span`,{"data-slot":`gh-row-meta`,className:`flex flex-wrap items-center gap-x-2 gap-y-1 pl-[22px] font-mono text-[11px] text-muted-foreground md:flex-nowrap md:gap-y-0`,children:[(0,Y.jsxs)(`span`,{children:[`#`,e.number]}),(0,Y.jsx)(`span`,{"data-slot":`gh-row-author`,className:`max-w-full shrink-0 truncate md:min-w-0 md:shrink`,children:e.author}),(0,Y.jsx)(`span`,{children:z(e.createdAt)}),(0,Y.jsx)(je,{count:l}),s?(0,Y.jsx)(Pe,{checks:s}):null,o?(0,Y.jsx)(`span`,{"data-slot":`gh-queued-flag`,className:`font-sans font-medium text-accent-text`,children:`↗ run queued`}):null]}),e.labels.length>0?(0,Y.jsx)(`span`,{"data-slot":`gh-row-labels`,className:`flex flex-wrap gap-1 pl-[22px]`,children:e.labels.map(e=>(0,Y.jsx)(ze,{label:e,color:r[e],plain:!0},e))}):null]})}function qt({options:e,colors:t,selected:n,onChange:r}){let[i,o]=(0,K.useState)(!1),s=e=>r(n.includes(e)?n.filter(t=>t!==e):[...n,e]);return(0,Y.jsxs)(O,{open:i,onOpenChange:o,children:[(0,Y.jsx)(E,{asChild:!0,children:(0,Y.jsxs)(`button`,{type:`button`,"data-slot":`gh-label-filter`,disabled:e.length===0,className:a(`flex min-h-11 min-w-11 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-accent-strong/60 text-foreground`),children:[n.length>0?`Labels · ${n.length}`:`Labels`,(0,Y.jsx)(L,{size:12,"aria-hidden":`true`,className:`size-3 shrink-0 text-soft-foreground`})]})}),(0,Y.jsx)(D,{align:`end`,sideOffset:6,className:`w-60 p-0`,children:(0,Y.jsxs)(be,{children:[(0,Y.jsx)(xe,{placeholder:`Filter labels…`}),(0,Y.jsxs)(ve,{className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[(0,Y.jsx)(ye,{children:`No labels.`}),n.length>0?(0,Y.jsxs)(H,{value:`__clear__`,onSelect:()=>r([]),className:`min-h-11 text-soft-foreground`,children:[`Clear `,n.length,` filter`,n.length>1?`s`:``]}):null,e.map(e=>{let r=n.includes(e);return(0,Y.jsxs)(H,{value:e,onSelect:()=>s(e),className:`min-h-11`,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,className:`size-2.5 shrink-0 rounded-full border`,style:Me(t[e])}),(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e}),r?(0,Y.jsx)(F,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-link-foreground`}):null]},e)})]})]})})]})}export{St as GithubRoute};
|