@usine/server 0.6.1-next.501.g324bfed.1.1 → 0.6.1-next.504.gbfa02ef.1.1

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.
Files changed (112) hide show
  1. package/dist/web/assets/DialogRoot-BnWtrM7T.js +1 -0
  2. package/dist/web/assets/{DialogTitle-ZKc1xOt2.js → DialogTitle-CmNtB_if.js} +1 -1
  3. package/dist/web/assets/{ToolbarRootContext-BElFN4IU.js → ToolbarRootContext-BhX0kWFx.js} +1 -1
  4. package/dist/web/assets/{X.es-ByT0qSpG.js → X.es-p_rZm_HF.js} +1 -1
  5. package/dist/web/assets/_agent-CTNXZ9mU.js +1 -0
  6. package/dist/web/assets/{_binding-C3bNTN-6.js → _binding-ntpPOSJH.js} +1 -1
  7. package/dist/web/assets/{_label-Cb5N2daA.js → _label-DhwahVag.js} +1 -1
  8. package/dist/web/assets/{_loop-BFvAGiGH.js → _loop-DMgv59rx.js} +1 -1
  9. package/dist/web/assets/{_name-B-HbASQe.js → _name-AaUzzjKV.js} +1 -1
  10. package/dist/web/assets/{_name-CRASi5EE.js → _name-DLxk4fLY.js} +1 -1
  11. package/dist/web/assets/{_number-666zNAz8.js → _number-BD_oDGQS.js} +1 -1
  12. package/dist/web/assets/{_number-iQ5JX9Xp.js → _number-CCbRhsJN.js} +1 -1
  13. package/dist/web/assets/_number-RZacAert.js +1 -0
  14. package/dist/web/assets/{_project-D9N3mdm7.js → _project-9J8A_yfR.js} +1 -1
  15. package/dist/web/assets/{_project-BnOgRC9A.js → _project-BROb-oiU.js} +1 -1
  16. package/dist/web/assets/_project-RZacAert.js +1 -0
  17. package/dist/web/assets/_run-BJ8con45.js +1 -0
  18. package/dist/web/assets/{_run-BXQ307iw.js → _run-CMMziuTX.js} +1 -1
  19. package/dist/web/assets/_run-RZacAert.js +1 -0
  20. package/dist/web/assets/{_worker-CTj3spwl.js → _worker-DPJgqNci.js} +1 -1
  21. package/dist/web/assets/{action-BVeAbPKD.js → action-ePdvzmB3.js} +1 -1
  22. package/dist/web/assets/{agents-Ch7mw3mq.js → agents-BvuPUUkE.js} +1 -1
  23. package/dist/web/assets/agents-DOYC5OE7.js +1 -0
  24. package/dist/web/assets/{bindings-D_hro8X1.js → bindings-DdlsgFj5.js} +1 -1
  25. package/dist/web/assets/{boot-screen-DGKdyVSY.js → boot-screen-CVcHadxm.js} +1 -1
  26. package/dist/web/assets/button-B_wpMfoU.js +333 -0
  27. package/dist/web/assets/{checkbox-Bpoln7xT.js → checkbox-DKKxya-R.js} +1 -1
  28. package/dist/web/assets/{ci-Bd2-5eE-.js → ci-BRLK7afF.js} +1 -1
  29. package/dist/web/assets/{code-block-CDwrFKNl.js → code-block-BodRvfPC.js} +1 -1
  30. package/dist/web/assets/{collapsible-CM-8P125.js → collapsible-KWf3qneC.js} +1 -1
  31. package/dist/web/assets/{composite-DL7zHaeP.js → composite-C47YIbmc.js} +1 -1
  32. package/dist/web/assets/{connections-BSPNtewn.js → connections-B8Gz_4YR.js} +1 -1
  33. package/dist/web/assets/{drawer-BkO9kvZy.js → drawer-B6xJFSaO.js} +1 -1
  34. package/dist/web/assets/{edit-and-retry-CgZ3xrB_.js → edit-and-retry-YC_kJKBK.js} +1 -1
  35. package/dist/web/assets/{empty-BTh7Ax9v.js → empty-DFqt3Iti.js} +1 -1
  36. package/dist/web/assets/{entities-BboNqA6v.js → entities-dMwQmf_Q.js} +1 -1
  37. package/dist/web/assets/{error-alert-DcRaRQK1.js → error-alert-DXxL8kJu.js} +1 -1
  38. package/dist/web/assets/{fill-cell-Coppd2Sm.js → fill-cell-Dh_4y6F5.js} +1 -1
  39. package/dist/web/assets/{history-z0IG8395.js → history-d3Sk8yKt.js} +1 -1
  40. package/dist/web/assets/{index-Cq5xMfDA.js → index-BhH8XWzB.js} +3 -3
  41. package/dist/web/assets/{label-0owErZt2.js → label-BjRVxS_7.js} +1 -1
  42. package/dist/web/assets/{label-badge-DiN1DIT9.js → label-badge-CuJIC6DQ.js} +1 -1
  43. package/dist/web/assets/{labels-Sy9SW_nF.js → labels-qx6tg3rh.js} +1 -1
  44. package/dist/web/assets/{list-DxfaSANC.js → list-FCrLxDTG.js} +1 -1
  45. package/dist/web/assets/loops-_Dyoq2Ro.js +1 -0
  46. package/dist/web/assets/{mark-DFrG-wvV.js → mark-BJvMuc9Z.js} +1 -1
  47. package/dist/web/assets/{markdown-BjLrKTI1.js → markdown-BzMrVQ6u.js} +1 -1
  48. package/dist/web/assets/{members-Dchvh3OF.js → members-C36p9Hzh.js} +1 -1
  49. package/dist/web/assets/{model-Bnpi-qEo.js → model-C-f-ObW7.js} +1 -1
  50. package/dist/web/assets/{moves-ByPNlnr2.js → moves-4eVFsVSm.js} +1 -1
  51. package/dist/web/assets/{native-select-Bn_51YxJ.js → native-select-zTpHWMRD.js} +1 -1
  52. package/dist/web/assets/{not-found-BE6pGaWV.js → not-found-C4gl-kkH.js} +1 -1
  53. package/dist/web/assets/{outcome-XjC24MeM.js → outcome-DLmKxrxg.js} +1 -1
  54. package/dist/web/assets/{overview-Dmd3TFds.js → overview-Cf1EaGd5.js} +1 -1
  55. package/dist/web/assets/{page-BJ9RNBzB.js → page-B5q3ShED.js} +1 -1
  56. package/dist/web/assets/{project-not-found-CXsaeZK0.js → project-not-found-B911bkwg.js} +1 -1
  57. package/dist/web/assets/{projects-CtHMn-m3.js → projects-DYEroyuv.js} +1 -1
  58. package/dist/web/assets/{pull-request-marks-BN-mAa8p.js → pull-request-marks-Cc9TmOyj.js} +1 -1
  59. package/dist/web/assets/queries-B0e4uxoK.js +1 -0
  60. package/dist/web/assets/{queries-CXqw4JcF.js → queries-BzN2ySR3.js} +1 -1
  61. package/dist/web/assets/{queries-Bor-exGZ.js → queries-CYP1JIM4.js} +1 -1
  62. package/dist/web/assets/{queries-C6MEHDMF.js → queries-CyI_Gl2p.js} +1 -1
  63. package/dist/web/assets/{queries-DO7XXRdt.js → queries-DYYP8QHb.js} +1 -1
  64. package/dist/web/assets/{queries-Cu8khI1y.js → queries-Db0cAsXY.js} +1 -1
  65. package/dist/web/assets/{queries-D6MAUZQk.js → queries-x40vN2tZ.js} +1 -1
  66. package/dist/web/assets/{query-changes-CnpXchuu.js → query-changes-6m6URFVb.js} +1 -1
  67. package/dist/web/assets/{reason-parts-C8_QVM-x.js → reason-parts-CAa6vA5m.js} +1 -1
  68. package/dist/web/assets/{repositories-BpeYjM-B.js → repositories-VrePkhrL.js} +1 -1
  69. package/dist/web/assets/{repository-link-DErlSv-H.js → repository-link-PhIA55jS.js} +1 -1
  70. package/dist/web/assets/route-BtJ95NGW.js +1 -0
  71. package/dist/web/assets/route-DYJJl3oO.js +1 -0
  72. package/dist/web/assets/{route-status-D0jVnz2s.js → route-status-BCcC0k8s.js} +1 -1
  73. package/dist/web/assets/{routes-DicSLvNg.js → routes-8UKtjqvq.js} +1 -1
  74. package/dist/web/assets/routes-RZacAert.js +1 -0
  75. package/dist/web/assets/{run-again-Cv8qY2OG.js → run-again-Db-OxdfX.js} +1 -1
  76. package/dist/web/assets/{section-BcsvLs1s.js → section-CXAHfqOZ.js} +1 -1
  77. package/dist/web/assets/{section-8xm4fdgZ.js → section-DGBeX8se.js} +1 -1
  78. package/dist/web/assets/{section-Df5s1evj.js → section-DUpW9pom.js} +1 -1
  79. package/dist/web/assets/{settings-fTJFfIr7.js → settings-B5hOJll9.js} +1 -1
  80. package/dist/web/assets/{setup-0LjhQIjm.js → setup-DbGmjqKE.js} +1 -1
  81. package/dist/web/assets/{sign-in-bh16D6Xs.js → sign-in-BRpSMg29.js} +1 -1
  82. package/dist/web/assets/{skeleton-BbXMn698.js → skeleton-BmM4Alte.js} +1 -1
  83. package/dist/web/assets/{slots-BIkeIict.js → slots-BMR0c0c8.js} +1 -1
  84. package/dist/web/assets/{status-badge-CLWrI7_O.js → status-badge-lMqS2smw.js} +1 -1
  85. package/dist/web/assets/{strings-CLu9pWvP.js → strings-DG-SWn1l.js} +1 -1
  86. package/dist/web/assets/{table-k2qcth_z.js → table-BzYq3WJ7.js} +1 -1
  87. package/dist/web/assets/{tasks-BhVqjb_O.js → tasks-BSttFfyV.js} +1 -1
  88. package/dist/web/assets/tasks-RZacAert.js +1 -0
  89. package/dist/web/assets/{tokens-_vpbnJhr.js → tokens-CMBIboVk.js} +1 -1
  90. package/dist/web/assets/{usage-BLOhtP0k.js → usage-BAuU_wyk.js} +1 -1
  91. package/dist/web/assets/{useScrollLock-BfxCcUTp.js → useScrollLock-BNjD0kJK.js} +1 -1
  92. package/dist/web/assets/{useTriggerFocusGuards-D1spCxy-.js → useTriggerFocusGuards-08dQykHh.js} +1 -1
  93. package/dist/web/assets/{usine-mark-CmbHzNsC.js → usine-mark-CMCPjAnd.js} +1 -1
  94. package/dist/web/assets/{visuallyHidden-fzSUV_7b.js → visuallyHidden-D89bfuJD.js} +1 -1
  95. package/dist/web/assets/{window-toggle-aHUv2rHi.js → window-toggle-dtU2YKCn.js} +1 -1
  96. package/dist/web/assets/{workers-CtvpUaXS.js → workers-CRPP5xhC.js} +1 -1
  97. package/dist/web/index.html +29 -29
  98. package/package.json +11 -11
  99. package/dist/web/assets/DialogRoot-zL8jhi3v.js +0 -1
  100. package/dist/web/assets/_agent-WrZNmjy8.js +0 -1
  101. package/dist/web/assets/_number-CKeh7Ldy.js +0 -1
  102. package/dist/web/assets/_project-CKeh7Ldy.js +0 -1
  103. package/dist/web/assets/_run-CKeh7Ldy.js +0 -1
  104. package/dist/web/assets/_run-DCdqGJiV.js +0 -1
  105. package/dist/web/assets/agents-D5Nl7esk.js +0 -1
  106. package/dist/web/assets/button-Dy2BwcbE.js +0 -333
  107. package/dist/web/assets/loops-CHobSH89.js +0 -1
  108. package/dist/web/assets/queries-BhOWO492.js +0 -1
  109. package/dist/web/assets/route-BU5d43ru.js +0 -1
  110. package/dist/web/assets/route-BgSYFqig.js +0 -1
  111. package/dist/web/assets/routes-CKeh7Ldy.js +0 -1
  112. package/dist/web/assets/tasks-CKeh7Ldy.js +0 -1
@@ -0,0 +1 @@
1
+ import{s as e}from"./useScrollLock-BNjD0kJK.js";import{n as t}from"./DialogTitle-CmNtB_if.js";var n=e(function(e){return t(`dialog`,e)});export{n as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{n as t,t as n}from"./jsx-runtime-C3cWAN_r.js";import{P as r,c as i,r as a,s as o}from"./button-Dy2BwcbE.js";import{M as s,T as c,_ as l,a as u,at as d,b as f,d as p,g as m,h,i as g,it as _,l as v,m as y,n as b,o as x,r as S,t as C,u as w,v as T,w as E,y as D}from"./useScrollLock-BfxCcUTp.js";import{C as O,_ as k,n as A,o as j}from"./reason-parts-C8_QVM-x.js";import{a as M,b as N,y as P}from"./composite-DL7zHaeP.js";import{i as F,l as I}from"./visuallyHidden-fzSUV_7b.js";var L=e(t(),1),R=L.createContext(void 0);function z(e){let t=L.useContext(R);if(!e&&t===void 0)throw Error(o(27));return t}var B=L.forwardRef(function(e,t){let{render:n,className:i,style:a,forceRender:o=!1,...s}=e,c=z(),l=c.useState(`open`),u=c.useState(`nested`),f=c.useState(`mounted`),p={open:l,transitionStatus:c.useState(`transitionStatus`)};return r(`div`,e,{state:p,ref:[c.context.backdropRef,t],stateAttributesMapping:d,props:[{role:`presentation`,hidden:!f,style:{userSelect:`none`,WebkitUserSelect:`none`}},s],enabled:o||!u})}),V=L.forwardRef(function(e,t){let{render:n,className:i,style:o,disabled:s=!1,nativeButton:c=!0,...l}=e,u=z(),d=u.useState(`open`),{getButtonProps:f,buttonRef:p}=a({disabled:s,native:c}),m={disabled:s};function h(e){d&&u.setOpen(!1,k(A,e.nativeEvent))}return r(`button`,e,{state:m,ref:[t,p],props:[{onClick:h},l,f]})}),H=L.forwardRef(function(e,t){let{render:n,className:i,style:a,id:o,...s}=e,c=z(),l=O(o);return c.useSyncedValueWithCleanup(`descriptionElementId`,l),r(`p`,e,{ref:t,props:[{id:l},s]})}),U=L.createContext(void 0);function W(){let e=L.useContext(U);if(e===void 0)throw Error(o(26));return e}var G=`--nested-dialogs`,K=`data-nested-dialog-open`,q={..._,...I,nestedDialogOpen(e){return e?{[K]:``}:null}},J=n(),Y=L.forwardRef(function(e,t){let{render:n,className:i,style:a,finalFocus:o,initialFocus:s,...l}=e,u=z(),d=u.useState(`descriptionElementId`),f=u.useState(`disablePointerDismissal`),p=u.useState(`floatingRootContext`),m=u.useState(`popupProps`),h=u.useState(`modal`),g=u.useState(`mounted`),_=u.useState(`nested`),v=u.useState(`nestedOpenDialogCount`),b=u.useState(`open`),x=u.useState(`openMethod`),S=u.useState(`titleElementId`),C=u.useState(`transitionStatus`),T=u.useState(`role`),E=p.useState(`floatingId`);W(),F({open:b,ref:u.context.popupRef,onComplete(){b&&u.context.onOpenChangeComplete?.(!0)}});let D=s===void 0?y(u.context.popupRef):s,O=v>0,k=u.useStateSetter(`popupElement`),A=r(`div`,e,{state:{open:b,nested:_,transitionStatus:C,nestedDialogOpen:O},props:[m,{id:E,"aria-labelledby":S,"aria-describedby":d,role:T,...w,hidden:!g,onKeyDown(e){M.has(e.key)&&e.stopPropagation()},style:{[G]:v}},l],ref:[t,u.context.popupRef,k],stateAttributesMapping:q});return(0,J.jsx)(c,{context:p,openInteractionType:x,disabled:!g,closeOnFocusOut:!f,initialFocus:D,returnFocus:o,modal:h!==!1,restoreFocus:`popup`,children:A})}),X=L.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=z(),a=i.useState(`mounted`),o=i.useState(`modal`),c=i.useState(`open`);return a||n?(0,J.jsx)(U.Provider,{value:n,children:(0,J.jsxs)(s,{ref:t,...r,children:[a&&o===!0&&(0,J.jsx)(b,{ref:i.context.internalBackdropRef,inert:S(!c)}),e.children]})}):null});function Z({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),a=e.useState(`mounted`),o=e.useState(`disablePointerDismissal`),s=e.useState(`modal`),c=e.useState(`popupElement`),l=e.useState(`floatingRootContext`),[u,d]=L.useState(0),[f,p]=L.useState(0),m=u===0,h=E(l,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:s===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=N(t);if(m&&!o){if(s){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||P(n,c)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:m});return C(r&&s===!0,c),e.useContextCallback(`onNestedDialogOpen`,(t,n)=>{(e.select(`open`)||e.select(`mounted`))&&(d(t),p(n))}),i(()=>{!r&&!a&&(d(0),p(0))},[r,a]),i(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(u+1,f+ +!!n),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,u,f,t]),T(e,{activeTriggerProps:h.reference,inactiveTriggerProps:h.trigger,popupProps:h.floating,nestedOpenDialogCount:u,nestedOpenDrawerCount:f}),null}var Q={...u,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},$=class extends x{constructor(e,t,n){let r=new v,i=ee(e,r,t,n);super(i,te(r),Q)}setOpen=(e,t)=>{t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),!t.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(h(this.state,e,t.trigger)))}};function ee(e,t,n,r=!1){return{...g(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function te(e){return{popupRef:L.createRef(),backdropRef:L.createRef(),internalBackdropRef:L.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function ne(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:u,handle:d,triggerId:h,defaultTriggerId:g=null}=t,_=e===`drawer`,v=e===`alert-dialog`,y=v?!0:c,b=v||s,x=v?`alertdialog`:`dialog`,S=z(!0),C={modal:y,disablePointerDismissal:b,nested:S!=null,role:x},w=D((e,t)=>new $({open:i,openProp:r,activeTriggerId:g,triggerIdProp:h,...C},e,t),!0);w.useControlledProp(`openProp`,r),w.useControlledProp(`triggerIdProp`,h),w.useSyncedValues(C),w.useContextCallback(`onOpenChange`,a),w.useContextCallback(`onOpenChangeComplete`,o);let T=w.useState(`open`),E=w.useState(`mounted`),O=w.useState(`payload`);f(w,T),m(w);let{forceUnmount:A}=l(T,w);L.useImperativeHandle(u,()=>({unmount:A,close:()=>w.setOpen(!1,k(j))}),[A,w]);let M=T||E||d!=null;return(0,J.jsxs)(R.Provider,{value:w,children:[d&&(0,J.jsx)(p,{handle:d,store:w}),M&&(0,J.jsx)(Z,{store:w,parentContext:S?.context,isDrawer:_}),typeof n==`function`?n({payload:O}):n]})}var re=L.forwardRef(function(e,t){let{render:n,className:i,style:a,id:o,...s}=e,c=z(),l=O(o);return c.useSyncedValueWithCleanup(`titleElementId`,l),r(`h2`,e,{ref:t,props:[{id:l},s]})});export{H as a,z as c,Y as i,ne as n,V as o,X as r,B as s,re as t};
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{n as t,t as n}from"./jsx-runtime-C3cWAN_r.js";import{P as r,c as i,r as a,s as o}from"./button-B_wpMfoU.js";import{M as s,T as c,_ as l,a as u,at as d,b as f,d as p,g as m,h,i as g,it as _,l as v,m as y,n as b,o as x,r as S,t as C,u as w,v as T,w as E,y as D}from"./useScrollLock-BNjD0kJK.js";import{C as O,_ as k,n as A,o as j}from"./reason-parts-CAa6vA5m.js";import{a as M,b as N,y as P}from"./composite-C47YIbmc.js";import{i as F,l as I}from"./visuallyHidden-D89bfuJD.js";var L=e(t(),1),R=L.createContext(void 0);function z(e){let t=L.useContext(R);if(!e&&t===void 0)throw Error(o(27));return t}var B=L.forwardRef(function(e,t){let{render:n,className:i,style:a,forceRender:o=!1,...s}=e,c=z(),l=c.useState(`open`),u=c.useState(`nested`),f=c.useState(`mounted`),p={open:l,transitionStatus:c.useState(`transitionStatus`)};return r(`div`,e,{state:p,ref:[c.context.backdropRef,t],stateAttributesMapping:d,props:[{role:`presentation`,hidden:!f,style:{userSelect:`none`,WebkitUserSelect:`none`}},s],enabled:o||!u})}),V=L.forwardRef(function(e,t){let{render:n,className:i,style:o,disabled:s=!1,nativeButton:c=!0,...l}=e,u=z(),d=u.useState(`open`),{getButtonProps:f,buttonRef:p}=a({disabled:s,native:c}),m={disabled:s};function h(e){d&&u.setOpen(!1,k(A,e.nativeEvent))}return r(`button`,e,{state:m,ref:[t,p],props:[{onClick:h},l,f]})}),H=L.forwardRef(function(e,t){let{render:n,className:i,style:a,id:o,...s}=e,c=z(),l=O(o);return c.useSyncedValueWithCleanup(`descriptionElementId`,l),r(`p`,e,{ref:t,props:[{id:l},s]})}),U=L.createContext(void 0);function W(){let e=L.useContext(U);if(e===void 0)throw Error(o(26));return e}var G=`--nested-dialogs`,K=`data-nested-dialog-open`,q={..._,...I,nestedDialogOpen(e){return e?{[K]:``}:null}},J=n(),Y=L.forwardRef(function(e,t){let{render:n,className:i,style:a,finalFocus:o,initialFocus:s,...l}=e,u=z(),d=u.useState(`descriptionElementId`),f=u.useState(`disablePointerDismissal`),p=u.useState(`floatingRootContext`),m=u.useState(`popupProps`),h=u.useState(`modal`),g=u.useState(`mounted`),_=u.useState(`nested`),v=u.useState(`nestedOpenDialogCount`),b=u.useState(`open`),x=u.useState(`openMethod`),S=u.useState(`titleElementId`),C=u.useState(`transitionStatus`),T=u.useState(`role`),E=p.useState(`floatingId`);W(),F({open:b,ref:u.context.popupRef,onComplete(){b&&u.context.onOpenChangeComplete?.(!0)}});let D=s===void 0?y(u.context.popupRef):s,O=v>0,k=u.useStateSetter(`popupElement`),A=r(`div`,e,{state:{open:b,nested:_,transitionStatus:C,nestedDialogOpen:O},props:[m,{id:E,"aria-labelledby":S,"aria-describedby":d,role:T,...w,hidden:!g,onKeyDown(e){M.has(e.key)&&e.stopPropagation()},style:{[G]:v}},l],ref:[t,u.context.popupRef,k],stateAttributesMapping:q});return(0,J.jsx)(c,{context:p,openInteractionType:x,disabled:!g,closeOnFocusOut:!f,initialFocus:D,returnFocus:o,modal:h!==!1,restoreFocus:`popup`,children:A})}),X=L.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=z(),a=i.useState(`mounted`),o=i.useState(`modal`),c=i.useState(`open`);return a||n?(0,J.jsx)(U.Provider,{value:n,children:(0,J.jsxs)(s,{ref:t,...r,children:[a&&o===!0&&(0,J.jsx)(b,{ref:i.context.internalBackdropRef,inert:S(!c)}),e.children]})}):null});function Z({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),a=e.useState(`mounted`),o=e.useState(`disablePointerDismissal`),s=e.useState(`modal`),c=e.useState(`popupElement`),l=e.useState(`floatingRootContext`),[u,d]=L.useState(0),[f,p]=L.useState(0),m=u===0,h=E(l,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:s===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=N(t);if(m&&!o){if(s){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||P(n,c)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:m});return C(r&&s===!0,c),e.useContextCallback(`onNestedDialogOpen`,(t,n)=>{(e.select(`open`)||e.select(`mounted`))&&(d(t),p(n))}),i(()=>{!r&&!a&&(d(0),p(0))},[r,a]),i(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(u+1,f+ +!!n),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,u,f,t]),T(e,{activeTriggerProps:h.reference,inactiveTriggerProps:h.trigger,popupProps:h.floating,nestedOpenDialogCount:u,nestedOpenDrawerCount:f}),null}var Q={...u,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},$=class extends x{constructor(e,t,n){let r=new v,i=ee(e,r,t,n);super(i,te(r),Q)}setOpen=(e,t)=>{t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),!t.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(h(this.state,e,t.trigger)))}};function ee(e,t,n,r=!1){return{...g(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function te(e){return{popupRef:L.createRef(),backdropRef:L.createRef(),internalBackdropRef:L.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function ne(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:u,handle:d,triggerId:h,defaultTriggerId:g=null}=t,_=e===`drawer`,v=e===`alert-dialog`,y=v?!0:c,b=v||s,x=v?`alertdialog`:`dialog`,S=z(!0),C={modal:y,disablePointerDismissal:b,nested:S!=null,role:x},w=D((e,t)=>new $({open:i,openProp:r,activeTriggerId:g,triggerIdProp:h,...C},e,t),!0);w.useControlledProp(`openProp`,r),w.useControlledProp(`triggerIdProp`,h),w.useSyncedValues(C),w.useContextCallback(`onOpenChange`,a),w.useContextCallback(`onOpenChangeComplete`,o);let T=w.useState(`open`),E=w.useState(`mounted`),O=w.useState(`payload`);f(w,T),m(w);let{forceUnmount:A}=l(T,w);L.useImperativeHandle(u,()=>({unmount:A,close:()=>w.setOpen(!1,k(j))}),[A,w]);let M=T||E||d!=null;return(0,J.jsxs)(R.Provider,{value:w,children:[d&&(0,J.jsx)(p,{handle:d,store:w}),M&&(0,J.jsx)(Z,{store:w,parentContext:S?.context,isDrawer:_}),typeof n==`function`?n({payload:O}):n]})}var re=L.forwardRef(function(e,t){let{render:n,className:i,style:a,id:o,...s}=e,c=z(),l=O(o);return c.useSyncedValueWithCleanup(`titleElementId`,l),r(`h2`,e,{ref:t,props:[{id:l},s]})});export{H as a,z as c,Y as i,ne as n,V as o,X as r,B as s,re as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{n as t}from"./jsx-runtime-C3cWAN_r.js";import{s as n}from"./button-Dy2BwcbE.js";var r=e(t(),1),i=r.createContext(void 0);function a(){return r.useContext(i)?.direction??`ltr`}var o=r.createContext(void 0);function s(e){let t=r.useContext(o);if(t===void 0&&!e)throw Error(n(69));return t}export{a as n,s as t};
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{n as t}from"./jsx-runtime-C3cWAN_r.js";import{s as n}from"./button-B_wpMfoU.js";var r=e(t(),1),i=r.createContext(void 0);function a(){return r.useContext(i)?.direction??`ltr`}var o=r.createContext(void 0);function s(e){let t=r.useContext(o);if(t===void 0&&!e)throw Error(n(69));return t}export{a as n,s as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{n as t}from"./jsx-runtime-C3cWAN_r.js";import{W as n}from"./button-Dy2BwcbE.js";var r=e(t(),1),i=new Map([[`bold`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z`}))],[`duotone`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`,opacity:`0.2`}),r.createElement(`path`,{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`fill`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`light`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z`}))],[`regular`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`thin`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z`}))]]),a=r.forwardRef((e,t)=>r.createElement(n,{ref:t,...e,weights:i}));a.displayName=`XIcon`;export{a as t};
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{n as t}from"./jsx-runtime-C3cWAN_r.js";import{W as n}from"./button-B_wpMfoU.js";var r=e(t(),1),i=new Map([[`bold`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z`}))],[`duotone`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`,opacity:`0.2`}),r.createElement(`path`,{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`fill`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`light`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z`}))],[`regular`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`thin`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z`}))]]),a=r.forwardRef((e,t)=>r.createElement(n,{ref:t,...e,weights:i}));a.displayName=`XIcon`;export{a as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./jsx-runtime-C3cWAN_r.js";import{t}from"./useSuspenseQuery-Q36G6iE9.js";import{n}from"./queries-DYYP8QHb.js";import{g as r}from"./index-BhH8XWzB.js";import{t as i}from"./agents-BvuPUUkE.js";var a=e(),o=()=>{let{agent:e}=r.useParams(),{data:o}=t(n());return(0,a.jsx)(i,{name:e,configuration:o})};export{o as component};
@@ -1 +1 @@
1
- import{t as e}from"./jsx-runtime-C3cWAN_r.js";import{t}from"./useSuspenseQuery-Q36G6iE9.js";import{t as n,x as r}from"./section-BcsvLs1s.js";import{n as i}from"./queries-DO7XXRdt.js";import{t as a}from"./queries-Bor-exGZ.js";import{n as o}from"./entities-BboNqA6v.js";import{m as s}from"./index-Cq5xMfDA.js";var c=e(),l=()=>{let{binding:e}=s.useParams(),{data:l}=t(i()),{data:u}=t(a()),d=l.bindings.find(t=>t.name===e);return(0,c.jsx)(n,{title:e,entity:o(`binding`,e),children:d!==void 0&&(0,c.jsxs)(`p`,{children:[u.find(({id:e})=>e===d.member)?.login??r.unenrolledMember,` ·`,` `,d.role,` ·`,` `,d.scope._tag===`Instance`?r.instance:d.scope.project]})})};export{l as component};
1
+ import{t as e}from"./jsx-runtime-C3cWAN_r.js";import{t}from"./useSuspenseQuery-Q36G6iE9.js";import{t as n,x as r}from"./section-CXAHfqOZ.js";import{n as i}from"./queries-DYYP8QHb.js";import{t as a}from"./queries-CYP1JIM4.js";import{n as o}from"./entities-dMwQmf_Q.js";import{m as s}from"./index-BhH8XWzB.js";var c=e(),l=()=>{let{binding:e}=s.useParams(),{data:l}=t(i()),{data:u}=t(a()),d=l.bindings.find(t=>t.name===e);return(0,c.jsx)(n,{title:e,entity:o(`binding`,e),children:d!==void 0&&(0,c.jsxs)(`p`,{children:[u.find(({id:e})=>e===d.member)?.login??r.unenrolledMember,` ·`,` `,d.role,` ·`,` `,d.scope._tag===`Instance`?r.instance:d.scope.project]})})};export{l as component};
@@ -1 +1 @@
1
- import{t as e}from"./jsx-runtime-C3cWAN_r.js";import{t}from"./useSuspenseQuery-Q36G6iE9.js";import{bs as n,ys as r}from"./Fiber-BdWb6IYe.js";import{D as i,a,i as o,t as s}from"./section-BcsvLs1s.js";import{n as c}from"./queries-DO7XXRdt.js";import{n as l}from"./entities-BboNqA6v.js";import{p as u}from"./index-Cq5xMfDA.js";import{t as d}from"./label-badge-DiN1DIT9.js";var f=e(),p=()=>{let{label:e}=u.useParams(),{data:p}=t(c()),m=p.labels.find(({name:t})=>t===e);return(0,f.jsx)(s,{title:e,entity:l(`label`,e),children:m!==void 0&&(0,f.jsxs)(a,{children:[(0,f.jsx)(o,{label:i.label,children:(0,f.jsx)(d,{name:m.name,label:{name:m.name,color:n(m.color),description:n(m.description)}})}),(0,f.jsx)(o,{label:i.description,children:r(m.description,()=>i.noDescription)})]})})};export{p as component};
1
+ import{t as e}from"./jsx-runtime-C3cWAN_r.js";import{t}from"./useSuspenseQuery-Q36G6iE9.js";import{bs as n,ys as r}from"./Fiber-BdWb6IYe.js";import{D as i,a,i as o,t as s}from"./section-CXAHfqOZ.js";import{n as c}from"./queries-DYYP8QHb.js";import{n as l}from"./entities-dMwQmf_Q.js";import{p as u}from"./index-BhH8XWzB.js";import{t as d}from"./label-badge-CuJIC6DQ.js";var f=e(),p=()=>{let{label:e}=u.useParams(),{data:p}=t(c()),m=p.labels.find(({name:t})=>t===e);return(0,f.jsx)(s,{title:e,entity:l(`label`,e),children:m!==void 0&&(0,f.jsxs)(a,{children:[(0,f.jsx)(o,{label:i.label,children:(0,f.jsx)(d,{name:m.name,label:{name:m.name,color:n(m.color),description:n(m.description)}})}),(0,f.jsx)(o,{label:i.description,children:r(m.description,()=>i.noDescription)})]})})};export{p as component};
@@ -1 +1 @@
1
- import{t as e}from"./jsx-runtime-C3cWAN_r.js";import{t}from"./useSuspenseQuery-Q36G6iE9.js";import{t as n}from"./link-l4ws0FnP.js";import{i as r}from"./strings-6CUMEccc.js";import{M as i,N as a,a as o,b as s,c,g as l,h as u,i as d,n as f,o as p,r as m,s as h,t as g,u as _}from"./section-BcsvLs1s.js";import{n as v,r as y}from"./list-DxfaSANC.js";import{t as b}from"./error-alert-DcRaRQK1.js";import{n as x}from"./queries-DO7XXRdt.js";import{n as S}from"./entities-BboNqA6v.js";import{J as C,f as w,nn as T}from"./index-Cq5xMfDA.js";import{t as E}from"./file-error-BOGdnLms.js";import{t as D}from"./repository-link-DErlSv-H.js";var O=e(),k=({loop:e,configuration:t})=>{let a=t.projects.find(t=>e.name.startsWith(`${t.id}/`)),c=t.agents.find(({name:t})=>t===e.agent);return(0,O.jsxs)(o,{children:[a!==void 0&&(0,O.jsx)(d,{label:`Project`,children:(0,O.jsx)(n,{to:`/configuration/projects/$project`,params:{project:a.id},className:`text-primary hover:underline`,children:a.name})}),(0,O.jsxs)(d,{label:`Agent`,children:[(0,O.jsx)(n,{to:`/configuration/agents/$agent`,params:{agent:e.agent},className:`text-primary hover:underline`,children:e.agent}),c!==void 0&&(0,O.jsx)(`p`,{className:`mt-0.5 font-mono text-xs text-muted-foreground`,children:r(c)})]}),(0,O.jsx)(d,{label:`Repositories`,children:e.repositories.length===0?(0,O.jsx)(_,{children:`No registered repository matches the selector`}):(0,O.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:e.repositories.map(e=>(0,O.jsx)(`li`,{children:(0,O.jsx)(D,{repository:e})},e))})}),(0,O.jsxs)(d,{label:`Approval`,children:[s(e.approval),e.approval!==`none`&&e.approval!==`required`&&(0,O.jsx)(`code`,{className:`block text-xs wrap-anywhere`,children:e.approval})]}),(0,O.jsxs)(d,{label:`Max cycles`,children:[(0,O.jsx)(`span`,{className:`tabular-nums`,children:e.maxCycles}),` `,(0,O.jsx)(_,{children:`runs per item before a reset`})]}),(0,O.jsx)(d,{label:`Permissions`,children:i[e.permissions]}),(0,O.jsx)(d,{label:`Priority`,children:e.priority===null?(0,O.jsx)(_,{children:`0; ties use lane order`}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`span`,{className:`tabular-nums`,children:e.priority}),` `,(0,O.jsx)(_,{children:`higher values go first; ties use lane order`})]})}),(0,O.jsx)(d,{label:`Step`,children:(0,O.jsx)(`code`,{className:`font-mono text-xs`,children:e.step})})]})},A=e=>[[`on`,e.stream],[`if`,e.condition],...e.cron===null?[]:[[`cron`,e.cron]],...e.timeZone===null?[]:[[`tz`,e.timeZone]]],j=({repos:e,tags:t})=>[...e===null?[]:[[`repos`,e.join(`, `)]],...t===null?[]:[[`tags`,t.join(`, `)]]],M=({loop:e,configuration:t,pause:n})=>{let r=l(e.prompt).length;return(0,O.jsxs)(O.Fragment,{children:[n?.isError===!0&&(0,O.jsx)(b,{message:n.error.message}),(0,O.jsxs)(f,{facts:(0,O.jsx)(k,{loop:e,configuration:t}),children:[(0,O.jsxs)(m,{title:`Trigger`,children:[(0,O.jsx)(p,{entries:A(e)}),e.undeclaredLabels.length>0&&(0,O.jsxs)(`p`,{className:`flex items-start gap-1.5 text-xs text-muted-foreground`,children:[(0,O.jsx)(T,{weight:`fill`,className:`mt-0.5 size-3 shrink-0 text-warning`}),(0,O.jsxs)(`span`,{children:[`Condition uses`,` `,e.undeclaredLabels.length===1?`an undeclared label`:`undeclared labels`,`:`,` `,e.undeclaredLabels.join(`, `),`. usine creates only the labels in Configuration > Labels.`]})]})]}),(0,O.jsx)(m,{title:`Selector`,children:e.selector===null?(0,O.jsx)(`p`,{className:`text-muted-foreground`,children:`No selector: every registered repository`}):(0,O.jsx)(p,{entries:j(e.selector)})}),(0,O.jsx)(m,{title:`Prompt`,aside:r===0?`Same text for every run`:`${a(r,`outlined expression`)} filled in from each item`,children:(0,O.jsx)(u,{template:e.prompt})})]})]})},N=({name:e,configuration:t,pause:r})=>{let i=t.loops.find(t=>t.name===e);if(i!==void 0)return(0,O.jsx)(g,{entity:S(`loop`,e),title:i.name,marks:(0,O.jsx)(y,{paused:i.paused}),file:i.file,actions:r!==null&&(0,O.jsx)(v,{loop:i,pause:r,variant:`outline`}),children:(0,O.jsx)(M,{loop:i,configuration:t,pause:r})});let a=t.quarantinedLoops.find(t=>t.name===e);return a===void 0?(0,O.jsx)(g,{entity:S(`loop`,e),title:e,children:(0,O.jsxs)(h,{title:`Loop not found`,children:[`The configuration has no file `,(0,O.jsxs)(`code`,{children:[`loops/`,e,`.md`]}),`.`,` `,(0,O.jsx)(n,{to:`/configuration/loops`,className:`text-primary hover:underline`,children:`See all loops`}),`.`]})}):(0,O.jsx)(g,{entity:S(`loop`,e),title:a.name,marks:(0,O.jsx)(c,{}),file:a.file,children:(0,O.jsx)(E,{error:a.error,consequence:`No runs until the file loads.`})})},P=()=>{let{loop:e}=w.useParams(),{data:n}=t(x());return(0,O.jsx)(N,{name:e,configuration:n,pause:C()})};export{P as component};
1
+ import{t as e}from"./jsx-runtime-C3cWAN_r.js";import{t}from"./useSuspenseQuery-Q36G6iE9.js";import{t as n}from"./link-l4ws0FnP.js";import{i as r}from"./strings-6CUMEccc.js";import{M as i,N as a,a as o,b as s,c,g as l,h as u,i as d,n as f,o as p,r as m,s as h,t as g,u as _}from"./section-CXAHfqOZ.js";import{n as v,r as y}from"./list-FCrLxDTG.js";import{t as b}from"./error-alert-DXxL8kJu.js";import{n as x}from"./queries-DYYP8QHb.js";import{n as S}from"./entities-dMwQmf_Q.js";import{J as C,f as w,nn as T}from"./index-BhH8XWzB.js";import{t as E}from"./file-error-BOGdnLms.js";import{t as D}from"./repository-link-PhIA55jS.js";var O=e(),k=({loop:e,configuration:t})=>{let a=t.projects.find(t=>e.name.startsWith(`${t.id}/`)),c=t.agents.find(({name:t})=>t===e.agent);return(0,O.jsxs)(o,{children:[a!==void 0&&(0,O.jsx)(d,{label:`Project`,children:(0,O.jsx)(n,{to:`/configuration/projects/$project`,params:{project:a.id},className:`text-primary hover:underline`,children:a.name})}),(0,O.jsxs)(d,{label:`Agent`,children:[(0,O.jsx)(n,{to:`/configuration/agents/$agent`,params:{agent:e.agent},className:`text-primary hover:underline`,children:e.agent}),c!==void 0&&(0,O.jsx)(`p`,{className:`mt-0.5 font-mono text-xs text-muted-foreground`,children:r(c)})]}),(0,O.jsx)(d,{label:`Repositories`,children:e.repositories.length===0?(0,O.jsx)(_,{children:`No registered repository matches the selector`}):(0,O.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:e.repositories.map(e=>(0,O.jsx)(`li`,{children:(0,O.jsx)(D,{repository:e})},e))})}),(0,O.jsxs)(d,{label:`Approval`,children:[s(e.approval),e.approval!==`none`&&e.approval!==`required`&&(0,O.jsx)(`code`,{className:`block text-xs wrap-anywhere`,children:e.approval})]}),(0,O.jsxs)(d,{label:`Max cycles`,children:[(0,O.jsx)(`span`,{className:`tabular-nums`,children:e.maxCycles}),` `,(0,O.jsx)(_,{children:`runs per item before a reset`})]}),(0,O.jsx)(d,{label:`Permissions`,children:i[e.permissions]}),(0,O.jsx)(d,{label:`Priority`,children:e.priority===null?(0,O.jsx)(_,{children:`0; ties use lane order`}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`span`,{className:`tabular-nums`,children:e.priority}),` `,(0,O.jsx)(_,{children:`higher values go first; ties use lane order`})]})}),(0,O.jsx)(d,{label:`Step`,children:(0,O.jsx)(`code`,{className:`font-mono text-xs`,children:e.step})})]})},A=e=>[[`on`,e.stream],[`if`,e.condition],...e.cron===null?[]:[[`cron`,e.cron]],...e.timeZone===null?[]:[[`tz`,e.timeZone]]],j=({repos:e,tags:t})=>[...e===null?[]:[[`repos`,e.join(`, `)]],...t===null?[]:[[`tags`,t.join(`, `)]]],M=({loop:e,configuration:t,pause:n})=>{let r=l(e.prompt).length;return(0,O.jsxs)(O.Fragment,{children:[n?.isError===!0&&(0,O.jsx)(b,{message:n.error.message}),(0,O.jsxs)(f,{facts:(0,O.jsx)(k,{loop:e,configuration:t}),children:[(0,O.jsxs)(m,{title:`Trigger`,children:[(0,O.jsx)(p,{entries:A(e)}),e.undeclaredLabels.length>0&&(0,O.jsxs)(`p`,{className:`flex items-start gap-1.5 text-xs text-muted-foreground`,children:[(0,O.jsx)(T,{weight:`fill`,className:`mt-0.5 size-3 shrink-0 text-warning`}),(0,O.jsxs)(`span`,{children:[`Condition uses`,` `,e.undeclaredLabels.length===1?`an undeclared label`:`undeclared labels`,`:`,` `,e.undeclaredLabels.join(`, `),`. usine creates only the labels in Configuration > Labels.`]})]})]}),(0,O.jsx)(m,{title:`Selector`,children:e.selector===null?(0,O.jsx)(`p`,{className:`text-muted-foreground`,children:`No selector: every registered repository`}):(0,O.jsx)(p,{entries:j(e.selector)})}),(0,O.jsx)(m,{title:`Prompt`,aside:r===0?`Same text for every run`:`${a(r,`outlined expression`)} filled in from each item`,children:(0,O.jsx)(u,{template:e.prompt})})]})]})},N=({name:e,configuration:t,pause:r})=>{let i=t.loops.find(t=>t.name===e);if(i!==void 0)return(0,O.jsx)(g,{entity:S(`loop`,e),title:i.name,marks:(0,O.jsx)(y,{paused:i.paused}),file:i.file,actions:r!==null&&(0,O.jsx)(v,{loop:i,pause:r,variant:`outline`}),children:(0,O.jsx)(M,{loop:i,configuration:t,pause:r})});let a=t.quarantinedLoops.find(t=>t.name===e);return a===void 0?(0,O.jsx)(g,{entity:S(`loop`,e),title:e,children:(0,O.jsxs)(h,{title:`Loop not found`,children:[`The configuration has no file `,(0,O.jsxs)(`code`,{children:[`loops/`,e,`.md`]}),`.`,` `,(0,O.jsx)(n,{to:`/configuration/loops`,className:`text-primary hover:underline`,children:`See all loops`}),`.`]})}):(0,O.jsx)(g,{entity:S(`loop`,e),title:a.name,marks:(0,O.jsx)(c,{}),file:a.file,children:(0,O.jsx)(E,{error:a.error,consequence:`No runs until the file loads.`})})},P=()=>{let{loop:e}=w.useParams(),{data:n}=t(x());return(0,O.jsx)(N,{name:e,configuration:n,pause:C()})};export{P as component};
@@ -1 +1 @@
1
- import{t as e}from"./jsx-runtime-C3cWAN_r.js";import{t}from"./useSuspenseQuery-Q36G6iE9.js";import{a as n,r}from"./overview-Dmd3TFds.js";import{a as i}from"./index-Cq5xMfDA.js";import{i as a,n as o,t as s}from"./project-not-found-CXsaeZK0.js";var c=e(),l=()=>{let{project:e,name:l}=i.useParams(),{data:u}=t(r());return u.projects.some(t=>n(t)===e)?(0,c.jsx)(s,{title:`Page not found`,description:o(e,l)}):(0,c.jsx)(s,{description:a(`${e}/${l}`)})};export{l as notFoundComponent};
1
+ import{t as e}from"./jsx-runtime-C3cWAN_r.js";import{t}from"./useSuspenseQuery-Q36G6iE9.js";import{a as n,r}from"./overview-Cf1EaGd5.js";import{a as i}from"./index-BhH8XWzB.js";import{i as a,n as o,t as s}from"./project-not-found-B911bkwg.js";var c=e(),l=()=>{let{project:e,name:l}=i.useParams(),{data:u}=t(r());return u.projects.some(t=>n(t)===e)?(0,c.jsx)(s,{title:`Page not found`,description:o(e,l)}):(0,c.jsx)(s,{description:a(`${e}/${l}`)})};export{l as notFoundComponent};
@@ -1 +1 @@
1
- import{t as e}from"./jsx-runtime-C3cWAN_r.js";import{t}from"./useSuspenseQuery-Q36G6iE9.js";import{t as n}from"./link-l4ws0FnP.js";import{B as r,a as i,i as a,n as o,r as s,s as c,t as l,u}from"./section-BcsvLs1s.js";import{n as d}from"./queries-DO7XXRdt.js";import{n as f}from"./entities-BboNqA6v.js";import{i as p,jt as m}from"./index-Cq5xMfDA.js";import{t as h}from"./label-badge-DiN1DIT9.js";var g=e(),_=({label:e})=>e.failure===null?e.onGitHub===!1?(0,g.jsxs)(`span`,{className:`text-destructive`,children:[`Missing on GitHub`,e.declared?`, created at the next poll`:``]}):null:(0,g.jsx)(`span`,{className:`text-destructive`,children:e.failure.message}),v=({repository:e,project:t})=>(0,g.jsxs)(i,{children:[(0,g.jsx)(a,{label:r.project,children:t===void 0?(0,g.jsx)(u,{children:r.unassignedProject}):(0,g.jsx)(n,{to:`/configuration/projects/$project`,params:{project:t.id},className:`text-primary hover:underline`,children:t.name})}),t!==void 0&&(0,g.jsx)(a,{label:`Board`,children:(0,g.jsx)(n,{to:`/projects/$project`,params:{project:t.id},className:`text-primary hover:underline`,children:r.board})}),(0,g.jsx)(a,{label:`Tags`,children:e.tags.length===0?(0,g.jsx)(u,{children:`None`}):e.tags.join(`, `)}),(0,g.jsx)(a,{label:`Loops`,children:e.loops.length===0?(0,g.jsx)(u,{children:`Not selected by any loop`}):(0,g.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:e.loops.map(e=>(0,g.jsx)(`li`,{children:(0,g.jsx)(n,{to:`/configuration/loops/$loop`,params:{loop:e},className:`text-primary hover:underline`,children:e})},e))})})]}),y=({owner:e,name:t,configuration:r})=>{let i=`${e}/${t}`,a=r.repositories.find(e=>e.name.toLowerCase()===i.toLowerCase());return a===void 0?(0,g.jsx)(l,{entity:f(`repository`,i),title:i,children:(0,g.jsxs)(c,{title:`Repository not registered`,children:[`Configuration > Repositories has no repository `,i,`.`,` `,(0,g.jsx)(n,{to:`/configuration/repositories`,className:`text-primary hover:underline`,children:`See all repositories`}),`.`]})}):(0,g.jsx)(l,{entity:f(`repository`,a.name),title:a.name,leading:(0,g.jsx)(m,{repository:a.name,size:`title`}),children:(0,g.jsx)(o,{facts:(0,g.jsx)(v,{repository:a,project:r.projects.find(e=>e.includes(a.name))}),children:(0,g.jsx)(s,{title:`Labels usine creates`,aside:`From Configuration > Labels`,children:a.declaredLabels.length===0?(0,g.jsx)(`p`,{className:`text-muted-foreground`,children:`No labels in Configuration > Labels`}):(0,g.jsx)(`ul`,{className:`flex flex-col gap-2`,children:a.declaredLabels.map(e=>(0,g.jsxs)(`li`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,g.jsx)(h,{name:e.name,label:e}),(0,g.jsx)(`span`,{className:`text-xs`,children:e.onGitHub===!0&&e.failure===null?(0,g.jsx)(u,{children:`On GitHub`}):(0,g.jsx)(_,{label:e})})]},e.name))})})})})},b=()=>{let{owner:e,name:n}=p.useParams(),{data:r}=t(d());return(0,g.jsx)(y,{owner:e,name:n,configuration:r})};export{b as component};
1
+ import{t as e}from"./jsx-runtime-C3cWAN_r.js";import{t}from"./useSuspenseQuery-Q36G6iE9.js";import{t as n}from"./link-l4ws0FnP.js";import{B as r,a as i,i as a,n as o,r as s,s as c,t as l,u}from"./section-CXAHfqOZ.js";import{n as d}from"./queries-DYYP8QHb.js";import{n as f}from"./entities-dMwQmf_Q.js";import{i as p,jt as m}from"./index-BhH8XWzB.js";import{t as h}from"./label-badge-CuJIC6DQ.js";var g=e(),_=({label:e})=>e.failure===null?e.onGitHub===!1?(0,g.jsxs)(`span`,{className:`text-destructive`,children:[`Missing on GitHub`,e.declared?`, created at the next poll`:``]}):null:(0,g.jsx)(`span`,{className:`text-destructive`,children:e.failure.message}),v=({repository:e,project:t})=>(0,g.jsxs)(i,{children:[(0,g.jsx)(a,{label:r.project,children:t===void 0?(0,g.jsx)(u,{children:r.unassignedProject}):(0,g.jsx)(n,{to:`/configuration/projects/$project`,params:{project:t.id},className:`text-primary hover:underline`,children:t.name})}),t!==void 0&&(0,g.jsx)(a,{label:`Board`,children:(0,g.jsx)(n,{to:`/projects/$project`,params:{project:t.id},className:`text-primary hover:underline`,children:r.board})}),(0,g.jsx)(a,{label:`Tags`,children:e.tags.length===0?(0,g.jsx)(u,{children:`None`}):e.tags.join(`, `)}),(0,g.jsx)(a,{label:`Loops`,children:e.loops.length===0?(0,g.jsx)(u,{children:`Not selected by any loop`}):(0,g.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:e.loops.map(e=>(0,g.jsx)(`li`,{children:(0,g.jsx)(n,{to:`/configuration/loops/$loop`,params:{loop:e},className:`text-primary hover:underline`,children:e})},e))})})]}),y=({owner:e,name:t,configuration:r})=>{let i=`${e}/${t}`,a=r.repositories.find(e=>e.name.toLowerCase()===i.toLowerCase());return a===void 0?(0,g.jsx)(l,{entity:f(`repository`,i),title:i,children:(0,g.jsxs)(c,{title:`Repository not registered`,children:[`Configuration > Repositories has no repository `,i,`.`,` `,(0,g.jsx)(n,{to:`/configuration/repositories`,className:`text-primary hover:underline`,children:`See all repositories`}),`.`]})}):(0,g.jsx)(l,{entity:f(`repository`,a.name),title:a.name,leading:(0,g.jsx)(m,{repository:a.name,size:`title`}),children:(0,g.jsx)(o,{facts:(0,g.jsx)(v,{repository:a,project:r.projects.find(e=>e.includes(a.name))}),children:(0,g.jsx)(s,{title:`Labels usine creates`,aside:`From Configuration > Labels`,children:a.declaredLabels.length===0?(0,g.jsx)(`p`,{className:`text-muted-foreground`,children:`No labels in Configuration > Labels`}):(0,g.jsx)(`ul`,{className:`flex flex-col gap-2`,children:a.declaredLabels.map(e=>(0,g.jsxs)(`li`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,g.jsx)(h,{name:e.name,label:e}),(0,g.jsx)(`span`,{className:`text-xs`,children:e.onGitHub===!0&&e.failure===null?(0,g.jsx)(u,{children:`On GitHub`}):(0,g.jsx)(_,{label:e})})]},e.name))})})})})},b=()=>{let{owner:e,name:n}=p.useParams(),{data:r}=t(d());return(0,g.jsx)(y,{owner:e,name:n,configuration:r})};export{b as component};
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/diff-DxsEDkne.js","assets/rolldown-runtime-XKyaHtl9.js","assets/jsx-runtime-C3cWAN_r.js","assets/react-dom-BwXff0Px.js","assets/Fiber-BdWb6IYe.js","assets/preload-helper-BLdHbfdN.js","assets/IssueOpenedIcon-_2eTO7-E.js","assets/core-CKx2roUQ.js","assets/ccount-C8ZFHdSh.js","assets/engine-javascript-HJON5ycQ.js","assets/diff-BhNyFaio.css"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{n as t,t as n}from"./jsx-runtime-C3cWAN_r.js";import{F as r}from"./useBaseQuery-Dc10zv_h.js";import{t as i}from"./useInfiniteQuery-BM0Jy2se.js";import{t as a}from"./useQuery-vsTuI6W-.js";import{t as o}from"./useSuspenseQuery-Q36G6iE9.js";import{n as s,t as c}from"./useNavigate-CG-UHNSo.js";import{t as l}from"./link-l4ws0FnP.js";import{As as u,Ds as d,_s as f,fs as p,gt as m,hs as h}from"./Fiber-BdWb6IYe.js";import{A as g,Z as _,bn as ee,t as v,xn as y,yn as te}from"./button-Dy2BwcbE.js";import{t as ne}from"./preload-helper-BLdHbfdN.js";import{a as re,n as ie,r as ae}from"./page-BJ9RNBzB.js";import{c as oe,s as b,x}from"./strings-6CUMEccc.js";import{F as S,I as se,J as ce,K as C,X as le,Y as ue,a as w,i as de,q as T,r as fe}from"./overview-Dmd3TFds.js";import{c as pe,d as me,f as he,l as ge,n as _e,t as ve}from"./moves-ByPNlnr2.js";import{n as E,r as ye,t as be}from"./native-select-Bn_51YxJ.js";import{c as xe,o as Se}from"./useTriggerFocusGuards-D1spCxy-.js";import{t as D}from"./skeleton-BbXMn698.js";import{t as O}from"./error-alert-DcRaRQK1.js";import{i as k}from"./context-NRsMJqQa.js";import{r as Ce,t as A}from"./mark-DFrG-wvV.js";import{n as we,r as Te,t as Ee}from"./queries-Cu8khI1y.js";import{n as j}from"./queries-C6MEHDMF.js";import{At as De,Et as M,_t as N,at as Oe,bt as P,cn as ke,ct as Ae,dt as je,ft as Me,hn as Ne,it as Pe,kt as F,lt as Fe,mt as Ie,on as Le,ot as Re,pt as ze,rt as Be,st as Ve,t as He,un as Ue,ut as We,vt as I,yt as L}from"./index-Cq5xMfDA.js";import{t as Ge}from"./pull-request-marks-BN-mAa8p.js";import{n as R,t as Ke}from"./status-badge-CLWrI7_O.js";import{n as qe,t as Je}from"./edit-and-retry-CgZ3xrB_.js";import{a as Ye,i as z,n as B,o as V,r as H,t as U}from"./table-k2qcth_z.js";import{t as W}from"./fill-cell-Coppd2Sm.js";import{t as Xe}from"./label-badge-DiN1DIT9.js";import{a as Ze,n as Qe,t as $e}from"./model-Bnpi-qEo.js";import{n as et,t as tt}from"./run-again-Cv8qY2OG.js";import{a as nt,i as G,n as K,r as q,t as J}from"./section-Df5s1evj.js";import{a as rt,c as it,g as at,i as ot,m as st,n as ct,o as lt,r as ut,s as Y,t as dt,u as ft,y as X}from"./not-found-BE6pGaWV.js";var Z=n(),pt=e=>e.postedAt===null?e.attemptEndedAt===null?null:{at:e.attemptEndedAt,title:`Posted during the attempt that ended ${x(e.attemptEndedAt)}`}:{at:e.postedAt,title:`Posted ${x(e.postedAt)}`},mt=({task:e})=>{let t=F(),n=new Map((e.commentRuns??e.runs).map(e=>[e.id,e])),r=new Map(e.items.map(e=>[e.itemKey,e]));return(0,Z.jsxs)(`section`,{"aria-labelledby":`task-comments`,className:`flex flex-col gap-2`,children:[(0,Z.jsx)(K,{id:`task-comments`,title:`Comments and reviews`,count:e.comments.length}),e.comments.length===0?(0,Z.jsx)(J,{title:`No comments or reviews`,children:`Comments and reviews an agent posts on the task's items appear here after the attempt ends`}):(0,Z.jsx)(`div`,{className:`-mx-2`,children:(0,Z.jsx)(U,{"aria-labelledby":`task-comments`,children:(0,Z.jsx)(B,{className:`border-t`,children:e.comments.map(e=>{let i=n.get(e.runId),a=i===void 0?void 0:r.get(i.itemKey),o=pt(e);return(0,Z.jsxs)(V,{className:q,children:[(0,Z.jsx)(W,{className:`py-3 whitespace-normal`,children:(0,Z.jsxs)(`a`,{"data-row-link":!0,href:e.url,target:`_blank`,rel:`noreferrer`,className:`font-medium ${G}`,children:[Qe(e.kind),a!==void 0&&(0,Z.jsxs)(`span`,{className:`ml-2 text-xs font-normal text-muted-foreground`,children:[`on `,(0,Z.jsx)(A,{item:a,linked:!1})]})]})}),(0,Z.jsx)(H,{className:`py-3`,children:i!==void 0&&(0,Z.jsx)(l,{...t.run(i.repository,i.id),className:`relative z-10 rounded-sm text-muted-foreground underline-offset-4 outline-none hover:text-foreground hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring/70 focus-visible:outline-solid`,children:i.loop})}),(0,Z.jsx)(H,{className:`py-3 text-right`,children:o!==null&&(0,Z.jsx)(`time`,{dateTime:o.at,title:o.title,className:`font-mono text-xs text-muted-foreground tabular-nums`,children:b(o.at)})})]},e.url)})})})})]})},ht=({task:e,project:t,disabled:n})=>{let r=ve(t),[i]=e.items,a=e.items.find(({itemKey:t})=>t===e.current)??i,o=t.board.lanes.flatMap(e=>e.items.map(t=>({lane:e,card:t}))).find(({card:t})=>t.itemKey===e.current),s=o===void 0?void 0:r.moves.find(({itemKey:e})=>e===o.card.itemKey),c=o===void 0?[]:t.board.lanes.filter(e=>e._tag===`WritableBoardLane`&&e.id!==o.lane.id),l=t.board.lanes.find(({id:e})=>e===s?.toLane)?.name??o?.lane.name??e.lane.name,d=new Set(t.board.lanes.flatMap(e=>e._tag===`WritableBoardLane`?e.labels:[])),f=o===void 0?a.labels:_e(o.card,o.lane).filter(e=>s===void 0||!d.has(e)),p=new Map(t.labels.map(e=>[e.name,e])),m=!n&&!r.isPending&&s===void 0&&c.length>0;k(o!==void 0&&m?c.map(e=>({label:ge(e.name),run:()=>r.moveItem(o.card,e)})):[]);let{origin:h,pullRequests:g}=xe(e.items);return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Z.jsx)(ae,{actionsBeside:`sm`,heading:(0,Z.jsx)(De,{variant:`page`,item:u(h),title:e.title}),facts:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Ge,{pullRequests:g}),(0,Z.jsx)(ie,{icon:Le,title:`Lane`,children:(0,Z.jsx)(`span`,{className:`text-foreground`,children:l})}),s!==void 0&&(0,Z.jsx)(`span`,{role:`status`,children:pe(s.phase)}),f.length>0&&(0,Z.jsx)(`span`,{className:`flex flex-wrap gap-1`,children:f.map(e=>(0,Z.jsx)(Xe,{name:e,label:p.get(e)},e))}),e.needsYou&&(0,Z.jsx)(Ke,{})]}),...o!==void 0&&m?{actions:(0,Z.jsxs)(N,{children:[(0,Z.jsxs)(M,{render:(0,Z.jsx)(v,{variant:`outline`}),"aria-label":`Move ${Ce(a)} to another lane`,children:[`Move to`,(0,Z.jsx)(ye,{"data-icon":`inline-end`,"aria-hidden":`true`})]}),(0,Z.jsx)(I,{align:`end`,className:`w-auto min-w-40`,children:(0,Z.jsx)(L,{children:c.map(e=>(0,Z.jsx)(P,{onClick:()=>r.moveItem(o.card,e),children:e.name},e.id))})})]})}:{}}),r.error!==null&&(0,Z.jsx)(O,{className:`max-w-3xl`,message:r.error.message})]})},Q=e(t(),1),gt=(0,Q.lazy)(()=>ne(async()=>{let{PullRequestDiff:e}=await import(`./diff-DxsEDkne.js`);return{PullRequestDiff:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])).then(({PullRequestDiff:e})=>({default:e}))),$=()=>(0,Z.jsxs)(`div`,{role:`status`,"aria-label":it,className:`space-y-2 py-2`,children:[(0,Z.jsx)(D,{className:`h-8 w-full`}),(0,Z.jsx)(D,{className:`h-8 w-full`})]}),_t=({project:e,task:t,number:n,state:i,attempts:o})=>{let{repository:s}=t,c=(0,Q.useId)(),l=r(),[u,d]=(0,Q.useState)(`whole`),f=o.filter(({base:e,head:t})=>e!==t),p=f.find(({attemptId:e})=>e===u),h=p===void 0?ee.make({base:i.base,head:i.head}):te.make({base:p.base,head:p.head}),g=a(we(e,s,n,h)),y=async()=>{m(_)(g.error)&&g.error.error===`PullRequestFilesChangedError`&&await l.invalidateQueries({queryKey:j(t.repository,t.number).queryKey,exact:!0}),await g.refetch()};return(0,Z.jsxs)(`div`,{className:`min-w-0 space-y-3 pb-3`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-5 gap-y-2 text-xs text-muted-foreground`,children:[(0,Z.jsx)(`div`,{className:`flex min-w-0 items-center gap-2`,children:f.length===0?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{children:Y}),(0,Z.jsx)(`span`,{className:`text-foreground`,children:X})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`label`,{htmlFor:c,children:Y}),(0,Z.jsxs)(be,{id:c,value:p===void 0?`whole`:u,onChange:e=>d(e.target.value),className:`min-w-0 max-w-full`,children:[(0,Z.jsx)(E,{value:`whole`,children:X}),f.map(e=>(0,Z.jsx)(E,{value:e.attemptId,children:ct(e.loop,e.number,e.head)},e.attemptId))]})]})}),p===void 0&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`a`,{className:`underline-offset-4 hover:underline`,href:`https://github.com/${s}/pull/${n}/checks`,target:`_blank`,rel:`noreferrer`,children:lt(i.checks)}),(0,Z.jsx)(`span`,{children:at(i.review)})]})]}),f.length===0&&(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:o.length===0?`No attempt commits recorded for this pull request`:`Attempts on this pull request pushed no new commits`}),g.isPending?(0,Z.jsx)($,{}):g.isError?(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsx)(O,{title:ut,message:g.error.message}),(0,Z.jsx)(v,{variant:`outline`,size:`sm`,onClick:()=>void y(),children:st})]}):(0,Z.jsxs)(Z.Fragment,{children:[g.data.filesTruncated&&(0,Z.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:`GitHub limited this file list. Open the pull request on GitHub for the full list.`}),g.data.files.length===0?(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:ft}):(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsx)($,{}),children:(0,Z.jsx)(gt,{changes:g.data,repository:s},`${g.data.base}:${g.data.head}`)})]})]})},vt=({project:e,task:t,pullRequest:n})=>{let[r,i]=(0,Q.useState)(!1);return(0,Z.jsxs)(`details`,{className:`group/changes min-w-0`,onToggle:e=>i(e.currentTarget.open),children:[(0,Z.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-2 py-2 text-sm font-medium focus-visible:rounded-sm focus-visible:outline-2 focus-visible:outline-ring [&::-webkit-details-marker]:hidden`,children:[(0,Z.jsx)(Ue,{"aria-hidden":`true`,className:`size-3.5 shrink-0 group-open/changes:rotate-90`}),rt]}),r&&(0,Z.jsx)(`section`,{"aria-label":ot(n.number),className:`min-w-0 pt-1`,children:n.pullRequest===null?(0,Z.jsx)(`p`,{className:`pb-3 text-xs text-muted-foreground`,children:`Pull request base or head not recorded yet`}):(0,Z.jsx)(_t,{project:e,task:t,number:n.number,state:n.pullRequest,attempts:t.attemptChanges.filter(e=>e.pullRequest===n.number)})})]})},yt=({task:e,project:t})=>{let n=e.items.filter(({kind:e})=>e===`pr`);return(0,Z.jsxs)(`section`,{"aria-labelledby":`task-pull-requests`,className:`flex flex-col gap-2`,children:[(0,Z.jsx)(K,{id:`task-pull-requests`,title:`Pull requests`,count:n.length}),n.length===0?(0,Z.jsx)(J,{title:`No pull requests`,children:`Pull requests that close the issue, or that a run on the issue opened, appear here`}):(0,Z.jsx)(`div`,{className:`-mx-2`,children:(0,Z.jsx)(U,{"aria-labelledby":`task-pull-requests`,children:(0,Z.jsx)(B,{className:`border-t`,children:n.map(n=>(0,Z.jsxs)(Q.Fragment,{children:[(0,Z.jsxs)(V,{className:q,children:[(0,Z.jsx)(H,{className:`w-0 py-3`,children:(0,Z.jsx)(A,{item:n,linked:!1})}),(0,Z.jsx)(W,{className:`py-3 whitespace-normal`,children:(0,Z.jsxs)(`a`,{"data-row-link":!0,href:n.url,target:`_blank`,rel:`noreferrer`,className:`font-medium wrap-anywhere ${G}`,children:[n.title,(0,Z.jsx)(he,{className:`ml-1.5 inline size-3.5 text-muted-foreground`,"aria-label":`Opens on GitHub`})]})}),(0,Z.jsx)(H,{className:`py-3 text-right`,children:n.conflicting&&(0,Z.jsx)(`span`,{className:`text-xs text-destructive`,children:`Conflicts with base`})})]}),t!==void 0&&(0,Z.jsx)(V,{className:`hover:bg-transparent has-aria-expanded:bg-transparent`,children:(0,Z.jsx)(H,{colSpan:3,className:`max-w-0 pt-0 pb-1`,children:(0,Z.jsx)(vt,{project:t,task:e,pullRequest:n})})})]},n.itemKey))})})})]})},bt=({run:e})=>{let t=re(3e4);return d($e(e,t),{onNone:()=>null,onSome:e=>(0,Z.jsx)(`span`,{className:`font-mono text-xs tabular-nums`,title:`Total attempt time`,children:oe(e)})})},xt=({run:e})=>d(Ze(e),{onNone:()=>null,onSome:e=>(0,Z.jsxs)(`p`,{className:`line-clamp-2 text-xs wrap-anywhere`,title:S(e),children:[(0,Z.jsx)(`span`,{className:`font-medium text-destructive`,children:se(e)}),` `,(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:S(e)})]})}),St=({run:e})=>(0,Z.jsx)(`time`,{dateTime:e.openedAt,title:`Opened ${x(e.openedAt)}`,className:`font-mono text-xs whitespace-nowrap tabular-nums`,children:b(e.openedAt)}),Ct=({pullRequest:e})=>d(e,{onNone:()=>null,onSome:e=>(0,Z.jsx)(A,{item:e,className:`relative z-10`})}),wt=(e,t)=>`${e} ${t}${e===1?``:`s`}`,Tt=({run:e,pullRequest:t})=>(0,Z.jsxs)(`p`,{className:`flex flex-wrap items-baseline gap-x-3 gap-y-0.5 text-xs text-muted-foreground xl:hidden`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-foreground sm:hidden`,children:e.state}),(0,Z.jsx)(`span`,{children:e.agent}),(0,Z.jsx)(`span`,{children:wt(e.attempts.length,`attempt`)}),(0,Z.jsx)(bt,{run:e}),(0,Z.jsx)(St,{run:e}),(0,Z.jsx)(Ct,{pullRequest:t})]}),Et=e=>e.canApprove?`approve`:e.canRetry&&e.canResolveFailure?`retry`:null,Dt=({run:e,onEdit:t,openRun:n,status:r})=>{let i=Ne(e.repository),a=Pe(),o=Oe(),[s,c]=(0,Q.useState)(!1),l=t=>a.mutate({runId:e.id,request:t},{onSuccess:()=>r(null),onError:e=>r((0,Z.jsx)(`span`,{className:`text-destructive`,children:e.message}))}),u=()=>o.mutate(Be(e),{onSuccess:e=>{e._tag===`Claimed`?(r(null),n(e.runId)):r((0,Z.jsx)(`span`,{className:`text-needs-you`,children:ue}))},onError:e=>r((0,Z.jsx)(`span`,{className:`text-destructive`,children:e.message}))}),d=e.attempts.at(-1),f=Et(e),p=d?.outcome?._tag===`Failed`&&d.outcome.failure._tag===`QuestionFailure`,m=[];return e.canApprove&&f!==`approve`&&m.push({label:T.approve,select:()=>l({action:`approve`})}),e.canRetry&&f!==`retry`&&m.push({label:T.retry,description:C(e.agentBrain),select:()=>l({action:`retry`})}),e.canRetry&&m.push({label:`Edit and retry`,select:()=>t(`retry`)}),e.canRunAgain&&(m.push({label:T.runAgain,select:u}),m.push({label:`Edit and run again`,select:()=>t(`runAgain`)})),e.canResolveFailure&&d!==void 0&&m.push({label:p?`Mark answered`:`Mark resolved`,select:()=>l({action:`resolveFailure`,attemptId:d.id})}),e.canCancel&&m.push({label:T.cancel,destructive:!0,select:()=>c(!0)}),k(!i||a.isPending||o.isPending||s?[]:[...f===null?[]:[{label:T[f],select:()=>l({action:f})}],...m].map(({label:t,select:n})=>({label:`${t} · ${e.loop} · ${e.id.slice(0,8)}`,run:n}))),i?a.isPending&&a.variables!==void 0?(0,Z.jsx)(`span`,{role:`status`,className:`text-xs text-muted-foreground`,children:ce[a.variables.request.action]}):o.isPending?(0,Z.jsx)(`span`,{role:`status`,className:`text-xs text-muted-foreground`,children:le}):(0,Z.jsxs)(`div`,{className:`relative z-10 flex items-center justify-end gap-1`,children:[f!==null&&(0,Z.jsx)(v,{variant:`outline`,size:`sm`,title:f===`retry`?C(e.agentBrain):void 0,onClick:()=>l({action:f}),children:T[f]}),m.length>0&&(0,Z.jsxs)(N,{children:[(0,Z.jsx)(M,{render:(0,Z.jsx)(v,{variant:`ghost`,size:`icon-sm`,className:`text-muted-foreground hover:text-foreground aria-expanded:text-foreground`}),"aria-label":`Actions for the ${e.loop} run opened ${b(e.openedAt)}`,children:(0,Z.jsx)(ke,{weight:`bold`,className:`size-4`,"aria-hidden":`true`})}),(0,Z.jsx)(I,{align:`end`,className:`w-auto min-w-44`,children:(0,Z.jsx)(L,{children:m.map(({label:e,description:t,destructive:n,select:r})=>(0,Z.jsx)(P,{title:t,variant:n===!0?`destructive`:`default`,onClick:r,children:e},e))})})]}),e.canCancel&&(0,Z.jsx)(Ve,{open:s,onOpenChange:c,children:(0,Z.jsxs)(We,{children:[(0,Z.jsxs)(ze,{children:[(0,Z.jsxs)(Ie,{children:[`Cancel `,e.loop,`?`]}),(0,Z.jsx)(je,{children:`The run stops, including any attempt in progress.`})]}),(0,Z.jsxs)(Me,{children:[(0,Z.jsx)(Fe,{children:T.keepRunning}),(0,Z.jsx)(Ae,{variant:`destructive`,onClick:()=>{c(!1),l({action:`cancel`})},children:T.confirmCancel})]})]})})]}):null},Ot=8,kt=({run:e,item:t,pullRequest:n,openRun:r})=>{let i=F(),[a,o]=(0,Q.useState)(null),[s,c]=(0,Q.useState)(null);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(V,{className:g(q,`[&>td]:align-top`),children:[(0,Z.jsx)(H,{className:`hidden py-3 sm:table-cell`,children:(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-foreground`,children:[(0,Z.jsx)(R,{state:e.state,className:`ml-0.75`}),e.state]})}),(0,Z.jsx)(W,{className:`py-3 whitespace-normal`,children:(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,Z.jsxs)(`p`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,Z.jsx)(R,{state:e.state,className:`ml-0.75 self-center sm:hidden`}),(0,Z.jsx)(l,{"data-row-link":!0,...i.run(e.repository,e.id),className:g(`font-medium wrap-anywhere`,G),children:e.loop}),t!==null&&(0,Z.jsx)(A,{item:t,className:`relative z-10 shrink-0`})]}),(0,Z.jsx)(xt,{run:e}),e.runAgain!==null&&(0,Z.jsx)(tt,{run:e,source:`link`,className:`text-xs`}),e.approval!==null&&(0,Z.jsx)(et,{approval:e.approval,className:`text-xs`}),(0,Z.jsx)(Tt,{run:e,pullRequest:n}),s!==null&&(0,Z.jsx)(`p`,{role:`status`,className:`text-xs`,children:s})]})}),(0,Z.jsx)(H,{className:`hidden py-3 xl:table-cell`,children:e.agent}),(0,Z.jsx)(H,{className:`hidden py-3 text-right tabular-nums xl:table-cell`,children:e.attempts.length}),(0,Z.jsx)(H,{className:`hidden py-3 text-right xl:table-cell`,children:(0,Z.jsx)(bt,{run:e})}),(0,Z.jsx)(H,{className:`hidden py-3 xl:table-cell`,children:(0,Z.jsx)(St,{run:e})}),(0,Z.jsx)(H,{className:`hidden py-3 xl:table-cell`,children:(0,Z.jsx)(Ct,{pullRequest:n})}),(0,Z.jsx)(H,{className:`py-2.5`,children:(0,Z.jsx)(Dt,{run:e,onEdit:o,openRun:r,status:c})})]}),a!==null&&qe(e,a)&&(0,Z.jsx)(V,{className:`hover:bg-transparent`,children:(0,Z.jsx)(H,{colSpan:Ot,className:`px-2 pt-1 pb-4 whitespace-normal`,children:(0,Z.jsx)(Je,{run:e,intent:a,close:()=>o(null),openRun:r,className:`max-w-2xl rounded-lg border p-4`},`${e.id}:${a}`)})})]})},At=({task:e,openRun:t})=>{let n=i(Te(e)),r=n.data.pages.flatMap(({runs:e})=>e),a=(0,Q.useRef)(null),o=(0,Q.useRef)(null),s=me({count:r.length,getScrollElement:()=>o.current?.closest(`.overflow-y-auto`)??null,estimateSize:()=>80,overscan:8,enabled:r.length>=50,scrollMargin:o.current?.offsetTop??0}),c=s.getVirtualItems(),l=c.at(-1)?.index??0;(0,Q.useEffect)(()=>{n.hasNextPage&&!n.isFetchingNextPage&&l>=r.length-8&&n.fetchNextPage()},[n.hasNextPage,n.isFetchingNextPage,n.fetchNextPage,l,r.length]),(0,Q.useEffect)(()=>{let e=a.current;if(e===null||!n.hasNextPage||n.isFetchingNextPage)return;let t=new IntersectionObserver(e=>{e.some(({isIntersecting:e})=>e)&&n.fetchNextPage()},{root:o.current?.closest(`.overflow-y-auto`)??null,rootMargin:`200px`});return t.observe(e),()=>t.disconnect()},[n.hasNextPage,n.isFetchingNextPage,n.fetchNextPage]);let u=new Map(e.items.map(e=>[e.itemKey,e])),d=e.items.length>1;return(0,Z.jsxs)(`section`,{ref:o,"aria-labelledby":`task-runs`,className:`flex flex-col gap-2`,children:[(0,Z.jsx)(K,{id:`task-runs`,title:`Runs`,count:e.runsTotal??e.runs.length}),r.length===0?(0,Z.jsx)(J,{title:`No runs yet`,children:`A run opens when a loop's trigger matches one of the task's items`}):(0,Z.jsx)(`div`,{className:`-mx-2`,children:(0,Z.jsxs)(U,{children:[(0,Z.jsx)(Ye,{children:(0,Z.jsxs)(V,{className:`hover:bg-transparent`,children:[(0,Z.jsx)(z,{className:`hidden sm:table-cell`,children:`State`}),(0,Z.jsx)(z,{children:`Run`}),(0,Z.jsx)(z,{className:`hidden xl:table-cell`,children:`Agent`}),(0,Z.jsx)(z,{className:`hidden text-right xl:table-cell`,children:`Attempts`}),(0,Z.jsx)(z,{className:`hidden text-right xl:table-cell`,children:`Duration`}),(0,Z.jsx)(z,{className:`hidden xl:table-cell`,children:`Opened`}),(0,Z.jsx)(z,{className:`hidden xl:table-cell`,children:`Pull request`}),(0,Z.jsx)(z,{children:(0,Z.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),r.length>=50&&(0,Z.jsx)(`tbody`,{children:(0,Z.jsx)(`tr`,{"aria-hidden":`true`,children:(0,Z.jsx)(`td`,{colSpan:8,style:{height:Math.max(0,(c[0]?.start??0)-s.options.scrollMargin)}})})}),(r.length>=50?c:r.map((e,t)=>({index:t,key:t}))).map(n=>{let i=r[n.index];if(i===void 0)return null;let a=h(f(i.pullRequestUrl),t=>Se(t,e.items)),o=d?u.get(i.itemKey)??null:null;return(0,Z.jsx)(B,{"data-index":n.index,ref:r.length>=50?s.measureElement:void 0,children:(0,Z.jsx)(kt,{run:i,item:o===null||p(a,({number:e})=>e===o.number)?null:o,pullRequest:a,openRun:t})},i.id)}),r.length>=50&&(0,Z.jsx)(`tbody`,{children:(0,Z.jsx)(`tr`,{"aria-hidden":`true`,children:(0,Z.jsx)(`td`,{colSpan:8,style:{height:Math.max(0,s.getTotalSize()-((c.at(-1)?.end??0)-s.options.scrollMargin))}})})})]})}),(0,Z.jsx)(`div`,{ref:a,"aria-hidden":`true`}),n.isFetchingNextPage&&(0,Z.jsx)(`p`,{role:`status`,children:`Loading runs…`}),n.isError&&(0,Z.jsx)(`button`,{type:`button`,onClick:()=>void n.refetch(),children:`Could not load runs. Retry`})]})},jt=({children:e})=>(0,Z.jsx)(`main`,{className:`px-4 pt-5 pb-10 md:px-5`,children:(0,Z.jsx)(`div`,{className:`flex max-w-5xl flex-col gap-8`,children:e})}),Mt=({repository:e,number:t})=>{let{data:n}=o(fe()),r=de(n.projects,e),i=Ee(r===void 0?y.make(`missing`):w(r)),l=a({...i,enabled:r!==void 0}).data??r,u=s(),d=Re(),f=o(j(e,t));if(m(_)(f.error)&&f.error.error===`BoardItemNotFoundError`)return(0,Z.jsx)(dt,{repository:e,number:String(t)});let p=f.isError&&(0,Z.jsx)(O,{className:`max-w-3xl`,title:`Could not refresh the task`,message:f.error.message}),h=f.data;return h.number!==t&&l!==void 0?(0,Z.jsx)(c,{to:`/projects/$project/tasks/$number`,params:{project:w(l),number:String(h.number)},search:t=>({...t,repository:e}),replace:!0}):(0,Z.jsxs)(jt,{children:[l!==void 0&&l.repositories.length>1&&(0,Z.jsx)(nt,{repositories:l.repositories,value:e,onChange:e=>void u({to:`/projects/$project/tasks`,params:{project:w(l)},search:{repository:e}})}),p,l!==void 0&&(0,Z.jsx)(ht,{task:h,project:l,disabled:n._tag===`NeedsSetup`}),(0,Z.jsx)(At,{task:h,openRun:d}),(0,Z.jsx)(yt,{task:h,project:l===void 0?void 0:w(l)}),(0,Z.jsx)(mt,{task:h})]})},Nt=()=>{let{repository:e,number:t}=He.useLoaderData();return(0,Z.jsx)(Mt,{repository:e,number:t},`${e}#${t}`)};export{Nt as component};
2
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{n as t,t as n}from"./jsx-runtime-C3cWAN_r.js";import{F as r}from"./useBaseQuery-Dc10zv_h.js";import{t as i}from"./useInfiniteQuery-BM0Jy2se.js";import{t as a}from"./useQuery-vsTuI6W-.js";import{t as o}from"./useSuspenseQuery-Q36G6iE9.js";import{n as s,t as c}from"./useNavigate-CG-UHNSo.js";import{t as l}from"./link-l4ws0FnP.js";import{As as u,Ds as d,_s as f,fs as p,gt as m,hs as h}from"./Fiber-BdWb6IYe.js";import{A as g,Z as _,bn as ee,t as v,xn as y,yn as te}from"./button-B_wpMfoU.js";import{t as ne}from"./preload-helper-BLdHbfdN.js";import{a as re,n as ie,r as ae}from"./page-B5q3ShED.js";import{c as oe,s as b,x}from"./strings-6CUMEccc.js";import{F as S,I as se,J as ce,K as C,X as le,Y as ue,a as w,i as de,q as T,r as fe}from"./overview-Cf1EaGd5.js";import{c as pe,d as me,f as he,l as ge,n as _e,t as ve}from"./moves-4eVFsVSm.js";import{n as E,r as ye,t as be}from"./native-select-zTpHWMRD.js";import{c as xe,o as Se}from"./useTriggerFocusGuards-08dQykHh.js";import{t as D}from"./skeleton-BmM4Alte.js";import{t as O}from"./error-alert-DXxL8kJu.js";import{i as k}from"./context-NRsMJqQa.js";import{r as Ce,t as A}from"./mark-BJvMuc9Z.js";import{n as we,r as Te,t as Ee}from"./queries-Db0cAsXY.js";import{n as j}from"./queries-CyI_Gl2p.js";import{At as De,Et as M,_t as N,at as Oe,bt as P,cn as ke,ct as Ae,dt as je,ft as Me,hn as Ne,it as Pe,kt as F,lt as Fe,mt as Ie,on as Le,ot as Re,pt as ze,rt as Be,st as Ve,t as He,un as Ue,ut as We,vt as I,yt as L}from"./index-BhH8XWzB.js";import{t as Ge}from"./pull-request-marks-Cc9TmOyj.js";import{n as R,t as Ke}from"./status-badge-lMqS2smw.js";import{n as qe,t as Je}from"./edit-and-retry-YC_kJKBK.js";import{a as Ye,i as z,n as B,o as V,r as H,t as U}from"./table-BzYq3WJ7.js";import{t as W}from"./fill-cell-Dh_4y6F5.js";import{t as Xe}from"./label-badge-CuJIC6DQ.js";import{a as Ze,n as Qe,t as $e}from"./model-C-f-ObW7.js";import{n as et,t as tt}from"./run-again-Db-OxdfX.js";import{a as nt,i as G,n as K,r as q,t as J}from"./section-DUpW9pom.js";import{a as rt,c as it,g as at,i as ot,m as st,n as ct,o as lt,r as ut,s as Y,t as dt,u as ft,y as X}from"./not-found-C4gl-kkH.js";var Z=n(),pt=e=>e.postedAt===null?e.attemptEndedAt===null?null:{at:e.attemptEndedAt,title:`Posted during the attempt that ended ${x(e.attemptEndedAt)}`}:{at:e.postedAt,title:`Posted ${x(e.postedAt)}`},mt=({task:e})=>{let t=F(),n=new Map((e.commentRuns??e.runs).map(e=>[e.id,e])),r=new Map(e.items.map(e=>[e.itemKey,e]));return(0,Z.jsxs)(`section`,{"aria-labelledby":`task-comments`,className:`flex flex-col gap-2`,children:[(0,Z.jsx)(K,{id:`task-comments`,title:`Comments and reviews`,count:e.comments.length}),e.comments.length===0?(0,Z.jsx)(J,{title:`No comments or reviews`,children:`Comments and reviews an agent posts on the task's items appear here after the attempt ends`}):(0,Z.jsx)(`div`,{className:`-mx-2`,children:(0,Z.jsx)(U,{"aria-labelledby":`task-comments`,children:(0,Z.jsx)(B,{className:`border-t`,children:e.comments.map(e=>{let i=n.get(e.runId),a=i===void 0?void 0:r.get(i.itemKey),o=pt(e);return(0,Z.jsxs)(V,{className:q,children:[(0,Z.jsx)(W,{className:`py-3 whitespace-normal`,children:(0,Z.jsxs)(`a`,{"data-row-link":!0,href:e.url,target:`_blank`,rel:`noreferrer`,className:`font-medium ${G}`,children:[Qe(e.kind),a!==void 0&&(0,Z.jsxs)(`span`,{className:`ml-2 text-xs font-normal text-muted-foreground`,children:[`on `,(0,Z.jsx)(A,{item:a,linked:!1})]})]})}),(0,Z.jsx)(H,{className:`py-3`,children:i!==void 0&&(0,Z.jsx)(l,{...t.run(i.repository,i.id),className:`relative z-10 rounded-sm text-muted-foreground underline-offset-4 outline-none hover:text-foreground hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring/70 focus-visible:outline-solid`,children:i.loop})}),(0,Z.jsx)(H,{className:`py-3 text-right`,children:o!==null&&(0,Z.jsx)(`time`,{dateTime:o.at,title:o.title,className:`font-mono text-xs text-muted-foreground tabular-nums`,children:b(o.at)})})]},e.url)})})})})]})},ht=({task:e,project:t,disabled:n})=>{let r=ve(t),[i]=e.items,a=e.items.find(({itemKey:t})=>t===e.current)??i,o=t.board.lanes.flatMap(e=>e.items.map(t=>({lane:e,card:t}))).find(({card:t})=>t.itemKey===e.current),s=o===void 0?void 0:r.moves.find(({itemKey:e})=>e===o.card.itemKey),c=o===void 0?[]:t.board.lanes.filter(e=>e._tag===`WritableBoardLane`&&e.id!==o.lane.id),l=t.board.lanes.find(({id:e})=>e===s?.toLane)?.name??o?.lane.name??e.lane.name,d=new Set(t.board.lanes.flatMap(e=>e._tag===`WritableBoardLane`?e.labels:[])),f=o===void 0?a.labels:_e(o.card,o.lane).filter(e=>s===void 0||!d.has(e)),p=new Map(t.labels.map(e=>[e.name,e])),m=!n&&!r.isPending&&s===void 0&&c.length>0;k(o!==void 0&&m?c.map(e=>({label:ge(e.name),run:()=>r.moveItem(o.card,e)})):[]);let{origin:h,pullRequests:g}=xe(e.items);return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Z.jsx)(ae,{actionsBeside:`sm`,heading:(0,Z.jsx)(De,{variant:`page`,item:u(h),title:e.title}),facts:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Ge,{pullRequests:g}),(0,Z.jsx)(ie,{icon:Le,title:`Lane`,children:(0,Z.jsx)(`span`,{className:`text-foreground`,children:l})}),s!==void 0&&(0,Z.jsx)(`span`,{role:`status`,children:pe(s.phase)}),f.length>0&&(0,Z.jsx)(`span`,{className:`flex flex-wrap gap-1`,children:f.map(e=>(0,Z.jsx)(Xe,{name:e,label:p.get(e)},e))}),e.needsYou&&(0,Z.jsx)(Ke,{})]}),...o!==void 0&&m?{actions:(0,Z.jsxs)(N,{children:[(0,Z.jsxs)(M,{render:(0,Z.jsx)(v,{variant:`outline`}),"aria-label":`Move ${Ce(a)} to another lane`,children:[`Move to`,(0,Z.jsx)(ye,{"data-icon":`inline-end`,"aria-hidden":`true`})]}),(0,Z.jsx)(I,{align:`end`,className:`w-auto min-w-40`,children:(0,Z.jsx)(L,{children:c.map(e=>(0,Z.jsx)(P,{onClick:()=>r.moveItem(o.card,e),children:e.name},e.id))})})]})}:{}}),r.error!==null&&(0,Z.jsx)(O,{className:`max-w-3xl`,message:r.error.message})]})},Q=e(t(),1),gt=(0,Q.lazy)(()=>ne(async()=>{let{PullRequestDiff:e}=await import(`./diff-DxsEDkne.js`);return{PullRequestDiff:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])).then(({PullRequestDiff:e})=>({default:e}))),$=()=>(0,Z.jsxs)(`div`,{role:`status`,"aria-label":it,className:`space-y-2 py-2`,children:[(0,Z.jsx)(D,{className:`h-8 w-full`}),(0,Z.jsx)(D,{className:`h-8 w-full`})]}),_t=({project:e,task:t,number:n,state:i,attempts:o})=>{let{repository:s}=t,c=(0,Q.useId)(),l=r(),[u,d]=(0,Q.useState)(`whole`),f=o.filter(({base:e,head:t})=>e!==t),p=f.find(({attemptId:e})=>e===u),h=p===void 0?ee.make({base:i.base,head:i.head}):te.make({base:p.base,head:p.head}),g=a(we(e,s,n,h)),y=async()=>{m(_)(g.error)&&g.error.error===`PullRequestFilesChangedError`&&await l.invalidateQueries({queryKey:j(t.repository,t.number).queryKey,exact:!0}),await g.refetch()};return(0,Z.jsxs)(`div`,{className:`min-w-0 space-y-3 pb-3`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-5 gap-y-2 text-xs text-muted-foreground`,children:[(0,Z.jsx)(`div`,{className:`flex min-w-0 items-center gap-2`,children:f.length===0?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{children:Y}),(0,Z.jsx)(`span`,{className:`text-foreground`,children:X})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`label`,{htmlFor:c,children:Y}),(0,Z.jsxs)(be,{id:c,value:p===void 0?`whole`:u,onChange:e=>d(e.target.value),className:`min-w-0 max-w-full`,children:[(0,Z.jsx)(E,{value:`whole`,children:X}),f.map(e=>(0,Z.jsx)(E,{value:e.attemptId,children:ct(e.loop,e.number,e.head)},e.attemptId))]})]})}),p===void 0&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`a`,{className:`underline-offset-4 hover:underline`,href:`https://github.com/${s}/pull/${n}/checks`,target:`_blank`,rel:`noreferrer`,children:lt(i.checks)}),(0,Z.jsx)(`span`,{children:at(i.review)})]})]}),f.length===0&&(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:o.length===0?`No attempt commits recorded for this pull request`:`Attempts on this pull request pushed no new commits`}),g.isPending?(0,Z.jsx)($,{}):g.isError?(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsx)(O,{title:ut,message:g.error.message}),(0,Z.jsx)(v,{variant:`outline`,size:`sm`,onClick:()=>void y(),children:st})]}):(0,Z.jsxs)(Z.Fragment,{children:[g.data.filesTruncated&&(0,Z.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:`GitHub limited this file list. Open the pull request on GitHub for the full list.`}),g.data.files.length===0?(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:ft}):(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsx)($,{}),children:(0,Z.jsx)(gt,{changes:g.data,repository:s},`${g.data.base}:${g.data.head}`)})]})]})},vt=({project:e,task:t,pullRequest:n})=>{let[r,i]=(0,Q.useState)(!1);return(0,Z.jsxs)(`details`,{className:`group/changes min-w-0`,onToggle:e=>i(e.currentTarget.open),children:[(0,Z.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-2 py-2 text-sm font-medium focus-visible:rounded-sm focus-visible:outline-2 focus-visible:outline-ring [&::-webkit-details-marker]:hidden`,children:[(0,Z.jsx)(Ue,{"aria-hidden":`true`,className:`size-3.5 shrink-0 group-open/changes:rotate-90`}),rt]}),r&&(0,Z.jsx)(`section`,{"aria-label":ot(n.number),className:`min-w-0 pt-1`,children:n.pullRequest===null?(0,Z.jsx)(`p`,{className:`pb-3 text-xs text-muted-foreground`,children:`Pull request base or head not recorded yet`}):(0,Z.jsx)(_t,{project:e,task:t,number:n.number,state:n.pullRequest,attempts:t.attemptChanges.filter(e=>e.pullRequest===n.number)})})]})},yt=({task:e,project:t})=>{let n=e.items.filter(({kind:e})=>e===`pr`);return(0,Z.jsxs)(`section`,{"aria-labelledby":`task-pull-requests`,className:`flex flex-col gap-2`,children:[(0,Z.jsx)(K,{id:`task-pull-requests`,title:`Pull requests`,count:n.length}),n.length===0?(0,Z.jsx)(J,{title:`No pull requests`,children:`Pull requests that close the issue, or that a run on the issue opened, appear here`}):(0,Z.jsx)(`div`,{className:`-mx-2`,children:(0,Z.jsx)(U,{"aria-labelledby":`task-pull-requests`,children:(0,Z.jsx)(B,{className:`border-t`,children:n.map(n=>(0,Z.jsxs)(Q.Fragment,{children:[(0,Z.jsxs)(V,{className:q,children:[(0,Z.jsx)(H,{className:`w-0 py-3`,children:(0,Z.jsx)(A,{item:n,linked:!1})}),(0,Z.jsx)(W,{className:`py-3 whitespace-normal`,children:(0,Z.jsxs)(`a`,{"data-row-link":!0,href:n.url,target:`_blank`,rel:`noreferrer`,className:`font-medium wrap-anywhere ${G}`,children:[n.title,(0,Z.jsx)(he,{className:`ml-1.5 inline size-3.5 text-muted-foreground`,"aria-label":`Opens on GitHub`})]})}),(0,Z.jsx)(H,{className:`py-3 text-right`,children:n.conflicting&&(0,Z.jsx)(`span`,{className:`text-xs text-destructive`,children:`Conflicts with base`})})]}),t!==void 0&&(0,Z.jsx)(V,{className:`hover:bg-transparent has-aria-expanded:bg-transparent`,children:(0,Z.jsx)(H,{colSpan:3,className:`max-w-0 pt-0 pb-1`,children:(0,Z.jsx)(vt,{project:t,task:e,pullRequest:n})})})]},n.itemKey))})})})]})},bt=({run:e})=>{let t=re(3e4);return d($e(e,t),{onNone:()=>null,onSome:e=>(0,Z.jsx)(`span`,{className:`font-mono text-xs tabular-nums`,title:`Total attempt time`,children:oe(e)})})},xt=({run:e})=>d(Ze(e),{onNone:()=>null,onSome:e=>(0,Z.jsxs)(`p`,{className:`line-clamp-2 text-xs wrap-anywhere`,title:S(e),children:[(0,Z.jsx)(`span`,{className:`font-medium text-destructive`,children:se(e)}),` `,(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:S(e)})]})}),St=({run:e})=>(0,Z.jsx)(`time`,{dateTime:e.openedAt,title:`Opened ${x(e.openedAt)}`,className:`font-mono text-xs whitespace-nowrap tabular-nums`,children:b(e.openedAt)}),Ct=({pullRequest:e})=>d(e,{onNone:()=>null,onSome:e=>(0,Z.jsx)(A,{item:e,className:`relative z-10`})}),wt=(e,t)=>`${e} ${t}${e===1?``:`s`}`,Tt=({run:e,pullRequest:t})=>(0,Z.jsxs)(`p`,{className:`flex flex-wrap items-baseline gap-x-3 gap-y-0.5 text-xs text-muted-foreground xl:hidden`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-foreground sm:hidden`,children:e.state}),(0,Z.jsx)(`span`,{children:e.agent}),(0,Z.jsx)(`span`,{children:wt(e.attempts.length,`attempt`)}),(0,Z.jsx)(bt,{run:e}),(0,Z.jsx)(St,{run:e}),(0,Z.jsx)(Ct,{pullRequest:t})]}),Et=e=>e.canApprove?`approve`:e.canRetry&&e.canResolveFailure?`retry`:null,Dt=({run:e,onEdit:t,openRun:n,status:r})=>{let i=Ne(e.repository),a=Pe(),o=Oe(),[s,c]=(0,Q.useState)(!1),l=t=>a.mutate({runId:e.id,request:t},{onSuccess:()=>r(null),onError:e=>r((0,Z.jsx)(`span`,{className:`text-destructive`,children:e.message}))}),u=()=>o.mutate(Be(e),{onSuccess:e=>{e._tag===`Claimed`?(r(null),n(e.runId)):r((0,Z.jsx)(`span`,{className:`text-needs-you`,children:ue}))},onError:e=>r((0,Z.jsx)(`span`,{className:`text-destructive`,children:e.message}))}),d=e.attempts.at(-1),f=Et(e),p=d?.outcome?._tag===`Failed`&&d.outcome.failure._tag===`QuestionFailure`,m=[];return e.canApprove&&f!==`approve`&&m.push({label:T.approve,select:()=>l({action:`approve`})}),e.canRetry&&f!==`retry`&&m.push({label:T.retry,description:C(e.agentBrain),select:()=>l({action:`retry`})}),e.canRetry&&m.push({label:`Edit and retry`,select:()=>t(`retry`)}),e.canRunAgain&&(m.push({label:T.runAgain,select:u}),m.push({label:`Edit and run again`,select:()=>t(`runAgain`)})),e.canResolveFailure&&d!==void 0&&m.push({label:p?`Mark answered`:`Mark resolved`,select:()=>l({action:`resolveFailure`,attemptId:d.id})}),e.canCancel&&m.push({label:T.cancel,destructive:!0,select:()=>c(!0)}),k(!i||a.isPending||o.isPending||s?[]:[...f===null?[]:[{label:T[f],select:()=>l({action:f})}],...m].map(({label:t,select:n})=>({label:`${t} · ${e.loop} · ${e.id.slice(0,8)}`,run:n}))),i?a.isPending&&a.variables!==void 0?(0,Z.jsx)(`span`,{role:`status`,className:`text-xs text-muted-foreground`,children:ce[a.variables.request.action]}):o.isPending?(0,Z.jsx)(`span`,{role:`status`,className:`text-xs text-muted-foreground`,children:le}):(0,Z.jsxs)(`div`,{className:`relative z-10 flex items-center justify-end gap-1`,children:[f!==null&&(0,Z.jsx)(v,{variant:`outline`,size:`sm`,title:f===`retry`?C(e.agentBrain):void 0,onClick:()=>l({action:f}),children:T[f]}),m.length>0&&(0,Z.jsxs)(N,{children:[(0,Z.jsx)(M,{render:(0,Z.jsx)(v,{variant:`ghost`,size:`icon-sm`,className:`text-muted-foreground hover:text-foreground aria-expanded:text-foreground`}),"aria-label":`Actions for the ${e.loop} run opened ${b(e.openedAt)}`,children:(0,Z.jsx)(ke,{weight:`bold`,className:`size-4`,"aria-hidden":`true`})}),(0,Z.jsx)(I,{align:`end`,className:`w-auto min-w-44`,children:(0,Z.jsx)(L,{children:m.map(({label:e,description:t,destructive:n,select:r})=>(0,Z.jsx)(P,{title:t,variant:n===!0?`destructive`:`default`,onClick:r,children:e},e))})})]}),e.canCancel&&(0,Z.jsx)(Ve,{open:s,onOpenChange:c,children:(0,Z.jsxs)(We,{children:[(0,Z.jsxs)(ze,{children:[(0,Z.jsxs)(Ie,{children:[`Cancel `,e.loop,`?`]}),(0,Z.jsx)(je,{children:`The run stops, including any attempt in progress.`})]}),(0,Z.jsxs)(Me,{children:[(0,Z.jsx)(Fe,{children:T.keepRunning}),(0,Z.jsx)(Ae,{variant:`destructive`,onClick:()=>{c(!1),l({action:`cancel`})},children:T.confirmCancel})]})]})})]}):null},Ot=8,kt=({run:e,item:t,pullRequest:n,openRun:r})=>{let i=F(),[a,o]=(0,Q.useState)(null),[s,c]=(0,Q.useState)(null);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(V,{className:g(q,`[&>td]:align-top`),children:[(0,Z.jsx)(H,{className:`hidden py-3 sm:table-cell`,children:(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-foreground`,children:[(0,Z.jsx)(R,{state:e.state,className:`ml-0.75`}),e.state]})}),(0,Z.jsx)(W,{className:`py-3 whitespace-normal`,children:(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,Z.jsxs)(`p`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,Z.jsx)(R,{state:e.state,className:`ml-0.75 self-center sm:hidden`}),(0,Z.jsx)(l,{"data-row-link":!0,...i.run(e.repository,e.id),className:g(`font-medium wrap-anywhere`,G),children:e.loop}),t!==null&&(0,Z.jsx)(A,{item:t,className:`relative z-10 shrink-0`})]}),(0,Z.jsx)(xt,{run:e}),e.runAgain!==null&&(0,Z.jsx)(tt,{run:e,source:`link`,className:`text-xs`}),e.approval!==null&&(0,Z.jsx)(et,{approval:e.approval,className:`text-xs`}),(0,Z.jsx)(Tt,{run:e,pullRequest:n}),s!==null&&(0,Z.jsx)(`p`,{role:`status`,className:`text-xs`,children:s})]})}),(0,Z.jsx)(H,{className:`hidden py-3 xl:table-cell`,children:e.agent}),(0,Z.jsx)(H,{className:`hidden py-3 text-right tabular-nums xl:table-cell`,children:e.attempts.length}),(0,Z.jsx)(H,{className:`hidden py-3 text-right xl:table-cell`,children:(0,Z.jsx)(bt,{run:e})}),(0,Z.jsx)(H,{className:`hidden py-3 xl:table-cell`,children:(0,Z.jsx)(St,{run:e})}),(0,Z.jsx)(H,{className:`hidden py-3 xl:table-cell`,children:(0,Z.jsx)(Ct,{pullRequest:n})}),(0,Z.jsx)(H,{className:`py-2.5`,children:(0,Z.jsx)(Dt,{run:e,onEdit:o,openRun:r,status:c})})]}),a!==null&&qe(e,a)&&(0,Z.jsx)(V,{className:`hover:bg-transparent`,children:(0,Z.jsx)(H,{colSpan:Ot,className:`px-2 pt-1 pb-4 whitespace-normal`,children:(0,Z.jsx)(Je,{run:e,intent:a,close:()=>o(null),openRun:r,className:`max-w-2xl rounded-lg border p-4`},`${e.id}:${a}`)})})]})},At=({task:e,openRun:t})=>{let n=i(Te(e)),r=n.data.pages.flatMap(({runs:e})=>e),a=(0,Q.useRef)(null),o=(0,Q.useRef)(null),s=me({count:r.length,getScrollElement:()=>o.current?.closest(`.overflow-y-auto`)??null,estimateSize:()=>80,overscan:8,enabled:r.length>=50,scrollMargin:o.current?.offsetTop??0}),c=s.getVirtualItems(),l=c.at(-1)?.index??0;(0,Q.useEffect)(()=>{n.hasNextPage&&!n.isFetchingNextPage&&l>=r.length-8&&n.fetchNextPage()},[n.hasNextPage,n.isFetchingNextPage,n.fetchNextPage,l,r.length]),(0,Q.useEffect)(()=>{let e=a.current;if(e===null||!n.hasNextPage||n.isFetchingNextPage)return;let t=new IntersectionObserver(e=>{e.some(({isIntersecting:e})=>e)&&n.fetchNextPage()},{root:o.current?.closest(`.overflow-y-auto`)??null,rootMargin:`200px`});return t.observe(e),()=>t.disconnect()},[n.hasNextPage,n.isFetchingNextPage,n.fetchNextPage]);let u=new Map(e.items.map(e=>[e.itemKey,e])),d=e.items.length>1;return(0,Z.jsxs)(`section`,{ref:o,"aria-labelledby":`task-runs`,className:`flex flex-col gap-2`,children:[(0,Z.jsx)(K,{id:`task-runs`,title:`Runs`,count:e.runsTotal??e.runs.length}),r.length===0?(0,Z.jsx)(J,{title:`No runs yet`,children:`A run opens when a loop's trigger matches one of the task's items`}):(0,Z.jsx)(`div`,{className:`-mx-2`,children:(0,Z.jsxs)(U,{children:[(0,Z.jsx)(Ye,{children:(0,Z.jsxs)(V,{className:`hover:bg-transparent`,children:[(0,Z.jsx)(z,{className:`hidden sm:table-cell`,children:`State`}),(0,Z.jsx)(z,{children:`Run`}),(0,Z.jsx)(z,{className:`hidden xl:table-cell`,children:`Agent`}),(0,Z.jsx)(z,{className:`hidden text-right xl:table-cell`,children:`Attempts`}),(0,Z.jsx)(z,{className:`hidden text-right xl:table-cell`,children:`Duration`}),(0,Z.jsx)(z,{className:`hidden xl:table-cell`,children:`Opened`}),(0,Z.jsx)(z,{className:`hidden xl:table-cell`,children:`Pull request`}),(0,Z.jsx)(z,{children:(0,Z.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),r.length>=50&&(0,Z.jsx)(`tbody`,{children:(0,Z.jsx)(`tr`,{"aria-hidden":`true`,children:(0,Z.jsx)(`td`,{colSpan:8,style:{height:Math.max(0,(c[0]?.start??0)-s.options.scrollMargin)}})})}),(r.length>=50?c:r.map((e,t)=>({index:t,key:t}))).map(n=>{let i=r[n.index];if(i===void 0)return null;let a=h(f(i.pullRequestUrl),t=>Se(t,e.items)),o=d?u.get(i.itemKey)??null:null;return(0,Z.jsx)(B,{"data-index":n.index,ref:r.length>=50?s.measureElement:void 0,children:(0,Z.jsx)(kt,{run:i,item:o===null||p(a,({number:e})=>e===o.number)?null:o,pullRequest:a,openRun:t})},i.id)}),r.length>=50&&(0,Z.jsx)(`tbody`,{children:(0,Z.jsx)(`tr`,{"aria-hidden":`true`,children:(0,Z.jsx)(`td`,{colSpan:8,style:{height:Math.max(0,s.getTotalSize()-((c.at(-1)?.end??0)-s.options.scrollMargin))}})})})]})}),(0,Z.jsx)(`div`,{ref:a,"aria-hidden":`true`}),n.isFetchingNextPage&&(0,Z.jsx)(`p`,{role:`status`,children:`Loading runs…`}),n.isError&&(0,Z.jsx)(`button`,{type:`button`,onClick:()=>void n.refetch(),children:`Could not load runs. Retry`})]})},jt=({children:e})=>(0,Z.jsx)(`main`,{className:`px-4 pt-5 pb-10 md:px-5`,children:(0,Z.jsx)(`div`,{className:`flex max-w-5xl flex-col gap-8`,children:e})}),Mt=({repository:e,number:t})=>{let{data:n}=o(fe()),r=de(n.projects,e),i=Ee(r===void 0?y.make(`missing`):w(r)),l=a({...i,enabled:r!==void 0}).data??r,u=s(),d=Re(),f=o(j(e,t));if(m(_)(f.error)&&f.error.error===`BoardItemNotFoundError`)return(0,Z.jsx)(dt,{repository:e,number:String(t)});let p=f.isError&&(0,Z.jsx)(O,{className:`max-w-3xl`,title:`Could not refresh the task`,message:f.error.message}),h=f.data;return h.number!==t&&l!==void 0?(0,Z.jsx)(c,{to:`/projects/$project/tasks/$number`,params:{project:w(l),number:String(h.number)},search:t=>({...t,repository:e}),replace:!0}):(0,Z.jsxs)(jt,{children:[l!==void 0&&l.repositories.length>1&&(0,Z.jsx)(nt,{repositories:l.repositories,value:e,onChange:e=>void u({to:`/projects/$project/tasks`,params:{project:w(l)},search:{repository:e}})}),p,l!==void 0&&(0,Z.jsx)(ht,{task:h,project:l,disabled:n._tag===`NeedsSetup`}),(0,Z.jsx)(At,{task:h,openRun:d}),(0,Z.jsx)(yt,{task:h,project:l===void 0?void 0:w(l)}),(0,Z.jsx)(mt,{task:h})]})},Nt=()=>{let{repository:e,number:t}=He.useLoaderData();return(0,Z.jsx)(Mt,{repository:e,number:t},`${e}#${t}`)};export{Nt as component};
@@ -1 +1 @@
1
- import{t as e}from"./jsx-runtime-C3cWAN_r.js";import{t}from"./index-Cq5xMfDA.js";import{_ as n,t as r}from"./not-found-BE6pGaWV.js";var i=e(),a=()=>{let{repository:e}=t.useSearch(),{number:a}=t.useParams();return e===void 0?(0,i.jsx)(`p`,{children:n}):(0,i.jsx)(r,{repository:e,number:a})};export{a as notFoundComponent};
1
+ import{t as e}from"./jsx-runtime-C3cWAN_r.js";import{t}from"./index-BhH8XWzB.js";import{_ as n,t as r}from"./not-found-C4gl-kkH.js";var i=e(),a=()=>{let{repository:e}=t.useSearch(),{number:a}=t.useParams();return e===void 0?(0,i.jsx)(`p`,{children:n}):(0,i.jsx)(r,{repository:e,number:a})};export{a as notFoundComponent};
@@ -0,0 +1 @@
1
+ import{t as e}from"./route-status-BCcC0k8s.js";var t=e;export{t as errorComponent};
@@ -1,2 +1,2 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{n as t,t as n}from"./jsx-runtime-C3cWAN_r.js";import{t as r}from"./useInfiniteQuery-BM0Jy2se.js";import{_ as i,a,c as o,d as s,f as c,g as l,h as u,i as d,l as f,m as p,o as m,p as h,r as g,s as _,t as v}from"./sortable.esm-CH2MBXNN.js";import{t as y}from"./useQuery-vsTuI6W-.js";import{t as b}from"./useSuspenseQuery-Q36G6iE9.js";import{n as x}from"./useMutationState-D_2KzpK8.js";import{t as S}from"./link-l4ws0FnP.js";import{gt as C}from"./Fiber-BdWb6IYe.js";import{A as w,Mt as T,W as E,Z as D,ln as O,t as k,xn as A}from"./button-Dy2BwcbE.js";import{a as j,i as M}from"./page-BJ9RNBzB.js";import{l as N,x as P}from"./strings-6CUMEccc.js";import{H as F,J as ee,K as I,R as te,X as ne,a as L,o as re,q as R,r as ie}from"./overview-Dmd3TFds.js";import{a as ae,c as oe,d as se,f as ce,i as le,n as ue,o as de,r as fe,t as pe}from"./moves-ByPNlnr2.js";import{t as z}from"./error-alert-DcRaRQK1.js";import{i as me}from"./context-NRsMJqQa.js";import{r as he,t as B}from"./mark-DFrG-wvV.js";import{t as ge}from"./queries-BhOWO492.js";import{t as _e}from"./queries-C6MEHDMF.js";import{Ct as V,Et as ve,St as ye,Tt as H,_t as be,at as xe,bt as U,c as Se,cn as Ce,ct as we,dt as Te,et as W,ft as Ee,it as De,jt as G,kt as Oe,l as ke,lt as Ae,mt as je,o as Me,ot as Ne,pn as Pe,pt as Fe,s as Ie,st as Le,ut as Re,vt as ze,wt as K,xt as Be,yt as Ve}from"./index-Cq5xMfDA.js";import{n as He,t as Ue}from"./ci-Bd2-5eE-.js";import{n as q,r as We,t as Ge}from"./status-badge-CLWrI7_O.js";import{a as Ke,i as J,n as qe,o as Y,r as X,t as Je}from"./table-k2qcth_z.js";import{t as Ye}from"./label-badge-DiN1DIT9.js";import{t as Xe}from"./action-BVeAbPKD.js";import{d as Ze,l as Qe,o as $e}from"./model-Bnpi-qEo.js";import{n as et,t as tt}from"./strings-CLu9pWvP.js";import{r as nt,t as rt}from"./project-not-found-CXsaeZK0.js";var Z=e(t(),1),it=new Map([[`bold`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M204,64V168a12,12,0,0,1-24,0V93L72.49,200.49a12,12,0,0,1-17-17L163,76H88a12,12,0,0,1,0-24H192A12,12,0,0,1,204,64Z`}))],[`duotone`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M192,64V168L88,64Z`,opacity:`0.2`}),Z.createElement(`path`,{d:`M192,56H88a8,8,0,0,0-5.66,13.66L128.69,116,58.34,186.34a8,8,0,0,0,11.32,11.32L140,127.31l46.34,46.35A8,8,0,0,0,200,168V64A8,8,0,0,0,192,56Zm-8,92.69-38.34-38.34h0L107.31,72H184Z`}))],[`fill`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M200,64V168a8,8,0,0,1-13.66,5.66L140,127.31,69.66,197.66a8,8,0,0,1-11.32-11.32L128.69,116,82.34,69.66A8,8,0,0,1,88,56H192A8,8,0,0,1,200,64Z`}))],[`light`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M198,64V168a6,6,0,0,1-12,0V78.48L68.24,196.24a6,6,0,0,1-8.48-8.48L177.52,70H88a6,6,0,0,1,0-12H192A6,6,0,0,1,198,64Z`}))],[`regular`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M200,64V168a8,8,0,0,1-16,0V83.31L69.66,197.66a8,8,0,0,1-11.32-11.32L172.69,72H88a8,8,0,0,1,0-16H192A8,8,0,0,1,200,64Z`}))],[`thin`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M196,64V168a4,4,0,0,1-8,0V73.66L66.83,194.83a4,4,0,0,1-5.66-5.66L182.34,68H88a4,4,0,0,1,0-8H192A4,4,0,0,1,196,64Z`}))]]),at=new Map([[`bold`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M140,40V216a12,12,0,0,1-24,0V40a12,12,0,0,1,24,0ZM64.49,87.51a12,12,0,0,0-17,17L59,116H16a12,12,0,0,0,0,24H59L47.51,151.51a12,12,0,0,0,17,17l32-32a12,12,0,0,0,0-17ZM240,116H197l11.52-11.51a12,12,0,0,0-17-17l-32,32a12,12,0,0,0,0,17l32,32a12,12,0,0,0,17-17L197,140h43a12,12,0,0,0,0-24Z`}))],[`duotone`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M240,56V200a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V56A16,16,0,0,1,32,40H224A16,16,0,0,1,240,56Z`,opacity:`0.2`}),Z.createElement(`path`,{d:`M136,40V216a8,8,0,0,1-16,0V40a8,8,0,0,1,16,0ZM69.66,90.34a8,8,0,0,0-11.32,11.32L76.69,120H16a8,8,0,0,0,0,16H76.69L58.34,154.34a8,8,0,0,0,11.32,11.32l32-32a8,8,0,0,0,0-11.32ZM240,120H179.31l18.35-18.34a8,8,0,0,0-11.32-11.32l-32,32a8,8,0,0,0,0,11.32l32,32a8,8,0,0,0,11.32-11.32L179.31,136H240a8,8,0,0,0,0-16Z`}))],[`fill`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M101.66,122.34a8,8,0,0,1,0,11.32l-32,32A8,8,0,0,1,56,160V136H16a8,8,0,0,1,0-16H56V96a8,8,0,0,1,13.66-5.66ZM240,120H200V96a8,8,0,0,0-13.66-5.66l-32,32a8,8,0,0,0,0,11.32l32,32A8,8,0,0,0,200,160V136h40a8,8,0,0,0,0-16ZM128,32a8,8,0,0,0-8,8V216a8,8,0,0,0,16,0V40A8,8,0,0,0,128,32Z`}))],[`light`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M134,40V216a6,6,0,0,1-12,0V40a6,6,0,0,1,12,0ZM68.24,91.76a6,6,0,0,0-8.48,8.48L81.51,122H16a6,6,0,0,0,0,12H81.51L59.76,155.76a6,6,0,1,0,8.48,8.48l32-32a6,6,0,0,0,0-8.48ZM240,122H174.49l21.75-21.76a6,6,0,0,0-8.48-8.48l-32,32a6,6,0,0,0,0,8.48l32,32a6,6,0,0,0,8.48-8.48L174.49,134H240a6,6,0,0,0,0-12Z`}))],[`regular`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M136,40V216a8,8,0,0,1-16,0V40a8,8,0,0,1,16,0ZM69.66,90.34a8,8,0,0,0-11.32,11.32L76.69,120H16a8,8,0,0,0,0,16H76.69L58.34,154.34a8,8,0,0,0,11.32,11.32l32-32a8,8,0,0,0,0-11.32ZM240,120H179.31l18.35-18.34a8,8,0,0,0-11.32-11.32l-32,32a8,8,0,0,0,0,11.32l32,32a8,8,0,0,0,11.32-11.32L179.31,136H240a8,8,0,0,0,0-16Z`}))],[`thin`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M132,40V216a4,4,0,0,1-8,0V40a4,4,0,0,1,8,0ZM66.83,93.17a4,4,0,0,0-5.66,5.66L86.34,124H16a4,4,0,0,0,0,8H86.34L61.17,157.17a4,4,0,0,0,5.66,5.66l32-32a4,4,0,0,0,0-5.66ZM240,124H169.66l25.17-25.17a4,4,0,1,0-5.66-5.66l-32,32a4,4,0,0,0,0,5.66l32,32a4,4,0,0,0,5.66-5.66L169.66,132H240a4,4,0,0,0,0-8Z`}))]]),ot=Z.forwardRef((e,t)=>Z.createElement(E,{ref:t,...e,weights:it}));ot.displayName=`ArrowUpRightIcon`;var st=Z.forwardRef((e,t)=>Z.createElement(E,{ref:t,...e,weights:at}));st.displayName=`ArrowsInLineHorizontalIcon`;var ct=(e,t)=>e===`Running`?`Running since ${P(t)}`:e===`Failed`?`Failed at ${P(t)}`:F(t),lt={above:!1,below:!1},ut=()=>{let[e,t]=(0,Z.useState)(lt),n=(0,Z.useRef)(null);return[(0,Z.useCallback)(e=>{if(n.current?.(),n.current=null,e===null)return;let r=()=>{let n=e.scrollTop>1,r=e.scrollHeight-e.clientHeight-e.scrollTop>1;t(e=>e.above===n&&e.below===r?e:{above:n,below:r})},i=new ResizeObserver(r),a=()=>{i.observe(e);for(let t of e.children)i.observe(t)},o=new MutationObserver(()=>{i.disconnect(),a(),r()});a(),o.observe(e,{childList:!0}),e.addEventListener(`scroll`,r,{passive:!0}),r(),n.current=()=>{e.removeEventListener(`scroll`,r),o.disconnect(),i.disconnect()}},[]),e]},Q=n();function $({className:e,size:t=`default`,...n}){return(0,Q.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:w(`group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-lg bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-border [--card-spacing:--spacing(4)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] *:[img:first-child]:rounded-t-lg *:[img:last-child]:rounded-b-lg`,e),...n})}function dt({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`card-header`,className:w(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-lg px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)`,e),...t})}function ft({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`card-title`,className:w(`text-lg font-semibold`,e),...t})}function pt({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`card-description`,className:w(`text-sm text-muted-foreground`,e),...t})}function mt({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`card-content`,className:w(`px-(--card-spacing)`,e),...t})}var ht=3,gt=({labels:e,catalog:t})=>{if(e.length===0)return null;let n=e.slice(ht);return(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[e.slice(0,ht).map(e=>(0,Q.jsx)(Ye,{name:e,label:t.get(e)},e)),n.length>0&&(0,Q.jsxs)(W,{variant:`outline`,className:`text-muted-foreground tabular-nums`,title:n.join(`, `),"aria-label":`${n.length} more: ${n.join(`, `)}`,children:[`+`,n.length]})]})},_t=`block w-full cursor-pointer text-left outline-none after:absolute after:inset-0 after:rounded-lg`,vt=({item:e,project:t})=>{let n=Oe();return(0,Q.jsx)(`h3`,{className:`text-sm/snug font-medium text-card-foreground`,title:e.title,children:(0,Q.jsx)(S,{...t===void 0?{...n.task(e.repository,Qe(e))}:{to:`/projects/$project/tasks/$number`,params:{project:t,number:Qe(e)},search:{repository:e.repository}},draggable:!1,className:_t,children:(0,Q.jsx)(`span`,{className:`line-clamp-2`,children:e.title})})})},yt=({failure:e,children:t})=>(0,Q.jsxs)(`div`,{className:`flex flex-col items-start gap-1.5 rounded-md bg-destructive/8 px-2 py-1.5 text-xs text-destructive`,children:[(0,Q.jsx)(`p`,{className:`line-clamp-2 wrap-anywhere`,title:e.message,children:e.message}),t]}),bt=({failure:e,action:t})=>t!==null&&e.run.canRetry&&!t.isPending?(0,Q.jsx)(k,{variant:`outline`,size:`xs`,className:`relative z-10`,title:I(e.run.agentBrain),onClick:()=>t.mutate({runId:e.run.id,request:{action:`retry`}}),children:R.retry}):null,xt=({run:e})=>{let t=j(3e4),n=le(e);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1.5 text-xs whitespace-nowrap text-muted-foreground`,children:[(0,Q.jsx)(q,{state:e.state,className:`mr-0.5 ml-0.75`}),(0,Q.jsx)(`span`,{className:`truncate text-foreground`,children:e.loop}),e.state!==`AwaitingCi`&&(0,Q.jsx)(`span`,{className:`shrink-0`,children:e.state}),n!==null&&(0,Q.jsx)(`time`,{className:`shrink-0 font-mono tabular-nums`,dateTime:n,title:ct(e.state,n),children:N(n,t)}),(0,Q.jsx)(`span`,{className:`ml-auto truncate pl-2`,children:e.agent})]}),e.ciWait!==null&&(0,Q.jsx)(`p`,{className:`text-xs`,children:(0,Q.jsx)(He,{run:e})}),e.machineWait!==null&&(0,Q.jsx)(`p`,{className:`text-xs break-words text-muted-foreground`,children:te(e.machineWait)})]})},St=({stalled:e,named:t,children:n})=>{let r=j(3e4),i=et(e,r);return(0,Q.jsxs)(`div`,{"data-slot":`stall-note`,className:`flex flex-col items-start gap-1.5 text-xs`,children:[(0,Q.jsxs)(`p`,{className:`line-clamp-3 text-muted-foreground`,title:`${e.loop}: ${i}`,children:[t&&(0,Q.jsxs)(`span`,{className:`font-medium text-foreground`,children:[e.loop,` `]}),i]}),n]})},Ct=e=>[`run-again`,`board-card`,e],wt=(e,t)=>{let n=Ct(e),r=xe({mutationKey:n,onClaimed:t}),i=x({filters:{mutationKey:n,exact:!0},select:({state:e})=>e}).at(-1);return{isPending:i?.status===`pending`,data:i?.data,error:i?.error??null,send:e=>r.mutate({runId:e.id,amendment:`unchanged`})}},Tt=({project:e,showRepository:t,item:n,lane:r,catalog:i,stall:a,readOnly:o,action:s,again:c,progress:l})=>{let u=ae(n),d=fe(n),f=d===null?void 0:T(n).find(({handoff:e})=>e?.fixRunId===d.id),p=s?.error?.message??null,m=c?.error?.message??null,h=a!==null&&u!==null&&(a.reason._tag===`RunFailed`||a.reason._tag===`SuppressedForOperator`)&&a.reason.run.id===u.run.id,g=a===null||s===null?null:(0,Q.jsx)(Xe,{stalled:a,readOnly:o,appearance:`card`}),_=n.needsYou&&d?.canApprove!==!0&&d?.canResolveFailure!==!0&&a===null;return(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5 px-3`,children:[(0,Q.jsx)(`p`,{className:`flex flex-wrap items-baseline gap-x-2.5 pr-6`,children:n.items.map(e=>(0,Q.jsx)(B,{item:e,className:`relative z-10`},e.itemKey))}),t&&(0,Q.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,Q.jsx)(G,{repository:n.repository}),(0,Q.jsx)(`span`,{className:`truncate`,children:n.repository})]}),(0,Q.jsx)(vt,{item:n,project:e}),(0,Q.jsx)(gt,{labels:ue(n,r),catalog:i}),d!==null&&(0,Q.jsx)(xt,{run:d}),f!==void 0&&(0,Q.jsx)(`p`,{className:`text-xs`,children:(0,Q.jsx)(Ue,{run:f})}),l!==null&&(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:l}),u!==null&&(0,Q.jsx)(yt,{failure:u,children:h&&a?.reason._tag===`SuppressedForOperator`?g:(0,Q.jsx)(bt,{failure:u,action:o?null:s})}),a!==null&&!h&&(0,Q.jsx)(St,{stalled:a,named:(d===null||$e(a)?.id!==d.id)&&!tt(a),children:g}),c?.data?._tag===`CycleBlocked`&&(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-needs-you`,children:`No run opened: cycle budget used up. Reset it in Needs attention`}),p!==null&&(0,Q.jsx)(`p`,{className:`text-xs text-destructive wrap-anywhere`,children:p}),m!==null&&(0,Q.jsx)(`p`,{className:`text-xs text-destructive wrap-anywhere`,children:m}),n.conflicting&&(0,Q.jsx)(`p`,{className:`text-xs text-destructive`,children:`Conflicts with base`}),_&&(0,Q.jsx)(`p`,{className:`text-xs text-needs-you`,children:`Needs attention`})]})},Et=({item:e,displayedRun:t,openRun:n})=>{let[r,i]=(0,Z.useState)(!1),a=e.items.find(({kind:e})=>e===`issue`)??e,o=y({..._e(e.repository,a.number),enabled:r}),s=o.data?.runs.filter(({id:e})=>e!==t?.id)??[];return(0,Q.jsxs)(V,{open:r,onOpenChange:i,children:[(0,Q.jsx)(H,{children:`Run history`}),(0,Q.jsxs)(K,{className:`min-w-48`,children:[o.isPending&&(0,Q.jsx)(U,{disabled:!0,children:`Loading runs…`}),o.isError&&(0,Q.jsx)(U,{onClick:()=>o.refetch(),children:`Could not load runs. Retry`}),s.map(e=>(0,Q.jsxs)(U,{onClick:()=>n(e.id),children:[(0,Q.jsx)(`span`,{className:`truncate`,children:e.loop}),(0,Q.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-2 pl-4 text-xs text-muted-foreground`,children:[(0,Q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(q,{state:e.state}),e.state]}),(0,Q.jsx)(`time`,{dateTime:e.openedAt,title:F(e.openedAt),className:`font-mono tabular-nums`,children:N(e.openedAt)})]})]},e.id))]})]})},Dt=({readOnly:e,item:t,run:n,moves:r,openRun:i,action:a,again:o,className:s})=>{let[c,l]=(0,Z.useState)(!1),u=he(t),d=t.runCount-(n===null?0:1),f=t.run?.canRunAgain===!0?t.run:null,p=[{key:`links`,content:t.items.map(e=>(0,Q.jsxs)(Be,{href:e.url,target:`_blank`,rel:`noreferrer`,closeOnClick:!0,children:[`Open `,(0,Q.jsx)(B,{item:e,linked:!1}),` on GitHub`,(0,Q.jsx)(ce,{className:`ml-auto text-muted-foreground`,"aria-hidden":`true`})]},e.itemKey))}];(n!==null||d>0)&&p.push({key:`runs`,content:(0,Q.jsxs)(Q.Fragment,{children:[n!==null&&(0,Q.jsx)(U,{onClick:()=>i(n.id),children:`Open run`}),d>0&&(0,Q.jsx)(Et,{item:t,displayedRun:n,openRun:i})]})});let m=a.isPending||o.isPending,h=f!==null||n!==null&&(n.canApprove||n.canRetry||n.canCancel);return!e&&!m&&h&&p.push({key:`actions`,content:(0,Q.jsxs)(Q.Fragment,{children:[n?.canApprove&&(0,Q.jsx)(U,{onClick:()=>a.mutate({runId:n.id,request:{action:`approve`}}),children:R.approve}),n?.canRetry&&(0,Q.jsx)(U,{title:I(n.agentBrain),onClick:()=>a.mutate({runId:n.id,request:{action:`retry`}}),children:R.retry}),f!==null&&(0,Q.jsxs)(U,{onClick:()=>o.send(f),children:[R.runAgain,(0,Q.jsx)(`span`,{className:`ml-auto truncate pl-4 text-xs text-muted-foreground`,children:f.loop})]}),n?.canCancel&&(0,Q.jsx)(U,{variant:`destructive`,onClick:()=>l(!0),children:R.cancel})]})}),!e&&!r.disabled&&r.targets.length>0&&p.push({key:`move`,content:(0,Q.jsxs)(V,{children:[(0,Q.jsx)(H,{children:`Move to`}),(0,Q.jsx)(K,{className:`min-w-40`,children:r.targets.map(e=>(0,Q.jsx)(U,{onClick:()=>r.onMove(t,e),children:e.name},e.id))})]})}),(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(be,{children:[(0,Q.jsx)(ve,{render:(0,Q.jsx)(k,{variant:`ghost`,size:`icon-sm`,className:w(`text-muted-foreground hover:text-foreground aria-expanded:text-foreground`,s)}),"aria-label":`Actions for ${u}`,children:(0,Q.jsx)(Ce,{weight:`bold`,className:`size-4`,"aria-hidden":`true`})}),(0,Q.jsx)(ze,{align:`end`,className:`w-auto min-w-48`,children:p.map(({key:e,content:t},n)=>(0,Q.jsxs)(Z.Fragment,{children:[n>0&&(0,Q.jsx)(ye,{}),(0,Q.jsx)(Ve,{children:t})]},e))})]}),n!==null&&(0,Q.jsx)(Le,{open:c,onOpenChange:l,children:(0,Q.jsxs)(Re,{children:[(0,Q.jsxs)(Fe,{children:[(0,Q.jsxs)(je,{children:[`Cancel `,n.loop,`?`]}),(0,Q.jsxs)(Te,{children:[`The run on `,u,` stops, including any attempt in progress.`]})]}),(0,Q.jsxs)(Ee,{children:[(0,Q.jsx)(Ae,{children:R.keepRunning}),(0,Q.jsx)(we,{variant:`destructive`,onClick:()=>{l(!1),a.mutate({runId:n.id,request:{action:`cancel`}})},children:R.confirmCancel})]})]})})]})},Ot=e=>w(`relative gap-0 py-2.5 transition-[box-shadow] hover:ring-foreground/15 has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-ring/70`,e&&`ring-needs-you/45 hover:ring-needs-you/65`),kt=(e,t,n)=>e.isPending&&e.variables!==void 0?ee[e.variables.request.action]:t.isPending?ne:n===void 0?null:oe(n),At=({project:e,showRepository:t,item:n,lane:r,catalog:i,draggable:a,phase:o,moves:s,stall:c,readOnly:u,openRun:f})=>{let p=De(),m=wt(n.itemKey,f),{attributes:h,listeners:g,setNodeRef:_,setActivatorNodeRef:v,transform:y,transition:b,isDragging:x}=d({id:n.itemKey,disabled:{draggable:!a,droppable:r._tag!==`WritableBoardLane`}});return(0,Q.jsxs)(`div`,{ref:_,style:{transform:l.Translate.toString(y),transition:b},className:w(`group/task relative`,x&&`opacity-40`),children:[(0,Q.jsx)($,{ref:v,size:`sm`,className:w(Ot(n.needsYou),a&&`touch-none focus-visible:ring-2 focus-visible:ring-ring/70`),...a&&h,...a&&g,children:(0,Q.jsx)(Tt,{project:e,showRepository:t,item:n,lane:r,catalog:i,stall:c,readOnly:u,action:p,again:m,progress:kt(p,m,o)})}),(0,Q.jsx)(Dt,{readOnly:u,item:n,run:fe(n),moves:s,openRun:f,action:p,again:m,className:`absolute top-1.5 right-1.5 transition-opacity [@media(hover:hover)]:opacity-0 [@media(hover:hover)]:group-hover/task:opacity-100 [@media(hover:hover)]:group-focus-within/task:opacity-100 [@media(hover:hover)]:aria-expanded:opacity-100`})]})},jt=new Set([`Waiting`,`Queued`,`Running`]),Mt=(e,t)=>new Map(e.flatMap((n,r)=>{let i=e[r+1];if(i===void 0||n._tag!==`WritableBoardLane`||i._tag!==`WritableBoardLane`)return[];let a=new Set(n.items.flatMap(e=>e.loops)),o=n.items.flatMap(e=>T(e).filter(({state:e,loop:t})=>jt.has(e)&&a.has(t))),s={next:i,loops:t.filter(({name:e})=>a.has(e)).map(({name:e,paused:t})=>({name:e,paused:t})),tone:o.some(({state:e})=>e!==`Waiting`)?`active`:o.length>0?`waiting`:`idle`};return[[n.id,s]]})),Nt=e=>e.map(({name:e,paused:t})=>t?`${e} (paused)`:e).join(`, `),Pt=({flow:e})=>{let t=e.loops.length>0;return(0,Q.jsxs)(`p`,{"data-slot":`flow-arrow`,className:w(`-mr-3 ml-auto flex min-w-0 items-center gap-1.5 pl-2 text-xs`,e.tone===`active`?`text-run-active`:e.tone===`waiting`?`text-run-waiting`:`text-muted-foreground`),title:t?`Loops matching this lane: ${Nt(e.loops)}. Flows to ${e.next.name}`:void 0,children:[(0,Q.jsxs)(`span`,{className:`sr-only`,children:[`Flows to `,e.next.name]}),t&&(0,Q.jsx)(`span`,{className:`truncate`,children:e.loops.map(({name:e,paused:t},n)=>(0,Q.jsxs)(Z.Fragment,{children:[n>0&&`, `,e,t&&(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:` paused`})]},e))}),(0,Q.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 22 8`,className:w(`h-2 w-5.5 shrink-0 fill-none stroke-current`,e.tone===`idle`&&`text-faint`),strokeWidth:`1`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,Q.jsx)(`path`,{d:`M0.5 4h18M15.5 1l3 3-3 3`})})]})},Ft=e=>e.origin===`fallback`||e.sources.length>0&&e.sources.every(e=>`state`in e&&O(e.state)),It=({sources:e,catalog:t})=>(0,Q.jsx)(`ul`,{"aria-label":`Lane sources`,className:`flex flex-wrap gap-1`,children:e.map(e=>(0,Q.jsx)(`li`,{className:`flex`,children:`label`in e?(0,Q.jsx)(Ye,{name:e.label,label:t.get(e.label)}):(0,Q.jsx)(W,{variant:`outline`,className:`text-muted-foreground`,children:e.state})},`label`in e?`label:${e.label}`:`state:${e.state}`))}),Lt=({lane:e,open:t})=>(0,Q.jsx)(`section`,{"aria-label":`${e.name} lane`,className:`w-10 shrink-0`,children:(0,Q.jsx)(`button`,{type:`button`,"aria-expanded":!1,title:`Open ${e.name}`,onClick:t,className:`flex h-full min-h-40 w-full items-start justify-center rounded-lg bg-card/60 ring-1 ring-border transition-colors outline-none hover:bg-muted/50 focus-visible:ring-2 focus-visible:ring-ring/70`,children:(0,Q.jsxs)(`span`,{className:`sticky top-0 flex flex-col-reverse items-center gap-2 py-3`,children:[(0,Q.jsx)(`span`,{className:`max-h-60 truncate text-sm font-semibold [writing-mode:vertical-rl]`,children:e.name}),` `,(0,Q.jsx)(`span`,{className:`text-sm text-muted-foreground tabular-nums`,children:e.totalItems??e.items.length})]})})}),Rt=({project:e,showRepository:t,lane:n,lanes:i,flow:o,catalog:s,targeted:c,pending:l,readOnly:u,moves:d,stallOf:f,openRun:p,onMove:m})=>{let g=Ft(n),[_,y]=(0,Z.useState)(g),b=n._tag===`WritableBoardLane`,{setNodeRef:x}=h({id:n.id,disabled:!b||l}),S=i.filter(e=>e._tag===`WritableBoardLane`&&e.id!==n.id),C=r({...Ie(e??A.make(`missing`),n.id),enabled:e!==void 0&&n.totalItems!==void 0&&!_}),T=n.items,E=n.totalItems??T.length,D=(0,Z.useRef)(null),O=se({count:T.length,getScrollElement:()=>D.current,estimateSize:()=>150,overscan:5,enabled:T.length>=50}),j=O.getVirtualItems(),M=j.at(-1)?.index??0;(0,Z.useEffect)(()=>{!_&&C.hasNextPage&&!C.isFetchingNextPage&&M>=T.length-5&&C.fetchNextPage()},[_,C.hasNextPage,C.isFetchingNextPage,C.fetchNextPage,M,T.length]);let[N,P]=ut();return me(g?[{label:de(n.name,_),run:()=>y(!_)}]:[]),g&&_?(0,Q.jsx)(Lt,{lane:n,open:()=>y(!1)}):(0,Q.jsxs)(`section`,{ref:x,"aria-label":`${n.name} lane`,className:w(`flex w-68 shrink-0 flex-col gap-2 rounded-lg transition-[background-color,box-shadow]`,c&&`bg-muted/40 ring-6 ring-muted/40`),children:[(0,Q.jsxs)(`header`,{className:w(`z-20 -mx-0.5 flex shrink-0 flex-col gap-1.5 px-1 pt-1 pb-1`,!c&&`bg-background`),children:[(0,Q.jsxs)(`div`,{className:`flex h-6 items-center`,children:[(0,Q.jsxs)(`h2`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,Q.jsx)(`span`,{className:`truncate text-sm font-semibold`,children:n.name}),(0,Q.jsx)(`span`,{className:`text-sm text-muted-foreground tabular-nums`,children:E})]}),o!==void 0&&(0,Q.jsx)(Pt,{flow:o}),g&&(0,Q.jsx)(k,{variant:`ghost`,size:`icon-xs`,"aria-expanded":!0,"aria-label":`Fold ${n.name}`,title:`Fold ${n.name}`,className:`ml-auto text-muted-foreground hover:text-foreground`,onClick:()=>y(!0),children:(0,Q.jsx)(st,{"aria-hidden":`true`})})]}),(0,Q.jsx)(`div`,{className:`min-h-5`,children:n.sources.length>0&&(0,Q.jsx)(It,{sources:n.sources,catalog:s})})]}),(0,Q.jsx)(`div`,{ref:e=>{D.current=e,N(e)},"aria-label":`${n.name} cards`,tabIndex:P.above||P.below?0:void 0,className:w(`-mx-1 flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto overscroll-y-contain px-1 pb-1 outline-none focus-visible:ring-2 focus-visible:ring-ring/70`,P.above&&`mask-t-from-[calc(100%-2.5rem)]`,P.below&&`mask-b-from-[calc(100%-2.5rem)]`),children:(0,Q.jsxs)(v,{items:T.map(({itemKey:e})=>e),strategy:a,children:[E===0&&(0,Q.jsx)(`p`,{className:`rounded-lg border border-dashed border-input px-3 py-2.5 text-xs text-muted-foreground`,children:`No tasks`}),(0,Q.jsx)(`div`,{style:T.length>=50?{height:O.getTotalSize(),position:`relative`}:void 0,className:`flex shrink-0 flex-col gap-2`,children:(T.length>=50?j:T.map((e,t)=>({index:t,key:t,start:0}))).map(r=>{let i=T[r.index];if(i===void 0)return null;let a=d.find(({itemKey:e})=>e===i.itemKey)?.phase,o=l||a!==void 0;return(0,Q.jsx)(`div`,{"data-index":r.index,ref:T.length>=50?O.measureElement:void 0,style:T.length>=50?{position:`absolute`,top:0,left:0,width:`100%`,transform:`translateY(${r.start}px)`,paddingBottom:8}:void 0,children:(0,Q.jsx)(At,{item:i,project:e,showRepository:t,lane:n,catalog:s,draggable:!o&&S.length>0,phase:a,moves:{targets:S,disabled:o,onMove:m},stall:f(i),readOnly:u,openRun:p})},i.itemKey)})}),C.isFetchingNextPage&&(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:`Loading tasks…`}),C.isError&&(0,Q.jsx)(`button`,{type:`button`,onClick:()=>void C.refetch(),className:`text-xs text-destructive`,children:`Could not load tasks. Retry`})]})})]})},zt=({item:e,lane:t,catalog:n,stall:r,project:i,showRepository:a})=>(0,Q.jsx)($,{size:`sm`,className:w(Ot(e.needsYou),`cursor-grabbing shadow-raised`),children:(0,Q.jsx)(Tt,{project:i,showRepository:a,item:e,lane:t,catalog:n,stall:r,readOnly:!0,action:null,again:null,progress:null})}),Bt=({runs:e,openRun:t})=>(0,Q.jsxs)($,{className:`sticky left-4 w-[min(64rem,calc(100cqw-2rem))] md:left-5 md:w-[min(64rem,calc(100cqw-2.5rem))]`,children:[(0,Q.jsxs)(dt,{children:[(0,Q.jsx)(ft,{children:`Runs without a card`}),(0,Q.jsxs)(pt,{children:[e.length,` run`,e.length===1?``:`s`,` with no card on this board`]})]}),(0,Q.jsx)(mt,{children:(0,Q.jsxs)(Je,{children:[(0,Q.jsx)(Ke,{children:(0,Q.jsxs)(Y,{children:[(0,Q.jsx)(J,{children:`Loop`}),(0,Q.jsx)(J,{children:`Agent`}),(0,Q.jsx)(J,{children:`Item`}),(0,Q.jsx)(J,{children:`State`}),(0,Q.jsx)(J,{className:`w-0`})]})}),(0,Q.jsx)(qe,{children:e.map(e=>(0,Q.jsxs)(Y,{className:`cursor-pointer`,onClick:()=>t(e.id),children:[(0,Q.jsx)(X,{className:`font-medium`,children:e.loop}),(0,Q.jsx)(X,{children:e.agent}),(0,Q.jsx)(X,{className:`max-w-64 truncate font-mono text-xs`,children:e.itemKey}),(0,Q.jsx)(X,{children:(0,Q.jsx)(We,{state:e.state})}),(0,Q.jsx)(X,{className:`text-right`,children:(0,Q.jsx)(k,{variant:`ghost`,size:`icon-sm`,"aria-label":`Open run ${e.id}`,onClick:n=>{n.stopPropagation(),t(e.id)},children:(0,Q.jsx)(ot,{"aria-hidden":`true`})})})]},e.id))})]})})]}),Vt=e=>[...e.filter(({_tag:e})=>e===`WritableBoardLane`),...e.filter(({_tag:e,origin:t})=>e!==`WritableBoardLane`&&t!==`fallback`),...e.filter(({origin:e})=>e===`fallback`)],Ht=(e,t)=>t.find(t=>t.id===e)??t.find(t=>t.items.some(({itemKey:t})=>t===e)),Ut=e=>{let t=s(e);if(t.length>0)return t;if(e.pointerCoordinates===null){let t=s({...e,pointerCoordinates:{x:e.collisionRect.left+1,y:e.collisionRect.top+1}});if(t.length>0)return t}return c(e)},Wt=e=>(t,n)=>{let r=t.code===`ArrowRight`;if(!r&&t.code!==`ArrowLeft`)return g(t,n);t.preventDefault();let{collisionRect:i,droppableRects:a,droppableContainers:o}=n.context;if(i===null)return;let s=new Set(e.map(({id:e})=>e)),[c]=o.getEnabled().flatMap(({id:e})=>{let t=a.get(e);return t!==void 0&&s.has(e)?[t]:[]}).filter(({left:e})=>r?e>i.left:e<i.left).sort((e,t)=>r?e.left-t.left:t.left-e.left);return c===void 0?void 0:{x:c.left,y:c.top}},Gt=(e,t)=>{let n=e.flatMap(({items:e})=>e).find(({itemKey:e})=>e===t.itemKey);if(n===void 0)return e;let r=new Set(e.flatMap(e=>e._tag===`WritableBoardLane`?e.labels:[])),i={...n,labels:n.labels.filter(e=>!r.has(e))};return e.map(e=>{let n=e.items.filter(({itemKey:e})=>e!==t.itemKey),r=e.id===t.toLane?[i,...n]:n;return e.totalItems===void 0?{...e,items:r}:{...e,items:r,totalItems:e.totalItems+r.length-e.items.length}})},Kt=e=>{let t=new Set(e.board.cardedItemKeys??e.board.lanes.flatMap(({items:e})=>e.flatMap(({items:e})=>e.map(({itemKey:e})=>e))));return e.runs.filter(({itemKey:e})=>!t.has(e))},qt=({project:e,loops:t,stalled:n,disabled:r,openRun:a})=>{let s=Pe(`operate`,e.id),c=r||!s,[l,d]=(0,Z.useState)(null),[h,g]=(0,Z.useState)(null),v=L(e),y=i({queries:e.board.lanes.map(e=>Se(v,e.id)),combine:e=>e.map(({data:e})=>e)}),b=(0,Z.useMemo)(()=>({...e,board:{...e.board,lanes:e.board.lanes.map((e,t)=>({...e,items:e.totalItems===void 0?e.items:y[t]??e.items}))}}),[e,y]),{moves:x,moveItem:S,isPending:C,error:w}=pe(b),T=Kt(e),E=x.reduce(Gt,Vt(b.board.lanes)),D=u(p(f,{activationConstraint:{distance:6}}),p(o,{coordinateGetter:Wt(E)})),O=Mt(E,e.id===void 0?t:t.filter(t=>t.name.startsWith(`${e.id}/`))),k=E.reduce((e,t)=>e+(t.totalItems??t.items.length),0),A=e=>Ze(n,e),j=new Map(e.labels.map(e=>[e.name,e])),N=c||C,P=()=>{d(null),g(null)};return(0,Q.jsxs)(`div`,{className:`flex min-w-0 min-h-96 flex-1 flex-col gap-4 pt-5`,children:[(0,Q.jsx)(M,{title:re(e),leading:(0,Q.jsx)(G,{repository:e.repository,size:`title`}),counts:`${E.length} lane${E.length===1?``:`s`}, ${k} item${k===1?``:`s`}`,className:`px-4 md:px-5`,children:e.status===`needs-you`&&(0,Q.jsx)(Ge,{})}),e.board.lanes.some(({origin:e})=>e===`proposed`)&&(0,Q.jsx)(`p`,{className:`mx-4 max-w-3xl text-muted-foreground md:mx-5`,children:`Proposed lanes are read-only. Add lanes with labels in Configuration > Projects to enable moves.`}),e.board.failures.length>0&&(0,Q.jsx)(z,{className:`mx-4 max-w-3xl md:mx-5`,title:`${e.board.failures.length} ${e.board.failures.length===1?`item`:`items`} not shown on the board`,message:e.board.failures.map(e=>e.message).join(`
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{n as t,t as n}from"./jsx-runtime-C3cWAN_r.js";import{t as r}from"./useInfiniteQuery-BM0Jy2se.js";import{_ as i,a,c as o,d as s,f as c,g as l,h as u,i as d,l as f,m as p,o as m,p as h,r as g,s as _,t as v}from"./sortable.esm-CH2MBXNN.js";import{t as y}from"./useQuery-vsTuI6W-.js";import{t as b}from"./useSuspenseQuery-Q36G6iE9.js";import{n as x}from"./useMutationState-D_2KzpK8.js";import{t as S}from"./link-l4ws0FnP.js";import{gt as C}from"./Fiber-BdWb6IYe.js";import{A as w,Mt as T,W as E,Z as D,ln as O,t as k,xn as A}from"./button-B_wpMfoU.js";import{a as j,i as M}from"./page-B5q3ShED.js";import{l as N,x as P}from"./strings-6CUMEccc.js";import{H as F,J as ee,K as I,R as te,X as ne,a as L,o as re,q as R,r as ie}from"./overview-Cf1EaGd5.js";import{a as ae,c as oe,d as se,f as ce,i as le,n as ue,o as de,r as fe,t as pe}from"./moves-4eVFsVSm.js";import{t as z}from"./error-alert-DXxL8kJu.js";import{i as me}from"./context-NRsMJqQa.js";import{r as he,t as B}from"./mark-BJvMuc9Z.js";import{t as ge}from"./queries-B0e4uxoK.js";import{t as _e}from"./queries-CyI_Gl2p.js";import{Ct as V,Et as ve,St as ye,Tt as H,_t as be,at as xe,bt as U,c as Se,cn as Ce,ct as we,dt as Te,et as W,ft as Ee,it as De,jt as G,kt as Oe,l as ke,lt as Ae,mt as je,o as Me,ot as Ne,pn as Pe,pt as Fe,s as Ie,st as Le,ut as Re,vt as ze,wt as K,xt as Be,yt as Ve}from"./index-BhH8XWzB.js";import{n as He,t as Ue}from"./ci-BRLK7afF.js";import{n as q,r as We,t as Ge}from"./status-badge-lMqS2smw.js";import{a as Ke,i as J,n as qe,o as Y,r as X,t as Je}from"./table-BzYq3WJ7.js";import{t as Ye}from"./label-badge-CuJIC6DQ.js";import{t as Xe}from"./action-ePdvzmB3.js";import{d as Ze,l as Qe,o as $e}from"./model-C-f-ObW7.js";import{n as et,t as tt}from"./strings-DG-SWn1l.js";import{r as nt,t as rt}from"./project-not-found-B911bkwg.js";var Z=e(t(),1),it=new Map([[`bold`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M204,64V168a12,12,0,0,1-24,0V93L72.49,200.49a12,12,0,0,1-17-17L163,76H88a12,12,0,0,1,0-24H192A12,12,0,0,1,204,64Z`}))],[`duotone`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M192,64V168L88,64Z`,opacity:`0.2`}),Z.createElement(`path`,{d:`M192,56H88a8,8,0,0,0-5.66,13.66L128.69,116,58.34,186.34a8,8,0,0,0,11.32,11.32L140,127.31l46.34,46.35A8,8,0,0,0,200,168V64A8,8,0,0,0,192,56Zm-8,92.69-38.34-38.34h0L107.31,72H184Z`}))],[`fill`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M200,64V168a8,8,0,0,1-13.66,5.66L140,127.31,69.66,197.66a8,8,0,0,1-11.32-11.32L128.69,116,82.34,69.66A8,8,0,0,1,88,56H192A8,8,0,0,1,200,64Z`}))],[`light`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M198,64V168a6,6,0,0,1-12,0V78.48L68.24,196.24a6,6,0,0,1-8.48-8.48L177.52,70H88a6,6,0,0,1,0-12H192A6,6,0,0,1,198,64Z`}))],[`regular`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M200,64V168a8,8,0,0,1-16,0V83.31L69.66,197.66a8,8,0,0,1-11.32-11.32L172.69,72H88a8,8,0,0,1,0-16H192A8,8,0,0,1,200,64Z`}))],[`thin`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M196,64V168a4,4,0,0,1-8,0V73.66L66.83,194.83a4,4,0,0,1-5.66-5.66L182.34,68H88a4,4,0,0,1,0-8H192A4,4,0,0,1,196,64Z`}))]]),at=new Map([[`bold`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M140,40V216a12,12,0,0,1-24,0V40a12,12,0,0,1,24,0ZM64.49,87.51a12,12,0,0,0-17,17L59,116H16a12,12,0,0,0,0,24H59L47.51,151.51a12,12,0,0,0,17,17l32-32a12,12,0,0,0,0-17ZM240,116H197l11.52-11.51a12,12,0,0,0-17-17l-32,32a12,12,0,0,0,0,17l32,32a12,12,0,0,0,17-17L197,140h43a12,12,0,0,0,0-24Z`}))],[`duotone`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M240,56V200a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V56A16,16,0,0,1,32,40H224A16,16,0,0,1,240,56Z`,opacity:`0.2`}),Z.createElement(`path`,{d:`M136,40V216a8,8,0,0,1-16,0V40a8,8,0,0,1,16,0ZM69.66,90.34a8,8,0,0,0-11.32,11.32L76.69,120H16a8,8,0,0,0,0,16H76.69L58.34,154.34a8,8,0,0,0,11.32,11.32l32-32a8,8,0,0,0,0-11.32ZM240,120H179.31l18.35-18.34a8,8,0,0,0-11.32-11.32l-32,32a8,8,0,0,0,0,11.32l32,32a8,8,0,0,0,11.32-11.32L179.31,136H240a8,8,0,0,0,0-16Z`}))],[`fill`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M101.66,122.34a8,8,0,0,1,0,11.32l-32,32A8,8,0,0,1,56,160V136H16a8,8,0,0,1,0-16H56V96a8,8,0,0,1,13.66-5.66ZM240,120H200V96a8,8,0,0,0-13.66-5.66l-32,32a8,8,0,0,0,0,11.32l32,32A8,8,0,0,0,200,160V136h40a8,8,0,0,0,0-16ZM128,32a8,8,0,0,0-8,8V216a8,8,0,0,0,16,0V40A8,8,0,0,0,128,32Z`}))],[`light`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M134,40V216a6,6,0,0,1-12,0V40a6,6,0,0,1,12,0ZM68.24,91.76a6,6,0,0,0-8.48,8.48L81.51,122H16a6,6,0,0,0,0,12H81.51L59.76,155.76a6,6,0,1,0,8.48,8.48l32-32a6,6,0,0,0,0-8.48ZM240,122H174.49l21.75-21.76a6,6,0,0,0-8.48-8.48l-32,32a6,6,0,0,0,0,8.48l32,32a6,6,0,0,0,8.48-8.48L174.49,134H240a6,6,0,0,0,0-12Z`}))],[`regular`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M136,40V216a8,8,0,0,1-16,0V40a8,8,0,0,1,16,0ZM69.66,90.34a8,8,0,0,0-11.32,11.32L76.69,120H16a8,8,0,0,0,0,16H76.69L58.34,154.34a8,8,0,0,0,11.32,11.32l32-32a8,8,0,0,0,0-11.32ZM240,120H179.31l18.35-18.34a8,8,0,0,0-11.32-11.32l-32,32a8,8,0,0,0,0,11.32l32,32a8,8,0,0,0,11.32-11.32L179.31,136H240a8,8,0,0,0,0-16Z`}))],[`thin`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M132,40V216a4,4,0,0,1-8,0V40a4,4,0,0,1,8,0ZM66.83,93.17a4,4,0,0,0-5.66,5.66L86.34,124H16a4,4,0,0,0,0,8H86.34L61.17,157.17a4,4,0,0,0,5.66,5.66l32-32a4,4,0,0,0,0-5.66ZM240,124H169.66l25.17-25.17a4,4,0,1,0-5.66-5.66l-32,32a4,4,0,0,0,0,5.66l32,32a4,4,0,0,0,5.66-5.66L169.66,132H240a4,4,0,0,0,0-8Z`}))]]),ot=Z.forwardRef((e,t)=>Z.createElement(E,{ref:t,...e,weights:it}));ot.displayName=`ArrowUpRightIcon`;var st=Z.forwardRef((e,t)=>Z.createElement(E,{ref:t,...e,weights:at}));st.displayName=`ArrowsInLineHorizontalIcon`;var ct=(e,t)=>e===`Running`?`Running since ${P(t)}`:e===`Failed`?`Failed at ${P(t)}`:F(t),lt={above:!1,below:!1},ut=()=>{let[e,t]=(0,Z.useState)(lt),n=(0,Z.useRef)(null);return[(0,Z.useCallback)(e=>{if(n.current?.(),n.current=null,e===null)return;let r=()=>{let n=e.scrollTop>1,r=e.scrollHeight-e.clientHeight-e.scrollTop>1;t(e=>e.above===n&&e.below===r?e:{above:n,below:r})},i=new ResizeObserver(r),a=()=>{i.observe(e);for(let t of e.children)i.observe(t)},o=new MutationObserver(()=>{i.disconnect(),a(),r()});a(),o.observe(e,{childList:!0}),e.addEventListener(`scroll`,r,{passive:!0}),r(),n.current=()=>{e.removeEventListener(`scroll`,r),o.disconnect(),i.disconnect()}},[]),e]},Q=n();function $({className:e,size:t=`default`,...n}){return(0,Q.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:w(`group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-lg bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-border [--card-spacing:--spacing(4)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] *:[img:first-child]:rounded-t-lg *:[img:last-child]:rounded-b-lg`,e),...n})}function dt({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`card-header`,className:w(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-lg px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)`,e),...t})}function ft({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`card-title`,className:w(`text-lg font-semibold`,e),...t})}function pt({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`card-description`,className:w(`text-sm text-muted-foreground`,e),...t})}function mt({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`card-content`,className:w(`px-(--card-spacing)`,e),...t})}var ht=3,gt=({labels:e,catalog:t})=>{if(e.length===0)return null;let n=e.slice(ht);return(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[e.slice(0,ht).map(e=>(0,Q.jsx)(Ye,{name:e,label:t.get(e)},e)),n.length>0&&(0,Q.jsxs)(W,{variant:`outline`,className:`text-muted-foreground tabular-nums`,title:n.join(`, `),"aria-label":`${n.length} more: ${n.join(`, `)}`,children:[`+`,n.length]})]})},_t=`block w-full cursor-pointer text-left outline-none after:absolute after:inset-0 after:rounded-lg`,vt=({item:e,project:t})=>{let n=Oe();return(0,Q.jsx)(`h3`,{className:`text-sm/snug font-medium text-card-foreground`,title:e.title,children:(0,Q.jsx)(S,{...t===void 0?{...n.task(e.repository,Qe(e))}:{to:`/projects/$project/tasks/$number`,params:{project:t,number:Qe(e)},search:{repository:e.repository}},draggable:!1,className:_t,children:(0,Q.jsx)(`span`,{className:`line-clamp-2`,children:e.title})})})},yt=({failure:e,children:t})=>(0,Q.jsxs)(`div`,{className:`flex flex-col items-start gap-1.5 rounded-md bg-destructive/8 px-2 py-1.5 text-xs text-destructive`,children:[(0,Q.jsx)(`p`,{className:`line-clamp-2 wrap-anywhere`,title:e.message,children:e.message}),t]}),bt=({failure:e,action:t})=>t!==null&&e.run.canRetry&&!t.isPending?(0,Q.jsx)(k,{variant:`outline`,size:`xs`,className:`relative z-10`,title:I(e.run.agentBrain),onClick:()=>t.mutate({runId:e.run.id,request:{action:`retry`}}),children:R.retry}):null,xt=({run:e})=>{let t=j(3e4),n=le(e);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1.5 text-xs whitespace-nowrap text-muted-foreground`,children:[(0,Q.jsx)(q,{state:e.state,className:`mr-0.5 ml-0.75`}),(0,Q.jsx)(`span`,{className:`truncate text-foreground`,children:e.loop}),e.state!==`AwaitingCi`&&(0,Q.jsx)(`span`,{className:`shrink-0`,children:e.state}),n!==null&&(0,Q.jsx)(`time`,{className:`shrink-0 font-mono tabular-nums`,dateTime:n,title:ct(e.state,n),children:N(n,t)}),(0,Q.jsx)(`span`,{className:`ml-auto truncate pl-2`,children:e.agent})]}),e.ciWait!==null&&(0,Q.jsx)(`p`,{className:`text-xs`,children:(0,Q.jsx)(He,{run:e})}),e.machineWait!==null&&(0,Q.jsx)(`p`,{className:`text-xs break-words text-muted-foreground`,children:te(e.machineWait)})]})},St=({stalled:e,named:t,children:n})=>{let r=j(3e4),i=et(e,r);return(0,Q.jsxs)(`div`,{"data-slot":`stall-note`,className:`flex flex-col items-start gap-1.5 text-xs`,children:[(0,Q.jsxs)(`p`,{className:`line-clamp-3 text-muted-foreground`,title:`${e.loop}: ${i}`,children:[t&&(0,Q.jsxs)(`span`,{className:`font-medium text-foreground`,children:[e.loop,` `]}),i]}),n]})},Ct=e=>[`run-again`,`board-card`,e],wt=(e,t)=>{let n=Ct(e),r=xe({mutationKey:n,onClaimed:t}),i=x({filters:{mutationKey:n,exact:!0},select:({state:e})=>e}).at(-1);return{isPending:i?.status===`pending`,data:i?.data,error:i?.error??null,send:e=>r.mutate({runId:e.id,amendment:`unchanged`})}},Tt=({project:e,showRepository:t,item:n,lane:r,catalog:i,stall:a,readOnly:o,action:s,again:c,progress:l})=>{let u=ae(n),d=fe(n),f=d===null?void 0:T(n).find(({handoff:e})=>e?.fixRunId===d.id),p=s?.error?.message??null,m=c?.error?.message??null,h=a!==null&&u!==null&&(a.reason._tag===`RunFailed`||a.reason._tag===`SuppressedForOperator`)&&a.reason.run.id===u.run.id,g=a===null||s===null?null:(0,Q.jsx)(Xe,{stalled:a,readOnly:o,appearance:`card`}),_=n.needsYou&&d?.canApprove!==!0&&d?.canResolveFailure!==!0&&a===null;return(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5 px-3`,children:[(0,Q.jsx)(`p`,{className:`flex flex-wrap items-baseline gap-x-2.5 pr-6`,children:n.items.map(e=>(0,Q.jsx)(B,{item:e,className:`relative z-10`},e.itemKey))}),t&&(0,Q.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,Q.jsx)(G,{repository:n.repository}),(0,Q.jsx)(`span`,{className:`truncate`,children:n.repository})]}),(0,Q.jsx)(vt,{item:n,project:e}),(0,Q.jsx)(gt,{labels:ue(n,r),catalog:i}),d!==null&&(0,Q.jsx)(xt,{run:d}),f!==void 0&&(0,Q.jsx)(`p`,{className:`text-xs`,children:(0,Q.jsx)(Ue,{run:f})}),l!==null&&(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:l}),u!==null&&(0,Q.jsx)(yt,{failure:u,children:h&&a?.reason._tag===`SuppressedForOperator`?g:(0,Q.jsx)(bt,{failure:u,action:o?null:s})}),a!==null&&!h&&(0,Q.jsx)(St,{stalled:a,named:(d===null||$e(a)?.id!==d.id)&&!tt(a),children:g}),c?.data?._tag===`CycleBlocked`&&(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-needs-you`,children:`No run opened: cycle budget used up. Reset it in Needs attention`}),p!==null&&(0,Q.jsx)(`p`,{className:`text-xs text-destructive wrap-anywhere`,children:p}),m!==null&&(0,Q.jsx)(`p`,{className:`text-xs text-destructive wrap-anywhere`,children:m}),n.conflicting&&(0,Q.jsx)(`p`,{className:`text-xs text-destructive`,children:`Conflicts with base`}),_&&(0,Q.jsx)(`p`,{className:`text-xs text-needs-you`,children:`Needs attention`})]})},Et=({item:e,displayedRun:t,openRun:n})=>{let[r,i]=(0,Z.useState)(!1),a=e.items.find(({kind:e})=>e===`issue`)??e,o=y({..._e(e.repository,a.number),enabled:r}),s=o.data?.runs.filter(({id:e})=>e!==t?.id)??[];return(0,Q.jsxs)(V,{open:r,onOpenChange:i,children:[(0,Q.jsx)(H,{children:`Run history`}),(0,Q.jsxs)(K,{className:`min-w-48`,children:[o.isPending&&(0,Q.jsx)(U,{disabled:!0,children:`Loading runs…`}),o.isError&&(0,Q.jsx)(U,{onClick:()=>o.refetch(),children:`Could not load runs. Retry`}),s.map(e=>(0,Q.jsxs)(U,{onClick:()=>n(e.id),children:[(0,Q.jsx)(`span`,{className:`truncate`,children:e.loop}),(0,Q.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-2 pl-4 text-xs text-muted-foreground`,children:[(0,Q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(q,{state:e.state}),e.state]}),(0,Q.jsx)(`time`,{dateTime:e.openedAt,title:F(e.openedAt),className:`font-mono tabular-nums`,children:N(e.openedAt)})]})]},e.id))]})]})},Dt=({readOnly:e,item:t,run:n,moves:r,openRun:i,action:a,again:o,className:s})=>{let[c,l]=(0,Z.useState)(!1),u=he(t),d=t.runCount-(n===null?0:1),f=t.run?.canRunAgain===!0?t.run:null,p=[{key:`links`,content:t.items.map(e=>(0,Q.jsxs)(Be,{href:e.url,target:`_blank`,rel:`noreferrer`,closeOnClick:!0,children:[`Open `,(0,Q.jsx)(B,{item:e,linked:!1}),` on GitHub`,(0,Q.jsx)(ce,{className:`ml-auto text-muted-foreground`,"aria-hidden":`true`})]},e.itemKey))}];(n!==null||d>0)&&p.push({key:`runs`,content:(0,Q.jsxs)(Q.Fragment,{children:[n!==null&&(0,Q.jsx)(U,{onClick:()=>i(n.id),children:`Open run`}),d>0&&(0,Q.jsx)(Et,{item:t,displayedRun:n,openRun:i})]})});let m=a.isPending||o.isPending,h=f!==null||n!==null&&(n.canApprove||n.canRetry||n.canCancel);return!e&&!m&&h&&p.push({key:`actions`,content:(0,Q.jsxs)(Q.Fragment,{children:[n?.canApprove&&(0,Q.jsx)(U,{onClick:()=>a.mutate({runId:n.id,request:{action:`approve`}}),children:R.approve}),n?.canRetry&&(0,Q.jsx)(U,{title:I(n.agentBrain),onClick:()=>a.mutate({runId:n.id,request:{action:`retry`}}),children:R.retry}),f!==null&&(0,Q.jsxs)(U,{onClick:()=>o.send(f),children:[R.runAgain,(0,Q.jsx)(`span`,{className:`ml-auto truncate pl-4 text-xs text-muted-foreground`,children:f.loop})]}),n?.canCancel&&(0,Q.jsx)(U,{variant:`destructive`,onClick:()=>l(!0),children:R.cancel})]})}),!e&&!r.disabled&&r.targets.length>0&&p.push({key:`move`,content:(0,Q.jsxs)(V,{children:[(0,Q.jsx)(H,{children:`Move to`}),(0,Q.jsx)(K,{className:`min-w-40`,children:r.targets.map(e=>(0,Q.jsx)(U,{onClick:()=>r.onMove(t,e),children:e.name},e.id))})]})}),(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(be,{children:[(0,Q.jsx)(ve,{render:(0,Q.jsx)(k,{variant:`ghost`,size:`icon-sm`,className:w(`text-muted-foreground hover:text-foreground aria-expanded:text-foreground`,s)}),"aria-label":`Actions for ${u}`,children:(0,Q.jsx)(Ce,{weight:`bold`,className:`size-4`,"aria-hidden":`true`})}),(0,Q.jsx)(ze,{align:`end`,className:`w-auto min-w-48`,children:p.map(({key:e,content:t},n)=>(0,Q.jsxs)(Z.Fragment,{children:[n>0&&(0,Q.jsx)(ye,{}),(0,Q.jsx)(Ve,{children:t})]},e))})]}),n!==null&&(0,Q.jsx)(Le,{open:c,onOpenChange:l,children:(0,Q.jsxs)(Re,{children:[(0,Q.jsxs)(Fe,{children:[(0,Q.jsxs)(je,{children:[`Cancel `,n.loop,`?`]}),(0,Q.jsxs)(Te,{children:[`The run on `,u,` stops, including any attempt in progress.`]})]}),(0,Q.jsxs)(Ee,{children:[(0,Q.jsx)(Ae,{children:R.keepRunning}),(0,Q.jsx)(we,{variant:`destructive`,onClick:()=>{l(!1),a.mutate({runId:n.id,request:{action:`cancel`}})},children:R.confirmCancel})]})]})})]})},Ot=e=>w(`relative gap-0 py-2.5 transition-[box-shadow] hover:ring-foreground/15 has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-ring/70`,e&&`ring-needs-you/45 hover:ring-needs-you/65`),kt=(e,t,n)=>e.isPending&&e.variables!==void 0?ee[e.variables.request.action]:t.isPending?ne:n===void 0?null:oe(n),At=({project:e,showRepository:t,item:n,lane:r,catalog:i,draggable:a,phase:o,moves:s,stall:c,readOnly:u,openRun:f})=>{let p=De(),m=wt(n.itemKey,f),{attributes:h,listeners:g,setNodeRef:_,setActivatorNodeRef:v,transform:y,transition:b,isDragging:x}=d({id:n.itemKey,disabled:{draggable:!a,droppable:r._tag!==`WritableBoardLane`}});return(0,Q.jsxs)(`div`,{ref:_,style:{transform:l.Translate.toString(y),transition:b},className:w(`group/task relative`,x&&`opacity-40`),children:[(0,Q.jsx)($,{ref:v,size:`sm`,className:w(Ot(n.needsYou),a&&`touch-none focus-visible:ring-2 focus-visible:ring-ring/70`),...a&&h,...a&&g,children:(0,Q.jsx)(Tt,{project:e,showRepository:t,item:n,lane:r,catalog:i,stall:c,readOnly:u,action:p,again:m,progress:kt(p,m,o)})}),(0,Q.jsx)(Dt,{readOnly:u,item:n,run:fe(n),moves:s,openRun:f,action:p,again:m,className:`absolute top-1.5 right-1.5 transition-opacity [@media(hover:hover)]:opacity-0 [@media(hover:hover)]:group-hover/task:opacity-100 [@media(hover:hover)]:group-focus-within/task:opacity-100 [@media(hover:hover)]:aria-expanded:opacity-100`})]})},jt=new Set([`Waiting`,`Queued`,`Running`]),Mt=(e,t)=>new Map(e.flatMap((n,r)=>{let i=e[r+1];if(i===void 0||n._tag!==`WritableBoardLane`||i._tag!==`WritableBoardLane`)return[];let a=new Set(n.items.flatMap(e=>e.loops)),o=n.items.flatMap(e=>T(e).filter(({state:e,loop:t})=>jt.has(e)&&a.has(t))),s={next:i,loops:t.filter(({name:e})=>a.has(e)).map(({name:e,paused:t})=>({name:e,paused:t})),tone:o.some(({state:e})=>e!==`Waiting`)?`active`:o.length>0?`waiting`:`idle`};return[[n.id,s]]})),Nt=e=>e.map(({name:e,paused:t})=>t?`${e} (paused)`:e).join(`, `),Pt=({flow:e})=>{let t=e.loops.length>0;return(0,Q.jsxs)(`p`,{"data-slot":`flow-arrow`,className:w(`-mr-3 ml-auto flex min-w-0 items-center gap-1.5 pl-2 text-xs`,e.tone===`active`?`text-run-active`:e.tone===`waiting`?`text-run-waiting`:`text-muted-foreground`),title:t?`Loops matching this lane: ${Nt(e.loops)}. Flows to ${e.next.name}`:void 0,children:[(0,Q.jsxs)(`span`,{className:`sr-only`,children:[`Flows to `,e.next.name]}),t&&(0,Q.jsx)(`span`,{className:`truncate`,children:e.loops.map(({name:e,paused:t},n)=>(0,Q.jsxs)(Z.Fragment,{children:[n>0&&`, `,e,t&&(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:` paused`})]},e))}),(0,Q.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 22 8`,className:w(`h-2 w-5.5 shrink-0 fill-none stroke-current`,e.tone===`idle`&&`text-faint`),strokeWidth:`1`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,Q.jsx)(`path`,{d:`M0.5 4h18M15.5 1l3 3-3 3`})})]})},Ft=e=>e.origin===`fallback`||e.sources.length>0&&e.sources.every(e=>`state`in e&&O(e.state)),It=({sources:e,catalog:t})=>(0,Q.jsx)(`ul`,{"aria-label":`Lane sources`,className:`flex flex-wrap gap-1`,children:e.map(e=>(0,Q.jsx)(`li`,{className:`flex`,children:`label`in e?(0,Q.jsx)(Ye,{name:e.label,label:t.get(e.label)}):(0,Q.jsx)(W,{variant:`outline`,className:`text-muted-foreground`,children:e.state})},`label`in e?`label:${e.label}`:`state:${e.state}`))}),Lt=({lane:e,open:t})=>(0,Q.jsx)(`section`,{"aria-label":`${e.name} lane`,className:`w-10 shrink-0`,children:(0,Q.jsx)(`button`,{type:`button`,"aria-expanded":!1,title:`Open ${e.name}`,onClick:t,className:`flex h-full min-h-40 w-full items-start justify-center rounded-lg bg-card/60 ring-1 ring-border transition-colors outline-none hover:bg-muted/50 focus-visible:ring-2 focus-visible:ring-ring/70`,children:(0,Q.jsxs)(`span`,{className:`sticky top-0 flex flex-col-reverse items-center gap-2 py-3`,children:[(0,Q.jsx)(`span`,{className:`max-h-60 truncate text-sm font-semibold [writing-mode:vertical-rl]`,children:e.name}),` `,(0,Q.jsx)(`span`,{className:`text-sm text-muted-foreground tabular-nums`,children:e.totalItems??e.items.length})]})})}),Rt=({project:e,showRepository:t,lane:n,lanes:i,flow:o,catalog:s,targeted:c,pending:l,readOnly:u,moves:d,stallOf:f,openRun:p,onMove:m})=>{let g=Ft(n),[_,y]=(0,Z.useState)(g),b=n._tag===`WritableBoardLane`,{setNodeRef:x}=h({id:n.id,disabled:!b||l}),S=i.filter(e=>e._tag===`WritableBoardLane`&&e.id!==n.id),C=r({...Ie(e??A.make(`missing`),n.id),enabled:e!==void 0&&n.totalItems!==void 0&&!_}),T=n.items,E=n.totalItems??T.length,D=(0,Z.useRef)(null),O=se({count:T.length,getScrollElement:()=>D.current,estimateSize:()=>150,overscan:5,enabled:T.length>=50}),j=O.getVirtualItems(),M=j.at(-1)?.index??0;(0,Z.useEffect)(()=>{!_&&C.hasNextPage&&!C.isFetchingNextPage&&M>=T.length-5&&C.fetchNextPage()},[_,C.hasNextPage,C.isFetchingNextPage,C.fetchNextPage,M,T.length]);let[N,P]=ut();return me(g?[{label:de(n.name,_),run:()=>y(!_)}]:[]),g&&_?(0,Q.jsx)(Lt,{lane:n,open:()=>y(!1)}):(0,Q.jsxs)(`section`,{ref:x,"aria-label":`${n.name} lane`,className:w(`flex w-68 shrink-0 flex-col gap-2 rounded-lg transition-[background-color,box-shadow]`,c&&`bg-muted/40 ring-6 ring-muted/40`),children:[(0,Q.jsxs)(`header`,{className:w(`z-20 -mx-0.5 flex shrink-0 flex-col gap-1.5 px-1 pt-1 pb-1`,!c&&`bg-background`),children:[(0,Q.jsxs)(`div`,{className:`flex h-6 items-center`,children:[(0,Q.jsxs)(`h2`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,Q.jsx)(`span`,{className:`truncate text-sm font-semibold`,children:n.name}),(0,Q.jsx)(`span`,{className:`text-sm text-muted-foreground tabular-nums`,children:E})]}),o!==void 0&&(0,Q.jsx)(Pt,{flow:o}),g&&(0,Q.jsx)(k,{variant:`ghost`,size:`icon-xs`,"aria-expanded":!0,"aria-label":`Fold ${n.name}`,title:`Fold ${n.name}`,className:`ml-auto text-muted-foreground hover:text-foreground`,onClick:()=>y(!0),children:(0,Q.jsx)(st,{"aria-hidden":`true`})})]}),(0,Q.jsx)(`div`,{className:`min-h-5`,children:n.sources.length>0&&(0,Q.jsx)(It,{sources:n.sources,catalog:s})})]}),(0,Q.jsx)(`div`,{ref:e=>{D.current=e,N(e)},"aria-label":`${n.name} cards`,tabIndex:P.above||P.below?0:void 0,className:w(`-mx-1 flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto overscroll-y-contain px-1 pb-1 outline-none focus-visible:ring-2 focus-visible:ring-ring/70`,P.above&&`mask-t-from-[calc(100%-2.5rem)]`,P.below&&`mask-b-from-[calc(100%-2.5rem)]`),children:(0,Q.jsxs)(v,{items:T.map(({itemKey:e})=>e),strategy:a,children:[E===0&&(0,Q.jsx)(`p`,{className:`rounded-lg border border-dashed border-input px-3 py-2.5 text-xs text-muted-foreground`,children:`No tasks`}),(0,Q.jsx)(`div`,{style:T.length>=50?{height:O.getTotalSize(),position:`relative`}:void 0,className:`flex shrink-0 flex-col gap-2`,children:(T.length>=50?j:T.map((e,t)=>({index:t,key:t,start:0}))).map(r=>{let i=T[r.index];if(i===void 0)return null;let a=d.find(({itemKey:e})=>e===i.itemKey)?.phase,o=l||a!==void 0;return(0,Q.jsx)(`div`,{"data-index":r.index,ref:T.length>=50?O.measureElement:void 0,style:T.length>=50?{position:`absolute`,top:0,left:0,width:`100%`,transform:`translateY(${r.start}px)`,paddingBottom:8}:void 0,children:(0,Q.jsx)(At,{item:i,project:e,showRepository:t,lane:n,catalog:s,draggable:!o&&S.length>0,phase:a,moves:{targets:S,disabled:o,onMove:m},stall:f(i),readOnly:u,openRun:p})},i.itemKey)})}),C.isFetchingNextPage&&(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:`Loading tasks…`}),C.isError&&(0,Q.jsx)(`button`,{type:`button`,onClick:()=>void C.refetch(),className:`text-xs text-destructive`,children:`Could not load tasks. Retry`})]})})]})},zt=({item:e,lane:t,catalog:n,stall:r,project:i,showRepository:a})=>(0,Q.jsx)($,{size:`sm`,className:w(Ot(e.needsYou),`cursor-grabbing shadow-raised`),children:(0,Q.jsx)(Tt,{project:i,showRepository:a,item:e,lane:t,catalog:n,stall:r,readOnly:!0,action:null,again:null,progress:null})}),Bt=({runs:e,openRun:t})=>(0,Q.jsxs)($,{className:`sticky left-4 w-[min(64rem,calc(100cqw-2rem))] md:left-5 md:w-[min(64rem,calc(100cqw-2.5rem))]`,children:[(0,Q.jsxs)(dt,{children:[(0,Q.jsx)(ft,{children:`Runs without a card`}),(0,Q.jsxs)(pt,{children:[e.length,` run`,e.length===1?``:`s`,` with no card on this board`]})]}),(0,Q.jsx)(mt,{children:(0,Q.jsxs)(Je,{children:[(0,Q.jsx)(Ke,{children:(0,Q.jsxs)(Y,{children:[(0,Q.jsx)(J,{children:`Loop`}),(0,Q.jsx)(J,{children:`Agent`}),(0,Q.jsx)(J,{children:`Item`}),(0,Q.jsx)(J,{children:`State`}),(0,Q.jsx)(J,{className:`w-0`})]})}),(0,Q.jsx)(qe,{children:e.map(e=>(0,Q.jsxs)(Y,{className:`cursor-pointer`,onClick:()=>t(e.id),children:[(0,Q.jsx)(X,{className:`font-medium`,children:e.loop}),(0,Q.jsx)(X,{children:e.agent}),(0,Q.jsx)(X,{className:`max-w-64 truncate font-mono text-xs`,children:e.itemKey}),(0,Q.jsx)(X,{children:(0,Q.jsx)(We,{state:e.state})}),(0,Q.jsx)(X,{className:`text-right`,children:(0,Q.jsx)(k,{variant:`ghost`,size:`icon-sm`,"aria-label":`Open run ${e.id}`,onClick:n=>{n.stopPropagation(),t(e.id)},children:(0,Q.jsx)(ot,{"aria-hidden":`true`})})})]},e.id))})]})})]}),Vt=e=>[...e.filter(({_tag:e})=>e===`WritableBoardLane`),...e.filter(({_tag:e,origin:t})=>e!==`WritableBoardLane`&&t!==`fallback`),...e.filter(({origin:e})=>e===`fallback`)],Ht=(e,t)=>t.find(t=>t.id===e)??t.find(t=>t.items.some(({itemKey:t})=>t===e)),Ut=e=>{let t=s(e);if(t.length>0)return t;if(e.pointerCoordinates===null){let t=s({...e,pointerCoordinates:{x:e.collisionRect.left+1,y:e.collisionRect.top+1}});if(t.length>0)return t}return c(e)},Wt=e=>(t,n)=>{let r=t.code===`ArrowRight`;if(!r&&t.code!==`ArrowLeft`)return g(t,n);t.preventDefault();let{collisionRect:i,droppableRects:a,droppableContainers:o}=n.context;if(i===null)return;let s=new Set(e.map(({id:e})=>e)),[c]=o.getEnabled().flatMap(({id:e})=>{let t=a.get(e);return t!==void 0&&s.has(e)?[t]:[]}).filter(({left:e})=>r?e>i.left:e<i.left).sort((e,t)=>r?e.left-t.left:t.left-e.left);return c===void 0?void 0:{x:c.left,y:c.top}},Gt=(e,t)=>{let n=e.flatMap(({items:e})=>e).find(({itemKey:e})=>e===t.itemKey);if(n===void 0)return e;let r=new Set(e.flatMap(e=>e._tag===`WritableBoardLane`?e.labels:[])),i={...n,labels:n.labels.filter(e=>!r.has(e))};return e.map(e=>{let n=e.items.filter(({itemKey:e})=>e!==t.itemKey),r=e.id===t.toLane?[i,...n]:n;return e.totalItems===void 0?{...e,items:r}:{...e,items:r,totalItems:e.totalItems+r.length-e.items.length}})},Kt=e=>{let t=new Set(e.board.cardedItemKeys??e.board.lanes.flatMap(({items:e})=>e.flatMap(({items:e})=>e.map(({itemKey:e})=>e))));return e.runs.filter(({itemKey:e})=>!t.has(e))},qt=({project:e,loops:t,stalled:n,disabled:r,openRun:a})=>{let s=Pe(`operate`,e.id),c=r||!s,[l,d]=(0,Z.useState)(null),[h,g]=(0,Z.useState)(null),v=L(e),y=i({queries:e.board.lanes.map(e=>Se(v,e.id)),combine:e=>e.map(({data:e})=>e)}),b=(0,Z.useMemo)(()=>({...e,board:{...e.board,lanes:e.board.lanes.map((e,t)=>({...e,items:e.totalItems===void 0?e.items:y[t]??e.items}))}}),[e,y]),{moves:x,moveItem:S,isPending:C,error:w}=pe(b),T=Kt(e),E=x.reduce(Gt,Vt(b.board.lanes)),D=u(p(f,{activationConstraint:{distance:6}}),p(o,{coordinateGetter:Wt(E)})),O=Mt(E,e.id===void 0?t:t.filter(t=>t.name.startsWith(`${e.id}/`))),k=E.reduce((e,t)=>e+(t.totalItems??t.items.length),0),A=e=>Ze(n,e),j=new Map(e.labels.map(e=>[e.name,e])),N=c||C,P=()=>{d(null),g(null)};return(0,Q.jsxs)(`div`,{className:`flex min-w-0 min-h-96 flex-1 flex-col gap-4 pt-5`,children:[(0,Q.jsx)(M,{title:re(e),leading:(0,Q.jsx)(G,{repository:e.repository,size:`title`}),counts:`${E.length} lane${E.length===1?``:`s`}, ${k} item${k===1?``:`s`}`,className:`px-4 md:px-5`,children:e.status===`needs-you`&&(0,Q.jsx)(Ge,{})}),e.board.lanes.some(({origin:e})=>e===`proposed`)&&(0,Q.jsx)(`p`,{className:`mx-4 max-w-3xl text-muted-foreground md:mx-5`,children:`Proposed lanes are read-only. Add lanes with labels in Configuration > Projects to enable moves.`}),e.board.failures.length>0&&(0,Q.jsx)(z,{className:`mx-4 max-w-3xl md:mx-5`,title:`${e.board.failures.length} ${e.board.failures.length===1?`item`:`items`} not shown on the board`,message:e.board.failures.map(e=>e.message).join(`
2
2
  `)}),w!==null&&(0,Q.jsx)(z,{className:`mx-4 max-w-3xl md:mx-5`,message:w.message}),(0,Q.jsxs)(m,{sensors:D,collisionDetection:Ut,onDragStart:({active:e})=>{let t=E.find(({items:t})=>t.some(({itemKey:t})=>t===e.id)),n=t?.items.find(({itemKey:t})=>t===e.id);d(t===void 0||n===void 0?null:{item:n,lane:t})},onDragOver:({over:e})=>g(e===null?null:Ht(e.id,E)?.id??null),onDragEnd:({over:e})=>{if(P(),e===null||l===null)return;let t=Ht(e.id,E);t!==void 0&&S(l.item,t)},onDragCancel:P,children:[(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto overscroll-contain [container-type:size]`,"aria-label":`${re(e)} project board`,children:(0,Q.jsxs)(`div`,{className:`flex w-max min-w-full flex-col gap-6 px-4 pb-4 md:px-5`,children:[(0,Q.jsx)(`div`,{className:`flex h-[calc(100cqh-1rem)] min-h-80 shrink-0 gap-3`,children:E.map(t=>(0,Q.jsx)(Rt,{project:L(e),showRepository:e.repositories.length>1,lane:t,lanes:E,flow:O.get(t.id),catalog:j,targeted:l!==null&&h===t.id&&t.id!==l.lane.id&&t._tag===`WritableBoardLane`,pending:N,readOnly:c,moves:x,stallOf:A,openRun:a,onMove:S},t.id))}),T.length>0&&(0,Q.jsx)(Bt,{runs:T,openRun:a})]})}),(0,Q.jsx)(_,{children:l!==null&&(0,Q.jsx)(zt,{item:l.item,project:L(e),showRepository:e.repositories.length>1,lane:l.lane,catalog:j,stall:A(l.item)})})]})]})},Jt=()=>{let{project:e}=Me.useParams(),{data:t}=b({...ie(),select:e=>({loops:e.loops,readOnly:e._tag===`NeedsSetup`})}),n=b(ge()),r=Ne(),{data:i,error:a}=b(ke(A.make(e)));return C(D)(a)&&a.error===`BoardProjectNotFoundError`?(0,Q.jsx)(rt,{description:nt(e)}):(0,Q.jsx)(qt,{project:i,loops:t.loops,stalled:n.data.notMoving,disabled:t.readOnly,openRun:r})};export{Jt as component};
@@ -1 +1 @@
1
- import{t as e}from"./jsx-runtime-C3cWAN_r.js";import{t}from"./useSuspenseQuery-Q36G6iE9.js";import{t as n}from"./link-l4ws0FnP.js";import{B as r,r as i,s as a,t as o}from"./section-BcsvLs1s.js";import{n as s}from"./queries-DO7XXRdt.js";import{n as c}from"./entities-BboNqA6v.js";import{d as l}from"./index-Cq5xMfDA.js";import{t as u}from"./repository-link-DErlSv-H.js";var d=e(),f=({id:e,configuration:t})=>{let s=t.projects.find(t=>t.id===e);return(0,d.jsx)(o,{title:s?.name??e,entity:c(`project`,e),children:s===void 0?(0,d.jsx)(a,{title:r.missing,children:null}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(n,{to:`/projects/$project`,params:{project:e},className:`text-primary hover:underline`,children:r.board}),(0,d.jsx)(i,{title:r.repositories,children:(0,d.jsx)(`ol`,{className:`space-y-2`,children:s.repositories.map(e=>(0,d.jsx)(`li`,{children:(0,d.jsx)(u,{repository:e})},e))})}),(0,d.jsx)(i,{title:r.lanes,children:(0,d.jsx)(`ol`,{className:`space-y-2`,children:s.lanes.map(e=>(0,d.jsxs)(`li`,{className:`flex flex-wrap gap-2`,children:[(0,d.jsx)(`span`,{children:e.name}),(0,d.jsx)(`span`,{className:`text-muted-foreground`,children:e.sources.map(e=>`label`in e?e.label:e.state).join(`, `)})]},e.name))})})]})})},p=()=>{let{project:e}=l.useParams(),{data:n}=t(s());return(0,d.jsx)(f,{id:e,configuration:n})};export{p as component};
1
+ import{t as e}from"./jsx-runtime-C3cWAN_r.js";import{t}from"./useSuspenseQuery-Q36G6iE9.js";import{t as n}from"./link-l4ws0FnP.js";import{B as r,r as i,s as a,t as o}from"./section-CXAHfqOZ.js";import{n as s}from"./queries-DYYP8QHb.js";import{n as c}from"./entities-dMwQmf_Q.js";import{d as l}from"./index-BhH8XWzB.js";import{t as u}from"./repository-link-PhIA55jS.js";var d=e(),f=({id:e,configuration:t})=>{let s=t.projects.find(t=>t.id===e);return(0,d.jsx)(o,{title:s?.name??e,entity:c(`project`,e),children:s===void 0?(0,d.jsx)(a,{title:r.missing,children:null}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(n,{to:`/projects/$project`,params:{project:e},className:`text-primary hover:underline`,children:r.board}),(0,d.jsx)(i,{title:r.repositories,children:(0,d.jsx)(`ol`,{className:`space-y-2`,children:s.repositories.map(e=>(0,d.jsx)(`li`,{children:(0,d.jsx)(u,{repository:e})},e))})}),(0,d.jsx)(i,{title:r.lanes,children:(0,d.jsx)(`ol`,{className:`space-y-2`,children:s.lanes.map(e=>(0,d.jsxs)(`li`,{className:`flex flex-wrap gap-2`,children:[(0,d.jsx)(`span`,{children:e.name}),(0,d.jsx)(`span`,{className:`text-muted-foreground`,children:e.sources.map(e=>`label`in e?e.label:e.state).join(`, `)})]},e.name))})})]})})},p=()=>{let{project:e}=l.useParams(),{data:n}=t(s());return(0,d.jsx)(f,{id:e,configuration:n})};export{p as component};
@@ -0,0 +1 @@
1
+ import{t as e}from"./route-status-BCcC0k8s.js";var t=e;export{t as errorComponent};
@@ -0,0 +1 @@
1
+ import{t as e}from"./jsx-runtime-C3cWAN_r.js";import{r as t}from"./index-BhH8XWzB.js";import{a as n,t as r}from"./project-not-found-B911bkwg.js";var i=e(),a=()=>{let{project:e,run:a}=t.useParams();return(0,i.jsx)(r,{title:`Run not found`,description:n(a,e)})};export{a as notFoundComponent};