@coreplane/switchboard 1.210.0 → 1.212.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/dist/assets/deploy/cloudflare-resident/worker.ts +68 -20
  2. package/dist/assets/deploy/cloudflare-sandbox/worker.ts +19 -5
  3. package/dist/assets/package-lock.json +3 -3
  4. package/dist/assets/package.json +1 -1
  5. package/dist/assets/project.json +1 -1
  6. package/dist/assets/source.json +3 -3
  7. package/dist/assets/src/agents/registry.ts +22 -0
  8. package/dist/assets/src/core/runEvents.ts +33 -1
  9. package/dist/assets/src/core/runFriction.ts +6 -5
  10. package/dist/assets/src/core/trace/streamSpans.ts +3 -0
  11. package/dist/assets/src/execution/binaryRead.ts +56 -14
  12. package/dist/assets/src/execution/residentStepReport.ts +4 -0
  13. package/dist/assets/web/dist/.vite/manifest.json +18 -18
  14. package/dist/assets/web/dist/assets/{ResidentDetailPage-CV3wfAIP.js → ResidentDetailPage-CM5nWw-Z.js} +1 -1
  15. package/dist/assets/web/dist/assets/{ResidentsIndexPage-CLkWc50b.js → ResidentsIndexPage-BKBnuvp3.js} +1 -1
  16. package/dist/assets/web/dist/assets/{RunRoutePage-CQYRfQ_B.js → RunRoutePage-Bu4CwEzt.js} +4 -4
  17. package/dist/assets/web/dist/assets/{RunsIndexPage-BLRPp_gk.js → RunsIndexPage-w2jJP5xu.js} +1 -1
  18. package/dist/assets/web/dist/assets/{ScheduledPage-C-VO4Ddl.js → ScheduledPage-D3-k9DPz.js} +1 -1
  19. package/dist/assets/web/dist/assets/{StatusDot-CIAoBB5Y.js → StatusDot-BmFHnV8m.js} +1 -1
  20. package/dist/assets/web/dist/assets/{Tooltip-DEL1ic4g.js → Tooltip-DoThP2fW.js} +1 -1
  21. package/dist/assets/web/dist/assets/{dist-CawBR4t8.js → dist-YrRKtxsS.js} +1 -1
  22. package/dist/assets/web/dist/assets/{main-CctUbVOl.js → main-D6nzMf0k.js} +2 -2
  23. package/dist/cli.js +698 -385
  24. package/package.json +1 -1
@@ -1,12 +1,12 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-CawBR4t8.js","assets/AppShell-lYVcj-k7.js","assets/seed-DeKSHrt2.js","assets/main-CctUbVOl.js","assets/main-CuENKPdD.css"])))=>i.map(i=>d[i]);
2
- import{C as e,S as t,_ as n,b as r,c as i,g as a,h as o,m as s,n as c,p as l,r as u,s as d,t as f,v as p,y as m}from"./AppShell-lYVcj-k7.js";import{A as h,B as g,Ci as _,Dr as v,Gn as y,H as b,Ht as ee,J as x,Jn as te,Lr as S,Mr as C,N as w,Or as T,P as ne,Pr as re,Q as ie,Qn as E,Rn as ae,Si as D,U as O,Ut as oe,Wn as k,Wt as A,Xt as j,_ as se,_n as M,a as ce,at as le,b as ue,ci as N,cn as P,d as de,di as fe,dr as F,et as pe,f as me,ft as he,g as I,gn as L,h as ge,hi as _e,ir as R,it as ve,j as ye,kn as z,ln as B,m as be,mi as xe,nr as Se,nt as Ce,oi as V,on as H,or as we,p as Te,r as Ee,sn as U,t as De,u as Oe,un as W,ur as G,vi as K,wi as q,x as ke,xi as J,xr as Ae,y as je,yn as Y,z as Me,zr as Ne}from"./seed-DeKSHrt2.js";import{t as Pe}from"./Tooltip-DEL1ic4g.js";import{r as Fe,t as Ie}from"./main-CctUbVOl.js";import{n as Le,t as Re}from"./wallClock-61NpVkY6.js";import{t as ze}from"./NotFoundPage-BzWS4Ca1.js";import{t as Be}from"./indexFormat-B-pd4r7Y.js";import{A as Ve,D as He,E as Ue,M as X,O as We,b as Ge,j as Ke,k as qe,n as Je,t as Ye}from"./favicon-CWPcvWvp.js";import{t as Z}from"./localIso-L06jV29p.js";var[Q,Xe]=g(`DialogRoot`),Ze=Y({inheritAttrs:!1,__name:`DialogRoot`,props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1,default:!1},modal:{type:Boolean,required:!1,default:!0},unmountOnHide:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=le(n,`open`,t,{defaultValue:n.defaultOpen,passive:n.open===void 0}),i=N(),a=N(),{modal:o,unmountOnHide:s}=_e(n);return Xe({open:r,modal:o,unmountOnHide:s,openModal:()=>{r.value=!0},onOpenChange:e=>{r.value=e},onOpenToggle:()=>{r.value=!r.value},contentId:``,titleId:``,descriptionId:``,triggerElement:i,contentElement:a}),(e,t)=>F(e.$slots,`default`,{open:K(r),close:()=>r.value=!1})}}),Qe=Y({__name:`DialogClose`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;w();let n=Q();return(e,r)=>(R(),P(K(h),k(t,{type:e.as===`button`?`button`:void 0,onClick:r[0]||=e=>K(n).onOpenChange(!1)}),{default:S(()=>[F(e.$slots,`default`)]),_:3},16,[`type`]))}}),$e=Y({__name:`DialogContentImpl`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let r=e,i=t,o=Q(),{forwardRef:s,currentElement:c}=w();return o.titleId||=m(void 0,`reka-dialog-title`),o.descriptionId||=m(void 0,`reka-dialog-description`),E(()=>{o.contentElement=c,Me()!==document.body&&(o.triggerElement.value=Me())}),(e,t)=>(R(),P(K(n),{"as-child":``,loop:``,trapped:r.trapFocus,present:r.present,onMountAutoFocus:t[5]||=e=>i(`openAutoFocus`,e),onUnmountAutoFocus:t[6]||=e=>i(`closeAutoFocus`,e)},{default:S(()=>[M(K(p),k({id:K(o).contentId,ref:K(s),as:e.as,"as-child":e.asChild,present:r.present,"disable-outside-pointer-events":e.disableOutsidePointerEvents,role:`dialog`,"aria-describedby":K(o).descriptionId,"aria-labelledby":K(o).titleId,"data-state":K(a)(K(o).open.value)},e.$attrs,{onDismiss:t[0]||=e=>K(o).onOpenChange(!1),onEscapeKeyDown:t[1]||=e=>i(`escapeKeyDown`,e),onFocusOutside:t[2]||=e=>i(`focusOutside`,e),onInteractOutside:t[3]||=e=>i(`interactOutside`,e),onPointerDownOutside:t[4]||=e=>i(`pointerDownOutside`,e)}),{default:S(()=>[F(e.$slots,`default`)]),_:3},16,[`id`,`as`,`as-child`,`present`,`disable-outside-pointer-events`,`aria-describedby`,`aria-labelledby`,`data-state`])]),_:3},8,[`trapped`,`present`]))}}),et=Y({__name:`DialogContentModal`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,i=t,a=Q(),o=ne(i),{forwardRef:s,currentElement:c}=w(),l=H(()=>n.present?c.value:void 0);r(l);let u=H(()=>{let{present:e,...t}=n;return t});return C(()=>n.present,(e,t)=>{!e&&t&&a.triggerElement.value?.focus()}),(e,t)=>(R(),P($e,k({...u.value,...K(o)},{ref:K(s),present:e.present,"trap-focus":K(a).open.value,"disable-outside-pointer-events":n.disableOutsidePointerEvents,onCloseAutoFocus:t[0]||=e=>{e.defaultPrevented||(e.preventDefault(),K(a).triggerElement.value?.focus())},onPointerDownOutside:t[1]||=e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()},onFocusOutside:t[2]||=e=>{e.preventDefault()}}),{default:S(()=>[F(e.$slots,`default`)]),_:3},16,[`present`,`trap-focus`,`disable-outside-pointer-events`]))}}),tt=Y({__name:`DialogContentNonModal`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=ne(t);w();let i=Q(),a=N(!1),o=N(!1),s=H(()=>{let{present:e,...t}=n;return t});return C(()=>n.present,(e,t)=>{!e&&t&&(a.value||i.triggerElement.value?.focus(),a.value=!1,o.value=!1)}),(e,t)=>(R(),P($e,k({...s.value,...K(r)},{present:e.present,"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:t[0]||=e=>{e.defaultPrevented||(a.value||K(i).triggerElement.value?.focus(),e.preventDefault()),a.value=!1,o.value=!1},onInteractOutside:t[1]||=e=>{e.defaultPrevented||(a.value=!0,e.detail.originalEvent.type===`pointerdown`&&(o.value=!0));let t=e.target;K(i).triggerElement.value?.contains(t)&&e.preventDefault(),e.detail.originalEvent.type===`focusin`&&o.value&&e.preventDefault()}}),{default:S(()=>[F(e.$slots,`default`)]),_:3},16,[`present`]))}}),nt=Y({__name:`DialogContent`,props:{forceMount:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=Q(),a=ne(r),{forwardRef:o}=w();return(e,t)=>(R(),P(K(ye),{present:e.forceMount||K(i).open.value,"force-mount":e.forceMount||!K(i).unmountOnHide.value},{default:S(({present:t})=>[K(i).modal.value?Ne((R(),P(et,k({key:0,ref:K(o),present:K(i).unmountOnHide.value||t},{...n,...K(a),...e.$attrs}),{default:S(()=>[F(e.$slots,`default`)]),_:2},1040,[`present`])),[[ee,K(i).unmountOnHide.value||t]]):Ne((R(),P(tt,k({key:1,ref:K(o),present:K(i).unmountOnHide.value||t},{...n,...K(a),...e.$attrs}),{default:S(()=>[F(e.$slots,`default`)]),_:2},1040,[`present`])),[[ee,K(i).unmountOnHide.value||t]])]),_:3},8,[`present`,`force-mount`]))}}),rt=Y({__name:`DialogDescription`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`p`}},setup(e){let t=e;w();let n=Q();return(e,r)=>(R(),P(K(h),k(t,{id:K(n).descriptionId}),{default:S(()=>[F(e.$slots,`default`)]),_:3},16,[`id`]))}}),it=Y({__name:`DialogOverlayImpl`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1,default:!0}},setup(t){let n=t,r=Q(),i=e(n.present);return C(()=>n.present,e=>i.value=e),w(),(e,t)=>(R(),P(K(h),{as:e.as,"as-child":e.asChild,"data-state":K(r).open.value?`open`:`closed`,style:{"pointer-events":`auto`},onPointerdown:t[0]||=A(()=>{},[`left`,`self`,`prevent`])},{default:S(()=>[F(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`data-state`]))}}),at=Y({__name:`DialogOverlay`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=Q(),{forwardRef:n}=w();return(e,r)=>K(t)?.modal.value?(R(),P(K(ye),{key:0,present:e.forceMount||K(t).open.value,"force-mount":e.forceMount||!K(t).unmountOnHide.value},{default:S(({present:r})=>[Ne(M(it,k(e.$attrs,{ref:K(n),as:e.as,"as-child":e.asChild,present:K(t).unmountOnHide.value||r}),{default:S(()=>[F(e.$slots,`default`)]),_:2},1040,[`as`,`as-child`,`present`]),[[ee,K(t).unmountOnHide.value||r]])]),_:3},8,[`present`,`force-mount`])):B(`v-if`,!0)}}),ot=Y({__name:`DialogPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(R(),P(K(ke),D(z(t)),{default:S(()=>[F(e.$slots,`default`)]),_:3},16))}}),st=Y({__name:`DialogTitle`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`h2`}},setup(e){let t=e,n=Q();return w(),(e,r)=>(R(),P(K(h),k(t,{id:K(n).titleId}),{default:S(()=>[F(e.$slots,`default`)]),_:3},16,[`id`]))}}),ct=Y({__name:`DialogTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=Q(),{forwardRef:r,currentElement:i}=w();return n.contentId||=m(void 0,`reka-dialog-content`),E(()=>{n.triggerElement.value=i.value}),(e,i)=>(R(),P(K(h),k(t,{ref:K(r),type:e.as===`button`?`button`:void 0,"aria-haspopup":`dialog`,"aria-expanded":K(n).open.value||!1,"aria-controls":K(n).open.value?K(n).contentId:void 0,"data-state":K(n).open.value?`open`:`closed`,onClick:K(n).onOpenToggle}),{default:S(()=>[F(e.$slots,`default`)]),_:3},16,[`type`,`aria-expanded`,`aria-controls`,`data-state`,`onClick`]))}}),lt=Y({__name:`RovingFocusItem`,props:{tabStopId:{type:String,required:!1},focusable:{type:Boolean,required:!1,default:!0},active:{type:Boolean,required:!1},allowShiftKey:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=e,n=i(),r=m(),a=H(()=>t.tabStopId||r),c=H(()=>n.currentTabStopId.value===a.value),{getItems:u,CollectionItem:d}=ue();E(()=>{t.focusable&&n.onFocusableItemAdd()}),Se(()=>{t.focusable&&n.onFocusableItemRemove()}),C(()=>t.focusable,(e,t)=>{e!==t&&(e?n.onFocusableItemAdd():n.onFocusableItemRemove())});function f(e){if(e.key===`Tab`&&e.shiftKey){n.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let r=s(e,n.orientation.value,n.dir.value);if(r!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||!t.allowShiftKey&&e.shiftKey)return;e.preventDefault();let i=[...u().map(e=>e.ref).filter(e=>e.dataset.disabled!==``)];if(r===`last`)i.reverse();else if(r===`prev`||r===`next`){r===`prev`&&i.reverse();let t=i.indexOf(e.currentTarget);i=n.loop.value?o(i,t+1):i.slice(t+1)}y(()=>l(i))}}return(e,t)=>(R(),P(K(d),null,{default:S(()=>[M(K(h),{tabindex:c.value?0:-1,"data-orientation":K(n).orientation.value,"data-active":e.active?``:void 0,"data-disabled":e.focusable?void 0:``,as:e.as,"as-child":e.asChild,onMousedown:t[0]||=t=>{e.focusable?K(n).onItemFocus(a.value):t.preventDefault()},onFocus:t[1]||=e=>K(n).onItemFocus(a.value),onKeydown:f},{default:S(()=>[F(e.$slots,`default`)]),_:3},8,[`tabindex`,`data-orientation`,`data-active`,`data-disabled`,`as`,`as-child`])]),_:3}))}}),[ut,dt]=g(`TabsRoot`),ft=Y({__name:`TabsRoot`,props:{defaultValue:{type:null,required:!1},orientation:{type:String,required:!1,default:`horizontal`},dir:{type:String,required:!1},activationMode:{type:String,required:!1,default:`automatic`},modelValue:{type:null,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:modelValue`],setup(e,{emit:n}){let r=e,i=n,{orientation:a,unmountOnHide:o,dir:s}=_e(r),c=t(s);w();let l=le(r,`modelValue`,i,{defaultValue:r.defaultValue,passive:r.modelValue===void 0}),u=N(),d=fe(new Set);return dt({modelValue:l,changeModelValue:e=>{l.value=e},orientation:a,dir:c,unmountOnHide:o,activationMode:r.activationMode,baseId:m(void 0,`reka-tabs`),tabsList:u,contentIds:d,registerContent:e=>{d.value=new Set([...d.value,e])},unregisterContent:e=>{let t=new Set(d.value);t.delete(e),d.value=t}}),(e,t)=>(R(),P(K(h),{dir:K(c),"data-orientation":K(a),"as-child":e.asChild,as:e.as},{default:S(()=>[F(e.$slots,`default`,{modelValue:K(l)})]),_:3},8,[`dir`,`data-orientation`,`as-child`,`as`]))}});function pt(e,t){return`${e}-trigger-${t}`}function mt(e,t){return`${e}-content-${t}`}var ht=Y({__name:`TabsContent`,props:{value:{type:[String,Number],required:!0},forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,{forwardRef:n}=w(),r=ut(),i=H(()=>pt(r.baseId,t.value)),a=H(()=>mt(r.baseId,t.value)),o=H(()=>t.value===r.modelValue.value),s=N(o.value);return E(()=>{r.registerContent(t.value),requestAnimationFrame(()=>{s.value=!1})}),te(()=>{r.unregisterContent(t.value)}),(e,t)=>(R(),P(K(ye),{present:e.forceMount||o.value,"force-mount":``},{default:S(({present:t})=>[M(K(h),{id:a.value,ref:K(n),"as-child":e.asChild,as:e.as,role:`tabpanel`,"data-state":o.value?`active`:`inactive`,"data-orientation":K(r).orientation.value,"aria-labelledby":i.value,hidden:!t,tabindex:`0`,style:_({animationDuration:s.value?`0s`:void 0})},{default:S(()=>[!K(r).unmountOnHide.value||t?F(e.$slots,`default`,{key:0}):B(`v-if`,!0)]),_:2},1032,[`id`,`as-child`,`as`,`data-state`,`data-orientation`,`aria-labelledby`,`hidden`,`style`])]),_:3},8,[`present`]))}}),gt=Y({__name:`TabsIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e,{expose:t}){let n=e,r=ut();t({updateIndicatorStyle:s}),w();let i=Ce(),a=N({size:null,thickness:null,position:null}),o=N([]);C(()=>[r.modelValue.value,r?.dir.value],()=>{s()},{immediate:!0,flush:`post`}),re(()=>{o.value=Array.from(r.tabsList.value?.querySelectorAll(`[role="tab"]`)||[])}),ve(H(()=>[r.tabsList.value,...o.value]),s);function s(){let e=r.tabsList.value?.querySelector(`[role="tab"][data-state="active"]`);e&&(r.orientation.value===`horizontal`?a.value={size:e.offsetWidth,thickness:e.offsetHeight,position:e.offsetLeft}:a.value={size:e.offsetHeight,thickness:e.offsetWidth,position:e.offsetTop})}return(e,t)=>K(i)&&typeof a.value.size==`number`?(R(),P(K(h),k({key:0},n,{style:{"--reka-tabs-indicator-size":`${a.value.size}px`,"--reka-tabs-indicator-thickness":`${a.value.thickness}px`,"--reka-tabs-indicator-position":`${a.value.position}px`}}),{default:S(()=>[F(e.$slots,`default`)]),_:3},16,[`style`])):B(`v-if`,!0)}}),_t=Y({__name:`TabsList`,props:{loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let{loop:t}=_e(e),{forwardRef:n,currentElement:r}=w(),i=ut();return i.tabsList=r,(e,r)=>(R(),P(K(d),{"as-child":``,orientation:K(i).orientation.value,dir:K(i).dir.value,loop:K(t)},{default:S(()=>[M(K(h),{ref:K(n),role:`tablist`,"as-child":e.asChild,as:e.as,"aria-orientation":K(i).orientation.value},{default:S(()=>[F(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`aria-orientation`])]),_:3},8,[`orientation`,`dir`,`loop`]))}}),vt=Y({__name:`TabsTrigger`,props:{value:{type:[String,Number],required:!0},disabled:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,{forwardRef:n}=w(),r=ut(),i=H(()=>pt(r.baseId,t.value)),a=H(()=>r.contentIds.value.has(t.value)?mt(r.baseId,t.value):void 0),o=H(()=>t.value===r.modelValue.value);return(e,t)=>(R(),P(K(lt),{"as-child":``,focusable:!e.disabled,active:o.value},{default:S(()=>[M(K(h),{id:i.value,ref:K(n),role:`tab`,type:e.as===`button`?`button`:void 0,as:e.as,"as-child":e.asChild,"aria-selected":o.value?`true`:`false`,"aria-controls":a.value,"data-state":o.value?`active`:`inactive`,disabled:e.disabled,"data-disabled":e.disabled?``:void 0,"data-orientation":K(r).orientation.value,onMousedown:t[0]||=A(t=>{!e.disabled&&t.ctrlKey===!1?K(r).changeModelValue(e.value):t.preventDefault()},[`left`]),onKeydown:t[1]||=oe(t=>K(r).changeModelValue(e.value),[`enter`,`space`]),onFocus:t[2]||=()=>{let t=K(r).activationMode!==`manual`;!o.value&&!e.disabled&&t&&K(r).changeModelValue(e.value)}},{default:S(()=>[F(e.$slots,`default`)]),_:3},8,[`id`,`type`,`as`,`as-child`,`aria-selected`,`aria-controls`,`data-state`,`disabled`,`data-disabled`,`data-orientation`])]),_:3},8,[`focusable`,`active`]))}});function yt(e){let t=new Date(e),n=t.getHours(),r=e=>String(e).padStart(2,`0`),i=new Intl.DateTimeFormat(void 0,{timeZoneName:`short`}).formatToParts(t).find(e=>e.type===`timeZoneName`)?.value;return`${n%12==0?12:n%12}:${r(t.getMinutes())}:${r(t.getSeconds())} ${n<12?`AM`:`PM`}${i?` ${i}`:``}`}function bt(e,t={}){let n=e.detail.originalEvent,r=n.target;if(!r?.isConnected){e.preventDefault();return}t.scrollable&&(n.offsetX>r.clientWidth||n.offsetY>r.clientHeight)&&e.preventDefault()}var xt={slots:{overlay:`fixed inset-0 bg-elevated/75`,content:`fixed bg-default divide-y divide-default sm:ring ring-default sm:shadow-lg flex flex-col focus:outline-none`,header:`flex items-center gap-1.5 p-4 sm:px-6 min-h-(--ui-header-height)`,wrapper:``,body:`flex-1 overflow-y-auto p-4 sm:p-6`,footer:`flex items-center gap-1.5 p-4 sm:px-6`,title:`text-highlighted font-semibold`,description:`mt-1 text-muted text-sm`,close:`absolute top-4 end-4`},variants:{side:{top:{content:``},right:{content:`max-w-md`},bottom:{content:``},left:{content:`max-w-md`}},inset:{true:{content:`rounded-lg`}},transition:{true:{overlay:`data-[state=open]:animate-[fade-in_200ms_var(--ease-out)] data-[state=closed]:animate-[fade-out_200ms_var(--ease-out)]`}}},compoundVariants:[{side:`top`,inset:!0,class:{content:`max-h-[calc(100%-2rem)] inset-x-4 top-4`}},{side:`top`,inset:!1,class:{content:`max-h-full inset-x-0 top-0`}},{side:`right`,inset:!0,class:{content:`w-[calc(100%-2rem)] inset-y-4 right-4`}},{side:`right`,inset:!1,class:{content:`w-full inset-y-0 right-0`}},{side:`bottom`,inset:!0,class:{content:`max-h-[calc(100%-2rem)] inset-x-4 bottom-4`}},{side:`bottom`,inset:!1,class:{content:`max-h-full inset-x-0 bottom-0`}},{side:`left`,inset:!0,class:{content:`w-[calc(100%-2rem)] inset-y-4 left-4`}},{side:`left`,inset:!1,class:{content:`w-full inset-y-0 left-0`}},{transition:!0,side:`top`,class:{content:`data-[state=open]:animate-[slide-in-from-top_200ms_var(--ease-out)] data-[state=closed]:animate-[slide-out-to-top_200ms_var(--ease-out)]`}},{transition:!0,side:`right`,class:{content:`data-[state=open]:animate-[slide-in-from-right_200ms_var(--ease-out)] data-[state=closed]:animate-[slide-out-to-right_200ms_var(--ease-out)]`}},{transition:!0,side:`bottom`,class:{content:`data-[state=open]:animate-[slide-in-from-bottom_200ms_var(--ease-out)] data-[state=closed]:animate-[slide-out-to-bottom_200ms_var(--ease-out)]`}},{transition:!0,side:`left`,class:{content:`data-[state=open]:animate-[slide-in-from-left_200ms_var(--ease-out)] data-[state=closed]:animate-[slide-out-to-left_200ms_var(--ease-out)]`}}]},St={__name:`Slideover`,props:{title:{type:String,required:!1},description:{type:String,required:!1},content:{type:Object,required:!1},overlay:{type:Boolean,required:!1,default:!0},transition:{type:Boolean,required:!1,default:!0},side:{type:null,required:!1,default:`right`},inset:{type:Boolean,required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},close:{type:[Boolean,Object],required:!1,default:!0},closeIcon:{type:null,required:!1},dismissible:{type:Boolean,required:!1,default:!0},class:{type:null,required:!1},ui:{type:Object,required:!1},open:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1},modal:{type:Boolean,required:!1,default:!0},unmountOnHide:{type:Boolean,required:!1}},emits:[`leave`,`after:leave`,`enter`,`after:enter`,`close:prevent`,`update:open`],setup(e,{emit:t}){let n=e,r=t,i=v(),a=se(`slideover`,n),{t:o}=b(),s=x(),c=I(he(a,`open`,`defaultOpen`,`modal`,`unmountOnHide`),r),l=je(xe(()=>a.portal)),u=xe(()=>a.content),d=H(()=>a.dismissible?{pointerDownOutside:bt}:[`interactOutside`,`escapeKeyDown`].reduce((e,t)=>(e[t]=e=>{e.preventDefault(),r(`close:prevent`)},e),{})),f=H(()=>ge({extend:xt,...s.ui?.slideover||{}})({transition:a.transition,side:a.side,inset:a.inset}));return(e,t)=>(R(),P(K(Ze),D(z(K(c))),{default:S(({open:n,close:c})=>[i.default?(R(),P(K(ct),{key:0,"as-child":``,class:J(K(a).class)},{default:S(()=>[F(e.$slots,`default`,{open:n})]),_:2},1032,[`class`])):B(``,!0),M(K(ot),k(K(l),{"force-mount":K(l).disabled&&K(a).unmountOnHide===!1||void 0}),{default:S(()=>[M(K(Oe),null,{default:S(()=>[K(a).overlay?(R(),P(K(at),{key:0,"data-slot":`overlay`,class:J(f.value.overlay({class:K(a).ui?.overlay}))},null,8,[`class`])):B(``,!0),M(K(nt),k({"data-side":K(a).side,"data-slot":`content`,class:f.value.content({class:[!i.default&&K(a).class,K(a).ui?.content]})},u.value,{onEnter:t[0]||=e=>r(`enter`),onAfterEnter:t[1]||=e=>r(`after:enter`),onLeave:t[2]||=e=>r(`leave`),onAfterLeave:t[3]||=e=>r(`after:leave`)},Ae(d.value)),{default:S(()=>[!K(a).title&&!i.title||!K(a).description&&!i.description||i.content?(R(),P(K(Fe),{key:0},{default:S(()=>[!K(a).title&&!i.title?(R(),P(K(st),{key:0})):i.content?(R(),P(K(st),{key:1},{default:S(()=>[F(e.$slots,`title`,{},()=>[L(q(K(a).title),1)])]),_:3})):B(``,!0),!K(a).description&&!i.description?(R(),P(K(rt),{key:2})):i.content?(R(),P(K(rt),{key:3},{default:S(()=>[F(e.$slots,`description`,{},()=>[L(q(K(a).description),1)])]),_:3})):B(``,!0)]),_:3})):B(``,!0),F(e.$slots,`content`,{close:c},()=>[i.header||K(a).title||i.title||K(a).description||i.description||K(a).close||i.close?(R(),W(`div`,{key:0,"data-slot":`header`,class:J(f.value.header({class:K(a).ui?.header}))},[F(e.$slots,`header`,{close:c},()=>[K(a).title||i.title||K(a).description||i.description?(R(),W(`div`,{key:0,"data-slot":`wrapper`,class:J(f.value.wrapper({class:K(a).ui?.wrapper}))},[K(a).title||i.title?(R(),P(K(st),{key:0,"data-slot":`title`,class:J(f.value.title({class:K(a).ui?.title}))},{default:S(()=>[F(e.$slots,`title`,{},()=>[L(q(K(a).title),1)])]),_:3},8,[`class`])):B(``,!0),K(a).description||i.description?(R(),P(K(rt),{key:1,"data-slot":`description`,class:J(f.value.description({class:K(a).ui?.description}))},{default:S(()=>[F(e.$slots,`description`,{},()=>[L(q(K(a).description),1)])]),_:3},8,[`class`])):B(``,!0)],2)):B(``,!0),F(e.$slots,`actions`),K(a).close||i.close?(R(),P(K(Qe),{key:1,"as-child":``},{default:S(()=>[F(e.$slots,`close`,{ui:f.value},()=>[K(a).close?(R(),P(ce,k({key:0,icon:K(a).closeIcon||K(s).ui.icons.close,color:`neutral`,variant:`ghost`,"aria-label":K(o)(`slideover.close`)},typeof K(a).close==`object`?K(a).close:{},{"data-slot":`close`,class:f.value.close({class:K(a).ui?.close})}),null,16,[`icon`,`aria-label`,`class`])):B(``,!0)])]),_:2},1024)):B(``,!0)])],2)):B(``,!0),U(`div`,{"data-slot":`body`,class:J(f.value.body({class:K(a).ui?.body}))},[F(e.$slots,`body`,{close:c})],2),i.footer?(R(),W(`div`,{key:1,"data-slot":`footer`,class:J(f.value.footer({class:K(a).ui?.footer}))},[F(e.$slots,`footer`,{close:c})],2)):B(``,!0)])]),_:2},1040,[`data-side`,`class`])]),_:2},1024)]),_:2},1040,[`force-mount`])]),_:3},16))}},Ct=[`data-expanded`,`data-overflowing`],wt={key:0,class:`fade pointer-events-none absolute inset-x-0 bottom-6 h-10`},Tt={key:1,class:`mt-1 flex justify-start`},Et=[`aria-expanded`],Dt=u(Y({__name:`ExpandableText`,props:{lines:{default:5}},setup(e){let t=e,n=N(!1),r=N(!1),i=N(null),a=`expandable-${Math.random().toString(36).slice(2,8)}`;function o(){let e=i.value;e&&!n.value&&(r.value=e.scrollHeight>e.clientHeight+1)}let s=null;E(()=>{o(),typeof ResizeObserver<`u`&&i.value&&(s=new ResizeObserver(()=>o()),s.observe(i.value))}),te(()=>s?.disconnect()),C(n,e=>{e||Promise.resolve().then(o)});function c(){n.value=!n.value}function l(e){!n.value&&r.value&&(e.target?.closest?.(`a`)||(n.value=!0))}return(e,o)=>(R(),W(`div`,{class:J([`expandable group relative`,!n.value&&r.value?`cursor-pointer`:``]),"data-expanded":n.value?`1`:`0`,"data-overflowing":r.value?`1`:`0`,onClick:l},[U(`div`,{id:a,ref_key:`body`,ref:i,class:J([`body`,n.value?``:`clamped`]),style:_(n.value?void 0:{"--expandable-lines":String(t.lines)})},[F(e.$slots,`default`,{},void 0,!0)],6),!n.value&&r.value?(R(),W(`div`,wt)):B(``,!0),r.value||n.value?(R(),W(`div`,Tt,[U(`button`,{type:`button`,class:`more cursor-pointer text-xs text-dimmed group-hover:text-primary hover:underline focus-visible:outline-2 focus-visible:outline-primary`,"aria-expanded":n.value?`true`:`false`,"aria-controls":a,onClick:A(c,[`stop`])},q(n.value?`Show less`:`Show more`),9,Et)])):B(``,!0)],10,Ct))}}),[[`__scopeId`,`data-v-ce3bfa89`]]);function Ot(e,t){let n=e.ownerDocument;e.textContent=``;let r=String(t??``).replace(/\r\n?/g,`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-YrRKtxsS.js","assets/AppShell-lYVcj-k7.js","assets/seed-DeKSHrt2.js","assets/main-D6nzMf0k.js","assets/main-CuENKPdD.css"])))=>i.map(i=>d[i]);
2
+ import{C as e,S as t,_ as n,b as r,c as i,g as a,h as o,m as s,n as c,p as l,r as u,s as d,t as f,v as p,y as m}from"./AppShell-lYVcj-k7.js";import{A as h,B as g,Ci as _,Dr as v,Gn as y,H as b,Ht as ee,J as x,Jn as te,Lr as S,Mr as C,N as w,Or as T,P as ne,Pr as re,Q as ie,Qn as E,Rn as ae,Si as D,U as O,Ut as oe,Wn as k,Wt as A,Xt as j,_ as se,_n as M,a as ce,at as le,b as ue,ci as N,cn as P,d as de,di as fe,dr as F,et as pe,f as me,ft as he,g as I,gn as L,h as ge,hi as _e,ir as R,it as ve,j as ye,kn as z,ln as B,m as be,mi as xe,nr as Se,nt as Ce,oi as V,on as H,or as we,p as Te,r as Ee,sn as U,t as De,u as Oe,un as W,ur as G,vi as K,wi as q,x as ke,xi as J,xr as Ae,y as je,yn as Y,z as Me,zr as Ne}from"./seed-DeKSHrt2.js";import{t as Pe}from"./Tooltip-DoThP2fW.js";import{r as Fe,t as Ie}from"./main-D6nzMf0k.js";import{n as Le,t as Re}from"./wallClock-61NpVkY6.js";import{t as ze}from"./NotFoundPage-BzWS4Ca1.js";import{t as Be}from"./indexFormat-B-pd4r7Y.js";import{A as Ve,D as He,E as Ue,M as X,O as We,b as Ge,j as Ke,k as qe,n as Je,t as Ye}from"./favicon-CWPcvWvp.js";import{t as Z}from"./localIso-L06jV29p.js";var[Q,Xe]=g(`DialogRoot`),Ze=Y({inheritAttrs:!1,__name:`DialogRoot`,props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1,default:!1},modal:{type:Boolean,required:!1,default:!0},unmountOnHide:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=le(n,`open`,t,{defaultValue:n.defaultOpen,passive:n.open===void 0}),i=N(),a=N(),{modal:o,unmountOnHide:s}=_e(n);return Xe({open:r,modal:o,unmountOnHide:s,openModal:()=>{r.value=!0},onOpenChange:e=>{r.value=e},onOpenToggle:()=>{r.value=!r.value},contentId:``,titleId:``,descriptionId:``,triggerElement:i,contentElement:a}),(e,t)=>F(e.$slots,`default`,{open:K(r),close:()=>r.value=!1})}}),Qe=Y({__name:`DialogClose`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;w();let n=Q();return(e,r)=>(R(),P(K(h),k(t,{type:e.as===`button`?`button`:void 0,onClick:r[0]||=e=>K(n).onOpenChange(!1)}),{default:S(()=>[F(e.$slots,`default`)]),_:3},16,[`type`]))}}),$e=Y({__name:`DialogContentImpl`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let r=e,i=t,o=Q(),{forwardRef:s,currentElement:c}=w();return o.titleId||=m(void 0,`reka-dialog-title`),o.descriptionId||=m(void 0,`reka-dialog-description`),E(()=>{o.contentElement=c,Me()!==document.body&&(o.triggerElement.value=Me())}),(e,t)=>(R(),P(K(n),{"as-child":``,loop:``,trapped:r.trapFocus,present:r.present,onMountAutoFocus:t[5]||=e=>i(`openAutoFocus`,e),onUnmountAutoFocus:t[6]||=e=>i(`closeAutoFocus`,e)},{default:S(()=>[M(K(p),k({id:K(o).contentId,ref:K(s),as:e.as,"as-child":e.asChild,present:r.present,"disable-outside-pointer-events":e.disableOutsidePointerEvents,role:`dialog`,"aria-describedby":K(o).descriptionId,"aria-labelledby":K(o).titleId,"data-state":K(a)(K(o).open.value)},e.$attrs,{onDismiss:t[0]||=e=>K(o).onOpenChange(!1),onEscapeKeyDown:t[1]||=e=>i(`escapeKeyDown`,e),onFocusOutside:t[2]||=e=>i(`focusOutside`,e),onInteractOutside:t[3]||=e=>i(`interactOutside`,e),onPointerDownOutside:t[4]||=e=>i(`pointerDownOutside`,e)}),{default:S(()=>[F(e.$slots,`default`)]),_:3},16,[`id`,`as`,`as-child`,`present`,`disable-outside-pointer-events`,`aria-describedby`,`aria-labelledby`,`data-state`])]),_:3},8,[`trapped`,`present`]))}}),et=Y({__name:`DialogContentModal`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,i=t,a=Q(),o=ne(i),{forwardRef:s,currentElement:c}=w(),l=H(()=>n.present?c.value:void 0);r(l);let u=H(()=>{let{present:e,...t}=n;return t});return C(()=>n.present,(e,t)=>{!e&&t&&a.triggerElement.value?.focus()}),(e,t)=>(R(),P($e,k({...u.value,...K(o)},{ref:K(s),present:e.present,"trap-focus":K(a).open.value,"disable-outside-pointer-events":n.disableOutsidePointerEvents,onCloseAutoFocus:t[0]||=e=>{e.defaultPrevented||(e.preventDefault(),K(a).triggerElement.value?.focus())},onPointerDownOutside:t[1]||=e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()},onFocusOutside:t[2]||=e=>{e.preventDefault()}}),{default:S(()=>[F(e.$slots,`default`)]),_:3},16,[`present`,`trap-focus`,`disable-outside-pointer-events`]))}}),tt=Y({__name:`DialogContentNonModal`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=ne(t);w();let i=Q(),a=N(!1),o=N(!1),s=H(()=>{let{present:e,...t}=n;return t});return C(()=>n.present,(e,t)=>{!e&&t&&(a.value||i.triggerElement.value?.focus(),a.value=!1,o.value=!1)}),(e,t)=>(R(),P($e,k({...s.value,...K(r)},{present:e.present,"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:t[0]||=e=>{e.defaultPrevented||(a.value||K(i).triggerElement.value?.focus(),e.preventDefault()),a.value=!1,o.value=!1},onInteractOutside:t[1]||=e=>{e.defaultPrevented||(a.value=!0,e.detail.originalEvent.type===`pointerdown`&&(o.value=!0));let t=e.target;K(i).triggerElement.value?.contains(t)&&e.preventDefault(),e.detail.originalEvent.type===`focusin`&&o.value&&e.preventDefault()}}),{default:S(()=>[F(e.$slots,`default`)]),_:3},16,[`present`]))}}),nt=Y({__name:`DialogContent`,props:{forceMount:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=Q(),a=ne(r),{forwardRef:o}=w();return(e,t)=>(R(),P(K(ye),{present:e.forceMount||K(i).open.value,"force-mount":e.forceMount||!K(i).unmountOnHide.value},{default:S(({present:t})=>[K(i).modal.value?Ne((R(),P(et,k({key:0,ref:K(o),present:K(i).unmountOnHide.value||t},{...n,...K(a),...e.$attrs}),{default:S(()=>[F(e.$slots,`default`)]),_:2},1040,[`present`])),[[ee,K(i).unmountOnHide.value||t]]):Ne((R(),P(tt,k({key:1,ref:K(o),present:K(i).unmountOnHide.value||t},{...n,...K(a),...e.$attrs}),{default:S(()=>[F(e.$slots,`default`)]),_:2},1040,[`present`])),[[ee,K(i).unmountOnHide.value||t]])]),_:3},8,[`present`,`force-mount`]))}}),rt=Y({__name:`DialogDescription`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`p`}},setup(e){let t=e;w();let n=Q();return(e,r)=>(R(),P(K(h),k(t,{id:K(n).descriptionId}),{default:S(()=>[F(e.$slots,`default`)]),_:3},16,[`id`]))}}),it=Y({__name:`DialogOverlayImpl`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1,default:!0}},setup(t){let n=t,r=Q(),i=e(n.present);return C(()=>n.present,e=>i.value=e),w(),(e,t)=>(R(),P(K(h),{as:e.as,"as-child":e.asChild,"data-state":K(r).open.value?`open`:`closed`,style:{"pointer-events":`auto`},onPointerdown:t[0]||=A(()=>{},[`left`,`self`,`prevent`])},{default:S(()=>[F(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`data-state`]))}}),at=Y({__name:`DialogOverlay`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=Q(),{forwardRef:n}=w();return(e,r)=>K(t)?.modal.value?(R(),P(K(ye),{key:0,present:e.forceMount||K(t).open.value,"force-mount":e.forceMount||!K(t).unmountOnHide.value},{default:S(({present:r})=>[Ne(M(it,k(e.$attrs,{ref:K(n),as:e.as,"as-child":e.asChild,present:K(t).unmountOnHide.value||r}),{default:S(()=>[F(e.$slots,`default`)]),_:2},1040,[`as`,`as-child`,`present`]),[[ee,K(t).unmountOnHide.value||r]])]),_:3},8,[`present`,`force-mount`])):B(`v-if`,!0)}}),ot=Y({__name:`DialogPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(R(),P(K(ke),D(z(t)),{default:S(()=>[F(e.$slots,`default`)]),_:3},16))}}),st=Y({__name:`DialogTitle`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`h2`}},setup(e){let t=e,n=Q();return w(),(e,r)=>(R(),P(K(h),k(t,{id:K(n).titleId}),{default:S(()=>[F(e.$slots,`default`)]),_:3},16,[`id`]))}}),ct=Y({__name:`DialogTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=Q(),{forwardRef:r,currentElement:i}=w();return n.contentId||=m(void 0,`reka-dialog-content`),E(()=>{n.triggerElement.value=i.value}),(e,i)=>(R(),P(K(h),k(t,{ref:K(r),type:e.as===`button`?`button`:void 0,"aria-haspopup":`dialog`,"aria-expanded":K(n).open.value||!1,"aria-controls":K(n).open.value?K(n).contentId:void 0,"data-state":K(n).open.value?`open`:`closed`,onClick:K(n).onOpenToggle}),{default:S(()=>[F(e.$slots,`default`)]),_:3},16,[`type`,`aria-expanded`,`aria-controls`,`data-state`,`onClick`]))}}),lt=Y({__name:`RovingFocusItem`,props:{tabStopId:{type:String,required:!1},focusable:{type:Boolean,required:!1,default:!0},active:{type:Boolean,required:!1},allowShiftKey:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=e,n=i(),r=m(),a=H(()=>t.tabStopId||r),c=H(()=>n.currentTabStopId.value===a.value),{getItems:u,CollectionItem:d}=ue();E(()=>{t.focusable&&n.onFocusableItemAdd()}),Se(()=>{t.focusable&&n.onFocusableItemRemove()}),C(()=>t.focusable,(e,t)=>{e!==t&&(e?n.onFocusableItemAdd():n.onFocusableItemRemove())});function f(e){if(e.key===`Tab`&&e.shiftKey){n.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let r=s(e,n.orientation.value,n.dir.value);if(r!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||!t.allowShiftKey&&e.shiftKey)return;e.preventDefault();let i=[...u().map(e=>e.ref).filter(e=>e.dataset.disabled!==``)];if(r===`last`)i.reverse();else if(r===`prev`||r===`next`){r===`prev`&&i.reverse();let t=i.indexOf(e.currentTarget);i=n.loop.value?o(i,t+1):i.slice(t+1)}y(()=>l(i))}}return(e,t)=>(R(),P(K(d),null,{default:S(()=>[M(K(h),{tabindex:c.value?0:-1,"data-orientation":K(n).orientation.value,"data-active":e.active?``:void 0,"data-disabled":e.focusable?void 0:``,as:e.as,"as-child":e.asChild,onMousedown:t[0]||=t=>{e.focusable?K(n).onItemFocus(a.value):t.preventDefault()},onFocus:t[1]||=e=>K(n).onItemFocus(a.value),onKeydown:f},{default:S(()=>[F(e.$slots,`default`)]),_:3},8,[`tabindex`,`data-orientation`,`data-active`,`data-disabled`,`as`,`as-child`])]),_:3}))}}),[ut,dt]=g(`TabsRoot`),ft=Y({__name:`TabsRoot`,props:{defaultValue:{type:null,required:!1},orientation:{type:String,required:!1,default:`horizontal`},dir:{type:String,required:!1},activationMode:{type:String,required:!1,default:`automatic`},modelValue:{type:null,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:modelValue`],setup(e,{emit:n}){let r=e,i=n,{orientation:a,unmountOnHide:o,dir:s}=_e(r),c=t(s);w();let l=le(r,`modelValue`,i,{defaultValue:r.defaultValue,passive:r.modelValue===void 0}),u=N(),d=fe(new Set);return dt({modelValue:l,changeModelValue:e=>{l.value=e},orientation:a,dir:c,unmountOnHide:o,activationMode:r.activationMode,baseId:m(void 0,`reka-tabs`),tabsList:u,contentIds:d,registerContent:e=>{d.value=new Set([...d.value,e])},unregisterContent:e=>{let t=new Set(d.value);t.delete(e),d.value=t}}),(e,t)=>(R(),P(K(h),{dir:K(c),"data-orientation":K(a),"as-child":e.asChild,as:e.as},{default:S(()=>[F(e.$slots,`default`,{modelValue:K(l)})]),_:3},8,[`dir`,`data-orientation`,`as-child`,`as`]))}});function pt(e,t){return`${e}-trigger-${t}`}function mt(e,t){return`${e}-content-${t}`}var ht=Y({__name:`TabsContent`,props:{value:{type:[String,Number],required:!0},forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,{forwardRef:n}=w(),r=ut(),i=H(()=>pt(r.baseId,t.value)),a=H(()=>mt(r.baseId,t.value)),o=H(()=>t.value===r.modelValue.value),s=N(o.value);return E(()=>{r.registerContent(t.value),requestAnimationFrame(()=>{s.value=!1})}),te(()=>{r.unregisterContent(t.value)}),(e,t)=>(R(),P(K(ye),{present:e.forceMount||o.value,"force-mount":``},{default:S(({present:t})=>[M(K(h),{id:a.value,ref:K(n),"as-child":e.asChild,as:e.as,role:`tabpanel`,"data-state":o.value?`active`:`inactive`,"data-orientation":K(r).orientation.value,"aria-labelledby":i.value,hidden:!t,tabindex:`0`,style:_({animationDuration:s.value?`0s`:void 0})},{default:S(()=>[!K(r).unmountOnHide.value||t?F(e.$slots,`default`,{key:0}):B(`v-if`,!0)]),_:2},1032,[`id`,`as-child`,`as`,`data-state`,`data-orientation`,`aria-labelledby`,`hidden`,`style`])]),_:3},8,[`present`]))}}),gt=Y({__name:`TabsIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e,{expose:t}){let n=e,r=ut();t({updateIndicatorStyle:s}),w();let i=Ce(),a=N({size:null,thickness:null,position:null}),o=N([]);C(()=>[r.modelValue.value,r?.dir.value],()=>{s()},{immediate:!0,flush:`post`}),re(()=>{o.value=Array.from(r.tabsList.value?.querySelectorAll(`[role="tab"]`)||[])}),ve(H(()=>[r.tabsList.value,...o.value]),s);function s(){let e=r.tabsList.value?.querySelector(`[role="tab"][data-state="active"]`);e&&(r.orientation.value===`horizontal`?a.value={size:e.offsetWidth,thickness:e.offsetHeight,position:e.offsetLeft}:a.value={size:e.offsetHeight,thickness:e.offsetWidth,position:e.offsetTop})}return(e,t)=>K(i)&&typeof a.value.size==`number`?(R(),P(K(h),k({key:0},n,{style:{"--reka-tabs-indicator-size":`${a.value.size}px`,"--reka-tabs-indicator-thickness":`${a.value.thickness}px`,"--reka-tabs-indicator-position":`${a.value.position}px`}}),{default:S(()=>[F(e.$slots,`default`)]),_:3},16,[`style`])):B(`v-if`,!0)}}),_t=Y({__name:`TabsList`,props:{loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let{loop:t}=_e(e),{forwardRef:n,currentElement:r}=w(),i=ut();return i.tabsList=r,(e,r)=>(R(),P(K(d),{"as-child":``,orientation:K(i).orientation.value,dir:K(i).dir.value,loop:K(t)},{default:S(()=>[M(K(h),{ref:K(n),role:`tablist`,"as-child":e.asChild,as:e.as,"aria-orientation":K(i).orientation.value},{default:S(()=>[F(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`aria-orientation`])]),_:3},8,[`orientation`,`dir`,`loop`]))}}),vt=Y({__name:`TabsTrigger`,props:{value:{type:[String,Number],required:!0},disabled:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,{forwardRef:n}=w(),r=ut(),i=H(()=>pt(r.baseId,t.value)),a=H(()=>r.contentIds.value.has(t.value)?mt(r.baseId,t.value):void 0),o=H(()=>t.value===r.modelValue.value);return(e,t)=>(R(),P(K(lt),{"as-child":``,focusable:!e.disabled,active:o.value},{default:S(()=>[M(K(h),{id:i.value,ref:K(n),role:`tab`,type:e.as===`button`?`button`:void 0,as:e.as,"as-child":e.asChild,"aria-selected":o.value?`true`:`false`,"aria-controls":a.value,"data-state":o.value?`active`:`inactive`,disabled:e.disabled,"data-disabled":e.disabled?``:void 0,"data-orientation":K(r).orientation.value,onMousedown:t[0]||=A(t=>{!e.disabled&&t.ctrlKey===!1?K(r).changeModelValue(e.value):t.preventDefault()},[`left`]),onKeydown:t[1]||=oe(t=>K(r).changeModelValue(e.value),[`enter`,`space`]),onFocus:t[2]||=()=>{let t=K(r).activationMode!==`manual`;!o.value&&!e.disabled&&t&&K(r).changeModelValue(e.value)}},{default:S(()=>[F(e.$slots,`default`)]),_:3},8,[`id`,`type`,`as`,`as-child`,`aria-selected`,`aria-controls`,`data-state`,`disabled`,`data-disabled`,`data-orientation`])]),_:3},8,[`focusable`,`active`]))}});function yt(e){let t=new Date(e),n=t.getHours(),r=e=>String(e).padStart(2,`0`),i=new Intl.DateTimeFormat(void 0,{timeZoneName:`short`}).formatToParts(t).find(e=>e.type===`timeZoneName`)?.value;return`${n%12==0?12:n%12}:${r(t.getMinutes())}:${r(t.getSeconds())} ${n<12?`AM`:`PM`}${i?` ${i}`:``}`}function bt(e,t={}){let n=e.detail.originalEvent,r=n.target;if(!r?.isConnected){e.preventDefault();return}t.scrollable&&(n.offsetX>r.clientWidth||n.offsetY>r.clientHeight)&&e.preventDefault()}var xt={slots:{overlay:`fixed inset-0 bg-elevated/75`,content:`fixed bg-default divide-y divide-default sm:ring ring-default sm:shadow-lg flex flex-col focus:outline-none`,header:`flex items-center gap-1.5 p-4 sm:px-6 min-h-(--ui-header-height)`,wrapper:``,body:`flex-1 overflow-y-auto p-4 sm:p-6`,footer:`flex items-center gap-1.5 p-4 sm:px-6`,title:`text-highlighted font-semibold`,description:`mt-1 text-muted text-sm`,close:`absolute top-4 end-4`},variants:{side:{top:{content:``},right:{content:`max-w-md`},bottom:{content:``},left:{content:`max-w-md`}},inset:{true:{content:`rounded-lg`}},transition:{true:{overlay:`data-[state=open]:animate-[fade-in_200ms_var(--ease-out)] data-[state=closed]:animate-[fade-out_200ms_var(--ease-out)]`}}},compoundVariants:[{side:`top`,inset:!0,class:{content:`max-h-[calc(100%-2rem)] inset-x-4 top-4`}},{side:`top`,inset:!1,class:{content:`max-h-full inset-x-0 top-0`}},{side:`right`,inset:!0,class:{content:`w-[calc(100%-2rem)] inset-y-4 right-4`}},{side:`right`,inset:!1,class:{content:`w-full inset-y-0 right-0`}},{side:`bottom`,inset:!0,class:{content:`max-h-[calc(100%-2rem)] inset-x-4 bottom-4`}},{side:`bottom`,inset:!1,class:{content:`max-h-full inset-x-0 bottom-0`}},{side:`left`,inset:!0,class:{content:`w-[calc(100%-2rem)] inset-y-4 left-4`}},{side:`left`,inset:!1,class:{content:`w-full inset-y-0 left-0`}},{transition:!0,side:`top`,class:{content:`data-[state=open]:animate-[slide-in-from-top_200ms_var(--ease-out)] data-[state=closed]:animate-[slide-out-to-top_200ms_var(--ease-out)]`}},{transition:!0,side:`right`,class:{content:`data-[state=open]:animate-[slide-in-from-right_200ms_var(--ease-out)] data-[state=closed]:animate-[slide-out-to-right_200ms_var(--ease-out)]`}},{transition:!0,side:`bottom`,class:{content:`data-[state=open]:animate-[slide-in-from-bottom_200ms_var(--ease-out)] data-[state=closed]:animate-[slide-out-to-bottom_200ms_var(--ease-out)]`}},{transition:!0,side:`left`,class:{content:`data-[state=open]:animate-[slide-in-from-left_200ms_var(--ease-out)] data-[state=closed]:animate-[slide-out-to-left_200ms_var(--ease-out)]`}}]},St={__name:`Slideover`,props:{title:{type:String,required:!1},description:{type:String,required:!1},content:{type:Object,required:!1},overlay:{type:Boolean,required:!1,default:!0},transition:{type:Boolean,required:!1,default:!0},side:{type:null,required:!1,default:`right`},inset:{type:Boolean,required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},close:{type:[Boolean,Object],required:!1,default:!0},closeIcon:{type:null,required:!1},dismissible:{type:Boolean,required:!1,default:!0},class:{type:null,required:!1},ui:{type:Object,required:!1},open:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1},modal:{type:Boolean,required:!1,default:!0},unmountOnHide:{type:Boolean,required:!1}},emits:[`leave`,`after:leave`,`enter`,`after:enter`,`close:prevent`,`update:open`],setup(e,{emit:t}){let n=e,r=t,i=v(),a=se(`slideover`,n),{t:o}=b(),s=x(),c=I(he(a,`open`,`defaultOpen`,`modal`,`unmountOnHide`),r),l=je(xe(()=>a.portal)),u=xe(()=>a.content),d=H(()=>a.dismissible?{pointerDownOutside:bt}:[`interactOutside`,`escapeKeyDown`].reduce((e,t)=>(e[t]=e=>{e.preventDefault(),r(`close:prevent`)},e),{})),f=H(()=>ge({extend:xt,...s.ui?.slideover||{}})({transition:a.transition,side:a.side,inset:a.inset}));return(e,t)=>(R(),P(K(Ze),D(z(K(c))),{default:S(({open:n,close:c})=>[i.default?(R(),P(K(ct),{key:0,"as-child":``,class:J(K(a).class)},{default:S(()=>[F(e.$slots,`default`,{open:n})]),_:2},1032,[`class`])):B(``,!0),M(K(ot),k(K(l),{"force-mount":K(l).disabled&&K(a).unmountOnHide===!1||void 0}),{default:S(()=>[M(K(Oe),null,{default:S(()=>[K(a).overlay?(R(),P(K(at),{key:0,"data-slot":`overlay`,class:J(f.value.overlay({class:K(a).ui?.overlay}))},null,8,[`class`])):B(``,!0),M(K(nt),k({"data-side":K(a).side,"data-slot":`content`,class:f.value.content({class:[!i.default&&K(a).class,K(a).ui?.content]})},u.value,{onEnter:t[0]||=e=>r(`enter`),onAfterEnter:t[1]||=e=>r(`after:enter`),onLeave:t[2]||=e=>r(`leave`),onAfterLeave:t[3]||=e=>r(`after:leave`)},Ae(d.value)),{default:S(()=>[!K(a).title&&!i.title||!K(a).description&&!i.description||i.content?(R(),P(K(Fe),{key:0},{default:S(()=>[!K(a).title&&!i.title?(R(),P(K(st),{key:0})):i.content?(R(),P(K(st),{key:1},{default:S(()=>[F(e.$slots,`title`,{},()=>[L(q(K(a).title),1)])]),_:3})):B(``,!0),!K(a).description&&!i.description?(R(),P(K(rt),{key:2})):i.content?(R(),P(K(rt),{key:3},{default:S(()=>[F(e.$slots,`description`,{},()=>[L(q(K(a).description),1)])]),_:3})):B(``,!0)]),_:3})):B(``,!0),F(e.$slots,`content`,{close:c},()=>[i.header||K(a).title||i.title||K(a).description||i.description||K(a).close||i.close?(R(),W(`div`,{key:0,"data-slot":`header`,class:J(f.value.header({class:K(a).ui?.header}))},[F(e.$slots,`header`,{close:c},()=>[K(a).title||i.title||K(a).description||i.description?(R(),W(`div`,{key:0,"data-slot":`wrapper`,class:J(f.value.wrapper({class:K(a).ui?.wrapper}))},[K(a).title||i.title?(R(),P(K(st),{key:0,"data-slot":`title`,class:J(f.value.title({class:K(a).ui?.title}))},{default:S(()=>[F(e.$slots,`title`,{},()=>[L(q(K(a).title),1)])]),_:3},8,[`class`])):B(``,!0),K(a).description||i.description?(R(),P(K(rt),{key:1,"data-slot":`description`,class:J(f.value.description({class:K(a).ui?.description}))},{default:S(()=>[F(e.$slots,`description`,{},()=>[L(q(K(a).description),1)])]),_:3},8,[`class`])):B(``,!0)],2)):B(``,!0),F(e.$slots,`actions`),K(a).close||i.close?(R(),P(K(Qe),{key:1,"as-child":``},{default:S(()=>[F(e.$slots,`close`,{ui:f.value},()=>[K(a).close?(R(),P(ce,k({key:0,icon:K(a).closeIcon||K(s).ui.icons.close,color:`neutral`,variant:`ghost`,"aria-label":K(o)(`slideover.close`)},typeof K(a).close==`object`?K(a).close:{},{"data-slot":`close`,class:f.value.close({class:K(a).ui?.close})}),null,16,[`icon`,`aria-label`,`class`])):B(``,!0)])]),_:2},1024)):B(``,!0)])],2)):B(``,!0),U(`div`,{"data-slot":`body`,class:J(f.value.body({class:K(a).ui?.body}))},[F(e.$slots,`body`,{close:c})],2),i.footer?(R(),W(`div`,{key:1,"data-slot":`footer`,class:J(f.value.footer({class:K(a).ui?.footer}))},[F(e.$slots,`footer`,{close:c})],2)):B(``,!0)])]),_:2},1040,[`data-side`,`class`])]),_:2},1024)]),_:2},1040,[`force-mount`])]),_:3},16))}},Ct=[`data-expanded`,`data-overflowing`],wt={key:0,class:`fade pointer-events-none absolute inset-x-0 bottom-6 h-10`},Tt={key:1,class:`mt-1 flex justify-start`},Et=[`aria-expanded`],Dt=u(Y({__name:`ExpandableText`,props:{lines:{default:5}},setup(e){let t=e,n=N(!1),r=N(!1),i=N(null),a=`expandable-${Math.random().toString(36).slice(2,8)}`;function o(){let e=i.value;e&&!n.value&&(r.value=e.scrollHeight>e.clientHeight+1)}let s=null;E(()=>{o(),typeof ResizeObserver<`u`&&i.value&&(s=new ResizeObserver(()=>o()),s.observe(i.value))}),te(()=>s?.disconnect()),C(n,e=>{e||Promise.resolve().then(o)});function c(){n.value=!n.value}function l(e){!n.value&&r.value&&(e.target?.closest?.(`a`)||(n.value=!0))}return(e,o)=>(R(),W(`div`,{class:J([`expandable group relative`,!n.value&&r.value?`cursor-pointer`:``]),"data-expanded":n.value?`1`:`0`,"data-overflowing":r.value?`1`:`0`,onClick:l},[U(`div`,{id:a,ref_key:`body`,ref:i,class:J([`body`,n.value?``:`clamped`]),style:_(n.value?void 0:{"--expandable-lines":String(t.lines)})},[F(e.$slots,`default`,{},void 0,!0)],6),!n.value&&r.value?(R(),W(`div`,wt)):B(``,!0),r.value||n.value?(R(),W(`div`,Tt,[U(`button`,{type:`button`,class:`more cursor-pointer text-xs text-dimmed group-hover:text-primary hover:underline focus-visible:outline-2 focus-visible:outline-primary`,"aria-expanded":n.value?`true`:`false`,"aria-controls":a,onClick:A(c,[`stop`])},q(n.value?`Show less`:`Show more`),9,Et)])):B(``,!0)],10,Ct))}}),[[`__scopeId`,`data-v-ce3bfa89`]]);function Ot(e,t){let n=e.ownerDocument;e.textContent=``;let r=String(t??``).replace(/\r\n?/g,`
3
3
  `).split(`
4
4
  `),i=/^(\s*)([-*]|\d+[.)])\s+(.*)$/,a=/^(```|#{1,6}\s|>)/;function o(e,t){let r=n.createElement(t);return e.appendChild(r),r}function s(e,t){t&&e.appendChild(n.createTextNode(t))}function c(e){let t=e.trim();return t[0]===`|`&&(t=t.slice(1)),t[t.length-1]===`|`&&(t=t.slice(0,-1)),t.split(`|`).map(e=>e.trim())}function l(e){let t=e.trim();return t.indexOf(`|`)<0||!/^[\s:|-]+$/.test(t)?!1:c(t).every(e=>/^:?-+:?$/.test(e))}function u(e,t){let n=e[t];return n.indexOf(`|`)<0||l(n)||t+1>=e.length||!l(e[t+1])?!1:c(n).length===c(e[t+1]).length}function d(e,t){let n=0,r=``,i=()=>{s(e,r),r=``};for(;n<t.length;){let a=t[n];if(a==="`"){let r=t.indexOf("`",n+1);if(r>n+1){i(),o(e,`code`).textContent=t.slice(n+1,r),n=r+1;continue}}else if(a===`*`&&t[n+1]===`*`){let r=t.indexOf(`**`,n+2);if(r>n+2){i(),d(o(e,`strong`),t.slice(n+2,r)),n=r+2;continue}}else if(a===`*`||a===`_`){let r=n>0?t[n-1]:``;if(/\S/.test(t[n+1]||``)&&!/\w/.test(r)){let r=-1;for(let e=n+2;e<t.length;e++)if(t[e]===a&&/\S/.test(t[e-1])&&!/\w/.test(t[e+1]||``)){r=e;break}if(r>0){i(),d(o(e,`em`),t.slice(n+1,r)),n=r+1;continue}}}else if(a===`[`){let r=/^\[([^\]\n]+)\]\(([^)\s]+)\)/.exec(t.slice(n));if(r&&/^https?:\/\//i.test(r[2])){i();let t=o(e,`a`);t.setAttribute(`href`,r[2]),t.setAttribute(`rel`,`noopener noreferrer`),t.setAttribute(`target`,`_blank`),d(t,r[1]),n+=r[0].length;continue}}r+=a,n++}i()}function f(e,t,n=0){let r=0;for(;r<t.length;){let s=t[r];if(/^\s*$/.test(s)){r++;continue}if(/^```/.test(s)){let n=[];for(r++;r<t.length&&!/^```\s*$/.test(t[r]);)n.push(t[r++]);r++,o(o(e,`pre`),`code`).textContent=n.join(`
5
5
  `);continue}let l=/^(#{1,6})\s+(\S.*?)\s*$/.exec(s);if(l){d(o(e,`h`+l[1].length),l[2]),r++;continue}if(s[0]===`>`&&n<8){let i=[];for(;r<t.length&&t[r][0]===`>`;)i.push(t[r++].replace(/^>\s?/,``));f(o(e,`blockquote`),i,n+1);continue}if(u(t,r)){let n=c(s),i=o(e,`table`),a=o(o(i,`thead`),`tr`);for(let e of n)d(o(a,`th`),e);r+=2;let l=null;for(;r<t.length&&t[r].indexOf(`|`)>=0&&!u(t,r);){l||=o(i,`tbody`);let e=c(t[r]),a=o(l,`tr`);for(let t=0;t<n.length;t++)d(o(a,`td`),t<e.length?e[t]:``);r++}continue}if(i.test(s)){let n=[],a;for(;r<t.length&&(a=i.exec(t[r]))!==null;)n.push({indent:a[1].length,ordered:/^\d/.test(a[2]),text:a[3]}),r++;let s=n[0].indent,c=o(e,n[0].ordered?`ol`:`ul`),l=null,u=null;for(let e of n)e.indent>s&&l?(u||=o(l,e.ordered?`ol`:`ul`),d(o(u,`li`),e.text)):(l=o(c,`li`),u=null,d(l,e.text));continue}let p=[];for(;r<t.length&&!/^\s*$/.test(t[r])&&!a.test(t[r])&&!i.test(t[r])&&!u(t,r);)p.push(t[r++]);p.length===0&&p.push(t[r++]),d(o(e,`p`),p.join(`
6
6
  `))}}f(e,r)}var $=Y({__name:`MarkdownText`,props:{text:{}},setup(e){let t=e,n=N(null);function r(){let e=n.value;if(e)try{Ot(e,t.text)}catch{e.textContent=t.text}}return E(r),C(()=>t.text,r),(e,t)=>(R(),W(`div`,{ref_key:`root`,ref:n,class:`md prose prose-sm prose-neutral dark:prose-invert min-w-0 max-w-none flex-1 whitespace-pre-wrap break-words font-sans text-[0.875rem] leading-normal [&_a]:font-medium [&_a]:decoration-(--ui-text-dimmed) [&_a]:underline-offset-[3px] [&_a:hover]:decoration-current [&_blockquote]:my-1.5 [&_h1]:font-medium [&_h1]:tracking-tight [&_h2]:font-medium [&_h2]:tracking-tight [&_h3]:font-medium [&_h3]:tracking-tight [&_h4]:font-medium [&_strong]:font-medium [&_li>ol]:my-0.5 [&_li>ul]:my-0.5 [&_li]:my-0.5 [&_li]:whitespace-pre-wrap [&_ol]:my-1.5 [&_ol]:whitespace-normal [&_p]:my-1.5 [&_pre]:my-2 [&_pre]:whitespace-pre [&_table]:whitespace-normal [&_ul]:my-1.5 [&_ul]:whitespace-normal`},null,512))}}),kt={},At={viewBox:`0 0 16 16`,class:`inline-block size-[1em] shrink-0`,"aria-hidden":`true`};function jt(e,t){return R(),W(`svg`,At,[...t[0]||=[U(`path`,{fill:`currentColor`,d:`M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z`},null,-1)]])}var Mt=u(kt,[[`render`,jt]]);function Nt(){let e=[],t=null,n=0,r=[];function i(e){return typeof e==`number`&&isFinite(e)?e:void 0}function a(e){return typeof e==`string`?e:``}function o(n){let r={index:e.length,calls:[]};return n&&(r.narration=n),e.push(r),t=r,r}function s(e){return e<1e3?String(e):e<1e6?(Math.round(e/100)/10).toFixed(1)+`k`:(Math.round(e/1e5)/10).toFixed(1)+`M`}function c(e){let t=/\((\d+) chars(?:, (\d+) lines)?\)$/.exec(e.summary);if(t)return t[2]?Number(t[2]):1;if(e.output)return e.output.split(`
7
7
  `).length}function l(e){let t=[],n=e.result;if(!n)return t;n.infra?t.push(`sandbox error`):e.shell?t.push(n.exitCode===void 0?n.ok?`exit 0`:`error`:`exit `+n.exitCode):n.ok||t.push(`error`);let r=c(n);return r!==void 0&&r>1&&t.push(r+` lines`),e.durationMs!==void 0&&t.push(X(e.durationMs,`precise`)),t}function u(e,t){let n={ok:t.ok===!0,infra:t.infra===!0,summary:a(t.summary),output:a(t.output),at:i(t.at)},o=i(t.exitCode);o!==void 0&&(n.exitCode=o),e.result=n;let s=r.indexOf(e);s!==-1&&r.splice(s,1),e.status=n.infra?`infra`:n.ok?`ok`:`failed`,e.status!==`ok`&&(e.tags=e.tags.concat(e.status)),e.startedAt!==void 0&&n.at!==void 0&&n.at>=e.startedAt&&(e.durationMs=n.at-e.startedAt),e.facts=l(e)}let d=[[`tests`,/\b(npm|pnpm|yarn|bun)\s+(run\s+)?test\b|\b(vitest|jest|pytest|mocha|go test|cargo test)\b/],[`build`,/\b(npm|pnpm|yarn|bun)\s+run\s+(build|typecheck|lint)\b|\b(tsc|make|cargo build|go build|eslint|prettier)\b/],[`install`,/\b(npm|pnpm|yarn|bun)\s+(i|install|ci|add)\b|\bpip3?\s+install\b|\bapt(-get)?\s+install\b|\bbrew\s+install\b/],[`git`,/(^|[\s;&|(])(git|gh)\s/],[`network`,/(^|[\s;&|(])(curl|wget)\s/],[`read`,/(^|[\s;&|(])(cat|sed|head|tail|less|ls|find|grep|rg|wc|tree|pwd|echo|env|which|stat|file|diff)\b/]];function f(e){let t=e.replace(/^(\s*cd\s+("[^"]*"|'[^']*'|\S+)\s*(&&|;)\s*)+/,``);return t.trim()?t:e}function p(e){let t=f(e);for(let[e,n]of d)if(n.test(t))return e;return`shell`}function m(e,t){let n=t?f(e):e,r=n.indexOf(`
8
- `),i=r===-1?n:n.slice(0,r).trimEnd();return i.length<e.length?i+` …`:i}function h(e,t){let o=a(e.tool),s=o===`bash`,c=t||o,l=s&&c.startsWith(`$ `)?c.slice(2):!s&&c.startsWith(o+` `)?c.slice(o.length+1):c,u={id:a(e.callId)||`c`+ ++n,tool:o,title:l,headline:m(l,s),shell:s,quiet:o===`update_status`,tags:[s?p(l):o],status:`running`,startedAt:i(e.at),facts:[]};return r.push(u),u}function g(t){for(let n=e.length-1;n>=0;n--)for(let r of e[n].calls)if(r.id===t)return{step:e[n],call:r};return null}function _(t){let n=a(t.callId);if(!n)return null;for(let t=e.length-1;t>=0;t--)for(let r of e[t].calls)if(r.id===n&&!r.result)return{step:e[t],call:r};return null}function v(e){if(!e||typeof e!=`object`)return[];let n=e;switch(n.type){case`input`:{let e={kind:`input`,text:a(n.text),at:i(n.at)},t=n.source;if(t&&typeof t==`object`){let n=t,r={};a(n.url)&&(r.url=a(n.url)),a(n.channel)&&(r.channel=a(n.channel)),a(n.user)&&(r.user=a(n.user)),a(n.run)&&(r.run=a(n.run)),Object.keys(r).length>0&&(e.source=r)}return[e]}case`answer`:return[{kind:`answer`,text:a(n.text),at:i(n.at)}];case`pr_opened`:{let e=i(n.number);return!a(n.url)||e===void 0||!Number.isInteger(e)||e<=0?[]:[{kind:`pr_opened`,url:a(n.url),number:e,created:n.created===!0,at:i(n.at)}]}case`run_meta`:{if(!a(n.agent))return[];let e={kind:`meta`,agent:a(n.agent),model:a(n.model),at:i(n.at)};return a(n.effort)&&(e.effort=a(n.effort)),a(n.repo)&&(e.repo=a(n.repo)),a(n.ref)&&(e.ref=a(n.ref)),i(n.pr)!==void 0&&Number.isInteger(n.pr)&&n.pr>0&&(e.pr=n.pr),/^[0-9a-f]{7,40}$/i.test(a(n.headSha))&&(e.headSha=a(n.headSha)),[e]}case`context`:return[{kind:`context`,text:a(n.text),at:i(n.at)}];case`replay_note`:return[{kind:`replay_note`,text:a(n.summary)}];case`run_note`:return[{kind:`note`,text:a(n.summary),noteKind:a(n.kind),mode:a(n.mode)||void 0,at:i(n.at)}];case`assistant`:return[{kind:`step`,step:o({text:a(n.text),at:i(n.at)})}];case`review_artifact`:return[];case`span_start`:{let e=a(n.name),t=a(n.spanId);return!e||!t||e.startsWith(`tool.`)||e.startsWith(`mcp.`)||e===`model.turn`?[]:[{kind:`span`,spanId:t,name:e,open:!0,at:i(n.at)}]}case`span_end`:{let e=a(n.name),r=a(n.spanId),o=i(n.durationMs);if(!e||!r||o===void 0)return[];let c=n.status===`error`?`error`:`ok`,u=typeof n.attrs==`object`&&n.attrs!==null?n.attrs:{};if(e===`model.turn`){t=null;let e=[],c=i(u.inputTokens),l=i(u.outputTokens),d=i(u.cacheReadTokens);c!==void 0&&e.push(s(c)+` in`),l!==void 0&&e.push(s(l)+` out`),d!==void 0&&e.push(s(d)+` cached`);let f=i(u.ttftMs);f!==void 0&&e.push(`first token `+X(f,`precise`));let p=i(u.thinkingMs);p!==void 0&&e.push(`thinking `+X(p,`precise`));let m=i(u.textMs);m!==void 0&&e.push(`writing `+X(m,`precise`));let h=a(u.model);return[{kind:`turn`,spanId:r,label:`Thought for `+X(o,`precise`),facts:e,durationMs:o,...h?{model:h}:{},at:i(n.at)}]}if(e.startsWith(`tool.`)||e.startsWith(`mcp.`)){if(!e.startsWith(`tool.`))return[];let t=a(u.callId);if(!t)return[];let n=g(t);return!n||n.call.durationMs!==void 0?[]:(n.call.durationMs=o,n.call.facts=l(n.call),[{kind:`result`,step:n.step,call:n.call}])}let d=i(n.startedAt);return[{kind:`span`,spanId:r,name:e,open:!1,durationMs:o,status:c,at:i(n.at),...d===void 0?{}:{startedAt:d}}]}case`skill_use`:{let e=a(n.skill);if(!e)return[];let r=[];t||r.push({kind:`step`,step:o()});let s=a(n.source),c={name:e,description:a(n.description),agent:a(n.agent),bodyBytes:i(n.bodyBytes)??0,at:i(n.at)};return/^https?:\/\//.test(s)&&(c.source=s),r.push({kind:`skill`,step:t,skill:c}),r}case`tool_call`:{let e=[];t||e.push({kind:`step`,step:o()});let r=h(n,a(n.summary));return t.calls.push(r),e.push({kind:`call`,step:t,call:r}),e}case`tool_result`:{let e=_(n);if(e)return u(e.call,n),[{kind:`result`,step:e.step,call:e.call}];let r=[];t||r.push({kind:`step`,step:o()});let i=h(n,``);return i.startedAt=void 0,u(i,n),t.calls.push(i),r.push({kind:`call`,step:t,call:i}),r}default:return[]}}function y(){return r.length>0?r[0]:null}return{push:v,pending:y,steps:()=>e}}new Set(`request,slack.receive,dispatch.history,dispatch.admission,dispatch.ack_card,dispatch.gate.repo,dispatch.gate.pr_head,dispatch.workspace.attach,dispatch.gate.attached_head,dispatch.mcp_discovery,dispatch.compose,dispatch.channel_visibility,dispatch.repo_context,dispatch.memory_read,dispatch.refuse,dispatch.ship_preflight,dispatch.ledger_claim,run.agent,run.command,run.reading_diff,run.settle_reviewed_head,run.description_turn,run.observe_workspace,run.pr_post_step,run.review_post_step,run.reading_diff_join,run.pr_description_join,model.turn,ship.round,post.card_close,post.reply`.split(`,`));var Pt=new Set([`slack.receive`,`dispatch.history`,`dispatch.admission`,`dispatch.ack_card`,`dispatch.gate.repo`,`dispatch.gate.pr_head`,`dispatch.workspace.attach`,`dispatch.gate.attached_head`,`dispatch.mcp_discovery`,`dispatch.compose`,`dispatch.channel_visibility`,`dispatch.repo_context`,`dispatch.memory_read`,`dispatch.refuse`,`dispatch.ship_preflight`,`dispatch.ledger_claim`]),Ft=new Set([`run.observe_workspace`,`run.pr_post_step`,`run.review_post_step`,`run.reading_diff_join`,`run.pr_description_join`]),It=new Set([`request`,`run.agent`,`ship.round`,`run.settle_reviewed_head`,`run.description_turn`,`post.card_close`,`post.reply`]),Lt=new Set([`run.reading_diff`]);function Rt(e,t){if(Lt.has(e))return{kind:`background`};if(It.has(e))return{kind:`uncounted`};if(e===`model.turn`)return{kind:`counted`,bucket:`thinking`};if(e===`run.command`||e.startsWith(`run.command.`))return{kind:`counted`,bucket:t===`command`?`tools`:`getting_ready`};if(Pt.has(e)||e.startsWith(`dispatch.workspace.attach.`))return{kind:`counted`,bucket:`getting_ready`};if(Ft.has(e))return{kind:`counted`,bucket:`finishing_up`};if(e.startsWith(`tool.`)||e.startsWith(`mcp.`))return{kind:`counted`,bucket:`tools`}}var zt={clone:`cloning the repo`,"checkout-clone":`cloning the checkout`,"worktree-clone":`cloning the worktree`,"worktree-detach":`checking out the expected commit`,"op-clone":`cloning the op tree`,fetch:`fetching the branch`,"wake-fetch":`fetching the latest commits`,"reclaim-fetch":`fetching to reclaim the mirror`,"for-each-ref":`listing the branches`,checkout:`checking out the branch`,"checkout-update":`updating the checkout`,"rev-parse":`reading the commit`,"cat-file":`checking the mirror for the commit`,"show-ref":`reading the branch tip`,"detect-default-branch":`detecting the default branch`,git:`a git command`,"git-setup":`configuring git`,"stage-perms":`securing the credential stage`,install:`installing dependencies`,build:`building`,test:`running the tests`,"clear-markers":`clearing the build markers`,"lockfile-key":`hashing the lockfile`,"deps-store-dir":`preparing the dependency store`,"deps-scratch":`cloning a scratch tree for the dependency install`,"deps-install":`installing the dependency store`,"deps-harden":`locking down the installed dependencies`,"deps-commit":`recording the installed dependencies`,"deps-adopt":`adopting the dependency store`,"deps-restore-scratch":`restoring dependencies to scratch`,"deps-restore-chown":`setting the restored dependencies' owner`,"deps-restore-commit":`recording the restored dependencies`,"deps-scratch-chown":`setting the dependency scratch owner`,"deps-evict":`evicting an old dependency store`,"unlink-deps-view":`unlinking the dependency view`,"clear-installing-marker":`clearing the install marker`,chown:`setting the workspace owner`,"worktree-chown":`setting the worktree owner`,"op-chown":`setting the op tree's owner`,"worktree-clean":`cleaning the worktree`,"clean-workspace":`cleaning the workspace`,"clean-before-restore":`cleaning before the restore`,"unmount-restores":`unmounting earlier restores`,"mirror-restore-extract":`extracting the mirror snapshot`,"checkout-restore-extract":`extracting the checkout snapshot`,"deps-restore-extract":`extracting the dependency snapshot`,evict:`evicting a stale tree`,"thread-dir":`preparing a directory`,"threads-dir":`preparing a directory`,"op-dir":`preparing a directory`,"ops-dir":`preparing a directory`,"stage-dir":`preparing a directory`,stat:`checking a file`,touch:`touching a marker`,nproc:`counting CPUs`,mutex_wait:`waiting for the workspace`,kill:`stopping the previous step`};Object.keys(zt);function Bt(e){return Object.prototype.hasOwnProperty.call(zt,e)?e:void 0}function Vt(e){let t=Bt(e);if(t!==void 0)return zt[t];if(e.endsWith(`-stale-sweep`)){let t=Bt(e.slice(0,-12));if(t!==void 0)return`clearing leftovers before ${zt[t]}`}}var Ht={request:`the request`,"slack.receive":`receiving`,"dispatch.history":`reading the thread`,"dispatch.admission":`checking the thread`,"dispatch.ack_card":`posting the status card`,"dispatch.gate.repo":`checking the repo`,"dispatch.gate.pr_head":`checking the PR`,"dispatch.workspace.attach":`attaching the workspace`,"dispatch.gate.attached_head":`checking out the branch`,"dispatch.mcp_discovery":`loading tools`,"dispatch.compose":`preparing the prompt`,"dispatch.channel_visibility":`checking the channel`,"dispatch.repo_context":`reading the repo's context`,"dispatch.memory_read":`recalling memory`,"dispatch.refuse":`refusing`,"dispatch.ship_preflight":`checking the ship request`,"dispatch.ledger_claim":`claiming the run's row`,"run.agent":`the agent loop`,"run.command":`the command`,"run.reading_diff":`reading the diff (in parallel)`,"run.settle_reviewed_head":`re-checking the moved branch`,"run.description_turn":`asking for the PR description`,"run.observe_workspace":`checking the workspace`,"run.pr_post_step":`posting the PR`,"run.review_post_step":`posting the review`,"run.reading_diff_join":`waiting for the diff`,"run.pr_description_join":`waiting for the PR description`,"model.turn":`a model turn`,"ship.round":`a ship round`,"post.card_close":`closing the card`,"post.reply":`posting the reply`},Ut=`a Switchboard step`;function Wt(e){if(e in Ht)return Ht[e];if(e.startsWith(`tool.`))return e.slice(5)||`a Switchboard step`;if(e.startsWith(`mcp.`)){let t=e.slice(e.lastIndexOf(`.`)+1);return t&&t!==`mcp`?t:Ut}for(let t of[`dispatch.workspace.attach.`,`run.command.`])if(e.startsWith(t))return Vt(e.slice(t.length))??`a Switchboard step`;return Ut}var Gt=`A-Za-z0-9:@._-`;RegExp(`^[${Gt}]{1,128}$`),RegExp(`[^${Gt}]`,`g`);function Kt(e){return e.type===`span_start`||e.type===`span_end`}function qt(e,t,n){let r=e.get(t.spanId);if(t.type===`span_start`){if(r)return;e.set(t.spanId,{traceId:n,spanId:t.spanId,...t.parentSpanId===void 0?{}:{parentSpanId:t.parentSpanId},name:t.name,startedAt:t.at??0,attrs:t.attrs??{}});return}e.set(t.spanId,{traceId:n,spanId:t.spanId,...t.parentSpanId===void 0?r?.parentSpanId===void 0?{}:{parentSpanId:r.parentSpanId}:{parentSpanId:t.parentSpanId},name:t.name,startedAt:t.startedAt,endedAt:t.startedAt+t.durationMs,durationMs:t.durationMs,status:t.status,...t.error===void 0?{}:{errorMessage:t.error},attrs:{...r?.attrs??{},...t.attrs??{}}})}function Jt(){let e,t,n=[];return{push(r){e?t&&r.seq!==void 0&&t.seq!==void 0&&r.seq>t.seq+1&&t.at!==void 0&&r.at!==void 0&&n.push({kind:`gap`,fromSeq:t.seq+1,toSeq:r.seq-1,from:Math.min(t.at,r.at),to:Math.max(t.at,r.at)}):e={seq:r.seq??1,at:r.at},r.type===`run_note`&&r.kind===`spans_dropped`&&r.from!==void 0&&r.to!==void 0&&r.to>=r.from&&n.push({kind:`note`,from:r.from,to:r.to}),t={seq:r.seq,at:r.at}},losses(t={}){let r=t.elided??[],i=(e,t)=>r.some(n=>n.fromSeq<=e&&t<=n.toSeq),a=[];e&&e.seq>1&&t.windowStart!==void 0&&e.at!==void 0&&e.at>t.windowStart&&a.push({from:t.windowStart,to:e.at,kind:`lost`});for(let e of n)a.push(e.kind===`note`?{from:e.from,to:e.to,kind:`lost`}:{from:e.from,to:e.to,kind:i(e.fromSeq,e.toSeq)?`elided`:`lost`});return a}}}var Yt=[/\bslack[\s-]?only\b/i,/\bpost\s*[:=]\s*(?:off|no|false|none)\b/i,/\bno[\s-]post\b/i,/\b(?:don['’]?t|do\s+not|never|skip|without)\s+(?:\w+\s+){0,2}?(?:post|comment)(?:ing|s)?\b/i,/\bno\s+need\s+to\s+(?:post|comment)\b/i];function Xt(e){return Yt.some(t=>t.test(e))}var Zt=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,Qt=/^[0-9a-f]{7,40}$/,$t=/^(?![.-])(?!.*\.\.)(?!.*\/\/)(?!.*@\{)(?!.*\.lock$)(?!.*[./]$)[\w][\w./-]*$/;function en(e){return e&&Zt.test(e)?`https://github.com/${e}`:void 0}function tn(e,t){let n=en(e);if(!(!n||t===void 0||!Number.isInteger(t)||t<=0))return`${n}/pull/${t}`}function nn(e,t){let n=en(e);if(n&&t&&$t.test(t))return`${n}/tree/${t.split(`/`).map(encodeURIComponent).join(`/`)}`}function rn(e,t){let n=en(e);if(n&&t&&Qt.test(t))return`${n}/commit/${t}`}function an(e){return e.slice(0,7)}function on(e){if(e===`slack.receive`||e.startsWith(`dispatch.`))return`getting_ready`;let t=Rt(e,`agent`);return t?.kind===`counted`&&t.bucket===`finishing_up`?`finishing_up`:void 0}function sn(e){return e===`request`||e===`run.agent`}var cn={getting_ready:`Getting ready`,finishing_up:`Finishing up`};function ln(e){let t=e.rows.length,n=`${t} step${t===1?``:`s`}`,r=cn[e.phase];if(t===0||e.rows.some(e=>e.open||e.at===void 0||e.durationMs===void 0))return`${r} · ${n}`;let i=Math.min(...e.rows.map(e=>e.at)),a=Math.max(...e.rows.map(e=>e.at+e.durationMs));return`${r} · ${n} · ${X(Math.max(0,a-i),`precise`)}`}function un(e){if(typeof e!=`string`)return null;let t;try{t=JSON.parse(e)}catch{return null}if(typeof t!=`object`||!t)return null;let{fromSeq:n,toSeq:r}=t,i=e=>typeof e==`number`&&Number.isInteger(e)&&e>0;return!i(n)||!i(r)||n>r?null:{fromSeq:n,toSeq:r}}function dn(e){let t=e.toSeq-e.fromSeq+1,n=t===1?`event ${e.fromSeq}`:`events ${e.fromSeq}–${e.toSeq}`;return`${t} ${t===1?`event`:`events`} not loaded (${n}) — the record has them`}function fn(e,t,n){let r=!!e.model&&t!==null&&Cn(e.model,t),i=r?t:e.model??t??void 0,a=!!e.model&&t!==null&&!r;return{spanId:e.spanId,label:e.label,chip:e.label.replace(/^Thought for /,``),quick:e.durationMs<6e4,durationMs:e.durationMs,facts:e.facts,...i?{model:i}:{},switched:a,showModel:!!i&&(!n||a),at:e.at}}function pn(e){let t=`${e.n} tool call${e.n===1?``:`s`}`;if(e.n===0)return`no tool calls`;if(e.ok===e.n)return`${t}, all succeeded`;if(e.running===e.n)return`${t}, all running`;let n=[];return e.bad&&n.push(`${e.bad} failed`),e.infra&&n.push(`${e.infra} sandbox error${e.infra===1?``:`s`}`),e.running&&n.push(`${e.running} still running`),`${t}, ${n.join(`, `)}`}function mn(e){let{meta:t,prOpened:n}=e,r=t?.repo&&en(t.repo)?t.repo:void 0;if(t?.agent===`review`){if(Xt(e.requestText))return{text:`verdict, Slack only`};if(r&&t.pr!==void 0){let e=tn(r,t.pr);return e?{text:`verdict for ${r}#${t.pr}`,href:e}:{text:`verdict`}}return{text:`verdict`}}if(t?.agent===`coding`&&n){let e=n.created?`pull request opened`:`pull request updated`,t=r?tn(r,n.number):void 0;return t?{text:`${e} ${r}#${n.number}`,href:t}:{text:e}}return t?.agent===`command`?{text:`output`}:{text:`answer`}}function hn(e,t){return{id:e.id,tool:e.tool,title:e.title,headline:e.headline,shell:e.shell,status:e.status,facts:[...e.facts],startedAt:e.startedAt,output:e.result?e.result.output||e.result.summary:``,hasResult:e.result!==void 0,chipOnly:!e.shell&&e.title===e.tool,durationMs:e.durationMs,exitCode:e.result?.exitCode,timedOut:Ve(e.result?.exitCode),open:t}}function gn(e={}){let t=e.openTags&&e.openTags.length>0?e.openTags:[`failed`,`infra`],n=Nt(),r=V({request:null,meta:null,context:[],log:[],reply:null,prOpened:null,placeholder:!0,allOpen:!1,stopMode:null,model:null,firstAt:null,lastAt:null,lastAtWall:null,elided:[],traceVersion:0}),i=Jt(),a=new Map,o=new Map,s=new Map,c=new Map,l=new Map,u=new Map,d=new Map,f=new Set,p=null,m=!1,h=-1,g=0,_=e=>`${e}-${g++}`;function v(e){return t.includes(`all`)?!0:e.some(e=>t.includes(e))}function y(e){let t=0,n=0,r=0;for(let i of e.items)i.kind===`call`&&(i.call.status===`failed`?t++:i.call.status===`infra`?n++:i.call.status===`running`&&r++);return{bad:t,infra:n,running:r}}function b(e){let{bad:t,infra:n,running:r}=y(e);(t||n||r)&&(e.groupOpen=!0)}function ee(e){let t=o.get(h);t&&(t.live=!1),h=e.index;let n=p;p=null;let i=V({kind:`step`,key:_(`step`),index:e.index,at:e.narration?e.narration.at:n?.at,turn:n,narration:e.narration?e.narration.text:null,note:`no commentary`,items:[],live:!0,manual:!1,groupOpen:!0});return o.set(e.index,i),r.log.push(i),i}function x(e){return o.get(e.index)??ee(e)}function te(e,t){let n=x(e);if(t.quiet){f.add(t.id),n.items.push({kind:`quiet`,at:t.startedAt,text:`✎ ${t.tool===`update_status`?`status checklist updated`:t.title}`}),b(n);return}let i=V(hn(t,r.allOpen||v(t.tags)));u.set(t.id,i),d.set(t.id,n),n.items.push({kind:`call`,call:i}),b(n)}function S(e,t){if(f.has(t.id)){let t=o.get(e.index);t&&b(t);return}let n=u.get(t.id);if(!n){te(e,t);return}Object.assign(n,hn(t,n.open)),v(t.tags)&&(n.open=!0);let r=o.get(e.index);r&&b(r)}function C(e){p&&=(r.log.push({kind:`turn`,key:_(`turn`),turn:p,note:e}),null)}function w(e){switch(r.placeholder=!1,e.kind){case`input`:{let t={text:e.text,at:e.at,...e.source?{source:e.source}:{}};r.request?r.log.push({kind:`followup`,key:_(`followup`),input:t}):r.request=t;return}case`step`:ee(e.step);return;case`call`:te(e.step,e.call);return;case`result`:S(e.step,e.call);return;case`turn`:C(``),p=fn(e,r.model,m),p.model&&(m=!0),e.model&&!(r.model!==null&&Cn(e.model,r.model))&&(r.model=e.model);return;case`meta`:r.model===null&&e.model&&(r.model=e.model),r.meta={agent:e.agent,model:e.model,...e.effort?{effort:e.effort}:{},...e.repo?{repo:e.repo}:{},...e.ref?{ref:e.ref}:{},...e.pr===void 0?{}:{pr:e.pr},...e.headSha?{headSha:e.headSha}:{}};return;case`pr_opened`:r.prOpened={url:e.url,number:e.number,created:e.created};return;case`skill`:x(e.step).items.push({kind:`skill`,skill:e.skill});return;case`context`:r.context.push({key:_(`ctx`),at:e.at,text:e.text});return;case`note`:if(e.noteKind===`follow_up`)return;r.log.push({kind:`note`,key:_(`note`),at:e.at,replay:!1,text:e.text}),(e.noteKind===`stop_requested`||e.noteKind===`stopped`)&&(e.mode===`soft`||e.mode===`hard`)&&ae(e.mode);return;case`replay_note`:r.log.push({kind:`note`,key:_(`note`),replay:!0,text:e.text});return;case`span`:{if(sn(e.name)){e.name===`run.agent`&&e.open&&T(`getting_ready`);return}e.name.startsWith(`post.`)&&e.open&&T(`finishing_up`);let t=s.get(e.spanId);if(t){t.open=e.open,e.durationMs!==void 0&&(t.durationMs=e.durationMs),e.status&&(t.status=e.status);return}let n=V({kind:`span`,key:_(`span`),spanId:e.spanId,text:Wt(e.name),open:e.open,...e.durationMs===void 0?{}:{durationMs:e.durationMs},...e.status?{status:e.status}:{},at:e.open?e.at:e.startedAt??e.at});s.set(e.spanId,n);let i=on(e.name);if(i){let t=l.get(i);t||(t={group:V({kind:`phase`,phase:i,key:_(i),rows:[],open:!0}),toggled:!1},l.set(i,t),r.log.push(t.group)),t.group.rows.push(n),c.set(e.spanId,t.group);return}r.log.push(n);return}case`answer`:C(`wrote the reply below`),r.reply={text:e.text,at:e.at};return}}function T(e){let t=l.get(e);t&&!t.toggled&&(t.group.open=!1)}function ne(e){let t=e,o=t?.type===`span_start`||t?.type===`span_end`;if(t&&typeof t.type==`string`){let t=e;i.push(t),Kt(t)&&qt(a,t,``),r.traceVersion++}t&&!o&&typeof t.at==`number`&&((r.firstAt===null||t.at<r.firstAt)&&(r.firstAt=t.at),(r.lastAt===null||t.at>=r.lastAt)&&(r.lastAt=t.at,r.lastAtWall=Le()));for(let t of n.push(e))w(t)}function re(){for(let e of u.values())if(e.status===`running`)return e;return null}function ie(e){r.allOpen=e;for(let t of l.values())t.group.open=e,t.toggled=!0;for(let t of u.values())t.open=e}function E(e){if(e.startsWith(`call-`)){let t=e.slice(5),n=d.get(t);return!n||!u.has(t)?!1:(n.manual=!0,n.groupOpen=!0,!0)}if(e.startsWith(`span-`)){let t=e.slice(5),n=c.get(t);if(n){n.open=!0;let e=l.get(n.phase);return e&&(e.toggled=!0),!0}if(s.has(t))return!0;for(let e of r.log)if(e.kind===`step`&&e.turn?.spanId===t||e.kind===`turn`&&e.turn.spanId===t)return!0}return!1}function ae(e){r.stopMode=e}function D(e){r.elided.push(e),r.log.push({kind:`note`,key:_(`note`),replay:!0,text:dn(e)}),r.placeholder=!1,r.traceVersion++}return{state:r,handle:ne,noteElided:D,spanSet:()=>[...a.values()],losses:e=>i.losses({windowStart:e,elided:r.elided}),pendingCall:re,flushPendingTurn:C,closePhases(){T(`getting_ready`),T(`finishing_up`)},setAllOpen:ie,togglePhase(e){e.open=!e.open;let t=l.get(e.phase);t&&(t.toggled=!0)},reveal:E,callHeadline:e=>u.get(e)?.headline,toggleGroup(e){e.manual=!0,e.groupOpen=!e.groupOpen},toggleCall(e){e.open=!e.open},markStopping:ae,opensByDefault:v}}function _n(e,t){return e.lastAt===null||e.lastAtWall===null?null:e.lastAt+(t-e.lastAtWall)}function vn(e,t){return{now:n=>e.serverNow+(n-t),elapsedMs(t){return He(e,this.now(t))??0},elapsedAt(t){return He({receivedAt:e.receivedAt,startedAt:e.startedAt,finishedAt:t})??0}}}function yn(e){if(typeof e!=`string`)return{};let t;try{t=JSON.parse(e)}catch{return{}}if(typeof t!=`object`||!t)return{};let{sealedAt:n,replyOk:r}=t;return{...typeof n==`number`&&Number.isFinite(n)&&n>0?{sealedAt:n}:{},...typeof r==`boolean`?{replyOk:r}:{}}}function bn(e){return e.replyOk===!1?`reply failed`:e.replyOk!==!0||e.finishedAt===void 0||e.sealedAt===void 0?``:`delivered in ${X(Math.max(0,e.sealedAt-e.finishedAt),`clock`)}`}function xn(e){if(typeof e!=`string`)return null;let t;try{t=JSON.parse(e)}catch{return null}if(typeof t!=`object`||!t)return null;let{finishedAt:n}=t;return typeof n==`number`&&Number.isFinite(n)&&n>0?{finishedAt:n}:null}var Sn=Symbol(`sb-runner-clock`);function Cn(e,t){return e===t||!e.includes(`/`)!=!t.includes(`/`)&&wn(e)===wn(t)}function wn(e){if(!e)return`model`;let t=e.lastIndexOf(`/`);return(t===-1?e:e.slice(t+1))||e}var Tn=6e4;function En(e,t,n){let r=_n(e,n);if(r===null||e.lastAt===null)return{kind:`starting`};if(t)return{kind:`call`,call:t,elapsedMs:Math.max(0,r-(t.startedAt??e.lastAt))};let i=Math.max(0,r-e.lastAt);return{kind:`thinking`,elapsedMs:i,slow:i>=Tn}}var Dn=[`id`,`open`,`title`,`data-status`,`data-heat`],On={key:0,class:`spin inline-block size-[0.7em] shrink-0 animate-spin self-center rounded-full border-2 border-accented border-t-info motion-reduce:animate-none`,role:`img`,"aria-label":`running`},kn={key:2,class:`dollar shrink-0 select-none text-dimmed`},An={key:3,class:`tool shrink-0 rounded bg-accented px-1.5 text-xs leading-normal text-muted`},jn={key:0,class:`cmd brief min-w-0 flex-1 truncate text-info`},Mn={key:1,class:`cmd full min-w-0 flex-1 whitespace-pre-wrap break-words text-info max-sm:order-last max-sm:basis-full`},Nn={key:5,class:`cmd min-w-0 flex-1`},Pn={class:`facts ml-auto flex shrink-0 gap-2.5 text-xs tabular-nums text-muted`},Fn={key:0,class:`fact elapsed`,title:`since this call started (runner clock)`},In={key:0,class:`over rounded bg-bad/15 px-1 font-medium text-bad`},Ln={key:1,class:`over rounded bg-bad/15 px-1 font-medium text-bad`},Rn={class:`body`},zn={key:1,class:`none px-3 py-1.5 text-xs italic text-dimmed`},Bn={key:2,class:`none px-3 py-1.5 text-xs italic text-dimmed`},Vn=Y({__name:`CallCard`,props:{call:{}},setup(e){let t=e,n=ae(Sn,null),r=H(()=>{let e=n?.value;return t.call.status!==`running`||typeof e!=`number`||t.call.startedAt===void 0?``:X(Math.max(0,e-t.call.startedAt),`clock`)}),i=H(()=>We(t.call.durationMs,`tool`,t.call.timedOut)),a=H(()=>qe(i.value)),o=H(()=>t.call.durationMs===void 0?-1:t.call.facts.length-1);function s(){t.call.open=!t.call.open}return(t,n)=>(R(),W(`details`,{id:`call-${e.call.id}`,class:J([`call rounded-lg border border-default bg-elevated font-mono open:bg-accented`,e.call.status]),open:e.call.open,title:typeof e.call.startedAt==`number`?`started ${K(Z)(e.call.startedAt)}`:void 0,"data-status":e.call.status,"data-heat":i.value.level},[U(`summary`,{class:J([`flex min-w-0 cursor-pointer list-none items-baseline gap-3 rounded-lg pl-3 pr-[calc(var(--sb-gutter)-1px)] py-2 hover:bg-accented/60 focus-visible:outline-2 focus-visible:outline-primary max-sm:flex-wrap [&::-webkit-details-marker]:hidden`,e.call.open?`rounded-b-none border-b border-default`:``]),onClick:A(s,[`prevent`])},[U(`span`,{class:J([`chev shrink-0 select-none text-xs text-dimmed transition-transform motion-reduce:transition-none`,e.call.open?`rotate-90`:``])},`❯`,2),e.call.status===`running`?(R(),W(`span`,On)):(R(),W(`span`,{key:1,class:J([`glyph w-[1em] shrink-0 text-center font-medium`,e.call.status===`ok`?`text-ok`:e.call.status===`failed`?`text-bad`:`text-warn`])},q(e.call.status===`ok`?`✓`:e.call.status===`failed`?`✗`:`⚠`),3)),e.call.shell?(R(),W(`span`,kn,`$`)):(R(),W(`span`,An,q(e.call.tool),1)),e.call.chipOnly?(R(),W(`span`,Nn)):(R(),W(j,{key:4},[e.call.open?(R(),W(`code`,Mn,q(e.call.title),1)):(R(),W(`code`,jn,q(e.call.headline),1))],64)),U(`span`,Pn,[r.value?(R(),W(`span`,Fn,q(r.value),1)):B(``,!0),(R(!0),W(j,null,G(e.call.facts,(t,n)=>(R(),W(j,{key:n},[n===o.value&&i.value.over?(R(),W(`span`,In,`timed out`)):B(``,!0),U(`span`,{class:J([`fact`,[e.call.status!==`ok`&&n===0?`text-bad`:``,n===o.value&&i.value.over?`font-medium text-bad`:``,n===o.value&&a.value?`heat`:``,n===o.value&&i.value.level>=2&&!i.value.over?`font-medium`:``]]),style:_(n===o.value?a.value:void 0)},q(t),7)],64))),128)),i.value.over&&o.value===-1?(R(),W(`span`,Ln,`timed out`)):B(``,!0)])],2),U(`div`,Rn,[e.call.hasResult&&e.call.output?(R(),W(`pre`,{key:0,class:J([`out max-h-[28rem] overflow-auto whitespace-pre-wrap break-words px-3.5 py-2.5 font-mono leading-normal`,e.call.status===`failed`?`text-bad`:`text-toned`])},q(e.call.output),3)):e.call.hasResult?(R(),W(`div`,zn,`no output`)):(R(),W(`div`,Bn,`no output yet`))])],10,Dn))}}),Hn=[`title`],Un=[`title`],Wn={class:`skillname whitespace-nowrap font-mono font-medium text-skill`},Gn={key:0,class:`skilldesc min-w-0 flex-1 truncate text-xs text-muted`},Kn={class:`facts ml-auto flex shrink-0 gap-2.5 font-mono text-xs text-muted`},qn=[`href`],Jn={class:`fact`},Yn=Y({__name:`StepItems`,props:{items:{}},setup(e){function t(e){return e>0?e<1024?`${e} B`:e<1048576?`${(Math.round(e/102.4)/10).toFixed(1)} KB`:`${(Math.round(e/104857.6)/10).toFixed(1)} MB`:`0 B`}return(n,r)=>(R(!0),W(j,null,G(e.items,(e,n)=>(R(),W(j,{key:n},[e.kind===`call`?(R(),P(Vn,{key:0,call:e.call},null,8,[`call`])):e.kind===`quiet`?(R(),W(`div`,{key:1,class:`quiet flex items-baseline gap-3 pl-3 pr-(--sb-gutter) py-0.5 font-mono text-xs text-dimmed`,title:e.at===void 0?void 0:K(Z)(e.at)},[U(`span`,null,q(e.text),1)],8,Hn)):(R(),W(`div`,{key:2,class:`skill flex items-baseline gap-2.5 pl-3 pr-(--sb-gutter) py-0.5`,title:e.skill.at===void 0?void 0:K(Z)(e.skill.at)},[r[0]||=U(`span`,{class:`skillmark shrink-0 select-none text-xs`},`📚`,-1),U(`span`,Wn,`skill `+q(e.skill.name),1),e.skill.description?(R(),W(`span`,Gn,q(e.skill.description),1)):B(``,!0),U(`span`,Kn,[e.skill.source?(R(),W(`a`,{key:0,class:`fact text-primary hover:underline`,href:e.skill.source,target:`_blank`,rel:`noopener noreferrer`},`source`,8,qn)):B(``,!0),U(`span`,Jn,q(t(e.skill.bodyBytes))+` into context`,1)])],8,Un))],64))),128))}}),Xn=[`id`,`data-live`],Zn={class:`head flex items-baseline gap-x-6 pb-1.5 pr-(--sb-gutter)`},Qn={class:`min-w-0 flex-1`},$n={key:0,class:`meta flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5 font-mono text-xs tabular-nums text-dimmed`},er=[`data-heat`,`title`],tr=[`title`],nr=[`title`],rr={key:2,class:`nonar font-sans text-sm italic text-dimmed`},ir=[`title`],ar={key:0,class:`narration flex items-baseline gap-3 pb-1.5 pr-(--sb-gutter)`},or={key:1,class:`narration flex items-baseline gap-3 pb-1.5 pr-(--sb-gutter)`},sr={class:`nonar flex-1 font-sans text-sm italic text-dimmed`},cr={class:`calls flex flex-col gap-2`},lr=[`open`,`data-group-open`],ur=[`title`],dr=[`data-ok`,`data-bad`,`data-infra`,`data-running`],fr=[`data-heat`],pr={class:`gbody flex flex-col gap-2 pb-1 pt-1.5`},mr=Y({__name:`StepBlock`,props:{step:{}},emits:[`toggleGroup`],setup(e,{emit:t}){let n=e,r=t,i=H(()=>n.step.items.filter(e=>e.kind===`call`)),a=H(()=>i.value.length>=2),o=H(()=>{let e=0,t=0,n=0,r=0,a=0;for(let o of i.value){if(o.kind!==`call`)continue;let i=o.call;i.status===`ok`?e++:i.status===`failed`?t++:i.status===`infra`?n++:r++,typeof i.durationMs==`number`&&(a+=i.durationMs)}return{n:e+t+n+r,ok:e,bad:t,infra:n,running:r,ms:a}}),s=H(()=>pn(o.value)),c=H(()=>i.value.some(e=>e.kind===`call`&&e.call.timedOut)),l=H(()=>We(o.value.ms,`tool`,c.value)),u=H(()=>qe(l.value)),d=H(()=>n.step.turn?We(n.step.turn.durationMs,`turn`):void 0),f=H(()=>d.value?qe(d.value):void 0),p=H(()=>{let e=i.value[0];return e?.kind===`call`?e.call.startedAt:void 0});return(t,n)=>(R(),W(`li`,{id:e.step.turn?`span-${e.step.turn.spanId}`:void 0,class:J([`step relative border-l-2 pb-3 pl-3 pt-2`,e.step.live?`border-ok/40`:`border-(--ui-border-accented)/50`]),"data-live":e.step.live?`1`:void 0},[U(`div`,Zn,[U(`div`,Qn,[e.step.turn?(R(),W(`div`,$n,[U(`span`,{class:J([`thought`,[f.value?`heat`:``,d.value&&d.value.level>=2?`font-medium`:``]]),style:_(f.value),"data-heat":d.value?.level,title:e.step.turn.label},`thought `+q(e.step.turn.chip),15,er),e.step.turn.switched?(R(),W(`span`,{key:0,class:`model-switch order-first rounded border border-warn/40 bg-warn/10 px-1.5 font-medium text-warn`,title:`model changed: this turn ran on ${e.step.turn.model}`},`⇄ `+q(K(wn)(e.step.turn.model)),9,tr)):e.step.turn.showModel?(R(),W(`span`,{key:1,class:`model-badge order-first rounded bg-accented px-1.5 text-[0.68rem] font-medium leading-normal tracking-wider text-muted`,title:e.step.turn.model},q(K(wn)(e.step.turn.model)),9,nr)):B(``,!0),(R(!0),W(j,null,G(e.step.turn.facts,(e,t)=>(R(),W(`span`,{key:t,class:`fact`},q(e),1))),128))])):e.step.narration===null?(R(),W(`span`,rr,q(e.step.note),1)):(R(),P($,{key:1,text:e.step.narration},null,8,[`text`]))]),e.step.at===void 0?B(``,!0):(R(),W(`span`,{key:0,class:`ts shrink-0 select-none font-mono text-xs tabular-nums text-dimmed`,title:K(Z)(e.step.at)},q(K(yt)(e.step.at)),9,ir))]),e.step.turn&&e.step.narration!==null?(R(),W(`div`,ar,[M($,{text:e.step.narration},null,8,[`text`])])):e.step.turn&&e.step.narration===null&&!e.step.turn.facts.length?(R(),W(`div`,or,[U(`span`,sr,q(e.step.note),1)])):B(``,!0),U(`div`,cr,[a.value?(R(),W(`details`,{key:1,class:`grp`,open:e.step.groupOpen,"data-group-open":e.step.groupOpen?`1`:`0`},[U(`summary`,{class:`gsummary flex cursor-pointer list-none items-baseline gap-3 rounded-md pl-3 pr-(--sb-gutter) py-1 font-mono text-xs text-dimmed hover:bg-accented/40 hover:text-muted focus-visible:outline-2 focus-visible:outline-primary [&::-webkit-details-marker]:hidden`,title:typeof p.value==`number`?`calls began ${K(Z)(p.value)}`:void 0,onClick:n[0]||=A(e=>r(`toggleGroup`),[`prevent`])},[U(`span`,{class:J([`gchev shrink-0 select-none transition-transform motion-reduce:transition-none`,e.step.groupOpen?`rotate-90`:``])},`❯`,2),U(`span`,{class:J([`gcount`,o.value.bad||o.value.infra?`text-bad`:``]),"data-ok":o.value.ok,"data-bad":o.value.bad,"data-infra":o.value.infra,"data-running":o.value.running},q(s.value),11,dr),o.value.ms>0?(R(),W(`span`,{key:0,class:J([`gtime ml-auto tabular-nums`,[u.value?`heat`:``,l.value.over?`font-medium text-bad`:l.value.level>=2?`font-medium`:``]]),style:_(u.value),"data-heat":l.value.level},[l.value.over?(R(),W(j,{key:0},[L(`timed out · `)],64)):B(``,!0),L(q(K(X)(o.value.ms,`clock`)),1)],14,fr)):B(``,!0)],8,ur),U(`div`,pr,[M(Yn,{items:e.step.items},null,8,[`items`])])],8,lr)):(R(),P(Yn,{key:0,items:e.step.items},null,8,[`items`]))])],10,Xn))}}),hr=[`id`],gr={class:`what`},_r={key:0,class:`text-dimmed`},vr={key:1,class:`dur tabular-nums text-dimmed`},yr=[`title`],br=Y({__name:`SpanRow`,props:{item:{}},setup(e){return(t,n)=>(R(),W(`li`,{id:`span-${e.item.spanId}`,class:`span flex items-baseline gap-2 py-0.5 pr-(--sb-gutter) font-mono text-xs text-muted`},[U(`span`,{class:J([`glyph select-none`,e.item.status===`error`?`text-bad`:`text-dimmed`])},q(e.item.open?`◌`:e.item.status===`error`?`✗`:`◷`),3),U(`span`,gr,q(e.item.text),1),e.item.open?(R(),W(`span`,_r,`…`)):e.item.durationMs===void 0?B(``,!0):(R(),W(`span`,vr,q(K(X)(e.item.durationMs,`precise`)),1)),e.item.at===void 0?B(``,!0):(R(),W(`span`,{key:2,class:`ts ml-auto select-none text-dimmed`,title:K(Z)(e.item.at)},q(K(yt)(e.item.at)),9,yr))],8,hr))}}),xr={"getting ready":`paint-ready`,thinking:`paint-thinking`,"in tools":`paint-tools`,"finishing up":`paint-finishing`,"Switchboard overhead":`paint-overhead`,"not recorded":`paint-lost`,"not loaded":`paint-elided`},Sr={getting_ready:`getting ready`,finishing_up:`finishing up`};function Cr(e){return xr[Sr[e]]}var wr={id:`timeline`,class:`block mb-4 rounded-lg border border-default bg-(--ui-bg-muted) px-(--sb-gutter) py-3`,"data-testid":`timeline`},Tr={class:`mb-2 flex items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},Er={class:`ml-auto flex items-baseline gap-3 font-normal normal-case tracking-normal`},Dr=[`href`],Or={class:`lede font-mono text-sm text-toned`},kr={class:`shape tabular-nums`},Ar={key:0,class:`current text-muted`},jr={key:0,class:`note mt-0.5 text-xs text-muted`},Mr=[`aria-label`],Nr=[`title`,`data-term`],Pr={class:`legend mt-2 flex flex-wrap gap-x-4 gap-y-1 font-mono text-xs`},Fr=[`title`,`data-term`],Ir={class:`term text-muted`},Lr={class:`ms tabular-nums text-toned`},Rr=[`title`],zr={class:`ranked mt-1 flex flex-col gap-1 font-mono text-xs`},Br={class:`ms w-14 shrink-0 tabular-nums text-toned`},Vr=[`href`,`data-anchor`,`onClick`],Hr=Y({__name:`TimelineSection`,props:{vm:{},eventsHref:{}},emits:[`reveal`],setup(e,{emit:t}){let n=e,r=t;function i(e){return`${X(e.ms,`clock`)} ${e.term}${e.hatched?` (in flight)`:``}`}function a(){c.copyText(JSON.stringify(n.vm.debug,null,2))}return(t,n)=>(R(),W(`section`,wr,[U(`h2`,Tr,[n[0]||=U(`span`,null,`Where the time went`,-1),U(`span`,Er,[e.eventsHref?(R(),W(`a`,{key:0,class:`text-dimmed no-underline hover:text-primary hover:underline`,href:e.eventsHref,title:`the stored events, as JSON lines`},`raw events`,8,Dr)):B(``,!0),U(`button`,{type:`button`,class:`debug cursor-pointer text-dimmed hover:text-toned`,title:`the partition and the raw span names, for a bug report`,onClick:a},` Copy debug JSON `)])]),U(`p`,Or,[U(`span`,kr,q(e.vm.shown?e.vm.total:e.vm.lede),1),e.vm.current?(R(),W(`span`,Ar,` · `+q(e.vm.current),1)):B(``,!0)]),(R(!0),W(j,null,G(e.vm.captions,e=>(R(),W(`p`,{key:e,class:`caption mt-0.5 text-xs text-muted`},q(e),1))),128)),e.vm.note?(R(),W(`p`,jr,q(e.vm.note),1)):B(``,!0),e.vm.shown?(R(),W(j,{key:1},[U(`div`,{class:`bar mt-2.5 flex h-2 w-full overflow-hidden rounded-sm`,role:`img`,"aria-label":e.vm.lede},[(R(!0),W(j,null,G(e.vm.bar,(e,t)=>(R(),W(`div`,{key:t,class:J([`seg h-full`,[K(xr)[e.term],e.hatched?`paint-hatched hatched`:``]]),style:_({width:`${e.pct}%`}),title:i(e),"data-term":e.term},null,14,Nr))),128))],8,Mr),U(`ul`,Pr,[(R(!0),W(j,null,G(e.vm.legend,e=>(R(),W(`li`,{key:e.term,class:`flex items-baseline gap-1.5 cursor-help`,title:e.definition,"data-term":e.term},[U(`span`,{class:J([`swatch inline-block size-2 shrink-0 self-center rounded-[2px]`,K(xr)[e.term]])},null,2),U(`span`,Ir,q(e.term),1),U(`span`,Lr,q(e.text),1)],8,Fr))),128))]),e.vm.ranked.length>0?(R(),W(j,{key:0},[U(`h3`,{class:`ranked-head mt-3 inline-block cursor-help text-xs font-medium text-muted underline decoration-dotted decoration-(--ui-border-accented) underline-offset-2`,title:e.vm.rankedNote},` Longest steps `,8,Rr),U(`ol`,zr,[(R(!0),W(j,null,G(e.vm.ranked,(e,t)=>(R(),W(`li`,{key:t,class:`flex items-baseline gap-2`},[U(`span`,Br,q(K(X)(e.ms,`clock`)),1),U(`a`,{class:`label min-w-0 truncate text-muted no-underline hover:text-primary hover:underline`,href:`#${e.anchor}`,"data-anchor":e.anchor,title:`scroll to this step`,onClick:A(t=>r(`reveal`,e.anchor),[`prevent`])},q(e.label),9,Vr),(R(!0),W(j,null,G(e.facts,e=>(R(),W(`span`,{key:e,class:`fact shrink-0 rounded border border-accented px-1 text-dimmed`},q(e),1))),128))]))),128))])],64)):B(``,!0)],64)):B(``,!0)]))}}),Ur=[`data-position`],Wr={class:`mb-2 flex items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-ok`},Gr=[`href`],Kr={key:1,class:`caption font-normal normal-case tracking-normal text-dimmed`},qr=[`title`],Jr=Y({__name:`ReplyBlock`,props:{text:{},caption:{},when:{},whenTitle:{},position:{}},setup(e){return(t,n)=>(R(),W(`section`,{id:`reply`,class:J([`block rounded-lg border border-ok/40 bg-(--ui-bg-muted) px-(--sb-gutter) py-3`,e.position===`first`?`mb-4`:`mt-6`]),"data-position":e.position},[U(`h2`,Wr,[n[0]||=U(`span`,null,`Reply`,-1),e.caption.href?(R(),W(`a`,{key:0,class:`caption font-normal normal-case tracking-normal text-dimmed no-underline hover:text-primary hover:underline`,href:e.caption.href,target:`_blank`,rel:`noopener noreferrer`},q(e.caption.text),9,Gr)):(R(),W(`span`,Kr,q(e.caption.text),1)),U(`span`,{class:`ts ml-auto select-none text-xs font-normal normal-case tracking-normal text-dimmed`,title:e.whenTitle},q(e.when),9,qr)]),M($,{text:e.text},null,8,[`text`])],10,Ur))}});function Yr(e,t){let{window:n,owner:r,finished:i}=t,a=Math.max(0,n.end-n.start),o=new Map(e.map(e=>[e.spanId,e])),s=new Map,c=e=>{let t=s.get(e.spanId);if(t!==void 0)return t;s.set(e.spanId,1);let n=e.parentSpanId?o.get(e.parentSpanId):void 0,r=n?c(n)+1:1;return s.set(e.spanId,r),r},l=e=>{let t=e,n=new Set;for(;t&&!n.has(t.spanId);){if(n.add(t.spanId),Rt(t.name,r)?.kind===`background`)return!0;t=t.parentSpanId?o.get(t.parentSpanId):void 0}return!1},u=t.losses.map(e=>Math.max(n.start,e.from)).sort((e,t)=>e-t),d=e=>{if(e.endedAt!==void 0)return Math.min(n.end,e.endedAt);if(!i)return n.end;let t=u.find(t=>t>e.startedAt);return t===void 0?n.end:Math.min(n.end,t)},f=[],p=[];for(let t of e){let e=Rt(t.name,r);if(!e)continue;let i=Math.max(n.start,t.startedAt);if(e.kind===`background`){let e=Math.min(n.end,t.endedAt??n.end);e>i&&p.push([i,e]);continue}if(e.kind!==`counted`||l(t))continue;let a=d(t);a<=i||f.push({start:i,end:a,bucket:e.bucket,depth:c(t),startedAt:t.startedAt,spanId:t.spanId})}f.sort((e,t)=>t.depth-e.depth||e.startedAt-t.startedAt||(e.spanId<t.spanId?-1:+(e.spanId>t.spanId)));let m=new Set([n.start,n.end]);for(let e of f)m.add(e.start),m.add(e.end);for(let e of t.losses)m.add(Xr(e.from,n)),m.add(Xr(e.to,n));for(let[e,t]of p)m.add(e),m.add(t);let h=[...m].filter(e=>e>=n.start&&e<=n.end).sort((e,t)=>e-t),g={getting_ready:0,thinking:0,tools:0,finishing_up:0},_=0,v=0,y=0;for(let e=0;e+1<h.length;e++){let r=h[e],i=h[e+1],a=i-r;if(a<=0)continue;let o=f.find(e=>e.start<=r&&e.end>=i);if(o){g[o.bucket]+=a;continue}if(t.losses.some(e=>e.kind===`lost`&&Xr(e.from,n)<=r&&Xr(e.to,n)>=i)){_+=a;continue}if(t.losses.some(e=>e.kind===`elided`&&Xr(e.from,n)<=r&&Xr(e.to,n)>=i)){v+=a;continue}p.some(([e,t])=>e<=r&&t>=i)&&(y+=a)}let b=g.getting_ready+g.thinking+g.tools+g.finishing_up;return{windowMs:a,gettingReadyMs:g.getting_ready,thinkingMs:g.thinking,toolsMs:g.tools,finishingUpMs:g.finishing_up,overheadMs:Math.max(0,a-b-_-v),notRecordedMs:_,notLoadedMs:v,backgroundOnlyMs:y}}function Xr(e,t){return Math.min(t.end,Math.max(t.start,e))}function Zr(e){let t=Math.floor(e.windowMs/1e3),n=[[`getting ready`,Math.floor(e.gettingReadyMs/1e3)],[`thinking`,Math.floor(e.thinkingMs/1e3)],[`in tools`,Math.floor(e.toolsMs/1e3)],[`finishing up`,Math.floor(e.finishingUpMs/1e3)],[`not recorded`,Math.floor(e.notRecordedMs/1e3)],[`not loaded`,Math.floor(e.notLoadedMs/1e3)]],r=n.reduce((e,[,t])=>e+t,0),i=n.filter(([,e])=>e>0).map(([e,t])=>({term:e,s:t})),a=t-r;a>0&&i.push({term:`Switchboard overhead`,s:a});let o=[`getting ready`,`thinking`,`in tools`,`finishing up`,`Switchboard overhead`,`not recorded`,`not loaded`];return i.sort((e,t)=>o.indexOf(e.term)-o.indexOf(t.term)),{totalS:t,items:i}}function Qr(e){return[e.gettingReadyMs,e.thinkingMs,e.toolsMs,e.finishingUpMs,e.overheadMs,e.notRecordedMs,e.notLoadedMs].filter(t=>t>=2e3||e.windowMs>0&&t/e.windowMs>=.05).length>=2}function $r(e,t){if(t===void 0||t<6e4)return;let n=X(t,`clock`);return e===`before`?`queued ${n} before we saw it`:`queued ${n} behind the previous run`}var ei={"getting ready":`before the agent's first turn: reading the thread, finding the repo, checking out, loading tools`,thinking:`the model's turns — from a request to the model until its reply came back`,"in tools":`the commands and tool calls the model ran`,"finishing up":`after the agent's last turn: posting the PR, checking the workspace`,"Switchboard overhead":`orchestration between steps, and moments when only a background read was running — the time no step claims`,"not recorded":`a stretch of the run the record does not carry`,"not loaded":`a stretch of the run this page did not load — the record has the full shape`},ti=`Ranked by each step's own time, its children excluded — the bar counts every instant once.`,ni=`currently delivering`,ri=`getting ready: not recorded (too large)`,ii=`no timing data`,ai=`not loaded (the record has the full shape)`,oi={getting_ready:`getting ready`,thinking:`thinking`,tools:`in tools`,finishing_up:`finishing up`};function si(e){let{spans:t,window:n,owner:r}=e,i=e.phase!==`live`,a=Yr(t,{window:n,owner:r,finished:i,losses:e.losses}),o=Zr(a),s=X(o.totalS*1e3,`clock`),c=t.find(e=>e.name===`request`&&e.parentSpanId===void 0),l=e.phase===`live`?li(t,r,n):void 0,u=di(e,l),d=l?Wt(l.name):``,f={window:n,owner:r,phase:e.phase,partition:a,spans:t.map(e=>({spanId:e.spanId,parentSpanId:e.parentSpanId,name:e.name,startedAt:e.startedAt,endedAt:e.endedAt,status:e.status,attrs:e.attrs}))};if(e.untimed)return{total:s,current:u,openStep:d,captions:[],rankedNote:ti,debug:f,lede:s,shown:!1,bar:[],legend:[],ranked:[],note:ii};let p={total:s,current:u,openStep:d,captions:[$r(`before`,ci(c,`queuedBeforeMs`)),$r(`behind`,ci(c,`queuedBehindMs`))].filter(e=>e!==void 0),rankedNote:ti,debug:f};if(!c)return{...p,lede:s,shown:!1,bar:[],legend:[],ranked:[],note:i?ri:``};let m=t=>t===`not recorded`?`not recorded${e.truncated?` (too large)`:``}`:t===`not loaded`?ai:t,h=Qr(a)&&o.items.length>0,g=h?`${s} — ${o.items.map(({term:e,s:t})=>`${X(t*1e3,`clock`)} ${m(e)}`).join(` · `)}`:a.windowMs>0?`${s} — ${m(pi(a))}`:s,_=h?o.items.map(({term:t,s:n})=>({term:t,text:X(n*1e3,`clock`),definition:t===`not recorded`&&e.truncated?`${ei[t]} (too large)`:ei[t]})):[];return{...p,lede:g,shown:h,bar:h?mi(a,l):[],legend:_,ranked:h?hi(t,c,r,n,e.callTitle):[],note:``}}function ci(e,t){let n=e?.attrs[t];return typeof n==`number`&&Number.isFinite(n)?n:void 0}function li(e,t,n){let r=new Map(e.map(e=>[e.spanId,e])),i=e=>{let t=1,n=new Set([e.spanId]),i=e.parentSpanId?r.get(e.parentSpanId):void 0;for(;i&&!n.has(i.spanId);)n.add(i.spanId),t++,i=i.parentSpanId?r.get(i.parentSpanId):void 0;return t},a;for(let o of e){if(o.endedAt!==void 0||o.startedAt>=n.end)continue;let e=Rt(o.name,t);if(e?.kind!==`counted`||ui(o,r,t))continue;let s=i(o);(!a||s>a.depth||s===a.depth&&o.startedAt>a.span.startedAt)&&(a={span:o,depth:s,bucket:e.bucket})}if(a)return{bucket:a.bucket,name:a.span.name,elapsedMs:Math.max(0,n.end-Math.max(n.start,a.span.startedAt))}}function ui(e,t,n){let r=e,i=new Set;for(;r&&!i.has(r.spanId);){if(i.add(r.spanId),Rt(r.name,n)?.kind===`background`)return!0;r=r.parentSpanId?t.get(r.parentSpanId):void 0}return!1}function di(e,t){return e.phase===`delivering`?ni:e.phase===`ended`?bn(e.delivery??{}):t?`currently ${oi[t.bucket]} ${X(t.elapsedMs,`clock`)}`:``}function fi(e){return[[`getting ready`,e.gettingReadyMs],[`thinking`,e.thinkingMs],[`in tools`,e.toolsMs],[`finishing up`,e.finishingUpMs],[`Switchboard overhead`,e.overheadMs],[`not recorded`,e.notRecordedMs],[`not loaded`,e.notLoadedMs]]}function pi(e){let t=[`getting ready`,-1];for(let n of fi(e))n[1]>t[1]&&(t=n);return t[0]}function mi(e,t){let n=[],r=t=>e.windowMs>0?t/e.windowMs*100:0;for(let[i,a]of fi(e))if(!(a<=0)){if(t&&oi[t.bucket]===i){let e=Math.min(t.elapsedMs,a);a-e>0&&n.push({term:i,ms:a-e,pct:r(a-e),hatched:!1}),e>0&&n.push({term:i,ms:e,pct:r(e),hatched:!0});continue}n.push({term:i,ms:a,pct:r(a),hatched:!1})}return n}function hi(e,t,n,r,i){let a=new Map(e.map(e=>[e.spanId,e])),o=new Map;for(let t of e){if(t.parentSpanId===void 0)continue;let e=o.get(t.parentSpanId);e?e.push(t):o.set(t.parentSpanId,[t])}let s=e=>[Math.max(r.start,e.startedAt),Math.min(r.end,e.endedAt??r.end)],c=[];for(let r of e){if(r===t||r.name===`run.agent`||Rt(r.name,n)===void 0||ui(r,a,n))continue;let[e,l]=s(r);if(l<=e)continue;let u=(o.get(r.spanId)??[]).map(s).map(([t,n])=>[Math.max(e,t),Math.min(l,n)]).filter(([e,t])=>t>e),d=l-e-gi(u);if(d<=0)continue;let f=r.name.startsWith(`tool.`)&&typeof r.attrs.callId==`string`?r.attrs.callId:void 0,p=f?i?.(f):void 0;c.push({label:p??Wt(r.name),ms:d,facts:_i(r),anchor:f?`call-${f}`:`span-${r.spanId}`,startedAt:r.startedAt})}return c.sort((e,t)=>t.ms-e.ms||e.startedAt-t.startedAt),c.slice(0,3).map(({label:e,ms:t,facts:n,anchor:r})=>({label:e,ms:t,facts:n,anchor:r}))}function gi(e){let t=[...e].sort((e,t)=>e[0]-t[0]),n=0,r;for(let[e,i]of t)!r||e>r[1]?(r&&(n+=r[1]-r[0]),r=[e,i]):i>r[1]&&(r[1]=i);return r&&(n+=r[1]-r[0]),n}function _i(e){let t=e.attrs,n=[];return(t.token===`expired`||t.token===`expiring`)&&n.push(`token ${t.token}`),t.budget===`clipped`&&n.push(`budget clipped`),typeof t.timeoutMs==`number`&&n.push(`timeout ${X(t.timeoutMs,`clock`)}`),typeof t.waitedMs==`number`&&n.push(`waited ${X(t.waitedMs,`clock`)}`),typeof t.exitCode==`number`&&t.exitCode!==0&&n.push(`exit ${t.exitCode}`),t.timedOut===!0&&n.push(`timed out`),typeof t.attempts==`number`&&t.attempts>1&&n.push(`${t.attempts} attempts`),e.status===`error`&&n.length===0&&n.push(`failed`),n}function vi(e){return e===`command`?`command`:`agent`}function yi(e){return e.description?.title?e.description.title:e.pr.repo&&e.pr.number!==void 0?`${e.pr.repo}#${e.pr.number}`:e.pr.repo??`PR review`}var bi=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,xi=/^[0-9a-f]{7,40}$/;function Si(e){if(!e.repo||!bi.test(e.repo))return{};let t=`https://github.com/${e.repo}`,n={};return e.number!==void 0&&Number.isInteger(e.number)&&e.number>0&&(n.pr=`${t}/pull/${e.number}`,n.files=`${t}/pull/${e.number}/files`),e.headSha&&xi.test(e.headSha)&&(n.commit=e.number!==void 0&&n.pr?`${t}/pull/${e.number}/commits/${e.headSha}`:`${t}/commit/${e.headSha}`),n}function Ci(e){return e.find(e=>e.poweredBy===`meat`)??e.find(e=>e.poweredBy===`git`)??null}function wi(e){return e===`meat`?`An abridged reading of the change: a model dropped what a reviewer need not read (style, imports, boilerplate) and kept the concepts`:`The complete change, base…head, as git reports it`}function Ti(e){return`The recorded diff was cut at ${e.toLocaleString(`en-US`)} characters; open the full diff on GitHub for the rest`}function Ei(e){return e===`meat`?`reading diff · meat`:`full diff · git`}function Di(e){let t=[];return e.origin===`parsed`&&!e.complete&&t.push(`read back from the PR body`),e.truncated&&t.push(`the body was cut before it was read`),t.length>0?t.join(`; `):void 0}var Oi=e=>typeof e==`object`&&!!e,ki=e=>typeof e==`string`&&e!==``,Ai=e=>typeof e==`number`&&Number.isInteger(e)&&e>0;function ji(e){for(let t of e.split(/\n\s*\n/)){let e=t.split(`
8
+ `),i=r===-1?n:n.slice(0,r).trimEnd();return i.length<e.length?i+` …`:i}function h(e,t){let o=a(e.tool),s=o===`bash`,c=t||o,l=s&&c.startsWith(`$ `)?c.slice(2):!s&&c.startsWith(o+` `)?c.slice(o.length+1):c,u={id:a(e.callId)||`c`+ ++n,tool:o,title:l,headline:m(l,s),shell:s,quiet:o===`update_status`,tags:[s?p(l):o],status:`running`,startedAt:i(e.at),facts:[]};return r.push(u),u}function g(t){for(let n=e.length-1;n>=0;n--)for(let r of e[n].calls)if(r.id===t)return{step:e[n],call:r};return null}function _(t){let n=a(t.callId);if(!n)return null;for(let t=e.length-1;t>=0;t--)for(let r of e[t].calls)if(r.id===n&&!r.result)return{step:e[t],call:r};return null}function v(e){if(!e||typeof e!=`object`)return[];let n=e;switch(n.type){case`input`:{let e={kind:`input`,text:a(n.text),at:i(n.at)},t=n.source;if(t&&typeof t==`object`){let n=t,r={};a(n.url)&&(r.url=a(n.url)),a(n.channel)&&(r.channel=a(n.channel)),a(n.user)&&(r.user=a(n.user)),a(n.run)&&(r.run=a(n.run)),Object.keys(r).length>0&&(e.source=r)}return[e]}case`answer`:return[{kind:`answer`,text:a(n.text),at:i(n.at)}];case`pr_opened`:{let e=i(n.number);return!a(n.url)||e===void 0||!Number.isInteger(e)||e<=0?[]:[{kind:`pr_opened`,url:a(n.url),number:e,created:n.created===!0,at:i(n.at)}]}case`run_meta`:{if(!a(n.agent))return[];let e={kind:`meta`,agent:a(n.agent),model:a(n.model),at:i(n.at)};return a(n.effort)&&(e.effort=a(n.effort)),a(n.repo)&&(e.repo=a(n.repo)),a(n.ref)&&(e.ref=a(n.ref)),i(n.pr)!==void 0&&Number.isInteger(n.pr)&&n.pr>0&&(e.pr=n.pr),/^[0-9a-f]{7,40}$/i.test(a(n.headSha))&&(e.headSha=a(n.headSha)),[e]}case`context`:return[{kind:`context`,text:a(n.text),at:i(n.at)}];case`replay_note`:return[{kind:`replay_note`,text:a(n.summary)}];case`run_note`:return[{kind:`note`,text:a(n.summary),noteKind:a(n.kind),mode:a(n.mode)||void 0,at:i(n.at)}];case`assistant`:return[{kind:`step`,step:o({text:a(n.text),at:i(n.at)})}];case`review_artifact`:return[];case`span_start`:{let e=a(n.name),t=a(n.spanId);return!e||!t||e.startsWith(`tool.`)||e.startsWith(`mcp.`)||e===`model.turn`?[]:[{kind:`span`,spanId:t,name:e,open:!0,at:i(n.at)}]}case`span_end`:{let e=a(n.name),r=a(n.spanId),o=i(n.durationMs);if(!e||!r||o===void 0)return[];let c=n.status===`error`?`error`:`ok`,u=typeof n.attrs==`object`&&n.attrs!==null?n.attrs:{};if(e===`model.turn`){t=null;let e=[],c=i(u.inputTokens),l=i(u.outputTokens),d=i(u.cacheReadTokens);c!==void 0&&e.push(s(c)+` in`),l!==void 0&&e.push(s(l)+` out`),d!==void 0&&e.push(s(d)+` cached`);let f=i(u.ttftMs);f!==void 0&&e.push(`first token `+X(f,`precise`));let p=i(u.thinkingMs);p!==void 0&&e.push(`thinking `+X(p,`precise`));let m=i(u.textMs);m!==void 0&&e.push(`writing `+X(m,`precise`));let h=a(u.model);return[{kind:`turn`,spanId:r,label:`Thought for `+X(o,`precise`),facts:e,durationMs:o,...h?{model:h}:{},at:i(n.at)}]}if(e.startsWith(`tool.`)||e.startsWith(`mcp.`)){if(!e.startsWith(`tool.`))return[];let t=a(u.callId);if(!t)return[];let n=g(t);return!n||n.call.durationMs!==void 0?[]:(n.call.durationMs=o,n.call.facts=l(n.call),[{kind:`result`,step:n.step,call:n.call}])}let d=i(n.startedAt);return[{kind:`span`,spanId:r,name:e,open:!1,durationMs:o,status:c,at:i(n.at),...d===void 0?{}:{startedAt:d}}]}case`skill_use`:{let e=a(n.skill);if(!e)return[];let r=[];t||r.push({kind:`step`,step:o()});let s=a(n.source),c={name:e,description:a(n.description),agent:a(n.agent),bodyBytes:i(n.bodyBytes)??0,at:i(n.at)};return/^https?:\/\//.test(s)&&(c.source=s),r.push({kind:`skill`,step:t,skill:c}),r}case`tool_call`:{let e=[];t||e.push({kind:`step`,step:o()});let r=h(n,a(n.summary));return t.calls.push(r),e.push({kind:`call`,step:t,call:r}),e}case`tool_result`:{let e=_(n);if(e)return u(e.call,n),[{kind:`result`,step:e.step,call:e.call}];let r=[];t||r.push({kind:`step`,step:o()});let i=h(n,``);return i.startedAt=void 0,u(i,n),t.calls.push(i),r.push({kind:`call`,step:t,call:i}),r}default:return[]}}function y(){return r.length>0?r[0]:null}return{push:v,pending:y,steps:()=>e}}new Set(`request,slack.receive,dispatch.history,dispatch.admission,dispatch.ack_card,dispatch.gate.repo,dispatch.gate.pr_head,dispatch.workspace.attach,dispatch.gate.attached_head,dispatch.mcp_discovery,dispatch.compose,dispatch.channel_visibility,dispatch.repo_context,dispatch.memory_read,dispatch.refuse,dispatch.ship_preflight,dispatch.ledger_claim,dispatch.route,run.agent,run.command,run.reading_diff,run.settle_reviewed_head,run.description_turn,run.observe_workspace,run.pr_post_step,run.review_post_step,run.reading_diff_join,run.pr_description_join,model.turn,ship.round,post.card_close,post.reply`.split(`,`));var Pt=new Set([`slack.receive`,`dispatch.history`,`dispatch.admission`,`dispatch.ack_card`,`dispatch.gate.repo`,`dispatch.gate.pr_head`,`dispatch.workspace.attach`,`dispatch.gate.attached_head`,`dispatch.mcp_discovery`,`dispatch.compose`,`dispatch.channel_visibility`,`dispatch.repo_context`,`dispatch.memory_read`,`dispatch.refuse`,`dispatch.ship_preflight`,`dispatch.ledger_claim`,`dispatch.route`]),Ft=new Set([`run.observe_workspace`,`run.pr_post_step`,`run.review_post_step`,`run.reading_diff_join`,`run.pr_description_join`]),It=new Set([`request`,`run.agent`,`ship.round`,`run.settle_reviewed_head`,`run.description_turn`,`post.card_close`,`post.reply`]),Lt=new Set([`run.reading_diff`]);function Rt(e,t){if(Lt.has(e))return{kind:`background`};if(It.has(e))return{kind:`uncounted`};if(e===`model.turn`)return{kind:`counted`,bucket:`thinking`};if(e===`run.command`||e.startsWith(`run.command.`))return{kind:`counted`,bucket:t===`command`?`tools`:`getting_ready`};if(Pt.has(e)||e.startsWith(`dispatch.workspace.attach.`))return{kind:`counted`,bucket:`getting_ready`};if(Ft.has(e))return{kind:`counted`,bucket:`finishing_up`};if(e.startsWith(`tool.`)||e.startsWith(`mcp.`))return{kind:`counted`,bucket:`tools`}}var zt={clone:`cloning the repo`,"checkout-clone":`cloning the checkout`,"worktree-clone":`cloning the worktree`,"worktree-detach":`checking out the expected commit`,"op-clone":`cloning the op tree`,fetch:`fetching the branch`,"wake-fetch":`fetching the latest commits`,"reclaim-fetch":`fetching to reclaim the mirror`,"for-each-ref":`listing the branches`,checkout:`checking out the branch`,"checkout-update":`updating the checkout`,"rev-parse":`reading the commit`,"cat-file":`checking the mirror for the commit`,"show-ref":`reading the branch tip`,"detect-default-branch":`detecting the default branch`,git:`a git command`,"git-setup":`configuring git`,"stage-perms":`securing the credential stage`,install:`installing dependencies`,build:`building`,test:`running the tests`,"clear-markers":`clearing the build markers`,"lockfile-key":`hashing the lockfile`,"deps-store-dir":`preparing the dependency store`,"deps-scratch":`cloning a scratch tree for the dependency install`,"deps-install":`installing the dependency store`,"deps-harden":`locking down the installed dependencies`,"deps-commit":`recording the installed dependencies`,"deps-adopt":`adopting the dependency store`,"deps-restore-scratch":`restoring dependencies to scratch`,"deps-restore-chown":`setting the restored dependencies' owner`,"deps-restore-commit":`recording the restored dependencies`,"deps-scratch-chown":`setting the dependency scratch owner`,"deps-evict":`evicting an old dependency store`,"unlink-deps-view":`unlinking the dependency view`,"clear-installing-marker":`clearing the install marker`,chown:`setting the workspace owner`,"worktree-chown":`setting the worktree owner`,"op-chown":`setting the op tree's owner`,"worktree-clean":`cleaning the worktree`,"clean-workspace":`cleaning the workspace`,"clean-before-restore":`cleaning before the restore`,"unmount-restores":`unmounting earlier restores`,"mirror-restore-extract":`extracting the mirror snapshot`,"checkout-restore-extract":`extracting the checkout snapshot`,"deps-restore-extract":`extracting the dependency snapshot`,evict:`evicting a stale tree`,"thread-dir":`preparing a directory`,"threads-dir":`preparing a directory`,"op-dir":`preparing a directory`,"ops-dir":`preparing a directory`,"stage-dir":`preparing a directory`,stat:`checking a file`,touch:`touching a marker`,nproc:`counting CPUs`,mutex_wait:`waiting for the workspace`,kill:`stopping the previous step`};Object.keys(zt);function Bt(e){return Object.prototype.hasOwnProperty.call(zt,e)?e:void 0}function Vt(e){let t=Bt(e);if(t!==void 0)return zt[t];if(e.endsWith(`-stale-sweep`)){let t=Bt(e.slice(0,-12));if(t!==void 0)return`clearing leftovers before ${zt[t]}`}}var Ht={request:`the request`,"slack.receive":`receiving`,"dispatch.history":`reading the thread`,"dispatch.admission":`checking the thread`,"dispatch.ack_card":`posting the status card`,"dispatch.gate.repo":`checking the repo`,"dispatch.gate.pr_head":`checking the PR`,"dispatch.workspace.attach":`attaching the workspace`,"dispatch.gate.attached_head":`checking out the branch`,"dispatch.mcp_discovery":`loading tools`,"dispatch.compose":`preparing the prompt`,"dispatch.channel_visibility":`checking the channel`,"dispatch.repo_context":`reading the repo's context`,"dispatch.memory_read":`recalling memory`,"dispatch.refuse":`refusing`,"dispatch.ship_preflight":`checking the ship request`,"dispatch.ledger_claim":`claiming the run's row`,"dispatch.route":`picking the preset`,"run.agent":`the agent loop`,"run.command":`the command`,"run.reading_diff":`reading the diff (in parallel)`,"run.settle_reviewed_head":`re-checking the moved branch`,"run.description_turn":`asking for the PR description`,"run.observe_workspace":`checking the workspace`,"run.pr_post_step":`posting the PR`,"run.review_post_step":`posting the review`,"run.reading_diff_join":`waiting for the diff`,"run.pr_description_join":`waiting for the PR description`,"model.turn":`a model turn`,"ship.round":`a ship round`,"post.card_close":`closing the card`,"post.reply":`posting the reply`},Ut=`a Switchboard step`;function Wt(e){if(e in Ht)return Ht[e];if(e.startsWith(`tool.`))return e.slice(5)||`a Switchboard step`;if(e.startsWith(`mcp.`)){let t=e.slice(e.lastIndexOf(`.`)+1);return t&&t!==`mcp`?t:Ut}for(let t of[`dispatch.workspace.attach.`,`run.command.`])if(e.startsWith(t))return Vt(e.slice(t.length))??`a Switchboard step`;return Ut}var Gt=`A-Za-z0-9:@._-`;RegExp(`^[${Gt}]{1,128}$`),RegExp(`[^${Gt}]`,`g`);function Kt(e){return e.type===`span_start`||e.type===`span_end`}function qt(e,t,n){let r=e.get(t.spanId);if(t.type===`span_start`){if(r)return;e.set(t.spanId,{traceId:n,spanId:t.spanId,...t.parentSpanId===void 0?{}:{parentSpanId:t.parentSpanId},name:t.name,startedAt:t.at??0,attrs:t.attrs??{}});return}e.set(t.spanId,{traceId:n,spanId:t.spanId,...t.parentSpanId===void 0?r?.parentSpanId===void 0?{}:{parentSpanId:r.parentSpanId}:{parentSpanId:t.parentSpanId},name:t.name,startedAt:t.startedAt,endedAt:t.startedAt+t.durationMs,durationMs:t.durationMs,status:t.status,...t.error===void 0?{}:{errorMessage:t.error},attrs:{...r?.attrs??{},...t.attrs??{}}})}function Jt(){let e,t,n=[];return{push(r){e?t&&r.seq!==void 0&&t.seq!==void 0&&r.seq>t.seq+1&&t.at!==void 0&&r.at!==void 0&&n.push({kind:`gap`,fromSeq:t.seq+1,toSeq:r.seq-1,from:Math.min(t.at,r.at),to:Math.max(t.at,r.at)}):e={seq:r.seq??1,at:r.at},r.type===`run_note`&&r.kind===`spans_dropped`&&r.from!==void 0&&r.to!==void 0&&r.to>=r.from&&n.push({kind:`note`,from:r.from,to:r.to}),t={seq:r.seq,at:r.at}},losses(t={}){let r=t.elided??[],i=(e,t)=>r.some(n=>n.fromSeq<=e&&t<=n.toSeq),a=[];e&&e.seq>1&&t.windowStart!==void 0&&e.at!==void 0&&e.at>t.windowStart&&a.push({from:t.windowStart,to:e.at,kind:`lost`});for(let e of n)a.push(e.kind===`note`?{from:e.from,to:e.to,kind:`lost`}:{from:e.from,to:e.to,kind:i(e.fromSeq,e.toSeq)?`elided`:`lost`});return a}}}var Yt=[/\bslack[\s-]?only\b/i,/\bpost\s*[:=]\s*(?:off|no|false|none)\b/i,/\bno[\s-]post\b/i,/\b(?:don['’]?t|do\s+not|never|skip|without)\s+(?:\w+\s+){0,2}?(?:post|comment)(?:ing|s)?\b/i,/\bno\s+need\s+to\s+(?:post|comment)\b/i];function Xt(e){return Yt.some(t=>t.test(e))}var Zt=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,Qt=/^[0-9a-f]{7,40}$/,$t=/^(?![.-])(?!.*\.\.)(?!.*\/\/)(?!.*@\{)(?!.*\.lock$)(?!.*[./]$)[\w][\w./-]*$/;function en(e){return e&&Zt.test(e)?`https://github.com/${e}`:void 0}function tn(e,t){let n=en(e);if(!(!n||t===void 0||!Number.isInteger(t)||t<=0))return`${n}/pull/${t}`}function nn(e,t){let n=en(e);if(n&&t&&$t.test(t))return`${n}/tree/${t.split(`/`).map(encodeURIComponent).join(`/`)}`}function rn(e,t){let n=en(e);if(n&&t&&Qt.test(t))return`${n}/commit/${t}`}function an(e){return e.slice(0,7)}function on(e){if(e===`slack.receive`||e.startsWith(`dispatch.`))return`getting_ready`;let t=Rt(e,`agent`);return t?.kind===`counted`&&t.bucket===`finishing_up`?`finishing_up`:void 0}function sn(e){return e===`request`||e===`run.agent`}var cn={getting_ready:`Getting ready`,finishing_up:`Finishing up`};function ln(e){let t=e.rows.length,n=`${t} step${t===1?``:`s`}`,r=cn[e.phase];if(t===0||e.rows.some(e=>e.open||e.at===void 0||e.durationMs===void 0))return`${r} · ${n}`;let i=Math.min(...e.rows.map(e=>e.at)),a=Math.max(...e.rows.map(e=>e.at+e.durationMs));return`${r} · ${n} · ${X(Math.max(0,a-i),`precise`)}`}function un(e){if(typeof e!=`string`)return null;let t;try{t=JSON.parse(e)}catch{return null}if(typeof t!=`object`||!t)return null;let{fromSeq:n,toSeq:r}=t,i=e=>typeof e==`number`&&Number.isInteger(e)&&e>0;return!i(n)||!i(r)||n>r?null:{fromSeq:n,toSeq:r}}function dn(e){let t=e.toSeq-e.fromSeq+1,n=t===1?`event ${e.fromSeq}`:`events ${e.fromSeq}–${e.toSeq}`;return`${t} ${t===1?`event`:`events`} not loaded (${n}) — the record has them`}function fn(e,t,n){let r=!!e.model&&t!==null&&Cn(e.model,t),i=r?t:e.model??t??void 0,a=!!e.model&&t!==null&&!r;return{spanId:e.spanId,label:e.label,chip:e.label.replace(/^Thought for /,``),quick:e.durationMs<6e4,durationMs:e.durationMs,facts:e.facts,...i?{model:i}:{},switched:a,showModel:!!i&&(!n||a),at:e.at}}function pn(e){let t=`${e.n} tool call${e.n===1?``:`s`}`;if(e.n===0)return`no tool calls`;if(e.ok===e.n)return`${t}, all succeeded`;if(e.running===e.n)return`${t}, all running`;let n=[];return e.bad&&n.push(`${e.bad} failed`),e.infra&&n.push(`${e.infra} sandbox error${e.infra===1?``:`s`}`),e.running&&n.push(`${e.running} still running`),`${t}, ${n.join(`, `)}`}function mn(e){let{meta:t,prOpened:n}=e,r=t?.repo&&en(t.repo)?t.repo:void 0;if(t?.agent===`review`){if(Xt(e.requestText))return{text:`verdict, Slack only`};if(r&&t.pr!==void 0){let e=tn(r,t.pr);return e?{text:`verdict for ${r}#${t.pr}`,href:e}:{text:`verdict`}}return{text:`verdict`}}if(t?.agent===`coding`&&n){let e=n.created?`pull request opened`:`pull request updated`,t=r?tn(r,n.number):void 0;return t?{text:`${e} ${r}#${n.number}`,href:t}:{text:e}}return t?.agent===`command`?{text:`output`}:{text:`answer`}}function hn(e,t){return{id:e.id,tool:e.tool,title:e.title,headline:e.headline,shell:e.shell,status:e.status,facts:[...e.facts],startedAt:e.startedAt,output:e.result?e.result.output||e.result.summary:``,hasResult:e.result!==void 0,chipOnly:!e.shell&&e.title===e.tool,durationMs:e.durationMs,exitCode:e.result?.exitCode,timedOut:Ve(e.result?.exitCode),open:t}}function gn(e={}){let t=e.openTags&&e.openTags.length>0?e.openTags:[`failed`,`infra`],n=Nt(),r=V({request:null,meta:null,context:[],log:[],reply:null,prOpened:null,placeholder:!0,allOpen:!1,stopMode:null,model:null,firstAt:null,lastAt:null,lastAtWall:null,elided:[],traceVersion:0}),i=Jt(),a=new Map,o=new Map,s=new Map,c=new Map,l=new Map,u=new Map,d=new Map,f=new Set,p=null,m=!1,h=-1,g=0,_=e=>`${e}-${g++}`;function v(e){return t.includes(`all`)?!0:e.some(e=>t.includes(e))}function y(e){let t=0,n=0,r=0;for(let i of e.items)i.kind===`call`&&(i.call.status===`failed`?t++:i.call.status===`infra`?n++:i.call.status===`running`&&r++);return{bad:t,infra:n,running:r}}function b(e){let{bad:t,infra:n,running:r}=y(e);(t||n||r)&&(e.groupOpen=!0)}function ee(e){let t=o.get(h);t&&(t.live=!1),h=e.index;let n=p;p=null;let i=V({kind:`step`,key:_(`step`),index:e.index,at:e.narration?e.narration.at:n?.at,turn:n,narration:e.narration?e.narration.text:null,note:`no commentary`,items:[],live:!0,manual:!1,groupOpen:!0});return o.set(e.index,i),r.log.push(i),i}function x(e){return o.get(e.index)??ee(e)}function te(e,t){let n=x(e);if(t.quiet){f.add(t.id),n.items.push({kind:`quiet`,at:t.startedAt,text:`✎ ${t.tool===`update_status`?`status checklist updated`:t.title}`}),b(n);return}let i=V(hn(t,r.allOpen||v(t.tags)));u.set(t.id,i),d.set(t.id,n),n.items.push({kind:`call`,call:i}),b(n)}function S(e,t){if(f.has(t.id)){let t=o.get(e.index);t&&b(t);return}let n=u.get(t.id);if(!n){te(e,t);return}Object.assign(n,hn(t,n.open)),v(t.tags)&&(n.open=!0);let r=o.get(e.index);r&&b(r)}function C(e){p&&=(r.log.push({kind:`turn`,key:_(`turn`),turn:p,note:e}),null)}function w(e){switch(r.placeholder=!1,e.kind){case`input`:{let t={text:e.text,at:e.at,...e.source?{source:e.source}:{}};r.request?r.log.push({kind:`followup`,key:_(`followup`),input:t}):r.request=t;return}case`step`:ee(e.step);return;case`call`:te(e.step,e.call);return;case`result`:S(e.step,e.call);return;case`turn`:C(``),p=fn(e,r.model,m),p.model&&(m=!0),e.model&&!(r.model!==null&&Cn(e.model,r.model))&&(r.model=e.model);return;case`meta`:r.model===null&&e.model&&(r.model=e.model),r.meta={agent:e.agent,model:e.model,...e.effort?{effort:e.effort}:{},...e.repo?{repo:e.repo}:{},...e.ref?{ref:e.ref}:{},...e.pr===void 0?{}:{pr:e.pr},...e.headSha?{headSha:e.headSha}:{}};return;case`pr_opened`:r.prOpened={url:e.url,number:e.number,created:e.created};return;case`skill`:x(e.step).items.push({kind:`skill`,skill:e.skill});return;case`context`:r.context.push({key:_(`ctx`),at:e.at,text:e.text});return;case`note`:if(e.noteKind===`follow_up`)return;r.log.push({kind:`note`,key:_(`note`),at:e.at,replay:!1,text:e.text}),(e.noteKind===`stop_requested`||e.noteKind===`stopped`)&&(e.mode===`soft`||e.mode===`hard`)&&ae(e.mode);return;case`replay_note`:r.log.push({kind:`note`,key:_(`note`),replay:!0,text:e.text});return;case`span`:{if(sn(e.name)){e.name===`run.agent`&&e.open&&T(`getting_ready`);return}e.name.startsWith(`post.`)&&e.open&&T(`finishing_up`);let t=s.get(e.spanId);if(t){t.open=e.open,e.durationMs!==void 0&&(t.durationMs=e.durationMs),e.status&&(t.status=e.status);return}let n=V({kind:`span`,key:_(`span`),spanId:e.spanId,text:Wt(e.name),open:e.open,...e.durationMs===void 0?{}:{durationMs:e.durationMs},...e.status?{status:e.status}:{},at:e.open?e.at:e.startedAt??e.at});s.set(e.spanId,n);let i=on(e.name);if(i){let t=l.get(i);t||(t={group:V({kind:`phase`,phase:i,key:_(i),rows:[],open:!0}),toggled:!1},l.set(i,t),r.log.push(t.group)),t.group.rows.push(n),c.set(e.spanId,t.group);return}r.log.push(n);return}case`answer`:C(`wrote the reply below`),r.reply={text:e.text,at:e.at};return}}function T(e){let t=l.get(e);t&&!t.toggled&&(t.group.open=!1)}function ne(e){let t=e,o=t?.type===`span_start`||t?.type===`span_end`;if(t&&typeof t.type==`string`){let t=e;i.push(t),Kt(t)&&qt(a,t,``),r.traceVersion++}t&&!o&&typeof t.at==`number`&&((r.firstAt===null||t.at<r.firstAt)&&(r.firstAt=t.at),(r.lastAt===null||t.at>=r.lastAt)&&(r.lastAt=t.at,r.lastAtWall=Le()));for(let t of n.push(e))w(t)}function re(){for(let e of u.values())if(e.status===`running`)return e;return null}function ie(e){r.allOpen=e;for(let t of l.values())t.group.open=e,t.toggled=!0;for(let t of u.values())t.open=e}function E(e){if(e.startsWith(`call-`)){let t=e.slice(5),n=d.get(t);return!n||!u.has(t)?!1:(n.manual=!0,n.groupOpen=!0,!0)}if(e.startsWith(`span-`)){let t=e.slice(5),n=c.get(t);if(n){n.open=!0;let e=l.get(n.phase);return e&&(e.toggled=!0),!0}if(s.has(t))return!0;for(let e of r.log)if(e.kind===`step`&&e.turn?.spanId===t||e.kind===`turn`&&e.turn.spanId===t)return!0}return!1}function ae(e){r.stopMode=e}function D(e){r.elided.push(e),r.log.push({kind:`note`,key:_(`note`),replay:!0,text:dn(e)}),r.placeholder=!1,r.traceVersion++}return{state:r,handle:ne,noteElided:D,spanSet:()=>[...a.values()],losses:e=>i.losses({windowStart:e,elided:r.elided}),pendingCall:re,flushPendingTurn:C,closePhases(){T(`getting_ready`),T(`finishing_up`)},setAllOpen:ie,togglePhase(e){e.open=!e.open;let t=l.get(e.phase);t&&(t.toggled=!0)},reveal:E,callHeadline:e=>u.get(e)?.headline,toggleGroup(e){e.manual=!0,e.groupOpen=!e.groupOpen},toggleCall(e){e.open=!e.open},markStopping:ae,opensByDefault:v}}function _n(e,t){return e.lastAt===null||e.lastAtWall===null?null:e.lastAt+(t-e.lastAtWall)}function vn(e,t){return{now:n=>e.serverNow+(n-t),elapsedMs(t){return He(e,this.now(t))??0},elapsedAt(t){return He({receivedAt:e.receivedAt,startedAt:e.startedAt,finishedAt:t})??0}}}function yn(e){if(typeof e!=`string`)return{};let t;try{t=JSON.parse(e)}catch{return{}}if(typeof t!=`object`||!t)return{};let{sealedAt:n,replyOk:r}=t;return{...typeof n==`number`&&Number.isFinite(n)&&n>0?{sealedAt:n}:{},...typeof r==`boolean`?{replyOk:r}:{}}}function bn(e){return e.replyOk===!1?`reply failed`:e.replyOk!==!0||e.finishedAt===void 0||e.sealedAt===void 0?``:`delivered in ${X(Math.max(0,e.sealedAt-e.finishedAt),`clock`)}`}function xn(e){if(typeof e!=`string`)return null;let t;try{t=JSON.parse(e)}catch{return null}if(typeof t!=`object`||!t)return null;let{finishedAt:n}=t;return typeof n==`number`&&Number.isFinite(n)&&n>0?{finishedAt:n}:null}var Sn=Symbol(`sb-runner-clock`);function Cn(e,t){return e===t||!e.includes(`/`)!=!t.includes(`/`)&&wn(e)===wn(t)}function wn(e){if(!e)return`model`;let t=e.lastIndexOf(`/`);return(t===-1?e:e.slice(t+1))||e}var Tn=6e4;function En(e,t,n){let r=_n(e,n);if(r===null||e.lastAt===null)return{kind:`starting`};if(t)return{kind:`call`,call:t,elapsedMs:Math.max(0,r-(t.startedAt??e.lastAt))};let i=Math.max(0,r-e.lastAt);return{kind:`thinking`,elapsedMs:i,slow:i>=Tn}}var Dn=[`id`,`open`,`title`,`data-status`,`data-heat`],On={key:0,class:`spin inline-block size-[0.7em] shrink-0 animate-spin self-center rounded-full border-2 border-accented border-t-info motion-reduce:animate-none`,role:`img`,"aria-label":`running`},kn={key:2,class:`dollar shrink-0 select-none text-dimmed`},An={key:3,class:`tool shrink-0 rounded bg-accented px-1.5 text-xs leading-normal text-muted`},jn={key:0,class:`cmd brief min-w-0 flex-1 truncate text-info`},Mn={key:1,class:`cmd full min-w-0 flex-1 whitespace-pre-wrap break-words text-info max-sm:order-last max-sm:basis-full`},Nn={key:5,class:`cmd min-w-0 flex-1`},Pn={class:`facts ml-auto flex shrink-0 gap-2.5 text-xs tabular-nums text-muted`},Fn={key:0,class:`fact elapsed`,title:`since this call started (runner clock)`},In={key:0,class:`over rounded bg-bad/15 px-1 font-medium text-bad`},Ln={key:1,class:`over rounded bg-bad/15 px-1 font-medium text-bad`},Rn={class:`body`},zn={key:1,class:`none px-3 py-1.5 text-xs italic text-dimmed`},Bn={key:2,class:`none px-3 py-1.5 text-xs italic text-dimmed`},Vn=Y({__name:`CallCard`,props:{call:{}},setup(e){let t=e,n=ae(Sn,null),r=H(()=>{let e=n?.value;return t.call.status!==`running`||typeof e!=`number`||t.call.startedAt===void 0?``:X(Math.max(0,e-t.call.startedAt),`clock`)}),i=H(()=>We(t.call.durationMs,`tool`,t.call.timedOut)),a=H(()=>qe(i.value)),o=H(()=>t.call.durationMs===void 0?-1:t.call.facts.length-1);function s(){t.call.open=!t.call.open}return(t,n)=>(R(),W(`details`,{id:`call-${e.call.id}`,class:J([`call rounded-lg border border-default bg-elevated font-mono open:bg-accented`,e.call.status]),open:e.call.open,title:typeof e.call.startedAt==`number`?`started ${K(Z)(e.call.startedAt)}`:void 0,"data-status":e.call.status,"data-heat":i.value.level},[U(`summary`,{class:J([`flex min-w-0 cursor-pointer list-none items-baseline gap-3 rounded-lg pl-3 pr-[calc(var(--sb-gutter)-1px)] py-2 hover:bg-accented/60 focus-visible:outline-2 focus-visible:outline-primary max-sm:flex-wrap [&::-webkit-details-marker]:hidden`,e.call.open?`rounded-b-none border-b border-default`:``]),onClick:A(s,[`prevent`])},[U(`span`,{class:J([`chev shrink-0 select-none text-xs text-dimmed transition-transform motion-reduce:transition-none`,e.call.open?`rotate-90`:``])},`❯`,2),e.call.status===`running`?(R(),W(`span`,On)):(R(),W(`span`,{key:1,class:J([`glyph w-[1em] shrink-0 text-center font-medium`,e.call.status===`ok`?`text-ok`:e.call.status===`failed`?`text-bad`:`text-warn`])},q(e.call.status===`ok`?`✓`:e.call.status===`failed`?`✗`:`⚠`),3)),e.call.shell?(R(),W(`span`,kn,`$`)):(R(),W(`span`,An,q(e.call.tool),1)),e.call.chipOnly?(R(),W(`span`,Nn)):(R(),W(j,{key:4},[e.call.open?(R(),W(`code`,Mn,q(e.call.title),1)):(R(),W(`code`,jn,q(e.call.headline),1))],64)),U(`span`,Pn,[r.value?(R(),W(`span`,Fn,q(r.value),1)):B(``,!0),(R(!0),W(j,null,G(e.call.facts,(t,n)=>(R(),W(j,{key:n},[n===o.value&&i.value.over?(R(),W(`span`,In,`timed out`)):B(``,!0),U(`span`,{class:J([`fact`,[e.call.status!==`ok`&&n===0?`text-bad`:``,n===o.value&&i.value.over?`font-medium text-bad`:``,n===o.value&&a.value?`heat`:``,n===o.value&&i.value.level>=2&&!i.value.over?`font-medium`:``]]),style:_(n===o.value?a.value:void 0)},q(t),7)],64))),128)),i.value.over&&o.value===-1?(R(),W(`span`,Ln,`timed out`)):B(``,!0)])],2),U(`div`,Rn,[e.call.hasResult&&e.call.output?(R(),W(`pre`,{key:0,class:J([`out max-h-[28rem] overflow-auto whitespace-pre-wrap break-words px-3.5 py-2.5 font-mono leading-normal`,e.call.status===`failed`?`text-bad`:`text-toned`])},q(e.call.output),3)):e.call.hasResult?(R(),W(`div`,zn,`no output`)):(R(),W(`div`,Bn,`no output yet`))])],10,Dn))}}),Hn=[`title`],Un=[`title`],Wn={class:`skillname whitespace-nowrap font-mono font-medium text-skill`},Gn={key:0,class:`skilldesc min-w-0 flex-1 truncate text-xs text-muted`},Kn={class:`facts ml-auto flex shrink-0 gap-2.5 font-mono text-xs text-muted`},qn=[`href`],Jn={class:`fact`},Yn=Y({__name:`StepItems`,props:{items:{}},setup(e){function t(e){return e>0?e<1024?`${e} B`:e<1048576?`${(Math.round(e/102.4)/10).toFixed(1)} KB`:`${(Math.round(e/104857.6)/10).toFixed(1)} MB`:`0 B`}return(n,r)=>(R(!0),W(j,null,G(e.items,(e,n)=>(R(),W(j,{key:n},[e.kind===`call`?(R(),P(Vn,{key:0,call:e.call},null,8,[`call`])):e.kind===`quiet`?(R(),W(`div`,{key:1,class:`quiet flex items-baseline gap-3 pl-3 pr-(--sb-gutter) py-0.5 font-mono text-xs text-dimmed`,title:e.at===void 0?void 0:K(Z)(e.at)},[U(`span`,null,q(e.text),1)],8,Hn)):(R(),W(`div`,{key:2,class:`skill flex items-baseline gap-2.5 pl-3 pr-(--sb-gutter) py-0.5`,title:e.skill.at===void 0?void 0:K(Z)(e.skill.at)},[r[0]||=U(`span`,{class:`skillmark shrink-0 select-none text-xs`},`📚`,-1),U(`span`,Wn,`skill `+q(e.skill.name),1),e.skill.description?(R(),W(`span`,Gn,q(e.skill.description),1)):B(``,!0),U(`span`,Kn,[e.skill.source?(R(),W(`a`,{key:0,class:`fact text-primary hover:underline`,href:e.skill.source,target:`_blank`,rel:`noopener noreferrer`},`source`,8,qn)):B(``,!0),U(`span`,Jn,q(t(e.skill.bodyBytes))+` into context`,1)])],8,Un))],64))),128))}}),Xn=[`id`,`data-live`],Zn={class:`head flex items-baseline gap-x-6 pb-1.5 pr-(--sb-gutter)`},Qn={class:`min-w-0 flex-1`},$n={key:0,class:`meta flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5 font-mono text-xs tabular-nums text-dimmed`},er=[`data-heat`,`title`],tr=[`title`],nr=[`title`],rr={key:2,class:`nonar font-sans text-sm italic text-dimmed`},ir=[`title`],ar={key:0,class:`narration flex items-baseline gap-3 pb-1.5 pr-(--sb-gutter)`},or={key:1,class:`narration flex items-baseline gap-3 pb-1.5 pr-(--sb-gutter)`},sr={class:`nonar flex-1 font-sans text-sm italic text-dimmed`},cr={class:`calls flex flex-col gap-2`},lr=[`open`,`data-group-open`],ur=[`title`],dr=[`data-ok`,`data-bad`,`data-infra`,`data-running`],fr=[`data-heat`],pr={class:`gbody flex flex-col gap-2 pb-1 pt-1.5`},mr=Y({__name:`StepBlock`,props:{step:{}},emits:[`toggleGroup`],setup(e,{emit:t}){let n=e,r=t,i=H(()=>n.step.items.filter(e=>e.kind===`call`)),a=H(()=>i.value.length>=2),o=H(()=>{let e=0,t=0,n=0,r=0,a=0;for(let o of i.value){if(o.kind!==`call`)continue;let i=o.call;i.status===`ok`?e++:i.status===`failed`?t++:i.status===`infra`?n++:r++,typeof i.durationMs==`number`&&(a+=i.durationMs)}return{n:e+t+n+r,ok:e,bad:t,infra:n,running:r,ms:a}}),s=H(()=>pn(o.value)),c=H(()=>i.value.some(e=>e.kind===`call`&&e.call.timedOut)),l=H(()=>We(o.value.ms,`tool`,c.value)),u=H(()=>qe(l.value)),d=H(()=>n.step.turn?We(n.step.turn.durationMs,`turn`):void 0),f=H(()=>d.value?qe(d.value):void 0),p=H(()=>{let e=i.value[0];return e?.kind===`call`?e.call.startedAt:void 0});return(t,n)=>(R(),W(`li`,{id:e.step.turn?`span-${e.step.turn.spanId}`:void 0,class:J([`step relative border-l-2 pb-3 pl-3 pt-2`,e.step.live?`border-ok/40`:`border-(--ui-border-accented)/50`]),"data-live":e.step.live?`1`:void 0},[U(`div`,Zn,[U(`div`,Qn,[e.step.turn?(R(),W(`div`,$n,[U(`span`,{class:J([`thought`,[f.value?`heat`:``,d.value&&d.value.level>=2?`font-medium`:``]]),style:_(f.value),"data-heat":d.value?.level,title:e.step.turn.label},`thought `+q(e.step.turn.chip),15,er),e.step.turn.switched?(R(),W(`span`,{key:0,class:`model-switch order-first rounded border border-warn/40 bg-warn/10 px-1.5 font-medium text-warn`,title:`model changed: this turn ran on ${e.step.turn.model}`},`⇄ `+q(K(wn)(e.step.turn.model)),9,tr)):e.step.turn.showModel?(R(),W(`span`,{key:1,class:`model-badge order-first rounded bg-accented px-1.5 text-[0.68rem] font-medium leading-normal tracking-wider text-muted`,title:e.step.turn.model},q(K(wn)(e.step.turn.model)),9,nr)):B(``,!0),(R(!0),W(j,null,G(e.step.turn.facts,(e,t)=>(R(),W(`span`,{key:t,class:`fact`},q(e),1))),128))])):e.step.narration===null?(R(),W(`span`,rr,q(e.step.note),1)):(R(),P($,{key:1,text:e.step.narration},null,8,[`text`]))]),e.step.at===void 0?B(``,!0):(R(),W(`span`,{key:0,class:`ts shrink-0 select-none font-mono text-xs tabular-nums text-dimmed`,title:K(Z)(e.step.at)},q(K(yt)(e.step.at)),9,ir))]),e.step.turn&&e.step.narration!==null?(R(),W(`div`,ar,[M($,{text:e.step.narration},null,8,[`text`])])):e.step.turn&&e.step.narration===null&&!e.step.turn.facts.length?(R(),W(`div`,or,[U(`span`,sr,q(e.step.note),1)])):B(``,!0),U(`div`,cr,[a.value?(R(),W(`details`,{key:1,class:`grp`,open:e.step.groupOpen,"data-group-open":e.step.groupOpen?`1`:`0`},[U(`summary`,{class:`gsummary flex cursor-pointer list-none items-baseline gap-3 rounded-md pl-3 pr-(--sb-gutter) py-1 font-mono text-xs text-dimmed hover:bg-accented/40 hover:text-muted focus-visible:outline-2 focus-visible:outline-primary [&::-webkit-details-marker]:hidden`,title:typeof p.value==`number`?`calls began ${K(Z)(p.value)}`:void 0,onClick:n[0]||=A(e=>r(`toggleGroup`),[`prevent`])},[U(`span`,{class:J([`gchev shrink-0 select-none transition-transform motion-reduce:transition-none`,e.step.groupOpen?`rotate-90`:``])},`❯`,2),U(`span`,{class:J([`gcount`,o.value.bad||o.value.infra?`text-bad`:``]),"data-ok":o.value.ok,"data-bad":o.value.bad,"data-infra":o.value.infra,"data-running":o.value.running},q(s.value),11,dr),o.value.ms>0?(R(),W(`span`,{key:0,class:J([`gtime ml-auto tabular-nums`,[u.value?`heat`:``,l.value.over?`font-medium text-bad`:l.value.level>=2?`font-medium`:``]]),style:_(u.value),"data-heat":l.value.level},[l.value.over?(R(),W(j,{key:0},[L(`timed out · `)],64)):B(``,!0),L(q(K(X)(o.value.ms,`clock`)),1)],14,fr)):B(``,!0)],8,ur),U(`div`,pr,[M(Yn,{items:e.step.items},null,8,[`items`])])],8,lr)):(R(),P(Yn,{key:0,items:e.step.items},null,8,[`items`]))])],10,Xn))}}),hr=[`id`],gr={class:`what`},_r={key:0,class:`text-dimmed`},vr={key:1,class:`dur tabular-nums text-dimmed`},yr=[`title`],br=Y({__name:`SpanRow`,props:{item:{}},setup(e){return(t,n)=>(R(),W(`li`,{id:`span-${e.item.spanId}`,class:`span flex items-baseline gap-2 py-0.5 pr-(--sb-gutter) font-mono text-xs text-muted`},[U(`span`,{class:J([`glyph select-none`,e.item.status===`error`?`text-bad`:`text-dimmed`])},q(e.item.open?`◌`:e.item.status===`error`?`✗`:`◷`),3),U(`span`,gr,q(e.item.text),1),e.item.open?(R(),W(`span`,_r,`…`)):e.item.durationMs===void 0?B(``,!0):(R(),W(`span`,vr,q(K(X)(e.item.durationMs,`precise`)),1)),e.item.at===void 0?B(``,!0):(R(),W(`span`,{key:2,class:`ts ml-auto select-none text-dimmed`,title:K(Z)(e.item.at)},q(K(yt)(e.item.at)),9,yr))],8,hr))}}),xr={"getting ready":`paint-ready`,thinking:`paint-thinking`,"in tools":`paint-tools`,"finishing up":`paint-finishing`,"Switchboard overhead":`paint-overhead`,"not recorded":`paint-lost`,"not loaded":`paint-elided`},Sr={getting_ready:`getting ready`,finishing_up:`finishing up`};function Cr(e){return xr[Sr[e]]}var wr={id:`timeline`,class:`block mb-4 rounded-lg border border-default bg-(--ui-bg-muted) px-(--sb-gutter) py-3`,"data-testid":`timeline`},Tr={class:`mb-2 flex items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},Er={class:`ml-auto flex items-baseline gap-3 font-normal normal-case tracking-normal`},Dr=[`href`],Or={class:`lede font-mono text-sm text-toned`},kr={class:`shape tabular-nums`},Ar={key:0,class:`current text-muted`},jr={key:0,class:`note mt-0.5 text-xs text-muted`},Mr=[`aria-label`],Nr=[`title`,`data-term`],Pr={class:`legend mt-2 flex flex-wrap gap-x-4 gap-y-1 font-mono text-xs`},Fr=[`title`,`data-term`],Ir={class:`term text-muted`},Lr={class:`ms tabular-nums text-toned`},Rr=[`title`],zr={class:`ranked mt-1 flex flex-col gap-1 font-mono text-xs`},Br={class:`ms w-14 shrink-0 tabular-nums text-toned`},Vr=[`href`,`data-anchor`,`onClick`],Hr=Y({__name:`TimelineSection`,props:{vm:{},eventsHref:{}},emits:[`reveal`],setup(e,{emit:t}){let n=e,r=t;function i(e){return`${X(e.ms,`clock`)} ${e.term}${e.hatched?` (in flight)`:``}`}function a(){c.copyText(JSON.stringify(n.vm.debug,null,2))}return(t,n)=>(R(),W(`section`,wr,[U(`h2`,Tr,[n[0]||=U(`span`,null,`Where the time went`,-1),U(`span`,Er,[e.eventsHref?(R(),W(`a`,{key:0,class:`text-dimmed no-underline hover:text-primary hover:underline`,href:e.eventsHref,title:`the stored events, as JSON lines`},`raw events`,8,Dr)):B(``,!0),U(`button`,{type:`button`,class:`debug cursor-pointer text-dimmed hover:text-toned`,title:`the partition and the raw span names, for a bug report`,onClick:a},` Copy debug JSON `)])]),U(`p`,Or,[U(`span`,kr,q(e.vm.shown?e.vm.total:e.vm.lede),1),e.vm.current?(R(),W(`span`,Ar,` · `+q(e.vm.current),1)):B(``,!0)]),(R(!0),W(j,null,G(e.vm.captions,e=>(R(),W(`p`,{key:e,class:`caption mt-0.5 text-xs text-muted`},q(e),1))),128)),e.vm.note?(R(),W(`p`,jr,q(e.vm.note),1)):B(``,!0),e.vm.shown?(R(),W(j,{key:1},[U(`div`,{class:`bar mt-2.5 flex h-2 w-full overflow-hidden rounded-sm`,role:`img`,"aria-label":e.vm.lede},[(R(!0),W(j,null,G(e.vm.bar,(e,t)=>(R(),W(`div`,{key:t,class:J([`seg h-full`,[K(xr)[e.term],e.hatched?`paint-hatched hatched`:``]]),style:_({width:`${e.pct}%`}),title:i(e),"data-term":e.term},null,14,Nr))),128))],8,Mr),U(`ul`,Pr,[(R(!0),W(j,null,G(e.vm.legend,e=>(R(),W(`li`,{key:e.term,class:`flex items-baseline gap-1.5 cursor-help`,title:e.definition,"data-term":e.term},[U(`span`,{class:J([`swatch inline-block size-2 shrink-0 self-center rounded-[2px]`,K(xr)[e.term]])},null,2),U(`span`,Ir,q(e.term),1),U(`span`,Lr,q(e.text),1)],8,Fr))),128))]),e.vm.ranked.length>0?(R(),W(j,{key:0},[U(`h3`,{class:`ranked-head mt-3 inline-block cursor-help text-xs font-medium text-muted underline decoration-dotted decoration-(--ui-border-accented) underline-offset-2`,title:e.vm.rankedNote},` Longest steps `,8,Rr),U(`ol`,zr,[(R(!0),W(j,null,G(e.vm.ranked,(e,t)=>(R(),W(`li`,{key:t,class:`flex items-baseline gap-2`},[U(`span`,Br,q(K(X)(e.ms,`clock`)),1),U(`a`,{class:`label min-w-0 truncate text-muted no-underline hover:text-primary hover:underline`,href:`#${e.anchor}`,"data-anchor":e.anchor,title:`scroll to this step`,onClick:A(t=>r(`reveal`,e.anchor),[`prevent`])},q(e.label),9,Vr),(R(!0),W(j,null,G(e.facts,e=>(R(),W(`span`,{key:e,class:`fact shrink-0 rounded border border-accented px-1 text-dimmed`},q(e),1))),128))]))),128))])],64)):B(``,!0)],64)):B(``,!0)]))}}),Ur=[`data-position`],Wr={class:`mb-2 flex items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-ok`},Gr=[`href`],Kr={key:1,class:`caption font-normal normal-case tracking-normal text-dimmed`},qr=[`title`],Jr=Y({__name:`ReplyBlock`,props:{text:{},caption:{},when:{},whenTitle:{},position:{}},setup(e){return(t,n)=>(R(),W(`section`,{id:`reply`,class:J([`block rounded-lg border border-ok/40 bg-(--ui-bg-muted) px-(--sb-gutter) py-3`,e.position===`first`?`mb-4`:`mt-6`]),"data-position":e.position},[U(`h2`,Wr,[n[0]||=U(`span`,null,`Reply`,-1),e.caption.href?(R(),W(`a`,{key:0,class:`caption font-normal normal-case tracking-normal text-dimmed no-underline hover:text-primary hover:underline`,href:e.caption.href,target:`_blank`,rel:`noopener noreferrer`},q(e.caption.text),9,Gr)):(R(),W(`span`,Kr,q(e.caption.text),1)),U(`span`,{class:`ts ml-auto select-none text-xs font-normal normal-case tracking-normal text-dimmed`,title:e.whenTitle},q(e.when),9,qr)]),M($,{text:e.text},null,8,[`text`])],10,Ur))}});function Yr(e,t){let{window:n,owner:r,finished:i}=t,a=Math.max(0,n.end-n.start),o=new Map(e.map(e=>[e.spanId,e])),s=new Map,c=e=>{let t=s.get(e.spanId);if(t!==void 0)return t;s.set(e.spanId,1);let n=e.parentSpanId?o.get(e.parentSpanId):void 0,r=n?c(n)+1:1;return s.set(e.spanId,r),r},l=e=>{let t=e,n=new Set;for(;t&&!n.has(t.spanId);){if(n.add(t.spanId),Rt(t.name,r)?.kind===`background`)return!0;t=t.parentSpanId?o.get(t.parentSpanId):void 0}return!1},u=t.losses.map(e=>Math.max(n.start,e.from)).sort((e,t)=>e-t),d=e=>{if(e.endedAt!==void 0)return Math.min(n.end,e.endedAt);if(!i)return n.end;let t=u.find(t=>t>e.startedAt);return t===void 0?n.end:Math.min(n.end,t)},f=[],p=[];for(let t of e){let e=Rt(t.name,r);if(!e)continue;let i=Math.max(n.start,t.startedAt);if(e.kind===`background`){let e=Math.min(n.end,t.endedAt??n.end);e>i&&p.push([i,e]);continue}if(e.kind!==`counted`||l(t))continue;let a=d(t);a<=i||f.push({start:i,end:a,bucket:e.bucket,depth:c(t),startedAt:t.startedAt,spanId:t.spanId})}f.sort((e,t)=>t.depth-e.depth||e.startedAt-t.startedAt||(e.spanId<t.spanId?-1:+(e.spanId>t.spanId)));let m=new Set([n.start,n.end]);for(let e of f)m.add(e.start),m.add(e.end);for(let e of t.losses)m.add(Xr(e.from,n)),m.add(Xr(e.to,n));for(let[e,t]of p)m.add(e),m.add(t);let h=[...m].filter(e=>e>=n.start&&e<=n.end).sort((e,t)=>e-t),g={getting_ready:0,thinking:0,tools:0,finishing_up:0},_=0,v=0,y=0;for(let e=0;e+1<h.length;e++){let r=h[e],i=h[e+1],a=i-r;if(a<=0)continue;let o=f.find(e=>e.start<=r&&e.end>=i);if(o){g[o.bucket]+=a;continue}if(t.losses.some(e=>e.kind===`lost`&&Xr(e.from,n)<=r&&Xr(e.to,n)>=i)){_+=a;continue}if(t.losses.some(e=>e.kind===`elided`&&Xr(e.from,n)<=r&&Xr(e.to,n)>=i)){v+=a;continue}p.some(([e,t])=>e<=r&&t>=i)&&(y+=a)}let b=g.getting_ready+g.thinking+g.tools+g.finishing_up;return{windowMs:a,gettingReadyMs:g.getting_ready,thinkingMs:g.thinking,toolsMs:g.tools,finishingUpMs:g.finishing_up,overheadMs:Math.max(0,a-b-_-v),notRecordedMs:_,notLoadedMs:v,backgroundOnlyMs:y}}function Xr(e,t){return Math.min(t.end,Math.max(t.start,e))}function Zr(e){let t=Math.floor(e.windowMs/1e3),n=[[`getting ready`,Math.floor(e.gettingReadyMs/1e3)],[`thinking`,Math.floor(e.thinkingMs/1e3)],[`in tools`,Math.floor(e.toolsMs/1e3)],[`finishing up`,Math.floor(e.finishingUpMs/1e3)],[`not recorded`,Math.floor(e.notRecordedMs/1e3)],[`not loaded`,Math.floor(e.notLoadedMs/1e3)]],r=n.reduce((e,[,t])=>e+t,0),i=n.filter(([,e])=>e>0).map(([e,t])=>({term:e,s:t})),a=t-r;a>0&&i.push({term:`Switchboard overhead`,s:a});let o=[`getting ready`,`thinking`,`in tools`,`finishing up`,`Switchboard overhead`,`not recorded`,`not loaded`];return i.sort((e,t)=>o.indexOf(e.term)-o.indexOf(t.term)),{totalS:t,items:i}}function Qr(e){return[e.gettingReadyMs,e.thinkingMs,e.toolsMs,e.finishingUpMs,e.overheadMs,e.notRecordedMs,e.notLoadedMs].filter(t=>t>=2e3||e.windowMs>0&&t/e.windowMs>=.05).length>=2}function $r(e,t){if(t===void 0||t<6e4)return;let n=X(t,`clock`);return e===`before`?`queued ${n} before we saw it`:`queued ${n} behind the previous run`}var ei={"getting ready":`before the agent's first turn: reading the thread, finding the repo, checking out, loading tools`,thinking:`the model's turns — from a request to the model until its reply came back`,"in tools":`the commands and tool calls the model ran`,"finishing up":`after the agent's last turn: posting the PR, checking the workspace`,"Switchboard overhead":`orchestration between steps, and moments when only a background read was running — the time no step claims`,"not recorded":`a stretch of the run the record does not carry`,"not loaded":`a stretch of the run this page did not load — the record has the full shape`},ti=`Ranked by each step's own time, its children excluded — the bar counts every instant once.`,ni=`currently delivering`,ri=`getting ready: not recorded (too large)`,ii=`no timing data`,ai=`not loaded (the record has the full shape)`,oi={getting_ready:`getting ready`,thinking:`thinking`,tools:`in tools`,finishing_up:`finishing up`};function si(e){let{spans:t,window:n,owner:r}=e,i=e.phase!==`live`,a=Yr(t,{window:n,owner:r,finished:i,losses:e.losses}),o=Zr(a),s=X(o.totalS*1e3,`clock`),c=t.find(e=>e.name===`request`&&e.parentSpanId===void 0),l=e.phase===`live`?li(t,r,n):void 0,u=di(e,l),d=l?Wt(l.name):``,f={window:n,owner:r,phase:e.phase,partition:a,spans:t.map(e=>({spanId:e.spanId,parentSpanId:e.parentSpanId,name:e.name,startedAt:e.startedAt,endedAt:e.endedAt,status:e.status,attrs:e.attrs}))};if(e.untimed)return{total:s,current:u,openStep:d,captions:[],rankedNote:ti,debug:f,lede:s,shown:!1,bar:[],legend:[],ranked:[],note:ii};let p={total:s,current:u,openStep:d,captions:[$r(`before`,ci(c,`queuedBeforeMs`)),$r(`behind`,ci(c,`queuedBehindMs`))].filter(e=>e!==void 0),rankedNote:ti,debug:f};if(!c)return{...p,lede:s,shown:!1,bar:[],legend:[],ranked:[],note:i?ri:``};let m=t=>t===`not recorded`?`not recorded${e.truncated?` (too large)`:``}`:t===`not loaded`?ai:t,h=Qr(a)&&o.items.length>0,g=h?`${s} — ${o.items.map(({term:e,s:t})=>`${X(t*1e3,`clock`)} ${m(e)}`).join(` · `)}`:a.windowMs>0?`${s} — ${m(pi(a))}`:s,_=h?o.items.map(({term:t,s:n})=>({term:t,text:X(n*1e3,`clock`),definition:t===`not recorded`&&e.truncated?`${ei[t]} (too large)`:ei[t]})):[];return{...p,lede:g,shown:h,bar:h?mi(a,l):[],legend:_,ranked:h?hi(t,c,r,n,e.callTitle):[],note:``}}function ci(e,t){let n=e?.attrs[t];return typeof n==`number`&&Number.isFinite(n)?n:void 0}function li(e,t,n){let r=new Map(e.map(e=>[e.spanId,e])),i=e=>{let t=1,n=new Set([e.spanId]),i=e.parentSpanId?r.get(e.parentSpanId):void 0;for(;i&&!n.has(i.spanId);)n.add(i.spanId),t++,i=i.parentSpanId?r.get(i.parentSpanId):void 0;return t},a;for(let o of e){if(o.endedAt!==void 0||o.startedAt>=n.end)continue;let e=Rt(o.name,t);if(e?.kind!==`counted`||ui(o,r,t))continue;let s=i(o);(!a||s>a.depth||s===a.depth&&o.startedAt>a.span.startedAt)&&(a={span:o,depth:s,bucket:e.bucket})}if(a)return{bucket:a.bucket,name:a.span.name,elapsedMs:Math.max(0,n.end-Math.max(n.start,a.span.startedAt))}}function ui(e,t,n){let r=e,i=new Set;for(;r&&!i.has(r.spanId);){if(i.add(r.spanId),Rt(r.name,n)?.kind===`background`)return!0;r=r.parentSpanId?t.get(r.parentSpanId):void 0}return!1}function di(e,t){return e.phase===`delivering`?ni:e.phase===`ended`?bn(e.delivery??{}):t?`currently ${oi[t.bucket]} ${X(t.elapsedMs,`clock`)}`:``}function fi(e){return[[`getting ready`,e.gettingReadyMs],[`thinking`,e.thinkingMs],[`in tools`,e.toolsMs],[`finishing up`,e.finishingUpMs],[`Switchboard overhead`,e.overheadMs],[`not recorded`,e.notRecordedMs],[`not loaded`,e.notLoadedMs]]}function pi(e){let t=[`getting ready`,-1];for(let n of fi(e))n[1]>t[1]&&(t=n);return t[0]}function mi(e,t){let n=[],r=t=>e.windowMs>0?t/e.windowMs*100:0;for(let[i,a]of fi(e))if(!(a<=0)){if(t&&oi[t.bucket]===i){let e=Math.min(t.elapsedMs,a);a-e>0&&n.push({term:i,ms:a-e,pct:r(a-e),hatched:!1}),e>0&&n.push({term:i,ms:e,pct:r(e),hatched:!0});continue}n.push({term:i,ms:a,pct:r(a),hatched:!1})}return n}function hi(e,t,n,r,i){let a=new Map(e.map(e=>[e.spanId,e])),o=new Map;for(let t of e){if(t.parentSpanId===void 0)continue;let e=o.get(t.parentSpanId);e?e.push(t):o.set(t.parentSpanId,[t])}let s=e=>[Math.max(r.start,e.startedAt),Math.min(r.end,e.endedAt??r.end)],c=[];for(let r of e){if(r===t||r.name===`run.agent`||Rt(r.name,n)===void 0||ui(r,a,n))continue;let[e,l]=s(r);if(l<=e)continue;let u=(o.get(r.spanId)??[]).map(s).map(([t,n])=>[Math.max(e,t),Math.min(l,n)]).filter(([e,t])=>t>e),d=l-e-gi(u);if(d<=0)continue;let f=r.name.startsWith(`tool.`)&&typeof r.attrs.callId==`string`?r.attrs.callId:void 0,p=f?i?.(f):void 0;c.push({label:p??Wt(r.name),ms:d,facts:_i(r),anchor:f?`call-${f}`:`span-${r.spanId}`,startedAt:r.startedAt})}return c.sort((e,t)=>t.ms-e.ms||e.startedAt-t.startedAt),c.slice(0,3).map(({label:e,ms:t,facts:n,anchor:r})=>({label:e,ms:t,facts:n,anchor:r}))}function gi(e){let t=[...e].sort((e,t)=>e[0]-t[0]),n=0,r;for(let[e,i]of t)!r||e>r[1]?(r&&(n+=r[1]-r[0]),r=[e,i]):i>r[1]&&(r[1]=i);return r&&(n+=r[1]-r[0]),n}function _i(e){let t=e.attrs,n=[];return(t.token===`expired`||t.token===`expiring`)&&n.push(`token ${t.token}`),t.budget===`clipped`&&n.push(`budget clipped`),typeof t.timeoutMs==`number`&&n.push(`timeout ${X(t.timeoutMs,`clock`)}`),typeof t.waitedMs==`number`&&n.push(`waited ${X(t.waitedMs,`clock`)}`),typeof t.exitCode==`number`&&t.exitCode!==0&&n.push(`exit ${t.exitCode}`),t.timedOut===!0&&n.push(`timed out`),typeof t.attempts==`number`&&t.attempts>1&&n.push(`${t.attempts} attempts`),e.status===`error`&&n.length===0&&n.push(`failed`),n}function vi(e){return e===`command`?`command`:`agent`}function yi(e){return e.description?.title?e.description.title:e.pr.repo&&e.pr.number!==void 0?`${e.pr.repo}#${e.pr.number}`:e.pr.repo??`PR review`}var bi=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,xi=/^[0-9a-f]{7,40}$/;function Si(e){if(!e.repo||!bi.test(e.repo))return{};let t=`https://github.com/${e.repo}`,n={};return e.number!==void 0&&Number.isInteger(e.number)&&e.number>0&&(n.pr=`${t}/pull/${e.number}`,n.files=`${t}/pull/${e.number}/files`),e.headSha&&xi.test(e.headSha)&&(n.commit=e.number!==void 0&&n.pr?`${t}/pull/${e.number}/commits/${e.headSha}`:`${t}/commit/${e.headSha}`),n}function Ci(e){return e.find(e=>e.poweredBy===`meat`)??e.find(e=>e.poweredBy===`git`)??null}function wi(e){return e===`meat`?`An abridged reading of the change: a model dropped what a reviewer need not read (style, imports, boilerplate) and kept the concepts`:`The complete change, base…head, as git reports it`}function Ti(e){return`The recorded diff was cut at ${e.toLocaleString(`en-US`)} characters; open the full diff on GitHub for the rest`}function Ei(e){return e===`meat`?`reading diff · meat`:`full diff · git`}function Di(e){let t=[];return e.origin===`parsed`&&!e.complete&&t.push(`read back from the PR body`),e.truncated&&t.push(`the body was cut before it was read`),t.length>0?t.join(`; `):void 0}var Oi=e=>typeof e==`object`&&!!e,ki=e=>typeof e==`string`&&e!==``,Ai=e=>typeof e==`number`&&Number.isInteger(e)&&e>0;function ji(e){for(let t of e.split(/\n\s*\n/)){let e=t.split(`
9
9
  `).map(e=>e.trim()).filter(e=>e!==``);if(!(e.length===0||e.every(e=>e.startsWith(`#`))))return e.join(`
10
10
  `)}}function Mi(e,t){let n=t.trim().toLowerCase(),r=[],i=!1,a=!1;for(let t of e.split(`
11
11
  `)){/^\s*```/.test(t)&&(i=!i);let e=i?null:/^##\s+(.+?)\s*$/.exec(t);if(e){if(a)break;a=e[1].toLowerCase()===n;continue}a&&r.push(t)}let o=r.join(`
12
- `).trim();return o===``?void 0:o}function Ni(e){if(!ki(e.title)||e.origin!==`submitted`&&e.origin!==`parsed`)return;let t=typeof e.body==`string`?e.body:``,n=ki(e.tldr)?e.tldr:ji(t),r=Mi(t,`What & why`);return{title:e.title,...n===void 0?{}:{tldr:n},...r===void 0?{}:{whatWhy:r},origin:e.origin,complete:e.complete===!0,truncated:e.truncated===!0}}function Pi(){let e=V({pr:{},readingDiffs:[],ready:!1});return{state:e,handle(t){if(!Oi(t))return;let n=t;if(n.type===`run_meta`)ki(n.repo)&&(e.pr.repo=n.repo),Ai(n.pr)&&(e.pr.number=n.pr),typeof n.headSha==`string`&&xi.test(n.headSha)&&(e.pr.headSha=n.headSha);else if(n.type===`review_artifact`&&n.artifact===`reading_diff`){if(!ki(n.diff)||n.poweredBy!==`git`&&n.poweredBy!==`meat`)return;let t={poweredBy:n.poweredBy,baseRef:ki(n.baseRef)?n.baseRef:`HEAD`,diff:n.diff,truncated:n.truncated===!0,...ki(n.summary)?{summary:n.summary}:{}},r=e.readingDiffs.findIndex(e=>e.poweredBy===t.poweredBy);r>=0?e.readingDiffs.splice(r,1,t):e.readingDiffs.push(t),e.ready=!0}else if(n.type===`review_artifact`&&n.artifact===`pr_description`){let t=Ni(n);t&&(e.description=t)}}}}var Fi=3e3,Ii={fetch:(...e)=>globalThis.fetch(...e),delay:e=>new Promise(t=>setTimeout(t,e))};function Li(e,t,n={}){let{fetch:r,delay:i}={...Ii,...n},a=V({state:{state:`absent`}}),o=!1,s=!1;async function c(t){let n=await r(`/api/review.abridge`,{method:`POST`,credentials:`same-origin`,headers:{"content-type":`application/json`},body:JSON.stringify({id:e,...t?{force:!0}:{}})}),i=await n.json().catch(()=>null);if(!n.ok)throw Error(typeof i?.error==`string`?i.error:`HTTP ${n.status}`);return i??{}}async function l(){let n=!1,i;for(let a=0;a<50;a++){let a=`id=${encodeURIComponent(e)}${i===void 0?``:`&after-seq=${i}`}`,s=await r(`/api/runs.events?${a}`,{credentials:`same-origin`});if(o)return`disposed`;if(!s.ok)throw Error(`HTTP ${s.status}`);let c=await s.json();if(o)return`disposed`;for(let e of c.events??[]){t(e);let r=e;r.type===`review_artifact`&&r.artifact===`reading_diff`&&r.poweredBy===`meat`&&(n=!0)}if(typeof c.nextAfterSeq!=`number`)return n?`found`:`missing`;if(i!==void 0&&c.nextAfterSeq<=i)return`stuck`;i=c.nextAfterSeq}return`stuck`}async function u(e){try{let t=await c(e);for(let e=0;t.state===`running`;e++){if(e>=200){s=!1,a.state={state:`failed`,reason:`still running after the page stopped waiting; ask again later`};return}if(await i(Fi),o)return;t=await c(!1)}if(o)return;if(t.state===`failed`)s=!0,a.state={state:`failed`,reason:typeof t.reason==`string`?t.reason:`unknown reason`};else if(t.state===`done`){let e=await l();if(e===`disposed`)return;s=!1,a.state=e===`found`?{state:`done`}:{state:`failed`,reason:e===`stuck`?`the run's record did not page to its end`:`the abridged diff did not appear on the run's record`}}else s=!1,a.state={state:`failed`,reason:`unexpected answer: ${String(t.state)}`}}catch(e){if(o)return;s=!1,a.state={state:`failed`,reason:e instanceof Error?e.message:String(e)}}}return{get state(){return a.state},start(){if(a.state.state===`running`||o)return;let e=a.state.state===`failed`&&s;a.state={state:`running`},u(e)},dispose(){o=!0}}}var Ri={slots:{base:`font-medium inline-flex items-center`,label:`truncate`,leadingIcon:`shrink-0`,leadingAvatar:`shrink-0`,leadingAvatarSize:``,trailingIcon:`shrink-0`},variants:{fieldGroup:{horizontal:`not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none focus-visible:z-[1]`,vertical:`not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none focus-visible:z-[1]`},color:{primary:``,secondary:``,success:``,info:``,warning:``,error:``,neutral:``},variant:{solid:``,outline:``,soft:``,subtle:``},size:{xs:{base:`text-[8px]/3 px-1 py-0.5 gap-1 rounded-sm`,leadingIcon:`size-3`,leadingAvatarSize:`3xs`,trailingIcon:`size-3`},sm:{base:`text-[10px]/3 px-1.5 py-1 gap-1 rounded-sm`,leadingIcon:`size-3`,leadingAvatarSize:`3xs`,trailingIcon:`size-3`},md:{base:`text-xs px-2 py-1 gap-1 rounded-md`,leadingIcon:`size-4`,leadingAvatarSize:`3xs`,trailingIcon:`size-4`},lg:{base:`text-sm px-2 py-1 gap-1.5 rounded-md`,leadingIcon:`size-5`,leadingAvatarSize:`2xs`,trailingIcon:`size-5`},xl:{base:`text-base px-2.5 py-1 gap-1.5 rounded-md`,leadingIcon:`size-6`,leadingAvatarSize:`2xs`,trailingIcon:`size-6`}},square:{true:``}},compoundVariants:[{color:`primary`,variant:`solid`,class:`bg-primary text-inverted`},{color:`secondary`,variant:`solid`,class:`bg-secondary text-inverted`},{color:`success`,variant:`solid`,class:`bg-success text-inverted`},{color:`info`,variant:`solid`,class:`bg-info text-inverted`},{color:`warning`,variant:`solid`,class:`bg-warning text-inverted`},{color:`error`,variant:`solid`,class:`bg-error text-inverted`},{color:`primary`,variant:`outline`,class:`text-primary ring ring-inset ring-primary/50`},{color:`secondary`,variant:`outline`,class:`text-secondary ring ring-inset ring-secondary/50`},{color:`success`,variant:`outline`,class:`text-success ring ring-inset ring-success/50`},{color:`info`,variant:`outline`,class:`text-info ring ring-inset ring-info/50`},{color:`warning`,variant:`outline`,class:`text-warning ring ring-inset ring-warning/50`},{color:`error`,variant:`outline`,class:`text-error ring ring-inset ring-error/50`},{color:`primary`,variant:`soft`,class:`bg-primary/10 text-primary`},{color:`secondary`,variant:`soft`,class:`bg-secondary/10 text-secondary`},{color:`success`,variant:`soft`,class:`bg-success/10 text-success`},{color:`info`,variant:`soft`,class:`bg-info/10 text-info`},{color:`warning`,variant:`soft`,class:`bg-warning/10 text-warning`},{color:`error`,variant:`soft`,class:`bg-error/10 text-error`},{color:`primary`,variant:`subtle`,class:`bg-primary/10 text-primary ring ring-inset ring-primary/25`},{color:`secondary`,variant:`subtle`,class:`bg-secondary/10 text-secondary ring ring-inset ring-secondary/25`},{color:`success`,variant:`subtle`,class:`bg-success/10 text-success ring ring-inset ring-success/25`},{color:`info`,variant:`subtle`,class:`bg-info/10 text-info ring ring-inset ring-info/25`},{color:`warning`,variant:`subtle`,class:`bg-warning/10 text-warning ring ring-inset ring-warning/25`},{color:`error`,variant:`subtle`,class:`bg-error/10 text-error ring ring-inset ring-error/25`},{color:`neutral`,variant:`solid`,class:`text-inverted bg-inverted`},{color:`neutral`,variant:`outline`,class:`ring ring-inset ring-accented text-default bg-default`},{color:`neutral`,variant:`soft`,class:`text-default bg-elevated`},{color:`neutral`,variant:`subtle`,class:`ring ring-inset ring-accented text-default bg-elevated`},{size:`xs`,square:!0,class:`p-0.5`},{size:`sm`,square:!0,class:`p-1`},{size:`md`,square:!0,class:`p-1`},{size:`lg`,square:!0,class:`p-1`},{size:`xl`,square:!0,class:`p-1`}],defaultVariants:{color:`primary`,variant:`solid`,size:`md`}},zi={__name:`Badge`,props:{as:{type:null,required:!1,default:`span`},label:{type:[String,Number],required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},square:{type:Boolean,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},trailingIcon:{type:null,required:!1}},setup(e){let t=e,n=v(),r=se(`badge`,t),i=x(),{orientation:a,size:o}=de(t),{isLeading:s,isTrailing:c,leadingIconName:l,trailingIconName:u}=me(r),d=H(()=>ge({extend:Ri,...i.ui?.badge||{}})({color:r.color,variant:r.variant,size:o.value??r.size,square:r.square||!n.default&&!r.label,fieldGroup:a.value}));return(e,t)=>(R(),P(K(h),{as:K(r).as,"data-slot":`base`,class:J(d.value.base({class:[K(r).ui?.base,K(r).class]}))},{default:S(()=>[F(e.$slots,`leading`,{ui:d.value},()=>[K(s)&&K(l)?(R(),P(be,{key:0,name:K(l),"data-slot":`leadingIcon`,class:J(d.value.leadingIcon({class:K(r).ui?.leadingIcon}))},null,8,[`name`,`class`])):K(r).avatar?(R(),P(Te,k({key:1,size:K(r).ui?.leadingAvatarSize||d.value.leadingAvatarSize()},K(r).avatar,{"data-slot":`leadingAvatar`,class:d.value.leadingAvatar({class:K(r).ui?.leadingAvatar})}),null,16,[`size`,`class`])):B(``,!0)]),F(e.$slots,`default`,{ui:d.value},()=>[K(r).label!==void 0&&K(r).label!==null?(R(),W(`span`,{key:0,"data-slot":`label`,class:J(d.value.label({class:K(r).ui?.label}))},q(K(r).label),3)):B(``,!0)]),F(e.$slots,`trailing`,{ui:d.value},()=>[K(c)&&K(u)?(R(),P(be,{key:0,name:K(u),"data-slot":`trailingIcon`,class:J(d.value.trailingIcon({class:K(r).ui?.trailingIcon}))},null,8,[`name`,`class`])):B(``,!0)])]),_:3},8,[`as`,`class`]))}},Bi={slots:{root:`flex items-center gap-2`,list:`relative flex p-1 group`,indicator:`absolute transition-[translate,width] duration-200 ease-out motion-reduce:transition-none`,trigger:[`group relative inline-flex items-center min-w-0 data-[state=inactive]:text-muted hover:data-[state=inactive]:not-disabled:text-default font-medium rounded-md disabled:cursor-not-allowed disabled:opacity-75`,`transition-colors`],leadingIcon:`shrink-0`,leadingAvatar:`shrink-0`,leadingAvatarSize:``,label:`truncate`,trailingBadge:`shrink-0`,trailingBadgeSize:`sm`,content:`w-full rounded-md focus-visible:outline-3`},variants:{color:{primary:{content:`outline-primary/25`},secondary:{content:`outline-secondary/25`},success:{content:`outline-success/25`},info:{content:`outline-info/25`},warning:{content:`outline-warning/25`},error:{content:`outline-error/25`},neutral:{content:`outline-inverted/25`}},variant:{pill:{list:`bg-elevated rounded-lg`,trigger:[`grow`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:content-[''] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:absolute in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:inset-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:rounded-md in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:shadow-xs in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:-z-10 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:isolate`],indicator:`rounded-md shadow-xs`},link:{list:`border-default`,indicator:`rounded-full`,trigger:`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:content-[''] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:absolute in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:rounded-full`}},orientation:{horizontal:{root:`flex-col`,list:`w-full`,indicator:`left-0 w-(--reka-tabs-indicator-size) translate-x-(--reka-tabs-indicator-position)`,trigger:`justify-center`},vertical:{list:`flex-col`,indicator:`top-0 h-(--reka-tabs-indicator-size) translate-y-(--reka-tabs-indicator-position)`}},size:{xs:{trigger:`px-2 py-1 text-xs gap-1`,leadingIcon:`size-4`,leadingAvatarSize:`3xs`},sm:{trigger:`px-2.5 py-1.5 text-xs gap-1.5`,leadingIcon:`size-4`,leadingAvatarSize:`3xs`},md:{trigger:`px-3 py-1.5 text-sm gap-1.5`,leadingIcon:`size-5`,leadingAvatarSize:`2xs`},lg:{trigger:`px-3 py-2 text-sm gap-2`,leadingIcon:`size-5`,leadingAvatarSize:`2xs`},xl:{trigger:`px-3 py-2 text-base gap-2`,leadingIcon:`size-6`,leadingAvatarSize:`xs`}}},compoundVariants:[{orientation:`horizontal`,variant:`pill`,class:{indicator:`inset-y-1`}},{orientation:`horizontal`,variant:`link`,class:{list:`border-b -mb-px`,indicator:`-bottom-px h-px`,trigger:`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:inset-x-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:-bottom-[calc(var(--spacing)+1px)] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:h-px`}},{orientation:`vertical`,variant:`pill`,class:{indicator:`inset-x-1`,list:`items-center`,trigger:`w-full justify-center`}},{orientation:`vertical`,variant:`link`,class:{list:`border-s -ms-px`,indicator:`-start-px w-px`,trigger:`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:inset-y-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:-start-[calc(var(--spacing)+1px)] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:w-px`}},{color:`primary`,variant:`pill`,class:{indicator:`bg-primary`,trigger:[`data-[state=active]:text-inverted outline-primary/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-primary`]}},{color:`secondary`,variant:`pill`,class:{indicator:`bg-secondary`,trigger:[`data-[state=active]:text-inverted outline-secondary/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-secondary`]}},{color:`success`,variant:`pill`,class:{indicator:`bg-success`,trigger:[`data-[state=active]:text-inverted outline-success/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-success`]}},{color:`info`,variant:`pill`,class:{indicator:`bg-info`,trigger:[`data-[state=active]:text-inverted outline-info/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-info`]}},{color:`warning`,variant:`pill`,class:{indicator:`bg-warning`,trigger:[`data-[state=active]:text-inverted outline-warning/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-warning`]}},{color:`error`,variant:`pill`,class:{indicator:`bg-error`,trigger:[`data-[state=active]:text-inverted outline-error/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-error`]}},{color:`neutral`,variant:`pill`,class:{indicator:`bg-inverted`,trigger:[`data-[state=active]:text-inverted outline-inverted/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-inverted`]}},{color:`primary`,variant:`link`,class:{indicator:`bg-primary`,trigger:[`data-[state=active]:text-primary outline-primary/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-primary`]}},{color:`secondary`,variant:`link`,class:{indicator:`bg-secondary`,trigger:[`data-[state=active]:text-secondary outline-secondary/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-secondary`]}},{color:`success`,variant:`link`,class:{indicator:`bg-success`,trigger:[`data-[state=active]:text-success outline-success/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-success`]}},{color:`info`,variant:`link`,class:{indicator:`bg-info`,trigger:[`data-[state=active]:text-info outline-info/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-info`]}},{color:`warning`,variant:`link`,class:{indicator:`bg-warning`,trigger:[`data-[state=active]:text-warning outline-warning/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-warning`]}},{color:`error`,variant:`link`,class:{indicator:`bg-error`,trigger:[`data-[state=active]:text-error outline-error/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-error`]}},{color:`neutral`,variant:`link`,class:{indicator:`bg-inverted`,trigger:[`data-[state=active]:text-highlighted outline-inverted/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-inverted`]}}],defaultVariants:{color:`primary`,variant:`pill`,size:`md`}},Vi={__name:`Tabs`,props:{as:{type:null,required:!1},items:{type:Array,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},orientation:{type:null,required:!1,default:`horizontal`},content:{type:Boolean,required:!1,default:!0},valueKey:{type:null,required:!1,default:`value`},labelKey:{type:null,required:!1,default:`label`},class:{type:null,required:!1},ui:{type:Object,required:!1},defaultValue:{type:[String,Number],required:!1,default:`0`},modelValue:{type:[String,Number],required:!1},activationMode:{type:String,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0}},emits:[`update:modelValue`],setup(e,{expose:t,emit:n}){let r=e,i=n,a=v(),o=se(`tabs`,r),s=x(),c=I(he(o,`as`,`unmountOnHide`),i),l=H(()=>ge({extend:Bi,...s.ui?.tabs||{}})({color:o.color,variant:o.variant,size:o.size,orientation:o.orientation})),u=N([]);function d(e,t){u.value[e]=t}return t({triggersRef:u}),(e,t)=>(R(),P(K(ft),k(K(c),{"model-value":K(o).modelValue,"default-value":K(o).defaultValue,orientation:K(o).orientation,"activation-mode":K(o).activationMode,"data-slot":`root`,class:l.value.root({class:[K(o).ui?.root,K(o).class]})}),{default:S(()=>[M(K(_t),{"data-slot":`list`,class:J(l.value.list({class:K(o).ui?.list}))},{default:S(()=>[M(K(gt),{"data-slot":`indicator`,class:J(l.value.indicator({class:K(o).ui?.indicator}))},null,8,[`class`]),F(e.$slots,`list-leading`),(R(!0),W(j,null,G(K(o).items,(t,n)=>(R(),P(K(vt),{key:K(O)(t,K(o).valueKey)??n,ref_for:!0,ref:e=>d(n,e),value:K(O)(t,K(o).valueKey)??String(n),disabled:t.disabled,"data-slot":`trigger`,class:J(l.value.trigger({class:[K(o).ui?.trigger,t.ui?.trigger]}))},{default:S(()=>[F(e.$slots,`leading`,{item:t,index:n,ui:l.value},()=>[t.icon?(R(),P(be,{key:0,name:t.icon,"data-slot":`leadingIcon`,class:J(l.value.leadingIcon({class:[K(o).ui?.leadingIcon,t.ui?.leadingIcon]}))},null,8,[`name`,`class`])):t.avatar?(R(),P(Te,k({key:1,size:t.ui?.leadingAvatarSize||K(o).ui?.leadingAvatarSize||l.value.leadingAvatarSize()},{ref_for:!0},t.avatar,{"data-slot":`leadingAvatar`,class:l.value.leadingAvatar({class:[K(o).ui?.leadingAvatar,t.ui?.leadingAvatar]})}),null,16,[`size`,`class`])):B(``,!0)]),K(O)(t,K(o).labelKey)||a.default?(R(),W(`span`,{key:0,"data-slot":`label`,class:J(l.value.label({class:[K(o).ui?.label,t.ui?.label]}))},[F(e.$slots,`default`,{item:t,index:n},()=>[L(q(K(O)(t,K(o).labelKey)),1)])],2)):B(``,!0),F(e.$slots,`trailing`,{item:t,index:n,ui:l.value},()=>[t.badge||t.badge===0?(R(),P(zi,k({key:0,color:`neutral`,variant:`outline`,size:t.ui?.trailingBadgeSize||K(o).ui?.trailingBadgeSize||l.value.trailingBadgeSize()},{ref_for:!0},typeof t.badge==`string`||typeof t.badge==`number`?{label:t.badge}:t.badge,{"data-slot":`trailingBadge`,class:l.value.trailingBadge({class:[K(o).ui?.trailingBadge,t.ui?.trailingBadge]})}),null,16,[`size`,`class`])):B(``,!0)])]),_:2},1032,[`value`,`disabled`,`class`]))),128)),F(e.$slots,`list-trailing`)]),_:3},8,[`class`]),K(o).content?(R(!0),W(j,{key:0},G(K(o).items,(t,n)=>(R(),P(K(ht),{key:K(O)(t,K(o).valueKey)??n,value:K(O)(t,K(o).valueKey)??String(n),"data-slot":`content`,class:J(l.value.content({class:[K(o).ui?.content,t.ui?.content,t.class]}))},{default:S(()=>[F(e.$slots,t.slot||`content`,{item:t,index:n,ui:l.value},()=>[L(q(t.content),1)])]),_:2},1032,[`value`,`class`]))),128)):B(``,!0)]),_:3},16,[`model-value`,`default-value`,`orientation`,`activation-mode`,`class`]))}},Hi;function Ui(){return Hi??=Ie(()=>import(`./dist-CawBR4t8.js`),__vite__mapDeps([0,1,2,3,4])),Hi}var Wi={key:0,class:`overflow-x-auto rounded-lg border border-(--ui-border) p-3 font-mono text-xs whitespace-pre text-(--ui-text)`,"data-testid":`diff-raw`},Gi=Y({__name:`FileDiffs`,props:{diff:{},theme:{},diffStyle:{}},setup(e){let t=e,n=N(null),r=N(!1),i=[],a=0;function o(){for(let e of i)try{e.cleanUp()}catch{}i=[],n.value&&(n.value.innerHTML=``)}async function s(){let e=++a;r.value=!1;try{let{FileDiff:r,parsePatchFiles:s}=await Ui();if(e!==a||!n.value)return;o();let c=s(t.diff).flatMap(e=>e.files);for(let e of c){let a=document.createElement(`diffs-container`);a.dataset.file=e.name,n.value.appendChild(a);let o=new r({themeType:t.theme,diffStyle:t.diffStyle??`unified`});o.render({fileDiff:e,fileContainer:a}),i.push(o)}}catch{e===a&&(r.value=!0)}}return E(s),C(()=>t.diff,s),C(()=>t.theme,s),C(()=>t.diffStyle,s),Se(()=>{a++,o()}),(t,i)=>r.value?(R(),W(`pre`,Wi,q(e.diff),1)):(R(),W(`div`,{key:1,ref_key:`container`,ref:n,class:`space-y-4`,"data-testid":`file-diffs`},null,512))}});async function Ki(e){let{parsePatchFiles:t}=await Ui(),n=t(e).flatMap(e=>e.files).map(e=>({path:e.name,additions:e.hunks.reduce((e,t)=>e+t.additionLines,0),deletions:e.hunks.reduce((e,t)=>e+t.deletionLines,0)}));return{files:n,additions:n.reduce((e,t)=>e+t.additions,0),deletions:n.reduce((e,t)=>e+t.deletions,0)}}function qi(e,t){if(e.length<=t)return e;let n=Math.max(1,t-1),r=Math.ceil(n/2),i=Math.floor(n/2);return`${e.slice(0,r)}…${e.slice(e.length-i)}`}var Ji={dockerfile:`docker`,makefile:`makefile`,"go.mod":`go`,"go.sum":`go`,".gitignore":`gitignore`,".dockerignore":`dockerignore`},Yi={ts:`typescript`,tsx:`tsx`,js:`javascript`,jsx:`jsx`,mjs:`javascript`,cjs:`javascript`,vue:`vue`,svelte:`svelte`,py:`python`,rb:`ruby`,go:`go`,rs:`rust`,java:`java`,kt:`kotlin`,swift:`swift`,c:`c`,h:`c`,cpp:`cpp`,cc:`cpp`,hpp:`cpp`,cs:`csharp`,php:`php`,scala:`scala`,ex:`elixir`,exs:`elixir`,json:`json`,jsonc:`json`,yaml:`yaml`,yml:`yaml`,toml:`toml`,xml:`xml`,html:`html`,css:`css`,scss:`scss`,sass:`sass`,less:`less`,md:`markdown`,mdx:`mdx`,sh:`bash`,bash:`bash`,zsh:`zsh`,sql:`sql`,tf:`terraform`,hcl:`hcl`,dockerfile:`docker`};function Xi(e){let t=(e.split(`/`).pop()||e).toLowerCase(),n=Ji[t];if(n)return n;let r=t.lastIndexOf(`.`);return r===-1?`text`:Yi[t.slice(r+1)]??`text`}var Zi={javascript:`i-simple-icons-javascript`,typescript:`i-simple-icons-typescript`,vue:`i-simple-icons-vuedotjs`,jsx:`i-simple-icons-react`,tsx:`i-simple-icons-react`,svelte:`i-simple-icons-svelte`,html:`i-simple-icons-html5`,css:`i-simple-icons-css`,scss:`i-simple-icons-sass`,sass:`i-simple-icons-sass`,less:`i-simple-icons-less`,python:`i-simple-icons-python`,go:`i-simple-icons-go`,rust:`i-simple-icons-rust`,java:`i-simple-icons-openjdk`,c:`i-simple-icons-c`,cpp:`i-simple-icons-cplusplus`,csharp:`i-simple-icons-csharp`,php:`i-simple-icons-php`,ruby:`i-simple-icons-ruby`,elixir:`i-simple-icons-elixir`,scala:`i-simple-icons-scala`,swift:`i-simple-icons-swift`,kotlin:`i-simple-icons-kotlin`,json:`i-simple-icons-json`,yaml:`i-simple-icons-yaml`,toml:`i-simple-icons-toml`,xml:`i-simple-icons-xml`,sql:`i-lucide-database`,markdown:`i-simple-icons-markdown`,mdx:`i-simple-icons-mdx`,bash:`i-simple-icons-gnubash`,zsh:`i-simple-icons-gnubash`,docker:`i-simple-icons-docker`,dockerignore:`i-simple-icons-docker`,terraform:`i-simple-icons-terraform`,hcl:`i-simple-icons-terraform`,makefile:`i-lucide-hammer`,gitignore:`i-simple-icons-git`,text:`i-lucide-file-text`};function Qi(e){return Zi[e]??Zi.text}function $i(e){return Qi(Xi(e))}var ea={key:0,class:`flex items-center gap-2 p-4 text-sm text-(--ui-text-muted) sm:p-5`,"data-testid":`files-loading`},ta={key:1,class:`p-4 text-sm text-(--ui-text-muted) sm:p-5`,"data-testid":`no-files`},na={class:`shrink-0 border-b border-(--ui-border) @2xl:w-72 @2xl:border-b-0 @2xl:border-r`,"data-testid":`file-list`},ra={class:`@2xl:sticky @2xl:top-0 @2xl:max-h-[calc(100dvh-11rem)] @2xl:overflow-y-auto @2xl:py-3`},ia=[`aria-expanded`],aa={class:`ml-auto tabular-nums`,"data-testid":`pr-totals`},oa={class:`text-(--ui-success)`},sa={class:`text-(--ui-error)`},ca={key:1,class:`flex items-center justify-between gap-2 px-3 pb-2 text-xs text-(--ui-text-dimmed)`},la={"data-testid":`file-count`},ua={class:`tabular-nums`,"data-testid":`pr-totals`},da={class:`text-(--ui-success)`},fa={class:`text-(--ui-error)`},pa=[`title`,`aria-current`,`onClick`],ma={class:`min-w-0 flex-1 whitespace-nowrap`},ha={class:`shrink-0 text-[11px] tabular-nums`},ga={class:`text-(--ui-success)`},_a={class:`text-(--ui-error)`},va=34,ya=Y({__name:`FilesChanged`,props:{diff:{},notes:{},diffStyle:{}},setup(e){let t=e,n=ie(),r=H(()=>n.value===`dark`?`dark`:`light`),i=N([]),a=N(!0),o=N(null),s=T(`panel`),c=T(`root`),{width:l}=pe(c);C(c,e=>{e&&(l.value=e.getBoundingClientRect().width)});let u=H(()=>l.value>0&&l.value<672),d=N(!1),f=H(()=>u.value?`unified`:t.diffStyle??`unified`),p=0;async function m(){let e=++p;a.value=!0;let n=await Ki(t.diff);e===p&&(i.value=n.files,o.value=null,a.value=!1)}C(()=>t.diff,m,{immediate:!0});let h=H(()=>i.value.reduce((e,t)=>({additions:e.additions+t.additions,deletions:e.deletions+t.deletions}),{additions:0,deletions:0}));function g(e){o.value=e,u.value&&(d.value=!1);let t=s.value?.querySelectorAll(`[data-file]`)??[];Array.from(t).find(t=>t.dataset.file===e)?.scrollIntoView({block:`start`,behavior:`smooth`})}return(t,n)=>{let l=be;return a.value?(R(),W(`div`,ea,[M(l,{name:`i-lucide-loader-circle`,class:`size-4 animate-spin`}),n[1]||=U(`span`,null,`Loading diff…`,-1)])):i.value.length===0?(R(),W(`p`,ta,` Nothing in this diff parsed as a file. `)):(R(),W(`div`,{key:2,ref_key:`root`,ref:c,class:`@container flex min-h-full flex-col @2xl:flex-row`,"data-testid":`files-changed`},[U(`aside`,na,[U(`div`,ra,[u.value?(R(),W(`button`,{key:0,type:`button`,class:`flex w-full items-center gap-2 px-3 py-2.5 text-xs text-(--ui-text-muted)`,"aria-expanded":d.value,"data-testid":`files-fold`,onClick:n[0]||=e=>d.value=!d.value},[M(l,{name:d.value?`i-lucide-chevron-down`:`i-lucide-chevron-right`,class:`size-3.5 shrink-0 text-(--ui-text-dimmed)`},null,8,[`name`]),U(`span`,null,q(i.value.length)+` `+q(i.value.length===1?`file`:`files`)+` changed`,1),U(`span`,aa,[U(`span`,oa,`+`+q(h.value.additions),1),U(`span`,sa,`−`+q(h.value.deletions),1)])],8,ia)):(R(),W(`div`,ca,[U(`span`,la,q(i.value.length)+` `+q(i.value.length===1?`file`:`files`),1),U(`span`,ua,[U(`span`,da,`+`+q(h.value.additions),1),U(`span`,fa,`−`+q(h.value.deletions),1)])])),!u.value||d.value?(R(),W(`ul`,{key:2,class:J([`flex flex-col`,u.value?`pb-2`:``])},[(R(!0),W(j,null,G(i.value,e=>(R(),W(`li`,{key:e.path},[U(`button`,{type:`button`,class:J([`flex w-full min-w-0 items-center gap-2 px-3 py-1.5 text-left text-xs transition-colors hover:bg-accented/50 dark:hover:bg-(--ui-bg)`,o.value===e.path?`bg-accented/50 text-(--ui-text) dark:bg-(--ui-bg)`:`text-(--ui-text-muted)`]),title:e.path,"aria-current":o.value===e.path?`true`:void 0,"data-testid":`file-entry`,onClick:t=>g(e.path)},[M(l,{name:K($i)(e.path),class:`size-3.5 shrink-0`},null,8,[`name`]),U(`span`,ma,q(K(qi)(e.path,va)),1),U(`span`,ha,[U(`span`,ga,`+`+q(e.additions),1),U(`span`,_a,`−`+q(e.deletions),1)])],10,pa)]))),128))],2)):B(``,!0)])]),U(`div`,{ref_key:`panel`,ref:s,class:`min-w-0 flex-1 overflow-x-auto`,"data-testid":`diff-column`},[(R(!0),W(j,null,G(e.notes,e=>(R(),W(`p`,{key:e,class:`px-3 pt-3 text-xs text-(--ui-text-muted)`,"data-testid":`diff-note`},q(e),1))),128)),M(Gi,{diff:e.diff,theme:r.value,"diff-style":f.value},null,8,[`diff`,`theme`,`diff-style`])],512)],512))}}}),ba=Y({__name:`LabelTip`,props:{text:{},disabled:{type:Boolean,default:!1}},setup(e){return(t,n)=>{let r=Pe;return R(),P(r,{text:e.text,disabled:e.disabled,"delay-duration":250,content:{side:`bottom`,align:`end`,sideOffset:6,collisionPadding:8},ui:{content:`h-auto max-w-[28rem] px-2.5 py-1.5`,text:`text-clip whitespace-normal leading-snug`}},{default:S(()=>[F(t.$slots,`default`)]),_:3},8,[`text`,`disabled`])}}}),xa={class:`pr-review-panel @container flex h-full min-h-0 min-w-0 flex-col`,"data-testid":`pr-review-panel`},Sa={class:`shrink-0 border-b border-(--ui-border) px-4 pt-5 pb-4 sm:px-6`},Ca={class:`flex flex-col gap-3 @2xl:flex-row @2xl:items-start @2xl:justify-between @2xl:gap-4`},wa={class:`min-w-0`},Ta={class:`line-clamp-2 text-lg leading-snug font-semibold text-(--ui-text) @2xl:line-clamp-none @2xl:truncate`,"data-testid":`pr-title`},Ea={class:`mt-1.5 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-(--ui-text-muted)`,"data-testid":`pr-facts`},Da=[`href`],Oa={key:1,class:`inline-flex items-center gap-1.5`},ka=[`href`],Aa={title:`the base the diff is against`},ja={"data-testid":`producer-label`},Ma={class:`inline-flex items-center gap-1 text-(--ui-warning)`,"data-testid":`truncated-label`},Na={class:`flex shrink-0 flex-wrap items-center gap-2`},Pa={key:1,class:`inline-flex shrink-0 items-center gap-1.5 text-xs text-(--ui-text-muted)`,"data-testid":`abridge-running`},Fa={key:2,class:`inline-flex min-w-0 shrink items-center gap-1.5 text-xs text-(--ui-error)`,"data-testid":`abridge-failed`},Ia=[`title`],La={key:0,class:`flex shrink-0 items-center justify-between gap-3 border-b border-(--ui-border) px-4 py-2 sm:px-6`},Ra={class:`tabs-scroll min-w-0 overflow-x-auto`},za={class:`min-h-0 flex-1 overflow-y-auto`},Ba={key:1,class:`mx-auto max-w-3xl p-4 sm:p-6`,"data-testid":`pr-description`},Va={key:2,class:`mt-4 text-xs text-(--ui-text-dimmed) italic`,"data-testid":`description-origin`},Ha={key:2,class:`px-4 py-3 text-sm text-(--ui-text-muted) sm:px-6`,"data-testid":`no-diff`},Ua=`switchboard:diffStyle`,Wa=`Abridge the full diff with meat.dev: a model keeps the concepts and drops what a reviewer need not read. One model call; usually a minute or three.`,Ga=Y({__name:`PrReviewPanel`,props:{data:{},closable:{type:Boolean,default:!1},abridge:{default:void 0}},emits:[`close`],setup(e,{emit:t}){let n=e,r=t,i=H(()=>Si(n.data.pr)),a=H(()=>yi(n.data)),o=H(()=>n.data.readingDiffs),s=H(()=>n.data.description),c=H(()=>o.value.find(e=>e.poweredBy===`git`)),l=H(()=>o.value.find(e=>e.poweredBy===`meat`)),u=H(()=>n.data.pr.headSha?.slice(0,7)),d=H(()=>{let e=[];return c.value&&e.push({label:`Files changed`,value:`files`}),l.value&&e.push({label:`Reading diff`,value:`reading`}),(s.value?.tldr||s.value?.whatWhy)&&e.push({label:`Description`,value:`description`}),e}),f=()=>Ci(o.value)?.poweredBy===`meat`?`reading`:`files`,p=N(f());C(()=>Ci(o.value),()=>p.value=f()),C(d,e=>{e.some(e=>e.value===p.value)||(p.value=e[0]?.value??`files`)},{immediate:!0});let m=H(()=>p.value===`files`?c.value:p.value===`reading`?l.value:void 0),h=H(()=>{let e=m.value;if(!e)return[];let t=[];return e.summary&&t.push(e.summary),e.truncated&&t.push(`${Ti(e.diff.length)}.`),t}),g=H(()=>s.value?Di(s.value):void 0),_=[{label:`Inline`,value:`unified`,icon:`i-lucide-rows-3`},{label:`Side by side`,value:`split`,icon:`i-lucide-columns-2`}],v=N(`unified`);E(()=>{try{localStorage.getItem(Ua)===`split`&&(v.value=`split`)}catch{}});function y(e){v.value=e===`split`?`split`:`unified`;try{localStorage.setItem(Ua,v.value)}catch{}}let b=H(()=>n.abridge!==void 0&&n.abridge.state.state!==`done`&&c.value!==void 0&&!l.value);return(t,n)=>{let o=be,c=ce,l=Vi;return R(),W(`div`,xa,[U(`header`,Sa,[U(`div`,Ca,[U(`div`,wa,[U(`h1`,Ta,q(a.value),1),U(`div`,Ea,[i.value.pr?(R(),W(`a`,{key:0,href:i.value.pr,target:`_blank`,rel:`noopener noreferrer`,class:`inline-flex items-center gap-1.5 hover:text-(--ui-text)`,"data-testid":`pr-link`},[M(o,{name:`i-simple-icons-github`,class:`size-3.5 shrink-0`}),U(`span`,null,q(e.data.pr.repo)+`#`+q(e.data.pr.number),1)],8,Da)):e.data.pr.repo?(R(),W(`span`,Oa,[M(o,{name:`i-simple-icons-github`,class:`size-3.5 shrink-0`}),U(`span`,null,q(e.data.pr.repo),1)])):B(``,!0),i.value.commit?(R(),W(`a`,{key:2,href:i.value.commit,target:`_blank`,rel:`noopener noreferrer`,class:`font-mono hover:text-(--ui-text)`,"data-testid":`commit-link`},q(u.value),9,ka)):B(``,!0),m.value?(R(),W(j,{key:3},[U(`span`,Aa,`against origin/`+q(m.value.baseRef),1),M(ba,{text:K(wi)(m.value.poweredBy)},{default:S(()=>[U(`span`,ja,q(K(Ei)(m.value.poweredBy)),1)]),_:1},8,[`text`]),m.value.truncated?(R(),P(ba,{key:0,text:K(Ti)(m.value.diff.length)},{default:S(()=>[U(`span`,Ma,[M(o,{name:`i-lucide-scissors`,class:`size-3.5`}),n[4]||=L(`truncated `,-1)])]),_:1},8,[`text`])):B(``,!0)],64)):B(``,!0)])]),U(`div`,Na,[i.value.pr?(R(),P(c,{key:0,label:`View on GitHub`,icon:`i-simple-icons-github`,color:`neutral`,variant:`ghost`,size:`sm`,to:i.value.pr,target:`_blank`,"data-testid":`github-button`},null,8,[`to`])):B(``,!0),b.value&&e.abridge?(R(),W(j,{key:1},[e.abridge.state.state===`absent`?(R(),P(ba,{key:0,text:Wa},{default:S(()=>[M(c,{label:`Abridge with meat`,icon:`i-lucide-scissors`,size:`sm`,"data-testid":`abridge-button`,onClick:n[0]||=t=>e.abridge.start()})]),_:1})):e.abridge.state.state===`running`?(R(),W(`span`,Pa,[M(o,{name:`i-lucide-loader-circle`,class:`size-3.5 animate-spin`}),n[5]||=L(` Abridging… usually 1–3 minutes `,-1)])):e.abridge.state.state===`failed`?(R(),W(`span`,Fa,[M(o,{name:`i-lucide-circle-alert`,class:`size-3.5 shrink-0`}),U(`span`,{class:`truncate`,title:e.abridge.state.reason},`Abridging failed: `+q(e.abridge.state.reason),9,Ia),M(c,{size:`xs`,color:`neutral`,variant:`outline`,label:`Retry`,"data-testid":`abridge-retry`,onClick:n[1]||=t=>e.abridge.start()})])):B(``,!0)],64)):B(``,!0),e.closable?(R(),P(c,{key:2,icon:`i-lucide-x`,color:`neutral`,variant:`ghost`,size:`sm`,"aria-label":`Close`,"data-testid":`panel-close`,onClick:n[2]||=e=>r(`close`)})):B(``,!0)])])]),d.value.length>0?(R(),W(`div`,La,[U(`div`,Ra,[M(l,{modelValue:p.value,"onUpdate:modelValue":n[3]||=e=>p.value=e,items:d.value,size:`sm`,class:`w-fit gap-0`,content:!1,"data-testid":`panel-tabs`},null,8,[`modelValue`,`items`])]),m.value?(R(),P(l,{key:0,"model-value":v.value,items:_,color:`neutral`,size:`xs`,content:!1,class:`hidden w-fit @2xl:flex`,"data-testid":`diff-style`,"onUpdate:modelValue":y},null,8,[`model-value`])):B(``,!0)])):B(``,!0),U(`div`,za,[m.value?(R(),P(ya,{key:m.value.poweredBy,diff:m.value.diff,notes:h.value,"diff-style":v.value},null,8,[`diff`,`notes`,`diff-style`])):p.value===`description`&&s.value?(R(),W(`div`,Ba,[n[7]||=U(`div`,{class:`mb-2 text-xs font-medium text-(--ui-text-dimmed)`},`What the pull request says about itself`,-1),s.value.tldr?(R(),P($,{key:0,text:s.value.tldr,class:`text-sm`,"data-testid":`description-tldr`},null,8,[`text`])):B(``,!0),s.value.whatWhy?(R(),W(j,{key:1},[n[6]||=U(`div`,{class:`mt-4 mb-2 text-xs font-medium text-(--ui-text-dimmed)`},`What & why`,-1),M($,{text:s.value.whatWhy,class:`text-sm`,"data-testid":`description-what-why`},null,8,[`text`])],64)):B(``,!0),g.value?(R(),W(`p`,Va,q(g.value),1)):B(``,!0)])):(R(),W(`p`,Ha,` No reading diff was produced for this review. `))])])}}}),Ka={class:`conn flex items-center gap-2 font-mono`},qa={key:0,class:`ok text-ok`,role:`img`,"aria-label":`succeeded`},Ja=[`data-heat`],Ya={key:2,id:`delivery`,class:`text-xs text-muted`},Xa=[`title`],Za={key:0,id:`actions`,class:`actions flex gap-1.5`},Qa={class:`mx-auto max-w-6xl`},$a={key:0,id:`runmeta`,class:`runmeta facts mb-3 flex flex-wrap items-baseline gap-x-3 gap-y-1.5 px-(--sb-gutter) font-mono text-xs text-dimmed`},eo={class:`agent text-[0.68rem] font-medium uppercase tracking-wider text-toned`},to={class:`model`},no={key:0,class:`effort`},ro=[`href`],io={key:2,class:`repo`},ao=[`href`],oo={key:4,class:`reftag rounded border border-accented px-1.5 text-[0.75rem] text-toned`},so=[`href`,`title`],co=[`href`],lo={key:1,id:`request`,class:`block mb-4 rounded-lg border border-default bg-(--ui-bg-muted) px-(--sb-gutter) py-3`},uo={class:`mb-2 flex items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},fo={key:0,class:`source flex items-center gap-2 font-normal normal-case tracking-normal text-dimmed`},po=[`href`],mo={key:1},ho={key:1},go=[`title`],_o={key:3,id:`context`,class:`group mb-4 px-(--sb-gutter)`},vo={class:`flex min-h-6 cursor-pointer list-none items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted hover:text-toned [&::-webkit-details-marker]:hidden`},yo={class:`count font-normal normal-case tracking-normal text-dimmed`},bo={id:`contextturns`,class:`pb-1 pl-5`},xo=[`title`],So={id:`thisrun`,class:`mb-2 flex items-baseline gap-2.5 px-(--sb-gutter) font-mono text-xs font-medium uppercase tracking-wider text-muted`},Co={key:0,class:`count font-normal normal-case tracking-normal text-dimmed`},wo=[`aria-pressed`,`data-open`,`title`],To={id:`log`,class:`m-0 list-none p-0`},Eo={key:0,id:`placeholder`,class:`empty text-muted`},Do=[`id`],Oo={class:`meta flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5 pr-(--sb-gutter) font-mono text-xs tabular-nums text-dimmed`},ko=[`title`],Ao=[`title`],jo=[`title`],Mo={key:2,class:`nonar font-sans italic`},No=[`title`],Po=[`data-phase`],Fo=[`aria-expanded`,`onClick`],Io={class:`glyph select-none text-dimmed`},Lo={class:`what`},Ro={key:0,class:`m-0 list-none p-0 pl-4`},zo={key:4,class:`followup block mt-5 rounded-lg border border-default bg-(--ui-bg-muted) px-(--sb-gutter) py-3`},Bo={class:`mb-2 flex items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},Vo={key:0,class:`source flex items-center gap-2 font-normal normal-case tracking-normal text-dimmed`},Ho=[`href`],Uo={key:1},Wo=[`title`],Go=[`title`],Ko={key:1,id:`thinking`,class:`pending ml-3.5 mt-5 flex items-center gap-3 rounded-md border border-dashed border-accented pl-3 pr-[calc(var(--sb-gutter)-1px)] py-2 text-sm first:mt-0`,"aria-live":`off`,title:`the model is working on its next turn — nothing back yet (since the last event, runner clock)`},qo=[`title`],Jo={class:`verb min-w-0 truncate text-toned`},Yo=Y({__name:`RunPage`,setup(e){let t=Ee(`run`),n=t?.mode===`history`,r=n?`Run`:`Live run`,i=n,a=typeof window<`u`?new URLSearchParams(window.location.search).get(`open`):null,o=gn({openTags:a?a.split(`,`).map(e=>e.trim()).filter(Boolean):void 0}),s=o.state,l=N(n?`ended`:`connecting`),u=N(``),d=Re(),p=t?.mode===`live`?vn(t,d.value):null,m=N(void 0),h=N({}),g=H(()=>{if(n&&t?.mode===`history`)return t.status===`completed`?{ok:!0,cls:``,word:`succeeded`}:{ok:!1,cls:t.status===`failed`||t.status===`stopped_hard`||t.status===`interrupted`?`red`:t.status===`stopped_soft`?`amber`:`grey`,word:t.status?Ge(t.status):`ended`};let e=s.stopMode;return{ok:!1,cls:e===`hard`?`red`:e===`soft`?`amber`:`grey`,word:e===`hard`?`killed`:e===`soft`?`stopped early`:`ended`}}),v=H(()=>n&&t?.mode===`history`?t.durationMs:m.value),b=H(()=>bn(n&&t?.mode===`history`?{finishedAt:t.finishedAt,sealedAt:t.sealedAt,replyOk:t.replyOk}:h.value)),ee=H(()=>v.value===void 0?``:X(v.value,`clock`)),x=H(()=>We(v.value,`run`)),te=H(()=>qe(x.value)),w={red:`border-bad/30 text-bad`,amber:`border-warn/30 text-warn`,grey:`border-accented text-muted`},T=H(()=>u.value?u.value:l.value===`connecting`?`connecting…`:l.value===`disconnected`?`disconnected`:l.value===`stopping`?`stopping (${s.stopMode??`soft`})`:l.value===`finished`?m.value===void 0?`delivering…`:`delivering… · ${X(m.value,`clock`)}`:p?`running · ${X(p.elapsedMs(d.value),`clock`)}`:`running`),ne=H(()=>u.value||l.value===`disconnected`?`text-bad`:l.value===`running`?`text-ok motion-safe:animate-pulse`:l.value===`finished`?`text-ok`:`text-warn motion-safe:animate-pulse`),re=H(()=>{if(!t||t.mode!==`live`&&t.mode!==`history`)return null;s.traceVersion;let e=t.receivedAt??t.startedAt,n=vi(s.meta?.agent);if(t.mode===`history`){let r=t.durationMs??(t.finishedAt===void 0?0:Math.max(0,t.finishedAt-e));return si({spans:o.spanSet(),losses:o.losses(e),window:{start:e,end:e+r},owner:n,totalMs:r,phase:`ended`,delivery:{finishedAt:t.finishedAt,sealedAt:t.sealedAt,replyOk:t.replyOk},...t.truncated===void 0?{}:{truncated:t.truncated},...t.untimed?{untimed:!0}:{},callTitle:o.callHeadline})}if(!p)return null;let r=l.value===`ended`?`ended`:l.value===`finished`?`delivering`:`live`,i=r===`live`?p.elapsedMs(d.value):m.value??p.elapsedMs(d.value);return si({spans:o.spanSet(),losses:o.losses(e),window:{start:e,end:e+i},owner:n,totalMs:i,phase:r,delivery:h.value,callTitle:o.callHeadline})}),ie=n&&t?.mode===`history`?`/runs/${encodeURIComponent(t.id)}/events`:void 0;function ae(e){o.reveal(e)&&y().then(()=>{let t=document.getElementById(e);t&&(t.scrollIntoView?.({block:`center`}),t.classList.add(`revealed`),setTimeout(()=>t.classList.remove(`revealed`),1500))})}let D=N(n),O=N(!1);function oe(e){t?.mode===`live`&&(e!==`hard`||c.confirm(`Hard stop: abort the run now with no summary and free its sandbox?`))&&(O.value=!0,fetch(`${t.stopUrl}&mode=${encodeURIComponent(e)}`,{method:`POST`,credentials:`same-origin`}).then(t=>{if(!t.ok)throw Error(`HTTP ${t.status}`);k(e)}).catch(e=>{O.value=!1,u.value=`stop failed: ${e instanceof Error?e.message:`error`}`}))}function k(e){o.markStopping(e),D.value=!0,(l.value===`connecting`||l.value===`running`)&&(l.value=`stopping`)}C(()=>s.stopMode,e=>{e&&l.value!==`ended`&&l.value!==`disconnected`&&l.value!==`finished`&&k(e)}),n||C(l,e=>c.setFavicon(e===`ended`||e===`disconnected`||e===`finished`?Ye:Je),{immediate:!0});let se=H(()=>!n&&l.value!==`ended`&&l.value!==`disconnected`&&l.value!==`finished`),le=H(()=>se.value?_n(s,d.value):null);we(Sn,le);let ue=H(()=>se.value?En(s,o.pendingCall(),d.value):null),de=[`Thinking`,`Pondering`,`Mulling it over`,`Reasoning`,`Cogitating`,`Weighing options`,`Puzzling`,`Deliberating`,`Noodling`,`Chewing on it`,`Ruminating`,`Reticulating splines`],fe=H(()=>ue.value?.kind===`thinking`?re.value?.openStep||de[Math.floor(ue.value.elapsedMs/6e3)%de.length]:``);function F(){o.setAllOpen(!s.allOpen)}let pe=H(()=>s.log.filter(e=>e.kind===`step`).length),me=N(null);function he(){return window.innerHeight+window.scrollY>=document.body.scrollHeight-60}let I=Pi(),ge=N(!1),_e=t?.mode===`history`&&t.capabilities.readingDiffAbridge?Li(t.id,e=>I.handle(e)):void 0;Se(()=>_e?.dispose());function ve(e){let t=he();o.handle(e),I.handle(e),t&&requestAnimationFrame(()=>me.value?.scrollIntoView?.({block:`nearest`}))}let ye=Ue(),z=null;if(t?.mode===`history`){for(let e of t.events)o.handle(e),I.handle(e);o.closePhases()}E(()=>{if(t?.mode!==`live`)return;z=ye(t.eventsUrl),z.onopen=()=>{s.stopMode||(l.value=`running`)};let e=0;z.onmessage=t=>{let n;try{n=JSON.parse(t.data)}catch{return}if(n.type!==`replay_note`){let n=Number(t.lastEventId);if(n>0){if(n<=e)return;e=n}}ve(n)},z.addEventListener(`replay_elided`,e=>{let t=un(e);t&&o.noteElided(t)}),z.addEventListener(`finished`,e=>{let t=xn(e);t&&p&&(m.value=p.elapsedAt(t.finishedAt)),t&&(h.value={...h.value,finishedAt:t.finishedAt}),D.value=!0,(l.value===`connecting`||l.value===`running`)&&(l.value=`finished`)}),z.addEventListener(`end`,e=>{o.flushPendingTurn(`the run ended here`),o.closePhases(),D.value=!0,m.value??=p?.elapsedMs(d.value),h.value={...h.value,...yn(e)},l.value=`ended`,z?.close()}),z.onerror=()=>{z&&z.readyState===2&&(l.value=`disconnected`)}}),Se(()=>{z?.close()});function xe(e){return e&&/^https?:\/\//.test(e)?e:``}let Ce=H(()=>xe(s.request?.source?.url)),V=H(()=>{let e=s.meta;return{repo:en(e?.repo),tree:nn(e?.repo,e?.ref),commit:rn(e?.repo,e?.headSha),pr:tn(e?.repo,e?.pr)}}),Te=H(()=>mn({meta:s.meta,requestText:s.request?.text??``,prOpened:s.prOpened}));function De(e){return typeof e==`number`?Be(e,d.value):``}function Oe(e){return typeof e==`number`?Z(e):void 0}return(e,t)=>{let n=ce,a=Pe,c=be,d=St;return R(),P(f,{title:K(r),nav:`runs`},{leading:S(()=>[...t[4]||=[U(`a`,{class:`back text-sm text-primary no-underline hover:underline`,href:`/runs`},`← All runs`,-1)]]),status:S(()=>[U(`span`,Ka,[l.value===`ended`?(R(),W(j,{key:0},[g.value.ok?(R(),W(`span`,qa,`✓`)):(R(),W(`span`,{key:1,class:J([`chip rounded border px-1.5 text-[0.7rem]`,w[g.value.cls]])},q(g.value.word),3)),U(`span`,{id:`state`,class:J([`dur text-xs tabular-nums`,[te.value?`heat`:`text-muted`,x.value.level>=2?`font-medium`:``]]),style:_(te.value),"data-heat":x.value.level},q(ee.value),15,Ja),b.value?(R(),W(`span`,Ya,`· `+q(b.value),1)):B(``,!0)],64)):(R(),W(j,{key:1},[U(`span`,{id:`statedot`,class:J([`pulse text-[1.1em] leading-none`,ne.value])},`∿`,2),U(`span`,{id:`state`,class:J([`text-xs tabular-nums`,u.value?`text-bad`:`text-muted`]),title:l.value===`running`&&!u.value?`the whole run, since we received the message`:l.value===`finished`?`the agent stopped; the reply is being posted`:void 0},q(T.value),11,Xa)],64))])]),actions:S(()=>[D.value?B(``,!0):(R(),W(`span`,Za,[M(a,{text:`Soft stop: no new steps, the agent writes up what it has`},{default:S(()=>[M(n,{size:`xs`,color:`neutral`,variant:`outline`,label:`Stop`,disabled:O.value,onClick:t[0]||=e=>oe(`soft`)},null,8,[`disabled`])]),_:1}),M(a,{text:`Hard stop: abort now, no summary, free the sandbox`},{default:S(()=>[M(n,{size:`xs`,color:`error`,variant:`outline`,label:`Kill`,disabled:O.value,onClick:t[1]||=e=>oe(`hard`)},null,8,[`disabled`])]),_:1})]))]),default:S(()=>[U(`div`,Qa,[K(s).meta?(R(),W(`div`,$a,[U(`span`,eo,q(K(s).meta.agent),1),U(`span`,to,q(K(s).meta.model),1),K(s).meta.effort?(R(),W(`span`,no,q(K(s).meta.effort)+` effort`,1)):B(``,!0),V.value.repo?(R(),W(`a`,{key:1,class:`text-primary no-underline hover:underline`,href:V.value.repo,target:`_blank`,rel:`noopener noreferrer`},q(K(s).meta.repo),9,ro)):K(s).meta.repo?(R(),W(`span`,io,q(K(s).meta.repo),1)):B(``,!0),V.value.tree?(R(),W(`a`,{key:3,class:`reftag rounded border border-accented px-1.5 text-[0.75rem] text-toned no-underline hover:border-primary hover:text-primary`,href:V.value.tree,target:`_blank`,rel:`noopener noreferrer`,title:`the branch on GitHub`},q(K(s).meta.ref),9,ao)):K(s).meta.ref?(R(),W(`span`,oo,q(K(s).meta.ref),1)):B(``,!0),V.value.commit&&K(s).meta.headSha?(R(),W(`a`,{key:5,class:`sha tabular-nums text-toned no-underline hover:text-primary hover:underline`,href:V.value.commit,target:`_blank`,rel:`noopener noreferrer`,title:`the head commit ${K(s).meta.headSha}`},q(K(an)(K(s).meta.headSha)),9,so)):B(``,!0),V.value.pr?(R(),W(`a`,{key:6,class:`prlink whitespace-nowrap text-primary no-underline hover:underline`,href:V.value.pr,target:`_blank`,rel:`noopener noreferrer`},[M(Mt,{class:`mr-1 align-[-0.125em]`}),L(`#`+q(K(s).meta.pr),1)],8,co)):B(``,!0),K(I).state.ready?(R(),W(`button`,{key:7,type:`button`,class:`reading-diff ml-auto inline-flex cursor-pointer items-center gap-1 whitespace-nowrap text-primary hover:underline focus-visible:outline-2 focus-visible:outline-primary`,"data-testid":`reading-diff-button`,onClick:t[2]||=e=>ge.value=!0},[M(c,{name:`i-lucide-git-compare`,class:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[5]||=L(` Reading diff `,-1)])):B(``,!0)])):B(``,!0),K(s).request?(R(),W(`section`,lo,[U(`h2`,uo,[t[6]||=U(`span`,null,`Request`,-1),K(s).request.source?(R(),W(`span`,fo,[K(s).request.source.channel?(R(),W(j,{key:0},[M(Ke),Ce.value?(R(),W(`a`,{key:0,class:`text-muted no-underline hover:text-primary hover:underline`,href:Ce.value,target:`_blank`,rel:`noopener noreferrer`,title:`open the thread`},`#`+q(K(s).request.source.channel),9,po)):(R(),W(`span`,mo,`#`+q(K(s).request.source.channel),1))],64)):B(``,!0),K(s).request.source.user?(R(),W(`span`,ho,q(K(s).request.source.user),1)):B(``,!0)])):B(``,!0),U(`span`,{class:`ts ml-auto select-none text-xs font-normal normal-case tracking-normal text-dimmed`,title:Oe(K(s).request.at)},q(De(K(s).request.at)),9,go)]),M(Dt,{lines:3},{default:S(()=>[M($,{text:K(s).request.text},null,8,[`text`])]),_:1})])):B(``,!0),K(s).reply&&K(i)?(R(),P(Jr,{key:2,position:`first`,text:K(s).reply.text,caption:Te.value,when:De(K(s).reply.at),"when-title":Oe(K(s).reply.at)},null,8,[`text`,`caption`,`when`,`when-title`])):B(``,!0),K(s).context.length>0?(R(),W(`details`,_o,[U(`summary`,vo,[t[7]||=U(`span`,{class:`chev select-none text-xs text-dimmed transition-transform group-open:rotate-90 motion-reduce:transition-none`},`❯`,-1),t[8]||=U(`span`,null,`Earlier in this thread`,-1),U(`span`,yo,`· `+q(K(s).context.length)+` turn`+q(K(s).context.length===1?``:`s`),1)]),U(`div`,bo,[(R(!0),W(j,null,G(K(s).context,e=>(R(),W(`div`,{key:e.key,class:`turn flex items-baseline gap-3 border-t border-default py-1.5 opacity-85 first-of-type:border-t-0`},[M($,{text:e.text},null,8,[`text`]),U(`span`,{class:`ts ml-auto shrink-0 select-none font-mono text-xs text-dimmed`,title:Oe(e.at)},q(De(e.at)),9,xo)]))),128))])])):B(``,!0),U(`h2`,So,[t[9]||=U(`span`,null,`This run`,-1),pe.value>0?(R(),W(`span`,Co,`· `+q(pe.value)+` step`+q(pe.value===1?``:`s`),1)):B(``,!0),U(`button`,{id:`fold`,type:`button`,class:`ml-auto cursor-pointer font-normal normal-case tracking-normal text-dimmed hover:text-toned focus-visible:outline-2 focus-visible:outline-primary`,"aria-pressed":K(s).allOpen?`true`:`false`,"data-open":K(s).allOpen?`1`:`0`,title:K(s).allOpen?`Close every call card`:`Open every call card`,onClick:F},q(K(s).allOpen?`Collapse all`:`Expand all`),9,wo)]),re.value?(R(),P(Hr,{key:4,vm:re.value,"events-href":K(ie),onReveal:ae},null,8,[`vm`,`events-href`])):B(``,!0),U(`ol`,To,[K(s).placeholder?(R(),W(`li`,Eo,`Waiting for activity…`)):B(``,!0),(R(!0),W(j,null,G(K(s).log,e=>(R(),W(j,{key:e.key},[e.kind===`step`?(R(),P(mr,{key:0,step:e,class:`mt-5 first:mt-0`,onToggleGroup:t=>K(o).toggleGroup(e)},null,8,[`step`,`onToggleGroup`])):e.kind===`turn`?(R(),W(`li`,{key:1,id:`span-${e.turn.spanId}`,class:`turn mt-5 border-l-2 border-(--ui-border-accented)/50 pb-3 pl-3 pt-2`},[U(`div`,Oo,[U(`span`,{class:J([`thought`,e.turn.quick?``:`text-warn`]),title:e.turn.label},`thought `+q(e.turn.chip),11,ko),e.turn.switched?(R(),W(`span`,{key:0,class:`model-switch order-first rounded border border-warn/40 bg-warn/10 px-1.5 font-medium text-warn`,title:`model changed: this turn ran on ${e.turn.model}`},`⇄ `+q(K(wn)(e.turn.model)),9,Ao)):e.turn.showModel?(R(),W(`span`,{key:1,class:`model-badge order-first rounded bg-accented px-1.5 text-[0.68rem] font-medium leading-normal tracking-wider text-muted`,title:e.turn.model},q(K(wn)(e.turn.model)),9,jo)):B(``,!0),(R(!0),W(j,null,G(e.turn.facts,(e,t)=>(R(),W(`span`,{key:t,class:`fact`},q(e),1))),128)),e.note?(R(),W(`span`,Mo,q(e.note),1)):B(``,!0),e.turn.at===void 0?B(``,!0):(R(),W(`span`,{key:3,class:`ts ml-auto select-none`,title:K(Z)(e.turn.at)},q(K(yt)(e.turn.at)),9,No))])],8,Do)):e.kind===`span`?(R(),P(br,{key:2,item:e},null,8,[`item`])):e.kind===`phase`?(R(),W(`li`,{key:3,class:`phase py-0.5 font-mono text-xs`,"data-phase":e.phase},[U(`button`,{type:`button`,class:`phase-head flex w-full cursor-pointer items-baseline gap-2 text-left text-muted hover:text-toned`,"aria-expanded":e.open,onClick:A(t=>K(o).togglePhase(e),[`prevent`])},[U(`span`,Io,q(e.open?`▾`:`▸`),1),U(`span`,{class:J([`swatch inline-block size-2 shrink-0 self-center rounded-[2px]`,K(Cr)(e.phase)]),"aria-hidden":`true`},null,2),U(`span`,Lo,q(K(ln)(e)),1)],8,Fo),e.open?(R(),W(`ul`,Ro,[(R(!0),W(j,null,G(e.rows,e=>(R(),P(br,{key:e.key,item:e},null,8,[`item`]))),128))])):B(``,!0)],8,Po)):e.kind===`followup`?(R(),W(`li`,zo,[U(`h2`,Bo,[t[10]||=U(`span`,null,`↪ Follow-up`,-1),e.input.source?.user?(R(),W(`span`,Vo,[xe(e.input.source.url)?(R(),W(`a`,{key:0,class:`text-muted no-underline hover:text-primary hover:underline`,href:e.input.source.url,target:`_blank`,rel:`noopener noreferrer`,title:`open the message`},q(e.input.source.user),9,Ho)):(R(),W(`span`,Uo,q(e.input.source.user),1))])):B(``,!0),U(`span`,{class:`ts ml-auto select-none text-xs font-normal normal-case tracking-normal text-dimmed`,title:Oe(e.input.at)},q(De(e.input.at)),9,Wo)]),M($,{text:e.input.text},null,8,[`text`])])):(R(),W(`li`,{key:5,class:J([`note mt-4 flex items-baseline gap-3 rounded-md pl-3 pr-(--sb-gutter) py-1.5`,e.replay?`text-dimmed`:`bg-warn/10 text-warn`])},[U(`span`,null,q((e.replay?`… `:`⏱ `)+e.text),1),e.at===void 0?B(``,!0):(R(),W(`span`,{key:0,class:`ts ml-auto select-none font-mono text-xs text-dimmed`,title:K(Z)(e.at)},q(K(yt)(e.at)),9,Go))],2))],64))),128)),ue.value?.kind===`thinking`?(R(),W(`li`,Ko,[t[11]||=U(`span`,{class:`pulse text-[1.1em] leading-none text-info motion-safe:animate-pulse`},`∿`,-1),U(`span`,{class:`badge shrink-0 rounded bg-accented px-1.5 font-mono text-[0.68rem] font-medium leading-normal tracking-wider text-muted`,title:K(s).model??void 0},q(K(wn)(K(s).model)),9,qo),U(`span`,Jo,q(fe.value)+`…`,1),U(`span`,{class:J([`since ml-auto shrink-0 font-mono text-xs tabular-nums`,ue.value.slow?`text-warn`:`text-dimmed`])},q(K(X)(ue.value.elapsedMs,`clock`)),3)])):B(``,!0),U(`li`,{ref_key:`logEnd`,ref:me,"aria-hidden":`true`},null,512)]),K(s).reply&&!K(i)?(R(),P(Jr,{key:5,position:`last`,text:K(s).reply.text,caption:Te.value,when:De(K(s).reply.at),"when-title":Oe(K(s).reply.at)},null,8,[`text`,`caption`,`when`,`when-title`])):B(``,!0)]),M(d,{open:ge.value,"onUpdate:open":t[3]||=e=>ge.value=e,title:K(yi)(K(I).state),ui:{overlay:`z-30`,content:`z-30 w-[min(96vw,90rem)] max-w-none`}},{content:S(({close:e})=>[M(Ga,{data:K(I).state,abridge:K(_e),closable:``,onClose:t=>e()},null,8,[`data`,`abridge`,`onClose`])]),_:1},8,[`open`,`title`])]),_:1},8,[`title`])}}}),Xo=Y({__name:`RunRoutePage`,setup(e){let t=ae(De,null);return(e,n)=>!K(t)||K(t).page===`runNotFound`?(R(),P(ze,{key:0})):(R(),P(Yo,{key:1}))}});export{Xo as default};
12
+ `).trim();return o===``?void 0:o}function Ni(e){if(!ki(e.title)||e.origin!==`submitted`&&e.origin!==`parsed`)return;let t=typeof e.body==`string`?e.body:``,n=ki(e.tldr)?e.tldr:ji(t),r=Mi(t,`What & why`);return{title:e.title,...n===void 0?{}:{tldr:n},...r===void 0?{}:{whatWhy:r},origin:e.origin,complete:e.complete===!0,truncated:e.truncated===!0}}function Pi(){let e=V({pr:{},readingDiffs:[],ready:!1});return{state:e,handle(t){if(!Oi(t))return;let n=t;if(n.type===`run_meta`)ki(n.repo)&&(e.pr.repo=n.repo),Ai(n.pr)&&(e.pr.number=n.pr),typeof n.headSha==`string`&&xi.test(n.headSha)&&(e.pr.headSha=n.headSha);else if(n.type===`review_artifact`&&n.artifact===`reading_diff`){if(!ki(n.diff)||n.poweredBy!==`git`&&n.poweredBy!==`meat`)return;let t={poweredBy:n.poweredBy,baseRef:ki(n.baseRef)?n.baseRef:`HEAD`,diff:n.diff,truncated:n.truncated===!0,...ki(n.summary)?{summary:n.summary}:{}},r=e.readingDiffs.findIndex(e=>e.poweredBy===t.poweredBy);r>=0?e.readingDiffs.splice(r,1,t):e.readingDiffs.push(t),e.ready=!0}else if(n.type===`review_artifact`&&n.artifact===`pr_description`){let t=Ni(n);t&&(e.description=t)}}}}var Fi=3e3,Ii={fetch:(...e)=>globalThis.fetch(...e),delay:e=>new Promise(t=>setTimeout(t,e))};function Li(e,t,n={}){let{fetch:r,delay:i}={...Ii,...n},a=V({state:{state:`absent`}}),o=!1,s=!1;async function c(t){let n=await r(`/api/review.abridge`,{method:`POST`,credentials:`same-origin`,headers:{"content-type":`application/json`},body:JSON.stringify({id:e,...t?{force:!0}:{}})}),i=await n.json().catch(()=>null);if(!n.ok)throw Error(typeof i?.error==`string`?i.error:`HTTP ${n.status}`);return i??{}}async function l(){let n=!1,i;for(let a=0;a<50;a++){let a=`id=${encodeURIComponent(e)}${i===void 0?``:`&after-seq=${i}`}`,s=await r(`/api/runs.events?${a}`,{credentials:`same-origin`});if(o)return`disposed`;if(!s.ok)throw Error(`HTTP ${s.status}`);let c=await s.json();if(o)return`disposed`;for(let e of c.events??[]){t(e);let r=e;r.type===`review_artifact`&&r.artifact===`reading_diff`&&r.poweredBy===`meat`&&(n=!0)}if(typeof c.nextAfterSeq!=`number`)return n?`found`:`missing`;if(i!==void 0&&c.nextAfterSeq<=i)return`stuck`;i=c.nextAfterSeq}return`stuck`}async function u(e){try{let t=await c(e);for(let e=0;t.state===`running`;e++){if(e>=200){s=!1,a.state={state:`failed`,reason:`still running after the page stopped waiting; ask again later`};return}if(await i(Fi),o)return;t=await c(!1)}if(o)return;if(t.state===`failed`)s=!0,a.state={state:`failed`,reason:typeof t.reason==`string`?t.reason:`unknown reason`};else if(t.state===`done`){let e=await l();if(e===`disposed`)return;s=!1,a.state=e===`found`?{state:`done`}:{state:`failed`,reason:e===`stuck`?`the run's record did not page to its end`:`the abridged diff did not appear on the run's record`}}else s=!1,a.state={state:`failed`,reason:`unexpected answer: ${String(t.state)}`}}catch(e){if(o)return;s=!1,a.state={state:`failed`,reason:e instanceof Error?e.message:String(e)}}}return{get state(){return a.state},start(){if(a.state.state===`running`||o)return;let e=a.state.state===`failed`&&s;a.state={state:`running`},u(e)},dispose(){o=!0}}}var Ri={slots:{base:`font-medium inline-flex items-center`,label:`truncate`,leadingIcon:`shrink-0`,leadingAvatar:`shrink-0`,leadingAvatarSize:``,trailingIcon:`shrink-0`},variants:{fieldGroup:{horizontal:`not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none focus-visible:z-[1]`,vertical:`not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none focus-visible:z-[1]`},color:{primary:``,secondary:``,success:``,info:``,warning:``,error:``,neutral:``},variant:{solid:``,outline:``,soft:``,subtle:``},size:{xs:{base:`text-[8px]/3 px-1 py-0.5 gap-1 rounded-sm`,leadingIcon:`size-3`,leadingAvatarSize:`3xs`,trailingIcon:`size-3`},sm:{base:`text-[10px]/3 px-1.5 py-1 gap-1 rounded-sm`,leadingIcon:`size-3`,leadingAvatarSize:`3xs`,trailingIcon:`size-3`},md:{base:`text-xs px-2 py-1 gap-1 rounded-md`,leadingIcon:`size-4`,leadingAvatarSize:`3xs`,trailingIcon:`size-4`},lg:{base:`text-sm px-2 py-1 gap-1.5 rounded-md`,leadingIcon:`size-5`,leadingAvatarSize:`2xs`,trailingIcon:`size-5`},xl:{base:`text-base px-2.5 py-1 gap-1.5 rounded-md`,leadingIcon:`size-6`,leadingAvatarSize:`2xs`,trailingIcon:`size-6`}},square:{true:``}},compoundVariants:[{color:`primary`,variant:`solid`,class:`bg-primary text-inverted`},{color:`secondary`,variant:`solid`,class:`bg-secondary text-inverted`},{color:`success`,variant:`solid`,class:`bg-success text-inverted`},{color:`info`,variant:`solid`,class:`bg-info text-inverted`},{color:`warning`,variant:`solid`,class:`bg-warning text-inverted`},{color:`error`,variant:`solid`,class:`bg-error text-inverted`},{color:`primary`,variant:`outline`,class:`text-primary ring ring-inset ring-primary/50`},{color:`secondary`,variant:`outline`,class:`text-secondary ring ring-inset ring-secondary/50`},{color:`success`,variant:`outline`,class:`text-success ring ring-inset ring-success/50`},{color:`info`,variant:`outline`,class:`text-info ring ring-inset ring-info/50`},{color:`warning`,variant:`outline`,class:`text-warning ring ring-inset ring-warning/50`},{color:`error`,variant:`outline`,class:`text-error ring ring-inset ring-error/50`},{color:`primary`,variant:`soft`,class:`bg-primary/10 text-primary`},{color:`secondary`,variant:`soft`,class:`bg-secondary/10 text-secondary`},{color:`success`,variant:`soft`,class:`bg-success/10 text-success`},{color:`info`,variant:`soft`,class:`bg-info/10 text-info`},{color:`warning`,variant:`soft`,class:`bg-warning/10 text-warning`},{color:`error`,variant:`soft`,class:`bg-error/10 text-error`},{color:`primary`,variant:`subtle`,class:`bg-primary/10 text-primary ring ring-inset ring-primary/25`},{color:`secondary`,variant:`subtle`,class:`bg-secondary/10 text-secondary ring ring-inset ring-secondary/25`},{color:`success`,variant:`subtle`,class:`bg-success/10 text-success ring ring-inset ring-success/25`},{color:`info`,variant:`subtle`,class:`bg-info/10 text-info ring ring-inset ring-info/25`},{color:`warning`,variant:`subtle`,class:`bg-warning/10 text-warning ring ring-inset ring-warning/25`},{color:`error`,variant:`subtle`,class:`bg-error/10 text-error ring ring-inset ring-error/25`},{color:`neutral`,variant:`solid`,class:`text-inverted bg-inverted`},{color:`neutral`,variant:`outline`,class:`ring ring-inset ring-accented text-default bg-default`},{color:`neutral`,variant:`soft`,class:`text-default bg-elevated`},{color:`neutral`,variant:`subtle`,class:`ring ring-inset ring-accented text-default bg-elevated`},{size:`xs`,square:!0,class:`p-0.5`},{size:`sm`,square:!0,class:`p-1`},{size:`md`,square:!0,class:`p-1`},{size:`lg`,square:!0,class:`p-1`},{size:`xl`,square:!0,class:`p-1`}],defaultVariants:{color:`primary`,variant:`solid`,size:`md`}},zi={__name:`Badge`,props:{as:{type:null,required:!1,default:`span`},label:{type:[String,Number],required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},square:{type:Boolean,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},trailingIcon:{type:null,required:!1}},setup(e){let t=e,n=v(),r=se(`badge`,t),i=x(),{orientation:a,size:o}=de(t),{isLeading:s,isTrailing:c,leadingIconName:l,trailingIconName:u}=me(r),d=H(()=>ge({extend:Ri,...i.ui?.badge||{}})({color:r.color,variant:r.variant,size:o.value??r.size,square:r.square||!n.default&&!r.label,fieldGroup:a.value}));return(e,t)=>(R(),P(K(h),{as:K(r).as,"data-slot":`base`,class:J(d.value.base({class:[K(r).ui?.base,K(r).class]}))},{default:S(()=>[F(e.$slots,`leading`,{ui:d.value},()=>[K(s)&&K(l)?(R(),P(be,{key:0,name:K(l),"data-slot":`leadingIcon`,class:J(d.value.leadingIcon({class:K(r).ui?.leadingIcon}))},null,8,[`name`,`class`])):K(r).avatar?(R(),P(Te,k({key:1,size:K(r).ui?.leadingAvatarSize||d.value.leadingAvatarSize()},K(r).avatar,{"data-slot":`leadingAvatar`,class:d.value.leadingAvatar({class:K(r).ui?.leadingAvatar})}),null,16,[`size`,`class`])):B(``,!0)]),F(e.$slots,`default`,{ui:d.value},()=>[K(r).label!==void 0&&K(r).label!==null?(R(),W(`span`,{key:0,"data-slot":`label`,class:J(d.value.label({class:K(r).ui?.label}))},q(K(r).label),3)):B(``,!0)]),F(e.$slots,`trailing`,{ui:d.value},()=>[K(c)&&K(u)?(R(),P(be,{key:0,name:K(u),"data-slot":`trailingIcon`,class:J(d.value.trailingIcon({class:K(r).ui?.trailingIcon}))},null,8,[`name`,`class`])):B(``,!0)])]),_:3},8,[`as`,`class`]))}},Bi={slots:{root:`flex items-center gap-2`,list:`relative flex p-1 group`,indicator:`absolute transition-[translate,width] duration-200 ease-out motion-reduce:transition-none`,trigger:[`group relative inline-flex items-center min-w-0 data-[state=inactive]:text-muted hover:data-[state=inactive]:not-disabled:text-default font-medium rounded-md disabled:cursor-not-allowed disabled:opacity-75`,`transition-colors`],leadingIcon:`shrink-0`,leadingAvatar:`shrink-0`,leadingAvatarSize:``,label:`truncate`,trailingBadge:`shrink-0`,trailingBadgeSize:`sm`,content:`w-full rounded-md focus-visible:outline-3`},variants:{color:{primary:{content:`outline-primary/25`},secondary:{content:`outline-secondary/25`},success:{content:`outline-success/25`},info:{content:`outline-info/25`},warning:{content:`outline-warning/25`},error:{content:`outline-error/25`},neutral:{content:`outline-inverted/25`}},variant:{pill:{list:`bg-elevated rounded-lg`,trigger:[`grow`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:content-[''] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:absolute in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:inset-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:rounded-md in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:shadow-xs in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:-z-10 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:isolate`],indicator:`rounded-md shadow-xs`},link:{list:`border-default`,indicator:`rounded-full`,trigger:`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:content-[''] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:absolute in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:rounded-full`}},orientation:{horizontal:{root:`flex-col`,list:`w-full`,indicator:`left-0 w-(--reka-tabs-indicator-size) translate-x-(--reka-tabs-indicator-position)`,trigger:`justify-center`},vertical:{list:`flex-col`,indicator:`top-0 h-(--reka-tabs-indicator-size) translate-y-(--reka-tabs-indicator-position)`}},size:{xs:{trigger:`px-2 py-1 text-xs gap-1`,leadingIcon:`size-4`,leadingAvatarSize:`3xs`},sm:{trigger:`px-2.5 py-1.5 text-xs gap-1.5`,leadingIcon:`size-4`,leadingAvatarSize:`3xs`},md:{trigger:`px-3 py-1.5 text-sm gap-1.5`,leadingIcon:`size-5`,leadingAvatarSize:`2xs`},lg:{trigger:`px-3 py-2 text-sm gap-2`,leadingIcon:`size-5`,leadingAvatarSize:`2xs`},xl:{trigger:`px-3 py-2 text-base gap-2`,leadingIcon:`size-6`,leadingAvatarSize:`xs`}}},compoundVariants:[{orientation:`horizontal`,variant:`pill`,class:{indicator:`inset-y-1`}},{orientation:`horizontal`,variant:`link`,class:{list:`border-b -mb-px`,indicator:`-bottom-px h-px`,trigger:`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:inset-x-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:-bottom-[calc(var(--spacing)+1px)] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:h-px`}},{orientation:`vertical`,variant:`pill`,class:{indicator:`inset-x-1`,list:`items-center`,trigger:`w-full justify-center`}},{orientation:`vertical`,variant:`link`,class:{list:`border-s -ms-px`,indicator:`-start-px w-px`,trigger:`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:inset-y-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:-start-[calc(var(--spacing)+1px)] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:w-px`}},{color:`primary`,variant:`pill`,class:{indicator:`bg-primary`,trigger:[`data-[state=active]:text-inverted outline-primary/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-primary`]}},{color:`secondary`,variant:`pill`,class:{indicator:`bg-secondary`,trigger:[`data-[state=active]:text-inverted outline-secondary/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-secondary`]}},{color:`success`,variant:`pill`,class:{indicator:`bg-success`,trigger:[`data-[state=active]:text-inverted outline-success/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-success`]}},{color:`info`,variant:`pill`,class:{indicator:`bg-info`,trigger:[`data-[state=active]:text-inverted outline-info/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-info`]}},{color:`warning`,variant:`pill`,class:{indicator:`bg-warning`,trigger:[`data-[state=active]:text-inverted outline-warning/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-warning`]}},{color:`error`,variant:`pill`,class:{indicator:`bg-error`,trigger:[`data-[state=active]:text-inverted outline-error/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-error`]}},{color:`neutral`,variant:`pill`,class:{indicator:`bg-inverted`,trigger:[`data-[state=active]:text-inverted outline-inverted/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-inverted`]}},{color:`primary`,variant:`link`,class:{indicator:`bg-primary`,trigger:[`data-[state=active]:text-primary outline-primary/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-primary`]}},{color:`secondary`,variant:`link`,class:{indicator:`bg-secondary`,trigger:[`data-[state=active]:text-secondary outline-secondary/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-secondary`]}},{color:`success`,variant:`link`,class:{indicator:`bg-success`,trigger:[`data-[state=active]:text-success outline-success/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-success`]}},{color:`info`,variant:`link`,class:{indicator:`bg-info`,trigger:[`data-[state=active]:text-info outline-info/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-info`]}},{color:`warning`,variant:`link`,class:{indicator:`bg-warning`,trigger:[`data-[state=active]:text-warning outline-warning/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-warning`]}},{color:`error`,variant:`link`,class:{indicator:`bg-error`,trigger:[`data-[state=active]:text-error outline-error/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-error`]}},{color:`neutral`,variant:`link`,class:{indicator:`bg-inverted`,trigger:[`data-[state=active]:text-highlighted outline-inverted/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-inverted`]}}],defaultVariants:{color:`primary`,variant:`pill`,size:`md`}},Vi={__name:`Tabs`,props:{as:{type:null,required:!1},items:{type:Array,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},orientation:{type:null,required:!1,default:`horizontal`},content:{type:Boolean,required:!1,default:!0},valueKey:{type:null,required:!1,default:`value`},labelKey:{type:null,required:!1,default:`label`},class:{type:null,required:!1},ui:{type:Object,required:!1},defaultValue:{type:[String,Number],required:!1,default:`0`},modelValue:{type:[String,Number],required:!1},activationMode:{type:String,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0}},emits:[`update:modelValue`],setup(e,{expose:t,emit:n}){let r=e,i=n,a=v(),o=se(`tabs`,r),s=x(),c=I(he(o,`as`,`unmountOnHide`),i),l=H(()=>ge({extend:Bi,...s.ui?.tabs||{}})({color:o.color,variant:o.variant,size:o.size,orientation:o.orientation})),u=N([]);function d(e,t){u.value[e]=t}return t({triggersRef:u}),(e,t)=>(R(),P(K(ft),k(K(c),{"model-value":K(o).modelValue,"default-value":K(o).defaultValue,orientation:K(o).orientation,"activation-mode":K(o).activationMode,"data-slot":`root`,class:l.value.root({class:[K(o).ui?.root,K(o).class]})}),{default:S(()=>[M(K(_t),{"data-slot":`list`,class:J(l.value.list({class:K(o).ui?.list}))},{default:S(()=>[M(K(gt),{"data-slot":`indicator`,class:J(l.value.indicator({class:K(o).ui?.indicator}))},null,8,[`class`]),F(e.$slots,`list-leading`),(R(!0),W(j,null,G(K(o).items,(t,n)=>(R(),P(K(vt),{key:K(O)(t,K(o).valueKey)??n,ref_for:!0,ref:e=>d(n,e),value:K(O)(t,K(o).valueKey)??String(n),disabled:t.disabled,"data-slot":`trigger`,class:J(l.value.trigger({class:[K(o).ui?.trigger,t.ui?.trigger]}))},{default:S(()=>[F(e.$slots,`leading`,{item:t,index:n,ui:l.value},()=>[t.icon?(R(),P(be,{key:0,name:t.icon,"data-slot":`leadingIcon`,class:J(l.value.leadingIcon({class:[K(o).ui?.leadingIcon,t.ui?.leadingIcon]}))},null,8,[`name`,`class`])):t.avatar?(R(),P(Te,k({key:1,size:t.ui?.leadingAvatarSize||K(o).ui?.leadingAvatarSize||l.value.leadingAvatarSize()},{ref_for:!0},t.avatar,{"data-slot":`leadingAvatar`,class:l.value.leadingAvatar({class:[K(o).ui?.leadingAvatar,t.ui?.leadingAvatar]})}),null,16,[`size`,`class`])):B(``,!0)]),K(O)(t,K(o).labelKey)||a.default?(R(),W(`span`,{key:0,"data-slot":`label`,class:J(l.value.label({class:[K(o).ui?.label,t.ui?.label]}))},[F(e.$slots,`default`,{item:t,index:n},()=>[L(q(K(O)(t,K(o).labelKey)),1)])],2)):B(``,!0),F(e.$slots,`trailing`,{item:t,index:n,ui:l.value},()=>[t.badge||t.badge===0?(R(),P(zi,k({key:0,color:`neutral`,variant:`outline`,size:t.ui?.trailingBadgeSize||K(o).ui?.trailingBadgeSize||l.value.trailingBadgeSize()},{ref_for:!0},typeof t.badge==`string`||typeof t.badge==`number`?{label:t.badge}:t.badge,{"data-slot":`trailingBadge`,class:l.value.trailingBadge({class:[K(o).ui?.trailingBadge,t.ui?.trailingBadge]})}),null,16,[`size`,`class`])):B(``,!0)])]),_:2},1032,[`value`,`disabled`,`class`]))),128)),F(e.$slots,`list-trailing`)]),_:3},8,[`class`]),K(o).content?(R(!0),W(j,{key:0},G(K(o).items,(t,n)=>(R(),P(K(ht),{key:K(O)(t,K(o).valueKey)??n,value:K(O)(t,K(o).valueKey)??String(n),"data-slot":`content`,class:J(l.value.content({class:[K(o).ui?.content,t.ui?.content,t.class]}))},{default:S(()=>[F(e.$slots,t.slot||`content`,{item:t,index:n,ui:l.value},()=>[L(q(t.content),1)])]),_:2},1032,[`value`,`class`]))),128)):B(``,!0)]),_:3},16,[`model-value`,`default-value`,`orientation`,`activation-mode`,`class`]))}},Hi;function Ui(){return Hi??=Ie(()=>import(`./dist-YrRKtxsS.js`),__vite__mapDeps([0,1,2,3,4])),Hi}var Wi={key:0,class:`overflow-x-auto rounded-lg border border-(--ui-border) p-3 font-mono text-xs whitespace-pre text-(--ui-text)`,"data-testid":`diff-raw`},Gi=Y({__name:`FileDiffs`,props:{diff:{},theme:{},diffStyle:{}},setup(e){let t=e,n=N(null),r=N(!1),i=[],a=0;function o(){for(let e of i)try{e.cleanUp()}catch{}i=[],n.value&&(n.value.innerHTML=``)}async function s(){let e=++a;r.value=!1;try{let{FileDiff:r,parsePatchFiles:s}=await Ui();if(e!==a||!n.value)return;o();let c=s(t.diff).flatMap(e=>e.files);for(let e of c){let a=document.createElement(`diffs-container`);a.dataset.file=e.name,n.value.appendChild(a);let o=new r({themeType:t.theme,diffStyle:t.diffStyle??`unified`});o.render({fileDiff:e,fileContainer:a}),i.push(o)}}catch{e===a&&(r.value=!0)}}return E(s),C(()=>t.diff,s),C(()=>t.theme,s),C(()=>t.diffStyle,s),Se(()=>{a++,o()}),(t,i)=>r.value?(R(),W(`pre`,Wi,q(e.diff),1)):(R(),W(`div`,{key:1,ref_key:`container`,ref:n,class:`space-y-4`,"data-testid":`file-diffs`},null,512))}});async function Ki(e){let{parsePatchFiles:t}=await Ui(),n=t(e).flatMap(e=>e.files).map(e=>({path:e.name,additions:e.hunks.reduce((e,t)=>e+t.additionLines,0),deletions:e.hunks.reduce((e,t)=>e+t.deletionLines,0)}));return{files:n,additions:n.reduce((e,t)=>e+t.additions,0),deletions:n.reduce((e,t)=>e+t.deletions,0)}}function qi(e,t){if(e.length<=t)return e;let n=Math.max(1,t-1),r=Math.ceil(n/2),i=Math.floor(n/2);return`${e.slice(0,r)}…${e.slice(e.length-i)}`}var Ji={dockerfile:`docker`,makefile:`makefile`,"go.mod":`go`,"go.sum":`go`,".gitignore":`gitignore`,".dockerignore":`dockerignore`},Yi={ts:`typescript`,tsx:`tsx`,js:`javascript`,jsx:`jsx`,mjs:`javascript`,cjs:`javascript`,vue:`vue`,svelte:`svelte`,py:`python`,rb:`ruby`,go:`go`,rs:`rust`,java:`java`,kt:`kotlin`,swift:`swift`,c:`c`,h:`c`,cpp:`cpp`,cc:`cpp`,hpp:`cpp`,cs:`csharp`,php:`php`,scala:`scala`,ex:`elixir`,exs:`elixir`,json:`json`,jsonc:`json`,yaml:`yaml`,yml:`yaml`,toml:`toml`,xml:`xml`,html:`html`,css:`css`,scss:`scss`,sass:`sass`,less:`less`,md:`markdown`,mdx:`mdx`,sh:`bash`,bash:`bash`,zsh:`zsh`,sql:`sql`,tf:`terraform`,hcl:`hcl`,dockerfile:`docker`};function Xi(e){let t=(e.split(`/`).pop()||e).toLowerCase(),n=Ji[t];if(n)return n;let r=t.lastIndexOf(`.`);return r===-1?`text`:Yi[t.slice(r+1)]??`text`}var Zi={javascript:`i-simple-icons-javascript`,typescript:`i-simple-icons-typescript`,vue:`i-simple-icons-vuedotjs`,jsx:`i-simple-icons-react`,tsx:`i-simple-icons-react`,svelte:`i-simple-icons-svelte`,html:`i-simple-icons-html5`,css:`i-simple-icons-css`,scss:`i-simple-icons-sass`,sass:`i-simple-icons-sass`,less:`i-simple-icons-less`,python:`i-simple-icons-python`,go:`i-simple-icons-go`,rust:`i-simple-icons-rust`,java:`i-simple-icons-openjdk`,c:`i-simple-icons-c`,cpp:`i-simple-icons-cplusplus`,csharp:`i-simple-icons-csharp`,php:`i-simple-icons-php`,ruby:`i-simple-icons-ruby`,elixir:`i-simple-icons-elixir`,scala:`i-simple-icons-scala`,swift:`i-simple-icons-swift`,kotlin:`i-simple-icons-kotlin`,json:`i-simple-icons-json`,yaml:`i-simple-icons-yaml`,toml:`i-simple-icons-toml`,xml:`i-simple-icons-xml`,sql:`i-lucide-database`,markdown:`i-simple-icons-markdown`,mdx:`i-simple-icons-mdx`,bash:`i-simple-icons-gnubash`,zsh:`i-simple-icons-gnubash`,docker:`i-simple-icons-docker`,dockerignore:`i-simple-icons-docker`,terraform:`i-simple-icons-terraform`,hcl:`i-simple-icons-terraform`,makefile:`i-lucide-hammer`,gitignore:`i-simple-icons-git`,text:`i-lucide-file-text`};function Qi(e){return Zi[e]??Zi.text}function $i(e){return Qi(Xi(e))}var ea={key:0,class:`flex items-center gap-2 p-4 text-sm text-(--ui-text-muted) sm:p-5`,"data-testid":`files-loading`},ta={key:1,class:`p-4 text-sm text-(--ui-text-muted) sm:p-5`,"data-testid":`no-files`},na={class:`shrink-0 border-b border-(--ui-border) @2xl:w-72 @2xl:border-b-0 @2xl:border-r`,"data-testid":`file-list`},ra={class:`@2xl:sticky @2xl:top-0 @2xl:max-h-[calc(100dvh-11rem)] @2xl:overflow-y-auto @2xl:py-3`},ia=[`aria-expanded`],aa={class:`ml-auto tabular-nums`,"data-testid":`pr-totals`},oa={class:`text-(--ui-success)`},sa={class:`text-(--ui-error)`},ca={key:1,class:`flex items-center justify-between gap-2 px-3 pb-2 text-xs text-(--ui-text-dimmed)`},la={"data-testid":`file-count`},ua={class:`tabular-nums`,"data-testid":`pr-totals`},da={class:`text-(--ui-success)`},fa={class:`text-(--ui-error)`},pa=[`title`,`aria-current`,`onClick`],ma={class:`min-w-0 flex-1 whitespace-nowrap`},ha={class:`shrink-0 text-[11px] tabular-nums`},ga={class:`text-(--ui-success)`},_a={class:`text-(--ui-error)`},va=34,ya=Y({__name:`FilesChanged`,props:{diff:{},notes:{},diffStyle:{}},setup(e){let t=e,n=ie(),r=H(()=>n.value===`dark`?`dark`:`light`),i=N([]),a=N(!0),o=N(null),s=T(`panel`),c=T(`root`),{width:l}=pe(c);C(c,e=>{e&&(l.value=e.getBoundingClientRect().width)});let u=H(()=>l.value>0&&l.value<672),d=N(!1),f=H(()=>u.value?`unified`:t.diffStyle??`unified`),p=0;async function m(){let e=++p;a.value=!0;let n=await Ki(t.diff);e===p&&(i.value=n.files,o.value=null,a.value=!1)}C(()=>t.diff,m,{immediate:!0});let h=H(()=>i.value.reduce((e,t)=>({additions:e.additions+t.additions,deletions:e.deletions+t.deletions}),{additions:0,deletions:0}));function g(e){o.value=e,u.value&&(d.value=!1);let t=s.value?.querySelectorAll(`[data-file]`)??[];Array.from(t).find(t=>t.dataset.file===e)?.scrollIntoView({block:`start`,behavior:`smooth`})}return(t,n)=>{let l=be;return a.value?(R(),W(`div`,ea,[M(l,{name:`i-lucide-loader-circle`,class:`size-4 animate-spin`}),n[1]||=U(`span`,null,`Loading diff…`,-1)])):i.value.length===0?(R(),W(`p`,ta,` Nothing in this diff parsed as a file. `)):(R(),W(`div`,{key:2,ref_key:`root`,ref:c,class:`@container flex min-h-full flex-col @2xl:flex-row`,"data-testid":`files-changed`},[U(`aside`,na,[U(`div`,ra,[u.value?(R(),W(`button`,{key:0,type:`button`,class:`flex w-full items-center gap-2 px-3 py-2.5 text-xs text-(--ui-text-muted)`,"aria-expanded":d.value,"data-testid":`files-fold`,onClick:n[0]||=e=>d.value=!d.value},[M(l,{name:d.value?`i-lucide-chevron-down`:`i-lucide-chevron-right`,class:`size-3.5 shrink-0 text-(--ui-text-dimmed)`},null,8,[`name`]),U(`span`,null,q(i.value.length)+` `+q(i.value.length===1?`file`:`files`)+` changed`,1),U(`span`,aa,[U(`span`,oa,`+`+q(h.value.additions),1),U(`span`,sa,`−`+q(h.value.deletions),1)])],8,ia)):(R(),W(`div`,ca,[U(`span`,la,q(i.value.length)+` `+q(i.value.length===1?`file`:`files`),1),U(`span`,ua,[U(`span`,da,`+`+q(h.value.additions),1),U(`span`,fa,`−`+q(h.value.deletions),1)])])),!u.value||d.value?(R(),W(`ul`,{key:2,class:J([`flex flex-col`,u.value?`pb-2`:``])},[(R(!0),W(j,null,G(i.value,e=>(R(),W(`li`,{key:e.path},[U(`button`,{type:`button`,class:J([`flex w-full min-w-0 items-center gap-2 px-3 py-1.5 text-left text-xs transition-colors hover:bg-accented/50 dark:hover:bg-(--ui-bg)`,o.value===e.path?`bg-accented/50 text-(--ui-text) dark:bg-(--ui-bg)`:`text-(--ui-text-muted)`]),title:e.path,"aria-current":o.value===e.path?`true`:void 0,"data-testid":`file-entry`,onClick:t=>g(e.path)},[M(l,{name:K($i)(e.path),class:`size-3.5 shrink-0`},null,8,[`name`]),U(`span`,ma,q(K(qi)(e.path,va)),1),U(`span`,ha,[U(`span`,ga,`+`+q(e.additions),1),U(`span`,_a,`−`+q(e.deletions),1)])],10,pa)]))),128))],2)):B(``,!0)])]),U(`div`,{ref_key:`panel`,ref:s,class:`min-w-0 flex-1 overflow-x-auto`,"data-testid":`diff-column`},[(R(!0),W(j,null,G(e.notes,e=>(R(),W(`p`,{key:e,class:`px-3 pt-3 text-xs text-(--ui-text-muted)`,"data-testid":`diff-note`},q(e),1))),128)),M(Gi,{diff:e.diff,theme:r.value,"diff-style":f.value},null,8,[`diff`,`theme`,`diff-style`])],512)],512))}}}),ba=Y({__name:`LabelTip`,props:{text:{},disabled:{type:Boolean,default:!1}},setup(e){return(t,n)=>{let r=Pe;return R(),P(r,{text:e.text,disabled:e.disabled,"delay-duration":250,content:{side:`bottom`,align:`end`,sideOffset:6,collisionPadding:8},ui:{content:`h-auto max-w-[28rem] px-2.5 py-1.5`,text:`text-clip whitespace-normal leading-snug`}},{default:S(()=>[F(t.$slots,`default`)]),_:3},8,[`text`,`disabled`])}}}),xa={class:`pr-review-panel @container flex h-full min-h-0 min-w-0 flex-col`,"data-testid":`pr-review-panel`},Sa={class:`shrink-0 border-b border-(--ui-border) px-4 pt-5 pb-4 sm:px-6`},Ca={class:`flex flex-col gap-3 @2xl:flex-row @2xl:items-start @2xl:justify-between @2xl:gap-4`},wa={class:`min-w-0`},Ta={class:`line-clamp-2 text-lg leading-snug font-semibold text-(--ui-text) @2xl:line-clamp-none @2xl:truncate`,"data-testid":`pr-title`},Ea={class:`mt-1.5 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-(--ui-text-muted)`,"data-testid":`pr-facts`},Da=[`href`],Oa={key:1,class:`inline-flex items-center gap-1.5`},ka=[`href`],Aa={title:`the base the diff is against`},ja={"data-testid":`producer-label`},Ma={class:`inline-flex items-center gap-1 text-(--ui-warning)`,"data-testid":`truncated-label`},Na={class:`flex shrink-0 flex-wrap items-center gap-2`},Pa={key:1,class:`inline-flex shrink-0 items-center gap-1.5 text-xs text-(--ui-text-muted)`,"data-testid":`abridge-running`},Fa={key:2,class:`inline-flex min-w-0 shrink items-center gap-1.5 text-xs text-(--ui-error)`,"data-testid":`abridge-failed`},Ia=[`title`],La={key:0,class:`flex shrink-0 items-center justify-between gap-3 border-b border-(--ui-border) px-4 py-2 sm:px-6`},Ra={class:`tabs-scroll min-w-0 overflow-x-auto`},za={class:`min-h-0 flex-1 overflow-y-auto`},Ba={key:1,class:`mx-auto max-w-3xl p-4 sm:p-6`,"data-testid":`pr-description`},Va={key:2,class:`mt-4 text-xs text-(--ui-text-dimmed) italic`,"data-testid":`description-origin`},Ha={key:2,class:`px-4 py-3 text-sm text-(--ui-text-muted) sm:px-6`,"data-testid":`no-diff`},Ua=`switchboard:diffStyle`,Wa=`Abridge the full diff with meat.dev: a model keeps the concepts and drops what a reviewer need not read. One model call; usually a minute or three.`,Ga=Y({__name:`PrReviewPanel`,props:{data:{},closable:{type:Boolean,default:!1},abridge:{default:void 0}},emits:[`close`],setup(e,{emit:t}){let n=e,r=t,i=H(()=>Si(n.data.pr)),a=H(()=>yi(n.data)),o=H(()=>n.data.readingDiffs),s=H(()=>n.data.description),c=H(()=>o.value.find(e=>e.poweredBy===`git`)),l=H(()=>o.value.find(e=>e.poweredBy===`meat`)),u=H(()=>n.data.pr.headSha?.slice(0,7)),d=H(()=>{let e=[];return c.value&&e.push({label:`Files changed`,value:`files`}),l.value&&e.push({label:`Reading diff`,value:`reading`}),(s.value?.tldr||s.value?.whatWhy)&&e.push({label:`Description`,value:`description`}),e}),f=()=>Ci(o.value)?.poweredBy===`meat`?`reading`:`files`,p=N(f());C(()=>Ci(o.value),()=>p.value=f()),C(d,e=>{e.some(e=>e.value===p.value)||(p.value=e[0]?.value??`files`)},{immediate:!0});let m=H(()=>p.value===`files`?c.value:p.value===`reading`?l.value:void 0),h=H(()=>{let e=m.value;if(!e)return[];let t=[];return e.summary&&t.push(e.summary),e.truncated&&t.push(`${Ti(e.diff.length)}.`),t}),g=H(()=>s.value?Di(s.value):void 0),_=[{label:`Inline`,value:`unified`,icon:`i-lucide-rows-3`},{label:`Side by side`,value:`split`,icon:`i-lucide-columns-2`}],v=N(`unified`);E(()=>{try{localStorage.getItem(Ua)===`split`&&(v.value=`split`)}catch{}});function y(e){v.value=e===`split`?`split`:`unified`;try{localStorage.setItem(Ua,v.value)}catch{}}let b=H(()=>n.abridge!==void 0&&n.abridge.state.state!==`done`&&c.value!==void 0&&!l.value);return(t,n)=>{let o=be,c=ce,l=Vi;return R(),W(`div`,xa,[U(`header`,Sa,[U(`div`,Ca,[U(`div`,wa,[U(`h1`,Ta,q(a.value),1),U(`div`,Ea,[i.value.pr?(R(),W(`a`,{key:0,href:i.value.pr,target:`_blank`,rel:`noopener noreferrer`,class:`inline-flex items-center gap-1.5 hover:text-(--ui-text)`,"data-testid":`pr-link`},[M(o,{name:`i-simple-icons-github`,class:`size-3.5 shrink-0`}),U(`span`,null,q(e.data.pr.repo)+`#`+q(e.data.pr.number),1)],8,Da)):e.data.pr.repo?(R(),W(`span`,Oa,[M(o,{name:`i-simple-icons-github`,class:`size-3.5 shrink-0`}),U(`span`,null,q(e.data.pr.repo),1)])):B(``,!0),i.value.commit?(R(),W(`a`,{key:2,href:i.value.commit,target:`_blank`,rel:`noopener noreferrer`,class:`font-mono hover:text-(--ui-text)`,"data-testid":`commit-link`},q(u.value),9,ka)):B(``,!0),m.value?(R(),W(j,{key:3},[U(`span`,Aa,`against origin/`+q(m.value.baseRef),1),M(ba,{text:K(wi)(m.value.poweredBy)},{default:S(()=>[U(`span`,ja,q(K(Ei)(m.value.poweredBy)),1)]),_:1},8,[`text`]),m.value.truncated?(R(),P(ba,{key:0,text:K(Ti)(m.value.diff.length)},{default:S(()=>[U(`span`,Ma,[M(o,{name:`i-lucide-scissors`,class:`size-3.5`}),n[4]||=L(`truncated `,-1)])]),_:1},8,[`text`])):B(``,!0)],64)):B(``,!0)])]),U(`div`,Na,[i.value.pr?(R(),P(c,{key:0,label:`View on GitHub`,icon:`i-simple-icons-github`,color:`neutral`,variant:`ghost`,size:`sm`,to:i.value.pr,target:`_blank`,"data-testid":`github-button`},null,8,[`to`])):B(``,!0),b.value&&e.abridge?(R(),W(j,{key:1},[e.abridge.state.state===`absent`?(R(),P(ba,{key:0,text:Wa},{default:S(()=>[M(c,{label:`Abridge with meat`,icon:`i-lucide-scissors`,size:`sm`,"data-testid":`abridge-button`,onClick:n[0]||=t=>e.abridge.start()})]),_:1})):e.abridge.state.state===`running`?(R(),W(`span`,Pa,[M(o,{name:`i-lucide-loader-circle`,class:`size-3.5 animate-spin`}),n[5]||=L(` Abridging… usually 1–3 minutes `,-1)])):e.abridge.state.state===`failed`?(R(),W(`span`,Fa,[M(o,{name:`i-lucide-circle-alert`,class:`size-3.5 shrink-0`}),U(`span`,{class:`truncate`,title:e.abridge.state.reason},`Abridging failed: `+q(e.abridge.state.reason),9,Ia),M(c,{size:`xs`,color:`neutral`,variant:`outline`,label:`Retry`,"data-testid":`abridge-retry`,onClick:n[1]||=t=>e.abridge.start()})])):B(``,!0)],64)):B(``,!0),e.closable?(R(),P(c,{key:2,icon:`i-lucide-x`,color:`neutral`,variant:`ghost`,size:`sm`,"aria-label":`Close`,"data-testid":`panel-close`,onClick:n[2]||=e=>r(`close`)})):B(``,!0)])])]),d.value.length>0?(R(),W(`div`,La,[U(`div`,Ra,[M(l,{modelValue:p.value,"onUpdate:modelValue":n[3]||=e=>p.value=e,items:d.value,size:`sm`,class:`w-fit gap-0`,content:!1,"data-testid":`panel-tabs`},null,8,[`modelValue`,`items`])]),m.value?(R(),P(l,{key:0,"model-value":v.value,items:_,color:`neutral`,size:`xs`,content:!1,class:`hidden w-fit @2xl:flex`,"data-testid":`diff-style`,"onUpdate:modelValue":y},null,8,[`model-value`])):B(``,!0)])):B(``,!0),U(`div`,za,[m.value?(R(),P(ya,{key:m.value.poweredBy,diff:m.value.diff,notes:h.value,"diff-style":v.value},null,8,[`diff`,`notes`,`diff-style`])):p.value===`description`&&s.value?(R(),W(`div`,Ba,[n[7]||=U(`div`,{class:`mb-2 text-xs font-medium text-(--ui-text-dimmed)`},`What the pull request says about itself`,-1),s.value.tldr?(R(),P($,{key:0,text:s.value.tldr,class:`text-sm`,"data-testid":`description-tldr`},null,8,[`text`])):B(``,!0),s.value.whatWhy?(R(),W(j,{key:1},[n[6]||=U(`div`,{class:`mt-4 mb-2 text-xs font-medium text-(--ui-text-dimmed)`},`What & why`,-1),M($,{text:s.value.whatWhy,class:`text-sm`,"data-testid":`description-what-why`},null,8,[`text`])],64)):B(``,!0),g.value?(R(),W(`p`,Va,q(g.value),1)):B(``,!0)])):(R(),W(`p`,Ha,` No reading diff was produced for this review. `))])])}}}),Ka={class:`conn flex items-center gap-2 font-mono`},qa={key:0,class:`ok text-ok`,role:`img`,"aria-label":`succeeded`},Ja=[`data-heat`],Ya={key:2,id:`delivery`,class:`text-xs text-muted`},Xa=[`title`],Za={key:0,id:`actions`,class:`actions flex gap-1.5`},Qa={class:`mx-auto max-w-6xl`},$a={key:0,id:`runmeta`,class:`runmeta facts mb-3 flex flex-wrap items-baseline gap-x-3 gap-y-1.5 px-(--sb-gutter) font-mono text-xs text-dimmed`},eo={class:`agent text-[0.68rem] font-medium uppercase tracking-wider text-toned`},to={class:`model`},no={key:0,class:`effort`},ro=[`href`],io={key:2,class:`repo`},ao=[`href`],oo={key:4,class:`reftag rounded border border-accented px-1.5 text-[0.75rem] text-toned`},so=[`href`,`title`],co=[`href`],lo={key:1,id:`request`,class:`block mb-4 rounded-lg border border-default bg-(--ui-bg-muted) px-(--sb-gutter) py-3`},uo={class:`mb-2 flex items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},fo={key:0,class:`source flex items-center gap-2 font-normal normal-case tracking-normal text-dimmed`},po=[`href`],mo={key:1},ho={key:1},go=[`title`],_o={key:3,id:`context`,class:`group mb-4 px-(--sb-gutter)`},vo={class:`flex min-h-6 cursor-pointer list-none items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted hover:text-toned [&::-webkit-details-marker]:hidden`},yo={class:`count font-normal normal-case tracking-normal text-dimmed`},bo={id:`contextturns`,class:`pb-1 pl-5`},xo=[`title`],So={id:`thisrun`,class:`mb-2 flex items-baseline gap-2.5 px-(--sb-gutter) font-mono text-xs font-medium uppercase tracking-wider text-muted`},Co={key:0,class:`count font-normal normal-case tracking-normal text-dimmed`},wo=[`aria-pressed`,`data-open`,`title`],To={id:`log`,class:`m-0 list-none p-0`},Eo={key:0,id:`placeholder`,class:`empty text-muted`},Do=[`id`],Oo={class:`meta flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5 pr-(--sb-gutter) font-mono text-xs tabular-nums text-dimmed`},ko=[`title`],Ao=[`title`],jo=[`title`],Mo={key:2,class:`nonar font-sans italic`},No=[`title`],Po=[`data-phase`],Fo=[`aria-expanded`,`onClick`],Io={class:`glyph select-none text-dimmed`},Lo={class:`what`},Ro={key:0,class:`m-0 list-none p-0 pl-4`},zo={key:4,class:`followup block mt-5 rounded-lg border border-default bg-(--ui-bg-muted) px-(--sb-gutter) py-3`},Bo={class:`mb-2 flex items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},Vo={key:0,class:`source flex items-center gap-2 font-normal normal-case tracking-normal text-dimmed`},Ho=[`href`],Uo={key:1},Wo=[`title`],Go=[`title`],Ko={key:1,id:`thinking`,class:`pending ml-3.5 mt-5 flex items-center gap-3 rounded-md border border-dashed border-accented pl-3 pr-[calc(var(--sb-gutter)-1px)] py-2 text-sm first:mt-0`,"aria-live":`off`,title:`the model is working on its next turn — nothing back yet (since the last event, runner clock)`},qo=[`title`],Jo={class:`verb min-w-0 truncate text-toned`},Yo=Y({__name:`RunPage`,setup(e){let t=Ee(`run`),n=t?.mode===`history`,r=n?`Run`:`Live run`,i=n,a=typeof window<`u`?new URLSearchParams(window.location.search).get(`open`):null,o=gn({openTags:a?a.split(`,`).map(e=>e.trim()).filter(Boolean):void 0}),s=o.state,l=N(n?`ended`:`connecting`),u=N(``),d=Re(),p=t?.mode===`live`?vn(t,d.value):null,m=N(void 0),h=N({}),g=H(()=>{if(n&&t?.mode===`history`)return t.status===`completed`?{ok:!0,cls:``,word:`succeeded`}:{ok:!1,cls:t.status===`failed`||t.status===`stopped_hard`||t.status===`interrupted`?`red`:t.status===`stopped_soft`?`amber`:`grey`,word:t.status?Ge(t.status):`ended`};let e=s.stopMode;return{ok:!1,cls:e===`hard`?`red`:e===`soft`?`amber`:`grey`,word:e===`hard`?`killed`:e===`soft`?`stopped early`:`ended`}}),v=H(()=>n&&t?.mode===`history`?t.durationMs:m.value),b=H(()=>bn(n&&t?.mode===`history`?{finishedAt:t.finishedAt,sealedAt:t.sealedAt,replyOk:t.replyOk}:h.value)),ee=H(()=>v.value===void 0?``:X(v.value,`clock`)),x=H(()=>We(v.value,`run`)),te=H(()=>qe(x.value)),w={red:`border-bad/30 text-bad`,amber:`border-warn/30 text-warn`,grey:`border-accented text-muted`},T=H(()=>u.value?u.value:l.value===`connecting`?`connecting…`:l.value===`disconnected`?`disconnected`:l.value===`stopping`?`stopping (${s.stopMode??`soft`})`:l.value===`finished`?m.value===void 0?`delivering…`:`delivering… · ${X(m.value,`clock`)}`:p?`running · ${X(p.elapsedMs(d.value),`clock`)}`:`running`),ne=H(()=>u.value||l.value===`disconnected`?`text-bad`:l.value===`running`?`text-ok motion-safe:animate-pulse`:l.value===`finished`?`text-ok`:`text-warn motion-safe:animate-pulse`),re=H(()=>{if(!t||t.mode!==`live`&&t.mode!==`history`)return null;s.traceVersion;let e=t.receivedAt??t.startedAt,n=vi(s.meta?.agent);if(t.mode===`history`){let r=t.durationMs??(t.finishedAt===void 0?0:Math.max(0,t.finishedAt-e));return si({spans:o.spanSet(),losses:o.losses(e),window:{start:e,end:e+r},owner:n,totalMs:r,phase:`ended`,delivery:{finishedAt:t.finishedAt,sealedAt:t.sealedAt,replyOk:t.replyOk},...t.truncated===void 0?{}:{truncated:t.truncated},...t.untimed?{untimed:!0}:{},callTitle:o.callHeadline})}if(!p)return null;let r=l.value===`ended`?`ended`:l.value===`finished`?`delivering`:`live`,i=r===`live`?p.elapsedMs(d.value):m.value??p.elapsedMs(d.value);return si({spans:o.spanSet(),losses:o.losses(e),window:{start:e,end:e+i},owner:n,totalMs:i,phase:r,delivery:h.value,callTitle:o.callHeadline})}),ie=n&&t?.mode===`history`?`/runs/${encodeURIComponent(t.id)}/events`:void 0;function ae(e){o.reveal(e)&&y().then(()=>{let t=document.getElementById(e);t&&(t.scrollIntoView?.({block:`center`}),t.classList.add(`revealed`),setTimeout(()=>t.classList.remove(`revealed`),1500))})}let D=N(n),O=N(!1);function oe(e){t?.mode===`live`&&(e!==`hard`||c.confirm(`Hard stop: abort the run now with no summary and free its sandbox?`))&&(O.value=!0,fetch(`${t.stopUrl}&mode=${encodeURIComponent(e)}`,{method:`POST`,credentials:`same-origin`}).then(t=>{if(!t.ok)throw Error(`HTTP ${t.status}`);k(e)}).catch(e=>{O.value=!1,u.value=`stop failed: ${e instanceof Error?e.message:`error`}`}))}function k(e){o.markStopping(e),D.value=!0,(l.value===`connecting`||l.value===`running`)&&(l.value=`stopping`)}C(()=>s.stopMode,e=>{e&&l.value!==`ended`&&l.value!==`disconnected`&&l.value!==`finished`&&k(e)}),n||C(l,e=>c.setFavicon(e===`ended`||e===`disconnected`||e===`finished`?Ye:Je),{immediate:!0});let se=H(()=>!n&&l.value!==`ended`&&l.value!==`disconnected`&&l.value!==`finished`),le=H(()=>se.value?_n(s,d.value):null);we(Sn,le);let ue=H(()=>se.value?En(s,o.pendingCall(),d.value):null),de=[`Thinking`,`Pondering`,`Mulling it over`,`Reasoning`,`Cogitating`,`Weighing options`,`Puzzling`,`Deliberating`,`Noodling`,`Chewing on it`,`Ruminating`,`Reticulating splines`],fe=H(()=>ue.value?.kind===`thinking`?re.value?.openStep||de[Math.floor(ue.value.elapsedMs/6e3)%de.length]:``);function F(){o.setAllOpen(!s.allOpen)}let pe=H(()=>s.log.filter(e=>e.kind===`step`).length),me=N(null);function he(){return window.innerHeight+window.scrollY>=document.body.scrollHeight-60}let I=Pi(),ge=N(!1),_e=t?.mode===`history`&&t.capabilities.readingDiffAbridge?Li(t.id,e=>I.handle(e)):void 0;Se(()=>_e?.dispose());function ve(e){let t=he();o.handle(e),I.handle(e),t&&requestAnimationFrame(()=>me.value?.scrollIntoView?.({block:`nearest`}))}let ye=Ue(),z=null;if(t?.mode===`history`){for(let e of t.events)o.handle(e),I.handle(e);o.closePhases()}E(()=>{if(t?.mode!==`live`)return;z=ye(t.eventsUrl),z.onopen=()=>{s.stopMode||(l.value=`running`)};let e=0;z.onmessage=t=>{let n;try{n=JSON.parse(t.data)}catch{return}if(n.type!==`replay_note`){let n=Number(t.lastEventId);if(n>0){if(n<=e)return;e=n}}ve(n)},z.addEventListener(`replay_elided`,e=>{let t=un(e);t&&o.noteElided(t)}),z.addEventListener(`finished`,e=>{let t=xn(e);t&&p&&(m.value=p.elapsedAt(t.finishedAt)),t&&(h.value={...h.value,finishedAt:t.finishedAt}),D.value=!0,(l.value===`connecting`||l.value===`running`)&&(l.value=`finished`)}),z.addEventListener(`end`,e=>{o.flushPendingTurn(`the run ended here`),o.closePhases(),D.value=!0,m.value??=p?.elapsedMs(d.value),h.value={...h.value,...yn(e)},l.value=`ended`,z?.close()}),z.onerror=()=>{z&&z.readyState===2&&(l.value=`disconnected`)}}),Se(()=>{z?.close()});function xe(e){return e&&/^https?:\/\//.test(e)?e:``}let Ce=H(()=>xe(s.request?.source?.url)),V=H(()=>{let e=s.meta;return{repo:en(e?.repo),tree:nn(e?.repo,e?.ref),commit:rn(e?.repo,e?.headSha),pr:tn(e?.repo,e?.pr)}}),Te=H(()=>mn({meta:s.meta,requestText:s.request?.text??``,prOpened:s.prOpened}));function De(e){return typeof e==`number`?Be(e,d.value):``}function Oe(e){return typeof e==`number`?Z(e):void 0}return(e,t)=>{let n=ce,a=Pe,c=be,d=St;return R(),P(f,{title:K(r),nav:`runs`},{leading:S(()=>[...t[4]||=[U(`a`,{class:`back text-sm text-primary no-underline hover:underline`,href:`/runs`},`← All runs`,-1)]]),status:S(()=>[U(`span`,Ka,[l.value===`ended`?(R(),W(j,{key:0},[g.value.ok?(R(),W(`span`,qa,`✓`)):(R(),W(`span`,{key:1,class:J([`chip rounded border px-1.5 text-[0.7rem]`,w[g.value.cls]])},q(g.value.word),3)),U(`span`,{id:`state`,class:J([`dur text-xs tabular-nums`,[te.value?`heat`:`text-muted`,x.value.level>=2?`font-medium`:``]]),style:_(te.value),"data-heat":x.value.level},q(ee.value),15,Ja),b.value?(R(),W(`span`,Ya,`· `+q(b.value),1)):B(``,!0)],64)):(R(),W(j,{key:1},[U(`span`,{id:`statedot`,class:J([`pulse text-[1.1em] leading-none`,ne.value])},`∿`,2),U(`span`,{id:`state`,class:J([`text-xs tabular-nums`,u.value?`text-bad`:`text-muted`]),title:l.value===`running`&&!u.value?`the whole run, since we received the message`:l.value===`finished`?`the agent stopped; the reply is being posted`:void 0},q(T.value),11,Xa)],64))])]),actions:S(()=>[D.value?B(``,!0):(R(),W(`span`,Za,[M(a,{text:`Soft stop: no new steps, the agent writes up what it has`},{default:S(()=>[M(n,{size:`xs`,color:`neutral`,variant:`outline`,label:`Stop`,disabled:O.value,onClick:t[0]||=e=>oe(`soft`)},null,8,[`disabled`])]),_:1}),M(a,{text:`Hard stop: abort now, no summary, free the sandbox`},{default:S(()=>[M(n,{size:`xs`,color:`error`,variant:`outline`,label:`Kill`,disabled:O.value,onClick:t[1]||=e=>oe(`hard`)},null,8,[`disabled`])]),_:1})]))]),default:S(()=>[U(`div`,Qa,[K(s).meta?(R(),W(`div`,$a,[U(`span`,eo,q(K(s).meta.agent),1),U(`span`,to,q(K(s).meta.model),1),K(s).meta.effort?(R(),W(`span`,no,q(K(s).meta.effort)+` effort`,1)):B(``,!0),V.value.repo?(R(),W(`a`,{key:1,class:`text-primary no-underline hover:underline`,href:V.value.repo,target:`_blank`,rel:`noopener noreferrer`},q(K(s).meta.repo),9,ro)):K(s).meta.repo?(R(),W(`span`,io,q(K(s).meta.repo),1)):B(``,!0),V.value.tree?(R(),W(`a`,{key:3,class:`reftag rounded border border-accented px-1.5 text-[0.75rem] text-toned no-underline hover:border-primary hover:text-primary`,href:V.value.tree,target:`_blank`,rel:`noopener noreferrer`,title:`the branch on GitHub`},q(K(s).meta.ref),9,ao)):K(s).meta.ref?(R(),W(`span`,oo,q(K(s).meta.ref),1)):B(``,!0),V.value.commit&&K(s).meta.headSha?(R(),W(`a`,{key:5,class:`sha tabular-nums text-toned no-underline hover:text-primary hover:underline`,href:V.value.commit,target:`_blank`,rel:`noopener noreferrer`,title:`the head commit ${K(s).meta.headSha}`},q(K(an)(K(s).meta.headSha)),9,so)):B(``,!0),V.value.pr?(R(),W(`a`,{key:6,class:`prlink whitespace-nowrap text-primary no-underline hover:underline`,href:V.value.pr,target:`_blank`,rel:`noopener noreferrer`},[M(Mt,{class:`mr-1 align-[-0.125em]`}),L(`#`+q(K(s).meta.pr),1)],8,co)):B(``,!0),K(I).state.ready?(R(),W(`button`,{key:7,type:`button`,class:`reading-diff ml-auto inline-flex cursor-pointer items-center gap-1 whitespace-nowrap text-primary hover:underline focus-visible:outline-2 focus-visible:outline-primary`,"data-testid":`reading-diff-button`,onClick:t[2]||=e=>ge.value=!0},[M(c,{name:`i-lucide-git-compare`,class:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[5]||=L(` Reading diff `,-1)])):B(``,!0)])):B(``,!0),K(s).request?(R(),W(`section`,lo,[U(`h2`,uo,[t[6]||=U(`span`,null,`Request`,-1),K(s).request.source?(R(),W(`span`,fo,[K(s).request.source.channel?(R(),W(j,{key:0},[M(Ke),Ce.value?(R(),W(`a`,{key:0,class:`text-muted no-underline hover:text-primary hover:underline`,href:Ce.value,target:`_blank`,rel:`noopener noreferrer`,title:`open the thread`},`#`+q(K(s).request.source.channel),9,po)):(R(),W(`span`,mo,`#`+q(K(s).request.source.channel),1))],64)):B(``,!0),K(s).request.source.user?(R(),W(`span`,ho,q(K(s).request.source.user),1)):B(``,!0)])):B(``,!0),U(`span`,{class:`ts ml-auto select-none text-xs font-normal normal-case tracking-normal text-dimmed`,title:Oe(K(s).request.at)},q(De(K(s).request.at)),9,go)]),M(Dt,{lines:3},{default:S(()=>[M($,{text:K(s).request.text},null,8,[`text`])]),_:1})])):B(``,!0),K(s).reply&&K(i)?(R(),P(Jr,{key:2,position:`first`,text:K(s).reply.text,caption:Te.value,when:De(K(s).reply.at),"when-title":Oe(K(s).reply.at)},null,8,[`text`,`caption`,`when`,`when-title`])):B(``,!0),K(s).context.length>0?(R(),W(`details`,_o,[U(`summary`,vo,[t[7]||=U(`span`,{class:`chev select-none text-xs text-dimmed transition-transform group-open:rotate-90 motion-reduce:transition-none`},`❯`,-1),t[8]||=U(`span`,null,`Earlier in this thread`,-1),U(`span`,yo,`· `+q(K(s).context.length)+` turn`+q(K(s).context.length===1?``:`s`),1)]),U(`div`,bo,[(R(!0),W(j,null,G(K(s).context,e=>(R(),W(`div`,{key:e.key,class:`turn flex items-baseline gap-3 border-t border-default py-1.5 opacity-85 first-of-type:border-t-0`},[M($,{text:e.text},null,8,[`text`]),U(`span`,{class:`ts ml-auto shrink-0 select-none font-mono text-xs text-dimmed`,title:Oe(e.at)},q(De(e.at)),9,xo)]))),128))])])):B(``,!0),U(`h2`,So,[t[9]||=U(`span`,null,`This run`,-1),pe.value>0?(R(),W(`span`,Co,`· `+q(pe.value)+` step`+q(pe.value===1?``:`s`),1)):B(``,!0),U(`button`,{id:`fold`,type:`button`,class:`ml-auto cursor-pointer font-normal normal-case tracking-normal text-dimmed hover:text-toned focus-visible:outline-2 focus-visible:outline-primary`,"aria-pressed":K(s).allOpen?`true`:`false`,"data-open":K(s).allOpen?`1`:`0`,title:K(s).allOpen?`Close every call card`:`Open every call card`,onClick:F},q(K(s).allOpen?`Collapse all`:`Expand all`),9,wo)]),re.value?(R(),P(Hr,{key:4,vm:re.value,"events-href":K(ie),onReveal:ae},null,8,[`vm`,`events-href`])):B(``,!0),U(`ol`,To,[K(s).placeholder?(R(),W(`li`,Eo,`Waiting for activity…`)):B(``,!0),(R(!0),W(j,null,G(K(s).log,e=>(R(),W(j,{key:e.key},[e.kind===`step`?(R(),P(mr,{key:0,step:e,class:`mt-5 first:mt-0`,onToggleGroup:t=>K(o).toggleGroup(e)},null,8,[`step`,`onToggleGroup`])):e.kind===`turn`?(R(),W(`li`,{key:1,id:`span-${e.turn.spanId}`,class:`turn mt-5 border-l-2 border-(--ui-border-accented)/50 pb-3 pl-3 pt-2`},[U(`div`,Oo,[U(`span`,{class:J([`thought`,e.turn.quick?``:`text-warn`]),title:e.turn.label},`thought `+q(e.turn.chip),11,ko),e.turn.switched?(R(),W(`span`,{key:0,class:`model-switch order-first rounded border border-warn/40 bg-warn/10 px-1.5 font-medium text-warn`,title:`model changed: this turn ran on ${e.turn.model}`},`⇄ `+q(K(wn)(e.turn.model)),9,Ao)):e.turn.showModel?(R(),W(`span`,{key:1,class:`model-badge order-first rounded bg-accented px-1.5 text-[0.68rem] font-medium leading-normal tracking-wider text-muted`,title:e.turn.model},q(K(wn)(e.turn.model)),9,jo)):B(``,!0),(R(!0),W(j,null,G(e.turn.facts,(e,t)=>(R(),W(`span`,{key:t,class:`fact`},q(e),1))),128)),e.note?(R(),W(`span`,Mo,q(e.note),1)):B(``,!0),e.turn.at===void 0?B(``,!0):(R(),W(`span`,{key:3,class:`ts ml-auto select-none`,title:K(Z)(e.turn.at)},q(K(yt)(e.turn.at)),9,No))])],8,Do)):e.kind===`span`?(R(),P(br,{key:2,item:e},null,8,[`item`])):e.kind===`phase`?(R(),W(`li`,{key:3,class:`phase py-0.5 font-mono text-xs`,"data-phase":e.phase},[U(`button`,{type:`button`,class:`phase-head flex w-full cursor-pointer items-baseline gap-2 text-left text-muted hover:text-toned`,"aria-expanded":e.open,onClick:A(t=>K(o).togglePhase(e),[`prevent`])},[U(`span`,Io,q(e.open?`▾`:`▸`),1),U(`span`,{class:J([`swatch inline-block size-2 shrink-0 self-center rounded-[2px]`,K(Cr)(e.phase)]),"aria-hidden":`true`},null,2),U(`span`,Lo,q(K(ln)(e)),1)],8,Fo),e.open?(R(),W(`ul`,Ro,[(R(!0),W(j,null,G(e.rows,e=>(R(),P(br,{key:e.key,item:e},null,8,[`item`]))),128))])):B(``,!0)],8,Po)):e.kind===`followup`?(R(),W(`li`,zo,[U(`h2`,Bo,[t[10]||=U(`span`,null,`↪ Follow-up`,-1),e.input.source?.user?(R(),W(`span`,Vo,[xe(e.input.source.url)?(R(),W(`a`,{key:0,class:`text-muted no-underline hover:text-primary hover:underline`,href:e.input.source.url,target:`_blank`,rel:`noopener noreferrer`,title:`open the message`},q(e.input.source.user),9,Ho)):(R(),W(`span`,Uo,q(e.input.source.user),1))])):B(``,!0),U(`span`,{class:`ts ml-auto select-none text-xs font-normal normal-case tracking-normal text-dimmed`,title:Oe(e.input.at)},q(De(e.input.at)),9,Wo)]),M($,{text:e.input.text},null,8,[`text`])])):(R(),W(`li`,{key:5,class:J([`note mt-4 flex items-baseline gap-3 rounded-md pl-3 pr-(--sb-gutter) py-1.5`,e.replay?`text-dimmed`:`bg-warn/10 text-warn`])},[U(`span`,null,q((e.replay?`… `:`⏱ `)+e.text),1),e.at===void 0?B(``,!0):(R(),W(`span`,{key:0,class:`ts ml-auto select-none font-mono text-xs text-dimmed`,title:K(Z)(e.at)},q(K(yt)(e.at)),9,Go))],2))],64))),128)),ue.value?.kind===`thinking`?(R(),W(`li`,Ko,[t[11]||=U(`span`,{class:`pulse text-[1.1em] leading-none text-info motion-safe:animate-pulse`},`∿`,-1),U(`span`,{class:`badge shrink-0 rounded bg-accented px-1.5 font-mono text-[0.68rem] font-medium leading-normal tracking-wider text-muted`,title:K(s).model??void 0},q(K(wn)(K(s).model)),9,qo),U(`span`,Jo,q(fe.value)+`…`,1),U(`span`,{class:J([`since ml-auto shrink-0 font-mono text-xs tabular-nums`,ue.value.slow?`text-warn`:`text-dimmed`])},q(K(X)(ue.value.elapsedMs,`clock`)),3)])):B(``,!0),U(`li`,{ref_key:`logEnd`,ref:me,"aria-hidden":`true`},null,512)]),K(s).reply&&!K(i)?(R(),P(Jr,{key:5,position:`last`,text:K(s).reply.text,caption:Te.value,when:De(K(s).reply.at),"when-title":Oe(K(s).reply.at)},null,8,[`text`,`caption`,`when`,`when-title`])):B(``,!0)]),M(d,{open:ge.value,"onUpdate:open":t[3]||=e=>ge.value=e,title:K(yi)(K(I).state),ui:{overlay:`z-30`,content:`z-30 w-[min(96vw,90rem)] max-w-none`}},{content:S(({close:e})=>[M(Ga,{data:K(I).state,abridge:K(_e),closable:``,onClose:t=>e()},null,8,[`data`,`abridge`,`onClose`])]),_:1},8,[`open`,`title`])]),_:1},8,[`title`])}}}),Xo=Y({__name:`RunRoutePage`,setup(e){let t=ae(De,null);return(e,n)=>!K(t)||K(t).page===`runNotFound`?(R(),P(ze,{key:0})):(R(),P(Yo,{key:1}))}});export{Xo as default};