@staff0rd/assist 0.934.3 → 0.934.4

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.
@@ -3875,7 +3875,7 @@ ${t.url}`),n.set("newCwd",r),n),{replace:!0})}var Q$e=E(fe(),1);function klr(e,t
3875
3875
  `)}var Lcr=E(fe(),1);var LWn=()=>!1;function Cge(){return(0,Lcr.useSyncExternalStore)(umt,uie,LWn)}var Mcr=e=>({position:"fixed",bottom:`calc(8px + ${AS})`,right:8,zIndex:3e3,background:Gs.renderHud.background,color:Gs.renderHud.text,font:`11px/1.4 ${e}`,padding:"6px 8px",borderRadius:4,whiteSpace:"pre",cursor:"pointer",userSelect:"none"});var Dcr=E($(),1),MWn=500;function Icr(){let{font:e}=Fn().tokens,t=(0,DY.useRef)(null),r=(0,DY.useRef)(""),n=Cge();return(0,DY.useEffect)(()=>{if(!n)return;let i=new Map(PE),o=performance.now(),a=requestAnimationFrame(function s(){a=requestAnimationFrame(s);let l=performance.now();if(l-o<MWn)return;let u=Acr(PE,i,l-o);i=new Map(PE),o=l,r.current=Pcr(u),t.current&&(t.current.textContent=r.current)});return()=>cancelAnimationFrame(a)},[n]),n?(0,Dcr.jsx)("div",{ref:t,style:Mcr(e.mono),title:"Click to copy",onClick:()=>dze(t.current,r.current),onKeyDown:()=>dze(t.current,r.current)}):null}var aWe=E(fe(),1);var Jur=E(fe(),1);var kge=E(fe(),1);function Ncr(e){let{activity:t,status:r}=e;return(t?.kind==="backlog"&&r!=="done"?t.phaseName:void 0)??e.subtitle}var PB={color:"text.disabled",fontFamily:"fontFamilyMono",fontSize:"0.8125rem",whiteSpace:"nowrap",flexShrink:0};var LB=E($(),1),IWn={...PB,display:"inline-flex",alignItems:"center",gap:.25,borderRadius:.5,px:.25},Ocr={fontSize:"0.875rem"};function DWn(e){let[t=""]=e.split("-");return t===e?e.slice(0,8):t}function Bcr({conversationId:e,collapsed:t,harness:r}){let{copied:n,copy:i}=EL(e);return t?(0,LB.jsxs)(pn,{sx:IWn,onClick:i,title:n?"Copied the full conversation id":`Click to copy the full conversation id ${e}`,children:[DWn(e),n?(0,LB.jsx)(xy,{sx:Ocr}):(0,LB.jsx)(QL,{sx:Ocr})]}):(0,LB.jsx)(Le,{sx:{...PB,userSelect:"all"},title:`${pit(r)} conversation ${e}`,children:e})}var Sk=E($(),1);function Fcr({session:e,collapsed:t}){let{id:r,claudeSessionId:n,harnessSessionId:i}=e,o=n??i,a=kL(kS(e))?nm(e.cwd):"";return(0,Sk.jsxs)(Sk.Fragment,{children:[a&&(0,Sk.jsx)(Le,{sx:{...PB,color:"text.secondary"},title:e.cwd,children:a}),(0,Sk.jsx)(Le,{sx:{...PB,userSelect:"all"},title:`assist session ${r}`,children:`#${r}`}),o&&(0,Sk.jsx)(Bcr,{conversationId:o,collapsed:t,harness:e.harness})]})}var wge=E($(),1),NWn=po`
3876
3876
  0%, 100% { opacity: 1; transform: scale(1); }
3877
3877
  50% { opacity: 0.35; transform: scale(0.8); }
3878
- `,$cr={flexShrink:0,fontSize:"1.68rem",lineHeight:.6},OWn={flexShrink:0,whiteSpace:"nowrap"},BWn={...$cr,animation:`${NWn} 1.4s ease-in-out infinite`,"@media (prefers-reduced-motion: reduce)":{animation:"none"}};function zcr({status:e,label:t=!1}){return t?(0,wge.jsxs)(Le,{variant:"caption",sx:{...OWn,color:Lg[e]},children:["\u25CF ",e]}):(0,wge.jsx)(Le,{variant:"caption",sx:{...e==="waiting"?BWn:$cr,color:Lg[e]},title:e,children:"\u25CF"})}var T0=E($(),1),FWn={flexShrink:0,whiteSpace:"nowrap"},$Wn={display:"flex",alignItems:"center",gap:.25,flexShrink:0};function zWn({session:e}){return yre(e)?(0,T0.jsxs)(ie,{sx:$Wn,children:[(0,T0.jsx)(GL,{ring:!0,title:"verifying"}),(0,T0.jsx)(Le,{variant:"caption",sx:{color:Lg.running},children:"running"})]}):(0,T0.jsx)(zcr,{status:om(e),label:!0})}function Hcr({session:e}){let{restored:t}=e;return(0,T0.jsxs)(T0.Fragment,{children:[(0,T0.jsx)(zWn,{session:e}),t!==void 0&&(0,T0.jsx)(Le,{variant:"caption",sx:{...FWn,color:t?"success.main":"warning.main"},children:t?"restored":"not restored"})]})}var NY=E($(),1),HWn={display:"flex",alignItems:"center",gap:.75,minWidth:0},UWn={color:"text.primary",fontSize:"1.25rem",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function Ucr({session:e}){let t=e.activity?.itemId;return(0,NY.jsxs)(ie,{sx:HWn,children:[t!=null&&(0,NY.jsx)(Tte,{itemId:t,cwd:e.cwd}),(0,NY.jsx)(Le,{variant:"body1",sx:UWn,children:xre(e)})]})}var Ck=E(fe(),1);function Wcr(e,t){let[r,n]=(0,Ck.useState)(0),[i,o]=(0,Ck.useState)(!1),a=(0,Ck.useRef)(0);return(0,Ck.useEffect)(()=>{let s=e.current;if(!s||typeof ResizeObserver>"u")return;let l=new ResizeObserver(()=>n(s.scrollWidth));return l.observe(s),()=>l.disconnect()},[e]),(0,Ck.useEffect)(()=>{i||(a.current=r),t!==null&&a.current>0&&o(a.current>t)},[i,r,t]),{width:r,collapsed:i}}var wk=E($(),1),WWn={display:"flex",flexDirection:"column",flexGrow:1,flexShrink:1,flexBasis:0,overflow:"hidden"},GWn={display:"flex",alignItems:"center",alignSelf:"flex-start",gap:1},VWn={color:"text.secondary",fontSize:"0.875rem",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function Gcr({session:e,minWidth:t,budget:r,onIdentityWidth:n}){let i=(0,kge.useRef)(null),{width:o,collapsed:a}=Wcr(i,r),s=Ncr(e);return(0,kge.useEffect)(()=>n(o),[o,n]),(0,wk.jsxs)(ie,{sx:{...WWn,minWidth:`${t}px`},children:[(0,wk.jsxs)(ie,{ref:i,sx:GWn,children:[(0,wk.jsx)(Fcr,{session:e,collapsed:a}),(0,wk.jsx)(Hcr,{session:e})]}),(0,wk.jsx)(Ucr,{session:e}),s&&(0,wk.jsx)(Le,{sx:VWn,children:s})]})}var Kur=E(fe(),1);function MB(e){let{activity:t,status:r}=e;if(!(r==="done"||t?.kind!=="backlog"||t.itemId==null))return{itemId:t.itemId,phase:t.phase,totalPhases:t.totalPhases}}var hze=E($(),1);function Vcr({pr:e}){return e.url?(0,hze.jsx)(Us,{label:"PR",title:"Open PR",icon:(0,hze.jsx)(TL,{sx:{fontSize:14}}),onClick:t=>{t.stopPropagation(),window.open(e.url,"_blank")}}):null}var qcr=E($(),1),jcr=st((0,qcr.jsx)("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m0 14H5.17l-.59.59-.58.58V4h16zm-9.5-2H18v-2h-5.5zm3.86-5.87c.2-.2.2-.51 0-.71l-1.77-1.77c-.2-.2-.51-.2-.71 0L6 11.53V14h2.47z"}),"RateReviewOutlined");var rur=E(fe(),1);var Kcr=E($(),1),qWn=[{label:"Address Comments",args:[]},{label:"Address Comments (batch)",args:["--batch"]},{label:"Address Comments (auto)",args:["--auto"]}];function Ycr({review:e,pick:t}){return qWn.map(({label:r,args:n})=>(0,Kcr.jsx)(ln,{onClick:i=>t(i,()=>e.launchAddressComments(n)),children:r},r))}var kk=E($(),1);function Xcr({anchorEl:e,onClose:t,review:r,highLevel:n}){let i=(o,a)=>{o.stopPropagation(),t(),a()};return(0,kk.jsxs)(Bs,{anchorEl:e,open:!!e,onClose:t,onClick:o=>o.stopPropagation(),children:[fge.map(o=>(0,kk.jsx)(ln,{onClick:a=>i(a,n&&o.args.includes("--high-level")?n.run:()=>r.launchMode(o.args)),children:o.label},o.label)),(0,kk.jsx)(Ci,{}),(0,kk.jsx)(pge,{value:r.options,onChange:r.setOptions}),(0,kk.jsx)(Ci,{}),(0,kk.jsx)(Ycr,{review:r,pick:i})]})}function Zcr(e,t){let r=e.pendingPrPreview;return r?.kind==="high-level-review"&&r.prNumber===t}function Qcr(e,t){return e.assistArgs?.[0]==="review"&&e.assistArgs.includes("--high-level")&&wS(e)===t}function Jcr(e,t,r){let{activateSession:n,sendInput:i}=al(),o=Fn().palette.primary.main;if(!e||!Qcr(e,t.number))return;if(Zcr(e,t.number))return{run:()=>{n(e.id),jl(yf("preview",e.id),o)}};let a=r.force?" --force":"";return{run:()=>nh(i,e.id,`/review-high-level ${t.number}${a}`)}}var eur=E(fe(),1);function tur(e,t,r){let{launchAssist:n}=al(),[i,o]=(0,eur.useState)(EY),a={...bB(t),inPlace:!0,launchedFrom:r},s=l=>n(l,e,a);return{options:i,setOptions:o,resetOptions:()=>o(EY),launchMode:l=>s([...l,String(t.number),...dge(i)]),launchAddressComments:l=>s(["review-pr-comments",String(t.number),...l])}}var _k=E($(),1);function nur({cwd:e,pr:t,session:r}){let n=tur(e,t,r?.id),i=Jcr(r,t,n.options),[o,a]=(0,rur.useState)(null);return(0,_k.jsxs)(_k.Fragment,{children:[(0,_k.jsx)(Us,{label:"Review",title:"Review PR",icon:(0,_k.jsx)(jcr,{sx:{fontSize:14}}),onClick:s=>{s.stopPropagation(),n.resetOptions(),a(s.currentTarget)}}),(0,_k.jsx)(Xcr,{anchorEl:o,onClose:()=>a(null),review:n,highLevel:i})]})}var OY=E($(),1),iur=st((0,OY.jsxs)("g",{fillRule:"evenodd",children:[(0,OY.jsx)("path",{d:"M20 3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16H4V5h16z"}),(0,OY.jsx)("path",{d:"M19.41 10.42 17.99 9l-3.17 3.17-1.41-1.42L12 12.16 14.82 15zM5 7h5v2H5zm0 4h5v2H5zm0 4h5v2H5z"})]}),"FactCheckOutlined");var lur=E(fe(),1);var Ek=E($(),1);function our({content:e,onClose:t}){return(0,Ek.jsxs)(Wl,{open:!0,onClose:t,maxWidth:"md",fullWidth:!0,children:[(0,Ek.jsx)(ku,{children:"Review synthesis"}),(0,Ek.jsx)(wu,{dividers:!0,children:(0,Ek.jsx)(Ou,{className:"markdown",sx:{lineHeight:1.7,"& p":{mt:0},"& a":{color:"primary.main"},wordBreak:"break-word"},html:v2(e)})}),(0,Ek.jsx)(cd,{children:(0,Ek.jsx)(Dt,{onClick:t,children:"Close"})})]})}var _ge=E(fe(),1);async function aur(e,t){try{let r=await fetch(qr(`/api/review/synthesis?cwd=${encodeURIComponent(e)}`,t));if(r.status===404)return{status:"absent"};if(!r.ok)return{status:"error"};let n=await r.json();return typeof n.synthesis!="string"?{status:"absent"}:{status:"ready",content:n.synthesis}}catch{return{status:"error"}}}function sur(e,t){let[r,n]=(0,_ge.useState)({status:"loading"}),i=yr();return(0,_ge.useEffect)(()=>{if(!e||!t){n({status:"absent"});return}let o=!1;return n({status:"loading"}),aur(e,i).then(a=>{o||n(a)}),()=>{o=!0}},[e,t,i]),r}var R2=E($(),1);function cur({session:e}){let t=kS(e)==="review",r=sur(e.cwd,t),[n,i]=(0,lur.useState)(!1);return r.status!=="ready"?null:(0,R2.jsxs)(R2.Fragment,{children:[(0,R2.jsx)(Us,{label:"Findings",title:"View review findings",icon:(0,R2.jsx)(iur,{sx:{fontSize:14}}),onClick:o=>{o.stopPropagation(),i(!0)}}),n&&(0,R2.jsx)(ia,{children:(0,R2.jsx)(our,{content:r.content,onClose:()=>i(!1)})})]})}var Rk=E($(),1);function uur({session:e}){let t=sre(e.cwd,wS(e),e.status),r=e.cwd;return(0,Rk.jsxs)(Rk.Fragment,{children:[t&&r&&(0,Rk.jsx)(Vcr,{pr:t}),t&&r&&(0,Rk.jsx)(nur,{cwd:r,pr:t,session:e}),(0,Rk.jsx)(cur,{session:e})]})}var pze=E(fe(),1);var S0=E($(),1);function fur({target:e,cwd:t,onDismiss:r,shortcut:n}){let{itemId:i,phase:o,totalPhases:a}=e,[s,l]=(0,pze.useState)(!1),[u,f]=(0,pze.useState)(null),d=async()=>{try{await IL(i,"done",t),l(!1),r()}catch{f(`Failed to mark item ${ao(i)} as done`)}};return(0,S0.jsxs)(S0.Fragment,{children:[(0,S0.jsx)(Us,{label:"Done",title:"Mark done",shortcut:n,icon:(0,S0.jsx)(xy,{sx:{fontSize:16}}),onClick:h=>{h.stopPropagation(),l(!0)}}),s&&(0,S0.jsx)(ia,{children:(0,S0.jsx)(bi,{title:`Mark ${ao(i)} done`,message:`${o??0} of ${a??0} phases completed. Mark this backlog item as done and end its session?`,confirmLabel:"Mark done",onConfirm:d,onCancel:()=>l(!1)})}),(0,S0.jsx)(ia,{children:(0,S0.jsx)(Xl,{error:u,onClose:()=>f(null)})})]})}var dur=E($(),1),Ege=st((0,dur.jsx)("path",{d:"M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8"}),"Replay");var mze=E($(),1);function hur({id:e,onRetry:t,shortcut:r}){return(0,mze.jsx)(Us,{label:"Retry",title:`Retry session ${e}`,shortcut:r,icon:(0,mze.jsx)(Ege,{sx:{fontSize:14}}),onClick:n=>{n.stopPropagation(),t()}})}var gze=E($(),1);function pur({runName:e,cwd:t,launchedFrom:r}){let{onStart:n}=HL();return(0,gze.jsx)(Us,{label:e,title:`Start ${e}`,tone:"start",icon:(0,gze.jsx)(Ag,{sx:{fontSize:16}}),onClick:i=>{i.stopPropagation(),n(e,t,void 0,r)}})}var Pge=E(fe(),1);var Rge={textTransform:"none",fontSize:11,justifyContent:"space-between",maxWidth:"100%",overflow:"hidden"};var IB=E($(),1),jWn={[`& .${Hn.lastButton}`]:{minWidth:0,px:.25}};function mur({label:e,open:t,onClick:r,onDefaultAction:n,disabled:i=!1}){let o=t?PS:bd,a=typeof e=="string"?`${e} options`:"options";return(0,IB.jsxs)(MT,{size:"small",variant:"outlined",disabled:i,sx:jWn,children:[(0,IB.jsx)(Dt,{disabled:i,onClick:n,sx:{...Rge,justifyContent:"center"},children:e}),(0,IB.jsx)(Dt,{disabled:i,onClick:r,"aria-label":a,title:a,"aria-haspopup":"true","aria-expanded":t,children:(0,IB.jsx)(o,{sx:{fontSize:18}})})]})}var DB=E($(),1);function Age({label:e,open:t,onClick:r,onDefaultAction:n,disabled:i=!1,tooltip:o}){if(n)return(0,DB.jsx)(mur,{label:e,open:t,onClick:r,onDefaultAction:n,disabled:i});let a=(0,DB.jsx)(Dt,{size:"small",variant:"outlined",disabled:i,onClick:r,"aria-haspopup":"true","aria-expanded":t,endIcon:t?(0,DB.jsx)(PS,{}):(0,DB.jsx)(bd,{}),sx:Rge,fullWidth:!0,children:e});return o?(0,DB.jsx)(lr,{describeChild:!0,title:o,children:a}):a}var WR=E($(),1);function Lge({runs:e,onSelect:t}){let[r,n]=(0,Pge.useState)(!1),i=(0,Pge.useRef)(null),o=()=>n(!1);return(0,WR.jsxs)(tn,{ref:i,variant:"outlined",sx:{display:"inline-flex",border:"none"},children:[(0,WR.jsx)(Age,{label:"server",open:r,onClick:()=>n(!r)}),(0,WR.jsx)(Bs,{anchorEl:i.current,open:r,onClose:o,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{width:200,maxHeight:200}},list:{dense:!0,disablePadding:!0}},children:e.map(a=>(0,WR.jsx)(ln,{onClick:()=>{o(),t(a.name)},sx:{py:.75},children:(0,WR.jsx)(Le,{sx:{fontSize:13},children:a.name})},a.name))})]})}var Mge=E(fe(),1);function Ige(e){let[t,r]=(0,Mge.useState)([]),n=yr();return(0,Mge.useEffect)(()=>{if(!e){r([]);return}let i=!1;return fetch(qr(`/api/server-runs?cwd=${encodeURIComponent(e)}`,n)).then(o=>o.json()).then(o=>{i||r(Array.isArray(o?.runs)?o.runs:[])}).catch(()=>{i||r([])}),()=>{i=!0}},[e,n]),t}var GR=E($(),1);function gur({session:e}){let t=Ige(e.cwd),{onStart:r}=HL();return t.length>2?(0,GR.jsx)(ia,{children:(0,GR.jsx)(Lge,{runs:t,onSelect:n=>r(n,e.cwd,void 0,e.id)})}):(0,GR.jsx)(GR.Fragment,{children:t.map(n=>(0,GR.jsx)(pur,{runName:n.name,cwd:e.cwd,launchedFrom:e.id},n.name))})}var yur=E($(),1),Dge=st((0,yur.jsx)("path",{d:"M12 17.27 18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"}),"Star");var vur=E($(),1),Nge=st((0,vur.jsx)("path",{d:"m22 9.24-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28z"}),"StarBorder");var Oge=E($(),1);function bur({session:e}){let{isStarred:t,toggleStar:r}=uy(),n=t(e);return(0,Oge.jsx)(Us,{label:n?"Unstar":"Star",title:n?"Unstar":"Star",tone:n?"starred":"muted",pressed:n,icon:n?(0,Oge.jsx)(Dge,{sx:{fontSize:16}}):(0,Oge.jsx)(Nge,{sx:{fontSize:16}}),onClick:i=>{i.stopPropagation(),r(e)}})}var xur=E($(),1),Tur=st((0,xur.jsx)("path",{d:"M22 9V7h-2v2h-2v2h2v2h2v-2h2V9zM8 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m0-6c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2m0 7c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4m6 5H2v-.99C2.2 16.29 5.3 15 8 15s5.8 1.29 6 2zM12.51 4.05C13.43 5.11 14 6.49 14 8s-.57 2.89-1.49 3.95C14.47 11.7 16 10.04 16 8s-1.53-3.7-3.49-3.95m4.02 9.78C17.42 14.66 18 15.7 18 17v3h2v-3c0-1.45-1.59-2.51-3.47-3.17"}),"GroupAddOutlined");var vze=E(fe(),1);function Sur(e){return e.joinable===!0}var Cur={"assist-draft":["draft","--once"],"assist-bug":["bug","--once"],"assist-refine":["refine","--once"]};function YWn(e){return e in Cur}function KWn(e,t){let r=[...Cur[e]],n=t?.trim();return n&&r.push(n),r}function wur(e,t,r,n,i){if(YWn(e)&&t){r(KWn(e,i),t);return}n(e)}var Bge="Enter prompt...";function A2(e){e.key==="Enter"&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),e.currentTarget.closest("form")?.requestSubmit())}var Eur=E(fe(),1);var yze=E(fe(),1);function kur(e){return e.ctrlKey||e.altKey||e.metaKey?!1:e.key.length===1&&e.key!==" "}function _ur(e,t){let[r,n]=(0,yze.useState)(!1),[i,o]=(0,yze.useState)("");return{open:r,initialFilter:i,onKeyDown:l=>{!e||r||t||kur(l)&&(l.preventDefault(),o(l.key),n(!0))},toggle:()=>{o(""),n(!r)},close:()=>n(!1)}}var $ge=E($(),1),NB={position:"absolute",top:"100%",left:0,right:0,mt:.25,maxHeight:200,overflowY:"auto",zIndex:10};function Fge({label:e,children:t,disabled:r=!1,onDefaultAction:n,tooltip:i,typeToOpen:o=!1}){let{open:a,initialFilter:s,onKeyDown:l,toggle:u,close:f}=_ur(o,r),d=(0,Eur.useRef)(null);return(0,$ge.jsxs)(tn,{component:"fieldset",ref:d,variant:"outlined",sx:{position:"relative",border:"none",m:0,p:0},onBlur:h=>{d.current?.contains(h.relatedTarget)||f()},onKeyDown:l,children:[(0,$ge.jsx)(Age,{label:e,open:a,disabled:r,onClick:u,onDefaultAction:n,tooltip:i}),a&&t(f,s)]})}function Rur(e){return e?{width:320}:{...NB,left:"auto",width:320}}var VR=E($(),1);function Aur({value:e,onChange:t,onSubmit:r,header:n,anchored:i=!1}){return(0,VR.jsx)(tn,{elevation:i?0:4,sx:Rur(i),children:(0,VR.jsxs)(Rt,{component:"form",spacing:1,sx:{p:1},onSubmit:o=>{o.preventDefault(),r()},children:[n,(0,VR.jsxs)(Rt,{direction:"row",spacing:1,sx:{alignItems:"flex-start"},children:[(0,VR.jsx)(Jn,{value:e,onChange:o=>t(o.target.value),onKeyDown:A2,placeholder:Bge,size:"small",autoFocus:!0,fullWidth:!0,multiline:!0,maxRows:7,slotProps:{input:{sx:{fontSize:13}}}}),(0,VR.jsx)(Dt,{type:"submit",variant:"contained",size:"small",sx:{whiteSpace:"nowrap"},children:"Start"})]})]})})}var P2=E($(),1);function Pur({session:e,shortcut:t}){let{launchAgentInStream:r}=al(),[n,i]=(0,vze.useState)(null),[o,a]=(0,vze.useState)("");return Sur(e)?(0,P2.jsxs)(P2.Fragment,{children:[(0,P2.jsx)(Us,{label:"Add agent",title:"Add another agent to this session's workspace",ariaLabel:"add agent",shortcut:t,icon:(0,P2.jsx)(Tur,{sx:{fontSize:14}}),onClick:s=>{s.stopPropagation(),i(s.currentTarget)}}),(0,P2.jsx)(Up,{anchorEl:n,open:!!n,onClose:()=>i(null),onClick:s=>s.stopPropagation(),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:(0,P2.jsx)(Aur,{anchored:!0,value:o,onChange:a,onSubmit:()=>{r(e.id,o,e.cwd),a(""),i(null)}})})]}):null}var Dur=E(fe(),1);var Lur="Failed to open VS Code";async function Mur(e,t){try{let r=await fetch(qr(`/api/open-in-code?cwd=${encodeURIComponent(e)}`,t),{method:"POST"});return r.ok?null:(await r.json().catch(()=>null))?.error??Lur}catch{return Lur}}var bze=E($(),1);function Iur(e){return(0,bze.jsx)(M6,{viewBox:"-3 -3 30 30",...e,children:(0,bze.jsx)("path",{d:"M23.15 2.587L18.21.21a1.494 1.494 0 0 0-1.705.29l-9.46 8.63-4.12-3.128a.999.999 0 0 0-1.276.057L.327 7.261A1 1 0 0 0 .326 8.74L3.899 12 .326 15.26a1 1 0 0 0 .001 1.479L1.65 17.94a.999.999 0 0 0 1.276.057l4.12-3.128 9.46 8.63a1.492 1.492 0 0 0 1.704.29l4.942-2.377A1.5 1.5 0 0 0 24 20.06V3.939a1.5 1.5 0 0 0-.85-1.352zm-5.146 14.861L10.826 12l7.178-5.448v10.896z"})})}var Q1=E($(),1);function zge({cwd:e,variant:t="toolbar",shortcut:r}){let[n,i]=(0,Dur.useState)(null),o=t==="card",a=yr(),s=(0,Q1.jsx)(Us,{label:"VS Code",title:r?"Open in VS Code":void 0,ariaLabel:"Open in VS Code",tone:o?"muted":"inherit",size:o?"small":"medium",disabled:!e,shortcut:r,icon:(0,Q1.jsx)(Iur,{sx:o?{fontSize:14}:void 0}),onClick:l=>{l.stopPropagation(),Mur(e,a).then(u=>u&&i(u))}});return(0,Q1.jsxs)(Q1.Fragment,{children:[r?s:(0,Q1.jsx)(lr,{title:"Open in VS Code",children:(0,Q1.jsx)("span",{children:s})}),(0,Q1.jsx)(Xl,{error:n,onClose:()=>i(null)})]})}var qR=E($(),1);function Nur({session:e}){return(0,qR.jsxs)(qR.Fragment,{children:[(0,qR.jsx)(Pur,{session:e,shortcut:"focusAddAgent"}),e.cwd&&(0,qR.jsx)(zge,{cwd:e.cwd,variant:"card",shortcut:e.commandType==="run"?void 0:"focusVsCode"})]})}var Ym=E($(),1);function Our({session:e,onRetry:t,onRestart:r,onDismiss:n}){let i=e.status==="stopped"||e.closing===!0,o=MB(e);return(0,Ym.jsxs)(Ym.Fragment,{children:[(0,Ym.jsx)(gur,{session:e}),(0,Ym.jsx)(Nur,{session:e}),(0,Ym.jsx)(uur,{session:e}),r&&!i&&(0,Ym.jsx)(gre,{id:e.id,onRestart:r,harness:e.harness}),t&&(0,Ym.jsx)(hur,{id:e.id,onRetry:t,shortcut:e.commandType==="run"?"focusVsCode":void 0}),(0,Ym.jsx)(bur,{session:e}),o&&(0,Ym.jsx)(fur,{target:o,cwd:e.cwd,onDismiss:n,shortcut:"focusDone"})]})}var Fur=E($(),1);function Bur({session:e}){return e.cwd?(0,Fur.jsx)(nre,{panelSessionId:e.id,cwd:e.cwd,sessionId:e.claudeSessionId,offerBranchDiff:!0,toggleChordHint:!0}):null}var xze=E($(),1),XWn={display:"flex",flexShrink:0};function $ur({session:e,onDismiss:t,childDismiss:r}){let{status:n,id:i}=e;return n==="stopped"||e.closing?null:(0,xze.jsx)(ie,{sx:XWn,children:(0,xze.jsx)(fre,{id:i,status:n,onDismiss:t,childDismiss:r})})}var Hge=E(fe(),1);function zur(e=0,t=null){let[,r]=(0,Hge.useState)(0);(0,Hge.useEffect)(()=>{if(t==null)return;let s=setInterval(()=>r(l=>l+1),1e3);return()=>clearInterval(s)},[t]);let n=t==null?e:e+(Date.now()-t),i=Math.floor(n/1e3),o=Math.floor(i/60),a=i%60;return o>=60?`${Math.floor(o/60)}h ${o%60}m`:o>0?`${o}m ${a}s`:`${a}s`}var Uur=E($(),1);function Hur({session:e}){let t=zur(e.runningMs,e.runningSince);return(0,Uur.jsx)(Le,{variant:"caption",sx:{flexShrink:0,whiteSpace:"nowrap",color:"text.disabled"},children:t})}var Uge=E($(),1);function Wur({label:e,checked:t,onChange:r,inline:n=!1}){return(0,Uge.jsx)(ia,{children:(0,Uge.jsx)(S5,{sx:n?{m:0,flexShrink:0}:{m:0,mt:.5},control:(0,Uge.jsx)(Uz,{size:"small",checked:t,onChange:i=>r(i.target.checked)}),label:e,slotProps:{typography:{variant:"caption",color:"text.secondary"}}})})}function Gur(e,t){return e==="autoApprove"?t.onSetAutoApprove:t.onSetAutoAdvance}var BY=E($(),1);function Vur({session:e,onSetAutoApprove:t,onSetAutoAdvance:r}){return(0,BY.jsx)(BY.Fragment,{children:cre(e).map(n=>(0,BY.jsx)(Wur,{inline:!0,label:n.label,checked:n.checked,onChange:Gur(n.key,{onSetAutoApprove:t,onSetAutoAdvance:r})},n.key))})}var Wge=E(fe(),1);function qur(e,t,r){let n=1,i=0;for(let o of e){let a=i===0?o:i+t+o;a>r&&i>0?(n++,i=o):i=a}return n}function jur(e,t,r){if(e.length===0||e.reduce((s,l)=>s+l,0)+t*(e.length-1)<=r)return;let i=qur(e,t,r),o=Math.ceil(Math.max(...e)),a=Math.max(o,Math.floor(r));for(;o<a;){let s=Math.floor((o+a)/2);qur(e,t,s)<=i?a=s:o=s+1}return o+1}function ZWn(e,t){return e.gap===t.gap&&e.widths.length===t.widths.length&&e.widths.every((r,n)=>r===t.widths[n])}function QWn(e){let t=getComputedStyle(e);return e.getBoundingClientRect().width+(Number.parseFloat(t.marginLeft)||0)+(Number.parseFloat(t.marginRight)||0)}function Tze(e){return Array.from(e.children).flatMap(t=>getComputedStyle(t).display==="contents"?Tze(t):[t])}function Yur(e,t){let[r,n]=(0,Wge.useState)({widths:[],gap:0});if((0,Wge.useEffect)(()=>{let i=e.current;if(!i||typeof ResizeObserver>"u")return;let o=()=>{let u={widths:Tze(i).map(QWn),gap:Number.parseFloat(getComputedStyle(i).columnGap)||0};n(f=>ZWn(f,u)?f:u)},a=new ResizeObserver(o),s=()=>{a.disconnect();for(let u of Tze(i))a.observe(u);o()},l=new MutationObserver(s);return l.observe(i,{childList:!0,subtree:!0}),s(),()=>{a.disconnect(),l.disconnect()}},[e]),t!==null)return jur(r.widths,r.gap,t)}var L2=E($(),1),JWn={display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"flex-end",gap:1,flexGrow:0,flexShrink:1,flexBasis:"auto",minWidth:0};function Xur({session:e,labelled:t,available:r,onRetry:n,onRestart:i,onDismiss:o,childDismiss:a,onSetAutoApprove:s,onSetAutoAdvance:l}){let u=(0,Kur.useRef)(null),f=Yur(u,r);return(0,L2.jsxs)(ie,{ref:u,sx:{...JWn,width:f},children:[(0,L2.jsx)(Bur,{session:e}),(0,L2.jsx)(Hur,{session:e}),(0,L2.jsx)(Vur,{session:e,onSetAutoApprove:s,onSetAutoAdvance:l}),(0,L2.jsx)(nwe.Provider,{value:t,children:(0,L2.jsx)(Our,{session:e,onRetry:n,onRestart:i,onDismiss:o})}),(0,L2.jsx)($ur,{session:e,onDismiss:o,childDismiss:a})]})}var Zur=E(fe(),1);var Sze=8,eGn=560,tGn=48,rGn=.5;function Qur(e){let t=cie(e),[r,n]=(0,Zur.useState)(0),i=t===null?r:Math.min(r,Math.max(t-tGn,0));return{floor:i,budget:t===null?null:t*rGn,labelled:t===null||t-i>=eGn,available:t===null?null:t-i-Sze,setIdentityWidth:n}}var FY=E($(),1),nGn={position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:`${Sze}px`,px:1.5,py:.75,borderBottom:1,borderColor:"divider",bgcolor:"background.paper",overflow:"hidden"};function efr({session:e,...t}){let r=(0,Jur.useRef)(null),n=Qur(r);return(0,FY.jsxs)(ie,{ref:r,sx:nGn,"data-top-bar-session-id":e.id,children:[(0,FY.jsx)(Gcr,{session:e,minWidth:n.floor,budget:n.budget,onIdentityWidth:n.setIdentityWidth}),(0,FY.jsx)(Xur,{session:e,labelled:n.labelled,available:n.available,...t})]})}var rfr=E($(),1);function tfr({session:e,sessions:t,lifecycle:r}){let n=Ute(t).find(i=>i.session.id===e.id)?.children??[];return(0,rfr.jsx)(efr,{session:e,...Tre(e,r),childDismiss:Xte(e,n,r.onDismiss),onSetAutoApprove:i=>r.onSetAutoApprove(e.id,i),onSetAutoAdvance:i=>r.onSetAutoAdvance(e.id,i)},e.id)}var Cze=E($(),1),iGn={flexShrink:0};function nfr({session:e,sessions:t,lifecycle:r}){return e===void 0?null:(0,Cze.jsx)(ie,{"data-testid":"session-top-bar",sx:iGn,children:(0,Cze.jsx)(tfr,{session:e,sessions:t,lifecycle:r})})}var wze=E($(),1),ifr={minWidth:0,overflow:"auto",px:1,borderColor:"divider","&:focus":{outline:"none"}},oGn={...ifr,width:"50%",borderLeft:1},aGn={...ifr,width:"100%"};function ofr({sessionId:e,panel:t,sessions:r,sendInput:n}){let{closePanel:i,setPanelScope:o,togglePanelMode:a}=hy();return(0,wze.jsx)(ie,{"data-diff-session-id":e,tabIndex:-1,sx:t.mode==="full"?aGn:oGn,children:(0,wze.jsx)(Wme,{cwd:t.cwd,sessionId:t.claudeSessionId,scope:t.scope,onScopeChange:s=>o(e,s),sessions:r,sendInput:n,mode:t.mode,onToggleMode:()=>a(e),onClose:()=>i(e)})})}var $Y=E($(),1),sGn={display:"flex",flex:1,minHeight:0,overflow:"hidden"};function afr({sessionId:e,sessions:t,sendInput:r,children:n}){let i=hy().panelFor(e);return(0,$Y.jsxs)(ie,{sx:sGn,children:[(0,$Y.jsx)(ie,{sx:{display:i?.mode==="full"?"none":"flex",width:i?"50%":"100%",minWidth:0},children:n}),i&&e!==null&&(0,$Y.jsx)(ofr,{sessionId:e,panel:i,sessions:t,sendInput:r},e)]})}var Gge=E(fe(),1),kze=(0,Gge.createContext)({mode:"half",full:!1});function OB(){return(0,Gge.useContext)(kze)}var bfr=E(fe(),1);function BB(e){return`high-level-check-${e}`}var sfr=E($(),1),lfr=st((0,sfr.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12z"}),"Cancel");var cfr=E($(),1),ufr=st((0,cfr.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"}),"CheckCircle");var Vge=E($(),1);function ffr({check:e,ticked:t,onTick:r}){return e.kind==="manual"?(0,Vge.jsx)(J0,{size:"small",checked:t,onChange:n=>r(n.target.checked),slotProps:{input:{"aria-label":e.title}},sx:{p:.25}}):e.status==="fail"?(0,Vge.jsx)(lfr,{color:"error",fontSize:"small",titleAccess:"fails"}):(0,Vge.jsx)(ufr,{color:"success",fontSize:"small",titleAccess:"passes"})}var jR=E($(),1);function dfr({check:e,failed:t}){return(0,jR.jsxs)(jR.Fragment,{children:[(0,jR.jsx)(Le,{variant:"body2",sx:{fontWeight:600,color:t?"error.main":void 0},children:e.title}),(0,jR.jsx)(Le,{variant:"caption",sx:{display:"block",color:t?"error.main":"text.secondary"},children:t?`Fails: ${e.reason}`:e.reason})]})}var lGn=e=>e.tokens.color.wash.error;function hfr(e){return{scrollMarginTop:`${48}px`,px:2,py:1.25,borderLeft:3,borderColor:e?"error.main":"transparent",bgcolor:e?lGn:void 0}}var Ak=E($(),1);function pfr({check:e,ticked:t,comment:r,detail:n,onTick:i,onComment:o}){let a=e.status==="fail";return(0,Ak.jsx)(ie,{id:BB(e.id),sx:hfr(a),children:(0,Ak.jsxs)(Rt,{direction:"row",spacing:1,sx:{alignItems:"flex-start"},children:[(0,Ak.jsx)(ffr,{check:e,ticked:t,onTick:i}),(0,Ak.jsxs)(ie,{sx:{flex:1,minWidth:0},children:[(0,Ak.jsx)(dfr,{check:e,failed:a}),(0,Ak.jsx)(Jn,{variant:"standard",size:"small",fullWidth:!0,multiline:!0,value:r,onChange:s=>o(s.target.value),placeholder:"Comment (optional)",slotProps:{htmlInput:{"aria-label":`Comment on ${e.title}`}},sx:{mt:.5,"& .MuiInputBase-input":{fontSize:12}}}),n]})]})})}var zY=E($(),1);function Eze({heading:e,checks:t,checklist:r,details:n}){return t.length===0?null:(0,zY.jsxs)(ie,{children:[(0,zY.jsx)(Le,{variant:"overline",sx:{px:2,color:"text.secondary",letterSpacing:1},children:e}),t.map(i=>(0,zY.jsx)(pfr,{check:i,ticked:r.ticked(i.id),comment:r.comment(i.id),detail:n[i.id],onTick:o=>r.onTick(i.id,o),onComment:o=>r.onComment(i.id,o)},i.id))]})}var HY=E($(),1);function cGn(e){return{height:"100%",px:1.5,gap:.75,flexShrink:0,fontSize:12,fontWeight:500,letterSpacing:"0.02857em",textTransform:"uppercase",whiteSpace:"nowrap",color:e?"primary.main":"text.secondary",borderBottom:2,borderColor:e?"primary.main":"transparent","&:hover":{color:e?"primary.main":"text.primary"}}}function uGn(e){return{width:8,height:8,borderRadius:"50%",border:1,borderColor:e?"success.main":"text.disabled",bgcolor:e?"success.main":"transparent"}}var fGn={color:"text.disabled",fontWeight:400,textTransform:"none"};function mfr({label:e,count:t,ticked:r,active:n,onJump:i}){return(0,HY.jsxs)(pn,{onClick:i,"aria-label":`${e}, ${r?"ticked":"not ticked"}`,"aria-current":n?"true":void 0,sx:cGn(n),children:[(0,HY.jsx)(ie,{component:"span",sx:uGn(r)}),e,t&&(0,HY.jsx)(ie,{component:"span",sx:fGn,children:t})]})}function gfr(e){let t=document.getElementById(BB(e));if(!t)return;let r=globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches;t.scrollIntoView?.({block:"start",behavior:r?"auto":"smooth"}),t.querySelector('input[type="checkbox"]')?.focus({preventScroll:!0})}var UY=E($(),1),dGn={position:"sticky",top:0,zIndex:4,flexShrink:0,display:"flex",alignItems:"center",height:40,px:2,overflowX:"auto",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},bgcolor:"background.paper",borderBottom:1,borderColor:"divider"};function yfr({checks:e,ticked:t,counts:r,activeId:n}){let{full:i}=OB();return e.length===0?null:(0,UY.jsxs)(ie,{component:"nav","aria-label":"Judge",sx:dGn,children:[i&&(0,UY.jsx)(Le,{variant:"overline",sx:{mr:1,color:"text.secondary",letterSpacing:1},children:"Judge"}),e.map(o=>(0,UY.jsx)(mfr,{label:o.kind==="manual"&&o.short||o.title,count:r[o.id],ticked:t(o.id),active:o.id===n,onJump:()=>gfr(o.id)},o.id))]})}var qge=E(fe(),1);function hGn(e){let{scrollTop:t,scrollHeight:r,clientHeight:n}=e;return r>n&&t+n>=r-1}function pGn(e,t){if(hGn(e))return t.at(-1);let r=e.getBoundingClientRect().top+48+1,n=t[0];for(let i of t){let o=document.getElementById(BB(i));o&&o.getBoundingClientRect().top<=r&&(n=i)}return n}function vfr(e,t){let r=t.join("|"),[n,i]=(0,qge.useState)(t[0]);return(0,qge.useEffect)(()=>{let o=e.current;if(!o||!r)return;let a=r.split("|"),s=()=>i(pGn(o,a));return s(),o.addEventListener("scroll",s,{passive:!0}),()=>o.removeEventListener("scroll",s)},[e,r]),n}var FB=E($(),1);function xfr({checks:e,checklist:t,details:r,counts:n}){let i=(0,bfr.useRef)(null),o=e.filter(s=>s.kind==="manual"),a=vfr(i,o.map(s=>s.id));return(0,FB.jsxs)(Rt,{ref:i,spacing:2,sx:{flex:1,minHeight:0,overflowY:"auto",pt:o.length>0?0:2,pb:2},children:[(0,FB.jsx)(yfr,{checks:o,ticked:t.ticked,counts:n,activeId:a}),(0,FB.jsx)(Eze,{heading:"Evaluated for you",checks:e.filter(s=>s.kind==="deterministic"),checklist:t,details:r}),(0,FB.jsx)(Eze,{heading:"Yours to judge",checks:o,checklist:t,details:r})]})}var Cfr=E(fe(),1);async function Tfr(e,t,r){let n=new URLSearchParams({repo:e,sha:t,path:r}),i=await fetch(`/api/github-file?${n}`),o=await i.json().catch(()=>({}));if(!i.ok||typeof o.content!="string")throw new Error(typeof o.error=="string"?o.error:`HTTP ${i.status}`);let a=o.content.split(`
3878
+ `,$cr={flexShrink:0,fontSize:"1.68rem",lineHeight:.6},OWn={flexShrink:0,whiteSpace:"nowrap"},BWn={...$cr,animation:`${NWn} 1.4s ease-in-out infinite`,"@media (prefers-reduced-motion: reduce)":{animation:"none"}};function zcr({status:e,label:t=!1}){return t?(0,wge.jsxs)(Le,{variant:"caption",sx:{...OWn,color:Lg[e]},children:["\u25CF ",e]}):(0,wge.jsx)(Le,{variant:"caption",sx:{...e==="waiting"?BWn:$cr,color:Lg[e]},title:e,children:"\u25CF"})}var T0=E($(),1),FWn={flexShrink:0,whiteSpace:"nowrap"},$Wn={display:"flex",alignItems:"center",gap:.25,flexShrink:0};function zWn({session:e}){return yre(e)?(0,T0.jsxs)(ie,{sx:$Wn,children:[(0,T0.jsx)(GL,{ring:!0,title:"verifying"}),(0,T0.jsx)(Le,{variant:"caption",sx:{color:Lg.running},children:"running"})]}):(0,T0.jsx)(zcr,{status:om(e),label:!0})}function Hcr({session:e}){let{restored:t}=e;return(0,T0.jsxs)(T0.Fragment,{children:[(0,T0.jsx)(zWn,{session:e}),t!==void 0&&(0,T0.jsx)(Le,{variant:"caption",sx:{...FWn,color:t?"success.main":"warning.main"},children:t?"restored":"not restored"})]})}var NY=E($(),1),HWn={display:"flex",alignItems:"center",gap:.75,minWidth:0},UWn={color:"text.primary",fontSize:"1.25rem",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function Ucr({session:e}){let t=e.activity?.itemId;return(0,NY.jsxs)(ie,{sx:HWn,children:[t!=null&&(0,NY.jsx)(Tte,{itemId:t,cwd:e.cwd}),(0,NY.jsx)(Le,{variant:"body1",sx:UWn,children:xre(e)})]})}var Ck=E(fe(),1);function Wcr(e,t){let[r,n]=(0,Ck.useState)(0),[i,o]=(0,Ck.useState)(!1),a=(0,Ck.useRef)(0);return(0,Ck.useEffect)(()=>{let s=e.current;if(!s||typeof ResizeObserver>"u")return;let l=new ResizeObserver(()=>n(s.scrollWidth));return l.observe(s),()=>l.disconnect()},[e]),(0,Ck.useEffect)(()=>{i||(a.current=r),t!==null&&a.current>0&&o(a.current>t)},[i,r,t]),{width:r,collapsed:i}}var wk=E($(),1),WWn={display:"flex",flexDirection:"column",flexGrow:1,flexShrink:1,flexBasis:0,overflow:"hidden"},GWn={display:"flex",alignItems:"center",alignSelf:"flex-start",gap:1},VWn={color:"text.secondary",fontSize:"0.875rem",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function Gcr({session:e,minWidth:t,budget:r,onIdentityWidth:n}){let i=(0,kge.useRef)(null),{width:o,collapsed:a}=Wcr(i,r),s=Ncr(e);return(0,kge.useEffect)(()=>n(o),[o,n]),(0,wk.jsxs)(ie,{sx:{...WWn,minWidth:`${t}px`},children:[(0,wk.jsxs)(ie,{ref:i,sx:GWn,children:[(0,wk.jsx)(Fcr,{session:e,collapsed:a}),(0,wk.jsx)(Hcr,{session:e})]}),(0,wk.jsx)(Ucr,{session:e}),s&&(0,wk.jsx)(Le,{sx:VWn,children:s})]})}var Kur=E(fe(),1);function MB(e){let{activity:t,status:r}=e;if(!(r==="done"||t?.kind!=="backlog"||t.itemId==null))return{itemId:t.itemId,phase:t.phase,totalPhases:t.totalPhases}}var hze=E($(),1);function Vcr({pr:e}){return e.url?(0,hze.jsx)(Us,{label:"PR",title:"Open PR",icon:(0,hze.jsx)(TL,{sx:{fontSize:14}}),onClick:t=>{t.stopPropagation(),window.open(e.url,"_blank")}}):null}var qcr=E($(),1),jcr=st((0,qcr.jsx)("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m0 14H5.17l-.59.59-.58.58V4h16zm-9.5-2H18v-2h-5.5zm3.86-5.87c.2-.2.2-.51 0-.71l-1.77-1.77c-.2-.2-.51-.2-.71 0L6 11.53V14h2.47z"}),"RateReviewOutlined");var rur=E(fe(),1);var Kcr=E($(),1),qWn=[{label:"Address Comments",args:[]},{label:"Address Comments (batch)",args:["--batch"]},{label:"Address Comments (auto)",args:["--auto"]}];function Ycr({review:e,pick:t}){return qWn.map(({label:r,args:n})=>(0,Kcr.jsx)(ln,{onClick:i=>t(i,()=>e.launchAddressComments(n)),children:r},r))}var kk=E($(),1);function Xcr({anchorEl:e,onClose:t,review:r,highLevel:n}){let i=(o,a)=>{o.stopPropagation(),t(),a()};return(0,kk.jsxs)(Bs,{anchorEl:e,open:!!e,onClose:t,onClick:o=>o.stopPropagation(),children:[fge.map(o=>(0,kk.jsx)(ln,{onClick:a=>i(a,n&&o.args.includes("--high-level")?n.run:()=>r.launchMode(o.args)),children:o.label},o.label)),(0,kk.jsx)(Ci,{}),(0,kk.jsx)(pge,{value:r.options,onChange:r.setOptions}),(0,kk.jsx)(Ci,{}),(0,kk.jsx)(Ycr,{review:r,pick:i})]})}function Zcr(e,t){let r=e.pendingPrPreview;return r?.kind==="high-level-review"&&r.prNumber===t}function Qcr(e,t){return e.assistArgs?.[0]==="review"&&e.assistArgs.includes("--high-level")&&wS(e)===t}function Jcr(e,t,r){let{activateSession:n,sendInput:i}=al(),o=Fn().palette.primary.main;if(!e||!Qcr(e,t.number))return;if(Zcr(e,t.number))return{run:()=>{n(e.id),jl(yf("preview",e.id),o)}};let a=r.force?" --force":"";return{run:()=>nh(i,e.id,`/review-high-level ${t.number}${a}`)}}var eur=E(fe(),1);function tur(e,t,r){let{launchAssist:n}=al(),[i,o]=(0,eur.useState)(EY),a={...bB(t),inPlace:!0,launchedFrom:r},s=l=>n(l,e,a);return{options:i,setOptions:o,resetOptions:()=>o(EY),launchMode:l=>s([...l,String(t.number),...dge(i)]),launchAddressComments:l=>s(["review-pr-comments",String(t.number),...l])}}var _k=E($(),1);function nur({cwd:e,pr:t,session:r}){let n=tur(e,t,r?.id),i=Jcr(r,t,n.options),[o,a]=(0,rur.useState)(null);return(0,_k.jsxs)(_k.Fragment,{children:[(0,_k.jsx)(Us,{label:"Review",title:"Review PR",icon:(0,_k.jsx)(jcr,{sx:{fontSize:14}}),onClick:s=>{s.stopPropagation(),n.resetOptions(),a(s.currentTarget)}}),(0,_k.jsx)(Xcr,{anchorEl:o,onClose:()=>a(null),review:n,highLevel:i})]})}var OY=E($(),1),iur=st((0,OY.jsxs)("g",{fillRule:"evenodd",children:[(0,OY.jsx)("path",{d:"M20 3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16H4V5h16z"}),(0,OY.jsx)("path",{d:"M19.41 10.42 17.99 9l-3.17 3.17-1.41-1.42L12 12.16 14.82 15zM5 7h5v2H5zm0 4h5v2H5zm0 4h5v2H5z"})]}),"FactCheckOutlined");var lur=E(fe(),1);var Ek=E($(),1);function our({content:e,onClose:t}){return(0,Ek.jsxs)(Wl,{open:!0,onClose:t,maxWidth:"md",fullWidth:!0,children:[(0,Ek.jsx)(ku,{children:"Review synthesis"}),(0,Ek.jsx)(wu,{dividers:!0,children:(0,Ek.jsx)(Ou,{className:"markdown",sx:{lineHeight:1.7,"& p":{mt:0},"& a":{color:"primary.main"},wordBreak:"break-word"},html:v2(e)})}),(0,Ek.jsx)(cd,{children:(0,Ek.jsx)(Dt,{onClick:t,children:"Close"})})]})}var _ge=E(fe(),1);async function aur(e,t){try{let r=await fetch(qr(`/api/review/synthesis?cwd=${encodeURIComponent(e)}`,t));if(r.status===404)return{status:"absent"};if(!r.ok)return{status:"error"};let n=await r.json();return typeof n.synthesis!="string"?{status:"absent"}:{status:"ready",content:n.synthesis}}catch{return{status:"error"}}}function sur(e,t){let[r,n]=(0,_ge.useState)({status:"loading"}),i=yr();return(0,_ge.useEffect)(()=>{if(!e||!t){n({status:"absent"});return}let o=!1;return n({status:"loading"}),aur(e,i).then(a=>{o||n(a)}),()=>{o=!0}},[e,t,i]),r}var R2=E($(),1);function cur({session:e}){let t=kS(e)==="review",r=sur(e.cwd,t),[n,i]=(0,lur.useState)(!1);return r.status!=="ready"?null:(0,R2.jsxs)(R2.Fragment,{children:[(0,R2.jsx)(Us,{label:"Findings",title:"View review findings",icon:(0,R2.jsx)(iur,{sx:{fontSize:14}}),onClick:o=>{o.stopPropagation(),i(!0)}}),n&&(0,R2.jsx)(ia,{children:(0,R2.jsx)(our,{content:r.content,onClose:()=>i(!1)})})]})}var Rk=E($(),1);function uur({session:e}){let t=sre(e.cwd,wS(e),e.status),r=e.cwd;return(0,Rk.jsxs)(Rk.Fragment,{children:[t&&r&&(0,Rk.jsx)(Vcr,{pr:t}),t&&r&&(0,Rk.jsx)(nur,{cwd:r,pr:t,session:e}),(0,Rk.jsx)(cur,{session:e})]})}var pze=E(fe(),1);var S0=E($(),1);function fur({target:e,cwd:t,onDismiss:r,shortcut:n}){let{itemId:i,phase:o,totalPhases:a}=e,[s,l]=(0,pze.useState)(!1),[u,f]=(0,pze.useState)(null),d=async()=>{try{await IL(i,"done",t),l(!1),r()}catch{f(`Failed to mark item ${ao(i)} as done`)}};return(0,S0.jsxs)(S0.Fragment,{children:[(0,S0.jsx)(Us,{label:"Done",title:"Mark done",shortcut:n,icon:(0,S0.jsx)(xy,{sx:{fontSize:16}}),onClick:h=>{h.stopPropagation(),l(!0)}}),s&&(0,S0.jsx)(ia,{children:(0,S0.jsx)(bi,{title:`Mark ${ao(i)} done`,message:`${o??0} of ${a??0} phases completed. Mark this backlog item as done and end its session?`,confirmLabel:"Mark done",autoFocusConfirm:!0,onConfirm:d,onCancel:()=>l(!1)})}),(0,S0.jsx)(ia,{children:(0,S0.jsx)(Xl,{error:u,onClose:()=>f(null)})})]})}var dur=E($(),1),Ege=st((0,dur.jsx)("path",{d:"M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8"}),"Replay");var mze=E($(),1);function hur({id:e,onRetry:t,shortcut:r}){return(0,mze.jsx)(Us,{label:"Retry",title:`Retry session ${e}`,shortcut:r,icon:(0,mze.jsx)(Ege,{sx:{fontSize:14}}),onClick:n=>{n.stopPropagation(),t()}})}var gze=E($(),1);function pur({runName:e,cwd:t,launchedFrom:r}){let{onStart:n}=HL();return(0,gze.jsx)(Us,{label:e,title:`Start ${e}`,tone:"start",icon:(0,gze.jsx)(Ag,{sx:{fontSize:16}}),onClick:i=>{i.stopPropagation(),n(e,t,void 0,r)}})}var Pge=E(fe(),1);var Rge={textTransform:"none",fontSize:11,justifyContent:"space-between",maxWidth:"100%",overflow:"hidden"};var IB=E($(),1),jWn={[`& .${Hn.lastButton}`]:{minWidth:0,px:.25}};function mur({label:e,open:t,onClick:r,onDefaultAction:n,disabled:i=!1}){let o=t?PS:bd,a=typeof e=="string"?`${e} options`:"options";return(0,IB.jsxs)(MT,{size:"small",variant:"outlined",disabled:i,sx:jWn,children:[(0,IB.jsx)(Dt,{disabled:i,onClick:n,sx:{...Rge,justifyContent:"center"},children:e}),(0,IB.jsx)(Dt,{disabled:i,onClick:r,"aria-label":a,title:a,"aria-haspopup":"true","aria-expanded":t,children:(0,IB.jsx)(o,{sx:{fontSize:18}})})]})}var DB=E($(),1);function Age({label:e,open:t,onClick:r,onDefaultAction:n,disabled:i=!1,tooltip:o}){if(n)return(0,DB.jsx)(mur,{label:e,open:t,onClick:r,onDefaultAction:n,disabled:i});let a=(0,DB.jsx)(Dt,{size:"small",variant:"outlined",disabled:i,onClick:r,"aria-haspopup":"true","aria-expanded":t,endIcon:t?(0,DB.jsx)(PS,{}):(0,DB.jsx)(bd,{}),sx:Rge,fullWidth:!0,children:e});return o?(0,DB.jsx)(lr,{describeChild:!0,title:o,children:a}):a}var WR=E($(),1);function Lge({runs:e,onSelect:t}){let[r,n]=(0,Pge.useState)(!1),i=(0,Pge.useRef)(null),o=()=>n(!1);return(0,WR.jsxs)(tn,{ref:i,variant:"outlined",sx:{display:"inline-flex",border:"none"},children:[(0,WR.jsx)(Age,{label:"server",open:r,onClick:()=>n(!r)}),(0,WR.jsx)(Bs,{anchorEl:i.current,open:r,onClose:o,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{width:200,maxHeight:200}},list:{dense:!0,disablePadding:!0}},children:e.map(a=>(0,WR.jsx)(ln,{onClick:()=>{o(),t(a.name)},sx:{py:.75},children:(0,WR.jsx)(Le,{sx:{fontSize:13},children:a.name})},a.name))})]})}var Mge=E(fe(),1);function Ige(e){let[t,r]=(0,Mge.useState)([]),n=yr();return(0,Mge.useEffect)(()=>{if(!e){r([]);return}let i=!1;return fetch(qr(`/api/server-runs?cwd=${encodeURIComponent(e)}`,n)).then(o=>o.json()).then(o=>{i||r(Array.isArray(o?.runs)?o.runs:[])}).catch(()=>{i||r([])}),()=>{i=!0}},[e,n]),t}var GR=E($(),1);function gur({session:e}){let t=Ige(e.cwd),{onStart:r}=HL();return t.length>2?(0,GR.jsx)(ia,{children:(0,GR.jsx)(Lge,{runs:t,onSelect:n=>r(n,e.cwd,void 0,e.id)})}):(0,GR.jsx)(GR.Fragment,{children:t.map(n=>(0,GR.jsx)(pur,{runName:n.name,cwd:e.cwd,launchedFrom:e.id},n.name))})}var yur=E($(),1),Dge=st((0,yur.jsx)("path",{d:"M12 17.27 18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"}),"Star");var vur=E($(),1),Nge=st((0,vur.jsx)("path",{d:"m22 9.24-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28z"}),"StarBorder");var Oge=E($(),1);function bur({session:e}){let{isStarred:t,toggleStar:r}=uy(),n=t(e);return(0,Oge.jsx)(Us,{label:n?"Unstar":"Star",title:n?"Unstar":"Star",tone:n?"starred":"muted",pressed:n,icon:n?(0,Oge.jsx)(Dge,{sx:{fontSize:16}}):(0,Oge.jsx)(Nge,{sx:{fontSize:16}}),onClick:i=>{i.stopPropagation(),r(e)}})}var xur=E($(),1),Tur=st((0,xur.jsx)("path",{d:"M22 9V7h-2v2h-2v2h2v2h2v-2h2V9zM8 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m0-6c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2m0 7c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4m6 5H2v-.99C2.2 16.29 5.3 15 8 15s5.8 1.29 6 2zM12.51 4.05C13.43 5.11 14 6.49 14 8s-.57 2.89-1.49 3.95C14.47 11.7 16 10.04 16 8s-1.53-3.7-3.49-3.95m4.02 9.78C17.42 14.66 18 15.7 18 17v3h2v-3c0-1.45-1.59-2.51-3.47-3.17"}),"GroupAddOutlined");var vze=E(fe(),1);function Sur(e){return e.joinable===!0}var Cur={"assist-draft":["draft","--once"],"assist-bug":["bug","--once"],"assist-refine":["refine","--once"]};function YWn(e){return e in Cur}function KWn(e,t){let r=[...Cur[e]],n=t?.trim();return n&&r.push(n),r}function wur(e,t,r,n,i){if(YWn(e)&&t){r(KWn(e,i),t);return}n(e)}var Bge="Enter prompt...";function A2(e){e.key==="Enter"&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),e.currentTarget.closest("form")?.requestSubmit())}var Eur=E(fe(),1);var yze=E(fe(),1);function kur(e){return e.ctrlKey||e.altKey||e.metaKey?!1:e.key.length===1&&e.key!==" "}function _ur(e,t){let[r,n]=(0,yze.useState)(!1),[i,o]=(0,yze.useState)("");return{open:r,initialFilter:i,onKeyDown:l=>{!e||r||t||kur(l)&&(l.preventDefault(),o(l.key),n(!0))},toggle:()=>{o(""),n(!r)},close:()=>n(!1)}}var $ge=E($(),1),NB={position:"absolute",top:"100%",left:0,right:0,mt:.25,maxHeight:200,overflowY:"auto",zIndex:10};function Fge({label:e,children:t,disabled:r=!1,onDefaultAction:n,tooltip:i,typeToOpen:o=!1}){let{open:a,initialFilter:s,onKeyDown:l,toggle:u,close:f}=_ur(o,r),d=(0,Eur.useRef)(null);return(0,$ge.jsxs)(tn,{component:"fieldset",ref:d,variant:"outlined",sx:{position:"relative",border:"none",m:0,p:0},onBlur:h=>{d.current?.contains(h.relatedTarget)||f()},onKeyDown:l,children:[(0,$ge.jsx)(Age,{label:e,open:a,disabled:r,onClick:u,onDefaultAction:n,tooltip:i}),a&&t(f,s)]})}function Rur(e){return e?{width:320}:{...NB,left:"auto",width:320}}var VR=E($(),1);function Aur({value:e,onChange:t,onSubmit:r,header:n,anchored:i=!1}){return(0,VR.jsx)(tn,{elevation:i?0:4,sx:Rur(i),children:(0,VR.jsxs)(Rt,{component:"form",spacing:1,sx:{p:1},onSubmit:o=>{o.preventDefault(),r()},children:[n,(0,VR.jsxs)(Rt,{direction:"row",spacing:1,sx:{alignItems:"flex-start"},children:[(0,VR.jsx)(Jn,{value:e,onChange:o=>t(o.target.value),onKeyDown:A2,placeholder:Bge,size:"small",autoFocus:!0,fullWidth:!0,multiline:!0,maxRows:7,slotProps:{input:{sx:{fontSize:13}}}}),(0,VR.jsx)(Dt,{type:"submit",variant:"contained",size:"small",sx:{whiteSpace:"nowrap"},children:"Start"})]})]})})}var P2=E($(),1);function Pur({session:e,shortcut:t}){let{launchAgentInStream:r}=al(),[n,i]=(0,vze.useState)(null),[o,a]=(0,vze.useState)("");return Sur(e)?(0,P2.jsxs)(P2.Fragment,{children:[(0,P2.jsx)(Us,{label:"Add agent",title:"Add another agent to this session's workspace",ariaLabel:"add agent",shortcut:t,icon:(0,P2.jsx)(Tur,{sx:{fontSize:14}}),onClick:s=>{s.stopPropagation(),i(s.currentTarget)}}),(0,P2.jsx)(Up,{anchorEl:n,open:!!n,onClose:()=>i(null),onClick:s=>s.stopPropagation(),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:(0,P2.jsx)(Aur,{anchored:!0,value:o,onChange:a,onSubmit:()=>{r(e.id,o,e.cwd),a(""),i(null)}})})]}):null}var Dur=E(fe(),1);var Lur="Failed to open VS Code";async function Mur(e,t){try{let r=await fetch(qr(`/api/open-in-code?cwd=${encodeURIComponent(e)}`,t),{method:"POST"});return r.ok?null:(await r.json().catch(()=>null))?.error??Lur}catch{return Lur}}var bze=E($(),1);function Iur(e){return(0,bze.jsx)(M6,{viewBox:"-3 -3 30 30",...e,children:(0,bze.jsx)("path",{d:"M23.15 2.587L18.21.21a1.494 1.494 0 0 0-1.705.29l-9.46 8.63-4.12-3.128a.999.999 0 0 0-1.276.057L.327 7.261A1 1 0 0 0 .326 8.74L3.899 12 .326 15.26a1 1 0 0 0 .001 1.479L1.65 17.94a.999.999 0 0 0 1.276.057l4.12-3.128 9.46 8.63a1.492 1.492 0 0 0 1.704.29l4.942-2.377A1.5 1.5 0 0 0 24 20.06V3.939a1.5 1.5 0 0 0-.85-1.352zm-5.146 14.861L10.826 12l7.178-5.448v10.896z"})})}var Q1=E($(),1);function zge({cwd:e,variant:t="toolbar",shortcut:r}){let[n,i]=(0,Dur.useState)(null),o=t==="card",a=yr(),s=(0,Q1.jsx)(Us,{label:"VS Code",title:r?"Open in VS Code":void 0,ariaLabel:"Open in VS Code",tone:o?"muted":"inherit",size:o?"small":"medium",disabled:!e,shortcut:r,icon:(0,Q1.jsx)(Iur,{sx:o?{fontSize:14}:void 0}),onClick:l=>{l.stopPropagation(),Mur(e,a).then(u=>u&&i(u))}});return(0,Q1.jsxs)(Q1.Fragment,{children:[r?s:(0,Q1.jsx)(lr,{title:"Open in VS Code",children:(0,Q1.jsx)("span",{children:s})}),(0,Q1.jsx)(Xl,{error:n,onClose:()=>i(null)})]})}var qR=E($(),1);function Nur({session:e}){return(0,qR.jsxs)(qR.Fragment,{children:[(0,qR.jsx)(Pur,{session:e,shortcut:"focusAddAgent"}),e.cwd&&(0,qR.jsx)(zge,{cwd:e.cwd,variant:"card",shortcut:e.commandType==="run"?void 0:"focusVsCode"})]})}var Ym=E($(),1);function Our({session:e,onRetry:t,onRestart:r,onDismiss:n}){let i=e.status==="stopped"||e.closing===!0,o=MB(e);return(0,Ym.jsxs)(Ym.Fragment,{children:[(0,Ym.jsx)(gur,{session:e}),(0,Ym.jsx)(Nur,{session:e}),(0,Ym.jsx)(uur,{session:e}),r&&!i&&(0,Ym.jsx)(gre,{id:e.id,onRestart:r,harness:e.harness}),t&&(0,Ym.jsx)(hur,{id:e.id,onRetry:t,shortcut:e.commandType==="run"?"focusVsCode":void 0}),(0,Ym.jsx)(bur,{session:e}),o&&(0,Ym.jsx)(fur,{target:o,cwd:e.cwd,onDismiss:n,shortcut:"focusDone"})]})}var Fur=E($(),1);function Bur({session:e}){return e.cwd?(0,Fur.jsx)(nre,{panelSessionId:e.id,cwd:e.cwd,sessionId:e.claudeSessionId,offerBranchDiff:!0,toggleChordHint:!0}):null}var xze=E($(),1),XWn={display:"flex",flexShrink:0};function $ur({session:e,onDismiss:t,childDismiss:r}){let{status:n,id:i}=e;return n==="stopped"||e.closing?null:(0,xze.jsx)(ie,{sx:XWn,children:(0,xze.jsx)(fre,{id:i,status:n,onDismiss:t,childDismiss:r})})}var Hge=E(fe(),1);function zur(e=0,t=null){let[,r]=(0,Hge.useState)(0);(0,Hge.useEffect)(()=>{if(t==null)return;let s=setInterval(()=>r(l=>l+1),1e3);return()=>clearInterval(s)},[t]);let n=t==null?e:e+(Date.now()-t),i=Math.floor(n/1e3),o=Math.floor(i/60),a=i%60;return o>=60?`${Math.floor(o/60)}h ${o%60}m`:o>0?`${o}m ${a}s`:`${a}s`}var Uur=E($(),1);function Hur({session:e}){let t=zur(e.runningMs,e.runningSince);return(0,Uur.jsx)(Le,{variant:"caption",sx:{flexShrink:0,whiteSpace:"nowrap",color:"text.disabled"},children:t})}var Uge=E($(),1);function Wur({label:e,checked:t,onChange:r,inline:n=!1}){return(0,Uge.jsx)(ia,{children:(0,Uge.jsx)(S5,{sx:n?{m:0,flexShrink:0}:{m:0,mt:.5},control:(0,Uge.jsx)(Uz,{size:"small",checked:t,onChange:i=>r(i.target.checked)}),label:e,slotProps:{typography:{variant:"caption",color:"text.secondary"}}})})}function Gur(e,t){return e==="autoApprove"?t.onSetAutoApprove:t.onSetAutoAdvance}var BY=E($(),1);function Vur({session:e,onSetAutoApprove:t,onSetAutoAdvance:r}){return(0,BY.jsx)(BY.Fragment,{children:cre(e).map(n=>(0,BY.jsx)(Wur,{inline:!0,label:n.label,checked:n.checked,onChange:Gur(n.key,{onSetAutoApprove:t,onSetAutoAdvance:r})},n.key))})}var Wge=E(fe(),1);function qur(e,t,r){let n=1,i=0;for(let o of e){let a=i===0?o:i+t+o;a>r&&i>0?(n++,i=o):i=a}return n}function jur(e,t,r){if(e.length===0||e.reduce((s,l)=>s+l,0)+t*(e.length-1)<=r)return;let i=qur(e,t,r),o=Math.ceil(Math.max(...e)),a=Math.max(o,Math.floor(r));for(;o<a;){let s=Math.floor((o+a)/2);qur(e,t,s)<=i?a=s:o=s+1}return o+1}function ZWn(e,t){return e.gap===t.gap&&e.widths.length===t.widths.length&&e.widths.every((r,n)=>r===t.widths[n])}function QWn(e){let t=getComputedStyle(e);return e.getBoundingClientRect().width+(Number.parseFloat(t.marginLeft)||0)+(Number.parseFloat(t.marginRight)||0)}function Tze(e){return Array.from(e.children).flatMap(t=>getComputedStyle(t).display==="contents"?Tze(t):[t])}function Yur(e,t){let[r,n]=(0,Wge.useState)({widths:[],gap:0});if((0,Wge.useEffect)(()=>{let i=e.current;if(!i||typeof ResizeObserver>"u")return;let o=()=>{let u={widths:Tze(i).map(QWn),gap:Number.parseFloat(getComputedStyle(i).columnGap)||0};n(f=>ZWn(f,u)?f:u)},a=new ResizeObserver(o),s=()=>{a.disconnect();for(let u of Tze(i))a.observe(u);o()},l=new MutationObserver(s);return l.observe(i,{childList:!0,subtree:!0}),s(),()=>{a.disconnect(),l.disconnect()}},[e]),t!==null)return jur(r.widths,r.gap,t)}var L2=E($(),1),JWn={display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"flex-end",gap:1,flexGrow:0,flexShrink:1,flexBasis:"auto",minWidth:0};function Xur({session:e,labelled:t,available:r,onRetry:n,onRestart:i,onDismiss:o,childDismiss:a,onSetAutoApprove:s,onSetAutoAdvance:l}){let u=(0,Kur.useRef)(null),f=Yur(u,r);return(0,L2.jsxs)(ie,{ref:u,sx:{...JWn,width:f},children:[(0,L2.jsx)(Bur,{session:e}),(0,L2.jsx)(Hur,{session:e}),(0,L2.jsx)(Vur,{session:e,onSetAutoApprove:s,onSetAutoAdvance:l}),(0,L2.jsx)(nwe.Provider,{value:t,children:(0,L2.jsx)(Our,{session:e,onRetry:n,onRestart:i,onDismiss:o})}),(0,L2.jsx)($ur,{session:e,onDismiss:o,childDismiss:a})]})}var Zur=E(fe(),1);var Sze=8,eGn=560,tGn=48,rGn=.5;function Qur(e){let t=cie(e),[r,n]=(0,Zur.useState)(0),i=t===null?r:Math.min(r,Math.max(t-tGn,0));return{floor:i,budget:t===null?null:t*rGn,labelled:t===null||t-i>=eGn,available:t===null?null:t-i-Sze,setIdentityWidth:n}}var FY=E($(),1),nGn={position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:`${Sze}px`,px:1.5,py:.75,borderBottom:1,borderColor:"divider",bgcolor:"background.paper",overflow:"hidden"};function efr({session:e,...t}){let r=(0,Jur.useRef)(null),n=Qur(r);return(0,FY.jsxs)(ie,{ref:r,sx:nGn,"data-top-bar-session-id":e.id,children:[(0,FY.jsx)(Gcr,{session:e,minWidth:n.floor,budget:n.budget,onIdentityWidth:n.setIdentityWidth}),(0,FY.jsx)(Xur,{session:e,labelled:n.labelled,available:n.available,...t})]})}var rfr=E($(),1);function tfr({session:e,sessions:t,lifecycle:r}){let n=Ute(t).find(i=>i.session.id===e.id)?.children??[];return(0,rfr.jsx)(efr,{session:e,...Tre(e,r),childDismiss:Xte(e,n,r.onDismiss),onSetAutoApprove:i=>r.onSetAutoApprove(e.id,i),onSetAutoAdvance:i=>r.onSetAutoAdvance(e.id,i)},e.id)}var Cze=E($(),1),iGn={flexShrink:0};function nfr({session:e,sessions:t,lifecycle:r}){return e===void 0?null:(0,Cze.jsx)(ie,{"data-testid":"session-top-bar",sx:iGn,children:(0,Cze.jsx)(tfr,{session:e,sessions:t,lifecycle:r})})}var wze=E($(),1),ifr={minWidth:0,overflow:"auto",px:1,borderColor:"divider","&:focus":{outline:"none"}},oGn={...ifr,width:"50%",borderLeft:1},aGn={...ifr,width:"100%"};function ofr({sessionId:e,panel:t,sessions:r,sendInput:n}){let{closePanel:i,setPanelScope:o,togglePanelMode:a}=hy();return(0,wze.jsx)(ie,{"data-diff-session-id":e,tabIndex:-1,sx:t.mode==="full"?aGn:oGn,children:(0,wze.jsx)(Wme,{cwd:t.cwd,sessionId:t.claudeSessionId,scope:t.scope,onScopeChange:s=>o(e,s),sessions:r,sendInput:n,mode:t.mode,onToggleMode:()=>a(e),onClose:()=>i(e)})})}var $Y=E($(),1),sGn={display:"flex",flex:1,minHeight:0,overflow:"hidden"};function afr({sessionId:e,sessions:t,sendInput:r,children:n}){let i=hy().panelFor(e);return(0,$Y.jsxs)(ie,{sx:sGn,children:[(0,$Y.jsx)(ie,{sx:{display:i?.mode==="full"?"none":"flex",width:i?"50%":"100%",minWidth:0},children:n}),i&&e!==null&&(0,$Y.jsx)(ofr,{sessionId:e,panel:i,sessions:t,sendInput:r},e)]})}var Gge=E(fe(),1),kze=(0,Gge.createContext)({mode:"half",full:!1});function OB(){return(0,Gge.useContext)(kze)}var bfr=E(fe(),1);function BB(e){return`high-level-check-${e}`}var sfr=E($(),1),lfr=st((0,sfr.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12z"}),"Cancel");var cfr=E($(),1),ufr=st((0,cfr.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"}),"CheckCircle");var Vge=E($(),1);function ffr({check:e,ticked:t,onTick:r}){return e.kind==="manual"?(0,Vge.jsx)(J0,{size:"small",checked:t,onChange:n=>r(n.target.checked),slotProps:{input:{"aria-label":e.title}},sx:{p:.25}}):e.status==="fail"?(0,Vge.jsx)(lfr,{color:"error",fontSize:"small",titleAccess:"fails"}):(0,Vge.jsx)(ufr,{color:"success",fontSize:"small",titleAccess:"passes"})}var jR=E($(),1);function dfr({check:e,failed:t}){return(0,jR.jsxs)(jR.Fragment,{children:[(0,jR.jsx)(Le,{variant:"body2",sx:{fontWeight:600,color:t?"error.main":void 0},children:e.title}),(0,jR.jsx)(Le,{variant:"caption",sx:{display:"block",color:t?"error.main":"text.secondary"},children:t?`Fails: ${e.reason}`:e.reason})]})}var lGn=e=>e.tokens.color.wash.error;function hfr(e){return{scrollMarginTop:`${48}px`,px:2,py:1.25,borderLeft:3,borderColor:e?"error.main":"transparent",bgcolor:e?lGn:void 0}}var Ak=E($(),1);function pfr({check:e,ticked:t,comment:r,detail:n,onTick:i,onComment:o}){let a=e.status==="fail";return(0,Ak.jsx)(ie,{id:BB(e.id),sx:hfr(a),children:(0,Ak.jsxs)(Rt,{direction:"row",spacing:1,sx:{alignItems:"flex-start"},children:[(0,Ak.jsx)(ffr,{check:e,ticked:t,onTick:i}),(0,Ak.jsxs)(ie,{sx:{flex:1,minWidth:0},children:[(0,Ak.jsx)(dfr,{check:e,failed:a}),(0,Ak.jsx)(Jn,{variant:"standard",size:"small",fullWidth:!0,multiline:!0,value:r,onChange:s=>o(s.target.value),placeholder:"Comment (optional)",slotProps:{htmlInput:{"aria-label":`Comment on ${e.title}`}},sx:{mt:.5,"& .MuiInputBase-input":{fontSize:12}}}),n]})]})})}var zY=E($(),1);function Eze({heading:e,checks:t,checklist:r,details:n}){return t.length===0?null:(0,zY.jsxs)(ie,{children:[(0,zY.jsx)(Le,{variant:"overline",sx:{px:2,color:"text.secondary",letterSpacing:1},children:e}),t.map(i=>(0,zY.jsx)(pfr,{check:i,ticked:r.ticked(i.id),comment:r.comment(i.id),detail:n[i.id],onTick:o=>r.onTick(i.id,o),onComment:o=>r.onComment(i.id,o)},i.id))]})}var HY=E($(),1);function cGn(e){return{height:"100%",px:1.5,gap:.75,flexShrink:0,fontSize:12,fontWeight:500,letterSpacing:"0.02857em",textTransform:"uppercase",whiteSpace:"nowrap",color:e?"primary.main":"text.secondary",borderBottom:2,borderColor:e?"primary.main":"transparent","&:hover":{color:e?"primary.main":"text.primary"}}}function uGn(e){return{width:8,height:8,borderRadius:"50%",border:1,borderColor:e?"success.main":"text.disabled",bgcolor:e?"success.main":"transparent"}}var fGn={color:"text.disabled",fontWeight:400,textTransform:"none"};function mfr({label:e,count:t,ticked:r,active:n,onJump:i}){return(0,HY.jsxs)(pn,{onClick:i,"aria-label":`${e}, ${r?"ticked":"not ticked"}`,"aria-current":n?"true":void 0,sx:cGn(n),children:[(0,HY.jsx)(ie,{component:"span",sx:uGn(r)}),e,t&&(0,HY.jsx)(ie,{component:"span",sx:fGn,children:t})]})}function gfr(e){let t=document.getElementById(BB(e));if(!t)return;let r=globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches;t.scrollIntoView?.({block:"start",behavior:r?"auto":"smooth"}),t.querySelector('input[type="checkbox"]')?.focus({preventScroll:!0})}var UY=E($(),1),dGn={position:"sticky",top:0,zIndex:4,flexShrink:0,display:"flex",alignItems:"center",height:40,px:2,overflowX:"auto",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},bgcolor:"background.paper",borderBottom:1,borderColor:"divider"};function yfr({checks:e,ticked:t,counts:r,activeId:n}){let{full:i}=OB();return e.length===0?null:(0,UY.jsxs)(ie,{component:"nav","aria-label":"Judge",sx:dGn,children:[i&&(0,UY.jsx)(Le,{variant:"overline",sx:{mr:1,color:"text.secondary",letterSpacing:1},children:"Judge"}),e.map(o=>(0,UY.jsx)(mfr,{label:o.kind==="manual"&&o.short||o.title,count:r[o.id],ticked:t(o.id),active:o.id===n,onJump:()=>gfr(o.id)},o.id))]})}var qge=E(fe(),1);function hGn(e){let{scrollTop:t,scrollHeight:r,clientHeight:n}=e;return r>n&&t+n>=r-1}function pGn(e,t){if(hGn(e))return t.at(-1);let r=e.getBoundingClientRect().top+48+1,n=t[0];for(let i of t){let o=document.getElementById(BB(i));o&&o.getBoundingClientRect().top<=r&&(n=i)}return n}function vfr(e,t){let r=t.join("|"),[n,i]=(0,qge.useState)(t[0]);return(0,qge.useEffect)(()=>{let o=e.current;if(!o||!r)return;let a=r.split("|"),s=()=>i(pGn(o,a));return s(),o.addEventListener("scroll",s,{passive:!0}),()=>o.removeEventListener("scroll",s)},[e,r]),n}var FB=E($(),1);function xfr({checks:e,checklist:t,details:r,counts:n}){let i=(0,bfr.useRef)(null),o=e.filter(s=>s.kind==="manual"),a=vfr(i,o.map(s=>s.id));return(0,FB.jsxs)(Rt,{ref:i,spacing:2,sx:{flex:1,minHeight:0,overflowY:"auto",pt:o.length>0?0:2,pb:2},children:[(0,FB.jsx)(yfr,{checks:o,ticked:t.ticked,counts:n,activeId:a}),(0,FB.jsx)(Eze,{heading:"Evaluated for you",checks:e.filter(s=>s.kind==="deterministic"),checklist:t,details:r}),(0,FB.jsx)(Eze,{heading:"Yours to judge",checks:o,checklist:t,details:r})]})}var Cfr=E(fe(),1);async function Tfr(e,t,r){let n=new URLSearchParams({repo:e,sha:t,path:r}),i=await fetch(`/api/github-file?${n}`),o=await i.json().catch(()=>({}));if(!i.ok||typeof o.content!="string")throw new Error(typeof o.error=="string"?o.error:`HTTP ${i.status}`);let a=o.content.split(`
3879
3879
  `);return a.at(-1)===""?a.slice(0,-1):a}var Sfr=E(fe(),1),jge=(0,Sfr.createContext)(void 0);var kfr=E($(),1);function mGn(e,t){let r=new Map;return{load:n=>{let i=r.get(n);if(i)return i;let o=Tfr(e,t,n);return r.set(n,o),o.catch(()=>r.delete(n)),o}}}function wfr({repo:e,headSha:t,children:r}){let n=(0,Cfr.useMemo)(()=>e&&t?mGn(e,t):void 0,[e,t]);return(0,kfr.jsx)(jge.Provider,{value:n,children:r})}var Rze=E($(),1);function _fr({payload:e,...t}){return(0,Rze.jsx)(wfr,{repo:e.repo,headSha:e.headSha,children:(0,Rze.jsx)(xfr,{checks:e.checks,...t})})}var Lk=E($(),1);function gGn(e,t){let r=[...e>0?[`${e} deterministic check${e===1?"":"s"} failing`]:[],...t>0?[`${t} manual item${t===1?"":"s"} left to tick`]:[]];return r.length>0?r.join(" \xB7 "):"Every item is accounted for"}function Efr({failed:e,outstanding:t,onApprove:r,onComment:n,onRequestChanges:i,onClose:o}){return(0,Lk.jsxs)(Rt,{direction:"row",spacing:1,sx:{p:2,alignItems:"center",justifyContent:"flex-end"},children:[(0,Lk.jsx)(Le,{variant:"body2",sx:{flex:1,color:"text.secondary"},children:gGn(e,t)}),(0,Lk.jsx)(Dt,{variant:"outlined",onClick:o,children:"Close"}),(0,Lk.jsx)(Dt,{color:"error",variant:"outlined",onClick:i,children:"Request changes"}),(0,Lk.jsx)(Dt,{variant:"outlined",onClick:n,children:"Comment"}),(0,Lk.jsx)(Dt,{color:"success",variant:"contained",onClick:r,children:"Approve"})]})}var M2=E($(),1);function Aze({path:e,startLine:t,endLine:r}){return t===r?`${e}:${t}`:`${e}:${t}-${r}`}function Rfr({queued:e,onRemove:t}){return e.length===0?null:(0,M2.jsxs)(ie,{component:"section","aria-label":"Queued review comments",sx:{px:2,py:1,maxHeight:160,overflowY:"auto"},children:[(0,M2.jsx)(Le,{variant:"overline",sx:{color:"text.secondary",letterSpacing:1},children:`Queued for review (${e.length})`}),e.map((r,n)=>(0,M2.jsxs)(Rt,{direction:"row",spacing:1,sx:{alignItems:"flex-start"},children:[(0,M2.jsxs)(Le,{variant:"body2",sx:{flex:1,minWidth:0},children:[(0,M2.jsx)(ie,{component:"code",sx:{fontSize:12,mr:1},children:Aze(r)}),r.note]}),(0,M2.jsx)(ir,{size:"small","aria-label":`Remove the queued comment on ${Aze(r)}`,onClick:()=>t(n),sx:{p:.25},children:(0,M2.jsx)(Wo,{sx:{fontSize:14}})})]},`${Aze(r)}:${n}`))]})}function Afr(e,t){return{comments:[],screenshots:[],reviewAfter:!1,announceAfter:!1,draft:!1,autoMerge:!1,checklist:e,reviewComments:t}}function Pfr(e,t,r){let n=()=>Afr(e(),t),i=(o,a)=>r(o,{...n(),reviewEvent:a});return{onApprove:()=>i("approve","APPROVE"),onComment:()=>i("approve","COMMENT"),onRequestChanges:()=>i("reject","REQUEST_CHANGES"),onClose:()=>r("reject",{...n(),dismissed:!0})}}var $B=E($(),1),yGn={px:2,pb:2,display:"flex",flexWrap:"wrap",columnGap:3,rowGap:.5};function Yge({items:e}){return e.length===0?null:(0,$B.jsx)(ie,{sx:yGn,children:e.map(t=>(0,$B.jsxs)(Le,{variant:"body2",color:"text.secondary",children:[t.label,":"," ",t.url?(0,$B.jsx)(Kr,{href:t.url,target:"_blank",rel:"noopener noreferrer",children:t.value}):(0,$B.jsx)(ie,{component:"span",sx:{color:"text.primary"},children:t.value})]},t.label))})}var Mfr=E($(),1);function Lfr(){let{mode:e,onToggleMode:t}=OB();return t?(0,Mfr.jsx)(Qne,{mode:e,onToggleMode:t,subject:"preview"}):null}function Ifr(e,t){return e.kind==="pr-comment"||e.kind==="github-issue-comment"?{label:"Comment",color:"default"}:e.kind==="github-issue-edit"?{label:"Edit issue",color:"warning"}:e.kind==="miro-board"?{label:"Miro boxes",color:"info"}:e.kind==="slack-post"?{label:"Slack post",color:"success"}:e.kind==="show"?{label:"Show",color:"default"}:e.kind==="ask"?{label:"Review",color:"info"}:e.kind==="high-level-review"?{label:"Checklist",color:"info"}:e.kind==="github-issue"?{label:"New issue",color:"success"}:e.kind==="backlog-item"?e.itemType==="bug"?{label:"Bug",color:"warning"}:{label:"Story",color:"info"}:e.prNumber!==null?{label:`Update #${e.prNumber}`,color:"info"}:t?{label:"New draft PR",color:"success"}:{label:"New PR",color:"success"}}var vGn=/[^\s/]+\/[^\s/#]+#\d+/;function Dfr(e){let t=vGn.exec(e);if(!t)return null;let r=mte(t[0]);return r?{before:e.slice(0,t.index),reference:t[0],url:r,after:e.slice(t.index+t[0].length)}:null}var J1=E($(),1);function Mk({preview:e,draft:t}){let r=Ifr(e,t),n=Dfr(e.title);return(0,J1.jsxs)(ie,{sx:{p:2,display:"flex",alignItems:"center",gap:1},children:[(0,J1.jsx)(Le,{variant:"subtitle1",sx:{flex:1,fontWeight:600},children:n?(0,J1.jsxs)(J1.Fragment,{children:[n.before,(0,J1.jsx)(Kr,{href:n.url,target:"_blank",rel:"noreferrer",underline:"hover",children:n.reference}),n.after]}):e.title}),(0,J1.jsx)(rn,{size:"small",label:r.label,color:r.color}),(0,J1.jsx)(Lfr,{})]})}var Ik={flex:1,minWidth:0,height:"100%",display:"flex",flexDirection:"column",borderLeft:1,borderColor:"divider",bgcolor:"background.paper"};var tHe=E(fe(),1);var Nfr=E(fe(),1),Dk=E($(),1);function Kge({label:e,children:t}){let[r,n]=(0,Nfr.useState)(!0);return(0,Dk.jsxs)(ie,{sx:{mt:.75,minWidth:0},children:[(0,Dk.jsx)(Dt,{size:"small",onClick:()=>n(!r),startIcon:r?(0,Dk.jsx)(Ane,{}):(0,Dk.jsx)(Zl,{}),sx:{textTransform:"none",fontSize:12,py:0,minWidth:0},children:e}),(0,Dk.jsx)(G6,{in:r,children:(0,Dk.jsx)(ie,{sx:{mt:.5,minWidth:0},children:t})})]})}var Ofr=E($(),1);function ev({children:e}){return(0,Ofr.jsx)(Le,{variant:"caption",sx:{color:"text.secondary"},children:e})}var Bfr={position:"sticky",top:40,zIndex:3,display:"flex",alignItems:"center",gap:1,minWidth:0,cursor:"pointer",borderRadius:.5,bgcolor:"background.paper","&:hover":{backgroundImage:({palette:e})=>`linear-gradient(${e.action.hover}, ${e.action.hover})`}};var Pze=E($(),1);function Ffr({path:e,collapsed:t,onToggle:r}){let n=t?Sd:Zl;return(0,Pze.jsx)(ir,{size:"small",onClick:i=>{i.stopPropagation(),r()},"aria-expanded":!t,"aria-label":`${t?"Expand":"Collapse"} ${e}`,sx:{p:.25,flexShrink:0},children:(0,Pze.jsx)(n,{sx:{fontSize:16}})})}var zfr=E(fe(),1);function bGn(e,t){return e.getBoundingClientRect().top>t.getBoundingClientRect().top}function $fr(e){let t=e.parentElement;!t||!bGn(e,t)||t.scrollIntoView?.({block:"start"})}function Xge(e,t){let r=(0,zfr.useRef)(null);return{ref:r,toggle:()=>{e&&r.current&&$fr(r.current),t()}}}var Zge=12,Hfr=e=>({bgcolor:gi(e.palette.primary.main,.08),"&:hover":{bgcolor:gi(e.palette.primary.main,.16)}}),Qge={width:"100%",minHeight:24},YR={display:"flex",alignItems:"center",gap:.75,minWidth:0,py:.15,borderRadius:1,"&:hover":{bgcolor:"action.hover"}},zB={border:0,bgcolor:"transparent",cursor:"pointer",textAlign:"left",color:"inherit",font:"inherit"},I2={fontFamily:"fontFamilyMono",fontSize:12,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},Lze={fontFamily:"fontFamilyMono",fontSize:11,flexShrink:0},HB={added:"success.main",removed:"error.main",modified:"warning.main"},Jge={added:"A",removed:"D",modified:"M"},e0e=e=>({position:"relative","&::before":{content:'""',position:"absolute",left:0,top:4,bottom:4,width:3,borderRadius:1,bgcolor:e.palette.warning.main}});var t0e=E($(),1);function UB({additions:e,deletions:t,inline:r=!1}){return(0,t0e.jsxs)(ie,{sx:{display:"flex",gap:.5,ml:r?0:"auto",pl:1,flexShrink:0},children:[(0,t0e.jsxs)(Le,{component:"span",sx:{...Lze,color:"success.main"},children:["+",e]}),(0,t0e.jsxs)(Le,{component:"span",sx:{...Lze,color:"error.main"},children:["\u2212",t]})]})}var KR=E($(),1);function r0e({diff:e,collapsed:t,onToggle:r}){let{ref:n,toggle:i}=Xge(!t,r);return(0,KR.jsxs)(ie,{ref:n,onClick:i,sx:Bfr,children:[(0,KR.jsx)(Ffr,{path:e.path,collapsed:t,onToggle:i}),(0,KR.jsx)(Kr,{href:e.diffUrl,target:"_blank",rel:"noreferrer",onClick:o=>o.stopPropagation(),sx:{...I2,fontWeight:600},title:e.path,children:e.path}),(0,KR.jsx)(Le,{variant:"caption",sx:{flexShrink:0,color:HB[e.status]},children:e.status}),(0,KR.jsx)(UB,{additions:e.additions,deletions:e.deletions})]})}var n0e={mb:1,minWidth:0,scrollMarginTop:`${40}px`};var Nk=20,xGn=3;function TGn({changes:e}){return[...e].reverse().findIndex(r=>!vf(r))<xGn}function SGn(e,t,r){return r!==void 0?r-t+1:TGn(e)?e.oldStart+e.oldLines:null}function CGn(e,t,r){return r?e!==null&&e<=Nk?["all"]:t?["down","up"]:["up"]:["down"]}function wGn(e,t,r,n){return t?t.oldStart:e?SGn(e,r,n):1}function i0e(e,t,r){let n=e[t-1],i=e[t],o=n?n.oldStart+n.oldLines:1,a=n?n.newStart+n.newLines-o:0,s=wGn(n,i,a,r);return s!==null&&s<=o?null:{start:o,end:s,offset:a,directions:CGn(s===null?null:s-o,n!==void 0,i!==void 0)}}var Mze=E($(),1),kGn={all:P7,down:bd,up:PS};function _Gn({start:e,end:t,directions:r},n){return n==="all"?`Show ${(t??e)-e} hidden lines`:r.length===1?`Show ${Nk} lines ${n==="up"?"above":"below"}`:n==="up"?`Show ${Nk} lines above the next change`:`Show ${Nk} lines below the previous change`}function Ufr({gap:e,disabled:t,onExpand:r}){return e.directions.map(n=>{let i=kGn[n];return(0,Mze.jsx)(pn,{className:"high-level-gap-button",disabled:t,onClick:()=>r(n),"aria-label":_Gn(e,n),children:(0,Mze.jsx)(i,{fontSize:"small"})},n)})}var tv=E($(),1);function Wfr({hidden:e,header:t,loading:r,error:n,onRetry:i}){return r?(0,tv.jsxs)(ie,{sx:{display:"inline-flex",alignItems:"center",gap:1},children:[(0,tv.jsx)(oo,{size:14,"aria-label":"Loading"}),"Loading file from GitHub\u2026"]}):n?(0,tv.jsxs)(ie,{component:"span",sx:{color:"error.main",whiteSpace:"normal"},children:["Couldn't load this file from GitHub: ",n," ",(0,tv.jsx)(Dt,{size:"small",onClick:i,sx:{minWidth:0,py:0},children:"Retry"})]}):(0,tv.jsxs)(tv.Fragment,{children:[e===null?"More lines below":`${e} hidden line${e===1?"":"s"}`," ",t&&(0,tv.jsx)(ie,{component:"span",sx:{color:"text.disabled"},children:t})]})}var WB=E($(),1);function Gfr({gap:e,header:t,disabled:r,loading:n,error:i,onExpand:o,onRetry:a}){return(0,WB.jsxs)(uft,{className:"high-level-gap",gutterClassName:"high-level-gap-gutter",contentClassName:"high-level-gap-content",children:[(0,WB.jsx)(ie,{className:"high-level-gap-buttons",children:(0,WB.jsx)(Ufr,{gap:e,disabled:r,onExpand:o})}),(0,WB.jsx)(Wfr,{hidden:e.end===null?null:e.end-e.start,header:t,loading:n,error:i,onRetry:a})]})}var qfr=E($(),1);function Vfr({hunks:e,headLength:t,loading:r,error:n,expand:i}){return o=>{let a=i0e(e,o,t);return a?(0,qfr.jsx)(Gfr,{gap:a,header:e[o]?.content,disabled:r!==null,loading:r===o,error:n?.index===o?n.message:void 0,onExpand:s=>i(o,s),onRetry:()=>n&&i(n.index,n.direction)},`gap-${e[o]?.content??"end"}`):null}}var jfr=e=>({"& .high-level-gap td":{backgroundColor:gi(e.palette.primary.main,.08),borderBlock:`1px solid ${e.palette.divider}`},"& .high-level-gap-gutter":{p:0},"& .high-level-gap-buttons":{display:"flex",flexDirection:"column"},"& .high-level-gap-button":{width:"100%",minWidth:88,height:26,color:"text.secondary",transition:"background-color 0.2s ease, color 0.2s ease","& + .high-level-gap-button":{borderTop:`1px solid ${e.palette.divider}`},"&:hover":{backgroundColor:gi(e.palette.primary.main,.2),color:"primary.main"},"&.Mui-disabled":{color:"text.disabled"}},"& .high-level-gap-content":{px:1.5,color:"text.secondary",fontSize:13,verticalAlign:"middle",whiteSpace:"nowrap"}});var Ize=E(fe(),1);var Yfr="/dev/null";function Kfr(e,t,r){let n=t==="added"?Yfr:`a/${e}`,i=t==="removed"?Yfr:`b/${e}`;return[`diff --git a/${e} b/${e}`,`--- ${n}`,`+++ ${i}`,r,""].join(`
3880
3880
  `)}var XR=E(fe(),1);function EGn(e,t){return t>=0?e.slice(t):[...Array(-t).fill(""),...e]}function RGn(e,t,r){return r==="down"?[e,Math.min(e+Nk,t)]:r==="up"?[Math.max(t-Nk,e),t]:[e,t]}function Xfr(e,t,r,n){let i=i0e(e,r,t.length);if(!i||i.end===null)return e;let[o,a]=RGn(i.start,i.end,n);return rft(e,EGn(t,i.offset),o,a)}function Zfr(e,t,r,n,i){return{base:t,hunks:Xfr(e?.base===t?e.hunks:t,r,n,i)}}function Qfr(e,t,r){let n=(0,XR.useContext)(jge),[i,o]=(0,XR.useState)(null),[a,s]=(0,XR.useState)(),[l,u]=(0,XR.useState)(null),[f,d]=(0,XR.useState)(null);return{hunks:i?.base===t?i.hunks:t,headLength:a,expandable:r&&n!==void 0,loading:l,error:f,expand:(m,g)=>{n&&(u(m),d(null),n.load(e).then(y=>{s(y.length),o(v=>Zfr(v,t,y,m,g))}).catch(y=>d({index:m,direction:g,message:y instanceof Error?y.message:String(y)})).finally(()=>u(null)))}}}var AGn=[];function Jfr(e,t,r){let n=(0,Ize.useMemo)(()=>{if(r)try{return pne(Kfr(e,t,r))[0]}catch{return}},[e,t,r]),i=Qfr(e,n?.hunks??AGn,t==="modified");return{file:(0,Ize.useMemo)(()=>n&&{...n,hunks:i.hunks},[n,i.hunks]),expansion:i}}var ZR=E($(),1);function GB({path:e,status:t,patch:r,truncated:n,viewType:i,comments:o}){let{file:a,expansion:s}=Jfr(e,t,r);return a?(0,ZR.jsxs)(ie,{sx:[tne,jfr,{pt:.5,minWidth:0}],children:[(0,ZR.jsx)(zne,{path:e,cwd:o?.cwd,hunks:a.hunks,onComment:o?.onComment,onQueue:o?.onQueue,unavailable:o?.unavailable,children:(0,ZR.jsx)(Xne,{file:a,path:e,viewType:i,renderGap:s.expandable?Vfr(s):void 0})}),n&&(0,ZR.jsx)(ev,{children:"Truncated \u2014 the rest of this diff is on GitHub."})]}):(0,ZR.jsx)(ev,{children:n?"Too large to show here \u2014 open it on GitHub.":"No diff available \u2014 open it on GitHub."})}var WY=E($(),1);function edr({diff:e,collapsed:t,onToggle:r,viewType:n,comments:i}){return(0,WY.jsxs)(ie,{sx:n0e,children:[(0,WY.jsx)(r0e,{diff:e,collapsed:t,onToggle:r}),!t&&(0,WY.jsx)(GB,{path:e.path,status:e.status,patch:e.patch,truncated:e.truncated===!0,viewType:n,comments:i})]})}var ndr=E(fe(),1);var tdr="assist:high-level-tree:",PGn=new Set;function QR(e,t=PGn){let r=`${tdr}${e}`,[n,i]=(0,ndr.useState)(()=>(lk(tdr),new Set(Xu(r)))),o=a=>{Zu(r,[...a]),i(a)};return{collapsed:rdr(t,n),overrides:n,onToggle:a=>o(rdr(n,[a])),onSet:(a,s)=>{let l=new Set(n);for(let u of a)t.has(u)===s?l.delete(u):l.add(u);o(l)},onReset:()=>o(new Set)}}function rdr(e,t){let r=new Set(e);for(let n of t)r.delete(n)||r.add(n);return r}function idr(e,t){let{collapsed:r,onToggle:n,onSet:i}=QR(`critical:${e}`),o=t.map(s=>s.path),a=o.filter(s=>r.has(s)).length;return{collapsed:r,onToggle:n,bulk:{open:o.length-a,collapsed:a,expandAll:()=>i(o,!1),collapseAll:()=>i(o,!0)}}}var JR={minHeight:28,py:0,px:1,fontSize:12,textTransform:"none",whiteSpace:"nowrap","& .MuiButton-startIcon > *:nth-of-type(1)":{fontSize:16}};var Km=E($(),1);function odr(e){return`${e} diff${e===1?"":"s"}`}function adr({count:e}){return(0,Km.jsx)(ie,{component:"span","data-testid":"bulk-count",sx:{ml:.75,px:.5,minWidth:18,borderRadius:1,bgcolor:"action.selected",fontFamily:"fontFamilyMono",fontSize:11,lineHeight:"16px",textAlign:"center"},children:e})}function o0e({bulk:e}){return(0,Km.jsxs)(Km.Fragment,{children:[(0,Km.jsxs)(Dt,{size:"small",color:"inherit",startIcon:(0,Km.jsx)(P7,{}),title:`Expand the ${odr(e.collapsed)} collapsed`,disabled:e.collapsed===0,onClick:e.expandAll,sx:JR,children:["Expand all",(0,Km.jsx)(adr,{count:e.collapsed})]}),(0,Km.jsxs)(Dt,{size:"small",color:"inherit",startIcon:(0,Km.jsx)(iie,{}),title:`Collapse the ${odr(e.open)} open`,disabled:e.open===0,onClick:e.collapseAll,sx:JR,children:["Collapse all",(0,Km.jsx)(adr,{count:e.open})]})]})}var Dze="--high-level-structure-toolbar-height",a0e=`calc(${40}px + var(${Dze}, 0px))`,sdr={position:"sticky",top:40,zIndex:3,bgcolor:"background.paper",py:1,mt:.5,display:"flex",flexDirection:"column",gap:.75,borderBottom:1,borderColor:"divider"},GY={display:"flex",alignItems:"center",flexWrap:"wrap",gap:.75};var VB=E($(),1);function ldr({bulk:e,viewType:t,onChangeViewType:r}){return(0,VB.jsxs)(ie,{sx:GY,children:[(0,VB.jsx)(o0e,{bulk:e}),(0,VB.jsx)(ie,{sx:{ml:"auto"},children:(0,VB.jsx)(L7,{viewType:t,onChange:r})})]})}var eA=E($(),1);function cdr({diffs:e,criticalPaths:t,subject:r,comments:n}){let{viewType:i,onChange:o}=pB(),{collapsed:a,onToggle:s,bulk:l}=idr(r,e);return t.length===0?(0,eA.jsx)(ev,{children:"review.highLevel.criticalPaths is empty, so no diffs are shown here."}):e.length===0?(0,eA.jsx)(ev,{children:`No changed file matches ${t.join(", ")}.`}):(0,eA.jsxs)(ie,{sx:{minWidth:0},children:[(0,eA.jsx)(ldr,{bulk:l,viewType:i,onChangeViewType:o}),e.map(u=>(0,eA.jsx)(edr,{diff:u,collapsed:a.has(u.path),onToggle:()=>s(u.path),viewType:i,comments:n},u.path))]})}var udr={display:"flex",alignItems:"center",height:28,flex:"1 1 180px",minWidth:0,maxWidth:320,border:1,borderColor:"divider",borderRadius:1,"&:focus-within":{borderColor:"primary.main",boxShadow:e=>`0 0 0 1px ${e.palette.primary.main}`}},Nze={fontSize:11,color:"text.disabled",whiteSpace:"nowrap",px:1};var qB=E($(),1);function fdr({glob:e,onChangeGlob:t,count:r,onSubmit:n}){return(0,qB.jsxs)(ie,{component:"label",sx:udr,children:[(0,qB.jsx)(Le,{component:"span",sx:Nze,children:"Match"}),(0,qB.jsx)(Cu,{value:e,placeholder:"name or **/*.md",title:"File name (case-insensitive) or glob",onChange:i=>t(i.target.value),onKeyDown:i=>{i.key==="Enter"&&n?.(),i.key==="Escape"&&t("")},inputProps:{"aria-label":"Match changed files",spellCheck:!1,autoComplete:"off"},sx:{flex:1,minWidth:0,fontFamily:"fontFamilyMono",fontSize:12}}),e.trim()&&(0,qB.jsxs)(Le,{component:"span",sx:{...Nze,color:"text.secondary"},children:[r," file",r===1?"":"s"]})]})}var VY=E($(),1);function ddr({globs:e,active:t,onSelect:r}){return(0,VY.jsxs)(ie,{sx:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:.5},children:[(0,VY.jsx)(Le,{component:"span",sx:{fontSize:11,color:"text.disabled",mr:.25},children:"Quick"}),e.map(n=>{let i=n===t.trim();return(0,VY.jsx)(rn,{label:n,size:"small",clickable:!0,"aria-pressed":i,onClick:()=>r(n),sx:{height:20,fontFamily:"fontFamilyMono",fontSize:11,border:1,borderColor:i?"warning.main":"transparent",color:i?"text.primary":"text.secondary"}},n)})]})}var D2=E($(),1);function hdr({glob:e,onChangeGlob:t,matches:r,quickGlobs:n,onShow:i,onHide:o}){let a=r.size===0,s={...JR,minWidth:0};return(0,D2.jsxs)(D2.Fragment,{children:[(0,D2.jsx)(fdr,{glob:e,onChangeGlob:t,count:r.size,onSubmit:a?void 0:i}),(0,D2.jsx)(Dt,{size:"small",variant:"outlined",color:"inherit",disabled:a,title:"Open the matching diffs and their folders",onClick:i,sx:s,children:"Show"}),(0,D2.jsx)(Dt,{size:"small",variant:"outlined",color:"inherit",disabled:a,title:"Collapse the matching diffs",onClick:o,sx:s,children:"Hide"}),(0,D2.jsx)(ddr,{globs:n,active:e,onSelect:l=>t(l===e?"":l)})]})}var Oze=E($(),1);function pdr({changes:e,onReset:t}){return(0,Oze.jsx)(Dt,{size:"small",variant:"outlined",disabled:e===0,startIcon:(0,Oze.jsx)(UL,{}),title:"Return to the review.highLevel.collapsedPaths defaults",onClick:t,sx:JR,children:e===0?"Defaults":`Reset ${e} change${e===1?"":"s"}`})}var C0=E($(),1);function mdr({ref:e,bulk:t,viewType:r,onChangeViewType:n,matches:i,...o}){return(0,C0.jsxs)(ie,{ref:e,role:"toolbar","aria-label":"Changed files controls",sx:sdr,children:[(0,C0.jsxs)(ie,{sx:GY,children:[(0,C0.jsx)(o0e,{bulk:t}),(0,C0.jsx)(Ci,{orientation:"vertical",flexItem:!0}),(0,C0.jsx)(pdr,{changes:t.changes,onReset:t.reset}),(0,C0.jsx)(ie,{sx:{ml:"auto"},children:(0,C0.jsx)(L7,{viewType:r,onChange:n})})]}),(0,C0.jsx)(ie,{sx:GY,children:(0,C0.jsx)(hdr,{...o,matches:i,onShow:()=>t.show(i),onHide:()=>t.hide(i)})})]})}var ydr=E($(),1);function gdr({structure:e}){return(0,ydr.jsxs)(Le,{variant:"caption",sx:{color:"text.secondary"},children:[e.added," added \xB7 ",e.removed," deleted \xB7"," ",e.modified," modified \xB7 +",e.additions," \u2212",e.deletions]})}var vdr=E($(),1),bdr=st((0,vdr.jsx)("path",{d:"M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"}),"Folder");var xdr=E($(),1),Tdr=st((0,xdr.jsx)("path",{d:"M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2m0 12H4V8h16z"}),"FolderOpen");var tA=E($(),1);function Sdr({collapsed:e,ignored:t}){return(0,tA.jsxs)(tA.Fragment,{children:[(0,tA.jsx)(e?Sd:Zl,{sx:{fontSize:16,color:"text.secondary",flexShrink:0}}),(0,tA.jsx)(e?bdr:Tdr,{sx:{fontSize:16,color:e&&!t?"primary.main":"text.secondary",flexShrink:0}})]})}function ih(e){return e.flatMap(t=>t.kind==="file"?[t]:ih(t.children))}var Cdr=E($(),1),wdr=st((0,Cdr.jsx)("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}),"VisibilityOff");var qY=E($(),1);function s0e({label:e,globs:t}){return(0,qY.jsxs)(ie,{component:"span",title:"Collapsed by review.highLevel.collapsedPaths",sx:{display:"inline-flex",alignItems:"center",gap:.5,fontSize:11,fontWeight:500,lineHeight:"18px",color:"text.primary",bgcolor:"action.selected",borderRadius:2.5,pl:.625,pr:.875,flexShrink:0,whiteSpace:"nowrap"},children:[(0,qY.jsx)(wdr,{sx:{fontSize:12}}),e,(0,qY.jsx)(ie,{component:"span",sx:{fontFamily:"fontFamilyMono",color:"text.secondary"},children:t.join(", ")})]})}var _dr=E($(),1);function kdr({dir:e}){let t=ih(e.children).length;return(0,_dr.jsxs)(Le,{component:"span",variant:"caption",sx:{color:"text.secondary",flexShrink:0},children:[t," ",t===1?"file":"files"," hidden"]})}var Bze=E($(),1);function Edr({dir:e,collapsed:t,ignoredGlobs:r}){return r?(0,Bze.jsx)(s0e,{label:`${ih(e.children).length} ignored`,globs:r}):t?(0,Bze.jsx)(kdr,{dir:e}):null}function Rdr(e,t){return[{...YR,...Qge,pl:e,...zB},t&&e0e]}function Adr(e,t){return{...I2,fontWeight:600,color:t?"text.secondary":e?"primary.main":void 0}}var rA=E($(),1);function Pdr({dir:e,collapsed:t,matched:r,ignoredGlobs:n,indent:i,onToggle:o}){let a=n!==void 0;return(0,rA.jsxs)(ie,{component:"button",type:"button",onClick:o,"aria-expanded":!t,"aria-label":e.path,"data-matched":r||void 0,sx:Rdr(i,r),children:[(0,rA.jsx)(Sdr,{collapsed:t,ignored:a}),(0,rA.jsx)(Le,{component:"span",sx:Adr(t,a),children:e.name}),(0,rA.jsx)(Edr,{dir:e,collapsed:t,ignoredGlobs:n}),(0,rA.jsx)(UB,{additions:e.additions,deletions:e.deletions,inline:!0})]})}var Ldr=e=>`linear-gradient(${e}, ${e})`;function LGn(e){return t=>{let r=Hfr(t),n=e?r.bgcolor:"transparent",i=e?r["&:hover"].bgcolor:t.palette.action.hover;return{position:"sticky",top:a0e,zIndex:2,bgcolor:"background.paper",backgroundImage:Ldr(n),"&:hover":{bgcolor:"background.paper",backgroundImage:Ldr(i)}}}}function Mdr(e,t){return[{...YR,gap:0,cursor:"pointer"},t&&e0e,LGn(e)]}function Idr(e){return{...YR,minHeight:Qge.minHeight,"&:hover":void 0,minWidth:0,pl:e,...zB}}var Fze=E($(),1);function Ddr({file:e}){return(0,Fze.jsx)(ir,{size:"small",href:e.diffUrl,target:"_blank",rel:"noreferrer","aria-label":`Open ${e.path} on GitHub`,onClick:t=>t.stopPropagation(),sx:{p:.25,flexShrink:0},children:(0,Fze.jsx)(Vte,{sx:{fontSize:14}})})}var Odr=E($(),1);function Ndr({open:e}){return(0,Odr.jsx)(e?Zl:Sd,{sx:{fontSize:16,color:e?"primary.main":"text.secondary",flexShrink:0}})}var Ok=E($(),1);function Bdr({file:e,muted:t=!1}){return(0,Ok.jsxs)(Ok.Fragment,{children:[(0,Ok.jsx)(lr,{title:e.status,children:(0,Ok.jsx)(Le,{component:"span",sx:{...I2,flexShrink:0,fontWeight:700,color:HB[e.status]},children:Jge[e.status]})}),(0,Ok.jsx)(Le,{component:"span",sx:{...I2,color:t?"text.secondary":void 0},title:e.path,children:e.name})]})}var N2=E($(),1);function Fdr({file:e,indent:t,open:r,onToggle:n,glob:i,matched:o}){let a=!r&&i!==void 0,{ref:s,toggle:l}=Xge(r,n);return(0,N2.jsxs)(ie,{ref:s,onClick:l,"data-matched":o||void 0,sx:Mdr(r,o),children:[(0,N2.jsxs)(ie,{component:"button",type:"button","aria-expanded":r,"aria-label":`${r?"Collapse":"Expand"} ${e.path}`,sx:Idr(t),children:[(0,N2.jsx)(Ndr,{open:r}),(0,N2.jsx)(Bdr,{file:e,muted:a}),a&&(0,N2.jsx)(s0e,{label:"ignored",globs:[i]}),(0,N2.jsx)(UB,{additions:e.additions,deletions:e.deletions,inline:!0})]}),(0,N2.jsx)(Ddr,{file:e})]})}var jB=E($(),1);function $dr({file:e,indent:t,open:r,onToggle:n,glob:i,matched:o,viewType:a,comments:s}){return(0,jB.jsxs)(ie,{sx:{minWidth:0,scrollMarginTop:a0e},children:[(0,jB.jsx)(Fdr,{file:e,indent:t,open:r,onToggle:n,glob:i,matched:o}),r&&(0,jB.jsx)(ie,{sx:{mb:1,minWidth:0},children:(0,jB.jsx)(GB,{path:e.path,status:e.status,patch:e.patch??null,truncated:e.truncated===!0,viewType:a,comments:s})})]})}function zdr(e,t){let r=ih(e.children).map(n=>t.get(n.path));if(!(r.length===0||r.some(n=>n===void 0)))return[...new Set(r)]}function Hdr(e,t){let r=t.collapsed.has(e.path);return r?{collapsed:r,matched:ih(e.children).some(n=>t.matches.has(n.path)),ignoredGlobs:zdr(e,t.fileGlobs)}:{collapsed:r,matched:!1,ignoredGlobs:void 0}}var YB=E($(),1);function $ze(e){let{nodes:t,depth:r=0,collapsed:n,onToggleDir:i}=e,o=`${r*Zge}px`;return t.map(a=>a.kind==="file"?(0,YB.jsx)($dr,{file:a,indent:o,open:!e.collapsedFiles.has(a.path),onToggle:()=>e.onToggleFile(a.path),glob:e.fileGlobs.get(a.path),matched:e.matches.has(a.path),viewType:e.viewType,comments:e.comments},a.path):(0,YB.jsxs)(ie,{sx:{minWidth:0},children:[(0,YB.jsx)(Pdr,{dir:a,...Hdr(a,e),indent:o,onToggle:()=>i(a.path)}),!n.has(a.path)&&(0,YB.jsx)($ze,{...e,nodes:a.children,depth:r+1})]},a.path))}var Udr=E(fe(),1);function zze(e,t){return e.flatMap(r=>{if(r.kind==="file")return t.has(r.path)?[r]:[];let n=zze(r.children,t);return n.length>0?[{...r,children:n}]:[]})}var MGn=new Set;function Wdr(e,t,r,n){let i=t.trim()!=="",o=(0,Udr.useMemo)(()=>i?zze(e,r):e,[i,e,r]);return{nodes:o,collapsedDirs:i?MGn:n,noMatches:i&&o.length===0}}var jY=E($(),1);function Gdr({glob:e,...t}){let r=Wdr(t.nodes,e,t.matches,t.collapsed);return(0,jY.jsxs)(ie,{sx:{mt:.5},children:[r.noMatches&&(0,jY.jsx)(Le,{variant:"caption",sx:{color:"text.secondary"},children:"No files match."}),(0,jY.jsx)($ze,{...t,nodes:r.nodes,collapsed:r.collapsedDirs})]})}var d0e=E(fe(),1);function Hze(e,t,r,n=!1){let i={open:0,collapsed:0};for(let o of e){if(o.kind==="file"){n||r.has(o.path)?i.collapsed++:i.open++;continue}let a=Hze(o.children,t,r,n||t.has(o.path));i.open+=a.open,i.collapsed+=a.collapsed}return i}function Uze(e){return e.flatMap(t=>t.kind==="file"?[]:[t.path,...Uze(t.children)])}var Wze=(e,t,r)=>{let n=e instanceof RegExp?Vdr(e,r):e,i=t instanceof RegExp?Vdr(t,r):t,o=n!==null&&i!=null&&IGn(n,i,r);return o&&{start:o[0],end:o[1],pre:r.slice(0,o[0]),body:r.slice(o[0]+n.length,o[1]),post:r.slice(o[1]+i.length)}},Vdr=(e,t)=>{let r=t.match(e);return r?r[0]:null},IGn=(e,t,r)=>{let n,i,o,a,s,l=r.indexOf(e),u=r.indexOf(t,l+1),f=l;if(l>=0&&u>0){if(e===t)return[l,u];for(n=[],o=r.length;f>=0&&!s;){if(f===l)n.push(f),l=r.indexOf(e,f+1);else if(n.length===1){let d=n.pop();d!==void 0&&(s=[d,u])}else i=n.pop(),i!==void 0&&i<o&&(o=i,a=u),u=r.indexOf(t,f+1);f=l<u&&l>=0?l:u}n.length&&a!==void 0&&(s=[o,a])}return s};var qdr="\0SLASH"+Math.random()+"\0",jdr="\0OPEN"+Math.random()+"\0",Vze="\0CLOSE"+Math.random()+"\0",Ydr="\0COMMA"+Math.random()+"\0",Kdr="\0PERIOD"+Math.random()+"\0",DGn=new RegExp(qdr,"g"),NGn=new RegExp(jdr,"g"),OGn=new RegExp(Vze,"g"),BGn=new RegExp(Ydr,"g"),FGn=new RegExp(Kdr,"g"),$Gn=/\\\\/g,zGn=/\\{/g,HGn=/\\}/g,UGn=/\\,/g,WGn=/\\\./g,GGn=1e5;function Gze(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function VGn(e){return e.replace($Gn,qdr).replace(zGn,jdr).replace(HGn,Vze).replace(UGn,Ydr).replace(WGn,Kdr)}function qGn(e){return e.replace(DGn,"\\").replace(NGn,"{").replace(OGn,"}").replace(BGn,",").replace(FGn,".")}function Xdr(e){if(!e)return[""];let t=[],r=Wze("{","}",e);if(!r)return e.split(",");let{pre:n,body:i,post:o}=r,a=n.split(",");a[a.length-1]+="{"+i+"}";let s=Xdr(o);return o.length&&(a[a.length-1]+=s.shift(),a.push.apply(a,s)),t.push.apply(t,a),t}function Zdr(e,t={}){if(!e)return[];let{max:r=GGn}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),YY(VGn(e),r,!0).map(qGn)}function jGn(e){return"{"+e+"}"}function YGn(e){return/^-?0\d/.test(e)}function KGn(e,t){return e<=t}function XGn(e,t){return e>=t}function YY(e,t,r){let n=[],i=Wze("{","}",e);if(!i)return[e];let o=i.pre,a=i.post.length?YY(i.post,t,!1):[""];if(/\$$/.test(i.pre))for(let s=0;s<a.length&&s<t;s++){let l=o+"{"+i.body+"}"+a[s];n.push(l)}else{let s=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),u=s||l,f=i.body.indexOf(",")>=0;if(!u&&!f)return i.post.match(/,(?!,).*\}/)?(e=i.pre+"{"+i.body+Vze+i.post,YY(e,t,!0)):[e];let d;if(u)d=i.body.split(/\.\./);else if(d=Xdr(i.body),d.length===1&&d[0]!==void 0&&(d=YY(d[0],t,!1).map(jGn),d.length===1))return a.map(p=>i.pre+d[0]+p);let h;if(u&&d[0]!==void 0&&d[1]!==void 0){let p=Gze(d[0]),m=Gze(d[1]),g=Math.max(d[0].length,d[1].length),y=d.length===3&&d[2]!==void 0?Math.abs(Gze(d[2])):1,v=KGn;m<p&&(y*=-1,v=XGn);let x=d.some(YGn);h=[];for(let C=p;v(C,m);C+=y){let S;if(l)S=String.fromCharCode(C),S==="\\"&&(S="");else if(S=String(C),x){let w=g-S.length;if(w>0){let k=new Array(w+1).join("0");C<0?S="-"+k+S.slice(1):S=k+S}}h.push(S)}}else{h=[];for(let p=0;p<d.length;p++)h.push.apply(h,YY(d[p],t,!1))}for(let p=0;p<h.length;p++)for(let m=0;m<a.length&&n.length<t;m++){let g=o+h[p]+a[m];(!r||u||g)&&n.push(g)}}return n}var KY=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")};var ZGn={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},XY=e=>e.replace(/[[\]\\-]/g,"\\$&"),QGn=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Qdr=e=>e.join(""),Jdr=(e,t)=>{let r=t;if(e.charAt(r)!=="[")throw new Error("not in a brace expression");let n=[],i=[],o=r+1,a=!1,s=!1,l=!1,u=!1,f=r,d="";e:for(;o<e.length;){let g=e.charAt(o);if((g==="!"||g==="^")&&o===r+1){u=!0,o++;continue}if(g==="]"&&a&&!l){f=o+1;break}if(a=!0,g==="\\"&&!l){l=!0,o++;continue}if(g==="["&&!l){for(let[y,[v,b,x]]of Object.entries(ZGn))if(e.startsWith(y,o)){if(d)return["$.",!1,e.length-r,!0];o+=y.length,x?i.push(v):n.push(v),s=s||b;continue e}}if(l=!1,d){g>d?n.push(XY(d)+"-"+XY(g)):g===d&&n.push(XY(g)),d="",o++;continue}if(e.startsWith("-]",o+1)){n.push(XY(g+"-")),o+=2;continue}if(e.startsWith("-",o+1)){d=g,o+=2;continue}n.push(XY(g)),o++}if(f<o)return["",!1,0,!1];if(!n.length&&!i.length)return["$.",!1,e.length-r,!0];if(i.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!u){let g=n[0].length===2?n[0].slice(-1):n[0];return[QGn(g),!1,f-r,!1]}let h="["+(u?"^":"")+Qdr(n)+"]",p="["+(u?"":"^")+Qdr(i)+"]";return[n.length&&i.length?"("+h+"|"+p+")":n.length?h:p,s,f-r,!0]};var Bk=(e,{windowsPathsNoEscape:t=!1,magicalBraces:r=!0}={})=>r?t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"):t?e.replace(/\[([^\/\\{}])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1");var oh,JGn=new Set(["!","?","+","*","@"]),qze=e=>JGn.has(e),ehr=e=>qze(e.type),eVn=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),tVn=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),rVn=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),thr=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),nVn="(?!(?:^|/)\\.\\.?(?:$|/))",l0e="(?!\\.)",iVn=new Set(["[","."]),oVn=new Set(["..","."]),aVn=new Set("().*{}+?[]^$\\!"),sVn=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Xze="[^/]",rhr=Xze+"*?",nhr=Xze+"+?",lVn=0,sl,mc,O2,Dn,Aa,Fk,nA,$k,rv,nv,KB,to,ihr,Hk,c0e,ohr,jze,u0e,ahr,Yze,shr,lhr,chr,f0e,Kze,uhr,zk=class{constructor(t,r,n={}){bu(this,to);tr(this,"type");bu(this,sl);bu(this,mc);bu(this,O2,!1);bu(this,Dn,[]);bu(this,Aa);bu(this,Fk);bu(this,nA);bu(this,$k,!1);bu(this,rv);bu(this,nv);bu(this,KB,!1);tr(this,"id",++lVn);this.type=t,t&&So(this,mc,!0),So(this,Aa,r),So(this,sl,Vt(this,Aa)?Vt(Vt(this,Aa),sl):this),So(this,rv,Vt(this,sl)===this?n:Vt(Vt(this,sl),rv)),So(this,nA,Vt(this,sl)===this?[]:Vt(Vt(this,sl),nA)),t==="!"&&!Vt(Vt(this,sl),$k)&&Vt(this,nA).push(this),So(this,Fk,Vt(this,Aa)?Vt(Vt(this,Aa),Dn).length:0)}get depth(){return(Vt(this,Aa)?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:Vt(this,sl).id,parent:Vt(this,Aa)?.id,depth:this.depth,partsLength:Vt(this,Dn).length,parts:Vt(this,Dn)}}get hasMagic(){if(Vt(this,mc)!==void 0)return Vt(this,mc);for(let t of Vt(this,Dn))if(typeof t!="string"&&(t.type||t.hasMagic))return So(this,mc,!0);return Vt(this,mc)}toString(){return Vt(this,nv)!==void 0?Vt(this,nv):this.type?So(this,nv,this.type+"("+Vt(this,Dn).map(t=>String(t)).join("|")+")"):So(this,nv,Vt(this,Dn).map(t=>String(t)).join(""))}push(...t){for(let r of t)if(r!==""){if(typeof r!="string"&&!(r instanceof oh&&Vt(r,Aa)===this))throw new Error("invalid part: "+r);Vt(this,Dn).push(r)}}toJSON(){let t=this.type===null?Vt(this,Dn).slice().map(r=>typeof r=="string"?r:r.toJSON()):[this.type,...Vt(this,Dn).map(r=>r.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===Vt(this,sl)||Vt(Vt(this,sl),$k)&&Vt(this,Aa)?.type==="!")&&t.push({}),t}isStart(){if(Vt(this,sl)===this)return!0;if(!Vt(this,Aa)?.isStart())return!1;if(Vt(this,Fk)===0)return!0;let t=Vt(this,Aa);for(let r=0;r<Vt(this,Fk);r++){let n=Vt(t,Dn)[r];if(!(n instanceof oh&&n.type==="!"))return!1}return!0}isEnd(){if(Vt(this,sl)===this||Vt(this,Aa)?.type==="!")return!0;if(!Vt(this,Aa)?.isEnd())return!1;if(!this.type)return Vt(this,Aa)?.isEnd();let t=Vt(this,Aa)?Vt(Vt(this,Aa),Dn).length:0;return Vt(this,Fk)===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let r=new oh(this.type,t);for(let n of Vt(this,Dn))r.copyIn(n);return r}static fromGlob(t,r={}){var i;let n=new oh(null,void 0,r);return Di(i=oh,Hk,c0e).call(i,t,n,0,r,0),n}toMMPattern(){if(this!==Vt(this,sl))return Vt(this,sl).toMMPattern();let t=this.toString(),[r,n,i,o]=this.toRegExpSource();if(!(i||Vt(this,mc)||Vt(this,rv).nocase&&!Vt(this,rv).nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return n;let s=(Vt(this,rv).nocase?"i":"")+(o?"u":"");return Object.assign(new RegExp(`^${r}$`,s),{_src:r,_glob:t})}get options(){return Vt(this,rv)}toRegExpSource(t){let r=t??!!Vt(this,rv).dot;if(Vt(this,sl)===this&&(Di(this,to,f0e).call(this),Di(this,to,ihr).call(this)),!ehr(this)){let l=this.isStart()&&this.isEnd()&&!Vt(this,Dn).some(p=>typeof p!="string"),u=Vt(this,Dn).map(p=>{var b;let[m,g,y,v]=typeof p=="string"?Di(b=oh,Hk,uhr).call(b,p,Vt(this,mc),l):p.toRegExpSource(t);return So(this,mc,Vt(this,mc)||y),So(this,O2,Vt(this,O2)||v),m}).join(""),f="";if(this.isStart()&&typeof Vt(this,Dn)[0]=="string"&&!(Vt(this,Dn).length===1&&oVn.has(Vt(this,Dn)[0]))){let m=iVn,g=r&&m.has(u.charAt(0))||u.startsWith("\\.")&&m.has(u.charAt(2))||u.startsWith("\\.\\.")&&m.has(u.charAt(4)),y=!r&&!t&&m.has(u.charAt(0));f=g?nVn:y?l0e:""}let d="";return this.isEnd()&&Vt(Vt(this,sl),$k)&&Vt(this,Aa)?.type==="!"&&(d="(?:$|\\/)"),[f+u+d,Bk(u),So(this,mc,!!Vt(this,mc)),Vt(this,O2)]}let n=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",o=Di(this,to,Kze).call(this,r);if(this.isStart()&&this.isEnd()&&!o&&this.type!=="!"){let l=this.toString(),u=this;return So(u,Dn,[l]),u.type=null,So(u,mc,void 0),[l,Bk(this.toString()),!1,!1]}let a=!n||t||r||!l0e?"":Di(this,to,Kze).call(this,!0);a===o&&(a=""),a&&(o=`(?:${o})(?:${a})*?`);let s="";if(this.type==="!"&&Vt(this,KB))s=(this.isStart()&&!r?l0e:"")+nhr;else{let l=this.type==="!"?"))"+(this.isStart()&&!r&&!t?l0e:"")+rhr+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;s=i+o+l}return[s,Bk(o),So(this,mc,!!Vt(this,mc)),Vt(this,O2)]}};sl=new WeakMap,mc=new WeakMap,O2=new WeakMap,Dn=new WeakMap,Aa=new WeakMap,Fk=new WeakMap,nA=new WeakMap,$k=new WeakMap,rv=new WeakMap,nv=new WeakMap,KB=new WeakMap,to=new WeakSet,ihr=function(){if(this!==Vt(this,sl))throw new Error("should only call on root");if(Vt(this,$k))return this;this.toString(),So(this,$k,!0);let t;for(;t=Vt(this,nA).pop();){if(t.type!=="!")continue;let r=t,n=Vt(r,Aa);for(;n;){for(let i=Vt(r,Fk)+1;!n.type&&i<Vt(n,Dn).length;i++)for(let o of Vt(t,Dn)){if(typeof o=="string")throw new Error("string part in extglob AST??");o.copyIn(Vt(n,Dn)[i])}r=n,n=Vt(r,Aa)}}return this},Hk=new WeakSet,c0e=function(t,r,n,i,o){var g,y,v,b;let a=i.maxExtglobRecursion??2,s=!1,l=!1,u=-1,f=!1;if(r.type===null){let x=n,C="";for(;x<t.length;){let S=t.charAt(x++);if(s||S==="\\"){s=!s,C+=S;continue}if(l){x===u+1?(S==="^"||S==="!")&&(f=!0):S==="]"&&!(x===u+2&&f)&&(l=!1),C+=S;continue}else if(S==="["){l=!0,u=x,f=!1,C+=S;continue}if(!i.noext&&qze(S)&&t.charAt(x)==="("&&o<=a){r.push(C),C="";let k=new oh(S,r);x=Di(g=oh,Hk,c0e).call(g,t,k,x,i,o+1),r.push(k);continue}C+=S}return r.push(C),x}let d=n+1,h=new oh(null,r),p=[],m="";for(;d<t.length;){let x=t.charAt(d++);if(s||x==="\\"){s=!s,m+=x;continue}if(l){d===u+1?(x==="^"||x==="!")&&(f=!0):x==="]"&&!(d===u+2&&f)&&(l=!1),m+=x;continue}else if(x==="["){l=!0,u=d,f=!1,m+=x;continue}if(!i.noext&&qze(x)&&t.charAt(d)==="("&&(o<=a||r&&Di(y=r,to,u0e).call(y,x))){let S=r&&Di(v=r,to,u0e).call(v,x)?0:1;h.push(m),m="";let w=new oh(x,h);h.push(w),d=Di(b=oh,Hk,c0e).call(b,t,w,d,i,o+S);continue}if(x==="|"){h.push(m),m="",p.push(h),h=new oh(null,r);continue}if(x===")")return m===""&&Vt(r,Dn).length===0&&So(r,KB,!0),h.push(m),m="",r.push(...p,h),d;m+=x}return r.type=null,So(r,mc,void 0),So(r,Dn,[t.substring(n-1)]),d},ohr=function(t){return Di(this,to,jze).call(this,t,tVn)},jze=function(t,r=eVn){if(!t||typeof t!="object"||t.type!==null||Vt(t,Dn).length!==1||this.type===null)return!1;let n=Vt(t,Dn)[0];return!n||typeof n!="object"||n.type===null?!1:Di(this,to,u0e).call(this,n.type,r)},u0e=function(t,r=rVn){return!!r.get(this.type)?.includes(t)},ahr=function(t,r){let n=Vt(t,Dn)[0],i=new oh(null,n,this.options);Vt(i,Dn).push(""),n.push(i),Di(this,to,Yze).call(this,t,r)},Yze=function(t,r){let n=Vt(t,Dn)[0];Vt(this,Dn).splice(r,1,...Vt(n,Dn));for(let i of Vt(n,Dn))typeof i=="object"&&So(i,Aa,this);So(this,nv,void 0)},shr=function(t){return!!thr.get(this.type)?.has(t)},lhr=function(t){if(!t||typeof t!="object"||t.type!==null||Vt(t,Dn).length!==1||this.type===null||Vt(this,Dn).length!==1)return!1;let r=Vt(t,Dn)[0];return!r||typeof r!="object"||r.type===null?!1:Di(this,to,shr).call(this,r.type)},chr=function(t){let r=thr.get(this.type),n=Vt(t,Dn)[0],i=r?.get(n.type);if(!i)return!1;So(this,Dn,Vt(n,Dn));for(let o of Vt(this,Dn))typeof o=="object"&&So(o,Aa,this);this.type=i,So(this,nv,void 0),So(this,KB,!1)},f0e=function(){var t,r;if(ehr(this)){let n=0,i=!1;do{i=!0;for(let o=0;o<Vt(this,Dn).length;o++){let a=Vt(this,Dn)[o];typeof a=="object"&&(Di(r=a,to,f0e).call(r),Di(this,to,jze).call(this,a)?(i=!1,Di(this,to,Yze).call(this,a,o)):Di(this,to,ohr).call(this,a)?(i=!1,Di(this,to,ahr).call(this,a,o)):Di(this,to,lhr).call(this,a)&&(i=!1,Di(this,to,chr).call(this,a)))}}while(!i&&++n<10)}else for(let n of Vt(this,Dn))typeof n=="object"&&Di(t=n,to,f0e).call(t);So(this,nv,void 0)},Kze=function(t){return Vt(this,Dn).map(r=>{if(typeof r=="string")throw new Error("string type in extglob ast??");let[n,i,o,a]=r.toRegExpSource(t);return So(this,O2,Vt(this,O2)||a),n}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")},uhr=function(t,r,n=!1){let i=!1,o="",a=!1,s=!1;for(let l=0;l<t.length;l++){let u=t.charAt(l);if(i){i=!1,o+=(aVn.has(u)?"\\":"")+u;continue}if(u==="*"){if(s)continue;s=!0,o+=n&&/^[*]+$/.test(t)?nhr:rhr,r=!0;continue}else s=!1;if(u==="\\"){l===t.length-1?o+="\\\\":i=!0;continue}if(u==="["){let[f,d,h,p]=Jdr(t,l);if(h){o+=f,a=a||d,l+=h-1,r=r||p;continue}}if(u==="?"){o+=Xze,r=!0;continue}o+=sVn(u)}return[o,Bk(t),!!r,a]},bu(zk,Hk);oh=zk;var Zze=(e,{windowsPathsNoEscape:t=!1,magicalBraces:r=!1}={})=>r?t?e.replace(/[?*()[\]{}]/g,"[$&]"):e.replace(/[?*()[\]\\{}]/g,"\\$&"):t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&");var Il=(e,t,r={})=>(KY(t),!r.nocomment&&t.charAt(0)==="#"?!1:new ZB(t,r).match(e)),cVn=/^\*+([^+@!?\*\[\(]*)$/,uVn=e=>t=>!t.startsWith(".")&&t.endsWith(e),fVn=e=>t=>t.endsWith(e),dVn=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),hVn=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),pVn=/^\*+\.\*+$/,mVn=e=>!e.startsWith(".")&&e.includes("."),gVn=e=>e!=="."&&e!==".."&&e.includes("."),yVn=/^\.\*+$/,vVn=e=>e!=="."&&e!==".."&&e.startsWith("."),bVn=/^\*+$/,xVn=e=>e.length!==0&&!e.startsWith("."),TVn=e=>e.length!==0&&e!=="."&&e!=="..",SVn=/^\?+([^+@!?\*\[\(]*)?$/,CVn=([e,t=""])=>{let r=hhr([e]);return t?(t=t.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(t)):r},wVn=([e,t=""])=>{let r=phr([e]);return t?(t=t.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(t)):r},kVn=([e,t=""])=>{let r=phr([e]);return t?n=>r(n)&&n.endsWith(t):r},_Vn=([e,t=""])=>{let r=hhr([e]);return t?n=>r(n)&&n.endsWith(t):r},hhr=([e])=>{let t=e.length;return r=>r.length===t&&!r.startsWith(".")},phr=([e])=>{let t=e.length;return r=>r.length===t&&r!=="."&&r!==".."},mhr=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",fhr={win32:{sep:"\\"},posix:{sep:"/"}},EVn=mhr==="win32"?fhr.win32.sep:fhr.posix.sep;Il.sep=EVn;var Qu=Symbol("globstar **");Il.GLOBSTAR=Qu;var RVn="[^/]",AVn=RVn+"*?",PVn="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",LVn="(?:(?!(?:\\/|^)\\.).)*?",MVn=(e,t={})=>r=>Il(r,e,t);Il.filter=MVn;var Xm=(e,t={})=>Object.assign({},e,t),IVn=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return Il;let t=Il;return Object.assign((n,i,o={})=>t(n,i,Xm(e,o)),{Minimatch:class extends t.Minimatch{constructor(i,o={}){super(i,Xm(e,o))}static defaults(i){return t.defaults(Xm(e,i)).Minimatch}},AST:class extends t.AST{constructor(i,o,a={}){super(i,o,Xm(e,a))}static fromGlob(i,o={}){return t.AST.fromGlob(i,Xm(e,o))}},unescape:(n,i={})=>t.unescape(n,Xm(e,i)),escape:(n,i={})=>t.escape(n,Xm(e,i)),filter:(n,i={})=>t.filter(n,Xm(e,i)),defaults:n=>t.defaults(Xm(e,n)),makeRe:(n,i={})=>t.makeRe(n,Xm(e,i)),braceExpand:(n,i={})=>t.braceExpand(n,Xm(e,i)),match:(n,i,o={})=>t.match(n,i,Xm(e,o)),sep:t.sep,GLOBSTAR:Qu})};Il.defaults=IVn;var ghr=(e,t={})=>(KY(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:Zdr(e,{max:t.braceExpandMax}));Il.braceExpand=ghr;var DVn=(e,t={})=>new ZB(e,t).makeRe();Il.makeRe=DVn;var NVn=(e,t,r={})=>{let n=new ZB(t,r);return e=e.filter(i=>n.match(i)),n.options.nonull&&!e.length&&e.push(t),e};Il.match=NVn;var dhr=/[?*]|[+@!]\(.*?\)|\[|\]/,OVn=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),yp,yhr,Qze,XB,ZB=class{constructor(t,r={}){bu(this,yp);tr(this,"options");tr(this,"set");tr(this,"pattern");tr(this,"windowsPathsNoEscape");tr(this,"nonegate");tr(this,"negate");tr(this,"comment");tr(this,"empty");tr(this,"preserveMultipleSlashes");tr(this,"partial");tr(this,"globSet");tr(this,"globParts");tr(this,"nocase");tr(this,"isWindows");tr(this,"platform");tr(this,"windowsNoMagicRoot");tr(this,"maxGlobstarRecursion");tr(this,"regexp");KY(t),r=r||{},this.options=r,this.maxGlobstarRecursion=r.maxGlobstarRecursion??200,this.pattern=t,this.platform=r.platform||mhr,this.isWindows=this.platform==="win32";let n="allowWindowsEscape";this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r[n]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let r of t)if(typeof r!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,r=this.options;if(!r.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],r.debug&&(this.debug=(...o)=>console.error(...o)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(o=>this.slashSplit(o));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let i=this.globParts.map((o,a,s)=>{if(this.isWindows&&this.windowsNoMagicRoot){let l=o[0]===""&&o[1]===""&&(o[2]==="?"||!dhr.test(o[2]))&&!dhr.test(o[3]),u=/^[a-z]:/i.test(o[0]);if(l)return[...o.slice(0,4),...o.slice(4).map(f=>this.parse(f))];if(u)return[o[0],...o.slice(1).map(f=>this.parse(f))]}return o.map(l=>this.parse(l))});if(this.debug(this.pattern,i),this.set=i.filter(o=>o.indexOf(!1)===-1),this.isWindows)for(let o=0;o<this.set.length;o++){let a=this.set[o];a[0]===""&&a[1]===""&&this.globParts[o][2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3])&&(a[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let n=0;n<t.length;n++)for(let i=0;i<t[n].length;i++)t[n][i]==="**"&&(t[n][i]="*");let{optimizationLevel:r=1}=this.options;return r>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):r>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(r=>{let n=-1;for(;(n=r.indexOf("**",n+1))!==-1;){let i=n;for(;r[i+1]==="**";)i++;i!==n&&r.splice(n,i-n)}return r})}levelOneOptimize(t){return t.map(r=>(r=r.reduce((n,i)=>{let o=n[n.length-1];return i==="**"&&o==="**"?n:i===".."&&o&&o!==".."&&o!=="."&&o!=="**"?(n.pop(),n):(n.push(i),n)},[]),r.length===0?[""]:r))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let i=1;i<t.length-1;i++){let o=t[i];i===1&&o===""&&t[0]===""||(o==="."||o==="")&&(r=!0,t.splice(i,1),i--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(r=!0,t.pop())}let n=0;for(;(n=t.indexOf("..",n+1))!==-1;){let i=t[n-1];i&&i!=="."&&i!==".."&&i!=="**"&&(r=!0,t.splice(n-1,2),n-=2)}}while(r);return t.length===0?[""]:t}firstPhasePreProcess(t){let r=!1;do{r=!1;for(let n of t){let i=-1;for(;(i=n.indexOf("**",i+1))!==-1;){let a=i;for(;n[a+1]==="**";)a++;a>i&&n.splice(i+1,a-i);let s=n[i+1],l=n[i+2],u=n[i+3];if(s!==".."||!l||l==="."||l===".."||!u||u==="."||u==="..")continue;r=!0,n.splice(i,1);let f=n.slice(0);f[i]="**",t.push(f),i--}if(!this.preserveMultipleSlashes){for(let a=1;a<n.length-1;a++){let s=n[a];a===1&&s===""&&n[0]===""||(s==="."||s==="")&&(r=!0,n.splice(a,1),a--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(r=!0,n.pop())}let o=0;for(;(o=n.indexOf("..",o+1))!==-1;){let a=n[o-1];if(a&&a!=="."&&a!==".."&&a!=="**"){r=!0;let l=o===1&&n[o+1]==="**"?["."]:[];n.splice(o-1,2,...l),n.length===0&&n.push(""),o-=2}}}}while(r);return t}secondPhasePreProcess(t){for(let r=0;r<t.length-1;r++)for(let n=r+1;n<t.length;n++){let i=this.partsMatch(t[r],t[n],!this.preserveMultipleSlashes);if(i){t[r]=[],t[n]=i;break}}return t.filter(r=>r.length)}partsMatch(t,r,n=!1){let i=0,o=0,a=[],s="";for(;i<t.length&&o<r.length;)if(t[i]===r[o])a.push(s==="b"?r[o]:t[i]),i++,o++;else if(n&&t[i]==="**"&&r[o]===t[i+1])a.push(t[i]),i++;else if(n&&r[o]==="**"&&t[i]===r[o+1])a.push(r[o]),o++;else if(t[i]==="*"&&r[o]&&(this.options.dot||!r[o].startsWith("."))&&r[o]!=="**"){if(s==="b")return!1;s="a",a.push(t[i]),i++,o++}else if(r[o]==="*"&&t[i]&&(this.options.dot||!t[i].startsWith("."))&&t[i]!=="**"){if(s==="a")return!1;s="b",a.push(r[o]),i++,o++}else return!1;return t.length===r.length&&a}parseNegate(){if(this.nonegate)return;let t=this.pattern,r=!1,n=0;for(let i=0;i<t.length&&t.charAt(i)==="!";i++)r=!r,n++;n&&(this.pattern=t.slice(n)),this.negate=r}matchOne(t,r,n=!1){let i=0,o=0;if(this.isWindows){let s=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),l=!s&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),u=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),f=!u&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3]),d=l?3:s?0:void 0,h=f?3:u?0:void 0;if(typeof d=="number"&&typeof h=="number"){let[p,m]=[t[d],r[h]];p.toLowerCase()===m.toLowerCase()&&(r[h]=p,o=h,i=d)}}let{optimizationLevel:a=1}=this.options;return a>=2&&(t=this.levelTwoFileOptimize(t)),r.includes(Qu)?Di(this,yp,yhr).call(this,t,r,n,i,o):Di(this,yp,XB).call(this,t,r,n,i,o)}braceExpand(){return ghr(this.pattern,this.options)}parse(t){KY(t);let r=this.options;if(t==="**")return Qu;if(t==="")return"";let n,i=null;(n=t.match(bVn))?i=r.dot?TVn:xVn:(n=t.match(cVn))?i=(r.nocase?r.dot?hVn:dVn:r.dot?fVn:uVn)(n[1]):(n=t.match(SVn))?i=(r.nocase?r.dot?wVn:CVn:r.dot?kVn:_Vn)(n):(n=t.match(pVn))?i=r.dot?gVn:mVn:(n=t.match(yVn))&&(i=vVn);let o=zk.fromGlob(t,this.options).toMMPattern();return i&&typeof o=="object"&&Reflect.defineProperty(o,"test",{value:i}),o}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let r=this.options,n=r.noglobstar?AVn:r.dot?PVn:LVn,i=new Set(r.nocase?["i"]:[]),o=t.map(l=>{let u=l.map(d=>{if(d instanceof RegExp)for(let h of d.flags.split(""))i.add(h);return typeof d=="string"?OVn(d):d===Qu?Qu:d._src});u.forEach((d,h)=>{let p=u[h+1],m=u[h-1];d!==Qu||m===Qu||(m===void 0?p!==void 0&&p!==Qu?u[h+1]="(?:\\/|"+n+"\\/)?"+p:u[h]=n:p===void 0?u[h-1]=m+"(?:\\/|\\/"+n+")?":p!==Qu&&(u[h-1]=m+"(?:\\/|\\/"+n+"\\/)"+p,u[h+1]=Qu))});let f=u.filter(d=>d!==Qu);if(this.partial&&f.length>=1){let d=[];for(let h=1;h<=f.length;h++)d.push(f.slice(0,h).join("/"));return"(?:"+d.join("|")+")"}return f.join("/")}).join("|"),[a,s]=t.length>1?["(?:",")"]:["",""];o="^"+a+o+s+"$",this.partial&&(o="^(?:\\/|"+a+o.slice(1,-1)+s+")$"),this.negate&&(o="^(?!"+o+").+$");try{this.regexp=new RegExp(o,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,r=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&r)return!0;let n=this.options;this.isWindows&&(t=t.split("\\").join("/"));let i=this.slashSplit(t);this.debug(this.pattern,"split",i);let o=this.set;this.debug(this.pattern,"set",o);let a=i[i.length-1];if(!a)for(let s=i.length-2;!a&&s>=0;s--)a=i[s];for(let s=0;s<o.length;s++){let l=o[s],u=i;if(n.matchBase&&l.length===1&&(u=[a]),this.matchOne(u,l,r))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(t){return Il.defaults(t).Minimatch}};yp=new WeakSet,yhr=function(t,r,n,i,o){let a=r.indexOf(Qu,o),s=r.lastIndexOf(Qu),[l,u,f]=n?[r.slice(o,a),r.slice(a+1),[]]:[r.slice(o,a),r.slice(a+1,s),r.slice(s+1)];if(l.length){let b=t.slice(i,i+l.length);if(!Di(this,yp,XB).call(this,b,l,n,0,0))return!1;i+=l.length,o+=l.length}let d=0;if(f.length){if(f.length+i>t.length)return!1;let b=t.length-f.length;if(Di(this,yp,XB).call(this,t,f,n,b,0))d=f.length;else{if(t[t.length-1]!==""||i+f.length===t.length||(b--,!Di(this,yp,XB).call(this,t,f,n,b,0)))return!1;d=f.length+1}}if(!u.length){let b=!!d;for(let x=i;x<t.length-d;x++){let C=String(t[x]);if(b=!0,C==="."||C===".."||!this.options.dot&&C.startsWith("."))return!1}return n||b}let h=[[[],0]],p=h[0],m=0,g=[0];for(let b of u)b===Qu?(g.push(m),p=[[],0],h.push(p)):(p[0].push(b),m++);let y=h.length-1,v=t.length-d;for(let b of h)b[1]=v-(g[y--]+b[0].length);return!!Di(this,yp,Qze).call(this,t,h,i,0,n,0,!!d)},Qze=function(t,r,n,i,o,a,s){let l=r[i];if(!l){for(let d=n;d<t.length;d++){s=!0;let h=t[d];if(h==="."||h===".."||!this.options.dot&&h.startsWith("."))return!1}return s}let[u,f]=l;for(;n<=f;){if(Di(this,yp,XB).call(this,t.slice(0,n+u.length),u,o,n,0)&&a<this.maxGlobstarRecursion){let p=Di(this,yp,Qze).call(this,t,r,n+u.length,i+1,o,a+1,s);if(p!==!1)return p}let h=t[n];if(h==="."||h===".."||!this.options.dot&&h.startsWith("."))return!1;n++}return o||null},XB=function(t,r,n,i,o){let a,s,l,u;for(a=i,s=o,u=t.length,l=r.length;a<u&&s<l;a++,s++){this.debug("matchOne loop");let f=r[s],d=t[a];if(this.debug(r,f,d),f===!1||f===Qu)return!1;let h;if(typeof f=="string"?(h=d===f,this.debug("string match",f,d,h)):(h=f.test(d),this.debug("pattern match",f,d,h)),!h)return!1}if(a===u&&s===l)return!0;if(a===u)return n;if(s===l)return a===u-1&&t[a]==="";throw new Error("wtf?")};Il.AST=zk;Il.Minimatch=ZB;Il.escape=Zze;Il.unescape=Bk;function vhr(e,t){let r=new Set,n=new Map;for(let i of ih(e)){let o=t.find(a=>Il(i.path,a));o&&n.set(i.path,o),(o||i.status==="removed")&&r.add(i.path)}return{dirs:bhr(e,n),files:r,fileGlobs:n}}function bhr(e,t){let r=new Set;for(let n of e){if(n.kind==="file")continue;let i=ih(n.children);i.length>0&&i.every(o=>t.has(o.path))&&r.add(n.path);for(let o of bhr(n.children,t))r.add(o)}return r}function Thr(e,t,r,n,i){return{...i,changes:xhr(e.overrides,r)+xhr(t.overrides,n),expandAll:()=>{e.onSet(r,!1),t.onSet(n,!1)},collapseAll:()=>t.onSet(n,!0),show:o=>{let a=[...o];e.onSet(r.filter(s=>a.some(l=>l.startsWith(`${s}/`))),!1),t.onSet(a,!1)},hide:o=>t.onSet(o,!0),reset:()=>{e.onReset(),t.onReset()}}}function xhr(e,t){return t.filter(r=>e.has(r)).length}function Shr(e,t,r){let n=(0,d0e.useMemo)(()=>vhr(t,r),[t,r]),i=(0,d0e.useMemo)(()=>ih(t).map(u=>u.path),[t]),o=(0,d0e.useMemo)(()=>Uze(t),[t]),a=QR(e,n.dirs),s=QR(`files:${e}`,n.files),l=Thr(a,s,o,i,Hze(t,a.collapsed,s.collapsed));return{dirs:a,files:s,fileGlobs:n.fileGlobs,filePaths:i,bulk:l}}var ZY=E(fe(),1);var BVn=/[*?[{]/;function Chr(e,t){let r=t.trim();if(!r)return new Set;if(!BVn.test(r)){let n=r.toLowerCase();return new Set(e.filter(i=>i.toLowerCase().includes(n)))}return new Set(e.filter(n=>Il(n,r,{matchBase:!0})))}function whr(e,t){let[r,n]=(0,ZY.useState)(""),i=(0,ZY.useMemo)(()=>Chr(e,r),[e,r]),o=(0,ZY.useMemo)(()=>[...new Set(["**/*.md",...t])],[t]);return{glob:r,onChangeGlob:n,matches:i,quickGlobs:o}}var khr=E(fe(),1);var h0e=E(fe(),1);function p0e(e,t){let[r,n]=(0,h0e.useState)(t);return(0,h0e.useEffect)(()=>{let i=e.current;if(!i||(n(i.offsetHeight),typeof ResizeObserver>"u"))return;let o=new ResizeObserver(()=>n(i.offsetHeight));return o.observe(i),()=>o.disconnect()},[e]),r}function _hr(){let e=(0,khr.useRef)(null),t=p0e(e,0);return{toolbarRef:e,offsetSx:{[Dze]:`${t}px`}}}var iA=E($(),1);function Ehr({structure:e,collapsedPaths:t,subject:r,comments:n}){let{dirs:i,files:o,fileGlobs:a,filePaths:s,bulk:l}=Shr(r,e.tree,t),{viewType:u,onChange:f}=pB(),d=whr(s,t),{toolbarRef:h,offsetSx:p}=_hr();return e.tree.length===0?(0,iA.jsx)(Le,{variant:"caption",sx:{color:"text.secondary"},children:"No changed files."}):(0,iA.jsxs)(ie,{sx:{minWidth:0,...p},children:[(0,iA.jsx)(gdr,{structure:e}),(0,iA.jsx)(mdr,{ref:h,bulk:l,viewType:u,onChangeViewType:f,...d}),(0,iA.jsx)(Gdr,{glob:d.glob,nodes:e.tree,collapsed:i.collapsed,onToggleDir:i.onToggle,collapsedFiles:o.collapsed,onToggleFile:o.onToggle,fileGlobs:a,matches:d.matches,viewType:u,comments:n})]})}var Mhr=E(fe(),1);function Rhr(e){return e.flatMap(({source:t,line:r})=>{let n=t.split(`
3881
3881
  `),i=`${r},${n.length}`;return[`@@ -${i} +${i} @@`,...n.map(o=>` ${o}`)]}).join(`
@@ -4019,7 +4019,7 @@ ${f.join(`
4019
4019
  `,mti=po`
4020
4020
  0%, 100% { transform: scale(1); }
4021
4021
  50% { transform: scale(1.08); }
4022
- `,ISr={content:'""',position:"absolute",borderRadius:"inherit",background:"conic-gradient(from calc(var(--rainbow-pill-h) * 1deg) in oklch longer hue, oklch(66% 0.21 0), oklch(66% 0.21 0))",animation:`${pti} 1.8s linear infinite`},gti={display:"inline-flex",alignItems:"center",px:1.5,py:"3px",borderRadius:999,position:"relative",isolation:"isolate",fontWeight:700,animation:`${mti} 1.6s ease-in-out infinite`,"&::before":{...ISr,inset:0,zIndex:-1},"&::after":{...ISr,inset:"-5px",zIndex:-2,filter:"blur(9px)",opacity:.85},"& span":{color:Gs.rainbowPill.text,textShadow:Gs.rainbowPill.shadow},"@media (prefers-reduced-motion: reduce)":{animation:"none","&::before, &::after":{animation:"none"}}};function DSr({children:e}){return(0,$A.jsxs)($A.Fragment,{children:[(0,$A.jsx)(J_,{styles:hti}),(0,$A.jsx)(ie,{component:"span","data-testid":"rainbow-pill",sx:gti,children:e})]})}function NSr({pct:e,timeLabel:t}){return[Math.round(e),...(t.match(/\d+/g)??[]).map(Number)].join(",")}function OSr(e){if(e.length!==2)return!1;let[t,r]=e;return NSr(t)===NSr(r)}var fT=E($(),1);function W1e({rateLimits:e}){let t=c_(3e4),r=[{window:e.five_hour,windowSeconds:18e3,fallbackLabel:"5h"},{window:e.seven_day,windowSeconds:604800,fallbackLabel:"7d"}].filter(o=>o.window?.used_percentage!=null),n=OSr(r.map(o=>({pct:o.window?.used_percentage??0,timeLabel:H1e(o.window?.resets_at,o.fallbackLabel,t)}))),i=r.map((o,a)=>(0,fT.jsxs)(BSr.Fragment,{children:[a>0?(0,fT.jsx)(ie,{component:"span",sx:{color:o$,mr:.5},children:","}):null,(0,fT.jsx)(MSr,{window:o.window,windowSeconds:o.windowSeconds,fallbackLabel:o.fallbackLabel,now:t})]},o.fallbackLabel));return n?(0,fT.jsx)(DSr,{children:i}):(0,fT.jsx)(fT.Fragment,{children:i})}var k_=E($(),1);function $Sr({groups:e}){return(0,k_.jsx)(k_.Fragment,{children:e.map((t,r)=>(0,k_.jsxs)(FSr.Fragment,{children:[(0,k_.jsx)(ie,{component:"span",sx:{color:o$,ml:r>0?1:0,mr:.5},children:Mu(t.harness)}),(0,k_.jsx)(W1e,{rateLimits:t.rateLimits})]},t.harness))})}function yti(e){if(e==="over")return{level:"warn",boundary:100};if(e==="warn")return{level:"ok",boundary:75}}function vti(e){if(e==="ok")return{level:"warn",boundary:75};if(e==="warn")return{level:"over",boundary:100}}function bti(e,t,r,n){if(e>=t)return;let i=e/t;return Math.round(r-n*(1-i))}function USr(e,t,r,n){if(t==null)return{kind:"unprojectable"};let i=yWe(t,r,n);if(i==null)return{kind:"unprojectable"};let o=l_(e,t,r,n),a=yti(o),s=vti(o);return{kind:"projected",recovery:a&&{level:a.level,pct:a.boundary*i,at:bti(e,a.boundary,t,r)},worse:s&&{level:s.level,pct:s.boundary*i}}}function G1e(e){return t=>t.tokens.color.onAppBar.level[e]}function WSr(e,t){return e.at==null?"not before reset":`${e.level==="ok"?"green":"under"} in ${r1e(e.at,t)}`}var N0=E($(),1);function $We({direction:e,threshold:t}){let r=e==="back",n={display:"inline-flex",gap:.5,minWidth:"6ch",justifyContent:r?"flex-end":"flex-start"};if(!t)return(0,N0.jsx)(ie,{component:"span",sx:n});let i=(0,N0.jsx)(ie,{component:"span",sx:{opacity:.6},children:r?"\u2190":"\u2192"}),o=(0,N0.jsxs)(ie,{component:"span",sx:{color:G1e(t.level)},children:[Math.round(t.pct),"%"]});return(0,N0.jsx)(ie,{component:"span",sx:n,children:r?(0,N0.jsxs)(N0.Fragment,{children:[o,i]}):(0,N0.jsxs)(N0.Fragment,{children:[i,o]})})}var __=E($(),1);function GSr({label:e,pct:t,resetsAt:r,windowSeconds:n,now:i}){let o=l_(t,r,n,i),a=USr(t,r,n,i),s=a.kind==="projected"?a:void 0;return(0,__.jsxs)(ie,{sx:{display:"flex",alignItems:"baseline",gap:.75},children:[(0,__.jsx)(ie,{component:"span",sx:{minWidth:"2ch"},children:e}),(0,__.jsx)($We,{direction:"back",threshold:s?.recovery}),(0,__.jsxs)(ie,{component:"span",sx:{minWidth:"4ch",textAlign:"right",color:G1e(o)},children:[Math.round(t),"%"]}),(0,__.jsx)($We,{direction:"forward",threshold:s?.worse}),(0,__.jsx)(ie,{component:"span",sx:{opacity:.6},children:s?s.recovery&&WSr(s.recovery,i):"no projection yet"})]})}function VSr(e){return[{label:"5h",window:e.five_hour,windowSeconds:18e3},{label:"7d",window:e.seven_day,windowSeconds:604800}].flatMap(t=>t.window?.used_percentage==null?[]:[{label:t.label,pct:t.window.used_percentage,resetsAt:t.window.resets_at,windowSeconds:t.windowSeconds}])}var qSr=E($(),1);function V1e({rateLimits:e,now:t}){return VSr(e).map(r=>(0,qSr.jsx)(GSr,{label:r.label,pct:r.pct,resetsAt:r.resetsAt,windowSeconds:r.windowSeconds,now:t},r.label))}var zA=E($(),1);function jSr({groups:e}){let t=c_(3e4);return(0,zA.jsxs)(ie,{sx:{fontFamily:"fontFamilyMono",fontSize:12},children:[e.map(r=>(0,zA.jsxs)(ie,{sx:{mb:.5},children:[(0,zA.jsx)(ie,{sx:{opacity:.8},children:Mu(r.harness)}),(0,zA.jsx)(V1e,{rateLimits:r.rateLimits,now:t})]},r.harness)),(0,zA.jsx)(ie,{sx:{mt:.5,opacity:.6},children:"Account usage per harness \u2014 view history"})]})}function YSr(e){return e?.five_hour?.used_percentage!=null||e?.seven_day?.used_percentage!=null}function KSr(e,t){let r=[];YSr(e)&&r.push({harness:"claude",rateLimits:e});for(let[n,i]of Object.entries(t))YSr(i)&&r.push({harness:n,rateLimits:i});return r}var xti={display:"flex",alignItems:"center",ml:2,fontFamily:"fontFamilyMono",fontSize:13},Tti={display:"flex",alignItems:"center",height:22,px:1,borderRadius:1,fontSize:"inherit","&:hover, &:focus-visible":{bgcolor:e=>e.tokens.color.statusBar?.hover,color:e=>e.tokens.color.statusBar?.hoverText}},XSr=e=>e?Tti:xti;var TX=E($(),1),zWe="Claude account usage (5h / 7d windows) \u2014 view history";function ZSr({rateLimits:e}){let t=c_(3e4);return(0,TX.jsxs)(ie,{sx:{fontFamily:"fontFamilyMono",fontSize:12},children:[(0,TX.jsx)(V1e,{rateLimits:e,now:t}),(0,TX.jsx)(ie,{sx:{mt:.5,opacity:.6},children:zWe})]})}var HA=E($(),1),Sti={};function q1e({rateLimits:e,harnessRateLimits:t=Sti,onStatusBar:r=!1}){let n=KSr(e,t),i=n.every(l=>l.harness==="claude"),o=e,a=zWe,s="Usage";return n.length>0&&i?(a=(0,HA.jsx)(ZSr,{rateLimits:o}),s=(0,HA.jsx)(W1e,{rateLimits:o})):n.length>0&&(a=(0,HA.jsx)(jSr,{groups:n}),s=(0,HA.jsx)($Sr,{groups:n})),(0,HA.jsx)(lr,{title:a,placement:r?"top-end":"bottom",children:(0,HA.jsx)(Kr,{component:ws,to:"/usage",underline:r?"none":"hover",color:"inherit",sx:XSr(r),children:s})})}var eCr=E(fe(),1);var E_="0.934.3";var j1e=E(fe(),1),HWe=(0,j1e.createContext)(null);function Y1e(){return(0,j1e.useContext)(HWe)}var UWe=E($(),1);function QSr(){let e=Y1e();return!e||e===E_?null:(0,UWe.jsx)(lr,{title:`Daemon is running v${e}, but this page was served by v${E_}. Restart the daemon to match.`,children:(0,UWe.jsx)(M1e,{fontSize:"small",color:"warning","aria-label":"Version mismatch"})})}var WWe=e=>e.tokens.color.statusBar,Cti={height:22,py:0,borderRadius:1,fontSize:"inherit",opacity:1,"&:hover, &:focus-visible":{bgcolor:e=>WWe(e)?.hover,color:e=>WWe(e)?.hoverText},"& .ready-count":{fontWeight:500,color:e=>WWe(e)?.readyText}},JSr=(e,t=!1)=>({display:"inline-flex",alignItems:"center",gap:.75,px:1,py:.25,borderRadius:999,fontSize:12,lineHeight:1.5,color:"inherit",opacity:e?1:.55,bgcolor:r=>e?w_(r).active:"transparent",transition:"opacity .2s ease, background-color .2s ease, color .2s ease","&:hover, &:focus-visible":{opacity:1,bgcolor:r=>w_(r).hover},"& .ready-dot":{width:t?6:8,height:t?6:8,borderRadius:"50%",bgcolor:r=>w_(r).dot,boxShadow:r=>`0 0 0 ${t?3:2}px ${w_(r).dotRing}`},"& .ready-count":{fontWeight:500},...t&&Cti});var sg=E($(),1);function K1e({onStatusBar:e=!1}){let{entries:t}=kF(),r=Oi(),n=(0,eCr.useCallback)(()=>r("/updates"),[r]),{matches:i,chords:o}=jn("openUpdates");if(Eo(i,n),!E_)return null;let a=t.filter(MF).length;return(0,sg.jsxs)(sg.Fragment,{children:[(0,sg.jsx)(lr,{describeChild:!0,placement:e?"top-start":"bottom",title:(0,sg.jsx)(Iu,{label:"Updates",chords:o}),children:(0,sg.jsxs)(pn,{component:ws,to:"/updates","aria-label":a?`Updates: ${a} node${a>1?"s have":" has"} an update ready`:"Updates",sx:JSr(a>0,e),children:[a>0&&(0,sg.jsx)("span",{className:"ready-dot","aria-hidden":!0}),(0,sg.jsxs)("span",{children:["v",E_]}),a>0&&(0,sg.jsxs)("span",{className:"ready-count",children:[a," ready"]})]})}),(0,sg.jsx)(QSr,{})]})}var X1e=E($(),1);function tCr({socket:e}){return(0,X1e.jsx)(PSr,{start:(0,X1e.jsx)(K1e,{onStatusBar:!0}),end:(0,X1e.jsx)(q1e,{rateLimits:e.rateLimits,harnessRateLimits:e.harnessRateLimits,onStatusBar:!0})})}var tve=E(fe(),1);var eve=E(fe(),1);function rCr(e,t,r){if(!e)return"Select a repo to search files.";if(r.error)return"Couldn't search files in this repo.";if(!(r.files.length>0||r.loading))return t?"No matching files.":"No files in this repo."}var R_=E($(),1),wti={display:"flex",gap:1,alignItems:"center",minWidth:0},kti={display:"flex",gap:1,alignItems:"baseline",minWidth:0,overflow:"hidden"},_ti={fontFamily:"fontFamilyMono",fontSize:13,whiteSpace:"nowrap"},Eti={fontFamily:"fontFamilyMono",fontSize:11,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function Rti(e){let t=e.lastIndexOf("/");return t===-1?{dir:"",basename:e}:{dir:e.slice(0,t),basename:e.slice(t+1)}}function nCr({files:e,highlight:t,onHighlight:r,onSelect:n}){return(0,R_.jsx)(Hp,{dense:!0,sx:{py:0},children:e.map((i,o)=>{let{dir:a,basename:s}=Rti(i);return(0,R_.jsxs)(ln,{selected:o===t,onMouseEnter:()=>r(o),onClick:()=>n(i),sx:wti,children:[(0,R_.jsx)(fB,{path:i}),(0,R_.jsxs)(ie,{sx:kti,children:[(0,R_.jsx)(Le,{component:"span",sx:_ti,children:s}),(0,R_.jsx)(Le,{component:"span",color:"text.secondary",sx:Eti,children:a})]})]},i)})})}var Z1e=E($(),1),Ati={maxHeight:420,overflowY:"auto"},Pti={px:2,py:2,fontSize:13};function iCr({message:e,files:t,highlight:r,onHighlight:n,onSelect:i}){return(0,Z1e.jsx)(ie,{sx:Ati,children:e?(0,Z1e.jsx)(Le,{color:"text.secondary",sx:Pti,children:e}):(0,Z1e.jsx)(nCr,{files:t,highlight:r,onHighlight:n,onSelect:i})})}var oCr=E($(),1),Lti={mt:6,alignSelf:"flex-start"};function Q1e({onClose:e,onEntered:t,centered:r=!1,children:n}){return(0,oCr.jsx)(Wl,{open:!0,onClose:e,maxWidth:"sm",fullWidth:!0,slotProps:{paper:{sx:r?void 0:Lti},transition:{onEntered:t}},children:n})}var J1e=E(fe(),1);var aCr={files:[],loading:!1,error:!1};function sCr(e,t){let[r,n]=(0,J1e.useState)(aCr),i=yr();return(0,J1e.useEffect)(()=>{if(!e){n(aCr);return}let o=!1;return n(s=>({...s,loading:!0})),(async()=>{try{let s=await fetch(qr(`/api/files?cwd=${encodeURIComponent(e)}&q=${encodeURIComponent(t)}`,i));if(!s.ok)throw new Error(`HTTP ${s.status}`);let l=await s.json();if(o)return;n({files:Array.isArray(l.files)?l.files:[],loading:!1,error:!1})}catch{o||n({files:[],loading:!1,error:!0})}})(),()=>{o=!0}},[e,t,i]),r}var UA=E($(),1);function Mti(e,t,r){let n=new URLSearchParams({path:e});return t&&n.set("cwd",t),t&&r&&n.set("node",r),`/file?${n}`}function lCr({onClose:e}){let{worktreeNode:t}=$n();return(0,UA.jsx)(mf.Provider,{value:t,children:(0,UA.jsx)(Iti,{onClose:e})})}function Iti({onClose:e}){let{worktreeCwd:t,worktreeNode:r}=$n(),[n,i]=(0,eve.useState)(""),o=sCr(t,n),a=Oi(),s=(0,eve.useRef)(null),l=p=>a(Mti(p,t,r)),{highlight:u,setHighlight:f,onKeyDown:d}=g_(o.files,n,l,e),h=p=>{l(p),e()};return(0,UA.jsxs)(Q1e,{onClose:e,onEntered:()=>s.current?.focus(),children:[(0,UA.jsx)(gS,{autoFocus:!0,inputRef:s,value:n,onChange:i,onKeyDown:d,placeholder:"Search files by name..."}),(0,UA.jsx)(iCr,{message:rCr(t,n,o),files:o.files,highlight:u,onHighlight:f,onSelect:h})]})}function cCr(e){Eo(jn("quickOpen").matches,e)}var fCr=E($(),1);function uCr(){let[e,t]=(0,tve.useState)(!1);return cCr((0,tve.useCallback)(()=>t(!0),[])),e?(0,fCr.jsx)(lCr,{onClose:()=>t(!1)}):null}var rve=E($(),1);function dCr({notice:e,onClose:t,onView:r}){let n=e?.sessionId??null;return(0,rve.jsx)(Bh,{open:e!==null,autoHideDuration:6e3,onClose:t,children:(0,rve.jsx)(yi,{severity:"success",variant:"filled",onClose:t,action:n!==null?(0,rve.jsx)(Dt,{color:"inherit",size:"small",onClick:()=>r(n),children:"View"}):void 0,children:e?.message})})}var wX=E(fe(),1);function hCr(e){let t=["claude"];return e.exposeCodexActions&&t.push("codex"),e.exposePiActions&&t.push("pi"),t}var _Cr=E(fe(),1);var pCr=E($(),1),mCr=st((0,pCr.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2"}),"Circle");var Dti={connected:"success.main",connecting:"warning.main",disconnected:"error.main","version-blocked":"error.main"};function gCr(e){return e?Dti[e]:"success.main"}function yCr(e){return e.split("-")[0].split(".").map(Number)}function vCr(e,t){if(!e||!t||e===t)return;let r=yCr(e),n=yCr(t);for(let i=0;i<Math.max(r.length,n.length);i++){let o=(r[i]??0)-(n[i]??0);if(Number.isNaN(o))return;if(o!==0)return o<0?"behind":"ahead"}}var WA=E($(),1),Nti={height:16,fontSize:10},Oti={opacity:.6,fontSize:"0.85em"};function Bti(e,t){if(t===e.local)return"this machine";let r=e.links.find(n=>n.name===t);return r?r.error?`${r.state}: ${r.error}`:r.state:""}function SX({nodes:e,name:t,showVersion:r=!1}){let n=Y1e()??E_,i=e.links.find(a=>a.name===t),o=vCr(i?.peerVersion,n);return(0,WA.jsx)(lr,{title:Bti(e,t),placement:"right",children:(0,WA.jsxs)(ie,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:.75},children:[(0,WA.jsx)(mCr,{sx:{fontSize:8,color:gCr(i?.state)}}),t,r&&i?.peerVersion&&(0,WA.jsxs)(ie,{component:"span",sx:Oti,children:["v",i.peerVersion]}),o&&(0,WA.jsx)(rn,{label:o,size:"small",color:o==="behind"?"warning":"info",sx:Nti})]})})}var GA=E($(),1),Fti={opacity:.6},$ti={display:"inline-flex",alignItems:"center",gap:.5,px:.5,border:1,borderStyle:"dashed",borderRadius:1};function bCr({nodes:e,name:t,clone:r}){let n=(0,GA.jsx)(SX,{nodes:e,name:t});return r.kind==="cloned"?n:r.kind==="unavailable"?(0,GA.jsx)(ie,{component:"span",sx:Fti,children:n}):(0,GA.jsx)(lr,{title:VF(t,r.cloneTarget),children:(0,GA.jsxs)(ie,{component:"span",sx:$ti,children:[(0,GA.jsx)(GF,{sx:{fontSize:14}}),n]})})}var TCr=E($(),1),zti={px:1.5,borderRadius:.75,fontSize:12,fontWeight:600,color:"text.secondary","&:hover":{color:"text.primary",bgcolor:"action.hover"},"&[aria-checked='true']":{color:"primary.main",bgcolor:"action.selected"},"&.Mui-focusVisible":{outline:2,outlineColor:"primary.main"}};function xCr({value:e,label:t,checked:r,autoFocus:n,onSelect:i}){return(0,TCr.jsx)(pn,{role:"radio","aria-checked":r,"data-value":e,tabIndex:r?0:-1,autoFocus:n&&r,onClick:i,sx:zti,children:t})}var SCr={ArrowRight:1,ArrowLeft:-1};function Hti(e,t,r){if(e.key==="Tab"){let n=t+(e.shiftKey?-1:1);return n>=0&&n<r?n:void 0}return(t+SCr[e.key]+r)%r}function CCr(e,t,r,n){return i=>{if(i.key==="ArrowUp"||i.key==="ArrowDown"){if(!n)return;i.preventDefault(),n();return}if(i.key!=="Tab"&&!SCr[i.key]){A2(i);return}let o=Hti(i,e.indexOf(t),e.length);o!==void 0&&(i.preventDefault(),r(e[o]),i.currentTarget.querySelector(`[data-value="${e[o]}"]`)?.focus())}}var wCr=E(fe(),1);function a$(e){return e?.querySelector('[aria-checked="true"]')}function kCr(e,t){(0,wCr.useEffect)(()=>{let r=e.current;if(!r?.contains(document.activeElement))return;let n=a$(r);n&&n!==document.activeElement&&n.focus()},[e,t])}var GWe=E($(),1),Uti={border:1,borderColor:"divider",borderRadius:1,height:40,p:"2px",flexShrink:0};function nve({label:e,options:t,value:r,onChange:n,optionLabel:i=u=>u,groupRef:o,autoFocus:a,onTrack:s,onToggleRow:l}){return kCr(o,r),(0,GWe.jsx)(Rt,{ref:o,direction:"row",role:"radiogroup","aria-label":e,spacing:"2px",onFocus:s,onKeyDown:CCr(t,r,n,l),sx:Uti,children:t.map(u=>(0,GWe.jsx)(xCr,{value:u,label:i(u),checked:u===r,autoFocus:a,onSelect:()=>n(u)},u))})}var VWe=E($(),1);function ECr({value:e,onChange:t,cloneState:r}){let{nodes:n,names:i,visible:o}=_c(),a=(0,_Cr.useRef)(null);return!o||!n||!e?null:(0,VWe.jsx)(nve,{label:"Machine",options:i,value:e,onChange:t,optionLabel:s=>(0,VWe.jsx)(bCr,{nodes:n,name:s,clone:r(s)}),groupRef:a,autoFocus:!1,onTrack:()=>{}})}var ACr=E($(),1);function RCr({value:e,onChange:t,placeholder:r,inputRef:n,autoFocus:i,onTrack:o}){return(0,ACr.jsx)(Jn,{value:e,onChange:a=>t(a.target.value),onKeyDown:A2,onFocus:o,onSelect:o,inputRef:n,placeholder:r,autoFocus:i,fullWidth:!0,multiline:!0,minRows:3,maxRows:12,slotProps:{htmlInput:{"aria-label":"Prompt"},input:{sx:{fontSize:14}}}})}var ICr=E(fe(),1);var dT={draft:{placeholder:"Describe the backlog item to draft...",submitLabel:"Start draft",sessionMode:"assist-draft"},bug:{placeholder:"Describe the bug: what happened, what you expected...",submitLabel:"File bug",sessionMode:"assist-bug"},prompt:{placeholder:Bge,submitLabel:"Start session"},design:{placeholder:"Describe the design task...",submitLabel:"Start design"}},PCr=Object.keys(dT);var qWe=E($(),1);function LCr({anchor:e,harness:t,harnesses:r,onPick:n,onClose:i}){return(0,qWe.jsx)(Bs,{open:e!==null,anchorEl:e,onClose:i,slotProps:{list:{dense:!0,"aria-label":"Harness"}},children:r.map(o=>(0,qWe.jsx)(ln,{role:"menuitemradio","aria-checked":o===t,selected:o===t,onClick:()=>{n(o),i()},sx:{fontSize:13},children:Mu(o)},o))})}var VA=E($(),1);function MCr(e){return t=>t==="prompt"&&e?(0,VA.jsxs)(VA.Fragment,{children:["prompt",(0,VA.jsx)(ie,{component:"span",sx:{fontWeight:400,whiteSpace:"pre"},children:` \xB7 ${Mu(e)}`}),(0,VA.jsx)(bd,{sx:{fontSize:18,mr:-.75}})]}):t}var qA=E($(),1);function DCr({draft:e,harness:t,harnesses:r,focus:n}){let[i,o]=(0,ICr.useState)(null),a=e.mode==="prompt"&&r.length>1,s=()=>o(a$(n.modeRef.current)??null),l=u=>{a&&u==="prompt"?s():e.setMode(u)};return(0,qA.jsxs)(qA.Fragment,{children:[(0,qA.jsx)(nve,{label:"Mode",options:PCr,value:e.mode,onChange:l,optionLabel:MCr(r.length>1?t:void 0),groupRef:n.modeRef,autoFocus:n.autoFocus==="mode",onTrack:n.trackMode,onToggleRow:a?s:void 0}),(0,qA.jsx)(LCr,{anchor:i,harness:t,harnesses:r,onPick:e.setHarness,onClose:()=>o(null)})]})}var VCr=E(fe(),1);var jWe=E($(),1),Wti={zIndex:e=>e.zIndex.modal+1};function NCr({open:e,anchor:t,children:r}){return(0,jWe.jsx)(Q6,{open:e,anchorEl:t,placement:"bottom-start",sx:Wti,children:(0,jWe.jsx)(tn,{sx:{maxHeight:240,overflowY:"auto",width:t?.clientWidth},onMouseDown:n=>n.preventDefault(),children:r})})}function OCr(e){return{htmlInput:{role:"combobox","aria-label":"Repo","aria-expanded":e},input:{sx:{fontSize:13,height:40}}}}var BCr=E(B6(),1);function FCr({open:e,highlighted:t,accept:r,close:n,navigate:i,openList:o}){return a=>{if(!e){if(a.key==="ArrowDown"){a.preventDefault(),o();return}A2(a);return}if(a.key!=="Escape"){if(a.key==="Enter"){if(a.preventDefault(),t===void 0)return;(0,BCr.flushSync)(()=>{r(t),n()}),A2(a);return}if(a.key!=="Tab"){i(a);return}t!==void 0&&r(t),n()}}}function $Cr(e,t){let r=t.trim().toLowerCase();return r?e.filter(n=>Tv(n).toLowerCase().includes(r)):e}var YWe=E(fe(),1);function zCr(){let[e,t]=(0,YWe.useState)(!1),[r,n]=(0,YWe.useState)("");return{open:e,query:r,show:()=>t(!0),filterBy:i=>{n(i),t(!0)},close:()=>{t(!1),n("")}}}var UCr=E(fe(),1);var HCr=e=>e?Tv(e):"";function WCr(e){let[t,r]=(0,UCr.useState)(()=>HCr(e));return{text:t,setText:r,showRepo:n=>r(HCr(n))}}function GCr(e,t,r){let n=zCr(),i=WCr(t),o=$Cr(e,n.query),a=f=>{r(f),i.showRepo(f)},s=g_(o,n.query,a,n.close),l=()=>s.setHighlight(Math.max(e.indexOf(t),0)),u=()=>{l(),n.show()};return{open:n.open,text:i.text,filtered:o,highlight:s.highlight,setHighlight:s.setHighlight,onKeyDown:FCr({open:n.open,highlighted:o[s.highlight],accept:a,close:n.close,navigate:s.onKeyDown,openList:u}),onClick:()=>{n.open||u()},onType:f=>{i.setText(f),n.filterBy(f)},onFocus:l,onBlur:()=>{n.close(),i.showRepo(t)},pick:f=>{a(f),n.close()}}}var s$=E($(),1);function qCr({repos:e,value:t,onChange:r,inputRef:n,autoFocus:i,onTrack:o}){let a=GCr(e,t,r),s=(0,VCr.useRef)(null);return(0,s$.jsxs)(ie,{ref:s,sx:{flex:1,minWidth:0},children:[(0,s$.jsx)(Jn,{value:a.text,onChange:l=>a.onType(l.target.value),onFocus:l=>{l.target.select(),a.onFocus(),o()},inputRef:n,autoFocus:i,onClick:a.onClick,onBlur:a.onBlur,onKeyDown:a.onKeyDown,placeholder:"Repo",size:"small",fullWidth:!0,slotProps:OCr(a.open)}),(0,s$.jsx)(NCr,{open:a.open,anchor:s.current,children:(0,s$.jsx)(E1e,{repos:a.filtered,selected:t,highlight:a.highlight,onHighlight:a.setHighlight,onSelect:a.pick})})]})}var A_=E($(),1);function jCr({cloneState:e,...t}){let{draft:r,focus:n}=t,{repos:i}=$n();return(0,A_.jsxs)(Rt,{spacing:1,sx:{p:1},children:[(0,A_.jsx)(RCr,{value:r.prompt,onChange:r.setPrompt,placeholder:dT[r.mode].placeholder,inputRef:n.promptRef,autoFocus:n.autoFocus==="prompt",onTrack:n.trackPrompt}),(0,A_.jsxs)(Rt,{direction:"row",spacing:1,sx:{alignItems:"flex-start"},children:[(0,A_.jsx)(qCr,{repos:i,value:r.cwd,onChange:r.setCwd,inputRef:n.repoRef,autoFocus:n.autoFocus==="repo",onTrack:n.trackRepo}),(0,A_.jsx)(DCr,{...t})]}),(0,A_.jsx)(ECr,{value:r.node,onChange:r.setNode,cloneState:e})]})}var l$=E($(),1),Gti=["Enter start","Shift+Enter newline","Esc close"],Vti={alignItems:"center",px:1.5,py:1,borderTop:1,borderColor:"divider",bgcolor:"action.hover"};function YCr({submitLabel:e,disabled:t=!1,loading:r=!1}){return(0,l$.jsxs)(Rt,{direction:"row",spacing:1.5,sx:Vti,children:[(0,l$.jsx)(Rt,{direction:"row",spacing:1.5,sx:{mr:"auto"},children:Gti.map(n=>(0,l$.jsx)(Le,{variant:"caption",color:"text.secondary",children:n},n))}),(0,l$.jsx)(Dt,{type:"submit",variant:"contained",size:"small",disabled:t,loading:r,children:e})]})}var jA=E(fe(),1);function KCr(e,t){let r=(0,jA.useRef)(e),n=(0,jA.useRef)(null),i=(0,jA.useRef)(null),o=(0,jA.useRef)(null),a=(0,jA.useCallback)(u=>{n.current=u;let{field:f,selectionStart:d,selectionEnd:h}=r.current;u&&f==="prompt"&&u.setSelectionRange(d,h)},[]),s=u=>{let f=u.target;t({field:"prompt",selectionStart:f.selectionStart,selectionEnd:f.selectionEnd})},l=()=>{if(o.current?.closest("form")?.contains(document.activeElement))return;let{field:u}=r.current;({repo:i.current,mode:a$(o.current),prompt:n.current}[u]??n.current)?.focus()};return{autoFocus:e.field,promptRef:a,repoRef:i,modeRef:o,trackPrompt:s,trackRepo:()=>t({...e,field:"repo"}),trackMode:()=>t({...e,field:"mode"}),restore:l}}function qti(e,t,r){return e?r.kind==="cloned"?{kind:"launch",cwd:r.cwd}:r.kind==="clonable"?{kind:"clone",prompt:A1e(r,t)}:{kind:"blocked"}:{kind:"launch",cwd:e}}function XCr(e,t){let{names:r,visible:n}=_c(),i=w1e(t,n?r:[void 0]);return{cloneState:i,target:qti(t,e,i(e))}}function ZCr({mode:e,harness:t,prompt:r,cwd:n,node:i},o){let a=n||void 0,s=i?[i]:[];if(e==="prompt"){t==="claude"?o.onCreate(r,a,...s):o.onCreateHarness(t,r,a,...s);return}if(e==="design"){o.onCreateDesign(r,a,...s);return}let l=i?[{node:i}]:[];wur(dT[e].sessionMode,n,(u,f)=>o.onCreateAssist(u,f,...l),()=>{},r)}function QCr(e,t,r,n){return r.kind==="blocked"||e.modePending?!1:r.kind==="clone"?(g1e(r.prompt,n.onCreateAssist),!0):(ZCr({mode:e.mode,harness:t,prompt:e.prompt,cwd:r.cwd,node:e.node},n),e.clear(),!0)}var ive=E(fe(),1);function JCr(e,t){let[r,n]=(0,ive.useState)(!1);return(0,ive.useEffect)(()=>{!r||e.modePending||(n(!1),t())},[r,e.modePending,t]),()=>{e.modePending?n(!0):t()}}function ewr(e,t,r,n,i){let o=JCr(e,()=>{QCr(e,t,r,n)&&i()});return a=>{a.preventDefault(),o()}}var CX=E(fe(),1);function twr(e,t){let r=(0,CX.useRef)(e),n=(0,CX.useRef)(null);return(0,CX.useEffect)(()=>{if(r.current&&!e){let i=n.current;i?.isConnected?i.focus():t()}r.current=e},[e,t]),i=>{n.current=i.target}}var nwr=E($(),1),jti={border:0,margin:0,padding:0,minWidth:0};function rwr({loading:e,restoreFocus:t,children:r}){let n=twr(e,t);return(0,nwr.jsx)("fieldset",{disabled:e,style:jti,onFocus:n,children:r})}var YA=E($(),1);function iwr({draft:e,launchers:t,onClose:r}){let n=KCr(e.focus,e.setFocus),i=hCr(f_()),o=i.includes(e.harness)?e.harness:"claude",{target:a,cloneState:s}=XCr(e.node,e.cwd),l=ewr(e,o,a,t,r);return(0,YA.jsx)(Q1e,{onClose:r,onEntered:n.restore,centered:!0,children:(0,YA.jsx)("form",{onSubmit:l,children:(0,YA.jsxs)(rwr,{loading:e.modePending,restoreFocus:n.restore,children:[(0,YA.jsx)(jCr,{draft:e,harness:o,harnesses:i,focus:n,cloneState:s}),(0,YA.jsx)(YCr,{submitLabel:a.kind==="clone"?"Clone":dT[e.mode].submitLabel,disabled:a.kind==="blocked",loading:e.modePending})]})})})}var ove=E(fe(),1);var Yti=1e3;async function Kti(e){try{let t=e?`?cwd=${encodeURIComponent(e)}`:"",n=await(await fetch(`/api/new-session-defaults${t}`)).json();return Object.hasOwn(dT,n?.mode)?n.mode:null}catch{return null}}function owr(e,t=0){let[r,n]=(0,ove.useState)(null);return(0,ove.useEffect)(()=>{let i=!1,o,a=async()=>{let s=await Kti(e);i||(s?n({cwd:e,opens:t,mode:s}):o=setTimeout(a,Yti))};return a(),()=>{i=!0,clearTimeout(o)}},[e,t]),r?{mode:r.mode,pending:r.cwd!==e||r.opens!==t}:null}function awr(e,{visible:t,names:r,selected:n}){if(t)return e&&r.includes(e)?e:n}var hT=E(fe(),1),swr={field:"prompt",selectionStart:0,selectionEnd:0};function lwr(){let[e,t]=(0,hT.useState)(""),[r,n]=(0,hT.useState)(),[i,o]=(0,hT.useState)(),[a,s]=(0,hT.useState)("claude"),[l,u]=(0,hT.useState)(),[f,d]=(0,hT.useState)(swr),h=(0,hT.useCallback)(()=>{t(""),n(void 0),o(void 0),u(void 0),d(swr)},[]);return{prompt:e,cwd:r,mode:i,harness:a,node:l,focus:f,setPrompt:t,setNode:u,setCwd:n,setMode:o,setHarness:s,setFocus:d,clear:h}}function cwr(e,t=owr){let{selectedCwd:r}=$n(),n=_c(),i=lwr(),o=i.cwd??r,a=t(o,e);return a?{...i,cwd:o,mode:i.mode??a.mode,modePending:i.mode===void 0&&a.pending,node:awr(i.node,n)}:null}function uwr(e){Eo(jn("newSession").matches,e)}var fwr=E(fe(),1);function dwr(e,t){let{selectedCwd:r}=$n(),[n,i]=Uc(),o=n.get("new"),a=n.get("newCwd")??r,{setPrompt:s,setCwd:l,setFocus:u}=e??{};(0,fwr.useEffect)(()=>{o===null||!s||!l||!u||(o&&(s(o),l(a),u({field:"prompt",selectionStart:o.length,selectionEnd:o.length})),t(),i(f=>(f.delete("new"),f.delete("newCwd"),f),{replace:!0}))},[o,a,s,l,u,t,i])}var pwr=E($(),1);function hwr({launchers:e}){let[t,r]=(0,wX.useState)(!1),[n,i]=(0,wX.useState)(0),o=cwr(n),a=(0,wX.useCallback)(()=>{r(!0),i(s=>s+1)},[]);return uwr(a),dwr(o,a),!t||!o?null:(0,pwr.jsx)(iwr,{draft:o,launchers:e,onClose:()=>r(!1)})}var ave=E($(),1);function mwr({reconnecting:e}){return(0,ave.jsx)(Bh,{open:e,children:(0,ave.jsx)(yi,{severity:"info",variant:"filled",icon:(0,ave.jsx)(oo,{size:16,color:"inherit"}),children:"Reconnecting\u2026"})})}var Rv=E($(),1);function gwr({socket:e,onViewLaunchedSession:t}){return(0,Rv.jsxs)(Rv.Fragment,{children:[(0,Rv.jsx)(uCr,{}),(0,Rv.jsx)(hwr,{launchers:{onCreate:e.createSession,onCreateDesign:e.createDesignSession,onCreateHarness:e.createHarnessSession,onCreateAssist:e.createAssistSession}}),(0,Rv.jsx)(mwr,{reconnecting:e.reconnecting}),(0,Rv.jsx)(Xl,{error:e.error,onClose:e.clearError}),(0,Rv.jsx)(dCr,{notice:e.success,onClose:e.clearSuccess,onView:t})]})}var Av=E(fe(),1);var Xti=6e4;function Zti(e,t,r){return t.map(n=>e.find(i=>i.name===n)??{name:n,local:n===r,loading:!0})}function ywr(e){let t=e.nodes?.local,r=e.names.join(`
4022
+ `,ISr={content:'""',position:"absolute",borderRadius:"inherit",background:"conic-gradient(from calc(var(--rainbow-pill-h) * 1deg) in oklch longer hue, oklch(66% 0.21 0), oklch(66% 0.21 0))",animation:`${pti} 1.8s linear infinite`},gti={display:"inline-flex",alignItems:"center",px:1.5,py:"3px",borderRadius:999,position:"relative",isolation:"isolate",fontWeight:700,animation:`${mti} 1.6s ease-in-out infinite`,"&::before":{...ISr,inset:0,zIndex:-1},"&::after":{...ISr,inset:"-5px",zIndex:-2,filter:"blur(9px)",opacity:.85},"& span":{color:Gs.rainbowPill.text,textShadow:Gs.rainbowPill.shadow},"@media (prefers-reduced-motion: reduce)":{animation:"none","&::before, &::after":{animation:"none"}}};function DSr({children:e}){return(0,$A.jsxs)($A.Fragment,{children:[(0,$A.jsx)(J_,{styles:hti}),(0,$A.jsx)(ie,{component:"span","data-testid":"rainbow-pill",sx:gti,children:e})]})}function NSr({pct:e,timeLabel:t}){return[Math.round(e),...(t.match(/\d+/g)??[]).map(Number)].join(",")}function OSr(e){if(e.length!==2)return!1;let[t,r]=e;return NSr(t)===NSr(r)}var fT=E($(),1);function W1e({rateLimits:e}){let t=c_(3e4),r=[{window:e.five_hour,windowSeconds:18e3,fallbackLabel:"5h"},{window:e.seven_day,windowSeconds:604800,fallbackLabel:"7d"}].filter(o=>o.window?.used_percentage!=null),n=OSr(r.map(o=>({pct:o.window?.used_percentage??0,timeLabel:H1e(o.window?.resets_at,o.fallbackLabel,t)}))),i=r.map((o,a)=>(0,fT.jsxs)(BSr.Fragment,{children:[a>0?(0,fT.jsx)(ie,{component:"span",sx:{color:o$,mr:.5},children:","}):null,(0,fT.jsx)(MSr,{window:o.window,windowSeconds:o.windowSeconds,fallbackLabel:o.fallbackLabel,now:t})]},o.fallbackLabel));return n?(0,fT.jsx)(DSr,{children:i}):(0,fT.jsx)(fT.Fragment,{children:i})}var k_=E($(),1);function $Sr({groups:e}){return(0,k_.jsx)(k_.Fragment,{children:e.map((t,r)=>(0,k_.jsxs)(FSr.Fragment,{children:[(0,k_.jsx)(ie,{component:"span",sx:{color:o$,ml:r>0?1:0,mr:.5},children:Mu(t.harness)}),(0,k_.jsx)(W1e,{rateLimits:t.rateLimits})]},t.harness))})}function yti(e){if(e==="over")return{level:"warn",boundary:100};if(e==="warn")return{level:"ok",boundary:75}}function vti(e){if(e==="ok")return{level:"warn",boundary:75};if(e==="warn")return{level:"over",boundary:100}}function bti(e,t,r,n){if(e>=t)return;let i=e/t;return Math.round(r-n*(1-i))}function USr(e,t,r,n){if(t==null)return{kind:"unprojectable"};let i=yWe(t,r,n);if(i==null)return{kind:"unprojectable"};let o=l_(e,t,r,n),a=yti(o),s=vti(o);return{kind:"projected",recovery:a&&{level:a.level,pct:a.boundary*i,at:bti(e,a.boundary,t,r)},worse:s&&{level:s.level,pct:s.boundary*i}}}function G1e(e){return t=>t.tokens.color.onAppBar.level[e]}function WSr(e,t){return e.at==null?"not before reset":`${e.level==="ok"?"green":"under"} in ${r1e(e.at,t)}`}var N0=E($(),1);function $We({direction:e,threshold:t}){let r=e==="back",n={display:"inline-flex",gap:.5,minWidth:"6ch",justifyContent:r?"flex-end":"flex-start"};if(!t)return(0,N0.jsx)(ie,{component:"span",sx:n});let i=(0,N0.jsx)(ie,{component:"span",sx:{opacity:.6},children:r?"\u2190":"\u2192"}),o=(0,N0.jsxs)(ie,{component:"span",sx:{color:G1e(t.level)},children:[Math.round(t.pct),"%"]});return(0,N0.jsx)(ie,{component:"span",sx:n,children:r?(0,N0.jsxs)(N0.Fragment,{children:[o,i]}):(0,N0.jsxs)(N0.Fragment,{children:[i,o]})})}var __=E($(),1);function GSr({label:e,pct:t,resetsAt:r,windowSeconds:n,now:i}){let o=l_(t,r,n,i),a=USr(t,r,n,i),s=a.kind==="projected"?a:void 0;return(0,__.jsxs)(ie,{sx:{display:"flex",alignItems:"baseline",gap:.75},children:[(0,__.jsx)(ie,{component:"span",sx:{minWidth:"2ch"},children:e}),(0,__.jsx)($We,{direction:"back",threshold:s?.recovery}),(0,__.jsxs)(ie,{component:"span",sx:{minWidth:"4ch",textAlign:"right",color:G1e(o)},children:[Math.round(t),"%"]}),(0,__.jsx)($We,{direction:"forward",threshold:s?.worse}),(0,__.jsx)(ie,{component:"span",sx:{opacity:.6},children:s?s.recovery&&WSr(s.recovery,i):"no projection yet"})]})}function VSr(e){return[{label:"5h",window:e.five_hour,windowSeconds:18e3},{label:"7d",window:e.seven_day,windowSeconds:604800}].flatMap(t=>t.window?.used_percentage==null?[]:[{label:t.label,pct:t.window.used_percentage,resetsAt:t.window.resets_at,windowSeconds:t.windowSeconds}])}var qSr=E($(),1);function V1e({rateLimits:e,now:t}){return VSr(e).map(r=>(0,qSr.jsx)(GSr,{label:r.label,pct:r.pct,resetsAt:r.resetsAt,windowSeconds:r.windowSeconds,now:t},r.label))}var zA=E($(),1);function jSr({groups:e}){let t=c_(3e4);return(0,zA.jsxs)(ie,{sx:{fontFamily:"fontFamilyMono",fontSize:12},children:[e.map(r=>(0,zA.jsxs)(ie,{sx:{mb:.5},children:[(0,zA.jsx)(ie,{sx:{opacity:.8},children:Mu(r.harness)}),(0,zA.jsx)(V1e,{rateLimits:r.rateLimits,now:t})]},r.harness)),(0,zA.jsx)(ie,{sx:{mt:.5,opacity:.6},children:"Account usage per harness \u2014 view history"})]})}function YSr(e){return e?.five_hour?.used_percentage!=null||e?.seven_day?.used_percentage!=null}function KSr(e,t){let r=[];YSr(e)&&r.push({harness:"claude",rateLimits:e});for(let[n,i]of Object.entries(t))YSr(i)&&r.push({harness:n,rateLimits:i});return r}var xti={display:"flex",alignItems:"center",ml:2,fontFamily:"fontFamilyMono",fontSize:13},Tti={display:"flex",alignItems:"center",height:22,px:1,borderRadius:1,fontSize:"inherit","&:hover, &:focus-visible":{bgcolor:e=>e.tokens.color.statusBar?.hover,color:e=>e.tokens.color.statusBar?.hoverText}},XSr=e=>e?Tti:xti;var TX=E($(),1),zWe="Claude account usage (5h / 7d windows) \u2014 view history";function ZSr({rateLimits:e}){let t=c_(3e4);return(0,TX.jsxs)(ie,{sx:{fontFamily:"fontFamilyMono",fontSize:12},children:[(0,TX.jsx)(V1e,{rateLimits:e,now:t}),(0,TX.jsx)(ie,{sx:{mt:.5,opacity:.6},children:zWe})]})}var HA=E($(),1),Sti={};function q1e({rateLimits:e,harnessRateLimits:t=Sti,onStatusBar:r=!1}){let n=KSr(e,t),i=n.every(l=>l.harness==="claude"),o=e,a=zWe,s="Usage";return n.length>0&&i?(a=(0,HA.jsx)(ZSr,{rateLimits:o}),s=(0,HA.jsx)(W1e,{rateLimits:o})):n.length>0&&(a=(0,HA.jsx)(jSr,{groups:n}),s=(0,HA.jsx)($Sr,{groups:n})),(0,HA.jsx)(lr,{title:a,placement:r?"top-end":"bottom",children:(0,HA.jsx)(Kr,{component:ws,to:"/usage",underline:r?"none":"hover",color:"inherit",sx:XSr(r),children:s})})}var eCr=E(fe(),1);var E_="0.934.4";var j1e=E(fe(),1),HWe=(0,j1e.createContext)(null);function Y1e(){return(0,j1e.useContext)(HWe)}var UWe=E($(),1);function QSr(){let e=Y1e();return!e||e===E_?null:(0,UWe.jsx)(lr,{title:`Daemon is running v${e}, but this page was served by v${E_}. Restart the daemon to match.`,children:(0,UWe.jsx)(M1e,{fontSize:"small",color:"warning","aria-label":"Version mismatch"})})}var WWe=e=>e.tokens.color.statusBar,Cti={height:22,py:0,borderRadius:1,fontSize:"inherit",opacity:1,"&:hover, &:focus-visible":{bgcolor:e=>WWe(e)?.hover,color:e=>WWe(e)?.hoverText},"& .ready-count":{fontWeight:500,color:e=>WWe(e)?.readyText}},JSr=(e,t=!1)=>({display:"inline-flex",alignItems:"center",gap:.75,px:1,py:.25,borderRadius:999,fontSize:12,lineHeight:1.5,color:"inherit",opacity:e?1:.55,bgcolor:r=>e?w_(r).active:"transparent",transition:"opacity .2s ease, background-color .2s ease, color .2s ease","&:hover, &:focus-visible":{opacity:1,bgcolor:r=>w_(r).hover},"& .ready-dot":{width:t?6:8,height:t?6:8,borderRadius:"50%",bgcolor:r=>w_(r).dot,boxShadow:r=>`0 0 0 ${t?3:2}px ${w_(r).dotRing}`},"& .ready-count":{fontWeight:500},...t&&Cti});var sg=E($(),1);function K1e({onStatusBar:e=!1}){let{entries:t}=kF(),r=Oi(),n=(0,eCr.useCallback)(()=>r("/updates"),[r]),{matches:i,chords:o}=jn("openUpdates");if(Eo(i,n),!E_)return null;let a=t.filter(MF).length;return(0,sg.jsxs)(sg.Fragment,{children:[(0,sg.jsx)(lr,{describeChild:!0,placement:e?"top-start":"bottom",title:(0,sg.jsx)(Iu,{label:"Updates",chords:o}),children:(0,sg.jsxs)(pn,{component:ws,to:"/updates","aria-label":a?`Updates: ${a} node${a>1?"s have":" has"} an update ready`:"Updates",sx:JSr(a>0,e),children:[a>0&&(0,sg.jsx)("span",{className:"ready-dot","aria-hidden":!0}),(0,sg.jsxs)("span",{children:["v",E_]}),a>0&&(0,sg.jsxs)("span",{className:"ready-count",children:[a," ready"]})]})}),(0,sg.jsx)(QSr,{})]})}var X1e=E($(),1);function tCr({socket:e}){return(0,X1e.jsx)(PSr,{start:(0,X1e.jsx)(K1e,{onStatusBar:!0}),end:(0,X1e.jsx)(q1e,{rateLimits:e.rateLimits,harnessRateLimits:e.harnessRateLimits,onStatusBar:!0})})}var tve=E(fe(),1);var eve=E(fe(),1);function rCr(e,t,r){if(!e)return"Select a repo to search files.";if(r.error)return"Couldn't search files in this repo.";if(!(r.files.length>0||r.loading))return t?"No matching files.":"No files in this repo."}var R_=E($(),1),wti={display:"flex",gap:1,alignItems:"center",minWidth:0},kti={display:"flex",gap:1,alignItems:"baseline",minWidth:0,overflow:"hidden"},_ti={fontFamily:"fontFamilyMono",fontSize:13,whiteSpace:"nowrap"},Eti={fontFamily:"fontFamilyMono",fontSize:11,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function Rti(e){let t=e.lastIndexOf("/");return t===-1?{dir:"",basename:e}:{dir:e.slice(0,t),basename:e.slice(t+1)}}function nCr({files:e,highlight:t,onHighlight:r,onSelect:n}){return(0,R_.jsx)(Hp,{dense:!0,sx:{py:0},children:e.map((i,o)=>{let{dir:a,basename:s}=Rti(i);return(0,R_.jsxs)(ln,{selected:o===t,onMouseEnter:()=>r(o),onClick:()=>n(i),sx:wti,children:[(0,R_.jsx)(fB,{path:i}),(0,R_.jsxs)(ie,{sx:kti,children:[(0,R_.jsx)(Le,{component:"span",sx:_ti,children:s}),(0,R_.jsx)(Le,{component:"span",color:"text.secondary",sx:Eti,children:a})]})]},i)})})}var Z1e=E($(),1),Ati={maxHeight:420,overflowY:"auto"},Pti={px:2,py:2,fontSize:13};function iCr({message:e,files:t,highlight:r,onHighlight:n,onSelect:i}){return(0,Z1e.jsx)(ie,{sx:Ati,children:e?(0,Z1e.jsx)(Le,{color:"text.secondary",sx:Pti,children:e}):(0,Z1e.jsx)(nCr,{files:t,highlight:r,onHighlight:n,onSelect:i})})}var oCr=E($(),1),Lti={mt:6,alignSelf:"flex-start"};function Q1e({onClose:e,onEntered:t,centered:r=!1,children:n}){return(0,oCr.jsx)(Wl,{open:!0,onClose:e,maxWidth:"sm",fullWidth:!0,slotProps:{paper:{sx:r?void 0:Lti},transition:{onEntered:t}},children:n})}var J1e=E(fe(),1);var aCr={files:[],loading:!1,error:!1};function sCr(e,t){let[r,n]=(0,J1e.useState)(aCr),i=yr();return(0,J1e.useEffect)(()=>{if(!e){n(aCr);return}let o=!1;return n(s=>({...s,loading:!0})),(async()=>{try{let s=await fetch(qr(`/api/files?cwd=${encodeURIComponent(e)}&q=${encodeURIComponent(t)}`,i));if(!s.ok)throw new Error(`HTTP ${s.status}`);let l=await s.json();if(o)return;n({files:Array.isArray(l.files)?l.files:[],loading:!1,error:!1})}catch{o||n({files:[],loading:!1,error:!0})}})(),()=>{o=!0}},[e,t,i]),r}var UA=E($(),1);function Mti(e,t,r){let n=new URLSearchParams({path:e});return t&&n.set("cwd",t),t&&r&&n.set("node",r),`/file?${n}`}function lCr({onClose:e}){let{worktreeNode:t}=$n();return(0,UA.jsx)(mf.Provider,{value:t,children:(0,UA.jsx)(Iti,{onClose:e})})}function Iti({onClose:e}){let{worktreeCwd:t,worktreeNode:r}=$n(),[n,i]=(0,eve.useState)(""),o=sCr(t,n),a=Oi(),s=(0,eve.useRef)(null),l=p=>a(Mti(p,t,r)),{highlight:u,setHighlight:f,onKeyDown:d}=g_(o.files,n,l,e),h=p=>{l(p),e()};return(0,UA.jsxs)(Q1e,{onClose:e,onEntered:()=>s.current?.focus(),children:[(0,UA.jsx)(gS,{autoFocus:!0,inputRef:s,value:n,onChange:i,onKeyDown:d,placeholder:"Search files by name..."}),(0,UA.jsx)(iCr,{message:rCr(t,n,o),files:o.files,highlight:u,onHighlight:f,onSelect:h})]})}function cCr(e){Eo(jn("quickOpen").matches,e)}var fCr=E($(),1);function uCr(){let[e,t]=(0,tve.useState)(!1);return cCr((0,tve.useCallback)(()=>t(!0),[])),e?(0,fCr.jsx)(lCr,{onClose:()=>t(!1)}):null}var rve=E($(),1);function dCr({notice:e,onClose:t,onView:r}){let n=e?.sessionId??null;return(0,rve.jsx)(Bh,{open:e!==null,autoHideDuration:6e3,onClose:t,children:(0,rve.jsx)(yi,{severity:"success",variant:"filled",onClose:t,action:n!==null?(0,rve.jsx)(Dt,{color:"inherit",size:"small",onClick:()=>r(n),children:"View"}):void 0,children:e?.message})})}var wX=E(fe(),1);function hCr(e){let t=["claude"];return e.exposeCodexActions&&t.push("codex"),e.exposePiActions&&t.push("pi"),t}var _Cr=E(fe(),1);var pCr=E($(),1),mCr=st((0,pCr.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2"}),"Circle");var Dti={connected:"success.main",connecting:"warning.main",disconnected:"error.main","version-blocked":"error.main"};function gCr(e){return e?Dti[e]:"success.main"}function yCr(e){return e.split("-")[0].split(".").map(Number)}function vCr(e,t){if(!e||!t||e===t)return;let r=yCr(e),n=yCr(t);for(let i=0;i<Math.max(r.length,n.length);i++){let o=(r[i]??0)-(n[i]??0);if(Number.isNaN(o))return;if(o!==0)return o<0?"behind":"ahead"}}var WA=E($(),1),Nti={height:16,fontSize:10},Oti={opacity:.6,fontSize:"0.85em"};function Bti(e,t){if(t===e.local)return"this machine";let r=e.links.find(n=>n.name===t);return r?r.error?`${r.state}: ${r.error}`:r.state:""}function SX({nodes:e,name:t,showVersion:r=!1}){let n=Y1e()??E_,i=e.links.find(a=>a.name===t),o=vCr(i?.peerVersion,n);return(0,WA.jsx)(lr,{title:Bti(e,t),placement:"right",children:(0,WA.jsxs)(ie,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:.75},children:[(0,WA.jsx)(mCr,{sx:{fontSize:8,color:gCr(i?.state)}}),t,r&&i?.peerVersion&&(0,WA.jsxs)(ie,{component:"span",sx:Oti,children:["v",i.peerVersion]}),o&&(0,WA.jsx)(rn,{label:o,size:"small",color:o==="behind"?"warning":"info",sx:Nti})]})})}var GA=E($(),1),Fti={opacity:.6},$ti={display:"inline-flex",alignItems:"center",gap:.5,px:.5,border:1,borderStyle:"dashed",borderRadius:1};function bCr({nodes:e,name:t,clone:r}){let n=(0,GA.jsx)(SX,{nodes:e,name:t});return r.kind==="cloned"?n:r.kind==="unavailable"?(0,GA.jsx)(ie,{component:"span",sx:Fti,children:n}):(0,GA.jsx)(lr,{title:VF(t,r.cloneTarget),children:(0,GA.jsxs)(ie,{component:"span",sx:$ti,children:[(0,GA.jsx)(GF,{sx:{fontSize:14}}),n]})})}var TCr=E($(),1),zti={px:1.5,borderRadius:.75,fontSize:12,fontWeight:600,color:"text.secondary","&:hover":{color:"text.primary",bgcolor:"action.hover"},"&[aria-checked='true']":{color:"primary.main",bgcolor:"action.selected"},"&.Mui-focusVisible":{outline:2,outlineColor:"primary.main"}};function xCr({value:e,label:t,checked:r,autoFocus:n,onSelect:i}){return(0,TCr.jsx)(pn,{role:"radio","aria-checked":r,"data-value":e,tabIndex:r?0:-1,autoFocus:n&&r,onClick:i,sx:zti,children:t})}var SCr={ArrowRight:1,ArrowLeft:-1};function Hti(e,t,r){if(e.key==="Tab"){let n=t+(e.shiftKey?-1:1);return n>=0&&n<r?n:void 0}return(t+SCr[e.key]+r)%r}function CCr(e,t,r,n){return i=>{if(i.key==="ArrowUp"||i.key==="ArrowDown"){if(!n)return;i.preventDefault(),n();return}if(i.key!=="Tab"&&!SCr[i.key]){A2(i);return}let o=Hti(i,e.indexOf(t),e.length);o!==void 0&&(i.preventDefault(),r(e[o]),i.currentTarget.querySelector(`[data-value="${e[o]}"]`)?.focus())}}var wCr=E(fe(),1);function a$(e){return e?.querySelector('[aria-checked="true"]')}function kCr(e,t){(0,wCr.useEffect)(()=>{let r=e.current;if(!r?.contains(document.activeElement))return;let n=a$(r);n&&n!==document.activeElement&&n.focus()},[e,t])}var GWe=E($(),1),Uti={border:1,borderColor:"divider",borderRadius:1,height:40,p:"2px",flexShrink:0};function nve({label:e,options:t,value:r,onChange:n,optionLabel:i=u=>u,groupRef:o,autoFocus:a,onTrack:s,onToggleRow:l}){return kCr(o,r),(0,GWe.jsx)(Rt,{ref:o,direction:"row",role:"radiogroup","aria-label":e,spacing:"2px",onFocus:s,onKeyDown:CCr(t,r,n,l),sx:Uti,children:t.map(u=>(0,GWe.jsx)(xCr,{value:u,label:i(u),checked:u===r,autoFocus:a,onSelect:()=>n(u)},u))})}var VWe=E($(),1);function ECr({value:e,onChange:t,cloneState:r}){let{nodes:n,names:i,visible:o}=_c(),a=(0,_Cr.useRef)(null);return!o||!n||!e?null:(0,VWe.jsx)(nve,{label:"Machine",options:i,value:e,onChange:t,optionLabel:s=>(0,VWe.jsx)(bCr,{nodes:n,name:s,clone:r(s)}),groupRef:a,autoFocus:!1,onTrack:()=>{}})}var ACr=E($(),1);function RCr({value:e,onChange:t,placeholder:r,inputRef:n,autoFocus:i,onTrack:o}){return(0,ACr.jsx)(Jn,{value:e,onChange:a=>t(a.target.value),onKeyDown:A2,onFocus:o,onSelect:o,inputRef:n,placeholder:r,autoFocus:i,fullWidth:!0,multiline:!0,minRows:3,maxRows:12,slotProps:{htmlInput:{"aria-label":"Prompt"},input:{sx:{fontSize:14}}}})}var ICr=E(fe(),1);var dT={draft:{placeholder:"Describe the backlog item to draft...",submitLabel:"Start draft",sessionMode:"assist-draft"},bug:{placeholder:"Describe the bug: what happened, what you expected...",submitLabel:"File bug",sessionMode:"assist-bug"},prompt:{placeholder:Bge,submitLabel:"Start session"},design:{placeholder:"Describe the design task...",submitLabel:"Start design"}},PCr=Object.keys(dT);var qWe=E($(),1);function LCr({anchor:e,harness:t,harnesses:r,onPick:n,onClose:i}){return(0,qWe.jsx)(Bs,{open:e!==null,anchorEl:e,onClose:i,slotProps:{list:{dense:!0,"aria-label":"Harness"}},children:r.map(o=>(0,qWe.jsx)(ln,{role:"menuitemradio","aria-checked":o===t,selected:o===t,onClick:()=>{n(o),i()},sx:{fontSize:13},children:Mu(o)},o))})}var VA=E($(),1);function MCr(e){return t=>t==="prompt"&&e?(0,VA.jsxs)(VA.Fragment,{children:["prompt",(0,VA.jsx)(ie,{component:"span",sx:{fontWeight:400,whiteSpace:"pre"},children:` \xB7 ${Mu(e)}`}),(0,VA.jsx)(bd,{sx:{fontSize:18,mr:-.75}})]}):t}var qA=E($(),1);function DCr({draft:e,harness:t,harnesses:r,focus:n}){let[i,o]=(0,ICr.useState)(null),a=e.mode==="prompt"&&r.length>1,s=()=>o(a$(n.modeRef.current)??null),l=u=>{a&&u==="prompt"?s():e.setMode(u)};return(0,qA.jsxs)(qA.Fragment,{children:[(0,qA.jsx)(nve,{label:"Mode",options:PCr,value:e.mode,onChange:l,optionLabel:MCr(r.length>1?t:void 0),groupRef:n.modeRef,autoFocus:n.autoFocus==="mode",onTrack:n.trackMode,onToggleRow:a?s:void 0}),(0,qA.jsx)(LCr,{anchor:i,harness:t,harnesses:r,onPick:e.setHarness,onClose:()=>o(null)})]})}var VCr=E(fe(),1);var jWe=E($(),1),Wti={zIndex:e=>e.zIndex.modal+1};function NCr({open:e,anchor:t,children:r}){return(0,jWe.jsx)(Q6,{open:e,anchorEl:t,placement:"bottom-start",sx:Wti,children:(0,jWe.jsx)(tn,{sx:{maxHeight:240,overflowY:"auto",width:t?.clientWidth},onMouseDown:n=>n.preventDefault(),children:r})})}function OCr(e){return{htmlInput:{role:"combobox","aria-label":"Repo","aria-expanded":e},input:{sx:{fontSize:13,height:40}}}}var BCr=E(B6(),1);function FCr({open:e,highlighted:t,accept:r,close:n,navigate:i,openList:o}){return a=>{if(!e){if(a.key==="ArrowDown"){a.preventDefault(),o();return}A2(a);return}if(a.key!=="Escape"){if(a.key==="Enter"){if(a.preventDefault(),t===void 0)return;(0,BCr.flushSync)(()=>{r(t),n()}),A2(a);return}if(a.key!=="Tab"){i(a);return}t!==void 0&&r(t),n()}}}function $Cr(e,t){let r=t.trim().toLowerCase();return r?e.filter(n=>Tv(n).toLowerCase().includes(r)):e}var YWe=E(fe(),1);function zCr(){let[e,t]=(0,YWe.useState)(!1),[r,n]=(0,YWe.useState)("");return{open:e,query:r,show:()=>t(!0),filterBy:i=>{n(i),t(!0)},close:()=>{t(!1),n("")}}}var UCr=E(fe(),1);var HCr=e=>e?Tv(e):"";function WCr(e){let[t,r]=(0,UCr.useState)(()=>HCr(e));return{text:t,setText:r,showRepo:n=>r(HCr(n))}}function GCr(e,t,r){let n=zCr(),i=WCr(t),o=$Cr(e,n.query),a=f=>{r(f),i.showRepo(f)},s=g_(o,n.query,a,n.close),l=()=>s.setHighlight(Math.max(e.indexOf(t),0)),u=()=>{l(),n.show()};return{open:n.open,text:i.text,filtered:o,highlight:s.highlight,setHighlight:s.setHighlight,onKeyDown:FCr({open:n.open,highlighted:o[s.highlight],accept:a,close:n.close,navigate:s.onKeyDown,openList:u}),onClick:()=>{n.open||u()},onType:f=>{i.setText(f),n.filterBy(f)},onFocus:l,onBlur:()=>{n.close(),i.showRepo(t)},pick:f=>{a(f),n.close()}}}var s$=E($(),1);function qCr({repos:e,value:t,onChange:r,inputRef:n,autoFocus:i,onTrack:o}){let a=GCr(e,t,r),s=(0,VCr.useRef)(null);return(0,s$.jsxs)(ie,{ref:s,sx:{flex:1,minWidth:0},children:[(0,s$.jsx)(Jn,{value:a.text,onChange:l=>a.onType(l.target.value),onFocus:l=>{l.target.select(),a.onFocus(),o()},inputRef:n,autoFocus:i,onClick:a.onClick,onBlur:a.onBlur,onKeyDown:a.onKeyDown,placeholder:"Repo",size:"small",fullWidth:!0,slotProps:OCr(a.open)}),(0,s$.jsx)(NCr,{open:a.open,anchor:s.current,children:(0,s$.jsx)(E1e,{repos:a.filtered,selected:t,highlight:a.highlight,onHighlight:a.setHighlight,onSelect:a.pick})})]})}var A_=E($(),1);function jCr({cloneState:e,...t}){let{draft:r,focus:n}=t,{repos:i}=$n();return(0,A_.jsxs)(Rt,{spacing:1,sx:{p:1},children:[(0,A_.jsx)(RCr,{value:r.prompt,onChange:r.setPrompt,placeholder:dT[r.mode].placeholder,inputRef:n.promptRef,autoFocus:n.autoFocus==="prompt",onTrack:n.trackPrompt}),(0,A_.jsxs)(Rt,{direction:"row",spacing:1,sx:{alignItems:"flex-start"},children:[(0,A_.jsx)(qCr,{repos:i,value:r.cwd,onChange:r.setCwd,inputRef:n.repoRef,autoFocus:n.autoFocus==="repo",onTrack:n.trackRepo}),(0,A_.jsx)(DCr,{...t})]}),(0,A_.jsx)(ECr,{value:r.node,onChange:r.setNode,cloneState:e})]})}var l$=E($(),1),Gti=["Enter start","Shift+Enter newline","Esc close"],Vti={alignItems:"center",px:1.5,py:1,borderTop:1,borderColor:"divider",bgcolor:"action.hover"};function YCr({submitLabel:e,disabled:t=!1,loading:r=!1}){return(0,l$.jsxs)(Rt,{direction:"row",spacing:1.5,sx:Vti,children:[(0,l$.jsx)(Rt,{direction:"row",spacing:1.5,sx:{mr:"auto"},children:Gti.map(n=>(0,l$.jsx)(Le,{variant:"caption",color:"text.secondary",children:n},n))}),(0,l$.jsx)(Dt,{type:"submit",variant:"contained",size:"small",disabled:t,loading:r,children:e})]})}var jA=E(fe(),1);function KCr(e,t){let r=(0,jA.useRef)(e),n=(0,jA.useRef)(null),i=(0,jA.useRef)(null),o=(0,jA.useRef)(null),a=(0,jA.useCallback)(u=>{n.current=u;let{field:f,selectionStart:d,selectionEnd:h}=r.current;u&&f==="prompt"&&u.setSelectionRange(d,h)},[]),s=u=>{let f=u.target;t({field:"prompt",selectionStart:f.selectionStart,selectionEnd:f.selectionEnd})},l=()=>{if(o.current?.closest("form")?.contains(document.activeElement))return;let{field:u}=r.current;({repo:i.current,mode:a$(o.current),prompt:n.current}[u]??n.current)?.focus()};return{autoFocus:e.field,promptRef:a,repoRef:i,modeRef:o,trackPrompt:s,trackRepo:()=>t({...e,field:"repo"}),trackMode:()=>t({...e,field:"mode"}),restore:l}}function qti(e,t,r){return e?r.kind==="cloned"?{kind:"launch",cwd:r.cwd}:r.kind==="clonable"?{kind:"clone",prompt:A1e(r,t)}:{kind:"blocked"}:{kind:"launch",cwd:e}}function XCr(e,t){let{names:r,visible:n}=_c(),i=w1e(t,n?r:[void 0]);return{cloneState:i,target:qti(t,e,i(e))}}function ZCr({mode:e,harness:t,prompt:r,cwd:n,node:i},o){let a=n||void 0,s=i?[i]:[];if(e==="prompt"){t==="claude"?o.onCreate(r,a,...s):o.onCreateHarness(t,r,a,...s);return}if(e==="design"){o.onCreateDesign(r,a,...s);return}let l=i?[{node:i}]:[];wur(dT[e].sessionMode,n,(u,f)=>o.onCreateAssist(u,f,...l),()=>{},r)}function QCr(e,t,r,n){return r.kind==="blocked"||e.modePending?!1:r.kind==="clone"?(g1e(r.prompt,n.onCreateAssist),!0):(ZCr({mode:e.mode,harness:t,prompt:e.prompt,cwd:r.cwd,node:e.node},n),e.clear(),!0)}var ive=E(fe(),1);function JCr(e,t){let[r,n]=(0,ive.useState)(!1);return(0,ive.useEffect)(()=>{!r||e.modePending||(n(!1),t())},[r,e.modePending,t]),()=>{e.modePending?n(!0):t()}}function ewr(e,t,r,n,i){let o=JCr(e,()=>{QCr(e,t,r,n)&&i()});return a=>{a.preventDefault(),o()}}var CX=E(fe(),1);function twr(e,t){let r=(0,CX.useRef)(e),n=(0,CX.useRef)(null);return(0,CX.useEffect)(()=>{if(r.current&&!e){let i=n.current;i?.isConnected?i.focus():t()}r.current=e},[e,t]),i=>{n.current=i.target}}var nwr=E($(),1),jti={border:0,margin:0,padding:0,minWidth:0};function rwr({loading:e,restoreFocus:t,children:r}){let n=twr(e,t);return(0,nwr.jsx)("fieldset",{disabled:e,style:jti,onFocus:n,children:r})}var YA=E($(),1);function iwr({draft:e,launchers:t,onClose:r}){let n=KCr(e.focus,e.setFocus),i=hCr(f_()),o=i.includes(e.harness)?e.harness:"claude",{target:a,cloneState:s}=XCr(e.node,e.cwd),l=ewr(e,o,a,t,r);return(0,YA.jsx)(Q1e,{onClose:r,onEntered:n.restore,centered:!0,children:(0,YA.jsx)("form",{onSubmit:l,children:(0,YA.jsxs)(rwr,{loading:e.modePending,restoreFocus:n.restore,children:[(0,YA.jsx)(jCr,{draft:e,harness:o,harnesses:i,focus:n,cloneState:s}),(0,YA.jsx)(YCr,{submitLabel:a.kind==="clone"?"Clone":dT[e.mode].submitLabel,disabled:a.kind==="blocked",loading:e.modePending})]})})})}var ove=E(fe(),1);var Yti=1e3;async function Kti(e){try{let t=e?`?cwd=${encodeURIComponent(e)}`:"",n=await(await fetch(`/api/new-session-defaults${t}`)).json();return Object.hasOwn(dT,n?.mode)?n.mode:null}catch{return null}}function owr(e,t=0){let[r,n]=(0,ove.useState)(null);return(0,ove.useEffect)(()=>{let i=!1,o,a=async()=>{let s=await Kti(e);i||(s?n({cwd:e,opens:t,mode:s}):o=setTimeout(a,Yti))};return a(),()=>{i=!0,clearTimeout(o)}},[e,t]),r?{mode:r.mode,pending:r.cwd!==e||r.opens!==t}:null}function awr(e,{visible:t,names:r,selected:n}){if(t)return e&&r.includes(e)?e:n}var hT=E(fe(),1),swr={field:"prompt",selectionStart:0,selectionEnd:0};function lwr(){let[e,t]=(0,hT.useState)(""),[r,n]=(0,hT.useState)(),[i,o]=(0,hT.useState)(),[a,s]=(0,hT.useState)("claude"),[l,u]=(0,hT.useState)(),[f,d]=(0,hT.useState)(swr),h=(0,hT.useCallback)(()=>{t(""),n(void 0),o(void 0),u(void 0),d(swr)},[]);return{prompt:e,cwd:r,mode:i,harness:a,node:l,focus:f,setPrompt:t,setNode:u,setCwd:n,setMode:o,setHarness:s,setFocus:d,clear:h}}function cwr(e,t=owr){let{selectedCwd:r}=$n(),n=_c(),i=lwr(),o=i.cwd??r,a=t(o,e);return a?{...i,cwd:o,mode:i.mode??a.mode,modePending:i.mode===void 0&&a.pending,node:awr(i.node,n)}:null}function uwr(e){Eo(jn("newSession").matches,e)}var fwr=E(fe(),1);function dwr(e,t){let{selectedCwd:r}=$n(),[n,i]=Uc(),o=n.get("new"),a=n.get("newCwd")??r,{setPrompt:s,setCwd:l,setFocus:u}=e??{};(0,fwr.useEffect)(()=>{o===null||!s||!l||!u||(o&&(s(o),l(a),u({field:"prompt",selectionStart:o.length,selectionEnd:o.length})),t(),i(f=>(f.delete("new"),f.delete("newCwd"),f),{replace:!0}))},[o,a,s,l,u,t,i])}var pwr=E($(),1);function hwr({launchers:e}){let[t,r]=(0,wX.useState)(!1),[n,i]=(0,wX.useState)(0),o=cwr(n),a=(0,wX.useCallback)(()=>{r(!0),i(s=>s+1)},[]);return uwr(a),dwr(o,a),!t||!o?null:(0,pwr.jsx)(iwr,{draft:o,launchers:e,onClose:()=>r(!1)})}var ave=E($(),1);function mwr({reconnecting:e}){return(0,ave.jsx)(Bh,{open:e,children:(0,ave.jsx)(yi,{severity:"info",variant:"filled",icon:(0,ave.jsx)(oo,{size:16,color:"inherit"}),children:"Reconnecting\u2026"})})}var Rv=E($(),1);function gwr({socket:e,onViewLaunchedSession:t}){return(0,Rv.jsxs)(Rv.Fragment,{children:[(0,Rv.jsx)(uCr,{}),(0,Rv.jsx)(hwr,{launchers:{onCreate:e.createSession,onCreateDesign:e.createDesignSession,onCreateHarness:e.createHarnessSession,onCreateAssist:e.createAssistSession}}),(0,Rv.jsx)(mwr,{reconnecting:e.reconnecting}),(0,Rv.jsx)(Xl,{error:e.error,onClose:e.clearError}),(0,Rv.jsx)(dCr,{notice:e.success,onClose:e.clearSuccess,onView:t})]})}var Av=E(fe(),1);var Xti=6e4;function Zti(e,t,r){return t.map(n=>e.find(i=>i.name===n)??{name:n,local:n===r,loading:!0})}function ywr(e){let t=e.nodes?.local,r=e.names.join(`
4023
4023
  `),[n,i]=(0,Av.useState)([]),o=(0,Av.useRef)(0),a=(0,Av.useCallback)(()=>{let l=r?r.split(`
4024
4024
  `):[];if(l.length===0)return;let u=++o.current;i(f=>Zti(f,l,t));for(let f of l)Yye(f,f===t).then(d=>{u===o.current&&i(h=>h.map(p=>p.name===f?d:p))})},[r,t]);(0,Av.useEffect)(()=>{a();let l=setInterval(a,Xti);return()=>clearInterval(l)},[a]);let s=n.length===0;return(0,Av.useMemo)(()=>({entries:n,loading:s,refresh:a}),[n,s,a])}var P_=E($(),1);function vwr({shell:e,children:t}){let{socket:r,selection:n,launch:i,sidebarCollapse:o}=e,a=ywr(r.nodeSelection);return(0,P_.jsx)(lWe.Provider,{value:a,children:(0,P_.jsx)(cwe.Provider,{value:o,children:(0,P_.jsx)(sU.Provider,{value:n,children:(0,P_.jsx)(EWe.Provider,{value:r.nodeSelection,children:(0,P_.jsx)(mf.Provider,{value:n.selectedNode,children:(0,P_.jsx)(X$e.Provider,{value:i,children:(0,P_.jsx)(Znt,{children:t})})})})})})})}var bwr=E($(),1),xwr=st((0,bwr.jsx)("path",{d:"M20 18c1.1 0 1.99-.9 1.99-2L22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2H0v2h24v-2zM4 6h16v10H4z"}),"Computer");var Twr=E(fe(),1);var O0=E($(),1),Qti={ml:1,textTransform:"none",fontSize:12};function Swr(){let{nodes:e,names:t,visible:r,selected:n,select:i}=_c(),[o,a]=(0,Twr.useState)(null);return!r||!e||!n?null:(0,O0.jsxs)(O0.Fragment,{children:[(0,O0.jsx)(Dt,{size:"small",color:"inherit",startIcon:(0,O0.jsx)(xwr,{fontSize:"small"}),"aria-label":"Machine","aria-haspopup":"menu",onClick:s=>a(s.currentTarget),sx:Qti,children:(0,O0.jsx)(SX,{nodes:e,name:n})}),(0,O0.jsx)(Bs,{anchorEl:o,open:!!o,onClose:()=>a(null),children:t.map(s=>(0,O0.jsx)(ln,{selected:s===n,onClick:()=>{i(s),a(null)},sx:{fontSize:13},children:(0,O0.jsx)(SX,{nodes:e,name:s,showVersion:!0})},s))})]})}var kX=E(fe(),1);function Cwr(e,t){return[...e[0].slice(0,-1),String(t+1)]}var sve=E($(),1);function wwr({index:e,label:t,...r}){let{chords:n}=jn("navTab");return(0,sve.jsx)(lr,{describeChild:!0,title:(0,sve.jsx)(Iu,{label:t,chords:[Cwr(n,e)]}),children:(0,sve.jsx)(tb,{label:t,...r})})}var KWe=E(fe(),1);function kwr(e,t){let{bound:r}=jn("navTab"),n=e.length,i=(0,KWe.useCallback)(a=>(gU(a,r)??n)<n,[r,n]),o=(0,KWe.useCallback)(a=>{let s=e[gU(a,r)??-1];s&&t(s)},[e,t,r]);Eo(i,o)}var lve=E(fe(),1);function _wr(){let[e,t]=(0,lve.useState)(!1);return(0,lve.useEffect)(()=>{let r=!1;return(async()=>{try{let i=await(await fetch("/api/news/nav")).json();r||t(i?.showInNav===!0)}catch{r||t(!1)}})(),()=>{r=!0}},[]),e}var cve=E(fe(),1);async function Jti(e,t){let r=await fetch(qr(`/api/releases/configured?cwd=${encodeURIComponent(e)}`,t));return r.ok?(await r.json())?.configured===!0:void 0}function Ewr(e){let[t,r]=(0,cve.useState)(null),n=yr(),i=`${n??""}\0${e}`;return(0,cve.useEffect)(()=>{if(!e)return;let o=!1;return Jti(e,n).catch(()=>{}).then(a=>{o||r({key:i,configured:a})}),()=>{o=!0}},[e,n,i]),t?.key===i?t.configured:void 0}var Rwr=E(fe(),1);function Awr(e){let{pathname:t}=Uo(),r=Oi(),n=t==="/releases"||t.startsWith("/releases/");(0,Rwr.useEffect)(()=>{e===!1&&n&&r("/sessions",{replace:!0})},[e,n,r])}var eri={path:"/sessions",label:"Sessions"},tri={path:"/backlog",label:"Backlog"},rri={path:"/next",label:"Next"},nri={path:"/releases",label:"Releases"},iri={path:"/news",label:"News"};function Pwr(e,t){return[eri,tri,rri,...e?[nri]:[],...t?[iri]:[]]}var XWe=E($(),1);function Lwr({cwd:e}){let t=Uo(),r=Oi(),n=Ewr(e),i=_wr();Awr(n);let o=n===!0,a=(0,kX.useMemo)(()=>Pwr(o,i),[o,i]),s=(0,kX.useMemo)(()=>a.map(f=>f.path),[a]),l=a.findIndex(f=>t.pathname.startsWith(f.path)),u=(0,kX.useCallback)(f=>{t.pathname!==f&&r(f)},[t.pathname,r]);return kwr(s,u),(0,XWe.jsx)(A5,{value:l===-1?!1:l,textColor:"inherit",indicatorColor:"secondary",children:a.map((f,d)=>(0,XWe.jsx)(wwr,{index:d,label:f.label,onClick:()=>u(f.path)},f.path))})}var Mwr=E($(),1),Iwr=st((0,Mwr.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m5 11h-4v4h-2v-4H7v-2h4V7h2v4h4z"}),"AddCircle");var _X=E($(),1),ori={color:"success.light"};function Dwr(){let[,e]=Uc(),{label:t,chords:r}=jn("newSession");return(0,_X.jsx)(lr,{title:(0,_X.jsx)(Iu,{label:t,chords:r}),children:(0,_X.jsx)(ir,{size:"small",sx:ori,"aria-label":"New session",onClick:()=>e(i=>(i.set("new",""),i),{replace:!0}),children:(0,_X.jsx)(Iwr,{})})})}var fve=E(fe(),1);var uve=E($(),1),ari={color:"inherit"};function Nwr({cwd:e}){let[t,r]=(0,fve.useState)(null),n=yr();return(0,fve.useEffect)(()=>{if(!e){r(null);return}let i=!1;return(async()=>{try{let a=await(await fetch(qr(`/api/github-url?cwd=${encodeURIComponent(e)}`,n))).json();i||r(a?.url??null)}catch{i||r(null)}})(),()=>{i=!0}},[e,n]),t?(0,uve.jsx)(lr,{title:"Open in GitHub",children:(0,uve.jsx)(ir,{sx:ari,onClick:()=>window.open(t,"_blank"),children:(0,uve.jsx)(TL,{})})}):null}var B0=E($(),1),sri={color:"inherit",mr:1.5};function Owr({reconnecting:e}){let{pending:t,error:r,clearError:n,restart:i}=s_("webserver",e);return(0,B0.jsxs)(B0.Fragment,{children:[(0,B0.jsx)(lr,{title:"Restart web server",children:(0,B0.jsx)("span",{children:(0,B0.jsx)(ir,{sx:sri,disabled:t,onClick:i,children:t?(0,B0.jsx)(oo,{size:24}):(0,B0.jsx)(qye,{})})})}),(0,B0.jsx)(Xl,{error:r,onClose:n})]})}var $wr=E(fe(),1);var Bwr=E(fe(),1);function Fwr(e){let t=Fn().palette.primary.main;Eo(jn("focusRepoPicker").matches,(0,Bwr.useCallback)(()=>jl({locate:()=>e.current?.querySelector("button")??null,focus:r=>r.focus()},t),[e,t]))}var EX=E($(),1),lri={width:240,ml:2};function zwr({repos:e,selected:t,onSelect:r}){let n=(0,$wr.useRef)(null);Fwr(n);let{chords:i}=jn("focusRepoPicker");return(0,EX.jsx)(ie,{ref:n,sx:lri,children:(0,EX.jsx)(Fge,{label:t?Tv(t):"Select repo...",tooltip:(0,EX.jsx)(Iu,{label:"Repo",chords:i}),typeToOpen:!0,children:(o,a)=>(0,EX.jsx)(R2r,{repos:e,selected:t,onSelect:r,close:o,initialFilter:a})})})}var Xwr=E(fe(),1);var RX=E(fe(),1);function dve(e){let[t,r]=(0,RX.useState)([]),[n,i]=(0,RX.useState)(!0),o=yr();return(0,RX.useEffect)(()=>{if(!e){r([]),i(!1);return}let a=!1;return i(!0),fetch(qr(`/api/pr-list?cwd=${encodeURIComponent(e)}`,o)).then(s=>s.json()).then(s=>{a||(r(Array.isArray(s?.prs)?s.prs:[]),i(!1))}).catch(()=>{a||(r([]),i(!1))}),()=>{a=!0}},[e,o]),{prs:t,loading:n}}var ZWe=E($(),1);function QWe({text:e}){return(0,ZWe.jsx)(ie,{sx:{p:1.5},children:(0,ZWe.jsx)(Le,{sx:{fontSize:13,color:"text.secondary"},children:e})})}var KA=E($(),1);function Hwr({pr:e,highlighted:t,onHover:r,onPick:n}){let i=_1e(t);return(0,KA.jsx)(ln,{ref:i,selected:t,onMouseDown:o=>o.preventDefault(),onMouseEnter:r,onClick:()=>n(e),sx:{alignItems:"flex-start",py:.75,whiteSpace:"normal"},children:(0,KA.jsxs)(Rt,{spacing:.25,sx:{minWidth:0},children:[(0,KA.jsxs)(Le,{sx:{fontSize:13,lineHeight:1.3,fontWeight:500},children:[e.title,e.isDraft&&(0,KA.jsx)(rn,{label:"Draft",size:"small",variant:"outlined",sx:{ml:.75,height:18,fontSize:10,verticalAlign:"middle"}})]}),(0,KA.jsxs)(Le,{sx:{fontSize:11,color:"text.secondary"},children:["#",e.number," \xB7 ",e.author," \xB7 ",_o(e.createdAt)]})]})})}var JWe=E($(),1);function Uwr({prs:e,highlight:t,onHighlight:r,onPick:n}){return(0,JWe.jsx)(Hp,{dense:!0,disablePadding:!0,sx:{maxHeight:200,overflowY:"auto"},children:e.map((i,o)=>(0,JWe.jsx)(Hwr,{pr:i,highlighted:o===t,onHover:()=>r(o),onPick:n},i.number))})}var Gwr=E(fe(),1);function Wwr(e,t){let r=t.trim().toLowerCase();if(!r)return e;let n=r.replace(/^#/,"");return e.filter(i=>i.title.toLowerCase().includes(r)||i.author.toLowerCase().includes(r)||n!==""&&String(i.number).includes(n))}function Vwr(e,t,r){let[n,i]=(0,Gwr.useState)(""),o=Wwr(e,n),{highlight:a,setHighlight:s,onKeyDown:l}=g_(o,n,t,r);return{filter:n,setFilter:i,filtered:o,highlight:a,setHighlight:s,onKeyDown:l,select:f=>{t(f),r()}}}var L_=E($(),1),qwr={...NB,left:"auto",width:320,maxHeight:"none",overflowY:"visible"};function jwr({cwd:e,onPick:t,close:r}){let{prs:n,loading:i}=dve(e),o=Vwr(n,t,r);return i||n.length===0?(0,L_.jsx)(tn,{elevation:4,sx:qwr,children:(0,L_.jsx)(QWe,{text:i?"Loading open PRs\u2026":"No open PRs"})}):(0,L_.jsxs)(tn,{elevation:4,sx:qwr,children:[(0,L_.jsx)(gS,{autoFocus:!0,value:o.filter,onChange:o.setFilter,onKeyDown:o.onKeyDown,placeholder:"Filter PRs..."}),o.filtered.length===0?(0,L_.jsx)(QWe,{text:"No PRs match"}):(0,L_.jsx)(Uwr,{prs:o.filtered,highlight:o.highlight,onHighlight:o.setHighlight,onPick:o.select})]})}var Kwr=E($(),1);function Ywr({cwd:e,onPick:t,close:r}){return(0,Kwr.jsx)(jwr,{cwd:e,onPick:t,close:r})}var M_=E($(),1);function Zwr({cwd:e,disabled:t,onSelect:r}){let{prs:n,loading:i}=dve(e),[o,a]=(0,Xwr.useState)(null);return i||n.length===0?null:(0,M_.jsxs)(M_.Fragment,{children:[(0,M_.jsx)(Fge,{label:"prs",disabled:t,children:s=>(0,M_.jsx)(Ywr,{cwd:e,onPick:a,close:s})}),o&&(0,M_.jsx)(mge,{pr:o,onSelect:s=>{r(o,s),a(null)},onCancel:()=>a(null)})]})}var Jwr=E($(),1);function Qwr({onStartRun:e,cwd:t}){let r=Ige(t);return!t||r.length===0?null:(0,Jwr.jsx)(Lge,{runs:r,onSelect:n=>e(n,t)})}var AX=E($(),1);function ekr({onCreateAssist:e,onStartRun:t}){let{selectedCwd:r,selectedNode:n}=$n();return(0,AX.jsxs)(Rt,{direction:"row",spacing:.5,sx:{alignItems:"center","&:not(:empty)":{ml:2}},children:[(0,AX.jsx)(Zwr,{cwd:r,disabled:!r,onSelect:(i,o)=>e([...o,String(i.number)],r,{...bB(i),node:n})}),(0,AX.jsx)(Qwr,{onStartRun:(i,o)=>t(i,o,void 0,void 0,n),cwd:r})]})}var ch=E($(),1),cri={minHeight:48,pl:1,pr:14};function tkr({socket:e,selection:t}){let{collapsed:r,onToggleCollapsed:n}=RS(),{design:i}=Fn();return(0,ch.jsxs)(R5,{variant:"dense",disableGutters:!0,sx:cri,children:[r&&(0,ch.jsx)(Cre,{collapsed:r,onToggleCollapsed:n}),(0,ch.jsx)(Owr,{reconnecting:e.reconnecting}),(0,ch.jsx)(Lwr,{cwd:t.selectedCwd}),(0,ch.jsx)(Swr,{}),(0,ch.jsx)(zwr,{repos:t.repos,selected:t.selectedCwd,onSelect:t.setSelectedCwd}),(0,ch.jsxs)(ie,{sx:{display:"flex",alignItems:"center",ml:1},children:[(0,ch.jsx)(zge,{cwd:t.selectedCwd}),(0,ch.jsx)(Nwr,{cwd:t.selectedCwd}),(0,ch.jsx)(Dwr,{})]}),(0,ch.jsx)(ekr,{onCreateAssist:e.createAssistSession,onStartRun:e.startRun}),i!=="slate"&&(0,ch.jsx)(q1e,{rateLimits:e.rateLimits,harnessRateLimits:e.harnessRateLimits})]})}var hve=E(fe(),1);function rkr(){let[e,t]=(0,hve.useState)(null);return(0,hve.useEffect)(()=>{let r=!1;return(async()=>{try{let i=await(await fetch("/api/health")).json();!r&&typeof i?.nodeName=="string"&&t(i.nodeName)}catch{}})(),()=>{r=!0}},[]),e}var ikr=E($(),1),uri={lineHeight:"32px",bgcolor:"transparent"};function nkr(){let e=rkr();return e?(0,ikr.jsx)(Cxe,{sx:uri,children:e}):null}var okr=E($(),1),akr=st((0,okr.jsx)("path",{d:"M20 5H4c-1.1 0-1.99.9-1.99 2L2 17c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m-9 3h2v2h-2zm0 3h2v2h-2zM8 8h2v2H8zm0 3h2v2H8zm-1 2H5v-2h2zm0-3H5V8h2zm9 7H8v-2h8zm0-4h-2v-2h2zm0-3h-2V8h2zm3 3h-2v-2h2zm0-3h-2V8h2z"}),"Keyboard");var skr=E($(),1),lkr=st((0,skr.jsx)("path",{d:"M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10c1.38 0 2.5-1.12 2.5-2.5 0-.61-.23-1.2-.64-1.67-.08-.1-.13-.21-.13-.33 0-.28.22-.5.5-.5H16c3.31 0 6-2.69 6-6 0-4.96-4.49-9-10-9m5.5 11c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5m-3-4c-.83 0-1.5-.67-1.5-1.5S13.67 6 14.5 6s1.5.67 1.5 1.5S15.33 9 14.5 9M5 11.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5S7.33 13 6.5 13 5 12.33 5 11.5m6-4c0 .83-.67 1.5-1.5 1.5S8 8.33 8 7.5 8.67 6 9.5 6s1.5.67 1.5 1.5"}),"Palette");var ckr=E($(),1),ukr=st((0,ckr.jsx)("path",{d:"m12 16.5 4-4h-3v-9h-2v9H8zm9-13h-6v1.99h6v14.03H3V5.49h6V3.5H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2v-14c0-1.1-.9-2-2-2"}),"SystemUpdateAlt");var fkr=E($(),1),dkr=st((0,fkr.jsx)("path",{d:"M20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12zM12 18c-.89 0-1.74-.2-2.5-.55C11.56 16.5 13 14.42 13 12s-1.44-4.5-3.5-5.45C10.26 6.2 11.11 6 12 6c3.31 0 6 2.69 6 6s-2.69 6-6 6"}),"Brightness4");var hkr=E($(),1),pkr=st((0,hkr.jsx)("path",{d:"M20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12zM12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6 6 2.69 6 6-2.69 6-6 6m0-10c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4"}),"Brightness7");var eGe=E($(),1);function mkr({mode:e}){return e==="dark"?(0,eGe.jsx)(pkr,{fontSize:"small"}):(0,eGe.jsx)(dkr,{fontSize:"small"})}var gkr=E($(),1),ykr=st((0,gkr.jsx)("path",{d:"m20.38 8.57-1.23 1.85a8 8 0 0 1-.22 7.58H5.07A8 8 0 0 1 15.58 6.85l1.85-1.23A10 10 0 0 0 3.35 19a2 2 0 0 0 1.72 1h13.85a2 2 0 0 0 1.74-1 10 10 0 0 0-.27-10.44zm-9.79 6.84a2 2 0 0 0 2.83 0l5.66-8.49-8.49 5.66a2 2 0 0 0 0 2.83"}),"Speed");var c$=E($(),1);function vkr(){let e=Cge();return(0,c$.jsxs)(ln,{onClick:()=>cmt(!e),children:[(0,c$.jsx)(Xv,{children:(0,c$.jsx)(ykr,{fontSize:"small"})}),(0,c$.jsx)(Th,{children:e?"Hide render HUD":"Show render HUD"})]})}var La=E($(),1);function bkr({mode:e,restartLabel:t,updateLabel:r,onToggleColorMode:n,onToggleDesign:i,onShowShortcuts:o,onRestart:a,onUpdate:s}){return[(0,La.jsxs)(ln,{onClick:n,children:[(0,La.jsx)(Xv,{children:(0,La.jsx)(mkr,{mode:e})}),(0,La.jsx)(Th,{children:"Toggle dark mode"})]},"color-mode"),(0,La.jsxs)(ln,{onClick:i,children:[(0,La.jsx)(Xv,{children:(0,La.jsx)(lkr,{fontSize:"small"})}),(0,La.jsx)(Th,{children:"Toggle Slate design"})]},"design"),(0,La.jsx)(vkr,{},"render-hud"),(0,La.jsxs)(ln,{onClick:o,children:[(0,La.jsx)(Xv,{children:(0,La.jsx)(akr,{fontSize:"small"})}),(0,La.jsx)(Th,{children:"Keyboard shortcuts"})]},"shortcuts"),(0,La.jsx)(Ci,{},"restart-divider"),(0,La.jsxs)(ln,{onClick:a,children:[(0,La.jsx)(Xv,{children:(0,La.jsx)(UL,{fontSize:"small"})}),(0,La.jsx)(Th,{children:t})]},"restart"),(0,La.jsxs)(ln,{onClick:s,children:[(0,La.jsx)(Xv,{children:(0,La.jsx)(ukr,{fontSize:"small"})}),(0,La.jsx)(Th,{children:r})]},"update")]}var xkr=E(fe(),1);var Skr=E($(),1);function Tkr({peer:e,onRestart:t,onClose:r}){let[n,i]=(0,xkr.useState)(!1);return(0,Skr.jsx)(bi,{title:`Restart ${e}?`,message:`Restarts the sessions daemon and web server on ${e}. Its sessions resume when the daemon is back. This page stays open.`,confirmLabel:"Restart",busy:n,autoFocusConfirm:!0,onConfirm:()=>{i(!0),t(e).finally(r)},onCancel:r})}function Ckr(e){let t=new Map;for(let r of e){let n=t.get(r.group)??[];n.push(r),t.set(r.group,n)}return[...t].map(([r,n])=>({name:r,shortcuts:n}))}var fri=Object.keys(BL);function wkr(){let e=FL();return Ckr(fri.map(t=>SS(t,e)))}var Rp=E($(),1),dri={display:"flex",alignItems:"center",justifyContent:"space-between",pr:1},hri={display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,py:.5};function kkr({onClose:e}){let t=wkr();return(0,Rp.jsxs)(Wl,{open:!0,onClose:e,maxWidth:"xs",fullWidth:!0,"aria-labelledby":"shortcuts-dialog-title",children:[(0,Rp.jsxs)(ku,{id:"shortcuts-dialog-title",sx:dri,children:["Keyboard shortcuts",(0,Rp.jsx)(ir,{size:"small","aria-label":"Close",onClick:e,children:(0,Rp.jsx)(Wo,{fontSize:"small"})})]}),(0,Rp.jsx)(wu,{dividers:!0,children:t.map(r=>(0,Rp.jsxs)(ie,{component:"section",sx:{mb:1.5},children:[(0,Rp.jsx)(Le,{variant:"overline",color:"text.secondary",children:r.name}),r.shortcuts.map(n=>(0,Rp.jsxs)(ie,{sx:hri,children:[(0,Rp.jsx)(Le,{variant:"body2",children:n.label}),(0,Rp.jsx)(Rt,{direction:"row",spacing:.5,children:(0,Rp.jsx)(ere,{chords:n.chords})})]},n.label))]},r.name))})]})}var XA=E($(),1);function _kr({reconnecting:e,onClose:t}){let{pending:r,error:n,clearError:i,restart:o}=s_(NF.target,e);return(0,XA.jsxs)(XA.Fragment,{children:[(0,XA.jsx)(bi,{title:NF.label,message:NF.message,confirmLabel:"Restart",busy:r,autoFocusConfirm:!0,onConfirm:()=>{o()},onCancel:t}),(0,XA.jsx)(Xl,{error:n,onClose:i})]})}var Rkr=E($(),1);function pri(e){return e?{title:`Update assist on ${e}?`,message:`This runs 'assist update' on ${e} as a new session, then restarts its web server. This page stays open.`}:{title:"Update assist",message:"This starts a new session running 'assist update'. Its output will appear in the terminal."}}function Ekr({peer:e,onConfirm:t,onClose:r}){return(0,Rkr.jsx)(bi,{...pri(e),confirmLabel:"Update",onConfirm:()=>{t(),r()},onCancel:r})}var F0=E(fe(),1);async function mri(e){try{let t=await fetch(`/api/node-doctor?link=${encodeURIComponent(e)}`);return t.ok?(await t.json()).hop:null}catch{return null}}async function Akr(e,t){let r=await mri(e);if(!r)return t;let n=r.remediation?` \u2014 ${r.remediation}`:"";return`${t}: ${r.hop} hop failed: ${r.error}${n}`}var pT=E(fe(),1);function Pkr(e){let{nodes:t}=_c(),[r,n]=(0,pT.useState)(null),i=(0,pT.useRef)(!1),o=r?t?.links.find(l=>l.name===r.peer):void 0;(0,pT.useEffect)(()=>{if(!(!r||!o)){if(o.state!=="connected"){i.current=!0;return}i.current&&(n(null),e(r.describe(r.peer,o.peerVersion)))}},[r,o,e]);let a=(0,pT.useCallback)((l,u)=>{i.current=!1,n({peer:l,describe:u})},[]),s=(0,pT.useCallback)(()=>n(null),[]);return{watch:a,stop:s}}var gri=9e4;function pve(){let[e,t]=(0,F0.useState)(null),[r,n]=(0,F0.useState)(null),i=(0,F0.useRef)(void 0),o=(0,F0.useCallback)(f=>{clearTimeout(i.current),t(f)},[]),{watch:a,stop:s}=Pkr(o);(0,F0.useEffect)(()=>()=>clearTimeout(i.current),[]);let l=(0,F0.useCallback)(async(f,d)=>{n(await Akr(f,d))},[]);return{requestThenAwait:(0,F0.useCallback)(async(f,d,h,p)=>{let m;try{m=await h()}catch{}return m?.ok?(a(f,p),clearTimeout(i.current),i.current=setTimeout(()=>{s(),l(f,`${f} did not come back`)},gri),!0):(await l(f,`${d} failed (${await DF(m)})`),!1)},[l,a,s]),back:e,clearBack:()=>t(null),error:r,clearError:()=>n(null)}}var yri=(e,t)=>t?`${e} is back (v${t})`:`${e} is back`;function Lkr(){let{requestThenAwait:e,...t}=pve();return{restart:n=>e(n,`Restart ${n}`,()=>a_("both",n),yri),...t}}var PX=E(fe(),1);var $0=E(fe(),1);function Mkr(e){return e.commandType==="assist"&&e.assistArgs?.[0]==="update"&&e.status==="done"}function mve(e,t,r){let[n,i]=(0,$0.useState)(!1),[o,a]=(0,$0.useState)(!1),s=(0,$0.useRef)(!1),l=(0,$0.useRef)(e);l.current=e;let u=(0,$0.useRef)(new Set),f=(0,$0.useCallback)(()=>{s.current=!1,a(!1),u.current=new Set(l.current.filter(Mkr).map(d=>d.id)),i(!0)},[]);return(0,$0.useEffect)(()=>{if(!n||o)return;if(t){s.current=!0;return}if(!s.current)return;e.some(h=>Mkr(h)&&h.node===r&&!u.current.has(h.id))&&a(!0)},[n,o,t,e,r]),{arm:f,completed:o}}var Ikr=(e,t)=>t?`${e} updated to v${t}`:`${e} updated`;function vri(e){return fetch(`/api/self-update?node=${encodeURIComponent(e)}`,{method:"POST"})}function Dkr(e){let{nodes:t}=_c(),{launchAssist:r}=al(),{requestThenAwait:n,...i}=pve(),[o,a]=(0,PX.useState)(null),[s,l]=(0,PX.useState)(),u=m=>t?.links.find(g=>g.name===m)?.state,{arm:f,completed:d}=mve(e,u(s)!=="connected",s);(0,PX.useEffect)(()=>{!d||!s||(l(void 0),n(s,`Restart ${s}'s web server`,()=>a_("webserver",s),Ikr))},[d,s,n]);let h=async m=>{a(`Updating assist on ${m}\u2026`),await n(m,`Update ${m}`,()=>vri(m),Ikr),a(null)};return{update:m=>{if(u(m)!=="connected"){h(m);return}l(m),f(),r(["update"],void 0,{node:m})},progress:o,...i}}var z0=E($(),1);function Nkr({dialog:e,peer:t,sessions:r,reconnecting:n,onClose:i}){let{launchAssist:o,armUpdateReload:a}=al(),s=Lkr(),l=Dkr(r);return(0,z0.jsxs)(z0.Fragment,{children:[e==="shortcuts"&&(0,z0.jsx)(kkr,{onClose:i}),e==="restart"&&t&&(0,z0.jsx)(Tkr,{peer:t,onRestart:s.restart,onClose:i}),e==="restart"&&!t&&(0,z0.jsx)(_kr,{reconnecting:n,onClose:i}),e==="update"&&(0,z0.jsx)(Ekr,{peer:t,onConfirm:()=>{if(t){l.update(t);return}a(),o(["update"])},onClose:i}),(0,z0.jsx)(jK,{notices:s}),(0,z0.jsx)(jK,{notices:l})]})}var Okr=E($(),1),Bkr=st((0,Okr.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings");var Fkr=E(fe(),1);var LX=E($(),1);function $kr(){let e=Oi(),t=(0,Fkr.useCallback)(()=>e("/config"),[e]),{matches:r,chords:n}=jn("openConfig");return Eo(r,t),(0,LX.jsx)(lr,{describeChild:!0,title:(0,LX.jsx)(Iu,{label:"Config",chords:n}),children:(0,LX.jsx)(ir,{size:"small",sx:{color:"inherit"},"aria-label":"Config",onClick:t,children:(0,LX.jsx)(Bkr,{fontSize:"small"})})})}var zkr=E($(),1),Hkr=st((0,zkr.jsx)("path",{d:"M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"}),"Menu");var gve=E(fe(),1);var MX=E($(),1);function Ukr({open:e,onOpen:t}){let r=(0,gve.useRef)(null),{matches:n,chords:i}=jn("openMenu");return Eo(n,(0,gve.useCallback)(()=>{r.current&&t(r.current)},[t])),(0,MX.jsx)(lr,{describeChild:!0,title:(0,MX.jsx)(Iu,{label:"Menu",chords:i}),children:(0,MX.jsx)(ir,{ref:r,onClick:o=>t(o.currentTarget),size:"small",sx:{color:"inherit"},"aria-label":"Open menu","aria-haspopup":"true","aria-expanded":e?"true":void 0,children:(0,MX.jsx)(Hkr,{fontSize:"small"})})})}var u$=E($(),1);function Wkr({open:e,onOpen:t}){let{design:r}=Fn();return(0,u$.jsxs)(ie,{sx:{position:"fixed",top:8,right:16,zIndex:n=>n.zIndex.drawer+2,display:"flex",alignItems:"center",gap:.5,color:"inherit"},children:[r!=="slate"&&(0,u$.jsx)(K1e,{}),(0,u$.jsx)($kr,{}),(0,u$.jsx)(Ukr,{open:e,onOpen:t})]})}var ZA=E(fe(),1);var Vkr=E(fe(),1);var Gkr=!0,bri=new Set(["openMenu","cycleCards"]),xri=Object.keys(BL).filter(e=>!bri.has(e));function qkr(e,t){let r=FL();(0,Vkr.useEffect)(()=>{if(!e)return;let n=i=>{xri.some(o=>SS(o,r).matches(i))&&t()};return globalThis.addEventListener("keydown",n,Gkr),()=>globalThis.removeEventListener("keydown",n,Gkr)},[e,t,r])}function jkr(){let[e,t]=(0,ZA.useState)(null),[r,n]=(0,ZA.useState)(!0),i=!!e,o=(0,ZA.useCallback)(()=>t(null),[]),a=(0,ZA.useCallback)(s=>{n(!0),t(s)},[]);return qkr(i,(0,ZA.useCallback)(()=>{n(!1),t(null)},[])),{anchorEl:e,open:i,close:o,openAt:a,restoreFocus:r}}var IX=E(fe(),1);function Ykr(e){Eo(jn("shortcutsSheet").matches,e)}function Kkr(){let[e,t]=(0,IX.useState)(null);Ykr((0,IX.useCallback)(()=>t("shortcuts"),[]));let r=(0,IX.useCallback)(()=>t(null),[]);return{dialog:e,showDialog:t,closeDialog:r}}function Xkr(){let{nodes:e,selected:t}=_c();return e&&t&&t!==e.local?t:void 0}function Zkr(e){return{restartLabel:e?`Restart ${e}`:NF.label,updateLabel:e?`Update assist on ${e}`:"Update assist"}}function Qkr(e,t,r){let n=i=>()=>{i(),e()};return{onToggleColorMode:n(t),onToggleDesign:n(r)}}var mT=E($(),1);function Jkr({mode:e,toggle:t,toggleDesign:r,sessions:n,reconnecting:i}){let{anchorEl:o,open:a,close:s,openAt:l,restoreFocus:u}=jkr(),{dialog:f,showDialog:d,closeDialog:h}=Kkr(),p=Xkr(),m=g=>()=>{s(),d(g)};return(0,mT.jsxs)(mT.Fragment,{children:[(0,mT.jsx)(Wkr,{open:a,onOpen:l}),(0,mT.jsxs)(Bs,{anchorEl:o,open:a,onClose:s,disableRestoreFocus:!u,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[(0,mT.jsx)(nkr,{}),bkr({mode:e,...Zkr(p),...Qkr(s,t,r),onShowShortcuts:m("shortcuts"),onRestart:m("restart"),onUpdate:m("update")})]}),(0,mT.jsx)(Nkr,{dialog:f,peer:p,sessions:n,reconnecting:i,onClose:h})]})}var r_r=E(fe(),1);var t_r=E($(),1);function e_r({conflict:e,onConfirm:t,onCancel:r}){let{name:n,cwd:i,port:o,group:a}=e.existing,s=nm(i),l=o?` on port ${o}`:"",u=s?` in ${s}`:"",f=a?`, holding the ${a} server slot`:"";return(0,t_r.jsx)(bi,{title:a?`Replace the ${a} server?`:"Replace running server?",message:`"${n}" is already serving${l}${u}${f}. Replace it \u2014 stop the running server and start this one?`,confirmLabel:"Replace",confirmColor:"error",onConfirm:t,onCancel:r})}var yve=E($(),1);function n_r({socket:e,children:t}){let{serverConflict:r,clearServerConflict:n,retrySession:i,stopSession:o,startRun:a,discardSession:s}=e,l=(0,r_r.useMemo)(()=>({onStop:o,onStart:a,onDiscard:s}),[o,a,s]),u=()=>{r&&(r.runName?a(r.runName,r.cwd,!0,r.launchedFrom,r.node):r.sessionId&&i(r.sessionId,!0),n())};return(0,yve.jsxs)(twe.Provider,{value:l,children:[t,r&&(0,yve.jsx)(e_r,{conflict:r,onConfirm:u,onCancel:n})]})}var i_r=new Map;function o_r(e,t){if(!uie())return;let r=i_r.get(e);if(i_r.set(e,t),!!r)for(let[n,i]of Object.entries(t))Object.is(i,r[n])||ky(`\u0394 ${e}.${n}`)}var bve=E(fe(),1);function a_r(e,t,r){if(!t)return null;let n=e[t];if(!n)return null;let i=r.find(o=>o.id===n);return!i||im(i)!==t?null:n}function Pv(e,t,r){if(e)return t.find(n=>n.id===e)??r.find(n=>n.sessionId===e)}function vve(){let{pathname:e}=Uo();return e.startsWith("/backlog")||e.startsWith("/usage")}function s_r({selectedCwd:e,selectedCardId:t,sessions:r,history:n,activeByRepo:i,onSelect:o}){let a=Pv(t,r,n),s=a&&im(a),l=!!(s&&s===e),u=a_r(i,e,r),f=(0,bve.useRef)(t),d=vve();(0,bve.useEffect)(()=>{let h=f.current!==t&&!!s;f.current=t,!(d||h||l||!u)&&o(u)},[t,s,l,u,o,d])}var Sve=E(fe(),1);function l_r(e,t,r,n){return Pv(e,t,r)?.cwd||n}function c_r(e,t,r,n){let i=l_r(e,t,r,n.cwd),o=Pv(e,t,r);return{cwd:i,node:o?.cwd?o.node:n.node}}var tGe=E(fe(),1);function u_r(e,t,r){let{cwd:n,node:i,origin:o}=r,a=(0,tGe.useCallback)((l,u)=>{let f=lT(u,t),d=pX(e,l);return d?d.clones[f]:f===(l===n?i:Ep)?l:void 0},[e,t,n,i]),s=(0,tGe.useCallback)(l=>pX(e,l)?.origin??(l===n?o:void 0),[e,n,o]);return{cloneOn:a,originOf:s}}var xve=E(fe(),1);function f_r(e,t,r,n){let i=(0,xve.useRef)(e);(0,xve.useEffect)(()=>{if(i.current===e)return;i.current=e;let o=pX(t,r)?.clones[e];o&&n(o,e)},[e,t,r,n])}var f$=E(fe(),1);function d_r(e,t,r){if(t.node!==void 0)return t.node;let n=new Set(e.flatMap(i=>Object.entries(i.clones).filter(([,o])=>o===t.cwd).map(([o])=>o)));return n.has(r)?r:n.size===0||n.has(Ep)?Ep:[...n][0]}function h_r(e,t,r,n){let[i,o]=(0,f$.useState)({cwd:e}),a=(0,f$.useCallback)((l,u,f)=>o({cwd:l,node:u,origin:f}),[]);(0,f$.useEffect)(()=>{e&&!i.cwd&&o({cwd:e})},[e,i.cwd]);let s=d_r(t,{cwd:i.cwd,node:i.node===void 0?void 0:lT(i.node,n)},r);return{selectedCwd:i.cwd,selectedNode:s||void 0,selectedPick:{cwd:i.cwd,node:s,origin:i.origin},setSelectedCwd:a}}var p_r=E(fe(),1);function Tve(e,t,r){let n=Pv(e,t,r);return n&&im(n)}function m_r(e,t,r,n){let i=Tve(e,t,r),o=Pv(e,t,r),a=o?.node??Ep,s=o?.repoGroup?.origin;(0,p_r.useEffect)(()=>{i&&n(i,a,s)},[i,a,s,n])}function g_r(e,t,r,n,i){let o=i.nodes?.local,a=lT(i.selected,o),s=(0,Sve.useMemo)(()=>eTr(e,t),[e,t]),{selectedCwd:l,selectedNode:u,selectedPick:f,setSelectedCwd:d}=h_r(e,s,a,o);m_r(r,n,t,d),f_r(a,s,l,d);let{cloneOn:h,originOf:p}=u_r(s,o,f),m=(0,Sve.useMemo)(()=>s.map(v=>tTr(v,a)),[s,a]),{cwd:g,node:y}=c_r(r,n,t,{cwd:l,node:u});return(0,Sve.useMemo)(()=>({repos:m,selectedCwd:l,selectedNode:u,worktreeCwd:g,worktreeNode:y,setSelectedCwd:d,cloneOn:h,originOf:p}),[m,l,u,g,y,d,h,p])}var wve=E(fe(),1);var I_=E(fe(),1);var y_r=E(fe(),1),Cve="assist:reloaded-after-update";function v_r(e){(0,y_r.useEffect)(()=>{globalThis.sessionStorage?.getItem(Cve)&&(globalThis.sessionStorage.removeItem(Cve),e({message:"Reloaded after updating assist",sessionId:null}))},[e])}function b_r(e,t,r,n){let{arm:i,completed:o}=mve(e,t),a=(0,I_.useRef)(!1),s=(0,I_.useCallback)(()=>{globalThis.sessionStorage?.setItem(Cve,"1")},[]),{error:l,restart:u}=s_("webserver",t,s);return v_r(r),(0,I_.useEffect)(()=>{l&&n(l)},[l,n]),(0,I_.useEffect)(()=>{!o||a.current||(a.current=!0,u())},[o,u]),{armUpdateReload:(0,I_.useCallback)(()=>{a.current=!1,i()},[i])}}function x_r(e){let{armUpdateReload:t}=b_r(e.sessions,e.reconnecting,e.setSuccess,e.setError),r=yy(e.selectSession),n=(0,wve.useMemo)(()=>({launchAssist:e.createAssistSession,launchAgentInStream:e.createSessionInStream,resumeSession:e.resumeSession,armUpdateReload:t,activateSession:r,sendInput:e.sendInput}),[e.createAssistSession,e.createSessionInStream,e.resumeSession,t,r,e.sendInput]),i=Oi(),o=(0,wve.useCallback)(a=>{e.selectSession(a),i("/sessions"),e.clearSuccess()},[i,e.selectSession,e.clearSuccess]);return{launch:n,viewLaunchedSession:o}}var T_r=E(fe(),1);function S_r(e,t,r,n){let i=Tve(e,t,r);(0,T_r.useEffect)(()=>{e&&i&&n({type:"set-active",cwd:i,sessionId:e})},[e,i,n])}var kve=E(fe(),1);function C_r(e,t){let r=(0,kve.useRef)(new Map);(0,kve.useEffect)(()=>{let n=new Set;for(let{id:i,status:o}of e)n.add(i),r.current.get(i)!==o&&(r.current.set(i,o),console.debug(`[sessions] render session ${i} status=${o}`),t({type:"ui-status",sessionId:i,status:o}));for(let i of r.current.keys())n.has(i)||r.current.delete(i)},[e,t])}var d$=E(fe(),1),w_r="assist.sessions.node";function Tri(){try{return localStorage.getItem(w_r)}catch{return null}}function Sri(e){try{localStorage.setItem(w_r,e)}catch{}}function k_r(e){let[t,r]=(0,d$.useState)(Tri),n=(0,d$.useCallback)(i=>{r(i),Sri(i)},[]);return(0,d$.useMemo)(()=>{let i=e?[e.local,...e.links.map(o=>o.name)]:[];return{nodes:e,names:i,visible:i.length>1,selected:t&&i.includes(t)?t:e?.local,select:n}},[e,t,n])}var E_r=E(fe(),1);function __r(e){let t=e;if(t.type==="create")return{cwd:t.cwd,title:t.prompt?.trim()||(t.design?"New design session":"New session"),node:t.node};if(t.type==="create-assist"){let r=t.title?.trim();return{cwd:t.cwd,title:r||"New session",named:!!r,node:t.node}}return null}function R_r(e,t){return(0,E_r.useCallback)(r=>{let n=e.current;n?.readyState===WebSocket.OPEN&&n.send(JSON.stringify(r));let i=__r(r);i&&t(i)},[e,t])}var Lv=E(fe(),1);function _ve(e,t,r,n,i){e({type:"create",prompt:r||void 0,cwd:n,...t,...i?{node:i}:{}})}function A_r(e){return(t,r,n)=>_ve(e,{design:!0},t,r,n)}function P_r(e){return(t,r,n,i)=>_ve(e,{harness:t},r,n,i)}function L_r(e){return(t,r,n)=>_ve(e,{auto:!0},t,r,n)}function M_r(e){return(t,r,n)=>e({type:"create-assist",assistArgs:t,cwd:r,...n})}function I_r(e){return(t,r,n,i,o)=>e({type:"resume",sessionId:t,cwd:r,name:n,harness:i,node:o})}function D_r(e,t){return(r,n)=>{t.delete(r),e({type:"retry",sessionId:r,replace:n})}}function N_r(e,t){return r=>{t.delete(r),e({type:"restart",sessionId:r})}}function O_r(e,t){return r=>{e({type:"dismiss",sessionId:r}),t.delete(r)}}function B_r(e,t){return r=>{e({type:"discard",sessionId:r}),t.delete(r)}}function F_r(e){return t=>e({type:"stop",sessionId:t})}function $_r(e){return(t,r,n,i,o)=>e({type:"create-run",runName:t,cwd:r,replace:n,launchedFrom:i,node:o})}function z_r(e){return(t,r)=>e({type:"set-autoapprove",sessionId:t,enabled:r})}function H_r(e){return(t,r)=>e({type:"set-autoadvance",sessionId:t,enabled:r})}function U_r(e){return(t,r)=>e({type:"set-starred",sessionId:t,starred:r})}function W_r(e){return(t,r)=>e({type:"input",sessionId:t,data:r,viewerId:qK})}function G_r(e){return(t,r,n,i)=>e({type:"resize",sessionId:t,cols:r,rows:n,viewerId:qK,claim:i==="claim",refresh:i==="refresh"})}function V_r(e){return(t,r,n,i)=>e({type:"pr-decision",sessionId:t,requestId:r,decision:n,...i})}var QA=E(fe(),1);function q_r(e){return(t,r,n)=>e({type:"create",prompt:r||void 0,cwd:n,joinSessionId:t,auto:!0})}function j_r(e){return{createSession:(0,QA.useMemo)(()=>L_r(e),[e]),createSessionInStream:(0,QA.useMemo)(()=>q_r(e),[e]),createDesignSession:(0,QA.useMemo)(()=>A_r(e),[e]),createHarnessSession:(0,QA.useMemo)(()=>P_r(e),[e]),createAssistSession:(0,QA.useMemo)(()=>M_r(e),[e]),resumeSession:(0,QA.useMemo)(()=>I_r(e),[e])}}var DX=E(fe(),1);function Y_r(e,t){let r=(0,DX.useCallback)((a,s)=>{D_r(e,t.current)(a,s)},[e,t]),n=(0,DX.useCallback)(a=>{N_r(e,t.current)(a)},[e,t]),i=(0,DX.useCallback)(a=>{O_r(e,t.current)(a)},[e,t]),o=(0,DX.useCallback)(a=>{B_r(e,t.current)(a)},[e,t]);return{retrySession:r,restartSession:n,dismissSession:i,discardSession:o}}function K_r(e,t,r){return(n,i)=>{let o=t.get(n);return o&&(i(o),e({type:"snapshot",sessionId:n})),r.set(n,i),()=>r.delete(n)}}function X_r(e,t,r){let n={...j_r(e),sendInput:(0,Lv.useMemo)(()=>W_r(e),[e]),sendResize:(0,Lv.useMemo)(()=>G_r(e),[e]),sendPrDecision:(0,Lv.useMemo)(()=>V_r(e),[e]),setAutoApprove:(0,Lv.useMemo)(()=>z_r(e),[e]),setAutoAdvance:(0,Lv.useMemo)(()=>H_r(e),[e]),setStarred:(0,Lv.useMemo)(()=>U_r(e),[e]),stopSession:(0,Lv.useMemo)(()=>F_r(e),[e]),startRun:(0,Lv.useMemo)(()=>$_r(e),[e])},i=(0,Lv.useMemo)(()=>K_r(e,t.current,r.current),[e,t,r]);return{...n,...Y_r(e,t),onOutput:i}}var NX=E(fe(),1);function Z_r(e,t,r){let n=(0,NX.useCallback)(s=>{r(s),e({type:"fetch-transcript",sessionId:s})},[e,r]),i=(0,NX.useCallback)(s=>e({type:"fetch-user-messages",sessionId:s}),[e]),o=(0,NX.useCallback)(()=>{r(null)},[r]),a=(0,NX.useCallback)(s=>{r(null),t(s)},[t,r]);return{viewTranscript:n,fetchUserMessages:i,clearTranscript:o,selectSession:a}}var Pve=E(fe(),1);function Q_r(e,t){let r=new Set(t.map(i=>i.id)),n=null;for(let i of Object.values(e))r.has(i)&&(n=i);return n}var h$=E(fe(),1);function J_r(){let[e,t]=(0,h$.useState)(null),r=(0,h$.useRef)(e);r.current=e;let n=(0,h$.useCallback)(()=>r.current,[]);return{activeId:e,setActiveId:t,getActiveId:n}}var t5r=E(fe(),1);function e5r(e,t,r=null){return t!==null?e.some(n=>n.id===t)?t:e[0]?.id??null:r&&e.some(n=>n.id===r)?r:e[0]?.id??null}function r5r(e,t,r){let n=vve();(0,t5r.useEffect)(()=>{if(n){t(null);return}t(i=>e5r(e,i,r))},[e,t,r,n])}var Eve=E(fe(),1);function n5r(){let[e,t]=(0,Eve.useState)({}),[r,n]=(0,Eve.useState)(null),[i,o]=(0,Eve.useState)(null);return{activeByRepo:e,setActiveByRepo:t,daemonVersion:r,setDaemonVersion:n,nodes:i,setNodes:o}}var H0=E(fe(),1);function i5r(e,t){for(let r of t)clearTimeout(e.get(r)),e.delete(r)}function o5r(e,t){let r=new Set(t.map(n=>n.id));return[...e.keys()].filter(n=>!r.has(n))}function a5r(e,t){if(!t.some(n=>e.has(n)))return e;let r=new Set(e);for(let n of t)r.delete(n);return r}function s5r(e,t){let r=[];for(let n of t){let i=e.get(n.id);i!==void 0&&i!==n.startedAt&&r.push(n.id)}return r}function l5r(e,t){return t.filter(r=>r.commandType==="run"&&e.get(r.id)!==r.startedAt).map(r=>r.id)}var Cri=1500;function c5r(){let[e,t]=(0,H0.useState)(new Set),r=(0,H0.useRef)(new Map),n=(0,H0.useRef)(new Map),i=(0,H0.useCallback)(s=>{t(l=>l.has(s)?l:new Set(l).add(s))},[]),o=(0,H0.useCallback)(s=>{let l=n.current;for(let u of s)clearTimeout(l.get(u)),l.set(u,setTimeout(()=>{l.delete(u),i(u)},Cri))},[i]);(0,H0.useEffect)(()=>{let s=n.current;return()=>{for(let l of s.values())clearTimeout(l)}},[]);let a=(0,H0.useCallback)(s=>{let l=o5r(r.current,s),u=[...s5r(r.current,s),...l],f=l5r(r.current,s);r.current=new Map(s.map(d=>[d.id,d.startedAt])),i5r(n.current,l),u.length&&t(d=>a5r(d,u)),o(f)},[o]);return{initialized:e,markInitialized:i,syncSessions:a}}var D_=E(fe(),1);function u5r(){let[e,t]=(0,D_.useState)(null),[r,n]=(0,D_.useState)(null),[i,o]=(0,D_.useState)(null),a=(0,D_.useCallback)(()=>t(null),[]),s=(0,D_.useCallback)(()=>n(null),[]),l=(0,D_.useCallback)(()=>o(null),[]);return{error:e,setError:t,clearError:a,success:r,setSuccess:n,clearSuccess:s,serverConflict:i,setServerConflict:o,clearServerConflict:l}}var Mv=E(fe(),1);function f5r(e,t){return[...e,{...t,status:"launching"}]}function Rve(e){return e.find(t=>t.status==="launching")}function d5r(e){let t=Rve(e);return t?e.filter(r=>r.id!==t.id):e}function h5r(e,t){let r=Rve(e);return r?rGe(e,r.id,t):e}function rGe(e,t,r){return e.map(n=>n.id===t&&n.status==="launching"?{...n,status:"error",error:r}:n)}function p5r(e,t){return e.filter(r=>r.id!==t)}var m5r=E(fe(),1);var wri=6e4,kri="Launch timed out \u2014 the session did not start.";function g5r(e,t){(0,m5r.useEffect)(()=>{let r=e.filter(i=>i.status==="launching");if(r.length===0)return;let n=r.map(i=>setTimeout(()=>t(o=>rGe(o,i.id,kri)),Math.max(0,wri-(Date.now()-i.startedAt))));return()=>n.forEach(clearTimeout)},[e,t])}function y5r(){let[e,t]=(0,Mv.useState)([]),r=(0,Mv.useRef)([]),n=(0,Mv.useCallback)(l=>{r.current=l(r.current),t(r.current)},[]),i=(0,Mv.useCallback)(l=>{n(u=>f5r(u,{id:crypto.randomUUID(),startedAt:Date.now(),...l}))},[n]),o=(0,Mv.useCallback)(()=>{let l=Rve(r.current);return n(d5r),l?.named?l.title:void 0},[n]),a=(0,Mv.useCallback)(l=>n(u=>h5r(u,l)),[n]),s=(0,Mv.useCallback)(l=>n(u=>p5r(u,l)),[n]);return g5r(e,n),{pendingLaunches:e,addPendingLaunch:i,resolvePendingLaunch:o,failPendingLaunch:a,dismissPendingLaunch:s}}var OX=E(fe(),1);function v5r(){let[e,t]=(0,OX.useState)(null),[r,n]=(0,OX.useState)({}),i=(0,OX.useCallback)((o,a)=>{o!=="claude"&&n(s=>({...s,[o]:a}))},[]);return{rateLimits:e,setRateLimits:t,harnessRateLimits:r,setHarnessRateLimits:i}}var b5r=E(fe(),1);function x5r(e,t){return(0,b5r.useCallback)(r=>{e(r),t(r)},[e,t])}var nGe=E(fe(),1);function T5r(){let e=(0,nGe.useRef)(new Map),t=(0,nGe.useRef)(new Map);return{buffers:e,handlers:t}}var Ave=E(fe(),1);function S5r(){let[e,t]=(0,Ave.useState)(null),[r,n]=(0,Ave.useState)(null),[i,o]=(0,Ave.useState)(null);return{transcript:e,setTranscript:t,viewingTranscriptSessionId:r,setViewingTranscriptSessionId:n,userMessages:i,setUserMessages:o}}var N_=E(fe(),1);function C5r(e,t){let r=e.sessionId;t.buffers.current?.delete(r),t.handlers.current?.get(r)?.("\x1Bc")}function w5r(e,t){let r=e.sessionId,n=t.resolvePendingLaunch();e.isNew&&t.getActiveId()!==null||(t.setViewingTranscriptSessionId(null),t.setActiveId(r)),e.isNew&&t.setSuccess({message:n?`Started ${n}`:"New session started",sessionId:r})}function k5r(e,t){let r=e.message;t.setError(r),t.failPendingLaunch(r)}function _5r(e,t){let r=e.rateLimits,n=e.harness;!n||n==="claude"?t.setRateLimits(r):t.setHarnessRateLimits?.(n,r)}function E5r(e,t){t.setNodes({local:e.local,links:e.links??[]})}function R5r(e,t){t.setSuccess({message:e.message,sessionId:null})}function A5r(e,t){let r=e.sessionId,n=t.buffers.current?.get(r)??"";t.buffers.current?.set(r,n+e.data),t.handlers.current?.get(r)?.(e.data),t.markInitialized(r)}function P5r(e,t){t.setServerConflict({existing:e.existing,runName:e.runName,cwd:e.cwd,sessionId:e.sessionId,launchedFrom:e.launchedFrom,node:e.node})}function L5r(e,t){let r=e.sessions;t.setSessions(r),e.cwd&&t.setCurrentCwd(e.cwd),t.setActiveByRepo(e.active??{})}function M5r(e,t){let r=e.sessionId,n=e.data;t.buffers.current?.set(r,n),t.handlers.current?.get(r)?.(`\x1Bc${n}`)}var _ri={sessions:L5r,created:w5r,history:(e,t)=>t.setHistory(e.sessions),transcript:(e,t)=>t.setTranscript({sessionId:e.sessionId,messages:e.messages}),"user-messages":(e,t)=>t.setUserMessages({sessionId:e.sessionId,messages:e.messages}),hello:(e,t)=>t.setDaemonVersion(e.version),nodes:E5r,error:k5r,notice:R5r,"run-conflict":P5r,limits:_5r,clear:C5r,output:A5r,snapshot:M5r};function I5r(e,t){_ri[e.type]?.(e,t)}function D5r(e,t={}){let r=location.protocol==="https:"?"wss:":"ws:",n=new WebSocket(`${r}//${location.host}/ws`);return n.onopen=()=>{t.onOpen?.(),n.send(JSON.stringify({type:"hello"})),n.send(JSON.stringify({type:"history"}))},n.onmessage=i=>{I5r(JSON.parse(i.data),e)},n.onclose=()=>t.onClose?.(),n}function N5r(e,t,r,n){let i=!1,o,a=0,s=!1,l=()=>{i||t(D5r(e,{onOpen:()=>{s&&r(),s=!1,n(!1),a=0},onClose:()=>{if(i)return;s=!0,n(!0);let u=Math.min(300*2**a,2e3);a+=1,o=setTimeout(l,u)}}))};return l(),()=>{i=!0,o&&clearTimeout(o)}}function O5r(e){let t=(0,N_.useRef)(null),[r,n]=(0,N_.useState)(!1),{handleSessions:i,markInitialized:o,buffers:a,handlers:s}=e;(0,N_.useEffect)(()=>{let u=()=>{a.current?.clear();let d=s.current;if(d)for(let h of d.values())h("\x1Bc")},f=N5r({...e,setSessions:i},d=>{t.current=d},u,n);return()=>{f(),t.current?.close()}},[i,o,a,s]);let l=(0,N_.useCallback)(()=>{let u=t.current;u?.readyState===WebSocket.OPEN&&u.send(JSON.stringify({type:"history"}))},[]);return{wsRef:t,requestHistory:l,reconnecting:r}}function B5r(){let[e,t]=(0,Pve.useState)([]),[r,n]=(0,Pve.useState)([]),{activeId:i,setActiveId:o,getActiveId:a}=J_r(),s=n5r(),l=S5r(),[u,f]=(0,Pve.useState)(""),d=u5r(),h=y5r(),p=v5r(),{initialized:m,markInitialized:g,syncSessions:y}=c5r(),v=T5r(),b=x5r(y,t),{wsRef:x,requestHistory:C,reconnecting:S}=O5r({handleSessions:b,setHistory:n,getActiveId:a,setActiveId:o,...s,...l,setCurrentCwd:f,...d,...h,...p,markInitialized:g,...v});return r5r(e,o,Q_r(s.activeByRepo,e)),{sessions:e,history:r,activeId:i,setActiveId:o,...s,...l,currentCwd:u,...d,...h,...p,initialized:m,wsRef:x,...v,requestHistory:C,reconnecting:S}}function F5r(){let e=B5r(),{wsRef:t,buffers:r,handlers:n,addPendingLaunch:i,activeId:o,sessions:a}=e,s=k_r(e.nodes),l=R_r(t,i),u=X_r(l,r,n);S_r(o,a,e.history,l),C_r(a,l);let f=Z_r(l,e.setActiveId,e.setViewingTranscriptSessionId);return{...e,...u,...f,nodeSelection:s}}var p$=E(fe(),1);var $5r="assist:sidebar-collapsed";function z5r(){let[e,t]=(0,p$.useState)(()=>Xu($5r).length>0),r=(0,p$.useCallback)(()=>{t(n=>{let i=!n;return Zu($5r,i?[!0]:[]),i})},[]);return(0,p$.useMemo)(()=>({collapsed:e,onToggleCollapsed:r}),[e,r])}var H5r=E(fe(),1);function U5r(){(0,H5r.useEffect)(()=>{let e=!1;return(async()=>{try{let t=await fetch("/api/hotkeys");if(!t.ok)return;let r=await t.json();e||sE.set(r)}catch{}})(),()=>{e=!0}},[])}function W5r(){let e=F5r(),t=Vme(e),r=g_r(e.currentCwd,e.history,t,e.sessions,e.nodeSelection);s_r({selectedCwd:r.selectedCwd,selectedCardId:t,sessions:e.sessions,history:e.history,activeByRepo:e.activeByRepo,onSelect:e.selectSession});let{launch:n,viewLaunchedSession:i}=x_r(e);U5r();let o=z5r();return o_r("shell",{...e,selection:r,launch:n,sidebarCollapse:o}),{socket:e,selection:r,launch:n,viewLaunchedSession:i,sidebarCollapse:o}}var lg=E($(),1),Eri={zIndex:e=>e.zIndex.drawer+1},Rri={minHeight:48};function G5r({mode:e,toggle:t,toggleDesign:r}){let n=W5r(),{socket:i,selection:o,viewLaunchedSession:a}=n,{design:s}=Fn();return(0,lg.jsx)(vwr,{shell:n,children:(0,lg.jsxs)(HWe.Provider,{value:i.daemonVersion,children:[(0,lg.jsx)(Jkr,{mode:e,toggle:t,toggleDesign:r,sessions:i.sessions,reconnecting:i.reconnecting}),(0,lg.jsx)(sxe,{position:"fixed",sx:Eri,"data-testid":"toolbar",children:(0,lg.jsx)(tkr,{socket:i,selection:o})}),(0,lg.jsx)(R5,{variant:"dense",sx:Rri}),(0,lg.jsx)(n_r,{socket:i,children:(0,lg.jsx)(ESr,{socket:i})}),s==="slate"&&(0,lg.jsx)(tCr,{socket:i}),(0,lg.jsx)(gwr,{socket:i,onViewLaunchedSession:a})]})})}var V5r=E(fe(),1);function q5r(){let[e,t]=(0,V5r.useState)(()=>{try{return localStorage.getItem("theme-mode")??"dark"}catch{return"dark"}});return{mode:e,toggle:()=>t(n=>{let i=n==="dark"?"light":"dark";try{localStorage.setItem("theme-mode",i)}catch{}return i})}}var Ari={black:"#2e3436",red:"#cc0000",green:"#4e9a06",yellow:"#c4a000",blue:"#3465a4",magenta:"#75507b",cyan:"#06989a",white:"#d3d7cf",brightBlack:"#555753",brightRed:"#ef2929",brightGreen:"#8ae234",brightYellow:"#fce94f",brightBlue:"#729fcf",brightMagenta:"#ad7fa8",brightCyan:"#34e2e2",brightWhite:"#eeeeec"},BX="rgba(0, 0, 0, 0.87)",j5r={background:"rgba(97, 97, 97, 0.92)",text:"#fff"},Y5r={warning:"rgba(255, 167, 38, 0.09)",error:"rgba(244, 67, 54, 0.09)"},K5r={secondary:"rgba(255, 255, 255, 0.7)",hover:"rgba(255, 255, 255, 0.12)",active:"rgba(255, 255, 255, 0.16)",dot:"#ffb74d",dotRing:"rgba(0, 0, 0, 0.15)"},m$={name:"classic",dark:{color:{background:"#1e1e1e",surface:"#252526",raised:"rgba(255, 255, 255, 0.08)",line:"rgba(255, 255, 255, 0.12)",lineSoft:"rgba(255, 255, 255, 0.12)",text:{primary:"#fff",secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)"},selected:"rgba(255, 255, 255, 0.16)",wash:Y5r,well:"#1b1b1c",stripe:"rgba(255, 255, 255, 0.1)",overlay:j5r,onAppBar:{...K5r,level:{ok:"#66bb6a",warn:"#ffa726",over:"#f44336"}},primary:{main:"#90caf9",light:"#e3f2fd",dark:"#42a5f5",contrastText:BX},secondary:{main:"#ce93d8",light:"#f3e5f5",dark:"#ab47bc",contrastText:BX},success:{main:"#66bb6a",light:"#81c784",dark:"#388e3c",contrastText:BX},warning:{main:"#ffa726",light:"#ffb74d",dark:"#f57c00",contrastText:BX},error:{main:"#f44336",light:"#e57373",dark:"#d32f2f",contrastText:"#fff"},info:{main:"#29b6f6",light:"#4fc3f7",dark:"#0288d1",contrastText:BX}},terminal:{background:"#1e1e1e",foreground:"#d4d4d4",cursor:"#ffffff",cursorAccent:"#1e1e1e",selectionBackground:"rgba(255, 255, 255, 0.3)",...Ari},elevation:{appBar:1}},light:{color:{background:"#fff",surface:"#fff",raised:"rgba(0, 0, 0, 0.04)",line:"rgba(0, 0, 0, 0.12)",lineSoft:"rgba(0, 0, 0, 0.12)",text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},selected:"rgba(0, 0, 0, 0.08)",wash:Y5r,well:"#f3f4f6",stripe:"rgba(0, 0, 0, 0.1)",overlay:j5r,onAppBar:{...K5r,level:{ok:"#b9f6ca",warn:"#ffe57f",over:"#ffcdd2"}},primary:{main:"#1976d2",light:"#42a5f5",dark:"#1565c0",contrastText:"#fff"},secondary:{main:"#9c27b0",light:"#ba68c8",dark:"#7b1fa2",contrastText:"#fff"},success:{main:"#2e7d32",light:"#4caf50",dark:"#1b5e20",contrastText:"#fff"},warning:{main:"#ed6c02",light:"#ff9800",dark:"#e65100",contrastText:"#fff"},error:{main:"#d32f2f",light:"#ef5350",dark:"#c62828",contrastText:"#fff"},info:{main:"#0288d1",light:"#03a9f4",dark:"#01579b",contrastText:"#fff"}},terminal:{background:"#ffffff",foreground:"#333333",cursor:"#333333",cursorAccent:"#ffffff",selectionBackground:"#add6ff",black:"#000000",red:"#cd3131",green:"#107c10",yellow:"#949800",blue:"#0451a5",magenta:"#bc05bc",cyan:"#0598bc",white:"#555555",brightBlack:"#666666",brightRed:"#cd3131",brightGreen:"#14ce14",brightYellow:"#b5ba00",brightBlue:"#0451a5",brightMagenta:"#bc05bc",brightCyan:"#0598bc",brightWhite:"#a5a5a5"},elevation:{appBar:1}},font:{ui:'"Roboto", "Helvetica", "Arial", sans-serif',mono:"monospace",terminal:"'Cascadia Code', 'Fira Code', Consolas, monospace"},type:{fontSize:14,terminalFontSize:14,scale:{caption:12,body2:14,body1:16,subtitle2:14,subtitle1:16,h6:20,h5:24,h4:34,button:14},button:{textTransform:"uppercase",fontWeight:500}},radius:{sm:4,md:4},spacing:8};function X5r({color:e,radius:t,elevation:r,type:n}){let i={border:`1px solid ${e.line}`};return{MuiTooltip:{styleOverrides:{tooltip:{...i,backgroundColor:e.overlay.background,color:e.overlay.text,borderRadius:t.md,boxShadow:r.overlay,fontSize:`${n.scale.caption/16}rem`,padding:"6px 10px"},arrow:{color:e.overlay.background}}},MuiPopover:{styleOverrides:{paper:{...i,boxShadow:r.overlay}}},MuiDialog:{styleOverrides:{paper:{...i,backgroundColor:e.surface,borderRadius:t.md+4,boxShadow:r.dialog}}}}}function Z5r({color:e,radius:t}){return{MuiButton:{defaultProps:{disableElevation:!0},styleOverrides:{root:{borderRadius:t.sm}},variants:[{props:{variant:"tonal"},style:{backgroundColor:e.raised,border:`1px solid ${e.line}`,color:e.text.primary,"&:hover":{backgroundColor:e.raised,borderColor:e.text.disabled}}},{props:{variant:"outlined",color:"error"},style:{borderColor:gi(e.error.main,.35),"&:hover":{borderColor:e.error.main,backgroundColor:gi(e.error.main,.1)}}}]},MuiChip:{styleOverrides:{root:{fontWeight:600,borderRadius:999},sizeSmall:{height:22},outlined:{borderColor:e.line}}}}}var iGe=e=>`color-mix(in srgb, currentColor ${e}%, transparent)`;function Q5r({radius:e}){return{MuiTabs:{styleOverrides:{root:{minHeight:40,alignItems:"center"},list:{gap:2},indicator:{display:"none"}}},MuiTab:{styleOverrides:{root:{minHeight:30,padding:"6px 10px",borderRadius:e.sm,textTransform:"none",fontWeight:500,"&:hover":{backgroundColor:iGe(8)},"&.Mui-selected":{backgroundColor:iGe(12),boxShadow:`inset 0 0 0 1px ${iGe(18)}`}}}}}}function J5r(e){let{appBar:t}=e.color;return{...X5r(e),...Z5r(e),...Q5r(e),MuiPaper:{styleOverrides:{root:{backgroundImage:"none"},outlined:{borderColor:e.color.line}}},MuiAppBar:{defaultProps:{elevation:e.elevation.appBar},styleOverrides:{root:t&&{backgroundColor:t.background,color:t.text,borderBottom:`1px solid ${e.color.line}`}}}}}var Iv="#0e1116",oGe="#141820",Lve="#1b202a",Mve="#e3e7ee",aGe="#8a93a3",FX="#8b9cff",Ive="#5fd0a0",Dve="#f2b45a",Nve="#f27a7a",Ove={name:"slate",dark:{color:{background:Iv,surface:oGe,raised:Lve,line:"#262c37",lineSoft:"#1d222b",text:{primary:Mve,secondary:aGe,disabled:"#5c6473"},selected:"rgba(139, 156, 255, 0.14)",wash:{warning:"rgba(242, 180, 90, 0.09)",error:"rgba(242, 122, 122, 0.09)"},well:Iv,stripe:Lve,overlay:{background:Lve,text:Mve},appBar:{background:oGe,text:Mve},onAppBar:{...m$.dark.color.onAppBar,secondary:aGe,level:{ok:Ive,warn:Dve,over:Nve}},statusBar:{background:oGe,text:aGe,hoverText:Mve,secondary:"#5c6473",hover:Lve,active:"transparent",dot:FX,dotRing:"rgba(139, 156, 255, 0.14)",readyText:FX,level:{ok:Ive,warn:Dve,over:Nve}},primary:{main:FX,contrastText:Iv},secondary:{main:"#c99bff",contrastText:Iv},success:{main:Ive,contrastText:Iv},warning:{main:Dve,contrastText:Iv},error:{main:Nve,contrastText:Iv},info:{main:"#6cb6ff",contrastText:Iv}},terminal:{background:Iv,foreground:"#d6dbe4",cursor:FX,cursorAccent:Iv,selectionBackground:"rgba(139, 156, 255, 0.28)",black:"#1b2029",red:Nve,green:Ive,yellow:Dve,blue:FX,magenta:"#c99bff",cyan:"#6cc8d8",white:"#c3c9d4",brightBlack:"#5c6473",brightRed:"#ff9a9a",brightGreen:"#82e0b6",brightYellow:"#ffc97a",brightBlue:"#a9b6ff",brightMagenta:"#dcb8ff",brightCyan:"#8fdbe8",brightWhite:"#eef1f6"},elevation:{appBar:0,overlay:"0 14px 34px rgba(0, 0, 0, 0.45)",dialog:"0 30px 60px rgba(0, 0, 0, 0.5)"}},light:{...m$.light,color:{...m$.light.color,statusBar:{background:"#f3f4f6",text:"rgba(0, 0, 0, 0.6)",hoverText:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.38)",hover:"rgba(0, 0, 0, 0.06)",active:"transparent",dot:"#1976d2",dotRing:"rgba(25, 118, 210, 0.16)",readyText:"#1976d2",level:{ok:"#2e7d32",warn:"#ed6c02",over:"#d32f2f"}}},elevation:{appBar:0,overlay:"0 8px 24px rgba(15, 23, 42, 0.12)",dialog:"0 24px 48px rgba(15, 23, 42, 0.18)"}},font:{ui:'"Geist Variable", "Segoe UI", system-ui, sans-serif',mono:'"Geist Mono Variable", ui-monospace, Menlo, Consolas, monospace',terminal:'"Geist Mono Variable", ui-monospace, Menlo, Consolas, monospace'},type:{fontSize:14,terminalFontSize:13,scale:{caption:12,body2:14,body1:15,subtitle2:14,subtitle1:15,h6:16,h5:18,h4:24,button:14},button:{textTransform:"none",fontWeight:600}},radius:{sm:6,md:8},spacing:8};var gT=e=>`${e/16}rem`;function eEr({font:e,type:t}){let{scale:r}=t;return{fontFamily:e.ui,fontFamilyMono:e.mono,fontSize:t.fontSize,button:{...t.button,fontSize:gT(r.button)},caption:{fontSize:gT(r.caption)},body2:{fontSize:gT(r.body2)},body1:{fontSize:gT(r.body1)},subtitle2:{fontSize:gT(r.subtitle2)},subtitle1:{fontSize:gT(r.subtitle1)},h6:{fontSize:gT(r.h6)},h5:{fontSize:gT(r.h5)},h4:{fontSize:gT(r.h4)}}}function tEr(e){return{MuiButtonBase:{styleOverrides:{root:{cursor:"pointer","&.Mui-disabled":{cursor:"default"}}}},MuiLink:{styleOverrides:{root:{cursor:"pointer"}}},MuiAppBar:{defaultProps:{elevation:e.elevation.appBar}}}}var Pri={classic:m$,slate:Ove};function Lri(e,t){let{dark:r,light:n,...i}=Pri[e];return{...i,...t==="dark"?r:n,mode:t}}function rEr(e,t){let r=Lri(e,t),{color:n}=r;return Y0({design:e,tokens:r,palette:{mode:t,background:{default:n.background,paper:n.surface},primary:n.primary,secondary:n.secondary,success:n.success,warning:n.warning,error:n.error,info:n.info,text:n.text,divider:n.line,action:{hover:n.raised,selected:n.selected}},typography:eEr(r),shape:{borderRadius:r.radius.sm},spacing:r.spacing,components:{...tEr(r),...e==="slate"&&J5r(r)}})}function nEr(){if(typeof document>"u"||!document.fonts)return Promise.resolve();let{font:e,type:t}=Ove;return Promise.allSettled([document.fonts.load(`${t.fontSize}px ${e.ui}`),document.fonts.load(`${t.terminalFontSize}px ${e.terminal}`)])}var iEr=E(fe(),1),oEr="design";function Mri(){try{return localStorage.getItem(oEr)==="slate"?"slate":"classic"}catch{return"classic"}}function aEr(){let[e,t]=(0,iEr.useState)(Mri);return{design:e,toggleDesign:()=>t(n=>{let i=n==="slate"?"classic":"slate";try{localStorage.setItem(oEr,i)}catch{}return i})}}var sEr=E(fe(),1);var Bve=E($(),1),Iri=5;function lEr({children:e}){let[t,r]=(0,sEr.useState)(null);return(0,Bve.jsxs)(Ewe.Provider,{value:t,children:[e,(0,Bve.jsx)(ie,{ref:r,"data-testid":"toast-stack",sx:{position:"fixed",zIndex:"snackbar",bottom:{xs:1,sm:3},left:{xs:1,sm:"50%"},right:{xs:1,sm:"auto"},transform:{sm:"translateX(-50%)"},display:"flex",flexDirection:"column",alignItems:{xs:"stretch",sm:"center"},gap:1,pointerEvents:"none","& > *":{pointerEvents:"auto"},[`& > :nth-last-of-type(n+${Iri+1})`]:{display:"none"}}})]})}var yT=E($(),1);function Dri(){let{mode:e,toggle:t}=q5r(),{design:r,toggleDesign:n}=aEr(),i=(0,uEr.useMemo)(()=>rEr(r,e),[r,e]);return(0,yT.jsxs)(qZ,{theme:i,children:[(0,yT.jsx)(IQ,{}),(0,yT.jsx)(lEr,{children:(0,yT.jsx)(G5r,{mode:e,toggle:t,toggleDesign:n})})]})}var Nri=LCe([{path:"*",element:(0,yT.jsx)(Dri,{})}]);function Ori(){return(0,yT.jsx)(CCe,{router:Nri})}var cEr=document.getElementById("app");cEr&&nEr().then(()=>{(0,fEr.createRoot)(cEr).render((0,yT.jsx)(Ori,{}))});})();
4025
4025
  /*! Bundled license information:
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import { Command } from "commander";
6
6
  // package.json
7
7
  var package_default = {
8
8
  name: "@staff0rd/assist",
9
- version: "0.934.3",
9
+ version: "0.934.4",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staff0rd/assist",
3
- "version": "0.934.3",
3
+ "version": "0.934.4",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {