@hearsay-tools/squawk 0.19.0-dev.8901 → 0.19.0-nightly.20261129.95
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/delegation/routes.d.ts +65 -65
- package/dist/server/providers-routes.d.ts +57 -57
- package/dist/server/repo-routes.d.ts +34 -34
- package/dist/server/runner-install-routes.d.ts +10 -10
- package/dist/server/runs-routes.d.ts +303 -303
- package/dist/server/server.d.ts +58 -58
- package/dist/server/workspace-routes.d.ts +85 -85
- package/package.json +4 -4
- package/web/dist/assets/{accounts-section-DV18K14j.js → accounts-section-CL4_y1Ap.js} +1 -1
- package/web/dist/assets/{activity-motion-U0gkYTm-.js → activity-motion-1nxINCqs.js} +1 -1
- package/web/dist/assets/{activity-route-CKFb-IYI.js → activity-route-yCPzQHRl.js} +1 -1
- package/web/dist/assets/{agent-config-section-X66FRjsE.js → agent-config-section-CO-Bl7d7.js} +1 -1
- package/web/dist/assets/{agent-defaults-section-EEYiGk_Q.js → agent-defaults-section-C90pO0nt.js} +1 -1
- package/web/dist/assets/{appearance-D4I-ANZ_.js → appearance-dgwYTY63.js} +1 -1
- package/web/dist/assets/{archive-on-merge-field-D6y7pCov.js → archive-on-merge-field-DJZVhb_I.js} +1 -1
- package/web/dist/assets/{automations-route-4ahsnx6z.js → automations-route-BhSkU9kZ.js} +2 -2
- package/web/dist/assets/{command-ppU3xBNs.js → command-BMMjB5k9.js} +1 -1
- package/web/dist/assets/{commit-list-Dp0c_x8b.js → commit-list-mYh1t3BD.js} +1 -1
- package/web/dist/assets/{design-icons-CzEoMH9c.js → design-icons-BZt8Kqs9.js} +1 -1
- package/web/dist/assets/{dialog-DXCws12U.js → dialog-CB9ZhEk2.js} +1 -1
- package/web/dist/assets/{diff-n7BcLjSi.js → diff-B4l1BaZJ.js} +2 -2
- package/web/dist/assets/{diff-controls-7hWjGeWp.js → diff-controls-Bs58JOMz.js} +1 -1
- package/web/dist/assets/{diff-view-CJNrRCRI.js → diff-view-BGwOGavy.js} +1 -1
- package/web/dist/assets/{discard-changes-dialog-Bd3w4xOW.js → discard-changes-dialog-Cr1vlcjZ.js} +1 -1
- package/web/dist/assets/dropdown-menu-VFda6KAg.js +1 -0
- package/web/dist/assets/{file-preview-DS5j5uFi.js → file-preview-DqopZwES.js} +1 -1
- package/web/dist/assets/{git-toolbar-D5N_Ucqr.js → git-toolbar-pr68yTY4.js} +1 -1
- package/web/dist/assets/github-BY-X8L5Q.js +1 -0
- package/web/dist/assets/{global-activity-route-DqyHJiZz.js → global-activity-route-XkwjlnaD.js} +1 -1
- package/web/dist/assets/index-BOWGArJd.css +1 -0
- package/web/dist/assets/index-I4_drgNu.js +21 -0
- package/web/dist/assets/{markdown-9FIYg1nH.js → markdown-fuaT5ciN.js} +1 -1
- package/web/dist/assets/{open-in-menu-L5v_AQZt.js → open-in-menu-Uw-sJhbG.js} +1 -1
- package/web/dist/assets/{option-select-CYbw9rk4.js → option-select-_tHcMUWt.js} +1 -1
- package/web/dist/assets/{preferences-section-Do1nZwKg.js → preferences-section-Crh_5QfK.js} +1 -1
- package/web/dist/assets/{preview-pane-connected-o7nx7h4-.js → preview-pane-connected-CLWRxEhI.js} +1 -1
- package/web/dist/assets/{project-location-BFN7mvbZ.js → project-location-DmGO5Dqx.js} +1 -1
- package/web/dist/assets/{projects-section-Bq9DzRDF.js → projects-section-CLPN14JX.js} +1 -1
- package/web/dist/assets/{prompt-templates-section-CNa_K7AU.js → prompt-templates-section-CQHpVrcB.js} +2 -2
- package/web/dist/assets/{reference-chip-O8Bfl1Oi.js → reference-chip-Dk69XD7Q.js} +1 -1
- package/web/dist/assets/{remote-settings-notice-CbCCb3QA.js → remote-settings-notice-C8naX_yp.js} +1 -1
- package/web/dist/assets/{repo-git-Dz3fhj6j.js → repo-git-CTSdvalV.js} +1 -1
- package/web/dist/assets/{report-reader-BfsdCLq-.js → report-reader-DJJixZxy.js} +1 -1
- package/web/dist/assets/{report-selection-cuFCCxDW.js → report-selection-BH0M_8bk.js} +1 -1
- package/web/dist/assets/{reports-Df83TkE3.js → reports-DXfywo34.js} +1 -1
- package/web/dist/assets/{resources-section-CKJGgLWa.js → resources-section-CA-D1Vj2.js} +1 -1
- package/web/dist/assets/review-panel-UI6FQQmp.js +11 -0
- package/web/dist/assets/{run-header-BWNapiIC.js → run-header-DDQU9tCB.js} +2 -2
- package/web/dist/assets/select-QO8XlmjU.js +1 -0
- package/web/dist/assets/{session-context-section-CSDtUgJI.js → session-context-section-CTDQl-i5.js} +1 -1
- package/web/dist/assets/{settings-agent-picker-pMZcMiW4.js → settings-agent-picker-DE5zKJtS.js} +1 -1
- package/web/dist/assets/{settings-list-detail-Ch1KMPjr.js → settings-list-detail-DcRsGkGy.js} +1 -1
- package/web/dist/assets/{settings-save-bar-CFkofH5G.js → settings-save-bar-DM7T22Nr.js} +1 -1
- package/web/dist/assets/{settings-shell-B6-ofejE.js → settings-shell-EOUcgx1J.js} +1 -1
- package/web/dist/assets/{sidebar-section-DwcXrxn2.js → sidebar-section-C69ES3GL.js} +1 -1
- package/web/dist/assets/{skills-DD5hhynR.js → skills-DuaNQ6XW.js} +1 -1
- package/web/dist/assets/task-changes-midIkW0D.js +1 -0
- package/web/dist/assets/{task-commits-D8Pzk4b3.js → task-commits-DAT7-sIh.js} +1 -1
- package/web/dist/assets/{task-file-scope-DPJOeknI.js → task-file-scope-BYAH1Mj8.js} +1 -1
- package/web/dist/assets/{task-files-DJnNyynG.js → task-files-CJaZfp0y.js} +1 -1
- package/web/dist/assets/{task-github-item-Di9HWGn6.js → task-github-item-BnoxG2el.js} +1 -1
- package/web/dist/assets/task-thread-fsRo8vgf.js +2 -0
- package/web/dist/assets/{thread-state-B2dX4psn.js → thread-state-T5A2uz_q.js} +1 -1
- package/web/dist/assets/use-hand-to-agent-state-CqiCI37V.css +1 -0
- package/web/dist/assets/use-hand-to-agent-state-Cy6oaj7k.js +1 -0
- package/web/dist/assets/use-path-bases-x6weDx5i.js +1 -0
- package/web/dist/assets/workflows-CwZ1aiR4.js +7 -0
- package/web/dist/assets/{workspace-tools-6fvZHbrZ.js → workspace-tools-0-Yx7SCS.js} +1 -1
- package/web/dist/assets/{worktrees-section-C1fpzChO.js → worktrees-section-Cn8sFOCC.js} +1 -1
- package/web/dist/index.html +9 -9
- package/web/dist/assets/dropdown-menu-B60L-d_4.js +0 -1
- package/web/dist/assets/github-Bhj0PA8h.js +0 -1
- package/web/dist/assets/index-UMSYsh9P.css +0 -1
- package/web/dist/assets/index-i4Bu7SvU.js +0 -21
- package/web/dist/assets/review-panel-BaUd88ko.js +0 -11
- package/web/dist/assets/select-Cy2NunWj.js +0 -1
- package/web/dist/assets/task-changes-CbWxyOEd.js +0 -1
- package/web/dist/assets/task-thread-gXImKbGN.js +0 -2
- package/web/dist/assets/use-hand-to-agent-state-BHaqyTxa.css +0 -1
- package/web/dist/assets/use-hand-to-agent-state-DhUiLIQg.js +0 -1
- package/web/dist/assets/use-path-bases-BzlzA9bw.js +0 -1
- package/web/dist/assets/workflows-slzqyi2_.js +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-QTnfLwEv.js";import{i as e,t}from"./react-runtime-CCIEwYL0.js";import{o as n}from"./dist-C_rn70hE.js";import{
|
|
1
|
+
import"./rolldown-runtime-QTnfLwEv.js";import{i as e,t}from"./react-runtime-CCIEwYL0.js";import{o as n}from"./dist-C_rn70hE.js";import{pt as r}from"./design-icons-BZt8Kqs9.js";import{t as i}from"./button-C8jUIs8Q.js";import{a,i as o,n as s,o as c,r as l,s as u,t as d}from"./dist--f2yFdPY.js";e();var f=t();function p({...e}){return(0,f.jsx)(d,{"data-slot":`dialog`,...e})}function m({...e}){return(0,f.jsx)(c,{"data-slot":`dialog-portal`,...e})}function h({className:e,...t}){return(0,f.jsx)(a,{"data-slot":`dialog-overlay`,className:n(`fixed inset-0 z-50 bg-black/50 motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 motion-safe:data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function g({className:e,children:t,showCloseButton:i=!0,overlayClassName:a,...o}){return(0,f.jsxs)(m,{"data-slot":`dialog-portal`,children:[(0,f.jsx)(h,{className:a}),(0,f.jsxs)(l,{"data-slot":`dialog-content`,className:n(`fixed inset-bs-[50%] start-[50%] z-50 grid max-h-[calc(100dvh-2rem)] overflow-y-auto overscroll-contain w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-card p-6 shadow-modal duration-200 outline-hidden motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:animate-in data-[state=open]:fade-in-0 motion-safe:data-[state=open]:zoom-in-95 sm:max-w-lg`,e),...o,children:[t,i&&(0,f.jsxs)(s,{"data-slot":`dialog-close`,className:`absolute inset-bs-4 end-4 rounded-sm opacity-70 ring-offset-background transition-opacity pointer-hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[(0,f.jsx)(r,{}),(0,f.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function _({className:e,...t}){return(0,f.jsx)(`div`,{"data-slot":`dialog-header`,className:n(`flex shrink-0 flex-col gap-2 text-center sm:text-start`,e),...t})}function v({className:e,...t}){return(0,f.jsx)(`div`,{"data-slot":`dialog-body`,className:n(`min-h-0 min-w-0 overflow-y-auto overscroll-contain`,e),...t})}function y({className:e,showCloseButton:t=!1,children:r,...a}){return(0,f.jsxs)(`div`,{"data-slot":`dialog-footer`,className:n(`flex shrink-0 flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...a,children:[r,t&&(0,f.jsx)(s,{asChild:!0,children:(0,f.jsx)(i,{variant:`outline`,children:`Close`})})]})}function b({className:e,...t}){return(0,f.jsx)(u,{"data-slot":`dialog-title`,className:n(`text-lg leading-none font-semibold`,e),...t})}function x({className:e,...t}){return(0,f.jsx)(o,{"data-slot":`dialog-description`,className:n(`text-sm text-muted-foreground`,e),...t})}export{y as a,x as i,v as n,_ as o,g as r,b as s,p as t};
|
|
@@ -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{o as r}from"./dist-C_rn70hE.js";import{t as i}from"./preload-helper-Czpn1I53.js";import{t as a}from"./diff-stat-Dy4uLuyP.js";import{n as o,r as s,t as c}from"./image-preview-CeEKI2T5.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 i(()=>import(`./diff-view-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/diff-view-BGwOGavy.js","assets/rolldown-runtime-QTnfLwEv.js","assets/react-runtime-CCIEwYL0.js","assets/dist-C_rn70hE.js","assets/bundle-mjs-rHxsej31.js","assets/chevron-right-BENZ-1ZN.js","assets/createLucideIcon-BHp8sXmF.js","assets/eye-B8okNWXU.js","assets/diff-stat-Dy4uLuyP.js","assets/index-I4_drgNu.js","assets/queries-CIeJg62Y.js","assets/toaster-D0HMoto5.js","assets/live-protocol-DMhTnCmf.js","assets/preload-helper-Czpn1I53.js","assets/chunk-KS7C4IRE-Cg8l-LDN.js","assets/label-CV8tuTOO.js","assets/cez-idle-CdswdDRd.js","assets/run-detail-refresh-DTnwaDy2.js","assets/es2015-CUEfzDjB.js","assets/tasks-table-CvZ2ZyCa.js","assets/attention-V1gJ7gKo.js","assets/task-groups-C9pTQm-2.js","assets/design-icons-BZt8Kqs9.js","assets/open-in-menu-Uw-sJhbG.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/button-C8jUIs8Q.js","assets/dropdown-menu-VFda6KAg.js","assets/dist-BSUJIXeE.js","assets/dist-DudPJH39.js","assets/dist-BuF3mvCA.js","assets/own-lookup-DS54wXvD.js","assets/check-OP-CVgZG.js","assets/chevron-down-CHGyCDBH.js","assets/nav-row-styles-CgP5uNp4.js","assets/folder-browser-BSGB9hhQ.js","assets/loader-circle-CPBhhDbB.js","assets/play-CmVAj_fu.js","assets/reference-chip-Dk69XD7Q.js","assets/popover-CvL6hQ5c.js","assets/dist--f2yFdPY.js","assets/switch-CAKeV99j.js","assets/dist-Czz3Y5qH.js","assets/badge-B6B-xYQQ.js","assets/dialog-CB9ZhEk2.js","assets/project-router-BHFXTx5l.js","assets/status-dot-BXf-Ubd0.js","assets/report-selection-BH0M_8bk.js","assets/use-search-params-writer-ClMScnNe.js","assets/format-BU7D3IfE.js","assets/command-BMMjB5k9.js","assets/project-order-AcHI4Dcl.js","assets/skills-pM_PouEs.js","assets/page-shell-Dky5crRl.js","assets/page-shell-DQPYcKyL.css","assets/agents-settings-path-7X6_cvUg.js","assets/centered-state-BgSV4e79.js","assets/index-BOWGArJd.css","assets/highlighter-Cfo7mLVB.js","assets/image-preview-CeEKI2T5.js","assets/zoomable-image-BUTgYpld.js","assets/markdown-BBDDg-4t.js","assets/markdown-fuaT5ciN.js","assets/chunk-BO2N2NFS-DQrpGzb-.js","assets/lib-DrPFkMXk.js","assets/html-report-BX3msvci.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{o as r}from"./dist-C_rn70hE.js";import{t as i}from"./preload-helper-Czpn1I53.js";import{t as a}from"./diff-stat-Dy4uLuyP.js";import{n as o,r as s,t as c}from"./image-preview-CeEKI2T5.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 i(()=>import(`./diff-view-BGwOGavy.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])),()=>{e=!0}},[]),e.files.length===0?(0,u.jsx)(`p`,{"data-slot":`diff-empty`,className:r(`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:r(`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:i,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:r(`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:i},`${e.oldPath??``}→${e.path}`))]})}function p({file:e,wrap:t,imageSrc:n,onOpenInApp:i}){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:i}):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:r(`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:r(`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-C_rn70hE.js";import{
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{o as t}from"./dist-C_rn70hE.js";import{j as n,v as r}from"./design-icons-BZt8Kqs9.js";import{t as i}from"./createLucideIcon-BHp8sXmF.js";import{t as a}from"./button-C8jUIs8Q.js";import{lr as o}from"./index-I4_drgNu.js";var s=i(`rows-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}]]),c=i(`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`}]]),l=e();function u({mode:e,wrap:t,onModeChange:n,onWrapChange:r,disabled:i=!1}){return(0,l.jsxs)(l.Fragment,{children:[(0,l.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 max-md:hidden`,children:[(0,l.jsx)(h,{current:e,value:`unified`,onModeChange:n,disabled:i}),(0,l.jsx)(h,{current:e,value:`split`,onModeChange:n,disabled:i})]}),(0,l.jsx)(p,{wrap:t,onWrapChange:r,disabled:i})]})}var d=`Unavailable while Markdown preview is on`;function f(){return(0,l.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 p({wrap:e,onWrapChange:n,className:r=`size-11 rounded-lg`,disabled:i=!1}){return(0,l.jsx)(a,{variant:`outline`,size:`icon-sm`,"data-slot":`wrap-toggle`,"aria-pressed":e,"aria-label":`Wrap long lines`,title:i?d:`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,l.jsx)(c,{"aria-hidden":`true`})})}function m({preview:e,onPreviewChange:n}){return(0,l.jsxs)(a,{variant:`outline`,size:`sm`,"data-slot":`markdown-preview-toggle`,"aria-pressed":e,"aria-label":`Preview Markdown`,title:e?`Show Markdown as a diff`:`Preview Markdown`,className:t(`h-11 min-w-11 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,l.jsx)(o,{"aria-hidden":`true`,className:`size-4`}),(0,l.jsx)(`span`,{"aria-hidden":`true`,className:`max-sm:hidden`,children:`Preview MD`})]})}function h({current:e,value:n,onModeChange:i,disabled:a}){let o=e===n;return(0,l.jsxs)(`button`,{type:`button`,"data-mode":n,"aria-pressed":o,disabled:a,title:a?d:void 0,onClick:()=>i(n),className:t(`inline-flex min-h-11 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,l.jsx)(s,{"aria-hidden":`true`,className:`size-4`}):(0,l.jsx)(r,{size:16,"aria-hidden":`true`,className:`size-4`}),n]})}function g({branch:e}){return(0,l.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,l.jsx)(n,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,l.jsx)(`span`,{className:`truncate`,children:e})]})}export{p as a,m as i,u as n,f as r,g 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-C_rn70hE.js";import{t as i}from"./chevron-right-BENZ-1ZN.js";import{t as a}from"./eye-B8okNWXU.js";import{t as o}from"./diff-stat-Dy4uLuyP.js";import{s}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-C_rn70hE.js";import{t as i}from"./chevron-right-BENZ-1ZN.js";import{t as a}from"./eye-B8okNWXU.js";import{t as o}from"./diff-stat-Dy4uLuyP.js";import{s}from"./index-I4_drgNu.js";import{a as c,i as l,r as u}from"./highlighter-Cfo7mLVB.js";import{n as d,r as f,t as p}from"./image-preview-CeEKI2T5.js";import{n as m,t as h}from"./markdown-BBDDg-4t.js";import{t as g}from"./markdown-fuaT5ciN.js";var _=e(t(),1),v=44;function y(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 b(e){return y(e)*20+v}function x(e){return e.reduce((e,t)=>e+y(t),0)}function S(e,t){let n=new URLSearchParams(e).get(`diff`);return n===`flat`||n===`virtual`?n:t>1500?`virtual`:`flat`}function C(e){return`${e.oldPath??``}→${e.path}`}function w(e){let t=0;for(let n of e.split(`
|
|
3
3
|
`))n.length>t&&(t=n.length);return t}var T=/[A-Za-z0-9_]+|\s+|[^\sA-Za-z0-9_]+/g,E=300,D=.3;function O(e,t){if(e===t)return null;let n=e.match(T)??[],r=t.match(T)??[];if(n.length===0||r.length===0||n.length>E||r.length>E)return null;let i=k(n,r),a=r.length+1;return(i[n.length*a+r.length]??0)/Math.max(n.length,r.length)<D?null:A(n,r,i)}function k(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 A(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:j(e,i),add:j(t,a)}}function j(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 M(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 N=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/,P=`… (patch truncated)`;function F(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=N.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(P)){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 I(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 L(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 R(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=O(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 z(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(R(t,i))}else t(i),r++}}function B(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}),z(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 V(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}),z(e,e=>i.push({type:`pair`,left:{line:e},right:{line:e}}),e=>{let t=Math.max(e.dels.length,e.adds.length);for(let n=0;n<t;n++){let t=e.dels[n],r=e.adds[n];i.push({type:`pair`,...t?{left:{line:t,spans:e.delSpans[n]}}:{},...r?{right:{line:r,spans:e.addSpans[n]}}:{}})}})}),a(e.length),i}var H=n();function U({file:e,loadFileText:t,imageSrc:n}){let r=(0,_.useMemo)(()=>W(e),[e]),i=(0,_.useRef)(t);i.current=t;let a=(0,_.useRef)(n);a.current=n;let o=t!==void 0,[s,c]=(0,_.useState)(null);(0,_.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,_.useCallback)(t=>{let n=a.current,r=n?m(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,H.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,H.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,H.jsx)(`div`,{"data-slot":`diff-markdown-preview`,className:`px-4 py-5 md:px-6`,children:(0,H.jsxs)(`div`,{className:`mx-auto max-w-[72ch]`,children:[f?(0,H.jsx)(`p`,{className:`mb-4 text-xs text-muted-foreground`,children:f}):null,(0,H.jsx)(g,{document:!0,imageSrc:l,children:d??r.text})]})})}function W(e){let t=F(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-Bd3w4xOW.js → discard-changes-dialog-Cr1vlcjZ.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{Gt as t,Jt as n,Kt as r,Wt as i,Xt as a,Yt as o,Zt as s,qt as c}from"./index-
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{Gt as t,Jt as n,Kt as r,Wt as i,Xt as a,Yt as o,Zt as s,qt as c}from"./index-I4_drgNu.js";var l=e();function u({open:e,subject:u,onKeep:d,onDiscard:f}){return(0,l.jsx)(i,{open:e,onOpenChange:e=>!e&&d(),children:(0,l.jsxs)(c,{"data-slot":`discard-changes-dialog`,className:`sm:max-w-[560px]`,children:[(0,l.jsxs)(a,{children:[(0,l.jsx)(s,{children:`Discard unsaved changes?`}),(0,l.jsxs)(n,{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)(o,{children:[(0,l.jsx)(r,{"data-slot":`discard-changes-keep`,children:`Keep editing`}),(0,l.jsx)(t,{"data-slot":`discard-changes-confirm`,className:`bg-danger text-danger-foreground hover:brightness-[0.96]`,onClick:f,children:`Discard changes`})]})]})})}export{u as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{a as r,c as i,n as a,o}from"./dist-C_rn70hE.js";import{d as s,h as c,l}from"./design-icons-BZt8Kqs9.js";import{a as u,c as d,d as f,f as p,g as m,h,i as g,l as _,m as v,n as y,o as ee,p as b,r as x,t as S,u as C}from"./es2015-CUEfzDjB.js";import{n as w,t as T}from"./dist-BSUJIXeE.js";import{a as E,i as D,n as O,r as te,t as ne}from"./dist-DudPJH39.js";var k=e(t(),1),A=!1;function j(){let[e,t]=k.useState(A);return k.useEffect(()=>{A||(A=!0,t(!0))},[]),e}var re=k.useSyncExternalStore;function M(){return()=>{}}function N(){return re(M,()=>!0,()=>!1)}var P=typeof re==`function`?N:j,F=n(),I=`rovingFocusGroup.onEntryFocus`,ie={bubbles:!1,cancelable:!0},L=`RovingFocusGroup`,[R,ae,oe]=w(L),[se,ce]=v(L,[oe]),[le,ue]=se(L),de=k.forwardRef((e,t)=>(0,F.jsx)(R.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,F.jsx)(R.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,F.jsx)(fe,{...e,ref:t})})}));de.displayName=L;var fe=k.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:i,loop:a=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:p=!1,...m}=e,g=k.useRef(null),_=r(t,g),v=T(o),[y,ee]=f({prop:s,defaultProp:c??null,onChange:l,caller:L}),[x,S]=k.useState(!1),C=d(u),w=ae(n),E=k.useRef(!1),[D,O]=k.useState(0);return k.useEffect(()=>{let e=g.current;if(e)return e.addEventListener(I,C),()=>e.removeEventListener(I,C)},[C]),(0,F.jsx)(le,{scope:n,orientation:i,dir:v,loop:a,currentTabStopId:y,onItemFocus:k.useCallback(e=>ee(e),[ee]),onItemShiftTab:k.useCallback(()=>S(!0),[]),onFocusableItemAdd:k.useCallback(()=>O(e=>e+1),[]),onFocusableItemRemove:k.useCallback(()=>O(e=>e-1),[]),children:(0,F.jsx)(h.div,{tabIndex:x||D===0?-1:0,"data-orientation":i,...m,ref:_,style:{outline:`none`,...e.style},onMouseDown:b(e.onMouseDown,()=>{E.current=!0}),onFocus:b(e.onFocus,e=>{let t=!E.current;if(e.target===e.currentTarget&&t&&!x){let t=new CustomEvent(I,ie);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=w().filter(e=>e.focusable);ve([e.find(e=>e.active),e.find(e=>e.id===y),...e].filter(Boolean).map(e=>e.ref.current),p)}}E.current=!1}),onBlur:b(e.onBlur,()=>S(!1))})})}),pe=`RovingFocusGroupItem`,me=k.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=_(),l=a||c,u=ue(pe,n),d=u.currentTabStopId===l,f=ae(n),{onFocusableItemAdd:m,onFocusableItemRemove:g,currentTabStopId:v}=u,y=P();return p(()=>{if(!(!y||!r))return m(),()=>g()},[y,r,m,g]),k.useEffect(()=>{if(!(y||!r))return m(),()=>g()},[y,r,m,g]),(0,F.jsx)(R.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,F.jsx)(h.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:b(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:b(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:b(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=_e(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?ye(n,r+1):n.slice(r+1)}setTimeout(()=>ve(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:v!=null}):o})})});me.displayName=pe;var he={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function ge(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function _e(e,t,n){let r=ge(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return he[r]}function ve(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function ye(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var be=de,xe=me,Se=[`Enter`,` `],Ce=[`ArrowDown`,`PageUp`,`Home`],we=[`ArrowUp`,`PageDown`,`End`],Te=[...Ce,...we],Ee={ltr:[...Se,`ArrowRight`],rtl:[...Se,`ArrowLeft`]},De={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},z=`Menu`,[B,Oe,ke]=w(z),[V,Ae]=v(z,[ke,E,ce]),H=E(),je=ce(),[Me,U]=V(z),[Ne,W]=V(z),Pe=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=H(t),[c,l]=k.useState(null),u=k.useRef(!1),f=d(a),p=T(i);return k.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),k.useEffect(()=>{if(!n)return;let e=()=>f(!1);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,f]),(0,F.jsx)(D,{...s,children:(0,F.jsx)(Me,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:l,children:(0,F.jsx)(Ne,{scope:t,onClose:k.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:u,dir:p,modal:o,children:r})})})};Pe.displayName=z;var Fe=`MenuAnchor`,G=k.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=H(n);return(0,F.jsx)(ne,{...i,...r,ref:t})});G.displayName=Fe;var Ie=`MenuPortal`,[Le,Re]=V(Ie,{forceMount:void 0}),ze=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=U(Ie,t);return(0,F.jsx)(Le,{scope:t,forceMount:n,children:(0,F.jsx)(C,{present:n||a.open,children:(0,F.jsx)(g,{asChild:!0,container:i,children:r})})})};ze.displayName=Ie;var K=`MenuContent`,[Be,Ve]=V(K),He=k.forwardRef((e,t)=>{let n=Re(K,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=U(K,e.__scopeMenu),o=W(K,e.__scopeMenu);return(0,F.jsx)(B.Provider,{scope:e.__scopeMenu,children:(0,F.jsx)(C,{present:r||a.open,children:(0,F.jsx)(B.Slot,{scope:e.__scopeMenu,children:o.modal?(0,F.jsx)(Ue,{...i,ref:t}):(0,F.jsx)(We,{...i,ref:t})})})})}),Ue=k.forwardRef((e,t)=>{let n=U(K,e.__scopeMenu),i=k.useRef(null),a=r(t,i);return k.useEffect(()=>{let e=i.current;if(e)return S(e)},[]),(0,F.jsx)(Ke,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:b(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),We=k.forwardRef((e,t)=>{let n=U(K,e.__scopeMenu);return(0,F.jsx)(Ke,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Ge=a(`MenuContent.ScrollLock`),Ke=k.forwardRef((e,t)=>{let{__scopeMenu:n,loop:i=!1,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:c,onEntryFocus:l,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:h,disableOutsideScroll:g,..._}=e,v=U(K,n),S=W(K,n),C=H(n),w=je(n),T=Oe(n),[E,D]=k.useState(null),O=k.useRef(null),ne=r(t,O,v.onContentChange),A=k.useRef(0),j=k.useRef(``),re=k.useRef(0),M=k.useRef(null),N=k.useRef(`right`),P=k.useRef(0),I=g?y:k.Fragment,ie=g?{as:Ge,allowPinchZoom:!0}:void 0,L=e=>{let t=j.current+e,n=T().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=Et(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){j.current=t,window.clearTimeout(A.current),t!==``&&(A.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};k.useEffect(()=>()=>window.clearTimeout(A.current),[]),x();let R=k.useCallback(e=>N.current===M.current?.side&&Ot(e,M.current?.area),[]);return(0,F.jsx)(Be,{scope:n,searchRef:j,onItemEnter:k.useCallback(e=>{R(e)&&e.preventDefault()},[R]),onItemLeave:k.useCallback(e=>{R(e)||(O.current?.focus(),D(null))},[R]),onTriggerLeave:k.useCallback(e=>{R(e)&&e.preventDefault()},[R]),pointerGraceTimerRef:re,onPointerGraceIntentChange:k.useCallback(e=>{M.current=e},[]),children:(0,F.jsx)(I,{...ie,children:(0,F.jsx)(u,{asChild:!0,trapped:a,onMountAutoFocus:b(o,e=>{e.preventDefault(),O.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:(0,F.jsx)(ee,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:h,children:(0,F.jsx)(be,{asChild:!0,...w,dir:S.dir,orientation:`vertical`,loop:i,currentTabStopId:E,onCurrentTabStopIdChange:D,onEntryFocus:b(l,e=>{S.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,F.jsx)(te,{role:`menu`,"aria-orientation":`vertical`,"data-state":St(v.open),"data-radix-menu-content":``,dir:S.dir,...C,..._,ref:ne,style:{outline:`none`,..._.style},onKeyDown:b(_.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&L(e.key));let i=O.current;if(e.target!==i||!Te.includes(e.key))return;e.preventDefault();let a=T().filter(e=>!e.disabled).map(e=>e.ref.current);we.includes(e.key)&&a.reverse(),wt(a)}),onBlur:b(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(A.current),j.current=``)}),onPointerMove:b(e.onPointerMove,Z(e=>{let t=e.target,n=P.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>P.current?`right`:`left`;N.current=t,P.current=e.clientX}}))})})})})})})});He.displayName=K;var qe=`MenuGroup`,Je=k.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,F.jsx)(h.div,{role:`group`,...r,ref:t})});Je.displayName=qe;var Ye=`MenuLabel`,Xe=k.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,F.jsx)(h.div,{...r,ref:t})});Xe.displayName=Ye;var q=`MenuItem`,Ze=`menu.itemSelect`,J=k.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:i,...a}=e,o=k.useRef(null),s=W(q,e.__scopeMenu),c=Ve(q,e.__scopeMenu),l=r(t,o),u=k.useRef(!1),d=()=>{let e=o.current;if(!n&&e){let t=new CustomEvent(Ze,{bubbles:!0,cancelable:!0});e.addEventListener(Ze,e=>i?.(e),{once:!0}),m(e,t),t.defaultPrevented?u.current=!1:s.onClose()}};return(0,F.jsx)(Qe,{...a,ref:l,disabled:n,onClick:b(e.onClick,d),onPointerDown:t=>{e.onPointerDown?.(t),u.current=!0},onPointerUp:b(e.onPointerUp,e=>{u.current||e.currentTarget?.click()}),onKeyDown:b(e.onKeyDown,e=>{n||e.target!==e.currentTarget||c.searchRef.current!==``&&e.key===` `||Se.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});J.displayName=q;var Qe=k.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:i=!1,textValue:a,...o}=e,s=Ve(q,n),c=je(n),l=k.useRef(null),u=r(t,l),[d,f]=k.useState(!1),[p,m]=k.useState(``);return k.useEffect(()=>{let e=l.current;e&&m((e.textContent??``).trim())},[o.children]),(0,F.jsx)(B.ItemSlot,{scope:n,disabled:i,textValue:a??p,children:(0,F.jsx)(xe,{asChild:!0,...c,focusable:!i,children:(0,F.jsx)(h.div,{role:`menuitem`,"data-highlighted":d?``:void 0,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,...o,ref:u,onPointerMove:b(e.onPointerMove,Z(e=>{i?s.onItemLeave(e):(s.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:b(e.onPointerLeave,Z(e=>s.onItemLeave(e))),onFocus:b(e.onFocus,()=>f(!0)),onBlur:b(e.onBlur,()=>f(!1))})})})}),$e=`MenuCheckboxItem`,et=k.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,F.jsx)(ct,{scope:e.__scopeMenu,checked:n,children:(0,F.jsx)(J,{role:`menuitemcheckbox`,"aria-checked":X(n)?`mixed`:n,...i,ref:t,"data-state":Ct(n),onSelect:b(i.onSelect,()=>r?.(X(n)?!0:!n),{checkForDefaultPrevented:!1})})})});et.displayName=$e;var tt=`MenuRadioGroup`,[nt,rt]=V(tt,{value:void 0,onValueChange:()=>{}}),it=k.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=d(r);return(0,F.jsx)(nt,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,F.jsx)(Je,{...i,ref:t})})});it.displayName=tt;var at=`MenuRadioItem`,ot=k.forwardRef((e,t)=>{let{value:n,...r}=e,i=rt(at,e.__scopeMenu),a=n===i.value;return(0,F.jsx)(ct,{scope:e.__scopeMenu,checked:a,children:(0,F.jsx)(J,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":Ct(a),onSelect:b(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});ot.displayName=at;var st=`MenuItemIndicator`,[ct,lt]=V(st,{checked:!1}),ut=k.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=lt(st,n);return(0,F.jsx)(C,{present:r||X(a.checked)||a.checked===!0,children:(0,F.jsx)(h.span,{...i,ref:t,"data-state":Ct(a.checked)})})});ut.displayName=st;var dt=`MenuSeparator`,ft=k.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,F.jsx)(h.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});ft.displayName=dt;var pt=`MenuArrow`,mt=k.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=H(n);return(0,F.jsx)(O,{...i,...r,ref:t})});mt.displayName=pt;var ht=`MenuSub`,[gt,_t]=V(ht),vt=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=U(ht,t),o=H(t),[s,c]=k.useState(null),[l,u]=k.useState(null),f=d(i);return k.useEffect(()=>(a.open===!1&&f(!1),()=>f(!1)),[a.open,f]),(0,F.jsx)(D,{...o,children:(0,F.jsx)(Me,{scope:t,open:r,onOpenChange:f,content:l,onContentChange:u,children:(0,F.jsx)(gt,{scope:t,contentId:_(),triggerId:_(),trigger:s,onTriggerChange:c,children:n})})})};vt.displayName=ht;var Y=`MenuSubTrigger`,yt=k.forwardRef((e,t)=>{let n=U(Y,e.__scopeMenu),i=W(Y,e.__scopeMenu),a=_t(Y,e.__scopeMenu),o=Ve(Y,e.__scopeMenu),s=k.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:l}=o,u={__scopeMenu:e.__scopeMenu},d=k.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);k.useEffect(()=>d,[d]),k.useEffect(()=>{let e=c.current;return()=>{window.clearTimeout(e),l(null)}},[c,l]);let f=r(t,a.onTriggerChange);return(0,F.jsx)(G,{asChild:!0,...u,children:(0,F.jsx)(Qe,{id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?a.contentId:void 0,"data-state":St(n.open),...e,ref:f,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:b(e.onPointerMove,Z(t=>{o.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(o.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:b(e.onPointerLeave,Z(e=>{d();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,a=i?-5:5,s=t[i?`left`:`right`],l=t[i?`right`:`left`];o.onPointerGraceIntentChange({area:[{x:e.clientX+a,y:e.clientY},{x:s,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:s,y:t.bottom}],side:r}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(e),e.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:b(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||o.searchRef.current!==``&&t.key===` `||Ee[i.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});yt.displayName=Y;var bt=`MenuSubContent`,xt=k.forwardRef((e,t)=>{let n=Re(K,e.__scopeMenu),{forceMount:i=n.forceMount,align:a=`start`,...o}=e,s=U(K,e.__scopeMenu),c=W(K,e.__scopeMenu),l=_t(bt,e.__scopeMenu),u=k.useRef(null),d=r(t,u);return(0,F.jsx)(B.Provider,{scope:e.__scopeMenu,children:(0,F.jsx)(C,{present:i||s.open,children:(0,F.jsx)(B.Slot,{scope:e.__scopeMenu,children:(0,F.jsx)(Ke,{id:l.contentId,"aria-labelledby":l.triggerId,...o,ref:d,align:a,side:c.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{c.isUsingKeyboardRef.current&&u.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:b(e.onFocusOutside,e=>{e.target!==l.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:b(e.onEscapeKeyDown,e=>{c.onClose(),e.preventDefault()}),onKeyDown:b(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=De[c.dir].includes(e.key);t&&n&&(s.onOpenChange(!1),l.trigger?.focus(),e.preventDefault())})})})})})});xt.displayName=bt;function St(e){return e?`open`:`closed`}function X(e){return e===`indeterminate`}function Ct(e){return X(e)?`indeterminate`:e?`checked`:`unchecked`}function wt(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Tt(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Et(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Tt(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Dt(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function Ot(e,t){return t?Dt({x:e.clientX,y:e.clientY},t):!1}function Z(e){return t=>t.pointerType===`mouse`?e(t):void 0}var kt=Pe,At=G,jt=ze,Mt=He,Nt=Je,Pt=Xe,Ft=J,It=et,Lt=it,Rt=ot,zt=ut,Bt=ft,Vt=mt,Ht=vt,Ut=yt,Wt=xt,Q=`DropdownMenu`,[Gt,Kt]=v(Q,[Ae]),$=Ae(),[qt,Jt]=Gt(Q),Yt=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=$(t),l=k.useRef(null),[u,d]=f({prop:i,defaultProp:a??!1,onChange:o,caller:Q});return(0,F.jsx)(qt,{scope:t,triggerId:_(),triggerRef:l,contentId:_(),open:u,onOpenChange:d,onOpenToggle:k.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,F.jsx)(kt,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};Yt.displayName=Q;var Xt=`DropdownMenuTrigger`,Zt=k.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:i=!1,...a}=e,o=Jt(Xt,n),s=$(n),c=r(t,o.triggerRef);return(0,F.jsx)(At,{asChild:!0,...s,children:(0,F.jsx)(h.button,{type:`button`,id:o.triggerId,"aria-haspopup":`menu`,"aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?`open`:`closed`,"data-disabled":i?``:void 0,disabled:i,...a,ref:c,onPointerDown:b(e.onPointerDown,e=>{!i&&e.button===0&&e.ctrlKey===!1&&(o.onOpenToggle(),o.open||e.preventDefault())}),onKeyDown:b(e.onKeyDown,e=>{i||([`Enter`,` `].includes(e.key)&&o.onOpenToggle(),e.key===`ArrowDown`&&o.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});Zt.displayName=Xt;var Qt=`DropdownMenuPortal`,$t=e=>{let{__scopeDropdownMenu:t,...n}=e,r=$(t);return(0,F.jsx)(jt,{...r,...n})};$t.displayName=Qt;var en=`DropdownMenuContent`,tn=k.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Jt(en,n),a=$(n),o=k.useRef(!1);return(0,F.jsx)(Mt,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:b(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:b(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});tn.displayName=en;var nn=`DropdownMenuGroup`,rn=k.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,F.jsx)(Nt,{...i,...r,ref:t})});rn.displayName=nn;var an=`DropdownMenuLabel`,on=k.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,F.jsx)(Pt,{...i,...r,ref:t})});on.displayName=an;var sn=`DropdownMenuItem`,cn=k.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,F.jsx)(Ft,{...i,...r,ref:t})});cn.displayName=sn;var ln=`DropdownMenuCheckboxItem`,un=k.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,F.jsx)(It,{...i,...r,ref:t})});un.displayName=ln;var dn=`DropdownMenuRadioGroup`,fn=k.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,F.jsx)(Lt,{...i,...r,ref:t})});fn.displayName=dn;var pn=`DropdownMenuRadioItem`,mn=k.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,F.jsx)(Rt,{...i,...r,ref:t})});mn.displayName=pn;var hn=`DropdownMenuItemIndicator`,gn=k.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,F.jsx)(zt,{...i,...r,ref:t})});gn.displayName=hn;var _n=`DropdownMenuSeparator`,vn=k.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,F.jsx)(Bt,{...i,...r,ref:t})});vn.displayName=_n;var yn=`DropdownMenuArrow`,bn=k.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,F.jsx)(Vt,{...i,...r,ref:t})});bn.displayName=yn;var xn=e=>{let{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:a}=e,o=$(t),[s,c]=f({prop:r,defaultProp:a??!1,onChange:i,caller:`DropdownMenuSub`});return(0,F.jsx)(Ht,{...o,open:s,onOpenChange:c,children:n})},Sn=`DropdownMenuSubTrigger`,Cn=k.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,F.jsx)(Ut,{...i,...r,ref:t})});Cn.displayName=Sn;var wn=`DropdownMenuSubContent`,Tn=k.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,F.jsx)(Wt,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Tn.displayName=wn;var En=Yt,Dn=Zt,On=$t,kn=tn,An=on,jn=cn,Mn=un,Nn=fn,Pn=mn,Fn=gn,In=vn,Ln=xn,Rn=Cn,zn=Tn;function Bn({...e}){return(0,F.jsx)(En,{"data-slot":`dropdown-menu`,...e})}function Vn({...e}){return(0,F.jsx)(On,{"data-slot":`dropdown-menu-portal`,...e})}function Hn({...e}){return(0,F.jsx)(Dn,{"data-slot":`dropdown-menu-trigger`,...e})}function Un({className:e,sideOffset:t=4,...n}){return(0,F.jsx)(On,{children:(0,F.jsx)(kn,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:o(`z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] max-w-(--radix-dropdown-menu-content-available-width) [overflow-wrap:anywhere] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=left]:slide-in-from-right-2 motion-safe:data-[side=right]:slide-in-from-left-2 motion-safe:data-[side=top]:slide-in-from-bottom-2 motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:animate-in data-[state=open]:fade-in-0 motion-safe:data-[state=open]:zoom-in-95`,e),...n})})}function Wn({className:e,inset:t,variant:n=`default`,...r}){return(0,F.jsx)(jn,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:o(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:ps-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!`,e),...r})}function Gn({className:e,children:t,checked:n,...r}){return(0,F.jsxs)(Mn,{"data-slot":`dropdown-menu-checkbox-item`,className:o(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pe-2 ps-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...i({checked:n}),...r,children:[(0,F.jsx)(`span`,{className:`pointer-events-none absolute start-2 flex size-3.5 items-center justify-center`,children:(0,F.jsx)(Fn,{children:(0,F.jsx)(l,{className:`size-4`})})}),t]})}function Kn({...e}){return(0,F.jsx)(Nn,{"data-slot":`dropdown-menu-radio-group`,...e})}function qn({className:e,children:t,...n}){return(0,F.jsxs)(Pn,{"data-slot":`dropdown-menu-radio-item`,className:o(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pe-2 ps-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...n,children:[(0,F.jsx)(`span`,{className:`pointer-events-none absolute start-2 flex size-3.5 items-center justify-center`,children:(0,F.jsx)(Fn,{children:(0,F.jsx)(c,{className:`size-2 fill-current`})})}),t]})}function Jn({className:e,inset:t,...n}){return(0,F.jsx)(An,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:o(`px-2 py-1.5 text-sm font-medium data-[inset]:ps-8`,e),...n})}function Yn({className:e,...t}){return(0,F.jsx)(In,{"data-slot":`dropdown-menu-separator`,className:o(`-mx-1 my-1 h-px bg-border`,e),...t})}function Xn({...e}){return(0,F.jsx)(Ln,{"data-slot":`dropdown-menu-sub`,...e})}function Zn({className:e,inset:t,children:n,...r}){return(0,F.jsxs)(Rn,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":t,className:o(`flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset]:ps-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...r,children:[n,(0,F.jsx)(s,{className:`ms-auto size-4`})]})}function Qn({className:e,...t}){return(0,F.jsx)(zn,{"data-slot":`dropdown-menu-sub-content`,className:o(`z-50 min-w-[8rem] max-w-(--radix-dropdown-menu-content-available-width) [overflow-wrap:anywhere] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=left]:slide-in-from-right-2 motion-safe:data-[side=right]:slide-in-from-left-2 motion-safe:data-[side=top]:slide-in-from-bottom-2 motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:animate-in data-[state=open]:fade-in-0 motion-safe:data-[state=open]:zoom-in-95`,e),...t})}export{Jn as a,qn as c,Qn as d,Zn as f,Wn as i,Yn as l,Gn as n,Vn as o,Hn as p,Un as r,Kn as s,Bn as t,Xn as u};
|
|
@@ -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{o as r}from"./dist-C_rn70hE.js";import{et as i}from"./queries-CIeJg62Y.js";import{Fn as a,Ht as o}from"./toaster-D0HMoto5.js";import{f as s,p as c}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{
|
|
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-C_rn70hE.js";import{et as i}from"./queries-CIeJg62Y.js";import{Fn as a,Ht as o}from"./toaster-D0HMoto5.js";import{f as s,p as c}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{T as l,st as u}from"./design-icons-BZt8Kqs9.js";import{t as d}from"./createLucideIcon-BHp8sXmF.js";import{a as f}from"./diff-controls-Bs58JOMz.js";import{t as p}from"./centered-state-BgSV4e79.js";import{a as m,i as h,r as g}from"./highlighter-Cfo7mLVB.js";import{n as _,t as v}from"./markdown-fuaT5ciN.js";import{r as y}from"./html-report-BX3msvci.js";import{t as b}from"./html-report-frame-Ck76gKfA.js";var x=d(`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`}]]),S=d(`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`}]]),C=d(`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`}]]),w=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`bmp`,`ico`,`avif`]);function T(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n<=0?!1:w.has(t.slice(n+1).toLowerCase())}function E(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return T(e)||n>0&&t.slice(n+1).toLowerCase()===`svg`}var D=e(t(),1);function O(e){return e.tooLarge?`too-large`:E(e.path)?`image`:e.binary?`binary`:`text`}function k(e){return e>=1024**2?`${(e/1024**2).toFixed(1)} MB`:e>=1024?`${(e/1024).toFixed(1)} kB`:`${e} B`}var A=n();function j({runId:e,path:t,className:n}){let r=i(e,t??void 0);if(t===null)return(0,A.jsx)(R,{className:n,children:(0,A.jsx)(p,{icon:(0,A.jsx)(l,{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(r.isPending)return(0,A.jsx)(R,{className:n,children:(0,A.jsxs)(`p`,{"data-slot":`file-preview-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground`,children:[`Loading `,t,`…`]})});if(r.isError){let e=r.error instanceof a&&r.error.status===409;return(0,A.jsx)(R,{className:n,children:(0,A.jsx)(p,{icon:e?(0,A.jsx)(C,{}):(0,A.jsx)(u,{size:16}),tone:e?`neutral`:`danger`,heading:`h2`,title:e?`Cannot preview this file`:`Could not load this file`,subtitle:r.error.message})})}return r.data.type===`file`?(0,A.jsx)(P,{runId:e,entry:r.data,className:n}):(0,A.jsx)(R,{className:n,children:(0,A.jsx)(p,{icon:(0,A.jsx)(S,{}),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 M(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 N(e,t,n){let r=t&&/\.(?:md|markdown)$/i.test(e.path),i=t&&y(e.path),a=/\.(?:png|jpe?g|gif|webp|bmp|ico|avif)$/i.test(e.path),o=t&&a&&e.size<=10*1024*1024?`image`:O(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 P({runId:e,entry:t,displayPath:n,className:i,imageUrl:a,downloadUrl:o,snapshot:s,readerHref:c,documentPreview:l=!1}){let[u,d]=(0,D.useState)(!1),[p,m]=(0,D.useState)(!0),h=n??M(t.path),g=N(t,l,u),_=!!(s||o||g.toggle),v=!g.showImage&&g.kind===`text`&&g.rendered===null;return(0,A.jsxs)(R,{className:i,children:[(0,A.jsxs)(`header`,{"data-slot":`file-preview-head`,className:r(`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,A.jsx)(`span`,{className:`min-w-0 truncate font-mono font-medium text-foreground`,title:h,children:h}),(0,A.jsx)(`span`,{"data-slot":`file-preview-size`,className:`ml-auto shrink-0 font-mono text-xs tabular-nums text-muted-foreground`,children:k(t.size)}),v?(0,A.jsx)(f,{wrap:p,onWrapChange:m,className:`size-8 rounded-md max-md:size-11 pointer-coarse:size-11`}):null]}),_?(0,A.jsx)(I,{snapshot:s,downloadUrl:o,source:g.toggle?u:null,onSource:()=>d(e=>!e),readerHref:g.html&&g.kind===`text`?c:void 0}):null,(0,A.jsx)(F,{runId:e,entry:t,kind:g.kind,showImage:g.showImage,rendered:g.rendered,imageUrl:a,wrap:p})]})}function F({runId:e,entry:t,kind:n,showImage:r,rendered:i,imageUrl:a,wrap:s}){return r?(0,A.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,A.jsx)(`img`,{"data-slot":`file-preview-image`,src:a??o(e,t.path),alt:t.path,className:`max-h-[70vh] max-w-full rounded-sm`})}):n===`too-large`?(0,A.jsx)(p,{icon:(0,A.jsx)(x,{}),tone:`neutral`,heading:`h2`,title:`Too large to preview`,subtitle:`${k(t.size)} — past the preview cap. Open it in your editor instead.`}):n===`binary`?(0,A.jsx)(p,{icon:(0,A.jsx)(S,{}),tone:`neutral`,heading:`h2`,title:`Binary file`,subtitle:`${k(t.size)} of binary data — no text preview.`}):i===`markdown`?(0,A.jsx)(`div`,{className:`p-4`,children:(0,A.jsx)(v,{document:!0,children:t.content??``})}):i===`html`?(0,A.jsx)(b,{html:t.content??``,title:`Report: ${t.path}`,className:`h-[70vh]`}):(0,A.jsx)(V,{path:t.path,text:t.content??``,wrap:s})}function I({snapshot:e,downloadUrl:t,source:n,onSource:r,readerHref:i}){return(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 border-b border-border px-4 py-2 text-xs`,children:[e?(0,A.jsxs)(`span`,{children:[`Published snapshot · `,e]}):null,t?(0,A.jsx)(`a`,{className:`inline-flex min-h-11 items-center text-accent-text underline`,href:t,children:`Download`}):null,n===null?null:(0,A.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,A.jsx)(L,{href:i}):null]})}function L({href:e}){let t=c(),n=s();return(0,A.jsx)(`a`,{className:`inline-flex min-h-11 items-center px-2 text-accent-text underline focus-visible:ring-2`,href:e,onClick:r=>_(r,t,e,n),children:`Open reader`})}function R({className:e,children:t}){return(0,A.jsx)(`section`,{"data-slot":`file-preview`,className:r(`flex flex-col overflow-hidden rounded-lg border border-border bg-card`,e),children:t})}var z=1500;function B(e,t){let n=(0,D.useMemo)(()=>t.split(`
|
|
2
2
|
`).map(e=>[{content:e}]),[t]),r=(0,D.useMemo)(()=>m(e),[e]),i=n.length>z,[a,o]=(0,D.useState)(null);return(0,D.useEffect)(()=>{if(r===null||i)return;let n=!1;return g(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:h(t,r)?.tokens??n}function V({path:e,text:t,wrap:n=!1}){let i=B(e,t);return(0,A.jsx)(`div`,{"data-slot":`file-preview-code`,"data-lang":m(e)??`plaintext`,className:`overflow-x-auto overscroll-x-contain py-2 font-mono text-xs leading-[1.7] [scrollbar-width:thin]`,children:(0,A.jsx)(`div`,{className:n?`min-w-0`:`w-max min-w-full`,children:i.map((e,t)=>(0,A.jsxs)(`div`,{className:`flex`,children:[(0,A.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,A.jsx)(`span`,{className:r(`min-w-0 flex-1 pr-6`,n?`whitespace-pre-wrap wrap-anywhere`:`whitespace-pre`),children:e.map((e,t)=>(0,A.jsx)(`span`,{style:e.color===void 0?void 0:{color:e.color},children:e.content},t))})]},t))})})}export{k as a,S as c,M as i,x as l,P as n,E as o,j as r,C as s,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,s as i}from"./dist-C_rn70hE.js";import{
|
|
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-C_rn70hE.js";import{E as a,I as o,M as s,ct as c,d as l}from"./design-icons-BZt8Kqs9.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-Bs58JOMz.js";import{t as _}from"./square-terminal-B6RYYieR.js";import{t as v}from"./button-C8jUIs8Q.js";import{i as y,p as b,r as x,t as S}from"./dropdown-menu-VFda6KAg.js";import{t as C}from"./diff-stat-Dy4uLuyP.js";var w=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`}]]),T=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`}]]),E=e(t(),1),D=n();function O({root:e,selected:t,onSelect:n}){return(0,D.jsx)(`nav`,{"data-slot":`changes-tree`,"aria-label":`Changed files`,className:`min-w-0 text-[13px]`,children:(0,D.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,D.jsx)(A,{dir:e,depth:0,selected:t,onSelect:n},e.path)),e.files.map(e=>(0,D.jsx)(M,{file:e,depth:0,selected:t,onSelect:n},e.path))]})})}function k({adds:e,dels:t}){return(0,D.jsxs)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-xs font-medium tabular-nums`,children:[e>0?(0,D.jsxs)(`span`,{className:`text-semantic-green`,children:[`+`,e]}):null,e>0&&t>0?` `:null,t>0?(0,D.jsxs)(`span`,{className:`text-semantic-red`,children:[`−`,t]}):null]})}function A({dir:e,depth:t,selected:n,onSelect:i}){let[o,s]=(0,E.useState)(!0);return(0,D.jsxs)(`li`,{children:[(0,D.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,D.jsx)(l,{size:16,"aria-hidden":`true`,className:r(`size-3.5 shrink-0 transition-transform motion-reduce:transition-none`,o&&`rotate-90`)}),(0,D.jsx)(a,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,D.jsx)(`span`,{className:`min-w-0 truncate font-medium`,children:e.name}),(0,D.jsx)(k,{adds:e.adds,dels:e.dels})]}),o?(0,D.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,D.jsx)(A,{dir:e,depth:t+1,selected:n,onSelect:i},e.path)),e.files.map(e=>(0,D.jsx)(M,{file:e,depth:t+1,selected:n,onSelect:i},e.path))]}):null]})}var j={added:`text-semantic-green`,deleted:`text-semantic-red`};function M({file:e,depth:t,selected:n,onSelect:i}){let a=n===e.path;return(0,D.jsx)(`li`,{children:(0,D.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,D.jsx)(T,{"aria-hidden":`true`,className:r(`size-3.5 shrink-0`,j[e.status])}),(0,D.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name}),(0,D.jsx)(k,{adds:e.adds,dels:e.dels})]})})}function N(e,t){return{kind:`dir`,name:e,path:t,dirs:[],files:[],adds:0,dels:0,fileCount:0}}function P(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(P)}}var F=(e,t)=>e.name.localeCompare(t.name);function I(e){let t=N(``,``),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=N(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(F),e.files.sort(F)};return i(t),{...t,dirs:t.dirs.map(P)}}function L({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,D.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]:min-h-11`,children:[(0,D.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2.5`,children:[n?(0,D.jsx)(g,{branch:n}):null,i?(0,D.jsx)(B,{stat:i}):null]}),(0,D.jsxs)(`span`,{className:r(`ml-auto flex items-center gap-1.5`,!u&&`md:hidden`),children:[(0,D.jsx)(`span`,{className:`flex md:hidden`,children:(0,D.jsx)(f,{wrap:o,onWrapChange:l,disabled:_})}),_?(0,D.jsx)(h,{}):null,u?(0,D.jsx)(p,{preview:s,onPreviewChange:u}):null]}),(0,D.jsxs)(`span`,{className:r(`flex items-center gap-2 max-md:w-full`,!u&&`md:ml-auto`),children:[(0,D.jsx)(`span`,{className:`hidden items-center gap-1.5 md:flex`,children:(0,D.jsx)(m,{mode:a,wrap:o,onModeChange:c,onWrapChange:l,disabled:_})}),(0,D.jsx)(`span`,{"aria-hidden":`true`,className:`hidden h-5 w-px bg-border md:block`}),(0,D.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,D.jsx)(z,{action:e,variant:`outline`,onAction:d},e.id)),(0,D.jsx)(z,{action:e.primary,variant:`primary`,onAction:d})]}),e.menu.length>0?(0,D.jsxs)(S,{children:[(0,D.jsx)(b,{asChild:!0,children:(0,D.jsx)(v,{variant:`ghost`,size:`icon-sm`,"aria-label":`More git actions`,className:`max-md:min-w-11 max-md:border max-md:border-border max-md:bg-card`,children:(0,D.jsx)(w,{"aria-hidden":`true`})})}),(0,D.jsx)(x,{align:`end`,"data-slot":`git-toolbar-menu`,children:e.menu.map(e=>(0,D.jsxs)(y,{disabled:!e.enabled,title:e.reason,onSelect:()=>d(e.id),children:[R[e.id],e.label]},e.id))})]}):null]})]})}var R={commit:(0,D.jsx)(s,{size:16,"aria-hidden":`true`}),push:(0,D.jsx)(c,{size:16,"aria-hidden":`true`}),"create-pr":(0,D.jsx)(o,{size:16,"aria-hidden":`true`}),"view-pr":(0,D.jsx)(d,{"aria-hidden":`true`}),"open-terminal":(0,D.jsx)(_,{"aria-hidden":`true`})};function z({action:e,variant:t,onAction:n}){return e.id===`view-pr`?i(e.href)?(0,D.jsx)(v,{asChild:!0,variant:t,size:`sm`,"data-action":e.id,children:(0,D.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,children:[R[e.id],e.label]})}):(0,D.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:[R[e.id],e.label]}):(0,D.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:[R[e.id],e.label]})}function B({stat:e}){return(0,D.jsx)(`span`,{"data-slot":`changes-stat`,children:(0,D.jsx)(C,{stat:{adds:V(e.adds),dels:V(e.dels),files:e.files}})})}function V(e){let[t,n]=(0,E.useState)(e),r=(0,E.useRef)(e);return(0,E.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{O as i,L as n,I as r,B as t};
|
|
@@ -0,0 +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,p as i}from"./dist-C_rn70hE.js";import{M as a,Wt as o,a as s,cn as c,dn as l,i as u,k as d,l as f,o as p,r as m,s as h}from"./queries-CIeJg62Y.js";import{An as g,G as _,I as v,K as y,Si as b,U as x,hi as S,n as C,q as w}from"./toaster-D0HMoto5.js";import{f as T,h as ee}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{I as E,L as D,X as O,Z as te,i as k,l as A,lt as j,m as M,r as ne,st as N,u as P}from"./design-icons-BZt8Kqs9.js";import{t as re}from"./chevron-down-CHGyCDBH.js";import{t as F}from"./chevron-right-BENZ-1ZN.js";import{t as I}from"./loader-circle-CPBhhDbB.js";import{t as ie}from"./play-CmVAj_fu.js";import{t as L}from"./button-C8jUIs8Q.js";import{a as ae,i as oe,n as se,r as R,t as ce}from"./select-QO8XlmjU.js";import{i as z,r as B,t as V}from"./popover-CvL6hQ5c.js";import{r as le,t as H}from"./project-router-BHFXTx5l.js";import"./attention-V1gJ7gKo.js";import{f as ue,v as de}from"./task-groups-C9pTQm-2.js";import{t as fe}from"./status-dot-BXf-Ubd0.js";import{a as pe,o as me,r as he,s as ge,t as _e}from"./command-BMMjB5k9.js";import{c as U,d as W,f as ve,m as ye}from"./page-shell-Dky5crRl.js";import{t as G}from"./centered-state-BgSV4e79.js";import{t as be}from"./use-search-params-writer-ClMScnNe.js";import{An as xe,Bn as Se,Ct as Ce,Dt as we,Et as Te,Ot as Ee,Pn as De,Qn as Oe,Sn as K,St as ke,Tt as Ae,_t as je,bt as Me,ct as Ne,gt as Pe,kt as Fe,r as Ie,s as Le,vt as Re,wt as ze,xt as Be,yt as Ve}from"./index-I4_drgNu.js";import{t as He}from"./markdown-fuaT5ciN.js";import{a as Ue,c as We,d as Ge,f as q,i as Ke,l as qe,m as Je,n as Ye,o as Xe,p as Ze,r as Qe,s as $e,t as et}from"./use-hand-to-agent-state-Cy6oaj7k.js";import{t as tt}from"./tab-link-BYYXdpLn.js";var J=e(t(),1),Y=n();function nt({number:e,repo:t}){let n=i();return(0,Y.jsx)(rt,{number:e,repo:t,scope:n},JSON.stringify([n,t,e]))}function rt({number:e,repo:t,scope:n}){let i=(0,J.useId)(),o=(0,J.useId)(),[s,l]=(0,J.useState)(!1),u=s?re:F,d=c(n,!0,n==="default"),f=a(`#${e}`,!0),p=(0,J.useMemo)(()=>Te(de(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":i,className:r(`mt-4 min-w-0 rounded-lg border border-border`,s?`p-3`:`p-0.5`),children:[(0,Y.jsx)(`h3`,{id:i,className:`text-xs font-semibold text-muted-foreground`,children:(0,Y.jsxs)(`button`,{type:`button`,"aria-expanded":s,"aria-controls":o,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:o,children:s?(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)(L,{variant:`outline`,className:`mt-2 min-h-11`,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=xe(e,g(e));return(0,Y.jsx)(`li`,{children:(0,Y.jsxs)(H,{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:ue(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)(fe,{tone:t.tone,shape:t.shape,pulse:t.pulse,role:`img`,"aria-label":t.label,title:t.label}),e.archived?(0,Y.jsx)(Ie,{"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)(L,{variant:`outline`,className:`mt-2 min-h-11`,onClick:()=>void f.refetch(),disabled:f.isFetching,children:`Retry older linked tasks`})]}):f.hasNextPage?(0,Y.jsx)(L,{variant:`outline`,className:`mt-2 min-h-11`,onClick:()=>void f.fetchNextPage(),disabled:f.isFetchingNextPage,children:f.isFetchingNextPage?`Loading older linked tasks…`:`Show older linked tasks`}):null]}):null})]})}var it=`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 at(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 ot(e,t){return!!e&&t.length===1&&t[0]?.toLowerCase()===e.toLowerCase()}function st(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 ct(e){return[e.viewerLogin?``:`GitHub login unavailable.`,st(e)].filter(Boolean).join(` `)}function lt({options:e,assignees:t,onAssigneesChange:n}){return(0,Y.jsxs)(V,{children:[(0,Y.jsx)(z,{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)(B,{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 ut({data:e,projectId:t,onProjectChange:n,pickerRef:r}){if(e.projects?.length)return(0,Y.jsxs)(ce,{value:t||Z,onValueChange:e=>n(e===Z?``:e),children:[(0,Y.jsx)(oe,{ref:r,"aria-label":`Project board`,"data-slot":`gh-board-filter`,"data-value":t,className:`${X} ${it} justify-between`,children:(0,Y.jsx)(ae,{placeholder:`All boards`})}),(0,Y.jsxs)(se,{align:`start`,children:[(0,Y.jsx)(R,{value:Z,children:`All boards`}),e.projects.map(e=>(0,Y.jsx)(R,{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)(ce,{disabled:!0,value:Z,children:[(0,Y.jsx)(oe,{ref:r,"aria-label":`Project board`,"data-slot":`gh-board-filter`,"data-value":``,className:`${X} ${it} justify-between`,children:(0,Y.jsx)(ae,{placeholder:t,children:t})}),(0,Y.jsx)(se,{align:`start`,children:(0,Y.jsx)(R,{value:Z,children:t})})]})}return null}function dt({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)(V,{open:i,onOpenChange:a,children:[(0,Y.jsx)(z,{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)(O,{size:14,"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}):(0,Y.jsx)(N,{size:14,"aria-hidden":`true`,className:`size-3.5`})})}),(0,Y.jsx)(B,{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 ft({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=at(e.issues,t),f=ot(e.viewerLogin,t),p=ct(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)(lt,{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-foreground aria-pressed:bg-foreground aria-pressed:text-background`,disabled:!e.viewerLogin,"aria-pressed":f,onClick:()=>r(f?[]:[e.viewerLogin]),children:[(0,Y.jsx)(j,{size:14,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),`Assigned to me`]}),(0,Y.jsx)(ut,{data:e,projectId:n,onProjectChange:i,pickerRef:l}),(0,Y.jsx)(dt,{data:e,message:p,lastMessage:h,hasMessage:m,statusOpen:a,setStatusOpen:o,triggerRef:s,contentRef:c})]})}function pt({onRefresh:e,refreshing:t}){let n=Pe(i());return(0,Y.jsx)(W,{route:`github`,density:`full`,headerSpacing:`compact`,header:{title:`GitHub`,secondaryActions:(0,Y.jsx)(U,{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)(O,{size:17,"aria-hidden":`true`,className:r(`size-[17px]`,t&&`motion-safe:animate-spin`)})})},children:(0,Y.jsx)(`div`,{"data-slot":`github-filter-screen`,children:(0,Y.jsx)(je,{model:n,variant:`screen`})})})}function mt({view:e,activeFilter:t,isDesktop:n,rawFilterParam:r,n:i,gh:a,actions:o}){return{headerSlot:`gh-masthead`,title:n?e===`issues`?`Issues`:`Pull requests`:`GitHub`,scope:n?Re[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)(De,{iso:a.syncedAt,prefix:`Synced `}):`Not synced yet`]})]}):void 0,secondaryActions:(0,Y.jsx)(ht,{...o}),headerExtra:r!==null&&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)(H,{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)(ne,{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:[...Me,...Be].find(e=>e.id===t)?.label})]}):void 0}}function ht({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)(U,{variant:`outline`,asChild:!0,children:(0,Y.jsx)(H,{to:`/automations/new`,children:`Set up automations`})}):null,(0,Y.jsxs)(U,{type:`button`,variant:`outline`,"data-slot":`gh-refresh`,title:`Refresh from GitHub`,disabled:t,onClick:n,children:[(0,Y.jsx)(O,{size:16,"aria-hidden":`true`,className:r(`size-3.5`,t&&`motion-safe:animate-spin`)}),`Refresh`]})]})}function gt({view:e,number:t}){return(0,Y.jsx)(G,{icon:e===`issues`?(0,Y.jsx)(M,{size:16}):(0,Y.jsx)(E,{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.`})}function _t({item:e,view:t,filter:n,colors:i,expanded:a,onToggle:s,queuedRunId:c,checks:l,comments:u}){let d=e.kind===`issue`?M:E,f=S(),p=`gh-row-summary-${e.kind}-${e.number}`,m=()=>{f.prefetchQuery({queryKey:o.githubComments(e.kind,e.number),queryFn:({signal:t})=>y(e.kind,e.number,{},{signal:t}),staleTime:6e4})};return(0,Y.jsxs)(`div`,{"data-slot":`gh-row-shell`,"data-expanded":a||void 0,className:r(`rounded-md`,a&&`bg-sidebar-row-selected`),children:[(0,Y.jsxs)(`button`,{type:`button`,draggable:!0,onDragStart:t=>{try{t.dataTransfer.setData(`text/plain`,Qe(e)),t.dataTransfer.effectAllowed=`copy`}catch{}},onMouseEnter:m,onFocus:m,onClick:s,"data-slot":`gh-row`,"data-number":e.number,"data-kind":e.kind,"aria-expanded":a,"aria-controls":a?p:void 0,title:`Drag into the composer to prefill a task`,className:`flex w-full flex-col gap-2 rounded-md px-3 py-4 text-left transition-colors hover:bg-muted focus-visible:outline-2 focus-visible:-outline-offset-2`,children:[(0,Y.jsxs)(`span`,{className:`flex w-full min-w-0 items-start gap-2 md:items-center`,children:[(0,Y.jsx)(d,{"aria-hidden":`true`,"data-slot":`gh-row-icon`,className:r(`mt-0.5 size-3.5 shrink-0 md:mt-0`,e.kind===`issue`?`text-success`:`text-accent-icon`)}),(0,Y.jsx)(`span`,{"data-slot":`gh-row-title`,className:r(`line-clamp-2 min-w-0 flex-1 text-[13px] font-medium md:block md:truncate`,a&&`font-semibold`),children:e.title}),(0,Y.jsx)(P,{"data-slot":`gh-row-cue`,"aria-hidden":`true`,className:r(`mt-0.5 size-4 shrink-0 text-muted-foreground transition-transform motion-reduce:transition-none md:mt-0`,a&&`rotate-180`)})]}),(0,Y.jsxs)(`span`,{"data-slot":`gh-row-meta`,className:`flex flex-wrap items-center gap-x-1.5 gap-y-1 pl-[22px] text-xs text-muted-foreground md:flex-nowrap md:gap-y-0`,children:[(0,Y.jsxs)(`span`,{className:`shrink-0 tabular-nums`,children:[`#`,e.number]}),(0,Y.jsx)(Q,{}),(0,Y.jsx)(`span`,{"data-slot":`gh-row-author`,className:`max-w-full shrink-0 truncate md:min-w-0 md:shrink`,children:e.author}),(0,Y.jsx)(Q,{}),(0,Y.jsx)(De,{iso:e.createdAt,className:`shrink-0`}),u?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Q,{}),(0,Y.jsx)(Xe,{count:u})]}):null,l?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Q,{}),(0,Y.jsx)(Ue,{checks:l})]}):null,c?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Q,{}),(0,Y.jsx)(`span`,{"data-slot":`gh-queued-flag`,className:`shrink-0 font-sans font-medium text-accent-text`,children:`↗ run queued`})]}):null]}),e.labels.length>0&&!a?(0,Y.jsx)(`span`,{"data-slot":`gh-row-labels`,className:`flex flex-wrap gap-1 pl-[22px]`,children:e.labels.map(e=>(0,Y.jsx)(qe,{label:e,color:i[e],plain:!0},e))}):null]}),a?(0,Y.jsx)(vt,{id:p,item:e,colors:i,checks:l,detailPath:Ce(t,n,e.number),queuedRunId:c}):null]})}function vt({id:e,item:t,colors:n,checks:r,detailPath:i,queuedRunId:a}){let o=s(t.kind,t.number),c=(o.data?.detail?.body??t.body)?.trim(),l=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 md:pl-[34px]`,children:[(0,Y.jsx)(`div`,{"data-slot":`gh-row-body`,className:`text-[13px] leading-relaxed text-soft-foreground`,children:c?(0,Y.jsx)(`div`,{className:`line-clamp-3 [overflow-wrap:anywhere]`,children:(0,Y.jsx)(He,{inline:!0,children:c})}):o.isPending?(0,Y.jsx)(Oe,{className:`h-4 w-2/3`}):o.isError||o.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)`})}),t.labels.length>0||r?(0,Y.jsxs)(`div`,{"data-slot":`gh-row-facts`,className:`flex flex-wrap items-center gap-1.5`,children:[t.labels.map(e=>(0,Y.jsx)(qe,{label:e,color:n[e]},e)),r?(0,Y.jsx)(Ke,{checks:r,url:t.url}):null]}):null,(0,Y.jsxs)(`div`,{"data-slot":`gh-row-actions`,className:`flex flex-wrap items-center gap-2`,children:[a?(0,Y.jsx)(L,{asChild:!0,variant:`outline`,size:`sm`,className:`max-md:h-11`,children:(0,Y.jsxs)(H,{to:`/tasks/${a}`,"data-action":`gh-row-view-task`,children:[(0,Y.jsx)(A,{size:16,"aria-hidden":`true`,className:`size-3.5 text-success`}),`Open queued task`]})}):(0,Y.jsx)(L,{asChild:!0,variant:`primary`,size:`sm`,className:`max-md:h-11`,children:(0,Y.jsxs)(H,{to:i,state:{focusHandoff:!0},"data-action":`gh-row-handoff`,title:`Open this ${l} and write the prompt for an agent`,children:[(0,Y.jsx)(ie,{"aria-hidden":`true`,className:`size-3.5`}),`Hand to agent`]})}),(0,Y.jsx)(L,{asChild:!0,variant:`outline`,size:`sm`,className:`max-md:h-11`,children:(0,Y.jsxs)(H,{to:i,"data-action":`gh-row-open`,children:[`Open `,l,(0,Y.jsx)(k,{size:16,"aria-hidden":`true`,className:`size-3.5`})]})})]})]})}function Q(){return(0,Y.jsx)(`span`,{"data-slot":`gh-row-dot`,"aria-hidden":`true`,className:`shrink-0`,children:`·`})}function yt(e){let t=getComputedStyle(e).overflowY;return t===`auto`||t===`scroll`?e:e.closest(`[data-slot="main"]`)??e}function bt(e){let[t,n]=(0,J.useState)(null);return(0,J.useLayoutEffect)(()=>{if(!e){n(null);return}let t=()=>n(yt(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 xt(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 St(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 Ct(e,t,n,r,i){let[a,o]=(0,J.useState)(null),[s,c]=(0,J.useState)(null),l=bt(a),u=(0,J.useRef)(null);u.current=l;let d=xt(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:St(p&&!i&&!t.isFetchingNextPage&&!t.isFetchNextPageError,l,()=>void t.fetchNextPage())}}function wt({item:e,queuedRunId:t}){return t?(0,Y.jsx)(L,{asChild:!0,variant:`outline`,size:`sm`,className:`max-md:h-11 no-hover:h-11`,children:(0,Y.jsxs)(H,{to:`/tasks/${t}`,"data-action":`gh-header-view-task`,children:[(0,Y.jsx)(A,{size:16,"aria-hidden":`true`,className:`size-3.5 text-success`}),`Open queued task`]})}):(0,Y.jsxs)(L,{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`}`,className:`max-md:h-11 no-hover:h-11`,onClick:$,children:[(0,Y.jsx)(ie,{"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 Tt=100;function Et(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>=Tt)break;a.add(t.number)}return[...a]}function Dt(e,t,n,r,i,a){let o=Et(n,e,r,i,a),s=m(o,e===`prs`),c=s.data?.available?s.data.checks:void 0,l=u(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),d=(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]??(d.has(e.number)?void 0:e.comments)}}function Ot(e){let[t,n]=be(),r=t.get(`filter`),i=we(e,r);return{rawFilterParam:r,filter:i,activeFilter:i??`all`,setFilterParam:e=>n(t=>{let n=new URLSearchParams(t);return e===null?n.delete(`filter`):n.set(`filter`,e),n})}}function kt(e,t,{filter:n,activeFilter:r,setFilterParam:i}){let[a,o]=(0,J.useState)(``),[s,c]=(0,J.useState)([]),[l,u]=(0,J.useState)([]),{setProjectFilter:d,activeProject:f}=At(t),p=e===`issues`&&r===`assigned`,m=p?t?.viewerLogin?[t.viewerLogin]:[]:l;return{query:a,setQuery:o,labelFilter:s,setLabelFilter:c,setProjectFilter:d,activeProject:f,isAssignedFilter:p,effectiveAssignees:m,changeAssignees:e=>{u(e),p&&i(`all`)},clearFilters:()=>{o(``),c([]),u([]),d(``),n!==null&&n!==`all`&&i(`all`)},filtering:a.trim()!==``||s.length>0||e===`issues`&&(m.length>0||f!==``)||n!==null&&n!==`all`,narrowing:a.trim()!==``||s.length>0||e===`issues`&&(!p&&l.length>0||f!==``)}}function At(e){let[t,n]=(0,J.useState)(``),r=e?.projectsState===`refreshing`||e?.projectsState===`unavailable`,i=r||e?.projects?.some(e=>e.id===t)?t:``;return(0,J.useEffect)(()=>{e&&!r&&t&&!i&&n(``)},[e,t,i,r]),{setProjectFilter:n,activeProject:i}}function jt(e,t,{filter:n,activeFilter:r},a){let o=i(),s=e===`issues`&&(r===`no-task`||r===`has-task`),l=c(o,s,o==="default"),u=(0,J.useMemo)(()=>l.data?Ae(l.data,t?.repo,o):null,[l.data,t?.repo,o]),d=ze(e,n)?Fe(n):null,p=f(`pr`,d??``,d!==null&&t?.available===!0),m=d!==null&&p.data?.available?p.data.items:null,h=(0,J.useMemo)(()=>t?.available?e===`issues`?t.issues:t.prs:[],[t,e]),g=(0,J.useMemo)(()=>m?Ee(m,h):null,[m,h]),_=Mt({view:e,gh:t,activeFilter:r,isAssignedFilter:a,taskFilter:s,taskNumbers:u,runsQuery:l,backedQuery:d,filterHits:m,filterSearch:p});return{backedQuery:d,filterSearch:p,fullList:h,filterRows:g,filterGate:_,openItems:(0,J.useMemo)(()=>_?[]:g??h,[_,g,h]),narrow:(0,J.useMemo)(()=>e===`issues`?r===`no-task`&&u?{excludeNumbers:u}:r===`has-task`&&u?{includeNumbers:u}:{}:r===`mine`&&t?.viewerLogin?{author:t.viewerLogin}:m?{includeNumbers:new Set(m.map(e=>e.number))}:{},[e,r,u,t?.viewerLogin,m])}}function Mt({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 Nt(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 Pt(e,t,n,{filterGate:r,filterRows:i,fullList:a}){let s=o.github()[0],c=t===void 0?null:Number.parseInt(t,10),l=!r&&n.data?.available?n.data.items.find(e=>e.number===c):void 0,u=i&&c!==null&&!a.some(e=>e.number===c)?i.find(e=>e.number===c):void 0,d=l??u,[f,p]=(0,J.useState)(null);return(0,J.useEffect)(()=>{d&&p({scope:s,view:e,item:d})},[s,e,d]),{selectedNumber:c,remoteDetail:d??(f?.scope===s&&f.view===e&&f.item.number===c?f.item:null)}}function Ft(e,t,n,{fullList:r,filterRows:i},a){let s=S(),c=(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=p(l,n??0,u),f=u&&d.data?.available&&d.data.item?.kind===l?d.data.item:null;c.current=u&&n!==null?{kind:l,number:n,key:o.githubItem(l,n)}:null;let[m,h]=(0,J.useState)(!1);return{exactWanted:u,exactItem:d,exactDetail:f,exactTargetRef:c,retryingExact:m,retryExact:()=>{h(!0),Nt(s,c.current).then(e=>{h(!1),e||C(`Could not reach GitHub for #${n}`,{tone:`danger`})})}}}function It(e,t,n){let r=S(),i=(0,J.useRef)(null);return{refresh:l({mutationFn:e=>(Nt(r,e),x({refresh:!0,limit:50})),onSuccess:async a=>{await r.cancelQueries({queryKey:o.githubPages(50),exact:!0}),r.setQueryData(o.githubPages(50),{pages:[a],pageParams:[{}]}),r.invalidateQueries({queryKey:o.githubChecks(t)});let s=e===`issues`?`issue`:`pr`,c=(e===`issues`?a.issues:a.prs).map(e=>e.number),l=o.githubCommentCounts(s,c);r.removeQueries({queryKey:o.githubCommentCounts(s,[]).slice(0,4),predicate:e=>e.queryHash!==b(l)}),a.available&&a.commentsDeferred&&c.length>0&&_(s,c,{refresh:!0}).then(e=>r.setQueryData(l,e)).catch(()=>{}),r.invalidateQueries({queryKey:o.githubSearch(e===`issues`?`issue`:`pr`,n)}),r.invalidateQueries({queryKey:o.githubSearch(`pr`,ke)}),r.invalidateQueries({queryKey:o.githubSearch(`pr`,Ve)});let u=i.current,d=o.githubComments(`issue`,0).slice(0,3);if(!u){r.removeQueries({queryKey:d});return}let f=o.githubComments(u.kind,u.number);y(u.kind,u.number,{refresh:!0}).then(e=>r.setQueryData(f,e)).catch(()=>{}),r.removeQueries({queryKey:d,predicate:e=>e.queryHash!==b(f)})},onError:e=>C(e.message,{tone:`danger`})}),openThreadRef:i}}var Lt=350;function Rt(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 zt(e,t,{query:n,labelFilter:r,effectiveAssignees:i,activeProject:a},{openItems:o,narrow:s,filterGate:c}){let l=Rt(n,Lt),u=(0,J.useMemo)(()=>q(o,{query:l,labels:r,...s,...e===`issues`?{assignees:i,projectId:a}:{}}),[o,l,r,e,i,a,s]),d=n.trim()===l.trim(),p=t?.available===!0&&!c&&d&&Je(l,u),m=f(e===`issues`?`issue`:`pr`,l,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=Bt(e,g,a,i);return{debouncedQuery:l,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)):[],...Vt(n,d,p,m)}}function Bt(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 Vt(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 Ht({view:e,changes:t=!1,index:n=!1}){let{n:r}=ee(),i=Ot(e),{rawFilterParam:a,activeFilter:o}=i,s=ye(),{pages:c,data:l}=h(50),u=Se(),f=Wt(),p=et(),m=Ut({index:n,isDesktop:s,rawFilterParam:a,n:r,rememberedView:d().data?.githubView}),[g,_]=(0,J.useState)(null),v=kt(e,l,i),y=jt(e,l,i,v.isAssignedFilter),b=zt(e,l,v,y),x=Pt(e,r,b.forgeSearch,y),S=Ft(e,l,x.selectedNumber,y,x.remoteDetail),C=Dt(e,c,l,x.selectedNumber,b.searchHits,y.openItems),{refresh:w,openThreadRef:T}=It(e,C.checkPrNumbers,b.debouncedQuery),E=Ct(e,c,l,y.backedQuery,v.narrowing);if(m.restorePrs)return(0,Y.jsx)(le,{to:`/github/prs`,replace:!0});if(!l)return c.isError?(0,Y.jsx)(W,{route:`github`,density:`empty`,children:(0,Y.jsx)(G,{icon:(0,Y.jsx)(N,{size:16}),tone:`danger`,title:`Could not load GitHub`,subtitle:c.error.message})}):(0,Y.jsx)(Ne,{});T.current=null;let D=()=>w.mutate(S.exactTargetRef.current);if(m.filterScreen&&l.available)return(0,Y.jsx)(pt,{onRefresh:D,refreshing:w.isPending});if(!l.available)return(0,Y.jsx)(Yt,{reason:l.reason,refreshing:w.isPending,onRetry:D});let{labelColors:O,labelOptions:te}=Gt(l,b.searchPayload,y.openItems,y.fullList),k=Kt({number:x.selectedNumber,fullList:y.fullList,filterRows:y.filterRows,remoteDetail:x.remoteDetail,exactDetail:S.exactDetail}),A=r===void 0?[...b.items,...b.searchHits].find(e=>e.url===g)??null:null,j=k??A;T.current=j?{kind:j.kind,number:j.number}:null;let{linkFilter:M,listPath:ne}=qt(e,a,o,s),P={view:e,filter:M,colors:O,expandedUrl:A?.url??null,onToggle:e=>_(t=>t===e.url?null:e.url),queued:p.queued,checksMap:C.checksMap,commentsOf:C.commentsOf},re=Jt(e,v,y.filterGate,b),F=mt({view:e,activeFilter:o,isDesktop:s,rawFilterParam:a,n:r,gh:l,actions:{automationsAvailable:u,refreshing:w.isPending,onRefresh:D}});return r===void 0?(0,Y.jsxs)(W,{route:`github`,density:ve(b.items.length+b.searchHits.length),headerSpacing:`compact`,className:`pb-[calc(90px+env(safe-area-inset-bottom))] md:pb-4`,bodyClassName:`gap-2.5`,header:F,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)(Xt,{view:e,isDesktop:s,gh:l,onSaveView:f}),(0,Y.jsx)(Zt,{view:e,gh:l,filters:v,labelOptions:te,labelColors:O,searchPayload:b.searchPayload})]}),(0,Y.jsx)(en,{view:e,rows:P,verdict:re,search:b,sidebar:y,list:c,paging:E})]}):(0,Y.jsx)(W,{route:`github`,density:`full`,headerSpacing:`compact`,className:`pb-[calc(90px+env(safe-area-inset-bottom))] md:pb-4`,header:F,children:(0,Y.jsx)(on,{view:e,selected:k,selectedNumber:x.selectedNumber,exact:S,repo:l.repo,rows:P,listPath:ne,changes:t,handToAgent:p})})}function Ut({index:e,isDesktop:t,rawFilterParam:n,n:r,rememberedView:i}){return{filterScreen:e&&!t&&n===null&&r===void 0,restorePrs:e&&t&&n===null&&i===`prs`}}function Wt(){let e=S();return t=>{e.setQueryData(o.uiState,e=>({...e,githubView:t})),v({githubView:t}).then(t=>e.setQueryData(o.uiState,t)).catch(t=>{C(t instanceof Error?t.message:String(t),{tone:`danger`}),e.invalidateQueries({queryKey:o.uiState})})}}function Gt(e,t,n,r){return{labelColors:{...t?.labelColors,...e.labelColors},labelOptions:Ge([...n,...r,...t?.items??[]])}}function Kt({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 qt(e,t,n,r){let i=t===null?null:n;return{linkFilter:i,listPath:Ce(e,i??(e===`issues`&&!r?`all`:null))}}function Jt(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)(I,{"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)(I,{"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 Yt({reason:e,refreshing:t,onRetry:n}){return(0,Y.jsx)(W,{route:`github`,density:`empty`,children:(0,Y.jsx)(G,{icon:(0,Y.jsx)(D,{}),tone:`neutral`,title:`GitHub is unavailable here`,subtitle:e??`unknown reason`,actions:(0,Y.jsx)(L,{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 Xt({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)(tt,{to:t?`/github`:`/github?filter=all`,active:e===`issues`,onClick:()=>r(`issues`),children:[`Issues · `,n.issuesTotal??n.issues.length]}),(0,Y.jsxs)(tt,{to:`/github/prs`,active:e===`prs`,onClick:()=>r(`prs`),children:[`Pull requests · `,n.prsTotal??n.prs.length]})]})}function Zt({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)(te,{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)(ln,{options:r,colors:i,selected:n.labelFilter,onChange:n.setLabelFilter}),e===`issues`?(0,Y.jsx)(ft,{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 Qt(e,t){return e.kind===`pr`?t?.[e.number]??e.checks:e.checks}function $t(e,t){return(0,Y.jsx)(_t,{item:e,view:t.view,filter:t.filter,colors:t.colors,expanded:t.expandedUrl===e.url,onToggle:()=>t.onToggle(e),queuedRunId:t.queued.get(e.url)??null,checks:Qt(e,t.checksMap),comments:t.commentsOf(e)})}function en({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)(tn,{items:s,rows:t,paging:o}),o.pagingAvailable?(0,Y.jsx)(nn,{view:e,list:a,paging:o}):null,(0,Y.jsx)(rn,{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)(an,{hits:c,searchPayload:r.searchPayload,rows:t}):null]})}function tn({items:e,rows:t,paging:n}){let{setRowsEl:r,scrollOwner:i,listEl:a,scrollOwnerRef:o,startMargin:s}=n,c=e.map((e,n)=>(0,Y.jsx)(`div`,{role:`listitem`,"data-slot":`gh-row-item`,"data-divided":n>0||void 0,children:$t(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)(Le,{scrollRef:o,startMargin:s,children:c},i===a?`list`:`main`):c})}function nn({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)(I,{"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 rn({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 an({hits:e,searchPayload:t,rows:n}){return(0,Y.jsxs)(`div`,{"data-slot":`gh-search-hits`,children:[(0,Y.jsxs)(`p`,{className:`px-4 pt-2 pb-1 text-xs font-medium tracking-wide text-muted-foreground uppercase`,children:[`Found on GitHub`,t?.truncated?` (first matches)`:``]}),(0,Y.jsx)(`ul`,{className:`flex flex-col gap-0.5 px-2 pb-2`,children:e.map(e=>(0,Y.jsx)(`li`,{children:$t(e,n)},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)(sn,{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)(G,{icon:(0,Y.jsx)(I,{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)(cn,{number:n,exact:r}):(0,Y.jsx)(gt,{view:e,number:n})]})}function sn({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=T().state?.focusHandoff===!0;return(0,J.useEffect)(()=>{g&&$()},[g,e.url]),(0,Y.jsx)(We,{item:e,comments:n.commentsOf(e),afterHeading:e.kind===`issue`?(0,Y.jsx)(nt,{number:e.number,repo:t},e.url):void 0,backLink:{to:r},subNav:{filter:n.filter,changes:i},onRunAgent:$,headerAction:(0,Y.jsx)(wt,{item:e,queuedRunId:m.get(e.url)??null}),colors:n.colors,checks:Qt(e,n.checksMap),children:(0,Y.jsx)(Ye,{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 cn({number:e,exact:t}){let{exactItem:n,retryingExact:r,retryExact:i}=t;return(0,Y.jsx)(G,{icon:(0,Y.jsx)(N,{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)(L,{variant:`outline`,disabled:r,onClick:i,children:`Retry`})})}function ln({options:e,colors:t,selected:n,onChange:i}){let[a,o]=(0,J.useState)(!1),s=e=>i(n.includes(e)?n.filter(t=>t!==e):[...n,e]);return(0,Y.jsxs)(V,{open:a,onOpenChange:o,children:[(0,Y.jsx)(z,{asChild:!0,children:(0,Y.jsxs)(`button`,{type:`button`,"data-slot":`gh-label-filter`,disabled:e.length===0,className:r(`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)(B,{align:`end`,sideOffset:6,className:`w-60 p-0`,children:(0,Y.jsxs)(_e,{children:[(0,Y.jsx)(pe,{placeholder:`Filter labels…`}),(0,Y.jsxs)(ge,{className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[(0,Y.jsx)(he,{children:`No labels.`}),n.length>0?(0,Y.jsxs)(me,{value:`__clear__`,onSelect:()=>i([]),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)(me,{value:e,onSelect:()=>s(e),className:`min-h-11`,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,className:`size-2.5 shrink-0 rounded-full border`,style:Ze(t[e])}),(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e}),r?(0,Y.jsx)(A,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-link-foreground`}):null]},e)})]})]})})]})}export{Ht as GithubRoute};
|
package/web/dist/assets/{global-activity-route-DqyHJiZz.js → global-activity-route-XkwjlnaD.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{o as r}from"./dist-C_rn70hE.js";import{St as i,yt as a}from"./queries-CIeJg62Y.js";import{f as o,n as s}from"./chunk-KS7C4IRE-Cg8l-LDN.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-
|
|
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-C_rn70hE.js";import{St as i,yt as a}from"./queries-CIeJg62Y.js";import{f as o,n as s}from"./chunk-KS7C4IRE-Cg8l-LDN.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-1nxINCqs.js";import{t as A}from"./button-C8jUIs8Q.js";import{i as j}from"./project-order-AcHI4Dcl.js";import{a as M,f as N,n as P,t as F}from"./page-shell-Dky5crRl.js";import{xn as I}from"./index-I4_drgNu.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:i}){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:r(J,`border-dashed border-message-peer-accent`,t.id in i.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:i}){let a=te(i,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:r(J,a?`border-success`:`border-message-peer-accent`,C(i,e.id)===`fade`&&`activity-line-out`),children:[a?(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:i,now:a,motion:o=b,paused:s=!1}){let c=L.useRef(null),l=T(c,L.useCallback(n=>Pe(n,e,t),[e,t]),Fe,`[data-activity-pill]`,i),u=L.useMemo(()=>new Set(l.map(e=>e.id)),[l]),d=ne(o.comets,u,s),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:r(`stroke-message-peer-accent`,t?`opacity-100`:`opacity-80`,le(o,e.id))},e.id)}let t=C(o,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:r(`stroke-message-peer-accent`,fe(t,e.id in o.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:a,motion:o},e.id);let n=f.get(e.id);return n?(0,q.jsx)(Le,{arc:e,request:n,now:a,motion:o},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:i=Ve,index:a,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:r(`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)(s,{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:r(_.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] h-7 px-2 text-[12px] max-md:min-h-11`,children:(0,q.jsx)(s,{"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,a,i)}),(0,q.jsx)(Ue,{task:t}),(0,q.jsx)(ie,{runId:t.runId,requests:n,waits:i,index:a,link:s,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)(s,{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:i=!1}){let a=L.useId(),o=L.useMemo(()=>l(e),[e]),s=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(o,e)},p=`${e.tasks.map(e=>e.runId).join(`,`)}:${s.map(e=>e.requestId).join(`,`)}:${u.map(e=>e.id).join(`,`)}`,m=s.length>0||u.length>0;return(0,q.jsxs)(`section`,{"aria-labelledby":a,"data-slot":`activity-panel`,"data-project":e.projectId,className:Z,children:[(0,q.jsx)($,{project:e,headingId:a,detail:Ae(e),to:X(e.projectId),label:`Open project activity →`}),(0,q.jsxs)(`div`,{className:r(`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:r(`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:o,ctx:f,motion:n,linked:d.linked.has(t.runId),onHover:d.onHover},t.runId))}),m?(0,q.jsx)(Be,{arcs:s,waits:u,active:d.active,layoutKey:p,now:t,motion:n,paused:i}):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)(s,{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?j(e,t).map(e=>e.id):void 0,[e,t])}function $e(){let e=i().data,t=a(),n=o().state?.activityProjectId,r=e?.bootProject??t.data?.bootProject??null,s=typeof n==`string`&&e?.projects.some(e=>e.id===n&&e.status!==`missing`)?n:r;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),a=w(e.data?.generatedAt,e.dataUpdatedAt),o=e.data?.projects,c=L.useMemo(()=>Ee(o??[],n),[o,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)(M,{route:`activity-global`,density:o?N(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?a: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:o&&l.panels.length>0?(0,q.jsx)(P,{summary:`${d.length} active ${d.length===1?`project`:`projects`} with live work.`,actions:(0,q.jsx)(A,{variant:`outline`,size:`sm`,asChild:!0,className:`max-md:min-h-11`,children:(0,q.jsx)(s,{to:`/tasks`,children:`View all tasks`})})}):void 0,children:[o?(0,q.jsx)(u,{summary:D(o),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&&!o?(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(),className:`max-md:min-h-11`,children:`Retry`})]}):null,o&&l.panels.length===0&&l.idle.length===0?(0,q.jsx)(F,{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,className:`max-md:min-h-11`,children:(0,q.jsx)(s,{to:`/tools`,children:`Open workspace tools`})})}):null,d.length>0||h.length>0?(0,q.jsx)(me,{projects:d,now:a,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:a,motion:m,paused:_||b},e.projectId))}):null,(0,q.jsx)(Xe,{projects:l.idle,belowPanels:l.panels.length>0})]})}export{et as GlobalActivityRoute};
|