@codeuxai/codeux 0.8.1 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dashboard/dist/assets/{AgentAvatarScene-DAjdNR8q.js → AgentAvatarScene-3Fa3RQHc.js} +1 -1
- package/dashboard/dist/assets/{AgentsPage-dG7HaQww.js → AgentsPage-woorcNHq.js} +2 -2
- package/dashboard/dist/assets/{BackgroundManager-CxjNC7ME.js → BackgroundManager-DbgGcx7x.js} +1 -1
- package/dashboard/dist/assets/{BranchNameSchemeEditor-wfv629Ml.js → BranchNameSchemeEditor-Bk2p-g2z.js} +1 -1
- package/dashboard/dist/assets/{BrowserPage-5eFh6pZt.js → BrowserPage-BLTJo_tK.js} +1 -1
- package/dashboard/dist/assets/{ChatPage-CfunB4-0.js → ChatPage-BljTU3OV.js} +1 -1
- package/dashboard/dist/assets/{ErrorPage-CEHtK2Hk.js → ErrorPage-DgYd7CGv.js} +1 -1
- package/dashboard/dist/assets/{FileBrowserPage-BOVIkrrv.js → FileBrowserPage-ChIelEM6.js} +1 -1
- package/dashboard/dist/assets/{KnowledgePage-CeKSiAys.js → KnowledgePage-DP7v0vk3.js} +1 -1
- package/dashboard/dist/assets/{ListWindowSelector-cshzGFot.js → ListWindowSelector-DtKcmXGY.js} +1 -1
- package/dashboard/dist/assets/{MemoryPage-Cctk6NFp.js → MemoryPage-2N_EfqqO.js} +1 -1
- package/dashboard/dist/assets/{OverviewTelemetry-D_V7-M2H.js → OverviewTelemetry-C1hoOMVQ.js} +1 -1
- package/dashboard/dist/assets/{ProjectsPage-D8ICYJVv.js → ProjectsPage-CEn6QDXI.js} +1 -1
- package/dashboard/dist/assets/{SchedulerPage-BM0sGrEZ.js → SchedulerPage-BDTm8Q3w.js} +1 -1
- package/dashboard/dist/assets/{SettingsPage-BlDplYC7.js → SettingsPage-CvSsreD8.js} +1 -1
- package/dashboard/dist/assets/{SprintBoatRace-DaP10JYZ.js → SprintBoatRace-Ryphd2ZR.js} +1 -1
- package/dashboard/dist/assets/{SprintDag-DbxJdjBK.js → SprintDag-BLP6gb8k.js} +1 -1
- package/dashboard/dist/assets/{SprintsPage-XGhd04Sn.js → SprintsPage-DORSqECT.js} +1 -1
- package/dashboard/dist/assets/{StatsPage-CrSwtTGq.js → StatsPage-BODQk1cJ.js} +1 -1
- package/dashboard/dist/assets/{TasksPage-DNpVBxt6.js → TasksPage-PeouQ4EB.js} +1 -1
- package/dashboard/dist/assets/{index-BViPTeJx.js → index-DddY8OV0.js} +5 -5
- package/dashboard/dist/assets/{monaco.contribution-KtWzfVt5.js → monaco.contribution-Bxle9Jvf.js} +2 -2
- package/dashboard/dist/assets/{tsMode-CalcmZZa.js → tsMode-BYb4cdGe.js} +1 -1
- package/dashboard/dist/index.html +1 -1
- package/package.json +1 -1
- package/.code-ux/debug.log +0 -97190
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{O as e,P as t,S as n,_ as r,a as i,c as a,f as o,h as s,j as c,k as l,o as u,v as d,w as f,x as p,y as m}from"./vendor-Dl0fhdV0.js";import{t as h}from"./createLucideIcon-BshUfn15.js";import{i as g,n as _,r as v,t as y}from"./list-todo-DJl-wxIV.js";import{n as b,t as x}from"./message-square-DiaHza4H.js";import{n as S,t as C}from"./sliders-horizontal-6rJeI8Qo.js";import{t as w}from"./link-BfFF-gXK.js";import{t as T}from"./ListWindowSelector-cshzGFot.js";import{a as E,i as D,n as O,o as k,r as A,t as j}from"./quicksprint-api-BQTtbGzW.js";import{t as M}from"./save-DFYp4CAL.js";import{t as N}from"./server-Colb_cUG.js";import{t as P}from"./settings-2-B5NbDo8J.js";import{n as ee,r as F,t as I}from"./user-round-B1T_51SC.js";import{t as L}from"./upload-CU4ugZOr.js";import{t as R}from"./wrench-DSVlxBRn.js";import{A as z,B,F as te,H as V,I as ne,J as re,N as ie,O as H,U as ae,V as oe,W as U,X as se,g as W,h as ce,i as le,j as G,k as ue,q as K,r as de,y as fe,z as pe}from"./project-data-BSCsMQnj.js";import{a as me,c as he,d as ge,i as _e,n as ve,o as q,r as ye,t as J}from"./use-reduced-motion-Dxh6NCDM.js";import{Ai as be,Ar as xe,B as Se,Br as Ce,C as we,Cr as Te,D as Ee,Dt as De,Er as Oe,Fr as ke,Gr as Ae,Hr as je,I as Y,Ir as Me,J as Ne,Jr as Pe,K as Fe,L as Ie,Li as Le,M as Re,Mi as ze,Mr as Be,N as Ve,Nr as He,Oi as Ue,Or as We,Ot as Ge,P as Ke,Pi as qe,Qr as Je,S as Ye,Si as Xe,Sr as Ze,St as Qe,Ti as $e,Tn as et,Tr as tt,U as nt,Ur as rt,Vr as X,Yr as it,Yt as at,_ as ot,_r as st,ai as ct,ar as lt,at as ut,b as dt,cn as ft,cr as pt,ct as mt,dr as ht,ei as gt,et as _t,fi as vt,fn as yt,fr as bt,ft as xt,g as St,gr as Ct,gt as wt,h as Tt,hi as Et,hr as Dt,ht as Ot,i as Z,ii as kt,it as At,jr as jt,jt as Mt,kt as Nt,li as Pt,ln as Ft,m as It,mr as Lt,mt as Rt,n as zt,ni as Bt,nn as Vt,nt as Ht,on as Ut,or as Q,pi as Wt,pr as $,pt as Gt,qr as Kt,r as qt,ri as Jt,rt as Yt,si as Xt,sn as Zt,sr as Qt,st as $t,t as en,tn,u as nn,vi as rn,wr as an,wt as on,x as sn,y as cn,yr as ln,zi as un,zr as dn}from"./index-BViPTeJx.js";import{r as fn,t as pn}from"./PlanningShip-BejkTCIr.js";import{a as mn,n as hn,o as gn,r as _n,t as vn}from"./BranchNameSchemeEditor-wfv629Ml.js";import{n as yn}from"./list-window-BtcrCL8y.js";var bn=h(`accessibility`,[[`circle`,{cx:`16`,cy:`4`,r:`1`,key:`1grugj`}],[`path`,{d:`m18 19 1-7-6 1`,key:`r0i19z`}],[`path`,{d:`m5 8 3-3 5.5 3-2.36 3.5`,key:`9ptxx2`}],[`path`,{d:`M4.24 14.5a5 5 0 0 0 6.88 6`,key:`10kmtu`}],[`path`,{d:`M13.76 17.5a5 5 0 0 0-6.88-6`,key:`2qq6rc`}]]),xn=h(`bug`,[[`path`,{d:`M12 20v-9`,key:`1qisl0`}],[`path`,{d:`M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z`,key:`uouzyp`}],[`path`,{d:`M14.12 3.88 16 2`,key:`qol33r`}],[`path`,{d:`M21 21a4 4 0 0 0-3.81-4`,key:`1b0z45`}],[`path`,{d:`M21 5a4 4 0 0 1-3.55 3.97`,key:`5cxbf6`}],[`path`,{d:`M22 13h-4`,key:`1jl80f`}],[`path`,{d:`M3 21a4 4 0 0 1 3.81-4`,key:`1fjd4g`}],[`path`,{d:`M3 5a4 4 0 0 0 3.55 3.97`,key:`1d7oge`}],[`path`,{d:`M6 13H2`,key:`82j7cp`}],[`path`,{d:`m8 2 1.88 1.88`,key:`fmnt4t`}],[`path`,{d:`M9 7.13V6a3 3 0 1 1 6 0v1.13`,key:`1vgav8`}]]),Sn=h(`calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),Cn=h(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),wn=h(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),Tn=h(`file-search`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`11.5`,cy:`14.5`,r:`2.5`,key:`1bq0ko`}],[`path`,{d:`M13.3 16.3 15 18`,key:`2quom7`}]]),En=h(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),Dn=h(`gitlab`,[[`path`,{d:`m22 13.29-3.33-10a.42.42 0 0 0-.14-.18.38.38 0 0 0-.22-.11.39.39 0 0 0-.23.07.42.42 0 0 0-.14.18l-2.26 6.67H8.32L6.1 3.26a.42.42 0 0 0-.1-.18.38.38 0 0 0-.26-.08.39.39 0 0 0-.23.07.42.42 0 0 0-.14.18L2 13.29a.74.74 0 0 0 .27.83L12 21l9.69-6.88a.71.71 0 0 0 .31-.83Z`,key:`148pdi`}]]),On=h(`hammer`,[[`path`,{d:`m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9`,key:`1hayfq`}],[`path`,{d:`m18 15 4-4`,key:`16gjal`}],[`path`,{d:`m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5`,key:`15ts47`}]]),kn=h(`heart`,[[`path`,{d:`M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5`,key:`mvr1a0`}]]),An=h(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),jn=h(`list-plus`,[[`path`,{d:`M16 5H3`,key:`m91uny`}],[`path`,{d:`M11 12H3`,key:`51ecnj`}],[`path`,{d:`M16 19H3`,key:`zzsher`}],[`path`,{d:`M18 9v6`,key:`1twb98`}],[`path`,{d:`M21 12h-6`,key:`bt1uis`}]]),Mn=h(`microscope`,[[`path`,{d:`M6 18h8`,key:`1borvv`}],[`path`,{d:`M3 22h18`,key:`8prr45`}],[`path`,{d:`M14 22a7 7 0 1 0 0-14h-1`,key:`1jwaiy`}],[`path`,{d:`M9 14h2`,key:`197e7h`}],[`path`,{d:`M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z`,key:`1bmzmy`}],[`path`,{d:`M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3`,key:`1drr47`}]]),Nn=h(`paintbrush`,[[`path`,{d:`m14.622 17.897-10.68-2.913`,key:`vj2p1u`}],[`path`,{d:`M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z`,key:`18tc5c`}],[`path`,{d:`M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15`,key:`ytzfxy`}]]),Pn=h(`rocket`,[[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}],[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09`,key:`u4xsad`}],[`path`,{d:`M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z`,key:`676m9`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05`,key:`92ym6u`}]]),Fn=h(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),In=h(`test-tube-diagonal`,[[`path`,{d:`M21 7 6.82 21.18a2.83 2.83 0 0 1-3.99-.01a2.83 2.83 0 0 1 0-4L17 3`,key:`1ub6xw`}],[`path`,{d:`m16 2 6 6`,key:`1gw87d`}],[`path`,{d:`M12 16H4`,key:`1cjfip`}]]),Ln=h(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]);c(),p(),o(),c();var Rn=()=>i(`div`,{role:`separator`,className:`my-1 h-px bg-black/[0.06] dark:bg-white/[0.07]`}),zn=({sprint:t,isCompleted:n=!1,showcaseBusy:r=!1,markCompletedDisabled:a=!1,deleteBusy:o=!1,isRunning:s=!1,isPaused:c=!1,primaryBusy:l=!1,pauseResumeBusy:u=!1,onPrimaryAction:d,onPauseResume:f,onAddTasks:p,viewTasksHref:m,onEdit:h,onExport:g,onToggleShowcase:_,onOverrides:v,onMarkCompleted:b,onDelete:x,onClose:S,markCompletedIcon:C=`circle`,role:w,buttonClassName:T=`flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-left text-xs font-medium text-slate-600 transition-colors hover:bg-black/[0.04] hover:text-slate-900 dark:text-slate-300 dark:hover:bg-white/[0.05] dark:hover:text-white focus:outline-none focus-visible:ring-2 focus-visible:ring-signal-500/30 focus-visible:ring-offset-2`})=>{let E=T.replace(/text-slate-600 transition-colors hover:bg-black\/\[0\.04\] hover:text-slate-900/,`text-status-red hover:bg-status-red/10`).replace(/dark:text-slate-300 dark:hover:bg-white\/\[0\.05\] dark:hover:text-white/,``).replace(/focus-visible:ring-signal-500\/30/,`focus-visible:ring-status-red/30`),D=`${T} disabled:cursor-not-allowed disabled:opacity-40`,O=!!f&&(s||c);return i(e,{children:[(!!d||O||!!m||!!p)&&i(e,{children:[d&&i(`button`,{type:`button`,role:w,onClick:()=>{S?.(),d()},disabled:l,className:D,children:[l?i(X,{className:`h-3.5 w-3.5 animate-spin`,strokeWidth:2.1}):i(s?an:He,{className:`h-3.5 w-3.5`,fill:`currentColor`,strokeWidth:2.1}),s?`Stop Sprint`:`Start Sprint`]}),O&&i(`button`,{type:`button`,role:w,onClick:()=>{S?.(),f?.()},disabled:u,className:D,children:[u?i(X,{className:`h-3.5 w-3.5 animate-spin`,strokeWidth:2.1}):i(c?He:ke,{className:`h-3.5 w-3.5`,fill:`currentColor`,strokeWidth:2.1}),c?`Resume`:`Pause`]}),m&&i(`a`,{href:m,role:w,onClick:()=>S?.(),"aria-label":`View tasks for sprint ${t.name}`,className:T,children:[i(dn,{className:`h-3.5 w-3.5`,strokeWidth:2.1}),`View Tasks`]}),p&&i(`button`,{type:`button`,role:w,onClick:()=>{S?.(),p()},className:T,children:[i(y,{className:`h-3.5 w-3.5`,strokeWidth:2.1}),`Add Tasks`]}),i(Rn,{})]}),i(`button`,{type:`button`,role:w,onClick:()=>{S?.(),h?.()},"aria-label":`Edit sprint ${t.name}`,className:T,children:[i(k,{className:`h-3.5 w-3.5`,strokeWidth:2.1}),`Edit`]}),i(`button`,{type:`button`,role:w,onClick:()=>{S?.(),g?.()},"aria-label":`Export sprint ${t.name}`,className:T,children:[i(Cn,{className:`h-3.5 w-3.5`,strokeWidth:2.1}),`Export`]}),i(`button`,{type:`button`,role:w,onClick:()=>{S?.(),v?.()},"aria-label":`Configure overrides for sprint ${t.name}`,className:T,children:[i(tt,{className:`h-3.5 w-3.5`,strokeWidth:2.1}),`Overrides`]}),i(`button`,{type:`button`,role:w,onClick:()=>{S?.(),_?.()},disabled:r,className:D,children:[i(kn,{className:`h-3.5 w-3.5`,fill:t.showcasePinned?`currentColor`:`none`,strokeWidth:2.1}),t.showcasePinned?`Remove`:`Add`]}),i(Rn,{}),!n&&i(`button`,{type:`button`,role:w,onClick:()=>{S?.(),b?.()},disabled:a,"aria-label":`Mark sprint ${t.name} as completed`,className:D,children:[i(C===`square`?F:rn,{className:`h-3.5 w-3.5`,strokeWidth:2.1}),`Mark Completed`]}),i(`button`,{type:`button`,role:w,onClick:()=>{S?.(),x?.()},disabled:o,"aria-label":`Delete sprint ${t.name}`,className:o?`${E} disabled:cursor-not-allowed disabled:opacity-40`:E,children:[o?i(X,{className:`h-3.5 w-3.5 animate-spin`,strokeWidth:2.1}):i(Et,{className:`h-3.5 w-3.5`,strokeWidth:2.1}),o?`Deleting...`:`Delete`]})]})},Bn=({children:r,content:a,position:o=`bottom`,align:c=`start`,gap:p=8,className:h=``,isOpen:g,onOpenChange:_,triggerRef:v,computePosition:y})=>{let b=J(),x=bt(),[S,C]=m(!1),w=s(null),T=v||w,E=s(null),D=s(null),[O,k]=m({top:0,left:0}),[A,j]=m(`top center`),[M]=m(()=>`menu-${Math.random().toString(36).substr(2,9)}`),N=n(()=>{if(!T.current||!E.current)return;let e=T.current.getBoundingClientRect(),t=E.current.getBoundingClientRect();if(y){let n=y({triggerRect:e,menuRect:t,viewport:{width:window.innerWidth,height:window.innerHeight},defaultPosition:o,defaultAlign:c,gap:p});k({top:n.top,left:n.left}),j(n.transformOrigin??`top center`);return}let{top:n,left:r}=tn({triggerRect:e,contentRect:t,position:o,align:c,gap:p,padding:8});k({top:n,left:r}),j(`top center`)},[c,y,p,o,T]);return f(()=>{g?(C(!0),D.current=document.activeElement):S&&(!document.activeElement||document.activeElement===document.body||E.current&&E.current.contains(document.activeElement))&&(D.current?.isConnected?(D.current.focus({preventScroll:!0}),D.current=null):T.current?.isConnected&&T.current.focus({preventScroll:!0}))},[g]),d(()=>{g&&S&&N()},[g,S,N]),f(()=>{if(g)return window.addEventListener(`resize`,N),window.addEventListener(`scroll`,N,{capture:!0,passive:!0}),()=>{window.removeEventListener(`resize`,N),window.removeEventListener(`scroll`,N,{capture:!0})}},[g,N]),d(()=>{E.current&&($.killTweensOf(E.current),g?($.fromTo(E.current,{opacity:0,scale:.95,y:o===`bottom`?-5:o===`top`?5:0},{opacity:1,scale:1,y:0,duration:b?0:x.enterExit.duration,ease:x.enterExit.ease}),requestAnimationFrame(()=>{(E.current?.querySelector(`[role="menuitem"]:not([disabled]):not([aria-disabled="true"])`))?.focus({preventScroll:!0})})):S&&$.to(E.current,{opacity:0,scale:.95,y:o===`bottom`?-5:o===`top`?5:0,duration:b?0:x.enterExit.duration,ease:x.enterExit.ease,onComplete:()=>C(!1)}))},[g,S,o,b]),f(()=>{let e=e=>{g&&E.current&&!E.current.contains(e.target)&&T.current&&!T.current.contains(e.target)&&_(!1)},t=e=>{if(!g)return;if(e.key===`Escape`){_(!1);return}if(!E.current)return;let t=Array.from(E.current.querySelectorAll(`[role="menuitem"]:not([disabled]):not([aria-disabled="true"])`));if(t.length===0)return;let n=t.findIndex(e=>e===document.activeElement);e.key===`ArrowDown`?(e.preventDefault(),t[(n+1)%t.length]?.focus()):e.key===`ArrowUp`?(e.preventDefault(),t[n===-1?t.length-1:(n-1+t.length)%t.length]?.focus()):e.key===`Home`?(e.preventDefault(),t[0]?.focus()):e.key===`End`?(e.preventDefault(),t[t.length-1]?.focus()):(e.key===`Enter`||e.key===` `)&&document.activeElement&&t.includes(document.activeElement)&&document.activeElement.getAttribute(`role`)===`menuitem`&&(e.preventDefault(),document.activeElement.click())};return g&&(document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t)),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[g,_]),i(e,{children:[t(r)?l(r,{ref:v?void 0:w,onClick:e=>{e.stopPropagation(),_(!g),r.props.onClick&&r.props.onClick(e)},onKeyDown:e=>{!v&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),_(!g)),r.props.onKeyDown&&r.props.onKeyDown(e)},"aria-haspopup":`menu`,"aria-expanded":g,"aria-controls":g?M:void 0}):i(`button`,{type:`button`,ref:v?void 0:w,className:`inline-flex cursor-pointer text-left`,onClick:e=>{e.stopPropagation(),_(!g)},onKeyDown:e=>{!v&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),_(!g))},"aria-haspopup":`menu`,"aria-expanded":g,"aria-controls":g?M:void 0,children:r}),S&&typeof document<`u`&&u(i(`div`,{id:M,ref:E,role:`menu`,className:`fixed z-[100] bg-white dark:bg-void-800 border border-black/[0.08] dark:border-white/[0.08] shadow-[0_16px_36px_rgba(15,23,42,0.14)] dark:shadow-[0_16px_36px_rgba(0,0,0,0.4)] rounded-2xl p-2 ${g?``:`pointer-events-none`} ${h}`,style:{top:O.top,left:O.left,transformOrigin:A},onClick:e=>e.stopPropagation(),children:a}),document.body)]})},Vn=8,Hn=8;function Un(e,t,n){let r=Math.min(n.width,Math.max(0,t.width-Vn*2)),i=Math.min(n.height,Math.max(0,t.height-Vn*2)),a=e.right-r,o=t.width-r-Vn,s=Math.max(Vn,Math.min(a,o)),c=e.bottom+Hn,l=c+i<=t.height-Vn;return{top:l?c:Math.max(Vn,e.top-i-Hn),left:s,placement:l?`bottom`:`top`,transformOrigin:l?`top right`:`bottom right`}}p();var Wn=new Intl.DateTimeFormat(`en-US`,{month:`short`,day:`numeric`}),Gn={running:{ring:`border-status-green/45 shadow-[0_0_34px_rgba(0,171,132,0.28)]`,text:`text-status-green`,icon:qe,label:`Running`,accentHex:`#00AB84`},paused:{ring:`border-status-amber/45 shadow-[0_0_34px_rgba(245,158,11,0.24)]`,text:`text-status-amber`,icon:vt,label:`Paused`,accentHex:`#F59E0B`},completed:{ring:`border-slate-300/50 shadow-[0_0_24px_rgba(148,163,184,0.18)]`,text:`text-slate-500 dark:text-slate-400`,icon:rn,label:`Completed`,accentHex:`#94A3B8`},failed:{ring:`border-status-red/55 shadow-[0_0_34px_rgba(227,0,15,0.3)]`,text:`text-status-red`,icon:Et,label:`Failed`,accentHex:`#E3000F`},cancelled:{ring:`border-slate-300/35 shadow-[0_0_24px_rgba(148,163,184,0.16)]`,text:`text-slate-400 dark:text-slate-500`,icon:Et,label:`Cancelled`,accentHex:`#94A3B8`},idle:{ring:``,text:`text-signal-600 dark:text-signal-300`,icon:vt,label:`Draft`,accentHex:`#00E0A0`}},Kn={merge_required:{label:`Merge`,text:`text-purple-600 dark:text-purple-400`,accentHex:`#A855F7`},merge_conflict:{label:`Conflict`,text:`text-status-red`,accentHex:`#E3000F`},ci_fix_required:{label:`CI`,text:`text-blue-600 dark:text-blue-400`,accentHex:`#3B82F6`}},qn=(e,t=`SPR`)=>e.number?`${t}-${e.number}`:e.slug.toUpperCase(),Jn=e=>Wn.format(new Date(e)),Yn=new Intl.DateTimeFormat(`en-US`,{hour:`2-digit`,minute:`2-digit`,hour12:!1}),Xn=e=>Yn.format(new Date(e)),Zn=({sprint:e,isEven:t,accentColor:n,primaryBusy:r=!1,showcaseBusy:a=!1,isPaused:o=!1,pauseResumeBusy:c=!1,humanIntervention:l=null,onPrimaryAction:u,onPauseResume:d,onAddTasks:f,onEdit:p,onDelete:h,onExport:g,onOverrides:_,onToggleShowcase:v,onMarkCompleted:y})=>{let b=ye(e.projectId),x=J(),S=b.data?.settings?.git?.sprintKeyPrefix||`SPR`,C=s(null),[w,T]=m(!1),E=Gn[e.status],D=sn({state:e.status,humanInterventionTitle:l?.title??null,humanInterventionReason:l?.reason??null,humanInterventionInstructions:l?.instructions??null,humanInterventionOwnerType:l?.ownerType??null,attentionType:l?.attentionType??null,completion:e.completion,latestReviewStatus:e.latestReview?.status??null}),O=(e.status===`running`||e.status===`paused`)&&l?.attentionType?Kn[l.attentionType]:void 0,k=D.statusLabel,A=E.text,j=E.accentHex,M=E.icon;k===`QA`?(A=`text-status-amber`,j=`#F59E0B`,M=qe):k===`Merge`?(A=`text-purple-600 dark:text-purple-400`,j=`#A855F7`,M=qe):k===`Merge Conflict`?(A=`text-status-red`,j=`#E3000F`,M=st):O&&(k=O.label,A=O.text,j=O.accentHex);let N=e.status===`completed`,P=e.status===`running`,ee=!!l&&D.showHumanInterventionBadge,F=N?``:t?`animate-organic`:`animate-organic-reverse`,I=x?void 0:{animationDuration:`calc(${pt.timing.slow} * 12)`,animationTimingFunction:pt.easing.standard};return i(`div`,{ref:C,onMouseEnter:()=>{!C.current||N||$.to(C.current,{scale:1.05,rotation:(Math.random()-.5)*4,duration:.8,ease:`elastic.out(1, 0.5)`,overwrite:`auto`})},onMouseLeave:()=>{!C.current||N||$.to(C.current,{scale:1,rotation:0,duration:.95,ease:`elastic.out(1, 0.5)`,overwrite:`auto`})},className:`group relative flex h-72 w-72 shrink-0 cursor-pointer items-center justify-center perspective-1000 lg:h-80 lg:w-80`,children:[i(`div`,{className:`pointer-events-none absolute inset-0 rounded-[1.75rem] shadow-[0_24px_48px_rgba(0,0,0,0.07)] transition-all duration-700 dark:shadow-[0_24px_48px_rgba(0,0,0,0.5)] ${F} ${N?`opacity-80`:``}`}),i(`div`,{className:`absolute inset-0 rounded-[1.75rem] overflow-hidden border border-white/70 backdrop-blur-md transition-all duration-700 transform-gpu dark:border-white/[0.06] ${F} ${N?`opacity-80`:``} ${P?`bg-white/72 dark:bg-void-800/82`:`bg-white/55 dark:bg-void-800/65`}`,style:{WebkitMaskImage:`-webkit-radial-gradient(white, black)`,backfaceVisibility:`hidden`},children:[i(`div`,{className:`absolute inset-0 pointer-events-none shadow-[inset_0_0_0_1px_rgba(255,255,255,0.5)] dark:shadow-[inset_0_0_0_1px_rgba(255,255,255,0.04)] ${F}`}),i(Gt,{accentHex:E.accentHex}),i(xt,{accentHex:E.accentHex})]}),E.ring&&!N&&i(`div`,{className:`absolute inset-0 pointer-events-none mix-blend-screen scale-[1.012] ${F}`,style:{zIndex:10},children:[i(`div`,{className:`absolute inset-0 rounded-[inherit] border border-status-green/50 dark:mix-blend-screen`,style:{borderColor:`${j}70`}}),i(`div`,{className:`absolute inset-0 rounded-[inherit] animate-[pulse_3.5s_ease-in-out_infinite]`,style:{boxShadow:`0 0 20px ${j}40, inset 0 0 10px ${j}20`}})]}),e.latestReview?.status===`running`&&i(`div`,{className:`absolute inset-0 pointer-events-none ${F}`,style:{zIndex:10},children:i(`div`,{className:`absolute inset-0 rounded-[inherit] border-2 border-blue-400/55`})}),N&&i(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center`,children:i($e,{className:`h-40 w-40 text-slate-900/[0.06] dark:text-white/[0.05]`,strokeWidth:1.2})}),i(`div`,{className:`relative z-20 flex h-full w-full flex-col items-center justify-center p-8 text-center`,children:[i(`div`,{className:`absolute top-5 flex items-center gap-1.5 opacity-0 transition-opacity duration-300 group-hover:opacity-100 ${A}`,children:[i(M,{className:`h-3.5 w-3.5 ${P?`animate-pulse`:``}`,strokeWidth:2.5}),i(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.14em]`,children:k})]}),i(`div`,{className:`absolute left-7 top-7 inline-flex flex-col gap-0.5 font-mono text-[10px] font-bold uppercase tracking-[0.14em] ${n}`,children:[i(`div`,{className:`flex items-center gap-1.5`,children:[i(Ue,{className:`h-3.5 w-3.5`,strokeWidth:2.1}),Jn(e.createdAt)]}),i(`div`,{className:`pl-5 opacity-0 transition-opacity duration-300 group-hover:opacity-100`,children:Xn(e.createdAt)})]}),(ee||e.latestReview)&&i(`div`,{className:`absolute right-4 top-4 z-[60] flex items-center gap-2 lg:right-5 lg:top-5`,children:[e.latestReview&&i(Ge,{summary:e.latestReview,compact:!0,align:`right`}),ee&&l&&i(`div`,{className:x?``:`animate-pulse`,style:I,children:i(mt,{summary:l,label:`Needs you`,compact:!0,align:`right`})})]}),i(`div`,{className:`inline-flex items-center gap-1.5 rounded-full border border-black/[0.06] bg-black/[0.03] px-4 py-1.5 font-mono text-[11px] font-bold tracking-[0.14em] transition-transform duration-300 group-hover:-translate-y-3 dark:border-white/[0.06] dark:bg-white/[0.03] ${n}`,children:[i(tt,{className:`h-3.5 w-3.5`,strokeWidth:2.2}),qn(e,S)]}),i(`div`,{className:`mt-4 flex w-full flex-col items-center justify-center gap-3 px-4 transition-transform duration-300 group-hover:-translate-y-3`,children:i(`h3`,{className:`font-display text-2xl font-black leading-tight tracking-tight text-[var(--text-primary)]`,children:e.name})}),i(`div`,{className:`mt-6 flex items-center justify-center gap-7 text-center transition-transform duration-300 group-hover:-translate-y-3`,children:[i(`div`,{className:`flex flex-col items-center`,children:[i(`div`,{className:`font-mono text-[2rem] font-black text-[var(--text-primary)]`,children:e.tasksCount}),i(`div`,{className:`mt-0.5 text-[9px] font-bold uppercase tracking-[0.14em] text-slate-400`,children:`Tasks`})]}),i(`div`,{className:`h-10 w-px bg-black/[0.08] dark:bg-white/[0.08]`}),i(`div`,{className:`flex flex-col items-center`,children:[i(`div`,{className:`font-mono text-[2rem] font-black text-[var(--text-primary)]`,children:[e.completion,`%`]}),i(`div`,{className:`mt-0.5 text-[9px] font-bold uppercase tracking-[0.14em] text-slate-400`,children:`Done`})]})]}),i(`div`,{className:`absolute bottom-5 flex w-full items-center justify-center gap-3 transition-all duration-300 ${w?`translate-y-0 opacity-100`:`translate-y-2 opacity-0 pointer-events-none group-hover:translate-y-0 group-hover:opacity-100 group-hover:pointer-events-auto group-focus-within:translate-y-0 group-focus-within:opacity-100 group-focus-within:pointer-events-auto`}`,children:[i(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),u?.()},disabled:!u||r,className:`touch-target flex h-9 w-9 items-center justify-center rounded-full text-slate-800 transition-all duration-300 dark:text-white focus-visible:ring-2 focus-visible:ring-signal-500/30 focus-visible:ring-offset-2 ${P?`bg-status-red/[0.12] shadow-[0_0_18px_rgba(227,0,15,0.16)] hover:bg-status-red/[0.18]`:`bg-signal-500/[0.12] shadow-[0_0_18px_rgba(0,224,160,0.16)] hover:bg-signal-500/[0.18]`} disabled:cursor-not-allowed disabled:opacity-60`,title:P?`Stop`:`Start`,children:i(P?an:He,{className:`h-3.5 w-3.5 ${r?`animate-pulse`:``}`,fill:`currentColor`})}),i(`a`,{href:`/tasks?sprint=${encodeURIComponent(e.id)}`,onClick:e=>e.stopPropagation(),className:`touch-target inline-flex h-9 items-center gap-1.5 rounded-full bg-slate-900 px-5 text-[10px] font-bold uppercase tracking-[0.14em] text-white shadow-[0_4px_12px_rgba(0,0,0,0.15)] transition-all hover:opacity-85 dark:bg-white dark:text-void-900 focus-visible:ring-2 focus-visible:ring-signal-500/30 focus-visible:ring-offset-2`,children:[`View Tasks`,i(dn,{className:`h-2.5 w-2.5`})]}),i(Bn,{isOpen:w,onOpenChange:T,position:`top`,align:`end`,className:`min-w-[10rem]`,computePosition:({triggerRect:e,menuRect:t,viewport:n})=>Un(e,n,{width:t.width,height:t.height}),content:i(zn,{sprint:e,isCompleted:N,showcaseBusy:a,isRunning:P,isPaused:o,primaryBusy:r,pauseResumeBusy:c,onPrimaryAction:u,onPauseResume:d,onAddTasks:f,viewTasksHref:`/tasks?sprint=${encodeURIComponent(e.id)}`,onEdit:p,onExport:g,onToggleShowcase:v,onOverrides:_,onMarkCompleted:y,onDelete:h,onClose:()=>T(!1),markCompletedIcon:`circle`,role:`menuitem`,buttonClassName:`flex w-full items-center gap-2 rounded-[1rem] px-3 py-2 text-left text-xs font-medium text-slate-600 transition-colors hover:bg-black/[0.04] hover:text-slate-900 dark:text-slate-300 dark:hover:bg-white/[0.05] dark:hover:text-white focus-visible:ring-2 focus-visible:ring-signal-500/30 focus-visible:ring-offset-2`}),children:i(`button`,{type:`button`,"aria-haspopup":`menu`,"aria-expanded":w,className:`touch-target flex h-9 w-9 items-center justify-center rounded-full bg-black/[0.06] text-slate-800 transition-colors hover:bg-black/10 dark:bg-white/[0.07] dark:text-white dark:hover:bg-white/10 focus-visible:ring-2 focus-visible:ring-signal-500/30 focus-visible:ring-offset-2`,title:`Settings`,children:i(wn,{className:`h-3.5 w-3.5`})})})]})]})]})},Qn={query:``,status:`all`,showcase:`all`,qa:`all`},$n={running:`Running`,paused:`Paused`,completed:`Completed`,failed:`Failed`,cancelled:`Cancelled`,idle:`Draft`},er={running:0,paused:1,idle:2,completed:3,failed:4,cancelled:5},tr=(e,t=`SPR`)=>e.number?`${t}-${e.number}`:e.slug.toUpperCase(),nr=(e,t)=>e.localeCompare(t,void 0,{sensitivity:`base`});function rr(e,t,n=`SPR`){let r=e;t.status!==`all`&&t.status.size>0&&(r=r.filter(e=>t.status.has(e.status))),t.showcase===`pinned`?r=r.filter(e=>e.showcasePinned):t.showcase===`unpinned`&&(r=r.filter(e=>!e.showcasePinned)),t.qa===`missing`?r=r.filter(e=>!e.latestReview):t.qa===`running`?r=r.filter(e=>e.latestReview?.status===`running`):t.qa===`reviewed`&&(r=r.filter(e=>e.latestReview&&e.latestReview.status!==`running`));let i=t.query.trim();if(!i)return r;let a=i.toLowerCase();return r.filter(e=>{let t=tr(e,n).toLowerCase(),r=e.name.toLowerCase(),i=$n[e.status].toLowerCase(),o=(e.goal||``).toLowerCase();return t.includes(a)||r.includes(a)||i.includes(a)||o.includes(a)})}function ir(e,t,n=`SPR`){let r=[...e].sort((e,r)=>{switch(t.key){case`showcasePinned`:return Number(r.showcasePinned)-Number(e.showcasePinned);case`sprintKey`:return e.number!==null&&r.number!==null&&e.number!==r.number?e.number-r.number:nr(tr(e,n),tr(r,n));case`name`:return nr(e.name,r.name);case`status`:return er[e.status]-er[r.status];case`tasksCount`:return e.tasksCount-r.tasksCount;case`completion`:return e.completion-r.completion;default:return e.createdAt.localeCompare(r.createdAt)}});return t.direction===`desc`&&r.reverse(),r}function ar(e,t){return e.slice(0,t)}function or(e,t){let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n}function sr(){return new Set}function cr(e,t){let n=new Set(t.map(e=>e.id)),r=new Set;for(let t of e)n.has(t)&&r.add(t);return r}function lr(e,t){return t.filter(t=>e.has(t.id))}function ur(e,t){return e.key===t?{key:t,direction:e.direction===`asc`?`desc`:`asc`}:{key:t,direction:t===`name`||t===`status`||t===`showcasePinned`||t===`sprintKey`?`asc`:`desc`}}function dr({children:e,className:t=``,caption:n,ariaLabel:r,ariaLabelledBy:a}){return i(`div`,{className:`overflow-x-hidden lg:overflow-visible ${t}`,children:i(`table`,{className:`block w-full border-separate border-spacing-y-4 text-left lg:table`,"aria-label":r,"aria-labelledby":a,role:`table`,children:[n&&i(`caption`,{className:`sr-only`,children:n}),e]})})}function fr({children:e}){return i(`thead`,{className:`sr-only lg:not-sr-only lg:table-header-group`,role:`rowgroup`,children:i(`tr`,{className:`text-[color:var(--text-metadata)] text-xs font-medium`,children:e})})}function pr({children:e}){return i(`tbody`,{className:`block lg:table-row-group`,role:`rowgroup`,children:e})}function mr({children:e,className:t=``,selected:n,onClick:r,style:a}){return i(`tr`,{onClick:r,"aria-selected":n,role:`row`,className:`group mb-3 block overflow-hidden rounded-[1.5rem] border shadow-[var(--elevation-base)] backdrop-blur-xl transition-all duration-300 hover:-translate-y-0.5 hover:shadow-[var(--elevation-raised)] focus-within:ring-2 focus-within:ring-signal-500/20 lg:table-row lg:overflow-visible lg:rounded-none lg:border-0 lg:shadow-none lg:hover:bg-[var(--fill-muted-hover)] lg:transition-colors lg:duration-150 ${r?`cursor-pointer`:``} ${n?`bg-signal-500/5 ring-2 ring-inset ring-signal-500/30`:``} ${t}`,style:a,children:e})}function hr({children:e,className:t=``,isFirst:n,isLast:r,isHeader:a,align:o=`left`,colSpan:s,mobileLabel:c,ariaSort:l}){let u=o===`right`?`text-right`:o===`center`?`text-center`:`text-left`;return a?i(`th`,{scope:`col`,"aria-sort":l,className:`border-y border-[color:var(--border-hairline)] bg-[var(--surface-glass)] px-4 py-2 ${u} ${n?`rounded-l-2xl border-l`:r?`rounded-r-2xl border-r pr-6`:``} ${n?`pl-6`:``} ${t}`,children:e}):i(`td`,{colSpan:s,className:`block px-4 py-3 align-middle lg:table-cell lg:border-y lg:px-4 lg:py-3 ${u} ${n?`lg:rounded-l-[1.5rem] lg:border-l lg:pl-6`:r?`lg:rounded-r-[1.5rem] lg:border-r lg:pr-6`:``} ${t}`,role:`cell`,children:[c&&i(`span`,{className:`mb-1.5 block text-[10px] font-bold uppercase tracking-[0.14em] text-slate-400 lg:hidden`,children:c}),e]})}var gr=({sprintsCount:e,ledgerSprintsCount:t,pinnedCount:n,activeCount:r,completedCount:a,listWindow:o,onListWindowChange:s,filters:c,onFiltersChange:l})=>{let u=c.status===`all`||c.status.size!==1?`all`:[...c.status][0],d=!!c.query||c.qa!==`all`||c.showcase!==`all`||c.status!==`all`;return i(`div`,{role:`region`,"aria-label":`Sprint Ledger`,className:`relative overflow-visible border-b border-black/[0.06] px-4 py-5 dark:border-white/[0.06] sm:px-6 lg:px-7`,children:[i(`div`,{className:`relative grid gap-5 xl:grid-cols-[minmax(0,1fr)_auto] xl:items-start`,children:[i(`div`,{className:`min-w-0`,children:[i(`div`,{className:`inline-flex items-center gap-2 rounded-full border border-ember-500/20 bg-ember-500/10 px-3 py-1 text-[11px] font-bold text-ember-600 dark:text-ember-400`,children:[i(kn,{className:`h-3.5 w-3.5`,strokeWidth:2.3}),`Sprint Ledger`]}),i(`h2`,{className:`mt-3 font-display text-2xl font-bold text-slate-900 dark:text-white sm:text-3xl`,children:`All sprints, fully sortable.`}),i(`p`,{className:`mt-2 max-w-3xl text-sm leading-6 text-slate-500 dark:text-slate-400`,children:`Search, sort, pin, start, and triage sprints from a responsive ledger that keeps execution state, QA status, and progress visible without leaving the page.`})]}),i(`div`,{className:`grid grid-cols-2 gap-2 sm:grid-cols-4 xl:min-w-[34rem]`,children:[{label:`Visible`,value:t,icon:Ae,tone:`text-signal-600 dark:text-signal-300`},{label:`Pinned`,value:n,icon:tt,tone:`text-status-red`},{label:`Active`,value:r,icon:qe,tone:`text-status-green`},{label:`Done`,value:a,icon:rn,tone:`text-slate-600 dark:text-slate-300`}].map(e=>{let t=e.icon;return i(`div`,{className:`rounded-2xl border border-black/[0.06] bg-white/70 p-3 shadow-[0_10px_24px_rgba(15,23,42,0.05)] backdrop-blur-xl dark:border-white/[0.06] dark:bg-white/[0.04]`,children:[i(`div`,{className:`flex items-center gap-2 text-xs font-semibold ${e.tone}`,children:[i(t,{className:`h-3.5 w-3.5`,strokeWidth:2.2}),e.label]}),i(`div`,{className:`mt-1 font-mono text-xl font-bold text-slate-900 dark:text-white`,children:e.value})]},e.label)})})]}),i(`div`,{className:`relative mt-5 grid gap-3`,children:[i(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between`,children:[i(`div`,{className:`relative min-w-0 flex-1 lg:max-w-xl`,children:[i(We,{className:`pointer-events-none absolute left-4 top-1/2 h-4 w-4 -translate-y-1/2 text-slate-400`,strokeWidth:2.2}),i(`input`,{type:`text`,value:c.query,onInput:e=>l({...c,query:e.target.value}),placeholder:`Search sprints…`,className:`h-12 w-full rounded-2xl border border-black/[0.08] bg-white/85 pl-11 pr-11 text-sm text-slate-800 shadow-[0_10px_24px_rgba(15,23,42,0.04)] placeholder:text-slate-400 focus:border-signal-500/40 focus:outline-none focus-visible:ring-2 focus-visible:ring-signal-500/20 dark:border-white/[0.08] dark:bg-white/[0.05] dark:text-white dark:placeholder:text-slate-500`}),c.query&&i(`button`,{type:`button`,onClick:()=>l({...c,query:``}),className:`absolute right-3.5 top-1/2 inline-flex h-7 w-7 -translate-y-1/2 items-center justify-center rounded-full text-slate-400 transition-colors hover:bg-black/[0.04] hover:text-slate-700 focus-visible:ring-2 focus-visible:ring-signal-500/30 dark:hover:bg-white/[0.06] dark:hover:text-slate-200`,title:`Clear search`,"aria-label":`Clear search`,children:i(Dt,{className:`h-3.5 w-3.5`,strokeWidth:2.2})})]}),i(`div`,{className:`flex flex-wrap items-center gap-2`,children:[i(T,{value:o,onChange:s,label:`Show`}),i(`span`,{className:`rounded-full border border-black/[0.06] bg-white/70 px-3 py-1.5 font-mono text-xs text-slate-500 dark:border-white/[0.06] dark:bg-white/[0.04] dark:text-slate-400`,"aria-live":`polite`,"aria-atomic":`true`,"aria-label":`Showing ${t} of ${e} sprints`,children:[t,` / `,e]}),d?i(`button`,{type:`button`,onClick:()=>{l({query:``,status:`all`,showcase:`all`,qa:`all`})},title:`Clear all filters`,"aria-label":`Clear all applied filters to show all sprints`,className:`inline-flex items-center gap-1.5 rounded-full border border-signal-500/20 bg-signal-500/10 px-3 py-1.5 text-xs font-bold text-signal-700 transition-colors hover:bg-signal-500/15 focus-visible:ring-2 focus-visible:ring-signal-500/30 dark:text-signal-300`,children:[i(Dt,{className:`h-3.5 w-3.5`,strokeWidth:2.2}),`Clear Filters`]}):null]})]}),i(`div`,{className:`grid gap-2 sm:grid-cols-3`,children:[i($t,{options:[{value:`all`,label:`All Status`},{value:`running`,label:`Running`},{value:`idle`,label:`Draft`},{value:`paused`,label:`Paused`},{value:`completed`,label:`Done`},{value:`failed`,label:`Failed`}],value:u,onChange:e=>{l({...c,status:e===`all`?`all`:new Set([e])})},"aria-label":`Filter ledger by sprint status`}),i($t,{options:[{value:`all`,label:`All QA`},{value:`missing`,label:`No QA`},{value:`running`,label:`Reviewing`},{value:`reviewed`,label:`Reviewed`}],value:c.qa,onChange:e=>l({...c,qa:e}),"aria-label":`Filter ledger by QA status`}),i($t,{options:[{value:`all`,label:`All Pins`},{value:`pinned`,label:`Pinned`},{value:`unpinned`,label:`Unpinned`}],value:c.showcase,onChange:e=>l({...c,showcase:e}),"aria-label":`Filter ledger by pin state`})]})]}),i(`div`,{className:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:t===0&&d?`No matching sprints. Adjust search or filters.`:d?`Showing ${t} filtered sprints out of ${e} total.`:`Showing all ${e} sprints.`})]})};p();var _r=({selectedCount:e,totalCount:t,isAnyPending:n,isStartPending:r,isDeletePending:a,isPinPending:o,onBulkStart:c,onBulkDelete:l,onBulkShowcaseEnable:u,onBulkShowcaseDisable:d,onClearSelection:p})=>{let m=s(null),h=s(e),{expansionCollapse:g}=bt(),{base:_}=ht(),v=ht();return f(()=>{let t=m.current;if(!t)return;let n=v.base;e>0?n===0?$.set(t,{height:`auto`,opacity:1}):$.to(t,{height:`auto`,opacity:1,duration:n,ease:g.ease}):n===0?$.set(t,{height:0,opacity:0}):$.to(t,{height:0,opacity:0,duration:n,ease:g.ease})},[e,v,g.ease]),f(()=>{h.current=e},[e]),i(`div`,{ref:m,className:`overflow-hidden opacity-0`,style:{height:0},children:[i(`div`,{className:`flex flex-col gap-3 border-b border-signal-500/20 bg-signal-500/[0.08] px-4 py-3 backdrop-blur-xl dark:bg-signal-500/[0.1] sm:px-6 lg:flex-row lg:items-center lg:justify-between`,children:[i(`div`,{className:`flex min-w-0 items-center gap-3`,children:[i(`div`,{className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-2xl border border-signal-500/20 bg-signal-500/10 text-signal-700 dark:text-signal-300`,children:n?i(X,{className:`h-4 w-4 animate-spin`}):i(kn,{className:`h-4 w-4`,fill:`currentColor`})}),i(`div`,{className:`min-w-0`,"aria-live":`polite`,"aria-atomic":`true`,children:[i(`div`,{className:`text-sm font-bold text-slate-900 dark:text-white`,children:[e,` of `,t,` selected`]}),i(`div`,{className:`text-xs text-slate-500 dark:text-slate-400`,children:`Bulk controls apply to the current filtered result set.`})]})]}),i(`div`,{className:`flex flex-wrap items-center gap-2`,children:[i(`button`,{type:`button`,"aria-label":o?`Pinning selected sprints`:`Pin selected sprints to showcase`,"aria-disabled":n,onClick:u,disabled:n,className:`inline-flex h-9 items-center gap-1.5 rounded-xl border border-black/[0.06] bg-white/80 px-3 text-xs font-bold text-slate-600 transition-colors hover:bg-white hover:text-slate-900 focus-visible:ring-2 focus-visible:ring-signal-500/30 focus-visible:ring-offset-2 dark:border-white/[0.06] dark:bg-white/[0.04] dark:text-slate-300 dark:hover:bg-white/[0.08] dark:hover:text-white disabled:cursor-not-allowed disabled:opacity-50`,children:[o?i(X,{className:`h-3 w-3 animate-spin`}):i(kn,{className:`h-3 w-3`,fill:`currentColor`}),o?`Pinning...`:`Pin`]}),i(`button`,{type:`button`,"aria-label":o?`Unpinning selected sprints`:`Unpin selected sprints from showcase`,"aria-disabled":n,onClick:d,disabled:n,className:`inline-flex h-9 items-center gap-1.5 rounded-xl border border-black/[0.06] bg-white/80 px-3 text-xs font-bold text-slate-600 transition-colors hover:bg-white hover:text-slate-900 focus-visible:ring-2 focus-visible:ring-signal-500/30 focus-visible:ring-offset-2 dark:border-white/[0.06] dark:bg-white/[0.04] dark:text-slate-300 dark:hover:bg-white/[0.08] dark:hover:text-white disabled:cursor-not-allowed disabled:opacity-50`,children:[o?i(X,{className:`h-3 w-3 animate-spin`}):i(kn,{className:`h-3 w-3`}),o?`Unpinning...`:`Unpin`]}),i(`button`,{type:`button`,"aria-label":r?`Starting selected sprints`:`Start selected sprints`,"aria-disabled":n,onClick:c,disabled:n,className:`inline-flex h-9 items-center gap-1.5 rounded-xl border border-signal-500/25 bg-signal-500/10 px-3 text-xs font-bold text-signal-700 transition-colors hover:bg-signal-500/20 focus-visible:ring-2 focus-visible:ring-signal-500/30 focus-visible:ring-offset-2 dark:text-signal-300 disabled:cursor-not-allowed disabled:opacity-50`,children:[r?i(X,{className:`h-3 w-3 animate-spin`}):i(He,{className:`h-3 w-3`,fill:`currentColor`}),r?`Starting...`:`Start`]}),i(`button`,{type:`button`,"aria-label":a?`Deleting selected sprints`:`Delete selected sprints`,"aria-disabled":n,onClick:l,disabled:n,className:`inline-flex h-9 items-center gap-1.5 rounded-xl border border-status-red/20 bg-status-red/10 px-3 text-xs font-bold text-status-red transition-colors hover:bg-status-red/20 focus-visible:ring-2 focus-visible:ring-status-red/30 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`,children:[a?i(X,{className:`h-3 w-3 animate-spin`}):i(ln,{className:`h-3 w-3`}),a?`Deleting...`:`Delete`]}),i(`button`,{type:`button`,"aria-label":`Clear sprint selection`,"aria-disabled":n,onClick:p,disabled:n,className:`inline-flex h-9 items-center gap-1.5 rounded-xl px-3 text-xs font-bold text-slate-500 transition-colors hover:bg-black/[0.04] hover:text-slate-700 focus-visible:ring-2 focus-visible:ring-signal-500/30 focus-visible:ring-offset-2 dark:text-slate-400 dark:hover:bg-white/[0.05] dark:hover:text-slate-200 disabled:cursor-not-allowed disabled:opacity-50`,children:[i(Dt,{className:`h-3.5 w-3.5`,strokeWidth:2.2}),`Clear`]})]})]}),i(`div`,{className:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:e===0&&h.current>0?`Selection cleared`:``})]})},vr=({issue:e})=>{let t=`bg-[var(--bg-status-info-subtle)]`,n=`text-[var(--text-status-info-bold)]`,r=`border-[var(--border-status-info-subtle)]`;if(e.status){let i=e.status.toLowerCase();(i===`done`||i===`completed`)&&(t=`bg-[var(--bg-status-success-subtle)]`,n=`text-[var(--text-status-success-bold)]`,r=`border-[var(--border-status-success-subtle)]`)}return i(`span`,{className:`inline-flex items-center gap-1.5 rounded-[4px] border px-[8px] h-[20px] text-[11px] font-medium ${t} ${n} ${r} dark:!bg-white/[0.04] dark:!border-white/[0.1] dark:!text-slate-300`,title:e.title,children:[i(rt,{className:`h-3 w-3`,strokeWidth:2.2}),e.issueKey]})};o(),p(),c();var yr={running:`border-status-green/25 bg-status-green/10 text-status-green`,paused:`border-ember-500/25 bg-ember-500/10 text-ember-600 dark:text-ember-400`,completed:`border-slate-300/35 bg-slate-900/[0.04] text-slate-600 dark:border-white/15 dark:bg-white/[0.07] dark:text-slate-300`,failed:`border-status-red/25 bg-status-red/10 text-status-red`,cancelled:`border-slate-300/35 bg-slate-100/80 text-slate-500 dark:border-white/15 dark:bg-white/[0.05] dark:text-slate-400`,idle:`border-signal-500/25 bg-signal-500/10 text-signal-700 dark:text-signal-300`},br={merge_required:{tone:`border-purple-500/25 bg-purple-500/10 text-purple-600 dark:text-purple-300`,label:`Merge`},merge_conflict:{tone:`border-status-red/25 bg-status-red/10 text-status-red`,label:`Conflict`},ci_fix_required:{tone:`border-blue-500/25 bg-blue-500/10 text-blue-600 dark:text-blue-300`,label:`CI`}},xr={running:`from-status-green to-signal-500`,paused:`from-ember-500 to-ember-400`,completed:`from-slate-500 to-slate-400`,failed:`from-status-red to-status-red`,cancelled:`from-slate-400 to-slate-300`,idle:`from-signal-500 to-signal-300`},Sr=new Intl.DateTimeFormat(`en-US`,{month:`short`,day:`numeric`,year:`numeric`}),Cr=new Intl.DateTimeFormat(`en-US`,{month:`short`,day:`numeric`}),wr=new Intl.DateTimeFormat(`en-US`,{hour:`2-digit`,minute:`2-digit`,hour12:!1}),Tr=e=>e.slice(0,8),Er=e=>Sr.format(new Date(e)),Dr=e=>Cr.format(new Date(e)),Or=e=>wr.format(new Date(e)),kr=e=>e===`running`||e===`paused`,Ar=a(({sprint:t,isSelected:n,isEven:r,activeRun:a,pauseResumeRun:o,humanIntervention:s,pendingActionIds:c,isAnyBulkPending:l,onToggleRow:u,onToggleShowcase:d,onSprintToggle:f,onSprintPauseResume:p,onOpenRowMenu:h})=>{let g=ye(t.projectId),[_,v]=m(!1),y=g.data?.settings?.git?.sprintKeyPrefix||`SPR`,b=a?`sprint-stop:${a.id}`:`sprint-start:${t.id}`,x=t.status===`paused`?o?`sprint-resume:${o.id}`:``:o?`sprint-pause:${o.id}`:``,S=`sprint-showcase:${t.id}`,C=`sprint-delete:${t.id}`,w=t.status===`completed`,T=sn({state:t.status,humanInterventionTitle:s?.title??null,humanInterventionReason:s?.reason??null,humanInterventionInstructions:s?.instructions??null,humanInterventionOwnerType:s?.ownerType??null,attentionType:s?.attentionType??null,completion:t.completion,latestReviewStatus:t.latestReview?.status??null}),E=!!s&&T.showHumanInterventionBadge,D=c.has(b),O=x.length>0&&c.has(x),k=c.has(S),A=c.has(C),j=ve(Qt.selectionMovement.duration),M=Qt.selectionMovement.ease,N=n?`border-signal-500/35 bg-signal-500/[0.08] shadow-[0_18px_44px_rgba(0,224,160,0.12)]`:r?`border-black/[0.06] bg-white/80 dark:border-white/[0.07] dark:bg-white/[0.045]`:`border-black/[0.06] bg-slate-50/80 dark:border-white/[0.07] dark:bg-white/[0.03]`,P=n?`lg:border-signal-500/25 lg:bg-signal-500/[0.08]`:r?`lg:border-black/[0.06] lg:bg-white/80 dark:lg:border-white/[0.07] dark:lg:bg-white/[0.045]`:`lg:border-black/[0.06] lg:bg-slate-50/80 dark:lg:border-white/[0.07] dark:lg:bg-white/[0.03]`,ee=xr[t.status],I=s?.attentionType?br[s.attentionType]:void 0,L=T.statusLabel,R=yr[t.status]||`border-slate-300/35 bg-slate-900/[0.04] text-slate-600 dark:border-white/15 dark:bg-white/[0.07] dark:text-slate-300`;return L===`QA`?R=`border-status-amber/25 bg-status-amber/10 text-status-amber`:L===`Merge`?R=`border-purple-500/25 bg-purple-500/10 text-purple-600 dark:text-purple-300`:L===`Merge Conflict`?R=`border-status-red/25 bg-status-red/10 text-status-red`:I&&(L=I.label,R=I.tone),i(mr,{className:`group transition-all hover:-translate-y-0.5 focus-within:ring-2 focus-within:ring-signal-500/20 ${N} ${w?`text-slate-500 dark:text-slate-400`:``} ${A?`bg-status-red/5 grayscale opacity-50`:k||D||O?`bg-signal-500/5 opacity-80`:l?`opacity-60 grayscale-[0.2]`:``} hover:bg-[var(--bg-hover-subtle)]`,style:{transitionDuration:j,transitionTimingFunction:M},children:[i(hr,{isFirst:!0,className:`lg:w-[80px] lg:min-w-[80px] ${P}`,children:i(`button`,{type:`button`,onClick:()=>u(t.id),disabled:A||l,className:`inline-flex h-9 w-9 items-center justify-center rounded-xl border border-black/[0.06] bg-white/72 text-slate-400 transition-colors hover:border-signal-500/25 hover:text-signal-500 focus-visible:ring-2 focus-visible:ring-signal-500/30 dark:border-white/[0.07] dark:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50`,title:n?`Deselect sprint`:`Select sprint`,"aria-label":n?`Deselect sprint ${t.name}`:`Select sprint ${t.name}`,children:n?i(F,{className:`h-4 w-4 text-signal-500`,strokeWidth:2.2}):i(an,{className:`h-4 w-4`,strokeWidth:2.2})})}),i(hr,{className:`lg:w-[80px] lg:min-w-[80px] ${P}`,children:i(`button`,{type:`button`,onClick:()=>d(t),disabled:k||A,className:`inline-flex h-10 w-10 items-center justify-center rounded-2xl border transition-all focus-visible:ring-2 focus-visible:ring-signal-500/30 ${t.showcasePinned?`border-status-red/20 bg-status-red/10 text-status-red shadow-[0_8px_20px_rgba(239,68,68,0.10)]`:`border-black/[0.06] bg-white/70 text-slate-400 hover:border-status-red/20 hover:text-status-red dark:border-white/[0.07] dark:bg-white/[0.04]`} disabled:cursor-not-allowed disabled:opacity-50`,title:t.showcasePinned?`Remove from showcase`:`Pin to showcase`,"aria-label":t.showcasePinned?`Remove sprint ${t.name} from showcase`:`Pin sprint ${t.name} to showcase`,children:k?i(X,{className:`h-3.5 w-3.5 animate-spin`,strokeWidth:2.1}):i(kn,{className:`h-3.5 w-3.5`,fill:t.showcasePinned?`currentColor`:`none`,strokeWidth:2.1})})}),i(hr,{className:`lg:w-[120px] lg:min-w-[120px] ${P}`,mobileLabel:`Sprint ID`,children:[i(`div`,{className:`font-mono text-sm font-bold text-[var(--text-primary)] truncate`,children:tr(t,y)}),i(`div`,{className:`mt-1 text-[10px] font-bold text-slate-400 truncate`,children:Tr(t.id)})]}),i(hr,{className:`min-w-0 max-w-full lg:w-[220px] lg:min-w-[220px] ${P}`,mobileLabel:`Sprint`,children:[i(`div`,{className:`flex flex-wrap items-center gap-2`,children:[i(`div`,{className:`font-display text-lg font-black leading-tight break-words ${w?`text-slate-700 dark:text-slate-300`:`text-[var(--text-primary)]`}`,children:t.name}),t.latestReview&&i(Ge,{summary:t.latestReview,compact:!0,align:`left`})]}),i(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-[11px] font-mono text-slate-400`,children:[i(`span`,{className:`inline-flex items-center gap-1.5 rounded-full border border-black/[0.05] bg-black/[0.025] px-2 py-1 dark:border-white/[0.06] dark:bg-white/[0.03]`,children:[i(Sn,{className:`h-3 w-3`,strokeWidth:2.1}),`Updated `,Dr(t.updatedAt)]}),i(`span`,{className:`inline-flex items-center gap-1.5 rounded-full border border-black/[0.05] bg-black/[0.025] px-2 py-1 dark:border-white/[0.06] dark:bg-white/[0.03]`,children:[`Created `,Er(t.createdAt),` `,i(`span`,{className:`ml-1 font-mono text-[10px] text-slate-400`,children:Or(t.createdAt)})]})]}),E&&kr(t.status)&&s&&i(`div`,{className:`mt-3`,children:i(mt,{summary:s,label:`Needs you`,compact:!0,align:`left`})}),t.linkedIssues&&t.linkedIssues.length>0&&i(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:t.linkedIssues.map(e=>i(vr,{issue:e},e.id))}),t.goal?i(`p`,{className:`mt-3 max-w-2xl text-sm leading-relaxed ${w?`text-slate-400 dark:text-slate-500`:`text-slate-500 dark:text-slate-400`}`,children:t.goal}):null]}),i(hr,{className:`lg:w-[120px] lg:min-w-[120px] ${P}`,mobileLabel:`Status`,children:i(`div`,{className:`flex flex-wrap items-center gap-2 lg:flex-col lg:items-start`,children:A?i(`span`,{className:`inline-flex items-center gap-1.5 rounded-full border border-status-red/25 bg-status-red/10 px-3 py-1.5 text-[11px] font-bold text-status-red`,children:[i(X,{className:`h-3 w-3 animate-spin`,strokeWidth:2.2}),` Deleting`]}):k?i(`span`,{className:`inline-flex items-center gap-1.5 rounded-full border border-signal-500/25 bg-signal-500/10 px-3 py-1.5 text-[11px] font-bold text-signal-700 dark:text-signal-300`,children:[i(X,{className:`h-3 w-3 animate-spin`,strokeWidth:2.2}),` Pinning`]}):D?i(`span`,{className:`inline-flex items-center gap-1.5 rounded-full border border-signal-500/25 bg-signal-500/10 px-3 py-1.5 text-[11px] font-bold text-signal-700 dark:text-signal-300`,children:[i(X,{className:`h-3 w-3 animate-spin`,strokeWidth:2.2}),` `,a?`Stopping`:`Starting`]}):O?i(`span`,{className:`inline-flex items-center gap-1.5 rounded-full border border-signal-500/25 bg-signal-500/10 px-3 py-1.5 text-[11px] font-bold text-signal-700 dark:text-signal-300`,children:[i(X,{className:`h-3 w-3 animate-spin`,strokeWidth:2.2}),` `,t.status===`paused`?`Resuming`:`Pausing`]}):i(`span`,{className:`inline-flex rounded-full border px-4 py-1.5 text-[11px] font-bold ${R}`,children:L})})}),i(hr,{align:`right`,className:`lg:w-[100px] lg:min-w-[100px] ${P}`,mobileLabel:`Tasks`,children:i(`div`,{className:`flex items-center gap-3 justify-end lg:block`,children:[i(`div`,{className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-xl border border-black/[0.06] bg-white/70 text-slate-400 dark:border-white/[0.06] dark:bg-white/[0.04] lg:hidden`,children:i(je,{className:`h-4 w-4`,strokeWidth:2.2})}),i(`div`,{children:[i(`div`,{className:`font-mono text-lg font-bold text-[var(--text-primary)]`,children:t.tasksCount}),i(`div`,{className:`text-[11px] text-slate-400`,children:`planned tasks`})]})]})}),i(hr,{align:`right`,className:`min-w-[12rem] lg:w-[140px] lg:min-w-[140px] ${P}`,mobileLabel:`Completion`,children:i(`div`,{className:`flex items-center justify-end gap-3`,children:[i(`div`,{className:`h-2.5 flex-1 overflow-hidden rounded-full bg-black/10 ring-1 ring-black/[0.03] dark:bg-white/[0.08] dark:ring-white/[0.04]`,children:i(`div`,{className:`h-full rounded-full bg-gradient-to-r ${ee} transition-[width] duration-500 ease-out`,style:{width:`${t.completion}%`}})}),i(`span`,{className:`font-mono text-sm font-bold text-[var(--text-primary)]`,children:[t.completion,`%`]})]})}),i(hr,{className:`lg:w-[120px] lg:min-w-[120px] ${P}`,mobileLabel:`Created`,children:[i(`div`,{className:`font-medium text-[var(--text-primary)]`,children:[Er(t.createdAt),i(`span`,{className:`ml-1.5 font-mono text-[10px] text-slate-400`,children:Or(t.createdAt)})]}),i(`div`,{className:`mt-1 text-[11px] text-slate-400`,children:`created`}),i(`div`,{className:`mt-1.5 inline-flex items-center gap-1`,children:t.latestReview?.status===`running`?i(e,{children:[i(X,{className:`h-3.5 w-3.5 text-signal-500 animate-spin`,strokeWidth:2.2}),i(`span`,{className:`text-[11px] font-bold text-signal-500 animate-pulse`,children:`Reviewing`})]}):t.latestReview?.status===`completed`||t.latestReview?.status===`reviewed`?i(e,{children:[i(rn,{className:`h-3.5 w-3.5 text-signal-500`,strokeWidth:2.2}),i(`span`,{className:`text-[11px] font-bold text-signal-500`,children:`Reviewed`})]}):i(`span`,{className:`text-[11px] font-bold text-slate-400`,children:`Not reviewed`})})]}),i(hr,{align:`right`,isLast:!0,className:`lg:w-[140px] lg:min-w-[140px] ${P}`,mobileLabel:`Controls`,children:i(`div`,{className:`flex flex-wrap items-center gap-2 lg:justify-end lg:whitespace-nowrap`,children:[i(De,{isActive:!!a,isPaused:t.status===`paused`,isStartStopPending:D,isPauseResumePending:O,onStartStop:()=>f(t.id),onPauseResume:()=>p(t.id),sprintName:t.name}),i(`a`,{href:`/tasks?sprint=${encodeURIComponent(t.id)}`,"aria-label":`Open sprint ${t.name}`,className:`inline-flex h-10 min-w-[5rem] flex-1 items-center justify-center gap-2 rounded-xl border border-black/[0.06] bg-white/80 px-4 text-xs font-bold text-slate-600 transition-colors hover:bg-white hover:text-slate-900 focus-visible:ring-2 focus-visible:ring-signal-500/30 dark:border-white/[0.08] dark:bg-white/[0.04] dark:text-slate-300 dark:hover:bg-white/[0.08] dark:hover:text-white sm:flex-none`,children:[`Open`,i(dn,{className:`h-3.5 w-3.5`})]}),h?i(`button`,{type:`button`,disabled:A,onClick:e=>h(e,t.id),className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-black/[0.06] bg-white/80 text-slate-600 transition-colors hover:bg-white hover:text-slate-900 focus-visible:ring-2 focus-visible:ring-signal-500/30 dark:border-white/[0.08] dark:bg-white/[0.04] dark:text-slate-300 dark:hover:bg-white/[0.08] dark:hover:text-white disabled:cursor-not-allowed disabled:opacity-50`,title:`Open sprint actions`,"aria-label":`Open actions menu for sprint ${t.name}`,children:A?i(X,{className:`h-3.5 w-3.5 animate-spin text-signal-500`,strokeWidth:2.2}):i(wn,{className:`h-3.5 w-3.5`})}):i(Bn,{isOpen:_,onOpenChange:v,position:`bottom`,align:`end`,className:`min-w-[11.5rem]`,computePosition:({triggerRect:e,menuRect:t,viewport:n})=>Un(e,n,{width:t.width,height:t.height}),content:i(zn,{sprint:t,isCompleted:w,showcaseBusy:k,markCompletedDisabled:!1,deleteBusy:A,onToggleShowcase:()=>d(t),onClose:()=>v(!1),markCompletedIcon:`square`,role:`menuitem`,buttonClassName:`flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-left text-xs font-medium text-slate-600 transition-colors hover:bg-black/[0.04] hover:text-slate-900 focus-visible:ring-2 focus-visible:ring-signal-500/30 focus-visible:ring-offset-2 dark:text-slate-300 dark:hover:bg-white/[0.05] dark:hover:text-white focus:outline-none`}),children:i(`button`,{type:`button`,disabled:A,"aria-haspopup":`menu`,"aria-expanded":_,className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-black/[0.06] bg-white/80 text-slate-600 transition-colors hover:bg-white hover:text-slate-900 focus-visible:ring-2 focus-visible:ring-signal-500/30 dark:border-white/[0.08] dark:bg-white/[0.04] dark:text-slate-300 dark:hover:bg-white/[0.08] dark:hover:text-white disabled:cursor-not-allowed disabled:opacity-50`,title:`Open sprint actions`,"aria-label":`Open actions menu for sprint ${t.name}`,children:A?i(X,{className:`h-3.5 w-3.5 animate-spin text-signal-500`,strokeWidth:2.2}):i(wn,{className:`h-3.5 w-3.5`})})})]})})]})});p();var jr=({initialQuery:e,sprints:t,isLoading:a,listWindow:o,onListWindowChange:s,activeRunsBySprintId:c,pauseResumeRunsBySprintId:l,interventionBySprintId:u,pendingActionIds:d,onToggleShowcase:p,onSprintToggle:h,onSprintPauseResume:_,onOpenRowMenu:y,onEditSprint:x,onExportSprint:S,onOverridesSprint:C,onMarkCompletedSprint:w,onDeleteSprint:T,onBulkStart:E,onBulkDelete:D,onBulkShowcaseEnable:O,onBulkShowcaseDisable:k})=>{let[A,j]=m({...Qn,query:e||Qn.query}),[M,N]=m({key:`createdAt`,direction:`desc`}),[P,ee]=m(new Set),{isOpen:I,options:L,requestConfirm:R,handleConfirm:z,handleCancel:B}=dt();f(()=>{e!==void 0&&j(t=>({...t,query:e}))},[e]);let te=r(()=>rr(t,A),[t,A]),V=r(()=>ir(te,M),[te,M]),ne=r(()=>ar(V,yn(o,V.length)),[V,o]),re=r(()=>({pinnedCount:t.filter(e=>e.showcasePinned).length,activeCount:t.filter(e=>e.status===`running`||e.status===`paused`).length,completedCount:t.filter(e=>e.status===`completed`).length}),[t]),ie=r(()=>{let e=new Map;for(let n of t)if(n.status===`running`||n.status===`paused`){let t=u.get(n.id);t&&t.ownerType!==`worker`&&e.set(n.id,t)}return e},[t,u]);f(()=>{ee(e=>{if(e.size===0)return e;let t=cr(e,te);return t.size===e.size?e:t})},[te]);let H=r(()=>lr(P,V),[P,V]),{isBulkStartPending:ae,isBulkStopPending:oe,isBulkPinPending:U,isBulkDeletePending:se,isAnyBulkPending:W}=r(()=>{let e=!1,t=!1,n=!1,r=!1;for(let i of H){let a=c.get(i.id);d.has(`sprint-start:${i.id}`)&&(e=!0),a&&d.has(`sprint-stop:${a.id}`)&&(t=!0),d.has(`sprint-showcase:${i.id}`)&&(n=!0),d.has(`sprint-delete:${i.id}`)&&(r=!0)}for(let e of V)d.has(`sprint-delete:${e.id}`)&&(r=!0);return{isBulkStartPending:e,isBulkStopPending:t,isBulkPinPending:n,isBulkDeletePending:r,isAnyBulkPending:e||t||n||r}},[H,V,c,d]),ce=V.length>0&&V.every(e=>P.has(e.id)),le=ve(Qt.controlFeedback.duration),G=Qt.controlFeedback.ease,ue=e=>{N(t=>ur(t,e))},K=()=>{if(ce)ee(new Set);else{let e=new Set(P);for(let t of V)e.add(t.id);ee(e)}},de=n(e=>{ee(t=>or(t,e))},[]),fe=n(()=>{ee(sr())},[]),pe=n(()=>{E(H.map(e=>e.id))},[E,H]),me=n(async()=>{await R({title:`Delete Sprints?`,body:`Are you sure you want to delete ${H.length} selected sprint${H.length===1?``:`s`}? This action is permanent and will cascade to all downstream tasks, logs, and associated git artifacts. Please ensure you have cleaned up your repository branches if needed before proceeding.`,confirmLabel:`Delete Sprints`,cancelLabel:`Cancel`,destructive:!0})&&D(H.map(e=>e.id))},[D,H,R]),he=n(()=>{O(H.map(e=>e.id))},[O,H]),ge=n(()=>{k(H.map(e=>e.id))},[k,H]),_e=n(e=>p(e),[p]),q=n(e=>h(e),[h]),ye=n(e=>_(e),[_]),J=e=>M.key===e?M.direction===`asc`?i(b,{"aria-hidden":`true`,className:`h-3 w-3 text-signal-500 opacity-100 transition-transform`,strokeWidth:2.2,style:{transitionDuration:le,transitionTimingFunction:G}}):i(g,{"aria-hidden":`true`,className:`h-3 w-3 text-signal-500 opacity-100 transition-transform`,strokeWidth:2.2,style:{transitionDuration:le,transitionTimingFunction:G}}):i(v,{"aria-hidden":`true`,className:`h-3 w-3 text-slate-300 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100 dark:text-slate-600`,strokeWidth:2.2,style:{transitionDuration:le,transitionTimingFunction:G}});return i(`div`,{className:`w-full`,children:[i(gr,{sprintsCount:t.length,ledgerSprintsCount:V.length,pinnedCount:re.pinnedCount,activeCount:re.activeCount,completedCount:re.completedCount,listWindow:o,onListWindowChange:s,filters:A,onFiltersChange:j}),i(_r,{selectedCount:H.length,totalCount:V.length,isAnyPending:W,isStartPending:ae,isDeletePending:se,isPinPending:U,onBulkStart:pe,onBulkDelete:me,onBulkShowcaseEnable:he,onBulkShowcaseDisable:ge,onClearSelection:fe}),i(cn,{isOpen:I,options:L,onConfirm:z,onCancel:B}),i(`div`,{className:`min-h-[20rem] px-3 py-4 sm:px-4 lg:px-5`,children:i(dr,{caption:`Sprint ledger with selection, sorting, and bulk actions.`,children:[i(fr,{children:[i(hr,{isHeader:!0,isFirst:!0,className:`w-[80px] min-w-[80px]`,children:[i(`span`,{className:`sr-only`,children:`Select`}),i(`button`,{type:`button`,disabled:ne.length===0||W,onClick:K,className:`inline-flex h-8 w-8 items-center justify-center rounded-xl text-slate-400 transition-colors hover:bg-black/[0.04] hover:text-slate-700 focus-visible:ring-2 focus-visible:ring-signal-500/30 dark:hover:bg-white/[0.05] dark:hover:text-slate-200 disabled:cursor-not-allowed disabled:opacity-50`,title:ce?`Deselect all visible sprints`:`Select all visible sprints`,"aria-label":ce?`Deselect all visible sprints`:`Select all visible sprints`,children:ce?i(F,{className:`h-4 w-4 text-signal-500`,strokeWidth:2.2}):i(an,{className:`h-4 w-4`,strokeWidth:2.2})})]}),i(hr,{isHeader:!0,className:`group w-[80px] min-w-[80px]`,ariaSort:M.key===`showcasePinned`?M.direction===`asc`?`ascending`:`descending`:void 0,children:i(`button`,{type:`button`,onClick:()=>ue(`showcasePinned`),className:`inline-flex items-center gap-2 rounded-lg transition-colors hover:text-slate-700 focus-visible:ring-2 focus-visible:ring-signal-500/30 dark:hover:text-slate-200`,"aria-label":`Sort by Showcase, currently ${M.key===`showcasePinned`?M.direction===`asc`?`sorted ascending`:`sorted descending`:`unsorted`}. Click to sort by Showcase in ${M.key===`showcasePinned`&&M.direction===`asc`?`descending`:`ascending`} order.`,children:[`Showcase`,J(`showcasePinned`)]})}),i(hr,{isHeader:!0,className:`group w-[120px] min-w-[120px]`,ariaSort:M.key===`sprintKey`?M.direction===`asc`?`ascending`:`descending`:void 0,children:i(`button`,{type:`button`,onClick:()=>ue(`sprintKey`),className:`inline-flex items-center gap-2 rounded-lg transition-colors hover:text-slate-700 focus-visible:ring-2 focus-visible:ring-signal-500/30 dark:hover:text-slate-200`,"aria-label":`Sort by Sprint ID, currently ${M.key===`sprintKey`?M.direction===`asc`?`sorted ascending`:`sorted descending`:`unsorted`}. Click to sort by Sprint ID in ${M.key===`sprintKey`&&M.direction===`asc`?`descending`:`ascending`} order.`,children:[`Sprint ID`,J(`sprintKey`)]})}),i(hr,{isHeader:!0,className:`group w-[220px] min-w-[220px]`,ariaSort:M.key===`name`?M.direction===`asc`?`ascending`:`descending`:void 0,children:i(`button`,{type:`button`,onClick:()=>ue(`name`),className:`inline-flex items-center gap-2 rounded-lg transition-colors hover:text-slate-700 focus-visible:ring-2 focus-visible:ring-signal-500/30 dark:hover:text-slate-200`,"aria-label":`Sort by Sprint, currently ${M.key===`name`?M.direction===`asc`?`sorted ascending`:`sorted descending`:`unsorted`}. Click to sort by Sprint in ${M.key===`name`&&M.direction===`asc`?`descending`:`ascending`} order.`,children:[`Sprint`,J(`name`)]})}),i(hr,{isHeader:!0,className:`group w-[120px] min-w-[120px]`,ariaSort:M.key===`status`?M.direction===`asc`?`ascending`:`descending`:void 0,children:i(`button`,{type:`button`,onClick:()=>ue(`status`),className:`inline-flex items-center gap-2 rounded-lg transition-colors hover:text-slate-700 focus-visible:ring-2 focus-visible:ring-signal-500/30 dark:hover:text-slate-200`,"aria-label":`Sort by Status, currently ${M.key===`status`?M.direction===`asc`?`sorted ascending`:`sorted descending`:`unsorted`}. Click to sort by Status in ${M.key===`status`&&M.direction===`asc`?`descending`:`ascending`} order.`,children:[`Status`,J(`status`)]})}),i(hr,{isHeader:!0,align:`right`,className:`group w-[100px] min-w-[100px]`,ariaSort:M.key===`tasksCount`?M.direction===`asc`?`ascending`:`descending`:void 0,children:i(`button`,{type:`button`,onClick:()=>ue(`tasksCount`),className:`inline-flex w-full items-center justify-end gap-2 rounded-lg transition-colors hover:text-slate-700 focus-visible:ring-2 focus-visible:ring-signal-500/30 dark:hover:text-slate-200`,"aria-label":`Sort by Tasks, currently ${M.key===`tasksCount`?M.direction===`asc`?`sorted ascending`:`sorted descending`:`unsorted`}. Click to sort by Tasks in ${M.key===`tasksCount`&&M.direction===`asc`?`descending`:`ascending`} order.`,children:[J(`tasksCount`),`Tasks`]})}),i(hr,{isHeader:!0,align:`right`,className:`group w-[140px] min-w-[140px]`,ariaSort:M.key===`completion`?M.direction===`asc`?`ascending`:`descending`:void 0,children:i(`button`,{type:`button`,onClick:()=>ue(`completion`),className:`inline-flex w-full items-center justify-end gap-2 rounded-lg transition-colors hover:text-slate-700 focus-visible:ring-2 focus-visible:ring-signal-500/30 dark:hover:text-slate-200`,"aria-label":`Sort by Completion, currently ${M.key===`completion`?M.direction===`asc`?`sorted ascending`:`sorted descending`:`unsorted`}. Click to sort by Completion in ${M.key===`completion`&&M.direction===`asc`?`descending`:`ascending`} order.`,children:[J(`completion`),`Completion`]})}),i(hr,{isHeader:!0,className:`group w-[120px] min-w-[120px]`,ariaSort:M.key===`createdAt`?M.direction===`asc`?`ascending`:`descending`:void 0,children:i(`button`,{type:`button`,onClick:()=>ue(`createdAt`),className:`inline-flex items-center gap-2 rounded-lg transition-colors hover:text-slate-700 focus-visible:ring-2 focus-visible:ring-signal-500/30 dark:hover:text-slate-200`,"aria-label":`Sort by Created, currently ${M.key===`createdAt`?M.direction===`asc`?`sorted ascending`:`sorted descending`:`unsorted`}. Click to sort by Created in ${M.key===`createdAt`&&M.direction===`asc`?`descending`:`ascending`} order.`,children:[`Created`,J(`createdAt`)]})}),i(hr,{isHeader:!0,align:`right`,isLast:!0,className:`w-[140px] min-w-[140px] pr-6`,children:`Controls`})]}),i(pr,{children:a&&ne.length===0?Array.from({length:5}).map((e,t)=>i(`tr`,{className:`block lg:table-row`,children:i(hr,{colSpan:9,className:`p-2`,children:i(at,{})})},t)):ne.length===0?i(`tr`,{className:`block lg:table-row`,children:i(hr,{colSpan:9,children:i(`div`,{className:`flex min-h-[16rem] flex-col items-center justify-center rounded-[1.5rem] border border-dashed border-black/[0.08] bg-white/50 px-6 py-10 text-center dark:border-white/[0.08] dark:bg-white/[0.03]`,children:[i(`div`,{className:`flex h-12 w-12 items-center justify-center rounded-2xl border border-black/[0.06] bg-white/80 text-slate-400 dark:border-white/[0.08] dark:bg-white/[0.05]`,children:i(Kt,{className:`h-5 w-5`,strokeWidth:2.1})}),i(`div`,{"aria-live":`polite`,className:`mt-4 font-display text-xl font-bold text-slate-800 dark:text-white`,children:A.query||A.qa!==`all`||A.showcase!==`all`||A.status!==`all`?`No matching sprints`:`No sprints yet`}),i(`p`,{className:`mt-2 max-w-md text-sm leading-6 text-slate-500 dark:text-slate-400`,children:A.query||A.qa!==`all`||A.showcase!==`all`||A.status!==`all`?`Adjust the search or filters to bring sprints back into the ledger.`:`Create a sprint above and it will appear in the showcase and ledger automatically.`})]})})}):ne.map((e,t)=>i(Ar,{sprint:e,isSelected:P.has(e.id),isEven:t%2==0,activeRun:c.get(e.id),pauseResumeRun:l.get(e.id),humanIntervention:ie.get(e.id)||null,pendingActionIds:d,isAnyBulkPending:W,onToggleRow:de,onToggleShowcase:_e,onSprintToggle:q,onSprintPauseResume:ye,onOpenRowMenu:y,onEdit:()=>x(e),onExport:()=>S(e),onOverrides:()=>C(e),onMarkCompleted:()=>w(e.id),onDelete:()=>T(e.id)},e.id))})]})})]})},Mr={improve:[{text:`Researching codebase context...`,threshold:.1},{text:`Analyzing codebase...`,threshold:.3},{text:`Refining technical requirements...`,threshold:.6},{text:`Synthesizing improved plan...`,threshold:.9}],plan_only:[{text:`Registering sprint definition...`,threshold:.1},{text:`Analyzing codebase...`,threshold:.3},{text:`Resolving dependencies...`,threshold:.5},{text:`Orchestrating subtask generation...`,threshold:.7},{text:`Finalizing sprint structure...`,threshold:.9}],plan_and_start:[{text:`Registering sprint definition...`,threshold:.1},{text:`Analyzing codebase...`,threshold:.3},{text:`Resolving dependencies...`,threshold:.5},{text:`Orchestrating subtask generation...`,threshold:.7},{text:`Preparing launch sequence...`,threshold:.9}],replan:[{text:`Analyzing existing tasks...`,threshold:.1},{text:`Discarding outdated plan...`,threshold:.3},{text:`Analyzing codebase...`,threshold:.5},{text:`Generating new subtasks...`,threshold:.75},{text:`Finalizing new structure...`,threshold:.95}],draft:[{text:`Saving draft...`,threshold:.1},{text:`Finalizing draft...`,threshold:.8}],append_tasks:[{text:`Appending tasks...`,threshold:.1},{text:`Finalizing sprint...`,threshold:.8}]},Nr=12e3,Pr={improve:`Refining prompt...`,plan_only:`Generating subtasks...`,plan_and_start:`Planning and initiating...`,replan:`Updating execution plan...`,draft:`Saving draft...`,append_tasks:`Appending tasks...`};function Fr(e,t){let n=1-Math.exp(-t/8e3),r=t%Nr/Nr,i=Mr[e],a=i[0].text;for(let e of i)if(n>=e.threshold)a=e.text;else break;return{text:a,progress:n,shipProgress:r,shipType:e===`improve`?`wooden`:`container`}}p();var Ir=({isBusy:e,isDismissed:t=!1,feedback:n,planningEta:r,elapsedMs:a,isDark:o,actionType:c,themeAccent:l=`signal`,onCancel:u,onDismiss:f,secondaryActionLabel:p,onSecondaryAction:m})=>{let h=s(null),g=s(n?.text),_=J();if(d(()=>{if(!(!n||!h.current)&&g.current!==n.text){let e=$.context(()=>{$.killTweensOf(h.current),$.fromTo(h.current,{opacity:0,y:_?0:10},{opacity:1,y:0,duration:_?0:Q.overlay.entry,ease:Q.overlay.entryEase})});return g.current=n.text,()=>e.revert()}},[n?.text,_]),!e||t||!n)return null;let v={signal:{shipContainer:`#00E0A0`,shipWooden:`#FFB800`,badgeBorder:`border-signal-500/20`,badgeBg:`bg-signal-500/[0.08]`,badgeText:`text-signal-600 dark:text-signal-300`,pingBg1:`bg-signal-400`,pingBg2:`bg-signal-500`},ember:{shipContainer:`#FF6B00`,shipWooden:`#FFB800`,badgeBorder:`border-ember-500/20`,badgeBg:`bg-ember-500/[0.08]`,badgeText:`text-ember-600 dark:text-ember-400`,pingBg1:`bg-ember-400`,pingBg2:`bg-ember-500`}}[l];return i(`div`,{className:`absolute inset-0 z-50 flex cursor-pointer items-center justify-center bg-void-900/50 backdrop-blur-sm p-4`,onClick:e=>{e.target===e.currentTarget&&f()},children:i(`div`,{className:`flex flex-col items-center justify-center bg-white dark:bg-void-800 rounded-2xl shadow-2xl border border-black/[0.08] dark:border-white/[0.08] max-w-2xl w-full p-8 relative cursor-default`,onClick:e=>e.stopPropagation(),children:[i(`button`,{type:`button`,onClick:f,className:`absolute top-6 right-6 inline-flex h-10 w-10 items-center justify-center rounded-full border border-black/[0.06] bg-white/78 text-slate-400 transition-colors hover:text-slate-900 dark:border-white/[0.06] dark:bg-white/[0.03] dark:hover:text-white z-10`,"aria-label":`Minimize overlay`,children:i(Dt,{className:`h-4 w-4`})}),i(`div`,{className:`relative mb-12 flex h-32 w-full max-w-md items-center justify-center overflow-hidden pointer-events-none`,role:`progressbar`,"aria-live":`polite`,"aria-valuenow":Math.round(n.shipProgress*100),"aria-valuemin":0,"aria-valuemax":100,"aria-label":n.text,children:[i(`div`,{className:`absolute inset-x-0 bottom-8 h-px bg-gradient-to-r from-transparent via-slate-200 to-transparent dark:via-white/10`}),i(`div`,{className:`absolute transition-[left] duration-200 ease-linear`,style:{left:`${n.shipProgress*100}%`,transform:`translateX(-50%)`},children:i(`svg`,{width:`120`,height:`60`,viewBox:`-60 -30 120 60`,children:n.shipType===`container`?i(pn,{accentColor:v.shipContainer,isMoving:!0,isDark:o}):i(fn,{accentColor:v.shipWooden,isMoving:!0,isDark:o})})})]}),i(`div`,{className:`cursor-default space-y-4 text-center`,children:[i(`div`,{className:`inline-flex items-center gap-3 rounded-full border px-5 py-2 text-xs font-bold uppercase tracking-[0.2em] ${v.badgeBorder} ${v.badgeBg} ${v.badgeText}`,children:[i(`span`,{className:`relative flex h-2 w-2`,children:[i(`span`,{className:`absolute inline-flex h-full w-full motion-safe:animate-ping rounded-full opacity-75 ${v.pingBg1}`}),i(`span`,{className:`relative inline-flex h-2 w-2 rounded-full ${v.pingBg2}`})]}),c===`quicksprint`?`Quicksprint in motion`:Pr[c]||`Planning in motion`]}),i(`div`,{className:`flex items-center justify-center gap-6`,children:[i(`div`,{className:`flex flex-col items-center`,children:[i(`div`,{className:`text-[10px] font-bold uppercase tracking-[0.14em] text-slate-400`,children:`ETA`}),i(`div`,{className:`font-mono text-xl font-medium tracking-tight text-slate-900 dark:text-white`,children:[String(Math.floor(Math.max(0,r-a)/6e4)).padStart(2,`0`),`:`,String(Math.floor(Math.max(0,r-a)%6e4/1e3)).padStart(2,`0`)]})]}),i(`div`,{className:`h-8 w-px bg-black/[0.08] dark:bg-white/[0.08]`}),i(`div`,{className:`flex flex-col items-center`,children:[i(`div`,{className:`text-[10px] font-bold uppercase tracking-[0.14em] text-slate-400`,children:`Elapsed`}),i(`div`,{className:`font-mono text-xl font-medium tracking-tight text-slate-500`,children:[String(Math.floor(a/6e4)).padStart(2,`0`),`:`,String(Math.floor(a%6e4/1e3)).padStart(2,`0`)]})]})]}),i(`div`,{className:`flex flex-col items-center overflow-hidden h-10 w-full`,children:i(`div`,{className:`flex items-center gap-3`,ref:h,children:[i(`span`,{className:`relative flex h-3 w-3`,children:[i(`span`,{className:`motion-safe:animate-ping absolute inline-flex h-full w-full rounded-full opacity-75 ${v.pingBg1}`}),i(`span`,{className:`relative inline-flex rounded-full h-3 w-3 ${v.pingBg2}`})]}),i(`h3`,{className:`font-display text-2xl font-black tracking-tight text-slate-900 dark:text-white`,"aria-live":`polite`,children:n.text})]})}),i(`p`,{className:`mx-auto max-w-xs text-sm leading-relaxed text-slate-500 dark:text-slate-400`,children:(()=>{switch(c){case`improve`:return`The Planning agent is researching your codebase to produce a more precise technical definition.`;case`replan`:return`The Planning agent is analyzing existing tasks and researching the codebase to generate an updated plan.`;case`plan_only`:return`The Planning agent is researching the codebase to decompose your sprint into grounded, atomic subtasks. Execution will wait for your review.`;case`plan_and_start`:return`The Planning agent is researching the codebase to decompose your sprint into grounded, atomic subtasks and will begin execution immediately.`;case`draft`:return`Saving your sprint definition without generating subtasks.`;case`append_tasks`:return`Adding new tasks to your existing sprint.`;default:return`The Planning agent is researching the codebase to decompose your sprint into grounded, atomic subtasks.`}})()}),i(`div`,{className:`mt-4 flex flex-row items-center justify-center gap-3`,children:[i(`button`,{type:`button`,onClick:f,className:`inline-flex items-center gap-2 rounded-full border border-black/[0.08] bg-white/66 px-4 py-2 text-xs font-semibold text-slate-500 transition-colors hover:border-black/[0.15] hover:text-slate-900 dark:border-white/[0.08] dark:bg-white/[0.04] dark:text-slate-400 dark:hover:border-white/[0.15] dark:hover:text-white`,children:`Minimize`}),p&&m&&i(`button`,{type:`button`,onClick:m,className:`inline-flex items-center gap-2 rounded-full border border-slate-900 bg-slate-900 px-4 py-2 text-xs font-semibold text-white transition-colors hover:bg-slate-800 dark:border-white dark:bg-white dark:text-slate-900 dark:hover:bg-slate-100`,children:p}),u&&i(`button`,{type:`button`,onClick:u,className:`inline-flex items-center gap-2 rounded-full border border-status-red/20 bg-status-red/[0.06] px-4 py-2 text-xs font-semibold text-status-red transition-colors hover:bg-status-red/[0.12] dark:border-status-red/20 dark:bg-status-red/[0.08] dark:text-status-red dark:hover:bg-status-red/[0.16]`,children:[i(Dt,{className:`h-3.5 w-3.5`}),`Cancel Active Request`]})]})]})]})})};p(),c();var Lr={Sparkles:tt,ShieldCheck:Oe,Accessibility:bn,Zap:Lt,Bug:xn,Code2:Pt,Database:S,FileSearch:Tn,FlaskConical:En,GitBranch:Je,Globe:Pe,Hammer:On,Heart:kn,Layers:Ae,LayoutGrid:An,Lock:Ce,Microscope:Mn,Monitor:Me,Paintbrush:Nn,RefreshCw:xe,Search:We,Server:N,Shield:Fn,Terminal:Ze,TestTube2:In,Wrench:R},Rr=[{value:`signal`,text:`text-signal-500`,bg:`bg-signal-500/10`,border:`border-signal-500/20`,dot:`bg-signal-500`},{value:`ember`,text:`text-ember-500`,bg:`bg-ember-500/10`,border:`border-ember-500/20`,dot:`bg-ember-500`},{value:`green`,text:`text-status-green`,bg:`bg-status-green/10`,border:`border-status-green/20`,dot:`bg-status-green`},{value:`red`,text:`text-status-red`,bg:`bg-status-red/10`,border:`border-status-red/20`,dot:`bg-status-red`},{value:`amber`,text:`text-status-amber`,bg:`bg-status-amber/10`,border:`border-status-amber/20`,dot:`bg-status-amber`},{value:`violet`,text:`text-violet-500`,bg:`bg-violet-500/10`,border:`border-violet-500/20`,dot:`bg-violet-500`},{value:`cyan`,text:`text-cyan-500`,bg:`bg-cyan-500/10`,border:`border-cyan-500/20`,dot:`bg-cyan-500`},{value:`rose`,text:`text-rose-500`,bg:`bg-rose-500/10`,border:`border-rose-500/20`,dot:`bg-rose-500`},{value:`blue`,text:`text-blue-500`,bg:`bg-blue-500/10`,border:`border-blue-500/20`,dot:`bg-blue-500`},{value:`slate`,text:`text-slate-500`,bg:`bg-slate-500/10`,border:`border-slate-500/20`,dot:`bg-slate-500`}],zr=e=>{let t=Rr.find(t=>t.value===e);return t?{...t,style:{}}:{text:``,bg:``,border:``,dot:``,value:e,style:{"--accent":e}}},Br=[{value:`Sparkles`,Icon:tt},{value:`ShieldCheck`,Icon:Oe},{value:`Accessibility`,Icon:bn},{value:`Zap`,Icon:Lt},{value:`Bug`,Icon:xn},{value:`Code2`,Icon:Pt},{value:`Database`,Icon:S},{value:`FileSearch`,Icon:Tn},{value:`FlaskConical`,Icon:En},{value:`GitBranch`,Icon:Je},{value:`Globe`,Icon:Pe},{value:`Hammer`,Icon:On},{value:`Heart`,Icon:kn},{value:`Layers`,Icon:Ae},{value:`LayoutGrid`,Icon:An},{value:`Lock`,Icon:Ce},{value:`Microscope`,Icon:Mn},{value:`Monitor`,Icon:Me},{value:`Paintbrush`,Icon:Nn},{value:`RefreshCw`,Icon:xe},{value:`Search`,Icon:We},{value:`Server`,Icon:N},{value:`Shield`,Icon:Fn},{value:`Terminal`,Icon:Ze},{value:`TestTube2`,Icon:In},{value:`Wrench`,Icon:R}],Vr=({projectId:t,onClose:a,onExecute:o,templates:c,loading:l=!1,agentPresets:u=[],virtualProviders:d=[],defaultRouteOptionLabel:p=`Default Route`,defaultModelOptionLabel:h=`Default Model`,defaultRouteIconProviderId:g=null,planningEta:_=18e4,onCreateTemplate:v,onUpdateTemplate:y,onDeleteTemplate:b})=>{let x=s(null),S=s(null),[C,w]=m(`browse`),[T,E]=m(null),[D,O]=m(``),[k,A]=m(5),[j,M]=m(null),[N,ee]=m(null),[F,I]=m(!1),[L,R]=m(``),[z,B]=m(null),[te,V]=m(``),[ne,re]=m(``),[ie,H]=m(`Zap`),[ae,oe]=m(`engineering`),[U,se]=m(`#22c55e`),[W,ce]=m(!1),[le,G]=m(!1),ue=lt(le,{onClose:()=>G(!1),restoreFocus:!0}),K=lt(W,{onClose:()=>ce(!1),restoreFocus:!0}),[de,fe]=m({top:0,left:0}),[pe,me]=m(``),[he,ge]=m(5),[_e,ve]=m(``),[q,ye]=m(!1),[J,be]=m(!1),[xe,Se]=m(null),[Ce,Te]=m(0),[Ee,De]=m(!1),Oe=s(null),ke=s(null),Ae=s(0),je=xe!==null,Y=r(()=>c.find(e=>e.id===T)||null,[c,T]),Me=r(()=>c.filter(e=>e.isBuiltIn),[c]),Ne=r(()=>c.filter(e=>!e.isBuiltIn),[c]),Pe=r(()=>{let e=new Map;for(let t of Me){let n=t.purpose||`general`;e.has(n)||e.set(n,{value:n,label:t.purposeLabel||`General`,description:t.purposeDescription})}return Array.from(e.values())},[Me]);f(()=>{if(Pe.length===0){D&&O(``);return}Pe.some(e=>e.value===D)||O(Pe[0].value)},[Pe,D]);let Fe=r(()=>Pe.find(e=>e.value===D)||Pe[0]||null,[Pe,D]),Ie=r(()=>Fe?Me.filter(e=>(e.purpose||`general`)===Fe.value):Me,[Fe,Me]),Le=r(()=>{if(!Y)return``;let e=[],t=Y.agentPresetId;if(t){let n=u.find(e=>e.id===t);n?.instructionMarkdown&&e.push(`## Agent Context\n\nYou are operating as the "${n.name}" agent. Follow these agent-specific instructions:\n\n${n.instructionMarkdown}\n\n---`)}return Y.agentInstructionMarkdown&&e.push(Y.agentInstructionMarkdown),L.trim()&&e.push(`## Additional Instructions\n\n${L.trim()}`),e.push(`Produce exactly ${k} subtasks.`),e.join(`
|
|
1
|
+
import{O as e,P as t,S as n,_ as r,a as i,c as a,f as o,h as s,j as c,k as l,o as u,v as d,w as f,x as p,y as m}from"./vendor-Dl0fhdV0.js";import{t as h}from"./createLucideIcon-BshUfn15.js";import{i as g,n as _,r as v,t as y}from"./list-todo-DJl-wxIV.js";import{n as b,t as x}from"./message-square-DiaHza4H.js";import{n as S,t as C}from"./sliders-horizontal-6rJeI8Qo.js";import{t as w}from"./link-BfFF-gXK.js";import{t as T}from"./ListWindowSelector-DtKcmXGY.js";import{a as E,i as D,n as O,o as k,r as A,t as j}from"./quicksprint-api-BQTtbGzW.js";import{t as M}from"./save-DFYp4CAL.js";import{t as N}from"./server-Colb_cUG.js";import{t as P}from"./settings-2-B5NbDo8J.js";import{n as ee,r as F,t as I}from"./user-round-B1T_51SC.js";import{t as L}from"./upload-CU4ugZOr.js";import{t as R}from"./wrench-DSVlxBRn.js";import{A as z,B,F as te,H as V,I as ne,J as re,N as ie,O as H,U as ae,V as oe,W as U,X as se,g as W,h as ce,i as le,j as G,k as ue,q as K,r as de,y as fe,z as pe}from"./project-data-BSCsMQnj.js";import{a as me,c as he,d as ge,i as _e,n as ve,o as q,r as ye,t as J}from"./use-reduced-motion-Dxh6NCDM.js";import{Ai as be,Ar as xe,B as Se,Br as Ce,C as we,Cr as Te,D as Ee,Dt as De,Er as Oe,Fr as ke,Gr as Ae,Hr as je,I as Y,Ir as Me,J as Ne,Jr as Pe,K as Fe,L as Ie,Li as Le,M as Re,Mi as ze,Mr as Be,N as Ve,Nr as He,Oi as Ue,Or as We,Ot as Ge,P as Ke,Pi as qe,Qr as Je,S as Ye,Si as Xe,Sr as Ze,St as Qe,Ti as $e,Tn as et,Tr as tt,U as nt,Ur as rt,Vr as X,Yr as it,Yt as at,_ as ot,_r as st,ai as ct,ar as lt,at as ut,b as dt,cn as ft,cr as pt,ct as mt,dr as ht,ei as gt,et as _t,fi as vt,fn as yt,fr as bt,ft as xt,g as St,gr as Ct,gt as wt,h as Tt,hi as Et,hr as Dt,ht as Ot,i as Z,ii as kt,it as At,jr as jt,jt as Mt,kt as Nt,li as Pt,ln as Ft,m as It,mr as Lt,mt as Rt,n as zt,ni as Bt,nn as Vt,nt as Ht,on as Ut,or as Q,pi as Wt,pr as $,pt as Gt,qr as Kt,r as qt,ri as Jt,rt as Yt,si as Xt,sn as Zt,sr as Qt,st as $t,t as en,tn,u as nn,vi as rn,wr as an,wt as on,x as sn,y as cn,yr as ln,zi as un,zr as dn}from"./index-DddY8OV0.js";import{r as fn,t as pn}from"./PlanningShip-BejkTCIr.js";import{a as mn,n as hn,o as gn,r as _n,t as vn}from"./BranchNameSchemeEditor-Bk2p-g2z.js";import{n as yn}from"./list-window-BtcrCL8y.js";var bn=h(`accessibility`,[[`circle`,{cx:`16`,cy:`4`,r:`1`,key:`1grugj`}],[`path`,{d:`m18 19 1-7-6 1`,key:`r0i19z`}],[`path`,{d:`m5 8 3-3 5.5 3-2.36 3.5`,key:`9ptxx2`}],[`path`,{d:`M4.24 14.5a5 5 0 0 0 6.88 6`,key:`10kmtu`}],[`path`,{d:`M13.76 17.5a5 5 0 0 0-6.88-6`,key:`2qq6rc`}]]),xn=h(`bug`,[[`path`,{d:`M12 20v-9`,key:`1qisl0`}],[`path`,{d:`M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z`,key:`uouzyp`}],[`path`,{d:`M14.12 3.88 16 2`,key:`qol33r`}],[`path`,{d:`M21 21a4 4 0 0 0-3.81-4`,key:`1b0z45`}],[`path`,{d:`M21 5a4 4 0 0 1-3.55 3.97`,key:`5cxbf6`}],[`path`,{d:`M22 13h-4`,key:`1jl80f`}],[`path`,{d:`M3 21a4 4 0 0 1 3.81-4`,key:`1fjd4g`}],[`path`,{d:`M3 5a4 4 0 0 0 3.55 3.97`,key:`1d7oge`}],[`path`,{d:`M6 13H2`,key:`82j7cp`}],[`path`,{d:`m8 2 1.88 1.88`,key:`fmnt4t`}],[`path`,{d:`M9 7.13V6a3 3 0 1 1 6 0v1.13`,key:`1vgav8`}]]),Sn=h(`calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),Cn=h(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),wn=h(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),Tn=h(`file-search`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`11.5`,cy:`14.5`,r:`2.5`,key:`1bq0ko`}],[`path`,{d:`M13.3 16.3 15 18`,key:`2quom7`}]]),En=h(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),Dn=h(`gitlab`,[[`path`,{d:`m22 13.29-3.33-10a.42.42 0 0 0-.14-.18.38.38 0 0 0-.22-.11.39.39 0 0 0-.23.07.42.42 0 0 0-.14.18l-2.26 6.67H8.32L6.1 3.26a.42.42 0 0 0-.1-.18.38.38 0 0 0-.26-.08.39.39 0 0 0-.23.07.42.42 0 0 0-.14.18L2 13.29a.74.74 0 0 0 .27.83L12 21l9.69-6.88a.71.71 0 0 0 .31-.83Z`,key:`148pdi`}]]),On=h(`hammer`,[[`path`,{d:`m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9`,key:`1hayfq`}],[`path`,{d:`m18 15 4-4`,key:`16gjal`}],[`path`,{d:`m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5`,key:`15ts47`}]]),kn=h(`heart`,[[`path`,{d:`M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5`,key:`mvr1a0`}]]),An=h(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),jn=h(`list-plus`,[[`path`,{d:`M16 5H3`,key:`m91uny`}],[`path`,{d:`M11 12H3`,key:`51ecnj`}],[`path`,{d:`M16 19H3`,key:`zzsher`}],[`path`,{d:`M18 9v6`,key:`1twb98`}],[`path`,{d:`M21 12h-6`,key:`bt1uis`}]]),Mn=h(`microscope`,[[`path`,{d:`M6 18h8`,key:`1borvv`}],[`path`,{d:`M3 22h18`,key:`8prr45`}],[`path`,{d:`M14 22a7 7 0 1 0 0-14h-1`,key:`1jwaiy`}],[`path`,{d:`M9 14h2`,key:`197e7h`}],[`path`,{d:`M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z`,key:`1bmzmy`}],[`path`,{d:`M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3`,key:`1drr47`}]]),Nn=h(`paintbrush`,[[`path`,{d:`m14.622 17.897-10.68-2.913`,key:`vj2p1u`}],[`path`,{d:`M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z`,key:`18tc5c`}],[`path`,{d:`M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15`,key:`ytzfxy`}]]),Pn=h(`rocket`,[[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}],[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09`,key:`u4xsad`}],[`path`,{d:`M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z`,key:`676m9`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05`,key:`92ym6u`}]]),Fn=h(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),In=h(`test-tube-diagonal`,[[`path`,{d:`M21 7 6.82 21.18a2.83 2.83 0 0 1-3.99-.01a2.83 2.83 0 0 1 0-4L17 3`,key:`1ub6xw`}],[`path`,{d:`m16 2 6 6`,key:`1gw87d`}],[`path`,{d:`M12 16H4`,key:`1cjfip`}]]),Ln=h(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]);c(),p(),o(),c();var Rn=()=>i(`div`,{role:`separator`,className:`my-1 h-px bg-black/[0.06] dark:bg-white/[0.07]`}),zn=({sprint:t,isCompleted:n=!1,showcaseBusy:r=!1,markCompletedDisabled:a=!1,deleteBusy:o=!1,isRunning:s=!1,isPaused:c=!1,primaryBusy:l=!1,pauseResumeBusy:u=!1,onPrimaryAction:d,onPauseResume:f,onAddTasks:p,viewTasksHref:m,onEdit:h,onExport:g,onToggleShowcase:_,onOverrides:v,onMarkCompleted:b,onDelete:x,onClose:S,markCompletedIcon:C=`circle`,role:w,buttonClassName:T=`flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-left text-xs font-medium text-slate-600 transition-colors hover:bg-black/[0.04] hover:text-slate-900 dark:text-slate-300 dark:hover:bg-white/[0.05] dark:hover:text-white focus:outline-none focus-visible:ring-2 focus-visible:ring-signal-500/30 focus-visible:ring-offset-2`})=>{let E=T.replace(/text-slate-600 transition-colors hover:bg-black\/\[0\.04\] hover:text-slate-900/,`text-status-red hover:bg-status-red/10`).replace(/dark:text-slate-300 dark:hover:bg-white\/\[0\.05\] dark:hover:text-white/,``).replace(/focus-visible:ring-signal-500\/30/,`focus-visible:ring-status-red/30`),D=`${T} disabled:cursor-not-allowed disabled:opacity-40`,O=!!f&&(s||c);return i(e,{children:[(!!d||O||!!m||!!p)&&i(e,{children:[d&&i(`button`,{type:`button`,role:w,onClick:()=>{S?.(),d()},disabled:l,className:D,children:[l?i(X,{className:`h-3.5 w-3.5 animate-spin`,strokeWidth:2.1}):i(s?an:He,{className:`h-3.5 w-3.5`,fill:`currentColor`,strokeWidth:2.1}),s?`Stop Sprint`:`Start Sprint`]}),O&&i(`button`,{type:`button`,role:w,onClick:()=>{S?.(),f?.()},disabled:u,className:D,children:[u?i(X,{className:`h-3.5 w-3.5 animate-spin`,strokeWidth:2.1}):i(c?He:ke,{className:`h-3.5 w-3.5`,fill:`currentColor`,strokeWidth:2.1}),c?`Resume`:`Pause`]}),m&&i(`a`,{href:m,role:w,onClick:()=>S?.(),"aria-label":`View tasks for sprint ${t.name}`,className:T,children:[i(dn,{className:`h-3.5 w-3.5`,strokeWidth:2.1}),`View Tasks`]}),p&&i(`button`,{type:`button`,role:w,onClick:()=>{S?.(),p()},className:T,children:[i(y,{className:`h-3.5 w-3.5`,strokeWidth:2.1}),`Add Tasks`]}),i(Rn,{})]}),i(`button`,{type:`button`,role:w,onClick:()=>{S?.(),h?.()},"aria-label":`Edit sprint ${t.name}`,className:T,children:[i(k,{className:`h-3.5 w-3.5`,strokeWidth:2.1}),`Edit`]}),i(`button`,{type:`button`,role:w,onClick:()=>{S?.(),g?.()},"aria-label":`Export sprint ${t.name}`,className:T,children:[i(Cn,{className:`h-3.5 w-3.5`,strokeWidth:2.1}),`Export`]}),i(`button`,{type:`button`,role:w,onClick:()=>{S?.(),v?.()},"aria-label":`Configure overrides for sprint ${t.name}`,className:T,children:[i(tt,{className:`h-3.5 w-3.5`,strokeWidth:2.1}),`Overrides`]}),i(`button`,{type:`button`,role:w,onClick:()=>{S?.(),_?.()},disabled:r,className:D,children:[i(kn,{className:`h-3.5 w-3.5`,fill:t.showcasePinned?`currentColor`:`none`,strokeWidth:2.1}),t.showcasePinned?`Remove`:`Add`]}),i(Rn,{}),!n&&i(`button`,{type:`button`,role:w,onClick:()=>{S?.(),b?.()},disabled:a,"aria-label":`Mark sprint ${t.name} as completed`,className:D,children:[i(C===`square`?F:rn,{className:`h-3.5 w-3.5`,strokeWidth:2.1}),`Mark Completed`]}),i(`button`,{type:`button`,role:w,onClick:()=>{S?.(),x?.()},disabled:o,"aria-label":`Delete sprint ${t.name}`,className:o?`${E} disabled:cursor-not-allowed disabled:opacity-40`:E,children:[o?i(X,{className:`h-3.5 w-3.5 animate-spin`,strokeWidth:2.1}):i(Et,{className:`h-3.5 w-3.5`,strokeWidth:2.1}),o?`Deleting...`:`Delete`]})]})},Bn=({children:r,content:a,position:o=`bottom`,align:c=`start`,gap:p=8,className:h=``,isOpen:g,onOpenChange:_,triggerRef:v,computePosition:y})=>{let b=J(),x=bt(),[S,C]=m(!1),w=s(null),T=v||w,E=s(null),D=s(null),[O,k]=m({top:0,left:0}),[A,j]=m(`top center`),[M]=m(()=>`menu-${Math.random().toString(36).substr(2,9)}`),N=n(()=>{if(!T.current||!E.current)return;let e=T.current.getBoundingClientRect(),t=E.current.getBoundingClientRect();if(y){let n=y({triggerRect:e,menuRect:t,viewport:{width:window.innerWidth,height:window.innerHeight},defaultPosition:o,defaultAlign:c,gap:p});k({top:n.top,left:n.left}),j(n.transformOrigin??`top center`);return}let{top:n,left:r}=tn({triggerRect:e,contentRect:t,position:o,align:c,gap:p,padding:8});k({top:n,left:r}),j(`top center`)},[c,y,p,o,T]);return f(()=>{g?(C(!0),D.current=document.activeElement):S&&(!document.activeElement||document.activeElement===document.body||E.current&&E.current.contains(document.activeElement))&&(D.current?.isConnected?(D.current.focus({preventScroll:!0}),D.current=null):T.current?.isConnected&&T.current.focus({preventScroll:!0}))},[g]),d(()=>{g&&S&&N()},[g,S,N]),f(()=>{if(g)return window.addEventListener(`resize`,N),window.addEventListener(`scroll`,N,{capture:!0,passive:!0}),()=>{window.removeEventListener(`resize`,N),window.removeEventListener(`scroll`,N,{capture:!0})}},[g,N]),d(()=>{E.current&&($.killTweensOf(E.current),g?($.fromTo(E.current,{opacity:0,scale:.95,y:o===`bottom`?-5:o===`top`?5:0},{opacity:1,scale:1,y:0,duration:b?0:x.enterExit.duration,ease:x.enterExit.ease}),requestAnimationFrame(()=>{(E.current?.querySelector(`[role="menuitem"]:not([disabled]):not([aria-disabled="true"])`))?.focus({preventScroll:!0})})):S&&$.to(E.current,{opacity:0,scale:.95,y:o===`bottom`?-5:o===`top`?5:0,duration:b?0:x.enterExit.duration,ease:x.enterExit.ease,onComplete:()=>C(!1)}))},[g,S,o,b]),f(()=>{let e=e=>{g&&E.current&&!E.current.contains(e.target)&&T.current&&!T.current.contains(e.target)&&_(!1)},t=e=>{if(!g)return;if(e.key===`Escape`){_(!1);return}if(!E.current)return;let t=Array.from(E.current.querySelectorAll(`[role="menuitem"]:not([disabled]):not([aria-disabled="true"])`));if(t.length===0)return;let n=t.findIndex(e=>e===document.activeElement);e.key===`ArrowDown`?(e.preventDefault(),t[(n+1)%t.length]?.focus()):e.key===`ArrowUp`?(e.preventDefault(),t[n===-1?t.length-1:(n-1+t.length)%t.length]?.focus()):e.key===`Home`?(e.preventDefault(),t[0]?.focus()):e.key===`End`?(e.preventDefault(),t[t.length-1]?.focus()):(e.key===`Enter`||e.key===` `)&&document.activeElement&&t.includes(document.activeElement)&&document.activeElement.getAttribute(`role`)===`menuitem`&&(e.preventDefault(),document.activeElement.click())};return g&&(document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t)),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[g,_]),i(e,{children:[t(r)?l(r,{ref:v?void 0:w,onClick:e=>{e.stopPropagation(),_(!g),r.props.onClick&&r.props.onClick(e)},onKeyDown:e=>{!v&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),_(!g)),r.props.onKeyDown&&r.props.onKeyDown(e)},"aria-haspopup":`menu`,"aria-expanded":g,"aria-controls":g?M:void 0}):i(`button`,{type:`button`,ref:v?void 0:w,className:`inline-flex cursor-pointer text-left`,onClick:e=>{e.stopPropagation(),_(!g)},onKeyDown:e=>{!v&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),_(!g))},"aria-haspopup":`menu`,"aria-expanded":g,"aria-controls":g?M:void 0,children:r}),S&&typeof document<`u`&&u(i(`div`,{id:M,ref:E,role:`menu`,className:`fixed z-[100] bg-white dark:bg-void-800 border border-black/[0.08] dark:border-white/[0.08] shadow-[0_16px_36px_rgba(15,23,42,0.14)] dark:shadow-[0_16px_36px_rgba(0,0,0,0.4)] rounded-2xl p-2 ${g?``:`pointer-events-none`} ${h}`,style:{top:O.top,left:O.left,transformOrigin:A},onClick:e=>e.stopPropagation(),children:a}),document.body)]})},Vn=8,Hn=8;function Un(e,t,n){let r=Math.min(n.width,Math.max(0,t.width-Vn*2)),i=Math.min(n.height,Math.max(0,t.height-Vn*2)),a=e.right-r,o=t.width-r-Vn,s=Math.max(Vn,Math.min(a,o)),c=e.bottom+Hn,l=c+i<=t.height-Vn;return{top:l?c:Math.max(Vn,e.top-i-Hn),left:s,placement:l?`bottom`:`top`,transformOrigin:l?`top right`:`bottom right`}}p();var Wn=new Intl.DateTimeFormat(`en-US`,{month:`short`,day:`numeric`}),Gn={running:{ring:`border-status-green/45 shadow-[0_0_34px_rgba(0,171,132,0.28)]`,text:`text-status-green`,icon:qe,label:`Running`,accentHex:`#00AB84`},paused:{ring:`border-status-amber/45 shadow-[0_0_34px_rgba(245,158,11,0.24)]`,text:`text-status-amber`,icon:vt,label:`Paused`,accentHex:`#F59E0B`},completed:{ring:`border-slate-300/50 shadow-[0_0_24px_rgba(148,163,184,0.18)]`,text:`text-slate-500 dark:text-slate-400`,icon:rn,label:`Completed`,accentHex:`#94A3B8`},failed:{ring:`border-status-red/55 shadow-[0_0_34px_rgba(227,0,15,0.3)]`,text:`text-status-red`,icon:Et,label:`Failed`,accentHex:`#E3000F`},cancelled:{ring:`border-slate-300/35 shadow-[0_0_24px_rgba(148,163,184,0.16)]`,text:`text-slate-400 dark:text-slate-500`,icon:Et,label:`Cancelled`,accentHex:`#94A3B8`},idle:{ring:``,text:`text-signal-600 dark:text-signal-300`,icon:vt,label:`Draft`,accentHex:`#00E0A0`}},Kn={merge_required:{label:`Merge`,text:`text-purple-600 dark:text-purple-400`,accentHex:`#A855F7`},merge_conflict:{label:`Conflict`,text:`text-status-red`,accentHex:`#E3000F`},ci_fix_required:{label:`CI`,text:`text-blue-600 dark:text-blue-400`,accentHex:`#3B82F6`}},qn=(e,t=`SPR`)=>e.number?`${t}-${e.number}`:e.slug.toUpperCase(),Jn=e=>Wn.format(new Date(e)),Yn=new Intl.DateTimeFormat(`en-US`,{hour:`2-digit`,minute:`2-digit`,hour12:!1}),Xn=e=>Yn.format(new Date(e)),Zn=({sprint:e,isEven:t,accentColor:n,primaryBusy:r=!1,showcaseBusy:a=!1,isPaused:o=!1,pauseResumeBusy:c=!1,humanIntervention:l=null,onPrimaryAction:u,onPauseResume:d,onAddTasks:f,onEdit:p,onDelete:h,onExport:g,onOverrides:_,onToggleShowcase:v,onMarkCompleted:y})=>{let b=ye(e.projectId),x=J(),S=b.data?.settings?.git?.sprintKeyPrefix||`SPR`,C=s(null),[w,T]=m(!1),E=Gn[e.status],D=sn({state:e.status,humanInterventionTitle:l?.title??null,humanInterventionReason:l?.reason??null,humanInterventionInstructions:l?.instructions??null,humanInterventionOwnerType:l?.ownerType??null,attentionType:l?.attentionType??null,completion:e.completion,latestReviewStatus:e.latestReview?.status??null}),O=(e.status===`running`||e.status===`paused`)&&l?.attentionType?Kn[l.attentionType]:void 0,k=D.statusLabel,A=E.text,j=E.accentHex,M=E.icon;k===`QA`?(A=`text-status-amber`,j=`#F59E0B`,M=qe):k===`Merge`?(A=`text-purple-600 dark:text-purple-400`,j=`#A855F7`,M=qe):k===`Merge Conflict`?(A=`text-status-red`,j=`#E3000F`,M=st):O&&(k=O.label,A=O.text,j=O.accentHex);let N=e.status===`completed`,P=e.status===`running`,ee=!!l&&D.showHumanInterventionBadge,F=N?``:t?`animate-organic`:`animate-organic-reverse`,I=x?void 0:{animationDuration:`calc(${pt.timing.slow} * 12)`,animationTimingFunction:pt.easing.standard};return i(`div`,{ref:C,onMouseEnter:()=>{!C.current||N||$.to(C.current,{scale:1.05,rotation:(Math.random()-.5)*4,duration:.8,ease:`elastic.out(1, 0.5)`,overwrite:`auto`})},onMouseLeave:()=>{!C.current||N||$.to(C.current,{scale:1,rotation:0,duration:.95,ease:`elastic.out(1, 0.5)`,overwrite:`auto`})},className:`group relative flex h-72 w-72 shrink-0 cursor-pointer items-center justify-center perspective-1000 lg:h-80 lg:w-80`,children:[i(`div`,{className:`pointer-events-none absolute inset-0 rounded-[1.75rem] shadow-[0_24px_48px_rgba(0,0,0,0.07)] transition-all duration-700 dark:shadow-[0_24px_48px_rgba(0,0,0,0.5)] ${F} ${N?`opacity-80`:``}`}),i(`div`,{className:`absolute inset-0 rounded-[1.75rem] overflow-hidden border border-white/70 backdrop-blur-md transition-all duration-700 transform-gpu dark:border-white/[0.06] ${F} ${N?`opacity-80`:``} ${P?`bg-white/72 dark:bg-void-800/82`:`bg-white/55 dark:bg-void-800/65`}`,style:{WebkitMaskImage:`-webkit-radial-gradient(white, black)`,backfaceVisibility:`hidden`},children:[i(`div`,{className:`absolute inset-0 pointer-events-none shadow-[inset_0_0_0_1px_rgba(255,255,255,0.5)] dark:shadow-[inset_0_0_0_1px_rgba(255,255,255,0.04)] ${F}`}),i(Gt,{accentHex:E.accentHex}),i(xt,{accentHex:E.accentHex})]}),E.ring&&!N&&i(`div`,{className:`absolute inset-0 pointer-events-none mix-blend-screen scale-[1.012] ${F}`,style:{zIndex:10},children:[i(`div`,{className:`absolute inset-0 rounded-[inherit] border border-status-green/50 dark:mix-blend-screen`,style:{borderColor:`${j}70`}}),i(`div`,{className:`absolute inset-0 rounded-[inherit] animate-[pulse_3.5s_ease-in-out_infinite]`,style:{boxShadow:`0 0 20px ${j}40, inset 0 0 10px ${j}20`}})]}),e.latestReview?.status===`running`&&i(`div`,{className:`absolute inset-0 pointer-events-none ${F}`,style:{zIndex:10},children:i(`div`,{className:`absolute inset-0 rounded-[inherit] border-2 border-blue-400/55`})}),N&&i(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center`,children:i($e,{className:`h-40 w-40 text-slate-900/[0.06] dark:text-white/[0.05]`,strokeWidth:1.2})}),i(`div`,{className:`relative z-20 flex h-full w-full flex-col items-center justify-center p-8 text-center`,children:[i(`div`,{className:`absolute top-5 flex items-center gap-1.5 opacity-0 transition-opacity duration-300 group-hover:opacity-100 ${A}`,children:[i(M,{className:`h-3.5 w-3.5 ${P?`animate-pulse`:``}`,strokeWidth:2.5}),i(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.14em]`,children:k})]}),i(`div`,{className:`absolute left-7 top-7 inline-flex flex-col gap-0.5 font-mono text-[10px] font-bold uppercase tracking-[0.14em] ${n}`,children:[i(`div`,{className:`flex items-center gap-1.5`,children:[i(Ue,{className:`h-3.5 w-3.5`,strokeWidth:2.1}),Jn(e.createdAt)]}),i(`div`,{className:`pl-5 opacity-0 transition-opacity duration-300 group-hover:opacity-100`,children:Xn(e.createdAt)})]}),(ee||e.latestReview)&&i(`div`,{className:`absolute right-4 top-4 z-[60] flex items-center gap-2 lg:right-5 lg:top-5`,children:[e.latestReview&&i(Ge,{summary:e.latestReview,compact:!0,align:`right`}),ee&&l&&i(`div`,{className:x?``:`animate-pulse`,style:I,children:i(mt,{summary:l,label:`Needs you`,compact:!0,align:`right`})})]}),i(`div`,{className:`inline-flex items-center gap-1.5 rounded-full border border-black/[0.06] bg-black/[0.03] px-4 py-1.5 font-mono text-[11px] font-bold tracking-[0.14em] transition-transform duration-300 group-hover:-translate-y-3 dark:border-white/[0.06] dark:bg-white/[0.03] ${n}`,children:[i(tt,{className:`h-3.5 w-3.5`,strokeWidth:2.2}),qn(e,S)]}),i(`div`,{className:`mt-4 flex w-full flex-col items-center justify-center gap-3 px-4 transition-transform duration-300 group-hover:-translate-y-3`,children:i(`h3`,{className:`font-display text-2xl font-black leading-tight tracking-tight text-[var(--text-primary)]`,children:e.name})}),i(`div`,{className:`mt-6 flex items-center justify-center gap-7 text-center transition-transform duration-300 group-hover:-translate-y-3`,children:[i(`div`,{className:`flex flex-col items-center`,children:[i(`div`,{className:`font-mono text-[2rem] font-black text-[var(--text-primary)]`,children:e.tasksCount}),i(`div`,{className:`mt-0.5 text-[9px] font-bold uppercase tracking-[0.14em] text-slate-400`,children:`Tasks`})]}),i(`div`,{className:`h-10 w-px bg-black/[0.08] dark:bg-white/[0.08]`}),i(`div`,{className:`flex flex-col items-center`,children:[i(`div`,{className:`font-mono text-[2rem] font-black text-[var(--text-primary)]`,children:[e.completion,`%`]}),i(`div`,{className:`mt-0.5 text-[9px] font-bold uppercase tracking-[0.14em] text-slate-400`,children:`Done`})]})]}),i(`div`,{className:`absolute bottom-5 flex w-full items-center justify-center gap-3 transition-all duration-300 ${w?`translate-y-0 opacity-100`:`translate-y-2 opacity-0 pointer-events-none group-hover:translate-y-0 group-hover:opacity-100 group-hover:pointer-events-auto group-focus-within:translate-y-0 group-focus-within:opacity-100 group-focus-within:pointer-events-auto`}`,children:[i(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),u?.()},disabled:!u||r,className:`touch-target flex h-9 w-9 items-center justify-center rounded-full text-slate-800 transition-all duration-300 dark:text-white focus-visible:ring-2 focus-visible:ring-signal-500/30 focus-visible:ring-offset-2 ${P?`bg-status-red/[0.12] shadow-[0_0_18px_rgba(227,0,15,0.16)] hover:bg-status-red/[0.18]`:`bg-signal-500/[0.12] shadow-[0_0_18px_rgba(0,224,160,0.16)] hover:bg-signal-500/[0.18]`} disabled:cursor-not-allowed disabled:opacity-60`,title:P?`Stop`:`Start`,children:i(P?an:He,{className:`h-3.5 w-3.5 ${r?`animate-pulse`:``}`,fill:`currentColor`})}),i(`a`,{href:`/tasks?sprint=${encodeURIComponent(e.id)}`,onClick:e=>e.stopPropagation(),className:`touch-target inline-flex h-9 items-center gap-1.5 rounded-full bg-slate-900 px-5 text-[10px] font-bold uppercase tracking-[0.14em] text-white shadow-[0_4px_12px_rgba(0,0,0,0.15)] transition-all hover:opacity-85 dark:bg-white dark:text-void-900 focus-visible:ring-2 focus-visible:ring-signal-500/30 focus-visible:ring-offset-2`,children:[`View Tasks`,i(dn,{className:`h-2.5 w-2.5`})]}),i(Bn,{isOpen:w,onOpenChange:T,position:`top`,align:`end`,className:`min-w-[10rem]`,computePosition:({triggerRect:e,menuRect:t,viewport:n})=>Un(e,n,{width:t.width,height:t.height}),content:i(zn,{sprint:e,isCompleted:N,showcaseBusy:a,isRunning:P,isPaused:o,primaryBusy:r,pauseResumeBusy:c,onPrimaryAction:u,onPauseResume:d,onAddTasks:f,viewTasksHref:`/tasks?sprint=${encodeURIComponent(e.id)}`,onEdit:p,onExport:g,onToggleShowcase:v,onOverrides:_,onMarkCompleted:y,onDelete:h,onClose:()=>T(!1),markCompletedIcon:`circle`,role:`menuitem`,buttonClassName:`flex w-full items-center gap-2 rounded-[1rem] px-3 py-2 text-left text-xs font-medium text-slate-600 transition-colors hover:bg-black/[0.04] hover:text-slate-900 dark:text-slate-300 dark:hover:bg-white/[0.05] dark:hover:text-white focus-visible:ring-2 focus-visible:ring-signal-500/30 focus-visible:ring-offset-2`}),children:i(`button`,{type:`button`,"aria-haspopup":`menu`,"aria-expanded":w,className:`touch-target flex h-9 w-9 items-center justify-center rounded-full bg-black/[0.06] text-slate-800 transition-colors hover:bg-black/10 dark:bg-white/[0.07] dark:text-white dark:hover:bg-white/10 focus-visible:ring-2 focus-visible:ring-signal-500/30 focus-visible:ring-offset-2`,title:`Settings`,children:i(wn,{className:`h-3.5 w-3.5`})})})]})]})]})},Qn={query:``,status:`all`,showcase:`all`,qa:`all`},$n={running:`Running`,paused:`Paused`,completed:`Completed`,failed:`Failed`,cancelled:`Cancelled`,idle:`Draft`},er={running:0,paused:1,idle:2,completed:3,failed:4,cancelled:5},tr=(e,t=`SPR`)=>e.number?`${t}-${e.number}`:e.slug.toUpperCase(),nr=(e,t)=>e.localeCompare(t,void 0,{sensitivity:`base`});function rr(e,t,n=`SPR`){let r=e;t.status!==`all`&&t.status.size>0&&(r=r.filter(e=>t.status.has(e.status))),t.showcase===`pinned`?r=r.filter(e=>e.showcasePinned):t.showcase===`unpinned`&&(r=r.filter(e=>!e.showcasePinned)),t.qa===`missing`?r=r.filter(e=>!e.latestReview):t.qa===`running`?r=r.filter(e=>e.latestReview?.status===`running`):t.qa===`reviewed`&&(r=r.filter(e=>e.latestReview&&e.latestReview.status!==`running`));let i=t.query.trim();if(!i)return r;let a=i.toLowerCase();return r.filter(e=>{let t=tr(e,n).toLowerCase(),r=e.name.toLowerCase(),i=$n[e.status].toLowerCase(),o=(e.goal||``).toLowerCase();return t.includes(a)||r.includes(a)||i.includes(a)||o.includes(a)})}function ir(e,t,n=`SPR`){let r=[...e].sort((e,r)=>{switch(t.key){case`showcasePinned`:return Number(r.showcasePinned)-Number(e.showcasePinned);case`sprintKey`:return e.number!==null&&r.number!==null&&e.number!==r.number?e.number-r.number:nr(tr(e,n),tr(r,n));case`name`:return nr(e.name,r.name);case`status`:return er[e.status]-er[r.status];case`tasksCount`:return e.tasksCount-r.tasksCount;case`completion`:return e.completion-r.completion;default:return e.createdAt.localeCompare(r.createdAt)}});return t.direction===`desc`&&r.reverse(),r}function ar(e,t){return e.slice(0,t)}function or(e,t){let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n}function sr(){return new Set}function cr(e,t){let n=new Set(t.map(e=>e.id)),r=new Set;for(let t of e)n.has(t)&&r.add(t);return r}function lr(e,t){return t.filter(t=>e.has(t.id))}function ur(e,t){return e.key===t?{key:t,direction:e.direction===`asc`?`desc`:`asc`}:{key:t,direction:t===`name`||t===`status`||t===`showcasePinned`||t===`sprintKey`?`asc`:`desc`}}function dr({children:e,className:t=``,caption:n,ariaLabel:r,ariaLabelledBy:a}){return i(`div`,{className:`overflow-x-hidden lg:overflow-visible ${t}`,children:i(`table`,{className:`block w-full border-separate border-spacing-y-4 text-left lg:table`,"aria-label":r,"aria-labelledby":a,role:`table`,children:[n&&i(`caption`,{className:`sr-only`,children:n}),e]})})}function fr({children:e}){return i(`thead`,{className:`sr-only lg:not-sr-only lg:table-header-group`,role:`rowgroup`,children:i(`tr`,{className:`text-[color:var(--text-metadata)] text-xs font-medium`,children:e})})}function pr({children:e}){return i(`tbody`,{className:`block lg:table-row-group`,role:`rowgroup`,children:e})}function mr({children:e,className:t=``,selected:n,onClick:r,style:a}){return i(`tr`,{onClick:r,"aria-selected":n,role:`row`,className:`group mb-3 block overflow-hidden rounded-[1.5rem] border shadow-[var(--elevation-base)] backdrop-blur-xl transition-all duration-300 hover:-translate-y-0.5 hover:shadow-[var(--elevation-raised)] focus-within:ring-2 focus-within:ring-signal-500/20 lg:table-row lg:overflow-visible lg:rounded-none lg:border-0 lg:shadow-none lg:hover:bg-[var(--fill-muted-hover)] lg:transition-colors lg:duration-150 ${r?`cursor-pointer`:``} ${n?`bg-signal-500/5 ring-2 ring-inset ring-signal-500/30`:``} ${t}`,style:a,children:e})}function hr({children:e,className:t=``,isFirst:n,isLast:r,isHeader:a,align:o=`left`,colSpan:s,mobileLabel:c,ariaSort:l}){let u=o===`right`?`text-right`:o===`center`?`text-center`:`text-left`;return a?i(`th`,{scope:`col`,"aria-sort":l,className:`border-y border-[color:var(--border-hairline)] bg-[var(--surface-glass)] px-4 py-2 ${u} ${n?`rounded-l-2xl border-l`:r?`rounded-r-2xl border-r pr-6`:``} ${n?`pl-6`:``} ${t}`,children:e}):i(`td`,{colSpan:s,className:`block px-4 py-3 align-middle lg:table-cell lg:border-y lg:px-4 lg:py-3 ${u} ${n?`lg:rounded-l-[1.5rem] lg:border-l lg:pl-6`:r?`lg:rounded-r-[1.5rem] lg:border-r lg:pr-6`:``} ${t}`,role:`cell`,children:[c&&i(`span`,{className:`mb-1.5 block text-[10px] font-bold uppercase tracking-[0.14em] text-slate-400 lg:hidden`,children:c}),e]})}var gr=({sprintsCount:e,ledgerSprintsCount:t,pinnedCount:n,activeCount:r,completedCount:a,listWindow:o,onListWindowChange:s,filters:c,onFiltersChange:l})=>{let u=c.status===`all`||c.status.size!==1?`all`:[...c.status][0],d=!!c.query||c.qa!==`all`||c.showcase!==`all`||c.status!==`all`;return i(`div`,{role:`region`,"aria-label":`Sprint Ledger`,className:`relative overflow-visible border-b border-black/[0.06] px-4 py-5 dark:border-white/[0.06] sm:px-6 lg:px-7`,children:[i(`div`,{className:`relative grid gap-5 xl:grid-cols-[minmax(0,1fr)_auto] xl:items-start`,children:[i(`div`,{className:`min-w-0`,children:[i(`div`,{className:`inline-flex items-center gap-2 rounded-full border border-ember-500/20 bg-ember-500/10 px-3 py-1 text-[11px] font-bold text-ember-600 dark:text-ember-400`,children:[i(kn,{className:`h-3.5 w-3.5`,strokeWidth:2.3}),`Sprint Ledger`]}),i(`h2`,{className:`mt-3 font-display text-2xl font-bold text-slate-900 dark:text-white sm:text-3xl`,children:`All sprints, fully sortable.`}),i(`p`,{className:`mt-2 max-w-3xl text-sm leading-6 text-slate-500 dark:text-slate-400`,children:`Search, sort, pin, start, and triage sprints from a responsive ledger that keeps execution state, QA status, and progress visible without leaving the page.`})]}),i(`div`,{className:`grid grid-cols-2 gap-2 sm:grid-cols-4 xl:min-w-[34rem]`,children:[{label:`Visible`,value:t,icon:Ae,tone:`text-signal-600 dark:text-signal-300`},{label:`Pinned`,value:n,icon:tt,tone:`text-status-red`},{label:`Active`,value:r,icon:qe,tone:`text-status-green`},{label:`Done`,value:a,icon:rn,tone:`text-slate-600 dark:text-slate-300`}].map(e=>{let t=e.icon;return i(`div`,{className:`rounded-2xl border border-black/[0.06] bg-white/70 p-3 shadow-[0_10px_24px_rgba(15,23,42,0.05)] backdrop-blur-xl dark:border-white/[0.06] dark:bg-white/[0.04]`,children:[i(`div`,{className:`flex items-center gap-2 text-xs font-semibold ${e.tone}`,children:[i(t,{className:`h-3.5 w-3.5`,strokeWidth:2.2}),e.label]}),i(`div`,{className:`mt-1 font-mono text-xl font-bold text-slate-900 dark:text-white`,children:e.value})]},e.label)})})]}),i(`div`,{className:`relative mt-5 grid gap-3`,children:[i(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between`,children:[i(`div`,{className:`relative min-w-0 flex-1 lg:max-w-xl`,children:[i(We,{className:`pointer-events-none absolute left-4 top-1/2 h-4 w-4 -translate-y-1/2 text-slate-400`,strokeWidth:2.2}),i(`input`,{type:`text`,value:c.query,onInput:e=>l({...c,query:e.target.value}),placeholder:`Search sprints…`,className:`h-12 w-full rounded-2xl border border-black/[0.08] bg-white/85 pl-11 pr-11 text-sm text-slate-800 shadow-[0_10px_24px_rgba(15,23,42,0.04)] placeholder:text-slate-400 focus:border-signal-500/40 focus:outline-none focus-visible:ring-2 focus-visible:ring-signal-500/20 dark:border-white/[0.08] dark:bg-white/[0.05] dark:text-white dark:placeholder:text-slate-500`}),c.query&&i(`button`,{type:`button`,onClick:()=>l({...c,query:``}),className:`absolute right-3.5 top-1/2 inline-flex h-7 w-7 -translate-y-1/2 items-center justify-center rounded-full text-slate-400 transition-colors hover:bg-black/[0.04] hover:text-slate-700 focus-visible:ring-2 focus-visible:ring-signal-500/30 dark:hover:bg-white/[0.06] dark:hover:text-slate-200`,title:`Clear search`,"aria-label":`Clear search`,children:i(Dt,{className:`h-3.5 w-3.5`,strokeWidth:2.2})})]}),i(`div`,{className:`flex flex-wrap items-center gap-2`,children:[i(T,{value:o,onChange:s,label:`Show`}),i(`span`,{className:`rounded-full border border-black/[0.06] bg-white/70 px-3 py-1.5 font-mono text-xs text-slate-500 dark:border-white/[0.06] dark:bg-white/[0.04] dark:text-slate-400`,"aria-live":`polite`,"aria-atomic":`true`,"aria-label":`Showing ${t} of ${e} sprints`,children:[t,` / `,e]}),d?i(`button`,{type:`button`,onClick:()=>{l({query:``,status:`all`,showcase:`all`,qa:`all`})},title:`Clear all filters`,"aria-label":`Clear all applied filters to show all sprints`,className:`inline-flex items-center gap-1.5 rounded-full border border-signal-500/20 bg-signal-500/10 px-3 py-1.5 text-xs font-bold text-signal-700 transition-colors hover:bg-signal-500/15 focus-visible:ring-2 focus-visible:ring-signal-500/30 dark:text-signal-300`,children:[i(Dt,{className:`h-3.5 w-3.5`,strokeWidth:2.2}),`Clear Filters`]}):null]})]}),i(`div`,{className:`grid gap-2 sm:grid-cols-3`,children:[i($t,{options:[{value:`all`,label:`All Status`},{value:`running`,label:`Running`},{value:`idle`,label:`Draft`},{value:`paused`,label:`Paused`},{value:`completed`,label:`Done`},{value:`failed`,label:`Failed`}],value:u,onChange:e=>{l({...c,status:e===`all`?`all`:new Set([e])})},"aria-label":`Filter ledger by sprint status`}),i($t,{options:[{value:`all`,label:`All QA`},{value:`missing`,label:`No QA`},{value:`running`,label:`Reviewing`},{value:`reviewed`,label:`Reviewed`}],value:c.qa,onChange:e=>l({...c,qa:e}),"aria-label":`Filter ledger by QA status`}),i($t,{options:[{value:`all`,label:`All Pins`},{value:`pinned`,label:`Pinned`},{value:`unpinned`,label:`Unpinned`}],value:c.showcase,onChange:e=>l({...c,showcase:e}),"aria-label":`Filter ledger by pin state`})]})]}),i(`div`,{className:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:t===0&&d?`No matching sprints. Adjust search or filters.`:d?`Showing ${t} filtered sprints out of ${e} total.`:`Showing all ${e} sprints.`})]})};p();var _r=({selectedCount:e,totalCount:t,isAnyPending:n,isStartPending:r,isDeletePending:a,isPinPending:o,onBulkStart:c,onBulkDelete:l,onBulkShowcaseEnable:u,onBulkShowcaseDisable:d,onClearSelection:p})=>{let m=s(null),h=s(e),{expansionCollapse:g}=bt(),{base:_}=ht(),v=ht();return f(()=>{let t=m.current;if(!t)return;let n=v.base;e>0?n===0?$.set(t,{height:`auto`,opacity:1}):$.to(t,{height:`auto`,opacity:1,duration:n,ease:g.ease}):n===0?$.set(t,{height:0,opacity:0}):$.to(t,{height:0,opacity:0,duration:n,ease:g.ease})},[e,v,g.ease]),f(()=>{h.current=e},[e]),i(`div`,{ref:m,className:`overflow-hidden opacity-0`,style:{height:0},children:[i(`div`,{className:`flex flex-col gap-3 border-b border-signal-500/20 bg-signal-500/[0.08] px-4 py-3 backdrop-blur-xl dark:bg-signal-500/[0.1] sm:px-6 lg:flex-row lg:items-center lg:justify-between`,children:[i(`div`,{className:`flex min-w-0 items-center gap-3`,children:[i(`div`,{className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-2xl border border-signal-500/20 bg-signal-500/10 text-signal-700 dark:text-signal-300`,children:n?i(X,{className:`h-4 w-4 animate-spin`}):i(kn,{className:`h-4 w-4`,fill:`currentColor`})}),i(`div`,{className:`min-w-0`,"aria-live":`polite`,"aria-atomic":`true`,children:[i(`div`,{className:`text-sm font-bold text-slate-900 dark:text-white`,children:[e,` of `,t,` selected`]}),i(`div`,{className:`text-xs text-slate-500 dark:text-slate-400`,children:`Bulk controls apply to the current filtered result set.`})]})]}),i(`div`,{className:`flex flex-wrap items-center gap-2`,children:[i(`button`,{type:`button`,"aria-label":o?`Pinning selected sprints`:`Pin selected sprints to showcase`,"aria-disabled":n,onClick:u,disabled:n,className:`inline-flex h-9 items-center gap-1.5 rounded-xl border border-black/[0.06] bg-white/80 px-3 text-xs font-bold text-slate-600 transition-colors hover:bg-white hover:text-slate-900 focus-visible:ring-2 focus-visible:ring-signal-500/30 focus-visible:ring-offset-2 dark:border-white/[0.06] dark:bg-white/[0.04] dark:text-slate-300 dark:hover:bg-white/[0.08] dark:hover:text-white disabled:cursor-not-allowed disabled:opacity-50`,children:[o?i(X,{className:`h-3 w-3 animate-spin`}):i(kn,{className:`h-3 w-3`,fill:`currentColor`}),o?`Pinning...`:`Pin`]}),i(`button`,{type:`button`,"aria-label":o?`Unpinning selected sprints`:`Unpin selected sprints from showcase`,"aria-disabled":n,onClick:d,disabled:n,className:`inline-flex h-9 items-center gap-1.5 rounded-xl border border-black/[0.06] bg-white/80 px-3 text-xs font-bold text-slate-600 transition-colors hover:bg-white hover:text-slate-900 focus-visible:ring-2 focus-visible:ring-signal-500/30 focus-visible:ring-offset-2 dark:border-white/[0.06] dark:bg-white/[0.04] dark:text-slate-300 dark:hover:bg-white/[0.08] dark:hover:text-white disabled:cursor-not-allowed disabled:opacity-50`,children:[o?i(X,{className:`h-3 w-3 animate-spin`}):i(kn,{className:`h-3 w-3`}),o?`Unpinning...`:`Unpin`]}),i(`button`,{type:`button`,"aria-label":r?`Starting selected sprints`:`Start selected sprints`,"aria-disabled":n,onClick:c,disabled:n,className:`inline-flex h-9 items-center gap-1.5 rounded-xl border border-signal-500/25 bg-signal-500/10 px-3 text-xs font-bold text-signal-700 transition-colors hover:bg-signal-500/20 focus-visible:ring-2 focus-visible:ring-signal-500/30 focus-visible:ring-offset-2 dark:text-signal-300 disabled:cursor-not-allowed disabled:opacity-50`,children:[r?i(X,{className:`h-3 w-3 animate-spin`}):i(He,{className:`h-3 w-3`,fill:`currentColor`}),r?`Starting...`:`Start`]}),i(`button`,{type:`button`,"aria-label":a?`Deleting selected sprints`:`Delete selected sprints`,"aria-disabled":n,onClick:l,disabled:n,className:`inline-flex h-9 items-center gap-1.5 rounded-xl border border-status-red/20 bg-status-red/10 px-3 text-xs font-bold text-status-red transition-colors hover:bg-status-red/20 focus-visible:ring-2 focus-visible:ring-status-red/30 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`,children:[a?i(X,{className:`h-3 w-3 animate-spin`}):i(ln,{className:`h-3 w-3`}),a?`Deleting...`:`Delete`]}),i(`button`,{type:`button`,"aria-label":`Clear sprint selection`,"aria-disabled":n,onClick:p,disabled:n,className:`inline-flex h-9 items-center gap-1.5 rounded-xl px-3 text-xs font-bold text-slate-500 transition-colors hover:bg-black/[0.04] hover:text-slate-700 focus-visible:ring-2 focus-visible:ring-signal-500/30 focus-visible:ring-offset-2 dark:text-slate-400 dark:hover:bg-white/[0.05] dark:hover:text-slate-200 disabled:cursor-not-allowed disabled:opacity-50`,children:[i(Dt,{className:`h-3.5 w-3.5`,strokeWidth:2.2}),`Clear`]})]})]}),i(`div`,{className:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:e===0&&h.current>0?`Selection cleared`:``})]})},vr=({issue:e})=>{let t=`bg-[var(--bg-status-info-subtle)]`,n=`text-[var(--text-status-info-bold)]`,r=`border-[var(--border-status-info-subtle)]`;if(e.status){let i=e.status.toLowerCase();(i===`done`||i===`completed`)&&(t=`bg-[var(--bg-status-success-subtle)]`,n=`text-[var(--text-status-success-bold)]`,r=`border-[var(--border-status-success-subtle)]`)}return i(`span`,{className:`inline-flex items-center gap-1.5 rounded-[4px] border px-[8px] h-[20px] text-[11px] font-medium ${t} ${n} ${r} dark:!bg-white/[0.04] dark:!border-white/[0.1] dark:!text-slate-300`,title:e.title,children:[i(rt,{className:`h-3 w-3`,strokeWidth:2.2}),e.issueKey]})};o(),p(),c();var yr={running:`border-status-green/25 bg-status-green/10 text-status-green`,paused:`border-ember-500/25 bg-ember-500/10 text-ember-600 dark:text-ember-400`,completed:`border-slate-300/35 bg-slate-900/[0.04] text-slate-600 dark:border-white/15 dark:bg-white/[0.07] dark:text-slate-300`,failed:`border-status-red/25 bg-status-red/10 text-status-red`,cancelled:`border-slate-300/35 bg-slate-100/80 text-slate-500 dark:border-white/15 dark:bg-white/[0.05] dark:text-slate-400`,idle:`border-signal-500/25 bg-signal-500/10 text-signal-700 dark:text-signal-300`},br={merge_required:{tone:`border-purple-500/25 bg-purple-500/10 text-purple-600 dark:text-purple-300`,label:`Merge`},merge_conflict:{tone:`border-status-red/25 bg-status-red/10 text-status-red`,label:`Conflict`},ci_fix_required:{tone:`border-blue-500/25 bg-blue-500/10 text-blue-600 dark:text-blue-300`,label:`CI`}},xr={running:`from-status-green to-signal-500`,paused:`from-ember-500 to-ember-400`,completed:`from-slate-500 to-slate-400`,failed:`from-status-red to-status-red`,cancelled:`from-slate-400 to-slate-300`,idle:`from-signal-500 to-signal-300`},Sr=new Intl.DateTimeFormat(`en-US`,{month:`short`,day:`numeric`,year:`numeric`}),Cr=new Intl.DateTimeFormat(`en-US`,{month:`short`,day:`numeric`}),wr=new Intl.DateTimeFormat(`en-US`,{hour:`2-digit`,minute:`2-digit`,hour12:!1}),Tr=e=>e.slice(0,8),Er=e=>Sr.format(new Date(e)),Dr=e=>Cr.format(new Date(e)),Or=e=>wr.format(new Date(e)),kr=e=>e===`running`||e===`paused`,Ar=a(({sprint:t,isSelected:n,isEven:r,activeRun:a,pauseResumeRun:o,humanIntervention:s,pendingActionIds:c,isAnyBulkPending:l,onToggleRow:u,onToggleShowcase:d,onSprintToggle:f,onSprintPauseResume:p,onOpenRowMenu:h})=>{let g=ye(t.projectId),[_,v]=m(!1),y=g.data?.settings?.git?.sprintKeyPrefix||`SPR`,b=a?`sprint-stop:${a.id}`:`sprint-start:${t.id}`,x=t.status===`paused`?o?`sprint-resume:${o.id}`:``:o?`sprint-pause:${o.id}`:``,S=`sprint-showcase:${t.id}`,C=`sprint-delete:${t.id}`,w=t.status===`completed`,T=sn({state:t.status,humanInterventionTitle:s?.title??null,humanInterventionReason:s?.reason??null,humanInterventionInstructions:s?.instructions??null,humanInterventionOwnerType:s?.ownerType??null,attentionType:s?.attentionType??null,completion:t.completion,latestReviewStatus:t.latestReview?.status??null}),E=!!s&&T.showHumanInterventionBadge,D=c.has(b),O=x.length>0&&c.has(x),k=c.has(S),A=c.has(C),j=ve(Qt.selectionMovement.duration),M=Qt.selectionMovement.ease,N=n?`border-signal-500/35 bg-signal-500/[0.08] shadow-[0_18px_44px_rgba(0,224,160,0.12)]`:r?`border-black/[0.06] bg-white/80 dark:border-white/[0.07] dark:bg-white/[0.045]`:`border-black/[0.06] bg-slate-50/80 dark:border-white/[0.07] dark:bg-white/[0.03]`,P=n?`lg:border-signal-500/25 lg:bg-signal-500/[0.08]`:r?`lg:border-black/[0.06] lg:bg-white/80 dark:lg:border-white/[0.07] dark:lg:bg-white/[0.045]`:`lg:border-black/[0.06] lg:bg-slate-50/80 dark:lg:border-white/[0.07] dark:lg:bg-white/[0.03]`,ee=xr[t.status],I=s?.attentionType?br[s.attentionType]:void 0,L=T.statusLabel,R=yr[t.status]||`border-slate-300/35 bg-slate-900/[0.04] text-slate-600 dark:border-white/15 dark:bg-white/[0.07] dark:text-slate-300`;return L===`QA`?R=`border-status-amber/25 bg-status-amber/10 text-status-amber`:L===`Merge`?R=`border-purple-500/25 bg-purple-500/10 text-purple-600 dark:text-purple-300`:L===`Merge Conflict`?R=`border-status-red/25 bg-status-red/10 text-status-red`:I&&(L=I.label,R=I.tone),i(mr,{className:`group transition-all hover:-translate-y-0.5 focus-within:ring-2 focus-within:ring-signal-500/20 ${N} ${w?`text-slate-500 dark:text-slate-400`:``} ${A?`bg-status-red/5 grayscale opacity-50`:k||D||O?`bg-signal-500/5 opacity-80`:l?`opacity-60 grayscale-[0.2]`:``} hover:bg-[var(--bg-hover-subtle)]`,style:{transitionDuration:j,transitionTimingFunction:M},children:[i(hr,{isFirst:!0,className:`lg:w-[80px] lg:min-w-[80px] ${P}`,children:i(`button`,{type:`button`,onClick:()=>u(t.id),disabled:A||l,className:`inline-flex h-9 w-9 items-center justify-center rounded-xl border border-black/[0.06] bg-white/72 text-slate-400 transition-colors hover:border-signal-500/25 hover:text-signal-500 focus-visible:ring-2 focus-visible:ring-signal-500/30 dark:border-white/[0.07] dark:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50`,title:n?`Deselect sprint`:`Select sprint`,"aria-label":n?`Deselect sprint ${t.name}`:`Select sprint ${t.name}`,children:n?i(F,{className:`h-4 w-4 text-signal-500`,strokeWidth:2.2}):i(an,{className:`h-4 w-4`,strokeWidth:2.2})})}),i(hr,{className:`lg:w-[80px] lg:min-w-[80px] ${P}`,children:i(`button`,{type:`button`,onClick:()=>d(t),disabled:k||A,className:`inline-flex h-10 w-10 items-center justify-center rounded-2xl border transition-all focus-visible:ring-2 focus-visible:ring-signal-500/30 ${t.showcasePinned?`border-status-red/20 bg-status-red/10 text-status-red shadow-[0_8px_20px_rgba(239,68,68,0.10)]`:`border-black/[0.06] bg-white/70 text-slate-400 hover:border-status-red/20 hover:text-status-red dark:border-white/[0.07] dark:bg-white/[0.04]`} disabled:cursor-not-allowed disabled:opacity-50`,title:t.showcasePinned?`Remove from showcase`:`Pin to showcase`,"aria-label":t.showcasePinned?`Remove sprint ${t.name} from showcase`:`Pin sprint ${t.name} to showcase`,children:k?i(X,{className:`h-3.5 w-3.5 animate-spin`,strokeWidth:2.1}):i(kn,{className:`h-3.5 w-3.5`,fill:t.showcasePinned?`currentColor`:`none`,strokeWidth:2.1})})}),i(hr,{className:`lg:w-[120px] lg:min-w-[120px] ${P}`,mobileLabel:`Sprint ID`,children:[i(`div`,{className:`font-mono text-sm font-bold text-[var(--text-primary)] truncate`,children:tr(t,y)}),i(`div`,{className:`mt-1 text-[10px] font-bold text-slate-400 truncate`,children:Tr(t.id)})]}),i(hr,{className:`min-w-0 max-w-full lg:w-[220px] lg:min-w-[220px] ${P}`,mobileLabel:`Sprint`,children:[i(`div`,{className:`flex flex-wrap items-center gap-2`,children:[i(`div`,{className:`font-display text-lg font-black leading-tight break-words ${w?`text-slate-700 dark:text-slate-300`:`text-[var(--text-primary)]`}`,children:t.name}),t.latestReview&&i(Ge,{summary:t.latestReview,compact:!0,align:`left`})]}),i(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-[11px] font-mono text-slate-400`,children:[i(`span`,{className:`inline-flex items-center gap-1.5 rounded-full border border-black/[0.05] bg-black/[0.025] px-2 py-1 dark:border-white/[0.06] dark:bg-white/[0.03]`,children:[i(Sn,{className:`h-3 w-3`,strokeWidth:2.1}),`Updated `,Dr(t.updatedAt)]}),i(`span`,{className:`inline-flex items-center gap-1.5 rounded-full border border-black/[0.05] bg-black/[0.025] px-2 py-1 dark:border-white/[0.06] dark:bg-white/[0.03]`,children:[`Created `,Er(t.createdAt),` `,i(`span`,{className:`ml-1 font-mono text-[10px] text-slate-400`,children:Or(t.createdAt)})]})]}),E&&kr(t.status)&&s&&i(`div`,{className:`mt-3`,children:i(mt,{summary:s,label:`Needs you`,compact:!0,align:`left`})}),t.linkedIssues&&t.linkedIssues.length>0&&i(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:t.linkedIssues.map(e=>i(vr,{issue:e},e.id))}),t.goal?i(`p`,{className:`mt-3 max-w-2xl text-sm leading-relaxed ${w?`text-slate-400 dark:text-slate-500`:`text-slate-500 dark:text-slate-400`}`,children:t.goal}):null]}),i(hr,{className:`lg:w-[120px] lg:min-w-[120px] ${P}`,mobileLabel:`Status`,children:i(`div`,{className:`flex flex-wrap items-center gap-2 lg:flex-col lg:items-start`,children:A?i(`span`,{className:`inline-flex items-center gap-1.5 rounded-full border border-status-red/25 bg-status-red/10 px-3 py-1.5 text-[11px] font-bold text-status-red`,children:[i(X,{className:`h-3 w-3 animate-spin`,strokeWidth:2.2}),` Deleting`]}):k?i(`span`,{className:`inline-flex items-center gap-1.5 rounded-full border border-signal-500/25 bg-signal-500/10 px-3 py-1.5 text-[11px] font-bold text-signal-700 dark:text-signal-300`,children:[i(X,{className:`h-3 w-3 animate-spin`,strokeWidth:2.2}),` Pinning`]}):D?i(`span`,{className:`inline-flex items-center gap-1.5 rounded-full border border-signal-500/25 bg-signal-500/10 px-3 py-1.5 text-[11px] font-bold text-signal-700 dark:text-signal-300`,children:[i(X,{className:`h-3 w-3 animate-spin`,strokeWidth:2.2}),` `,a?`Stopping`:`Starting`]}):O?i(`span`,{className:`inline-flex items-center gap-1.5 rounded-full border border-signal-500/25 bg-signal-500/10 px-3 py-1.5 text-[11px] font-bold text-signal-700 dark:text-signal-300`,children:[i(X,{className:`h-3 w-3 animate-spin`,strokeWidth:2.2}),` `,t.status===`paused`?`Resuming`:`Pausing`]}):i(`span`,{className:`inline-flex rounded-full border px-4 py-1.5 text-[11px] font-bold ${R}`,children:L})})}),i(hr,{align:`right`,className:`lg:w-[100px] lg:min-w-[100px] ${P}`,mobileLabel:`Tasks`,children:i(`div`,{className:`flex items-center gap-3 justify-end lg:block`,children:[i(`div`,{className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-xl border border-black/[0.06] bg-white/70 text-slate-400 dark:border-white/[0.06] dark:bg-white/[0.04] lg:hidden`,children:i(je,{className:`h-4 w-4`,strokeWidth:2.2})}),i(`div`,{children:[i(`div`,{className:`font-mono text-lg font-bold text-[var(--text-primary)]`,children:t.tasksCount}),i(`div`,{className:`text-[11px] text-slate-400`,children:`planned tasks`})]})]})}),i(hr,{align:`right`,className:`min-w-[12rem] lg:w-[140px] lg:min-w-[140px] ${P}`,mobileLabel:`Completion`,children:i(`div`,{className:`flex items-center justify-end gap-3`,children:[i(`div`,{className:`h-2.5 flex-1 overflow-hidden rounded-full bg-black/10 ring-1 ring-black/[0.03] dark:bg-white/[0.08] dark:ring-white/[0.04]`,children:i(`div`,{className:`h-full rounded-full bg-gradient-to-r ${ee} transition-[width] duration-500 ease-out`,style:{width:`${t.completion}%`}})}),i(`span`,{className:`font-mono text-sm font-bold text-[var(--text-primary)]`,children:[t.completion,`%`]})]})}),i(hr,{className:`lg:w-[120px] lg:min-w-[120px] ${P}`,mobileLabel:`Created`,children:[i(`div`,{className:`font-medium text-[var(--text-primary)]`,children:[Er(t.createdAt),i(`span`,{className:`ml-1.5 font-mono text-[10px] text-slate-400`,children:Or(t.createdAt)})]}),i(`div`,{className:`mt-1 text-[11px] text-slate-400`,children:`created`}),i(`div`,{className:`mt-1.5 inline-flex items-center gap-1`,children:t.latestReview?.status===`running`?i(e,{children:[i(X,{className:`h-3.5 w-3.5 text-signal-500 animate-spin`,strokeWidth:2.2}),i(`span`,{className:`text-[11px] font-bold text-signal-500 animate-pulse`,children:`Reviewing`})]}):t.latestReview?.status===`completed`||t.latestReview?.status===`reviewed`?i(e,{children:[i(rn,{className:`h-3.5 w-3.5 text-signal-500`,strokeWidth:2.2}),i(`span`,{className:`text-[11px] font-bold text-signal-500`,children:`Reviewed`})]}):i(`span`,{className:`text-[11px] font-bold text-slate-400`,children:`Not reviewed`})})]}),i(hr,{align:`right`,isLast:!0,className:`lg:w-[140px] lg:min-w-[140px] ${P}`,mobileLabel:`Controls`,children:i(`div`,{className:`flex flex-wrap items-center gap-2 lg:justify-end lg:whitespace-nowrap`,children:[i(De,{isActive:!!a,isPaused:t.status===`paused`,isStartStopPending:D,isPauseResumePending:O,onStartStop:()=>f(t.id),onPauseResume:()=>p(t.id),sprintName:t.name}),i(`a`,{href:`/tasks?sprint=${encodeURIComponent(t.id)}`,"aria-label":`Open sprint ${t.name}`,className:`inline-flex h-10 min-w-[5rem] flex-1 items-center justify-center gap-2 rounded-xl border border-black/[0.06] bg-white/80 px-4 text-xs font-bold text-slate-600 transition-colors hover:bg-white hover:text-slate-900 focus-visible:ring-2 focus-visible:ring-signal-500/30 dark:border-white/[0.08] dark:bg-white/[0.04] dark:text-slate-300 dark:hover:bg-white/[0.08] dark:hover:text-white sm:flex-none`,children:[`Open`,i(dn,{className:`h-3.5 w-3.5`})]}),h?i(`button`,{type:`button`,disabled:A,onClick:e=>h(e,t.id),className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-black/[0.06] bg-white/80 text-slate-600 transition-colors hover:bg-white hover:text-slate-900 focus-visible:ring-2 focus-visible:ring-signal-500/30 dark:border-white/[0.08] dark:bg-white/[0.04] dark:text-slate-300 dark:hover:bg-white/[0.08] dark:hover:text-white disabled:cursor-not-allowed disabled:opacity-50`,title:`Open sprint actions`,"aria-label":`Open actions menu for sprint ${t.name}`,children:A?i(X,{className:`h-3.5 w-3.5 animate-spin text-signal-500`,strokeWidth:2.2}):i(wn,{className:`h-3.5 w-3.5`})}):i(Bn,{isOpen:_,onOpenChange:v,position:`bottom`,align:`end`,className:`min-w-[11.5rem]`,computePosition:({triggerRect:e,menuRect:t,viewport:n})=>Un(e,n,{width:t.width,height:t.height}),content:i(zn,{sprint:t,isCompleted:w,showcaseBusy:k,markCompletedDisabled:!1,deleteBusy:A,onToggleShowcase:()=>d(t),onClose:()=>v(!1),markCompletedIcon:`square`,role:`menuitem`,buttonClassName:`flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-left text-xs font-medium text-slate-600 transition-colors hover:bg-black/[0.04] hover:text-slate-900 focus-visible:ring-2 focus-visible:ring-signal-500/30 focus-visible:ring-offset-2 dark:text-slate-300 dark:hover:bg-white/[0.05] dark:hover:text-white focus:outline-none`}),children:i(`button`,{type:`button`,disabled:A,"aria-haspopup":`menu`,"aria-expanded":_,className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-black/[0.06] bg-white/80 text-slate-600 transition-colors hover:bg-white hover:text-slate-900 focus-visible:ring-2 focus-visible:ring-signal-500/30 dark:border-white/[0.08] dark:bg-white/[0.04] dark:text-slate-300 dark:hover:bg-white/[0.08] dark:hover:text-white disabled:cursor-not-allowed disabled:opacity-50`,title:`Open sprint actions`,"aria-label":`Open actions menu for sprint ${t.name}`,children:A?i(X,{className:`h-3.5 w-3.5 animate-spin text-signal-500`,strokeWidth:2.2}):i(wn,{className:`h-3.5 w-3.5`})})})]})})]})});p();var jr=({initialQuery:e,sprints:t,isLoading:a,listWindow:o,onListWindowChange:s,activeRunsBySprintId:c,pauseResumeRunsBySprintId:l,interventionBySprintId:u,pendingActionIds:d,onToggleShowcase:p,onSprintToggle:h,onSprintPauseResume:_,onOpenRowMenu:y,onEditSprint:x,onExportSprint:S,onOverridesSprint:C,onMarkCompletedSprint:w,onDeleteSprint:T,onBulkStart:E,onBulkDelete:D,onBulkShowcaseEnable:O,onBulkShowcaseDisable:k})=>{let[A,j]=m({...Qn,query:e||Qn.query}),[M,N]=m({key:`createdAt`,direction:`desc`}),[P,ee]=m(new Set),{isOpen:I,options:L,requestConfirm:R,handleConfirm:z,handleCancel:B}=dt();f(()=>{e!==void 0&&j(t=>({...t,query:e}))},[e]);let te=r(()=>rr(t,A),[t,A]),V=r(()=>ir(te,M),[te,M]),ne=r(()=>ar(V,yn(o,V.length)),[V,o]),re=r(()=>({pinnedCount:t.filter(e=>e.showcasePinned).length,activeCount:t.filter(e=>e.status===`running`||e.status===`paused`).length,completedCount:t.filter(e=>e.status===`completed`).length}),[t]),ie=r(()=>{let e=new Map;for(let n of t)if(n.status===`running`||n.status===`paused`){let t=u.get(n.id);t&&t.ownerType!==`worker`&&e.set(n.id,t)}return e},[t,u]);f(()=>{ee(e=>{if(e.size===0)return e;let t=cr(e,te);return t.size===e.size?e:t})},[te]);let H=r(()=>lr(P,V),[P,V]),{isBulkStartPending:ae,isBulkStopPending:oe,isBulkPinPending:U,isBulkDeletePending:se,isAnyBulkPending:W}=r(()=>{let e=!1,t=!1,n=!1,r=!1;for(let i of H){let a=c.get(i.id);d.has(`sprint-start:${i.id}`)&&(e=!0),a&&d.has(`sprint-stop:${a.id}`)&&(t=!0),d.has(`sprint-showcase:${i.id}`)&&(n=!0),d.has(`sprint-delete:${i.id}`)&&(r=!0)}for(let e of V)d.has(`sprint-delete:${e.id}`)&&(r=!0);return{isBulkStartPending:e,isBulkStopPending:t,isBulkPinPending:n,isBulkDeletePending:r,isAnyBulkPending:e||t||n||r}},[H,V,c,d]),ce=V.length>0&&V.every(e=>P.has(e.id)),le=ve(Qt.controlFeedback.duration),G=Qt.controlFeedback.ease,ue=e=>{N(t=>ur(t,e))},K=()=>{if(ce)ee(new Set);else{let e=new Set(P);for(let t of V)e.add(t.id);ee(e)}},de=n(e=>{ee(t=>or(t,e))},[]),fe=n(()=>{ee(sr())},[]),pe=n(()=>{E(H.map(e=>e.id))},[E,H]),me=n(async()=>{await R({title:`Delete Sprints?`,body:`Are you sure you want to delete ${H.length} selected sprint${H.length===1?``:`s`}? This action is permanent and will cascade to all downstream tasks, logs, and associated git artifacts. Please ensure you have cleaned up your repository branches if needed before proceeding.`,confirmLabel:`Delete Sprints`,cancelLabel:`Cancel`,destructive:!0})&&D(H.map(e=>e.id))},[D,H,R]),he=n(()=>{O(H.map(e=>e.id))},[O,H]),ge=n(()=>{k(H.map(e=>e.id))},[k,H]),_e=n(e=>p(e),[p]),q=n(e=>h(e),[h]),ye=n(e=>_(e),[_]),J=e=>M.key===e?M.direction===`asc`?i(b,{"aria-hidden":`true`,className:`h-3 w-3 text-signal-500 opacity-100 transition-transform`,strokeWidth:2.2,style:{transitionDuration:le,transitionTimingFunction:G}}):i(g,{"aria-hidden":`true`,className:`h-3 w-3 text-signal-500 opacity-100 transition-transform`,strokeWidth:2.2,style:{transitionDuration:le,transitionTimingFunction:G}}):i(v,{"aria-hidden":`true`,className:`h-3 w-3 text-slate-300 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100 dark:text-slate-600`,strokeWidth:2.2,style:{transitionDuration:le,transitionTimingFunction:G}});return i(`div`,{className:`w-full`,children:[i(gr,{sprintsCount:t.length,ledgerSprintsCount:V.length,pinnedCount:re.pinnedCount,activeCount:re.activeCount,completedCount:re.completedCount,listWindow:o,onListWindowChange:s,filters:A,onFiltersChange:j}),i(_r,{selectedCount:H.length,totalCount:V.length,isAnyPending:W,isStartPending:ae,isDeletePending:se,isPinPending:U,onBulkStart:pe,onBulkDelete:me,onBulkShowcaseEnable:he,onBulkShowcaseDisable:ge,onClearSelection:fe}),i(cn,{isOpen:I,options:L,onConfirm:z,onCancel:B}),i(`div`,{className:`min-h-[20rem] px-3 py-4 sm:px-4 lg:px-5`,children:i(dr,{caption:`Sprint ledger with selection, sorting, and bulk actions.`,children:[i(fr,{children:[i(hr,{isHeader:!0,isFirst:!0,className:`w-[80px] min-w-[80px]`,children:[i(`span`,{className:`sr-only`,children:`Select`}),i(`button`,{type:`button`,disabled:ne.length===0||W,onClick:K,className:`inline-flex h-8 w-8 items-center justify-center rounded-xl text-slate-400 transition-colors hover:bg-black/[0.04] hover:text-slate-700 focus-visible:ring-2 focus-visible:ring-signal-500/30 dark:hover:bg-white/[0.05] dark:hover:text-slate-200 disabled:cursor-not-allowed disabled:opacity-50`,title:ce?`Deselect all visible sprints`:`Select all visible sprints`,"aria-label":ce?`Deselect all visible sprints`:`Select all visible sprints`,children:ce?i(F,{className:`h-4 w-4 text-signal-500`,strokeWidth:2.2}):i(an,{className:`h-4 w-4`,strokeWidth:2.2})})]}),i(hr,{isHeader:!0,className:`group w-[80px] min-w-[80px]`,ariaSort:M.key===`showcasePinned`?M.direction===`asc`?`ascending`:`descending`:void 0,children:i(`button`,{type:`button`,onClick:()=>ue(`showcasePinned`),className:`inline-flex items-center gap-2 rounded-lg transition-colors hover:text-slate-700 focus-visible:ring-2 focus-visible:ring-signal-500/30 dark:hover:text-slate-200`,"aria-label":`Sort by Showcase, currently ${M.key===`showcasePinned`?M.direction===`asc`?`sorted ascending`:`sorted descending`:`unsorted`}. Click to sort by Showcase in ${M.key===`showcasePinned`&&M.direction===`asc`?`descending`:`ascending`} order.`,children:[`Showcase`,J(`showcasePinned`)]})}),i(hr,{isHeader:!0,className:`group w-[120px] min-w-[120px]`,ariaSort:M.key===`sprintKey`?M.direction===`asc`?`ascending`:`descending`:void 0,children:i(`button`,{type:`button`,onClick:()=>ue(`sprintKey`),className:`inline-flex items-center gap-2 rounded-lg transition-colors hover:text-slate-700 focus-visible:ring-2 focus-visible:ring-signal-500/30 dark:hover:text-slate-200`,"aria-label":`Sort by Sprint ID, currently ${M.key===`sprintKey`?M.direction===`asc`?`sorted ascending`:`sorted descending`:`unsorted`}. Click to sort by Sprint ID in ${M.key===`sprintKey`&&M.direction===`asc`?`descending`:`ascending`} order.`,children:[`Sprint ID`,J(`sprintKey`)]})}),i(hr,{isHeader:!0,className:`group w-[220px] min-w-[220px]`,ariaSort:M.key===`name`?M.direction===`asc`?`ascending`:`descending`:void 0,children:i(`button`,{type:`button`,onClick:()=>ue(`name`),className:`inline-flex items-center gap-2 rounded-lg transition-colors hover:text-slate-700 focus-visible:ring-2 focus-visible:ring-signal-500/30 dark:hover:text-slate-200`,"aria-label":`Sort by Sprint, currently ${M.key===`name`?M.direction===`asc`?`sorted ascending`:`sorted descending`:`unsorted`}. Click to sort by Sprint in ${M.key===`name`&&M.direction===`asc`?`descending`:`ascending`} order.`,children:[`Sprint`,J(`name`)]})}),i(hr,{isHeader:!0,className:`group w-[120px] min-w-[120px]`,ariaSort:M.key===`status`?M.direction===`asc`?`ascending`:`descending`:void 0,children:i(`button`,{type:`button`,onClick:()=>ue(`status`),className:`inline-flex items-center gap-2 rounded-lg transition-colors hover:text-slate-700 focus-visible:ring-2 focus-visible:ring-signal-500/30 dark:hover:text-slate-200`,"aria-label":`Sort by Status, currently ${M.key===`status`?M.direction===`asc`?`sorted ascending`:`sorted descending`:`unsorted`}. Click to sort by Status in ${M.key===`status`&&M.direction===`asc`?`descending`:`ascending`} order.`,children:[`Status`,J(`status`)]})}),i(hr,{isHeader:!0,align:`right`,className:`group w-[100px] min-w-[100px]`,ariaSort:M.key===`tasksCount`?M.direction===`asc`?`ascending`:`descending`:void 0,children:i(`button`,{type:`button`,onClick:()=>ue(`tasksCount`),className:`inline-flex w-full items-center justify-end gap-2 rounded-lg transition-colors hover:text-slate-700 focus-visible:ring-2 focus-visible:ring-signal-500/30 dark:hover:text-slate-200`,"aria-label":`Sort by Tasks, currently ${M.key===`tasksCount`?M.direction===`asc`?`sorted ascending`:`sorted descending`:`unsorted`}. Click to sort by Tasks in ${M.key===`tasksCount`&&M.direction===`asc`?`descending`:`ascending`} order.`,children:[J(`tasksCount`),`Tasks`]})}),i(hr,{isHeader:!0,align:`right`,className:`group w-[140px] min-w-[140px]`,ariaSort:M.key===`completion`?M.direction===`asc`?`ascending`:`descending`:void 0,children:i(`button`,{type:`button`,onClick:()=>ue(`completion`),className:`inline-flex w-full items-center justify-end gap-2 rounded-lg transition-colors hover:text-slate-700 focus-visible:ring-2 focus-visible:ring-signal-500/30 dark:hover:text-slate-200`,"aria-label":`Sort by Completion, currently ${M.key===`completion`?M.direction===`asc`?`sorted ascending`:`sorted descending`:`unsorted`}. Click to sort by Completion in ${M.key===`completion`&&M.direction===`asc`?`descending`:`ascending`} order.`,children:[J(`completion`),`Completion`]})}),i(hr,{isHeader:!0,className:`group w-[120px] min-w-[120px]`,ariaSort:M.key===`createdAt`?M.direction===`asc`?`ascending`:`descending`:void 0,children:i(`button`,{type:`button`,onClick:()=>ue(`createdAt`),className:`inline-flex items-center gap-2 rounded-lg transition-colors hover:text-slate-700 focus-visible:ring-2 focus-visible:ring-signal-500/30 dark:hover:text-slate-200`,"aria-label":`Sort by Created, currently ${M.key===`createdAt`?M.direction===`asc`?`sorted ascending`:`sorted descending`:`unsorted`}. Click to sort by Created in ${M.key===`createdAt`&&M.direction===`asc`?`descending`:`ascending`} order.`,children:[`Created`,J(`createdAt`)]})}),i(hr,{isHeader:!0,align:`right`,isLast:!0,className:`w-[140px] min-w-[140px] pr-6`,children:`Controls`})]}),i(pr,{children:a&&ne.length===0?Array.from({length:5}).map((e,t)=>i(`tr`,{className:`block lg:table-row`,children:i(hr,{colSpan:9,className:`p-2`,children:i(at,{})})},t)):ne.length===0?i(`tr`,{className:`block lg:table-row`,children:i(hr,{colSpan:9,children:i(`div`,{className:`flex min-h-[16rem] flex-col items-center justify-center rounded-[1.5rem] border border-dashed border-black/[0.08] bg-white/50 px-6 py-10 text-center dark:border-white/[0.08] dark:bg-white/[0.03]`,children:[i(`div`,{className:`flex h-12 w-12 items-center justify-center rounded-2xl border border-black/[0.06] bg-white/80 text-slate-400 dark:border-white/[0.08] dark:bg-white/[0.05]`,children:i(Kt,{className:`h-5 w-5`,strokeWidth:2.1})}),i(`div`,{"aria-live":`polite`,className:`mt-4 font-display text-xl font-bold text-slate-800 dark:text-white`,children:A.query||A.qa!==`all`||A.showcase!==`all`||A.status!==`all`?`No matching sprints`:`No sprints yet`}),i(`p`,{className:`mt-2 max-w-md text-sm leading-6 text-slate-500 dark:text-slate-400`,children:A.query||A.qa!==`all`||A.showcase!==`all`||A.status!==`all`?`Adjust the search or filters to bring sprints back into the ledger.`:`Create a sprint above and it will appear in the showcase and ledger automatically.`})]})})}):ne.map((e,t)=>i(Ar,{sprint:e,isSelected:P.has(e.id),isEven:t%2==0,activeRun:c.get(e.id),pauseResumeRun:l.get(e.id),humanIntervention:ie.get(e.id)||null,pendingActionIds:d,isAnyBulkPending:W,onToggleRow:de,onToggleShowcase:_e,onSprintToggle:q,onSprintPauseResume:ye,onOpenRowMenu:y,onEdit:()=>x(e),onExport:()=>S(e),onOverrides:()=>C(e),onMarkCompleted:()=>w(e.id),onDelete:()=>T(e.id)},e.id))})]})})]})},Mr={improve:[{text:`Researching codebase context...`,threshold:.1},{text:`Analyzing codebase...`,threshold:.3},{text:`Refining technical requirements...`,threshold:.6},{text:`Synthesizing improved plan...`,threshold:.9}],plan_only:[{text:`Registering sprint definition...`,threshold:.1},{text:`Analyzing codebase...`,threshold:.3},{text:`Resolving dependencies...`,threshold:.5},{text:`Orchestrating subtask generation...`,threshold:.7},{text:`Finalizing sprint structure...`,threshold:.9}],plan_and_start:[{text:`Registering sprint definition...`,threshold:.1},{text:`Analyzing codebase...`,threshold:.3},{text:`Resolving dependencies...`,threshold:.5},{text:`Orchestrating subtask generation...`,threshold:.7},{text:`Preparing launch sequence...`,threshold:.9}],replan:[{text:`Analyzing existing tasks...`,threshold:.1},{text:`Discarding outdated plan...`,threshold:.3},{text:`Analyzing codebase...`,threshold:.5},{text:`Generating new subtasks...`,threshold:.75},{text:`Finalizing new structure...`,threshold:.95}],draft:[{text:`Saving draft...`,threshold:.1},{text:`Finalizing draft...`,threshold:.8}],append_tasks:[{text:`Appending tasks...`,threshold:.1},{text:`Finalizing sprint...`,threshold:.8}]},Nr=12e3,Pr={improve:`Refining prompt...`,plan_only:`Generating subtasks...`,plan_and_start:`Planning and initiating...`,replan:`Updating execution plan...`,draft:`Saving draft...`,append_tasks:`Appending tasks...`};function Fr(e,t){let n=1-Math.exp(-t/8e3),r=t%Nr/Nr,i=Mr[e],a=i[0].text;for(let e of i)if(n>=e.threshold)a=e.text;else break;return{text:a,progress:n,shipProgress:r,shipType:e===`improve`?`wooden`:`container`}}p();var Ir=({isBusy:e,isDismissed:t=!1,feedback:n,planningEta:r,elapsedMs:a,isDark:o,actionType:c,themeAccent:l=`signal`,onCancel:u,onDismiss:f,secondaryActionLabel:p,onSecondaryAction:m})=>{let h=s(null),g=s(n?.text),_=J();if(d(()=>{if(!(!n||!h.current)&&g.current!==n.text){let e=$.context(()=>{$.killTweensOf(h.current),$.fromTo(h.current,{opacity:0,y:_?0:10},{opacity:1,y:0,duration:_?0:Q.overlay.entry,ease:Q.overlay.entryEase})});return g.current=n.text,()=>e.revert()}},[n?.text,_]),!e||t||!n)return null;let v={signal:{shipContainer:`#00E0A0`,shipWooden:`#FFB800`,badgeBorder:`border-signal-500/20`,badgeBg:`bg-signal-500/[0.08]`,badgeText:`text-signal-600 dark:text-signal-300`,pingBg1:`bg-signal-400`,pingBg2:`bg-signal-500`},ember:{shipContainer:`#FF6B00`,shipWooden:`#FFB800`,badgeBorder:`border-ember-500/20`,badgeBg:`bg-ember-500/[0.08]`,badgeText:`text-ember-600 dark:text-ember-400`,pingBg1:`bg-ember-400`,pingBg2:`bg-ember-500`}}[l];return i(`div`,{className:`absolute inset-0 z-50 flex cursor-pointer items-center justify-center bg-void-900/50 backdrop-blur-sm p-4`,onClick:e=>{e.target===e.currentTarget&&f()},children:i(`div`,{className:`flex flex-col items-center justify-center bg-white dark:bg-void-800 rounded-2xl shadow-2xl border border-black/[0.08] dark:border-white/[0.08] max-w-2xl w-full p-8 relative cursor-default`,onClick:e=>e.stopPropagation(),children:[i(`button`,{type:`button`,onClick:f,className:`absolute top-6 right-6 inline-flex h-10 w-10 items-center justify-center rounded-full border border-black/[0.06] bg-white/78 text-slate-400 transition-colors hover:text-slate-900 dark:border-white/[0.06] dark:bg-white/[0.03] dark:hover:text-white z-10`,"aria-label":`Minimize overlay`,children:i(Dt,{className:`h-4 w-4`})}),i(`div`,{className:`relative mb-12 flex h-32 w-full max-w-md items-center justify-center overflow-hidden pointer-events-none`,role:`progressbar`,"aria-live":`polite`,"aria-valuenow":Math.round(n.shipProgress*100),"aria-valuemin":0,"aria-valuemax":100,"aria-label":n.text,children:[i(`div`,{className:`absolute inset-x-0 bottom-8 h-px bg-gradient-to-r from-transparent via-slate-200 to-transparent dark:via-white/10`}),i(`div`,{className:`absolute transition-[left] duration-200 ease-linear`,style:{left:`${n.shipProgress*100}%`,transform:`translateX(-50%)`},children:i(`svg`,{width:`120`,height:`60`,viewBox:`-60 -30 120 60`,children:n.shipType===`container`?i(pn,{accentColor:v.shipContainer,isMoving:!0,isDark:o}):i(fn,{accentColor:v.shipWooden,isMoving:!0,isDark:o})})})]}),i(`div`,{className:`cursor-default space-y-4 text-center`,children:[i(`div`,{className:`inline-flex items-center gap-3 rounded-full border px-5 py-2 text-xs font-bold uppercase tracking-[0.2em] ${v.badgeBorder} ${v.badgeBg} ${v.badgeText}`,children:[i(`span`,{className:`relative flex h-2 w-2`,children:[i(`span`,{className:`absolute inline-flex h-full w-full motion-safe:animate-ping rounded-full opacity-75 ${v.pingBg1}`}),i(`span`,{className:`relative inline-flex h-2 w-2 rounded-full ${v.pingBg2}`})]}),c===`quicksprint`?`Quicksprint in motion`:Pr[c]||`Planning in motion`]}),i(`div`,{className:`flex items-center justify-center gap-6`,children:[i(`div`,{className:`flex flex-col items-center`,children:[i(`div`,{className:`text-[10px] font-bold uppercase tracking-[0.14em] text-slate-400`,children:`ETA`}),i(`div`,{className:`font-mono text-xl font-medium tracking-tight text-slate-900 dark:text-white`,children:[String(Math.floor(Math.max(0,r-a)/6e4)).padStart(2,`0`),`:`,String(Math.floor(Math.max(0,r-a)%6e4/1e3)).padStart(2,`0`)]})]}),i(`div`,{className:`h-8 w-px bg-black/[0.08] dark:bg-white/[0.08]`}),i(`div`,{className:`flex flex-col items-center`,children:[i(`div`,{className:`text-[10px] font-bold uppercase tracking-[0.14em] text-slate-400`,children:`Elapsed`}),i(`div`,{className:`font-mono text-xl font-medium tracking-tight text-slate-500`,children:[String(Math.floor(a/6e4)).padStart(2,`0`),`:`,String(Math.floor(a%6e4/1e3)).padStart(2,`0`)]})]})]}),i(`div`,{className:`flex flex-col items-center overflow-hidden h-10 w-full`,children:i(`div`,{className:`flex items-center gap-3`,ref:h,children:[i(`span`,{className:`relative flex h-3 w-3`,children:[i(`span`,{className:`motion-safe:animate-ping absolute inline-flex h-full w-full rounded-full opacity-75 ${v.pingBg1}`}),i(`span`,{className:`relative inline-flex rounded-full h-3 w-3 ${v.pingBg2}`})]}),i(`h3`,{className:`font-display text-2xl font-black tracking-tight text-slate-900 dark:text-white`,"aria-live":`polite`,children:n.text})]})}),i(`p`,{className:`mx-auto max-w-xs text-sm leading-relaxed text-slate-500 dark:text-slate-400`,children:(()=>{switch(c){case`improve`:return`The Planning agent is researching your codebase to produce a more precise technical definition.`;case`replan`:return`The Planning agent is analyzing existing tasks and researching the codebase to generate an updated plan.`;case`plan_only`:return`The Planning agent is researching the codebase to decompose your sprint into grounded, atomic subtasks. Execution will wait for your review.`;case`plan_and_start`:return`The Planning agent is researching the codebase to decompose your sprint into grounded, atomic subtasks and will begin execution immediately.`;case`draft`:return`Saving your sprint definition without generating subtasks.`;case`append_tasks`:return`Adding new tasks to your existing sprint.`;default:return`The Planning agent is researching the codebase to decompose your sprint into grounded, atomic subtasks.`}})()}),i(`div`,{className:`mt-4 flex flex-row items-center justify-center gap-3`,children:[i(`button`,{type:`button`,onClick:f,className:`inline-flex items-center gap-2 rounded-full border border-black/[0.08] bg-white/66 px-4 py-2 text-xs font-semibold text-slate-500 transition-colors hover:border-black/[0.15] hover:text-slate-900 dark:border-white/[0.08] dark:bg-white/[0.04] dark:text-slate-400 dark:hover:border-white/[0.15] dark:hover:text-white`,children:`Minimize`}),p&&m&&i(`button`,{type:`button`,onClick:m,className:`inline-flex items-center gap-2 rounded-full border border-slate-900 bg-slate-900 px-4 py-2 text-xs font-semibold text-white transition-colors hover:bg-slate-800 dark:border-white dark:bg-white dark:text-slate-900 dark:hover:bg-slate-100`,children:p}),u&&i(`button`,{type:`button`,onClick:u,className:`inline-flex items-center gap-2 rounded-full border border-status-red/20 bg-status-red/[0.06] px-4 py-2 text-xs font-semibold text-status-red transition-colors hover:bg-status-red/[0.12] dark:border-status-red/20 dark:bg-status-red/[0.08] dark:text-status-red dark:hover:bg-status-red/[0.16]`,children:[i(Dt,{className:`h-3.5 w-3.5`}),`Cancel Active Request`]})]})]})]})})};p(),c();var Lr={Sparkles:tt,ShieldCheck:Oe,Accessibility:bn,Zap:Lt,Bug:xn,Code2:Pt,Database:S,FileSearch:Tn,FlaskConical:En,GitBranch:Je,Globe:Pe,Hammer:On,Heart:kn,Layers:Ae,LayoutGrid:An,Lock:Ce,Microscope:Mn,Monitor:Me,Paintbrush:Nn,RefreshCw:xe,Search:We,Server:N,Shield:Fn,Terminal:Ze,TestTube2:In,Wrench:R},Rr=[{value:`signal`,text:`text-signal-500`,bg:`bg-signal-500/10`,border:`border-signal-500/20`,dot:`bg-signal-500`},{value:`ember`,text:`text-ember-500`,bg:`bg-ember-500/10`,border:`border-ember-500/20`,dot:`bg-ember-500`},{value:`green`,text:`text-status-green`,bg:`bg-status-green/10`,border:`border-status-green/20`,dot:`bg-status-green`},{value:`red`,text:`text-status-red`,bg:`bg-status-red/10`,border:`border-status-red/20`,dot:`bg-status-red`},{value:`amber`,text:`text-status-amber`,bg:`bg-status-amber/10`,border:`border-status-amber/20`,dot:`bg-status-amber`},{value:`violet`,text:`text-violet-500`,bg:`bg-violet-500/10`,border:`border-violet-500/20`,dot:`bg-violet-500`},{value:`cyan`,text:`text-cyan-500`,bg:`bg-cyan-500/10`,border:`border-cyan-500/20`,dot:`bg-cyan-500`},{value:`rose`,text:`text-rose-500`,bg:`bg-rose-500/10`,border:`border-rose-500/20`,dot:`bg-rose-500`},{value:`blue`,text:`text-blue-500`,bg:`bg-blue-500/10`,border:`border-blue-500/20`,dot:`bg-blue-500`},{value:`slate`,text:`text-slate-500`,bg:`bg-slate-500/10`,border:`border-slate-500/20`,dot:`bg-slate-500`}],zr=e=>{let t=Rr.find(t=>t.value===e);return t?{...t,style:{}}:{text:``,bg:``,border:``,dot:``,value:e,style:{"--accent":e}}},Br=[{value:`Sparkles`,Icon:tt},{value:`ShieldCheck`,Icon:Oe},{value:`Accessibility`,Icon:bn},{value:`Zap`,Icon:Lt},{value:`Bug`,Icon:xn},{value:`Code2`,Icon:Pt},{value:`Database`,Icon:S},{value:`FileSearch`,Icon:Tn},{value:`FlaskConical`,Icon:En},{value:`GitBranch`,Icon:Je},{value:`Globe`,Icon:Pe},{value:`Hammer`,Icon:On},{value:`Heart`,Icon:kn},{value:`Layers`,Icon:Ae},{value:`LayoutGrid`,Icon:An},{value:`Lock`,Icon:Ce},{value:`Microscope`,Icon:Mn},{value:`Monitor`,Icon:Me},{value:`Paintbrush`,Icon:Nn},{value:`RefreshCw`,Icon:xe},{value:`Search`,Icon:We},{value:`Server`,Icon:N},{value:`Shield`,Icon:Fn},{value:`Terminal`,Icon:Ze},{value:`TestTube2`,Icon:In},{value:`Wrench`,Icon:R}],Vr=({projectId:t,onClose:a,onExecute:o,templates:c,loading:l=!1,agentPresets:u=[],virtualProviders:d=[],defaultRouteOptionLabel:p=`Default Route`,defaultModelOptionLabel:h=`Default Model`,defaultRouteIconProviderId:g=null,planningEta:_=18e4,onCreateTemplate:v,onUpdateTemplate:y,onDeleteTemplate:b})=>{let x=s(null),S=s(null),[C,w]=m(`browse`),[T,E]=m(null),[D,O]=m(``),[k,A]=m(5),[j,M]=m(null),[N,ee]=m(null),[F,I]=m(!1),[L,R]=m(``),[z,B]=m(null),[te,V]=m(``),[ne,re]=m(``),[ie,H]=m(`Zap`),[ae,oe]=m(`engineering`),[U,se]=m(`#22c55e`),[W,ce]=m(!1),[le,G]=m(!1),ue=lt(le,{onClose:()=>G(!1),restoreFocus:!0}),K=lt(W,{onClose:()=>ce(!1),restoreFocus:!0}),[de,fe]=m({top:0,left:0}),[pe,me]=m(``),[he,ge]=m(5),[_e,ve]=m(``),[q,ye]=m(!1),[J,be]=m(!1),[xe,Se]=m(null),[Ce,Te]=m(0),[Ee,De]=m(!1),Oe=s(null),ke=s(null),Ae=s(0),je=xe!==null,Y=r(()=>c.find(e=>e.id===T)||null,[c,T]),Me=r(()=>c.filter(e=>e.isBuiltIn),[c]),Ne=r(()=>c.filter(e=>!e.isBuiltIn),[c]),Pe=r(()=>{let e=new Map;for(let t of Me){let n=t.purpose||`general`;e.has(n)||e.set(n,{value:n,label:t.purposeLabel||`General`,description:t.purposeDescription})}return Array.from(e.values())},[Me]);f(()=>{if(Pe.length===0){D&&O(``);return}Pe.some(e=>e.value===D)||O(Pe[0].value)},[Pe,D]);let Fe=r(()=>Pe.find(e=>e.value===D)||Pe[0]||null,[Pe,D]),Ie=r(()=>Fe?Me.filter(e=>(e.purpose||`general`)===Fe.value):Me,[Fe,Me]),Le=r(()=>{if(!Y)return``;let e=[],t=Y.agentPresetId;if(t){let n=u.find(e=>e.id===t);n?.instructionMarkdown&&e.push(`## Agent Context\n\nYou are operating as the "${n.name}" agent. Follow these agent-specific instructions:\n\n${n.instructionMarkdown}\n\n---`)}return Y.agentInstructionMarkdown&&e.push(Y.agentInstructionMarkdown),L.trim()&&e.push(`## Additional Instructions\n\n${L.trim()}`),e.push(`Produce exactly ${k} subtasks.`),e.join(`
|
|
2
2
|
|
|
3
3
|
`)},[Y,u,L,k]),{execution:Re}=Ot(),ze=Re?.connections||[],Ve=r(()=>{let e=[];for(let t of ze)(t.status===`connected`||t.status===`listening`||t.status===`idle`)&&e.push({type:`connected`,id:t.id,label:t.displayName||t.connectionKey});for(let t of d)e.push({type:`virtual`,id:t.providerConfigId||t.id||t.provider||``,label:t.displayLabel||t.label||t.providerConfigId||t.id||t.provider||`Provider`,provider:t.providerConfigId||t.id||t.provider,iconProviderId:t.iconProviderId||t.provider||t.id,effectiveModel:t.effectiveModel});return e},[ze,d]),He=j?.type===`virtual`,Ue=j?.iconProviderId,We=r(()=>He&&Ue?nt(Ue):[],[He,Ue]),Ge=j?.effectiveModel?`Default Model (${j.effectiveModel})`:h,Ke=e=>i(we,{id:e,className:`h-5 w-5 rounded-md`,imageClassName:`h-3 w-3`}),qe=()=>i(`span`,{className:`inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-md border border-slate-500/18 bg-slate-500/[0.08] text-slate-600 dark:border-slate-300/18 dark:bg-slate-300/[0.08] dark:text-slate-300`,children:i(P,{className:`h-3.5 w-3.5`,strokeWidth:2.2})});f(()=>{N&&(!He||!We.some(e=>e.value===N))&&ee(null)},[We,N,He]),f(()=>{if(!je){Te(0);return}De(!1);let e=Date.now(),t=setInterval(()=>Te(Date.now()-e),100);return()=>clearInterval(t)},[je]);let Je=r(()=>je?Fr(xe===`plan_and_start`?`plan_and_start`:`plan_only`,Ce):null,[je,xe,Ce]),Ye=typeof document<`u`&&document.documentElement.classList.contains(`dark`);f(()=>{x.current&&$.fromTo(x.current,{y:28,opacity:0,scale:.985},{y:0,opacity:1,scale:1,duration:.72,ease:`power4.out`})},[]),f(()=>{if(!S.current)return;let e=S.current.querySelectorAll(`[data-qs-stagger]`);e.length&&$.fromTo(e,{y:18,opacity:0},{y:0,opacity:1,stagger:.055,duration:.5,ease:`power3.out`})},[C]);let Ze=n(e=>{E(e.id),A(e.defaultTaskCount||5),M(null),ee(null),I(!1),R(``),w(`configure`)},[]),Qe=n(e=>{B(e),V(e?.name||``),re(e?.description||``),H(e?.icon||`Zap`),oe(e?.category||`engineering`),se(e?.categoryColor||`signal`),ce(!1),G(!1),me(e?.agentInstructionMarkdown||``),ge(e?.defaultTaskCount||5),ve(``),ye(!1),be(!1),w(`editor`)},[]),$e=n(async()=>{if(!(!te.trim()||!pe.trim()&&!_e)){ye(!0);try{let e={name:te.trim(),description:ne.trim(),icon:ie,category:ae,categoryColor:U,agentInstructionMarkdown:pe.trim(),defaultTaskCount:he,agentPresetId:_e||void 0};z?await y?.(z.id,e):await v?.(e),w(`browse`)}finally{ye(!1)}}},[te,ne,ie,ae,U,pe,he,_e,z,v,y]),et=n(async()=>{if(!J){be(!0);return}z&&(await b?.(z.id),T===z.id&&E(null),w(`browse`))},[J,z,T,b]),tt=n(async e=>{if(!Y||ke.current)return;Se(e),De(!1),Te(0);let t=new AbortController,n=Ae.current+1;Ae.current=n,ke.current={id:n,detached:!1,cancelled:!1},Oe.current=t;let r=()=>{let e=ke.current;return!!e&&e.id===n&&!e.detached&&!e.cancelled};try{await o(Y.id,k,e,L.trim()||void 0,j,N,t.signal,{shouldHandleResult:r}),r()&&a()}catch{}finally{let e=ke.current;e?.id===n&&(ke.current=null),Oe.current===t&&(Oe.current=null),(!e||e.id===n)&&Se(null)}},[Y,k,L,o,a,j,N]),rt=n(()=>{ke.current&&=(ke.current.cancelled=!0,null),Oe.current&&=(Oe.current.abort(),null),Se(null)},[]),X=n(()=>{ke.current&&(ke.current.detached=!0),ke.current=null,Oe.current=null,Se(null),De(!0),E(null),A(5),M(null),ee(null),I(!1),R(``),w(`browse`)},[]);return i(`section`,{ref:x,className:`relative w-full rounded-[1.75rem] border border-black/[0.06] bg-white/70 shadow-[0_20px_50px_rgba(15,23,42,0.08)] backdrop-blur-2xl dark:border-white/[0.06] dark:bg-void-800/60 dark:shadow-[0_24px_56px_rgba(0,0,0,0.28)] ${le||W?``:`overflow-hidden`}`,children:[i(`div`,{className:`pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_top_left,rgba(255,107,0,0.07),transparent_28%),radial-gradient(circle_at_bottom_right,rgba(0,224,160,0.06),transparent_34%)] dark:bg-[radial-gradient(circle_at_top_left,rgba(255,107,0,0.09),transparent_28%),radial-gradient(circle_at_bottom_right,rgba(0,224,160,0.07),transparent_34%)]`}),i(Ir,{isBusy:je,isDismissed:Ee,feedback:Je,planningEta:_,elapsedMs:Ce,isDark:Ye,actionType:`quicksprint`,themeAccent:`ember`,onDismiss:()=>De(!0),onCancel:rt,secondaryActionLabel:`New Quicksprint`,onSecondaryAction:X}),i(`div`,{ref:S,className:`relative z-10`,children:[C===`browse`&&i(`div`,{className:`p-6 sm:p-8 lg:p-10`,children:[i(`div`,{"data-qs-stagger":!0,className:`flex items-start justify-between gap-4`,children:[i(`div`,{className:`space-y-4`,children:[i(`div`,{className:`inline-flex items-center gap-2 rounded-full border border-ember-500/15 bg-ember-500/[0.07] px-3 py-1.5 text-[10px] font-bold uppercase tracking-[0.16em] text-ember-600 dark:text-ember-400`,children:[i(Lt,{className:`h-3.5 w-3.5`,strokeWidth:2.3}),`Quicksprint`]}),i(`div`,{className:`space-y-3`,children:[i(`h2`,{className:`font-display text-[2rem] font-black leading-none tracking-tight text-slate-900 dark:text-white sm:text-[2.35rem]`,children:`Launch A Quicksprint.`}),i(`p`,{className:`max-w-2xl text-sm leading-relaxed text-slate-500 dark:text-slate-400 sm:text-[15px]`,children:`Browse purpose-specific default templates or launch your own reusable custom flows to spin up a focused sprint fast.`})]})]}),i(`button`,{type:`button`,onClick:a,className:`inline-flex min-h-[44px] min-w-[44px] h-10 w-10 shrink-0 items-center justify-center rounded-full border border-black/[0.06] bg-white/78 text-slate-400 transition-colors hover:text-slate-900 dark:border-white/[0.06] dark:bg-white/[0.03] dark:hover:text-white`,"aria-label":`Close quicksprint`,children:i(Dt,{className:`h-4 w-4`})})]}),l?i(`div`,{className:`flex items-center justify-center py-20`,children:i(`div`,{className:`h-8 w-8 animate-spin rounded-full border-2 border-ember-500 border-t-transparent`})}):i(e,{children:[i(`div`,{"data-qs-stagger":!0,className:`mt-10`,children:[i(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-end lg:justify-between`,children:[i(`div`,{className:`space-y-2`,children:[i(`div`,{className:`text-[9px] font-bold uppercase tracking-[0.18em] text-slate-400`,children:`Default Templates`}),i(`p`,{className:`max-w-2xl text-sm leading-relaxed text-slate-500 dark:text-slate-400`,children:`Built-in templates are organized by purpose so the catalog can expand into additional language and product families over time.`})]}),i(`div`,{className:`w-full max-w-sm rounded-[1.4rem] border border-black/[0.06] bg-black/[0.025] p-4 dark:border-white/[0.06] dark:bg-white/[0.03]`,children:[i(`div`,{className:`text-[9px] font-bold uppercase tracking-[0.18em] text-slate-400`,children:`Purpose`}),i(`div`,{className:`mt-2`,children:i($t,{"aria-label":`Default template purpose`,variant:`compact`,value:Fe?.value||``,onChange:O,options:Pe.map(e=>({value:e.value,label:e.label})),placeholder:`Select Purpose`})})]})]}),Fe?.description&&i(`p`,{className:`mt-4 max-w-3xl text-xs leading-relaxed text-slate-400 dark:text-slate-500`,children:Fe.description}),i(`div`,{className:`mt-5 grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-3`,children:Ie.map(e=>i(Hr,{template:e,onSelect:()=>Ze(e)},e.id))})]}),i(`div`,{"data-qs-stagger":!0,className:`mt-10`,children:[i(`div`,{className:`flex items-center justify-between mb-5`,children:[i(`div`,{className:`text-[9px] font-bold uppercase tracking-[0.2em] text-slate-400`,children:`Custom Templates`}),i(`button`,{onClick:()=>Qe(null),className:`inline-flex min-h-[44px] items-center gap-1.5 rounded-full border border-ember-500/20 bg-ember-500/[0.06] px-3 py-1.5 text-[10px] font-bold uppercase tracking-[0.14em] text-ember-600 transition-colors hover:bg-ember-500/[0.12] dark:text-ember-400`,children:[i(Be,{className:`h-3 w-3`,strokeWidth:2.5}),`New Template`]})]}),Ne.length===0?i(`button`,{onClick:()=>Qe(null),className:`w-full rounded-[1.4rem] border border-dashed border-black/[0.08] bg-black/[0.015] p-8 text-center transition-colors hover:border-ember-500/30 hover:bg-ember-500/[0.03] dark:border-white/[0.06] dark:bg-white/[0.02] dark:hover:border-ember-500/30`,children:[i(`div`,{className:`mx-auto mb-2 flex h-10 w-10 items-center justify-center rounded-full bg-ember-500/10`,children:i(Be,{className:`h-5 w-5 text-ember-500`})}),i(`div`,{className:`text-sm font-semibold text-slate-500 dark:text-slate-400`,children:`Create your first custom template`}),i(`div`,{className:`mt-1 text-xs text-slate-400 dark:text-slate-500`,children:`Combine agent presets with custom prompts for reusable sprint flows`})]}):i(`div`,{className:`grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-3`,children:Ne.map(e=>i(Hr,{template:e,onSelect:()=>Ze(e),onEdit:()=>Qe(e)},e.id))})]})]})]}),C===`configure`&&Y&&i(`div`,{className:`grid gap-0 xl:grid-cols-[minmax(0,1fr)_22rem]`,children:[i(`div`,{className:`border-b border-black/[0.06] p-6 dark:border-white/[0.06] sm:p-8 lg:p-10 xl:border-b-0 xl:border-r`,children:[i(`div`,{"data-qs-stagger":!0,className:`flex items-center gap-3`,children:[i(`button`,{onClick:()=>w(`browse`),className:`inline-flex min-h-[44px] min-w-[44px] h-8 w-8 items-center justify-center rounded-full border border-black/[0.06] text-slate-400 transition-colors hover:text-slate-900 dark:border-white/[0.06] dark:hover:text-white`,children:i(Xe,{className:`h-4 w-4`})}),i(`div`,{className:`inline-flex items-center gap-2 rounded-full border border-ember-500/15 bg-ember-500/[0.07] px-3 py-1.5 text-[10px] font-bold uppercase tracking-[0.16em] text-ember-600 dark:text-ember-400`,children:[i(Lt,{className:`h-3.5 w-3.5`,strokeWidth:2.3}),`Configure Quicksprint`]})]}),i(`h2`,{"data-qs-stagger":!0,className:`mt-6 font-display text-[1.8rem] font-black leading-tight tracking-tight text-slate-900 dark:text-white sm:text-[2.1rem]`,children:Y.name}),i(`p`,{"data-qs-stagger":!0,className:`mt-2 max-w-2xl text-sm leading-relaxed text-slate-500 dark:text-slate-400`,children:Y.description}),i(`div`,{"data-qs-stagger":!0,className:`mt-8 grid gap-4 sm:grid-cols-2`,children:[i(`div`,{className:`rounded-[1.4rem] border border-black/[0.06] bg-black/[0.025] p-4 dark:border-white/[0.06] dark:bg-white/[0.03]`,children:[i(`div`,{className:`text-[9px] font-bold uppercase tracking-[0.2em] text-slate-400`,children:`Planning Route`}),i(`div`,{className:`mt-2`,children:i($t,{variant:`compact`,value:j?.id||``,onChange:e=>{M(Ve.find(t=>t.id===e)||null)},options:[{value:``,label:p,icon:g?()=>Ke(g):void 0},...Ve.map(e=>({value:e.id,label:e.label,icon:e.type===`virtual`&&e.iconProviderId?()=>Ke(e.iconProviderId):e.type===`connected`?qe:void 0}))],placeholder:p})})]}),i(`div`,{className:`rounded-[1.4rem] border p-4 transition-all ${He?`border-signal-500/20 bg-signal-500/[0.04] dark:bg-signal-500/[0.08]`:`border-black/[0.06] bg-black/[0.025] opacity-40 dark:border-white/[0.06] dark:bg-white/[0.03]`}`,children:[i(`div`,{className:`text-[9px] font-bold uppercase tracking-[0.2em] text-slate-400`,children:`Model Override`}),i(`div`,{className:`mt-2`,children:i($t,{variant:`compact`,disabled:!He,value:N||``,onChange:e=>ee(e||null),options:[{value:``,label:Ge,icon:Ue?()=>Ke(Ue):void 0},...We.map(e=>({value:e.value,label:e.label,icon:Ue?()=>Ke(Ue):void 0}))],placeholder:Ge})})]})]}),i(`div`,{"data-qs-stagger":!0,className:`mt-8 space-y-2`,children:[i(`label`,{className:`text-[9px] font-bold uppercase tracking-[0.2em] text-slate-400`,children:`Additional Instructions (optional)`}),i(`textarea`,{value:L,onInput:e=>R(e.target.value),placeholder:`Add extra context or requirements for this specific run — e.g. 'Focus only on the auth module' or 'Include migration scripts'...`,rows:4,className:`w-full rounded-[1.7rem] border border-black/[0.06] bg-black/[0.025] p-5 text-sm leading-relaxed text-slate-700 outline-none transition-all placeholder:text-slate-300 focus:border-ember-500/40 focus:shadow-[0_0_0_1px_rgba(255,107,0,0.16),0_0_30px_rgba(255,107,0,0.08)] dark:border-white/[0.06] dark:bg-white/[0.03] dark:text-slate-300 dark:placeholder:text-slate-600 resize-y`})]}),i(`div`,{"data-qs-stagger":!0,className:`mt-6`,children:[i(`button`,{onClick:()=>I(!F),className:`inline-flex min-h-[44px] min-w-[44px] items-center gap-2 text-[10px] font-bold uppercase tracking-[0.14em] text-slate-400 transition-colors hover:text-slate-600 dark:hover:text-slate-300`,children:[i(F?Jt:kt,{className:`h-3.5 w-3.5`}),F?`Hide Combined Prompt`:`View Combined Prompt`]}),i(`div`,{className:`overflow-hidden transition-all duration-500 ease-[cubic-bezier(0.22,1,0.36,1)] ${F?`mt-4 max-h-[600px] opacity-100`:`max-h-0 opacity-0`}`,children:i(`div`,{className:`rounded-[1.4rem] border border-black/[0.05] bg-black/[0.02] p-5 dark:border-white/[0.05] dark:bg-white/[0.02]`,children:i(`pre`,{className:`max-h-80 overflow-y-auto text-xs font-mono leading-relaxed text-slate-500 dark:text-slate-400 whitespace-pre-wrap break-words scrollbar-thin scrollbar-thumb-black/10 dark:scrollbar-thumb-white/10`,children:Le})})})]})]}),i(`div`,{className:`flex flex-col p-6 sm:p-8`,children:[i(`div`,{"data-qs-stagger":!0,children:[i(`div`,{className:`text-[9px] font-bold uppercase tracking-[0.2em] text-slate-400 mb-4`,children:`Subtask Count`}),i(Ur,{value:k,onChange:A})]}),i(`div`,{className:`mt-auto pt-8`}),i(`div`,{"data-qs-stagger":!0,className:`space-y-3`,children:[i(`button`,{onClick:()=>tt(`plan_and_start`),disabled:je,className:`flex min-h-[44px] w-full items-center justify-center gap-2.5 rounded-[1.35rem] bg-ember-600 px-5 py-3.5 text-[11px] font-bold uppercase tracking-[0.14em] text-white shadow-[0_0_20px_rgba(255,107,0,0.25)] transition-all hover:bg-ember-500 hover:shadow-[0_0_28px_rgba(255,107,0,0.35)] disabled:opacity-50 disabled:cursor-not-allowed`,children:[i(Pn,{className:`h-4 w-4`}),`Plan & Start`]}),i(`button`,{onClick:()=>tt(`plan_only`),disabled:je,className:`flex min-h-[44px] w-full items-center justify-center gap-2.5 rounded-[1.35rem] border border-black/[0.08] bg-white/66 px-5 py-3.5 text-[11px] font-bold uppercase tracking-[0.14em] text-slate-600 transition-colors hover:bg-black/[0.04] disabled:opacity-50 disabled:cursor-not-allowed dark:border-white/[0.08] dark:bg-white/[0.03] dark:text-slate-300 dark:hover:bg-white/[0.06]`,children:[i(Wt,{className:`h-4 w-4`}),`Plan Only`]})]})]})]}),C===`editor`&&i(`div`,{className:`p-6 sm:p-8 lg:p-10`,children:[i(`div`,{"data-qs-stagger":!0,className:`flex items-center gap-3`,children:[i(`button`,{onClick:()=>w(`browse`),className:`inline-flex min-h-[44px] min-w-[44px] h-8 w-8 items-center justify-center rounded-full border border-black/[0.06] text-slate-400 transition-colors hover:text-slate-900 dark:border-white/[0.06] dark:hover:text-white`,children:i(Xe,{className:`h-4 w-4`})}),i(`div`,{className:`inline-flex items-center gap-2 rounded-full border border-ember-500/15 bg-ember-500/[0.07] px-3 py-1.5 text-[10px] font-bold uppercase tracking-[0.16em] text-ember-600 dark:text-ember-400`,children:[i(P,{className:`h-3.5 w-3.5`,strokeWidth:2.3}),z?`Edit Template`:`New Template`]})]}),i(`label`,{"data-qs-stagger":!0,className:`mt-8 block space-y-2`,children:[i(`span`,{className:`text-[9px] font-bold uppercase tracking-[0.2em] text-slate-400`,children:`Template Name`}),i(`input`,{type:`text`,value:te,onInput:e=>V(e.target.value),placeholder:`API Integration Tests`,className:`w-full rounded-[1rem] border border-black/[0.06] bg-transparent px-4 py-3 font-display text-[1.65rem] font-black leading-none tracking-tight text-slate-900 outline-none transition-colors placeholder:text-slate-200 focus:ring-4 focus:ring-signal-500/20 focus:border-signal-500 dark:border-white/[0.08] dark:text-white dark:placeholder:text-slate-700 sm:text-[1.9rem]`,autoFocus:!0})]}),i(`label`,{"data-qs-stagger":!0,className:`mt-6 block space-y-2`,children:[i(`span`,{className:`text-[9px] font-bold uppercase tracking-[0.2em] text-slate-400`,children:`Description`}),i(`input`,{type:`text`,value:ne,onInput:e=>re(e.target.value),placeholder:`What this template does in one line`,className:`w-full rounded-[1rem] border border-black/[0.06] bg-transparent px-4 py-3 text-sm leading-relaxed text-slate-700 outline-none transition-colors placeholder:text-slate-300 focus:ring-4 focus:ring-signal-500/20 focus:border-signal-500 dark:border-white/[0.06] dark:text-slate-300 dark:placeholder:text-slate-600`})]}),i(`div`,{"data-qs-stagger":!0,className:`mt-8 grid gap-4 sm:grid-cols-2`,children:[i(`div`,{className:`rounded-[1.4rem] border border-black/[0.06] bg-black/[0.025] p-4 dark:border-white/[0.06] dark:bg-white/[0.03]`,children:[i(`div`,{className:`text-[9px] font-bold uppercase tracking-[0.2em] text-slate-400 mb-3`,children:`Category Tag`}),i(`div`,{className:`flex items-center gap-3`,children:[i(`button`,{type:`button`,onClick:e=>{let t=e.currentTarget.getBoundingClientRect(),n=x.current?.getBoundingClientRect()||{top:0,left:0};fe({top:t.bottom-n.top+8,left:t.left-n.left}),G(!le),ce(!1)},className:`flex min-h-[44px] min-w-[44px] h-10 w-10 flex-shrink-0 cursor-pointer items-center justify-center rounded-xl border border-black/[0.08] bg-white/80 text-slate-600 shadow-sm transition-all duration-200 hover:scale-105 hover:shadow-md hover:border-ember-500/30 hover:text-ember-500 active:scale-95 dark:border-white/[0.08] dark:bg-white/[0.05] dark:text-slate-300 dark:hover:text-ember-400`,title:`Pick icon`,children:i(Lr[ie]||Lt,{className:`h-5 w-5`})}),i(`button`,{type:`button`,onClick:e=>{let t=e.currentTarget.getBoundingClientRect(),n=x.current?.getBoundingClientRect()||{top:0,left:0};fe({top:t.bottom-n.top+8,left:t.left-n.left}),ce(!W),G(!1)},className:`flex min-h-[44px] min-w-[44px] h-10 w-10 flex-shrink-0 cursor-pointer items-center justify-center rounded-xl border border-black/[0.08] bg-white/80 shadow-sm transition-all duration-200 hover:scale-105 hover:shadow-md active:scale-95 dark:border-white/[0.08] dark:bg-white/[0.05]`,title:`Pick tag color`,children:i(`span`,{className:`block h-5 w-5 rounded-full shadow-[inset_0_1px_2px_rgba(255,255,255,0.4),0_0_0_2px_rgba(0,0,0,0.06)] transition-transform duration-200 ${zr(U).dot}`,style:zr(U).style?.[`--accent`]?{backgroundColor:`var(--accent)`,...zr(U).style}:void 0})}),i(`input`,{type:`text`,value:ae,onInput:e=>oe(e.target.value),placeholder:`e.g. engineering...`,className:`flex-1 min-w-0 rounded-[1rem] border border-black/[0.06] bg-transparent px-3 py-2 text-sm text-slate-700 outline-none transition-colors placeholder:text-slate-300 focus:ring-4 focus:ring-signal-500/20 focus:border-signal-500 dark:border-white/[0.06] dark:text-slate-300 dark:placeholder:text-slate-600`})]}),ae.trim()&&i(`div`,{className:`mt-3 flex items-center`,children:i(`span`,{className:`inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[10px] font-bold ${zr(U).bg} ${zr(U).text}`,style:zr(U).style?.[`--accent`]?{backgroundColor:`color-mix(in srgb, var(--accent) 15%, transparent)`,color:`var(--accent)`,...zr(U).style}:void 0,children:[i(`span`,{className:`block h-1.5 w-1.5 rounded-full ${zr(U).dot}`,style:zr(U).style?.[`--accent`]?{backgroundColor:`var(--accent)`,...zr(U).style}:void 0}),ae]})})]}),i(`div`,{className:`rounded-[1.4rem] border border-black/[0.06] bg-black/[0.025] p-4 dark:border-white/[0.06] dark:bg-white/[0.03]`,children:[i(`div`,{className:`text-[9px] font-bold uppercase tracking-[0.2em] text-slate-400 mb-2`,children:`Default Tasks`}),i(`div`,{className:`font-mono text-2xl font-black tracking-tight text-slate-900 dark:text-white`,children:he}),i(`input`,{type:`range`,min:`1`,max:`15`,value:he,onInput:e=>ge(parseInt(e.target.value,10)),className:`mt-2 w-full h-1.5 bg-black/[0.06] rounded-full appearance-none cursor-pointer accent-ember-500 dark:bg-white/[0.08]`})]})]}),le&&i(e,{children:[i(`div`,{className:`fixed inset-0 z-[9998] cursor-pointer`,onClick:()=>G(!1),"aria-hidden":`true`}),i(`div`,{ref:ue,role:`dialog`,"aria-modal":`true`,"aria-label":`Icon picker`,className:`absolute z-[9999] w-[17rem] rounded-2xl border border-white/[0.08] p-3 shadow-2xl backdrop-blur-2xl bg-[#1a1d24]/95`,style:{top:de.top,left:de.left,animation:`qs-picker-in 0.2s cubic-bezier(0.22,1,0.36,1)`},children:i(`div`,{className:`grid grid-cols-6 gap-1`,children:Br.map(e=>{let t=ie===e.value;return i(`button`,{type:`button`,onClick:()=>{H(e.value),G(!1)},title:e.value,className:`flex min-h-[44px] min-w-[44px] h-9 w-9 cursor-pointer items-center justify-center rounded-xl transition-all duration-150 ${t?`bg-ember-500/20 text-ember-500 shadow-[0_0_10px_rgba(255,107,0,0.15)] scale-110`:`text-slate-400 hover:bg-white/[0.08] hover:text-white hover:scale-110`}`,children:i(e.Icon,{className:`h-4 w-4`})},e.value)})})})]}),W&&i(e,{children:[i(`div`,{className:`fixed inset-0 z-[9998] cursor-pointer`,onClick:()=>ce(!1),"aria-hidden":`true`}),i(`div`,{ref:K,role:`dialog`,"aria-modal":`true`,"aria-label":`Color picker`,className:`absolute z-[9999] w-52 rounded-2xl border border-white/[0.08] p-3 shadow-2xl backdrop-blur-2xl bg-[#1a1d24]/95`,style:{top:de.top,left:de.left,animation:`qs-picker-in 0.2s cubic-bezier(0.22,1,0.36,1)`},children:i(`div`,{className:`grid grid-cols-5 gap-2`,children:Rr.map(({value:e,dot:t})=>{let n=e===U;return i(`button`,{type:`button`,onClick:()=>{se(e),ce(!1)},className:`group flex min-h-[44px] min-w-[44px] h-8 w-8 cursor-pointer items-center justify-center rounded-full transition-all duration-200 hover:scale-125 active:scale-95`,children:i(`span`,{className:`block rounded-full transition-all duration-200 ${t}`,style:{width:n?`1.5rem`:`1.25rem`,height:n?`1.5rem`:`1.25rem`,boxShadow:n?`inset 0 1px 3px rgba(255,255,255,0.35), 0 0 0 2.5px rgba(255,255,255,0.2), 0 0 12px rgba(255,255,255,0.15)`:`inset 0 1px 3px rgba(255,255,255,0.35)`}})},e)})})})]}),u.length>0&&i(`div`,{"data-qs-stagger":!0,className:`mt-6`,children:i(`div`,{className:`rounded-[1.4rem] border border-black/[0.06] bg-black/[0.025] p-4 dark:border-white/[0.06] dark:bg-white/[0.03]`,children:[i(`div`,{className:`text-[9px] font-bold uppercase tracking-[0.2em] text-slate-400 mb-2`,children:`Agent Preset (optional)`}),i(`p`,{className:`text-xs text-slate-400 dark:text-slate-500 mb-3`,children:`Attach an agent's instructions to this template. The agent's prompt will be prepended to the template instructions.`}),i($t,{variant:`compact`,value:_e,onChange:e=>ve(e),options:[{value:``,label:`No Agent`},...u.map(e=>({value:e.id,label:`${e.name}${e.labels.length?` (${e.labels.join(`, `)})`:``}`}))],placeholder:`No Agent`})]})}),i(`div`,{"data-qs-stagger":!0,className:`mt-6 space-y-2`,children:[i(`span`,{className:`text-[9px] font-bold uppercase tracking-[0.2em] text-slate-400`,children:`Agent Instructions`}),i(`textarea`,{value:pe,onInput:e=>me(e.target.value),placeholder:`Write detailed instructions for the planning agent. Leave empty to use only the agent preset's instructions...`,rows:10,className:`w-full rounded-[1rem] border border-black/[0.06] bg-black/[0.025] p-5 text-sm font-mono leading-relaxed text-slate-700 outline-none transition-all placeholder:text-slate-300 focus:ring-4 focus:ring-signal-500/20 focus:border-signal-500 dark:border-white/[0.06] dark:bg-white/[0.03] dark:text-slate-300 dark:placeholder:text-slate-600 resize-y`})]}),i(`div`,{"data-qs-stagger":!0,className:`mt-8 flex items-center justify-between`,children:[i(`div`,{children:z&&!z.isBuiltIn&&i(`button`,{type:`button`,onClick:et,className:`inline-flex min-h-[44px] items-center gap-1.5 rounded-full px-3.5 py-2 text-[10px] font-bold uppercase tracking-[0.14em] transition-colors ${J?`bg-red-600 text-white hover:bg-red-500`:`text-red-400 hover:text-red-300 hover:bg-red-500/10`}`,children:[i(ln,{className:`h-3.5 w-3.5`}),J?`Confirm Delete`:`Delete`]})}),i(`button`,{onClick:$e,disabled:q||!te.trim()||!pe.trim()&&!_e,className:`inline-flex min-h-[44px] items-center gap-2 rounded-[1.35rem] bg-ember-600 px-6 py-3 text-[11px] font-bold uppercase tracking-[0.14em] text-white shadow-[0_0_20px_rgba(255,107,0,0.25)] transition-all hover:bg-ember-500 hover:shadow-[0_0_28px_rgba(255,107,0,0.35)] disabled:opacity-50 disabled:cursor-not-allowed`,children:q?`Saving...`:z?`Save Changes`:`Create Template`})]})]})]})]})},Hr=({template:e,onSelect:t,onEdit:n})=>{let r=Lr[e.icon]||Lt,a=e.categoryColor||`slate`;return i(`button`,{type:`button`,onClick:t,className:`group relative flex flex-col rounded-[1.75rem] border border-black/[0.06] bg-white/70 p-5 text-left transition-all hover:border-ember-500/30 hover:shadow-[0_0_24px_rgba(255,107,0,0.08)] dark:border-white/[0.06] dark:bg-void-800/60 dark:hover:border-ember-500/30`,children:[!e.isBuiltIn&&n&&i(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),n()},className:`absolute top-4 right-4 rounded-lg min-h-[44px] min-w-[44px] p-1.5 text-slate-300 opacity-0 transition-all group-hover:opacity-100 hover:bg-ember-500/10 hover:text-ember-500 dark:text-slate-500`,title:`Edit template`,children:i(P,{className:`h-3.5 w-3.5`})}),i(`div`,{className:`flex items-center gap-3 mb-3`,children:[i(`div`,{className:`flex h-9 w-9 items-center justify-center rounded-xl bg-ember-500/[0.08] text-ember-500 transition-colors group-hover:bg-ember-500/[0.14]`,children:i(r,{className:`h-4.5 w-4.5`})}),i(`h3`,{className:`flex-1 text-sm font-bold text-slate-900 dark:text-white leading-tight pr-6`,children:e.name})]}),i(`p`,{className:`flex-1 text-xs leading-relaxed text-slate-500 dark:text-slate-400 mb-4`,children:e.description}),i(`div`,{className:`flex items-center justify-between`,children:[i(`span`,{className:`inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[10px] font-bold ${zr(a).bg} ${zr(a).text}`,style:zr(a).style?.[`--accent`]?{backgroundColor:`color-mix(in srgb, var(--accent) 15%, transparent)`,color:`var(--accent)`,...zr(a).style}:void 0,children:[i(`span`,{className:`block h-1.5 w-1.5 rounded-full ${zr(a).dot}`,style:zr(a).style?.[`--accent`]?{backgroundColor:`var(--accent)`,...zr(a).style}:void 0}),e.category]}),i(`span`,{className:`text-[10px] font-medium text-slate-400`,children:[e.defaultTaskCount,` subtask`,e.defaultTaskCount===1?``:`s`]})]})]})},Ur=({value:e,onChange:t})=>{let r=(e-1)/14*100,a=s(null),o=n(e=>{if(!a.current)return;let n=a.current.getBoundingClientRect(),r=Math.max(0,Math.min(1,(e.clientX-n.left)/n.width));t(Math.round(1+r*14))},[t]),c=n(e=>{e.target.setPointerCapture(e.pointerId),o(e)},[o]);return i(`div`,{className:`select-none`,children:[i(`div`,{className:`flex items-baseline gap-2 mb-6`,children:[i(`span`,{className:`font-mono text-[3.5rem] font-black leading-none tracking-tighter text-slate-900 dark:text-white tabular-nums`,children:String(e).padStart(2,`0`)}),i(`span`,{className:`text-sm font-medium text-slate-400`,children:[`subtask`,e===1?``:`s`]})]}),i(`div`,{ref:a,className:`relative h-10 cursor-pointer touch-none`,onPointerDown:c,onPointerMove:e=>{e.buttons===1&&o(e)},children:[i(`div`,{className:`absolute top-1/2 left-0 right-0 h-2 -translate-y-1/2 rounded-full bg-black/[0.06] dark:bg-white/[0.06] overflow-hidden`,children:i(`div`,{className:`absolute inset-y-0 left-0 rounded-full bg-gradient-to-r from-ember-500 to-ember-400 transition-[width] duration-75`,style:{width:`${r}%`}})}),i(`div`,{className:`absolute top-1/2 left-0 right-0 -translate-y-1/2 flex justify-between px-[2px]`,children:Array.from({length:15},(t,n)=>{let r=1+n;return i(`div`,{className:`rounded-full transition-all ${r===1||r===5||r===10||r===15?`h-3 w-1`:`h-1.5 w-0.5`} ${r<=e?`bg-ember-500/60`:`bg-black/[0.08] dark:bg-white/[0.08]`}`},r)})}),i(`div`,{className:`absolute top-1/2 -translate-y-1/2 -translate-x-1/2 transition-[left] duration-75`,style:{left:`${r}%`},children:i(`div`,{className:`relative`,children:[i(`div`,{className:`h-6 w-6 rounded-full border-[3px] border-ember-500 bg-white shadow-[0_0_12px_rgba(255,107,0,0.3)] dark:bg-void-800`}),i(`div`,{className:`absolute -inset-2 rounded-full bg-ember-500/10 animate-pulse`,style:{animationDuration:`2s`}})]})})]}),i(`div`,{className:`mt-2 flex justify-between text-[10px] font-bold tracking-wider text-slate-300 dark:text-slate-600`,children:[i(`span`,{children:`1`}),i(`span`,{children:`5`}),i(`span`,{children:`10`}),i(`span`,{children:`15`})]})]})};p();var Wr=[`critical`,`high`,`medium`,`low`],Gr=[`pending`,`in_progress`,`completed`],Kr=[{value:`auto`,label:`Auto`,description:`Use the default Code UX routing.`},{value:`docker_cli`,label:`CLI`,description:`Run through the isolated Docker workspace.`},{value:`jules`,label:`Jules`,description:`Force remote Jules execution.`}],qr=({sprints:e,availableTasks:t,initialTask:n,defaultSprintId:a,initialSprintId:o,onClose:c,onSubmit:l})=>{s(null);let u=s(null),[d,f]=m(n?.sprintId||a||o||e[0]?.id||``),[p,h]=m(n?.title||``),[g,_]=m(n?.description||``),[v,y]=m(n?.promptMarkdown||``),[b,x]=m(n?.status||`pending`),[S,C]=m(n?.priority||`medium`),[w,T]=m(n?.executorType||`auto`),[E,D]=m(n?.dependsOnTaskIds||[]),{feedback:O,setPending:k,setSuccess:A,setError:j,clearFeedback:M}=Mt();J();let[N,P]=m(!1),[ee,F]=m(!1),[I,L]=m({sprintId:!1,title:!1}),[R,z]=m(``),B=r(()=>{let e={};return d||(e.sprintId=`Sprint is required.`),p.trim()||(e.title=`Title is required.`),e},[d,p]),te=()=>{N||c()},V=r(()=>t.filter(e=>{if(e.sprintId!==d||e.recordId===n?.recordId)return!1;if(R){let t=R.toLowerCase(),n=e.id?e.id.toLowerCase().includes(t):!1,r=e.recordId.toLowerCase().includes(t),i=e.title.toLowerCase().includes(t);return n||r||i}return!0}),[t,n?.recordId,d,R]),ne=async e=>{if(e.preventDefault(),Object.keys(B).length>0){L({sprintId:!0,title:!0}),setTimeout(()=>{let e=u.current?.querySelector(`[aria-invalid="true"]`);e instanceof HTMLElement&&e.focus()},0);return}P(!0),M(),k(`Saving task...`);try{await l({sprintId:d,title:p.trim(),description:g.trim(),promptMarkdown:v.trim(),status:b,priority:S,executorType:w,dependsOnTaskIds:E}),A(`Task saved successfully.`),P(!1),te()}catch(e){P(!1),j(e instanceof Error?e.message:String(e),{retryAction:()=>u.current?.requestSubmit(),retryLabel:`Retry`,autoDismiss:!1})}},re=e=>{D(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])};return i(Ft,{isOpen:!0,onClose:te,ariaLabelledBy:`add-task-modal-title`,className:`w-[calc(100vw-2rem)] sm:w-full max-w-4xl !p-0 rounded-2xl`,children:i(`div`,{className:`relative w-full max-h-[calc(100dvh-2rem)] overflow-hidden sm:overflow-y-auto flex flex-col sm:flex-row`,children:[i(`div`,{className:`relative hidden sm:flex w-56 shrink-0 bg-void-900 dark:bg-void-950 flex-col justify-between p-8 overflow-hidden`,children:[i(`span`,{className:`absolute -top-2 -left-4 text-[7.5rem] font-black text-white/[0.035] font-display leading-none pointer-events-none select-none tracking-tighter`,children:n?`EDIT`:`TASK`}),i(`div`,{className:`absolute inset-0 flex items-center justify-center pointer-events-none`,children:[i(`div`,{className:`w-44 h-44 bg-signal-500/[0.08] animate-organic`,style:{borderRadius:`40% 60% 70% 30% / 40% 50% 60% 50%`}}),i(`div`,{className:`absolute w-28 h-28 bg-signal-500/[0.14] animate-organic-reverse`,style:{borderRadius:`40% 60% 70% 30% / 40% 50% 60% 50%`}})]}),i(`div`,{className:`relative z-10 flex items-center gap-2 text-signal-500 font-mono font-bold text-[10px] tracking-[0.2em] uppercase`,children:[i(je,{className:`w-3.5 h-3.5`,strokeWidth:2.5}),n?`Update Task`:`New Task`]}),i(`div`,{className:`relative z-10`,children:[i(`div`,{className:`text-[9px] font-bold uppercase tracking-[0.2em] text-white/25 font-mono mb-1.5`,children:`Workflow`}),i(`div`,{className:`text-4xl font-black text-white font-display tracking-tight leading-none`,children:b.replace(`_`,` `)}),i(`div`,{className:`mt-3 w-8 h-[2px] bg-signal-500/50`})]})]}),i(`div`,{className:`flex-1 bg-white/98 dark:bg-void-800/98 p-8 flex flex-col`,children:[i(`div`,{className:`flex items-start justify-between mb-8`,children:[i(`div`,{children:[i(`h2`,{id:`add-task-modal-title`,className:`text-[2rem] font-black text-slate-900 dark:text-white tracking-tight font-display leading-none`,children:n?`Edit Task.`:`Create Task.`}),i(`p`,{className:`text-xs font-medium text-slate-400 mt-2 tracking-wide`,children:`Define sprint scope, execution prompt, and dependencies.`})]}),i(`button`,{onClick:te,"aria-label":`Close dialog`,disabled:N,className:`w-9 h-9 flex items-center justify-center rounded-full bg-black/[0.05] dark:bg-white/[0.05] hover:bg-black/10 dark:hover:bg-white/10 text-slate-400 hover:text-slate-900 dark:hover:text-white transition-all active:scale-95 shrink-0 focus:outline-none focus-visible:ring-2 focus-visible:ring-signal-500`,children:i(Dt,{"aria-hidden":`true`,className:`w-4 h-4`})})]}),i(`form`,{ref:u,onSubmit:ne,className:`flex flex-col gap-6`,children:[i(ft,{status:O.status,message:O.message,onDismiss:M,autoDismiss:O.autoDismiss,retryAction:O.retryAction,retryLabel:O.retryLabel}),i(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-5`,children:[i(`div`,{className:`group/field`,children:[i(`label`,{htmlFor:`add-task-sprint`,className:`text-[9px] font-bold uppercase tracking-[0.2em] text-slate-400`,children:`Sprint`}),i(`select`,{id:`add-task-sprint`,value:d,onInput:e=>{f(e.target.value),O.status===`error`&&M()},className:`mt-2.5 w-full rounded-2xl bg-black/[0.03] dark:bg-white/[0.03] border border-black/[0.08] dark:border-white/[0.08] px-4 py-3 text-sm font-semibold text-slate-700 dark:text-slate-300 focus:outline-none focus:border-signal-500 focus-visible:ring-2 focus-visible:ring-signal-500`,"aria-invalid":B.sprintId&&I.sprintId?`true`:`false`,"aria-describedby":B.sprintId&&I.sprintId?`task-sprint-error`:void 0,onBlur:()=>L(e=>({...e,sprintId:!0})),required:!0,children:[i(`option`,{value:``,disabled:!0,children:`Select sprint`}),e.map(e=>i(`option`,{value:e.id,children:e.name},e.id))]}),B.sprintId&&I.sprintId&&i(`div`,{id:`task-sprint-error`,className:`text-xs text-red-500 mt-1 font-medium`,children:B.sprintId})]}),i(`div`,{className:`group/field`,children:[i(`label`,{htmlFor:`add-task-title`,className:`text-[9px] font-bold uppercase tracking-[0.2em] text-slate-400`,children:`Title`}),i(`input`,{id:`add-task-title`,type:`text`,value:p,"aria-invalid":B.title&&I.title?`true`:`false`,"aria-describedby":B.title&&I.title?`task-title-error`:void 0,onInput:e=>{h(e.target.value),O.status===`error`&&M()},className:`mt-2.5 w-full rounded-2xl bg-black/[0.03] dark:bg-white/[0.03] border border-black/[0.08] dark:border-white/[0.08] px-4 py-3 text-sm font-semibold text-slate-700 dark:text-slate-300 focus:outline-none focus:border-signal-500 focus-visible:ring-2 focus-visible:ring-signal-500`,placeholder:`Define the task scope`,required:!0,onBlur:()=>L(e=>({...e,title:!0}))}),B.title&&I.title&&i(`div`,{id:`task-title-error`,className:`text-xs text-red-500 mt-1 font-medium`,children:B.title})]})]}),i(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-5`,children:[i(`fieldset`,{children:[i(`legend`,{className:`text-[9px] font-bold uppercase tracking-[0.2em] text-slate-400 block mb-2.5`,children:`Status`}),i(`div`,{className:`inline-flex p-1 bg-black/[0.04] dark:bg-white/[0.04] rounded-2xl gap-1 flex-wrap`,children:Gr.map(e=>i(`button`,{type:`button`,onClick:()=>x(e),className:`px-3.5 py-2 rounded-xl text-[10px] font-bold uppercase tracking-[0.14em] transition-all active:scale-95 focus:outline-none focus-visible:ring-2 focus-visible:ring-signal-500 ${b===e?`bg-signal-500 text-void-900 shadow-[0_2px_12px_rgba(0,224,160,0.3)]`:`text-slate-500 dark:text-slate-400 hover:text-slate-800 dark:hover:text-slate-200`}`,children:e.replace(`_`,` `)},e))})]}),i(`fieldset`,{children:[i(`legend`,{className:`text-[9px] font-bold uppercase tracking-[0.2em] text-slate-400 block mb-2.5`,children:`Priority`}),i(`div`,{className:`inline-flex p-1 bg-black/[0.04] dark:bg-white/[0.04] rounded-2xl gap-1 flex-wrap`,children:Wr.map(e=>i(`button`,{type:`button`,onClick:()=>C(e),className:`px-3.5 py-2 rounded-xl text-[10px] font-bold uppercase tracking-[0.14em] transition-all active:scale-95 focus:outline-none focus-visible:ring-2 focus-visible:ring-ember-500 ${S===e?`bg-ember-500 text-void-900 shadow-[0_2px_12px_rgba(255,184,0,0.3)]`:`text-slate-500 dark:text-slate-400 hover:text-slate-800 dark:hover:text-slate-200`}`,children:e},e))})]})]}),i(`fieldset`,{children:[i(`legend`,{className:`flex items-center gap-2 mb-2.5`,children:[i(be,{className:`w-3.5 h-3.5 text-signal-500`,strokeWidth:2.3}),i(`span`,{className:`text-[9px] font-bold uppercase tracking-[0.2em] text-slate-400`,children:`Executor`})]}),i(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-2`,children:Kr.map(e=>i(`button`,{type:`button`,onClick:()=>T(e.value),className:`rounded-2xl border px-4 py-3 text-left transition-all active:scale-[0.98] focus:outline-none focus-visible:ring-2 focus-visible:ring-signal-500 ${w===e.value?`border-signal-500/45 bg-signal-500/[0.08] text-signal-700 dark:text-signal-300`:`border-black/[0.08] dark:border-white/[0.08] bg-black/[0.03] dark:bg-white/[0.03] text-slate-500 dark:text-slate-400`}`,children:[i(`div`,{className:`text-[10px] font-bold uppercase tracking-[0.14em]`,children:e.label}),i(`div`,{className:`mt-1 text-xs leading-relaxed`,children:e.description})]},e.value))})]}),i(`div`,{className:`group/field`,children:[i(`label`,{htmlFor:`add-task-description`,className:`text-[9px] font-bold uppercase tracking-[0.2em] text-slate-400`,children:`Description`}),i(`textarea`,{id:`add-task-description`,value:g,onInput:e=>_(e.target.value),className:`mt-2.5 w-full min-h-[110px] rounded-2xl bg-black/[0.03] dark:bg-white/[0.03] border border-black/[0.08] dark:border-white/[0.08] px-4 py-3 text-sm text-slate-700 dark:text-slate-300 focus:outline-none focus:border-signal-500 focus-visible:ring-2 focus-visible:ring-signal-500 resize-none`,placeholder:`Summarize the intent and outcome.`})]}),i(`div`,{className:`group/field`,children:[i(`label`,{htmlFor:`add-task-prompt`,className:`text-[9px] font-bold uppercase tracking-[0.2em] text-slate-400`,children:`Execution Prompt`}),i(`textarea`,{id:`add-task-prompt`,value:v,onInput:e=>y(e.target.value),className:`mt-2.5 w-full min-h-[150px] rounded-2xl bg-black/[0.03] dark:bg-white/[0.03] border border-black/[0.08] dark:border-white/[0.08] px-4 py-3 text-sm text-slate-700 dark:text-slate-300 focus:outline-none focus:border-signal-500 focus-visible:ring-2 focus-visible:ring-signal-500 resize-none font-mono`,placeholder:`Detailed markdown instructions for the agent.`})]}),i(`fieldset`,{children:[i(`div`,{className:`flex items-center justify-between mb-3`,children:[i(`legend`,{className:`flex items-center gap-2`,children:[i(Te,{className:`w-3.5 h-3.5 text-ember-500`,strokeWidth:2.3}),i(`span`,{className:`text-[9px] font-bold uppercase tracking-[0.2em] text-slate-400`,children:`Dependencies`})]}),t.filter(e=>e.sprintId===d&&e.recordId!==n?.recordId).length>5&&i(`div`,{children:[i(`label`,{htmlFor:`dependency-search`,className:`sr-only`,children:`Filter dependencies`}),i(`input`,{id:`dependency-search`,type:`search`,placeholder:`Filter tasks...`,value:R,onInput:e=>z(e.target.value),className:`w-48 bg-black/[0.03] dark:bg-white/[0.03] border border-black/[0.08] dark:border-white/[0.08] px-3 py-1.5 text-xs rounded-xl focus:outline-none focus:border-ember-500 focus-visible:ring-1 focus-visible:ring-ember-500/50`})]})]}),V.length===0?i(`div`,{role:`status`,"aria-live":`polite`,className:`rounded-2xl border border-dashed border-black/[0.08] dark:border-white/[0.08] px-4 py-4 text-xs text-slate-400`,children:`No existing tasks in this sprint yet.`}):i(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-2 max-h-44 overflow-y-auto pr-1`,children:V.map(e=>{let t=E.includes(e.recordId);return i(`button`,{type:`button`,onClick:()=>re(e.recordId),"aria-pressed":t?`true`:`false`,className:`flex items-center justify-between gap-3 px-4 py-3 rounded-2xl border text-left transition-all active:scale-[0.98] focus:outline-none focus-visible:ring-2 focus-visible:ring-ember-500 ${t?`border-ember-500/45 bg-ember-500/[0.08] text-ember-600 dark:text-ember-400`:`border-black/[0.07] dark:border-white/[0.07] bg-black/[0.02] dark:bg-white/[0.02] text-slate-500`}`,children:[i(`div`,{className:`min-w-0 flex-1 pr-2`,children:[i(`div`,{className:`flex items-center gap-2 mb-1`,children:[i(`span`,{className:`text-[10px] font-mono uppercase tracking-[0.14em] text-slate-400`,children:e.id}),i(`span`,{className:`text-[9px] px-1.5 py-0.5 rounded uppercase font-bold tracking-wider ${e.priority===`critical`?`bg-red-500/10 text-red-500`:e.priority===`high`?`bg-orange-500/10 text-orange-500`:`bg-slate-500/10 text-slate-500`}`,children:e.priority})]}),i(`div`,{className:`text-sm font-semibold truncate leading-tight`,children:e.title})]}),i(`span`,{className:`w-4 h-4 rounded-full border ${t?`border-ember-500 bg-ember-500`:`border-slate-300 dark:border-slate-600`}`})]},e.recordId)})})]}),i(`div`,{className:`flex items-center justify-between pt-2`,children:[i(`button`,{type:`button`,onClick:te,disabled:N,className:`text-sm font-semibold text-slate-400 hover:text-slate-700 dark:hover:text-slate-200 transition-all active:scale-95 focus:outline-none focus-visible:ring-2 focus-visible:ring-signal-500 rounded disabled:opacity-50 disabled:cursor-not-allowed`,children:`Cancel`}),i(Nt,{type:`submit`,pending:N,variant:`signal`,size:`lg`,children:[i(Be,{className:`w-4 h-4 group-hover/btn:rotate-90 transition-transform duration-300`}),n?`Save Task`:`Create Task`]})]})]})]})]})})};p();var Jr=[{id:`plan_and_start`,label:`Plan & Start`,description:`Create the sprint, let the Planning agent build subtasks, then launch immediately.`,icon:Pn},{id:`plan_only`,label:`Plan Only`,description:`Create the sprint and have the Planning agent generate subtasks without starting execution.`,icon:Wt},{id:`draft`,label:`Save Draft`,description:`Store the sprint only and keep planning for later.`,icon:M}];function Yr(e,t,n=null,r,i){if(!e&&!t&&!n&&!r&&!i)return;let a={};return e?.type===`connected`?a.workerId=e.id:(e?.type===`virtual`&&(a.virtualProvider=e.provider),t&&(a.virtualModel=t)),n&&(a.planningAgentPresetId=n),r&&(a.agentRoutingMode=r),i&&(a.workerAgentPresetId=i),Object.keys(a).length>0?a:void 0}var Xr=(e,t)=>e?t?[{id:`replan`,label:`Replan`,description:`Discard existing subtasks and have the Planning agent generate a new plan.`,icon:xe},{id:`append_tasks`,label:`Add Tasks`,description:`Append manual tasks to this sprint without affecting existing ones.`,icon:jn},{id:`draft`,label:`Save Changes`,description:`Update the sprint definition without triggering planning.`,icon:M}]:[{id:`plan_and_start`,label:`Plan & Start`,description:`Trigger planning and launch execution immediately.`,icon:Pn},{id:`plan_only`,label:`Plan Only`,description:`Trigger planning to generate subtasks without starting execution.`,icon:Wt},{id:`draft`,label:`Save Changes`,description:`Update the sprint definition without triggering planning.`,icon:M}]:Jr,Zr=(e=null,t=``,n={})=>{let[r,i]=m(e?.name||``),[a,o]=m(e?.goal||``),[s,c]=m(e?.originalPrompt||null),[l,u]=m(`plan_and_start`),[d,p]=m(null),[h,g]=m(null),[_,v]=m(n.planningAgentPresetId||null),[y,b]=m(n.agentRoutingMode||`MANUAL`),[x,S]=m(n.workerAgentPresetId||null),[C,w]=m(t),[T,E]=m(!1),[D,O]=m(!1),k=!!e,A=!!(e&&e.tasksCount>0);return f(()=>{i(e?.name||``),o(e?.goal||``),c(e?.originalPrompt||null),u(e&&e.tasksCount>0?`replan`:`plan_and_start`),p(null),g(null),v(n.planningAgentPresetId||null),b(n.agentRoutingMode||`MANUAL`),S(n.workerAgentPresetId||null),w(t),E(!1),O(!1)},[e?.id]),{name:r,setName:i,goal:a,setGoal:o,originalPrompt:s,setOriginalPrompt:c,submitMode:l,setSubmitMode:u,routeOverride:d,setRouteOverride:p,modelOverride:h,setModelOverride:g,planningAgentPresetId:_,setPlanningAgentPresetId:v,agentRoutingMode:y,setAgentRoutingMode:b,workerAgentPresetId:x,setWorkerAgentPresetId:S,sprintKeyOverride:C,setSprintKeyOverride:w,hasAttemptedSubmit:T,setHasAttemptedSubmit:E,hasAttemptedImprove:D,setHasAttemptedImprove:O,isEditing:k,hasTasks:A,availableModes:Xr(k,A)}};function Qr(e,t,n){return(e===`plan_only`||e===`plan_and_start`)&&!t?n.trim()||null:t}p(),c();var $r=({nextId:t,initialSprint:n=null,virtualProviders:a,defaultRouteOptionLabel:o=`Default Route`,defaultModelOptionLabel:c=`Default Model`,defaultRouteIconProviderId:l=null,planningPresets:u,agentPresets:p,defaultPlanningAgentPresetId:h=null,defaultAgentRoutingMode:g=`MANUAL`,defaultWorkerAgentPresetId:_=null,planningEta:v,onClose:y,onImprovePrompt:b,onSubmit:x,onCancelPlanningRequest:S,onStartNewSprint:C,onAppendTasks:T,linkedIssues:E,onRemoveLinkedIssue:D})=>{let O=s(null),k=s(null),A=s(null),j=s(null),M=s(new Set),N=s(null),P=s(!1),F=s({planningAgentPresetId:h||null,agentRoutingMode:g,workerAgentPresetId:_||null}),[I,L]=m(!1),[R,z]=m(!1),{feedback:B,setPending:te,setSuccess:V,setError:ne,clearFeedback:re}=Mt(),[ie,H]=m(!1),[ae,oe]=m(!1),U=J(),[se,W]=m(0),[ce,le]=m(!1),G=n?n.number?t.replace(/\d+$/,String(n.number)).toUpperCase():n.slug.toUpperCase():t.toUpperCase(),ue=s(G),K=Zr(n,G,{planningAgentPresetId:h,agentRoutingMode:g,workerAgentPresetId:_}),de=E??n?.linkedIssues??[],fe=p??u,pe=fe.map(e=>({value:e.id,label:e.name,icon:()=>i(Ye,{avatarConfig:e.avatarConfig,seed:`${e.id}:${e.name}`})})),me=()=>i(`span`,{className:`inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-md border border-signal-500/18 bg-signal-500/[0.08] text-signal-600 dark:border-signal-400/18 dark:bg-signal-400/[0.08] dark:text-signal-300`,children:i(Ct,{className:`h-3.5 w-3.5`,strokeWidth:2.2})}),he=()=>typeof crypto<`u`&&`randomUUID`in crypto?crypto.randomUUID():`planning-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`,ge=()=>{K.setName(``),K.setGoal(``),K.setOriginalPrompt(null),K.setSubmitMode(`plan_and_start`),K.setRouteOverride(null),K.setModelOverride(null),K.setPlanningAgentPresetId(h||null),K.setAgentRoutingMode(g),K.setWorkerAgentPresetId(_||null)};f(()=>(P.current=!1,()=>{P.current=!0}),[]),f(()=>{let e=F.current,t={planningAgentPresetId:h||null,agentRoutingMode:g,workerAgentPresetId:_||null};K.planningAgentPresetId===e.planningAgentPresetId&&K.setPlanningAgentPresetId(t.planningAgentPresetId),K.agentRoutingMode===e.agentRoutingMode&&K.setAgentRoutingMode(t.agentRoutingMode),K.workerAgentPresetId===e.workerAgentPresetId&&K.setWorkerAgentPresetId(t.workerAgentPresetId),F.current=t},[h,g,_]),f(()=>{let e=ue.current;G!==e&&(ue.current=G,!n&&K.sprintKeyOverride===e&&K.setSprintKeyOverride(G))},[G]),f(()=>{fe.length!==0&&(K.planningAgentPresetId&&!fe.find(e=>e.id===K.planningAgentPresetId)&&K.setPlanningAgentPresetId(null),K.workerAgentPresetId&&!fe.find(e=>e.id===K.workerAgentPresetId)&&K.setWorkerAgentPresetId(null))},[fe,K.planningAgentPresetId,K.workerAgentPresetId]);let _e=K.availableModes.find(e=>e.id===K.submitMode)||K.availableModes[0],ve=_e.icon,q=I||R,ye=r(()=>{if(I)return`improve`;if(R){if(K.submitMode===`plan_only`)return`plan_only`;if(K.submitMode===`plan_and_start`)return`plan_and_start`;if(K.submitMode===`replan`)return`replan`}return null},[I,R,K.submitMode]);f(()=>{if(!q){W(0);return}le(!1);let e=Date.now(),t=setInterval(()=>{W(Date.now()-e)},100);return()=>clearInterval(t)},[q]);let be=r(()=>ye?Fr(ye,se):null,[ye,se]);d(()=>{let e=$.timeline();O.current&&e.fromTo(O.current,{y:28,opacity:0,scale:.985,filter:`blur(14px)`},{y:0,opacity:1,scale:1,filter:`blur(0px)`,duration:.72,ease:`power4.out`}),k.current&&e.fromTo(Array.from(k.current.querySelectorAll(`[data-composer-stagger]`)),{y:18,opacity:0},{y:0,opacity:1,stagger:.055,duration:.5,ease:`power3.out`},`-=0.45`)},[n?.id]);let xe=()=>{let e=j.current;if(e&&(e.cancelled=!0,M.current.add(e.id),S?.(e.id)),A.current&&=(A.current.abort(),null),j.current=null,L(!1),z(!1),ne(`Planning request cancelled.`,{autoDismiss:!0}),N.current){let e=N.current;setTimeout(()=>e.focus(),0)}},Se=()=>{j.current&&(j.current.detached=!0,M.current.add(j.current.id)),j.current=null,A.current=null,L(!1),z(!1),le(!0),re(),ge(),C?.()},Ce=async()=>{if(!b)return;if(!K.name.trim()||!K.goal.trim()){K.setHasAttemptedSubmit(!0),K.setHasAttemptedImprove(!0);return}N.current=document.activeElement;let e=K.goal.trim(),t=he();j.current={id:t,detached:!1,cancelled:!1};let n=new AbortController;A.current=n;let r=()=>{let e=j.current;return!P.current&&!!e&&e.id===t&&!e.detached&&!e.cancelled};L(!0),re(),te(Pr.improve);try{let n=await b({name:K.name.trim(),goal:e,clientRequestId:t,planningAgentPresetId:K.planningAgentPresetId||void 0,overrides:Yr(K.routeOverride,K.modelOverride,K.planningAgentPresetId)});r()&&(K.setGoal(n),K.setOriginalPrompt(e),V(`Prompt refined`))}catch(e){let n=j.current;if(e instanceof DOMException&&e.name===`AbortError`||M.current.has(t)||n&&n.id!==t||n?.cancelled||n?.detached)return;P.current||ne(e instanceof Error?e.message:String(e),{retryAction:Ce,retryLabel:`Retry Improve`,autoDismiss:!1})}finally{A.current===n&&(A.current=null);let e=j.current;if(e?.id===t&&(j.current=null),M.current.delete(t),!P.current&&(!e||e.id===t)&&(L(!1),N.current)){let e=N.current;setTimeout(()=>e.focus(),0)}}},Ee=async e=>{if(e.preventDefault(),!K.name.trim()){K.setHasAttemptedSubmit(!0);return}if(K.submitMode===`append_tasks`&&T){T();return}N.current=document.activeElement;let t=he();j.current={id:t,detached:!1,cancelled:!1};let n=new AbortController;A.current=n;let r=()=>{let e=j.current;return!P.current&&!!e&&e.id===t&&!e.detached&&!e.cancelled};z(!0),re(),te(Pr[K.submitMode===`plan_only`?`plan_only`:K.submitMode===`replan`?`replan`:`plan_and_start`]);try{await x({name:K.name.trim(),goal:K.goal.trim(),originalPrompt:Qr(K.submitMode,K.originalPrompt,K.goal),submitMode:K.submitMode,routeOverride:K.routeOverride,modelOverride:K.modelOverride,planningAgentPresetId:K.planningAgentPresetId,agentRoutingMode:K.agentRoutingMode,workerAgentPresetId:K.agentRoutingMode===`MANUAL`?K.workerAgentPresetId:null,linkedIssues:de,clientRequestId:t,sprintKeyOverride:K.sprintKeyOverride.trim()||void 0,signal:n.signal,shouldHandleResult:r}),r()&&y()}catch(e){let n=j.current;if(e instanceof DOMException&&e.name===`AbortError`||M.current.has(t)||n&&n.id!==t||n?.cancelled||n?.detached)return;P.current||ne(e instanceof Error?e.message:String(e),{retryAction:()=>k.current?.requestSubmit(),retryLabel:`Retry Request`,autoDismiss:!1})}finally{A.current===n&&(A.current=null);let e=j.current;if(e?.id===t&&(j.current=null),M.current.delete(t),!P.current&&(!e||e.id===t)&&(z(!1),N.current&&document.activeElement===document.body)){let e=N.current;setTimeout(()=>e.focus(),0)}}},{execution:De}=Ot(),Oe=[...(De?.connections||[]).map(e=>({type:`connected`,id:e.id,label:e.displayName})),...a.map(e=>({type:`virtual`,id:e.providerConfigId||e.id||e.provider||``,label:e.displayLabel||e.label||e.providerConfigId||e.id||e.provider||`Provider`,provider:e.providerConfigId||e.id||e.provider,iconProviderId:e.iconProviderId||e.provider||e.id,effectiveModel:e.effectiveModel}))],ke=K.routeOverride||null,Ae=ke?.type===`virtual`,je=ke?.iconProviderId,Y=je?nt(je):[],Me=ke?.effectiveModel?`Default Model (${ke.effectiveModel})`:c,Ne=e=>i(we,{id:e,className:`h-5 w-5 rounded-md`,imageClassName:`h-3 w-3`}),Pe=()=>i(`span`,{className:`inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-md border border-slate-500/18 bg-slate-500/[0.08] text-slate-600 dark:border-slate-300/18 dark:bg-slate-300/[0.08] dark:text-slate-300`,children:i(Ct,{className:`h-3.5 w-3.5`,strokeWidth:2.2})});f(()=>{K.modelOverride&&(!Ae||!Y.some(e=>e.value===K.modelOverride))&&K.setModelOverride(null)},[Y,Ae,K.modelOverride]);let Fe=document.documentElement.classList.contains(`dark`);return i(`section`,{ref:O,className:`relative w-full overflow-hidden rounded-[2rem] border border-black/[0.06] bg-white/78 shadow-[0_20px_50px_rgba(15,23,42,0.08)] backdrop-blur-2xl dark:border-white/[0.06] dark:bg-void-800/72 dark:shadow-[0_24px_56px_rgba(0,0,0,0.28)]`,children:[i(`div`,{className:`pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_top_left,rgba(0,224,160,0.08),transparent_28%),radial-gradient(circle_at_bottom_right,rgba(255,184,0,0.08),transparent_34%)] dark:bg-[radial-gradient(circle_at_top_left,rgba(0,224,160,0.1),transparent_28%),radial-gradient(circle_at_bottom_right,rgba(255,184,0,0.09),transparent_34%)]`}),i(Ir,{isBusy:q,isDismissed:ce,feedback:be,planningEta:v,elapsedMs:se,isDark:Fe,actionType:ye||`plan_and_start`,themeAccent:`signal`,onCancel:xe,onDismiss:()=>le(!0),secondaryActionLabel:`New Sprint`,onSecondaryAction:Se}),i(`div`,{"aria-live":`polite`,className:`sr-only`,children:q?Pr[ye]||`Planning in progress`:B.status===`error`?B.message:``}),i(`form`,{ref:k,onSubmit:Ee,className:`relative z-10 grid gap-0 xl:grid-cols-[minmax(0,1fr)_21rem]`,tabIndex:-1,children:[i(`div`,{className:`border-b border-black/[0.06] p-6 dark:border-white/[0.06] sm:p-8 lg:p-10 xl:border-b-0 xl:border-r`,children:[i(`div`,{"data-composer-stagger":!0,className:`mb-8`,children:i(ft,{status:B.status,message:B.message,onDismiss:re,autoDismiss:B.autoDismiss,retryAction:B.retryAction,retryLabel:B.retryLabel})}),i(`div`,{"data-composer-stagger":!0,className:`flex items-start justify-between gap-4`,children:[i(`div`,{className:`space-y-4`,children:[i(`div`,{className:`inline-flex items-center gap-2 rounded-full border border-signal-500/15 bg-signal-500/[0.07] px-3 py-1.5 text-[10px] font-bold uppercase tracking-[0.16em] text-signal-600 dark:text-signal-300`,children:[i(Te,{className:`h-3.5 w-3.5`,strokeWidth:2.3}),K.isEditing?K.hasTasks?`Edit Planned Sprint`:`Edit Draft Sprint`:`Sprint Composer`]}),i(`div`,{className:`space-y-3`,children:[i(`h2`,{className:`font-display text-[2rem] font-black leading-none tracking-tight text-slate-900 dark:text-white sm:text-[2.35rem]`,children:K.isEditing?`Refine The Sprint.`:`Compose The Next Sprint.`}),i(`p`,{className:`max-w-2xl text-sm leading-relaxed text-slate-500 dark:text-slate-400 sm:text-[15px]`,children:K.isEditing?`Adjust the sprint definition. If tasks already exist, you can choose to Replan them.`:`The showcase folds away while you write. Define the sprint once, improve the prompt if needed, and let the Planning agent take the first pass at subtasks.`})]})]}),i(`button`,{type:`button`,onClick:y,disabled:q,className:`inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-full border border-black/[0.06] bg-white/78 text-slate-400 transition-colors hover:text-slate-900 disabled:cursor-not-allowed disabled:opacity-50 dark:border-white/[0.06] dark:bg-white/[0.03] dark:hover:text-white`,"aria-label":`Close sprint composer`,children:i(Dt,{className:`h-4 w-4`})})]}),i(`div`,{"data-composer-stagger":!0,className:`mt-8 grid gap-4 sm:grid-cols-3`,children:[i(`div`,{className:`group rounded-xl border border-black/[0.06] bg-black/[0.025] p-3 transition-colors focus-within:bg-white dark:border-white/[0.06] dark:bg-white/[0.03] dark:focus-within:bg-black/[0.05]`,children:[i(`div`,{className:`text-[9px] font-bold uppercase tracking-[0.2em] text-slate-400`,children:`Sprint Key`}),i(`input`,{type:`text`,value:K.sprintKeyOverride,onInput:e=>K.setSprintKeyOverride(e.target.value),disabled:q,className:`mt-2 w-full min-w-0 bg-transparent font-mono text-3xl font-black tracking-tight text-slate-900 outline-none transition-colors hover:bg-black/[0.03] focus:bg-white dark:text-white dark:hover:bg-white/[0.03] dark:focus:bg-transparent disabled:cursor-not-allowed`,placeholder:G,"aria-label":`Sprint Key Override`})]}),i(`div`,{className:`rounded-xl border p-3 transition-all ${q?`border-black/[0.06] bg-black/[0.025] opacity-50 dark:border-white/[0.06] dark:bg-white/[0.03]`:`border-black/[0.06] bg-black/[0.025] dark:border-white/[0.06] dark:bg-white/[0.03]`}`,children:[i(`div`,{className:`text-[9px] font-bold uppercase tracking-[0.2em] text-slate-400`,children:`Planning Route`}),i(`div`,{className:`mt-2`,children:i($t,{variant:`compact`,"aria-label":`Planning Route`,disabled:q,value:K.routeOverride?.id||``,onChange:e=>{let t=Oe.find(t=>t.id===e);K.setRouteOverride(t||null)},options:[{value:``,label:o,icon:l?()=>Ne(l):void 0},...Oe.map(e=>({value:e.id,label:e.label,icon:e.type===`virtual`&&e.iconProviderId?()=>Ne(e.iconProviderId):e.type===`connected`?Pe:void 0}))],placeholder:o})})]}),i(`div`,{className:`rounded-[1.4rem] border p-4 transition-all ${!Ae||q?`border-black/[0.06] bg-black/[0.025] opacity-40 dark:border-white/[0.06] dark:bg-white/[0.03]`:`border-signal-500/20 bg-signal-500/[0.04] dark:bg-signal-500/[0.08]`}`,children:[i(`div`,{className:`text-[9px] font-bold uppercase tracking-[0.2em] text-slate-400`,children:`Model Override`}),i(`div`,{className:`mt-2`,children:(()=>{let e=(K.hasAttemptedSubmit||K.hasAttemptedImprove)&&Ae&&!K.modelOverride;return i($t,{variant:`compact`,"aria-label":`Model Override`,disabled:!Ae||q,invalid:e,value:K.modelOverride||``,onChange:e=>K.setModelOverride(e||null),options:[{value:``,label:Me,icon:je?()=>Ne(je):void 0},...Y.map(e=>({value:e.value,label:e.label,icon:je?()=>Ne(je):void 0}))],placeholder:Me})})()})]})]}),i(`label`,{"data-composer-stagger":!0,className:`mt-8 block space-y-2`,children:[i(`span`,{className:`text-[9px] font-bold uppercase tracking-[0.2em] text-slate-400`,children:`Sprint Name`}),(()=>{let e=(ie||K.hasAttemptedSubmit)&&!K.name.trim();return i(`div`,{className:`relative`,children:[i(`input`,{type:`text`,value:K.name,onInput:e=>K.setName(e.target.value),onBlur:()=>H(!0),disabled:q,"aria-invalid":e?`true`:`false`,placeholder:`Runtime hardening`,className:`w-full border-0 border-b-2 bg-transparent pb-3 font-display text-[1.65rem] font-black leading-none tracking-tight outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50 sm:text-[1.9rem] ${e?`border-ember-500 text-ember-600 placeholder:text-ember-300 focus:border-ember-500 dark:border-ember-500 dark:text-ember-400 dark:placeholder:text-ember-800`:`border-black/[0.08] text-slate-900 placeholder:text-slate-200 focus:border-signal-500 dark:border-white/[0.08] dark:text-white dark:placeholder:text-slate-700`} ${e&&!U?`animate-form-shake`:``}`,required:!0,autoFocus:!0}),e&&i(`div`,{className:`absolute -bottom-6 left-0 text-[11px] font-bold text-ember-600 dark:text-ember-400`,children:`Sprint name is required`})]})})()]}),i(`div`,{"data-composer-stagger":!0,className:`mt-8 space-y-3`,children:[i(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[i(`label`,{className:`text-[9px] font-bold uppercase tracking-[0.2em] text-slate-400`,children:`Sprint Prompt`}),i(`button`,{type:`button`,onClick:()=>{Ce()},disabled:q,"aria-busy":I,className:`inline-flex items-center gap-2 rounded-full border border-signal-500/20 bg-signal-500/[0.08] px-3.5 py-2 text-[10px] font-bold uppercase tracking-[0.14em] text-signal-600 transition-colors hover:bg-signal-500/[0.14] disabled:cursor-not-allowed disabled:opacity-50 dark:text-signal-300`,children:[I?i(e,{children:[i(X,{"aria-hidden":`true`,className:`h-3.5 w-3.5 animate-spin`}),i(`span`,{className:`sr-only`,children:`Loading`})]}):i(tt,{className:`h-3.5 w-3.5`,strokeWidth:2.2}),I?Pr.improve:`Plan ahead with AI`]})]}),de.length>0&&i(`div`,{"data-composer-stagger":!0,className:`rounded-[1.7rem] border border-black/[0.07] bg-white/62 p-4 shadow-[0_12px_28px_rgba(15,23,42,0.04)] dark:border-white/[0.08] dark:bg-white/[0.035]`,children:[i(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-3`,children:[i(`div`,{className:`inline-flex items-center gap-2 text-[9px] font-bold uppercase tracking-[0.2em] text-slate-400`,children:[i(w,{className:`h-3.5 w-3.5 text-signal-500`,strokeWidth:2.2}),`Linked Issues`]}),i(`div`,{className:`rounded-full border border-signal-500/18 bg-signal-500/[0.08] px-2.5 py-1 text-[9px] font-bold uppercase tracking-[0.14em] text-signal-600 dark:text-signal-300`,children:[de.length,` imported`]})]}),i(`div`,{className:`grid gap-3 lg:grid-cols-2`,children:de.map(e=>{let t=e.provider===`gitlab`?Dn:e.provider===`jira`?en:it;return i(`article`,{className:`group relative overflow-hidden rounded-[1.25rem] border border-black/[0.06] bg-black/[0.025] p-4 transition-all hover:-translate-y-0.5 hover:border-signal-500/24 hover:bg-white/88 dark:border-white/[0.07] dark:bg-white/[0.03] dark:hover:bg-white/[0.055]`,children:[i(`div`,{className:`pointer-events-none absolute inset-x-0 top-0 h-1 bg-gradient-to-r from-signal-500 via-ember-500 to-slate-300 opacity-70`}),i(`div`,{className:`flex items-start gap-3`,children:[i(`div`,{className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-[0.85rem] border ${e.provider===`jira`?`border-[#0052CC]/20 bg-[#0052CC]/10 text-[#0052CC] dark:border-[#4C9AFF]/20 dark:bg-[#4C9AFF]/10 dark:text-[#4C9AFF]`:e.provider===`gitlab`?`border-ember-500/20 bg-ember-500/10 text-ember-600 dark:text-ember-400`:`border-slate-900/10 bg-slate-900/[0.06] text-slate-800 dark:border-white/10 dark:bg-white/[0.07] dark:text-white`}`,children:i(t,{className:`h-4 w-4`,strokeWidth:2.1})}),i(`div`,{className:`min-w-0 flex-1`,children:[i(`div`,{className:`flex flex-wrap items-center gap-2 text-[10px] font-bold uppercase tracking-[0.12em] text-slate-400`,children:[i(`span`,{children:e.repository}),i(`span`,{className:`text-signal-600 dark:text-signal-300`,children:e.issueKey||`#${e.issueNumber}`})]}),i(`h3`,{className:`mt-1 line-clamp-2 text-sm font-black leading-snug text-slate-900 dark:text-white`,children:e.title})]}),i(`a`,{href:Vt(e.url),target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-slate-400 transition-colors hover:bg-black/[0.05] hover:text-slate-900 dark:hover:bg-white/[0.06] dark:hover:text-white`,"aria-label":`Open ${e.title}`,children:i(ct,{className:`h-3.5 w-3.5`,strokeWidth:2.2})})]}),i(`div`,{className:`mt-3 flex flex-wrap gap-1.5`,children:[(e.labels||[]).slice(0,5).map(e=>i(`span`,{className:`inline-flex max-w-full items-center gap-1 rounded-full bg-signal-500/[0.08] px-2 py-1 text-[10px] font-semibold text-signal-700 dark:text-signal-300`,children:[i(ee,{className:`h-3 w-3 shrink-0`,strokeWidth:2}),i(`span`,{className:`truncate`,children:e})]},e)),(e.assignees||[]).slice(0,3).map(e=>i(`span`,{className:`inline-flex max-w-full items-center gap-1 rounded-full bg-ember-500/[0.09] px-2 py-1 text-[10px] font-semibold text-amber-700 dark:text-amber-300`,children:[i(Ln,{className:`h-3 w-3 shrink-0`,strokeWidth:2}),i(`span`,{className:`truncate`,children:e})]},e))]}),D&&!q&&i(`button`,{type:`button`,onClick:()=>D(e),className:`mt-3 text-[10px] font-bold uppercase tracking-[0.14em] text-slate-400 transition-colors hover:text-status-red`,children:`Remove Link`})]},`${e.provider}:${e.repository}:${e.issueNumber}`)})})]}),i(`div`,{className:K.originalPrompt?`grid gap-4 xl:grid-cols-2`:`grid gap-4`,children:[i(`div`,{className:`rounded-[1.7rem] border transition-all ${I?`border-signal-500/35 bg-black/[0.025] shadow-[0_0_0_1px_rgba(0,224,160,0.16),0_0_30px_rgba(0,224,160,0.1)] dark:bg-white/[0.03]`:q?`border-black/[0.07] bg-black/[0.025] opacity-50 dark:border-white/[0.08] dark:bg-white/[0.03]`:`border-black/[0.07] bg-black/[0.025] dark:border-white/[0.08] dark:bg-white/[0.03]`}`,children:(()=>{let e=(ae||K.hasAttemptedImprove)&&!K.goal.trim();return i(`div`,{className:`relative h-full`,children:[i(`textarea`,{value:K.goal,onInput:e=>K.setGoal(e.target.value),onBlur:()=>oe(!0),disabled:q,"aria-invalid":e?`true`:`false`,placeholder:`Describe the outcome, affected systems, and what done looks like when this sprint lands.`,className:`min-h-[220px] w-full resize-none rounded-[1.7rem] bg-transparent px-4 py-4 text-sm leading-relaxed outline-none disabled:cursor-not-allowed sm:min-h-[260px] sm:px-5 ${e?`text-ember-600 placeholder:text-ember-300 dark:text-ember-400 dark:placeholder:text-ember-800`:`text-slate-700 placeholder:text-slate-300 dark:text-slate-300 dark:placeholder:text-slate-600`} ${e&&!U?`animate-form-shake`:``}`}),e&&i(`div`,{className:`absolute bottom-2 right-4 text-[11px] font-bold text-ember-600 dark:text-ember-400`,children:`Prompt is required to plan`})]})})()}),K.originalPrompt&&i(`div`,{className:`flex flex-col rounded-[1.7rem] border border-black/[0.05] bg-black/[0.01] p-5 dark:border-white/[0.05] dark:bg-white/[0.015]`,children:[i(`div`,{className:`mb-3 text-[9px] font-bold uppercase tracking-[0.2em] text-slate-400`,children:`Original Prompt`}),i(`div`,{className:`max-h-[220px] overflow-y-auto text-xs italic leading-relaxed text-slate-400 dark:text-slate-500 sm:max-h-[260px]`,children:K.originalPrompt})]})]})]})]}),i(`aside`,{className:`flex flex-col gap-4 p-6 sm:p-8`,children:[i(`div`,{"data-composer-stagger":!0,children:i(`div`,{className:`transition-all ${q?`opacity-50`:``}`,children:[i(`div`,{className:`text-[9px] font-bold uppercase tracking-[0.2em] text-slate-400`,children:`Agent Routing`}),i(`div`,{className:`mt-3`,children:i($t,{variant:`card`,"aria-label":`Agent Routing`,disabled:q,value:K.agentRoutingMode,onChange:e=>K.setAgentRoutingMode(e===`ORCHESTRATOR`?`ORCHESTRATOR`:`MANUAL`),options:[{value:`MANUAL`,label:`Manual`,icon:me},{value:`ORCHESTRATOR`,label:`Orchestrator`,icon:me}],placeholder:`Manual`})})]})}),i(`div`,{"data-composer-stagger":!0,children:i(`div`,{className:`transition-all ${q?`opacity-50`:``}`,children:[i(`div`,{className:`text-[9px] font-bold uppercase tracking-[0.2em] text-slate-400`,children:`Planning Agent`}),i(`div`,{className:`mt-3`,children:i($t,{variant:`card`,"aria-label":`Planning Agent`,disabled:q,value:K.planningAgentPresetId||``,onChange:e=>K.setPlanningAgentPresetId(e||null),options:[{value:``,label:`Built-in Planning agent`,icon:()=>i(Ye,{seed:`built-in:planning`})},...pe],placeholder:`Built-in Planning agent`})})]})}),K.agentRoutingMode===`MANUAL`&&i(`div`,{"data-composer-stagger":!0,children:i(`div`,{className:`transition-all ${q?`opacity-50`:``}`,children:[i(`div`,{className:`text-[9px] font-bold uppercase tracking-[0.2em] text-slate-400`,children:`Worker Agent`}),i(`div`,{className:`mt-3`,children:i($t,{variant:`card`,"aria-label":`Worker Agent`,disabled:q,value:K.workerAgentPresetId||``,onChange:e=>K.setWorkerAgentPresetId(e||null),options:[{value:``,label:`Built-in Worker agent`,icon:()=>i(Ye,{seed:`built-in:worker`})},...pe],placeholder:`Built-in Worker agent`})})]})}),i(`div`,{"data-composer-stagger":!0,children:[i(`div`,{className:`text-[9px] font-bold uppercase tracking-[0.2em] text-slate-400`,children:`Execution Mode`}),i(`div`,{className:`mt-3 grid gap-3`,children:K.availableModes.map(e=>{let t=e.icon,n=K.submitMode===e.id;return i(`button`,{type:`button`,disabled:q,onClick:()=>K.setSubmitMode(e.id),className:`rounded-[1.35rem] border p-4 text-left transition-all ${n?`border-signal-500/30 bg-signal-500/[0.08] shadow-[0_12px_24px_rgba(0,224,160,0.08)]`:q?`border-black/[0.06] bg-white/66 opacity-50 dark:border-white/[0.06] dark:bg-white/[0.02]`:`border-black/[0.06] bg-white/66 hover:border-black/[0.1] hover:bg-white dark:border-white/[0.06] dark:bg-white/[0.02] dark:hover:border-white/[0.1]`} disabled:cursor-not-allowed`,children:[i(`div`,{className:`flex items-center gap-2 text-[10px] font-bold uppercase tracking-[0.14em] text-slate-700 dark:text-white`,children:[i(t,{className:`h-3.5 w-3.5 ${n?`text-signal-500`:`text-slate-400`}`,strokeWidth:2.1}),e.label]}),i(`div`,{className:`mt-2 text-xs leading-relaxed text-slate-500 dark:text-slate-400`,children:e.description})]},e.id)})})]}),i(`div`,{"data-composer-stagger":!0,className:`mt-auto flex flex-col gap-3 pt-2`,children:[q&&ce&&be&&i(`div`,{className:`flex w-full flex-col gap-3 rounded-xl border border-signal-500/30 bg-signal-500/[0.06] p-3 dark:bg-signal-500/[0.08] sm:flex-row sm:items-center sm:justify-between`,children:i(`button`,{type:`button`,onClick:()=>le(!1),className:`flex min-w-0 flex-1 items-center gap-3 text-left`,children:[i(e,{children:[i(X,{"aria-hidden":`true`,className:`h-4 w-4 animate-spin text-signal-500`}),i(`span`,{className:`sr-only`,children:`Loading`})]}),i(`div`,{className:`min-w-0`,children:[i(`div`,{className:`text-xs font-bold text-signal-700 dark:text-signal-300`,children:Pr[ye]||`Planning in progress...`}),i(`div`,{className:`mt-0.5 text-[10px] text-signal-600/70 dark:text-signal-400/70`,children:[String(Math.floor(se/6e4)).padStart(2,`0`),`:`,String(Math.floor(se%6e4/1e3)).padStart(2,`0`),` elapsed`]})]})]})}),i(`button`,{type:`submit`,disabled:q,"aria-busy":R,className:`inline-flex items-center justify-center gap-2.5 rounded-[1.2rem] bg-slate-900 px-5 py-3 text-sm font-bold text-white shadow-[0_12px_28px_rgba(15,23,42,0.16)] transition-all hover:-translate-y-px hover:opacity-92 disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white dark:text-void-900`,children:[R?i(e,{children:[i(X,{"aria-hidden":`true`,className:`h-4 w-4 animate-spin`}),i(`span`,{className:`sr-only`,children:`Loading`})]}):i(ve,{className:`h-4 w-4`,strokeWidth:2.3}),R?Pr[K.submitMode]||`Processing...`:K.submitMode===`draft`?K.isEditing?`Save Changes`:`Save Draft`:_e.label]}),i(`button`,{type:`button`,onClick:q?xe:y,className:`rounded-[1.2rem] border px-5 py-3 text-sm font-semibold transition-colors ${q?`border-status-red/30 bg-status-red/[0.06] text-status-red hover:bg-status-red/[0.12]`:`border-black/[0.06] bg-white/66 text-slate-500 hover:text-slate-900 dark:border-white/[0.06] dark:bg-white/[0.02] dark:text-slate-300 dark:hover:text-white`}`,children:q?`Cancel Active Request`:`Cancel`})]})]})]})]})};p();var ei=({mode:e,sprintMarkdown:t=``,tasksMarkdown:n=``,sprintLabel:r,onClose:a,onImport:o})=>{let c=s(null),l=s(null),[u,p]=m(t),[h,g]=m(n),[_,v]=m(null),y=J(),b=s(!1);d(()=>{let e=y?0:Q.backdrop.duration,t=y?0:Q.entry.duration;c.current&&$.killTweensOf(c.current),l.current&&$.killTweensOf(l.current),$.fromTo(c.current,{opacity:0},{opacity:1,duration:e,ease:Q.backdrop.ease}),$.fromTo(l.current,{y:y?0:Q.entry.yStart,opacity:Q.entry.opacityStart,scale:y?1:Q.entry.scaleStart,filter:y?Q.entry.filterEnd:Q.entry.filterStart},{y:Q.entry.yEnd,opacity:Q.entry.opacityEnd,scale:Q.entry.scaleEnd,filter:Q.entry.filterEnd,duration:t,ease:Q.entry.ease,clearProps:`filter`})},[y]);let x=()=>{if(b.current)return;let e=y?0:Q.exit.duration,t=y?0:Q.backdrop.duration;c.current&&$.killTweensOf(c.current),l.current&&$.killTweensOf(l.current),l.current&&$.to(l.current,{y:Q.exit.yEnd,opacity:Q.exit.opacityEnd,scale:Q.exit.scaleEnd,filter:Q.exit.filterEnd,duration:e,ease:Q.exit.ease}),c.current?$.to(c.current,{opacity:0,duration:t,delay:y?0:.05,onComplete:a}):a()};f(()=>{let e=e=>{e.key===`Escape`&&x()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[y,a]);let S=e=>{e.target===c.current&&x()},C=async(e,t)=>{await navigator.clipboard.writeText(t),v(e),window.setTimeout(()=>v(t=>t===e?null:t),1500)},w=async t=>{if(t.preventDefault(),!(e!==`import`||!o)){b.current=!0;try{await o({sprintMarkdown:u,tasksMarkdown:h})}finally{b.current=!1}x()}},T=(e,t)=>{let n=new Blob([t],{type:`text/markdown;charset=utf-8`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=e,i.click(),URL.revokeObjectURL(r)},E=e===`import`?`Import Sprint Markdown.`:`Export ${r||`Sprint`} Markdown.`,D=e===`import`?`Paste structured sprint metadata plus optional task files. Formatting hints are shown inline.`:`Copy the generated sprint and task markdown bundle from the database state.`;return i(`div`,{ref:c,onClick:S,className:`fixed inset-0 z-[220] flex cursor-pointer items-center justify-center px-6 bg-black/55 dark:bg-black/75 backdrop-blur-xl`,children:i(`div`,{ref:l,className:`relative flex flex-col sm:flex-row w-[calc(100vw-2rem)] sm:w-full max-w-5xl max-h-[calc(100dvh-2rem)] cursor-default overflow-hidden sm:overflow-y-auto rounded-[2.5rem] shadow-[0_48px_96px_rgba(0,0,0,0.25)] dark:shadow-[0_48px_96px_rgba(0,0,0,0.7)]`,children:[i(`div`,{className:`relative hidden sm:flex w-56 shrink-0 bg-void-900 dark:bg-void-950 flex-col justify-between p-8 overflow-hidden`,children:[i(`span`,{className:`absolute -top-2 -left-4 text-[7.5rem] font-black text-white/[0.035] font-display leading-none pointer-events-none select-none tracking-tighter`,children:e===`import`?`LOAD`:`SAVE`}),i(`div`,{className:`absolute inset-0 flex items-center justify-center pointer-events-none`,children:[i(`div`,{className:`w-44 h-44 ${e===`import`?`bg-signal-500/[0.08]`:`bg-ember-500/[0.08]`} animate-organic`,style:{borderRadius:`40% 60% 70% 30% / 40% 50% 60% 50%`}}),i(`div`,{className:`absolute w-28 h-28 ${e===`import`?`bg-signal-500/[0.14]`:`bg-ember-500/[0.14]`} animate-organic-reverse`,style:{borderRadius:`40% 60% 70% 30% / 40% 50% 60% 50%`}})]}),i(`div`,{className:`relative z-10 flex items-center gap-2 ${e===`import`?`text-signal-500`:`text-ember-500`} font-mono font-bold text-[10px] tracking-[0.2em] uppercase`,children:[i(e===`import`?L:Cn,{className:`w-3.5 h-3.5`,strokeWidth:2.5}),e===`import`?`Import Markdown`:`Export Markdown`]}),i(`div`,{className:`relative z-10`,children:[i(`div`,{className:`text-[9px] font-bold uppercase tracking-[0.2em] text-white/25 font-mono mb-1.5`,children:`Bundle`}),i(`div`,{className:`text-4xl font-black text-white font-display tracking-tight leading-none`,children:e===`import`?`IN`:`OUT`}),i(`div`,{className:`mt-3 w-8 h-[2px] ${e===`import`?`bg-signal-500/50`:`bg-ember-500/50`}`})]})]}),i(`div`,{className:`flex-1 bg-white/98 dark:bg-void-800/98 p-8 flex flex-col`,children:[i(`div`,{className:`flex items-start justify-between mb-8`,children:[i(`div`,{children:[i(`h2`,{className:`text-[2rem] font-black text-slate-900 dark:text-white tracking-tight font-display leading-none`,children:E}),i(`p`,{className:`text-xs font-medium text-slate-400 mt-2 tracking-wide`,children:D})]}),i(`button`,{onClick:x,"aria-label":`Close dialog`,className:`w-9 h-9 flex items-center justify-center rounded-full bg-black/[0.05] dark:bg-white/[0.05] hover:bg-black/10 dark:hover:bg-white/10 text-slate-400 hover:text-slate-900 dark:hover:text-white transition-all shrink-0`,children:i(Dt,{"aria-hidden":`true`,className:`w-4 h-4`})})]}),i(`form`,{onSubmit:w,className:`flex flex-col gap-6 flex-1 min-h-0`,children:[e===`import`&&i(`div`,{className:`grid gap-3 md:grid-cols-3`,children:[{icon:Bt,title:`Sprint Fields`,text:"`name`, `number`, `status`, then `goal:` followed by markdown scope."},{icon:je,title:`Task Files`,text:"Separate tasks with `--- FILE: T01.md ---`; dependencies use task keys."},{icon:L,title:`Import Result`,text:`Creates one sprint and preserves task order, dependencies, and merge flags.`}].map(({icon:e,title:t,text:n})=>i(`div`,{className:`rounded-[1.1rem] border border-black/[0.06] bg-black/[0.025] p-4 dark:border-white/[0.07] dark:bg-white/[0.035]`,children:[i(`div`,{className:`flex items-center gap-2 text-[9px] font-bold uppercase tracking-[0.18em] text-signal-600 dark:text-signal-300`,children:[i(e,{className:`h-3.5 w-3.5`,strokeWidth:2.2}),t]}),i(`p`,{className:`mt-2 text-xs leading-relaxed text-slate-500 dark:text-slate-400`,children:n})]},t))}),i(`div`,{className:`grid grid-cols-1 gap-5 flex-1 min-h-0`,children:[i(`div`,{className:`flex flex-col min-h-0`,children:[i(`div`,{className:`flex items-center justify-between mb-2`,children:[i(`label`,{className:`text-[9px] font-bold uppercase tracking-[0.2em] text-slate-400`,children:`Sprint Markdown`}),e===`import`?i(`button`,{type:`button`,onClick:()=>{p([`name: Runtime hardening`,`number: 12`,`status: idle`,`goal:`,`Stabilize the dashboard runtime, reduce noisy retries, and verify the health endpoints.`].join(`
|
|
4
4
|
`)),g([`--- FILE: T01.md ---`,`title: Add request correlation logging`,`depends_on: []`,`is_independent: true`,`merged: false`,`prompt:`,`Objective: add correlation IDs across dashboard routes.`,``,`--- FILE: T02.md ---`,`title: Verify health and readiness endpoints`,`depends_on: ["T01"]`,`is_independent: false`,`merged: false`,`prompt:`,`Objective: add tests for /health and /ready behavior.`].join(`
|