@usine/server 0.4.1-next.264.gfdecd7e → 0.4.1-next.265.g59d6496

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 (124) hide show
  1. package/README.md +2 -0
  2. package/dist/http.d.ts.map +1 -1
  3. package/dist/http.js +2 -0
  4. package/dist/http.js.map +1 -1
  5. package/dist/up.d.ts.map +1 -1
  6. package/dist/up.js +3 -1
  7. package/dist/up.js.map +1 -1
  8. package/dist/web/assets/_agent-_6-dDU4o.js +1 -0
  9. package/dist/web/assets/_label-B2hIQTiP.js +1 -0
  10. package/dist/web/assets/_loop-DvEDblaI.js +1 -0
  11. package/dist/web/assets/_name-CGGRdFfK.js +1 -0
  12. package/dist/web/assets/_name-DXMuBR5m.js +1 -0
  13. package/dist/web/assets/_name-Jq31XnPR.js +1 -0
  14. package/dist/web/assets/_name-z-THY2_h.js +2 -0
  15. package/dist/web/assets/{_number-CpU9ru_u.js → _number-DPBp5g17.js} +1 -1
  16. package/dist/web/assets/_number-DdeVk37S.js +1 -0
  17. package/dist/web/assets/_number-Jq31XnPR.js +1 -0
  18. package/dist/web/assets/_run-CdbRrREt.js +5 -0
  19. package/dist/web/assets/_run-Jq31XnPR.js +1 -0
  20. package/dist/web/assets/_worker-Kb3E2cex.js +1 -0
  21. package/dist/web/assets/action-BbYQzHVY.js +1 -0
  22. package/dist/web/assets/agents-aKrqbR-m.js +1 -0
  23. package/dist/web/assets/agents-ySzr8fy8.js +1 -0
  24. package/dist/web/assets/code-block-CjNdHwJz.js +4 -0
  25. package/dist/web/assets/collapsible-iYmFtriP.js +1 -0
  26. package/dist/web/assets/drawer-jppXFu1P.js +1 -0
  27. package/dist/web/assets/dropdown-menu-CFZLqcex.js +1 -0
  28. package/dist/web/assets/edit-and-retry-DE8DjLVA.js +1 -0
  29. package/dist/web/assets/{error-alert-hABzwCSY.js → error-alert-BVIxPJFU.js} +1 -1
  30. package/dist/web/assets/{file-error-B5tv6DhJ.js → file-error-DhZlb2_Y.js} +1 -1
  31. package/dist/web/assets/heading-D62nMA3C.js +1 -0
  32. package/dist/web/assets/{history-PYEz5wbe.js → history-DkNNnV6Y.js} +1 -1
  33. package/dist/web/assets/identity-DlGZ_gKf.js +1 -0
  34. package/dist/web/assets/index-B3ZB08sw.css +2 -0
  35. package/dist/web/assets/index-BdDPka5v.js +10 -0
  36. package/dist/web/assets/{label-badge-JdNthOHh.js → label-badge-d6omX3Kx.js} +1 -1
  37. package/dist/web/assets/labels-B7V9VhjQ.js +1 -0
  38. package/dist/web/assets/list-CMj9dgxo.js +1 -0
  39. package/dist/web/assets/loops-w6ia_oEU.js +1 -0
  40. package/dist/web/assets/mark-B8EExm_5.js +1 -0
  41. package/dist/web/assets/model-0V8C6gKN.js +1 -0
  42. package/dist/web/assets/moves-B2I_hBZb.js +1 -0
  43. package/dist/web/assets/{not-found-D7GT8Sj7.js → not-found-hL2Tp5vW.js} +1 -1
  44. package/dist/web/assets/outcome-xmjRsDh1.js +5 -0
  45. package/dist/web/assets/{overview-C73v5kbv.js → overview-BixI1Gdc.js} +1 -1
  46. package/dist/web/assets/{page-C47YAWAl.js → page-BLxt7Xfg.js} +1 -1
  47. package/dist/web/assets/pull-request-marks-BIB-F5Bo.js +1 -0
  48. package/dist/web/assets/repositories-DhkeCOwR.js +1 -0
  49. package/dist/web/assets/route-D0B3Tsri.js +1 -0
  50. package/dist/web/assets/route-NFcp08tu.js +1 -0
  51. package/dist/web/assets/{routes-g6SHTgCO.js → routes-BHwcH9Lh.js} +17 -17
  52. package/dist/web/assets/routes-Jq31XnPR.js +1 -0
  53. package/dist/web/assets/run-again-DSDtftlB.js +1 -0
  54. package/dist/web/assets/{section-BZs0sQLB.js → section-BP8TxDno.js} +1 -1
  55. package/dist/web/assets/section-D4djNiAN.js +24 -0
  56. package/dist/web/assets/settings-0NNJ2XzL.js +1 -0
  57. package/dist/web/assets/{sortable.esm-Lp8AM6j2.js → sortable.esm-JyniDt4R.js} +1 -1
  58. package/dist/web/assets/strings-BeaABxX0.js +311 -0
  59. package/dist/web/assets/{strings-Bexnszes.js → strings-Bs2WdZYo.js} +1 -1
  60. package/dist/web/assets/tasks-Jq31XnPR.js +1 -0
  61. package/dist/web/assets/tasks-x2oa1Rt3.js +1 -0
  62. package/dist/web/assets/usage-C27cuo6g.js +1 -0
  63. package/dist/web/assets/useAnchoredPopupScrollLock-DEVFEHhP.js +1 -0
  64. package/dist/web/assets/usePositioner-BeAdUrxb.js +1 -0
  65. package/dist/web/assets/useScrollLock-77tiYKUD.js +1 -0
  66. package/dist/web/assets/workers-jjiTPmGP.js +1 -0
  67. package/dist/web/index.html +10 -19
  68. package/package.json +9 -9
  69. package/dist/web/assets/Match-BsHjCE-9.js +0 -1
  70. package/dist/web/assets/_agent-CK1JZbEZ.js +0 -1
  71. package/dist/web/assets/_label-CkDrdgxa.js +0 -1
  72. package/dist/web/assets/_loop-DLKJmqFq.js +0 -1
  73. package/dist/web/assets/_name--06G9LKw.js +0 -1
  74. package/dist/web/assets/_name-BzeOsU08.js +0 -1
  75. package/dist/web/assets/_name-CCrJHJTI.js +0 -1
  76. package/dist/web/assets/_name-LWtfT5Eq.js +0 -2
  77. package/dist/web/assets/_number-BzeOsU08.js +0 -1
  78. package/dist/web/assets/_number-n4iejSEq.js +0 -1
  79. package/dist/web/assets/_run-BzeOsU08.js +0 -1
  80. package/dist/web/assets/_run-CHrGLkXR.js +0 -5
  81. package/dist/web/assets/_worker-BvlkSKMd.js +0 -1
  82. package/dist/web/assets/action-DQzkdVHs.js +0 -1
  83. package/dist/web/assets/actions-CG0hkpe7.js +0 -1
  84. package/dist/web/assets/agents-CgWsAMoz.js +0 -1
  85. package/dist/web/assets/agents-D3eAK_60.js +0 -1
  86. package/dist/web/assets/code-block-Y9Y-8fHK.js +0 -4
  87. package/dist/web/assets/collapsible-BKcakxvM.js +0 -1
  88. package/dist/web/assets/drawer-ClcvABkO.js +0 -1
  89. package/dist/web/assets/dropdown-menu-BHKHYfLs.js +0 -1
  90. package/dist/web/assets/edit-and-retry-DZ5FH7N6.js +0 -1
  91. package/dist/web/assets/heading-zIOXe3qT.js +0 -1
  92. package/dist/web/assets/index-C_S4sA5L.css +0 -2
  93. package/dist/web/assets/index-Dki55xSv.js +0 -10
  94. package/dist/web/assets/labels-Dr9t-xYj.js +0 -1
  95. package/dist/web/assets/lazyRouteComponent-BnRF0Crs.js +0 -1
  96. package/dist/web/assets/list-NcxSR9Ja.js +0 -1
  97. package/dist/web/assets/loops-DI4kElkX.js +0 -1
  98. package/dist/web/assets/mark-uyeJ8aPC.js +0 -1
  99. package/dist/web/assets/model-87X7P9Uh.js +0 -1
  100. package/dist/web/assets/moves-DS1ecXd6.js +0 -1
  101. package/dist/web/assets/outcome-DvqnSso3.js +0 -5
  102. package/dist/web/assets/preload-helper-BLdHbfdN.js +0 -1
  103. package/dist/web/assets/pull-request-marks-B4f7z4xa.js +0 -1
  104. package/dist/web/assets/queries-BZMW2wiD.js +0 -1
  105. package/dist/web/assets/queries-oea_Y4on.js +0 -1
  106. package/dist/web/assets/repositories-CZBhubWh.js +0 -1
  107. package/dist/web/assets/route-BtU2HI1M.js +0 -1
  108. package/dist/web/assets/route-CD6OvH-7.js +0 -1
  109. package/dist/web/assets/route-status-DGpeFNCC.js +0 -1
  110. package/dist/web/assets/routes-BzeOsU08.js +0 -1
  111. package/dist/web/assets/run-again-DPa5c27z.js +0 -1
  112. package/dist/web/assets/section-eyIYzZrG.js +0 -24
  113. package/dist/web/assets/settings-DusVdmgP.js +0 -1
  114. package/dist/web/assets/skeleton-87E84B2f.js +0 -1
  115. package/dist/web/assets/strings-DXB6PB2g.js +0 -311
  116. package/dist/web/assets/tasks-BzeOsU08.js +0 -1
  117. package/dist/web/assets/tasks-ClShPUFW.js +0 -1
  118. package/dist/web/assets/usage-BMYuEDo9.js +0 -1
  119. package/dist/web/assets/use-open-run-B8nD_BT1.js +0 -1
  120. package/dist/web/assets/useAnchoredPopupScrollLock-NN99o6YU.js +0 -1
  121. package/dist/web/assets/useSelector-CRBsgquS.js +0 -1
  122. package/dist/web/assets/useSuspenseQuery-DbhQN-t-.js +0 -1
  123. package/dist/web/assets/visuallyHidden-BUGCJ1D9.js +0 -1
  124. package/dist/web/assets/workers-CDWbu1Tb.js +0 -1
@@ -1 +1 @@
1
- import{r as e}from"./useRouter-Hur3RN7j.js";import{D as t,E as n,F as r}from"./button-4rhhIcK8.js";import{et as i}from"./index-Dki55xSv.js";var a=n(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 text-xs font-medium whitespace-nowrap transition-colors focus-visible:ring-2 focus-visible:ring-ring/70 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary/15 text-primary [a]:hover:bg-primary/25`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-accent`,destructive:`bg-destructive/15 text-destructive [a]:hover:bg-destructive/25`,outline:`border-input text-foreground [a]:hover:bg-muted/70`,ghost:`hover:bg-muted/70 hover:text-foreground`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function o({className:e,variant:n=`default`,render:o,...s}){return i({defaultTagName:`span`,props:r({className:t(a({variant:n}),e)},s),render:o,state:{slot:`badge`,variant:n}})}var s=e(),c=(e,t)=>parseInt(e.slice(t,t+2),16),l=e=>{let t=e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4};return .2126*t(c(e,0))+.7152*t(c(e,2))+.0722*t(c(e,4))},u=e=>{let t=Math.max(0,.55-l(e))/.55;if(t===0)return`#${e}`;let n=n=>Math.round(c(e,n)+(255-c(e,n))*t*.7);return`rgb(${n(0)} ${n(2)} ${n(4)})`},d=({name:e,label:t,className:n})=>t===void 0||t.color===null?(0,s.jsx)(o,{variant:`outline`,className:n,children:e}):(0,s.jsx)(o,{variant:`outline`,className:n,title:t.description??void 0,style:{color:u(t.color),borderColor:`#${t.color}66`,backgroundColor:`#${t.color}1f`},children:e});export{o as n,d as t};
1
+ import{r as e}from"./useRouter-Hur3RN7j.js";import{D as t,E as n,F as r}from"./button-4rhhIcK8.js";import{_t as i}from"./index-BdDPka5v.js";var a=n(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 text-xs font-medium whitespace-nowrap transition-colors focus-visible:ring-2 focus-visible:ring-ring/70 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary/15 text-primary [a]:hover:bg-primary/25`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-accent`,destructive:`bg-destructive/15 text-destructive [a]:hover:bg-destructive/25`,outline:`border-input text-foreground [a]:hover:bg-muted/70`,ghost:`hover:bg-muted/70 hover:text-foreground`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function o({className:e,variant:n=`default`,render:o,...s}){return i({defaultTagName:`span`,props:r({className:t(a({variant:n}),e)},s),render:o,state:{slot:`badge`,variant:n}})}var s=e(),c=(e,t)=>parseInt(e.slice(t,t+2),16),l=e=>{let t=e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4};return .2126*t(c(e,0))+.7152*t(c(e,2))+.0722*t(c(e,4))},u=e=>{let t=Math.max(0,.55-l(e))/.55;if(t===0)return`#${e}`;let n=n=>Math.round(c(e,n)+(255-c(e,n))*t*.7);return`rgb(${n(0)} ${n(2)} ${n(4)})`},d=({name:e,label:t,className:n})=>t===void 0||t.color===null?(0,s.jsx)(o,{variant:`outline`,className:n,children:e}):(0,s.jsx)(o,{variant:`outline`,className:n,title:t.description??void 0,style:{color:u(t.color),borderColor:`#${t.color}66`,backgroundColor:`#${t.color}1f`},children:e});export{o as n,d as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./useRouter-Hur3RN7j.js";import{s as t,t as n,x as r}from"./section-D4djNiAN.js";import{t as i}from"./link-C7GfYrMt.js";import{Vn as a}from"./strings-BeaABxX0.js";import{T as o,jt as s}from"./index-BdDPka5v.js";import{t as c}from"./label-badge-d6omX3Kx.js";var l=e(),u=()=>{let{data:e}=s(o());return(0,l.jsxs)(n,{title:`Labels`,createKind:`label`,children:[e.labels.length===0&&(0,l.jsx)(t,{title:r.noLabels,children:r.addLabel}),(0,l.jsx)(`ul`,{className:`divide-y border-y`,children:e.labels.map(e=>(0,l.jsxs)(`li`,{className:`flex min-w-0 flex-wrap gap-x-4 gap-y-1 py-3 wrap-anywhere`,children:[(0,l.jsx)(i,{to:`/configuration/labels/$label`,params:{label:e.name},className:`text-primary hover:underline`,children:(0,l.jsx)(c,{name:e.name,label:{name:e.name,color:a(e.color),description:a(e.description)}})}),(0,l.jsx)(`span`,{className:`text-muted-foreground`,children:a(e.description)})]},e.name))})]})};export{u as component};
@@ -0,0 +1 @@
1
+ import{i as e,r as t,s as n}from"./useRouter-Hur3RN7j.js";import{T as r,Y as i,c as a,d as o,h as s,l as c,s as l,t as u,v as d,w as f}from"./section-D4djNiAN.js";import{t as p}from"./error-alert-BVIxPJFU.js";import{B as m}from"./mark-B8EExm_5.js";import{n as h}from"./useNavigate-AT5VkfZa.js";import{t as g}from"./link-C7GfYrMt.js";import{D as _,W as v,t as y}from"./button-4rhhIcK8.js";import{T as b,m as x}from"./strings-BeaABxX0.js";import{St as S,at as C,et as w,h as ee,it as T,nt as E,ot as D,rt as O,tt as k,v as A}from"./index-BdDPka5v.js";import{r as j}from"./status-badge-CLPsMXtK.js";import{a as M,i as N,n as P,o as F,r as I,t as L}from"./table-hbKjhjeL.js";import{t as R}from"./fill-cell-CjksmixH.js";var z=n(e(),1),B=new Map([[`bold`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M200,28H160a20,20,0,0,0-20,20V208a20,20,0,0,0,20,20h40a20,20,0,0,0,20-20V48A20,20,0,0,0,200,28Zm-4,176H164V52h32ZM96,28H56A20,20,0,0,0,36,48V208a20,20,0,0,0,20,20H96a20,20,0,0,0,20-20V48A20,20,0,0,0,96,28ZM92,204H60V52H92Z`}))],[`duotone`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M208,48V208a8,8,0,0,1-8,8H160a8,8,0,0,1-8-8V48a8,8,0,0,1,8-8h40A8,8,0,0,1,208,48ZM96,40H56a8,8,0,0,0-8,8V208a8,8,0,0,0,8,8H96a8,8,0,0,0,8-8V48A8,8,0,0,0,96,40Z`,opacity:`0.2`}),z.createElement(`path`,{d:`M200,32H160a16,16,0,0,0-16,16V208a16,16,0,0,0,16,16h40a16,16,0,0,0,16-16V48A16,16,0,0,0,200,32Zm0,176H160V48h40ZM96,32H56A16,16,0,0,0,40,48V208a16,16,0,0,0,16,16H96a16,16,0,0,0,16-16V48A16,16,0,0,0,96,32Zm0,176H56V48H96Z`}))],[`fill`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M216,48V208a16,16,0,0,1-16,16H160a16,16,0,0,1-16-16V48a16,16,0,0,1,16-16h40A16,16,0,0,1,216,48ZM96,32H56A16,16,0,0,0,40,48V208a16,16,0,0,0,16,16H96a16,16,0,0,0,16-16V48A16,16,0,0,0,96,32Z`}))],[`light`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M200,34H160a14,14,0,0,0-14,14V208a14,14,0,0,0,14,14h40a14,14,0,0,0,14-14V48A14,14,0,0,0,200,34Zm2,174a2,2,0,0,1-2,2H160a2,2,0,0,1-2-2V48a2,2,0,0,1,2-2h40a2,2,0,0,1,2,2ZM96,34H56A14,14,0,0,0,42,48V208a14,14,0,0,0,14,14H96a14,14,0,0,0,14-14V48A14,14,0,0,0,96,34Zm2,174a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V48a2,2,0,0,1,2-2H96a2,2,0,0,1,2,2Z`}))],[`regular`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M200,32H160a16,16,0,0,0-16,16V208a16,16,0,0,0,16,16h40a16,16,0,0,0,16-16V48A16,16,0,0,0,200,32Zm0,176H160V48h40ZM96,32H56A16,16,0,0,0,40,48V208a16,16,0,0,0,16,16H96a16,16,0,0,0,16-16V48A16,16,0,0,0,96,32Zm0,176H56V48H96Z`}))],[`thin`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M200,36H160a12,12,0,0,0-12,12V208a12,12,0,0,0,12,12h40a12,12,0,0,0,12-12V48A12,12,0,0,0,200,36Zm4,172a4,4,0,0,1-4,4H160a4,4,0,0,1-4-4V48a4,4,0,0,1,4-4h40a4,4,0,0,1,4,4ZM96,36H56A12,12,0,0,0,44,48V208a12,12,0,0,0,12,12H96a12,12,0,0,0,12-12V48A12,12,0,0,0,96,36Zm4,172a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V48a4,4,0,0,1,4-4H96a4,4,0,0,1,4,4Z`}))]]),te=new Map([[`bold`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M234.49,111.07,90.41,22.94A20,20,0,0,0,60,39.87V216.13a20,20,0,0,0,30.41,16.93l144.08-88.13a19.82,19.82,0,0,0,0-33.86ZM84,208.85V47.15L216.16,128Z`}))],[`duotone`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M228.23,134.69,84.15,222.81A8,8,0,0,1,72,216.12V39.88a8,8,0,0,1,12.15-6.69l144.08,88.12A7.82,7.82,0,0,1,228.23,134.69Z`,opacity:`0.2`}),z.createElement(`path`,{d:`M232.4,114.49,88.32,26.35a16,16,0,0,0-16.2-.3A15.86,15.86,0,0,0,64,39.87V216.13A15.94,15.94,0,0,0,80,232a16.07,16.07,0,0,0,8.36-2.35L232.4,141.51a15.81,15.81,0,0,0,0-27ZM80,215.94V40l143.83,88Z`}))],[`fill`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M240,128a15.74,15.74,0,0,1-7.6,13.51L88.32,229.65a16,16,0,0,1-16.2.3A15.86,15.86,0,0,1,64,216.13V39.87a15.86,15.86,0,0,1,8.12-13.82,16,16,0,0,1,16.2.3L232.4,114.49A15.74,15.74,0,0,1,240,128Z`}))],[`light`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M231.36,116.19,87.28,28.06a14,14,0,0,0-14.18-.27A13.69,13.69,0,0,0,66,39.87V216.13a13.69,13.69,0,0,0,7.1,12.08,14,14,0,0,0,14.18-.27l144.08-88.13a13.82,13.82,0,0,0,0-23.62Zm-6.26,13.38L81,217.7a2,2,0,0,1-2.06,0,1.78,1.78,0,0,1-1-1.61V39.87a1.78,1.78,0,0,1,1-1.61A2.06,2.06,0,0,1,80,38a2,2,0,0,1,1,.31L225.1,126.43a1.82,1.82,0,0,1,0,3.14Z`}))],[`regular`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M232.4,114.49,88.32,26.35a16,16,0,0,0-16.2-.3A15.86,15.86,0,0,0,64,39.87V216.13A15.94,15.94,0,0,0,80,232a16.07,16.07,0,0,0,8.36-2.35L232.4,141.51a15.81,15.81,0,0,0,0-27ZM80,215.94V40l143.83,88Z`}))],[`thin`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M230.32,117.9,86.24,29.79a11.91,11.91,0,0,0-12.17-.23A11.71,11.71,0,0,0,68,39.89V216.11a11.71,11.71,0,0,0,6.07,10.33,11.91,11.91,0,0,0,12.17-.23L230.32,138.1a11.82,11.82,0,0,0,0-20.2Zm-4.18,13.37L82.06,219.39a4,4,0,0,1-4.07.07,3.77,3.77,0,0,1-2-3.35V39.89a3.77,3.77,0,0,1,2-3.35,4,4,0,0,1,4.07.07l144.08,88.12a3.8,3.8,0,0,1,0,6.54Z`}))]]),V=z.forwardRef((e,t)=>z.createElement(v,{ref:t,...e,weights:B}));V.displayName=`PauseIcon`;var H=z.forwardRef((e,t)=>z.createElement(v,{ref:t,...e,weights:te}));H.displayName=`PlayIcon`;var U=t(),W=({paused:e})=>(0,U.jsx)(j,{state:e?`paused`:`live`,label:e?`Paused`:`Active`});function G({...e}){return(0,U.jsx)(k,{"data-slot":`dialog`,...e})}function K({...e}){return(0,U.jsx)(E,{"data-slot":`dialog-portal`,...e})}function q({className:e,...t}){return(0,U.jsx)(D,{"data-slot":`dialog-overlay`,className:_(`fixed inset-0 isolate z-50 bg-black/80 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function J({className:e,children:t,showCloseButton:n=!0,...r}){return(0,U.jsxs)(K,{children:[(0,U.jsx)(q,{}),(0,U.jsxs)(O,{"data-slot":`dialog-content`,className:_(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-xs/relaxed text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[t,n&&(0,U.jsxs)(C,{"data-slot":`dialog-close`,render:(0,U.jsx)(y,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,U.jsx)(S,{}),(0,U.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function Y({className:e,showCloseButton:t=!1,children:n,...r}){return(0,U.jsxs)(`div`,{"data-slot":`dialog-footer`,className:_(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,U.jsx)(C,{render:(0,U.jsx)(y,{variant:`outline`}),children:`Close`})]})}function X({className:e,...t}){return(0,U.jsx)(w,{"data-slot":`dialog-title`,className:_(`font-heading text-sm font-medium`,e),...t})}function Z({className:e,...t}){return(0,U.jsx)(T,{"data-slot":`dialog-description`,className:_(`text-xs/relaxed text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}var Q=({name:e,pause:t,close:n})=>{let a=m({...ee(i(`loop`,e)),staleTime:0}),o=m({...A(new b({name:e,value:a.data?.value??null})),enabled:a.isSuccess&&!a.isFetching}),s=a.isSuccess&&!a.isFetching&&o.isSuccess&&!o.isFetching;return(0,U.jsx)(G,{open:!0,onOpenChange:e=>{!e&&!t.isPending&&n()},children:(0,U.jsxs)(J,{onClick:e=>e.stopPropagation(),children:[(0,U.jsxs)(X,{children:[r.confirm,`: `,e]}),(0,U.jsx)(Z,{children:r.resumeHint}),a.isError&&(0,U.jsx)(p,{message:a.error.message}),o.isError&&(0,U.jsx)(p,{message:o.error.message}),t.isError&&(0,U.jsx)(p,{message:t.error.message}),!s&&!a.isError&&!o.isError&&(0,U.jsx)(`p`,{role:`status`,children:r.previewing}),s&&(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsx)(`p`,{children:r.count(o.data.total,o.data.total)}),o.data.stream===`schedule`&&(0,U.jsx)(`p`,{children:r.schedule}),o.data.repositoriesWithoutItems.length>0&&(0,U.jsx)(`p`,{children:r.noData(o.data.repositoriesWithoutItems)}),o.data.failures.map((e,t)=>(0,U.jsx)(p,{message:e.message},`${e.itemKey}:${t}`))]}),(0,U.jsxs)(Y,{children:[(0,U.jsx)(y,{variant:`ghost`,disabled:t.isPending,onClick:n,children:r.cancel}),(0,U.jsx)(y,{disabled:!s||t.isPending,onClick:()=>t.mutate({loop:e,paused:!0},{onSuccess:n}),children:r.resume})]})]})})},$=({loop:e,pause:t,variant:n})=>{let[r,i]=(0,z.useState)(!1),a=t.isPending&&t.variables.loop===e.name;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(y,{variant:n,disabled:t.isPending,className:n===`ghost`?`text-muted-foreground`:void 0,onClick:n=>{n.stopPropagation(),e.paused?i(!0):t.mutate({loop:e.name,paused:!1})},children:[e.paused?(0,U.jsx)(H,{"data-icon":`inline-start`,"aria-hidden":`true`}):(0,U.jsx)(V,{"data-icon":`inline-start`,"aria-hidden":`true`}),(0,U.jsx)(`span`,{className:n===`ghost`?`max-sm:sr-only`:void 0,children:a?e.paused?`Resuming…`:`Pausing…`:e.paused?`Resume`:`Pause`}),n===`ghost`&&(0,U.jsxs)(`span`,{className:`sr-only`,children:[` `,e.name]})]}),r&&(0,U.jsx)(Q,{name:e.name,pause:t,close:()=>i(!1)})]})},ne=({loop:e,pause:t})=>{let n=h(),r={loop:e.name};return(0,U.jsxs)(c,{open:()=>void n({to:`/configuration/loops/$loop`,params:r}),children:[(0,U.jsx)(I,{className:`py-3`,children:(0,U.jsx)(g,{to:`/configuration/loops/$loop`,params:r,onClick:e=>e.stopPropagation(),className:o,children:e.name})}),(0,U.jsx)(I,{children:x(e.stream)}),(0,U.jsx)(R,{className:`hidden lg:table-cell`,children:(0,U.jsx)(`code`,{className:`block truncate font-mono text-xs text-muted-foreground [font-variant-ligatures:none]`,title:e.condition,children:e.condition})}),(0,U.jsx)(I,{className:`hidden sm:table-cell`,children:e.agent}),(0,U.jsx)(I,{className:`hidden md:table-cell`,children:d[e.approval]}),(0,U.jsx)(I,{children:(0,U.jsx)(W,{paused:e.paused})}),(0,U.jsx)(I,{className:`text-right`,children:t!==null&&(0,U.jsx)($,{loop:e,pause:t,variant:`ghost`})})]})},re=({loop:e})=>{let t=h(),n={loop:e.name};return(0,U.jsxs)(c,{open:()=>void t({to:`/configuration/loops/$loop`,params:n}),children:[(0,U.jsx)(I,{className:`py-3`,children:(0,U.jsx)(g,{to:`/configuration/loops/$loop`,params:n,onClick:e=>e.stopPropagation(),className:o,children:e.name})}),(0,U.jsx)(I,{colSpan:4,className:`max-w-0`,children:(0,U.jsx)(`p`,{className:`truncate text-destructive`,title:e.error.message,children:e.error.message})}),(0,U.jsx)(I,{children:(0,U.jsx)(a,{})}),(0,U.jsx)(I,{})]})},ie=({configuration:e,pause:t})=>(0,U.jsxs)(u,{title:`Loops`,createKind:`loop`,counts:f(e),children:[t?.isError===!0&&(0,U.jsx)(p,{message:t.error.message}),e.loops.length===0&&e.quarantinedLoops.length===0?(0,U.jsx)(l,{title:`No loops`,children:s}):(0,U.jsx)(`div`,{className:`-mx-2`,children:(0,U.jsxs)(L,{children:[(0,U.jsx)(M,{children:(0,U.jsxs)(F,{className:`hover:bg-transparent`,children:[(0,U.jsx)(N,{className:`lg:w-56`,children:`Loop`}),(0,U.jsx)(N,{children:`Trigger`}),(0,U.jsx)(N,{className:`hidden lg:table-cell`,children:`Condition`}),(0,U.jsx)(N,{className:`hidden sm:table-cell`,children:`Agent`}),(0,U.jsx)(N,{className:`hidden md:table-cell`,children:`Approval`}),(0,U.jsx)(N,{children:`State`}),(0,U.jsx)(N,{children:(0,U.jsx)(`span`,{className:`sr-only`,children:`Action`})})]})}),(0,U.jsxs)(P,{children:[e.quarantinedLoops.map(e=>(0,U.jsx)(re,{loop:e},e.file)),e.loops.map(e=>(0,U.jsx)(ne,{loop:e,pause:t},e.name))]})]})})]});export{$ as n,W as r,ie as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./useRouter-Hur3RN7j.js";import{t}from"./list-CMj9dgxo.js";import{T as n,jt as r,p as i}from"./index-BdDPka5v.js";var a=e(),o=()=>{let{data:e}=r(n());return(0,a.jsx)(t,{configuration:e,pause:i()})};export{o as component};
@@ -0,0 +1 @@
1
+ import{a as e,i as t,r as n,s as r}from"./useRouter-Hur3RN7j.js";import{c as i,o as a}from"./page-BLxt7Xfg.js";import{A as o,D as s,H as c,L as l,R as u,j as d,k as f,z as p}from"./button-4rhhIcK8.js";function m(e,t){return a(e,i,t)}var h=e((e=>{var n=t();function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`),s=Symbol.for(`react.recoverable`),c=Symbol.for(`react.optimistic_key`);function l(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:r===c?c:``+r,children:e,containerInfo:t,implementation:n}}var u=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.browser=function(e){return{$$typeof:s,_reason:e}},e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(r(299));return l(e,t,null,n)},e.flushSync=function(e){var t=u.T,n=a.p;try{if(u.T=null,a.p=2,e)return e()}finally{u.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=d(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??a.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=d(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else a.d.m(e)}},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return u.H.useFormState(e,t,n)},e.useFormStatus=function(){return u.H.useHostTransitionStatus()},e.version=`19.3.1`})),g=e(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=r(g(),1),v=r(t(),1);function y(e){v.useEffect(e,l)}var b=null;globalThis.requestAnimationFrame;var x=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},S=class e{static create(){return new e}static request(e){return x.request(e)}static cancel(e){return x.cancel(e)}currentId=b;request(e){this.cancel(),this.currentId=x.request(()=>{this.currentId=b,e()})}cancel=()=>{this.currentId!==b&&(x.cancel(this.currentId),this.currentId=b)};disposeEffect=()=>this.cancel};function C(){let e=c(S.create).current;return y(e.disposeEffect),e}function w(e){return e==null?e:`current`in e?e.current:e}function T(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var E=`data-starting-style`,D=`data-ending-style`,O=null;function k(e){if(!O){let e=[];O=e,queueMicrotask(()=>{O=null,_.flushSync(()=>{for(let t of e)t()})})}O.push(e)}function A(e,t=!1,n=!1){let r=C();return o((i,a=null)=>{r.cancel();let o=w(e);if(o==null)return;let s=o,c=()=>{n?k(()=>{a?.aborted||i()}):_.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(T(s).map(e=>e.finished.then(p))).then(()=>{a?.aborted||c()},()=>{a?.aborted||(T(s).some(e=>e.pending||e.playState!==`finished`)?l():c())})}if(t){let e=E;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}else r.request(l)})}function ee(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,s=o(a),c=A(r,n,i);v.useEffect(()=>{if(!t)return;let e=new AbortController;return c(s,e.signal),()=>{e.abort()}},[t,n,s,c])}var te={[E]:``},ne={[D]:``},re={transitionStatus(e){return e===`starting`?te:e===`ending`?ne:null}};function ie(e,t=!1,n=!1,r=!1){let[i,a]=v.useState(e&&t?`idle`:void 0),[o,s]=v.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),f(()=>{if(!e&&o&&i!==`ending`&&n){let e=S.request(()=>{a(`ending`)});return()=>{S.cancel(e)}}},[e,o,i,n]),f(()=>{if(!e||t||i===void 0)return;let n=S.request(()=>{a(void 0)});return()=>{S.cancel(n)}},[t,e,i]),f(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=S.request(()=>{a(`idle`)});return()=>{S.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}var j=0,M=class e{static create(){return new e}currentId=j;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=j,t()},e)}isStarted(){return this.currentId!==j}clear=()=>{this.currentId!==j&&(clearTimeout(this.currentId),this.currentId=j)};disposeEffect=()=>this.clear};function ae(){let e=c(M.create).current;return y(e.disposeEffect),e}function N(){let[,e]=v.useState({});return v.useCallback(()=>{e({})},[])}var P=0;function oe(e,t=`mui`){let n=v.useRef(void 0),r=N(),i=e??n.current;return v.useEffect(()=>{n.current??(P+=1,n.current=`${t}-${P}`,e??r())},[e,t,r]),i}var F=d.useId;function I(e,t){if(F!==void 0){let n=F();return e??(t?`${t}-${n}`:n)}return oe(e,t)}function se(e){return I(e,`base-ui`)}function ce(e,t,n,r){let i=!1,a=!1,o=r??u;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function le(e,t,n){let r=n??u;return{reason:e,event:t??new Event(`base-ui`),...r}}var ue=`none`,de=`trigger-press`,fe=`trigger-hover`,pe=`trigger-focus`,me=`outside-press`,he=`item-press`,L=`close-press`,R=`focus-out`,ge=`escape-key`,_e=`list-navigation`,ve=`keyboard`,ye=`pointer`,be=`cancel-open`,xe=`sibling-open`,Se=`disabled`,Ce=`imperative-action`,z={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},we={...z,position:`fixed`,margin:0,top:0,left:0},Te={...z,position:`absolute`};function B(e){"@babel/helpers - typeof";return B=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},B(e)}var Ee=[`aria-hidden`,`aria-label`,`aria-labelledby`,`tabIndex`,`className`,`fill`,`size`,`verticalAlign`,`id`,`title`,`style`];function V(){return V=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},V.apply(null,arguments)}function H(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function De(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?H(Object(n),!0).forEach(function(t){Oe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Oe(e,t,n){return(t=ke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ke(e){var t=Ae(e,`string`);return B(t)==`symbol`?t:t+``}function Ae(e,t){if(B(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(B(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function je(e,t){if(e==null)return{};var n,r,i=Me(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Me(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Ne={small:16,medium:32,large:64};function U(e,t,n,r,i){var a=e[`aria-hidden`],o=e[`aria-label`],s=e[`aria-labelledby`],c=e.tabIndex,l=e.className,u=l===void 0?``:l,d=e.fill,f=d===void 0?`currentColor`:d,p=e.size,m=p===void 0?16:p,h=e.verticalAlign,g=h===void 0?`text-bottom`:h,_=e.id,y=e.title,b=e.style,x=je(e,Ee),S=Ne[m]||m,C=Pe(i,S),w=r[C].width,T=w/C*S,E=r[C].path,D=o||s,O=a===void 0?D?void 0:`true`:a,k=D&&O!==`true`?`img`:void 0;return v.createElement(`svg`,V({ref:t,"data-component":`Octicon`},x,{"aria-hidden":O,tabIndex:c,focusable:c>=0?`true`:`false`,"aria-label":o,"aria-labelledby":s,className:`${n} ${u}`.trim(),role:k,viewBox:`0 0 ${w} ${C}`,width:T,height:S,fill:f,id:_,display:`inline-block`,overflow:`visible`,style:De({verticalAlign:g},b)}),y?v.createElement(`title`,null,y):null,E)}function Pe(e,t){return e.map(function(e){return parseInt(e,10)}).reduce(function(e,n){return n<=t?n:e},e[0])}var Fe=[`16`,`24`],Ie={16:{width:16,path:v.createElement(`path`,{d:`M5.45 5.154A4.25 4.25 0 0 0 9.25 7.5h1.378a2.251 2.251 0 1 1 0 1.5H9.25A5.734 5.734 0 0 1 5 7.123v3.505a2.25 2.25 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.95-.218ZM4.25 13.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm8.5-4.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5ZM5 3.25a.75.75 0 1 0 0 .005V3.25Z`})},24:{width:24,path:v.createElement(v.Fragment,null,v.createElement(`path`,{d:`M15 13.25a3.25 3.25 0 1 1 6.5 0 3.25 3.25 0 0 1-6.5 0Zm-12.5 6a3.25 3.25 0 1 1 6.5 0 3.25 3.25 0 0 1-6.5 0Zm0-14.5a3.25 3.25 0 1 1 6.5 0 3.25 3.25 0 0 1-6.5 0ZM5.75 6.5a1.75 1.75 0 1 0-.001-3.501A1.75 1.75 0 0 0 5.75 6.5Zm0 14.5a1.75 1.75 0 1 0-.001-3.501A1.75 1.75 0 0 0 5.75 21Zm12.5-6a1.75 1.75 0 1 0-.001-3.501A1.75 1.75 0 0 0 18.25 15Z`}),v.createElement(`path`,{d:`M6.5 7.25c0 2.9 2.35 5.25 5.25 5.25h4.5V14h-4.5A6.75 6.75 0 0 1 5 7.25Z`}),v.createElement(`path`,{d:`M5.75 16.75A.75.75 0 0 1 5 16V8a.75.75 0 0 1 1.5 0v8a.75.75 0 0 1-.75.75Z`}))}},W=v.forwardRef(function(e,t){return U(e,t,`octicon octicon-git-merge`,Ie,Fe)});W.displayName=`GitMergeIcon`;var Le=[`16`,`24`],Re={16:{width:16,path:v.createElement(`path`,{d:`M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25Zm5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z`})},24:{width:24,path:v.createElement(v.Fragment,null,v.createElement(`path`,{d:`M16 19.25a3.25 3.25 0 1 1 6.5 0 3.25 3.25 0 0 1-6.5 0Zm-14.5 0a3.25 3.25 0 1 1 6.5 0 3.25 3.25 0 0 1-6.5 0Zm0-14.5a3.25 3.25 0 1 1 6.5 0 3.25 3.25 0 0 1-6.5 0ZM4.75 3a1.75 1.75 0 1 0 .001 3.501A1.75 1.75 0 0 0 4.75 3Zm0 14.5a1.75 1.75 0 1 0 .001 3.501A1.75 1.75 0 0 0 4.75 17.5Zm14.5 0a1.75 1.75 0 1 0 .001 3.501 1.75 1.75 0 0 0-.001-3.501Z`}),v.createElement(`path`,{d:`M13.405 1.72a.75.75 0 0 1 0 1.06L12.185 4h4.065A3.75 3.75 0 0 1 20 7.75v8.75a.75.75 0 0 1-1.5 0V7.75a2.25 2.25 0 0 0-2.25-2.25h-4.064l1.22 1.22a.75.75 0 0 1-1.061 1.06l-2.5-2.5a.75.75 0 0 1 0-1.06l2.5-2.5a.75.75 0 0 1 1.06 0ZM4.75 7.25A.75.75 0 0 1 5.5 8v8A.75.75 0 0 1 4 16V8a.75.75 0 0 1 .75-.75Z`}))}},G=v.forwardRef(function(e,t){return U(e,t,`octicon octicon-git-pull-request`,Re,Le)});G.displayName=`GitPullRequestIcon`;var ze=[`16`,`24`],Be={16:{width:16,path:v.createElement(`path`,{d:`M3.25 1A2.25 2.25 0 0 1 4 5.372v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.251 2.251 0 0 1 3.25 1Zm9.5 5.5a.75.75 0 0 1 .75.75v3.378a2.251 2.251 0 1 1-1.5 0V7.25a.75.75 0 0 1 .75-.75Zm-2.03-5.273a.75.75 0 0 1 1.06 0l.97.97.97-.97a.748.748 0 0 1 1.265.332.75.75 0 0 1-.205.729l-.97.97.97.97a.751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018l-.97-.97-.97.97a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734l.97-.97-.97-.97a.75.75 0 0 1 0-1.06ZM2.5 3.25a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0ZM3.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm9.5 0a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z`})},24:{width:24,path:v.createElement(`path`,{d:`M22.266 2.711a.75.75 0 1 0-1.061-1.06l-1.983 1.983-1.984-1.983a.75.75 0 1 0-1.06 1.06l1.983 1.983-1.983 1.984a.75.75 0 0 0 1.06 1.06l1.984-1.983 1.983 1.983a.75.75 0 0 0 1.06-1.06l-1.983-1.984 1.984-1.983ZM4.75 1.5a3.25 3.25 0 0 1 .745 6.414A.827.827 0 0 1 5.5 8v8a.827.827 0 0 1-.005.086A3.25 3.25 0 0 1 4.75 22.5a3.25 3.25 0 0 1-.745-6.414A.827.827 0 0 1 4 16V8c0-.029.002-.057.005-.086A3.25 3.25 0 0 1 4.75 1.5ZM16 19.25a3.252 3.252 0 0 1 2.5-3.163V9.625a.75.75 0 0 1 1.5 0v6.462a3.252 3.252 0 0 1-.75 6.413A3.25 3.25 0 0 1 16 19.25ZM3 4.75a1.75 1.75 0 1 0 3.501-.001A1.75 1.75 0 0 0 3 4.75Zm0 14.5a1.75 1.75 0 1 0 3.501-.001A1.75 1.75 0 0 0 3 19.25Zm16.25-1.75a1.75 1.75 0 1 0 .001 3.501 1.75 1.75 0 0 0-.001-3.501Z`})}},K=v.forwardRef(function(e,t){return U(e,t,`octicon octicon-git-pull-request-closed`,Be,ze)});K.displayName=`GitPullRequestClosedIcon`;var Ve=[`16`,`24`],He={16:{width:16,path:v.createElement(v.Fragment,null,v.createElement(`path`,{d:`M11.28 6.78a.75.75 0 0 0-1.06-1.06L7.25 8.69 5.78 7.22a.75.75 0 0 0-1.06 1.06l2 2a.75.75 0 0 0 1.06 0l3.5-3.5Z`}),v.createElement(`path`,{d:`M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0Zm-1.5 0a6.5 6.5 0 1 0-13 0 6.5 6.5 0 0 0 13 0Z`}))},24:{width:24,path:v.createElement(v.Fragment,null,v.createElement(`path`,{d:`M17.28 9.28a.75.75 0 0 0-1.06-1.06l-5.97 5.97-2.47-2.47a.75.75 0 0 0-1.06 1.06l3 3a.75.75 0 0 0 1.06 0l6.5-6.5Z`}),v.createElement(`path`,{d:`M12 1c6.075 0 11 4.925 11 11s-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1ZM2.5 12a9.5 9.5 0 0 0 9.5 9.5 9.5 9.5 0 0 0 9.5-9.5A9.5 9.5 0 0 0 12 2.5 9.5 9.5 0 0 0 2.5 12Z`}))}},q=v.forwardRef(function(e,t){return U(e,t,`octicon octicon-issue-closed`,He,Ve)});q.displayName=`IssueClosedIcon`;var J=[`16`,`24`],Ue={16:{width:16,path:v.createElement(v.Fragment,null,v.createElement(`path`,{d:`M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z`}),v.createElement(`path`,{d:`M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z`}))},24:{width:24,path:v.createElement(`path`,{d:`M12 1c6.075 0 11 4.925 11 11s-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1ZM2.5 12a9.5 9.5 0 0 0 9.5 9.5 9.5 9.5 0 0 0 9.5-9.5A9.5 9.5 0 0 0 12 2.5 9.5 9.5 0 0 0 2.5 12Zm9.5 2a2 2 0 1 1-.001-3.999A2 2 0 0 1 12 14Z`})}},Y=v.forwardRef(function(e,t){return U(e,t,`octicon octicon-issue-opened`,Ue,J)});Y.displayName=`IssueOpenedIcon`;var X=n(),We={"issue-open":{icon:Y,tone:`text-run-succeeded`,word:`open`},"issue-closed":{icon:q,tone:`text-primary`,word:`closed`},"issue-unknown":{icon:Y,tone:`text-muted-foreground`,word:null},"pr-open":{icon:G,tone:`text-run-succeeded`,word:`open`},"pr-merged":{icon:W,tone:`text-primary`,word:`merged`},"pr-closed":{icon:K,tone:`text-run-failed`,word:`closed`},"pr-unknown":{icon:G,tone:`text-muted-foreground`,word:null}},Z=({kind:e,state:t})=>We[t??`${e}-unknown`],Q=e=>e===`pr`?`Pull request`:`Issue`,Ge=({kind:e,number:t})=>`${Q(e).toLowerCase()} #${t}`,$=e=>{let{word:t}=Z(e);return`${Q(e.kind)} #${e.number}${t===null?``:`, ${t}`}`},Ke=({item:e,size:t=`inline`,linked:n=!0,numbered:r=!0,className:i})=>{let{icon:a,tone:o}=Z(e),c=$(e),l=s(`inline-flex items-baseline gap-1 whitespace-nowrap`,t===`title`&&`gap-1.5`,o,i),u=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(a,{size:t===`title`?16:14,className:`shrink-0 self-center`}),r&&(0,X.jsxs)(`span`,{className:s(`font-mono tabular-nums`,t===`title`?`text-md`:`text-xs`),children:[`#`,e.number]})]});return n?(0,X.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,draggable:!1,title:c,"aria-label":c,className:s(l,`rounded-sm underline-offset-4 outline-none hover:underline focus-visible:ring-2 focus-visible:ring-ring/70`),children:u}):(0,X.jsx)(`span`,{role:`img`,title:c,"aria-label":c,className:l,children:u})};export{re as A,m as B,le as C,M as D,N as E,w as F,S as I,C as L,A as M,D as N,ae as O,E as P,y as R,ce as S,I as T,ye as _,Te as a,fe as b,Se as c,Ce as d,he as f,me as g,ue as h,we as i,ee as j,ie as k,ge as l,_e as m,$ as n,be as o,ve as p,Ge as r,L as s,Ke as t,R as u,xe as v,se as w,de as x,pe as y,g as z};
@@ -0,0 +1 @@
1
+ import{Ft as e,Yn as t,ft as n,g as r,o as i,p as a,qn as o}from"./strings-BeaABxX0.js";import{t as s}from"./identity-DlGZ_gKf.js";var c=(e,n)=>{if(e.attempts.length===0)return o();let r=0;for(let t of e.attempts){let e=t.outcome===null?n:t.endedAt===null?NaN:Date.parse(t.endedAt);if(Number.isNaN(e))return o();r+=Math.max(0,e-Date.parse(t.startedAt))}return t(r)},l=e=>{let n=e.attempts.at(-1)?.outcome;return e.state===`Failed`&&n?._tag===`Failed`?t(n.failure):o()},u=e=>{let t=e.attempts.at(-1);return e.closedAt??t?.endedAt??t?.startedAt??e.openedAt},d=(e,t)=>{let n=new Set(t.items.map(({itemKey:e})=>e));return e.filter(({item:e})=>n.has(e.itemKey))},f=(e,t)=>d(e,t)[0]??null,p=({reason:e})=>`run`in e?e.run:null,m=e=>String(s(e).origin.number),h=({reason:t})=>e(t,{AwaitingApproval:()=>!0,WaitingForStop:()=>!0,QueuedForWorker:()=>!0,SuppressedForOperator:()=>!0,CycleBudgetUsedUp:()=>!0,RunFailed:({run:e})=>e.canResolveFailure,ClosedUnchanged:()=>!1,LoopPaused:()=>!1,AwaitingPoll:()=>!1}),g=(e,...t)=>[...e].reverse().find(({state:e})=>t.includes(e)),_=(e,t,r)=>{let i=g(e.runs,`Running`);if(i!==void 0)return{_tag:`Running`,run:i};let a=g(e.runs,`Waiting`);if(a!==void 0)return{_tag:`AwaitingApproval`,run:a};let o=g(e.runs,`Pending`,`Queued`);if(o!==void 0){let e=r.find(e=>p(e)?.id===o.id);return e===void 0?{_tag:`Queued`,run:o}:{_tag:`Stalled`,stall:e,run:o}}if(n(e.state))return{_tag:`Done`};let s=d(r,e),c=s.find(h);if(c!==void 0)return{_tag:`Stalled`,stall:c,run:p(c)??t};let[l]=s;return l===void 0?e.needsYou?{_tag:`NeedsAttention`}:{_tag:`Ended`,run:t}:{_tag:`Idle`,stall:l}},v=({status:e,last:t})=>{switch(e._tag){case`Running`:return[0,Date.parse(e.run.openedAt)];case`AwaitingApproval`:return[1,Date.parse(e.run.openedAt)];case`Queued`:case`Stalled`:return[2,Date.parse(e.run.openedAt)];case`Idle`:case`NeedsAttention`:case`Done`:case`Ended`:return[3,Date.parse(u(t))]}},y=(e,t)=>e.flatMap(({items:e})=>e).flatMap(e=>{let n=e.runs.at(-1);return n===void 0?[]:[{task:e,last:n,status:_(e,n,t)}]}).map(e=>({row:e,place:v(e)})).sort(({row:e,place:[t,n]},{row:r,place:[i,a]})=>t-i||a-n||r.task.number-e.task.number).map(({row:e})=>e),b=[`in flight`,`needs attention`,`done`],x=({task:e,status:t})=>{switch(t._tag){case`Running`:case`AwaitingApproval`:case`Queued`:case`Stalled`:return`in flight`;case`Idle`:return e.needsYou?`needs attention`:null;case`NeedsAttention`:return`needs attention`;case`Done`:return`done`;case`Ended`:return null}},S=e=>{let t=b.flatMap(t=>{let n=e.filter(e=>x(e)===t).length;return n===0?[]:[`${n} ${t}`]});return t.length===0?void 0:t.join(`, `)},C=(e,t)=>e.runningSince.reduce((e,n)=>e+Math.max(0,t-Date.parse(n)),e.durationMillis),w=e=>e.pools.some(({unpriced:e})=>e),T=(e,t)=>{let n=e.flatMap(({task:e})=>e.usage.cost===null?[]:[e.usage.cost]);return{runs:e.reduce((e,{task:t})=>e+t.runs.length,0),durationMillis:e.reduce((e,{task:n})=>e+C(n.usage,t),0),unmeasured:e.reduce((e,{task:t})=>e+t.usage.unmeasured,0),tokens:e.reduce((e,{task:t})=>e+t.usage.tokens,0),unpriced:e.some(({task:e})=>w(e.usage)),usd:n.length===0?null:n.reduce((e,{usd:t})=>e+t,0)}},E=`Some attempts have no recorded timing; the real figure is higher`,D=`Some sessions have no price yet; the real figure is higher`,O=e=>[{figure:String(e.runs),words:e.runs===1?`run`:`runs`,lowerBound:null},{figure:i(e.durationMillis),words:`elapsed`,lowerBound:e.unmeasured>0?E:null},{figure:a(e.tokens),words:`tokens`,lowerBound:null},...e.usd===null?[]:[{figure:r(e.usd),words:`estimated`,lowerBound:e.unpriced?D:null}]],k=e=>{let t=new Map;for(let{loop:n,state:r}of e.runs)t.set(n,r);return[...t].map(([e,t])=>({loop:e,state:t}))},A=e=>{switch(e){case`issue-comment`:return`Comment`;case`review`:return`Review`;case`review-comment`:return`Review comment`}};export{l as a,C as c,y as d,f,E as g,D as h,u as i,k as l,O as m,A as n,p as o,T as p,w as r,S as s,c as t,m as u};
@@ -0,0 +1 @@
1
+ import{i as e,s as t}from"./useRouter-Hur3RN7j.js";import{A as n,M as r}from"./page-BLxt7Xfg.js";import{u as i}from"./error-alert-BVIxPJFU.js";import{B as a}from"./mark-B8EExm_5.js";import{m as o,n as s}from"./overview-BixI1Gdc.js";import{W as c}from"./button-4rhhIcK8.js";import{Pt as l,ft as u,kt as d,v as f}from"./strings-BeaABxX0.js";var p=t(e(),1),m=new Map([[`bold`,p.createElement(p.Fragment,null,p.createElement(`path`,{d:`M228,104a12,12,0,0,1-24,0V69l-59.51,59.51a12,12,0,0,1-17-17L187,52H152a12,12,0,0,1,0-24h64a12,12,0,0,1,12,12Zm-44,24a12,12,0,0,0-12,12v64H52V84h64a12,12,0,0,0,0-24H48A20,20,0,0,0,28,80V208a20,20,0,0,0,20,20H176a20,20,0,0,0,20-20V140A12,12,0,0,0,184,128Z`}))],[`duotone`,p.createElement(p.Fragment,null,p.createElement(`path`,{d:`M184,80V208a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V80a8,8,0,0,1,8-8H176A8,8,0,0,1,184,80Z`,opacity:`0.2`}),p.createElement(`path`,{d:`M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z`}))],[`fill`,p.createElement(p.Fragment,null,p.createElement(`path`,{d:`M192,136v72a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V80A16,16,0,0,1,48,64h72a8,8,0,0,1,0,16H48V208H176V136a8,8,0,0,1,16,0Zm32-96a8,8,0,0,0-8-8H152a8,8,0,0,0-5.66,13.66L172.69,72l-42.35,42.34a8,8,0,0,0,11.32,11.32L184,83.31l26.34,26.35A8,8,0,0,0,224,104Z`}))],[`light`,p.createElement(p.Fragment,null,p.createElement(`path`,{d:`M222,104a6,6,0,0,1-12,0V54.49l-69.75,69.75a6,6,0,0,1-8.48-8.48L201.51,46H152a6,6,0,0,1,0-12h64a6,6,0,0,1,6,6Zm-38,26a6,6,0,0,0-6,6v72a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V80a2,2,0,0,1,2-2h72a6,6,0,0,0,0-12H48A14,14,0,0,0,34,80V208a14,14,0,0,0,14,14H176a14,14,0,0,0,14-14V136A6,6,0,0,0,184,130Z`}))],[`regular`,p.createElement(p.Fragment,null,p.createElement(`path`,{d:`M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z`}))],[`thin`,p.createElement(p.Fragment,null,p.createElement(`path`,{d:`M220,104a4,4,0,0,1-8,0V49.66l-73.16,73.17a4,4,0,0,1-5.66-5.66L206.34,44H152a4,4,0,0,1,0-8h64a4,4,0,0,1,4,4Zm-36,28a4,4,0,0,0-4,4v72a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V80a4,4,0,0,1,4-4h72a4,4,0,0,0,0-8H48A12,12,0,0,0,36,80V208a12,12,0,0,0,12,12H176a12,12,0,0,0,12-12V136A4,4,0,0,0,184,132Z`}))]]),h=p.forwardRef((e,t)=>p.createElement(c,{ref:t,...e,weights:m}));h.displayName=`ArrowSquareOutIcon`;var g=(e,t)=>t.canResolveFailure&&!e.items.some(({itemKey:e,state:n})=>e===t.itemKey&&u(n)),_=e=>{let t=[...e.runs].reverse().find(t=>g(e,t));if(t===void 0)return null;let n=t.attempts;for(let e=n.length-1;e>=0;--e){let r=n[e]?.outcome;if(r?._tag===`Failed`)return{run:t,message:o(r.failure)}}return null},v=new Set(d),y=e=>{let t=e.run;return t!==null&&(v.has(t.state)||g(e,t))?t:null},b=e=>{let t=e.attempts.at(-1);switch(e.state){case`Pending`:case`Waiting`:case`Queued`:return e.openedAt;case`Running`:return t!==void 0&&t.outcome===null?t.startedAt:null;case`Failed`:return t?.endedAt??null;case`Succeeded`:case`Canceled`:return null}},x=(e,t)=>{let n=new Set(t._tag===`WritableBoardLane`?t.labels:[]);for(let e of t.sources)`label`in e&&n.add(e.label);return e.labels.filter(e=>!n.has(e))},S=e=>e===`saving`?`Moving…`:`Saved on GitHub · syncing…`,C=e=>[`board-moves`,e],w=(e,t)=>{if(e.phase===`saving`)return!0;let n=t.flatMap(({items:e})=>e).find(({itemKey:t})=>t===e.itemKey);if(n===void 0||n.state!==e.source.state)return!1;let r=n.labels.filter(t=>e.laneLabels.includes(t));return r.length===e.source.labels.length&&r.every(t=>e.source.labels.includes(t))},T=e=>{let t=r(),{data:o=[]}=a({queryKey:C(e.repository),queryFn:n,initialData:[],gcTime:1/0}),c=(e,n)=>t.setQueryData(C(e),(e=[])=>n(e)),u=o.filter(t=>w(t,e.board.lanes));a({...s(),enabled:u.length>0,refetchInterval:1e3}),(0,p.useEffect)(()=>{t.setQueryData(C(e.repository),t=>{let n=t?.filter(t=>w(t,e.board.lanes));return n?.length===t?.length?t:n})},[t,e.repository,e.board.lanes,o]);let d=i({mutationFn:({repository:e,item:t,toLane:n})=>{let{owner:r,name:i}=l(e);return f(e=>e.moveBoardItem({params:{owner:r,repository:i,item:t},payload:{toLane:n}}))},onSuccess:(e,{repository:n,itemKey:r})=>(c(n,e=>e.map(e=>e.itemKey===r?{...e,phase:`syncing`}:e)),t.invalidateQueries({queryKey:s().queryKey})),onError:(e,{repository:n,itemKey:r})=>(c(n,e=>e.filter(e=>e.itemKey!==r)),t.invalidateQueries({queryKey:s().queryKey}))}),m=(t,n)=>{let r=e.board.lanes.find(({items:e})=>e.some(({itemKey:e})=>e===t.itemKey)),i=r?.items.find(({itemKey:e})=>e===t.itemKey);if(n._tag!==`WritableBoardLane`||i===void 0||r?.id===n.id||u.some(({itemKey:e})=>e===t.itemKey))return;let a=e.board.lanes.flatMap(e=>e._tag===`WritableBoardLane`?e.labels:[]);c(e.repository,e=>[...e,{itemKey:t.itemKey,toLane:n.id,source:{state:i.state,labels:i.labels.filter(e=>a.includes(e))},laneLabels:a,phase:`saving`}]),d.mutate({repository:e.repository,itemKey:t.itemKey,item:t.number,toLane:n.id})},h=d.variables?.repository===e.repository;return{moves:u,moveItem:m,isPending:h&&d.isPending,error:h?d.error:null}};export{b as a,y as i,S as n,_ as o,x as r,h as s,T as t};
@@ -1 +1 @@
1
- import{r as e}from"./useRouter-Hur3RN7j.js";import{r as t}from"./overview-C73v5kbv.js";import{t as n}from"./link-C7GfYrMt.js";import{t as r}from"./boot-screen-Su4MyrBh.js";import{t as i}from"./button-4rhhIcK8.js";var a=`Task not found`,o=(e,t)=>`#${t} is not among the newest items on the ${e} board`,s=`Back to the board`,c=e(),l=({repository:e,number:l})=>(0,c.jsx)(r,{title:a,description:o(e,l),tone:`error`,inPanel:!0,children:(0,c.jsx)(i,{variant:`outline`,nativeButton:!1,render:(0,c.jsx)(n,{to:`/projects/$owner/$name`,params:t(e)}),children:s})});export{l as t};
1
+ import{r as e}from"./useRouter-Hur3RN7j.js";import{r as t}from"./overview-BixI1Gdc.js";import{t as n}from"./link-C7GfYrMt.js";import{t as r}from"./boot-screen-Su4MyrBh.js";import{t as i}from"./button-4rhhIcK8.js";var a=`Task not found`,o=(e,t)=>`#${t} is not among the newest items on the ${e} board`,s=`Back to the board`,c=e(),l=({repository:e,number:l})=>(0,c.jsx)(r,{title:a,description:o(e,l),tone:`error`,inPanel:!0,children:(0,c.jsx)(i,{variant:`outline`,nativeButton:!1,render:(0,c.jsx)(n,{to:`/projects/$owner/$name`,params:t(e)}),children:s})});export{l as t};
@@ -0,0 +1,5 @@
1
+ import{i as e,r as t,s as n}from"./useRouter-Hur3RN7j.js";import{n as r,r as i}from"./page-BLxt7Xfg.js";import{l as a,t as o}from"./error-alert-BVIxPJFU.js";import{M as s,N as c,_ as l,b as u,h as d,m as f,p,w as m,y as ee}from"./overview-BixI1Gdc.js";import{d as te,i as ne,n as re,r as ie,t as ae,u as oe}from"./dropdown-menu-CFZLqcex.js";import{D as se,W as h,t as g}from"./button-4rhhIcK8.js";import{$t as _,Bn as v,Bt as y,F as ce,Ft as b,Gn as x,Gt as le,Hn as ue,In as de,It as S,Jn as C,Jt as w,Kn as T,Kt as fe,Ln as E,Rn as pe,Ut as me,Vn as he,Wn as ge,Wt as _e,Xn as ve,Xt as ye,Yn as D,an as be,f as O,fn as xe,hn as Se,ln as k,n as Ce,nn as A,o as j,qn as M,qt as N,r as we,zn as P,zt as Te}from"./strings-BeaABxX0.js";import{i as Ee,r as De,t as Oe}from"./identity-DlGZ_gKf.js";import{Et as ke,M as Ae,N as je,Ot as Me,j as Ne,wt as Pe}from"./index-BdDPka5v.js";import{t as F}from"./use-now-vNgLntlV.js";import{t as Fe}from"./heading-D62nMA3C.js";import{t as Ie}from"./pull-request-marks-BIB-F5Bo.js";import{n as I}from"./status-badge-CLPsMXtK.js";import{n as Le}from"./usage-C27cuo6g.js";import{t as Re}from"./markdown-BNebzGGH.js";var L=n(e(),1),ze=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M188,86.11V84c0-14.62-10.83-27.55-30.51-36.4C140.87,40.12,119,36,96,36S51.13,40.12,34.51,47.6C14.83,56.45,4,69.38,4,84v40c0,14.62,10.83,27.55,30.51,36.4A131.67,131.67,0,0,0,68,169.88V172c0,14.62,10.83,27.55,30.51,36.4C115.13,215.88,137,220,160,220s44.87-4.12,61.49-11.6C241.17,199.55,252,186.62,252,172V132C252,109.86,226.71,92.08,188,86.11ZM228,132c0,7.75-21.77,22.48-61.81,23.88C180.33,147.4,188,136.3,188,124V110.44C213.88,115.15,228,125.48,228,132ZM107.37,147.63c-3.63.24-7.42.37-11.37.37-5.08,0-9.89-.22-14.43-.61a10.94,10.94,0,0,0-1.14-.09c-1.51-.14-3-.3-4.43-.48V130.93A187,187,0,0,0,96,132a187,187,0,0,0,20-1.07v15.89c-2.49.3-5.07.56-7.75.75C108,147.58,107.66,147.6,107.37,147.63ZM164,117.14V124c0,4.78-8.28,12.21-24,17.54v-15a115.32,115.32,0,0,0,17.49-6.13Q160.93,118.86,164,117.14ZM96,60c44,0,68,15.85,68,24s-24,24-68,24S28,92.15,28,84,52,60,96,60ZM28,124v-6.86q3.08,1.71,6.51,3.26A115.32,115.32,0,0,0,52,126.53v15C36.28,136.21,28,128.78,28,124Zm64,48v0c1.33,0,2.66,0,4,0q5.44,0,10.77-.32,4.45,1.57,9.23,2.86v15C100.28,184.21,92,176.78,92,172Zm48,22.82V178.94A186.45,186.45,0,0,0,160,180a187,187,0,0,0,20-1.07v15.89a170.08,170.08,0,0,1-40,0Zm64-5.28v-15a115.32,115.32,0,0,0,17.49-6.13q3.44-1.54,6.51-3.26V172C228,176.78,219.72,184.21,204,189.54Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M240,132c0,19.88-35.82,36-80,36-19.6,0-37.56-3.17-51.47-8.44h0C146.76,156.85,176,142,176,124V96.72h0C212.52,100.06,240,114.58,240,132ZM176,84c0-19.88-35.82-36-80-36S16,64.12,16,84s35.82,36,80,36S176,103.88,176,84Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M184,89.57V84c0-25.08-37.83-44-88-44S8,58.92,8,84v40c0,20.89,26.25,37.49,64,42.46V172c0,25.08,37.83,44,88,44s88-18.92,88-44V132C248,111.3,222.58,94.68,184,89.57ZM232,132c0,13.22-30.79,28-72,28-3.73,0-7.43-.13-11.08-.37C170.49,151.77,184,139,184,124V105.74C213.87,110.19,232,122.27,232,132ZM72,150.25V126.46A183.74,183.74,0,0,0,96,128a183.74,183.74,0,0,0,24-1.54v23.79A163,163,0,0,1,96,152,163,163,0,0,1,72,150.25Zm96-40.32V124c0,8.39-12.41,17.4-32,22.87V123.5C148.91,120.37,159.84,115.71,168,109.93ZM96,56c41.21,0,72,14.78,72,28s-30.79,28-72,28S24,97.22,24,84,54.79,56,96,56ZM24,124V109.93c8.16,5.78,19.09,10.44,32,13.57v23.37C36.41,141.4,24,132.39,24,124Zm64,48v-4.17c2.63.1,5.29.17,8,.17,3.88,0,7.67-.13,11.39-.35A121.92,121.92,0,0,0,120,171.41v23.46C100.41,189.4,88,180.39,88,172Zm48,26.25V174.4a179.48,179.48,0,0,0,24,1.6,183.74,183.74,0,0,0,24-1.54v23.79a165.45,165.45,0,0,1-48,0Zm64-3.38V171.5c12.91-3.13,23.84-7.79,32-13.57V172C232,180.39,219.59,189.4,200,194.87Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M184,89.57V84c0-25.08-37.83-44-88-44S8,58.92,8,84v40c0,20.89,26.25,37.49,64,42.46V172c0,25.08,37.83,44,88,44s88-18.92,88-44V132C248,111.3,222.58,94.68,184,89.57ZM56,146.87C36.41,141.4,24,132.39,24,124V109.93c8.16,5.78,19.09,10.44,32,13.57Zm80-23.37c12.91-3.13,23.84-7.79,32-13.57V124c0,8.39-12.41,17.4-32,22.87Zm-16,71.37C100.41,189.4,88,180.39,88,172v-4.17c2.63.1,5.29.17,8,.17,3.88,0,7.67-.13,11.39-.35A121.92,121.92,0,0,0,120,171.41Zm0-44.62A163,163,0,0,1,96,152a163,163,0,0,1-24-1.75V126.46A183.74,183.74,0,0,0,96,128a183.74,183.74,0,0,0,24-1.54Zm64,48a165.45,165.45,0,0,1-48,0V174.4a179.48,179.48,0,0,0,24,1.6,183.74,183.74,0,0,0,24-1.54ZM232,172c0,8.39-12.41,17.4-32,22.87V171.5c12.91-3.13,23.84-7.79,32-13.57Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224.56,103.81C213.43,97.75,198.47,93.39,182,91.34V84c0-12.12-9.58-23.1-27-30.93C139.16,45.93,118.2,42,96,42S52.84,45.93,37,53.07C19.58,60.9,10,71.88,10,84v40c0,12.12,9.58,23.1,27,30.93,10.49,4.72,23.21,8,37,9.73V172c0,12.12,9.58,23.1,27,30.93C116.84,210.07,137.8,214,160,214s43.16-3.93,59-11.07c17.39-7.83,27-18.81,27-30.93V132C246,121.35,238.39,111.34,224.56,103.81Zm-5.74,10.54C228.61,119.68,234,126,234,132c0,14.19-30.39,30-74,30a166.9,166.9,0,0,1-21.21-1.34A110.79,110.79,0,0,0,155,154.93c17.39-7.83,27-18.81,27-30.93V103.43C196.4,105.36,209.3,109.16,218.82,114.35ZM108.16,153.58c-3.92.27-8,.42-12.16.42-5.3,0-10.4-.24-15.28-.67a2.22,2.22,0,0,0-.37,0c-3.58-.33-7-.77-10.35-1.3V124.12A178,178,0,0,0,96,126a178,178,0,0,0,26-1.88V152c-4.34.69-8.91,1.22-13.69,1.56ZM170,105.89V124c0,9.54-13.75,19.8-36,25.51V121.85a115,115,0,0,0,21-6.92A66.2,66.2,0,0,0,170,105.89ZM96,54c43.61,0,74,15.81,74,30s-30.39,30-74,30S22,98.19,22,84,52.39,54,96,54ZM22,124V105.89a66.2,66.2,0,0,0,15,9,115,115,0,0,0,21,6.92v27.66C35.75,143.8,22,133.54,22,124Zm64,48v-6.28c3.3.18,6.63.28,10,.28q5.91,0,11.66-.37A123.17,123.17,0,0,0,122,169.84v27.67C99.75,191.8,86,181.54,86,172Zm48,28V172.1a177.84,177.84,0,0,0,26,1.9,178,178,0,0,0,26-1.88V200a170,170,0,0,1-52,0Zm64-2.49V169.85a115,115,0,0,0,21-6.92,66.2,66.2,0,0,0,15-9V172C234,181.54,220.25,191.8,198,197.51Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M184,89.57V84c0-25.08-37.83-44-88-44S8,58.92,8,84v40c0,20.89,26.25,37.49,64,42.46V172c0,25.08,37.83,44,88,44s88-18.92,88-44V132C248,111.3,222.58,94.68,184,89.57ZM232,132c0,13.22-30.79,28-72,28-3.73,0-7.43-.13-11.08-.37C170.49,151.77,184,139,184,124V105.74C213.87,110.19,232,122.27,232,132ZM72,150.25V126.46A183.74,183.74,0,0,0,96,128a183.74,183.74,0,0,0,24-1.54v23.79A163,163,0,0,1,96,152,163,163,0,0,1,72,150.25Zm96-40.32V124c0,8.39-12.41,17.4-32,22.87V123.5C148.91,120.37,159.84,115.71,168,109.93ZM96,56c41.21,0,72,14.78,72,28s-30.79,28-72,28S24,97.22,24,84,54.79,56,96,56ZM24,124V109.93c8.16,5.78,19.09,10.44,32,13.57v23.37C36.41,141.4,24,132.39,24,124Zm64,48v-4.17c2.63.1,5.29.17,8,.17,3.88,0,7.67-.13,11.39-.35A121.92,121.92,0,0,0,120,171.41v23.46C100.41,189.4,88,180.39,88,172Zm48,26.25V174.4a179.48,179.48,0,0,0,24,1.6,183.74,183.74,0,0,0,24-1.54v23.79a165.45,165.45,0,0,1-48,0Zm64-3.38V171.5c12.91-3.13,23.84-7.79,32-13.57V172C232,180.39,219.59,189.4,200,194.87Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M180,93.11V84c0-22.43-36.9-40-84-40S12,61.57,12,84v40c0,19.14,26.86,34.72,64,38.89V172c0,22.43,36.9,40,84,40s84-17.57,84-40V132C244,113.12,217.87,97.37,180,93.11ZM236,132c0,15.45-30.54,32-76,32a165.71,165.71,0,0,1-28-2.34v-1.39c28.61-6.31,48-20,48-36.27V101.17C212.22,105,236,117.93,236,132ZM108.19,155.59Q102.3,156,96,156c-5.47,0-10.72-.25-15.73-.69l-.27,0h0c-4.16-.38-8.16-.9-12-1.56V121.8A174.87,174.87,0,0,0,96,124a174.87,174.87,0,0,0,28-2.2v31.92a155,155,0,0,1-15.52,1.85ZM172,101.32V124c0,10.88-15.16,22.3-40,28.11V120.27C149.63,116.38,163.75,109.69,172,101.32ZM96,52c45.46,0,76,16.55,76,32s-30.54,32-76,32S20,99.45,20,84,50.54,52,96,52ZM20,124V101.32c8.25,8.37,22.37,15.06,40,19v31.84C35.16,146.3,20,134.88,20,124Zm64,48v-8.4c3.91.26,7.92.4,12,.4s8.06-.14,12-.39a123.93,123.93,0,0,0,16,4.63v31.87C99.16,194.3,84,182.88,84,172Zm48,29.72V169.77A174.48,174.48,0,0,0,160,172a174.87,174.87,0,0,0,28-2.2v31.92a173.07,173.07,0,0,1-56,0ZM236,172c0,10.88-15.16,22.3-40,28.11V168.27c17.63-3.89,31.75-10.58,40-19Z`}))]]),Be=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,44a96,96,0,1,0,96,96A96.11,96.11,0,0,0,128,44Zm0,168a72,72,0,1,1,72-72A72.08,72.08,0,0,1,128,212ZM164.49,99.51a12,12,0,0,1,0,17l-28,28a12,12,0,0,1-17-17l28-28A12,12,0,0,1,164.49,99.51ZM92,16A12,12,0,0,1,104,4h48a12,12,0,0,1,0,24H104A12,12,0,0,1,92,16Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,136a88,88,0,1,1-88-88A88,88,0,0,1,216,136Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M128,40a96,96,0,1,0,96,96A96.11,96.11,0,0,0,128,40Zm0,176a80,80,0,1,1,80-80A80.09,80.09,0,0,1,128,216ZM173.66,90.34a8,8,0,0,1,0,11.32l-40,40a8,8,0,0,1-11.32-11.32l40-40A8,8,0,0,1,173.66,90.34ZM96,16a8,8,0,0,1,8-8h48a8,8,0,0,1,0,16H104A8,8,0,0,1,96,16Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,40a96,96,0,1,0,96,96A96.11,96.11,0,0,0,128,40Zm45.66,61.66-40,40a8,8,0,0,1-11.32-11.32l40-40a8,8,0,0,1,11.32,11.32ZM96,16a8,8,0,0,1,8-8h48a8,8,0,0,1,0,16H104A8,8,0,0,1,96,16Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,42a94,94,0,1,0,94,94A94.11,94.11,0,0,0,128,42Zm0,176a82,82,0,1,1,82-82A82.1,82.1,0,0,1,128,218ZM172.24,91.76a6,6,0,0,1,0,8.48l-40,40a6,6,0,1,1-8.48-8.48l40-40A6,6,0,0,1,172.24,91.76ZM98,16a6,6,0,0,1,6-6h48a6,6,0,0,1,0,12H104A6,6,0,0,1,98,16Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,40a96,96,0,1,0,96,96A96.11,96.11,0,0,0,128,40Zm0,176a80,80,0,1,1,80-80A80.09,80.09,0,0,1,128,216ZM173.66,90.34a8,8,0,0,1,0,11.32l-40,40a8,8,0,0,1-11.32-11.32l40-40A8,8,0,0,1,173.66,90.34ZM96,16a8,8,0,0,1,8-8h48a8,8,0,0,1,0,16H104A8,8,0,0,1,96,16Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,44a92,92,0,1,0,92,92A92.1,92.1,0,0,0,128,44Zm0,176a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,220ZM170.83,93.17a4,4,0,0,1,0,5.66l-40,40a4,4,0,1,1-5.66-5.66l40-40A4,4,0,0,1,170.83,93.17ZM100,16a4,4,0,0,1,4-4h48a4,4,0,0,1,0,8H104A4,4,0,0,1,100,16Z`}))]]),Ve=L.forwardRef((e,t)=>L.createElement(h,{ref:t,...e,weights:ze}));Ve.displayName=`CoinsIcon`;var He=L.forwardRef((e,t)=>L.createElement(h,{ref:t,...e,weights:Be}));He.displayName=`TimerIcon`;var Ue=w({number:le,title:N,url:N,state:N,body:k(_e(N)),author:k(_e(w({login:N}))),labels:k(w({nodes:S(w({name:N}))}))}),We=ye(ce),Ge=_(Ue),R=e=>x(Ge(e),e=>({kind:e.url.includes(`/pull/`)?`Pull request`:`Issue`,number:e.number,title:e.title,url:e.url,state:e.state.charAt(0)+e.state.slice(1).toLowerCase(),author:P(e.author?.login),labels:e.labels?.nodes.map(({name:e})=>e)??[],body:E(P(e.body),e=>e.trim()!==``)})),Ke=new Map([[`Issue Open`,`issue-open`],[`Issue Closed`,`issue-closed`],[`Pull request Open`,`pr-open`],[`Pull request Closed`,`pr-closed`],[`Pull request Merged`,`pr-merged`]]),qe=({kind:e,number:t,url:n,state:r})=>({kind:e===`Pull request`?`pr`:`issue`,number:t,url:n,state:Ke.get(`${e} ${r}`)??null}),Je=(e,t,n)=>x(We(e.itemKey),([,r,i])=>{let a=ue(pe(Ee(t,e.itemKey),({items:t})=>P(t.find(({itemKey:t})=>t===e.itemKey)))),o=ue(E(n===void 0?M():R(n),e=>e.number===i));return{number:i,url:a?.url??o?.url??`https://github.com/${r}/issues/${i}`,title:P(a?.title??o?.title),pullRequest:a===void 0?o?.kind===`Pull request`:a.kind===`pr`}}),Ye=(e,t)=>T(R(t),{onNone:()=>`Opened by ${e}`,onSome:({kind:t,number:n,state:r,labels:i})=>`${e} matched ${t.toLowerCase()} #${n}: ${r.toLowerCase()}${i.length===0?``:`, labeled ${i.join(`, `)}`}`}),Xe=(e,t,n,r)=>{let i=x(n,Oe),a=T(n,{onNone:()=>[],onSome:({items:e})=>e}),o=pe(P(e.pullRequestUrl),e=>De(e,a)),s=x(t,({number:e,url:t,pullRequest:n})=>a.find(t=>t.number===e)??{kind:r===null?n||de(o,t=>t.number===e)?`pr`:`issue`:r.startsWith(`pr-`)?`pr`:`issue`,number:e,url:t,state:r}),c=T(i,{onNone:()=>s,onSome:({origin:e})=>D(e)});return{heading:c,title:x(i,({origin:e})=>e.title),pullRequest:E(C(o,()=>E(s,({kind:e})=>e===`pr`)),e=>!de(c,({number:t})=>t===e.number))}},z=t(),Ze=(e,t)=>v(pe(t,({title:e})=>e),()=>`${e.loop} on ${e.repository}`),Qe=({endedMillis:e,since:t})=>{let n=F(1e3);return(0,z.jsx)(z.Fragment,{children:j(e+Math.max(0,n-Date.parse(t)))})},$e=({duration:e})=>(0,z.jsxs)(`span`,{title:e.unmeasured===0?`Total attempt time`:`${e.unmeasured} ${e.unmeasured===1?`attempt`:`attempts`} not counted: no recorded end time`,className:`font-mono text-xs tabular-nums`,children:[e.unmeasured>0&&`at least `,e.runningSince===null?j(e.endedMillis):(0,z.jsx)(Qe,{endedMillis:e.endedMillis,since:e.runningSince})]}),et=({detail:e})=>{let{machine:t,run:n}=e;return t===null||t.state!==`ready`||t.id===null||t.attemptId===null||t.attemptId!==n.attempts.at(-1)?.id?null:(0,z.jsx)(`span`,{className:`font-mono text-xs`,title:`${s[t.provider]} ${c[t.provider]} ${t.id}`,children:t.id})},tt=({detail:e,overview:t,placement:n,shared:a,actions:o,as:s,className:c})=>{let{run:l}=e,u=Je(l,t,e.eventPayload),d=Xe(l,u,Ee(t,l.itemKey),e.settledItemState);return(0,z.jsx)(i,{actionsBeside:n===`page`?`lg`:`never`,...c===void 0?{}:{className:c},eyebrow:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(r,{icon:Me,title:`Loop`,children:l.loop}),(0,z.jsx)(r,{icon:Pe,title:`Agent`,children:l.agent})]}),heading:(0,z.jsx)(Fe,{variant:`page`,item:d.heading,title:v(d.title,()=>Ze(l,u)),...s===void 0?{}:{as:s},...a?{style:{viewTransitionName:`run-title`}}:{}}),facts:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`span`,{className:`inline-flex items-center gap-2 font-medium text-foreground`,style:a?{viewTransitionName:`run-state`}:void 0,children:[(0,z.jsx)(I,{state:l.state}),m(l,e.unconfirmedStop,e.machine)]}),(0,z.jsx)(Ie,{pullRequests:ve(d.pullRequest)}),e.worker!==null&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(r,{icon:He,children:(0,z.jsx)($e,{duration:e.duration})}),n===`page`&&e.usage.sessions.length>0&&(0,z.jsx)(r,{icon:Ve,children:(0,z.jsx)(Le,{usage:e.usage,attempts:l.attempts})}),(0,z.jsxs)(r,{icon:ke,title:`Worker`,children:[e.worker,(0,z.jsx)(et,{detail:e})]})]}),l.loopPaused&&(0,z.jsx)(`span`,{children:`Loop paused`})]}),actions:o})},B=e=>b(e,{Approve:()=>u.approve,Retry:()=>u.retry,EditRetry:()=>`Edit and retry`,RunAgain:()=>u.runAgain,EditRunAgain:()=>`Edit and run again`,Resolve:({question:e})=>e?`Mark answered`:`Mark resolved`,Cancel:()=>u.cancel}),nt=e=>{let t=e.attempts.at(-1),n=t?.outcome?._tag===`Failed`?t.outcome.failure._tag:null,r=[...e.canApprove?[{_tag:`Approve`}]:[],...e.canRetry?[{_tag:`Retry`},{_tag:`EditRetry`}]:[],...e.canRunAgain?[{_tag:`RunAgain`},{_tag:`EditRunAgain`}]:[],...e.canResolveFailure&&t!==void 0?[{_tag:`Resolve`,attemptId:t.id,question:n===`QuestionFailure`}]:[],...e.canCancel?[{_tag:`Cancel`}]:[]],i=e=>e.flatMap(e=>r.filter(t=>t._tag===e)),a=(()=>{if(e.canApprove){let[e=null]=i([`Approve`]);return{primary:e,secondary:null,more:i([`Cancel`])}}if(e.state===`Failed`){let t=e.canResolveFailure&&(n===`QuestionFailure`||n===`BlockedFailure`),[r=null,a=null,...o]=i(t?[`Resolve`,`EditRetry`,`Retry`]:[`Retry`,`EditRetry`,`Resolve`]);return{primary:r,secondary:a,more:o}}let[t=null,...r]=i(e.canRunAgain?[`RunAgain`,`EditRunAgain`]:[`Cancel`]);return{primary:null,secondary:t,more:r}})(),o=new Set([a.primary,a.secondary,...a.more]);return{...a,more:[...a.more,...r.filter(e=>!o.has(e))]}},rt=({detail:e,onEdit:t,openRun:n,className:r})=>{let{run:i,agentDefinitionChanged:a}=e,s=(0,L.useId)(),c=Ae(),l=je(),[d,f]=(0,L.useState)(!1),p=c.isPending||l.isPending,m=e=>c.mutate({runId:i.id,request:e},{onSuccess:()=>f(!1)}),h=e=>b(e,{Approve:()=>m({action:`approve`}),Retry:()=>m({action:`retry`}),EditRetry:()=>t(`retry`),RunAgain:()=>l.mutate(Ne(i),{onSuccess:e=>{e._tag===`Claimed`&&n(e.runId)}}),EditRunAgain:()=>t(`runAgain`),Resolve:({attemptId:e})=>m({action:`resolveFailure`,attemptId:e}),Cancel:()=>f(!0)}),{primary:_,secondary:v,more:y}=nt(i);return _===null&&v===null&&y.length===0?null:(0,z.jsxs)(`div`,{className:se(`max-w-sm space-y-2`,r),children:[(0,z.jsx)(`div`,{role:`group`,"aria-label":`Run actions`,className:`flex flex-wrap items-center gap-2`,children:d?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(g,{variant:`destructive`,disabled:p,onClick:()=>m({action:`cancel`}),children:u.confirmCancel}),(0,z.jsx)(g,{variant:`ghost`,disabled:p,onClick:()=>f(!1),children:u.keepRunning})]}):(0,z.jsxs)(z.Fragment,{children:[_!==null&&(0,z.jsx)(g,{disabled:p,"aria-describedby":_._tag===`Retry`?s:void 0,onClick:()=>h(_),children:B(_)}),v!==null&&(0,z.jsx)(g,{variant:v._tag===`Cancel`?`ghost`:`outline`,disabled:p,"aria-describedby":v._tag===`Retry`?s:void 0,onClick:()=>h(v),children:B(v)}),y.length>0&&(0,z.jsxs)(ae,{children:[(0,z.jsx)(oe,{disabled:p,render:(0,z.jsx)(g,{variant:`ghost`,size:`icon`,className:`text-muted-foreground hover:text-foreground aria-expanded:text-foreground`}),"aria-label":`More actions`,children:(0,z.jsx)(te,{weight:`bold`,className:`size-4`,"aria-hidden":`true`})}),(0,z.jsx)(re,{align:`end`,className:`w-auto min-w-44`,children:(0,z.jsx)(ie,{children:y.map(e=>(0,z.jsx)(ne,{"aria-describedby":e._tag===`Retry`?s:void 0,variant:e._tag===`Cancel`?`destructive`:`default`,onClick:()=>h(e),children:B(e)},e._tag))})})]})]})}),i.canRetry&&(0,z.jsxs)(`div`,{className:`space-y-1 text-xs wrap-anywhere text-muted-foreground`,children:[(0,z.jsx)(`p`,{id:s,children:ee(i.agentBrain)}),a&&(0,z.jsxs)(`p`,{children:[`The loaded definition of `,i.agent,` has changed. Edit and retry uses the current definition.`]})]}),l.data?._tag===`CycleBlocked`&&(0,z.jsx)(`p`,{role:`status`,className:`text-xs text-needs-you`,children:`No run opened: cycle budget used up. Reset it in Needs attention`}),c.isError&&(0,z.jsx)(o,{message:c.error.message}),l.isError&&(0,z.jsx)(o,{message:l.error.message})]})},it=(e,t,n)=>{let r=new Set(e.map(({sequence:e})=>e)),i=[...new Map([...t,...e].map(e=>[e.sequence,e])).values()].sort((e,t)=>e.sequence-t.sequence),a=new Map,o=new Map,s=(e,t)=>JSON.stringify([e,t]);for(let e of i){let t=e.payload;if(t._tag!==`SessionEvent`)continue;let i=t.event;if(i._tag===`PoolRateLimitsUpdated`||i._tag===`SessionTokensUpdated`)continue;let c=s(e.attemptId,i.session.id),l=a.get(c);l===void 0&&(l={attemptId:e.attemptId,session:i.session,first:e,harnessSession:M(),latestSequence:e.sequence,status:n.has(e.attemptId)?`Stopped`:`Live`,held:!1,paused:!1,idle:!1,events:[],interventions:[]},a.set(c,l),i.session._tag===`ParentSession`&&o.set(e.attemptId,l)),l.latestSequence=e.sequence,i._tag===`SessionStarted`&&(l.harnessSession=i.harnessSession),i._tag===`SessionFinished`&&(l.status=`Finished`),i._tag===`SessionIdle`&&(l.idle=!0),i._tag===`SessionResumed`&&(l.idle=!1),r.has(e.sequence)&&l.events.push({sequence:e.sequence,receivedAt:e.receivedAt,event:i})}let c=[],l=(e,t)=>JSON.stringify([e,t.inputSequence]),u=new Map;for(let{attemptId:e,payload:t}of i)(t._tag===`InterventionApplied`||t._tag===`InterventionRejected`)&&u.set(l(e,t),t);let d=new Set;for(let e of i){let t=e.payload;if(t._tag!==`InterventionApplied`&&t._tag!==`InterventionRejected`)continue;let n=l(e.attemptId,t),i={...e,payload:u.get(n)??t},f=t.intervention.target,p=f._tag===`Parent`?o.get(e.attemptId):a.get(s(e.attemptId,f.sessionId)),m=r.has(e.sequence)&&!d.has(n);m&&d.add(n),p===void 0?m&&c.push(i):(e.sequence>p.latestSequence&&(p.latestSequence=e.sequence),t._tag===`InterventionApplied`&&(p.held=t.state.held,p.paused=t.state.paused),m&&p.interventions.push(i))}return{groups:a,unmatched:c}},V=e=>({key:`event:${e.sequence}`,attemptId:e.attemptId,sequence:e.sequence,latestSequence:e.sequence,receivedAt:e.receivedAt}),H=(e,t,n)=>({_tag:`Notice`,...V(e),...t,origin:n,queued:null}),U=e=>`${e} ${e===1?`retry`:`retries`}`,at=(e,t)=>{let n=[],r=new Map;for(let i of e.events){let a=i.event,o={...i,attemptId:e.attemptId};if(a._tag===`ToolStarted`||a._tag===`ToolFinished`){let n=JSON.stringify([e.attemptId,e.session.id,a.callId]),s=r.get(n),c=s?.start??M();r.set(n,{_tag:`Tool`,...V(o),key:n,sequence:s?.sequence??i.sequence,receivedAt:s?.receivedAt??i.receivedAt,name:a.tool,start:a._tag===`ToolStarted`?D({receivedAt:i.receivedAt,input:a.input}):c,state:a._tag===`ToolFinished`?{_tag:a.isError?`Error`:`Finished`,receivedAt:i.receivedAt,output:a.output}:s?.state??{_tag:t===`Live`?`Running`:`Stopped`}});continue}if(a._tag===`ProviderRetrying`||a._tag===`ProviderRecovered`){n.push(H(o,a._tag===`ProviderRetrying`?{kind:`status`,label:`${e.session.agent}: provider unreachable`,detail:a.message,format:`plain`,tone:`warning`}:{kind:`status`,label:`${e.session.agent}: provider reachable again`,detail:`After ${U(a.retries)}`,format:`plain`,tone:`plain`},{_tag:`Provider`,session:e.session,event:a}));continue}let s=b(a,{TextOutput:({text:t})=>({kind:`message`,label:e.session.agent,detail:t,format:`markdown`,tone:`plain`}),SessionStarted:()=>({kind:`status`,label:`${e.session.agent} started`,detail:Ce(e.session.brain),format:`plain`,tone:`plain`}),SessionIdle:()=>({kind:`status`,label:`${e.session.agent} idle`,detail:`Session open for operator input`,format:`plain`,tone:`plain`}),SessionResumed:()=>({kind:`status`,label:`${e.session.agent} resumed`,detail:``,format:`plain`,tone:`plain`}),SessionFinished:()=>({kind:`status`,label:`${e.session.agent} finished`,detail:``,format:`plain`,tone:`plain`})});n.push(H(o,s,{_tag:`Session`,session:e.session,event:a._tag}))}return[...n,...r.values()].sort((e,t)=>e.sequence-t.sequence)},ot=e=>{let{action:t,operator:n,target:r}=e.payload.intervention,i=e.payload._tag===`InterventionRejected`,a=t._tag===`OperatorMessage`||t._tag===`Steer`,o=e.payload._tag===`InterventionApplied`&&e.payload.state.queued?r._tag===`Parent`?`parent`:`child`:null,s=`${n} released the ${r._tag===`Parent`?`parent`:`child`}`;return{...H(e,{kind:a?`message`:`status`,label:i?`${n} · not delivered`:a?n:t._tag===`Release`?s:`${n} paused the session`,detail:i?`${a?`${t.message}\n\n`:``}${e.payload.message}`:a?t.message:``,format:a?`markdown`:`plain`,tone:i?`failed`:`plain`},{_tag:`Operator`,operator:n}),queued:o}},st=(e,t,n=[])=>{let r=new Set(t.filter(({outcome:e})=>e!==null).map(({id:e})=>e));for(let{attemptId:t,payload:n}of e)(n._tag===`Final`||n._tag===`Failed`||n._tag===`Interrupted`)&&r.add(t);let{groups:i,unmatched:a}=it(e,n,r),o=[];for(let t of[...e].sort((e,t)=>e.sequence-t.sequence)){let e=t.payload;e._tag!==`InterventionApplied`&&e._tag!==`InterventionRejected`&&(t.direction!==`inbound`||t.operator===void 0||e._tag===`Cancel`)&&e._tag!==`SessionEvent`&&o.push(H(t,b(e,{Started:({parentModel:e,conflictingSalvage:t})=>({kind:`status`,label:`Attempt started`,detail:T(t,{onNone:()=>e,onSome:t=>`${e}. ${p(t)}`}),format:`plain`,tone:`plain`}),Final:({result:e})=>({kind:`status`,label:`Attempt finished`,detail:e.message,format:`markdown`,tone:`plain`}),Failed:({failure:e})=>({kind:`status`,label:`Attempt failed`,detail:f(e),format:`plain`,tone:`failed`}),Cancel:()=>({kind:`status`,label:`Cancel requested`,detail:`Attempt stopping`,format:`plain`,tone:`plain`}),Interrupted:()=>({kind:`status`,label:`Interrupted`,detail:`Acknowledged by the parent session`,format:`plain`,tone:`plain`}),Steer:({message:e})=>({kind:`message`,label:`Operator`,detail:e,format:`markdown`,tone:`plain`}),Interrupt:()=>({kind:`status`,label:`Interrupt requested`,detail:`Sent by the operator`,format:`plain`,tone:`plain`}),OperatorMessage:({message:e})=>({kind:`message`,label:`Operator`,detail:e,format:`markdown`,tone:`plain`}),Release:()=>({kind:`status`,label:`Released`,detail:`Held child released by the operator`,format:`plain`,tone:`plain`}),WorkerUnresponsive:({worker:e,lastAnsweredAt:t,reason:n})=>({kind:`status`,label:`${e} silent since ${we(xe(t))}`,detail:n,format:`plain`,tone:`warning`}),WorkerResponsive:({worker:e,lastAnsweredAt:n,recovered:r})=>({kind:`status`,label:r?`${e} answering again`:`${e} answering`,detail:r?`Silent for ${j(Date.parse(t.receivedAt)-Se(n))}`:``,format:`plain`,tone:`plain`})}),{_tag:`Envelope`,payload:e}))}let s=[];for(let[e,t]of i)s.push({_tag:`Session`,...V(t.first),key:e,latestSequence:t.latestSequence,session:t.session,harnessSession:t.harnessSession,status:t.status,held:t.status===`Live`&&t.held,paused:t.status===`Live`&&t.paused,idle:t.status===`Live`&&t.idle,entries:[...at(t,t.status),...t.interventions.map(e=>ot(e))].sort((e,t)=>e.sequence-t.sequence)});return o.push(...a.map(e=>{let t=ot(e),n=e.payload.intervention.target;return{...t,label:`${t.label} · ${n._tag===`Parent`?`parent`:n.sessionId}`}})),{sessions:s,terminalAttempts:r,items:[...o,...s.flatMap(e=>e.session._tag===`ChildSession`?[e]:e.entries)].sort((e,t)=>e.sequence-t.sequence)}},ct=e=>{if(e.status!==`Live`)return e.status;if(e.paused)return`Paused`;if(e.held)return e.idle?`Held, waiting for input`:`Held, working`;if(e.idle)return`Waiting for input`;let t=[...e.entries].reverse().find(e=>e._tag===`Tool`&&e.state._tag===`Running`);return t?._tag===`Tool`?`Running ${t.name}`:`Working`},W=fe(N,y),lt=w({type:me([`text`,`inputText`]),text:N}),G=e=>A(W)(e)?e:{},K=e=>A(N)(e)?e:void 0,ut=e=>{if(e===`cwd`)return`Working directory`;if(e===`durationMs`)return`Duration (ms)`;let t=e.replace(/([a-z])([A-Z])/gu,`$1 $2`).replaceAll(`_`,` `).toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1)},q=(e,t,n=`text`)=>({_tag:`Code`,label:e,text:t,language:n}),J=(e,t,n=[])=>{let r=Object.entries(t).filter(([e])=>!n.includes(e)).map(([e,t])=>({label:ut(e),value:t}));return r.length===0?[]:[{_tag:`Fields`,label:e,fields:r}]},Y=(e,t,n=`text`)=>{if(e==null)return[];if(A(N)(e))return[q(t,e,n)];if(Array.isArray(e))return e.flatMap(e=>A(lt)(e)?[q(t,e.text,n)]:Y(e,t,n));if(!A(W)(e))return[{_tag:`Fields`,label:t,fields:[{label:`Value`,value:e}]}];let r=[],i={};for(let[a,o]of Object.entries(e))a===`content`&&Array.isArray(o)?r.push(...Y(o,t,n)):[`text`,`stdout`,`stderr`,`aggregatedOutput`,`message`].includes(a)?r.push(...Y(o,a===`text`?t:ut(a),n)):a===`error`?r.push(...Y(o,`Error`)):i[a]=o;return[...r,...J(t,i)]},dt=w({oldText:N,newText:N}),ft=w({path:N,diff:N,kind:w({type:N})}),pt=_(S(ft)),mt=Te.check(be(1)),X=e=>/\.[cm]?tsx?$/iu.test(e)?`typescript`:/\.json$/iu.test(e)?`json`:`text`,ht=e=>Y(e,`Confirmation`).map(e=>e._tag===`Code`?{_tag:`Text`,label:e.label,text:e.text}:e),gt=(e,t,n)=>{let r=G(e),i=G(t),a=pt(i.changes??r.changes),o=K(r.path)??K(r.file_path),s=A(mt)(r.offset)?r.offset:void 0,c=A(mt)(r.limit)?r.limit:void 0,l=s??(r.offset===void 0?1:void 0),u=n===`read`&&(s!==void 0||c!==void 0)?[l===void 0?``:`From line ${l}`,c===void 0?``:`up to ${c} ${c===1?`line`:`lines`}`].filter(e=>e!==``).join(` · `):``,d=[o??`File details unavailable`,u].filter(e=>e!==``).join(` · `),f=K(G(i.details).patch)??K(G(i.details).diff),p=_(S(dt))(r.edits),m=v(p,()=>A(N)(r.old_string)&&A(N)(r.new_string)?[{oldText:r.old_string,newText:r.new_string}]:[]);return{activity:{_tag:`Files`,operation:i.type===`fileChange`||r.type===`fileChange`?`change`:n,paths:T(a,{onNone:()=>o===void 0?[]:[o],onSome:e=>e.map(({path:e})=>e)})},title:{read:`Read file`,edit:`Edit file`,write:`Write file`}[n],subject:n===`read`?d:o??T(a,{onNone:()=>`File details unavailable`,onSome:e=>e.length===1?e[0]?.path??`File details unavailable`:`${e.length} files`}),input:[...J(`Options`,r,[`path`,`file_path`,`edits`,`old_string`,`new_string`,`content`,`changes`,`type`,`id`,`status`,...n===`read`&&s!==void 0?[`offset`]:[],...n===`read`&&c!==void 0?[`limit`]:[]]),...(f===void 0?m:[]).flatMap(({oldText:e,newText:t},n)=>[q(m.length===1?`Before`:`Before ${n+1}`,e,X(o??``)),q(m.length===1?`After`:`After ${n+1}`,t,X(o??``))]),...A(N)(r.content)?[q(`Content`,r.content,X(o??``))]:[],...t===void 0?T(pt(r.changes),{onNone:()=>[],onSome:e=>e.map(({path:e,diff:t})=>q(e,t,`diff`))}):[]],output:T(pt(i.changes),{onNone:()=>f===void 0?n===`read`?Y(t,o??`Output`,X(o??``)):ht(t):[q(o??`Changes`,f,`diff`),...ht(Object.fromEntries(Object.entries(i).filter(([e])=>e!==`details`))),...J(`Metadata`,G(i.details),[`patch`,`diff`])],onSome:e=>e.map(({path:e,diff:t,kind:n})=>q(`${e} · ${n.type}`,t,`diff`))})}},_t=e=>{switch(e.toLowerCase()){case`bash`:case`powershell`:case`shell`:case`command`:return`command`;case`read`:return`read`;case`edit`:case`file_change`:return`edit`;case`write`:return`write`;case`grep`:case`glob`:case`find`:case`ls`:case`web_search`:return`search`;case`subagent`:case`agent`:case`task`:return`agent`;default:return`tool`}},vt=({input:e,output:t})=>{let n=G(e??t),r=G(t),i=K(n.command)??K(r.command);return{activity:{_tag:`Command`,command:i},title:`Command`,subject:i??`Command details unavailable`,input:[...i===void 0?[]:[q(`Command`,i,`bash`)],...J(`Options`,n,[`command`,`type`,`id`,`status`,`aggregatedOutput`,`exitCode`,`durationMs`,`processId`,`source`,`commandActions`])],output:r.type===`commandExecution`?[...Y(r.aggregatedOutput,`Output`),...J(`Execution`,r,[`type`,`id`,`status`,`command`,`cwd`,`aggregatedOutput`,`processId`,`source`,`commandActions`])]:Y(t,`Output`)}},yt=({input:e,output:t,name:n})=>{let r=G(e??t),i=G(t),a=G(r.action);return{activity:{_tag:`Search`},title:n.toLowerCase()===`ls`?`List files`:`Search`,subject:K(r.pattern)??K(r.query)??K(a.query)??K(a.url)??K(r.path)??`Search details unavailable`,input:J(`Search`,r,[`type`,`id`]),output:i.type===`webSearch`?J(`Search`,i,[`type`,`id`]):Y(t,`Results`)}},bt=({input:e,output:t})=>{let n=G(e),r=K(n.task)??K(n.prompt);return{activity:{_tag:`Delegation`},title:`Delegate`,subject:K(n.description)??r??`Delegated task`,input:[...r===void 0?[]:[{_tag:`Text`,label:`Task`,text:r}],...J(`Agent`,n,[`task`,`prompt`])],output:Y(t,`Report`).map(e=>e._tag===`Code`?{_tag:`Text`,label:e.label,text:e.text}:e)}},xt=({input:e,output:t,name:n})=>{let r=G(e),i=G(t),a=r.type===`mcpToolCall`||r.type===`dynamicToolCall`||i.type===`mcpToolCall`||i.type===`dynamicToolCall`,o=a?r.arguments??i.arguments:e;return{activity:{_tag:`Tool`},title:(a?[K(r.server)??K(i.server)??K(r.namespace)??K(i.namespace),K(r.tool)??K(i.tool)].filter(e=>e!==void 0).join(` · `):n)||n,subject:A(W)(o)?`${Object.keys(o).length} parameters`:A(N)(o)?o:`Tool details`,input:Y(o,`Parameters`),output:a?[...Y(i.result??i.contentItems,`Output`),...Y(i.error,`Error`)]:Y(t,`Output`)}},St=e=>{let t={name:e.name,input:T(e.start,{onNone:()=>void 0,onSome:({input:e})=>e}),output:b(e.state,{Running:()=>void 0,Stopped:()=>void 0,Finished:({output:e})=>e,Error:({output:e})=>e})},n=_t(e.name);return{category:n,...{command:vt,read:({input:e,output:t})=>gt(e,t,`read`),edit:({input:e,output:t})=>gt(e,t,`edit`),write:({input:e,output:t})=>gt(e,t,`write`),search:yt,agent:bt,tool:xt}[n](t)}},Z=(e,t)=>{let n=Math.max(0,Math.floor((t-Date.parse(e))/1e3));if(n<60)return`${n}s`;let r=Math.floor(n/60);return r<60?`${r}m ${n%60}s`:`${Math.floor(r/60)}h ${r%60}m`},Ct=({since:e,className:t})=>{let n=F(1e3);return(0,z.jsx)(`time`,{dateTime:e,"aria-live":`off`,className:se(`font-mono tabular-nums`,t),title:`Since ${O(e)}`,children:Z(e,n)})},wt=e=>{if(e.status!==`Live`)return{label:e.status,detail:``,since:M()};if(e.paused||e.held||e.idle)return{label:ct(e),detail:``,since:M()};let t=[...e.entries].reverse().find(e=>e._tag===`Tool`&&e.state._tag===`Running`);if(t?._tag!==`Tool`)return{label:`Working`,detail:``,since:M()};let n=St(t);return{label:{command:`Running command`,read:`Reading file`,edit:`Editing file`,write:`Writing file`,search:`Searching`,agent:`Delegating`,tool:`Running ${n.title}`}[n.category],detail:n.subject,since:x(t.start,({receivedAt:e})=>e)}},Tt=e=>{let t=e.filter(({status:e})=>e===`Live`);return t.filter(({session:e})=>e._tag===`ChildSession`).sort((e,t)=>t.latestSequence-e.latestSequence)[0]??t.find(({session:e})=>e._tag===`ParentSession`)},Et=({chapter:e})=>{let t=F(1e3),n=Tt(e.sessions),r=n===void 0?{label:`Parent session starting`,detail:``,since:M()}:wt(n);return(0,z.jsxs)(`div`,{role:`status`,"aria-label":`Current activity`,className:`min-w-0 space-y-0.5 text-xs`,children:[(0,z.jsxs)(`p`,{className:`flex min-w-0 items-center gap-2`,children:[(0,z.jsx)(I,{state:`Running`}),n!==void 0&&(0,z.jsx)(`span`,{className:`shrink-0 font-medium text-foreground`,children:n.session._tag===`ParentSession`?`Parent`:n.session.agent}),(0,z.jsx)(`span`,{className:`min-w-0 truncate text-muted-foreground`,children:r.label}),T(r.since,{onNone:()=>null,onSome:e=>(0,z.jsx)(`span`,{"aria-live":`off`,className:`ml-auto shrink-0 font-mono tabular-nums text-muted-foreground`,title:`Started ${O(e)}`,children:Z(e,t)})})]}),r.detail!==``&&(0,z.jsx)(`p`,{className:`truncate pl-3.5 font-mono text-muted-foreground`,title:r.detail,children:r.detail}),T(e.lastActivityAt,{onNone:()=>null,onSome:e=>(0,z.jsxs)(`p`,{"aria-live":`off`,className:`pl-3.5 text-muted-foreground`,children:[`Last activity `,Z(e,t),` ago`]})}),e.connectivity.map(e=>(0,z.jsx)(Dt,{warning:e,now:t},e._tag===`WorkerSilent`?e.worker:`${e.agent}:${e.since}`))]})},Dt=({warning:e,now:t})=>{let n=b(e,{WorkerSilent:({worker:e,lastAnsweredAt:t})=>({text:`${e} silent since ${we(t)}`,since:t,detail:null}),ProviderRetrying:({agent:e,retries:t,since:n,message:r})=>({text:`${e}: provider unreachable, ${U(t)} since ${we(n)}`,since:n,detail:r})});return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`p`,{className:`flex min-w-0 items-baseline gap-2 pl-3.5`,children:[(0,z.jsxs)(`span`,{className:`min-w-0 text-warning`,children:[(0,z.jsx)(`span`,{className:`sr-only`,children:`Warning: `}),n.text]}),(0,z.jsx)(`span`,{"aria-live":`off`,className:`ml-auto shrink-0 font-mono tabular-nums text-muted-foreground`,title:`Since ${O(n.since)}`,children:Z(n.since,t)})]}),n.detail!==null&&(0,z.jsx)(`p`,{className:`truncate pl-3.5 text-muted-foreground`,title:n.detail,children:n.detail})]})},Ot=e=>{let t=null,n=new Map;for(let{payload:r,receivedAt:i}of e)if(r._tag===`WorkerUnresponsive`)t={_tag:`WorkerSilent`,worker:r.worker,lastAnsweredAt:xe(r.lastAnsweredAt)};else if(r._tag===`WorkerResponsive`)t=null;else if(r._tag===`SessionEvent`){let e=r.event;e._tag===`ProviderRetrying`?n.set(e.session.id,{_tag:`ProviderRetrying`,sessionId:e.session.id,agent:e.session.agent,message:e.message,retries:e.retries,since:n.get(e.session.id)?.since??i}):(e._tag===`ProviderRecovered`||e._tag===`SessionIdle`||e._tag===`SessionFinished`)&&n.delete(e.session.id)}return[...t===null?[]:[t],...n.values()]},kt=/^\s*\[usine:(blocked|question|failed)\]/u,At=e=>{let t=kt.exec(e)?.[1];return t===`blocked`||t===`question`?t:null},Q=e=>e.replace(kt,``).trimStart(),jt=e=>Q(e).replace(/\s+/gu,` `).trim(),Mt=e=>e.replace(/^\s{0,3}(?:#{1,6}\s+|[-*+]\s+|\d+[.)]\s+|>\s?)/u,``).replace(/!?\[([^\]]*)\]\([^)]*\)/gu,`$1`).replace(/`([^`]*)`/gu,`$1`).replace(/(\*\*|__)(.+?)\1/gu,`$2`).replace(/(^|[\s(])\*(\S(?:.*?\S)?)\*(?=[\s).,;:!?]|$)/gu,`$1$2`).trim(),Nt=e=>e.replace(/```[\s\S]*?(?:```|$)/gu,`
2
+ `).split(`
3
+ `).map(Mt).filter(e=>e!==``).join(` `),$=e=>{let t=Q(e).replace(/```[\s\S]*?(?:```|$)/gu,`
4
+ `).split(`
5
+ `).map(Mt).filter(e=>e!==``)[0]??``;return/^(.*?[.!?…])(?=\s|$)/u.exec(t)?.[1]??t},Pt=32,Ft=12,It=e=>{if(e.length<=Pt)return e;let t=/^(.+?)(?:[,;:]\s|\s[—–-]\s)/u.exec(e)?.[1];if(t!==void 0&&t.length>=Ft&&t.length<=Pt)return t;let n=e.slice(0,33).lastIndexOf(` `);return`${(n>0?e.slice(0,n):e.split(` `)[0]??e).replace(/[\s,;:.—–-]+$/u,``)}…`},Lt=e=>({name:e.session._tag===`ParentSession`?`Parent`:e.session.agent,sessionKey:e.key}),Rt=e=>e.origin._tag===`Envelope`&&(e.origin.payload._tag===`Final`||e.origin.payload._tag===`Failed`||e.origin.payload._tag===`Interrupted`),zt=e=>b(e,{Succeeded:({message:e})=>he(e),Failed:({failure:e})=>e._tag===`AgentFailure`||e._tag===`BlockedFailure`||e._tag===`QuestionFailure`?f(e):null,Canceled:()=>null}),Bt=(e,t)=>{let n=t?.salvage??null,r=e?.origin._tag===`Envelope`&&e.origin.payload._tag===`Final`?D(e.origin.payload.result.message):M(),i=t?.outcome;if(i!=null)return b(i,{Succeeded:()=>({_tag:`Succeeded`,message:r}),Failed:({failure:e})=>({_tag:`Failed`,failure:e,salvage:n}),Canceled:()=>({_tag:`Canceled`,salvage:n})});if(e?.origin._tag!==`Envelope`)return null;let a=e.origin.payload;return a._tag===`Final`?{_tag:`Succeeded`,message:r}:a._tag===`Failed`?{_tag:`Failed`,failure:a.failure,salvage:n}:a._tag===`Interrupted`?{_tag:`Canceled`,salvage:n}:null},Vt=({direction:e,payload:t})=>e===`outbound`&&t._tag!==`WorkerUnresponsive`&&t._tag!==`WorkerResponsive`&&(t._tag!==`SessionEvent`||t.event._tag!==`PoolRateLimitsUpdated`&&t.event._tag!==`ProviderRetrying`),Ht=e=>e.detail===``?e.label:`${e.label}. ${e.detail}`,Ut=e=>e._tag===`Envelope`?e.payload._tag===`WorkerUnresponsive`?{_tag:`WorkerSilent`}:e.payload._tag===`WorkerResponsive`&&e.payload.recovered?{_tag:`WorkerAnswers`}:null:null,Wt=(e,t,n,r,i)=>{let a=[],o=t===null?null:zt(t),s=o===null?null:jt(o),c=new Set,l=null,u=[],d=null,f=new Map,m=()=>{let[e,...t]=u;e!==void 0&&d!==null&&a.push({_tag:`Burst`,key:`burst:${e.key}`,speaker:d,tools:[e,...t]}),u=[],d=null};for(let{entry:t,session:n}of e){if(t._tag===`Tool`){let e=n??{name:`Parent`,sessionKey:null};if(St(t).category===`agent`){m(),a.push({_tag:`Delegation`,key:t.key,speaker:e,tool:t});continue}d!==null&&d.sessionKey!==e.sessionKey&&m(),d=e,u.push(t);continue}if(Rt(t))continue;let e=t.origin,r={key:t.key,sequence:t.sequence,latestSequence:t.latestSequence,receivedAt:t.receivedAt};if(e._tag===`Session`){let i=n??{name:e.session.agent,sessionKey:null};if(e.event===`TextOutput`){let n=jt(t.detail);if(s!==null&&n===s){l??={receivedAt:t.receivedAt,speaker:i};continue}let o=e.session._tag===`ChildSession`;if(!o&&c.has(n))continue;o&&c.add(n),m();let u=At(t.detail);a.push({_tag:`Message`,...r,speaker:i,from:`agent`,text:Q(t.detail),format:t.format,undelivered:!1,queued:null,blocked:u===`blocked`,question:u===`question`});continue}(e.event===`SessionIdle`||e.event===`SessionResumed`)&&(m(),a.push({_tag:`Note`,...r,speaker:i,text:e.event===`SessionIdle`?`Waiting for operator input`:`Resumed`,tone:`plain`,connectivity:null}))}else if(e._tag===`Provider`){let i=n??{name:e.session.agent,sessionKey:null},o=e.event;if(m(),o._tag===`ProviderRecovered`){f.delete(e.session.id),a.push({_tag:`Note`,...r,speaker:i,text:`Provider reachable again after ${U(o.retries)}`,tone:`plain`,connectivity:null});continue}let s=`Provider unreachable, ${U(o.retries)} so far. ${o.message}`,c=f.get(e.session.id),l=c===void 0?void 0:a[c];if(c===a.length-1&&l?._tag===`Note`){a[c]={...l,latestSequence:t.latestSequence,text:s};continue}f.set(e.session.id,a.length),a.push({_tag:`Note`,...r,speaker:i,text:s,tone:`warning`,connectivity:{_tag:`ProviderRetrying`,sessionId:e.session.id}})}else if(e._tag===`Envelope`&&e.payload._tag===`Started`){let t=e.payload.conflictingSalvage;ge(t)&&(m(),a.push({_tag:`Note`,...r,speaker:null,text:p(t.value),tone:`plain`,connectivity:null}))}else m(),a.push(t.kind===`message`?{_tag:`Message`,...r,speaker:{name:e._tag===`Operator`?e.operator:t.label,sessionKey:n?.sessionKey??null},from:`operator`,text:t.detail,format:t.format,undelivered:t.tone===`failed`,queued:t.queued,blocked:!1,question:!1}:{_tag:`Note`,...r,speaker:null,text:Ht(t),tone:t.tone,connectivity:Ut(e)})}if(m(),t!==null){let e=n===void 0?M():D({key:n.key,sequence:n.sequence,latestSequence:n.latestSequence,receivedAt:n.receivedAt});a.push({_tag:`Ending`,key:n?.key??`ending:${i}`,position:e,receivedAt:C(P(l?.receivedAt),()=>C(x(e,({receivedAt:e})=>e),()=>P(r?.endedAt))),speaker:l?.speaker??null,end:t,outOfMemory:r?.outOfMemory??null})}return a},Gt=(e,t,n)=>{let r=new Map;for(let t of e.sessions)for(let e of t.entries)r.set(e.key,t);let i=e.items.flatMap(e=>e._tag===`Session`?e.entries:[e]).sort((e,t)=>e.sequence-t.sequence),o=[...[...t].sort((e,t)=>e.number-t.number).map(({id:e})=>e),...i.map(({attemptId:e})=>e)];return{chapters:[...new Set(o)].map(o=>{let s=t.find(({id:e})=>e===o),c=i.filter(e=>e.attemptId===o),l=[...c].reverse().find(e=>e._tag===`Notice`&&Rt(e)),u=c.find(e=>e._tag===`Notice`&&e.origin._tag===`Envelope`&&e.origin.payload._tag===`Started`),d=Bt(l,s),f=n.filter(e=>e.attemptId===o),p=[...f].reverse().find(Vt),m=d===null&&!e.terminalAttempts.has(o);return{key:`attempt:${o}`,attemptId:o,attempt:P(s),live:m,parentModel:u?._tag===`Notice`&&u.origin._tag===`Envelope`&&u.origin.payload._tag===`Started`?D(u.origin.payload.parentModel):M(),sessions:e.sessions.filter(e=>e.attemptId===o).sort((e,t)=>Number(e.session._tag===`ChildSession`)-Number(t.session._tag===`ChildSession`)||e.sequence-t.sequence),rows:Wt(c.map(e=>{let t=r.get(e.key);return{entry:e,session:t===void 0?null:Lt(t)}}),d,l,s,o),meters:a(f),endedAt:C(P(s?.endedAt),()=>P(l?.receivedAt)),lastActivityAt:P(p?.receivedAt),connectivity:m?Ot(f):[]}})}},Kt=e=>e.rows.flatMap(e=>{let t=(t,n)=>[{key:e.key,...t,text:n,label:It(n)}];if(e._tag===`Message`){let{sessionKey:n,name:r}=e.speaker;return e.from===`operator`?t({sessionKey:n,kind:`operator`,speaker:r,tone:e.undelivered?`failed`:`plain`},$(e.text)):t({sessionKey:n,kind:e.blocked?`blocker`:e.question?`question`:`turn`,speaker:r,tone:e.blocked?`failed`:`plain`},$(e.text))}if(e._tag===`Note`)return e.connectivity===null&&e.tone!==`failed`?[]:t({sessionKey:e.speaker?.sessionKey??null,kind:e.connectivity===null?`operator`:`notice`,speaker:e.speaker?.name??null,tone:e.tone},$(e.text));if(e._tag!==`Ending`)return[];let n=(n,r)=>t({sessionKey:e.speaker?.sessionKey??null,kind:`ending`,speaker:null,tone:r},n);return b(e.end,{Succeeded:({message:e})=>n(T(e,{onNone:()=>`Succeeded`,onSome:$}),`plain`),Failed:({failure:e})=>n($(f(e)),`failed`),Canceled:()=>n(`Canceled`,`plain`)})}),qt=e=>{let t=[];for(let n of Kt(e)){let e=t.at(-1);n.kind===`turn`?e?._tag===`Turns`&&e.sessionKey===n.sessionKey?t[t.length-1]={...e,turns:[...e.turns,n]}:t.push({_tag:`Turns`,key:`turns:${n.key}`,speaker:n.speaker??`Parent`,sessionKey:n.sessionKey,turns:[n]}):t.push({_tag:`Mark`,checkpoint:n})}return t},Jt=e=>e.chapters.flatMap(e=>{let t=new Set(Kt(e).map(({key:e})=>e)),n=(t,n=!1)=>({id:t,attemptId:e.attemptId,checkpoint:n});return[n(e.key),n(`history:${e.attemptId}`),n(`empty:${e.attemptId}`),...e.rows.map(e=>n(e.key,t.has(e.key))),n(`activity:${e.attemptId}`)]}),Yt=(e,t)=>{let n=new Set(t),r=e.findIndex(({id:e})=>n.has(e)),i=e[r];if(i===void 0)return null;let a=e.slice(0,r+1).reverse().find(e=>e.attemptId===i.attemptId&&e.checkpoint);return{attemptId:i.attemptId,checkpointKey:a?.id??null}},Xt=({failure:e,className:t})=>(0,z.jsxs)(`div`,{className:se(`rounded-lg border border-destructive/25 bg-destructive/8 px-3 pt-2 pb-2.5 text-sm`,t),children:[(0,z.jsx)(`p`,{className:`font-medium text-destructive`,children:d(e)}),(0,z.jsx)(Re,{className:`wrap-anywhere`,children:f(e)})]}),Zt=({salvage:e})=>(0,z.jsx)(`p`,{className:`text-xs text-muted-foreground wrap-anywhere`,children:e===null?`No salvage branch`:b(e,{Pushed:({ref:e,commit:t})=>(0,z.jsxs)(z.Fragment,{children:[`Unfinished work pushed to `,(0,z.jsx)(`span`,{className:`font-mono`,children:e}),` at`,` `,(0,z.jsx)(`span`,{className:`font-mono`,children:t.slice(0,7)})]}),PartlyPushed:({ref:e,commit:t,path:n,message:r})=>(0,z.jsxs)(z.Fragment,{children:[`Unfinished work pushed to `,(0,z.jsx)(`span`,{className:`font-mono`,children:e}),` at`,` `,(0,z.jsx)(`span`,{className:`font-mono`,children:t.slice(0,7)}),`, except files kept at`,` `,(0,z.jsx)(`span`,{className:`font-mono`,children:n}),`. `,r]}),Retained:({path:e,message:t})=>(0,z.jsxs)(z.Fragment,{children:[`Salvage incomplete: unfinished work at `,(0,z.jsx)(`span`,{className:`font-mono`,children:e}),`, retried at each startup while the worker is configured. Last error: `,t]}),Rejected:({path:e,message:t})=>(0,z.jsxs)(z.Fragment,{children:[`Salvage rejected: unfinished work at `,(0,z.jsx)(`span`,{className:`font-mono`,children:e}),`. The remote refused its push, so startup doesn't retry it until its commit changes. Error:`,` `,t]})})}),Qt=({end:e})=>b(e,{Failed:({failure:e,salvage:t})=>(0,z.jsxs)(`div`,{className:`space-y-2`,children:[(0,z.jsx)(Xt,{failure:e}),(0,z.jsx)(Zt,{salvage:t})]}),Succeeded:({message:e})=>(0,z.jsxs)(`div`,{className:`space-y-1`,children:[(0,z.jsxs)(`p`,{className:`flex items-center gap-2 text-sm font-medium`,children:[(0,z.jsx)(I,{state:`Succeeded`}),`Succeeded`]}),T(e,{onNone:()=>null,onSome:e=>(0,z.jsx)(Re,{className:`text-md wrap-anywhere`,children:e})})]}),Canceled:({salvage:e})=>(0,z.jsxs)(`div`,{className:`space-y-1`,children:[(0,z.jsxs)(`p`,{className:`flex items-center gap-2 text-sm font-medium`,children:[(0,z.jsx)(I,{state:`Canceled`}),`Canceled`]}),(0,z.jsx)(Zt,{salvage:e})]})}),$t=({kills:e})=>(0,z.jsxs)(`p`,{className:`text-xs text-warning wrap-anywhere`,children:[(0,z.jsx)(`span`,{className:`sr-only`,children:`Warning: `}),l(e)]}),en=({end:e,outOfMemory:t})=>t===null?(0,z.jsx)(Qt,{end:e}):(0,z.jsxs)(`div`,{className:`space-y-2`,children:[(0,z.jsx)(Qt,{end:e}),(0,z.jsx)($t,{kills:t})]});export{Yt as a,Et as c,st as d,rt as f,Ye as g,qe as h,Jt as i,Ct as l,R as m,qt as n,zt as o,tt as p,Gt as r,Nt as s,en as t,St as u};
@@ -1 +1 @@
1
- import{Dt as e,Ot as t,a as n,f as r,t as i,v as a,zn as o}from"./strings-DXB6PB2g.js";function s(e){return e}var c={hetzner:`Hetzner`,boat:`Boat`},l={hetzner:`server`,boat:`sandbox`},u=(e,t)=>`Creating a ${c[e.provider]} machine, started ${i(e.since,t)}`,d={capacity:`no capacity`,quota:`quota reached`,refused:`refused by the provider`,provider:`provider error`,unreachable:`unreachable`,timeout:`SSH timeout`},f=({reason:e})=>e===`check`?`Preflight failed on the first machine of the day`:`Machine creation failed: ${d[e]}`,p=(e,t)=>new Date(e).toDateString()===new Date(t).toDateString()?r(e).slice(11):n(e),m=({blocked:e,retryAt:t},n)=>`${e?`Next try`:`Pause ended`} at ${p(t,n)}`,h=({failures:e,failedAt:t},n)=>`${e===1?`Failed once`:`Failed ${e} times in a row`}, last at ${p(t,n)}`,g={approve:`Approve`,retry:`Retry`,runAgain:`Run again`,cancel:`Cancel run`,confirmCancel:`Confirm cancel`,keepRunning:`Keep running`},_=`Opening a run…`,v=`No run opened: cycle budget used up. Reset it in Needs attention`,y=e=>t(e,{Event:()=>`From the event`,OperatorRetry:({operator:e})=>o(e,{onNone:()=>`Retried`,onSome:e=>`Retried by ${e}`}),EditAndRetry:({operator:e})=>o(e,{onNone:()=>`Edited and retried`,onSome:e=>`Edited and retried by ${e}`}),InfraRetry:()=>`Retried after an infrastructure failure`,AfterRestart:()=>`Started again after a restart`}),b=(e,{runId:t,attemptNumber:n,worker:r})=>t===e?`Waiting for attempt ${n} to stop on ${r}`:`Waiting for attempt ${n} of an earlier run to stop on ${r}`,x=(e,t=null,n=null)=>{if(t!==null)return b(e.id,t);if(e.state===`Queued`&&n?.state===`creating`)return`Queued, creating a ${c[n.provider]} machine`;let r=e.attempts.length,i=r===0?``:` after ${r} ${r===1?`attempt`:`attempts`}`;switch(e.state){case`Pending`:return`Pending`;case`Waiting`:return`Waiting for approval`;case`Queued`:return`Queued, no free worker`;case`Running`:return`Running, attempt ${e.attempts.at(-1)?.number??1}`;case`Succeeded`:return r>1?`Succeeded${i}`:`Succeeded`;case`Failed`:return`Failed${i}`;case`Canceled`:return`Canceled${i}`}},S=e=>t(e,{GitHubPushFailure:()=>`GitHub refused push`,InfraFailure:()=>`Infrastructure failure`,DefectFailure:()=>`Executor defect`,AgentFailure:()=>`Agent failure`,BlockedFailure:()=>`Agent blocked`,QuestionFailure:()=>`Question from the agent`,RunawayFailure:()=>`Runaway guard`,ChildSessionBudgetFailure:()=>`Child session budget exhausted`}),C=e=>`Opened ${r(e)}`,w={ui:`from the UI`,"github-ask":`from GitHub`},T={approve:`Approving…`,retry:`Retrying…`,cancel:`Canceling…`,resolveFailure:`Marking resolved…`},E=e=>t(e,{GitHubPushFailure:({message:e})=>e,InfraFailure:({message:e})=>e,DefectFailure:({message:e})=>e,AgentFailure:({message:e})=>e,BlockedFailure:({message:e})=>e,QuestionFailure:({question:e})=>e,RunawayFailure:({ceiling:e})=>e===`wall-clock`?`Time limit reached: settings.max_attempt_minutes`:`Token limit reached: settings.max_attempt_tokens`,ChildSessionBudgetFailure:({attemptedChildren:e,maxChildren:t})=>`Child session budget of ${t} used; child ${e} did not start`}),D=e=>e===`parent`?`Queued until the delegated task ends`:`Queued until the current child step ends`,O=({ref:e,commit:t})=>`Not applied: the previous attempt's work on ${e} at ${t.slice(0,7)} conflicts with the current revision. It is still on ${e}`,k=({kills:e,memoryMib:t})=>`The kernel killed ${e} ${e===1?`process`:`processes`} for memory across containers in this attempt. The last container with recorded kills had a ${t} MiB memory limit`,A=e=>`Retry uses ${e.harness} · ${e.model} from the saved agent definition.`,j={loading:`Loading…`,loadEarlier:`Load earlier`,empty:`No activity recorded`},M=e=>o(e,{onNone:()=>`Attempt`,onSome:({number:e})=>`Attempt ${e}`}),N=e=>`${e.completedCycles} completed rounds. ${e.counts.map(({loop:e,admitted:t})=>`${e}: ${t} ${t===1?`run`:`runs`}`).join(`; `)}`,P=e=>t(e,{CycleBudgetNeed:({ask:e,itemLabel:t})=>({title:`Cycle budget exhausted`,detail:`${t}: ${N(e)}`,repository:e.repository,runId:null}),ApprovalNeed:({loop:e,repository:t,runId:n,item:r})=>({title:`${e}: approval needed`,detail:r===null?`Open the run for the task text`:r.title,repository:t,runId:n}),RunFailureNeed:({failure:e,loop:t,repository:n,runId:r})=>({title:e._tag===`QuestionFailure`?`Question from ${t}`:e._tag===`BlockedFailure`?`${t}: blocked`:`${t}: ${S(e).toLowerCase()}`,detail:E(e),repository:n,runId:r}),BoardProjectionNeed:({failure:e})=>({title:`Item not shown on the board`,detail:e.message,repository:e.repository,runId:null}),PollFailureNeed:({failure:e})=>({title:e.errorTag,detail:e.message,repository:e.repository,runId:null}),PreflightFindingNeed:({finding:e})=>({title:`Label preflight failed`,detail:`${e.label}: ${e.message}`,repository:e.repository,runId:null}),ScheduleFailureNeed:({failure:e})=>({title:t(e,{ScheduleTickFailure:({errorTag:e})=>e,ScheduleAgentFailure:({loop:e})=>`${e}: agent not loaded`,ScheduleCronFailure:({loop:e})=>`${e}: schedule not computed`}),detail:e.message,repository:e._tag===`ScheduleTickFailure`?e.repository:null,runId:null}),ConfigFileNeed:({kind:e,error:t})=>({title:e===`loop`?`Loop file not loaded`:`Agent file not loaded`,detail:`${t.file}: ${t.message.replace(/\.$/u,``)}. Fix the file, then reload the configuration from Configuration > Loops`,repository:null,runId:null}),WorkerPreflightNeed:({worker:e,message:t})=>({title:`${e}: preflight failed`,detail:`${t} This worker takes no new attempts while preflight retries automatically.`,repository:null,runId:null}),UnconfiguredWorkerNeed:({worker:e,attempts:t,running:n})=>({title:`Worker not configured`,detail:n>0?`${e} is not in usine.yaml. ${n} ${n===1?`attempt`:`attempts`} still running on it. Discard the leftovers after they end`:`${e} is not in usine.yaml. Startup does not reconcile the ${t} recorded ${t===1?`attempt`:`attempts`} on it. Add the worker back and restart usine up, or discard the leftovers`,repository:null,runId:null}),UnresponsiveWorkerNeed:({worker:e,lastAnsweredAt:t,attempts:n})=>({title:`${e}: worker not responding`,detail:`Last answered ${t}. ${n.length} ${n.length===1?`attempt is`:`attempts are`} still running. Check the worker or open an affected run.`,repository:null,runId:null}),UnconfirmedStopNeed:({loop:e,repository:t,runId:n,attemptNumber:r,worker:i})=>({title:`${e}: parent task not stopped`,detail:`Attempt ${r} still ending on ${i}, using one slot. No new attempt on this item until it stops. Stop retried every few minutes`,repository:t,runId:n})}),F={dismissNeed:`Dismiss`,undoDismissNeed:`Undo`},I={dismissNeed:`Dismissing…`,undoDismissNeed:`Undoing…`},L=`Dismissed`,R=({repository:e,loop:t,attemptNumber:n})=>`${e} · ${t} · attempt ${n}`,z=`Open worker`,B=t=>({...e(t),repository:t}),V=e=>{let t=new Map;for(let n of e){let e=n._tag===`UnresponsiveWorkerNeed`?n.attempts.map(({repository:e})=>e):[P(n).repository];for(let n of new Set(e))n!==null&&t.set(n,(t.get(n)??0)+1)}return t},H=2e3,U=15e3,W=()=>s({queryKey:[`overview`],queryFn:()=>a(e=>e.overview()),refetchInterval:e=>{let t=e.state.data;return t?._tag===`NeedsSetup`?!1:t?.projects.some(e=>e.runs.some(({canCancel:e})=>e))===!0?H:U}});export{u as A,_ as C,j as D,M as E,c as M,l as N,f as O,s as P,v as S,b as T,k as _,I as a,g as b,P as c,w as d,y as f,C as g,S as h,F as i,m as j,h as k,z as l,E as m,W as n,N as o,O as p,B as r,L as s,V as t,R as u,D as v,x as w,T as x,A as y};
1
+ import{Ft as e,Kn as t,Pt as n,a as r,f as i,t as a,v as o}from"./strings-BeaABxX0.js";function s(e){return e}var c={hetzner:`Hetzner`,boat:`Boat`},l={hetzner:`server`,boat:`sandbox`},u=(e,t)=>`Creating a ${c[e.provider]} machine, started ${a(e.since,t)}`,d={capacity:`no capacity`,quota:`quota reached`,refused:`refused by the provider`,provider:`provider error`,unreachable:`unreachable`,timeout:`SSH timeout`},f=({reason:e})=>e===`check`?`Preflight failed on the first machine of the day`:`Machine creation failed: ${d[e]}`,p=(e,t)=>new Date(e).toDateString()===new Date(t).toDateString()?i(e).slice(11):r(e),m=({blocked:e,retryAt:t},n)=>`${e?`Next try`:`Pause ended`} at ${p(t,n)}`,h=({failures:e,failedAt:t},n)=>`${e===1?`Failed once`:`Failed ${e} times in a row`}, last at ${p(t,n)}`,g={approve:`Approve`,retry:`Retry`,runAgain:`Run again`,cancel:`Cancel run`,confirmCancel:`Confirm cancel`,keepRunning:`Keep running`},_=`Opening a run…`,v=`No run opened: cycle budget used up. Reset it in Needs attention`,y=n=>e(n,{Event:()=>`From the event`,OperatorRetry:({operator:e})=>t(e,{onNone:()=>`Retried`,onSome:e=>`Retried by ${e}`}),EditAndRetry:({operator:e})=>t(e,{onNone:()=>`Edited and retried`,onSome:e=>`Edited and retried by ${e}`}),InfraRetry:()=>`Retried after an infrastructure failure`,AfterRestart:()=>`Started again after a restart`}),b=(e,{runId:t,attemptNumber:n,worker:r})=>t===e?`Waiting for attempt ${n} to stop on ${r}`:`Waiting for attempt ${n} of an earlier run to stop on ${r}`,x=(e,t=null,n=null)=>{if(t!==null)return b(e.id,t);if(e.state===`Queued`&&n?.state===`creating`)return`Queued, creating a ${c[n.provider]} machine`;let r=e.attempts.length,i=r===0?``:` after ${r} ${r===1?`attempt`:`attempts`}`;switch(e.state){case`Pending`:return`Pending`;case`Waiting`:return`Waiting for approval`;case`Queued`:return`Queued, no free worker`;case`Running`:return`Running, attempt ${e.attempts.at(-1)?.number??1}`;case`Succeeded`:return r>1?`Succeeded${i}`:`Succeeded`;case`Failed`:return`Failed${i}`;case`Canceled`:return`Canceled${i}`}},S=t=>e(t,{GitHubPushFailure:()=>`GitHub refused push`,InfraFailure:()=>`Infrastructure failure`,DefectFailure:()=>`Executor defect`,AgentFailure:()=>`Agent failure`,BlockedFailure:()=>`Agent blocked`,QuestionFailure:()=>`Question from the agent`,RunawayFailure:()=>`Runaway guard`,ChildSessionBudgetFailure:()=>`Child session budget exhausted`}),C=e=>`Opened ${i(e)}`,w={ui:`from the UI`,"github-ask":`from GitHub`},T={approve:`Approving…`,retry:`Retrying…`,cancel:`Canceling…`,resolveFailure:`Marking resolved…`},E=t=>e(t,{GitHubPushFailure:({message:e})=>e,InfraFailure:({message:e})=>e,DefectFailure:({message:e})=>e,AgentFailure:({message:e})=>e,BlockedFailure:({message:e})=>e,QuestionFailure:({question:e})=>e,RunawayFailure:({ceiling:e})=>e===`wall-clock`?`Time limit reached: settings.max_attempt_minutes`:`Token limit reached: settings.max_attempt_tokens`,ChildSessionBudgetFailure:({attemptedChildren:e,maxChildren:t})=>`Child session budget of ${t} used; child ${e} did not start`}),D=e=>e===`parent`?`Queued until the delegated task ends`:`Queued until the current child step ends`,O=({ref:e,commit:t})=>`Not applied: the previous attempt's work on ${e} at ${t.slice(0,7)} conflicts with the current revision. It is still on ${e}`,k=({kills:e,memoryMib:t})=>`The kernel killed ${e} ${e===1?`process`:`processes`} for memory across containers in this attempt. The last container with recorded kills had a ${t} MiB memory limit`,A=e=>`Retry uses ${e.harness} · ${e.model} from the saved agent definition.`,j={loading:`Loading…`,loadEarlier:`Load earlier`,empty:`No activity recorded`},M=e=>t(e,{onNone:()=>`Attempt`,onSome:({number:e})=>`Attempt ${e}`}),N=e=>`${e.completedCycles} completed rounds. ${e.counts.map(({loop:e,admitted:t})=>`${e}: ${t} ${t===1?`run`:`runs`}`).join(`; `)}`,P=t=>e(t,{CycleBudgetNeed:({ask:e,itemLabel:t})=>({title:`Cycle budget exhausted`,detail:`${t}: ${N(e)}`,repository:e.repository,runId:null}),ApprovalNeed:({loop:e,repository:t,runId:n,item:r})=>({title:`${e}: approval needed`,detail:r===null?`Open the run for the task text`:r.title,repository:t,runId:n}),RunFailureNeed:({failure:e,loop:t,repository:n,runId:r})=>({title:e._tag===`QuestionFailure`?`Question from ${t}`:e._tag===`BlockedFailure`?`${t}: blocked`:`${t}: ${S(e).toLowerCase()}`,detail:E(e),repository:n,runId:r}),BoardProjectionNeed:({failure:e})=>({title:`Item not shown on the board`,detail:e.message,repository:e.repository,runId:null}),PollFailureNeed:({failure:e})=>({title:e.errorTag,detail:e.message,repository:e.repository,runId:null}),PreflightFindingNeed:({finding:e})=>({title:`Label preflight failed`,detail:`${e.label}: ${e.message}`,repository:e.repository,runId:null}),ScheduleFailureNeed:({failure:t})=>({title:e(t,{ScheduleTickFailure:({errorTag:e})=>e,ScheduleAgentFailure:({loop:e})=>`${e}: agent not loaded`,ScheduleCronFailure:({loop:e})=>`${e}: schedule not computed`}),detail:t.message,repository:t._tag===`ScheduleTickFailure`?t.repository:null,runId:null}),ConfigFileNeed:({kind:e,error:t})=>({title:e===`loop`?`Loop file not loaded`:`Agent file not loaded`,detail:`${t.file}: ${t.message.replace(/\.$/u,``)}. Fix the file, then reload the configuration from Configuration > Loops`,repository:null,runId:null}),WorkerPreflightNeed:({worker:e,message:t})=>({title:`${e}: preflight failed`,detail:`${t} This worker takes no new attempts while preflight retries automatically.`,repository:null,runId:null}),UnconfiguredWorkerNeed:({worker:e,attempts:t,running:n})=>({title:`Worker not configured`,detail:n>0?`${e} is not in usine.yaml. ${n} ${n===1?`attempt`:`attempts`} still running on it. Discard the leftovers after they end`:`${e} is not in usine.yaml. Startup does not reconcile the ${t} recorded ${t===1?`attempt`:`attempts`} on it. Add the worker back and restart usine up, or discard the leftovers`,repository:null,runId:null}),UnresponsiveWorkerNeed:({worker:e,lastAnsweredAt:t,attempts:n})=>({title:`${e}: worker not responding`,detail:`Last answered ${t}. ${n.length} ${n.length===1?`attempt is`:`attempts are`} still running. Check the worker or open an affected run.`,repository:null,runId:null}),UnconfirmedStopNeed:({loop:e,repository:t,runId:n,attemptNumber:r,worker:i})=>({title:`${e}: parent task not stopped`,detail:`Attempt ${r} still ending on ${i}, using one slot. No new attempt on this item until it stops. Stop retried every few minutes`,repository:t,runId:n})}),F={dismissNeed:`Dismiss`,undoDismissNeed:`Undo`},I={dismissNeed:`Dismissing…`,undoDismissNeed:`Undoing…`},L=`Dismissed`,R=({repository:e,loop:t,attemptNumber:n})=>`${e} · ${t} · attempt ${n}`,z=`Open worker`,B=e=>({...n(e),repository:e}),V=e=>{let t=new Map;for(let n of e){let e=n._tag===`UnresponsiveWorkerNeed`?n.attempts.map(({repository:e})=>e):[P(n).repository];for(let n of new Set(e))n!==null&&t.set(n,(t.get(n)??0)+1)}return t},H=2e3,U=15e3,W=()=>s({queryKey:[`overview`],queryFn:()=>o(e=>e.overview()),refetchInterval:e=>{let t=e.state.data;return t?._tag===`NeedsSetup`?!1:t?.projects.some(e=>e.runs.some(({canCancel:e})=>e))===!0?H:U}});export{u as A,_ as C,j as D,M as E,c as M,l as N,f as O,s as P,v as S,b as T,k as _,I as a,g as b,P as c,w as d,y as f,C as g,S as h,F as i,m as j,h as k,z as l,E as m,W as n,N as o,O as p,B as r,L as s,V as t,R as u,D as v,x as w,T as x,A as y};
@@ -1 +1 @@
1
- import{i as e,r as t,s as n}from"./useRouter-Hur3RN7j.js";import{P as r}from"./overview-C73v5kbv.js";import{D as i}from"./button-4rhhIcK8.js";import{v as a}from"./strings-DXB6PB2g.js";var o=n(e(),1),s=t(),c=o.createContext(void 0),l=e=>{let t=o.useContext(c);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},u=({client:e,children:t})=>(o.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,s.jsx)(c.Provider,{value:e,children:t})),d={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},f=new class{#e=d;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function p(e){setTimeout(e,0)}var m=typeof window>`u`||`Deno`in globalThis;function h(){}function g(e,t){return typeof e==`function`?e(t):e}function _(e){return typeof e==`number`&&e>=0&&e!==1/0}function v(e,t){return Math.max(e+(t||0)-Date.now(),0)}function y(e,t){return typeof e==`function`?e(t):e}function b(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==S(o,t.options))return!1}else if(!w(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function x(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(C(t.options.mutationKey)!==C(a))return!1}else if(!w(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function S(e,t){return(t?.queryKeyHashFn||C)(e)}function C(e){return JSON.stringify(e,(e,t)=>O(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function w(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!w(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!w(e[r],t[r]))return!1;return!0}return!1}var ee=Object.prototype.hasOwnProperty;function T(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=D(e)&&D(t);if(!r&&!(O(e)&&O(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:ee.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=T(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function E(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function D(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function O(e){if(!k(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!k(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function k(e){return Object.prototype.toString.call(e)===`[object Object]`}function te(e){return new Promise(t=>{f.setTimeout(t,e)})}function A(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:T(e,t)}function ne(e){return e}function re(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function ie(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var j=Symbol();function M(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===j?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function N(e,t){return typeof e==`function`?e(...t):!!e}function ae(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0})),i)}),e}var oe=()=>m,P=()=>oe(),F=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},I=new class extends F{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},se=p;function ce(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=se,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var L=ce(),R=new class extends F{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function le(e){return Math.min(1e3*2**e,3e4)}function z(e){return(e??`online`)!==`online`||R.isOnline()}var B=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function V(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(h);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new B(t);g(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>I.isFocused()&&(e.networkMode===`always`||R.isOnline())&&e.canRun(),p=()=>z(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},g=e=>{c()||(r?.(),i=`rejected`,o(e))},_=t=>new Promise(n=>{r=e=>{(c()||t())&&n(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),v=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(P()?0:3),a=e.retryDelay??le,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!s?g(r):(n++,e.onFail?.(n,r),te(o).then(()=>f()?void 0:_(f)).then(()=>{t?g(r):v()}))})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?v():_(p).then(v),s)}}var H=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),_(this.gcTime)&&(this.#e=f.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(P()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(f.clearTimeout(this.#e),this.#e=void 0)}};function ue(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{ae(e,()=>t.signal,()=>n=!0)},u=M(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?ie:re;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?W:U,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]===void 0?r.initialPageParam:o[0]:U(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function U(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function W(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function de(e,t){return t?U(e,t)!=null:!1}function fe(e,t){return!t||!e.getPreviousPageParam?!1:W(e,t)!=null}var pe=class extends H{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=q(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=q(this.options);e.data!==void 0&&(this.setState(K(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=A(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(h).catch(h):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>y(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===j||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>y(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!v(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=M(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?ue(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=V({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof B&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof B){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...G(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...K(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),L.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function G(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:z(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function K(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function q(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var me=class extends F{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),J(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Y(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Y(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof y(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!E(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&X(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||y(this.options.enabled,this.#t)!==y(t.enabled,this.#t)||y(this.options.staleTime,this.#t)!==y(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||y(this.options.enabled,this.#t)!==y(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return E(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch(t).then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(h)),t}#h(e){return!P()&&y(this.options.enabled,this.#t)!==!1&&_(e)}#g(){this.#b();let e=y(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=v(this.#r.dataUpdatedAt,e)+1;this.#u=f.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return y(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=f.setInterval(()=>{(this.options.refetchIntervalInBackground||I.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(f.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(f.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&J(e,t),o=i&&X(e,n,t,r);(a||o)&&(l={...l,...G(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=A(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=A(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,b=_&&g,x=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:b,isLoading:b,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!x,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&x,isStale:Z(e,t),refetch:this.refetch,isEnabled:y(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),E(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();L.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function he(e,t){return y(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||y(t.retryOnMount,e)!==!1)}function J(e,t){return he(e,t)||e.state.data!==void 0&&Y(e,t,t.refetchOnMount)}function Y(e,t,n){if(y(t.enabled,e)!==!1&&y(t.staleTime,e)!==`static`){let r=y(n,e);return r===`always`||r!==!1&&Z(e,t)}return!1}function X(e,t,n,r){return(e!==t||y(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Z(e,n)}function Z(e,t){return y(t.enabled,e)!==!1&&e.isStaleByTime(y(t.staleTime,e))}var Q=o.createContext(!1),ge=()=>o.useContext(Q);Q.Provider;function _e(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var ve=o.createContext(_e()),ye=()=>o.useContext(ve),be=(e,t,n)=>{let r=n?.state.status===`error`&&typeof e.throwOnError==`function`?N(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},xe=e=>{o.useEffect(()=>{e.clearReset()},[e])},Se=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||N(n,[e.error,r])),Ce=(e,t)=>t.state.data===void 0,we=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Te=(e,t)=>e?.suspense&&t.isPending,Ee=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function De(e,t,n){let r=ge(),i=ye(),a=l(n),s=a.defaultQueryOptions(e),c=a.getQueryCache().get(s.queryHash),u=e.subscribed!==!1;s._optimisticResults=r?`isRestoring`:u?`optimistic`:void 0,we(s),be(s,i,c),xe(i);let[d]=o.useState(()=>new t(a,s)),f=d.getOptimisticResult(s),p=!r&&u;if(o.useSyncExternalStore(o.useCallback(e=>{let t=p?d.subscribe(L.batchCalls(e)):h;return d.updateResult(),t},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),o.useEffect(()=>{d.setOptions(s)},[s,d]),Te(s,f))throw Ee(s,d,i);if(Se({result:f,errorResetBoundary:i,throwOnError:s.throwOnError,query:c,suspense:s.suspense}))throw f.error;return s.notifyOnChangeProps?f:d.trackResult(f)}var $=3e3,Oe=15e3,ke=()=>r({queryKey:[`desk`],queryFn:()=>a(e=>e.desk()),refetchInterval:e=>{let t=e.state.data;return t!==void 0&&(t.running.length>0||t.notMoving.some(({reason:e})=>e._tag===`QueuedForWorker`))?$:Oe}}),Ae=({title:e,leading:t,counts:n,children:r,actions:a,className:o})=>(0,s.jsxs)(`header`,{className:i(`flex flex-wrap items-baseline gap-x-3 gap-y-1`,o),children:[(0,s.jsxs)(`h1`,{className:`flex items-baseline gap-2 text-xl font-semibold wrap-anywhere`,children:[t!==void 0&&(0,s.jsx)(`span`,{className:`flex h-7 shrink-0 items-center self-start`,children:t}),(0,s.jsx)(`span`,{className:`min-w-0`,children:e})]}),n!==void 0&&(0,s.jsx)(`p`,{className:`text-sm text-muted-foreground tabular-nums`,children:n}),r,a!==void 0&&(0,s.jsx)(`div`,{className:`ml-auto flex items-center gap-2 self-center`,children:a})]}),je=({children:e,width:t=`prose`})=>(0,s.jsx)(`main`,{className:`px-4 pt-5 pb-6 md:px-5`,children:(0,s.jsx)(`div`,{className:i(`flex flex-col gap-4`,t===`prose`&&`max-w-3xl`),children:e})}),Me={lg:`lg:flex-row lg:items-start lg:justify-between lg:gap-6`,sm:`sm:flex-row sm:items-start sm:justify-between sm:gap-6`,never:``},Ne=({eyebrow:e,heading:t,facts:n,actions:r,actionsBeside:a,className:o})=>(0,s.jsxs)(`header`,{className:i(`flex flex-col gap-3`,Me[a],o),children:[(0,s.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[e!==void 0&&(0,s.jsx)(`p`,{className:`flex flex-wrap items-center gap-x-3.5 gap-y-1 text-xs text-muted-foreground`,children:e}),t,n!==void 0&&(0,s.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-5 gap-y-1.5 pt-0.5 text-sm text-muted-foreground`,children:n})]}),r!==void 0&&(0,s.jsx)(`div`,{className:`shrink-0`,children:r})]}),Pe=({icon:e,title:t,children:n})=>(0,s.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,title:t,children:[(0,s.jsx)(e,{"aria-hidden":`true`,className:`size-[1em] shrink-0 text-faint`}),n]});export{j as A,b as C,y as D,T as E,l as M,E as O,x as S,w as T,F as _,ke as a,S as b,me as c,fe as d,H as f,I as g,L as h,Ae as i,u as j,N as k,pe as l,R as m,Pe as n,De as o,V as p,Ne as r,Ce as s,je as t,de as u,g as v,h as w,ne as x,C as y};
1
+ import{i as e,r as t,s as n}from"./useRouter-Hur3RN7j.js";import{P as r}from"./overview-BixI1Gdc.js";import{D as i}from"./button-4rhhIcK8.js";import{v as a}from"./strings-BeaABxX0.js";var o=n(e(),1),s=t(),c=o.createContext(void 0),l=e=>{let t=o.useContext(c);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},u=({client:e,children:t})=>(o.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,s.jsx)(c.Provider,{value:e,children:t})),d={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},f=new class{#e=d;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function p(e){setTimeout(e,0)}var m=typeof window>`u`||`Deno`in globalThis;function h(){}function g(e,t){return typeof e==`function`?e(t):e}function _(e){return typeof e==`number`&&e>=0&&e!==1/0}function v(e,t){return Math.max(e+(t||0)-Date.now(),0)}function y(e,t){return typeof e==`function`?e(t):e}function b(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==S(o,t.options))return!1}else if(!w(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function x(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(C(t.options.mutationKey)!==C(a))return!1}else if(!w(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function S(e,t){return(t?.queryKeyHashFn||C)(e)}function C(e){return JSON.stringify(e,(e,t)=>O(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function w(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!w(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!w(e[r],t[r]))return!1;return!0}return!1}var ee=Object.prototype.hasOwnProperty;function T(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=D(e)&&D(t);if(!r&&!(O(e)&&O(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:ee.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=T(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function E(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function D(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function O(e){if(!k(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!k(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function k(e){return Object.prototype.toString.call(e)===`[object Object]`}function te(e){return new Promise(t=>{f.setTimeout(t,e)})}function A(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:T(e,t)}function ne(e){return e}function re(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function ie(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var j=Symbol();function M(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===j?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function N(e,t){return typeof e==`function`?e(...t):!!e}function ae(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0})),i)}),e}var oe=()=>m,P=()=>oe(),F=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},I=new class extends F{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},se=p;function ce(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=se,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var L=ce(),R=new class extends F{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function le(e){return Math.min(1e3*2**e,3e4)}function z(e){return(e??`online`)!==`online`||R.isOnline()}var B=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function V(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(h);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new B(t);g(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>I.isFocused()&&(e.networkMode===`always`||R.isOnline())&&e.canRun(),p=()=>z(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},g=e=>{c()||(r?.(),i=`rejected`,o(e))},_=t=>new Promise(n=>{r=e=>{(c()||t())&&n(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),v=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(P()?0:3),a=e.retryDelay??le,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!s?g(r):(n++,e.onFail?.(n,r),te(o).then(()=>f()?void 0:_(f)).then(()=>{t?g(r):v()}))})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?v():_(p).then(v),s)}}var H=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),_(this.gcTime)&&(this.#e=f.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(P()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(f.clearTimeout(this.#e),this.#e=void 0)}};function ue(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{ae(e,()=>t.signal,()=>n=!0)},u=M(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?ie:re;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?W:U,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]===void 0?r.initialPageParam:o[0]:U(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function U(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function W(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function de(e,t){return t?U(e,t)!=null:!1}function fe(e,t){return!t||!e.getPreviousPageParam?!1:W(e,t)!=null}var pe=class extends H{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=q(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=q(this.options);e.data!==void 0&&(this.setState(K(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=A(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(h).catch(h):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>y(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===j||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>y(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!v(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=M(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?ue(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=V({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof B&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof B){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...G(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...K(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),L.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function G(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:z(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function K(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function q(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var me=class extends F{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),J(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Y(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Y(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof y(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!E(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&X(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||y(this.options.enabled,this.#t)!==y(t.enabled,this.#t)||y(this.options.staleTime,this.#t)!==y(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||y(this.options.enabled,this.#t)!==y(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return E(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch(t).then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(h)),t}#h(e){return!P()&&y(this.options.enabled,this.#t)!==!1&&_(e)}#g(){this.#b();let e=y(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=v(this.#r.dataUpdatedAt,e)+1;this.#u=f.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return y(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=f.setInterval(()=>{(this.options.refetchIntervalInBackground||I.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(f.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(f.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&J(e,t),o=i&&X(e,n,t,r);(a||o)&&(l={...l,...G(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=A(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=A(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,b=_&&g,x=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:b,isLoading:b,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!x,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&x,isStale:Z(e,t),refetch:this.refetch,isEnabled:y(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),E(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();L.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function he(e,t){return y(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||y(t.retryOnMount,e)!==!1)}function J(e,t){return he(e,t)||e.state.data!==void 0&&Y(e,t,t.refetchOnMount)}function Y(e,t,n){if(y(t.enabled,e)!==!1&&y(t.staleTime,e)!==`static`){let r=y(n,e);return r===`always`||r!==!1&&Z(e,t)}return!1}function X(e,t,n,r){return(e!==t||y(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Z(e,n)}function Z(e,t){return y(t.enabled,e)!==!1&&e.isStaleByTime(y(t.staleTime,e))}var Q=o.createContext(!1),ge=()=>o.useContext(Q);Q.Provider;function _e(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var ve=o.createContext(_e()),ye=()=>o.useContext(ve),be=(e,t,n)=>{let r=n?.state.status===`error`&&typeof e.throwOnError==`function`?N(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},xe=e=>{o.useEffect(()=>{e.clearReset()},[e])},Se=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||N(n,[e.error,r])),Ce=(e,t)=>t.state.data===void 0,we=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Te=(e,t)=>e?.suspense&&t.isPending,Ee=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function De(e,t,n){let r=ge(),i=ye(),a=l(n),s=a.defaultQueryOptions(e),c=a.getQueryCache().get(s.queryHash),u=e.subscribed!==!1;s._optimisticResults=r?`isRestoring`:u?`optimistic`:void 0,we(s),be(s,i,c),xe(i);let[d]=o.useState(()=>new t(a,s)),f=d.getOptimisticResult(s),p=!r&&u;if(o.useSyncExternalStore(o.useCallback(e=>{let t=p?d.subscribe(L.batchCalls(e)):h;return d.updateResult(),t},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),o.useEffect(()=>{d.setOptions(s)},[s,d]),Te(s,f))throw Ee(s,d,i);if(Se({result:f,errorResetBoundary:i,throwOnError:s.throwOnError,query:c,suspense:s.suspense}))throw f.error;return s.notifyOnChangeProps?f:d.trackResult(f)}var $=3e3,Oe=15e3,ke=()=>r({queryKey:[`desk`],queryFn:()=>a(e=>e.desk()),refetchInterval:e=>{let t=e.state.data;return t!==void 0&&(t.running.length>0||t.notMoving.some(({reason:e})=>e._tag===`QueuedForWorker`))?$:Oe}}),Ae=({title:e,leading:t,counts:n,children:r,actions:a,className:o})=>(0,s.jsxs)(`header`,{className:i(`flex flex-wrap items-baseline gap-x-3 gap-y-1`,o),children:[(0,s.jsxs)(`h1`,{className:`flex items-baseline gap-2 text-xl font-semibold wrap-anywhere`,children:[t!==void 0&&(0,s.jsx)(`span`,{className:`flex h-7 shrink-0 items-center self-start`,children:t}),(0,s.jsx)(`span`,{className:`min-w-0`,children:e})]}),n!==void 0&&(0,s.jsx)(`p`,{className:`text-sm text-muted-foreground tabular-nums`,children:n}),r,a!==void 0&&(0,s.jsx)(`div`,{className:`ml-auto flex items-center gap-2 self-center`,children:a})]}),je=({children:e,width:t=`prose`})=>(0,s.jsx)(`main`,{className:`px-4 pt-5 pb-6 md:px-5`,children:(0,s.jsx)(`div`,{className:i(`flex flex-col gap-4`,t===`prose`&&`max-w-3xl`),children:e})}),Me={lg:`lg:flex-row lg:items-start lg:justify-between lg:gap-6`,sm:`sm:flex-row sm:items-start sm:justify-between sm:gap-6`,never:``},Ne=({eyebrow:e,heading:t,facts:n,actions:r,actionsBeside:a,className:o})=>(0,s.jsxs)(`header`,{className:i(`flex flex-col gap-3`,Me[a],o),children:[(0,s.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[e!==void 0&&(0,s.jsx)(`p`,{className:`flex flex-wrap items-center gap-x-3.5 gap-y-1 text-xs text-muted-foreground`,children:e}),t,n!==void 0&&(0,s.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-5 gap-y-1.5 pt-0.5 text-sm text-muted-foreground`,children:n})]}),r!==void 0&&(0,s.jsx)(`div`,{className:`shrink-0`,children:r})]}),Pe=({icon:e,title:t,children:n})=>(0,s.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,title:t,children:[(0,s.jsx)(e,{"aria-hidden":`true`,className:`size-[1em] shrink-0 text-faint`}),n]});export{j as A,b as C,y as D,T as E,l as M,E as O,x as S,w as T,F as _,ke as a,S as b,me as c,fe as d,H as f,I as g,L as h,Ae as i,u as j,N as k,pe as l,R as m,Pe as n,De as o,V as p,Ne as r,Ce as s,je as t,de as u,g as v,h as w,ne as x,C as y};
@@ -0,0 +1 @@
1
+ import{r as e}from"./useRouter-Hur3RN7j.js";import{t}from"./mark-B8EExm_5.js";import{D as n}from"./button-4rhhIcK8.js";var r=e(),i=({pullRequests:e,linked:i=!0,className:a})=>e.length===0?null:(0,r.jsx)(`span`,{className:n(`inline-flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5`,a),children:e.map(e=>(0,r.jsx)(t,{item:e,linked:i},e.number))});export{i as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./useRouter-Hur3RN7j.js";import{d as t,g as n,l as r,s as i,t as a}from"./section-D4djNiAN.js";import{n as o}from"./useNavigate-AT5VkfZa.js";import{t as s}from"./link-C7GfYrMt.js";import{D as c}from"./button-4rhhIcK8.js";import{Pt as l}from"./strings-BeaABxX0.js";import{T as u,jt as d,vt as f}from"./index-BdDPka5v.js";import{a as p,i as m,n as h,o as g,r as _,t as v}from"./table-hbKjhjeL.js";import{t as y}from"./fill-cell-CjksmixH.js";import{t as b}from"./repositories-D4wYJfa_.js";var x=e(),S=e=>{let t=[...e.declaredLabels,...b(e)];if(t.length===0)return{text:`No labels`,problem:!1};if(t.some(({onGitHub:e})=>e===null))return{text:`Not polled yet`,problem:!1};let n=e=>new Set(e.map(({name:e})=>e.toLowerCase())).size,r=n(t.filter(({failure:e})=>e!==null)),i=n(t.filter(({onGitHub:e})=>e===!1)),a=[...r>0?[`${r} failed`]:[],...i>0?[`${i} missing on GitHub`]:[]];return a.length===0?{text:`All on GitHub`,problem:!1}:{text:a.join(`, `),problem:!0}},C=({repository:e})=>{let n=o(),i=l(e.name),a=S(e);return(0,x.jsxs)(r,{open:()=>void n({to:`/configuration/repositories/$owner/$name`,params:i}),children:[(0,x.jsx)(_,{className:`py-3`,children:(0,x.jsxs)(s,{to:`/configuration/repositories/$owner/$name`,params:i,onClick:e=>e.stopPropagation(),className:c(t,`flex w-fit items-center gap-2`),children:[(0,x.jsx)(f,{repository:e.name}),e.name]})}),(0,x.jsx)(_,{className:`hidden @2xl:table-cell`,children:e.tags.length===0?(0,x.jsx)(`span`,{className:`text-muted-foreground`,children:`None`}):e.tags.join(`, `)}),(0,x.jsx)(_,{className:`text-right tabular-nums`,children:e.lanes.length===0?(0,x.jsx)(`span`,{className:`text-muted-foreground`,children:`Proposed`}):e.lanes.length}),(0,x.jsx)(_,{className:c(`max-sm:whitespace-normal`,a.problem?`text-destructive`:`text-muted-foreground`),children:a.text}),(0,x.jsx)(y,{className:`hidden whitespace-normal text-muted-foreground sm:table-cell`,children:e.loops.length===0?`No loop`:e.loops.join(`, `)})]})},w=({configuration:e})=>(0,x.jsx)(a,{title:`Repositories`,createKind:`repository`,counts:`${e.repositories.length} ${e.repositories.length===1?`repository`:`repositories`}`,children:e.repositories.length===0?(0,x.jsx)(i,{title:`No repositories registered`,children:n}):(0,x.jsx)(`div`,{className:`@container -mx-2`,children:(0,x.jsxs)(v,{children:[(0,x.jsx)(p,{children:(0,x.jsxs)(g,{className:`hover:bg-transparent`,children:[(0,x.jsx)(m,{children:`Repository`}),(0,x.jsx)(m,{className:`hidden @2xl:table-cell`,children:`Tags`}),(0,x.jsx)(m,{className:`text-right`,children:`Lanes`}),(0,x.jsx)(m,{children:`Labels`}),(0,x.jsx)(m,{className:`hidden sm:table-cell`,children:`Loops`})]})}),(0,x.jsx)(h,{children:e.repositories.map(e=>(0,x.jsx)(C,{repository:e},e.name))})]})})}),T=()=>{let{data:e}=d(u());return(0,x.jsx)(w,{configuration:e})};export{T as component};
@@ -0,0 +1 @@
1
+ import{d as e}from"./index-BdDPka5v.js";var t=e;export{t as component};
@@ -0,0 +1 @@
1
+ import{f as e}from"./index-BdDPka5v.js";var t=e;export{t as errorComponent};