@hearsay-tools/squawk 0.19.0-dev.9229.2 → 0.19.0-nightly.20261201.97.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/contract/hosts.d.ts +0 -3
- package/dist/contract/index.js +0 -8
- package/dist/contract/projects.d.ts +0 -6
- package/dist/core/forge-registry.d.ts +0 -8
- package/dist/core/forge-registry.js +13 -36
- package/dist/core/forge-registry.js.map +1 -1
- package/dist/features/hosts/routes.d.ts +0 -2
- package/dist/features/webhooks/routes.d.ts +0 -3
- package/dist/server/projects-routes.d.ts +0 -6
- package/dist/server/runs-routes.d.ts +16 -16
- package/dist/server/server.d.ts +0 -6
- package/dist/workspace/projects.d.ts +0 -5
- package/dist/workspace/projects.js +2 -8
- package/dist/workspace/projects.js.map +1 -1
- package/package.json +4 -4
- package/web/dist/assets/accounts-section-s6sAdUT8.js +1 -0
- package/web/dist/assets/{activity-motion-DBxIOskd.js → activity-motion-CXlbNrMI.js} +1 -1
- package/web/dist/assets/{activity-route-BYf5OD8Y.js → activity-route-BL-QWLNp.js} +1 -1
- package/web/dist/assets/{agent-accounts-BzD14qLU.js → agent-accounts-Du8CHfFX.js} +1 -1
- package/web/dist/assets/{agent-config-section-BwmBjoad.js → agent-config-section-BzMSlPK0.js} +1 -1
- package/web/dist/assets/{agent-defaults-section-BbFvw0IO.js → agent-defaults-section-CqEVmRK0.js} +1 -1
- package/web/dist/assets/{appearance-CkohbKAs.js → appearance-vI6ae_So.js} +1 -1
- package/web/dist/assets/{archive-on-merge-field-CQ8DBqiG.js → archive-on-merge-field-C4hrO55O.js} +1 -1
- package/web/dist/assets/{ask-card-Bli7vYif.js → ask-card-hEb8IHjL.js} +3 -3
- package/web/dist/assets/automations-route-Bd6crv15.js +2 -0
- package/web/dist/assets/{commit-list-CJZtpbaw.js → commit-list-Jr1_04RS.js} +1 -1
- package/web/dist/assets/{diff-DPSOaO5_.js → diff-BOF9OXhn.js} +2 -2
- package/web/dist/assets/{diff-controls-rfNgY_Dd.js → diff-controls-CkxtRrbB.js} +1 -1
- package/web/dist/assets/{diff-view-CswchTTd.js → diff-view-Chu6rn_i.js} +1 -1
- package/web/dist/assets/{discard-changes-dialog-BMT0YtWx.js → discard-changes-dialog-BB47RqdX.js} +1 -1
- package/web/dist/assets/{file-preview-DoaMlVS3.js → file-preview-DNM-krBZ.js} +1 -1
- package/web/dist/assets/{folder-browser-D_q7aPq-.js → folder-browser-TNWat5kt.js} +1 -1
- package/web/dist/assets/{git-toolbar-BCqNvkr5.js → git-toolbar-CoKBTzNV.js} +1 -1
- package/web/dist/assets/{github-Bv1h-3dP.js → github-t611QkCi.js} +1 -1
- package/web/dist/assets/{global-activity-route-CrAG-ji7.js → global-activity-route-B9DMoviv.js} +1 -1
- package/web/dist/assets/{host-context-KsSKxKbI.js → host-context-iTMFRMT5.js} +1 -1
- package/web/dist/assets/host-storage-Cr_NKfWy.js +1 -0
- package/web/dist/assets/{hosts-pzCm30ta.js → hosts-rdWe_OBc.js} +1 -1
- package/web/dist/assets/{image-preview-CvcSCCBU.js → image-preview-C_xACQXI.js} +1 -1
- package/web/dist/assets/index-C3kap2_j.js +21 -0
- package/web/dist/assets/index-CWmMYQdT.css +1 -0
- package/web/dist/assets/{label-DEZnEIpB.js → label-B_s8eiYA.js} +1 -1
- package/web/dist/assets/{markdown-BRE9fTUI.js → markdown-Bmdr6MIa.js} +1 -1
- package/web/dist/assets/{open-in-menu-DomSOC26.js → open-in-menu-DkFneOWr.js} +1 -1
- package/web/dist/assets/{option-select-Cqnmt-CB.js → option-select-BxTmKg8G.js} +1 -1
- package/web/dist/assets/{preferences-section-CC4m45tb.js → preferences-section-B_yl_o-g.js} +1 -1
- package/web/dist/assets/{preview-DFL4D2C_.js → preview-D3zYSmIA.js} +1 -1
- package/web/dist/assets/{preview-pane-connected-CvF3zJ9A.js → preview-pane-connected-s9LvCVbp.js} +2 -2
- package/web/dist/assets/{project-location-D6-Lo1vY.js → project-location-BczZtNyO.js} +1 -1
- package/web/dist/assets/{project-router-CARDbdMX.js → project-router-CfEuKuz1.js} +1 -1
- package/web/dist/assets/{project-scope-context-Bz7AAyJ4.js → project-scope-context-DNrHbqd2.js} +2 -2
- package/web/dist/assets/{projects-section-zeGtqnI3.js → projects-section-C6DnyUa2.js} +1 -1
- package/web/dist/assets/{prompt-templates-section--ygct2zC.js → prompt-templates-section-BQvKWcaX.js} +2 -2
- package/web/dist/assets/queries-DD_9iITj.js +1 -0
- package/web/dist/assets/{reference-chip-D8ckcrda.js → reference-chip-e-fG4-yW.js} +1 -1
- package/web/dist/assets/{remote-settings-notice-MxDxNXXw.js → remote-settings-notice-CUqI2DdF.js} +1 -1
- package/web/dist/assets/{repo-git-VfTEbVO3.js → repo-git-NG_TxE7N.js} +1 -1
- package/web/dist/assets/{report-reader-DLCLUfdH.js → report-reader-LYNHrAe-.js} +1 -1
- package/web/dist/assets/{report-selection-BcsbTczw.js → report-selection-nUbQVjJu.js} +1 -1
- package/web/dist/assets/{reports-QoDlngjL.js → reports-DuT4m7i5.js} +1 -1
- package/web/dist/assets/{resources-section-CBL0htm5.js → resources-section-CT48TCXY.js} +1 -1
- package/web/dist/assets/{review-notes-drafts-DJDQNemf.js → review-notes-drafts-C7HCRebB.js} +1 -1
- package/web/dist/assets/{review-panel-BY05CuXd.js → review-panel-BffLSkRo.js} +1 -1
- package/web/dist/assets/{review-strip-BWhQ5CIC.js → review-strip-COa0ir6V.js} +1 -1
- package/web/dist/assets/{run-detail-refresh-CecZhU-h.js → run-detail-refresh-Db5HOGMX.js} +1 -1
- package/web/dist/assets/{run-diff-CpwwrpXO.js → run-diff-DldSY8BJ.js} +1 -1
- package/web/dist/assets/run-header-DxpN6yVQ.js +2 -0
- package/web/dist/assets/{select-C72KGfnK.js → select-Cd8wvwvm.js} +1 -1
- package/web/dist/assets/{session-context-section-D8v30mSp.js → session-context-section-CW8DS0dW.js} +1 -1
- package/web/dist/assets/{settings-agent-picker-DGhJwDIY.js → settings-agent-picker-an3ysM1B.js} +1 -1
- package/web/dist/assets/{settings-save-bar-Dp-eEIEF.js → settings-save-bar-BiHFQ4c0.js} +1 -1
- package/web/dist/assets/{settings-shell-DZzgCmSz.js → settings-shell-KZ801oLH.js} +1 -1
- package/web/dist/assets/{sidebar-section-B94mdYUS.js → sidebar-section-BRMO7aY4.js} +1 -1
- package/web/dist/assets/{skills-B6jO_f1w.js → skills-DHkLoxXb.js} +1 -1
- package/web/dist/assets/{status-dot-B5MkhHDP.js → status-dot-Da1M54kK.js} +1 -1
- package/web/dist/assets/{tab-link-zXPa9LIz.js → tab-link-DL1UtKVR.js} +1 -1
- package/web/dist/assets/{task-changes-B_2BDWIf.js → task-changes-CQhwyj0L.js} +2 -2
- package/web/dist/assets/{task-commits-kxDG4T81.js → task-commits-CTP8izpc.js} +1 -1
- package/web/dist/assets/{task-file-scope-DVACyrij.js → task-file-scope-CDIfOvl-.js} +1 -1
- package/web/dist/assets/{task-files-4CxXkPOx.js → task-files-CGlRH86B.js} +1 -1
- package/web/dist/assets/{task-github-item-C8hMZej3.js → task-github-item-ChgjULzj.js} +1 -1
- package/web/dist/assets/task-thread-Cj9B2ISO.js +2 -0
- package/web/dist/assets/{thread-state-CufNf_fC.js → thread-state-D2KJrZ1o.js} +1 -1
- package/web/dist/assets/{use-finish-run-CjYc6ovQ.js → use-finish-run-DifixlCM.js} +1 -1
- package/web/dist/assets/{use-hand-to-agent-state-B_j_e1kD.js → use-hand-to-agent-state-Bjh1EnB3.js} +1 -1
- package/web/dist/assets/use-path-bases-AV9YYh2B.js +1 -0
- package/web/dist/assets/use-workspace-config-save-02qlUK8v.js +1 -0
- package/web/dist/assets/{workflows-iMfDerlK.js → workflows-BDc-MpiC.js} +1 -1
- package/web/dist/assets/{workspace-tools-CgYFRggf.js → workspace-tools-D7kUSb-0.js} +1 -1
- package/web/dist/assets/{worktrees-section-CtT9bwKK.js → worktrees-section-Cv65NBgq.js} +4 -4
- package/web/dist/assets/{zoomable-image-Dv85Vr4A.js → zoomable-image-DJ1lJEMc.js} +1 -1
- package/web/dist/index.html +17 -17
- package/web/dist/live-worker.js +1 -1
- package/web/dist/assets/accounts-section-lnMwvHTo.js +0 -1
- package/web/dist/assets/automations-route-BNYFQeuu.js +0 -2
- package/web/dist/assets/host-storage-BHtMSWBL.js +0 -1
- package/web/dist/assets/index-D9hyWO4C.js +0 -21
- package/web/dist/assets/index-DZXi-K2N.css +0 -1
- package/web/dist/assets/queries-D7W-eGim.js +0 -1
- package/web/dist/assets/run-header-CZU3e9Xk.js +0 -2
- package/web/dist/assets/task-thread-Bv_Fjceh.js +0 -2
- package/web/dist/assets/use-path-bases-BfjK7tem.js +0 -1
- package/web/dist/assets/use-workspace-config-save-toCmvqtz.js +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/diff-view-
|
|
2
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./preload-helper-Czpn1I53.js";import{o as i}from"./dist-CCX8mhHc.js";import{t as a}from"./diff-stat-DCO_BkZB.js";import{n as o,r as s,t as c}from"./image-preview-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/diff-view-Chu6rn_i.js","assets/rolldown-runtime-QTnfLwEv.js","assets/react-runtime-CCIEwYL0.js","assets/dist-CCX8mhHc.js","assets/bundle-mjs-rHxsej31.js","assets/chevron-right-BENZ-1ZN.js","assets/createLucideIcon-BHp8sXmF.js","assets/eye-B8okNWXU.js","assets/button-BV_AiLj2.js","assets/diff-stat-DCO_BkZB.js","assets/index-C3kap2_j.js","assets/queries-DD_9iITj.js","assets/host-context-iTMFRMT5.js","assets/project-scope-context-DNrHbqd2.js","assets/live-protocol-CNUmr-VT.js","assets/host-storage-Cr_NKfWy.js","assets/preload-helper-Czpn1I53.js","assets/chunk-KS7C4IRE-BdLLx37K.js","assets/reference-chip-e-fG4-yW.js","assets/design-icons-QbNMZniQ.js","assets/popover-BQolmvDR.js","assets/es2015-BHonSvOU.js","assets/dist-Du6flkGD.js","assets/dist-ClMNSUvT.js","assets/label-B_s8eiYA.js","assets/cez-idle-C0drOeLs.js","assets/hosts-rdWe_OBc.js","assets/run-detail-refresh-Db5HOGMX.js","assets/open-in-menu-DkFneOWr.js","assets/bot-TkDIw4y-.js","assets/external-link-BE6y205O.js","assets/folder-o-AvL3y3.js","assets/smartphone-Lr8Ug2z_.js","assets/square-terminal-B6RYYieR.js","assets/dropdown-menu-NJZfnQCU.js","assets/dist-B2_vvox1.js","assets/own-lookup-DS54wXvD.js","assets/check-OP-CVgZG.js","assets/chevron-down-CHGyCDBH.js","assets/nav-row-styles-CIedRn3A.js","assets/folder-browser-TNWat5kt.js","assets/loader-circle-CPBhhDbB.js","assets/play-CmVAj_fu.js","assets/search-x-I9Q8pgUa.js","assets/preview-D3zYSmIA.js","assets/dist-CyFJ-9Ex.js","assets/switch-B9OfOEzC.js","assets/dist-Czz3Y5qH.js","assets/badge-DAnkqD7i.js","assets/dialog-DKr-j9S6.js","assets/project-router-CfEuKuz1.js","assets/status-dot-Da1M54kK.js","assets/report-selection-nUbQVjJu.js","assets/use-search-params-writer-DD5PEEZw.js","assets/page-shell-BdjH5hyc.js","assets/page-shell-CEIoW56O.css","assets/format-BU7D3IfE.js","assets/command-4D8sPZJy.js","assets/project-order-AcHI4Dcl.js","assets/skills-pM_PouEs.js","assets/agent-accounts-Du8CHfFX.js","assets/control-locations-kCPVEtOM.js","assets/agents-settings-path-7X6_cvUg.js","assets/centered-state-N8vWM_Hw.js","assets/html-report-BX3msvci.js","assets/index-CWmMYQdT.css","assets/highlighter-Crq-WTmN.js","assets/image-preview-C_xACQXI.js","assets/zoomable-image-DJ1lJEMc.js","assets/textarea-BGp28xFr.js","assets/markdown-BBDDg-4t.js","assets/markdown-Bmdr6MIa.js","assets/chunk-BO2N2NFS-DQrpGzb-.js","assets/lib-DrPFkMXk.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./preload-helper-Czpn1I53.js";import{o as i}from"./dist-CCX8mhHc.js";import{t as a}from"./diff-stat-DCO_BkZB.js";import{n as o,r as s,t as c}from"./image-preview-C_xACQXI.js";var l=e(t(),1),u=n();function d(e){let[t,n]=(0,l.useState)(null);return(0,l.useEffect)(()=>{let e=!1;return r(()=>import(`./diff-view-Chu6rn_i.js`).then(t=>{e||n({View:t.DiffView})},()=>{e||n(`failed`)}),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73])),()=>{e=!0}},[]),e.files.length===0?(0,u.jsx)(`p`,{"data-slot":`diff-empty`,className:i(`px-1 text-xs text-muted-foreground`,e.className),children:`No changes.`}):t===`failed`?(0,u.jsx)(f,{...e}):t===null?(0,u.jsx)(`p`,{"data-slot":`diff-loading`,className:i(`px-1 text-xs text-muted-foreground`,e.className),children:`Loading diff…`}):(0,u.jsx)(t.View,{...e})}function f({files:e,wrap:t=!1,imageSrc:n,onOpenInApp:r,viewRef:a,totals:o=!0,actions:c,className:d}){let f={adds:e.reduce((e,t)=>e+t.adds,0),dels:e.reduce((e,t)=>e+t.dels,0),files:e.length},m=(0,l.useRef)(null);return(0,l.useImperativeHandle)(a,()=>({scrollToPath:e=>{for(let t of m.current?.querySelectorAll(`[data-slot="diff-file"]`)??[])if(t.dataset.path===e){t.scrollIntoView({block:`start`,behavior:`smooth`});return}}})),(0,u.jsxs)(`div`,{ref:m,"data-slot":`diff`,"data-fallback":`true`,className:i(`flex min-w-0 flex-col gap-3`,d),children:[(0,u.jsxs)(`div`,{"data-slot":`diff-header`,hidden:!o&&!c,className:`flex min-h-9 flex-wrap items-center gap-x-2 gap-y-1.5 px-1`,children:[(0,u.jsx)(s,{stat:f,hidden:!o}),c?(0,u.jsx)(`div`,{"data-slot":`diff-actions`,className:`ms-auto flex items-center gap-1.5`,children:c}):null]}),e.map(e=>(0,u.jsx)(p,{file:e,wrap:t,imageSrc:n,onOpenInApp:r},`${e.oldPath??``}→${e.path}`))]})}function p({file:e,wrap:t,imageSrc:n,onOpenInApp:r}){let s=e.oldPath?`${e.oldPath} → ${e.path}`:e.path;return(0,u.jsxs)(`section`,{"data-slot":`diff-file`,"data-path":e.path,className:`min-w-0 overflow-clip rounded-md border border-border bg-card`,children:[(0,u.jsxs)(`header`,{className:`flex items-start gap-2 border-b border-border px-3 py-2`,children:[(0,u.jsx)(`span`,{"data-slot":`diff-file-path`,title:s,className:`min-w-0 wrap-anywhere font-mono text-xs font-medium`,children:s}),(0,u.jsx)(`span`,{className:`ml-auto shrink-0`,children:(0,u.jsx)(a,{stat:{adds:e.adds,dels:e.dels,files:1},className:`text-xs`})})]}),o(e)?(0,u.jsx)(c,{file:e,imageSrc:n,onOpenInApp:r}):e.binary?(0,u.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-muted-foreground`,children:`Binary file — no text diff.`}):e.patch===``?(0,u.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-muted-foreground`,children:`No content changes (metadata only).`}):(0,u.jsx)(`pre`,{className:i(`py-2 font-mono text-xs leading-[1.7]`,t?`break-words whitespace-pre-wrap`:`overflow-x-auto whitespace-pre`),children:e.patch.split(`
|
|
3
3
|
`).map((e,t)=>(0,u.jsxs)(`span`,{className:i(`block px-4`,e.startsWith(`+`)&&!e.startsWith(`+++`)&&`bg-diff-add`,e.startsWith(`-`)&&!e.startsWith(`---`)&&`bg-diff-del`,e.startsWith(`@@`)&&`text-muted-foreground`),children:[e,e===``?` `:``]},t))})]})}export{d as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{o as t}from"./dist-CCX8mhHc.js";import{j as n,nt as r,u as i,v as a}from"./design-icons-QbNMZniQ.js";import{t as o}from"./createLucideIcon-BHp8sXmF.js";import{t as s}from"./button-BV_AiLj2.js";import{n as c,p as l,r as u,t as d}from"./dropdown-menu-NJZfnQCU.js";import{vr as f}from"./index-
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{o as t}from"./dist-CCX8mhHc.js";import{j as n,nt as r,u as i,v as a}from"./design-icons-QbNMZniQ.js";import{t as o}from"./createLucideIcon-BHp8sXmF.js";import{t as s}from"./button-BV_AiLj2.js";import{n as c,p as l,r as u,t as d}from"./dropdown-menu-NJZfnQCU.js";import{vr as f}from"./index-C3kap2_j.js";var p=o(`rows-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}]]),m=o(`text-wrap`,[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]]),h=e();function g({mode:e,wrap:t,onModeChange:n,onWrapChange:r,disabled:i=!1}){return(0,h.jsxs)(`span`,{className:`flex items-center gap-1.5 max-md:hidden`,children:[(0,h.jsxs)(`span`,{"data-slot":`diff-mode-toggle`,role:`group`,"aria-label":`Diff layout`,className:`inline-flex items-center rounded-lg border border-border bg-card p-0.5`,children:[(0,h.jsx)(S,{current:e,value:`unified`,onModeChange:n,disabled:i}),(0,h.jsx)(S,{current:e,value:`split`,onModeChange:n,disabled:i})]}),(0,h.jsx)(b,{wrap:t,onWrapChange:r,disabled:i,labelled:!0,className:`gap-1.5 rounded-lg px-3 text-xs font-medium`})]})}function _({wrap:e,onWrapChange:t,preview:n=!1,onPreviewChange:a,disabled:o=!1}){return(0,h.jsxs)(d,{children:[(0,h.jsx)(l,{asChild:!0,children:(0,h.jsxs)(s,{variant:`outline`,size:`sm`,"data-slot":`diff-view-menu`,className:`gap-1.5 rounded-lg px-3 text-xs font-medium md:hidden`,children:[(0,h.jsx)(r,{size:16,"aria-hidden":`true`,className:`size-4`}),`View`,(0,h.jsx)(i,{size:16,"aria-hidden":`true`,className:`size-3.5 text-muted-foreground`})]})}),(0,h.jsxs)(u,{align:`end`,"data-slot":`diff-view-menu-content`,children:[(0,h.jsx)(c,{"data-slot":`diff-view-wrap`,className:`min-h-11`,checked:e,disabled:o,onCheckedChange:e=>t(e===!0),children:`Wrap long lines`}),a?(0,h.jsx)(c,{"data-slot":`diff-view-preview`,className:`min-h-11`,checked:n,onCheckedChange:e=>a(e===!0),children:`Preview Markdown`}):null]})]})}var v=`Unavailable while Markdown preview is on`;function y(){return(0,h.jsx)(`span`,{"data-slot":`markdown-preview-hint`,role:`status`,className:`text-xs text-muted-foreground max-sm:sr-only`,children:`Full-document preview — layout and wrap are off`})}function b({wrap:e,onWrapChange:n,className:r=`rounded-lg`,disabled:i=!1,labelled:a=!1}){return(0,h.jsxs)(s,{variant:`outline`,size:a?`default`:`icon-sm`,"data-slot":`wrap-toggle`,"aria-pressed":e,"aria-label":`Wrap long lines`,title:i?v:`Wrap long lines`,disabled:i,className:t(r,e?`border-accent-text/40 bg-muted text-accent-text`:`text-muted-foreground hover:text-foreground`),onClick:()=>n(!e),children:[(0,h.jsx)(m,{"aria-hidden":`true`}),a?(0,h.jsx)(`span`,{"aria-hidden":`true`,children:`Wrap`}):null]})}function x({preview:e,onPreviewChange:n}){return(0,h.jsxs)(s,{variant:`outline`,size:`default`,"data-slot":`markdown-preview-toggle`,"aria-pressed":e,"aria-label":`Preview Markdown`,title:e?`Show Markdown as a diff`:`Preview Markdown`,className:t(`gap-1.5 rounded-lg px-0 text-xs font-medium sm:px-3`,e?`border-accent-text/40 bg-muted text-accent-text`:`text-muted-foreground hover:text-foreground`),onClick:()=>n(!e),children:[(0,h.jsx)(f,{"aria-hidden":`true`,className:`size-4`}),(0,h.jsx)(`span`,{"aria-hidden":`true`,className:`max-sm:hidden`,children:`Preview MD`})]})}function S({current:e,value:n,onModeChange:r,disabled:i}){let o=e===n;return(0,h.jsxs)(`button`,{type:`button`,"data-mode":n,"aria-pressed":o,disabled:i,title:i?v:void 0,onClick:()=>r(n),className:t(`inline-flex h-[30px] items-center gap-1.5 rounded-md px-3 text-xs font-medium capitalize transition-colors outline-hidden focus-visible:ring-2 focus-visible:ring-ring/50 disabled:opacity-50`,o?`bg-muted text-foreground`:`text-muted-foreground pointer-hover:text-foreground`),children:[n===`unified`?(0,h.jsx)(p,{"aria-hidden":`true`,className:`size-4`}):(0,h.jsx)(a,{size:16,"aria-hidden":`true`,className:`size-4`}),n]})}function C({branch:e}){return(0,h.jsxs)(`span`,{"data-slot":`branch-chip`,className:`flex min-w-0 items-center gap-1 rounded-sm border border-border bg-card px-1.5 py-px font-mono text-xs font-medium`,children:[(0,h.jsx)(n,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,h.jsx)(`span`,{className:`truncate`,children:e})]})}export{x as a,y as i,_ as n,b as o,g as r,C as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{o as r}from"./dist-CCX8mhHc.js";import{t as i}from"./chevron-right-BENZ-1ZN.js";import{t as a}from"./eye-B8okNWXU.js";import{t as o}from"./button-BV_AiLj2.js";import{t as s}from"./diff-stat-DCO_BkZB.js";import{o as c,rt as l,wn as u}from"./index-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{o as r}from"./dist-CCX8mhHc.js";import{t as i}from"./chevron-right-BENZ-1ZN.js";import{t as a}from"./eye-B8okNWXU.js";import{t as o}from"./button-BV_AiLj2.js";import{t as s}from"./diff-stat-DCO_BkZB.js";import{o as c,rt as l,wn as u}from"./index-C3kap2_j.js";import{a as d,i as f,r as p}from"./highlighter-Crq-WTmN.js";import{n as m,r as h,t as g}from"./image-preview-C_xACQXI.js";import{t as _}from"./textarea-BGp28xFr.js";import{n as v,t as y}from"./markdown-BBDDg-4t.js";import{t as b}from"./markdown-Bmdr6MIa.js";var x=e(t(),1),S=44;function C(e){if(e.binary===!0||e.patch===``)return 1;let t=e.patch.split(`
|
|
2
2
|
`),n=t.findIndex(e=>e.startsWith(`@@`));return n===-1?t.length:t.length-n}function ee(e){return C(e)*20+S}function te(e){return e.reduce((e,t)=>e+C(t),0)}function ne(e,t){let n=new URLSearchParams(e).get(`diff`);return n===`flat`||n===`virtual`?n:t>1500?`virtual`:`flat`}function w(e){return`${e.oldPath??``}→${e.path}`}function T(e){let t=0;for(let n of e.split(`
|
|
3
3
|
`))n.length>t&&(t=n.length);return t}var E=n();function D({path:e,side:t,line:n,hunk:r}){let i=typeof n==`number`?String(n):`${n.start}-${n.end}`;return`${r?`hunk`:`line`}:${t}:${i}:${e}`}function O(e,t){return t.kind===`del`||t.newLine===void 0?{path:e,side:`old`,line:t.oldLine??0,hunk:!1}:{path:e,side:`new`,line:t.newLine,hunk:!1}}function k(e,t){let[n,r,i]=t.newCount===0?[t.oldStart,t.oldCount,`old`]:[t.newStart,t.newCount,`new`];return{path:e,side:i,line:{start:n,end:n+Math.max(r,1)-1},hunk:!0}}function A(e){return e.hunk?`Add a note on this hunk`:`Add a note on ${e.side===`old`?`old `:``}line ${String(e.line)}`}function j(e){return typeof e.line==`number`?`Note on ${e.side===`old`?`old `:``}line ${e.line} of ${e.path}`:`Note on lines ${e.line.start}–${e.line.end} of ${e.path}`}function re(e){let[t,n]=(0,x.useState)(()=>new Map),r=(0,x.useRef)(null);if(u([...t.values()].some(e=>e.text.trim()!==``)),!e)return;let i=e=>n(t=>{let n=new Map(t);return n.delete(e),n});return{drafts:t,open:e=>{let t=D(e);r.current=t,n(n=>new Map(n).set(t,n.get(t)??{anchor:e,text:``}))},change:(e,t)=>n(n=>{let r=n.get(e);return r?new Map(n).set(e,{...r,text:t}):n}),close:i,save:n=>{let r=t.get(n);!r||r.text.trim()===``||(e(r.anchor,r.text),i(n))},takeFocus:e=>r.current===e?(r.current=null,!0):!1}}var M=r(`cursor-pointer pointer-coarse:min-h-11 pointer-coarse:min-w-11 hover:text-foreground hover:underline`,`focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-ring`);function N({noteKey:e,draft:t,notes:n}){let r=(0,x.useRef)(null);(0,x.useEffect)(()=>{n.takeFocus(e)&&r.current?.focus()});let i=t.text.trim()===``;return(0,E.jsxs)(`div`,{"data-slot":`diff-note-editor`,className:`sticky left-0 flex w-full max-w-[100cqi] flex-col gap-2 border-y border-border bg-card px-3 py-2 font-sans`,children:[(0,E.jsx)(_,{ref:r,"data-slot":`diff-note-text`,"aria-label":j(t.anchor),placeholder:`What should change here?`,rows:2,value:t.text,onChange:t=>n.change(e,t.target.value),onKeyDown:t=>{if(t.key===`Escape`){t.preventDefault(),t.stopPropagation(),n.close(e);return}l(t)&&(t.preventDefault(),n.save(e))},className:`min-h-11 text-base md:text-[13px]`}),(0,E.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,E.jsx)(o,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`diff-note-cancel`,onClick:()=>n.close(e),children:`Cancel`}),(0,E.jsx)(o,{type:`button`,variant:`outline`,size:`sm`,"data-slot":`diff-note-save`,disabled:i,onClick:()=>n.save(e),children:`Save`})]})]})}var P=/[A-Za-z0-9_]+|\s+|[^\sA-Za-z0-9_]+/g,F=300,I=.3;function L(e,t){if(e===t)return null;let n=e.match(P)??[],r=t.match(P)??[];if(n.length===0||r.length===0||n.length>F||r.length>F)return null;let i=ie(n,r),a=r.length+1;return(i[n.length*a+r.length]??0)/Math.max(n.length,r.length)<I?null:ae(n,r,i)}function ie(e,t){let n=t.length+1,r=new Uint16Array((e.length+1)*n);for(let i=1;i<=e.length;i++)for(let a=1;a<=t.length;a++)r[i*n+a]=e[i-1]===t[a-1]?(r[(i-1)*n+(a-1)]??0)+1:Math.max(r[(i-1)*n+a]??0,r[i*n+(a-1)]??0);return r}function ae(e,t,n){let r=t.length+1,i=Array.from({length:e.length},()=>!1),a=Array.from({length:t.length},()=>!1),o=e.length,s=t.length;for(;o>0&&s>0;)e[o-1]===t[s-1]?(i[o-1]=!0,a[s-1]=!0,o--,s--):(n[(o-1)*r+s]??0)>=(n[o*r+(s-1)]??0)?o--:s--;return{del:R(e,i),add:R(t,a)}}function R(e,t){let n=[];return e.forEach((e,r)=>{let i=!(t[r]??!1),a=n[n.length-1];a&&a.changed===i?a.text+=e:n.push({text:e,changed:i})}),n}function oe(e,t,n){if(!t||t.length===0)return e?e.map(e=>({text:e.content,color:e.color,changed:!1})):n===``?[]:[{text:n,changed:!1}];if(!e||e.length===0)return t.map(e=>({text:e.text,changed:e.changed}));let r=[],i=0,a=0,o=0,s=0;for(;i<e.length&&o<t.length;){let n=e[i],c=t[o],l=n.content.length-a,u=c.text.length-s,d=Math.min(l,u);d>0&&(r.push({text:n.content.slice(a,a+d),color:n.color,changed:c.changed}),a+=d,s+=d),n.content.length-a<=0&&(i++,a=0),c.text.length-s<=0&&(o++,s=0)}for(;i<e.length;){let t=e[i],n=t.content.slice(a);n!==``&&r.push({text:n,color:t.color,changed:!1}),i++,a=0}return r}var se=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/,ce=`… (patch truncated)`;function z(e){let t=[],n=!1,r=null,i=0,a=0,o=e.split(`
|
|
4
4
|
`);o.at(-1)===``&&o.pop();for(let e of o){let o=se.exec(e);if(o){r={header:e,oldStart:Number(o[1]),oldCount:o[2]===void 0?1:Number(o[2]),newStart:Number(o[3]),newCount:o[4]===void 0?1:Number(o[4]),lines:[]},i=r.oldStart,a=r.newStart,t.push(r);continue}if(e.includes(ce)){n=!0,r=null;continue}r&&(e.startsWith(`+`)?r.lines.push({kind:`add`,text:e.slice(1),newLine:a++}):e.startsWith(`-`)?r.lines.push({kind:`del`,text:e.slice(1),oldLine:i++}):e.startsWith(`\\`)||r.lines.push({kind:`context`,text:e.slice(1),oldLine:i++,newLine:a++}))}return{hunks:t,truncated:n}}function le(e,t=!1){let n=[],r=e[0];if(!r)return n;r.newStart>1&&n.push({beforeHunk:0,count:r.newStart-1,oldStart:1,newStart:1});for(let t=1;t<e.length;t++){let r=e[t-1],i=e[t],a=r.oldStart+r.oldCount,o=r.newStart+r.newCount,s=i.newStart-o;s>0&&n.push({beforeHunk:t,count:s,oldStart:a,newStart:o})}if(t){let t=e[e.length-1];n.push({beforeHunk:e.length,oldStart:t.oldStart+t.oldCount,newStart:t.newStart+t.newCount})}return n}function ue(e,t){let n=e.count===void 0?t.length:e.newStart+e.count-1,r=e.oldStart-e.newStart,i=[];for(let a=e.newStart;a<=Math.min(n,t.length);a++)i.push({kind:`context`,text:t[a-1]??``,oldLine:a+r,newLine:a});return i}function de(e,t){let n=Array.from({length:e.length}),r=Array.from({length:t.length}),i=Math.min(e.length,t.length);for(let a=0;a<i;a++){let i=L(e[a].text,t[a].text);i&&(n[a]=i.del,r[a]=i.add)}return{dels:e,adds:t,delSpans:n,addSpans:r}}function B(e,t,n){let r=0;for(;r<e.lines.length;){let i=e.lines[r];if(i.kind===`del`||i.kind===`add`){let t=[],i=[];for(;r<e.lines.length&&e.lines[r].kind===`del`;)t.push(e.lines[r++]);for(;r<e.lines.length&&e.lines[r].kind===`add`;)i.push(e.lines[r++]);n(de(t,i))}else t(i),r++}}function fe(e,t=[],n){let r=new Map(t.map(e=>[e.beforeHunk,e])),i=[],a=e=>{let t=r.get(e);if(!t)return;let a=n?.get(e);if(a)for(let e of a)i.push({type:`line`,cell:{line:e}});else i.push({type:`gap`,gap:t})};return e.forEach((e,t)=>{a(t),i.push({type:`hunk`,hunk:e}),B(e,e=>i.push({type:`line`,cell:{line:e}}),e=>{e.dels.forEach((t,n)=>i.push({type:`line`,cell:{line:t,spans:e.delSpans[n]}})),e.adds.forEach((t,n)=>i.push({type:`line`,cell:{line:t,spans:e.addSpans[n]}}))})}),a(e.length),i}function pe(e,t=[],n){let r=new Map(t.map(e=>[e.beforeHunk,e])),i=[],a=e=>{let t=r.get(e);if(!t)return;let a=n?.get(e);if(a)for(let e of a)i.push({type:`pair`,left:{line:e},right:{line:e}});else i.push({type:`gap`,gap:t})};return e.forEach((e,t)=>{a(t),i.push({type:`hunk`,hunk:e}),B(e,e=>i.push({type:`pair`,left:{line:e},right:{line:e}}),e=>{let t=Math.max(e.dels.length,e.adds.length);for(let n=0;n<t;n++){let t=e.dels[n],r=e.adds[n];i.push({type:`pair`,...t?{left:{line:t,spans:e.delSpans[n]}}:{},...r?{right:{line:r,spans:e.addSpans[n]}}:{}})}})}),a(e.length),i}function me({file:e,loadFileText:t,imageSrc:n}){let r=(0,x.useMemo)(()=>he(e),[e]),i=(0,x.useRef)(t);i.current=t;let a=(0,x.useRef)(n);a.current=n;let o=t!==void 0,[s,c]=(0,x.useState)(null);(0,x.useEffect)(()=>{let t=i.current;if(!t)return;let n=!1;return t(e.path).then(t=>!n&&c({path:e.path,text:t}),()=>!n&&c({path:e.path,text:null})),()=>{n=!0}},[e.path,e.patch,o]);let l=(0,x.useCallback)(t=>{let n=a.current,r=n?v(e.path,t):null;return r===null||!n?null:n(r)},[e.path]),u=s?.path===e.path?s:null;if(o&&u===null)return(0,E.jsx)(`p`,{role:`status`,className:`px-4 py-2.5 text-xs text-muted-foreground`,children:`Loading preview…`});let d=u?.text??null;if(d===null&&r.text===``)return(0,E.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-muted-foreground`,children:`No content changes to preview.`});let f=d!==null||r.complete?null:o?`The full file could not be loaded. Showing the changed sections only.`:`Showing the changed sections only.`;return(0,E.jsx)(`div`,{"data-slot":`diff-markdown-preview`,className:`px-4 py-5 md:px-6`,children:(0,E.jsxs)(`div`,{className:`mx-auto max-w-[72ch]`,children:[f?(0,E.jsx)(`p`,{className:`mb-4 text-xs text-muted-foreground`,children:f}):null,(0,E.jsx)(b,{document:!0,imageSrc:l,children:d??r.text})]})})}function he(e){let t=z(e.patch);return{text:t.hunks.map(e=>e.lines.filter(e=>e.kind!==`del`).map(e=>e.text).join(`
|
package/web/dist/assets/{discard-changes-dialog-BMT0YtWx.js → discard-changes-dialog-BB47RqdX.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{$t as t,an as n,en as r,in as i,nn as a,on as o,rn as s,tn as c}from"./index-
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{$t as t,an as n,en as r,in as i,nn as a,on as o,rn as s,tn as c}from"./index-C3kap2_j.js";var l=e();function u({open:e,subject:u,onKeep:d,onDiscard:f}){return(0,l.jsx)(t,{open:e,onOpenChange:e=>!e&&d(),children:(0,l.jsxs)(a,{"data-slot":`discard-changes-dialog`,className:`sm:max-w-[560px]`,children:[(0,l.jsxs)(n,{children:[(0,l.jsx)(o,{children:`Discard unsaved changes?`}),(0,l.jsxs)(s,{children:[`Your edits to `,(0,l.jsx)(`span`,{className:`font-medium text-foreground`,children:u}),` are not saved. They are lost if you continue.`]})]}),(0,l.jsxs)(i,{children:[(0,l.jsx)(c,{"data-slot":`discard-changes-keep`,children:`Keep editing`}),(0,l.jsx)(r,{"data-slot":`discard-changes-confirm`,className:`bg-danger text-danger-foreground hover:brightness-[0.96]`,onClick:f,children:`Discard changes`})]})]})})}export{u as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{qt as r}from"./queries-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{qt as r}from"./queries-DD_9iITj.js";import{Cn as i,Gt as a}from"./project-scope-context-DNrHbqd2.js";import{d as o,m as s,p as c}from"./chunk-KS7C4IRE-BdLLx37K.js";import{o as l}from"./dist-CCX8mhHc.js";import{T as u,ct as d}from"./design-icons-QbNMZniQ.js";import{t as f}from"./createLucideIcon-BHp8sXmF.js";import{o as p}from"./diff-controls-CkxtRrbB.js";import{t as m}from"./centered-state-N8vWM_Hw.js";import{r as h}from"./html-report-BX3msvci.js";import{a as g,i as _,r as v}from"./highlighter-Crq-WTmN.js";import{n as y,t as b}from"./markdown-Bmdr6MIa.js";import{t as x}from"./html-report-frame-Bk6UkqKa.js";var S=f(`file-exclamation-point`,[[`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:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),C=f(`file-question-mark`,[[`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:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}]]),w=f(`file-x`,[[`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`}],[`path`,{d:`m14.5 12.5-5 5`,key:`b62r18`}],[`path`,{d:`m9.5 12.5 5 5`,key:`1rk7el`}]]),T=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`bmp`,`ico`,`avif`]);function E(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n<=0?!1:T.has(t.slice(n+1).toLowerCase())}function D(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return E(e)||n>0&&t.slice(n+1).toLowerCase()===`svg`}var O=e(t(),1);function k(e){return e.tooLarge?`too-large`:D(e.path)?`image`:e.binary?`binary`:`text`}function A(e){return e>=1024**2?`${(e/1024**2).toFixed(1)} MB`:e>=1024?`${(e/1024).toFixed(1)} kB`:`${e} B`}var j=n();function M({runId:e,path:t,className:n}){let a=r(e,t??void 0);if(t===null)return(0,j.jsx)(z,{className:n,children:(0,j.jsx)(m,{icon:(0,j.jsx)(u,{size:16}),tone:`neutral`,heading:`h2`,title:`Select a file`,subtitle:`Pick a file from this task’s worktree to inspect its contents.`,className:`[&_[data-slot=centered-state-tile]]:size-10 [&_[data-slot=centered-state-tile]]:border-0 [&_[data-slot=centered-state-tile]]:bg-transparent [&_[data-slot=centered-state-tile]]:text-accent-text [&_[data-slot=centered-state-tile]]:shadow-none [&_h2]:text-xl`})});if(a.isPending)return(0,j.jsx)(z,{className:n,children:(0,j.jsxs)(`p`,{"data-slot":`file-preview-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground`,children:[`Loading `,t,`…`]})});if(a.isError){let e=a.error instanceof i&&a.error.status===409;return(0,j.jsx)(z,{className:n,children:(0,j.jsx)(m,{icon:e?(0,j.jsx)(w,{}):(0,j.jsx)(d,{size:16}),tone:e?`neutral`:`danger`,heading:`h2`,title:e?`Cannot preview this file`:`Could not load this file`,subtitle:a.error.message})})}return a.data.type===`file`?(0,j.jsx)(F,{runId:e,entry:a.data,className:n}):(0,j.jsx)(z,{className:n,children:(0,j.jsx)(m,{icon:(0,j.jsx)(C,{}),tone:`neutral`,heading:`h2`,title:`Choose a file inside this directory`,subtitle:`Expand the folder in the tree, or enter the full path to a file.`})})}function N(e,t,n){let r=t?.replace(/\/+$/,``);if(r&&e.startsWith(`${r}/`))return e.slice(r.length+1);let i=/^.*\/\.ai\/(?:cezar|squawk)\/worktrees\/[^/]+\/(.+)$/.exec(e);if(i?.[1])return i[1];if(e.startsWith(`/`)&&n&&!n.startsWith(`/`)){let t=n.replace(/^\.?\//,``);if(t&&(e===`/${t}`||e.endsWith(`/${t}`)))return t}return e}function P(e,t,n){let r=t&&/\.(?:md|markdown)$/i.test(e.path),i=t&&h(e.path),a=/\.(?:png|jpe?g|gif|webp|bmp|ico|avif)$/i.test(e.path),o=t&&a&&e.size<=10*1024*1024?`image`:k(e);return{html:i,kind:o,toggle:(r||i)&&o===`text`,showImage:o===`image`&&(!t||a),rendered:n?null:r?`markdown`:i?`html`:null}}function F({runId:e,entry:t,displayPath:n,className:r,imageUrl:i,downloadUrl:a,snapshot:o,readerHref:s,documentPreview:c=!1}){let[u,d]=(0,O.useState)(!1),[f,m]=(0,O.useState)(!0),h=n??N(t.path),g=P(t,c,u),_=!!(o||a||g.toggle),v=!g.showImage&&g.kind===`text`&&g.rendered===null;return(0,j.jsxs)(z,{className:r,children:[(0,j.jsxs)(`header`,{"data-slot":`file-preview-head`,className:l(`flex min-h-11 items-center gap-2 border-b border-border bg-muted/40 ps-4 text-xs`,v?`pe-2 py-1`:`pe-4 py-2.5`),children:[(0,j.jsx)(`span`,{className:`min-w-0 truncate font-mono font-medium text-foreground`,title:h,children:h}),(0,j.jsx)(`span`,{"data-slot":`file-preview-size`,className:`ml-auto shrink-0 font-mono text-xs tabular-nums text-muted-foreground`,children:A(t.size)}),v?(0,j.jsx)(p,{wrap:f,onWrapChange:m,className:`rounded-md`}):null]}),_?(0,j.jsx)(L,{snapshot:o,downloadUrl:a,source:g.toggle?u:null,onSource:()=>d(e=>!e),readerHref:g.html&&g.kind===`text`?s:void 0}):null,(0,j.jsx)(I,{runId:e,entry:t,kind:g.kind,showImage:g.showImage,rendered:g.rendered,imageUrl:i,wrap:f})]})}function I({runId:e,entry:t,kind:n,showImage:r,rendered:i,imageUrl:o,wrap:s}){return r?(0,j.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,j.jsx)(`img`,{"data-slot":`file-preview-image`,src:o??a(e,t.path),alt:t.path,className:`max-h-[70vh] max-w-full rounded-sm`})}):n===`too-large`?(0,j.jsx)(m,{icon:(0,j.jsx)(S,{}),tone:`neutral`,heading:`h2`,title:`Too large to preview`,subtitle:`${A(t.size)} — past the preview cap. Open it in your editor instead.`}):n===`binary`?(0,j.jsx)(m,{icon:(0,j.jsx)(C,{}),tone:`neutral`,heading:`h2`,title:`Binary file`,subtitle:`${A(t.size)} of binary data — no text preview.`}):i===`markdown`?(0,j.jsx)(`div`,{className:`p-4`,children:(0,j.jsx)(b,{document:!0,children:t.content??``})}):i===`html`?(0,j.jsx)(x,{html:t.content??``,title:`Report: ${t.path}`,className:`h-[70vh]`}):(0,j.jsx)(H,{path:t.path,text:t.content??``,wrap:s})}function L({snapshot:e,downloadUrl:t,source:n,onSource:r,readerHref:i}){return(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 border-b border-border px-4 py-2 text-xs`,children:[e?(0,j.jsxs)(`span`,{children:[`Published snapshot · `,e]}):null,t?(0,j.jsx)(`a`,{className:`inline-flex min-h-11 items-center text-accent-text underline`,href:t,children:`Download`}):null,n===null?null:(0,j.jsx)(`button`,{className:`min-h-11 rounded px-2 text-accent-text underline focus-visible:ring-2`,onClick:r,children:n?`Preview`:`View source`}),i?(0,j.jsx)(R,{href:i}):null]})}function R({href:e}){let t=s(),n=c();return(0,j.jsx)(`a`,{className:`inline-flex min-h-11 items-center px-2 text-accent-text underline focus-visible:ring-2`,href:o(e),onClick:r=>y(r,t,e,n),children:`Open reader`})}function z({className:e,children:t}){return(0,j.jsx)(`section`,{"data-slot":`file-preview`,className:l(`flex flex-col overflow-hidden rounded-lg border border-border bg-card`,e),children:t})}var B=1500;function V(e,t){let n=(0,O.useMemo)(()=>t.split(`
|
|
2
2
|
`).map(e=>[{content:e}]),[t]),r=(0,O.useMemo)(()=>g(e),[e]),i=n.length>B,[a,o]=(0,O.useState)(null);return(0,O.useEffect)(()=>{if(r===null||i)return;let n=!1;return v(t,r).then(r=>{n||o({key:`${e}\0${t}`,tokens:r.tokens})}),()=>{n=!0}},[e,t,r,i]),r===null||i?n:a?.key===`${e}\0${t}`?a.tokens:_(t,r)?.tokens??n}function H({path:e,text:t,wrap:n=!1}){let r=V(e,t);return(0,j.jsx)(`div`,{"data-slot":`file-preview-code`,"data-lang":g(e)??`plaintext`,className:`overflow-x-auto overscroll-x-contain py-2 font-mono text-xs leading-[1.7] [scrollbar-width:thin]`,children:(0,j.jsx)(`div`,{className:n?`min-w-0`:`w-max min-w-full`,children:r.map((e,t)=>(0,j.jsxs)(`div`,{className:`flex`,children:[(0,j.jsx)(`span`,{className:`sticky left-0 w-14 shrink-0 select-none bg-card pr-3 pl-4 text-right tabular-nums text-muted-foreground`,children:t+1}),(0,j.jsx)(`span`,{className:l(`min-w-0 flex-1 pr-6`,n?`whitespace-pre-wrap wrap-anywhere`:`whitespace-pre`),children:e.map((e,t)=>(0,j.jsx)(`span`,{style:e.color===void 0?void 0:{color:e.color},children:e.content},t))})]},t))})})}export{A as a,C as c,N as i,S as l,F as n,D as o,M as r,w as s,H as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{R as t}from"./queries-
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{R as t}from"./queries-DD_9iITj.js";import{Cn as n}from"./project-scope-context-DNrHbqd2.js";import{o as r}from"./dist-CCX8mhHc.js";import{t as i}from"./createLucideIcon-BHp8sXmF.js";import{t as a}from"./chevron-right-BENZ-1ZN.js";import{t as o}from"./folder-o-AvL3y3.js";var s=i(`corner-left-up`,[[`path`,{d:`M14 9 9 4 4 9`,key:`1af5af`}],[`path`,{d:`M20 20h-7a4 4 0 0 1-4-4V4`,key:`1blwi3`}]]),c=e(),l=`x-apple.systempreferences:com.apple.preference.security?Privacy_FilesAndFolders`,u=`inline-flex items-center gap-1 rounded-md border border-border px-2 py-1 text-foreground hover:bg-muted`;function d(e){let t=e.replace(/[\\/]+$/,``),n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));return n<0?null:n===0?t.slice(0,1):t.slice(0,n)}function f({path:e,selected:n,onSelect:i,onEnter:l,decorate:u,emptyHint:d,showHidden:f=!1}){let m=t(e,f),h=m.data?.parent??null;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(`p`,{"data-slot":`fs-breadcrumb`,className:`truncate font-mono text-xs text-soft-foreground`,title:m.data?.path??void 0,children:m.data?.path??(m.isError?``:`Loading…`)}),m.isError?(0,c.jsx)(p,{error:m.error,path:e,onEnter:l,onRetry:()=>void m.refetch()}):(0,c.jsxs)(`ul`,{"data-slot":`fs-listing`,className:`max-h-64 divide-y divide-border/60 overflow-y-auto overscroll-contain rounded-md border border-border`,children:[h===null?null:(0,c.jsx)(`li`,{className:`flex`,children:(0,c.jsxs)(`button`,{type:`button`,"data-slot":`fs-up`,onClick:()=>l(h),className:`flex flex-1 items-center gap-2 px-3 py-2 text-left text-[13px] hover:bg-muted`,children:[(0,c.jsx)(s,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),`Up one level`]})}),(m.data?.dirs??[]).map(e=>(0,c.jsxs)(`li`,{className:`flex items-stretch`,children:[(0,c.jsxs)(`button`,{type:`button`,"data-slot":`fs-dir`,"aria-pressed":n?.path===e.path,onClick:()=>i(e),onDoubleClick:()=>l(e.path),className:r(`flex min-w-0 flex-1 items-center gap-2 px-3 py-2 text-left text-[13px] hover:bg-muted`,n?.path===e.path&&`bg-muted`),children:[(0,c.jsx)(o,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,c.jsx)(`span`,{className:`truncate`,children:e.name}),u?.(e)]}),(0,c.jsx)(`button`,{type:`button`,"data-slot":`fs-enter`,"aria-label":`Open ${e.name}`,onClick:()=>l(e.path),className:`flex shrink-0 items-center px-2.5 text-muted-foreground hover:bg-muted hover:text-foreground`,children:(0,c.jsx)(a,{className:`size-3.5`,"aria-hidden":`true`})})]},e.path)),m.data&&m.data.dirs.length===0?(0,c.jsx)(`li`,{className:`px-3 py-2 text-[13px] text-muted-foreground`,children:d}):null]}),m.data?.truncated?(0,c.jsx)(`p`,{"data-slot":`fs-truncated`,className:`text-xs text-muted-foreground`,children:`Too many folders to list — only the first ones are shown.`}):null]})}function p({error:e,path:t,onEnter:r,onRetry:i}){let a=e instanceof n&&e.status===403,o=t===null?null:d(t);return(0,c.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,c.jsx)(`p`,{"data-slot":`fs-error`,className:`min-w-0 break-words text-[13px] text-danger`,children:e instanceof Error?e.message:`could not list that folder`}),a?(0,c.jsx)(`p`,{"data-slot":`fs-privacy-hint`,className:`text-[12.5px] text-soft-foreground`,children:`Allow it under Privacy & Security ▸ Files & Folders, then try again.`}):null,(0,c.jsxs)(`div`,{className:`flex flex-wrap gap-2 text-[12.5px]`,children:[o===null?null:(0,c.jsxs)(`button`,{type:`button`,"data-slot":`fs-error-back`,onClick:()=>r(o),className:u,children:[(0,c.jsx)(s,{className:`size-3.5`,"aria-hidden":!0}),`Back`]}),a?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(`a`,{"data-slot":`fs-privacy-settings`,href:l,target:`_blank`,rel:`noreferrer`,className:u,children:`Open Privacy Settings`}),(0,c.jsx)(`button`,{type:`button`,"data-slot":`fs-retry`,onClick:i,className:u,children:`Try again`})]}):null]})]})}function m(e,n,r=!1){let i=t(e,r);return n?.path??i.data?.path??null}export{m as n,f as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{o as r,s as i}from"./dist-CCX8mhHc.js";import{E as a,I as o,M as s,d as c,lt as l}from"./design-icons-QbNMZniQ.js";import{t as u}from"./createLucideIcon-BHp8sXmF.js";import{t as d}from"./external-link-BE6y205O.js";import{a as f,i as p,n as m,r as h,t as g}from"./diff-controls-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{o as r,s as i}from"./dist-CCX8mhHc.js";import{E as a,I as o,M as s,d as c,lt as l}from"./design-icons-QbNMZniQ.js";import{t as u}from"./createLucideIcon-BHp8sXmF.js";import{t as d}from"./external-link-BE6y205O.js";import{a as f,i as p,n as m,r as h,t as g}from"./diff-controls-CkxtRrbB.js";import{t as _}from"./square-terminal-B6RYYieR.js";import{t as v}from"./button-BV_AiLj2.js";import{i as y,p as b,r as x,t as S}from"./dropdown-menu-NJZfnQCU.js";import{t as C}from"./diff-stat-DCO_BkZB.js";import{t as w}from"./middle-truncated-name-jUQS2QzL.js";var T=u(`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`}]]),E=u(`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`}]]),D=e(t(),1),O=n();function k({root:e,selected:t,onSelect:n}){return(0,O.jsx)(`nav`,{"data-slot":`changes-tree`,"aria-label":`Changed files`,className:`min-w-0 text-[13px]`,children:(0,O.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,O.jsx)(j,{dir:e,depth:0,selected:t,onSelect:n},e.path)),e.files.map(e=>(0,O.jsx)(N,{file:e,depth:0,selected:t,onSelect:n},e.path))]})})}function A({adds:e,dels:t}){return(0,O.jsxs)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-xs font-medium tabular-nums`,children:[e>0?(0,O.jsxs)(`span`,{className:`text-semantic-green`,children:[`+`,e]}):null,e>0&&t>0?` `:null,t>0?(0,O.jsxs)(`span`,{className:`text-semantic-red`,children:[`−`,t]}):null]})}function j({dir:e,depth:t,selected:n,onSelect:i}){let[o,s]=(0,D.useState)(!0);return(0,O.jsxs)(`li`,{children:[(0,O.jsxs)(`button`,{type:`button`,"data-slot":`tree-dir`,"data-path":e.path,"data-state":o?`open`:`closed`,"aria-expanded":o,onClick:()=>s(e=>!e),className:`flex min-h-11 md:min-h-8 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,O.jsx)(c,{size:16,"aria-hidden":`true`,className:r(`size-3.5 shrink-0 transition-transform motion-reduce:transition-none`,o&&`rotate-90`)}),(0,O.jsx)(a,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,O.jsx)(`span`,{title:e.path,className:`min-w-0 truncate font-medium`,children:e.name}),(0,O.jsx)(A,{adds:e.adds,dels:e.dels})]}),o?(0,O.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,O.jsx)(j,{dir:e,depth:t+1,selected:n,onSelect:i},e.path)),e.files.map(e=>(0,O.jsx)(N,{file:e,depth:t+1,selected:n,onSelect:i},e.path))]}):null]})}var M={added:`text-semantic-green`,deleted:`text-semantic-red`};function N({file:e,depth:t,selected:n,onSelect:i}){let a=n===e.path;return(0,O.jsx)(`li`,{children:(0,O.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 md:min-h-8 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,O.jsx)(E,{"aria-hidden":`true`,className:r(`size-3.5 shrink-0`,M[e.status])}),(0,O.jsx)(w,{name:e.name,path:e.path}),(0,O.jsx)(A,{adds:e.adds,dels:e.dels})]})})}function P(e,t){return{kind:`dir`,name:e,path:t,dirs:[],files:[],adds:0,dels:0,fileCount:0}}function F(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(F)}}var I=(e,t)=>e.name.localeCompare(t.name);function L(e){let t=P(``,``),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=P(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(I),e.files.sort(I)};return i(t),{...t,dirs:t.dirs.map(F)}}function R({bar:e,healthReady:t,branch:n,stat:i,mode:a,wrap:o,preview:s=!1,onModeChange:c,onWrapChange:l,onPreviewChange:u,onAction:d}){let _=s&&u!==void 0;return(0,O.jsxs)(`div`,{"data-slot":`git-toolbar`,"data-health-ready":t,className:`flex flex-wrap items-center gap-x-3 gap-y-2 px-4 py-4 md:px-9 [&_button:not([data-button-size])]:min-h-11`,children:[(0,O.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2.5`,children:[n?(0,O.jsx)(g,{branch:n}):null,i?(0,O.jsx)(V,{stat:i}):null]}),(0,O.jsxs)(`span`,{className:r(`ml-auto flex items-center gap-1.5`,!u&&`md:hidden`),children:[(0,O.jsx)(m,{wrap:o,onWrapChange:l,preview:s,onPreviewChange:u,disabled:_}),_?(0,O.jsx)(p,{}):null,u?(0,O.jsx)(`span`,{className:`max-md:hidden`,children:(0,O.jsx)(f,{preview:s,onPreviewChange:u})}):null]}),(0,O.jsxs)(`span`,{className:r(`flex items-center gap-2 max-md:w-full`,!u&&`md:ml-auto`),children:[(0,O.jsx)(h,{mode:a,wrap:o,onModeChange:c,onWrapChange:l,disabled:_}),(0,O.jsx)(`span`,{"aria-hidden":`true`,className:`hidden h-5 w-px bg-border md:block`}),(0,O.jsxs)(`span`,{"data-slot":`git-toolbar-actions`,className:`flex items-center gap-1.5 max-md:flex-1 max-md:[&>*]:flex-1`,children:[e.secondary.map(e=>(0,O.jsx)(B,{action:e,variant:`outline`,onAction:d},e.id)),(0,O.jsx)(B,{action:e.primary,variant:e.primaryVariant,onAction:d})]}),e.menu.length>0?(0,O.jsxs)(S,{children:[(0,O.jsx)(b,{asChild:!0,children:(0,O.jsx)(v,{variant:`ghost`,size:`icon-sm`,"aria-label":`More git actions`,className:`max-md:border max-md:border-border max-md:bg-card`,children:(0,O.jsx)(T,{"aria-hidden":`true`})})}),(0,O.jsx)(x,{align:`end`,"data-slot":`git-toolbar-menu`,children:e.menu.map(e=>(0,O.jsxs)(y,{disabled:!e.enabled,title:e.reason,onSelect:()=>d(e.id),children:[z[e.id],e.label]},e.id))})]}):null]})]})}var z={commit:(0,O.jsx)(s,{size:16,"aria-hidden":`true`}),push:(0,O.jsx)(l,{size:16,"aria-hidden":`true`}),"create-pr":(0,O.jsx)(o,{size:16,"aria-hidden":`true`}),"view-pr":(0,O.jsx)(d,{"aria-hidden":`true`}),"open-terminal":(0,O.jsx)(_,{"aria-hidden":`true`})};function B({action:e,variant:t,onAction:n}){return e.id===`view-pr`?i(e.href)?(0,O.jsx)(v,{asChild:!0,variant:t,size:`sm`,"data-action":e.id,children:(0,O.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,children:[z[e.id],e.label]})}):(0,O.jsxs)(v,{variant:t,size:`sm`,"data-action":e.id,disabled:!0,title:`View PR unavailable — the recorded PR link is not an http(s) URL`,children:[z[e.id],e.label]}):(0,O.jsxs)(v,{variant:t,size:`sm`,"data-action":e.id,disabled:!e.enabled,title:e.enabled?void 0:e.reason,onClick:()=>n(e.id),children:[z[e.id],e.label]})}function V({stat:e}){return(0,O.jsx)(`span`,{"data-slot":`changes-stat`,children:(0,O.jsx)(C,{stat:{adds:H(e.adds),dels:H(e.dels),files:e.files}})})}function H(e){let[t,n]=(0,D.useState)(e),r=(0,D.useRef)(e);return(0,D.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{k as i,R as n,L as r,V as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{O as r,Pn as i,Tt as a,Vn as o,_r as s,a as c,c as l,d as u,i as d,in as f,lt as p,n as m,o as h,r as g,ut as _,wt as v}from"./queries-D7W-eGim.js";import{g as y}from"./host-context-KsSKxKbI.js";import{Ci as b,G as x,J as S,Qi as C,R as w,Y as T,a as E,aa as D,q as ee}from"./project-scope-context-Bz7AAyJ4.js";import{g as te,p as ne}from"./chunk-KS7C4IRE-BdLLx37K.js";import{c as O,i as re,t as ie}from"./reference-chip-D8ckcrda.js";import{o as k}from"./dist-CCX8mhHc.js";import{I as A,L as j,Q as ae,Z as M,ct as oe,i as se,l as N,m as ce,r as le,u as P,ut as ue}from"./design-icons-QbNMZniQ.js";import{t as de}from"./chevron-down-CHGyCDBH.js";import{t as fe}from"./chevron-right-BENZ-1ZN.js";import{t as F}from"./loader-circle-CPBhhDbB.js";import{t as pe}from"./play-CmVAj_fu.js";import{t as I}from"./button-BV_AiLj2.js";import{a as me,i as he,n as ge,r as L,t as _e}from"./select-C72KGfnK.js";import{i as R,r as z,t as B}from"./popover-BQolmvDR.js";import{r as ve,t as V}from"./project-router-CARDbdMX.js";import{t as ye}from"./status-dot-B5MkhHDP.js";import{c as H,d as U,f as be,m as xe}from"./page-shell-BdjH5hyc.js";import{a as Se,o as Ce,r as we,s as Te,t as Ee}from"./command-4D8sPZJy.js";import{t as W}from"./centered-state-N8vWM_Hw.js";import{t as De}from"./use-search-params-writer-DD5PEEZw.js";import{At as G,Ct as Oe,Dn as K,Dt as ke,Et as Ae,Fn as je,Ft as Me,It as Ne,Kn as Pe,Lt as Fe,Mt as Ie,Nt as Le,Ot as Re,Pt as ze,St as Be,Tt as Ve,ir as He,jt as Ue,kt as We,o as Ge,pt as Ke,sr as qe,wt as Je,xt as Ye,zn as Xe}from"./index-D9hyWO4C.js";import{t as Ze}from"./markdown-BRE9fTUI.js";import{a as Qe,c as $e,f as et,h as tt,i as nt,l as rt,m as it,n as at,o as ot,p as q,r as st,s as ct,t as lt,u as ut}from"./use-hand-to-agent-state-B_j_e1kD.js";import{t as dt}from"./tab-link-zXPa9LIz.js";var J=e(t(),1),Y=n();function ft({number:e,repo:t}){let n=y();return(0,Y.jsx)(pt,{number:e,repo:t,scope:n},JSON.stringify([n,t,e]))}function pt({number:e,repo:t,scope:n}){let r=(0,J.useId)(),s=(0,J.useId)(),[c,l]=(0,J.useState)(!1),u=c?de:fe,d=v(n,!0,n==="default"),f=a(`#${e}`,!0),p=(0,J.useMemo)(()=>Le(o(d.data??[],f.data?.pages.flatMap(e=>e.runs)??[]),e,t,n),[d.data,f.data,e,t,n]);return(0,Y.jsxs)(`section`,{"aria-labelledby":r,className:k(`mt-4 min-w-0 rounded-lg border border-border`,c?`p-3`:`p-0.5`),children:[(0,Y.jsx)(`h3`,{id:r,className:`text-xs font-semibold text-muted-foreground`,children:(0,Y.jsxs)(`button`,{type:`button`,"aria-expanded":c,"aria-controls":s,onClick:()=>l(e=>!e),className:`flex min-h-11 w-full items-center gap-2 rounded-md px-2.5 text-left hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,children:[(0,Y.jsx)(u,{"aria-hidden":`true`,className:`size-4 shrink-0`}),(0,Y.jsxs)(`span`,{children:[`Linked tasks`,d.data?` (${p.length}${f.hasNextPage||f.isError?`+`:``})`:``]})]})}),(0,Y.jsx)(`div`,{id:s,children:c?(0,Y.jsxs)(Y.Fragment,{children:[d.isPending?(0,Y.jsx)(`p`,{role:`status`,className:`mt-2 text-xs text-muted-foreground`,children:`Loading linked tasks…`}):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 linked tasks. Check your connection and try again.`}),(0,Y.jsx)(I,{variant:`outline`,className:`mt-2`,onClick:()=>void d.refetch(),disabled:d.isFetching,children:`Retry linked tasks`})]}):null,d.data&&p.length===0&&!d.isError?(0,Y.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`No linked tasks yet.`}):null,p.length>0?(0,Y.jsx)(`ul`,{className:`mt-2 flex flex-col gap-1`,children:p.map(e=>{let t=je(e,b(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:i(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)(ye,{tone:t.tone,shape:t.shape,pulse:t.pulse,role:`img`,"aria-label":t.label,title:t.label}),e.archived?(0,Y.jsx)(He,{"data-slot":`linked-task-archived`,dot:K.tone,shape:K.shape,className:`px-2 py-px`,children:K.label}):null,(0,Y.jsx)(`time`,{dateTime:e.createdAt,children:new Date(e.createdAt).toLocaleDateString()})]})]})},e.id)})}):null,f.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`,onClick:()=>void f.refetch(),disabled:f.isFetching,children:`Retry older linked tasks`})]}):f.hasNextPage?(0,Y.jsx)(I,{variant:`outline`,className:`mt-2`,onClick:()=>void f.fetchNextPage(),disabled:f.isFetchingNextPage,children:f.isFetchingNextPage?`Loading older linked tasks…`:`Show older linked tasks`}):null]}):null})]})}var mt=`w-44 max-w-full`,X=`min-h-11 min-w-11 rounded-md border border-input bg-card px-3 text-sm font-medium text-foreground transition-colors hover:bg-muted focus-visible:outline-ring disabled:opacity-60`,Z=`__all__`;function ht(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 gt(e,t){return!!e&&t.length===1&&t[0]?.toLowerCase()===e.toLowerCase()}function _t(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 vt(e){return[e.viewerLogin?``:`GitHub login unavailable.`,_t(e)].filter(Boolean).join(` `)}function yt({options:e,assignees:t,onAssigneesChange:n}){return(0,Y.jsxs)(B,{children:[(0,Y.jsx)(R,{asChild:!0,children:(0,Y.jsxs)(`button`,{type:`button`,className:`${X} inline-flex items-center gap-1.5`,disabled:e.length===0,children:[`Assignee`,t.length?` · ${t.length}`:``,(0,Y.jsx)(P,{size:12,"aria-hidden":`true`,className:`size-3 shrink-0 text-muted-foreground`})]})}),(0,Y.jsx)(z,{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 bt({data:e,projectId:t,onProjectChange:n,pickerRef:r}){if(e.projects?.length)return(0,Y.jsxs)(_e,{value:t||Z,onValueChange:e=>n(e===Z?``:e),children:[(0,Y.jsx)(he,{ref:r,"aria-label":`Project board`,"data-slot":`gh-board-filter`,"data-value":t,className:`${X} ${mt} justify-between`,children:(0,Y.jsx)(me,{placeholder:`All boards`})}),(0,Y.jsxs)(ge,{align:`start`,children:[(0,Y.jsx)(L,{value:Z,children:`All boards`}),e.projects.map(e=>(0,Y.jsx)(L,{value:e.id,"data-board":e.id,children:e.title},e.id))]})]});if(e.projects||e.projectsState){let t=e.projects?`No boards`:e.projectsState===`refreshing`?`Loading boards…`:`Boards unavailable`;return(0,Y.jsxs)(_e,{disabled:!0,value:Z,children:[(0,Y.jsx)(he,{ref:r,"aria-label":`Project board`,"data-slot":`gh-board-filter`,"data-value":``,className:`${X} ${mt} justify-between`,children:(0,Y.jsx)(me,{placeholder:t,children:t})}),(0,Y.jsx)(ge,{align:`start`,children:(0,Y.jsx)(L,{value:Z,children:t})})]})}return null}function xt({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)(B,{open:i,onOpenChange:a,children:[(0,Y.jsx)(R,{asChild:!0,children:(0,Y.jsx)(`button`,{ref:o,type:`button`,className:`${X} 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)(M,{size:14,"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}):(0,Y.jsx)(oe,{size:14,"aria-hidden":`true`,className:`size-3.5`})})}),(0,Y.jsx)(z,{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 St({data:e,assignees:t,projectId:n,onAssigneesChange:r,onProjectChange:i}){let[a,o]=(0,J.useState)(!1),s=(0,J.useRef)(null),c=(0,J.useRef)(null),l=(0,J.useRef)(null),u=(0,J.useRef)(null),d=ht(e.issues,t),f=gt(e.viewerLogin,t),p=vt(e),m=p!==``,h=(0,J.useRef)(p);m&&(h.current=p);let g=(0,J.useRef)(!m);g.current=!m;let _=()=>(l.current&&!l.current.disabled?l.current:u.current)?.focus();return(0,J.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,J.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)(yt,{options:d,assignees:t,onAssigneesChange:r}),(0,Y.jsxs)(`button`,{ref:u,type:`button`,"data-slot":`gh-assigned-me`,className:`${X} inline-flex items-center gap-1.5 rounded-full aria-pressed:border-accent-strong aria-pressed:bg-accent-strong aria-pressed:text-accent-strong-foreground aria-pressed:hover:bg-accent-strong`,disabled:!e.viewerLogin,"aria-pressed":f,onClick:()=>r(f?[]:[e.viewerLogin]),children:[(0,Y.jsx)(ue,{size:14,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),`Assigned to me`]}),(0,Y.jsx)(bt,{data:e,projectId:n,onProjectChange:i,pickerRef:l}),(0,Y.jsx)(xt,{data:e,message:p,lastMessage:h,hasMessage:m,statusOpen:a,setStatusOpen:o,triggerRef:s,contentRef:c})]})}function Ct({onRefresh:e,refreshing:t}){let n=Ye(y());return(0,Y.jsx)(U,{route:`github`,density:`full`,headerSpacing:`compact`,header:{title:`GitHub`,secondaryActions:(0,Y.jsx)(H,{type:`button`,variant:`ghost`,"data-slot":`gh-screen-refresh`,"aria-label":`Refresh from GitHub`,title:`Refresh from GitHub`,disabled:t,onClick:e,children:(0,Y.jsx)(M,{size:17,"aria-hidden":`true`,className:k(`size-[17px]`,t&&`motion-safe:animate-spin`)})})},children:(0,Y.jsx)(`div`,{"data-slot":`github-filter-screen`,children:(0,Y.jsx)(Be,{model:n,variant:`screen`})})})}function wt({view:e,activeFilter:t,isDesktop:n,listInUrl:r,n:i,gh:a,actions:o}){return{headerSlot:`gh-masthead`,title:n?e===`issues`?`Issues`:`Pull requests`:`GitHub`,scope:n?Oe[t]:void 0,scopeSlot:`gh-title-qualifier`,subtitle:a.repo?(0,Y.jsxs)(`span`,{className:`block min-w-0 truncate`,children:[(0,Y.jsx)(`span`,{"data-slot":`gh-repo`,children:a.repo}),(0,Y.jsxs)(`span`,{"data-slot":`gh-synced`,title:a.syncedAt?new Date(a.syncedAt).toLocaleString():void 0,children:[` `,`· `,a.syncedAt?(0,Y.jsx)(Xe,{iso:a.syncedAt,prefix:`Synced `}):`Not synced yet`]})]}):void 0,secondaryActions:(0,Y.jsx)(Tt,{...o}),headerExtra:r&&i===void 0?(0,Y.jsxs)(`div`,{"data-slot":`gh-filter-context`,className:`mt-1 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)(le,{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-muted-foreground`,children:[...Ae,...ke].find(e=>e.id===t)?.label})]}):void 0}}function Tt({automationsAvailable:e,refreshing:t,onRefresh:n}){return(0,Y.jsxs)(`div`,{"data-slot":`gh-page-actions`,className:`flex shrink-0 flex-wrap items-center gap-2`,children:[e?(0,Y.jsx)(H,{variant:`outline`,asChild:!0,children:(0,Y.jsx)(V,{to:`/automations/new`,children:`Set up automations`})}):null,(0,Y.jsxs)(H,{type:`button`,variant:`outline`,"data-slot":`gh-refresh`,title:`Refresh from GitHub`,disabled:t,onClick:n,children:[(0,Y.jsx)(M,{size:16,"aria-hidden":`true`,className:k(`size-3.5`,t&&`motion-safe:animate-spin`)}),`Refresh`]})]})}function Et({view:e,number:t}){return(0,Y.jsx)(W,{icon:e===`issues`?(0,Y.jsx)(ce,{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`}. Go back to the list and search for ${t} to look it up on GitHub, closed and merged included.`})}var Dt=/^(\[[^\]\n]{1,24}\]:?)\s+(\S.*)$/s;function Ot(e){let t=Dt.exec(e);return t?{prefix:t[1],rest:t[2]}:{prefix:null,rest:e}}function kt(e,t){if(!t)return e.kind===`issue`?`open`:e.isDraft?`draft`:void 0}function At(e){let t=e.reduce((e,t)=>Math.max(e,String(t.number).length),1);return Math.ceil(28+(t+1)*7.2)}var jt=2;function Mt({item:e,view:t,filter:n,narrows:r,colors:i,expanded:a,onToggle:o,queuedRunId:s,checks:c,comments:l,status:u,task:d,referenceWidth:m}){let h=C(),g=`gh-row-summary-${e.kind}-${e.number}`,v=e.kind===`pr`?`PR`:`Issue`,y=O(v,e.number),b=(v===`PR`&&y.conflicting===!0?p:_(u??y.status))?.label,x=Ot(e.title),w=()=>{h.prefetchQuery({queryKey:f.githubComments(e.kind,e.number),queryFn:({signal:t})=>S(e.kind,e.number,{},{signal:t}),staleTime:6e4})};return(0,Y.jsxs)(`div`,{"data-slot":`gh-row-shell`,"data-expanded":a||void 0,style:{"--gh-ref-width":`${m}px`},className:k(`@container rounded-md`,a&&`bg-sidebar-row-selected`),children:[(0,Y.jsxs)(`button`,{type:`button`,draggable:!0,onDragStart:t=>{try{t.dataTransfer.setData(`text/plain`,st(e)),t.dataTransfer.effectAllowed=`copy`}catch{}},onMouseEnter:w,onFocus:w,onClick:o,"data-slot":`gh-row`,"data-number":e.number,"data-kind":e.kind,"aria-expanded":a,"aria-controls":a?g:void 0,title:`Drag into the composer to prefill a task`,className:`grid w-full grid-cols-[var(--gh-ref-width)_minmax(0,1fr)_auto] items-start gap-x-3 gap-y-1.5 rounded-md px-3 py-2 text-left transition-colors hover:bg-muted focus-visible:outline-2 focus-visible:-outline-offset-2 @4xl:grid-cols-[var(--gh-ref-width)_minmax(0,1fr)_auto_auto]`,children:[(0,Y.jsxs)(`span`,{"data-slot":`gh-row-ref`,title:b,className:`flex h-[18px] items-center`,children:[(0,Y.jsx)(ie,{reference:{kind:v,number:e.number},taskTitle:e.title,status:u,compact:!0,inert:!0}),b?(0,Y.jsx)(`span`,{className:`sr-only`,children:b}):null]}),(0,Y.jsxs)(`span`,{"data-slot":`gh-row-title`,className:k(`line-clamp-2 min-w-0 text-[13px] leading-[18px] font-medium text-foreground [overflow-wrap:anywhere] @4xl:line-clamp-none`,a&&`font-semibold`),children:[x.prefix?(0,Y.jsxs)(`span`,{"data-slot":`gh-row-title-prefix`,className:`font-normal text-soft-foreground`,children:[x.prefix,` `]}):null,x.rest]}),(0,Y.jsx)(P,{"data-slot":`gh-row-cue`,"aria-hidden":`true`,className:k(`col-start-3 row-start-1 mt-px size-4 shrink-0 text-muted-foreground transition-transform motion-reduce:transition-none @4xl:col-start-4`,a&&`rotate-180`)}),e.labels.length>0?(0,Y.jsx)(`span`,{"data-slot":`gh-row-labels`,className:`col-start-2 col-end-4 flex min-w-0 flex-wrap gap-1 @4xl:col-end-3`,children:e.labels.map(e=>(0,Y.jsx)(ut,{label:e,color:i[e],className:`max-w-full truncate`},e))}):null,(0,Y.jsx)(Nt,{item:e,view:t,task:d,queuedRunId:s,checks:c,comments:l})]}),a?(0,Y.jsx)(Ft,{id:g,item:e,checks:c,detailPath:We(t,n,e.number,``,r),queuedRunId:s}):null]})}function Nt({item:e,view:t,task:n,queuedRunId:r,checks:i,comments:a}){let o=e.assignees??[];return(0,Y.jsxs)(`span`,{"data-slot":`gh-row-meta`,className:`col-start-2 col-end-4 flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground @4xl:col-start-3 @4xl:col-end-4 @4xl:row-start-1 @4xl:h-[18px] @4xl:flex-nowrap`,children:[(0,Y.jsx)(`span`,{"data-slot":`gh-row-task`,className:Q.task,children:n?(0,Y.jsx)(He,{dot:n.status.tone,shape:n.status.shape,pulse:n.status.pulse,title:`Newest task: ${n.status.label}`,className:`max-w-full py-0.5`,children:(0,Y.jsx)(`span`,{className:`truncate`,children:n.status.label})}):r?(0,Y.jsx)(`span`,{"data-slot":`gh-queued-flag`,className:`shrink-0 font-sans font-medium text-accent-text`,children:`↗ run queued`}):null}),(0,Y.jsx)(`span`,{"data-slot":`gh-row-assignees`,className:Q.assignees,children:o.length>0?(0,Y.jsx)(Pt,{logins:o}):null}),t===`prs`?(0,Y.jsx)(`span`,{"data-slot":`gh-row-checks-slot`,className:Q.checks,children:i?(0,Y.jsx)(ot,{checks:i}):null}):null,(0,Y.jsx)(`span`,{"data-slot":`gh-row-comments`,className:Q.comments,children:a?(0,Y.jsx)(ct,{count:a}):null}),(0,Y.jsx)(Xe,{iso:e.createdAt,className:`shrink-0 @4xl:w-9 @4xl:text-right`})]})}var Q={task:`flex min-w-0 max-w-full empty:hidden @4xl:w-44 @4xl:empty:block`,assignees:`flex shrink-0 items-center empty:hidden @4xl:w-12 @4xl:justify-center @4xl:empty:block`,checks:`flex shrink-0 empty:hidden @4xl:w-4 @4xl:justify-center @4xl:empty:block`,comments:`flex shrink-0 empty:hidden @4xl:w-10 @4xl:empty:block`};function Pt({logins:e}){let t=e.join(`, `);return(0,Y.jsxs)(`span`,{title:`Assigned to ${t}`,className:`flex items-center -space-x-1`,children:[e.slice(0,jt).map(e=>(0,Y.jsx)(nt,{login:e},e)),e.length>jt?(0,Y.jsxs)(`span`,{"aria-hidden":`true`,className:`pl-2 tabular-nums`,children:[`+`,e.length-jt]}):null,(0,Y.jsxs)(`span`,{className:`sr-only`,children:[`Assigned to `,t]})]})}function Ft({id:e,item:t,checks:n,detailPath:r,queuedRunId:i}){let a=d(t.kind,t.number),o=(a.data?.detail?.body??t.body)?.trim(),s=t.kind===`pr`?`PR`:`issue`;return(0,Y.jsxs)(`div`,{id:e,"data-slot":`gh-row-summary`,className:`flex flex-col gap-3 px-3 pb-4 @4xl:pl-[calc(var(--gh-ref-width)+1.5rem)]`,children:[(0,Y.jsx)(`div`,{"data-slot":`gh-row-body`,className:`text-[13px] leading-relaxed text-soft-foreground`,children:o?(0,Y.jsx)(`div`,{"data-slot":`gh-row-excerpt`,inert:!0,className:It,children:(0,Y.jsx)(Ze,{document:!0,children:o})}):a.isPending?(0,Y.jsx)(qe,{className:`h-4 w-2/3`}):a.isError||a.data?.available===!1?(0,Y.jsx)(`p`,{"data-slot":`gh-row-body-unavailable`,className:`text-muted-foreground`,children:`Description unavailable. Use Refresh to try again.`}):(0,Y.jsx)(`p`,{className:`text-muted-foreground`,children:`(no description)`})}),(0,Y.jsxs)(`div`,{"data-slot":`gh-row-facts`,className:`flex flex-wrap items-center gap-x-2 gap-y-1.5 text-xs text-muted-foreground`,children:[(0,Y.jsxs)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:[`Opened by `,(0,Y.jsx)(`span`,{"data-slot":`gh-row-author`,className:`font-medium`,children:t.author})]}),n?(0,Y.jsx)(Qe,{checks:n,url:t.url}):null]}),(0,Y.jsxs)(`div`,{"data-slot":`gh-row-actions`,className:`flex flex-wrap items-center gap-2`,children:[i?(0,Y.jsx)(I,{asChild:!0,variant:`outline`,size:`sm`,children:(0,Y.jsxs)(V,{to:`/tasks/${i}`,"data-action":`gh-row-view-task`,children:[(0,Y.jsx)(N,{size:16,"aria-hidden":`true`,className:`size-3.5 text-success`}),`Open queued task`]})}):(0,Y.jsx)(I,{asChild:!0,variant:`primary`,size:`sm`,children:(0,Y.jsxs)(V,{to:r,state:{focusHandoff:!0},"data-action":`gh-row-handoff`,title:`Open this ${s} and write the prompt for an agent`,children:[(0,Y.jsx)(pe,{"aria-hidden":`true`,className:`size-3.5`}),`Hand to agent`]})}),(0,Y.jsx)(I,{asChild:!0,variant:`outline`,size:`sm`,children:(0,Y.jsxs)(V,{to:r,"data-action":`gh-row-open`,children:[`Open `,s,(0,Y.jsx)(se,{size:16,"aria-hidden":`true`,className:`size-3.5`})]})})]})]})}var It=k(`max-h-[calc(3lh)] overflow-hidden [overflow-wrap:anywhere]`,`[&_*]:!my-0 [&_p+*]:!mt-1 [&_ul]:list-inside [&_ol]:list-inside`,`[&_:is(h1,h2,h3,h4,h5,h6,pre,img,table,hr,[data-streamdown="code-block"],[data-streamdown="table-wrapper"],[data-streamdown="image-wrapper"],[data-streamdown="mermaid-block"])]:hidden`);function Lt(e){let t=getComputedStyle(e).overflowY;return t===`auto`||t===`scroll`?e:e.closest(`[data-slot="main"]`)??e}function Rt(e){let[t,n]=(0,J.useState)(null);return(0,J.useLayoutEffect)(()=>{if(!e){n(null);return}let t=()=>n(Lt(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 zt(e,t){let[n,r]=(0,J.useState)(0);return(0,J.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 Bt(e,t,n){let[r,i]=(0,J.useState)(null),a=(0,J.useRef)(n);return(0,J.useEffect)(()=>{a.current=n}),(0,J.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 Vt(e,t,n,r,i){let[a,o]=(0,J.useState)(null),[s,c]=(0,J.useState)(null),l=Rt(a),u=(0,J.useRef)(null);u.current=l;let d=zt(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:Bt(p&&!i&&!t.isFetchingNextPage&&!t.isFetchNextPageError,l,()=>void t.fetchNextPage())}}function Ht({item:e,queuedRunId:t}){return t?(0,Y.jsx)(I,{asChild:!0,variant:`outline`,size:`sm`,children:(0,Y.jsxs)(V,{to:`/tasks/${t}`,"data-action":`gh-header-view-task`,children:[(0,Y.jsx)(N,{size:16,"aria-hidden":`true`,className:`size-3.5 text-success`}),`Open queued task`]})}):(0,Y.jsxs)(I,{type:`button`,variant:`primary`,size:`sm`,"data-action":`gh-header-handoff`,title:`Write the prompt and pick the workflow and runner for this ${e.kind===`pr`?`PR`:`issue`}`,onClick:$,children:[(0,Y.jsx)(pe,{"aria-hidden":`true`,className:`size-3.5`}),`Hand to agent`]})}function $(){let e=document.querySelector(`[data-slot="gh-detail-inner"] [data-slot="gh-custom-prompt"]`);e?.scrollIntoView({block:`center`}),e?.focus({preventScroll:!0})}var Ut=100;function Wt(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>=Ut)break;a.add(t.number)}return[...a]}function Gt(e,t,n,r,i,a){let o=Wt(n,e,r,i,a),s=m(o,e===`prs`),c=s.data?.available?s.data.checks:void 0,l=g(e===`issues`?`issue`:`pr`,(0,J.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,J.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 Kt(e){let t=y(),n=v(t,!0,t==="default").data,r=(0,J.useMemo)(()=>n?ze(n,e,t):null,[n,e,t]);return(0,J.useCallback)(e=>{let t=e.kind===`issue`?r?.get(e.number):void 0;return t?{runId:t.id,status:je(t)}:null},[r])}function qt(e){let[t,n]=De(),r=t.get(`filter`),i=Me(e,r),a=i??`all`,o=e=>n(t=>{let n=new URLSearchParams(t);return e===null?n.delete(`filter`):n.set(`filter`,e),n}),s=G(t);return{rawFilterParam:r,filter:i,activeFilter:a,setFilterParam:o,narrows:s,url:(0,J.useMemo)(()=>{let t=new URLSearchParams(s);return{query:t.get(`q`)??``,labels:t.getAll(`label`),assignees:e===`issues`?t.getAll(`assignee`):[],board:e===`issues`?t.get(`board`)??``:``}},[s,e]),writeNarrows:(0,J.useCallback)(e=>n(t=>{let n=e(t);return(t.has(`filter`)||G(t)!==``)&&!n.has(`filter`)&&G(n)===``&&n.set(`filter`,`all`),n}),[n])}}function Jt(e,t){return n=>{let r=new URLSearchParams(n);r.delete(e);for(let n of t)r.append(e,n);return r}}function Yt(e,t,{rawFilterParam:n,filter:r,activeFilter:i,setFilterParam:a,narrows:o,url:s,writeNarrows:c}){let l=Zt(s.query,n!==null||o!==``,c),{query:u,setQuery:d}=l,f=s.labels,p=s.assignees,m=e=>c(Jt(`label`,e)),{setProjectFilter:h,activeProject:g}=Qt(t,s.board,c),_=e===`issues`&&i===`assigned`,v=_?t?.viewerLogin?[t.viewerLogin]:[]:p;return{query:u,setQuery:d,labelFilter:f,setLabelFilter:m,setProjectFilter:h,activeProject:g,isAssignedFilter:_,effectiveAssignees:v,changeAssignees:e=>{c(Jt(`assignee`,e)),_&&a(`all`)},clearFilters:()=>{l.clear(),c(e=>{let t=new URLSearchParams(e);for(let e of Ve)t.delete(e);return r!==null&&r!==`all`&&t.set(`filter`,`all`),t})},filtering:u.trim()!==``||f.length>0||e===`issues`&&(v.length>0||g!==``)||r!==null&&r!==`all`,narrowing:u.trim()!==``||f.length>0||e===`issues`&&(!_&&p.length>0||g!==``)}}var Xt=250;function Zt(e,t,n){let r=`${ne().pathname}${t?``:`#entry`}`,[i,a]=(0,J.useState)(e),o=(0,J.useRef)(e),s=(0,J.useRef)(void 0),c=(0,J.useRef)(r);return(0,J.useEffect)(()=>{e===o.current&&r===c.current||(clearTimeout(s.current),c.current=r,o.current=e,a(e))},[e,r]),(0,J.useEffect)(()=>()=>clearTimeout(s.current),[]),{query:i,setQuery:e=>{a(e),clearTimeout(s.current),s.current=setTimeout(()=>{let t=e.trim();o.current=t,n(e=>{let n=new URLSearchParams(e);return t===``?n.delete(`q`):n.set(`q`,t),n})},Xt)},clear:()=>{clearTimeout(s.current),o.current=``,a(``)}}}function Qt(e,t,n){let r=e=>n(t=>{let n=new URLSearchParams(t);return e===``?n.delete(`board`):n.set(`board`,e),n}),i=e?.projectsState===`refreshing`||e?.projectsState===`unavailable`,a=i||e?.projects?.some(e=>e.id===t)===!0,o=e?.available===!0&&!i&&t!==``&&!a,[s,c]=(0,J.useState)(``);s!==``&&s!==t&&c(``),o&&s!==t&&c(t);let l=o||s!==``&&s===t,u=a&&!l?t:``;return(0,J.useEffect)(()=>{l&&n(e=>{let t=new URLSearchParams(e);return t.delete(`board`),t})},[l,n]),{setProjectFilter:r,activeProject:u}}function $t(e,t,{filter:n,activeFilter:r},i){let a=y(),o=e===`issues`&&(r===`no-task`||r===`has-task`),s=v(a,o,a==="default"),c=(0,J.useMemo)(()=>s.data?Ie(s.data,t?.repo,a):null,[s.data,t?.repo,a]),u=Ue(e,n)?Fe(n):null,d=l(`pr`,u??``,u!==null&&t?.available===!0),f=u!==null&&d.data?.available?d.data.items:null,p=(0,J.useMemo)(()=>t?.available?e===`issues`?t.issues:t.prs:[],[t,e]),m=(0,J.useMemo)(()=>f?Ne(f,p):null,[f,p]),h=en({view:e,gh:t,activeFilter:r,isAssignedFilter:i,taskFilter:o,taskNumbers:c,runsQuery:s,backedQuery:u,filterHits:f,filterSearch:d});return{backedQuery:u,filterSearch:d,fullList:p,filterRows:m,filterGate:h,openItems:(0,J.useMemo)(()=>h?[]:m??p,[h,m,p]),narrow:(0,J.useMemo)(()=>e===`issues`?r===`no-task`&&c?{excludeNumbers:c}:r===`has-task`&&c?{includeNumbers:c}:{}:r===`mine`&&t?.viewerLogin?{author:t.viewerLogin}:f?{includeNumbers:new Set(f.map(e=>e.number))}:{},[e,r,c,t?.viewerLogin,f])}}function en({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 tn(e,t){return t?T(t.kind,t.number,{refresh:!0}).then(n=>(e.setQueryData(t.key,n),!0)).catch(()=>!1):Promise.resolve(!0)}function nn(e,t,n,{filterGate:r,filterRows:i,fullList:a}){let o=f.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,p]=(0,J.useState)(null);return(0,J.useEffect)(()=>{u&&p({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 rn(e,t,n,{fullList:r,filterRows:i},a){let o=C(),s=(0,J.useRef)(null),l=e===`issues`?`issue`:`pr`,u=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=c(l,n??0,u),p=u&&d.data?.available&&d.data.item?.kind===l?d.data.item:null;s.current=u&&n!==null?{kind:l,number:n,key:f.githubItem(l,n)}:null;let[m,h]=(0,J.useState)(!1);return{exactWanted:u,exactItem:d,exactDetail:p,exactTargetRef:s,retryingExact:m,retryExact:()=>{h(!0),tn(o,s.current).then(e=>{h(!1),e||E(`Could not reach GitHub for #${n}`,{tone:`danger`})})}}}function an(e,t,n){let r=C(),i=(0,J.useRef)(null);return{refresh:s({mutationFn:e=>(tn(r,e),x({refresh:!0,limit:50})),onSuccess:async a=>{await r.cancelQueries({queryKey:f.githubPages(50),exact:!0}),r.setQueryData(f.githubPages(50),{pages:[a],pageParams:[{}]}),r.invalidateQueries({queryKey:f.githubChecks(t)});let o=e===`issues`?`issue`:`pr`,s=(e===`issues`?a.issues:a.prs).map(e=>e.number),c=f.githubCommentCounts(o,s);r.removeQueries({queryKey:f.githubCommentCounts(o,[]).slice(0,4),predicate:e=>e.queryHash!==D(c)}),a.available&&a.commentsDeferred&&s.length>0&&ee(o,s,{refresh:!0}).then(e=>r.setQueryData(c,e)).catch(()=>{}),r.invalidateQueries({queryKey:f.githubSearch(e===`issues`?`issue`:`pr`,n)}),r.invalidateQueries({queryKey:f.githubSearch(`pr`,Re)}),r.invalidateQueries({queryKey:f.githubSearch(`pr`,Je)});let l=i.current,u=f.githubComments(`issue`,0).slice(0,3);if(!l){r.removeQueries({queryKey:u});return}let d=f.githubComments(l.kind,l.number);S(l.kind,l.number,{refresh:!0}).then(e=>r.setQueryData(d,e)).catch(()=>{}),r.removeQueries({queryKey:u,predicate:e=>e.queryHash!==D(d)})},onError:e=>E(e.message,{tone:`danger`})}),openThreadRef:i}}var on=350;function sn(e,t){let[n,r]=(0,J.useState)(e);return(0,J.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function cn(e,t,{query:n,labelFilter:r,effectiveAssignees:i,activeProject:a},{openItems:o,narrow:s,filterGate:c}){let u=sn(n,on),d=(0,J.useMemo)(()=>q(o,{query:u,labels:r,...s,...e===`issues`?{assignees:i,projectId:a}:{}}),[o,u,r,e,i,a,s]),f=n.trim()===u.trim(),p=t?.available===!0&&!c&&f&&tt(u,d),m=l(e===`issues`?`issue`:`pr`,u,p),h=q(o,{query:n,labels:r,...s,...e===`issues`?{assignees:i,projectId:a}:{}}),g=p&&m.data?.available?m.data:null,_=new Set(h.map(e=>e.number)),v=ln(e,g,a,i);return{debouncedQuery:u,searchWanted:p,forgeSearch:m,items:h,searchPayload:g,metadataFailure:v,searchHits:g&&!v?q(g.items,{labels:r,...s,...e===`issues`?{assignees:i,projectId:a}:{}}).filter(e=>!_.has(e.number)):[],...un(n,f,p,m)}}function ln(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 un(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 dn({view:e,changes:t=!1,index:n=!1}){let{n:i}=te(),a=qt(e),{rawFilterParam:o,activeFilter:s,narrows:c}=a,l=o!==null||c!==``,u=xe(),{pages:d,data:f}=h(50),p=Pe(),m=pn(),g=lt(),_=fn({index:n,isDesktop:u,listInUrl:l,n:i,rememberedView:r().data?.githubView}),[v,y]=(0,J.useState)(null),b=Yt(e,f,a),x=$t(e,f,a,b.isAssignedFilter),S=cn(e,f,b,x),C=nn(e,i,S.forgeSearch,x),w=rn(e,f,C.selectedNumber,x,C.remoteDetail),T=Gt(e,d,f,C.selectedNumber,S.searchHits,x.openItems),{refresh:E,openThreadRef:D}=an(e,T.checkPrNumbers,S.debouncedQuery),ee=Vt(e,d,f,x.backedQuery,b.narrowing),ne=Kt(f?.available?f.repo:void 0);if(_.restorePrs)return(0,Y.jsx)(ve,{to:`/github/prs`,replace:!0});if(!f)return d.isError?(0,Y.jsx)(U,{route:`github`,density:`empty`,children:(0,Y.jsx)(W,{icon:(0,Y.jsx)(oe,{size:16}),tone:`danger`,title:`Could not load GitHub`,subtitle:d.error.message})}):(0,Y.jsx)(Ke,{});D.current=null;let O=()=>E.mutate(w.exactTargetRef.current);if(_.filterScreen&&f.available)return(0,Y.jsx)(Ct,{onRefresh:O,refreshing:E.isPending});if(!f.available)return(0,Y.jsx)(vn,{reason:f.reason,refreshing:E.isPending,onRetry:O});let{labelColors:re,labelOptions:ie}=mn(f,S.searchPayload,x.openItems,x.fullList),k=hn({number:C.selectedNumber,fullList:x.fullList,filterRows:x.filterRows,remoteDetail:C.remoteDetail,exactDetail:w.exactDetail}),A=i===void 0?[...S.items,...S.searchHits].find(e=>e.url===v)??null:null,j=k??A;D.current=j?{kind:j.kind,number:j.number}:null;let{linkFilter:ae,listPath:M}=gn(e,o,s,u,c),se={view:e,filter:ae,narrows:c,colors:re,expandedUrl:A?.url??null,onToggle:e=>y(t=>t===e.url?null:e.url),queued:g.queued,checksMap:T.checksMap,commentsOf:T.commentsOf,taskOf:ne,referenceWidth:At([...S.items,...S.searchHits])},N=_n(e,b,x.filterGate,S),ce=wt({view:e,activeFilter:s,isDesktop:u,listInUrl:l,n:i,gh:f,actions:{automationsAvailable:p,refreshing:E.isPending,onRefresh:O}});return i===void 0?(0,Y.jsxs)(U,{route:`github`,density:be(S.items.length+S.searchHits.length),headerSpacing:`compact`,className:`pb-[calc(90px+env(safe-area-inset-bottom))] md:pb-4`,bodyClassName:`gap-2.5`,header:ce,children:[(0,Y.jsxs)(`header`,{"data-slot":`gh-header`,className:`flex shrink-0 flex-col gap-3 bg-background md:gap-4`,children:[(0,Y.jsx)(yn,{view:e,isDesktop:u,gh:f,onSaveView:m}),(0,Y.jsx)(bn,{view:e,gh:f,filters:b,labelOptions:ie,labelColors:re,searchPayload:S.searchPayload})]}),(0,Y.jsx)(Cn,{view:e,rows:se,verdict:N,search:S,sidebar:x,list:d,paging:ee})]}):(0,Y.jsx)(U,{route:`github`,density:`full`,headerSpacing:`compact`,className:`pb-[calc(90px+env(safe-area-inset-bottom))] md:pb-4`,header:ce,children:(0,Y.jsx)(On,{view:e,selected:k,selectedNumber:C.selectedNumber,exact:w,repo:f.repo,rows:se,listPath:M,changes:t,handToAgent:g})})}function fn({index:e,isDesktop:t,listInUrl:n,n:r,rememberedView:i}){return{filterScreen:e&&!t&&!n&&r===void 0,restorePrs:e&&t&&!n&&i===`prs`}}function pn(){let e=C();return t=>{e.setQueryData(f.uiState,e=>({...e,githubView:t})),w({githubView:t}).then(t=>e.setQueryData(f.uiState,t)).catch(t=>{E(t instanceof Error?t.message:String(t),{tone:`danger`}),e.invalidateQueries({queryKey:f.uiState})})}}function mn(e,t,n,r){return{labelColors:{...t?.labelColors,...e.labelColors},labelOptions:et([...n,...r,...t?.items??[]])}}function hn({number:e,fullList:t,filterRows:n,remoteDetail:r,exactDetail:i}){return e===null?null:t.find(t=>t.number===e)??n?.find(t=>t.number===e)??r??i??null}function gn(e,t,n,r,i){let a=t===null?null:n;return{linkFilter:a,listPath:We(e,a??(e===`issues`&&!r?`all`:null),void 0,``,i)}}function _n(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)(F,{"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)(F,{"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 vn({reason:e,refreshing:t,onRetry:n}){return(0,Y.jsx)(U,{route:`github`,density:`empty`,children:(0,Y.jsx)(W,{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:n,children:`Try again`}),children:(0,Y.jsxs)(`p`,{className:`text-xs leading-relaxed text-muted-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 Squawk works without it.`]})})})}function yn({view:e,isDesktop:t,gh:n,onSaveView:r}){return(0,Y.jsxs)(`div`,{"data-slot":`gh-tabs`,className:`flex min-h-11 flex-wrap items-center gap-3`,children:[(0,Y.jsxs)(dt,{to:t?`/github`:`/github?filter=all`,active:e===`issues`,onClick:()=>r(`issues`),children:[`Issues · `,n.issuesTotal??n.issues.length]}),(0,Y.jsxs)(dt,{to:`/github/prs`,active:e===`prs`,onClick:()=>r(`prs`),children:[`Pull requests · `,n.prsTotal??n.prs.length]})]})}function bn({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`,children:[(0,Y.jsxs)(`div`,{className:`relative min-w-0 basis-full md:flex-1 md:basis-auto`,children:[(0,Y.jsx)(ae,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-muted-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-lg border border-card-edge bg-card shadow-card py-1 pr-2.5 pl-8 text-[13px] text-foreground outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`})]}),(0,Y.jsx)(jn,{options:r,colors:i,selected:n.labelFilter,onChange:n.setLabelFilter}),e===`issues`?(0,Y.jsx)(St,{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,"data-slot":`gh-clear-filters`,className:`min-h-11 min-w-11 rounded-md border border-input bg-card px-3 text-sm font-medium text-foreground transition-colors hover:bg-muted disabled:cursor-not-allowed disabled:border-border disabled:bg-transparent disabled:text-muted-foreground`,onClick:n.clearFilters,children:`Clear filters`})]})}function xn(e,t){return e.kind===`pr`?t?.[e.number]??e.checks:e.checks}function Sn(e,t,n=!1){return(0,Y.jsx)(Mt,{item:e,view:t.view,filter:t.filter,narrows:t.narrows,colors:t.colors,expanded:t.expandedUrl===e.url,onToggle:()=>t.onToggle(e),queuedRunId:t.queued.get(e.url)??null,checks:xn(e,t.checksMap),comments:t.commentsOf(e),status:kt(e,n),task:t.taskOf(e),referenceWidth:t.referenceWidth})}function Cn({view:e,rows:t,verdict:n,search:r,sidebar:i,list:a,paging:o}){let{items:s,searchHits:c}=r;return(0,Y.jsxs)(`section`,{ref:o.setListEl,"data-slot":`gh-list`,className:`relative flex w-full min-w-0 flex-col rounded-lg border border-card-edge bg-card shadow-card p-3`,children:[s.length===0?n&&(0,Y.jsx)(`div`,{"data-slot":`gh-empty`,className:`px-4 py-4 text-sm text-muted-foreground`,children:n}):(0,Y.jsx)(wn,{items:s,rows:t,paging:o}),o.pagingAvailable?(0,Y.jsx)(Tn,{view:e,list:a,paging:o}):null,(0,Y.jsx)(En,{backedQuery:i.backedQuery,filterSearch:i.filterSearch}),s.length>0&&r.searchWanted&&n?(0,Y.jsx)(`div`,{"data-slot":`gh-search-status`,role:`status`,className:`px-4 py-4 text-sm text-muted-foreground`,children:n}):null,c.length>0?(0,Y.jsx)(Dn,{hits:c,searchPayload:r.searchPayload,rows:t}):null]})}function wn({items:e,rows:t,paging:n}){let{setRowsEl:r,scrollOwner:i,listEl:a,scrollOwnerRef:o,startMargin:s}=n,c=(0,J.useRef)(null),l=(0,J.useRef)(!1);(0,J.useEffect)(()=>{if(l.current||!i)return;l.current=!0;let n=e.findIndex(e=>e.url===t.expandedUrl);n>=0&&c.current?.scrollToIndex(n,{align:`start`})},[i,e,t.expandedUrl]);let u=e.map((e,n)=>(0,Y.jsx)(`div`,{role:`listitem`,"data-slot":`gh-row-item`,"data-divided":n>0||void 0,children:Sn(e,t)},e.url));return(0,Y.jsx)(`div`,{ref:r,"data-slot":`gh-rows`,"data-virtualized":i?`true`:void 0,role:`list`,children:i?(0,Y.jsx)(Ge,{ref:c,scrollRef:o,startMargin:s,children:u},i===a?`list`:`main`):u})}function Tn({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-muted-foreground`,children:t.isFetchingNextPage?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(F,{"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 En({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-muted-foreground`,children:[`Showing the first `,t.data.items.length,` matches from GitHub search; more may exist.`]}):null}function Dn({hits:e,searchPayload:t,rows:n}){let r=(0,J.useRef)(null),i=(0,J.useRef)(!1);(0,J.useEffect)(()=>{i.current||(i.current=!0,(r.current?.querySelector(`[data-slot="gh-row"][aria-expanded="true"]`))?.scrollIntoView({block:`start`}))},[]);let a=u();return(0,Y.jsx)(re,{projectId:a,requests:a?e.map(e=>({projectId:a,kind:e.kind===`pr`?`PR`:`Issue`,number:e.number})):[],children:(0,Y.jsxs)(`div`,{"data-slot":`gh-search-hits`,children:[(0,Y.jsxs)(`p`,{className:`px-4 pt-2 pb-1 text-xs font-medium tracking-wide text-muted-foreground uppercase`,children:[`Found on GitHub`,t?.truncated?` (first matches)`:``]}),(0,Y.jsx)(`ul`,{ref:r,className:`flex flex-col gap-0.5 px-2 pb-2`,children:e.map(e=>(0,Y.jsx)(`li`,{children:Sn(e,n,!0)},e.url))})]})})}function On({view:e,selected:t,selectedNumber:n,exact:r,repo:i,rows:a,listPath:o,changes:s,handToAgent:c}){let{exactWanted:l,exactItem:u}=r;return(0,Y.jsxs)(`section`,{"data-slot":`gh-detail`,className:`flex w-full min-w-0 flex-col rounded-lg border border-card-edge bg-card shadow-card`,children:[t?null:(0,Y.jsx)(`div`,{className:`px-4 pt-4 md:px-7 md:pt-5`,children:(0,Y.jsx)($e,{backLink:{to:o}})}),t?(0,Y.jsx)(kn,{item:t,repo:i,rows:a,listPath:o,changes:s,handToAgent:c}):l&&u.isPending?(0,Y.jsx)(`div`,{"data-slot":`gh-detail-loading`,className:`flex flex-1 flex-col`,children:(0,Y.jsx)(W,{icon:(0,Y.jsx)(F,{className:`motion-safe:animate-spin`}),tone:`neutral`,heading:`h2`,title:`Loading #${n}…`,subtitle:`It is not among the open items, so the tab is asking GitHub for it.`})}):l&&(u.isError||u.data?.available===!1)?(0,Y.jsx)(An,{number:n,exact:r}):(0,Y.jsx)(Et,{view:e,number:n})]})}function kn({item:e,repo:t,rows:n,listPath:r,changes:i,handToAgent:a}){let{workflows:o,skillList:s,workflow:c,setWorkflow:l,selectedSkills:u,setSelectedSkills:d,engine:f,setEngine:p,queued:m,onQueued:h}=a,g=ne().state?.focusHandoff===!0;return(0,J.useEffect)(()=>{g&&$()},[g,e.url]),(0,Y.jsx)(rt,{item:e,comments:n.commentsOf(e),afterHeading:e.kind===`issue`?(0,Y.jsx)(ft,{number:e.number,repo:t},e.url):void 0,backLink:{to:r},subNav:{filter:n.filter,narrows:n.narrows,changes:i},onRunAgent:$,headerAction:(0,Y.jsx)(Ht,{item:e,queuedRunId:m.get(e.url)??null}),colors:n.colors,checks:xn(e,n.checksMap),children:(0,Y.jsx)(at,{item:e,workflows:o.data?.workflows??[],skills:s,workflow:c,onWorkflowChange:l,selectedSkills:u,onSkillsChange:d,engine:f,onEngineChange:p,queuedRunId:m.get(e.url)??null,onQueued:h},e.url)})}function An({number:e,exact:t}){let{exactItem:n,retryingExact:r,retryExact:i}=t;return(0,Y.jsx)(W,{icon:(0,Y.jsx)(oe,{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:i,children:`Retry`})})}function jn({options:e,colors:t,selected:n,onChange:r}){let[i,a]=(0,J.useState)(!1),o=e=>r(n.includes(e)?n.filter(t=>t!==e):[...n,e]);return(0,Y.jsxs)(B,{open:i,onOpenChange:a,children:[(0,Y.jsx)(R,{asChild:!0,children:(0,Y.jsxs)(`button`,{type:`button`,"data-slot":`gh-label-filter`,disabled:e.length===0,className:k(`inline-flex min-h-11 min-w-11 shrink-0 items-center gap-1.5 rounded-md border border-input bg-card px-3 text-sm font-medium text-foreground transition-colors hover:bg-muted disabled:opacity-60`,n.length>0&&`border-accent-strong/60 text-foreground`),children:[n.length>0?`Labels · ${n.length}`:`Labels`,(0,Y.jsx)(P,{size:12,"aria-hidden":`true`,className:`size-3 shrink-0 text-muted-foreground`})]})}),(0,Y.jsx)(z,{align:`end`,sideOffset:6,className:`w-60 p-0`,children:(0,Y.jsxs)(Ee,{children:[(0,Y.jsx)(Se,{placeholder:`Filter labels…`}),(0,Y.jsxs)(Te,{className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[(0,Y.jsx)(we,{children:`No labels.`}),n.length>0?(0,Y.jsxs)(Ce,{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)(Ce,{value:e,onSelect:()=>o(e),className:`min-h-11`,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,"data-slot":`gh-label-dot`,className:`size-2.5 shrink-0 rounded-full ring-1 ring-foreground/30`,style:it(t[e])}),(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e}),r?(0,Y.jsx)(N,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-link-foreground`}):null]},e)})]})]})})]})}export{dn as GithubRoute};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{O as r,Pn as i,Tt as a,Vn as o,_r as s,a as c,c as l,d as u,i as d,in as f,lt as p,n as m,o as h,r as g,ut as _,wt as v}from"./queries-DD_9iITj.js";import{h as y}from"./host-context-iTMFRMT5.js";import{G as b,J as x,R as S,Si as C,Y as w,Zi as T,a as E,ia as D,q as ee}from"./project-scope-context-DNrHbqd2.js";import{g as te,p as ne}from"./chunk-KS7C4IRE-BdLLx37K.js";import{c as O,i as re,t as ie}from"./reference-chip-e-fG4-yW.js";import{o as k}from"./dist-CCX8mhHc.js";import{I as A,L as j,Q as ae,Z as M,ct as oe,i as se,l as N,m as ce,r as le,u as P,ut as ue}from"./design-icons-QbNMZniQ.js";import{t as de}from"./chevron-down-CHGyCDBH.js";import{t as fe}from"./chevron-right-BENZ-1ZN.js";import{t as F}from"./loader-circle-CPBhhDbB.js";import{t as pe}from"./play-CmVAj_fu.js";import{t as I}from"./button-BV_AiLj2.js";import{a as me,i as he,n as ge,r as L,t as _e}from"./select-Cd8wvwvm.js";import{i as R,r as z,t as B}from"./popover-BQolmvDR.js";import{r as ve,t as V}from"./project-router-CfEuKuz1.js";import{t as ye}from"./status-dot-Da1M54kK.js";import{c as H,d as U,f as be,m as xe}from"./page-shell-BdjH5hyc.js";import{a as Se,o as Ce,r as we,s as Te,t as Ee}from"./command-4D8sPZJy.js";import{t as W}from"./centered-state-N8vWM_Hw.js";import{t as De}from"./use-search-params-writer-DD5PEEZw.js";import{At as G,Ct as Oe,Dn as K,Dt as ke,Et as Ae,Fn as je,Ft as Me,It as Ne,Kn as Pe,Lt as Fe,Mt as Ie,Nt as Le,Ot as Re,Pt as ze,St as Be,Tt as Ve,ir as He,jt as Ue,kt as We,o as Ge,pt as Ke,sr as qe,wt as Je,xt as Ye,zn as Xe}from"./index-C3kap2_j.js";import{t as Ze}from"./markdown-Bmdr6MIa.js";import{a as Qe,c as $e,f as et,h as tt,i as nt,l as rt,m as it,n as at,o as ot,p as q,r as st,s as ct,t as lt,u as ut}from"./use-hand-to-agent-state-Bjh1EnB3.js";import{t as dt}from"./tab-link-DL1UtKVR.js";var J=e(t(),1),Y=n();function ft({number:e,repo:t}){let n=y();return(0,Y.jsx)(pt,{number:e,repo:t,scope:n},JSON.stringify([n,t,e]))}function pt({number:e,repo:t,scope:n}){let r=(0,J.useId)(),s=(0,J.useId)(),[c,l]=(0,J.useState)(!1),u=c?de:fe,d=v(n,!0,n==="default"),f=a(`#${e}`,!0),p=(0,J.useMemo)(()=>Le(o(d.data??[],f.data?.pages.flatMap(e=>e.runs)??[]),e,t,n),[d.data,f.data,e,t,n]);return(0,Y.jsxs)(`section`,{"aria-labelledby":r,className:k(`mt-4 min-w-0 rounded-lg border border-border`,c?`p-3`:`p-0.5`),children:[(0,Y.jsx)(`h3`,{id:r,className:`text-xs font-semibold text-muted-foreground`,children:(0,Y.jsxs)(`button`,{type:`button`,"aria-expanded":c,"aria-controls":s,onClick:()=>l(e=>!e),className:`flex min-h-11 w-full items-center gap-2 rounded-md px-2.5 text-left hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,children:[(0,Y.jsx)(u,{"aria-hidden":`true`,className:`size-4 shrink-0`}),(0,Y.jsxs)(`span`,{children:[`Linked tasks`,d.data?` (${p.length}${f.hasNextPage||f.isError?`+`:``})`:``]})]})}),(0,Y.jsx)(`div`,{id:s,children:c?(0,Y.jsxs)(Y.Fragment,{children:[d.isPending?(0,Y.jsx)(`p`,{role:`status`,className:`mt-2 text-xs text-muted-foreground`,children:`Loading linked tasks…`}):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 linked tasks. Check your connection and try again.`}),(0,Y.jsx)(I,{variant:`outline`,className:`mt-2`,onClick:()=>void d.refetch(),disabled:d.isFetching,children:`Retry linked tasks`})]}):null,d.data&&p.length===0&&!d.isError?(0,Y.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`No linked tasks yet.`}):null,p.length>0?(0,Y.jsx)(`ul`,{className:`mt-2 flex flex-col gap-1`,children:p.map(e=>{let t=je(e,C(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:i(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)(ye,{tone:t.tone,shape:t.shape,pulse:t.pulse,role:`img`,"aria-label":t.label,title:t.label}),e.archived?(0,Y.jsx)(He,{"data-slot":`linked-task-archived`,dot:K.tone,shape:K.shape,className:`px-2 py-px`,children:K.label}):null,(0,Y.jsx)(`time`,{dateTime:e.createdAt,children:new Date(e.createdAt).toLocaleDateString()})]})]})},e.id)})}):null,f.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`,onClick:()=>void f.refetch(),disabled:f.isFetching,children:`Retry older linked tasks`})]}):f.hasNextPage?(0,Y.jsx)(I,{variant:`outline`,className:`mt-2`,onClick:()=>void f.fetchNextPage(),disabled:f.isFetchingNextPage,children:f.isFetchingNextPage?`Loading older linked tasks…`:`Show older linked tasks`}):null]}):null})]})}var mt=`w-44 max-w-full`,X=`min-h-11 min-w-11 rounded-md border border-input bg-card px-3 text-sm font-medium text-foreground transition-colors hover:bg-muted focus-visible:outline-ring disabled:opacity-60`,Z=`__all__`;function ht(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 gt(e,t){return!!e&&t.length===1&&t[0]?.toLowerCase()===e.toLowerCase()}function _t(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 vt(e){return[e.viewerLogin?``:`GitHub login unavailable.`,_t(e)].filter(Boolean).join(` `)}function yt({options:e,assignees:t,onAssigneesChange:n}){return(0,Y.jsxs)(B,{children:[(0,Y.jsx)(R,{asChild:!0,children:(0,Y.jsxs)(`button`,{type:`button`,className:`${X} inline-flex items-center gap-1.5`,disabled:e.length===0,children:[`Assignee`,t.length?` · ${t.length}`:``,(0,Y.jsx)(P,{size:12,"aria-hidden":`true`,className:`size-3 shrink-0 text-muted-foreground`})]})}),(0,Y.jsx)(z,{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 bt({data:e,projectId:t,onProjectChange:n,pickerRef:r}){if(e.projects?.length)return(0,Y.jsxs)(_e,{value:t||Z,onValueChange:e=>n(e===Z?``:e),children:[(0,Y.jsx)(he,{ref:r,"aria-label":`Project board`,"data-slot":`gh-board-filter`,"data-value":t,className:`${X} ${mt} justify-between`,children:(0,Y.jsx)(me,{placeholder:`All boards`})}),(0,Y.jsxs)(ge,{align:`start`,children:[(0,Y.jsx)(L,{value:Z,children:`All boards`}),e.projects.map(e=>(0,Y.jsx)(L,{value:e.id,"data-board":e.id,children:e.title},e.id))]})]});if(e.projects||e.projectsState){let t=e.projects?`No boards`:e.projectsState===`refreshing`?`Loading boards…`:`Boards unavailable`;return(0,Y.jsxs)(_e,{disabled:!0,value:Z,children:[(0,Y.jsx)(he,{ref:r,"aria-label":`Project board`,"data-slot":`gh-board-filter`,"data-value":``,className:`${X} ${mt} justify-between`,children:(0,Y.jsx)(me,{placeholder:t,children:t})}),(0,Y.jsx)(ge,{align:`start`,children:(0,Y.jsx)(L,{value:Z,children:t})})]})}return null}function xt({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)(B,{open:i,onOpenChange:a,children:[(0,Y.jsx)(R,{asChild:!0,children:(0,Y.jsx)(`button`,{ref:o,type:`button`,className:`${X} 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)(M,{size:14,"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}):(0,Y.jsx)(oe,{size:14,"aria-hidden":`true`,className:`size-3.5`})})}),(0,Y.jsx)(z,{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 St({data:e,assignees:t,projectId:n,onAssigneesChange:r,onProjectChange:i}){let[a,o]=(0,J.useState)(!1),s=(0,J.useRef)(null),c=(0,J.useRef)(null),l=(0,J.useRef)(null),u=(0,J.useRef)(null),d=ht(e.issues,t),f=gt(e.viewerLogin,t),p=vt(e),m=p!==``,h=(0,J.useRef)(p);m&&(h.current=p);let g=(0,J.useRef)(!m);g.current=!m;let _=()=>(l.current&&!l.current.disabled?l.current:u.current)?.focus();return(0,J.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,J.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)(yt,{options:d,assignees:t,onAssigneesChange:r}),(0,Y.jsxs)(`button`,{ref:u,type:`button`,"data-slot":`gh-assigned-me`,className:`${X} inline-flex items-center gap-1.5 rounded-full aria-pressed:border-accent-strong aria-pressed:bg-accent-strong aria-pressed:text-accent-strong-foreground aria-pressed:hover:bg-accent-strong`,disabled:!e.viewerLogin,"aria-pressed":f,onClick:()=>r(f?[]:[e.viewerLogin]),children:[(0,Y.jsx)(ue,{size:14,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),`Assigned to me`]}),(0,Y.jsx)(bt,{data:e,projectId:n,onProjectChange:i,pickerRef:l}),(0,Y.jsx)(xt,{data:e,message:p,lastMessage:h,hasMessage:m,statusOpen:a,setStatusOpen:o,triggerRef:s,contentRef:c})]})}function Ct({onRefresh:e,refreshing:t}){let n=Ye(y());return(0,Y.jsx)(U,{route:`github`,density:`full`,headerSpacing:`compact`,header:{title:`GitHub`,secondaryActions:(0,Y.jsx)(H,{type:`button`,variant:`ghost`,"data-slot":`gh-screen-refresh`,"aria-label":`Refresh from GitHub`,title:`Refresh from GitHub`,disabled:t,onClick:e,children:(0,Y.jsx)(M,{size:17,"aria-hidden":`true`,className:k(`size-[17px]`,t&&`motion-safe:animate-spin`)})})},children:(0,Y.jsx)(`div`,{"data-slot":`github-filter-screen`,children:(0,Y.jsx)(Be,{model:n,variant:`screen`})})})}function wt({view:e,activeFilter:t,isDesktop:n,listInUrl:r,n:i,gh:a,actions:o}){return{headerSlot:`gh-masthead`,title:n?e===`issues`?`Issues`:`Pull requests`:`GitHub`,scope:n?Oe[t]:void 0,scopeSlot:`gh-title-qualifier`,subtitle:a.repo?(0,Y.jsxs)(`span`,{className:`block min-w-0 truncate`,children:[(0,Y.jsx)(`span`,{"data-slot":`gh-repo`,children:a.repo}),(0,Y.jsxs)(`span`,{"data-slot":`gh-synced`,title:a.syncedAt?new Date(a.syncedAt).toLocaleString():void 0,children:[` `,`· `,a.syncedAt?(0,Y.jsx)(Xe,{iso:a.syncedAt,prefix:`Synced `}):`Not synced yet`]})]}):void 0,secondaryActions:(0,Y.jsx)(Tt,{...o}),headerExtra:r&&i===void 0?(0,Y.jsxs)(`div`,{"data-slot":`gh-filter-context`,className:`mt-1 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)(le,{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-muted-foreground`,children:[...Ae,...ke].find(e=>e.id===t)?.label})]}):void 0}}function Tt({automationsAvailable:e,refreshing:t,onRefresh:n}){return(0,Y.jsxs)(`div`,{"data-slot":`gh-page-actions`,className:`flex shrink-0 flex-wrap items-center gap-2`,children:[e?(0,Y.jsx)(H,{variant:`outline`,asChild:!0,children:(0,Y.jsx)(V,{to:`/automations/new`,children:`Set up automations`})}):null,(0,Y.jsxs)(H,{type:`button`,variant:`outline`,"data-slot":`gh-refresh`,title:`Refresh from GitHub`,disabled:t,onClick:n,children:[(0,Y.jsx)(M,{size:16,"aria-hidden":`true`,className:k(`size-3.5`,t&&`motion-safe:animate-spin`)}),`Refresh`]})]})}function Et({view:e,number:t}){return(0,Y.jsx)(W,{icon:e===`issues`?(0,Y.jsx)(ce,{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`}. Go back to the list and search for ${t} to look it up on GitHub, closed and merged included.`})}var Dt=/^(\[[^\]\n]{1,24}\]:?)\s+(\S.*)$/s;function Ot(e){let t=Dt.exec(e);return t?{prefix:t[1],rest:t[2]}:{prefix:null,rest:e}}function kt(e,t){if(!t)return e.kind===`issue`?`open`:e.isDraft?`draft`:void 0}function At(e){let t=e.reduce((e,t)=>Math.max(e,String(t.number).length),1);return Math.ceil(28+(t+1)*7.2)}var jt=2;function Mt({item:e,view:t,filter:n,narrows:r,colors:i,expanded:a,onToggle:o,queuedRunId:s,checks:c,comments:l,status:u,task:d,referenceWidth:m}){let h=T(),g=`gh-row-summary-${e.kind}-${e.number}`,v=e.kind===`pr`?`PR`:`Issue`,y=O(v,e.number),b=(v===`PR`&&y.conflicting===!0?p:_(u??y.status))?.label,S=Ot(e.title),C=()=>{h.prefetchQuery({queryKey:f.githubComments(e.kind,e.number),queryFn:({signal:t})=>x(e.kind,e.number,{},{signal:t}),staleTime:6e4})};return(0,Y.jsxs)(`div`,{"data-slot":`gh-row-shell`,"data-expanded":a||void 0,style:{"--gh-ref-width":`${m}px`},className:k(`@container rounded-md`,a&&`bg-sidebar-row-selected`),children:[(0,Y.jsxs)(`button`,{type:`button`,draggable:!0,onDragStart:t=>{try{t.dataTransfer.setData(`text/plain`,st(e)),t.dataTransfer.effectAllowed=`copy`}catch{}},onMouseEnter:C,onFocus:C,onClick:o,"data-slot":`gh-row`,"data-number":e.number,"data-kind":e.kind,"aria-expanded":a,"aria-controls":a?g:void 0,title:`Drag into the composer to prefill a task`,className:`grid w-full grid-cols-[var(--gh-ref-width)_minmax(0,1fr)_auto] items-start gap-x-3 gap-y-1.5 rounded-md px-3 py-2 text-left transition-colors hover:bg-muted focus-visible:outline-2 focus-visible:-outline-offset-2 @4xl:grid-cols-[var(--gh-ref-width)_minmax(0,1fr)_auto_auto]`,children:[(0,Y.jsxs)(`span`,{"data-slot":`gh-row-ref`,title:b,className:`flex h-[18px] items-center`,children:[(0,Y.jsx)(ie,{reference:{kind:v,number:e.number},taskTitle:e.title,status:u,compact:!0,inert:!0}),b?(0,Y.jsx)(`span`,{className:`sr-only`,children:b}):null]}),(0,Y.jsxs)(`span`,{"data-slot":`gh-row-title`,className:k(`line-clamp-2 min-w-0 text-[13px] leading-[18px] font-medium text-foreground [overflow-wrap:anywhere] @4xl:line-clamp-none`,a&&`font-semibold`),children:[S.prefix?(0,Y.jsxs)(`span`,{"data-slot":`gh-row-title-prefix`,className:`font-normal text-soft-foreground`,children:[S.prefix,` `]}):null,S.rest]}),(0,Y.jsx)(P,{"data-slot":`gh-row-cue`,"aria-hidden":`true`,className:k(`col-start-3 row-start-1 mt-px size-4 shrink-0 text-muted-foreground transition-transform motion-reduce:transition-none @4xl:col-start-4`,a&&`rotate-180`)}),e.labels.length>0?(0,Y.jsx)(`span`,{"data-slot":`gh-row-labels`,className:`col-start-2 col-end-4 flex min-w-0 flex-wrap gap-1 @4xl:col-end-3`,children:e.labels.map(e=>(0,Y.jsx)(ut,{label:e,color:i[e],className:`max-w-full truncate`},e))}):null,(0,Y.jsx)(Nt,{item:e,view:t,task:d,queuedRunId:s,checks:c,comments:l})]}),a?(0,Y.jsx)(Ft,{id:g,item:e,checks:c,detailPath:We(t,n,e.number,``,r),queuedRunId:s}):null]})}function Nt({item:e,view:t,task:n,queuedRunId:r,checks:i,comments:a}){let o=e.assignees??[];return(0,Y.jsxs)(`span`,{"data-slot":`gh-row-meta`,className:`col-start-2 col-end-4 flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground @4xl:col-start-3 @4xl:col-end-4 @4xl:row-start-1 @4xl:h-[18px] @4xl:flex-nowrap`,children:[(0,Y.jsx)(`span`,{"data-slot":`gh-row-task`,className:Q.task,children:n?(0,Y.jsx)(He,{dot:n.status.tone,shape:n.status.shape,pulse:n.status.pulse,title:`Newest task: ${n.status.label}`,className:`max-w-full py-0.5`,children:(0,Y.jsx)(`span`,{className:`truncate`,children:n.status.label})}):r?(0,Y.jsx)(`span`,{"data-slot":`gh-queued-flag`,className:`shrink-0 font-sans font-medium text-accent-text`,children:`↗ run queued`}):null}),(0,Y.jsx)(`span`,{"data-slot":`gh-row-assignees`,className:Q.assignees,children:o.length>0?(0,Y.jsx)(Pt,{logins:o}):null}),t===`prs`?(0,Y.jsx)(`span`,{"data-slot":`gh-row-checks-slot`,className:Q.checks,children:i?(0,Y.jsx)(ot,{checks:i}):null}):null,(0,Y.jsx)(`span`,{"data-slot":`gh-row-comments`,className:Q.comments,children:a?(0,Y.jsx)(ct,{count:a}):null}),(0,Y.jsx)(Xe,{iso:e.createdAt,className:`shrink-0 @4xl:w-9 @4xl:text-right`})]})}var Q={task:`flex min-w-0 max-w-full empty:hidden @4xl:w-44 @4xl:empty:block`,assignees:`flex shrink-0 items-center empty:hidden @4xl:w-12 @4xl:justify-center @4xl:empty:block`,checks:`flex shrink-0 empty:hidden @4xl:w-4 @4xl:justify-center @4xl:empty:block`,comments:`flex shrink-0 empty:hidden @4xl:w-10 @4xl:empty:block`};function Pt({logins:e}){let t=e.join(`, `);return(0,Y.jsxs)(`span`,{title:`Assigned to ${t}`,className:`flex items-center -space-x-1`,children:[e.slice(0,jt).map(e=>(0,Y.jsx)(nt,{login:e},e)),e.length>jt?(0,Y.jsxs)(`span`,{"aria-hidden":`true`,className:`pl-2 tabular-nums`,children:[`+`,e.length-jt]}):null,(0,Y.jsxs)(`span`,{className:`sr-only`,children:[`Assigned to `,t]})]})}function Ft({id:e,item:t,checks:n,detailPath:r,queuedRunId:i}){let a=d(t.kind,t.number),o=(a.data?.detail?.body??t.body)?.trim(),s=t.kind===`pr`?`PR`:`issue`;return(0,Y.jsxs)(`div`,{id:e,"data-slot":`gh-row-summary`,className:`flex flex-col gap-3 px-3 pb-4 @4xl:pl-[calc(var(--gh-ref-width)+1.5rem)]`,children:[(0,Y.jsx)(`div`,{"data-slot":`gh-row-body`,className:`text-[13px] leading-relaxed text-soft-foreground`,children:o?(0,Y.jsx)(`div`,{"data-slot":`gh-row-excerpt`,inert:!0,className:It,children:(0,Y.jsx)(Ze,{document:!0,children:o})}):a.isPending?(0,Y.jsx)(qe,{className:`h-4 w-2/3`}):a.isError||a.data?.available===!1?(0,Y.jsx)(`p`,{"data-slot":`gh-row-body-unavailable`,className:`text-muted-foreground`,children:`Description unavailable. Use Refresh to try again.`}):(0,Y.jsx)(`p`,{className:`text-muted-foreground`,children:`(no description)`})}),(0,Y.jsxs)(`div`,{"data-slot":`gh-row-facts`,className:`flex flex-wrap items-center gap-x-2 gap-y-1.5 text-xs text-muted-foreground`,children:[(0,Y.jsxs)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:[`Opened by `,(0,Y.jsx)(`span`,{"data-slot":`gh-row-author`,className:`font-medium`,children:t.author})]}),n?(0,Y.jsx)(Qe,{checks:n,url:t.url}):null]}),(0,Y.jsxs)(`div`,{"data-slot":`gh-row-actions`,className:`flex flex-wrap items-center gap-2`,children:[i?(0,Y.jsx)(I,{asChild:!0,variant:`outline`,size:`sm`,children:(0,Y.jsxs)(V,{to:`/tasks/${i}`,"data-action":`gh-row-view-task`,children:[(0,Y.jsx)(N,{size:16,"aria-hidden":`true`,className:`size-3.5 text-success`}),`Open queued task`]})}):(0,Y.jsx)(I,{asChild:!0,variant:`primary`,size:`sm`,children:(0,Y.jsxs)(V,{to:r,state:{focusHandoff:!0},"data-action":`gh-row-handoff`,title:`Open this ${s} and write the prompt for an agent`,children:[(0,Y.jsx)(pe,{"aria-hidden":`true`,className:`size-3.5`}),`Hand to agent`]})}),(0,Y.jsx)(I,{asChild:!0,variant:`outline`,size:`sm`,children:(0,Y.jsxs)(V,{to:r,"data-action":`gh-row-open`,children:[`Open `,s,(0,Y.jsx)(se,{size:16,"aria-hidden":`true`,className:`size-3.5`})]})})]})]})}var It=k(`max-h-[calc(3lh)] overflow-hidden [overflow-wrap:anywhere]`,`[&_*]:!my-0 [&_p+*]:!mt-1 [&_ul]:list-inside [&_ol]:list-inside`,`[&_:is(h1,h2,h3,h4,h5,h6,pre,img,table,hr,[data-streamdown="code-block"],[data-streamdown="table-wrapper"],[data-streamdown="image-wrapper"],[data-streamdown="mermaid-block"])]:hidden`);function Lt(e){let t=getComputedStyle(e).overflowY;return t===`auto`||t===`scroll`?e:e.closest(`[data-slot="main"]`)??e}function Rt(e){let[t,n]=(0,J.useState)(null);return(0,J.useLayoutEffect)(()=>{if(!e){n(null);return}let t=()=>n(Lt(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 zt(e,t){let[n,r]=(0,J.useState)(0);return(0,J.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 Bt(e,t,n){let[r,i]=(0,J.useState)(null),a=(0,J.useRef)(n);return(0,J.useEffect)(()=>{a.current=n}),(0,J.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 Vt(e,t,n,r,i){let[a,o]=(0,J.useState)(null),[s,c]=(0,J.useState)(null),l=Rt(a),u=(0,J.useRef)(null);u.current=l;let d=zt(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:Bt(p&&!i&&!t.isFetchingNextPage&&!t.isFetchNextPageError,l,()=>void t.fetchNextPage())}}function Ht({item:e,queuedRunId:t}){return t?(0,Y.jsx)(I,{asChild:!0,variant:`outline`,size:`sm`,children:(0,Y.jsxs)(V,{to:`/tasks/${t}`,"data-action":`gh-header-view-task`,children:[(0,Y.jsx)(N,{size:16,"aria-hidden":`true`,className:`size-3.5 text-success`}),`Open queued task`]})}):(0,Y.jsxs)(I,{type:`button`,variant:`primary`,size:`sm`,"data-action":`gh-header-handoff`,title:`Write the prompt and pick the workflow and runner for this ${e.kind===`pr`?`PR`:`issue`}`,onClick:$,children:[(0,Y.jsx)(pe,{"aria-hidden":`true`,className:`size-3.5`}),`Hand to agent`]})}function $(){let e=document.querySelector(`[data-slot="gh-detail-inner"] [data-slot="gh-custom-prompt"]`);e?.scrollIntoView({block:`center`}),e?.focus({preventScroll:!0})}var Ut=100;function Wt(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>=Ut)break;a.add(t.number)}return[...a]}function Gt(e,t,n,r,i,a){let o=Wt(n,e,r,i,a),s=m(o,e===`prs`),c=s.data?.available?s.data.checks:void 0,l=g(e===`issues`?`issue`:`pr`,(0,J.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,J.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 Kt(e){let t=y(),n=v(t,!0,t==="default").data,r=(0,J.useMemo)(()=>n?ze(n,e,t):null,[n,e,t]);return(0,J.useCallback)(e=>{let t=e.kind===`issue`?r?.get(e.number):void 0;return t?{runId:t.id,status:je(t)}:null},[r])}function qt(e){let[t,n]=De(),r=t.get(`filter`),i=Me(e,r),a=i??`all`,o=e=>n(t=>{let n=new URLSearchParams(t);return e===null?n.delete(`filter`):n.set(`filter`,e),n}),s=G(t);return{rawFilterParam:r,filter:i,activeFilter:a,setFilterParam:o,narrows:s,url:(0,J.useMemo)(()=>{let t=new URLSearchParams(s);return{query:t.get(`q`)??``,labels:t.getAll(`label`),assignees:e===`issues`?t.getAll(`assignee`):[],board:e===`issues`?t.get(`board`)??``:``}},[s,e]),writeNarrows:(0,J.useCallback)(e=>n(t=>{let n=e(t);return(t.has(`filter`)||G(t)!==``)&&!n.has(`filter`)&&G(n)===``&&n.set(`filter`,`all`),n}),[n])}}function Jt(e,t){return n=>{let r=new URLSearchParams(n);r.delete(e);for(let n of t)r.append(e,n);return r}}function Yt(e,t,{rawFilterParam:n,filter:r,activeFilter:i,setFilterParam:a,narrows:o,url:s,writeNarrows:c}){let l=Zt(s.query,n!==null||o!==``,c),{query:u,setQuery:d}=l,f=s.labels,p=s.assignees,m=e=>c(Jt(`label`,e)),{setProjectFilter:h,activeProject:g}=Qt(t,s.board,c),_=e===`issues`&&i===`assigned`,v=_?t?.viewerLogin?[t.viewerLogin]:[]:p;return{query:u,setQuery:d,labelFilter:f,setLabelFilter:m,setProjectFilter:h,activeProject:g,isAssignedFilter:_,effectiveAssignees:v,changeAssignees:e=>{c(Jt(`assignee`,e)),_&&a(`all`)},clearFilters:()=>{l.clear(),c(e=>{let t=new URLSearchParams(e);for(let e of Ve)t.delete(e);return r!==null&&r!==`all`&&t.set(`filter`,`all`),t})},filtering:u.trim()!==``||f.length>0||e===`issues`&&(v.length>0||g!==``)||r!==null&&r!==`all`,narrowing:u.trim()!==``||f.length>0||e===`issues`&&(!_&&p.length>0||g!==``)}}var Xt=250;function Zt(e,t,n){let r=`${ne().pathname}${t?``:`#entry`}`,[i,a]=(0,J.useState)(e),o=(0,J.useRef)(e),s=(0,J.useRef)(void 0),c=(0,J.useRef)(r);return(0,J.useEffect)(()=>{e===o.current&&r===c.current||(clearTimeout(s.current),c.current=r,o.current=e,a(e))},[e,r]),(0,J.useEffect)(()=>()=>clearTimeout(s.current),[]),{query:i,setQuery:e=>{a(e),clearTimeout(s.current),s.current=setTimeout(()=>{let t=e.trim();o.current=t,n(e=>{let n=new URLSearchParams(e);return t===``?n.delete(`q`):n.set(`q`,t),n})},Xt)},clear:()=>{clearTimeout(s.current),o.current=``,a(``)}}}function Qt(e,t,n){let r=e=>n(t=>{let n=new URLSearchParams(t);return e===``?n.delete(`board`):n.set(`board`,e),n}),i=e?.projectsState===`refreshing`||e?.projectsState===`unavailable`,a=i||e?.projects?.some(e=>e.id===t)===!0,o=e?.available===!0&&!i&&t!==``&&!a,[s,c]=(0,J.useState)(``);s!==``&&s!==t&&c(``),o&&s!==t&&c(t);let l=o||s!==``&&s===t,u=a&&!l?t:``;return(0,J.useEffect)(()=>{l&&n(e=>{let t=new URLSearchParams(e);return t.delete(`board`),t})},[l,n]),{setProjectFilter:r,activeProject:u}}function $t(e,t,{filter:n,activeFilter:r},i){let a=y(),o=e===`issues`&&(r===`no-task`||r===`has-task`),s=v(a,o,a==="default"),c=(0,J.useMemo)(()=>s.data?Ie(s.data,t?.repo,a):null,[s.data,t?.repo,a]),u=Ue(e,n)?Fe(n):null,d=l(`pr`,u??``,u!==null&&t?.available===!0),f=u!==null&&d.data?.available?d.data.items:null,p=(0,J.useMemo)(()=>t?.available?e===`issues`?t.issues:t.prs:[],[t,e]),m=(0,J.useMemo)(()=>f?Ne(f,p):null,[f,p]),h=en({view:e,gh:t,activeFilter:r,isAssignedFilter:i,taskFilter:o,taskNumbers:c,runsQuery:s,backedQuery:u,filterHits:f,filterSearch:d});return{backedQuery:u,filterSearch:d,fullList:p,filterRows:m,filterGate:h,openItems:(0,J.useMemo)(()=>h?[]:m??p,[h,m,p]),narrow:(0,J.useMemo)(()=>e===`issues`?r===`no-task`&&c?{excludeNumbers:c}:r===`has-task`&&c?{includeNumbers:c}:{}:r===`mine`&&t?.viewerLogin?{author:t.viewerLogin}:f?{includeNumbers:new Set(f.map(e=>e.number))}:{},[e,r,c,t?.viewerLogin,f])}}function en({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 tn(e,t){return t?w(t.kind,t.number,{refresh:!0}).then(n=>(e.setQueryData(t.key,n),!0)).catch(()=>!1):Promise.resolve(!0)}function nn(e,t,n,{filterGate:r,filterRows:i,fullList:a}){let o=f.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,p]=(0,J.useState)(null);return(0,J.useEffect)(()=>{u&&p({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 rn(e,t,n,{fullList:r,filterRows:i},a){let o=T(),s=(0,J.useRef)(null),l=e===`issues`?`issue`:`pr`,u=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=c(l,n??0,u),p=u&&d.data?.available&&d.data.item?.kind===l?d.data.item:null;s.current=u&&n!==null?{kind:l,number:n,key:f.githubItem(l,n)}:null;let[m,h]=(0,J.useState)(!1);return{exactWanted:u,exactItem:d,exactDetail:p,exactTargetRef:s,retryingExact:m,retryExact:()=>{h(!0),tn(o,s.current).then(e=>{h(!1),e||E(`Could not reach GitHub for #${n}`,{tone:`danger`})})}}}function an(e,t,n){let r=T(),i=(0,J.useRef)(null);return{refresh:s({mutationFn:e=>(tn(r,e),b({refresh:!0,limit:50})),onSuccess:async a=>{await r.cancelQueries({queryKey:f.githubPages(50),exact:!0}),r.setQueryData(f.githubPages(50),{pages:[a],pageParams:[{}]}),r.invalidateQueries({queryKey:f.githubChecks(t)});let o=e===`issues`?`issue`:`pr`,s=(e===`issues`?a.issues:a.prs).map(e=>e.number),c=f.githubCommentCounts(o,s);r.removeQueries({queryKey:f.githubCommentCounts(o,[]).slice(0,4),predicate:e=>e.queryHash!==D(c)}),a.available&&a.commentsDeferred&&s.length>0&&ee(o,s,{refresh:!0}).then(e=>r.setQueryData(c,e)).catch(()=>{}),r.invalidateQueries({queryKey:f.githubSearch(e===`issues`?`issue`:`pr`,n)}),r.invalidateQueries({queryKey:f.githubSearch(`pr`,Re)}),r.invalidateQueries({queryKey:f.githubSearch(`pr`,Je)});let l=i.current,u=f.githubComments(`issue`,0).slice(0,3);if(!l){r.removeQueries({queryKey:u});return}let d=f.githubComments(l.kind,l.number);x(l.kind,l.number,{refresh:!0}).then(e=>r.setQueryData(d,e)).catch(()=>{}),r.removeQueries({queryKey:u,predicate:e=>e.queryHash!==D(d)})},onError:e=>E(e.message,{tone:`danger`})}),openThreadRef:i}}var on=350;function sn(e,t){let[n,r]=(0,J.useState)(e);return(0,J.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function cn(e,t,{query:n,labelFilter:r,effectiveAssignees:i,activeProject:a},{openItems:o,narrow:s,filterGate:c}){let u=sn(n,on),d=(0,J.useMemo)(()=>q(o,{query:u,labels:r,...s,...e===`issues`?{assignees:i,projectId:a}:{}}),[o,u,r,e,i,a,s]),f=n.trim()===u.trim(),p=t?.available===!0&&!c&&f&&tt(u,d),m=l(e===`issues`?`issue`:`pr`,u,p),h=q(o,{query:n,labels:r,...s,...e===`issues`?{assignees:i,projectId:a}:{}}),g=p&&m.data?.available?m.data:null,_=new Set(h.map(e=>e.number)),v=ln(e,g,a,i);return{debouncedQuery:u,searchWanted:p,forgeSearch:m,items:h,searchPayload:g,metadataFailure:v,searchHits:g&&!v?q(g.items,{labels:r,...s,...e===`issues`?{assignees:i,projectId:a}:{}}).filter(e=>!_.has(e.number)):[],...un(n,f,p,m)}}function ln(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 un(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 dn({view:e,changes:t=!1,index:n=!1}){let{n:i}=te(),a=qt(e),{rawFilterParam:o,activeFilter:s,narrows:c}=a,l=o!==null||c!==``,u=xe(),{pages:d,data:f}=h(50),p=Pe(),m=pn(),g=lt(),_=fn({index:n,isDesktop:u,listInUrl:l,n:i,rememberedView:r().data?.githubView}),[v,y]=(0,J.useState)(null),b=Yt(e,f,a),x=$t(e,f,a,b.isAssignedFilter),S=cn(e,f,b,x),C=nn(e,i,S.forgeSearch,x),w=rn(e,f,C.selectedNumber,x,C.remoteDetail),T=Gt(e,d,f,C.selectedNumber,S.searchHits,x.openItems),{refresh:E,openThreadRef:D}=an(e,T.checkPrNumbers,S.debouncedQuery),ee=Vt(e,d,f,x.backedQuery,b.narrowing),ne=Kt(f?.available?f.repo:void 0);if(_.restorePrs)return(0,Y.jsx)(ve,{to:`/github/prs`,replace:!0});if(!f)return d.isError?(0,Y.jsx)(U,{route:`github`,density:`empty`,children:(0,Y.jsx)(W,{icon:(0,Y.jsx)(oe,{size:16}),tone:`danger`,title:`Could not load GitHub`,subtitle:d.error.message})}):(0,Y.jsx)(Ke,{});D.current=null;let O=()=>E.mutate(w.exactTargetRef.current);if(_.filterScreen&&f.available)return(0,Y.jsx)(Ct,{onRefresh:O,refreshing:E.isPending});if(!f.available)return(0,Y.jsx)(vn,{reason:f.reason,refreshing:E.isPending,onRetry:O});let{labelColors:re,labelOptions:ie}=mn(f,S.searchPayload,x.openItems,x.fullList),k=hn({number:C.selectedNumber,fullList:x.fullList,filterRows:x.filterRows,remoteDetail:C.remoteDetail,exactDetail:w.exactDetail}),A=i===void 0?[...S.items,...S.searchHits].find(e=>e.url===v)??null:null,j=k??A;D.current=j?{kind:j.kind,number:j.number}:null;let{linkFilter:ae,listPath:M}=gn(e,o,s,u,c),se={view:e,filter:ae,narrows:c,colors:re,expandedUrl:A?.url??null,onToggle:e=>y(t=>t===e.url?null:e.url),queued:g.queued,checksMap:T.checksMap,commentsOf:T.commentsOf,taskOf:ne,referenceWidth:At([...S.items,...S.searchHits])},N=_n(e,b,x.filterGate,S),ce=wt({view:e,activeFilter:s,isDesktop:u,listInUrl:l,n:i,gh:f,actions:{automationsAvailable:p,refreshing:E.isPending,onRefresh:O}});return i===void 0?(0,Y.jsxs)(U,{route:`github`,density:be(S.items.length+S.searchHits.length),headerSpacing:`compact`,className:`pb-[calc(90px+env(safe-area-inset-bottom))] md:pb-4`,bodyClassName:`gap-2.5`,header:ce,children:[(0,Y.jsxs)(`header`,{"data-slot":`gh-header`,className:`flex shrink-0 flex-col gap-3 bg-background md:gap-4`,children:[(0,Y.jsx)(yn,{view:e,isDesktop:u,gh:f,onSaveView:m}),(0,Y.jsx)(bn,{view:e,gh:f,filters:b,labelOptions:ie,labelColors:re,searchPayload:S.searchPayload})]}),(0,Y.jsx)(Cn,{view:e,rows:se,verdict:N,search:S,sidebar:x,list:d,paging:ee})]}):(0,Y.jsx)(U,{route:`github`,density:`full`,headerSpacing:`compact`,className:`pb-[calc(90px+env(safe-area-inset-bottom))] md:pb-4`,header:ce,children:(0,Y.jsx)(On,{view:e,selected:k,selectedNumber:C.selectedNumber,exact:w,repo:f.repo,rows:se,listPath:M,changes:t,handToAgent:g})})}function fn({index:e,isDesktop:t,listInUrl:n,n:r,rememberedView:i}){return{filterScreen:e&&!t&&!n&&r===void 0,restorePrs:e&&t&&!n&&i===`prs`}}function pn(){let e=T();return t=>{e.setQueryData(f.uiState,e=>({...e,githubView:t})),S({githubView:t}).then(t=>e.setQueryData(f.uiState,t)).catch(t=>{E(t instanceof Error?t.message:String(t),{tone:`danger`}),e.invalidateQueries({queryKey:f.uiState})})}}function mn(e,t,n,r){return{labelColors:{...t?.labelColors,...e.labelColors},labelOptions:et([...n,...r,...t?.items??[]])}}function hn({number:e,fullList:t,filterRows:n,remoteDetail:r,exactDetail:i}){return e===null?null:t.find(t=>t.number===e)??n?.find(t=>t.number===e)??r??i??null}function gn(e,t,n,r,i){let a=t===null?null:n;return{linkFilter:a,listPath:We(e,a??(e===`issues`&&!r?`all`:null),void 0,``,i)}}function _n(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)(F,{"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)(F,{"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 vn({reason:e,refreshing:t,onRetry:n}){return(0,Y.jsx)(U,{route:`github`,density:`empty`,children:(0,Y.jsx)(W,{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:n,children:`Try again`}),children:(0,Y.jsxs)(`p`,{className:`text-xs leading-relaxed text-muted-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 Squawk works without it.`]})})})}function yn({view:e,isDesktop:t,gh:n,onSaveView:r}){return(0,Y.jsxs)(`div`,{"data-slot":`gh-tabs`,className:`flex min-h-11 flex-wrap items-center gap-3`,children:[(0,Y.jsxs)(dt,{to:t?`/github`:`/github?filter=all`,active:e===`issues`,onClick:()=>r(`issues`),children:[`Issues · `,n.issuesTotal??n.issues.length]}),(0,Y.jsxs)(dt,{to:`/github/prs`,active:e===`prs`,onClick:()=>r(`prs`),children:[`Pull requests · `,n.prsTotal??n.prs.length]})]})}function bn({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`,children:[(0,Y.jsxs)(`div`,{className:`relative min-w-0 basis-full md:flex-1 md:basis-auto`,children:[(0,Y.jsx)(ae,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-muted-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-lg border border-card-edge bg-card shadow-card py-1 pr-2.5 pl-8 text-[13px] text-foreground outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`})]}),(0,Y.jsx)(jn,{options:r,colors:i,selected:n.labelFilter,onChange:n.setLabelFilter}),e===`issues`?(0,Y.jsx)(St,{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,"data-slot":`gh-clear-filters`,className:`min-h-11 min-w-11 rounded-md border border-input bg-card px-3 text-sm font-medium text-foreground transition-colors hover:bg-muted disabled:cursor-not-allowed disabled:border-border disabled:bg-transparent disabled:text-muted-foreground`,onClick:n.clearFilters,children:`Clear filters`})]})}function xn(e,t){return e.kind===`pr`?t?.[e.number]??e.checks:e.checks}function Sn(e,t,n=!1){return(0,Y.jsx)(Mt,{item:e,view:t.view,filter:t.filter,narrows:t.narrows,colors:t.colors,expanded:t.expandedUrl===e.url,onToggle:()=>t.onToggle(e),queuedRunId:t.queued.get(e.url)??null,checks:xn(e,t.checksMap),comments:t.commentsOf(e),status:kt(e,n),task:t.taskOf(e),referenceWidth:t.referenceWidth})}function Cn({view:e,rows:t,verdict:n,search:r,sidebar:i,list:a,paging:o}){let{items:s,searchHits:c}=r;return(0,Y.jsxs)(`section`,{ref:o.setListEl,"data-slot":`gh-list`,className:`relative flex w-full min-w-0 flex-col rounded-lg border border-card-edge bg-card shadow-card p-3`,children:[s.length===0?n&&(0,Y.jsx)(`div`,{"data-slot":`gh-empty`,className:`px-4 py-4 text-sm text-muted-foreground`,children:n}):(0,Y.jsx)(wn,{items:s,rows:t,paging:o}),o.pagingAvailable?(0,Y.jsx)(Tn,{view:e,list:a,paging:o}):null,(0,Y.jsx)(En,{backedQuery:i.backedQuery,filterSearch:i.filterSearch}),s.length>0&&r.searchWanted&&n?(0,Y.jsx)(`div`,{"data-slot":`gh-search-status`,role:`status`,className:`px-4 py-4 text-sm text-muted-foreground`,children:n}):null,c.length>0?(0,Y.jsx)(Dn,{hits:c,searchPayload:r.searchPayload,rows:t}):null]})}function wn({items:e,rows:t,paging:n}){let{setRowsEl:r,scrollOwner:i,listEl:a,scrollOwnerRef:o,startMargin:s}=n,c=(0,J.useRef)(null),l=(0,J.useRef)(!1);(0,J.useEffect)(()=>{if(l.current||!i)return;l.current=!0;let n=e.findIndex(e=>e.url===t.expandedUrl);n>=0&&c.current?.scrollToIndex(n,{align:`start`})},[i,e,t.expandedUrl]);let u=e.map((e,n)=>(0,Y.jsx)(`div`,{role:`listitem`,"data-slot":`gh-row-item`,"data-divided":n>0||void 0,children:Sn(e,t)},e.url));return(0,Y.jsx)(`div`,{ref:r,"data-slot":`gh-rows`,"data-virtualized":i?`true`:void 0,role:`list`,children:i?(0,Y.jsx)(Ge,{ref:c,scrollRef:o,startMargin:s,children:u},i===a?`list`:`main`):u})}function Tn({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-muted-foreground`,children:t.isFetchingNextPage?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(F,{"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 En({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-muted-foreground`,children:[`Showing the first `,t.data.items.length,` matches from GitHub search; more may exist.`]}):null}function Dn({hits:e,searchPayload:t,rows:n}){let r=(0,J.useRef)(null),i=(0,J.useRef)(!1);(0,J.useEffect)(()=>{i.current||(i.current=!0,(r.current?.querySelector(`[data-slot="gh-row"][aria-expanded="true"]`))?.scrollIntoView({block:`start`}))},[]);let a=u();return(0,Y.jsx)(re,{projectId:a,requests:a?e.map(e=>({projectId:a,kind:e.kind===`pr`?`PR`:`Issue`,number:e.number})):[],children:(0,Y.jsxs)(`div`,{"data-slot":`gh-search-hits`,children:[(0,Y.jsxs)(`p`,{className:`px-4 pt-2 pb-1 text-xs font-medium tracking-wide text-muted-foreground uppercase`,children:[`Found on GitHub`,t?.truncated?` (first matches)`:``]}),(0,Y.jsx)(`ul`,{ref:r,className:`flex flex-col gap-0.5 px-2 pb-2`,children:e.map(e=>(0,Y.jsx)(`li`,{children:Sn(e,n,!0)},e.url))})]})})}function On({view:e,selected:t,selectedNumber:n,exact:r,repo:i,rows:a,listPath:o,changes:s,handToAgent:c}){let{exactWanted:l,exactItem:u}=r;return(0,Y.jsxs)(`section`,{"data-slot":`gh-detail`,className:`flex w-full min-w-0 flex-col rounded-lg border border-card-edge bg-card shadow-card`,children:[t?null:(0,Y.jsx)(`div`,{className:`px-4 pt-4 md:px-7 md:pt-5`,children:(0,Y.jsx)($e,{backLink:{to:o}})}),t?(0,Y.jsx)(kn,{item:t,repo:i,rows:a,listPath:o,changes:s,handToAgent:c}):l&&u.isPending?(0,Y.jsx)(`div`,{"data-slot":`gh-detail-loading`,className:`flex flex-1 flex-col`,children:(0,Y.jsx)(W,{icon:(0,Y.jsx)(F,{className:`motion-safe:animate-spin`}),tone:`neutral`,heading:`h2`,title:`Loading #${n}…`,subtitle:`It is not among the open items, so the tab is asking GitHub for it.`})}):l&&(u.isError||u.data?.available===!1)?(0,Y.jsx)(An,{number:n,exact:r}):(0,Y.jsx)(Et,{view:e,number:n})]})}function kn({item:e,repo:t,rows:n,listPath:r,changes:i,handToAgent:a}){let{workflows:o,skillList:s,workflow:c,setWorkflow:l,selectedSkills:u,setSelectedSkills:d,engine:f,setEngine:p,queued:m,onQueued:h}=a,g=ne().state?.focusHandoff===!0;return(0,J.useEffect)(()=>{g&&$()},[g,e.url]),(0,Y.jsx)(rt,{item:e,comments:n.commentsOf(e),afterHeading:e.kind===`issue`?(0,Y.jsx)(ft,{number:e.number,repo:t},e.url):void 0,backLink:{to:r},subNav:{filter:n.filter,narrows:n.narrows,changes:i},onRunAgent:$,headerAction:(0,Y.jsx)(Ht,{item:e,queuedRunId:m.get(e.url)??null}),colors:n.colors,checks:xn(e,n.checksMap),children:(0,Y.jsx)(at,{item:e,workflows:o.data?.workflows??[],skills:s,workflow:c,onWorkflowChange:l,selectedSkills:u,onSkillsChange:d,engine:f,onEngineChange:p,queuedRunId:m.get(e.url)??null,onQueued:h},e.url)})}function An({number:e,exact:t}){let{exactItem:n,retryingExact:r,retryExact:i}=t;return(0,Y.jsx)(W,{icon:(0,Y.jsx)(oe,{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:i,children:`Retry`})})}function jn({options:e,colors:t,selected:n,onChange:r}){let[i,a]=(0,J.useState)(!1),o=e=>r(n.includes(e)?n.filter(t=>t!==e):[...n,e]);return(0,Y.jsxs)(B,{open:i,onOpenChange:a,children:[(0,Y.jsx)(R,{asChild:!0,children:(0,Y.jsxs)(`button`,{type:`button`,"data-slot":`gh-label-filter`,disabled:e.length===0,className:k(`inline-flex min-h-11 min-w-11 shrink-0 items-center gap-1.5 rounded-md border border-input bg-card px-3 text-sm font-medium text-foreground transition-colors hover:bg-muted disabled:opacity-60`,n.length>0&&`border-accent-strong/60 text-foreground`),children:[n.length>0?`Labels · ${n.length}`:`Labels`,(0,Y.jsx)(P,{size:12,"aria-hidden":`true`,className:`size-3 shrink-0 text-muted-foreground`})]})}),(0,Y.jsx)(z,{align:`end`,sideOffset:6,className:`w-60 p-0`,children:(0,Y.jsxs)(Ee,{children:[(0,Y.jsx)(Se,{placeholder:`Filter labels…`}),(0,Y.jsxs)(Te,{className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[(0,Y.jsx)(we,{children:`No labels.`}),n.length>0?(0,Y.jsxs)(Ce,{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)(Ce,{value:e,onSelect:()=>o(e),className:`min-h-11`,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,"data-slot":`gh-label-dot`,className:`size-2.5 shrink-0 rounded-full ring-1 ring-foreground/30`,style:it(t[e])}),(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e}),r?(0,Y.jsx)(N,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-link-foreground`}):null]},e)})]})]})})]})}export{dn as GithubRoute};
|
package/web/dist/assets/{global-activity-route-CrAG-ji7.js → global-activity-route-B9DMoviv.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{B as r,U as i}from"./queries-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{B as r,U as i}from"./queries-DD_9iITj.js";import{n as a,p as o}from"./chunk-KS7C4IRE-BdLLx37K.js";import{o as s}from"./dist-CCX8mhHc.js";import{A as c,C as l,D as u,F as d,I as f,L as p,M as m,N as h,O as g,P as _,R as ee,S as v,T as y,_ as b,a as x,b as S,c as te,d as ne,f as re,g as ie,h as ae,i as oe,j as se,k as ce,l as le,m as ue,n as de,o as fe,p as pe,r as me,s as C,t as w,u as T,v as E,w as D,x as O,y as k}from"./activity-motion-CXlbNrMI.js";import{t as A}from"./button-BV_AiLj2.js";import{a as j,f as M,n as N,t as P}from"./page-shell-BdjH5hyc.js";import{i as F}from"./project-order-AcHI4Dcl.js";import{En as I}from"./index-C3kap2_j.js";var L=e(t(),1),R=(e,t)=>({x0:Math.min(e.x,t.x),y0:Math.min(e.y,t.y),x1:Math.max(e.x,t.x),y1:Math.max(e.y,t.y)});function z(e,t,n=1){return t.some(t=>t.x+n<e.x1&&e.x0<t.x+t.w-n&&t.y+n<e.y1&&e.y0<t.y+t.h-n)}var he=(e,...t)=>e.filter(e=>!t.some(t=>ge(e,t))),ge=(e,t)=>e.x===t.x&&e.y===t.y&&e.w===t.w&&e.h===t.h,B=e=>Math.round(e*10)/10,V=e=>`${B(e.x)} ${B(e.y)}`;function _e(e){let t=[];for(let n of e){let e=t[t.length-1];if(e&&e.x===n.x&&e.y===n.y)continue;let r=t[t.length-2];r&&e&&(r.x===e.x&&e.x===n.x||r.y===e.y&&e.y===n.y)&&t.pop(),t.push(n)}return t}function ve(e,t=8){let n=_e(e),r=n[0];if(!r)return``;let i=`M${V(r)}`;for(let e=1;e<n.length;e++){let r=n[e],a=n[e-1],o=n[e+1];if(!o){i+=` L ${V(r)}`;continue}let s=Math.min(t,Math.hypot(r.x-a.x,r.y-a.y)/2,Math.hypot(o.x-r.x,o.y-r.y)/2),c=(e,t,n)=>{let r=Math.hypot(t.x-e.x,t.y-e.y)||1;return{x:e.x+(t.x-e.x)/r*n,y:e.y+(t.y-e.y)/r*n}};i+=` L ${V(c(r,a,s))} Q ${V(r)}, ${V(c(r,o,s))}`}return i}function H(e,t,n){let r=[];for(let i of[...e].sort((e,n)=>t(e)-t(n))){let e=r[r.length-1];e&&Math.abs(t(i)-e.from)<=2?e.to=Math.max(e.to,n(i)):r.push({from:t(i),to:n(i)})}return r}function ye(e){return{rows:H(e,e=>e.y,e=>e.y+e.h).map(({from:e,to:t})=>({top:e,bottom:t})),cols:H(e,e=>e.x,e=>e.x+e.w).map(({from:e,to:t})=>({left:e,right:t}))}}var U=(e,t,n)=>Math.max(0,e.findIndex(e=>Math.abs(t(e)-n)<=2)),W=(e,t)=>((e.rows[t]?.bottom??0)+(e.rows[t+1]?.top??(e.rows[t]?.bottom??0)+16))/2;function be(e,t,n){let r=e.cols,i=e=>((r[e]?.right??0)+(r[e+1]?.left??0))/2;return t<n?i(t):t>n?i(t-1):t+1<r.length?i(t):t>0?i(t-1):(r[t]?.right??0)+8}function xe(e,t,n,r=0){let i=ye(n),a=U(i.rows,e=>e.top,e.y),o=U(i.rows,e=>e.top,t.y),s=o>a,c=e.x+e.w/2+r,l=t.x+t.w/2+r,u=(s?W(i,a):W(i,a-1))+r/2,d=(s?W(i,o-1):W(i,o))+r/2,f=be(i,U(i.cols,e=>e.left,e.x),U(i.cols,e=>e.left,t.x))+r/2,p={x:c,y:s?e.y+e.h+1:e.y-1},m={x:l,y:s?t.y-3:t.y+t.h+3};return{points:[p,{x:c,y:u},{x:f,y:u},{x:f,y:d},{x:l,y:d},m],label:{x:(c+f)/2,y:u}}}function Se(e){let t=new Map;for(let n of e){let e=[n.senderRunId,n.recipientRunId].sort().join(`
|
|
2
2
|
`);t.set(e,[...t.get(e)??[],n.requestId])}let n=new Map;for(let e of t.values())e.forEach((t,r)=>n.set(t,(r-(e.length-1)/2)*12));return n}function Ce(e,t,n,r=4){let i=[],a=new Map;for(let{id:o,at:s}of e){let e={...s};for(let a=0;a<=i.length;a++){let a=i.find(n=>Math.abs(e.x-n.x)<t.w+r&&Math.abs(e.y-n.y)<t.h+r);if(!a)break;n===`x`?e.x=a.x+t.w+r:e.y=a.y+t.h+r}i.push(e),a.set(o,e)}return a}var G=e=>Math.round(e*10)/10,K=e=>`${G(e.x)} ${G(e.y)}`;function we(e,t,n=[],r=0){let i=e.x+e.w/2+r,a=t.x+t.w/2+r;if(t.y>=e.y+e.h||t.y+t.h<=e.y){let o=t.y>e.y,s=o?e.y+e.h+1:e.y-1,c=o?t.y-3:t.y+t.h+3,l=(c-s)/2;if(z(R({x:i,y:s},{x:a,y:c}),he(n,e,t))){let i=xe(e,t,n,r);return{d:ve(i.points),label:i.label}}return{d:`M${K({x:i,y:s})} C ${K({x:i,y:s+l})}, ${K({x:a,y:c-l})}, ${K({x:a,y:c})}`,label:{x:(i+a)/2,y:(s+c)/2}}}let o=e.y-1,s=t.y-1,c=Math.min(o,s),l=Math.max(8,Math.min(30,18+Math.abs(a-i)*.05)+r);return{d:`M${K({x:i,y:o})} C ${K({x:i,y:c-l})}, ${K({x:a,y:c-l})}, ${K({x:a,y:s-3})}`,label:{x:(i+a)/2,y:c-l*.75}}}function Te(e,t){return{x:e.left-t.left,y:e.top-t.top,w:e.width,h:e.height}}function Ee(e,t){if(!t||t.length===0)return[...e];let n=new Map(t.map((e,t)=>[e,t])),r=e.filter(e=>n.has(e.projectId)),i=e.filter(e=>!n.has(e.projectId));return r.sort((e,t)=>(n.get(e.projectId)??0)-(n.get(t.projectId)??0)),[...r,...i]}function De(e){let t=[],n=[];for(let r of e)v(r)===void 0&&r.tasks.length===0?n.push(r):t.push(r);return{panels:t,idle:n}}function Oe(e){let t=new Set(e.tasks.map(e=>e.runId));return e.requests.filter(e=>e.relationship===`peer`&&t.has(e.senderRunId)&&t.has(e.recipientRunId))}function ke(e,t){let n=new Set(e.map(e=>e.runId));return t.filter(e=>n.has(e.waiterRunId)&&n.has(e.peerRunId))}function Ae(e){let t=e.tasks.length,n=e.tasks.reduce((e,t)=>e+t.workers.filter(e=>m(e.status)).length,0),r=[`${t} active task${t===1?``:`s`}`];return n>0&&r.push(`${n} worker${n===1?``:`s`}`),r.join(` · `)}function je(e,t){let n=t?`more `:``;return e===1?`1 ${n}project has no active work:`:`${e} ${n}projects have no active work:`}var q=n(),Me={w:104,h:20};function Ne(e){let t=e.getBoundingClientRect(),n=new Map;for(let r of e.querySelectorAll(`[data-activity-pill]`)){let e=r.getAttribute(`data-activity-pill`);e&&n.set(e,Te(r.getBoundingClientRect(),t))}return n}function Pe(e,t,n=[]){let r=Ne(e),i=[...r.values()],a=[...t.map(e=>({requestId:e.requestId,senderRunId:e.senderRunId,recipientRunId:e.recipientRunId,kind:`peer`})),...n.map(e=>({...re(e),kind:`wait`}))],o=Se(a),s=[];for(let e of a){let t=r.get(e.senderRunId),n=r.get(e.recipientRunId);t&&n&&s.push({id:e.requestId,kind:e.kind,...we(t,n,i,o.get(e.requestId))})}let c=Ce(s.map(e=>({id:e.id,at:e.label})),Me,`x`);return s.map(e=>({...e,label:c.get(e.id)??e.label}))}function Fe(e,t){return e.length===t.length&&e.every((e,n)=>e.id===t[n]?.id&&e.d===t[n]?.d&&e.label.x===t[n]?.label.x&&e.label.y===t[n]?.label.y)}var J=`pointer-events-none absolute z-[4] -translate-x-1/2 -translate-y-1/2 rounded-md border bg-background px-1.5 py-px text-xs whitespace-nowrap text-foreground tabular-nums max-md:hidden`;function Ie({arc:e,wait:t,now:n,motion:r}){return(0,q.jsxs)(`span`,{"data-slot":`activity-arc-label`,"data-wait":t.id,"aria-hidden":`true`,style:{left:e.label.x,top:e.label.y},className:s(J,`border-dashed border-message-peer-accent`,t.id in r.waitsClosing&&`activity-line-out`),children:[(0,q.jsx)(`span`,{className:`font-semibold text-message-peer-accent`,children:`Waiting`}),` · `,_(f(t.since,n))]})}function Le({arc:e,request:t,now:n,motion:r}){let i=te(r,e.id);return(0,q.jsxs)(`span`,{"data-slot":`activity-arc-label`,"data-request":e.id,"aria-hidden":`true`,style:{left:e.label.x,top:e.label.y},className:s(J,i?`border-success`:`border-message-peer-accent`,C(r,e.id)===`fade`&&`activity-line-out`),children:[i?(0,q.jsx)(`span`,{className:`font-semibold text-success`,children:`Replied`}):(0,q.jsx)(`span`,{className:`font-semibold text-message-peer-accent`,children:`Request`}),` · `,_(f(t.createdAt,n))]})}var Re=[],ze=new Set;function Be({arcs:e,waits:t=Re,active:n=ze,layoutKey:r,now:i,motion:a=b,paused:o=!1}){let c=L.useRef(null),l=T(c,L.useCallback(n=>Pe(n,e,t),[e,t]),Fe,`[data-activity-pill]`,r),u=L.useMemo(()=>new Set(l.map(e=>e.id)),[l]),d=ne(a.comets,u,o),f=new Map(e.map(e=>[e.requestId,e])),p=new Map(t.map(e=>[e.id,e])),m=L.useId().replace(/[^a-zA-Z0-9_-]/g,``),h=`activity-arrow-arc-${m}`,g=`activity-ring-arc-${m}`;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`svg`,{ref:c,"data-slot":`activity-arcs`,"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 z-[3] size-full overflow-visible max-md:hidden`,children:[(0,q.jsxs)(`defs`,{children:[(0,q.jsx)(`marker`,{id:h,viewBox:`0 0 10 10`,refX:`8`,refY:`5`,markerWidth:`7`,markerHeight:`7`,orient:`auto`,children:(0,q.jsx)(`path`,{d:`M0 0 10 5 0 10z`,className:`fill-message-peer-accent`})}),(0,q.jsx)(x,{id:g})]}),l.map(e=>{if(e.kind===`wait`){let t=n.has(e.id);return(0,q.jsx)(`path`,{"data-wait":e.id,"data-kind":`wait`,"data-active":t?`true`:void 0,d:e.d,fill:`none`,strokeDasharray:`0 8`,strokeLinecap:`round`,strokeWidth:t?3:2.2,markerEnd:`url(#${g})`,className:s(`stroke-message-peer-accent`,t?`opacity-100`:`opacity-80`,le(a,e.id))},e.id)}let t=C(a,e.id);return(0,q.jsx)(`path`,{"data-request":e.id,"data-kind":`peer`,"data-phase":t,d:e.d,fill:`none`,strokeDasharray:t===`replied`?void 0:`6 5`,strokeWidth:2,markerEnd:`url(#${h})`,className:s(`stroke-message-peer-accent`,fe(t,e.id in a.opening))},e.id)}),(0,q.jsx)(`g`,{ref:d,"data-slot":`activity-comets`})]}),l.map(e=>{let t=e.kind===`wait`?p.get(e.id):void 0;if(t)return(0,q.jsx)(Ie,{arc:e,wait:t,now:i,motion:a},e.id);let n=f.get(e.id);return n?(0,q.jsx)(Le,{arc:e,request:n,now:i,motion:a},e.id):null})]})}var Y=(e,t)=>`/p/${encodeURIComponent(e)}/tasks/${encodeURIComponent(t)}`,Ve=[],He=`relative z-[1] inline-flex min-h-11 items-center text-[12px] text-message-peer-accent hover:underline focus-visible:outline-2 focus-visible:outline-ring`;function Ue({task:e}){let t=e.workers.filter(e=>m(e.status));return t.length===0?null:(0,q.jsxs)(`div`,{"data-slot":`activity-pill-workers`,className:`mt-1.5 ml-[19px] flex flex-wrap items-center gap-1 text-xs text-muted-foreground`,children:[t.map(e=>(0,q.jsx)(c,{run:e,role:`worker`},e.runId)),(0,q.jsxs)(`span`,{className:`ml-0.5`,children:[t.length,` worker`,t.length===1?``:`s`]})]})}function We({projectId:e,task:t,requests:n,waits:r=Ve,index:i,ctx:o,motion:l=b,linked:u=!1,onHover:g}){let _=h(t,o);return(0,q.jsxs)(`li`,{"data-activity-pill":t.runId,"data-rung":t.rung,"data-action":_.action,"data-linked":u?`true`:void 0,...ae(t.runId,g),className:s(`relative min-w-0 rounded-[10px] border bg-card-2 px-2.5 py-2`,_.action?_.tone===`info`?`border-info/70`:`border-pending/70`:t.rung===`running`&&m(t.status)?`border-status-running/60`:`border-border`,u&&`outline-2 outline-offset-2 outline-message-peer-accent`,t.runId in l.entering&&`activity-card-enter`),children:[(0,q.jsx)(pe,{task:t,motion:l,glow:_.action!==void 0}),(0,q.jsxs)(`div`,{className:`flex items-center gap-[7px]`,children:[(0,q.jsx)(c,{run:t,role:`root`}),(0,q.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-[12.5px] font-medium`,children:(0,q.jsx)(a,{to:Y(e,t.runId),className:`after:absolute after:inset-0 after:rounded-[10px] after:content-[''] focus-visible:outline-2 focus-visible:outline-ring`,children:t.title})}),(0,q.jsx)(ce,{rate:t.rate,className:`h-3 w-10`})]}),(0,q.jsxs)(`div`,{className:`mt-[3px] ml-[19px] flex items-center gap-2`,children:[(0,q.jsxs)(`p`,{"data-slot":`activity-pill-line`,className:`min-w-0 flex-1 truncate text-xs text-muted-foreground tabular-nums`,children:[(0,q.jsx)(se,{"data-slot":`activity-verb`,tone:_.tone,className:`font-semibold`,children:_.verb}),_.action&&_.since?(0,q.jsxs)(q.Fragment,{children:[` · `,(0,q.jsx)(`span`,{"data-slot":`activity-pill-age`,title:d(_.since),children:p(f(_.since,o.now))})]}):null,` · `,(0,q.jsx)(`span`,{"data-slot":`activity-main`,className:s(_.mono&&`font-mono text-xs`),children:_.main})]}),_.action?(0,q.jsx)(A,{asChild:!0,size:`sm`,variant:_.action===`answer`?`primary`:`outline`,className:`relative z-[1] px-2 text-[12px]`,children:(0,q.jsx)(a,{"data-slot":`activity-pill-action`,to:Y(e,t.runId),children:_.action===`answer`?`Answer`:`Open task`})}):null]}),(0,q.jsx)(ue,{texts:k(t.runId,n,i,r)}),(0,q.jsx)(Ue,{task:t}),(0,q.jsx)(ie,{runId:t.runId,requests:n,waits:r,index:i,link:a,pathOf:t=>Y(e,t),className:`mt-1 ml-[19px] flex flex-col md:hidden`,linkClassName:He})]})}var X=e=>`/p/${encodeURIComponent(e)}/activity`,Ge=e=>`/p/${encodeURIComponent(e)}/`,Z=`rounded-xl border border-card-edge bg-card shadow-card px-4 pt-3.5 pb-4`,Q=`ml-auto inline-flex items-center text-[12px] text-accent-text hover:underline focus-visible:outline-2 focus-visible:outline-ring max-md:min-h-11`;function $({project:e,headingId:t,detail:n,to:r,label:i}){return(0,q.jsxs)(`header`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,q.jsx)(`h2`,{id:t,className:`min-w-0 truncate text-[14px] font-semibold`,children:e.name}),(0,q.jsx)(`span`,{"data-slot":`activity-panel-detail`,className:`text-[12px] text-muted-foreground`,children:n}),(0,q.jsx)(a,{to:r,className:Q,children:i})]})}function Ke({project:e,notice:t}){let n=L.useId();return(0,q.jsx)(`section`,{"aria-labelledby":n,"data-slot":`activity-panel`,"data-project":e.projectId,"data-notice":`true`,className:Z,children:(0,q.jsx)($,{project:e,headingId:n,detail:t,to:Ge(e.projectId),label:`Open project →`})})}function qe(e,t){return L.useMemo(()=>{let n=new Set(e.requests.map(e=>e.requestId)),r=Object.values(t.closing).filter(t=>t.projectId===e.projectId&&!n.has(t.request.requestId)).map(e=>e.request);return Oe({tasks:e.tasks,requests:[...e.requests,...r]})},[e,t.closing])}function Je({project:e,now:t,motion:n=b,paused:r=!1}){let i=L.useId(),a=L.useMemo(()=>l(e),[e]),o=qe(e,n),c=L.useMemo(()=>O(e.tasks),[e.tasks]),u=L.useMemo(()=>ke(e.tasks,[...c,...E(e.projectId,c,n)]),[e.tasks,e.projectId,c,n]),d=oe(c),f={now:t,titleOf:e=>S(a,e)},p=`${e.tasks.map(e=>e.runId).join(`,`)}:${o.map(e=>e.requestId).join(`,`)}:${u.map(e=>e.id).join(`,`)}`,m=o.length>0||u.length>0;return(0,q.jsxs)(`section`,{"aria-labelledby":i,"data-slot":`activity-panel`,"data-project":e.projectId,className:Z,children:[(0,q.jsx)($,{project:e,headingId:i,detail:Ae(e),to:X(e.projectId),label:`Open project activity →`}),(0,q.jsxs)(`div`,{className:s(`relative mt-3`,m&&`md:mt-1 md:pt-10`),children:[(0,q.jsx)(`ul`,{"data-slot":`activity-pills`,"aria-label":`${e.name} tasks`,className:s(`grid grid-cols-[repeat(auto-fit,minmax(min(100%,300px),1fr))] items-start gap-3.5`,m&&`md:gap-y-11`),children:e.tasks.map(t=>(0,q.jsx)(We,{projectId:e.projectId,task:t,requests:e.requests,waits:c,index:a,ctx:f,motion:n,linked:d.linked.has(t.runId),onHover:d.onHover},t.runId))}),m?(0,q.jsx)(Be,{arcs:o,waits:u,active:d.active,layoutKey:p,now:t,motion:n,paused:r}):null]})]})}function Ye(e){let t=v(e.project);return t===void 0?(0,q.jsx)(Je,{...e}):(0,q.jsx)(Ke,{project:e.project,notice:t})}function Xe({projects:e,belowPanels:t}){return e.length===0?null:(0,q.jsxs)(`p`,{"data-slot":`activity-idle`,className:`text-[12.5px] text-muted-foreground`,children:[je(e.length,t),` `,e.map((e,t)=>(0,q.jsxs)(L.Fragment,{children:[t>0?`, `:null,(0,q.jsx)(a,{to:X(e.projectId),"data-project":e.projectId,className:`text-foreground hover:underline focus-visible:outline-2 focus-visible:outline-ring max-md:inline-flex max-md:min-h-11 max-md:items-center`,children:e.name})]},e.projectId))]})}var Ze={kind:`workspace`};function Qe(){let e=i().data?.projects,{order:t}=I();return L.useMemo(()=>e?F(e,t).map(e=>e.id):void 0,[e,t])}function $e(){let e=i().data,t=r(),n=o().state?.activityProjectId,a=e?.bootProject??t.data?.bootProject??null,s=typeof n==`string`&&e?.projects.some(e=>e.id===n&&e.status!==`missing`)?n:a;return{id:s,name:e?.projects.find(e=>e.id===s)?.name,projects:e?.projects}}function et(){let e=ee(Ze),t=$e(),n=Qe(),[r,i]=L.useState(!1),o=w(e.data?.generatedAt,e.dataUpdatedAt),s=e.data?.projects,c=L.useMemo(()=>Ee(s??[],n),[s,n]),l=L.useMemo(()=>De(c),[c]),d=L.useMemo(()=>l.panels.filter(e=>v(e)===void 0),[l.panels]),f=L.useMemo(()=>l.panels.filter(e=>v(e)!==void 0),[l.panels]),p=L.useMemo(()=>c.map(e=>e.projectId),[c]),{motion:m,feed:h,paused:_,reduced:b}=de(e.data,`workspace`),x=d.reduce((e,t)=>e+t.tasks.length,0);return(0,q.jsxs)(j,{route:`activity-global`,density:s?M(x+f.length):`full`,headerSpacing:`compact`,rootProps:{"data-activity-paused":_?`true`:void 0},bodyClassName:`gap-3.5`,header:g({name:`All projects`,now:e.data?o:void 0,updatedAt:e.data?.generatedAt,stale:e.isError,scopeSwitch:(0,q.jsx)(y,{scope:`all`,projects:t.projects,projectId:t.id,projectName:t.name,grouped:r,onToggleGroup:()=>i(e=>!e)})}),sparseFooter:s&&l.panels.length>0?(0,q.jsx)(N,{summary:`${d.length} active ${d.length===1?`project`:`projects`} with live work.`,actions:(0,q.jsx)(A,{variant:`outline`,size:`sm`,asChild:!0,children:(0,q.jsx)(a,{to:`/tasks`,children:`View all tasks`})})}):void 0,children:[s?(0,q.jsx)(u,{summary:D(s),tasksTo:`/tasks`,bumps:m.bumps}):null,e.isPending?(0,q.jsx)(`p`,{"data-slot":`activity-loading`,role:`status`,className:`text-xs text-muted-foreground`,children:`Loading activity…`}):null,e.isError&&!s?(0,q.jsxs)(`div`,{role:`alert`,className:`flex flex-wrap items-center gap-3 rounded-xl border border-border bg-card p-5 text-[13px] text-muted-foreground`,children:[`Could not load activity: `,e.error.message,(0,q.jsx)(A,{size:`sm`,variant:`outline`,onClick:()=>void e.refetch(),children:`Retry`})]}):null,s&&l.panels.length===0&&l.idle.length===0?(0,q.jsx)(P,{slot:`activity-empty`,title:`No projects to show.`,description:`Register a project in Workspace tools to monitor live agent work across repositories.`,actions:(0,q.jsx)(A,{variant:`outline`,size:`sm`,asChild:!0,children:(0,q.jsx)(a,{to:`/tools`,children:`Open workspace tools`})})}):null,d.length>0||h.length>0?(0,q.jsx)(me,{projects:d,now:o,global:!0,grouped:r,projectOrder:p,motion:m,feed:h,still:b,paused:_}):null,f.length>0?(0,q.jsx)(`div`,{"data-slot":`activity-panels`,className:`flex flex-col gap-3`,children:f.map(e=>(0,q.jsx)(Ye,{project:e,now:o,motion:m,paused:_||b},e.projectId))}):null,(0,q.jsx)(Xe,{projects:l.idle,belowPanels:l.panels.length>0})]})}export{et as GlobalActivityRoute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=`/api/v1`,t=``;function n(e){t=e.replace(/\/+$/,``)}function r(){return t}var i=null;function a(e){i=e===``?null:e}function o(){return i}function s(){return i??`default`}var c=/^\/(?:health$|models(?:$|[/?])|providers(?:$|[/?])|projects(?:$|[/?])|workspace\/|fs\/)/;function l(n){return`${t}${e}${u(n)}`}function u(e){return i===null||c.test(e)?e:`/p/${encodeURIComponent(i)}${e}`}var d=/^\/api(?:\/v1)?(\/.*)$/;function f(e){let n=/^[a-z][a-z0-9+.-]*:/i.exec(e);if(n){let t=e.indexOf(`//`,n[0].length);if(t!==n[0].length)return e;let r=e.indexOf(`/`,t+2);if(r===-1)return e;let i=e.slice(0,r),a=p(e.slice(r));return a===null?e:`${i}${a}`}let r=p(t&&e.startsWith(t)?e.slice(t.length):e);return r===null?e:`${t}${r}`}function p(t){let n=d.exec(t);if(!n)return null;let r=n[1];return r.startsWith(`/p/`)?`${e}${r}`:`${e}${u(r)}`}var m=/^\/h\/([^/]+)(?=\/|$)/,h=/(?:^|\/)api\/v1\/hosts\/([^/]+)$/,g=``,_;function v(e){return e.replace(/\/+$/,``)}function y(e){try{return decodeURIComponent(e)}catch{return e}}function b(e){let t=m.exec(e);if(!t)return null;let n=t[1];return{hostId:y(n),basename:`/h/${n}`}}function x(e){let t=v(e);if(!t)return null;let n=h.exec(t);return n?y(n[1]):null}function S(e){g=v(e.mainApiBase??``);let t=b(e.pathname);if(!t)return _=void 0,n(g),{hostId:null,basename:void 0,apiBase:g,mainApiBase:g};_=t.basename;let r=`${g}/api/v1/hosts/${encodeURIComponent(t.hostId)}`;return n(r),{hostId:t.hostId,basename:t.basename,apiBase:r,mainApiBase:g}}function C(){return g}function w(){return x(r())}function T(){return w()!==null}function E(){let e=w();if(e!==null)return _&&b(`${_}/`)?.hostId===e?_:`/h/${encodeURIComponent(e)}`}function D(e){return e===null?`/`:`/h/${encodeURIComponent(e)}/`}function O(e,t){let n=`/p/${encodeURIComponent(t)}/`;return e===null?n:`/h/${encodeURIComponent(e)}${n}`}function k(e,t
|
|
1
|
+
var e=`/api/v1`,t=``;function n(e){t=e.replace(/\/+$/,``)}function r(){return t}var i=null;function a(e){i=e===``?null:e}function o(){return i}function s(){return i??`default`}var c=/^\/(?:health$|models(?:$|[/?])|providers(?:$|[/?])|projects(?:$|[/?])|workspace\/|fs\/)/;function l(n){return`${t}${e}${u(n)}`}function u(e){return i===null||c.test(e)?e:`/p/${encodeURIComponent(i)}${e}`}var d=/^\/api(?:\/v1)?(\/.*)$/;function f(e){let n=/^[a-z][a-z0-9+.-]*:/i.exec(e);if(n){let t=e.indexOf(`//`,n[0].length);if(t!==n[0].length)return e;let r=e.indexOf(`/`,t+2);if(r===-1)return e;let i=e.slice(0,r),a=p(e.slice(r));return a===null?e:`${i}${a}`}let r=p(t&&e.startsWith(t)?e.slice(t.length):e);return r===null?e:`${t}${r}`}function p(t){let n=d.exec(t);if(!n)return null;let r=n[1];return r.startsWith(`/p/`)?`${e}${r}`:`${e}${u(r)}`}var m=/^\/h\/([^/]+)(?=\/|$)/,h=/(?:^|\/)api\/v1\/hosts\/([^/]+)$/,g=``,_;function v(e){return e.replace(/\/+$/,``)}function y(e){try{return decodeURIComponent(e)}catch{return e}}function b(e){let t=m.exec(e);if(!t)return null;let n=t[1];return{hostId:y(n),basename:`/h/${n}`}}function x(e){let t=v(e);if(!t)return null;let n=h.exec(t);return n?y(n[1]):null}function S(e){g=v(e.mainApiBase??``);let t=b(e.pathname);if(!t)return _=void 0,n(g),{hostId:null,basename:void 0,apiBase:g,mainApiBase:g};_=t.basename;let r=`${g}/api/v1/hosts/${encodeURIComponent(t.hostId)}`;return n(r),{hostId:t.hostId,basename:t.basename,apiBase:r,mainApiBase:g}}function C(){return g}function w(){return x(r())}function T(){return w()!==null}function E(){let e=w();if(e!==null)return _&&b(`${_}/`)?.hostId===e?_:`/h/${encodeURIComponent(e)}`}function D(e){return e===null?`/`:`/h/${encodeURIComponent(e)}/`}function O(e,t){let n=`/p/${encodeURIComponent(t)}/`;return e===null?n:`/h/${encodeURIComponent(e)}${n}`}function k(e,t,n){return`/h/${encodeURIComponent(e)}/p/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}`}function A(e,t){let n=t.startsWith(`/`)?t:`/${t}`;return`/h/${encodeURIComponent(e)}${n}`}export{a as _,D as a,k as c,e as d,l as f,f as g,s as h,E as i,S as l,o as m,w as n,A as o,r as p,C as r,O as s,x as t,T as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./host-context-iTMFRMT5.js";var t=`cez-host:`;function n(n){let r=e();return r===null?n:`${t}${encodeURIComponent(r)}:${n}`}export{n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t}from"./react-runtime-CCIEwYL0.js";import{cr as n,fr as r,lr as i,on as a,pr as o,sn as s,sr as c,ur as l}from"./queries-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t}from"./react-runtime-CCIEwYL0.js";import{cr as n,fr as r,lr as i,on as a,pr as o,sn as s,sr as c,ur as l}from"./queries-DD_9iITj.js";import{n as u,u as d}from"./host-context-iTMFRMT5.js";import{Bi as f,On as p,Sr as m,Zi as h,_r as g,an as _,dr as v,er as y,hr as b,lr as x,nr as S,oa as C,ur as w,vr as T}from"./project-scope-context-DNrHbqd2.js";var E=e(t(),1),D=3e3,O=3e4,k=new WeakMap,A={health:[`main`,`health`],hosts:[`main`,`hosts`,`list`],hostsProjects:[`main`,`hosts`,`projects`],hostsRunsIndex:a,hostsRunsSearchRoot:[`main`,`hosts`,`runs-search`],hostsRunsSearch:e=>[`main`,`hosts`,`runs-search`,e],uiState:[`main`,`workspace`,`ui-state`]};function j(){return(0,E.useSyncExternalStore)(S,y,()=>void 0)}function M(e){return!d()&&e===`topics`}function N(e){let t=x();return f({queryKey:A.health,queryFn:({signal:e})=>c({signal:e}),enabled:e,...d()?{networkMode:`always`}:{},staleTime:O,refetchOnWindowFocus:e?`always`:!1,refetchInterval:o(e&&t?O:!1)})}function P(e={}){let{enabled:t=!0,pollWhileOffline:r=!1}=e,i=x(),a=T(),s=j(),c=u(),l=M(s),m=f({queryKey:A.hosts,queryFn:async({signal:e})=>{let t=w(),i=await n({signal:e});p(i.hosts),k.set(i,t);let a=u(),o=a?i.hosts.find(e=>e.id===a):void 0;if(a&&o){g(a,o.state,Date.now(),t);let n=v();r&&o.state===`connected`&&n.offline&&n.gatewayCode===`host-unreachable`&&_({signal:e}).catch(()=>void 0)}return i},enabled:t,...d()?{networkMode:`always`}:{},structuralSharing:!1,staleTime:1e4,refetchInterval:e=>{if(!t||!i)return!1;if(r&&a.offline)return D;let n=e.state.status===`error`||!!e.state.data?.warning;return l&&!n?!1:o(O)},refetchOnWindowFocus:t?`always`:!1});return(0,E.useEffect)(()=>{if(!c||!m.data)return;let e=m.data.hosts.find(e=>e.id===c);e&&g(c,e.state,m.dataUpdatedAt,k.get(m.data))},[c,m.data,m.dataUpdatedAt]),m}function F(e,t){return t?!0:e?e.hosts.length>0||!!e.warning:!1}var I=new WeakMap,L=new WeakMap;function R(e,t){let n=I.get(e);if(n||(n=new Set,I.set(e,n)),n.has(t.queryHash))return;n.add(t.queryHash);let r=e.getQueryCache().subscribe(i=>{i.query===t&&(i.type!==`removed`&&t.state.fetchStatus!==`idle`||(r(),n.delete(t.queryHash),i.type!==`removed`&&t.getObserversCount()>0&&e.invalidateQueries({queryKey:t.queryKey,exact:!0,refetchType:`active`})))})}function z(e){let t=e.getQueryCache().findAll({queryKey:A.hostsRunsSearchRoot}),n=[];for(let r of t){if(r.state.fetchStatus!==`idle`){r.getObserversCount()>0&&R(e,r);continue}n.push(e.invalidateQueries({queryKey:r.queryKey,exact:!0,refetchType:`active`}))}return n}function B(e,t){if(e.size!==t.size)return!0;for(let[n,r]of t)if(e.get(n)!==r)return!0;return!1}function V(e,t){if(d())return;let n=new Map;for(let e of t)n.set(e.id,e.state);let r=L.get(e);L.set(e,n),!(!r||y()!==`finite`)&&B(r,n)&&Promise.all(z(e))}function H(e={}){let{enabled:t=!0}=e,n=x(),r=h();return f({queryKey:A.hostsProjects,queryFn:async({signal:e})=>{let t=await i({signal:e});return p(t.hosts),V(r,t.hosts),t},enabled:t,...d()?{networkMode:`always`}:{},staleTime:O,retry:!1,refetchOnMount:e=>t&&(e.state.data===void 0||F(e.state.data,e.state.status===`error`)),refetchOnWindowFocus:e=>t&&F(e.state.data,e.state.status===`error`)?`always`:!1,refetchInterval:e=>!t||!n||!F(e.state.data,e.state.status===`error`)?!1:o(O)})}var U=new WeakMap;function W(e,t){let n=U.get(e);if(n)n.count+=1;else{let n=setInterval(()=>{e.reconcileFinite()},t);U.set(e,{count:1,timer:n})}return()=>{let t=U.get(e);t&&(--t.count,t.count<=0&&(clearInterval(t.timer),U.delete(e)))}}function G(e,t){let n=s(h()),r=x(),i=j(),a=e&&!d(),c=a&&r&&i===`finite`?o(O):!1;return(0,E.useEffect)(()=>{if(c)return W(n,c)},[c,n]),f({queryKey:A.hostsRunsIndex,queryFn:({signal:e})=>n.fetchFull(e),enabled:a,...t?{select:t}:{},structuralSharing:!1,staleTime:1/0,retry:!1,refetchOnWindowFocus:e=>a&&e.state.status===`error`?`always`:!1})}function K(e){let t=H({enabled:!e}),n=(0,E.useMemo)(()=>e?[]:t.data?.hosts??[],[e,t.data]),r=(0,E.useMemo)(()=>{let e=new Map,t=new Map,r=new Map;for(let i of n)e.set(i.id,i.label),t.set(i.id,i.state),i.projects&&r.set(i.id,i.projects);return{hostLabels:e,hostStates:t,projectsByHost:r}},[n]);return{mainHostsProjects:t,savedHosts:n,hasHosts:n.length>0,...r}}function q(e,t){let n=h(),i=e.trim(),a=t&&!d()&&i.length>=2,o=a?i:null;return(0,E.useEffect)(()=>{if(o===null)return;let e=A.hostsRunsSearch(o);return()=>{let t=n.getQueryCache().find({queryKey:e,exact:!0});t&&t.state.fetchStatus===`fetching`&&t.getObserversCount()===0&&n.cancelQueries({queryKey:e,exact:!0})}},[o,n]),f({queryKey:A.hostsRunsSearch(i),queryFn:({signal:e})=>r(i,{signal:e}),enabled:a,placeholderData:C,staleTime:1e4,retry:!1,refetchOnWindowFocus:!!a})}function J(e){return f({queryKey:A.uiState,queryFn:({signal:e})=>l({signal:e}),enabled:e,...d()?{networkMode:`always`}:{}})}function Y(){let e=h(),{hostId:t,offline:n}=T(),r=(0,E.useRef)(!1);(0,E.useEffect)(()=>{if(d())return b(()=>{e.refetchQueries({queryKey:A.hosts,exact:!0})})},[e]),(0,E.useEffect)(()=>{if(t===null){r.current=!1;return}r.current!==n&&e.invalidateQueries({queryKey:A.hostsProjects}),r.current=n},[t,n,e])}function X(){let e=u(),t=T(),n=P({enabled:e!==null,pollWhileOffline:!0});if(e===null)return null;let r=n.data?.hosts.find(t=>t.id===e),i=r?.label??e;return t.offline?{hostId:e,hostLabel:i,offline:!0,state:(r&&r.state!==`connected`?r.state:t.reportedState&&t.reportedState!==`connected`?t.reportedState:t.gatewayCode?m(t.gatewayCode):null)??`unreachable`,gatewayCode:t.gatewayCode}:{hostId:e,hostLabel:i,offline:!1,state:null,gatewayCode:null}}export{Y as a,P as c,J as d,K as f,X as i,H as l,z as n,G as o,F as r,N as s,A as t,q as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{t}from"./diff-stat-DCO_BkZB.js";import{t as n}from"./zoomable-image-
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{t}from"./diff-stat-DCO_BkZB.js";import{t as n}from"./zoomable-image-DJ1lJEMc.js";var r=e();function i({stat:e,hidden:n=!1}){return(0,r.jsxs)(`p`,{"data-slot":`diff-totals`,hidden:n,className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,r.jsxs)(`span`,{children:[e.files,` `,e.files===1?`file`:`files`,` changed`]}),(0,r.jsx)(t,{stat:e})]})}function a(e){return e.image===!0&&(e.binary===!0||e.patch===``)}function o({file:e,imageSrc:t,onOpenInApp:i}){return e.status===`deleted`?(0,r.jsx)(s,{children:`Image deleted — only the new side can be previewed.`}):t?(0,r.jsxs)(`div`,{"data-slot":`diff-image-preview`,className:`flex flex-col items-center gap-2 p-4`,children:[(0,r.jsx)(n,{src:t(e.path),alt:e.path,className:`max-h-[60vh] max-w-full rounded-sm`}),i?(0,r.jsx)(`button`,{type:`button`,"data-slot":`diff-image-open`,onClick:()=>i(e.path),className:`text-xs font-medium text-muted-foreground hover:text-foreground hover:underline`,children:`Open in default app`}):null]}):(0,r.jsx)(s,{children:`Binary file — no text diff.`})}function s({children:e}){return(0,r.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-muted-foreground`,children:e})}export{a as n,i as r,o as t};
|