@usine/server 0.4.1-next.262.g0f4d653 → 0.4.1-next.264.gfdecd7e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -9
- package/dist/backend.d.ts +4 -5
- package/dist/backend.d.ts.map +1 -1
- package/dist/backend.js +1 -3
- package/dist/backend.js.map +1 -1
- package/dist/configuration/catalog.d.ts +5 -0
- package/dist/configuration/catalog.d.ts.map +1 -0
- package/dist/configuration/catalog.js +38 -0
- package/dist/configuration/catalog.js.map +1 -0
- package/dist/http.d.ts +3 -1
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +8 -19
- package/dist/http.js.map +1 -1
- package/dist/up.d.ts.map +1 -1
- package/dist/up.js +4 -2
- package/dist/up.js.map +1 -1
- package/dist/web/assets/Match-BsHjCE-9.js +1 -0
- package/dist/web/assets/_agent-CK1JZbEZ.js +1 -0
- package/dist/web/assets/_label-CkDrdgxa.js +1 -0
- package/dist/web/assets/_loop-DLKJmqFq.js +1 -0
- package/dist/web/assets/_name--06G9LKw.js +1 -0
- package/dist/web/assets/_name-BzeOsU08.js +1 -0
- package/dist/web/assets/_name-CCrJHJTI.js +1 -0
- package/dist/web/assets/_name-LWtfT5Eq.js +2 -0
- package/dist/web/assets/_number-BzeOsU08.js +1 -0
- package/dist/web/assets/{_number-BFZW4AfX.js → _number-CpU9ru_u.js} +1 -1
- package/dist/web/assets/_number-n4iejSEq.js +1 -0
- package/dist/web/assets/_run-BzeOsU08.js +1 -0
- package/dist/web/assets/_run-CHrGLkXR.js +5 -0
- package/dist/web/assets/_worker-BvlkSKMd.js +1 -0
- package/dist/web/assets/action-DQzkdVHs.js +1 -0
- package/dist/web/assets/actions-CG0hkpe7.js +1 -0
- package/dist/web/assets/agents-CgWsAMoz.js +1 -0
- package/dist/web/assets/agents-D3eAK_60.js +1 -0
- package/dist/web/assets/code-block-Y9Y-8fHK.js +4 -0
- package/dist/web/assets/collapsible-BKcakxvM.js +1 -0
- package/dist/web/assets/drawer-ClcvABkO.js +1 -0
- package/dist/web/assets/dropdown-menu-BHKHYfLs.js +1 -0
- package/dist/web/assets/edit-and-retry-DZ5FH7N6.js +1 -0
- package/dist/web/assets/error-alert-hABzwCSY.js +1 -0
- package/dist/web/assets/{file-error-Befud4JV.js → file-error-B5tv6DhJ.js} +1 -1
- package/dist/web/assets/heading-zIOXe3qT.js +1 -0
- package/dist/web/assets/history-PYEz5wbe.js +1 -0
- package/dist/web/assets/index-C_S4sA5L.css +2 -0
- package/dist/web/assets/index-Dki55xSv.js +10 -0
- package/dist/web/assets/{label-badge-nrvxD46n.js → label-badge-JdNthOHh.js} +1 -1
- package/dist/web/assets/labels-Dr9t-xYj.js +1 -0
- package/dist/web/assets/lazyRouteComponent-BnRF0Crs.js +1 -0
- package/dist/web/assets/list-NcxSR9Ja.js +1 -0
- package/dist/web/assets/loops-DI4kElkX.js +1 -0
- package/dist/web/assets/mark-uyeJ8aPC.js +1 -0
- package/dist/web/assets/model-87X7P9Uh.js +1 -0
- package/dist/web/assets/moves-DS1ecXd6.js +1 -0
- package/dist/web/assets/native-select-BzF8xUnx.js +1 -0
- package/dist/web/assets/{not-found-Bexl2Syq.js → not-found-D7GT8Sj7.js} +1 -1
- package/dist/web/assets/outcome-DvqnSso3.js +5 -0
- package/dist/web/assets/{overview-CVIU9T_Q.js → overview-C73v5kbv.js} +1 -1
- package/dist/web/assets/page-C47YAWAl.js +1 -0
- package/dist/web/assets/preload-helper-BLdHbfdN.js +1 -0
- package/dist/web/assets/pull-request-marks-B4f7z4xa.js +1 -0
- package/dist/web/assets/queries-BZMW2wiD.js +1 -0
- package/dist/web/assets/queries-oea_Y4on.js +1 -0
- package/dist/web/assets/repositories-CZBhubWh.js +1 -0
- package/dist/web/assets/route-BtU2HI1M.js +1 -0
- package/dist/web/assets/route-CD6OvH-7.js +1 -0
- package/dist/web/assets/route-status-DGpeFNCC.js +1 -0
- package/dist/web/assets/routes-BzeOsU08.js +1 -0
- package/dist/web/assets/routes-g6SHTgCO.js +65 -0
- package/dist/web/assets/run-again-DPa5c27z.js +1 -0
- package/dist/web/assets/{section-DkPPj0Qz.js → section-BZs0sQLB.js} +1 -1
- package/dist/web/assets/section-eyIYzZrG.js +24 -0
- package/dist/web/assets/settings-DusVdmgP.js +1 -0
- package/dist/web/assets/skeleton-87E84B2f.js +1 -0
- package/dist/web/assets/sortable.esm-Lp8AM6j2.js +5 -0
- package/dist/web/assets/{strings-skTeG228.js → strings-Bexnszes.js} +1 -1
- package/dist/web/assets/{strings-DONjvHz8.js → strings-DXB6PB2g.js} +69 -61
- package/dist/web/assets/tasks-BzeOsU08.js +1 -0
- package/dist/web/assets/tasks-ClShPUFW.js +1 -0
- package/dist/web/assets/usage-BMYuEDo9.js +1 -0
- package/dist/web/assets/use-open-run-B8nD_BT1.js +1 -0
- package/dist/web/assets/useAnchoredPopupScrollLock-NN99o6YU.js +1 -0
- package/dist/web/assets/useControlled-B5kAMgo-.js +1 -0
- package/dist/web/assets/useSelector-CRBsgquS.js +1 -0
- package/dist/web/assets/useSuspenseQuery-DbhQN-t-.js +1 -0
- package/dist/web/assets/visuallyHidden-BUGCJ1D9.js +1 -0
- package/dist/web/assets/workers-CDWbu1Tb.js +1 -0
- package/dist/web/index.html +20 -13
- package/package.json +9 -9
- package/dist/web/assets/X.es-ClvLjC9g.js +0 -1
- package/dist/web/assets/_agent-DAEoPdV-.js +0 -1
- package/dist/web/assets/_loop-vCYTiV8K.js +0 -1
- package/dist/web/assets/_name-BU5JK5xh.js +0 -1
- package/dist/web/assets/_name-BzehryAG.js +0 -1
- package/dist/web/assets/_name-CqC1_Tkp.js +0 -1
- package/dist/web/assets/_name-PTdpQrSQ.js +0 -6
- package/dist/web/assets/_number-BzehryAG.js +0 -1
- package/dist/web/assets/_number-CTGqOC7Y.js +0 -1
- package/dist/web/assets/_run-BzehryAG.js +0 -1
- package/dist/web/assets/_run-CobdymLR.js +0 -8
- package/dist/web/assets/_worker-o45ziAln.js +0 -1
- package/dist/web/assets/action-D59leH3d.js +0 -1
- package/dist/web/assets/agents-DejXWwOW.js +0 -1
- package/dist/web/assets/agents-_VTnE2uR.js +0 -1
- package/dist/web/assets/collapsible-DfWPTljV.js +0 -1
- package/dist/web/assets/drawer-CG2uC8mz.js +0 -1
- package/dist/web/assets/dropdown-menu-BuVimdT5.js +0 -1
- package/dist/web/assets/edit-and-retry-DoBXzKs4.js +0 -1
- package/dist/web/assets/error-alert-B1wP9JKx.js +0 -1
- package/dist/web/assets/heading-CmCH5X04.js +0 -1
- package/dist/web/assets/index-C1tcW0Kz.js +0 -10
- package/dist/web/assets/index-Y-UpTvwI.css +0 -2
- package/dist/web/assets/list-C0Krf4aU.js +0 -1
- package/dist/web/assets/loops-BUL6rqOz.js +0 -1
- package/dist/web/assets/model-CYcw80ka.js +0 -1
- package/dist/web/assets/moves-BP3lsIkJ.js +0 -1
- package/dist/web/assets/outcome-CzVmfAHO.js +0 -5
- package/dist/web/assets/page-BuzrT_cg.js +0 -1
- package/dist/web/assets/pull-request-marks-oqSgsb3K.js +0 -1
- package/dist/web/assets/queries-CMOWVU8o.js +0 -1
- package/dist/web/assets/queries-DPtA2w4k.js +0 -1
- package/dist/web/assets/reload-DepSabvQ.js +0 -1
- package/dist/web/assets/repositories-C_W6sMMC.js +0 -1
- package/dist/web/assets/route-CEwJ12I0.js +0 -1
- package/dist/web/assets/route-DSZaQYtb.js +0 -1
- package/dist/web/assets/routes-BzehryAG.js +0 -1
- package/dist/web/assets/routes-CwATPoN5.js +0 -65
- package/dist/web/assets/run-again-hwgO0X30.js +0 -1
- package/dist/web/assets/section-DKHXjfWs.js +0 -1
- package/dist/web/assets/settings-BqZbr0qg.js +0 -1
- package/dist/web/assets/tasks-BzehryAG.js +0 -1
- package/dist/web/assets/tasks-DeTOoEpw.js +0 -1
- package/dist/web/assets/usage-BQwJd-Ch.js +0 -1
- package/dist/web/assets/useAnchoredPopupScrollLock-D1zkXMhu.js +0 -1
- package/dist/web/assets/usePositioner-BRxzSVtE.js +0 -1
- package/dist/web/assets/useTimeout-BC05Ghyu.js +0 -1
- package/dist/web/assets/workers-Oh2L44Fk.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./route-status-DGpeFNCC.js";var t=e;export{t as errorComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,r as t,s as n}from"./useRouter-Hur3RN7j.js";import{a as r,i,t as a}from"./page-C47YAWAl.js";import{O as o,c as s,x as c,y as l}from"./visuallyHidden-BUGCJ1D9.js";import{t as u}from"./useSuspenseQuery-DbhQN-t-.js";import{n as d,r as f}from"./overview-C73v5kbv.js";import{t as p}from"./link-C7GfYrMt.js";import{D as m,M as h,P as g,_,k as v}from"./button-4rhhIcK8.js";import{Hn as y,Ot as b,f as x,g as S,o as C,p as w,t as T}from"./strings-DXB6PB2g.js";import{A as E,B as D,C as O,D as k,E as A,F as j,G as ee,I as M,K as te,L as ne,Nt as re,O as ie,R as ae,T as oe,U as se,i as N,j as ce,jt as le,k as ue,nt as de,q as fe,t as pe,w as me}from"./mark-uyeJ8aPC.js";import{A as he,B as ge,H as _e,M as ve,N as ye,U as be,V as xe,j as Se,r as Ce,z as we}from"./index-Dki55xSv.js";import{t as Te}from"./use-now-vNgLntlV.js";import{t as Ee}from"./heading-zIOXe3qT.js";import{t as De}from"./pull-request-marks-B4f7z4xa.js";import{n as P}from"./status-badge-CLPsMXtK.js";import{t as Oe}from"./usage-BMYuEDo9.js";import{a as ke,i as F,n as Ae,o as I,r as L,t as je}from"./table-hbKjhjeL.js";import{t as Me}from"./fill-cell-CjksmixH.js";import{n as Ne}from"./section-BZs0sQLB.js";import{c as Pe,d as Fe,g as Ie,h as Le,i as Re,l as ze,m as Be,p as Ve,r as He,s as Ue,u as We}from"./model-87X7P9Uh.js";import{n as Ge,t as Ke}from"./strings-Bexnszes.js";import{t as qe}from"./project-not-found-CutZoVCI.js";import{i as Je,r as Ye}from"./section-BwxXJ9H0.js";function R(e,t,n,r){return{left:e,top:t,right:n,bottom:r,x:e,y:t,width:n-e,height:r-t}}function Xe(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:e.width,height:e.height}}function z(e){let t=[],n,r=1/0,i=1/0,a=-1/0,o=-1/0;for(let s of Array.from(e).sort((e,t)=>e.top-t.top)){if(r=Math.min(r,s.left),i=Math.min(i,s.top),a=Math.max(a,s.right),o=Math.max(o,s.bottom),!n||s.top-n.top>n.height/2)t.push(Xe(s));else{let e=t[t.length-1];e.left=Math.min(e.left,s.left),e.right=Math.max(e.right,s.right),e.bottom=Math.max(e.bottom,s.bottom),e.width=e.right-e.left,e.height=e.bottom-e.top}n=s}return{lines:t,fallback:R(r,i,a,o)}}function B(e,t,n){return e.findIndex(e=>t>e.left-2&&t<e.right+2&&n>e.top-2&&n<e.bottom+2)}function Ze(e){return R(e.left,e.top,e.right,e.bottom)}function Qe(e,t,n){let{lines:r}=z(e.getClientRects());if(r.length<2)return;let i=B(r,t,n);return{x:t,y:n,lineIndex:i===-1?void 0:i,element:e}}function $e(e,t,n){let{lines:r,fallback:i}=z(e.getClientRects());if(r.length<2)return null;let a=n?.x,o=n?.y,s=t[0];if(n?.lineIndex!=null&&r[n.lineIndex])return Ze(r[n.lineIndex]);if(a!=null&&o!=null){let e=B(r,a,o);if(e!==-1)return Ze(r[e])}if(r.length===2&&r[0].left>r[1].right&&a!=null&&o!=null)return i;if(s===`t`||s===`b`){let e=r[0],t=r[r.length-1],n=s===`t`?e:t;return R(n.left,e.top,n.right,t.bottom)}let c=s===`l`,l=r[0].left,u=r[0].right,d=c?1/0:-1/0,f=r[0],p=r[0];for(let e of r){l=Math.min(l,e.left),u=Math.max(u,e.right);let t=c?e.left:e.right;c&&t<d||!c&&t>d?(d=t,f=e,p=e):t===d&&(p=e)}return R(l,f.top,u,p.bottom)}function et(e){return`contextElement`in e&&e.contextElement?e.contextElement:_(e)?e:void 0}function tt(e,t){function n(t){V(e,t.currentTarget,t.clientX,t.clientY)}function r(e){t||n(e)}return{onFocus(){e.current=void 0},onMouseEnter:r,onMouseMove:r}}function V(e,t,n,r){let i=Qe(t,n,r);return e.current=i,i}function nt(e){return{name:`inline`,async fn(t){let n=t.elements.reference;if(typeof n?.getClientRects!=`function`)return{};let r=et(n),i=e.current,a=i?.element===n||i?.element===r?i:void 0,o=$e(n,t.placement,a);if(!o||typeof t.platform.getElementRects!=`function`)return{};let s=await t.platform.getElementRects({reference:{contextElement:r,getBoundingClientRect(){return o}},floating:t.elements.floating,strategy:t.strategy});return t.rects.reference.x===s.reference.x&&t.rects.reference.y===s.reference.y&&t.rects.reference.width===s.reference.width&&t.rects.reference.height===s.reference.height?{}:{reset:{rects:s}}}}}var H=n(e(),1),U=H.createContext(void 0);function W(e){let t=H.useContext(U);if(t===void 0&&!e)throw Error(h(50));return t}var rt={...me,instantType:e=>e.instantType,adaptiveOrigin:e=>e.adaptiveOrigin,closeDelay:e=>e.closeDelay},it=class extends oe{constructor(e,t,n){let r=new ie;super(at(e,r,t,n),ot(r),rt)}setOpen=(e,t)=>{let{inlineRectCoordsRef:n}=this.context;ce(this,e,t,{onBeforeDispatch(){let r=t.event;e&&t.reason===`trigger-hover`&&t.trigger&&`clientX`in r&&`clientY`in r&&n.current?.element!==t.trigger&&V(n,t.trigger,r.clientX,r.clientY)}})}};function at(e,t,n,r=!1){return{...O(t,n,r),instantType:void 0,adaptiveOrigin:void 0,closeDelay:300,...e}}function ot(e){return{popupRef:H.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e,inlineRectCoordsRef:{current:void 0}}}var G=t();function K(e){let{open:t,defaultOpen:n=!1,onOpenChange:r,onOpenChangeComplete:i,actionsRef:a,handle:o,triggerId:c,defaultTriggerId:u=null,children:d}=e,f=ae((e,r)=>new it({open:n,openProp:t,activeTriggerId:u,triggerIdProp:c},e,r));f.useControlledProp(`openProp`,t),f.useControlledProp(`triggerIdProp`,c),f.useContextCallback(`onOpenChange`,r),f.useContextCallback(`onOpenChangeComplete`,i);let p=f.useState(`open`),m=f.useState(`activeTriggerId`),h=f.useState(`mounted`),g=f.useState(`payload`);j(f,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:_}=M(p,f,()=>{f.context.inlineRectCoordsRef.current=void 0});v(()=>{p&&(m??f.set(`payload`,void 0))},[f,m,p]),H.useImperativeHandle(a,()=>({unmount:_,close:()=>f.setOpen(!1,l(s))}),[_,f]);let y=p||h||o!=null;return(0,G.jsxs)(U.Provider,{value:f,children:[o&&(0,G.jsx)(E,{handle:o,store:f}),y&&(0,G.jsx)(st,{store:f}),typeof d==`function`?d({payload:g}):d]})}function st({store:e}){let t=e.useState(`floatingRootContext`),n=se(t);return ne(e,{activeTriggerProps:n.reference,inactiveTriggerProps:n.trigger,popupProps:n.floating}),null}var ct=A(function(e){return W(!0)?(0,G.jsx)(K,{...e}):(0,G.jsx)(te,{children:(0,G.jsx)(K,{...e})})}),q=H.createContext(void 0);function lt(){let e=H.useContext(q);if(e===void 0)throw Error(h(48));return e}var ut=H.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return W().useState(`mounted`)||n?(0,G.jsx)(q.Provider,{value:n,children:(0,G.jsx)(ye,{ref:t,...r})}):null}),dt=k(function(e,t){let{render:n,className:r,delay:i,closeDelay:a,id:o,payload:s,handle:l,style:u,...d}=e,f=W(!0),p=be(l)??f;if(!p)throw Error(h(89));let m=c(o),_=p.useState(`isTriggerActive`,m),v=p.useState(`isOpenedByTrigger`,m),y=p.useState(`floatingRootContext`),b=p.context.inlineRectCoordsRef,x=H.useRef(null),S=i??600,C=a??300,{registerTrigger:w,isMountedByThisTrigger:T}=D(m,x,p,{payload:s,closeDelay:C}),E=ge(y,{mouseOnly:!0,move:!1,handleClose:we(),delay:()=>({open:S,close:C}),triggerElementRef:x,isActiveTrigger:_,isClosing:()=>p.select(`transitionStatus`)===`ending`}),O=_e(y,{delay:S}),k={open:v},A=p.useState(`triggerProps`,T),j=tt(b,v);return g(`a`,e,{state:k,ref:[t,w,x],props:[E,O.reference,A,j,{id:m},d],stateAttributesMapping:re})}),J=H.createContext(void 0);function ft(){let e=H.useContext(J);if(e===void 0)throw Error(h(49));return e}var pt=H.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`bottom`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=de,style:g,..._}=e,y=W(),b=lt(),x=fe(),S=y.useState(`open`),C=y.useState(`mounted`),w=y.useState(`floatingRootContext`),T=y.useState(`instantType`),E=y.useState(`transitionStatus`),D=y.useState(`adaptiveOrigin`),O=y.context.inlineRectCoordsRef,k=ve({anchor:i,floatingRootContext:w,positionMethod:a,mounted:C,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m,keepMounted:b,nodeId:x,collisionAvoidance:h,adaptiveOrigin:D,inline:nt(O)}),A=k.update;v(()=>{S&&C&&A()},[S,C,A]);let j={open:S,side:k.side,align:k.align,anchorHidden:k.anchorHidden,instant:T},M=he(e,j,{styles:k.positionerStyles,transitionStatus:E,props:_,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!C,inert:!S});return(0,G.jsx)(J.Provider,{value:k,children:(0,G.jsx)(ee,{id:x,children:M})})}),mt=H.forwardRef(function(e,t){let{className:n,render:r,style:i,...a}=e,s=W(),{side:c,align:l}=ft(),u=s.useState(`open`),d=s.useState(`instantType`),f=s.useState(`transitionStatus`),p=s.useState(`popupProps`),m=s.useState(`floatingRootContext`),h=s.useState(`closeDelay`);return o({open:u,ref:s.context.popupRef,onComplete(){u&&s.context.onOpenChangeComplete?.(!0)}}),xe(m,{closeDelay:h}),g(`div`,e,{state:{open:u,side:c,align:l,instant:d,transitionStatus:f},ref:[t,s.context.popupRef,s.useStateSetter(`popupElement`)],props:[ue,p,Se(f),a],stateAttributesMapping:le})});function ht({...e}){return(0,G.jsx)(ct,{"data-slot":`hover-card`,...e})}function gt({...e}){return(0,G.jsx)(dt,{"data-slot":`hover-card-trigger`,...e})}function _t({className:e,side:t=`bottom`,sideOffset:n=4,align:r=`center`,alignOffset:i=4,...a}){return(0,G.jsx)(ut,{"data-slot":`hover-card-portal`,children:(0,G.jsx)(pt,{align:r,alignOffset:i,side:t,sideOffset:n,className:`isolate z-50`,children:(0,G.jsx)(mt,{"data-slot":`hover-card-content`,className:m(`z-50 w-72 origin-(--transform-origin) rounded-lg bg-popover p-2.5 text-xs/relaxed text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 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),...a})})})}var vt=`relative z-10 rounded-sm underline-offset-4 outline-none hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring/70 focus-visible:outline-solid`,Y=({usage:e,label:t,note:n,children:r})=>(0,G.jsxs)(ht,{children:[(0,G.jsx)(gt,{delay:200,"aria-label":t,render:(0,G.jsx)(`button`,{type:`button`,className:vt}),children:r}),(0,G.jsxs)(_t,{align:`end`,className:`w-[26rem] max-w-[calc(100vw-2rem)] p-3 font-sans text-xs shadow-raised`,children:[n!==null&&(0,G.jsxs)(`p`,{className:`pb-2 text-muted-foreground`,children:[n,`.`]}),(0,G.jsx)(Oe,{pools:e.pools})]})]}),X=`hidden @5xl:table-cell`,Z=`hidden @4xl:table-cell`,Q=`@md:w-max @md:max-w-(--side)`,yt=({reason:e})=>b(e,{AwaitingApproval:()=>`Waiting`,SuppressedForOperator:()=>`needs-you`,CycleBudgetUsedUp:()=>`needs-you`,RunFailed:()=>`Failed`,ClosedUnchanged:({run:e})=>e.state,LoopPaused:()=>`paused`,WaitingForStop:({run:e})=>e.state,QueuedForWorker:({run:e})=>e.state,AwaitingPoll:()=>`Pending`}),bt=({last:e,status:t},n)=>{let r=Re(e),i=t=>({state:yt(t),words:`${e.loop!==t.loop&&!Ke(t)?`${t.loop} `:``}${Ge(t,n)}`,at:null});return b(t,{Running:({run:e})=>({state:`Running`,words:`Running ${e.loop}`,at:r}),AwaitingApproval:()=>({state:`Waiting`,words:`Waiting for approval`,at:r}),Queued:({run:e})=>({state:e.state,words:e.state,at:r}),Stalled:({stall:e})=>i(e),Idle:({stall:e})=>i(e),NeedsAttention:()=>({state:`needs-you`,words:`Needs attention`,at:r}),Done:()=>({state:`Done`,words:`Done`,at:r}),Ended:({run:e})=>({state:e.state,words:e.state,at:r})})},xt=({row:e,now:t})=>{let{state:n,words:r,at:i}=bt(e,t);return(0,G.jsxs)(`span`,{className:m(`flex items-start gap-1.5 text-xs/5 font-medium`,Q),children:[n===`Done`?(0,G.jsx)(pe,{item:e.task,linked:!1,numbered:!1,className:`mt-0.75`}):(0,G.jsx)(P,{state:n,className:`mt-1.75`}),(0,G.jsxs)(`span`,{className:`min-w-0 wrap-break-word`,children:[r,i!==null&&(0,G.jsxs)(G.Fragment,{children:[` `,(0,G.jsxs)(`span`,{className:`font-normal whitespace-nowrap text-muted-foreground`,children:[`·`,` `,(0,G.jsx)(`time`,{dateTime:i,title:x(i),className:`font-mono tabular-nums`,children:T(i,t)})]})]})]})]})},St=()=>(0,G.jsx)(`span`,{className:`absolute left-full text-muted-foreground`,children:`*`}),Ct=({usage:e})=>{if(e.cost===null)return null;let t=He(e),n=S(e.cost.usd);return(0,G.jsxs)(Y,{usage:e,label:`Estimated cost: ${t?`at least `:``}${n}. Show per pool`,note:t?Le:null,children:[n,t&&(0,G.jsx)(St,{})]})},wt=({task:e,now:t})=>{let{usage:n}=e;if(e.runs.every(({attempts:e})=>e.length===0))return null;let r=n.unmeasured>0;return(0,G.jsxs)(`span`,{className:`relative`,title:r?Ie:`Total attempt time`,children:[C(Pe(n,t)),r&&(0,G.jsx)(St,{})]})},Tt=`py-3 align-top whitespace-normal`,$=`py-3 text-right align-top font-mono text-xs/5 whitespace-nowrap tabular-nums`,Et=({task:e})=>{let t=ze(e);return(0,G.jsxs)(`span`,{className:m(`flex items-baseline gap-2`,Q),children:[(0,G.jsx)(`span`,{className:`truncate`,title:t.map(({loop:e})=>e).join(` · `),children:t.map(({loop:e,state:t},n)=>(0,G.jsxs)(H.Fragment,{children:[n>0&&(0,G.jsx)(`span`,{className:`text-muted-foreground`,children:` · `}),(0,G.jsx)(P,{state:t,className:`mr-1.5 align-middle`}),e,(0,G.jsxs)(`span`,{className:`sr-only`,children:[` `,t]})]},e))}),(0,G.jsx)(`span`,{className:`shrink-0 font-mono text-xs text-muted-foreground tabular-nums`,children:e.runs.length})]})},Dt=({row:e,repository:t,now:n})=>(0,G.jsxs)(I,{className:Ye,children:[(0,G.jsx)(Me,{className:`py-3 align-top`,children:(0,G.jsx)(p,{"data-row-link":!0,to:`/projects/$owner/$name/tasks/$number`,params:{...f(t),number:We(e.task)},className:m(`block min-w-0`,Je),children:(0,G.jsx)(Ee,{variant:`row`,item:y(N(e.task).origin),title:e.task.title,linked:!1})})}),(0,G.jsx)(L,{className:Tt,children:(0,G.jsx)(xt,{row:e,now:n})}),(0,G.jsx)(L,{className:m(`py-3 align-top`,X),children:(0,G.jsx)(Et,{task:e.task})}),(0,G.jsx)(L,{className:m(`py-3 text-right align-top`,X),children:(0,G.jsx)(De,{pullRequests:N(e.task).pullRequests,className:`relative z-10 justify-end`})}),(0,G.jsx)(L,{className:$,children:(0,G.jsx)(wt,{task:e.task,now:n})}),(0,G.jsx)(L,{className:m($,Z),children:e.task.usage.pools.length>0&&(0,G.jsx)(Y,{usage:e.task.usage,label:`Tokens: ${w(e.task.usage.tokens)}. Show per pool`,note:null,children:w(e.task.usage.tokens)})}),(0,G.jsx)(L,{className:m($,Z),children:(0,G.jsx)(Ct,{usage:e.task.usage})})]}),Ot=({totals:e})=>(0,G.jsx)(`p`,{className:`-mt-2 text-sm text-muted-foreground tabular-nums`,children:Be(e).map(({figure:e,words:t,lowerBound:n},r)=>(0,G.jsxs)(H.Fragment,{children:[r>0&&`, `,n===null?e:(0,G.jsx)(`span`,{title:n,children:`${e}*`}),` `,t]},t))}),kt=[`@md:[--side:clamp(7rem,calc((100cqw-26rem-var(--rest))/var(--sides)),13rem)]`,`[--rest:7rem] [--sides:1] @4xl:[--rest:16.5rem] @5xl:[--rest:23rem] @5xl:[--sides:2]`].join(` `),At=({project:e,stalled:t})=>{let n=Te(3e4),r=Fe(e.board.lanes,t);return(0,G.jsxs)(a,{width:`full`,children:[(0,G.jsx)(i,{title:`Tasks`,counts:Ue(r)}),r.length===0?(0,G.jsx)(Ne,{children:`No runs yet`}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Ot,{totals:Ve(r,n)}),(0,G.jsx)(`div`,{className:`@container -mx-2`,children:(0,G.jsxs)(je,{"aria-label":`${e.repository} tasks`,className:kt,children:[(0,G.jsx)(ke,{children:(0,G.jsxs)(I,{className:`hover:bg-transparent`,children:[(0,G.jsx)(F,{children:`Task`}),(0,G.jsx)(F,{children:`Status`}),(0,G.jsx)(F,{className:X,children:`Runs`}),(0,G.jsx)(F,{className:m(`text-right`,X),children:`Pull request`}),(0,G.jsx)(F,{className:`text-right`,children:`Elapsed time`}),(0,G.jsx)(F,{className:m(`text-right`,Z),children:`Tokens`}),(0,G.jsx)(F,{className:m(`text-right`,Z),children:`Estimated cost`})]})}),(0,G.jsx)(Ae,{children:r.map(t=>(0,G.jsx)(Dt,{row:t,repository:e.repository,now:n},t.task.itemKey))})]})})]})]})},jt=()=>{let{repository:e}=Ce.useParams(),{data:t}=u(d()),n=u(r()),i=t.projects.find(t=>t.repository===e);return i===void 0?(0,G.jsx)(qe,{}):(0,G.jsx)(At,{project:i,stalled:n.data.notMoving})};export{jt as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,r as t,s as n}from"./useRouter-Hur3RN7j.js";import{I as r,O as i,_ as a,c as o,w as s,x as c,y as l}from"./visuallyHidden-BUGCJ1D9.js";import{A as u,D as d,M as f,P as p,r as m,v as h}from"./button-4rhhIcK8.js";import{d as g,g as _,p as v}from"./strings-DXB6PB2g.js";import{$ as y,A as b,B as x,C as S,D as C,E as w,F as T,G as E,I as D,K as O,L as k,M as A,Mt as j,N as M,Nt as N,O as P,P as F,R as I,T as L,U as R,W as z,Z as B,at as V,f as H,jt as U,k as ee,nt as te,p as ne,q as W,v as G,w as K,z as re}from"./mark-uyeJ8aPC.js";import{a as ie,n as ae,o as oe,r as se,t as ce}from"./useAnchoredPopupScrollLock-NN99o6YU.js";import{A as le,B as ue,M as de,U as fe,V as pe,j as me,z as he}from"./index-Dki55xSv.js";import{t as ge}from"./ToolbarRootContext-aq6udDVh.js";var q=n(e(),1),J=q.createContext(void 0);function Y(e){let t=q.useContext(J);if(t===void 0&&!e)throw Error(f(47));return t}var _e=n(r(),1),ve={...K,disabled:e=>e.disabled,instantType:e=>e.instantType===`trigger-change`&&!K.open(e)?void 0:e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,isPressOpenedByTrigger:(e,t)=>e.openChangeReason===`trigger-press`&&K.isOpenedByTrigger(e,t),isTouchPressOpen:(e,t)=>t&&e.openMethod===`touch`&&e.openChangeReason===`trigger-press`,hasTriggerFocusGuards:(e,t)=>K.isOpenedByTrigger(e,t)&&!e.focusManagerModal,modal:e=>e.modal,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},ye=class extends L{constructor(e,t,n){let r=new P;super(be(e,r,t,n),xe(r),ve)}setOpen=(e,t)=>{let n=t.reason===a,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),o=A(t),s=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&s!=null&&(t.trigger=this.context.triggerElements.getById(s)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let c=()=>{let n=F(this.state,e,t.trigger,o());n.openChangeReason=t.reason,this.update(n)};n?(this.context.stickIfOpen=!0,this.context.stickIfOpenTimeout.start(500,()=>{this.context.stickIfOpen=!1}),_e.flushSync(c)):c();let l;r?l=`click`:i?l=`dismiss`:t.reason===`focus-out`&&(l=`focus`),this.set(`instantType`,l)}};function be(e,t,n,r=!1){let i={...S(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i}function xe(e){return{popupRef:q.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:q.createRef(),beforeTriggerFocusGuardRef:q.createRef(),beforeContentFocusGuardRef:q.createRef(),stickIfOpenTimeout:new s,stickIfOpen:!0,triggerElements:e}}var X=t(),Z=w(function({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:s=!1,handle:c,triggerId:u,defaultTriggerId:d=null}=e,f=Ce(c,{modal:s,open:r,openProp:n,activeTriggerId:d,triggerIdProp:u});f.useControlledProp(`openProp`,n),f.useControlledProp(`triggerIdProp`,u);let p=f.useState(`open`),m=f.useState(`mounted`),h=f.useState(`payload`);f.useContextCallback(`onOpenChange`,i),f.useContextCallback(`onOpenChangeComplete`,a),re(f,p),T(f);let{forceUnmount:g}=D(p,f,()=>{f.context.stickIfOpen=!0,f.set(`openChangeReason`,null)});f.useSyncedValues({modal:s}),q.useEffect(()=>{p||f.context.stickIfOpenTimeout.clear()},[f,p]),q.useImperativeHandle(e.actionsRef,()=>({unmount:g,close:()=>f.setOpen(!1,l(o))}),[g,f]);let _=p||m||c!=null;return(0,X.jsxs)(J.Provider,{value:f,children:[c&&(0,X.jsx)(b,{handle:c,store:f}),_&&(0,X.jsx)(we,{store:f,modal:s}),typeof t==`function`?t({payload:h}):t]})});function Se(e){return Y(!0)?(0,X.jsx)(Z,{props:e}):(0,X.jsx)(O,{children:(0,X.jsx)(Z,{props:e})})}function Ce(e,t){let n=I((e,n)=>new ye(t,e,n));return q.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function we({store:e,modal:t}){let n=e.useState(`floatingRootContext`),r=R(n,{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),i=r.reference,a=r.floating;return k(e,{activeTriggerProps:i,inactiveTriggerProps:i,popupProps:a}),null}var Te=C(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,handle:s,payload:l,openOnHover:d=!1,delay:h=300,closeDelay:g=0,id:_,...v}=e,b=Y(!0),S=fe(s)??b;if(!S)throw Error(f(74));let C=c(_),w=S.useState(`isTriggerActive`,C),T=S.useState(`floatingRootContext`),E=S.useState(`isOpenedByTrigger`,C),D=S.useState(`triggerPopupId`,C),O=q.useRef(null),{registerTrigger:k,isMountedByThisTrigger:A}=x(C,O,S,{payload:l,disabled:a,openOnHover:d,closeDelay:g}),M=S.useState(`isPressOpenedByTrigger`,C),P=S.useState(`isTouchPressOpen`,d),F=S.useState(`hasTriggerFocusGuards`,C),I=ue(T,{enabled:!a&&d&&!P,mouseOnly:!0,move:!1,handleClose:he(),restMs:h,delay:{close:g},triggerElementRef:O,isActiveTrigger:w,isClosing:()=>S.select(`transitionStatus`)===`ending`}),L=u(()=>S.context.stickIfOpen),R=oe(T,{stickIfOpen:L}),z=ie(()=>S.select(`open`),e=>{S.set(`openMethod`,e)}),B=S.useState(`triggerProps`,A),{getButtonProps:H,buttonRef:U}=m({disabled:a,native:o}),ee={open(e){return M?j.open(e):N.open(e)}},{handlePreFocusGuardFocus:te,handleFocusTargetFocus:ne}=se(S,O),W=p(`button`,e,{state:{disabled:a,open:E},ref:[U,t,k,O],props:[R.reference,I,B,z,{[y]:``,id:C,"aria-haspopup":`dialog`,"aria-expanded":E,"aria-controls":D},v,H],stateAttributesMapping:ee}),G=(0,X.jsx)(q.Fragment,{children:W},C);return F?(0,X.jsxs)(q.Fragment,{children:[(0,X.jsx)(V,{ref:S.context.beforeTriggerFocusGuardRef,onFocus:te}),G,(0,X.jsx)(V,{ref:S.context.triggerFocusTargetRef,onFocus:ne})]}):G}),Ee=q.createContext(void 0);function De(){let e=q.useContext(Ee);if(e===void 0)throw Error(f(45));return e}var Oe=q.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return Y().useState(`mounted`)||n?(0,X.jsx)(Ee.Provider,{value:n,children:(0,X.jsx)(B,{ref:t,...r})}):null}),ke=q.createContext(void 0);function Ae(){let e=q.useContext(ke);if(!e)throw Error(f(46));return e}var je=q.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:m,disableAnchorTracking:h=!1,collisionAvoidance:g=te,..._}=e,v=Y(),y=De(),b=W(),x=v.useState(`floatingRootContext`),S=v.useState(`mounted`),C=v.useState(`open`),w=v.useState(`openChangeReason`),T=v.useState(`activeTriggerElement`),D=v.useState(`modal`),O=v.useState(`openMethod`),k=v.useState(`positionerElement`),A=v.useState(`instantType`),j=v.useState(`transitionStatus`),M=v.useState(`adaptiveOrigin`),N=de({anchor:a,floatingRootContext:x,positionMethod:o,mounted:S,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h,keepMounted:y,nodeId:b,collisionAvoidance:g,adaptiveOrigin:M}),P=x.useState(`domReferenceElement`);ae({store:v,domReference:P,positionerElement:k,open:C});let F=D===!0&&w!==`trigger-hover`;ce(C&&F,O===`touch`,k,T);let I=v.useStateSetter(`positionerElement`),L={open:C,side:N.side,align:N.align,anchorHidden:N.anchorHidden,instant:A},R=le(e,L,{styles:N.positionerStyles,transitionStatus:j,props:_,refs:[t,I],hidden:!S,inert:!C});return(0,X.jsxs)(ke.Provider,{value:N,children:[S&&F&&(0,X.jsx)(H,{inert:ne(!C),cutout:T}),(0,X.jsx)(E,{id:b,children:R})]})}),Me=q.createContext(void 0);function Ne(){let[e,t]=q.useState(0),n=u(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:q.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}var Pe=q.forwardRef(function(e,t){let{render:n,className:r,style:a,initialFocus:o,finalFocus:s,...c}=e,l=Y(),u=Ae(),d=ge(!0)!=null,{context:f,hasClosePart:m}=Ne(),g=l.useState(`open`),_=l.useState(`openMethod`),v=l.useState(`instantType`),y=l.useState(`transitionStatus`),b=l.useState(`popupProps`),x=l.useState(`titleElementId`),S=l.useState(`descriptionElementId`),C=l.useState(`modal`),w=l.useState(`mounted`),T=l.useState(`openChangeReason`),E=l.useState(`activeTriggerElement`),D=l.useState(`floatingRootContext`),O=D.useState(`floatingId`),k=l.useState(`disabled`),A=l.useState(`openOnHover`),j=l.useState(`closeDelay`);i({open:g,ref:l.context.popupRef,onComplete(){g&&l.context.onOpenChangeComplete?.(!0)}}),pe(D,{enabled:A&&!k,closeDelay:j});let N=o===void 0?M(l.context.popupRef):o,P=C!==!1&&m;l.useSyncedValue(`focusManagerModal`,P);let F=l.useStateSetter(`popupElement`),I={open:g,side:u.side,align:u.align,instant:v,transitionStatus:y},L=p(`div`,e,{state:I,ref:[t,l.context.popupRef,F],props:[b,{id:O,role:`dialog`,...ee,"aria-labelledby":x,"aria-describedby":S,onKeyDown(e){d&&G.has(e.key)&&e.stopPropagation()}},me(y),c],stateAttributesMapping:U});return(0,X.jsx)(z,{context:D,openInteractionType:_,modal:P,disabled:!w||T===`trigger-hover`,initialFocus:N,returnFocus:s,restoreFocus:`popup`,getInsideElements:()=>[l.context.beforeTriggerFocusGuardRef.current],previousFocusableElement:h(E)?E:void 0,nextFocusableElement:l.context.triggerFocusTargetRef,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:(0,X.jsx)(Me.Provider,{value:f,children:L})})});function Fe({...e}){return(0,X.jsx)(Se,{"data-slot":`popover`,...e})}function Q({...e}){return(0,X.jsx)(Te,{"data-slot":`popover-trigger`,...e})}function Ie({className:e,align:t=`center`,alignOffset:n=0,side:r=`bottom`,sideOffset:i=4,...a}){return(0,X.jsx)(Oe,{children:(0,X.jsx)(je,{align:t,alignOffset:n,side:r,sideOffset:i,className:`isolate z-50`,children:(0,X.jsx)(Pe,{"data-slot":`popover-content`,className:d(`z-50 flex w-72 origin-(--transform-origin) flex-col gap-4 rounded-lg bg-popover p-2.5 text-xs text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 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),...a})})})}var $=new Intl.NumberFormat(`en`),Le=({cost:e})=>e===null?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`font-mono text-foreground tabular-nums`,children:_(e.usd)}),e.estimate&&(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:` estimate`})]}),Re=({session:e})=>e._tag===`ParentSession`?`Parent`:e.agent,ze=`grid grid-cols-[minmax(0,1fr)_auto_7rem] items-baseline gap-x-3 py-0.5`,Be=`grid grid-cols-[minmax(0,1fr)_auto_10rem] items-baseline gap-x-3 py-0.5`,Ve=e=>`unpriced`in e&&e.unpriced,He=({pools:e})=>{let t=e.some(e=>Ve(e)&&e.cost!==null);return(0,X.jsxs)(`section`,{"aria-label":`Tokens per pool`,children:[(0,X.jsx)(`h2`,{className:`pb-1 text-sm font-medium text-foreground`,children:`Tokens per pool`}),e.map(e=>(0,X.jsxs)(`div`,{className:t?Be:ze,children:[(0,X.jsx)(`span`,{className:`truncate text-foreground`,children:g(e.pool)}),(0,X.jsx)(`span`,{className:`text-right font-mono text-foreground tabular-nums`,children:$.format(e.tokens)}),(0,X.jsxs)(`span`,{className:`text-right`,children:[Ve(e)&&e.cost!==null&&(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`at least `}),(0,X.jsx)(Le,{cost:e.cost})]})]},e.pool))]})},Ue=({usage:e,attempts:t})=>(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(He,{pools:e.pools}),(0,X.jsxs)(`section`,{"aria-label":`Tokens per session`,className:`border-t pt-2.5`,children:[(0,X.jsx)(`h2`,{className:`pb-1 text-sm font-medium text-foreground`,children:`Tokens per session`}),t.map(t=>{let n=e.sessions.filter(({attemptId:e})=>e===t.id);return n.length===0?null:(0,X.jsxs)(`div`,{className:`pb-1`,children:[(0,X.jsxs)(`h3`,{className:`pt-1 text-muted-foreground`,children:[`Attempt `,t.number]}),n.map(e=>(0,X.jsxs)(`div`,{className:ze,children:[(0,X.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,X.jsx)(`span`,{className:`shrink-0 text-foreground`,children:Re(e)}),(0,X.jsx)(`span`,{className:`truncate font-mono text-muted-foreground`,children:e.session.brain.model})]}),(0,X.jsx)(`span`,{className:`text-right font-mono text-foreground tabular-nums`,children:$.format(e.tokens)}),(0,X.jsx)(`span`,{className:`text-right`,children:(0,X.jsx)(Le,{cost:e.cost})})]},e.session.id))]},t.id)})]}),(0,X.jsx)(`p`,{className:`text-muted-foreground`,children:`Tokens are output and uncached input. Dollars are the price each harness reports, or for Codex, the OpenAI API price.`})]}),We=({usage:e,attempts:t})=>(0,X.jsxs)(Fe,{children:[(0,X.jsxs)(Q,{"aria-label":`Tokens: ${$.format(e.tokens)}. Show per pool and session`,className:`rounded-sm text-primary underline-offset-4 outline-none hover:underline focus-visible:ring-2 focus-visible:ring-ring/70`,children:[(0,X.jsx)(`span`,{className:`font-mono text-xs tabular-nums`,children:v(e.tokens)}),` tokens`]}),(0,X.jsx)(Ie,{align:`start`,className:`w-[26rem] max-w-[calc(100vw-2rem)] gap-3 p-3 text-xs shadow-raised`,children:(0,X.jsx)(Ue,{usage:e,attempts:t})})]});export{Q as a,Ie as i,We as n,Fe as r,He as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,r as t,s as n}from"./useRouter-Hur3RN7j.js";import{D as r,O as i,c as a,i as o,x as s,y as c}from"./visuallyHidden-BUGCJ1D9.js";import{n as l}from"./useNavigate-AT5VkfZa.js";import{M as u,P as d,k as f,r as p}from"./button-4rhhIcK8.js";import{A as m,At as h,C as g,F as _,Gt as v,I as y,L as b,N as x,O as S,P as C,R as w,T,U as E,W as D,Wt as O,Z as k,d as A,f as j,jt as M,k as N,p as P,v as F,w as I,z as L}from"./mark-uyeJ8aPC.js";var R=n(e(),1),z=R.createContext(void 0);function B(e){let t=R.useContext(z);if(!e&&t===void 0)throw Error(u(27));return t}var V=R.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=B(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`),f={open:c,transitionStatus:s.useState(`transitionStatus`)};return d(`div`,e,{state:f,ref:[s.context.backdropRef,t],stateAttributesMapping:M,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),H=R.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:s=!0,...l}=e,u=B(),f=u.useState(`open`),{getButtonProps:m,buttonRef:h}=p({disabled:a,native:s}),g={disabled:a};function _(e){f&&u.setOpen(!1,c(o,e.nativeEvent))}return d(`button`,e,{state:g,ref:[t,h],props:[{onClick:_},l,m]})}),U=R.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,c=B(),l=s(a);return c.useSyncedValueWithCleanup(`descriptionElementId`,l),d(`p`,e,{ref:t,props:[{id:l},o]})}),W=R.createContext(void 0);function G(){let e=R.useContext(W);if(e===void 0)throw Error(u(26));return e}var K=`--nested-dialogs`,q=`data-nested-dialog-open`,J={...h,...r,nestedDialogOpen(e){return e?{[q]:``}:null}},Y=t(),X=R.forwardRef(function(e,t){let{render:n,className:r,style:a,finalFocus:o,initialFocus:s,...c}=e,l=B(),u=l.useState(`descriptionElementId`),f=l.useState(`disablePointerDismissal`),p=l.useState(`floatingRootContext`),m=l.useState(`popupProps`),h=l.useState(`modal`),g=l.useState(`mounted`),_=l.useState(`nested`),v=l.useState(`nestedOpenDialogCount`),y=l.useState(`open`),b=l.useState(`openMethod`),S=l.useState(`titleElementId`),C=l.useState(`transitionStatus`),w=l.useState(`role`),T=p.useState(`floatingId`);G(),i({open:y,ref:l.context.popupRef,onComplete(){y&&l.context.onOpenChangeComplete?.(!0)}});let E=s===void 0?x(l.context.popupRef):s,O=v>0,k=l.useStateSetter(`popupElement`),A=d(`div`,e,{state:{open:y,nested:_,transitionStatus:C,nestedDialogOpen:O},props:[m,{id:T,"aria-labelledby":S,"aria-describedby":u,role:w,...N,hidden:!g,onKeyDown(e){F.has(e.key)&&e.stopPropagation()},style:{[K]:v}},c],ref:[t,l.context.popupRef,k],stateAttributesMapping:J});return(0,Y.jsx)(D,{context:p,openInteractionType:b,disabled:!g,closeOnFocusOut:!f,initialFocus:E,returnFocus:o,modal:h!==!1,restoreFocus:`popup`,children:A})}),Z=R.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=B(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,Y.jsx)(W.Provider,{value:n,children:(0,Y.jsxs)(k,{ref:t,...r,children:[a&&o===!0&&(0,Y.jsx)(j,{ref:i.context.internalBackdropRef,inert:P(!s)}),e.children]})}):null});function Q({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`mounted`),a=e.useState(`disablePointerDismissal`),o=e.useState(`modal`),s=e.useState(`popupElement`),c=e.useState(`floatingRootContext`),[l,u]=R.useState(0),[d,p]=R.useState(0),m=l===0,h=E(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=v(t);if(m&&!a){if(o){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||O(n,s)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:m});return A(r&&o===!0,s),e.useContextCallback(`onNestedDialogOpen`,(t,n)=>{(e.select(`open`)||e.select(`mounted`))&&(u(t),p(n))}),f(()=>{!r&&!i&&(u(0),p(0))},[r,i]),f(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(l+1,d+ +!!n),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,l,d,t]),b(e,{activeTriggerProps:h.reference,inactiveTriggerProps:h.trigger,popupProps:h.floating,nestedOpenDialogCount:l,nestedOpenDrawerCount:d}),null}var $={...I,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},ee=class extends T{constructor(e,t,n){let r=new S,i=te(e,r,t,n);super(i,ne(r),$)}setOpen=(e,t)=>{t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),!t.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(C(this.state,e,t.trigger)))}};function te(e,t,n,r=!1){return{...g(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function ne(e){return{popupRef:R.createRef(),backdropRef:R.createRef(),internalBackdropRef:R.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function re(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:o,onOpenChangeComplete:s,disablePointerDismissal:l=!1,modal:u=!0,actionsRef:d,handle:f,triggerId:p,defaultTriggerId:h=null}=t,g=e===`drawer`,v=e===`alert-dialog`,b=v?!0:u,x=v||l,S=v?`alertdialog`:`dialog`,C=B(!0),T={modal:b,disablePointerDismissal:x,nested:C!=null,role:S},E=w((e,t)=>new ee({open:i,openProp:r,activeTriggerId:h,triggerIdProp:p,...T},e,t),!0);E.useControlledProp(`openProp`,r),E.useControlledProp(`triggerIdProp`,p),E.useSyncedValues(T),E.useContextCallback(`onOpenChange`,o),E.useContextCallback(`onOpenChangeComplete`,s);let D=E.useState(`open`),O=E.useState(`mounted`),k=E.useState(`payload`);L(E,D),_(E);let{forceUnmount:A}=y(D,E);R.useImperativeHandle(d,()=>({unmount:A,close:()=>E.setOpen(!1,c(a))}),[A,E]);let j=D||O||f!=null;return(0,Y.jsxs)(z.Provider,{value:E,children:[f&&(0,Y.jsx)(m,{handle:f,store:E}),j&&(0,Y.jsx)(Q,{store:E,parentContext:C?.context,isDrawer:g}),typeof n==`function`?n({payload:k}):n]})}var ie=R.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,c=B(),l=s(a);return c.useSyncedValueWithCleanup(`titleElementId`,l),d(`h2`,e,{ref:t,props:[{id:l},o]})}),ae=()=>{let e=l();return t=>void e({to:`.`,search:e=>({...e,run:t})})};export{X as a,V as c,Z as i,ie as n,U as o,re as r,H as s,ae as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,s as t}from"./useRouter-Hur3RN7j.js";import{I as n,P as r,T as i,k as a,s as o,v as s,y as c}from"./visuallyHidden-BUGCJ1D9.js";import{A as l,R as u,k as d}from"./button-4rhhIcK8.js";import{Dt as f,Gt as p,Yt as m,Zt as h,bt as g,d as _,lt as v,ut as y,vt as b}from"./mark-uyeJ8aPC.js";import{G as x}from"./index-Dki55xSv.js";var S=t(e(),1);function C(e,t={}){let{enabled:n=!0,event:a=`click`,toggle:o=!0,ignoreMouse:l=!1,stickIfOpen:d=!0,touchOpenDelay:m=0,reason:h=s}=t,_=e.context.dataRef,v=S.useRef(void 0),y=r(),x=i(),C=S.useMemo(()=>{function t(t,n,r,i){let a=c(h,n,r);t&&i===`touch`&&m>0?x.start(m,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let i=_.current.openEvent,a=e.select(`domReferenceElement`)!==n;return t&&a||!t||!o?!0:i&&(typeof d==`function`?d():d)?!r(i.type):!1}return{onPointerDown(e){v.current=b(e.pointerType,!0)&&g(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(r){let i=v.current,o=r.nativeEvent,s=e.select(`open`);if(r.button!==0||a===`click`||b(i,!0)&&l)return;let c=n(s,r.currentTarget,e=>e===`click`||e===`mousedown`),u=p(o),d=f(u);if(d||i===`virtual`){t(c,o,d?u:r.currentTarget,i);return}let m=r.currentTarget;y.request(()=>{t(c,o,m,i)})},onClick(r){if(a===`mousedown-only`)return;let i=v.current;a===`mousedown`&&i?v.current=void 0:b(i,!0)&&l||t(n(e.select(`open`),r.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),r.nativeEvent,r.currentTarget,i)},onKeyDown(){v.current=void 0}}},[_,a,l,h,e,d,o,y,x,m]);return S.useMemo(()=>n?{reference:C}:u,[n,C])}function w(e){let t=S.useRef(``),n=S.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:S.useCallback(n=>{n.detail===0?e(n,`keyboard`):(`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``)},[e]),onPointerDown:n}}function T(e,t){let{onClick:n,onPointerDown:r}=w(l((n,r)=>{(typeof e==`function`?e():e)||t(r||(m?`touch`:``))}));return S.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function E(e){let[t,n]=S.useState(null),r=T(e,n);return x(e,t=>{t&&!e&&n(null)}),S.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}var D=t(n(),1);function O(e,t){function n(n,r,i){let a=n.currentTarget;D.flushSync(()=>{e.setOpen(!1,c(o,n.nativeEvent,a))}),v(a.isConnected?a:t.current,r,i)?.focus()}function r(t){n(t,-1,e.select(`positionerElement`))}function i(t){let r=e.select(`positionerElement`);r&&y(t,r)?e.context.beforeContentFocusGuardRef.current?.focus():n(t,1,r)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function k(e){let{store:t,domReference:n,positionerElement:r,open:i}=e,o=S.useRef(null),s=S.useRef(null),c=a(r);d(()=>{i||(s.current?.abort(),s.current=null,t.state.instantType===`trigger-change`&&t.set(`instantType`,void 0))},[i,t]),d(()=>{let e=n,r=o.current;if(e&&(o.current=e),!r||!e||e===r||!t.select(`open`))return;t.set(`instantType`,void 0);let i=new AbortController;return s.current=i,c(()=>{t.select(`open`)&&t.set(`instantType`,`trigger-change`)},i.signal),()=>{i.abort()}},[n,c,t])}var A=20;function j(e,t,n,r){let[i,a]=S.useState(!1);d(()=>{if(!e||!t||n==null){a(!1);return}let r=h(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-A)},[e,t,n]),_(e&&(!t||i),r)}export{T as a,E as i,k as n,C as o,O as r,j as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,s as t}from"./useRouter-Hur3RN7j.js";var n=t(e(),1);function r({controlled:e,default:t,name:r,state:i=`value`}){let{current:a}=n.useRef(e!==void 0),[o,s]=n.useState(()=>t);return[a&&e!==void 0?e:o,n.useCallback(e=>{a||s(e)},[])]}export{r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,s as t}from"./useRouter-Hur3RN7j.js";import{t as n}from"./with-selector-Dwf291_Q.js";var r=t(e(),1),i=n();function a(e,t){return e===t}function o(e,t=e=>e,n){let o=n?.compare??a,s=(0,r.useCallback)(t=>{let{unsubscribe:n}=e.subscribe(t);return n},[e]),c=(0,r.useCallback)(()=>e.get(),[e]);return(0,i.useSyncExternalStoreWithSelector)(s,c,c,t,o)}export{o as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e,o as t,s as n}from"./page-C47YAWAl.js";function r(r,i){return t({...r,enabled:!0,suspense:!0,throwOnError:n,placeholderData:void 0},e,i)}export{r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,i as t,s as n}from"./useRouter-Hur3RN7j.js";import{c as r,o as i}from"./page-C47YAWAl.js";import{A as a,H as o,L as s,R as c,j as l,k as u,z as d}from"./button-4rhhIcK8.js";function f(e,t){return i(e,r,t)}var p=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`})),m=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=p()})),h=n(m(),1),g=n(t(),1);function _(e){g.useEffect(e,s)}var v=null;globalThis.requestAnimationFrame;var y=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)}},b=class e{static create(){return new e}static request(e){return y.request(e)}static cancel(e){return y.cancel(e)}currentId=v;request(e){this.cancel(),this.currentId=y.request(()=>{this.currentId=v,e()})}cancel=()=>{this.currentId!==v&&(y.cancel(this.currentId),this.currentId=v)};disposeEffect=()=>this.cancel};function x(){let e=o(b.create).current;return _(e.disposeEffect),e}function S(e){return e==null?e:`current`in e?e.current:e}function C(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var w=`data-starting-style`,T=`data-ending-style`,E=null;function D(e){if(!E){let e=[];E=e,queueMicrotask(()=>{E=null,h.flushSync(()=>{for(let t of e)t()})})}E.push(e)}function O(e,t=!1,n=!1){let r=x();return a((i,a=null)=>{r.cancel();let o=S(e);if(o==null)return;let s=o,c=()=>{n?D(()=>{a?.aborted||i()}):h.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(C(s).map(e=>e.finished.then(d))).then(()=>{a?.aborted||c()},()=>{a?.aborted||(C(s).some(e=>e.pending||e.playState!==`finished`)?l():c())})}if(t){let e=w;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 k(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:o}=e,s=a(o),c=O(r,n,i);g.useEffect(()=>{if(!t)return;let e=new AbortController;return c(s,e.signal),()=>{e.abort()}},[t,n,s,c])}var A={[w]:``},j={[T]:``},ee={transitionStatus(e){return e===`starting`?A:e===`ending`?j:null}};function te(e,t=!1,n=!1,r=!1){let[i,a]=g.useState(e&&t?`idle`:void 0),[o,s]=g.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),u(()=>{if(!e&&o&&i!==`ending`&&n){let e=b.request(()=>{a(`ending`)});return()=>{b.cancel(e)}}},[e,o,i,n]),u(()=>{if(!e||t||i===void 0)return;let n=b.request(()=>{a(void 0)});return()=>{b.cancel(n)}},[t,e,i]),u(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=b.request(()=>{a(`idle`)});return()=>{b.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}var M=0,N=class e{static create(){return new e}currentId=M;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=M,t()},e)}isStarted(){return this.currentId!==M}clear=()=>{this.currentId!==M&&(clearTimeout(this.currentId),this.currentId=M)};disposeEffect=()=>this.clear};function P(){let e=o(N.create).current;return _(e.disposeEffect),e}function F(){let[,e]=g.useState({});return g.useCallback(()=>{e({})},[])}var I=0;function L(e,t=`mui`){let n=g.useRef(void 0),r=F(),i=e??n.current;return g.useEffect(()=>{n.current??(I+=1,n.current=`${t}-${I}`,e??r())},[e,t,r]),i}var R=l.useId;function z(e,t){if(R!==void 0){let n=R();return e??(t?`${t}-${n}`:n)}return L(e,t)}function B(e){return z(e,`base-ui`)}function V(e,t,n,r){let i=!1,a=!1,o=r??c;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 H(e,t,n){let r=n??c;return{reason:e,event:t??new Event(`base-ui`),...r}}var U=`none`,W=`trigger-press`,G=`trigger-hover`,K=`trigger-focus`,q=`outside-press`,J=`item-press`,Y=`close-press`,X=`focus-out`,Z=`escape-key`,ne=`list-navigation`,re=`keyboard`,ie=`pointer`,ae=`cancel-open`,oe=`sibling-open`,se=`disabled`,Q=`imperative-action`,$={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},ce={...$,position:`fixed`,margin:0,top:0,left:0},le={...$,position:`absolute`};export{T as A,F as C,ee as D,te as E,_ as F,m as I,f as L,S as M,b as N,k as O,x as P,z as S,P as T,G as _,se as a,H as b,Q as c,ne as d,U as f,K as g,oe as h,Y as i,w as j,O as k,J as l,ie as m,le as n,Z as o,q as p,ae as r,X as s,ce as t,re as u,W as v,N as w,B as x,V as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./useRouter-Hur3RN7j.js";import{G as t,T as n,W as r,d as i,l as a,t as o,w as s}from"./section-eyIYzZrG.js";import{t as c}from"./useSuspenseQuery-DbhQN-t-.js";import{O as l,j as u}from"./overview-C73v5kbv.js";import{n as d}from"./useNavigate-AT5VkfZa.js";import{t as f}from"./link-C7GfYrMt.js";import{a as p}from"./strings-DXB6PB2g.js";import{n as m}from"./queries-BZMW2wiD.js";import{t as h}from"./use-now-vNgLntlV.js";import{r as g}from"./status-badge-CLPsMXtK.js";import{a as _,i as v,n as y,o as b,r as x,t as S}from"./table-hbKjhjeL.js";import{t as C}from"./fill-cell-CjksmixH.js";import{t as w}from"./slots-n0NbUO7Z.js";var T=e(),E={passed:{state:`Succeeded`,label:`Passed`},degraded:{state:`Waiting`,label:`Degraded`},deferred:{state:`Deferred`,label:`Deferred`},failed:{state:`Failed`,label:`Failed`}},D=({worker:e})=>{let{state:t,checkedAt:r}=n(e);return t===`unchecked`?(0,T.jsx)(`span`,{className:`text-muted-foreground`,children:`Not checked`}):(0,T.jsxs)(`span`,{className:`inline-flex flex-wrap items-baseline gap-x-2`,children:[(0,T.jsx)(g,{...E[t]}),r!==null&&(0,T.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground tabular-nums`,children:p(r)})]})},O=({worker:e})=>{let n=h(15e3),o=d(),s={worker:e.name};return(0,T.jsxs)(a,{open:()=>void o({to:`/configuration/workers/$worker`,params:s}),children:[(0,T.jsx)(x,{className:`py-3`,children:(0,T.jsx)(f,{to:`/configuration/workers/$worker`,params:s,onClick:e=>e.stopPropagation(),className:i,children:e.name})}),(0,T.jsx)(x,{children:r[e.kind]}),(0,T.jsx)(x,{className:`hidden font-mono text-xs @2xl:table-cell`,children:t(e)}),(0,T.jsx)(x,{className:`tabular-nums`,children:e.slots===null?(0,T.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.maxConcurrentAttempts,` max`]}):(0,T.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,T.jsx)(w,{slots:e.slots}),(0,T.jsxs)(`span`,{className:`max-sm:sr-only`,children:[e.slots.leased,` of `,e.slots.capacity]})]})}),(0,T.jsxs)(C,{className:`whitespace-normal`,children:[(0,T.jsx)(D,{worker:e}),e.provisioning?.blocked===!0&&(0,T.jsxs)(`p`,{className:`text-xs text-destructive tabular-nums`,title:e.provisioning.message,children:[l(e.provisioning),`.`,` `,u(e.provisioning,n)]})]})]})},k=({configuration:e})=>{let t=e.workers.some(({slots:e})=>e!==null);return(0,T.jsxs)(o,{title:`Workers`,createKind:`worker`,counts:s(e.workers.length,`worker`),children:[!t&&(0,T.jsx)(`p`,{className:`text-muted-foreground`,children:`No attempts run until the GitHub App is set up.`}),(0,T.jsx)(`div`,{className:`@container -mx-2`,children:(0,T.jsxs)(S,{children:[(0,T.jsx)(_,{children:(0,T.jsxs)(b,{className:`hover:bg-transparent`,children:[(0,T.jsx)(v,{children:`Worker`}),(0,T.jsx)(v,{children:`Kind`}),(0,T.jsx)(v,{className:`hidden @2xl:table-cell`,children:`Location`}),(0,T.jsx)(v,{children:`Slots in use`}),(0,T.jsx)(v,{children:`Last preflight`})]})}),(0,T.jsx)(y,{children:e.workers.map(e=>(0,T.jsx)(O,{worker:e},e.name))})]})}),e.removedWorkers.length>0&&(0,T.jsx)(`ul`,{className:`flex flex-col gap-1 text-muted-foreground`,children:e.removedWorkers.map(({name:e,running:t})=>(0,T.jsxs)(`li`,{children:[(0,T.jsx)(`span`,{className:`font-mono text-xs text-foreground`,children:e}),` removed by a reload,`,` `,s(t,`attempt`),` still running`]},e))})]})},A=()=>{let{data:e}=c(m());return(0,T.jsx)(k,{configuration:e})};export{A as component};
|
package/dist/web/index.html
CHANGED
|
@@ -5,26 +5,33 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<meta name="theme-color" content="#181825" />
|
|
7
7
|
<title>usine</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-Dki55xSv.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/useRouter-Hur3RN7j.js">
|
|
10
|
+
<link rel="modulepreload" crossorigin href="/assets/strings-DXB6PB2g.js">
|
|
11
|
+
<link rel="modulepreload" crossorigin href="/assets/overview-C73v5kbv.js">
|
|
10
12
|
<link rel="modulepreload" crossorigin href="/assets/button-4rhhIcK8.js">
|
|
11
|
-
<link rel="modulepreload" crossorigin href="/assets/page-
|
|
12
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
13
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
14
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
15
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
16
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
17
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
13
|
+
<link rel="modulepreload" crossorigin href="/assets/page-C47YAWAl.js">
|
|
14
|
+
<link rel="modulepreload" crossorigin href="/assets/error-alert-hABzwCSY.js">
|
|
15
|
+
<link rel="modulepreload" crossorigin href="/assets/visuallyHidden-BUGCJ1D9.js">
|
|
16
|
+
<link rel="modulepreload" crossorigin href="/assets/useSuspenseQuery-DbhQN-t-.js">
|
|
17
|
+
<link rel="modulepreload" crossorigin href="/assets/queries-BZMW2wiD.js">
|
|
18
|
+
<link rel="modulepreload" crossorigin href="/assets/queries-oea_Y4on.js">
|
|
19
|
+
<link rel="modulepreload" crossorigin href="/assets/actions-CG0hkpe7.js">
|
|
18
20
|
<link rel="modulepreload" crossorigin href="/assets/useNavigate-AT5VkfZa.js">
|
|
19
21
|
<link rel="modulepreload" crossorigin href="/assets/matchContext-D_B3XAQH.js">
|
|
20
22
|
<link rel="modulepreload" crossorigin href="/assets/link-C7GfYrMt.js">
|
|
21
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
22
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
23
|
+
<link rel="modulepreload" crossorigin href="/assets/with-selector-Dwf291_Q.js">
|
|
24
|
+
<link rel="modulepreload" crossorigin href="/assets/useSelector-CRBsgquS.js">
|
|
25
|
+
<link rel="modulepreload" crossorigin href="/assets/lazyRouteComponent-BnRF0Crs.js">
|
|
26
|
+
<link rel="modulepreload" crossorigin href="/assets/Match-BsHjCE-9.js">
|
|
23
27
|
<link rel="modulepreload" crossorigin href="/assets/empty-B9bymfss.js">
|
|
24
28
|
<link rel="modulepreload" crossorigin href="/assets/boot-screen-Su4MyrBh.js">
|
|
25
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
26
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
27
|
-
<link rel="
|
|
29
|
+
<link rel="modulepreload" crossorigin href="/assets/preload-helper-BLdHbfdN.js">
|
|
30
|
+
<link rel="modulepreload" crossorigin href="/assets/mark-uyeJ8aPC.js">
|
|
31
|
+
<link rel="modulepreload" crossorigin href="/assets/use-open-run-B8nD_BT1.js">
|
|
32
|
+
<link rel="modulepreload" crossorigin href="/assets/skeleton-87E84B2f.js">
|
|
33
|
+
<link rel="modulepreload" crossorigin href="/assets/route-status-DGpeFNCC.js">
|
|
34
|
+
<link rel="stylesheet" crossorigin href="/assets/index-C_S4sA5L.css">
|
|
28
35
|
</head>
|
|
29
36
|
<body>
|
|
30
37
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usine/server",
|
|
3
|
-
"version": "0.4.1-next.
|
|
3
|
+
"version": "0.4.1-next.264.gfdecd7e",
|
|
4
4
|
"description": "The usine orchestrator as a headless server: a thin CLI over @usine/orchestrator that serves the web UI.",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"repository": {
|
|
@@ -23,19 +23,19 @@
|
|
|
23
23
|
"@effect/platform-node": "4.0.6",
|
|
24
24
|
"@effect/platform-node-shared": "4.0.6",
|
|
25
25
|
"effect": "4.0.6",
|
|
26
|
-
"@usine/
|
|
27
|
-
"@usine/
|
|
28
|
-
"@usine/
|
|
29
|
-
"@usine/
|
|
30
|
-
"@usine/
|
|
31
|
-
"@usine/
|
|
32
|
-
"@usine/
|
|
26
|
+
"@usine/config": "0.4.1-next.264.gfdecd7e",
|
|
27
|
+
"@usine/core": "0.5.1-next.264.gfdecd7e",
|
|
28
|
+
"@usine/expression": "0.4.1-next.264.gfdecd7e",
|
|
29
|
+
"@usine/github": "0.3.1-next.264.gfdecd7e",
|
|
30
|
+
"@usine/durable": "0.2.1-next.264.gfdecd7e",
|
|
31
|
+
"@usine/engine": "0.5.1-next.264.gfdecd7e",
|
|
32
|
+
"@usine/orchestrator": "0.4.1-next.264.gfdecd7e"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"typescript": "7.0.2",
|
|
36
36
|
"vitest": "5.0.5",
|
|
37
37
|
"yaml": "2.9.1",
|
|
38
|
-
"@usine/executor": "0.4.1-next.
|
|
38
|
+
"@usine/executor": "0.4.1-next.264.gfdecd7e",
|
|
39
39
|
"@usine/tsconfig": "0.0.0",
|
|
40
40
|
"@usine/web": "0.0.0"
|
|
41
41
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,s as t}from"./useRouter-Hur3RN7j.js";import{W as n}from"./button-4rhhIcK8.js";var r=t(e(),1),i=new Map([[`bold`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z`}))],[`duotone`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`,opacity:`0.2`}),r.createElement(`path`,{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`fill`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`light`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z`}))],[`regular`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`thin`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z`}))]]),a=r.forwardRef((e,t)=>r.createElement(n,{ref:t,...e,weights:i}));a.displayName=`XIcon`;export{a as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./useRouter-Hur3RN7j.js";import{a as t}from"./page-BuzrT_cg.js";import{n}from"./queries-DPtA2w4k.js";import{l as r}from"./index-C1tcW0Kz.js";import{t as i}from"./agents-DejXWwOW.js";var a=e(),o=()=>{let{agent:e}=r.useParams(),{data:o}=t(n());return(0,a.jsx)(i,{name:e,configuration:o})};export{o as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./useRouter-Hur3RN7j.js";import{a as t}from"./page-BuzrT_cg.js";import{t as n}from"./error-alert-B1wP9JKx.js";import{t as r}from"./link-C7GfYrMt.js";import{n as i,r as a}from"./list-C0Krf4aU.js";import{n as o,nt as s}from"./strings-DONjvHz8.js";import{n as c}from"./queries-DPtA2w4k.js";import{C as l,S as u,St as d,bt as f,c as p,f as m,g as h}from"./index-C1tcW0Kz.js";import{t as g}from"./markdown-BNebzGGH.js";import{t as _}from"./file-error-Befud4JV.js";import{a as v,c as y,i as b,n as x,o as S,r as C,s as w,t as T,u as E}from"./section-DKHXjfWs.js";var D=e(),O=({repository:e})=>{let{owner:t,name:n}=s(e);return(0,D.jsxs)(r,{to:`/configuration/repositories/$owner/$name`,params:{owner:t,name:n},className:`flex w-fit items-center gap-2 text-primary hover:underline`,children:[(0,D.jsx)(f,{repository:e}),e]})},k=({loop:e,configuration:t})=>{let n=t.agents.find(({name:t})=>t===e.agent);return(0,D.jsxs)(v,{children:[(0,D.jsxs)(b,{label:`Agent`,children:[(0,D.jsx)(r,{to:`/configuration/agents/$agent`,params:{agent:e.agent},className:`text-primary hover:underline`,children:e.agent}),n!==void 0&&(0,D.jsx)(`p`,{className:`mt-0.5 font-mono text-xs text-muted-foreground`,children:o(n)})]}),(0,D.jsx)(b,{label:`Repositories`,children:e.repositories.length===0?(0,D.jsx)(E,{children:`No registered repository matches the selector`}):(0,D.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:e.repositories.map(e=>(0,D.jsx)(`li`,{children:(0,D.jsx)(O,{repository:e})},e))})}),(0,D.jsx)(b,{label:`Approval`,children:h[e.approval]}),(0,D.jsxs)(b,{label:`Max cycles`,children:[(0,D.jsx)(`span`,{className:`tabular-nums`,children:e.maxCycles}),` `,(0,D.jsx)(E,{children:`runs per item before a reset`})]}),(0,D.jsx)(b,{label:`Permissions`,children:u[e.permissions]}),(0,D.jsx)(b,{label:`Priority`,children:e.priority===null?(0,D.jsx)(E,{children:`None; runs wait in lane order`}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`span`,{className:`tabular-nums`,children:e.priority}),` `,(0,D.jsx)(E,{children:`queued ahead of runs in lane order`})]})}),(0,D.jsx)(b,{label:`Step`,children:(0,D.jsx)(`code`,{className:`font-mono text-xs`,children:e.step})})]})},A=/\{\{([\s\S]*?)\}\}/gu,j=e=>[...e.matchAll(A)].map(([,e=``])=>e.trim()),M=e=>{let t=e.value??``,n=[],r=0;for(let e of t.matchAll(A))e.index>r&&n.push({type:`text`,value:t.slice(r,e.index)}),n.push({type:`inlineCode`,value:(e[1]??``).trim(),data:{hName:`mark`}}),r=e.index+e[0].length;return n.length===0?[e]:(r<t.length&&n.push({type:`text`,value:t.slice(r)}),n)},N=e=>{e.children!==void 0&&(e.children=e.children.flatMap(e=>e.type===`text`?M(e):(N(e),[e])))},P=()=>N,F=({children:e})=>(0,D.jsx)(`mark`,{className:`bg-transparent p-0 text-inherit`,title:`Filled in from the item when a run opens`,children:(0,D.jsxs)(`code`,{className:`bg-transparent [font-variant-ligatures:none] ring-1 ring-input ring-inset [box-decoration-break:clone]`,children:[(0,D.jsx)(`span`,{className:`text-muted-foreground`,children:`{{\xA0`}),e,(0,D.jsx)(`span`,{className:`text-muted-foreground`,children:`\xA0}}`})]})}),I=({template:e})=>(0,D.jsx)(g,{className:`max-w-[72ch] text-md`,remarkPlugins:[P],components:{mark:F},children:e}),L=e=>[[`on`,e.stream],[`if`,e.condition],...e.cron===null?[]:[[`cron`,e.cron]],...e.timeZone===null?[]:[[`tz`,e.timeZone]]],R=({repos:e,tags:t})=>[...e===null?[]:[[`repos`,e.join(`, `)]],...t===null?[]:[[`tags`,t.join(`, `)]]],z=({loop:e,configuration:t,pause:r})=>{let o=j(e.prompt).length;return(0,D.jsxs)(T,{title:e.name,marks:(0,D.jsx)(a,{paused:e.paused}),file:e.file,actions:r!==null&&(0,D.jsx)(i,{loop:e,pause:r,variant:`outline`}),children:[r?.isError===!0&&(0,D.jsx)(n,{message:r.error.message}),(0,D.jsxs)(x,{facts:(0,D.jsx)(k,{loop:e,configuration:t}),children:[(0,D.jsxs)(C,{title:`Trigger`,children:[(0,D.jsx)(S,{entries:L(e)}),e.undeclaredLabels.length>0&&(0,D.jsxs)(`p`,{className:`flex items-start gap-1.5 text-xs text-muted-foreground`,children:[(0,D.jsx)(d,{weight:`fill`,className:`mt-0.5 size-3 shrink-0 text-warning`}),(0,D.jsxs)(`span`,{children:[`Condition uses`,` `,e.undeclaredLabels.length===1?`an undeclared label`:`undeclared labels`,`:`,` `,e.undeclaredLabels.join(`, `),`. usine creates only the labels under`,` `,(0,D.jsx)(`code`,{children:`labels`}),` in `,(0,D.jsx)(`code`,{children:`usine.yaml`}),`.`]})]})]}),(0,D.jsx)(C,{title:`Selector`,children:e.selector===null?(0,D.jsx)(`p`,{className:`text-muted-foreground`,children:`No selector: every registered repository`}):(0,D.jsx)(S,{entries:R(e.selector)})}),(0,D.jsx)(C,{title:`Prompt`,aside:o===0?`Same text for every run`:`${l(o,`outlined expression`)} filled in from each item`,children:(0,D.jsx)(I,{template:e.prompt})})]})]})},B=({name:e,configuration:t,pause:n})=>{let i=t.loops.find(t=>t.name===e);if(i!==void 0)return(0,D.jsx)(z,{loop:i,configuration:t,pause:n});let a=t.quarantinedLoops.find(t=>t.name===e);return a===void 0?(0,D.jsx)(T,{title:e,children:(0,D.jsxs)(w,{title:`Loop not found`,children:[`The configuration has no file `,(0,D.jsxs)(`code`,{children:[`loops/`,e,`.md`]}),`.`,` `,(0,D.jsx)(r,{to:`/configuration/loops`,className:`text-primary hover:underline`,children:`See all loops`}),`.`]})}):(0,D.jsx)(T,{title:a.name,marks:(0,D.jsx)(y,{}),file:a.file,children:(0,D.jsx)(_,{error:a.error,consequence:`No runs until the file loads.`})})},V=()=>{let{loop:e}=p.useParams(),{data:n}=t(c());return(0,D.jsx)(B,{name:e,configuration:n,pause:m()})};export{V as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./useRouter-Hur3RN7j.js";import{a as t}from"./page-BuzrT_cg.js";import{r as n}from"./overview-CVIU9T_Q.js";import{t as r}from"./link-C7GfYrMt.js";import{n as i}from"./queries-DPtA2w4k.js";import{bt as a,o}from"./index-C1tcW0Kz.js";import{a as s,i as c,n as l,o as u,r as d,t as f}from"./table-hbKjhjeL.js";import{t as p}from"./fill-cell-CjksmixH.js";import{a as m,i as h,n as g,r as _,s as v,t as y,u as b}from"./section-DKHXjfWs.js";import{n as x,t as S}from"./label-badge-nrvxD46n.js";import{t as C}from"./repositories-D4wYJfa_.js";var w=e(),T=({label:e})=>e.failure===null?e.onGitHub===!1?(0,w.jsxs)(`span`,{className:`text-destructive`,children:[`Missing on GitHub`,e.declared?`, created at the next poll`:``]}):null:(0,w.jsx)(`span`,{className:`text-destructive`,children:e.failure.message}),E=({source:e})=>e._tag===`Label`?(0,w.jsxs)(`span`,{className:`inline-flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,w.jsx)(S,{name:e.label.name,label:e.label}),(0,w.jsx)(`span`,{className:`text-xs`,children:(0,w.jsx)(T,{label:e.label})})]}):(0,w.jsx)(x,{variant:`outline`,className:`text-muted-foreground`,children:e.state}),D=({repository:e})=>(0,w.jsx)(`div`,{className:`-mx-2`,children:(0,w.jsxs)(f,{children:[(0,w.jsx)(s,{children:(0,w.jsxs)(u,{className:`hover:bg-transparent`,children:[(0,w.jsx)(c,{className:`text-right`,children:`#`}),(0,w.jsx)(c,{children:`Lane`}),(0,w.jsx)(c,{children:`Items with`})]})}),(0,w.jsx)(l,{children:e.lanes.map((e,t)=>(0,w.jsxs)(u,{className:`hover:bg-transparent`,children:[(0,w.jsx)(d,{className:`py-3 text-right align-top font-mono text-xs text-muted-foreground tabular-nums`,children:t+1}),(0,w.jsx)(d,{className:`py-3 align-top font-medium`,children:e.name}),(0,w.jsx)(p,{className:`py-3 whitespace-normal`,children:(0,w.jsx)(`ul`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1.5`,children:e.sources.map(e=>(0,w.jsx)(`li`,{children:(0,w.jsx)(E,{source:e})},e._tag===`Label`?e.label.name:e.state))})})]},e.name))})]})}),O=({repository:e})=>(0,w.jsxs)(m,{children:[(0,w.jsx)(h,{label:`Board`,children:(0,w.jsx)(r,{to:`/projects/$owner/$name`,params:n(e.name),className:`text-primary hover:underline`,children:`Open the board`})}),(0,w.jsx)(h,{label:`Tags`,children:e.tags.length===0?(0,w.jsx)(b,{children:`None`}):e.tags.join(`, `)}),(0,w.jsx)(h,{label:`Loops`,children:e.loops.length===0?(0,w.jsx)(b,{children:`Not selected by any loop`}):(0,w.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:e.loops.map(e=>(0,w.jsx)(`li`,{children:(0,w.jsx)(r,{to:`/configuration/loops/$loop`,params:{loop:e},className:`text-primary hover:underline`,children:e})},e))})})]}),k=({owner:e,name:t,configuration:n})=>{let i=`${e}/${t}`,o=n.repositories.find(e=>e.name.toLowerCase()===i.toLowerCase());return o===void 0?(0,w.jsx)(y,{title:i,children:(0,w.jsxs)(v,{title:`Repository not registered`,children:[i,` is not under `,(0,w.jsx)(`code`,{children:`repos`}),` in `,(0,w.jsx)(`code`,{children:`usine.yaml`}),`.`,` `,(0,w.jsx)(r,{to:`/configuration/repositories`,className:`text-primary hover:underline`,children:`See all repositories`}),`.`]})}):(0,w.jsx)(y,{title:o.name,leading:(0,w.jsx)(a,{repository:o.name,size:`title`}),children:(0,w.jsxs)(g,{facts:(0,w.jsx)(O,{repository:o}),children:[(0,w.jsxs)(_,{title:`Lanes`,aside:o.lanes.length===0?void 0:`In board order, as listed in repos[].lanes`,children:[[...o.declaredLabels,...C(o)].some(({onGitHub:e})=>e===null)&&(0,w.jsx)(`p`,{className:`text-muted-foreground`,children:`Labels not polled yet. Whether each label is on GitHub shows after the first poll.`}),o.lanes.length===0?(0,w.jsxs)(`p`,{className:`max-w-[72ch] text-muted-foreground`,children:[(0,w.jsx)(`code`,{children:`usine.yaml`}),` has no lanes for this repository. The board shows lanes proposed from the repository labels, and cards cannot be moved. To move cards, add lanes under `,(0,w.jsx)(`code`,{children:`repos[].lanes`}),`.`]}):(0,w.jsx)(D,{repository:o})]}),(0,w.jsx)(_,{title:`Labels usine creates`,aside:`From labels in usine.yaml`,children:o.declaredLabels.length===0?(0,w.jsxs)(`p`,{className:`text-muted-foreground`,children:[`No labels under `,(0,w.jsx)(`code`,{children:`labels`}),` in `,(0,w.jsx)(`code`,{children:`usine.yaml`}),`.`]}):(0,w.jsx)(`ul`,{className:`flex flex-col gap-2`,children:o.declaredLabels.map(e=>(0,w.jsxs)(`li`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,w.jsx)(S,{name:e.name,label:e}),(0,w.jsx)(`span`,{className:`text-xs`,children:e.onGitHub===!0&&e.failure===null?(0,w.jsx)(b,{children:`On GitHub`}):(0,w.jsx)(T,{label:e})})]},e.name))})})]})})},A=()=>{let{owner:e,name:n}=o.useParams(),{data:r}=t(i());return(0,w.jsx)(k,{owner:e,name:n,configuration:r})};export{A as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{W as e}from"./index-C1tcW0Kz.js";var t=e;export{t as errorComponent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./useRouter-Hur3RN7j.js";import{Ot as t}from"./index-C1tcW0Kz.js";var n=e(),r=()=>(0,n.jsx)(t,{});export{r as component};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{i as e,r as t,s as n}from"./useRouter-Hur3RN7j.js";import{a as r,i}from"./page-BuzrT_cg.js";import{t as a}from"./error-alert-B1wP9JKx.js";import{i as o,n as s,t as c}from"./queries-CMOWVU8o.js";import{C as l,b as u,g as d,n as f,r as p,x as m,y as h}from"./overview-CVIU9T_Q.js";import{t as g}from"./link-C7GfYrMt.js";import{p as _}from"./useTimeout-BC05Ghyu.js";import{a as v,i as y,n as b,o as x,r as S,s as C,t as w}from"./moves-BP3lsIkJ.js";import{a as ee,c as T,d as E,i as D,l as O,n as te,o as ne,r as k,s as A,t as re,u as ie}from"./dropdown-menu-BuVimdT5.js";import{D as j,W as ae,t as M}from"./button-4rhhIcK8.js";import{V as oe,f as N,s as se}from"./strings-DONjvHz8.js";import{$ as P,Q as F,X as I,Y as ce,Z as L,a as le,at as ue,bt as de,et as R,it as fe,kt as pe,nt as me,ot as he,rt as ge,tt as _e}from"./index-C1tcW0Kz.js";import{t as z}from"./use-now-vNgLntlV.js";import{n as B,r as ve,t as ye}from"./status-badge-CLPsMXtK.js";import{a as V,i as H,n as be,o as xe,r as U,t as Se}from"./table-hbKjhjeL.js";import{n as Ce,t as we}from"./label-badge-nrvxD46n.js";import{t as Te}from"./action-D59leH3d.js";import{f as Ee,o as De,u as Oe}from"./model-CYcw80ka.js";import{n as ke,t as Ae}from"./strings-skTeG228.js";import{t as je}from"./project-not-found-CutZoVCI.js";var W=n(e(),1),Me=new Map([[`bold`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M204,64V168a12,12,0,0,1-24,0V93L72.49,200.49a12,12,0,0,1-17-17L163,76H88a12,12,0,0,1,0-24H192A12,12,0,0,1,204,64Z`}))],[`duotone`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M192,64V168L88,64Z`,opacity:`0.2`}),W.createElement(`path`,{d:`M192,56H88a8,8,0,0,0-5.66,13.66L128.69,116,58.34,186.34a8,8,0,0,0,11.32,11.32L140,127.31l46.34,46.35A8,8,0,0,0,200,168V64A8,8,0,0,0,192,56Zm-8,92.69-38.34-38.34h0L107.31,72H184Z`}))],[`fill`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M200,64V168a8,8,0,0,1-13.66,5.66L140,127.31,69.66,197.66a8,8,0,0,1-11.32-11.32L128.69,116,82.34,69.66A8,8,0,0,1,88,56H192A8,8,0,0,1,200,64Z`}))],[`light`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M198,64V168a6,6,0,0,1-12,0V78.48L68.24,196.24a6,6,0,0,1-8.48-8.48L177.52,70H88a6,6,0,0,1,0-12H192A6,6,0,0,1,198,64Z`}))],[`regular`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M200,64V168a8,8,0,0,1-16,0V83.31L69.66,197.66a8,8,0,0,1-11.32-11.32L172.69,72H88a8,8,0,0,1,0-16H192A8,8,0,0,1,200,64Z`}))],[`thin`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M196,64V168a4,4,0,0,1-8,0V73.66L66.83,194.83a4,4,0,0,1-5.66-5.66L182.34,68H88a4,4,0,0,1,0-8H192A4,4,0,0,1,196,64Z`}))]]),Ne=new Map([[`bold`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M140,40V216a12,12,0,0,1-24,0V40a12,12,0,0,1,24,0ZM64.49,87.51a12,12,0,0,0-17,17L59,116H16a12,12,0,0,0,0,24H59L47.51,151.51a12,12,0,0,0,17,17l32-32a12,12,0,0,0,0-17ZM240,116H197l11.52-11.51a12,12,0,0,0-17-17l-32,32a12,12,0,0,0,0,17l32,32a12,12,0,0,0,17-17L197,140h43a12,12,0,0,0,0-24Z`}))],[`duotone`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M240,56V200a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V56A16,16,0,0,1,32,40H224A16,16,0,0,1,240,56Z`,opacity:`0.2`}),W.createElement(`path`,{d:`M136,40V216a8,8,0,0,1-16,0V40a8,8,0,0,1,16,0ZM69.66,90.34a8,8,0,0,0-11.32,11.32L76.69,120H16a8,8,0,0,0,0,16H76.69L58.34,154.34a8,8,0,0,0,11.32,11.32l32-32a8,8,0,0,0,0-11.32ZM240,120H179.31l18.35-18.34a8,8,0,0,0-11.32-11.32l-32,32a8,8,0,0,0,0,11.32l32,32a8,8,0,0,0,11.32-11.32L179.31,136H240a8,8,0,0,0,0-16Z`}))],[`fill`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M101.66,122.34a8,8,0,0,1,0,11.32l-32,32A8,8,0,0,1,56,160V136H16a8,8,0,0,1,0-16H56V96a8,8,0,0,1,13.66-5.66ZM240,120H200V96a8,8,0,0,0-13.66-5.66l-32,32a8,8,0,0,0,0,11.32l32,32A8,8,0,0,0,200,160V136h40a8,8,0,0,0,0-16ZM128,32a8,8,0,0,0-8,8V216a8,8,0,0,0,16,0V40A8,8,0,0,0,128,32Z`}))],[`light`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M134,40V216a6,6,0,0,1-12,0V40a6,6,0,0,1,12,0ZM68.24,91.76a6,6,0,0,0-8.48,8.48L81.51,122H16a6,6,0,0,0,0,12H81.51L59.76,155.76a6,6,0,1,0,8.48,8.48l32-32a6,6,0,0,0,0-8.48ZM240,122H174.49l21.75-21.76a6,6,0,0,0-8.48-8.48l-32,32a6,6,0,0,0,0,8.48l32,32a6,6,0,0,0,8.48-8.48L174.49,134H240a6,6,0,0,0,0-12Z`}))],[`regular`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M136,40V216a8,8,0,0,1-16,0V40a8,8,0,0,1,16,0ZM69.66,90.34a8,8,0,0,0-11.32,11.32L76.69,120H16a8,8,0,0,0,0,16H76.69L58.34,154.34a8,8,0,0,0,11.32,11.32l32-32a8,8,0,0,0,0-11.32ZM240,120H179.31l18.35-18.34a8,8,0,0,0-11.32-11.32l-32,32a8,8,0,0,0,0,11.32l32,32a8,8,0,0,0,11.32-11.32L179.31,136H240a8,8,0,0,0,0-16Z`}))],[`thin`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M132,40V216a4,4,0,0,1-8,0V40a4,4,0,0,1,8,0ZM66.83,93.17a4,4,0,0,0-5.66,5.66L86.34,124H16a4,4,0,0,0,0,8H86.34L61.17,157.17a4,4,0,0,0,5.66,5.66l32-32a4,4,0,0,0,0-5.66ZM240,124H169.66l25.17-25.17a4,4,0,1,0-5.66-5.66l-32,32a4,4,0,0,0,0,5.66l32,32a4,4,0,0,0,5.66-5.66L169.66,132H240a4,4,0,0,0,0-8Z`}))]]),Pe=W.forwardRef((e,t)=>W.createElement(ae,{ref:t,...e,weights:Me}));Pe.displayName=`ArrowUpRightIcon`;var Fe=W.forwardRef((e,t)=>W.createElement(ae,{ref:t,...e,weights:Ne}));Fe.displayName=`ArrowsInLineHorizontalIcon`;var Ie=n(_());function Le(){var e=[...arguments];return(0,W.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var Re=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function ze(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function Be(e){return`nodeType`in e}function G(e){return e?ze(e)?e:Be(e)?e.ownerDocument?.defaultView??window:window:window}function Ve(e){let{Document:t}=G(e);return e instanceof t}function He(e){return!ze(e)&&e instanceof G(e).HTMLElement}function Ue(e){return e instanceof G(e).SVGElement}function We(e){return e?ze(e)?e.document:Be(e)?Ve(e)?e:He(e)||Ue(e)?e.ownerDocument:document:document:document}var K=Re?W.useLayoutEffect:W.useEffect;function Ge(e){let t=(0,W.useRef)(e);return K(()=>{t.current=e}),(0,W.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function Ke(){let e=(0,W.useRef)(null);return[(0,W.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,W.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function qe(e,t){t===void 0&&(t=[e]);let n=(0,W.useRef)(e);return K(()=>{n.current!==e&&(n.current=e)},t),n}function Je(e,t){let n=(0,W.useRef)();return(0,W.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function Ye(e){let t=Ge(e),n=(0,W.useRef)(null);return[n,(0,W.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function Xe(e){let t=(0,W.useRef)();return(0,W.useEffect)(()=>{t.current=e},[e]),t.current}var Ze={};function Qe(e,t){return(0,W.useMemo)(()=>{if(t)return t;let n=Ze[e]==null?0:Ze[e]+1;return Ze[e]=n,e+`-`+n},[e,t])}function $e(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var et=$e(1),tt=$e(-1);function nt(e){return`clientX`in e&&`clientY`in e}function rt(e){if(!e)return!1;let{KeyboardEvent:t}=G(e.target);return t&&e instanceof t}function it(e){if(!e)return!1;let{TouchEvent:t}=G(e.target);return t&&e instanceof t}function at(e){if(it(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return nt(e)?{x:e.clientX,y:e.clientY}:null}var q=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[q.Translate.toString(e),q.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),ot=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function st(e){return e.matches(ot)?e:e.querySelector(ot)}var ct={display:`none`};function lt(e){let{id:t,value:n}=e;return W.createElement(`div`,{id:t,style:ct},n)}function ut(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return W.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function dt(){let[e,t]=(0,W.useState)(``);return{announce:(0,W.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var ft=(0,W.createContext)(null);function pt(e){let t=(0,W.useContext)(ft);(0,W.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function mt(){let[e]=(0,W.useState)(()=>new Set),t=(0,W.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,W.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var ht={draggable:`
|
|
2
|
-
To pick up a draggable item, press the space bar.
|
|
3
|
-
While dragging, use the arrow keys to move the item.
|
|
4
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
5
|
-
`},gt={onDragStart(e){let{active:t}=e;return`Picked up draggable item `+t.id+`.`},onDragOver(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was moved over droppable area `+n.id+`.`:`Draggable item `+t.id+` is no longer over a droppable area.`},onDragEnd(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was dropped over droppable area `+n.id:`Draggable item `+t.id+` was dropped.`},onDragCancel(e){let{active:t}=e;return`Dragging was cancelled. Draggable item `+t.id+` was dropped.`}};function _t(e){let{announcements:t=gt,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=ht}=e,{announce:a,announcement:o}=dt(),s=Qe(`DndLiveRegion`),[c,l]=(0,W.useState)(!1);if((0,W.useEffect)(()=>{l(!0)},[]),pt((0,W.useMemo)(()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&a(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;a(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;a(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;a(t.onDragCancel({active:n,over:r}))}}),[a,t])),!c)return null;let u=W.createElement(W.Fragment,null,W.createElement(lt,{id:r,value:i.draggable}),W.createElement(ut,{id:s,announcement:o}));return n?(0,Ie.createPortal)(u,n):u}var J;(function(e){e.DragStart=`dragStart`,e.DragMove=`dragMove`,e.DragEnd=`dragEnd`,e.DragCancel=`dragCancel`,e.DragOver=`dragOver`,e.RegisterDroppable=`registerDroppable`,e.SetDroppableDisabled=`setDroppableDisabled`,e.UnregisterDroppable=`unregisterDroppable`})(J||={});function vt(){}function yt(e,t){return(0,W.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}function bt(){var e=[...arguments];return(0,W.useMemo)(()=>[...e].filter(e=>e!=null),[...e])}var Y=Object.freeze({x:0,y:0});function xt(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function St(e,t){let n=at(e);if(!n)return`0 0`;let r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+`% `+r.y+`%`}function Ct(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function wt(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Tt(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function Et(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}var Dt=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=Tt(t),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=Tt(r),o=i.reduce((e,t,r)=>e+xt(n[r],t),0),s=Number((o/4).toFixed(4));a.push({id:t,data:{droppableContainer:e,value:s}})}}return a.sort(Ct)};function Ot(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-r,s=a-n;if(r<i&&n<a){let n=t.width*t.height,r=e.width*e.height,i=o*s,a=i/(n+r-i);return Number(a.toFixed(4))}return 0}var kt=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=[];for(let e of r){let{id:r}=e,a=n.get(r);if(a){let n=Ot(a,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(wt)};function At(e,t){let{top:n,left:r,bottom:i,right:a}=t;return n<=e.y&&e.y<=i&&r<=e.x&&e.x<=a}var jt=e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:r}=e;if(!r)return[];let i=[];for(let e of t){let{id:t}=e,a=n.get(t);if(a&&At(r,a)){let n=Tt(a).reduce((e,t)=>e+xt(r,t),0),o=Number((n/4).toFixed(4));i.push({id:t,data:{droppableContainer:e,value:o}})}}return i.sort(Ct)};function Mt(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Nt(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Y}function Pt(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}var Ft=Pt(1);function It(e){if(e.startsWith(`matrix3d(`)){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith(`matrix(`)){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Lt(e,t,n){let r=It(t);if(!r)return e;let{scaleX:i,scaleY:a,x:o,y:s}=r,c=e.left-o-(1-i)*parseFloat(n),l=e.top-s-(1-a)*parseFloat(n.slice(n.indexOf(` `)+1)),u=i?e.width/i:e.width,d=a?e.height/a:e.height;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c}}var Rt={ignoreTransform:!1};function zt(e,t){t===void 0&&(t=Rt);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=G(e).getComputedStyle(e);t&&(n=Lt(n,t,r))}let{top:r,left:i,width:a,height:o,bottom:s,right:c}=n;return{top:r,left:i,width:a,height:o,bottom:s,right:c}}function Bt(e){return zt(e,{ignoreTransform:!0})}function Vt(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Ht(e,t){return t===void 0&&(t=G(e).getComputedStyle(e)),t.position===`fixed`}function Ut(e,t){t===void 0&&(t=G(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return[`overflow`,`overflowX`,`overflowY`].some(e=>{let r=t[e];return typeof r==`string`&&n.test(r)})}function Wt(e,t){let n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(Ve(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!He(i)||Ue(i)||n.includes(i))return n;let a=G(e).getComputedStyle(i);return i!==e&&Ut(i,a)&&n.push(i),Ht(i,a)?n:r(i.parentNode)}return e?r(e):n}function Gt(e){let[t]=Wt(e,1);return t??null}function Kt(e){return!Re||!e?null:ze(e)?e:Be(e)?Ve(e)||e===We(e).scrollingElement?window:He(e)?e:null:null}function qt(e){return ze(e)?e.scrollX:e.scrollLeft}function Jt(e){return ze(e)?e.scrollY:e.scrollTop}function Yt(e){return{x:qt(e),y:Jt(e)}}var X;(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(X||={});function Xt(e){return!Re||!e?!1:e===document.scrollingElement}function Zt(e){let t={x:0,y:0},n=Xt(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}var Qt={x:.2,y:.2};function $t(e,t,n,r,i){let{top:a,left:o,right:s,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=Qt);let{isTop:l,isBottom:u,isLeft:d,isRight:f}=Zt(e),p={x:0,y:0},m={x:0,y:0},h={height:t.height*i.y,width:t.width*i.x};return!l&&a<=t.top+h.height?(p.y=X.Backward,m.y=r*Math.abs((t.top+h.height-a)/h.height)):!u&&c>=t.bottom-h.height&&(p.y=X.Forward,m.y=r*Math.abs((t.bottom-h.height-c)/h.height)),!f&&s>=t.right-h.width?(p.x=X.Forward,m.x=r*Math.abs((t.right-h.width-s)/h.width)):!d&&o<=t.left+h.width&&(p.x=X.Backward,m.x=r*Math.abs((t.left+h.width-o)/h.width)),{direction:p,speed:m}}function en(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function tn(e){return e.reduce((e,t)=>et(e,Yt(t)),Y)}function nn(e){return e.reduce((e,t)=>e+qt(t),0)}function rn(e){return e.reduce((e,t)=>e+Jt(t),0)}function an(e,t){if(t===void 0&&(t=zt),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);Gt(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var on=[[`x`,[`left`,`right`],nn],[`y`,[`top`,`bottom`],rn]],sn=class{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let n=Wt(t),r=tn(n);this.rect={...e},this.width=e.width,this.height=e.height;for(let[e,t,i]of on)for(let a of t)Object.defineProperty(this,a,{get:()=>{let t=i(n),o=r[e]-t;return this.rect[a]+o},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}},cn=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>this.target?.removeEventListener(...e))},this.target=e}add(e,t,n){var r;(r=this.target)==null||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}};function ln(e){let{EventTarget:t}=G(e);return e instanceof t?e:We(e)}function un(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t==`number`?Math.sqrt(n**2+r**2)>t:`x`in t&&`y`in t?n>t.x&&r>t.y:`x`in t?n>t.x:`y`in t&&r>t.y}var Z;(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(Z||={});function dn(e){e.preventDefault()}function fn(e){e.stopPropagation()}var Q;(function(e){e.Space=`Space`,e.Down=`ArrowDown`,e.Right=`ArrowRight`,e.Left=`ArrowLeft`,e.Up=`ArrowUp`,e.Esc=`Escape`,e.Enter=`Enter`,e.Tab=`Tab`})(Q||={});var pn={start:[Q.Space,Q.Enter],cancel:[Q.Esc],end:[Q.Space,Q.Enter,Q.Tab]},mn=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Q.Right:return{...n,x:n.x+25};case Q.Left:return{...n,x:n.x-25};case Q.Down:return{...n,y:n.y+25};case Q.Up:return{...n,y:n.y-25}}},hn=class{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:t}}=e;this.props=e,this.listeners=new cn(We(t)),this.windowListeners=new cn(G(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Z.Resize,this.handleCancel),this.windowListeners.add(Z.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Z.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&an(n),t(Y)}handleKeyDown(e){if(rt(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=pn,coordinateGetter:a=mn,scrollBehavior:o=`smooth`}=r,{code:s}=e;if(i.end.includes(s)){this.handleEnd(e);return}if(i.cancel.includes(s)){this.handleCancel(e);return}let{collisionRect:c}=n.current,l=c?{x:c.left,y:c.top}:Y;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=tt(u,l),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(let n of i){let i=e.code,{isTop:a,isRight:s,isLeft:c,isBottom:l,maxScroll:d,minScroll:f}=Zt(n),p=en(n),m={x:Math.min(i===Q.Right?p.right-p.width/2:p.right,Math.max(i===Q.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===Q.Down?p.bottom-p.height/2:p.bottom,Math.max(i===Q.Down?p.top:p.top+p.height/2,u.y))},h=i===Q.Right&&!s||i===Q.Left&&!c,g=i===Q.Down&&!l||i===Q.Up&&!a;if(h&&m.x!==u.x){let e=n.scrollLeft+t.x,a=i===Q.Right&&e<=d.x||i===Q.Left&&e>=f.x;if(a&&!t.y){n.scrollTo({left:e,behavior:o});return}r.x=a?n.scrollLeft-e:i===Q.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:o});break}if(g&&m.y!==u.y){let e=n.scrollTop+t.y,a=i===Q.Down&&e<=d.y||i===Q.Up&&e>=f.y;if(a&&!t.x){n.scrollTo({top:e,behavior:o});return}r.y=a?n.scrollTop-e:i===Q.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,et(tt(u,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};hn.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=pn,onActivation:i}=t,{active:a}=n,{code:o}=e.nativeEvent;if(r.start.includes(o)){let t=a.activatorNode.current;return t&&e.target!==t?!1:(e.preventDefault(),i?.({event:e.nativeEvent}),!0)}return!1}}];function gn(e){return!!(e&&`distance`in e)}function _n(e){return!!(e&&`delay`in e)}var vn=class{constructor(e,t,n){n===void 0&&(n=ln(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;let{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=We(i),this.documentListeners=new cn(this.document),this.listeners=new cn(n),this.windowListeners=new cn(G(i)),this.initialCoordinates=at(r)??Y,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(Z.Resize,this.handleCancel),this.windowListeners.add(Z.DragStart,dn),this.windowListeners.add(Z.VisibilityChange,this.handleCancel),this.windowListeners.add(Z.ContextMenu,dn),this.documentListeners.add(Z.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(_n(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(gn(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(Z.Click,fn,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Z.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){let{activated:t,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;let o=at(e)??Y,s=tt(n,o);if(!t&&a){if(gn(a)){if(a.tolerance!=null&&un(s,a.tolerance))return this.handleCancel();if(un(s,a.distance))return this.handleStart()}if(_n(a)&&un(s,a.tolerance))return this.handleCancel();this.handlePending(a,s)}else e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===Q.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},yn={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},bn=class extends vn{constructor(e){let{event:t}=e,n=We(t.target);super(e,yn,n)}};bn.activators=[{eventName:`onPointerDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];var xn={move:{name:`mousemove`},end:{name:`mouseup`}},Sn;(function(e){e[e.RightClick=2]=`RightClick`})(Sn||={});var Cn=class extends vn{constructor(e){super(e,xn,We(e.event.target))}};Cn.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==Sn.RightClick&&(r?.({event:n}),!0)}}];var wn={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},Tn=class extends vn{constructor(e){super(e,wn)}static setup(){return window.addEventListener(wn.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(wn.move.name,e)};function e(){}}};Tn.activators=[{eventName:`onTouchStart`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:i}=n;return i.length>1?!1:(r?.({event:n}),!0)}}];var En;(function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`})(En||={});var Dn;(function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`})(Dn||={});function On(e){let{acceleration:t,activator:n=En.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:o=5,order:s=Dn.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:u,delta:d,threshold:f}=e,p=An({delta:d,disabled:!a}),[m,h]=Ke(),g=(0,W.useRef)({x:0,y:0}),_=(0,W.useRef)({x:0,y:0}),v=(0,W.useMemo)(()=>{switch(n){case En.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case En.DraggableRect:return i}},[n,i,c]),y=(0,W.useRef)(null),b=(0,W.useCallback)(()=>{let e=y.current;if(!e)return;let t=g.current.x*_.current.x,n=g.current.y*_.current.y;e.scrollBy(t,n)},[]),x=(0,W.useMemo)(()=>s===Dn.TreeOrder?[...l].reverse():l,[s,l]);(0,W.useEffect)(()=>{if(!a||!l.length||!v)h();else{for(let e of x){if(r?.(e)===!1)continue;let n=l.indexOf(e),i=u[n];if(!i)continue;let{direction:a,speed:s}=$t(e,i,v,t,f);for(let e of[`x`,`y`])p[e][a[e]]||(s[e]=0,a[e]=0);if(s.x>0||s.y>0){h(),y.current=e,m(b,o),g.current=s,_.current=a;return}}g.current={x:0,y:0},_.current={x:0,y:0},h()}},[t,b,r,h,a,o,JSON.stringify(v),JSON.stringify(p),m,l,x,u,JSON.stringify(f)])}var kn={x:{[X.Backward]:!1,[X.Forward]:!1},y:{[X.Backward]:!1,[X.Forward]:!1}};function An(e){let{delta:t,disabled:n}=e,r=Xe(t);return Je(e=>{if(n||!r||!e)return kn;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[X.Backward]:e.x[X.Backward]||i.x===-1,[X.Forward]:e.x[X.Forward]||i.x===1},y:{[X.Backward]:e.y[X.Backward]||i.y===-1,[X.Forward]:e.y[X.Forward]||i.y===1}}},[n,t,r])}function jn(e,t){let n=t==null?void 0:e.get(t),r=n?n.node.current:null;return Je(e=>t==null?null:r??e??null,[r,t])}function Mn(e,t){return(0,W.useMemo)(()=>e.reduce((e,n)=>{let{sensor:r}=n,i=r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}));return[...e,...i]},[]),[e,t])}var Nn;(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(Nn||={});var Pn;(function(e){e.Optimized=`optimized`})(Pn||={});var Fn=new Map;function In(e,t){let{dragging:n,dependencies:r,config:i}=t,[a,o]=(0,W.useState)(null),{frequency:s,measure:c,strategy:l}=i,u=(0,W.useRef)(e),d=g(),f=qe(d),p=(0,W.useCallback)(function(e){e===void 0&&(e=[]),!f.current&&o(t=>t===null?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),m=(0,W.useRef)(null),h=Je(t=>{if(d&&!n)return Fn;if(!t||t===Fn||u.current!==e||a!=null){let t=new Map;for(let n of e){if(!n)continue;if(a&&a.length>0&&!a.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}let e=n.node.current,r=e?new sn(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,a,n,d,c]);return(0,W.useEffect)(()=>{u.current=e},[e]),(0,W.useEffect)(()=>{d||p()},[n,d]),(0,W.useEffect)(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),(0,W.useEffect)(()=>{d||typeof s!=`number`||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},s))},[s,d,p,...r]),{droppableRects:h,measureDroppableContainers:p,measuringScheduled:a!=null};function g(){switch(l){case Nn.Always:return!1;case Nn.BeforeDragging:return n;default:return!n}}}function Ln(e,t){return Je(n=>e?n||(typeof t==`function`?t(e):e):null,[t,e])}function Rn(e,t){return Ln(e,t)}function zn(e){let{callback:t,disabled:n}=e,r=Ge(t),i=(0,W.useMemo)(()=>{if(n||typeof window>`u`||window.MutationObserver===void 0)return;let{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,W.useEffect)(()=>()=>i?.disconnect(),[i]),i}function Bn(e){let{callback:t,disabled:n}=e,r=Ge(t),i=(0,W.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,W.useEffect)(()=>()=>i?.disconnect(),[i]),i}function Vn(e){return new sn(zt(e),e)}function Hn(e,t,n){t===void 0&&(t=Vn);let[r,i]=(0,W.useState)(null);function a(){i(r=>{if(!e)return null;if(e.isConnected===!1)return r??n??null;let i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}let o=zn({callback(t){if(e)for(let n of t){let{type:t,target:r}=n;if(t===`childList`&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),s=Bn({callback:a});return K(()=>{a(),e?(s?.observe(e),o?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),o?.disconnect())},[e]),r}function Un(e){return Nt(e,Ln(e))}var Wn=[];function Gn(e){let t=(0,W.useRef)(e),n=Je(n=>e?n&&n!==Wn&&e&&t.current&&e.parentNode===t.current.parentNode?n:Wt(e):Wn,[e]);return(0,W.useEffect)(()=>{t.current=e},[e]),n}function Kn(e){let[t,n]=(0,W.useState)(null),r=(0,W.useRef)(e),i=(0,W.useCallback)(e=>{let t=Kt(e.target);t&&n(e=>e?(e.set(t,Yt(t)),new Map(e)):null)},[]);return(0,W.useEffect)(()=>{let t=r.current;if(e!==t){a(t);let o=e.map(e=>{let t=Kt(e);return t?(t.addEventListener(`scroll`,i,{passive:!0}),[t,Yt(t)]):null}).filter(e=>e!=null);n(o.length?new Map(o):null),r.current=e}return()=>{a(e),a(t)};function a(e){e.forEach(e=>{Kt(e)?.removeEventListener(`scroll`,i)})}},[i,e]),(0,W.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>et(e,t),Y):tn(e):Y,[e,t])}function qn(e,t){t===void 0&&(t=[]);let n=(0,W.useRef)(null);return(0,W.useEffect)(()=>{n.current=null},t),(0,W.useEffect)(()=>{let t=e!==Y;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?tt(e,n.current):Y}function Jn(e){(0,W.useEffect)(()=>{if(!Re)return;let t=e.map(e=>{let{sensor:t}=e;return t.setup==null?void 0:t.setup()});return()=>{for(let e of t)e?.()}},e.map(e=>{let{sensor:t}=e;return t}))}function Yn(e,t){return(0,W.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}function Xn(e){return(0,W.useMemo)(()=>e?Vt(e):null,[e])}var Zn=[];function Qn(e,t){t===void 0&&(t=zt);let[n]=e,r=Xn(n?G(n):null),[i,a]=(0,W.useState)(Zn);function o(){a(()=>e.length?e.map(e=>Xt(e)?r:new sn(t(e),e)):Zn)}let s=Bn({callback:o});return K(()=>{s?.disconnect(),o(),e.forEach(e=>s?.observe(e))},[e]),i}function $n(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return He(t)?t:e}function er(e){let{measure:t}=e,[n,r]=(0,W.useState)(null),i=Bn({callback:(0,W.useCallback)(e=>{for(let{target:n}of e)if(He(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),[a,o]=Ye((0,W.useCallback)(e=>{let n=$n(e);i?.disconnect(),n&&i?.observe(n),r(n?t(n):null)},[t,i]));return(0,W.useMemo)(()=>({nodeRef:a,rect:n,setRef:o}),[n,a,o])}var tr=[{sensor:bn,options:{}},{sensor:hn,options:{}}],nr={current:{}},rr={draggable:{measure:Bt},droppable:{measure:Bt,strategy:Nn.WhileDragging,frequency:Pn.Optimized},dragOverlay:{measure:zt}},ir=class extends Map{get(e){return e==null?void 0:super.get(e)??void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){return this.get(e)?.node.current??void 0}},ar={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ir,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:vt},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:rr,measureDroppableContainers:vt,windowRect:null,measuringScheduled:!1},or={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:vt,draggableNodes:new Map,over:null,measureDroppableContainers:vt},sr=(0,W.createContext)(or),cr=(0,W.createContext)(ar);function lr(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ir}}}function ur(e,t){switch(t.type){case J.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case J.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case J.DragEnd:case J.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case J.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new ir(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case J.SetDroppableDisabled:{let{id:n,key:r,disabled:i}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;let o=new ir(e.droppable.containers);return o.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case J.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new ir(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function dr(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:i}=(0,W.useContext)(sr),a=Xe(r),o=Xe(n?.id);return(0,W.useEffect)(()=>{if(!t&&!r&&a&&o!=null){if(!rt(a)||document.activeElement===a.target)return;let e=i.get(o);if(!e)return;let{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(let e of[t.current,n.current]){if(!e)continue;let t=st(e);if(t){t.focus();break}}})}},[r,t,i,o,a]),null}function fr(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}function pr(e){return(0,W.useMemo)(()=>({draggable:{...rr.draggable,...e?.draggable},droppable:{...rr.droppable,...e?.droppable},dragOverlay:{...rr.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function mr(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e,a=(0,W.useRef)(!1),{x:o,y:s}=typeof i==`boolean`?{x:i,y:i}:i;K(()=>{if(!o&&!s||!t){a.current=!1;return}if(a.current||!r)return;let e=t?.node.current;if(!e||e.isConnected===!1)return;let i=Nt(n(e),r);if(o||(i.x=0),s||(i.y=0),a.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){let t=Gt(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,o,s,r,n])}var hr=(0,W.createContext)({...Y,scaleX:1,scaleY:1}),gr;(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(gr||={});var _r=(0,W.memo)(function(e){let{id:t,accessibility:n,autoScroll:r=!0,children:i,sensors:a=tr,collisionDetection:o=kt,measuring:s,modifiers:c,...l}=e,[u,d]=(0,W.useReducer)(ur,void 0,lr),[f,p]=mt(),[m,h]=(0,W.useState)(gr.Uninitialized),g=m===gr.Initialized,{draggable:{active:_,nodes:v,translate:y},droppable:{containers:b}}=u,x=_==null?null:v.get(_),S=(0,W.useRef)({initial:null,translated:null}),C=(0,W.useMemo)(()=>_==null?null:{id:_,data:x?.data??nr,rect:S},[_,x]),w=(0,W.useRef)(null),[ee,T]=(0,W.useState)(null),[E,D]=(0,W.useState)(null),O=qe(l,Object.values(l)),te=Qe(`DndDescribedBy`,t),ne=(0,W.useMemo)(()=>b.getEnabled(),[b]),k=pr(s),{droppableRects:A,measureDroppableContainers:re,measuringScheduled:ie}=In(ne,{dragging:g,dependencies:[y.x,y.y],config:k.droppable}),j=jn(v,_),ae=(0,W.useMemo)(()=>E?at(E):null,[E]),M=Te(),oe=Rn(j,k.draggable.measure);mr({activeNode:_==null?null:v.get(_),config:M.layoutShiftCompensation,initialRect:oe,measure:k.draggable.measure});let N=Hn(j,k.draggable.measure,oe),se=Hn(j?j.parentElement:null),P=(0,W.useRef)({activatorEvent:null,active:null,activeNode:j,collisionRect:null,collisions:null,droppableRects:A,draggableNodes:v,draggingNode:null,draggingNodeRect:null,droppableContainers:b,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),F=b.getNodeFor(P.current.over?.id),I=er({measure:k.dragOverlay.measure}),ce=I.nodeRef.current??j,L=g?I.rect??N:null,le=!!(I.nodeRef.current&&I.rect),ue=Un(le?null:N),de=Xn(ce?G(ce):null),R=Gn(g?F??j:null),fe=Qn(R),pe=fr(c,{transform:{x:y.x-ue.x,y:y.y-ue.y,scaleX:1,scaleY:1},activatorEvent:E,active:C,activeNodeRect:N,containerNodeRect:se,draggingNodeRect:L,over:P.current.over,overlayNodeRect:I.rect,scrollableAncestors:R,scrollableAncestorRects:fe,windowRect:de}),me=ae?et(ae,y):null,he=Kn(R),ge=qn(he),_e=qn(he,[N]),z=et(pe,ge),B=L?Ft(L,pe):null,ve=C&&B?o({active:C,collisionRect:B,droppableRects:A,droppableContainers:ne,pointerCoordinates:me}):null,ye=Et(ve,`id`),[V,H]=(0,W.useState)(null),be=Mt(le?pe:et(pe,_e),V?.rect??null,N),xe=(0,W.useRef)(null),U=(0,W.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(w.current==null)return;let i=v.get(w.current);if(!i)return;let a=e.nativeEvent,o=new n({active:w.current,activeNode:i,event:a,options:r,context:P,onAbort(e){if(!v.get(e))return;let{onDragAbort:t}=O.current,n={id:e};t?.(n),f({type:`onDragAbort`,event:n})},onPending(e,t,n,r){if(!v.get(e))return;let{onDragPending:i}=O.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};i?.(a),f({type:`onDragPending`,event:a})},onStart(e){let t=w.current;if(t==null)return;let n=v.get(t);if(!n)return;let{onDragStart:r}=O.current,i={activatorEvent:a,active:{id:t,data:n.data,rect:S}};(0,Ie.unstable_batchedUpdates)(()=>{r?.(i),h(gr.Initializing),d({type:J.DragStart,initialCoordinates:e,active:t}),f({type:`onDragStart`,event:i}),T(xe.current),D(a)})},onMove(e){d({type:J.DragMove,coordinates:e})},onEnd:s(J.DragEnd),onCancel:s(J.DragCancel)});xe.current=o;function s(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=P.current,o=null;if(t&&i){let{cancelDrop:s}=O.current;o={activatorEvent:a,active:t,collisions:n,delta:i,over:r},e===J.DragEnd&&typeof s==`function`&&await Promise.resolve(s(o))&&(e=J.DragCancel)}w.current=null,(0,Ie.unstable_batchedUpdates)(()=>{d({type:e}),h(gr.Uninitialized),H(null),T(null),D(null),xe.current=null;let t=e===J.DragEnd?`onDragEnd`:`onDragCancel`;if(o){let e=O.current[t];e?.(o),f({type:t,event:o})}})}}},[v]),Se=Mn(a,(0,W.useCallback)((e,t)=>(n,r)=>{let i=n.nativeEvent,a=v.get(r);if(w.current!==null||!a||i.dndKit||i.defaultPrevented)return;let o={active:a};e(n,t.options,o)===!0&&(i.dndKit={capturedBy:t.sensor},w.current=r,U(n,t))},[v,U]));Jn(a),K(()=>{N&&m===gr.Initializing&&h(gr.Initialized)},[N,m]),(0,W.useEffect)(()=>{let{onDragMove:e}=O.current,{active:t,activatorEvent:n,collisions:r,over:i}=P.current;if(!t||!n)return;let a={active:t,activatorEvent:n,collisions:r,delta:{x:z.x,y:z.y},over:i};(0,Ie.unstable_batchedUpdates)(()=>{e?.(a),f({type:`onDragMove`,event:a})})},[z.x,z.y]),(0,W.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=P.current;if(!e||w.current==null||!t||!i)return;let{onDragOver:a}=O.current,o=r.get(ye),s=o&&o.rect.current?{id:o.id,rect:o.rect.current,data:o.data,disabled:o.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:s};(0,Ie.unstable_batchedUpdates)(()=>{H(s),a?.(c),f({type:`onDragOver`,event:c})})},[ye]),K(()=>{P.current={activatorEvent:E,active:C,activeNode:j,collisionRect:B,collisions:ve,droppableRects:A,draggableNodes:v,draggingNode:ce,draggingNodeRect:L,droppableContainers:b,over:V,scrollableAncestors:R,scrollAdjustedTranslate:z},S.current={initial:L,translated:B}},[C,j,ve,B,v,ce,L,A,b,V,R,z]),On({...M,delta:y,draggingRect:B,pointerCoordinates:me,scrollableAncestors:R,scrollableAncestorRects:fe});let Ce=(0,W.useMemo)(()=>({active:C,activeNode:j,activeNodeRect:N,activatorEvent:E,collisions:ve,containerNodeRect:se,dragOverlay:I,draggableNodes:v,droppableContainers:b,droppableRects:A,over:V,measureDroppableContainers:re,scrollableAncestors:R,scrollableAncestorRects:fe,measuringConfiguration:k,measuringScheduled:ie,windowRect:de}),[C,j,N,E,ve,se,I,v,b,A,V,re,R,fe,k,ie,de]),we=(0,W.useMemo)(()=>({activatorEvent:E,activators:Se,active:C,activeNodeRect:N,ariaDescribedById:{draggable:te},dispatch:d,draggableNodes:v,over:V,measureDroppableContainers:re}),[E,Se,C,N,d,te,v,V,re]);return W.createElement(ft.Provider,{value:p},W.createElement(sr.Provider,{value:we},W.createElement(cr.Provider,{value:Ce},W.createElement(hr.Provider,{value:be},i)),W.createElement(dr,{disabled:n?.restoreFocus===!1})),W.createElement(_t,{...n,hiddenTextDescribedById:te}));function Te(){let e=ee?.autoScrollEnabled===!1,t=typeof r==`object`?r.enabled===!1:r===!1,n=g&&!e&&!t;return typeof r==`object`?{...r,enabled:n}:{enabled:n}}}),vr=(0,W.createContext)(null),yr=`button`,br=`Draggable`;function xr(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,a=Qe(br),{activators:o,activatorEvent:s,active:c,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:f}=(0,W.useContext)(sr),{role:p=yr,roleDescription:m=`draggable`,tabIndex:h=0}=i??{},g=c?.id===t,_=(0,W.useContext)(g?hr:vr),[v,y]=Ye(),[b,x]=Ye(),S=Yn(o,t),C=qe(n);return K(()=>(d.set(t,{id:t,key:a,node:v,activatorNode:b,data:C}),()=>{let e=d.get(t);e&&e.key===a&&d.delete(t)}),[d,t]),{active:c,activatorEvent:s,activeNodeRect:l,attributes:(0,W.useMemo)(()=>({role:p,tabIndex:h,"aria-disabled":r,"aria-pressed":g&&p===yr?!0:void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,p,h,g,m,u.draggable]),isDragging:g,listeners:r?void 0:S,node:v,over:f,setNodeRef:y,setActivatorNodeRef:x,transform:_}}function Sr(){return(0,W.useContext)(cr)}var Cr=`Droppable`,wr={timeout:25};function Tr(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=Qe(Cr),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,W.useContext)(sr),u=(0,W.useRef)({disabled:n}),d=(0,W.useRef)(!1),f=(0,W.useRef)(null),p=(0,W.useRef)(null),{disabled:m,updateMeasurementsFor:h,timeout:g}={...wr,...i},_=qe(h??r),v=Bn({callback:(0,W.useCallback)(()=>{d.current?(p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{l(Array.isArray(_.current)?_.current:[_.current]),p.current=null},g)):d.current=!0},[g]),disabled:m||!o}),[y,b]=Ye((0,W.useCallback)((e,t)=>{v&&(t&&(v.unobserve(t),d.current=!1),e&&v.observe(e))},[v])),x=qe(t);return(0,W.useEffect)(()=>{v&&y.current&&(v.disconnect(),d.current=!1,v.observe(y.current))},[y,v]),(0,W.useEffect)(()=>(s({type:J.RegisterDroppable,element:{id:r,key:a,disabled:n,node:y,rect:f,data:x}}),()=>s({type:J.UnregisterDroppable,key:a,id:r})),[r]),(0,W.useEffect)(()=>{n!==u.current.disabled&&(s({type:J.SetDroppableDisabled,id:r,key:a,disabled:n}),u.current.disabled=n)},[r,a,n,s]),{active:o,rect:f,isOver:c?.id===r,node:y,over:c,setNodeRef:b}}function Er(e){let{animation:t,children:n}=e,[r,i]=(0,W.useState)(null),[a,o]=(0,W.useState)(null),s=Xe(n);return!n&&!r&&s&&i(s),K(()=>{if(!a)return;let e=r?.key,n=r?.props.id;e==null||n==null?i(null):Promise.resolve(t(n,a)).then(()=>{i(null)})},[t,r,a]),W.createElement(W.Fragment,null,n,r?(0,W.cloneElement)(r,{ref:o}):null)}var Dr={x:0,y:0,scaleX:1,scaleY:1};function Or(e){let{children:t}=e;return W.createElement(sr.Provider,{value:or},W.createElement(hr.Provider,{value:Dr},t))}var kr={position:`fixed`,touchAction:`none`},Ar=e=>rt(e)?`transform 250ms ease`:void 0,jr=(0,W.forwardRef)((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:a,className:o,rect:s,style:c,transform:l,transition:u=Ar}=e;if(!s)return null;let d=i?l:{...l,scaleX:1,scaleY:1},f={...kr,width:s.width,height:s.height,top:s.top,left:s.left,transform:q.Transform.toString(d),transformOrigin:i&&r?St(r,s):void 0,transition:typeof u==`function`?u(r):u,...c};return W.createElement(n,{className:o,style:f,ref:t},a)}),Mr={duration:250,easing:`ease`,keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:q.Transform.toString(t)},{transform:q.Transform.toString(n)}]},sideEffects:(e=>t=>{let{active:n,dragOverlay:r}=t,i={},{styles:a,className:o}=e;if(a!=null&&a.active)for(let[e,t]of Object.entries(a.active))t!==void 0&&(i[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(a!=null&&a.dragOverlay)for(let[e,t]of Object.entries(a.dragOverlay))t!==void 0&&r.node.style.setProperty(e,t);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(let[e,t]of Object.entries(i))n.node.style.setProperty(e,t);o!=null&&o.active&&n.node.classList.remove(o.active)}})({styles:{active:{opacity:`0`}}})};function Nr(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return Ge((e,a)=>{if(t===null)return;let o=n.get(e);if(!o)return;let s=o.node.current;if(!s)return;let c=$n(a);if(!c)return;let{transform:l}=G(a).getComputedStyle(a),u=It(l);if(!u)return;let d=typeof t==`function`?t:Pr(t);return an(s,i.draggable.measure),d({active:{id:e,data:o.data,node:s,rect:i.draggable.measure(s)},draggableNodes:n,dragOverlay:{node:a,rect:i.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:i,transform:u})})}function Pr(e){let{duration:t,easing:n,sideEffects:r,keyframes:i}={...Mr,...e};return e=>{let{active:a,dragOverlay:o,transform:s,...c}=e;if(!t)return;let l={x:o.rect.left-a.rect.left,y:o.rect.top-a.rect.top},u={scaleX:s.scaleX===1?1:a.rect.width*s.scaleX/o.rect.width,scaleY:s.scaleY===1?1:a.rect.height*s.scaleY/o.rect.height},d={x:s.x-l.x,y:s.y-l.y,...u},f=i({...c,active:a,dragOverlay:o,transform:{initial:s,final:d}}),[p]=f,m=f[f.length-1];if(JSON.stringify(p)===JSON.stringify(m))return;let h=r?.({active:a,dragOverlay:o,...c}),g=o.node.animate(f,{duration:t,easing:n,fill:`forwards`});return new Promise(e=>{g.onfinish=()=>{h?.(),e()}})}}var Fr=0;function Ir(e){return(0,W.useMemo)(()=>{if(e!=null)return Fr++,Fr},[e])}var Lr=W.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:i,transition:a,modifiers:o,wrapperElement:s=`div`,className:c,zIndex:l=999}=e,{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:p,draggableNodes:m,droppableContainers:h,dragOverlay:g,over:_,measuringConfiguration:v,scrollableAncestors:y,scrollableAncestorRects:b,windowRect:x}=Sr(),S=(0,W.useContext)(hr),C=Ir(d?.id),w=fr(o,{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:p,draggingNodeRect:g.rect,over:_,overlayNodeRect:g.rect,scrollableAncestors:y,scrollableAncestorRects:b,transform:S,windowRect:x}),ee=Ln(f),T=Nr({config:r,draggableNodes:m,droppableContainers:h,measuringConfiguration:v}),E=ee?g.setRef:void 0;return W.createElement(Or,null,W.createElement(Er,{animation:T},d&&C?W.createElement(jr,{key:C,id:d.id,ref:E,as:s,activatorEvent:u,adjustScale:t,className:c,transition:a,rect:ee,style:{zIndex:l,...i},transform:w},n):null))});function Rr(e,t,n){let r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function zr(e,t){return e.reduce((e,n,r)=>{let i=t.get(n);return i&&(e[r]=i),e},Array(e.length))}function Br(e){return e!==null&&e>=0}function Vr(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Hr(e){return typeof e==`boolean`?{draggable:e,droppable:e}:e}var Ur=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e,a=Rr(t,r,n),o=t[i],s=a[i];return!s||!o?null:{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}},Wr={scaleX:1,scaleY:1},Gr=e=>{let{activeIndex:t,activeNodeRect:n,index:r,rects:i,overIndex:a}=e,o=i[t]??n;if(!o)return null;if(r===t){let e=i[a];return e?{x:0,y:t<a?e.top+e.height-(o.top+o.height):e.top-o.top,...Wr}:null}let s=Kr(i,r,t);return r>t&&r<=a?{x:0,y:-o.height-s,...Wr}:r<t&&r>=a?{x:0,y:o.height+s,...Wr}:{x:0,y:0,...Wr}};function Kr(e,t,n){let r=e[t],i=e[t-1],a=e[t+1];return r?n<t?i?r.top-(i.top+i.height):a?a.top-(r.top+r.height):0:a?a.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}var qr=`Sortable`,Jr=W.createContext({activeIndex:-1,containerId:qr,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Ur,disabled:{draggable:!1,droppable:!1}});function Yr(e){let{children:t,id:n,items:r,strategy:i=Ur,disabled:a=!1}=e,{active:o,dragOverlay:s,droppableRects:c,over:l,measureDroppableContainers:u}=Sr(),d=Qe(qr,n),f=s.rect!==null,p=(0,W.useMemo)(()=>r.map(e=>typeof e==`object`&&`id`in e?e.id:e),[r]),m=o!=null,h=o?p.indexOf(o.id):-1,g=l?p.indexOf(l.id):-1,_=(0,W.useRef)(p),v=!Vr(p,_.current),y=g!==-1&&h===-1||v,b=Hr(a);K(()=>{v&&m&&u(p)},[v,p,m,u]),(0,W.useEffect)(()=>{_.current=p},[p]);let x=(0,W.useMemo)(()=>({activeIndex:h,containerId:d,disabled:b,disableTransforms:y,items:p,overIndex:g,useDragOverlay:f,sortedRects:zr(p,c),strategy:i}),[h,d,b.draggable,b.droppable,y,p,g,c,f,i]);return W.createElement(Jr.Provider,{value:x},t)}var Xr=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return Rr(n,r,i).indexOf(t)},Zr=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:a,newIndex:o,previousItems:s,previousContainerId:c,transition:l}=e;return!l||!r||s!==a&&i===o?!1:n?!0:o!==i&&t===c},Qr={duration:200,easing:`ease`},$r=`transform`,ei=q.Transition.toString({property:$r,duration:0,easing:`linear`}),ti={roleDescription:`sortable`};function ni(e){let{disabled:t,index:n,node:r,rect:i}=e,[a,o]=(0,W.useState)(null),s=(0,W.useRef)(n);return K(()=>{if(!t&&n!==s.current&&r.current){let e=i.current;if(e){let t=zt(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&o(n)}}n!==s.current&&(s.current=n)},[t,n,r,i]),(0,W.useEffect)(()=>{a&&o(null)},[a]),a}function ri(e){let{animateLayoutChanges:t=Zr,attributes:n,disabled:r,data:i,getNewIndex:a=Xr,id:o,strategy:s,resizeObserverConfig:c,transition:l=Qr}=e,{items:u,containerId:d,activeIndex:f,disabled:p,disableTransforms:m,sortedRects:h,overIndex:g,useDragOverlay:_,strategy:v}=(0,W.useContext)(Jr),y=ii(r,p),b=u.indexOf(o),x=(0,W.useMemo)(()=>({sortable:{containerId:d,index:b,items:u},...i}),[d,i,b,u]),S=(0,W.useMemo)(()=>u.slice(u.indexOf(o)),[u,o]),{rect:C,node:w,isOver:ee,setNodeRef:T}=Tr({id:o,data:x,disabled:y.droppable,resizeObserverConfig:{updateMeasurementsFor:S,...c}}),{active:E,activatorEvent:D,activeNodeRect:O,attributes:te,setNodeRef:ne,listeners:k,isDragging:A,over:re,setActivatorNodeRef:ie,transform:j}=xr({id:o,data:x,attributes:{...ti,...n},disabled:y.draggable}),ae=Le(T,ne),M=!!E,oe=M&&!m&&Br(f)&&Br(g),N=!_&&A,se=oe?(N&&oe?j:null)??(s??v)({rects:h,activeNodeRect:O,activeIndex:f,overIndex:g,index:b}):null,P=Br(f)&&Br(g)?a({id:o,items:u,activeIndex:f,overIndex:g}):b,F=E?.id,I=(0,W.useRef)({activeId:F,items:u,newIndex:P,containerId:d}),ce=u!==I.current.items,L=t({active:E,containerId:d,isDragging:A,isSorting:M,id:o,index:b,items:u,newIndex:I.current.newIndex,previousItems:I.current.items,previousContainerId:I.current.containerId,transition:l,wasDragging:I.current.activeId!=null}),le=ni({disabled:!L,index:b,node:w,rect:C});return(0,W.useEffect)(()=>{M&&I.current.newIndex!==P&&(I.current.newIndex=P),d!==I.current.containerId&&(I.current.containerId=d),u!==I.current.items&&(I.current.items=u)},[M,P,d,u]),(0,W.useEffect)(()=>{if(F===I.current.activeId)return;if(F!=null&&I.current.activeId==null){I.current.activeId=F;return}let e=setTimeout(()=>{I.current.activeId=F},50);return()=>clearTimeout(e)},[F]),{active:E,activeIndex:f,attributes:te,data:x,rect:C,index:b,newIndex:P,items:u,isOver:ee,isSorting:M,isDragging:A,listeners:k,node:w,overIndex:g,over:re,setNodeRef:ae,setActivatorNodeRef:ie,setDroppableNodeRef:T,setDraggableNodeRef:ne,transform:le??se,transition:ue()};function ue(){if(le||ce&&I.current.newIndex===b)return ei;if(!(N&&!rt(D)||!l)&&(M||L))return q.Transition.toString({...l,property:$r})}}function ii(e,t){return typeof e==`boolean`?{draggable:e,droppable:!1}:{draggable:e?.draggable??t.draggable,droppable:e?.droppable??t.droppable}}function ai(e){if(!e)return!1;let t=e.data.current;return!!(t&&`sortable`in t&&typeof t.sortable==`object`&&`containerId`in t.sortable&&`items`in t.sortable&&`index`in t.sortable)}var oi=[Q.Down,Q.Right,Q.Up,Q.Left],si=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:a,over:o,scrollableAncestors:s}}=t;if(oi.includes(e.code)){if(e.preventDefault(),!n||!r)return;let t=[];a.getEnabled().forEach(n=>{if(!n||n!=null&&n.disabled)return;let a=i.get(n.id);if(a)switch(e.code){case Q.Down:r.top<a.top&&t.push(n);break;case Q.Up:r.top>a.top&&t.push(n);break;case Q.Left:r.left>a.left&&t.push(n);break;case Q.Right:r.left<a.left&&t.push(n)}});let c=Dt({active:n,collisionRect:r,droppableRects:i,droppableContainers:t,pointerCoordinates:null}),l=Et(c,`id`);if(l===o?.id&&c.length>1&&(l=c[1].id),l!=null){let e=a.get(n.id),t=a.get(l),o=t?i.get(t.id):null,c=t?.node.current;if(c&&o&&e&&t){let n=Wt(c).some((e,t)=>s[t]!==e),i=ci(e,t),a=li(e,t),l=n||!i?{x:0,y:0}:{x:a?r.width-o.width:0,y:a?r.height-o.height:0},u={x:o.left,y:o.top};return l.x&&l.y?u:tt(u,l)}}}};function ci(e,t){return!ai(e)||!ai(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function li(e,t){return!ai(e)||!ai(t)||!ci(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}var ui={above:!1,below:!1},di=()=>{let[e,t]=(0,W.useState)(ui),n=(0,W.useRef)(null);return[(0,W.useCallback)(e=>{if(n.current?.(),n.current=null,e===null)return;let r=()=>{let n=e.scrollTop>1,r=e.scrollHeight-e.clientHeight-e.scrollTop>1;t(e=>e.above===n&&e.below===r?e:{above:n,below:r})},i=new ResizeObserver(r),a=()=>{i.observe(e);for(let t of e.children)i.observe(t)},o=new MutationObserver(()=>{i.disconnect(),a(),r()});a(),o.observe(e,{childList:!0}),e.addEventListener(`scroll`,r,{passive:!0}),r(),n.current=()=>{e.removeEventListener(`scroll`,r),o.disconnect(),i.disconnect()}},[]),e]},$=t();function fi({className:e,size:t=`default`,...n}){return(0,$.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:j(`group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-lg bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-border [--card-spacing:--spacing(4)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] *:[img:first-child]:rounded-t-lg *:[img:last-child]:rounded-b-lg`,e),...n})}function pi({className:e,...t}){return(0,$.jsx)(`div`,{"data-slot":`card-header`,className:j(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-lg px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)`,e),...t})}function mi({className:e,...t}){return(0,$.jsx)(`div`,{"data-slot":`card-title`,className:j(`text-lg font-semibold`,e),...t})}function hi({className:e,...t}){return(0,$.jsx)(`div`,{"data-slot":`card-description`,className:j(`text-sm text-muted-foreground`,e),...t})}function gi({className:e,...t}){return(0,$.jsx)(`div`,{"data-slot":`card-content`,className:j(`px-(--card-spacing)`,e),...t})}var _i=(e,t)=>e===`Running`?`Running since ${N(t)}`:e===`Failed`?`Failed at ${N(t)}`:d(t),vi=3,yi=({labels:e,catalog:t})=>{if(e.length===0)return null;let n=e.slice(vi);return(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[e.slice(0,vi).map(e=>(0,$.jsx)(we,{name:e,label:t.get(e)},e)),n.length>0&&(0,$.jsxs)(Ce,{variant:`outline`,className:`text-muted-foreground tabular-nums`,title:n.join(`, `),"aria-label":`${n.length} more: ${n.join(`, `)}`,children:[`+`,n.length]})]})},bi=`block w-full cursor-pointer text-left outline-none after:absolute after:inset-0 after:rounded-lg`,xi=({item:e,repository:t})=>(0,$.jsx)(`h3`,{className:`text-sm/snug font-medium text-card-foreground`,title:e.title,children:(0,$.jsx)(g,{to:`/projects/$owner/$name/tasks/$number`,params:{...p(t),number:Oe(e)},draggable:!1,className:bi,children:(0,$.jsx)(`span`,{className:`line-clamp-2`,children:e.title})})}),Si=({failure:e,children:t})=>(0,$.jsxs)(`div`,{className:`flex flex-col items-start gap-1.5 rounded-md bg-destructive/8 px-2 py-1.5 text-xs text-destructive`,children:[(0,$.jsx)(`p`,{className:`line-clamp-2 wrap-anywhere`,title:e.message,children:e.message}),t]}),Ci=({failure:e,action:t})=>t!==null&&e.run.canRetry&&!t.isPending?(0,$.jsx)(M,{variant:`outline`,size:`xs`,className:`relative z-10`,title:h(e.run.agentBrain),onClick:()=>t.mutate({runId:e.run.id,request:{action:`retry`}}),children:u.retry}):null,wi=({run:e})=>{let t=z(3e4),n=v(e);return(0,$.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1.5 text-xs whitespace-nowrap text-muted-foreground`,children:[(0,$.jsx)(B,{state:e.state,className:`mr-0.5`}),(0,$.jsx)(`span`,{className:`truncate text-foreground`,children:e.loop}),(0,$.jsx)(`span`,{className:`shrink-0`,children:e.state}),n!==null&&(0,$.jsx)(`time`,{className:`shrink-0 font-mono tabular-nums`,dateTime:n,title:_i(e.state,n),children:se(n,t)}),(0,$.jsx)(`span`,{className:`ml-auto truncate pl-2`,children:e.agent})]})},Ti=({stalled:e,named:t,children:n})=>{let r=z(3e4),i=ke(e,r);return(0,$.jsxs)(`div`,{"data-slot":`stall-note`,className:`flex flex-col items-start gap-1.5 text-xs`,children:[(0,$.jsxs)(`p`,{className:`line-clamp-3 text-muted-foreground`,title:`${e.loop}: ${i}`,children:[t&&(0,$.jsxs)(`span`,{className:`font-medium text-foreground`,children:[e.loop,` `]}),i]}),n]})},Ei=e=>[`run-again`,`board-card`,e],Di=(e,t)=>{let n=Ei(e),r=L({mutationKey:n,onClaimed:t}),i=pe({filters:{mutationKey:n,exact:!0},select:({state:e})=>e}).at(-1);return{isPending:i?.status===`pending`,data:i?.data,error:i?.error??null,send:e=>r.mutate(ce(e))}},Oi=({item:e,lane:t,catalog:n,repository:r,stall:i,readOnly:a,action:o,again:c,progress:l})=>{let u=x(e),d=y(e),f=o?.error?.message??null,p=c?.error?.message??null,m=i!==null&&u!==null&&(i.reason._tag===`RunFailed`||i.reason._tag===`SuppressedForOperator`)&&i.reason.run.id===u.run.id,h=i===null||o===null?null:(0,$.jsx)(Te,{stalled:i,readOnly:a,appearance:`card`}),g=e.needsYou&&!(d?.canApprove||d?.canResolveFailure)&&i===null;return(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5 px-3`,children:[(0,$.jsx)(`p`,{className:`flex flex-wrap items-baseline gap-x-2.5 pr-6`,children:e.items.map(e=>(0,$.jsx)(s,{item:e,className:`relative z-10`},e.itemKey))}),(0,$.jsx)(xi,{item:e,repository:r}),(0,$.jsx)(yi,{labels:S(e,t),catalog:n}),d!==null&&(0,$.jsx)(wi,{run:d}),l!==null&&(0,$.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:l}),u!==null&&(0,$.jsx)(Si,{failure:u,children:m&&i?.reason._tag===`SuppressedForOperator`?h:(0,$.jsx)(Ci,{failure:u,action:o})}),i!==null&&!m&&(0,$.jsx)(Ti,{stalled:i,named:(d===null||De(i)?.id!==d.id)&&!Ae(i),children:h}),c?.data?._tag===`CycleBlocked`&&(0,$.jsx)(`p`,{role:`status`,className:`text-xs text-needs-you`,children:`No run opened: cycle budget used up. Reset it in Needs attention`}),f!==null&&(0,$.jsx)(`p`,{className:`text-xs text-destructive wrap-anywhere`,children:f}),p!==null&&(0,$.jsx)(`p`,{className:`text-xs text-destructive wrap-anywhere`,children:p}),e.conflicting&&(0,$.jsx)(`p`,{className:`text-xs text-destructive`,children:`Conflicts with base`}),g&&(0,$.jsx)(`p`,{className:`text-xs text-needs-you`,children:`Needs attention`})]})},ki=({runs:e,openRun:t})=>(0,$.jsxs)(A,{children:[(0,$.jsx)(O,{children:`Run history`}),(0,$.jsx)(T,{className:`min-w-48`,children:[...e].reverse().map(e=>(0,$.jsxs)(D,{onClick:()=>t(e.id),children:[(0,$.jsx)(`span`,{className:`truncate`,children:e.loop}),(0,$.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-2 pl-4 text-xs text-muted-foreground`,children:[(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(B,{state:e.state}),e.state]}),(0,$.jsx)(`time`,{dateTime:e.openedAt,title:d(e.openedAt),className:`font-mono tabular-nums`,children:se(e.openedAt)})]})]},e.id))})]}),Ai=({item:e,run:t,moves:n,openRun:r,action:i,again:a,className:c})=>{let[l,d]=(0,W.useState)(!1),f=o(e),p=e.runs.filter(({id:e})=>e!==t?.id),m=e.run?.canRunAgain===!0?e.run:null,g=[{key:`links`,content:e.items.map(e=>(0,$.jsxs)(ee,{href:e.url,target:`_blank`,rel:`noreferrer`,closeOnClick:!0,children:[`Open `,(0,$.jsx)(s,{item:e,linked:!1}),` on GitHub`,(0,$.jsx)(C,{className:`ml-auto text-muted-foreground`,"aria-hidden":`true`})]},e.itemKey))}];(t!==null||p.length>0)&&g.push({key:`runs`,content:(0,$.jsxs)($.Fragment,{children:[t!==null&&(0,$.jsx)(D,{onClick:()=>r(t.id),children:`Open run`}),p.length>0&&(0,$.jsx)(ki,{runs:p,openRun:r})]})});let _=i.isPending||a.isPending,v=m!==null||t!==null&&(t.canApprove||t.canRetry||t.canCancel);return!_&&v&&g.push({key:`actions`,content:(0,$.jsxs)($.Fragment,{children:[t?.canApprove&&(0,$.jsx)(D,{onClick:()=>i.mutate({runId:t.id,request:{action:`approve`}}),children:u.approve}),t?.canRetry&&(0,$.jsx)(D,{title:h(t.agentBrain),onClick:()=>i.mutate({runId:t.id,request:{action:`retry`}}),children:u.retry}),m!==null&&(0,$.jsxs)(D,{onClick:()=>a.send(m),children:[u.runAgain,(0,$.jsx)(`span`,{className:`ml-auto truncate pl-4 text-xs text-muted-foreground`,children:m.loop})]}),t?.canCancel&&(0,$.jsx)(D,{variant:`destructive`,onClick:()=>d(!0),children:u.cancel})]})}),!n.disabled&&n.targets.length>0&&g.push({key:`move`,content:(0,$.jsxs)(A,{children:[(0,$.jsx)(O,{children:`Move to`}),(0,$.jsx)(T,{className:`min-w-40`,children:n.targets.map(t=>(0,$.jsx)(D,{onClick:()=>n.onMove(e,t),children:t.name},t.id))})]})}),(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(re,{children:[(0,$.jsx)(ie,{render:(0,$.jsx)(M,{variant:`ghost`,size:`icon-sm`,className:j(`text-muted-foreground hover:text-foreground aria-expanded:text-foreground`,c)}),"aria-label":`Actions for ${f}`,children:(0,$.jsx)(E,{weight:`bold`,className:`size-4`,"aria-hidden":`true`})}),(0,$.jsx)(te,{align:`end`,className:`w-auto min-w-48`,children:g.map(({key:e,content:t},n)=>(0,$.jsxs)(W.Fragment,{children:[n>0&&(0,$.jsx)(ne,{}),(0,$.jsx)(k,{children:t})]},e))})]}),t!==null&&(0,$.jsx)(P,{open:l,onOpenChange:d,children:(0,$.jsxs)(me,{children:[(0,$.jsxs)(ue,{children:[(0,$.jsxs)(he,{children:[`Cancel `,t.loop,`?`]}),(0,$.jsxs)(ge,{children:[`The run on `,f,` stops, including any attempt in progress.`]})]}),(0,$.jsxs)(fe,{children:[(0,$.jsx)(_e,{children:u.keepRunning}),(0,$.jsx)(R,{variant:`destructive`,onClick:()=>{d(!1),i.mutate({runId:t.id,request:{action:`cancel`}})},children:u.confirmCancel})]})]})})]})},ji=e=>j(`relative gap-0 py-2.5 transition-[box-shadow] hover:ring-foreground/15 has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-ring/70`,e&&`ring-needs-you/45 hover:ring-needs-you/65`),Mi=(e,t,n)=>e.isPending&&e.variables!==void 0?m[e.variables.request.action]:t.isPending?l:n===void 0?null:b(n),Ni=({item:e,lane:t,catalog:n,draggable:r,phase:i,moves:a,stall:o,readOnly:s,openRun:c,repository:l})=>{let u=I(),d=Di(e.itemKey,c),{attributes:f,listeners:p,setNodeRef:m,setActivatorNodeRef:h,transform:g,transition:_,isDragging:v}=ri({id:e.itemKey,disabled:{draggable:!r,droppable:t._tag!==`WritableBoardLane`}});return(0,$.jsxs)(`div`,{ref:m,style:{transform:q.Translate.toString(g),transition:_},className:j(`group/task relative`,v&&`opacity-40`),children:[(0,$.jsx)(fi,{ref:h,size:`sm`,className:j(ji(e.needsYou),r&&`touch-none focus-visible:ring-2 focus-visible:ring-ring/70`),...r&&f,...r&&p,children:(0,$.jsx)(Oi,{item:e,lane:t,catalog:n,repository:l,stall:o,readOnly:s,action:u,again:d,progress:Mi(u,d,i)})}),(0,$.jsx)(Ai,{item:e,run:y(e),moves:a,openRun:c,action:u,again:d,className:`absolute top-1.5 right-1.5 transition-opacity [@media(hover:hover)]:opacity-0 [@media(hover:hover)]:group-hover/task:opacity-100 [@media(hover:hover)]:group-focus-within/task:opacity-100 [@media(hover:hover)]:aria-expanded:opacity-100`})]})},Pi=new Set([`Waiting`,`Queued`,`Running`]),Fi=(e,t)=>new Map(e.flatMap((n,r)=>{let i=e[r+1];if(i===void 0||n._tag!==`WritableBoardLane`||i._tag!==`WritableBoardLane`)return[];let a=new Set(n.items.flatMap(e=>e.loops)),o=n.items.flatMap(({runs:e})=>e.filter(({state:e,loop:t})=>Pi.has(e)&&a.has(t))),s={next:i,loops:t.filter(({name:e})=>a.has(e)).map(({name:e,paused:t})=>({name:e,paused:t})),tone:o.some(({state:e})=>e!==`Waiting`)?`active`:o.length>0?`waiting`:`idle`};return[[n.id,s]]})),Ii=e=>e.map(({name:e,paused:t})=>t?`${e} (paused)`:e).join(`, `),Li=({flow:e})=>{let t=e.loops.length>0;return(0,$.jsxs)(`p`,{"data-slot":`flow-arrow`,className:j(`-mr-3 ml-auto flex min-w-0 items-center gap-1.5 pl-2 text-xs`,e.tone===`active`?`text-run-active`:e.tone===`waiting`?`text-run-waiting`:`text-muted-foreground`),title:t?`Loops matching this lane: ${Ii(e.loops)}. Flows to ${e.next.name}`:void 0,children:[(0,$.jsxs)(`span`,{className:`sr-only`,children:[`Flows to `,e.next.name]}),t&&(0,$.jsx)(`span`,{className:`truncate`,children:e.loops.map(({name:e,paused:t},n)=>(0,$.jsxs)(W.Fragment,{children:[n>0&&`, `,e,t&&(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:` paused`})]},e))}),(0,$.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 22 8`,className:j(`h-2 w-5.5 shrink-0 fill-none stroke-current`,e.tone===`idle`&&`text-faint`),strokeWidth:`1`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,$.jsx)(`path`,{d:`M0.5 4h18M15.5 1l3 3-3 3`})})]})},Ri=e=>e.origin===`fallback`||e.sources.length>0&&e.sources.every(e=>`state`in e&&oe(e.state)),zi=({sources:e,catalog:t})=>(0,$.jsx)(`ul`,{"aria-label":`Lane sources`,className:`flex flex-wrap gap-1`,children:e.map(e=>(0,$.jsx)(`li`,{className:`flex`,children:`label`in e?(0,$.jsx)(we,{name:e.label,label:t.get(e.label)}):(0,$.jsx)(Ce,{variant:`outline`,className:`text-muted-foreground`,children:e.state})},`label`in e?`label:${e.label}`:`state:${e.state}`))}),Bi=({lane:e,open:t})=>(0,$.jsx)(`section`,{"aria-label":`${e.name} lane`,className:`w-10 shrink-0`,children:(0,$.jsx)(`button`,{type:`button`,"aria-expanded":!1,title:`Open ${e.name}`,onClick:t,className:`flex h-full min-h-40 w-full items-start justify-center rounded-lg bg-card/60 ring-1 ring-border transition-colors outline-none hover:bg-muted/50 focus-visible:ring-2 focus-visible:ring-ring/70`,children:(0,$.jsxs)(`span`,{className:`sticky top-0 flex flex-col-reverse items-center gap-2 py-3`,children:[(0,$.jsx)(`span`,{className:`max-h-60 truncate text-sm font-semibold [writing-mode:vertical-rl]`,children:e.name}),` `,(0,$.jsx)(`span`,{className:`text-sm text-muted-foreground tabular-nums`,children:e.items.length})]})})}),Vi=({lane:e,lanes:t,flow:n,catalog:r,targeted:i,pending:a,readOnly:o,moves:s,stallOf:c,openRun:l,onMove:u,repository:d})=>{let f=Ri(e),[p,m]=(0,W.useState)(f),h=e._tag===`WritableBoardLane`,{setNodeRef:g}=Tr({id:e.id,disabled:!h||a}),_=t.filter(t=>t._tag===`WritableBoardLane`&&t.id!==e.id),v=e.items.length,[y,b]=di();return f&&p?(0,$.jsx)(Bi,{lane:e,open:()=>m(!1)}):(0,$.jsxs)(`section`,{ref:g,"aria-label":`${e.name} lane`,className:j(`flex w-68 shrink-0 flex-col gap-2 rounded-lg transition-[background-color,box-shadow]`,i&&`bg-muted/40 ring-6 ring-muted/40`),children:[(0,$.jsxs)(`header`,{className:j(`z-20 -mx-0.5 flex shrink-0 flex-col gap-1.5 px-1 pt-1 pb-1`,!i&&`bg-background`),children:[(0,$.jsxs)(`div`,{className:`flex h-6 items-center`,children:[(0,$.jsxs)(`h2`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,$.jsx)(`span`,{className:`truncate text-sm font-semibold`,children:e.name}),(0,$.jsx)(`span`,{className:`text-sm text-muted-foreground tabular-nums`,children:v})]}),n!==void 0&&(0,$.jsx)(Li,{flow:n}),f&&(0,$.jsx)(M,{variant:`ghost`,size:`icon-xs`,"aria-expanded":!0,"aria-label":`Fold ${e.name}`,title:`Fold ${e.name}`,className:`ml-auto text-muted-foreground hover:text-foreground`,onClick:()=>m(!0),children:(0,$.jsx)(Fe,{"aria-hidden":`true`})})]}),(0,$.jsx)(`div`,{className:`min-h-5`,children:e.sources.length>0&&(0,$.jsx)(zi,{sources:e.sources,catalog:r})})]}),(0,$.jsx)(`div`,{ref:y,"aria-label":`${e.name} cards`,tabIndex:b.above||b.below?0:void 0,className:j(`-mx-1 flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto overscroll-y-contain px-1 pb-1 outline-none focus-visible:ring-2 focus-visible:ring-ring/70`,b.above&&`mask-t-from-[calc(100%-2.5rem)]`,b.below&&`mask-b-from-[calc(100%-2.5rem)]`),children:(0,$.jsxs)(Yr,{items:e.items.map(({itemKey:e})=>e),strategy:Gr,children:[v===0&&(0,$.jsx)(`p`,{className:`rounded-lg border border-dashed border-input px-3 py-2.5 text-xs text-muted-foreground`,children:`No tasks`}),e.items.map(t=>{let n=s.find(({itemKey:e})=>e===t.itemKey)?.phase,i=a||n!==void 0;return(0,$.jsx)(Ni,{item:t,lane:e,catalog:r,draggable:!i&&_.length>0,phase:n,moves:{targets:_,disabled:i,onMove:u},stall:c(t),readOnly:o,openRun:l,repository:d},t.itemKey)})]})})]})},Hi=({item:e,lane:t,catalog:n,repository:r,stall:i})=>(0,$.jsx)(fi,{size:`sm`,className:j(ji(e.needsYou),`cursor-grabbing shadow-raised`),children:(0,$.jsx)(Oi,{item:e,lane:t,catalog:n,repository:r,stall:i,readOnly:!0,action:null,again:null,progress:null})}),Ui=({runs:e,openRun:t})=>(0,$.jsxs)(fi,{className:`sticky left-4 w-[min(64rem,calc(100cqw-2rem))] md:left-5 md:w-[min(64rem,calc(100cqw-2.5rem))]`,children:[(0,$.jsxs)(pi,{children:[(0,$.jsx)(mi,{children:`Runs without a card`}),(0,$.jsxs)(hi,{children:[e.length,` run`,e.length===1?``:`s`,` with no card on this board`]})]}),(0,$.jsx)(gi,{children:(0,$.jsxs)(Se,{children:[(0,$.jsx)(V,{children:(0,$.jsxs)(xe,{children:[(0,$.jsx)(H,{children:`Loop`}),(0,$.jsx)(H,{children:`Agent`}),(0,$.jsx)(H,{children:`Item`}),(0,$.jsx)(H,{children:`State`}),(0,$.jsx)(H,{className:`w-0`})]})}),(0,$.jsx)(be,{children:e.map(e=>(0,$.jsxs)(xe,{className:`cursor-pointer`,onClick:()=>t(e.id),children:[(0,$.jsx)(U,{className:`font-medium`,children:e.loop}),(0,$.jsx)(U,{children:e.agent}),(0,$.jsx)(U,{className:`max-w-64 truncate font-mono text-xs`,children:e.itemKey}),(0,$.jsx)(U,{children:(0,$.jsx)(ve,{state:e.state})}),(0,$.jsx)(U,{className:`text-right`,children:(0,$.jsx)(M,{variant:`ghost`,size:`icon-sm`,"aria-label":`Open run ${e.id}`,onClick:n=>{n.stopPropagation(),t(e.id)},children:(0,$.jsx)(Pe,{"aria-hidden":`true`})})})]},e.id))})]})})]}),Wi=e=>[...e.filter(({_tag:e})=>e===`WritableBoardLane`),...e.filter(({_tag:e,origin:t})=>e!==`WritableBoardLane`&&t!==`fallback`),...e.filter(({origin:e})=>e===`fallback`)],Gi=(e,t)=>t.find(t=>t.id===e)??t.find(t=>t.items.some(({itemKey:t})=>t===e)),Ki=e=>{let t=jt(e);if(t.length>0)return t;if(e.pointerCoordinates===null){let t=jt({...e,pointerCoordinates:{x:e.collisionRect.left+1,y:e.collisionRect.top+1}});if(t.length>0)return t}return kt(e)},qi=e=>(t,n)=>{let r=t.code===`ArrowRight`;if(!r&&t.code!==`ArrowLeft`)return si(t,n);t.preventDefault();let{collisionRect:i,droppableRects:a,droppableContainers:o}=n.context;if(i===null)return;let s=new Set(e.map(({id:e})=>e)),[c]=o.getEnabled().flatMap(({id:e})=>{let t=a.get(e);return t!==void 0&&s.has(e)?[t]:[]}).filter(({left:e})=>r?e>i.left:e<i.left).sort((e,t)=>r?e.left-t.left:t.left-e.left);return c===void 0?void 0:{x:c.left,y:c.top}},Ji=(e,t)=>{let n=e.flatMap(({items:e})=>e).find(({itemKey:e})=>e===t.itemKey);if(n===void 0)return e;let r=new Set(e.flatMap(e=>e._tag===`WritableBoardLane`?e.labels:[])),i={...n,labels:n.labels.filter(e=>!r.has(e))};return e.map(e=>{let n=e.items.filter(({itemKey:e})=>e!==t.itemKey);return e.id===t.toLane?{...e,items:[i,...n]}:{...e,items:n}})},Yi=e=>{let t=new Set(e.board.lanes.flatMap(({items:e})=>e.flatMap(({items:e})=>e.map(({itemKey:e})=>e))));return e.runs.filter(({itemKey:e})=>!t.has(e))},Xi=({project:e,loops:t,stalled:n,disabled:r,openRun:o})=>{let[s,c]=(0,W.useState)(null),[l,u]=(0,W.useState)(null),{moves:d,moveItem:f,isPending:p,error:m}=w(e),h=Yi(e),g=d.reduce(Ji,Wi(e.board.lanes)),_=bt(yt(bn,{activationConstraint:{distance:6}}),yt(hn,{coordinateGetter:qi(g)})),v=Fi(g,t),y=g.reduce((e,t)=>e+t.items.length,0),b=e=>Ee(n,e),x=new Map(e.labels.map(e=>[e.name,e])),S=r||p,C=()=>{c(null),u(null)};return(0,$.jsxs)(`div`,{className:`flex min-h-96 flex-1 flex-col gap-4 pt-5`,children:[(0,$.jsx)(i,{title:e.repository,leading:(0,$.jsx)(de,{repository:e.repository,size:`title`}),counts:`${g.length} lane${g.length===1?``:`s`}, ${y} item${y===1?``:`s`}`,className:`px-4 md:px-5`,children:e.status===`needs-you`&&(0,$.jsx)(ye,{})}),e.board.lanes.some(({origin:e})=>e===`proposed`)&&(0,$.jsxs)(`p`,{className:`mx-4 max-w-3xl text-muted-foreground md:mx-5`,children:[`Proposed lanes are read-only. To enable moves, add lanes with labels for this project under `,(0,$.jsx)(`code`,{children:`repos[].lanes`}),` in `,(0,$.jsx)(`code`,{children:`usine.yaml`}),`, then reload the configuration from Configuration > Loops.`]}),e.board.failures.length>0&&(0,$.jsx)(a,{className:`mx-4 max-w-3xl md:mx-5`,title:`${e.board.failures.length} ${e.board.failures.length===1?`item`:`items`} not shown on the board`,message:e.board.failures.map(e=>e.message).join(`
|
|
6
|
-
`)}),m!==null&&(0,$.jsx)(a,{className:`mx-4 max-w-3xl md:mx-5`,message:m.message}),(0,$.jsxs)(_r,{sensors:_,collisionDetection:Ki,onDragStart:({active:e})=>{let t=g.find(({items:t})=>t.some(({itemKey:t})=>t===e.id)),n=t?.items.find(({itemKey:t})=>t===e.id);c(t===void 0||n===void 0?null:{item:n,lane:t})},onDragOver:({over:e})=>u(e===null?null:Gi(e.id,g)?.id??null),onDragEnd:({over:e})=>{if(C(),e===null||s===null)return;let t=Gi(e.id,g);t!==void 0&&f(s.item,t)},onDragCancel:C,children:[(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto overscroll-contain [container-type:size]`,"aria-label":`${e.repository} project board`,children:(0,$.jsxs)(`div`,{className:`flex w-max min-w-full flex-col gap-6 px-4 pb-4 md:px-5`,children:[(0,$.jsx)(`div`,{className:`flex h-[calc(100cqh-1rem)] min-h-80 shrink-0 gap-3`,children:g.map(t=>(0,$.jsx)(Vi,{lane:t,lanes:g,flow:v.get(t.id),catalog:x,targeted:s!==null&&l===t.id&&t.id!==s.lane.id&&t._tag===`WritableBoardLane`,pending:S,readOnly:r,moves:d,stallOf:b,openRun:o,onMove:f,repository:e.repository},t.id))}),h.length>0&&(0,$.jsx)(Ui,{runs:h,openRun:o})]})}),(0,$.jsx)(Lr,{children:s!==null&&(0,$.jsx)(Hi,{item:s.item,lane:s.lane,catalog:x,repository:e.repository,stall:b(s.item)})})]})]})},Zi=()=>{let{repository:e}=le.useParams(),{data:t}=r(f()),n=r(c()),i=F(),a=t.projects.find(t=>t.repository===e);return a===void 0?(0,$.jsx)(je,{}):(0,$.jsx)(Xi,{project:a,loops:t.loops,stalled:n.data.notMoving,disabled:t._tag===`NeedsSetup`,openRun:i})};export{Zi as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{W as e}from"./index-C1tcW0Kz.js";var t=e;export{t as errorComponent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,r as t,s as n}from"./useRouter-Hur3RN7j.js";import{a as r,n as i,r as a}from"./page-BuzrT_cg.js";import{t as o}from"./error-alert-B1wP9JKx.js";import{i as s,l as c,n as l,s as u}from"./queries-CMOWVU8o.js";import{C as d,S as f,b as p,h as m,m as h,n as g,r as _,x as v,y}from"./overview-CVIU9T_Q.js";import{t as b}from"./useNavigate-AT5VkfZa.js";import{t as x}from"./link-C7GfYrMt.js";import{n as ee,r as te,s as ne,t as re}from"./moves-BP3lsIkJ.js";import{a as ie,n as ae,t as oe}from"./edit-and-retry-DoBXzKs4.js";import{d as se,i as S,n as C,r as w,t as T,u as E}from"./dropdown-menu-BuVimdT5.js";import{D,t as O}from"./button-4rhhIcK8.js";import{$t as k,Gt as ce,Kt as le,Ut as ue,a as A,f as j,nn as de,o as fe,x as pe}from"./strings-DONjvHz8.js";import{$ as me,Q as he,X as ge,Y as _e,Z as ve,at as M,et as N,it as P,n as F,nt as ye,ot as be,rt as xe,t as I,tt as Se,wt as Ce}from"./index-C1tcW0Kz.js";import{t as we}from"./use-now-vNgLntlV.js";import{t as Te}from"./heading-CmCH5X04.js";import{t as Ee}from"./pull-request-marks-oqSgsb3K.js";import{n as L,t as De}from"./status-badge-CLPsMXtK.js";import{a as Oe,i as R,n as z,o as B,r as V,t as H}from"./table-hbKjhjeL.js";import{t as U}from"./fill-cell-CjksmixH.js";import{t as ke}from"./label-badge-nrvxD46n.js";import{a as Ae,n as je,t as Me}from"./model-CYcw80ka.js";import{n as Ne,t as Pe}from"./run-again-hwgO0X30.js";import{t as Fe}from"./not-found-Bexl2Syq.js";import{i as W,n as G,r as K,t as q}from"./section-BwxXJ9H0.js";var J=t(),Ie=e=>e.postedAt===null?e.attemptEndedAt===null?null:{at:e.attemptEndedAt,title:`Posted during the attempt that ended ${j(e.attemptEndedAt)}`}:{at:e.postedAt,title:`Posted ${j(e.postedAt)}`},Le=({task:e})=>{let t=new Map(e.runs.map(e=>[e.id,e])),n=new Map(e.items.map(e=>[e.itemKey,e]));return(0,J.jsxs)(`section`,{"aria-labelledby":`task-comments`,className:`flex flex-col gap-2`,children:[(0,J.jsx)(G,{id:`task-comments`,title:`Comments and reviews`,count:e.comments.length}),e.comments.length===0?(0,J.jsx)(q,{title:`No comments or reviews`,children:`Comments and reviews an agent posts on the task's items appear here after the attempt ends`}):(0,J.jsx)(`div`,{className:`-mx-2`,children:(0,J.jsx)(H,{"aria-labelledby":`task-comments`,children:(0,J.jsx)(z,{className:`border-t`,children:e.comments.map(e=>{let r=t.get(e.runId),i=r===void 0?void 0:n.get(r.itemKey),a=Ie(e);return(0,J.jsxs)(B,{className:K,children:[(0,J.jsx)(U,{className:`py-3 whitespace-normal`,children:(0,J.jsxs)(`a`,{"data-row-link":!0,href:e.url,target:`_blank`,rel:`noreferrer`,className:`font-medium ${W}`,children:[je(e.kind),i!==void 0&&(0,J.jsxs)(`span`,{className:`ml-2 text-xs font-normal text-muted-foreground`,children:[`on `,(0,J.jsx)(l,{item:i,linked:!1})]})]})}),(0,J.jsx)(V,{className:`py-3`,children:r!==void 0&&(0,J.jsx)(x,{to:`/projects/$owner/$name/runs/$run`,params:{..._(r.repository),run:r.id},className:`relative z-10 rounded-sm text-muted-foreground underline-offset-4 outline-none hover:text-foreground hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring/70 focus-visible:outline-solid`,children:r.loop})}),(0,J.jsx)(V,{className:`py-3 text-right`,children:a!==null&&(0,J.jsx)(`time`,{dateTime:a.at,title:a.title,className:`font-mono text-xs text-muted-foreground tabular-nums`,children:A(a.at)})})]},e.url)})})})})]})},Re=({task:e,project:t,disabled:n})=>{let r=re(t),[l]=e.items,u=e.items.find(({itemKey:t})=>t===e.current)??l,d=t.board.lanes.flatMap(e=>e.items.map(t=>({lane:e,card:t}))).find(({card:t})=>t.itemKey===e.current),f=d===void 0?void 0:r.moves.find(({itemKey:e})=>e===d.card.itemKey),p=d===void 0?[]:t.board.lanes.filter(e=>e._tag===`WritableBoardLane`&&e.id!==d.lane.id),m=t.board.lanes.find(({id:e})=>e===f?.toLane)?.name??d?.lane.name??e.lane.name,h=new Set(t.board.lanes.flatMap(e=>e._tag===`WritableBoardLane`?e.labels:[])),g=d===void 0?u.labels:te(d.card,d.lane).filter(e=>f===void 0||!h.has(e)),_=new Map(t.labels.map(e=>[e.name,e])),v=!n&&!r.isPending&&f===void 0&&p.length>0,{origin:y,pullRequests:b}=c(e.items);return(0,J.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,J.jsx)(a,{actionsBeside:`sm`,heading:(0,J.jsx)(Te,{variant:`page`,item:de(y),title:e.title}),facts:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Ee,{pullRequests:b}),(0,J.jsx)(i,{icon:Ce,title:`Lane`,children:(0,J.jsx)(`span`,{className:`text-foreground`,children:m})}),f!==void 0&&(0,J.jsx)(`span`,{role:`status`,children:ee(f.phase)}),g.length>0&&(0,J.jsx)(`span`,{className:`flex flex-wrap gap-1`,children:g.map(e=>(0,J.jsx)(ke,{name:e,label:_.get(e)},e))}),e.needsYou&&(0,J.jsx)(De,{})]}),...d!==void 0&&v?{actions:(0,J.jsxs)(T,{children:[(0,J.jsxs)(E,{render:(0,J.jsx)(O,{variant:`outline`}),"aria-label":`Move ${s(u)} to another lane`,children:[`Move to`,(0,J.jsx)(ie,{"data-icon":`inline-end`,"aria-hidden":`true`})]}),(0,J.jsx)(C,{align:`end`,className:`w-auto min-w-40`,children:(0,J.jsx)(w,{children:p.map(e=>(0,J.jsx)(S,{onClick:()=>r.moveItem(d.card,e),children:e.name},e.id))})})]})}:{}}),r.error!==null&&(0,J.jsx)(o,{className:`max-w-3xl`,message:r.error.message})]})},ze=({task:e})=>{let t=e.items.filter(({kind:e})=>e===`pr`);return(0,J.jsxs)(`section`,{"aria-labelledby":`task-pull-requests`,className:`flex flex-col gap-2`,children:[(0,J.jsx)(G,{id:`task-pull-requests`,title:`Pull requests`,count:t.length}),t.length===0?(0,J.jsx)(q,{title:`No pull requests`,children:`Pull requests that close the issue, or that a run on the issue opened, appear here`}):(0,J.jsx)(`div`,{className:`-mx-2`,children:(0,J.jsx)(H,{"aria-labelledby":`task-pull-requests`,children:(0,J.jsx)(z,{className:`border-t`,children:t.map(e=>(0,J.jsxs)(B,{className:K,children:[(0,J.jsx)(V,{className:`w-0 py-3`,children:(0,J.jsx)(l,{item:e,linked:!1})}),(0,J.jsx)(U,{className:`py-3 whitespace-normal`,children:(0,J.jsxs)(`a`,{"data-row-link":!0,href:e.url,target:`_blank`,rel:`noreferrer`,className:`font-medium wrap-anywhere ${W}`,children:[e.title,(0,J.jsx)(ne,{className:`ml-1.5 inline size-3.5 text-muted-foreground`,"aria-label":`Opens on GitHub`})]})}),(0,J.jsx)(V,{className:`py-3 text-right`,children:e.conflicting&&(0,J.jsx)(`span`,{className:`text-xs text-destructive`,children:`Conflicts with base`})})]},e.itemKey))})})})]})},Y=n(e(),1),X=({run:e})=>{let t=we(3e4);return k(Me(e,t),{onNone:()=>null,onSome:e=>(0,J.jsx)(`span`,{className:`font-mono text-xs tabular-nums`,title:`Total attempt time`,children:fe(e)})})},Be=({run:e})=>k(Ae(e),{onNone:()=>null,onSome:e=>(0,J.jsxs)(`p`,{className:`line-clamp-2 text-xs wrap-anywhere`,title:h(e),children:[(0,J.jsx)(`span`,{className:`font-medium text-destructive`,children:m(e)}),` `,(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:h(e)})]})}),Z=({run:e})=>(0,J.jsx)(`time`,{dateTime:e.openedAt,title:`Opened ${j(e.openedAt)}`,className:`font-mono text-xs whitespace-nowrap tabular-nums`,children:A(e.openedAt)}),Q=({pullRequest:e})=>k(e,{onNone:()=>null,onSome:e=>(0,J.jsx)(l,{item:e,className:`relative z-10`})}),Ve=(e,t)=>`${e} ${t}${e===1?``:`s`}`,$=({run:e,pullRequest:t})=>(0,J.jsxs)(`p`,{className:`flex flex-wrap items-baseline gap-x-3 gap-y-0.5 text-xs text-muted-foreground xl:hidden`,children:[(0,J.jsx)(`span`,{className:`font-medium text-foreground sm:hidden`,children:e.state}),(0,J.jsx)(`span`,{children:e.agent}),(0,J.jsx)(`span`,{children:Ve(e.attempts.length,`attempt`)}),(0,J.jsx)(X,{run:e}),(0,J.jsx)(Z,{run:e}),(0,J.jsx)(Q,{pullRequest:t})]}),He=e=>e.canApprove?`approve`:e.canRetry&&e.canResolveFailure?`retry`:null,Ue=({run:e,onEdit:t,openRun:n,status:r})=>{let i=ge(),a=ve(),[o,s]=(0,Y.useState)(!1);if(i.isPending&&i.variables!==void 0)return(0,J.jsx)(`span`,{role:`status`,className:`text-xs text-muted-foreground`,children:v[i.variables.request.action]});if(a.isPending)return(0,J.jsx)(`span`,{role:`status`,className:`text-xs text-muted-foreground`,children:d});let c=t=>i.mutate({runId:e.id,request:t},{onSuccess:()=>r(null),onError:e=>r((0,J.jsx)(`span`,{className:`text-destructive`,children:e.message}))}),l=()=>a.mutate(_e(e),{onSuccess:e=>{e._tag===`Claimed`?(r(null),n(e.runId)):r((0,J.jsx)(`span`,{className:`text-needs-you`,children:f}))},onError:e=>r((0,J.jsx)(`span`,{className:`text-destructive`,children:e.message}))}),u=e.attempts.at(-1),m=He(e),h=u?.outcome?._tag===`Failed`&&u.outcome.failure._tag===`QuestionFailure`,g=[];return e.canApprove&&m!==`approve`&&g.push({label:p.approve,select:()=>c({action:`approve`})}),e.canRetry&&m!==`retry`&&g.push({label:p.retry,description:y(e.agentBrain),select:()=>c({action:`retry`})}),e.canRetry&&g.push({label:`Edit and retry`,select:()=>t(`retry`)}),e.canRunAgain&&(g.push({label:p.runAgain,select:l}),g.push({label:`Edit and run again`,select:()=>t(`runAgain`)})),e.canResolveFailure&&u!==void 0&&g.push({label:h?`Mark answered`:`Mark resolved`,select:()=>c({action:`resolveFailure`,attemptId:u.id})}),e.canCancel&&g.push({label:p.cancel,destructive:!0,select:()=>s(!0)}),(0,J.jsxs)(`div`,{className:`relative z-10 flex items-center justify-end gap-1`,children:[m!==null&&(0,J.jsx)(O,{variant:`outline`,size:`sm`,title:m===`retry`?y(e.agentBrain):void 0,onClick:()=>c({action:m}),children:p[m]}),g.length>0&&(0,J.jsxs)(T,{children:[(0,J.jsx)(E,{render:(0,J.jsx)(O,{variant:`ghost`,size:`icon-sm`,className:`text-muted-foreground hover:text-foreground aria-expanded:text-foreground`}),"aria-label":`Actions for the ${e.loop} run opened ${A(e.openedAt)}`,children:(0,J.jsx)(se,{weight:`bold`,className:`size-4`,"aria-hidden":`true`})}),(0,J.jsx)(C,{align:`end`,className:`w-auto min-w-44`,children:(0,J.jsx)(w,{children:g.map(({label:e,description:t,destructive:n,select:r})=>(0,J.jsx)(S,{title:t,variant:n===!0?`destructive`:`default`,onClick:r,children:e},e))})})]}),e.canCancel&&(0,J.jsx)(me,{open:o,onOpenChange:s,children:(0,J.jsxs)(ye,{children:[(0,J.jsxs)(M,{children:[(0,J.jsxs)(be,{children:[`Cancel `,e.loop,`?`]}),(0,J.jsx)(xe,{children:`The run stops, including any attempt in progress.`})]}),(0,J.jsxs)(P,{children:[(0,J.jsx)(Se,{children:p.keepRunning}),(0,J.jsx)(N,{variant:`destructive`,onClick:()=>{s(!1),c({action:`cancel`})},children:p.confirmCancel})]})]})})]})},We=8,Ge=({run:e,item:t,pullRequest:n,openRun:r})=>{let[i,a]=(0,Y.useState)(null),[o,s]=(0,Y.useState)(null);return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(B,{className:D(K,`[&>td]:align-top`),children:[(0,J.jsx)(V,{className:`hidden py-3 sm:table-cell`,children:(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-foreground`,children:[(0,J.jsx)(L,{state:e.state}),e.state]})}),(0,J.jsx)(U,{className:`py-3 whitespace-normal`,children:(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,J.jsxs)(`p`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,J.jsx)(L,{state:e.state,className:`self-center sm:hidden`}),(0,J.jsx)(x,{"data-row-link":!0,to:`/projects/$owner/$name/runs/$run`,params:{..._(e.repository),run:e.id},className:D(`font-medium wrap-anywhere`,W),children:e.loop}),t!==null&&(0,J.jsx)(l,{item:t,className:`relative z-10 shrink-0`})]}),(0,J.jsx)(Be,{run:e}),e.runAgain!==null&&(0,J.jsx)(Pe,{run:e,source:`link`,className:`text-xs`}),e.approval!==null&&(0,J.jsx)(Ne,{approval:e.approval,className:`text-xs`}),(0,J.jsx)($,{run:e,pullRequest:n}),o!==null&&(0,J.jsx)(`p`,{role:`status`,className:`text-xs`,children:o})]})}),(0,J.jsx)(V,{className:`hidden py-3 xl:table-cell`,children:e.agent}),(0,J.jsx)(V,{className:`hidden py-3 text-right tabular-nums xl:table-cell`,children:e.attempts.length}),(0,J.jsx)(V,{className:`hidden py-3 text-right xl:table-cell`,children:(0,J.jsx)(X,{run:e})}),(0,J.jsx)(V,{className:`hidden py-3 xl:table-cell`,children:(0,J.jsx)(Z,{run:e})}),(0,J.jsx)(V,{className:`hidden py-3 xl:table-cell`,children:(0,J.jsx)(Q,{pullRequest:n})}),(0,J.jsx)(V,{className:`py-2.5`,children:(0,J.jsx)(Ue,{run:e,onEdit:a,openRun:r,status:s})})]}),i!==null&&ae(e,i)&&(0,J.jsx)(B,{className:`hover:bg-transparent`,children:(0,J.jsx)(V,{colSpan:We,className:`px-2 pt-1 pb-4 whitespace-normal`,children:(0,J.jsx)(oe,{run:e,intent:i,close:()=>a(null),openRun:r,className:`max-w-2xl rounded-lg border p-4`},`${e.id}:${i}`)})})]})},Ke=({task:e,openRun:t})=>{let n=new Map(e.items.map(e=>[e.itemKey,e])),r=e.items.length>1;return(0,J.jsxs)(`section`,{"aria-labelledby":`task-runs`,className:`flex flex-col gap-2`,children:[(0,J.jsx)(G,{id:`task-runs`,title:`Runs`,count:e.runs.length}),e.runs.length===0?(0,J.jsx)(q,{title:`No runs yet`,children:`A run opens when a loop's trigger matches one of the task's items`}):(0,J.jsx)(`div`,{className:`-mx-2`,children:(0,J.jsxs)(H,{children:[(0,J.jsx)(Oe,{children:(0,J.jsxs)(B,{className:`hover:bg-transparent`,children:[(0,J.jsx)(R,{className:`hidden sm:table-cell`,children:`State`}),(0,J.jsx)(R,{children:`Run`}),(0,J.jsx)(R,{className:`hidden xl:table-cell`,children:`Agent`}),(0,J.jsx)(R,{className:`hidden text-right xl:table-cell`,children:`Attempts`}),(0,J.jsx)(R,{className:`hidden text-right xl:table-cell`,children:`Duration`}),(0,J.jsx)(R,{className:`hidden xl:table-cell`,children:`Opened`}),(0,J.jsx)(R,{className:`hidden xl:table-cell`,children:`Pull request`}),(0,J.jsx)(R,{children:(0,J.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,J.jsx)(z,{children:e.runs.map(i=>{let a=ce(le(i.pullRequestUrl),t=>u(t,e.items)),o=r?n.get(i.itemKey)??null:null;return(0,J.jsx)(Ge,{run:i,item:o===null||ue(a,({number:e})=>e===o.number)?null:o,pullRequest:a,openRun:t},i.id)})})]})})]})},qe=({children:e})=>(0,J.jsx)(`main`,{className:`px-4 pt-5 pb-10 md:px-5`,children:(0,J.jsx)(`div`,{className:`flex max-w-5xl flex-col gap-8`,children:e})}),Je=({repository:e,number:t})=>{let{data:n}=r(g()),i=n.projects.find(t=>t.repository===e),a=he(),s=r(F(e,t));if(s.error instanceof pe&&s.error.error===`BoardItemNotFoundError`)return(0,J.jsx)(Fe,{repository:e,number:String(t)});let c=s.isError&&(0,J.jsx)(o,{className:`max-w-3xl`,title:`Could not refresh the task`,message:s.error.message}),l=s.data;return l.number===t?(0,J.jsxs)(qe,{children:[c,i!==void 0&&(0,J.jsx)(Re,{task:l,project:i,disabled:n._tag===`NeedsSetup`}),(0,J.jsx)(Ke,{task:l,openRun:a}),(0,J.jsx)(ze,{task:l}),(0,J.jsx)(Le,{task:l})]}):(0,J.jsx)(b,{to:`/projects/$owner/$name/tasks/$number`,params:{..._(e),number:String(l.number)},search:e=>e,replace:!0})},Ye=()=>{let{repository:e}=I.useParams(),{number:t}=I.useLoaderData();return(0,J.jsx)(Je,{repository:e,number:t},`${e}#${t}`)};export{Ye as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{W as e}from"./index-C1tcW0Kz.js";var t=e;export{t as errorComponent};
|