@coreplane/switchboard 1.228.0 → 1.230.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 (38) hide show
  1. package/dist/assets/config/config.example.yaml +17 -13
  2. package/dist/assets/deploy/cloudflare-memory/worker.ts +56 -29
  3. package/dist/assets/deploy/cloudflare-resident/worker.ts +80 -36
  4. package/dist/assets/package-lock.json +2400 -26
  5. package/dist/assets/package.json +3 -2
  6. package/dist/assets/source.json +3 -3
  7. package/dist/assets/src/agents/registry.ts +4 -34
  8. package/dist/assets/src/core/authz/actor.ts +24 -6
  9. package/dist/assets/src/core/authz/policy.ts +8 -0
  10. package/dist/assets/src/core/authz/resource.ts +3 -1
  11. package/dist/assets/src/core/authz/types.ts +10 -1
  12. package/dist/assets/src/core/chatMessage.ts +1 -1
  13. package/dist/assets/src/core/coordinator/contract.ts +19 -0
  14. package/dist/assets/src/core/runEvents.ts +38 -15
  15. package/dist/assets/src/core/runFriction.ts +5 -4
  16. package/dist/assets/src/core/runLedger/sessionLog.ts +13 -0
  17. package/dist/assets/src/core/runRecord.ts +33 -0
  18. package/dist/assets/src/core/trace/attrs.ts +3 -0
  19. package/dist/assets/src/core/trace/streamSpans.ts +4 -1
  20. package/dist/assets/src/execution/residentDepCache.ts +34 -8
  21. package/dist/assets/src/execution/residentRebind.ts +27 -4
  22. package/dist/assets/web/dist/.vite/manifest.json +20 -20
  23. package/dist/assets/web/dist/assets/CostsPage-B08bdD-1.js +2 -0
  24. package/dist/assets/web/dist/assets/{ResidentDetailPage-B1Q9pabX.js → ResidentDetailPage-DYxDruS0.js} +1 -1
  25. package/dist/assets/web/dist/assets/{ResidentsIndexPage-CP7U_4aK.js → ResidentsIndexPage-DIBRBmuq.js} +1 -1
  26. package/dist/assets/web/dist/assets/RunRoutePage-B4s8hJlW.js +13 -0
  27. package/dist/assets/web/dist/assets/{RunsIndexPage-Cgp4t4C8.js → RunsIndexPage-CaW07KOf.js} +1 -1
  28. package/dist/assets/web/dist/assets/{ScheduledPage-DthDA2xG.js → ScheduledPage-Cr7269s9.js} +1 -1
  29. package/dist/assets/web/dist/assets/{StatusDot-DDc88Kbs.js → StatusDot-lCLi16zY.js} +1 -1
  30. package/dist/assets/web/dist/assets/{Tooltip-CBapNhsh.js → Tooltip-DKMPwNyy.js} +1 -1
  31. package/dist/assets/web/dist/assets/{dist-BnwSD1cL.js → dist-DRkTB2rt.js} +1 -1
  32. package/dist/assets/web/dist/assets/main-CAVqMbiX.css +1 -0
  33. package/dist/assets/web/dist/assets/{main-ZhQGbZ2E.js → main-CXKOiCOK.js} +2 -2
  34. package/dist/cli.js +8166 -8242
  35. package/package.json +1 -2
  36. package/dist/assets/web/dist/assets/CostsPage-5pl3HB2F.js +0 -2
  37. package/dist/assets/web/dist/assets/RunRoutePage-dCC25f_b.js +0 -12
  38. package/dist/assets/web/dist/assets/main-xLAsdkfB.css +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coreplane/switchboard",
3
- "version": "1.228.0",
3
+ "version": "1.230.0",
4
4
  "description": "Mention it in Slack and an agent reviews the PR, ships the fix, or answers the question — on the model you choose, with its tools running where you decide.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://openswitchboard.dev",
@@ -34,7 +34,6 @@
34
34
  "verify": "npm run build && npm run typecheck && npm run licenses:check && npm test"
35
35
  },
36
36
  "dependencies": {
37
- "@anthropic-ai/sdk": "^0.124.0",
38
37
  "@earendil-works/pi-ai": "0.85.1",
39
38
  "@slack/bolt": "^5.1.0",
40
39
  "aws4fetch": "^1.0.20",
@@ -1,2 +0,0 @@
1
- import{t as e}from"./AppShell-lYVcj-k7.js";import{Ci as t,Lr as n,Xt as r,_n as i,ci as a,cn as o,gn as s,ir as c,ln as l,on as u,r as d,sn as f,un as p,ur as m,vi as h,wi as g,xi as _,yn as v}from"./seed-DeKSHrt2.js";var y=`Durable Objects`,b=`Workers · storage · R2`,x=`LLM (Anthropic)`,S=(e,t=2)=>`$${e.toFixed(t)}`,C=e=>e.workersUsd+e.doRowsUsd+e.doStorageUsd+e.r2Usd+e.workflowsUsd;function ee(e){let t=[];for(let n of e.days)for(let e of Object.keys(n.containers))t.includes(e)||t.push(e);return e.days.some(e=>Object.keys(e.durableObjects).length>0)&&t.push(y),e.days.some(e=>C(e)>0)&&t.push(b),e.llmAvailable&&t.push(x),t}function w(e,t){return t===`Durable Objects`?Object.values(e.durableObjects).reduce((e,t)=>e+t,0)+e.doRequestsUsd:t===`Workers · storage · R2`?C(e):t===`LLM (Anthropic)`?e.llmUsd:e.containers[t]?.total??0}var T=30.4;function te(e){let t=e.range.partialLastDay?e.days.slice(0,-1):e.days,n=e.range.partialLastDay?e.days[e.days.length-1]:void 0,r=t[t.length-1],i=t.slice(-7),a=i.length?i.reduce((e,t)=>e+t.total,0)/i.length:void 0,o=e.account.cloudUsd>0?Math.round(e.totals.cloudUsd/e.account.cloudUsd*100):0;return{...r?{yesterday:{date:r.date,total:r.total}}:{},...n?{today:{date:n.date,total:n.total}}:{},...a===void 0?{}:{avg7:a},projection:O(e,t,n),llm:{range:e.totals.llmUsd,...r?{yesterday:r.llmUsd}:{},...n?{today:{usd:n.llmUsd,estimated:n.llmEstimated}}:{}},accountShare:o}}var E=e=>e.reduce((e,t)=>e+t,0)/e.length;function D(e,t){let n=Date.parse(`${t.date}T00:00:00Z`),r=(e.generatedAt-n)/864e5;return Math.min(1,Math.max(1/24,Number.isFinite(r)?r:1))}function O(e,t,n){let r=n?D(e,n):1,i=t.slice(-7),a=0,o=`full-days`;i.length?a=E(i.map(e=>e.cloudUsd)):n&&(a=n.cloudUsd/r,o=`today`);let s=0,c=`none`,l=0;if(e.llmAvailable){let e=t.findIndex(e=>e.llmUsd>0),i=e===-1?[]:t.slice(e).slice(-7);i.length?(s=E(i.map(e=>e.llmUsd)),c=`closed-days`,l=i.length):n&&n.llmUsd>0&&(s=n.llmUsd/r,c=`today`)}return{monthUsd:(a+s)*T,cloudRate:a,llmRate:s,cloudBasis:o,llmBasis:c,llmClosedDays:l}}function ne(e){let t=`https://dash.cloudflare.com/${e.account.id}`;return{account:t,billing:`${t}/billing`,containers:`${t}/workers/containers`,durableObjects:`${t}/workers/durable-objects`,workers:`${t}/workers-and-pages`,r2:`${t}/r2/overview`,workflows:`${t}/workers/workflows`,worker:e=>`${t}/workers/services/view/${encodeURIComponent(e)}/production/metrics`,bucket:e=>`${t}/r2/default/buckets/${encodeURIComponent(e)}`,anthropic:`https://platform.claude.com/cost`}}var k=e=>e.account.name??`${e.account.id.slice(0,8)}…`;function A(e,t,n){let r=[`${e.date} · total ${S(e.total)}${n?` (partial day)`:``}`];for(let n of t){let t=w(e,n);t<=0||r.push(`${n} ${S(t)}${n===`LLM (Anthropic)`&&e.llmEstimated?` (estimate)`:``}`)}return r.join(`
2
- `)}function j(e){let t=new Date(`${e}T00:00:00Z`);return Number.isNaN(t.getTime())?e:`${[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`][t.getUTCMonth()]} ${t.getUTCDate()}`}function M(e,t,n){let r=t.map(t=>({series:t,usd:w(e,t),estimated:t===`LLM (Anthropic)`&&e.llmEstimated})).filter(e=>e.usd>0).sort((e,t)=>t.usd-e.usd);return{date:e.date,label:j(e.date),partial:n,total:e.total,rows:r}}function N(e,t){let n={t:12,r:12,b:30,l:48},r=960-n.l-n.r,i=260-n.t-n.b,a=e.days,o=Math.max(1e-9,...a.map(e=>e.total))*1.08,s=r/Math.max(1,a.length),c=Math.min(10,s*.28),l=e=>n.t+i-e/o*i,u=Array.from({length:5},(e,t)=>{let n=o/4*t;return{y:Number(l(n).toFixed(1)),label:S(n)}}),d=[],f=[],p=[];return a.forEach((r,o)=>{let u=0,m=n.l+o*s+c/2,h=s-c;f.push({x:Number((n.l+o*s).toFixed(1)),y:n.t,width:Number(s.toFixed(1)),height:i,title:A(r,t,e.range.partialLastDay&&o===a.length-1),tip:M(r,t,e.range.partialLastDay&&o===a.length-1)}),t.forEach((e,t)=>{let n=w(r,e);if(n<=0)return;let i=l(u+n),a=l(u),o=Math.max(0,a-i-2);d.push({seriesIndex:t,x:Number(m.toFixed(1)),y:Number(i.toFixed(1)),width:Number(h.toFixed(1)),height:Number(o.toFixed(1))}),u+=n}),(a.length<=16||o%Math.ceil(a.length/16)===0)&&p.push({x:Number((m+h/2).toFixed(1)),label:r.date.slice(5)})}),{width:960,height:260,gridLines:u,segments:d,dayHovers:f,dayLabels:p,axisY:Number(l(0).toFixed(1)),marginLeft:n.l,marginRight:n.r}}function re(e){let t=e.totals.byResource,n=[[`Memory (provisioned while awake)`,t.memory],[`vCPU (active use only)`,t.cpu],[`Durable Object duration + requests`,t.durableObjects],[`Disk (provisioned while awake)`,t.disk],[`Workers requests + CPU`,t.workers],[`Durable Object SQLite rows`,t.doRows],[`Durable Object SQLite storage`,t.doStorage],[`R2 storage + operations`,t.r2],[`Workflow steps + state`,t.workflows]],r=n.reduce((e,t)=>e+t[1],0)||1;return n.map(([e,t])=>({label:e,usd:t,percent:t/r*100}))}var P=[`fill-[#4478b8] dark:fill-[#7aa7e0]`,`fill-[#c8823b] dark:fill-[#e0a95a]`,`fill-[#4c8c57] dark:fill-[#6fae7a]`,`fill-[#b8963e] dark:fill-[#d4b45a]`,`fill-[#b0568c] dark:fill-[#d489b8]`,`fill-[#6b7bcc] dark:fill-[#98a5e6]`,`fill-[#d05252] dark:fill-[#e07a74]`,`fill-[#3e8e96] dark:fill-[#6fb9c0]`],F=[`bg-[#4478b8] dark:bg-[#7aa7e0]`,`bg-[#c8823b] dark:bg-[#e0a95a]`,`bg-[#4c8c57] dark:bg-[#6fae7a]`,`bg-[#b8963e] dark:bg-[#d4b45a]`,`bg-[#b0568c] dark:bg-[#d489b8]`,`bg-[#6b7bcc] dark:bg-[#98a5e6]`,`bg-[#d05252] dark:bg-[#e07a74]`,`bg-[#3e8e96] dark:bg-[#6fb9c0]`],I={class:`overflow-x-auto`},L=[`viewBox`],R=[`x1`,`x2`,`y1`,`y2`],z=[`x`,`y`],B=[`x`,`y`,`width`,`height`],V=[`aria-label`,`x`,`y`,`width`,`height`,`onPointerenter`,`onPointermove`],H=[`x`,`y`],U=[`x1`,`x2`,`y1`,`y2`],W={class:`tip-head mb-1.5 flex items-baseline justify-between gap-3 border-b border-muted pb-1.5`},G={class:`font-medium text-highlighted`},K={key:0,class:`ml-1.5 font-normal text-dimmed`},q={class:`font-medium text-highlighted`},J={class:`tip-name truncate text-muted`},Y={class:`text-highlighted`},X={class:`tip-usd`},ie={key:0,class:`ml-1 text-dimmed`},Z=256,Q=12,ae=v({__name:`CostChart`,props:{report:{},series:{}},setup(e){let n=e,i=u(()=>N(n.report,n.series)),o=e=>44+e*20,d=a(null),v=a(null);function y(e,t){let n=v.value,r=n?.getBoundingClientRect(),i=t.clientX-(r?.left??0),a=t.clientY-(r?.top??0),s=n?.clientWidth??0,c=n?.clientHeight??0,l=o(e.tip.rows.length),u=s>0&&i+Q+Z>s,f=c>0&&a+Q+l>c;d.value={x:Math.max(0,u?i-Q-Z:i+Q),y:Math.max(0,f?a-Q-l:a+Q),data:e.tip}}return(e,n)=>(c(),p(`div`,{ref_key:`host`,ref:v,class:`chart-host relative`},[f(`div`,I,[(c(),p(`svg`,{class:`block h-auto w-full font-mono`,viewBox:`0 0 ${i.value.width} ${i.value.height}`,role:`img`,"aria-label":`Daily cost, stacked by component`},[(c(!0),p(r,null,m(i.value.gridLines,(e,t)=>(c(),p(r,{key:`g${t}`},[f(`line`,{class:`stroke-(--ui-border-muted)`,x1:i.value.marginLeft,x2:i.value.width-i.value.marginRight,y1:e.y,y2:e.y},null,8,R),f(`text`,{class:`fill-(--ui-text-dimmed) text-[11px] tabular-nums`,x:i.value.marginLeft-8,y:e.y+4,"text-anchor":`end`},g(e.label),9,z)],64))),128)),(c(!0),p(r,null,m(i.value.segments,(e,t)=>(c(),p(`rect`,{key:`s${t}`,class:_([`seg hover:opacity-85`,h(P)[e.seriesIndex%h(P).length]]),x:e.x,y:e.y,width:e.width,height:e.height},null,10,B))),128)),(c(!0),p(r,null,m(i.value.dayHovers,(e,t)=>(c(),p(`rect`,{key:`h${t}`,class:`day fill-transparent`,role:`img`,"aria-label":e.title,x:e.x,y:e.y,width:e.width,height:e.height,onPointerenter:t=>y(e,t),onPointermove:t=>y(e,t),onPointerleave:n[0]||=e=>d.value=null},null,40,V))),128)),(c(!0),p(r,null,m(i.value.dayLabels,(e,t)=>(c(),p(`text`,{key:`d${t}`,class:`fill-(--ui-text-dimmed) text-[11px]`,x:e.x,y:i.value.height-10,"text-anchor":`middle`},g(e.label),9,H))),128)),f(`line`,{class:`stroke-(--ui-border)`,x1:i.value.marginLeft,x2:i.value.width-i.value.marginRight,y1:i.value.axisY,y2:i.value.axisY},null,8,U)],8,L))]),d.value?(c(),p(`div`,{key:0,class:`chart-tip pointer-events-none absolute z-10 w-64 rounded-md border border-default bg-elevated px-3 py-2 font-mono text-xs tabular-nums whitespace-nowrap shadow-lg`,role:`tooltip`,style:t({left:`${d.value.x}px`,top:`${d.value.y}px`})},[f(`div`,W,[f(`span`,G,[s(g(d.value.data.label),1),d.value.data.partial?(c(),p(`span`,K,`partial day`)):l(``,!0)]),f(`span`,q,g(h(S)(d.value.data.total)),1)]),(c(!0),p(r,null,m(d.value.data.rows,e=>(c(),p(`div`,{key:e.series,class:`tip-row flex items-baseline justify-between gap-3 leading-5`},[f(`span`,J,g(e.series),1),f(`span`,Y,[f(`span`,X,g(h(S)(e.usd)),1),e.estimated?(c(),p(`span`,ie,`est.`)):l(``,!0)])]))),128))],4)):l(``,!0)],512))}}),oe={class:`mb-4 flex flex-wrap items-center gap-x-4 gap-y-2`},se={class:`flex items-center gap-1`,"aria-label":`Range`},ce={key:0,class:`rounded-md bg-accented px-2.5 py-1 font-mono text-xs font-medium tabular-nums text-highlighted`,"aria-current":`page`},le=[`href`],ue={key:0,class:`flex items-center gap-1`,"aria-label":`Cost groups`},de={key:0,class:`rounded-md bg-accented px-2.5 py-1 text-xs font-medium text-highlighted`,"aria-current":`page`},fe=[`href`],pe={class:`font-mono text-sm tabular-nums text-muted`},me={class:`mb-5 grid grid-cols-[repeat(auto-fit,minmax(190px,1fr))] gap-3`},he={key:0,class:`grid gap-0.5 rounded-lg border border-default bg-elevated px-4 py-3.5`},ge={class:`font-mono text-2xl font-medium tabular-nums`},_e={class:`text-xs text-muted`},ve={key:1,class:`grid gap-0.5 rounded-lg border border-default bg-elevated px-4 py-3.5`},ye={class:`font-mono text-2xl font-medium tabular-nums`},be={class:`text-xs text-muted`},xe={class:`grid gap-0.5 rounded-lg border border-default bg-elevated px-4 py-3.5`},Se={class:`font-mono text-2xl font-medium tabular-nums`},Ce={class:`text-xs text-muted`},we={class:`grid gap-0.5 rounded-lg border border-default bg-elevated px-4 py-3.5`},Te={class:`font-mono text-2xl font-medium tabular-nums`},Ee={class:`text-xs text-muted`},De={class:`grid gap-0.5 rounded-lg border border-default bg-elevated px-4 py-3.5`},Oe={class:`font-mono text-2xl font-medium tabular-nums`},ke={class:`text-xs text-muted`},Ae={class:`grid gap-0.5 rounded-lg border border-default bg-elevated px-4 py-3.5`},je={class:`font-mono text-2xl font-medium tabular-nums`},Me={class:`text-xs text-muted`},Ne=[`href`,`title`],Pe=[`href`],Fe={class:`mb-5 grid gap-3 rounded-lg border border-default bg-elevated px-5 py-4`},Ie={class:`flex flex-wrap items-baseline justify-between gap-x-4 gap-y-2`},Le={class:`legend flex flex-wrap gap-x-4 gap-y-1.5 text-xs text-muted`},Re=[`href`,`title`],ze={key:0,class:`text-xs text-warn`},Be={key:1,class:`text-xs text-muted`},Ve={class:`mb-5 grid gap-3 rounded-lg border border-default bg-elevated px-5 py-4`},He={class:`w-full border-collapse font-mono text-[0.8125rem] tabular-nums`},Ue={class:`px-2.5 py-1.5`},We=[`href`],Ge={class:`px-2.5 py-1.5 text-right`},Ke={class:`px-2.5 py-1.5 text-right`},qe={class:`w-2/5 px-2.5 py-1.5`},Je={class:`mb-5 grid gap-3 rounded-lg border border-default bg-elevated px-5 py-4`},Ye={open:``},Xe={class:`mt-2.5 overflow-x-auto`},Ze={class:`data w-full min-w-[38rem] border-collapse whitespace-nowrap font-mono text-[0.8125rem] tabular-nums`},Qe=[`title`],$e={key:0,class:`text-xs text-dimmed`},et={key:1,class:`text-xs text-dimmed`},tt={class:`border-b border-muted px-2.5 py-1.5 text-right font-medium`},$={class:`text-xs text-muted`},nt={class:`rounded bg-accented px-1 py-0.5`},rt={class:`border-t border-default pt-3.5 text-xs text-dimmed`},it={class:`mt-2 grid gap-1.5`},at=[`href`],ot={key:2},st=[`href`],ct={key:2},lt=[`href`],ut=[`href`],dt=v({__name:`CostsPage`,setup(a){let v=d(`costs`),y=u(()=>v?.report??null),b=u(()=>v?.groups??[]),x=u(()=>y.value?ee(y.value):[]),C=u(()=>y.value?te(y.value):null),T=u(()=>y.value?re(y.value):[]),E=u(()=>y.value?ne(y.value):null),D=u(()=>y.value?k(y.value):``);function O(e){let t=E.value;if(t){if(/^(Memory|vCPU|Disk)/.test(e))return t.containers;if(e.startsWith(`Durable Object`))return t.durableObjects;if(e.startsWith(`Workers`))return t.workers;if(e.startsWith(`R2`))return t.r2;if(e.startsWith(`Workflow`))return t.workflows}}function A(e){let t=E.value;if(t)return e===`LLM (Anthropic)`?t.anthropic:e===`Durable Objects`?t.durableObjects:e===`Workers · storage · R2`?t.workers:t.containers}let j=u(()=>{let e=y.value,t=C.value;if(!e||!t)return``;let n=t.projection,r=`cloud ${S(n.cloudRate)}/day`,i=n.cloudBasis===`today`?`cloud from today so far`:`cloud from the last 7 full days`;if(!e.llmAvailable)return`${r} × 30.4 · ${i} · before plan fees and included allowances`;let a=`LLM ${S(n.llmRate)}/day`,o=n.llmBasis===`closed-days`?`LLM from ${n.llmClosedDays} closed day${n.llmClosedDays===1?``:`s`}`:n.llmBasis===`today`?`LLM from today so far`:`no LLM spend in range`;return`${r} + ${a} · × 30.4 · ${n.cloudBasis===`today`&&n.llmBasis===`today`?`both from today so far`:`${i} · ${o}`}`}),M=u(()=>y.value?[...y.value.days].reverse():[]),N=[1,7,30,90],P=e=>e===1?`today`:`${e}d`,I=u(()=>{let e=y.value,t=C.value;if(!e||!t)return``;if(!e.llmAvailable)return`LLM spend not configured`;let n=[];return t.llm.yesterday!==void 0&&n.push(`yesterday ${S(t.llm.yesterday)}`),t.llm.today&&n.push(`today ${S(t.llm.today.usd)}${t.llm.today.estimated?` (estimate)`:``}`),n.length?n.join(` · `):`in range`});function L(e){let t=new Date(`${e}T00:00:00Z`);return Number.isNaN(t.getTime())?e:`${[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`][t.getUTCMonth()]} ${t.getUTCDate()}`}return(a,u)=>y.value&&C.value?(c(),o(e,{key:0,title:`${y.value.label} spend`,nav:`costs`},{default:n(()=>[f(`div`,oe,[f(`nav`,se,[(c(),p(r,null,m(N,e=>(c(),p(r,{key:e},[e===y.value.range.days?(c(),p(`span`,ce,g(P(e)),1)):(c(),p(`a`,{key:1,class:`rounded-md px-2.5 py-1 font-mono text-xs tabular-nums text-muted no-underline hover:bg-elevated hover:text-highlighted`,href:`/costs/${y.value.group}?days=${e}`},g(P(e)),9,le))],64))),64))]),b.value.length>1?(c(),p(`nav`,ue,[(c(!0),p(r,null,m(b.value,e=>(c(),p(r,{key:e},[e===y.value.group?(c(),p(`span`,de,g(e),1)):(c(),p(`a`,{key:1,class:`rounded-md px-2.5 py-1 text-xs text-muted no-underline hover:bg-elevated hover:text-highlighted`,href:`/costs/${e}`},g(e),9,fe))],64))),128))])):l(``,!0),f(`p`,pe,[s(g(L(y.value.range.from))+` → `+g(L(y.value.range.to))+` · `+g(y.value.range.days)+`d`,1),y.value.range.partialLastDay?(c(),p(r,{key:0},[s(` · today partial`)],64)):l(``,!0)])]),f(`section`,me,[C.value.yesterday?(c(),p(`div`,he,[u[0]||=f(`span`,{class:`font-mono text-[0.6875rem] font-medium uppercase tracking-widest text-dimmed`},`Yesterday`,-1),f(`span`,ge,g(h(S)(C.value.yesterday.total)),1),f(`span`,_e,g(C.value.yesterday.date)+` · last full day`,1)])):(c(),p(`div`,ve,[u[1]||=f(`span`,{class:`font-mono text-[0.6875rem] font-medium uppercase tracking-widest text-dimmed`},`Today so far`,-1),f(`span`,ye,g(C.value.today?h(S)(C.value.today.total):`—`),1),f(`span`,be,g(C.value.today?`${C.value.today.date} · partial day, UTC`:`no day in range`),1)])),f(`div`,xe,[u[2]||=f(`span`,{class:`font-mono text-[0.6875rem] font-medium uppercase tracking-widest text-dimmed`},`7-day average`,-1),f(`span`,Se,g(C.value.avg7===void 0?`—`:h(S)(C.value.avg7)),1),f(`span`,Ce,g(C.value.avg7===void 0?`no full day yet in this range`:`per day, full days only`),1)]),f(`div`,we,[u[3]||=f(`span`,{class:`font-mono text-[0.6875rem] font-medium uppercase tracking-widest text-dimmed`},`Projected month`,-1),f(`span`,Te,g(h(S)(C.value.projection.monthUsd,0)),1),f(`span`,Ee,g(j.value),1)]),f(`div`,De,[u[4]||=f(`span`,{class:`font-mono text-[0.6875rem] font-medium uppercase tracking-widest text-dimmed`},`LLM spend`,-1),f(`span`,Oe,g(y.value.llmAvailable?h(S)(C.value.llm.range):`—`),1),f(`span`,ke,g(I.value),1)]),f(`div`,Ae,[u[6]||=f(`span`,{class:`font-mono text-[0.6875rem] font-medium uppercase tracking-widest text-dimmed`},`Share of account`,-1),f(`span`,je,g(C.value.accountShare)+`%`,1),f(`span`,Me,[s(g(h(S)(y.value.totals.cloudUsd))+` of `+g(h(S)(y.value.account.cloudUsd))+` on `,1),E.value?(c(),p(`a`,{key:0,class:`text-primary hover:underline`,href:E.value.account,target:`_blank`,rel:`noopener noreferrer`,title:`Cloudflare account ${y.value.account.id}`},g(D.value),9,Ne)):l(``,!0),u[5]||=s(` · Cloudflare spend in range · `,-1),E.value?(c(),p(`a`,{key:1,class:`text-primary hover:underline`,href:E.value.billing,target:`_blank`,rel:`noopener noreferrer`},`billing`,8,Pe)):l(``,!0)])])]),f(`section`,Fe,[f(`div`,Ie,[u[7]||=f(`div`,null,[f(`h2`,{class:`text-[0.9375rem] font-medium`},`Daily cost`),f(`p`,{class:`text-sm text-muted`},`Stacked by component · USD list price`)],-1),f(`div`,Le,[(c(!0),p(r,null,m(x.value,(e,t)=>(c(),p(`a`,{key:e,class:`inline-flex items-center gap-1.5 no-underline hover:text-highlighted hover:underline`,href:A(e),target:`_blank`,rel:`noopener noreferrer`,title:`Open where ${e} is billed`},[f(`i`,{class:_([`inline-block size-2.5 rounded-xs`,h(F)[t%h(F).length]])},null,2),s(g(e),1)],8,Re))),128))])]),i(ae,{report:y.value,series:x.value},null,8,[`report`,`series`]),y.value.llmAvailable?y.value.days.some(e=>e.llmEstimated)?(c(),p(`p`,Be,[u[9]||=s(` A day the Anthropic cost report has not closed yet (today, and yesterday until a few hours after midnight UTC) shows its LLM figure as an estimate: the hourly usage report priced at list. The closed days are the cost report itself. `,-1),y.value.days.some(e=>e.llmUnpricedTokens>0)?(c(),p(r,{key:0},[s(` Some tokens ran under a model this page has no price for and are not in the estimate. `)],64)):l(``,!0)])):l(``,!0):(c(),p(`p`,ze,[...u[8]||=[s(` LLM spend not configured — set `,-1),f(`code`,null,`ANTHROPIC_ADMIN_KEY`,-1),s(` and the group's `,-1),f(`code`,null,`anthropicWorkspaceId`,-1),s(` to layer it in. `,-1)]]))]),f(`section`,Ve,[u[10]||=f(`div`,null,[f(`h2`,{class:`text-[0.9375rem] font-medium`},`What each cloud dollar buys`)],-1),f(`table`,He,[f(`tbody`,null,[(c(!0),p(r,null,m(T.value,e=>(c(),p(`tr`,{key:e.label,class:`border-b border-muted`},[f(`td`,Ue,[O(e.label)?(c(),p(`a`,{key:0,class:`no-underline hover:text-highlighted hover:underline`,href:O(e.label),target:`_blank`,rel:`noopener noreferrer`,title:`Open where this is billed on Cloudflare`},g(e.label),9,We)):(c(),p(r,{key:1},[s(g(e.label),1)],64))]),f(`td`,Ge,g(h(S)(e.usd)),1),f(`td`,Ke,g(Math.round(e.percent))+`%`,1),f(`td`,qe,[f(`i`,{class:`block h-2.5 rounded-xs bg-primary opacity-75`,style:t({width:`${e.percent.toFixed(1)}%`})},null,4)])]))),128))])])]),f(`section`,Je,[f(`details`,Ye,[u[13]||=f(`summary`,{class:`cursor-pointer text-sm text-muted`},`Table view — daily cost by component (USD)`,-1),f(`div`,Xe,[f(`table`,Ze,[f(`thead`,null,[f(`tr`,null,[u[11]||=f(`th`,{class:`border-b border-muted bg-(--ui-bg-muted) px-2.5 py-1.5 text-left text-xs font-medium text-muted`},` Date `,-1),(c(!0),p(r,null,m(x.value,e=>(c(),p(`th`,{key:e,class:`border-b border-muted bg-(--ui-bg-muted) px-2.5 py-1.5 text-right text-xs font-medium text-muted`},g(e),1))),128)),u[12]||=f(`th`,{class:`border-b border-muted bg-(--ui-bg-muted) px-2.5 py-1.5 text-right text-xs font-medium text-muted`},` Total `,-1)])]),f(`tbody`,null,[(c(!0),p(r,null,m(M.value,e=>(c(),p(`tr`,{key:e.date},[f(`td`,{class:`border-b border-muted px-2.5 py-1.5`,title:e.date},[s(g(L(e.date))+` `,1),y.value.range.partialLastDay&&e.date===y.value.range.to?(c(),p(`span`,$e,`(partial day`+g(e.llmEstimated?` · LLM estimated`:``)+`)`,1)):e.llmEstimated?(c(),p(`span`,et,`(LLM estimated)`)):l(``,!0)],8,Qe),(c(!0),p(r,null,m(x.value,t=>(c(),p(`td`,{key:t,class:`border-b border-muted px-2.5 py-1.5 text-right`},g(h(S)(h(w)(e,t),3)),1))),128)),f(`td`,tt,g(h(S)(e.total,3)),1)]))),128))])])])]),f(`p`,$,[u[14]||=s(` Machine-readable twin: `,-1),f(`code`,nt,`GET /costs/`+g(y.value.group)+`.json`,1),u[15]||=s(` (same Access gate). `,-1)])]),f(`footer`,rt,[f(`details`,null,[u[23]||=f(`summary`,{class:`cursor-pointer text-muted`},`How these numbers are computed`,-1),f(`div`,it,[u[21]||=f(`div`,null,[f(`b`,null,`Live.`),s(` Both billing sources are read live from this page — nothing cached, nothing stored. Cloudflare bills vCPU on active use only; memory and disk bill on the provisioned size for every second a container is awake. LLM spend is the Anthropic Admin API cost report for this group's workspace (gross, USD); a day the cost report has not closed is the Admin API usage report, hourly, priced at Anthropic list per model (input, output, cache writes, cache reads) and marked as an estimate. `)],-1),u[22]||=f(`div`,null,[f(`b`,null,`Method.`),s(` Cloudflare GraphQL Analytics, every meter a Workers deployment is billed on: `),f(`code`,null,`containersUsageAdaptiveGroups`),s(` (cpuTimeSec, allocatedMemory, allocatedDisk per app per UTC day), `),f(`code`,null,`durableObjectsPeriodicGroups`),s(` (billable `),f(`code`,null,`duration`),s(` GB-s and SQLite rows read and written per namespace), `),f(`code`,null,`durableObjectsInvocationsAdaptiveGroups`),s(` (requests per namespace), `),f(`code`,null,`durableObjectsSqlStorageGroups`),s(` (bytes stored), `),f(`code`,null,`workersInvocationsAdaptive`),s(` (requests, CPU time), `),f(`code`,null,`r2StorageAdaptiveGroups`),s(` and `),f(`code`,null,`r2OperationsAdaptiveGroups`),s(` (bytes stored, class A/B operations). Prices: vCPU $0.000020/s, memory $0.0000025/GiB-s, disk $0.00000007/GB-s, DO duration $12.50 per million GB-s, DO requests $0.15/M, SQLite rows $0.001/M read and $1.00/M written, DO storage $0.20/GB-month, Workers $0.30/M requests and $0.02/M CPU-ms, R2 $0.015/GB-month, $4.50/M class A and $0.36/M class B (deletes free). Storage is the day's peak, prorated over a 30.44-day month. Gross list price — plan fees and included allowances are not subtracted; Workers Logs volume has no analytics dataset and is not priced. `)],-1),f(`div`,null,[u[16]||=f(`b`,null,`Scope.`,-1),u[17]||=s(` Attributed to this group: the Workers `,-1),(c(!0),p(r,null,m(y.value.attribution.workers,(e,t)=>(c(),p(r,{key:e},[t>0?(c(),p(r,{key:0},[s(`, `)],64)):l(``,!0),E.value?(c(),p(`a`,{key:1,class:`font-mono hover:underline`,href:E.value.worker(e),target:`_blank`,rel:`noopener noreferrer`},g(e),9,at)):(c(),p(`code`,ot,g(e),1))],64))),128)),s(`, every Durable Object namespace they host (`+g(Object.keys(y.value.attribution.durableObjectNamespaces).length)+`), the R2 buckets named after them (`,1),(c(!0),p(r,null,m(Object.keys(y.value.attribution.r2Buckets),(e,t)=>(c(),p(r,{key:e},[t>0?(c(),p(r,{key:0},[s(`, `)],64)):l(``,!0),E.value?(c(),p(`a`,{key:1,class:`font-mono hover:underline`,href:E.value.bucket(e),target:`_blank`,rel:`noopener noreferrer`},g(e),9,st)):(c(),p(`code`,ct,g(e),1))],64))),128)),Object.keys(y.value.attribution.r2Buckets).length===0?(c(),p(r,{key:0},[s(`none`)],64)):l(``,!0),u[18]||=s(`), and the container apps mapped in `,-1),f(`code`,null,`costs.groups.`+g(y.value.group),1),s(` (`+g(Object.keys(y.value.attribution.containerApps).length)+`). Everything else in the account is priced the same way into the account total, which is what "share of account" divides by. Every figure above links to where it is billed: the `,1),E.value?(c(),p(`a`,{key:1,class:`hover:underline`,href:E.value.account,target:`_blank`,rel:`noopener noreferrer`},`Cloudflare dashboard`,8,lt)):l(``,!0),u[19]||=s(` for the account `,-1),f(`code`,null,g(y.value.account.id),1),s(g(y.value.account.name?` (${y.value.account.name})`:``)+`, and `,1),E.value?(c(),p(`a`,{key:2,class:`hover:underline`,href:E.value.anthropic,target:`_blank`,rel:`noopener noreferrer`},`Anthropic's cost page`,8,ut)):l(``,!0),u[20]||=s(` for the LLM line. `,-1)])])])])]),_:1},8,[`title`])):l(``,!0)}});export{dt as default};
@@ -1,12 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-BnwSD1cL.js","assets/AppShell-lYVcj-k7.js","assets/seed-DeKSHrt2.js","assets/main-ZhQGbZ2E.js","assets/main-xLAsdkfB.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 te,Jn as x,Lr as S,Mr as C,N as w,Or as ne,P as re,Pr as ie,Q as T,Qn as E,Rn as ae,Si as oe,U as D,Ut as se,Wn as O,Wt as k,Xt as A,_ as ce,_n as j,a as le,at as ue,b as de,ci as M,cn as N,d as fe,di as pe,dr as P,et as me,f as he,ft as ge,g as _e,gn as F,h as I,hi as ve,ir as L,it as ye,j as be,kn as xe,ln as R,m as Se,mi as z,nr as Ce,nt as we,oi as B,on as V,or as Te,p as H,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-CBapNhsh.js";import{r as Fe,t as Ie}from"./main-ZhQGbZ2E.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=ue(n,`open`,t,{defaultValue:n.defaultOpen,passive:n.open===void 0}),i=M(),a=M(),{modal:o,unmountOnHide:s}=ve(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)=>P(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)=>(L(),N(K(h),O(t,{type:e.as===`button`?`button`:void 0,onClick:r[0]||=e=>K(n).onOpenChange(!1)}),{default:S(()=>[P(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)=>(L(),N(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(()=>[j(K(p),O({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(()=>[P(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=re(i),{forwardRef:s,currentElement:c}=w(),l=V(()=>n.present?c.value:void 0);r(l);let u=V(()=>{let{present:e,...t}=n;return t});return C(()=>n.present,(e,t)=>{!e&&t&&a.triggerElement.value?.focus()}),(e,t)=>(L(),N($e,O({...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(()=>[P(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=re(t);w();let i=Q(),a=M(!1),o=M(!1),s=V(()=>{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)=>(L(),N($e,O({...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(()=>[P(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=re(r),{forwardRef:o}=w();return(e,t)=>(L(),N(K(be),{present:e.forceMount||K(i).open.value,"force-mount":e.forceMount||!K(i).unmountOnHide.value},{default:S(({present:t})=>[K(i).modal.value?Ne((L(),N(et,O({key:0,ref:K(o),present:K(i).unmountOnHide.value||t},{...n,...K(a),...e.$attrs}),{default:S(()=>[P(e.$slots,`default`)]),_:2},1040,[`present`])),[[ee,K(i).unmountOnHide.value||t]]):Ne((L(),N(tt,O({key:1,ref:K(o),present:K(i).unmountOnHide.value||t},{...n,...K(a),...e.$attrs}),{default:S(()=>[P(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)=>(L(),N(K(h),O(t,{id:K(n).descriptionId}),{default:S(()=>[P(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)=>(L(),N(K(h),{as:e.as,"as-child":e.asChild,"data-state":K(r).open.value?`open`:`closed`,style:{"pointer-events":`auto`},onPointerdown:t[0]||=k(()=>{},[`left`,`self`,`prevent`])},{default:S(()=>[P(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?(L(),N(K(be),{key:0,present:e.forceMount||K(t).open.value,"force-mount":e.forceMount||!K(t).unmountOnHide.value},{default:S(({present:r})=>[Ne(j(it,O(e.$attrs,{ref:K(n),as:e.as,"as-child":e.asChild,present:K(t).unmountOnHide.value||r}),{default:S(()=>[P(e.$slots,`default`)]),_:2},1040,[`as`,`as-child`,`present`]),[[ee,K(t).unmountOnHide.value||r]])]),_:3},8,[`present`,`force-mount`])):R(`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)=>(L(),N(K(ke),oe(xe(t)),{default:S(()=>[P(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)=>(L(),N(K(h),O(t,{id:K(n).titleId}),{default:S(()=>[P(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)=>(L(),N(K(h),O(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(()=>[P(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=V(()=>t.tabStopId||r),c=V(()=>n.currentTabStopId.value===a.value),{getItems:u,CollectionItem:d}=de();E(()=>{t.focusable&&n.onFocusableItemAdd()}),Ce(()=>{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)=>(L(),N(K(d),null,{default:S(()=>[j(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(()=>[P(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}=ve(r),c=t(s);w();let l=ue(r,`modelValue`,i,{defaultValue:r.defaultValue,passive:r.modelValue===void 0}),u=M(),d=pe(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)=>(L(),N(K(h),{dir:K(c),"data-orientation":K(a),"as-child":e.asChild,as:e.as},{default:S(()=>[P(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=V(()=>pt(r.baseId,t.value)),a=V(()=>mt(r.baseId,t.value)),o=V(()=>t.value===r.modelValue.value),s=M(o.value);return E(()=>{r.registerContent(t.value),requestAnimationFrame(()=>{s.value=!1})}),x(()=>{r.unregisterContent(t.value)}),(e,t)=>(L(),N(K(be),{present:e.forceMount||o.value,"force-mount":``},{default:S(({present:t})=>[j(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?P(e.$slots,`default`,{key:0}):R(`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=we(),a=M({size:null,thickness:null,position:null}),o=M([]);C(()=>[r.modelValue.value,r?.dir.value],()=>{s()},{immediate:!0,flush:`post`}),ie(()=>{o.value=Array.from(r.tabsList.value?.querySelectorAll(`[role="tab"]`)||[])}),ye(V(()=>[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`?(L(),N(K(h),O({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(()=>[P(e.$slots,`default`)]),_:3},16,[`style`])):R(`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}=ve(e),{forwardRef:n,currentElement:r}=w(),i=ut();return i.tabsList=r,(e,r)=>(L(),N(K(d),{"as-child":``,orientation:K(i).orientation.value,dir:K(i).dir.value,loop:K(t)},{default:S(()=>[j(K(h),{ref:K(n),role:`tablist`,"as-child":e.asChild,as:e.as,"aria-orientation":K(i).orientation.value},{default:S(()=>[P(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=V(()=>pt(r.baseId,t.value)),a=V(()=>r.contentIds.value.has(t.value)?mt(r.baseId,t.value):void 0),o=V(()=>t.value===r.modelValue.value);return(e,t)=>(L(),N(K(lt),{"as-child":``,focusable:!e.disabled,active:o.value},{default:S(()=>[j(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]||=k(t=>{!e.disabled&&t.ctrlKey===!1?K(r).changeModelValue(e.value):t.preventDefault()},[`left`]),onKeydown:t[1]||=se(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(()=>[P(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){return e>0?e<1024?`${e} B`:e<1048576?`${(Math.round(e/102.4)/10).toFixed(1)} KB`:e<1073741824?`${(Math.round(e/104857.6)/10).toFixed(1)} MB`:`${(Math.round(e/107374182.4)/10).toFixed(1)} GB`:`0 B`}function xt(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 St={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)]`}}]},Ct={__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=ce(`slideover`,n),{t:o}=b(),s=te(),c=_e(ge(a,`open`,`defaultOpen`,`modal`,`unmountOnHide`),r),l=je(z(()=>a.portal)),u=z(()=>a.content),d=V(()=>a.dismissible?{pointerDownOutside:xt}:[`interactOutside`,`escapeKeyDown`].reduce((e,t)=>(e[t]=e=>{e.preventDefault(),r(`close:prevent`)},e),{})),f=V(()=>I({extend:St,...s.ui?.slideover||{}})({transition:a.transition,side:a.side,inset:a.inset}));return(e,t)=>(L(),N(K(Ze),oe(xe(K(c))),{default:S(({open:n,close:c})=>[i.default?(L(),N(K(ct),{key:0,"as-child":``,class:J(K(a).class)},{default:S(()=>[P(e.$slots,`default`,{open:n})]),_:2},1032,[`class`])):R(``,!0),j(K(ot),O(K(l),{"force-mount":K(l).disabled&&K(a).unmountOnHide===!1||void 0}),{default:S(()=>[j(K(Oe),null,{default:S(()=>[K(a).overlay?(L(),N(K(at),{key:0,"data-slot":`overlay`,class:J(f.value.overlay({class:K(a).ui?.overlay}))},null,8,[`class`])):R(``,!0),j(K(nt),O({"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?(L(),N(K(Fe),{key:0},{default:S(()=>[!K(a).title&&!i.title?(L(),N(K(st),{key:0})):i.content?(L(),N(K(st),{key:1},{default:S(()=>[P(e.$slots,`title`,{},()=>[F(q(K(a).title),1)])]),_:3})):R(``,!0),!K(a).description&&!i.description?(L(),N(K(rt),{key:2})):i.content?(L(),N(K(rt),{key:3},{default:S(()=>[P(e.$slots,`description`,{},()=>[F(q(K(a).description),1)])]),_:3})):R(``,!0)]),_:3})):R(``,!0),P(e.$slots,`content`,{close:c},()=>[i.header||K(a).title||i.title||K(a).description||i.description||K(a).close||i.close?(L(),W(`div`,{key:0,"data-slot":`header`,class:J(f.value.header({class:K(a).ui?.header}))},[P(e.$slots,`header`,{close:c},()=>[K(a).title||i.title||K(a).description||i.description?(L(),W(`div`,{key:0,"data-slot":`wrapper`,class:J(f.value.wrapper({class:K(a).ui?.wrapper}))},[K(a).title||i.title?(L(),N(K(st),{key:0,"data-slot":`title`,class:J(f.value.title({class:K(a).ui?.title}))},{default:S(()=>[P(e.$slots,`title`,{},()=>[F(q(K(a).title),1)])]),_:3},8,[`class`])):R(``,!0),K(a).description||i.description?(L(),N(K(rt),{key:1,"data-slot":`description`,class:J(f.value.description({class:K(a).ui?.description}))},{default:S(()=>[P(e.$slots,`description`,{},()=>[F(q(K(a).description),1)])]),_:3},8,[`class`])):R(``,!0)],2)):R(``,!0),P(e.$slots,`actions`),K(a).close||i.close?(L(),N(K(Qe),{key:1,"as-child":``},{default:S(()=>[P(e.$slots,`close`,{ui:f.value},()=>[K(a).close?(L(),N(le,O({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`])):R(``,!0)])]),_:2},1024)):R(``,!0)])],2)):R(``,!0),U(`div`,{"data-slot":`body`,class:J(f.value.body({class:K(a).ui?.body}))},[P(e.$slots,`body`,{close:c})],2),i.footer?(L(),W(`div`,{key:1,"data-slot":`footer`,class:J(f.value.footer({class:K(a).ui?.footer}))},[P(e.$slots,`footer`,{close:c})],2)):R(``,!0)])]),_:2},1040,[`data-side`,`class`])]),_:2},1024)]),_:2},1040,[`force-mount`])]),_:3},16))}},wt=[`data-expanded`,`data-overflowing`],Tt={key:0,class:`fade pointer-events-none absolute inset-x-0 bottom-6 h-10`},Et={key:1,class:`mt-1 flex justify-start`},Dt=[`aria-expanded`],Ot=u(Y({__name:`ExpandableText`,props:{lines:{default:5}},setup(e){let t=e,n=M(!1),r=M(!1),i=M(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))}),x(()=>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)=>(L(),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)})},[P(e.$slots,`default`,{},void 0,!0)],6),!n.value&&r.value?(L(),W(`div`,Tt)):R(``,!0),r.value||n.value?(L(),W(`div`,Et,[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:k(c,[`stop`])},q(n.value?`Show less`:`Show more`),9,Dt)])):R(``,!0)],10,wt))}}),[[`__scopeId`,`data-v-ce3bfa89`]]);function kt(e,t){let n=e.ownerDocument;e.textContent=``;let r=String(t??``).replace(/\r\n?/g,`
3
- `).split(`
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
- `);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
- `))}}f(e,r)}var $=Y({__name:`MarkdownText`,props:{text:{}},setup(e){let t=e,n=M(null);function r(){let e=n.value;if(e)try{kt(e,t.text)}catch{e.textContent=t.text}}return E(r),C(()=>t.text,r),(e,t)=>(L(),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))}}),At={},jt={viewBox:`0 0 16 16`,class:`inline-block size-[1em] shrink-0`,"aria-hidden":`true`};function Mt(e,t){return L(),W(`svg`,jt,[...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 Nt=u(At,[[`render`,Mt]]);function Pt(){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
- `).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),messageId:a(n.messageId),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`reference`:{let e=i(n.messages);return!a(n.url)||!a(n.channelName)||e===void 0?[]:[{kind:`reference`,url:a(n.url),channelName:a(n.channelName),messages:e,text:a(n.text),at:i(n.at)}]}case`notes`:return[{kind:`note`,text:a(n.text),noteKind:`notes`,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`artifact`:{let e=a(n.key),t=a(n.name);if(!e||!t)return[];let r={key:e,name:t,size:i(n.size)??0,contentType:a(n.contentType),at:i(n.at)},o=a(n.messageId),s=a(n.callId),c=n.direction===`in`&&o?{...r,direction:`in`,messageId:o}:n.direction===`out`&&s?{...r,direction:`out`,callId:s}:void 0;return c?[{kind:`artifact`,artifact:c}]:[]}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 Ft=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`]),It=new Set([`run.observe_workspace`,`run.pr_post_step`,`run.review_post_step`,`run.reading_diff_join`,`run.pr_description_join`]),Lt=new Set([`request`,`run.agent`,`ship.round`,`run.settle_reviewed_head`,`run.description_turn`,`post.card_close`,`post.reply`]),Rt=new Set([`run.reading_diff`]);function zt(e,t){if(Rt.has(e))return{kind:`background`};if(Lt.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(Ft.has(e)||e.startsWith(`dispatch.workspace.attach.`))return{kind:`counted`,bucket:`getting_ready`};if(It.has(e))return{kind:`counted`,bucket:`finishing_up`};if(e.startsWith(`tool.`)||e.startsWith(`mcp.`))return{kind:`counted`,bucket:`tools`}}var Bt={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`,"rebind-checkout":`checking out the thread's own branch`,"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`,"boot-id":`reading the container's identity`,touch:`touching a marker`,nproc:`counting CPUs`,mutex_wait:`waiting for the workspace`,kill:`stopping the previous step`};Object.keys(Bt);function Vt(e){return Object.prototype.hasOwnProperty.call(Bt,e)?e:void 0}function Ht(e){let t=Vt(e);if(t!==void 0)return Bt[t];if(e.endsWith(`-stale-sweep`)){let t=Vt(e.slice(0,-12));if(t!==void 0)return`clearing leftovers before ${Bt[t]}`}}var Ut={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`},Wt=`a Switchboard step`;function Gt(e){if(e in Ut)return Ut[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:Wt}for(let t of[`dispatch.workspace.attach.`,`run.command.`])if(e.startsWith(t))return Ht(e.slice(t.length))??`a Switchboard step`;return Wt}var Kt=`A-Za-z0-9:@._-`;RegExp(`^[${Kt}]{1,128}$`),RegExp(`[^${Kt}]`,`g`);function qt(e){return e.type===`span_start`||e.type===`span_end`}function Jt(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 Yt(){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 Xt=[/\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 Zt(e){return Xt.some(t=>t.test(e))}var Qt=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,$t=/^[0-9a-f]{7,40}$/,en=/^(?![.-])(?!.*\.\.)(?!.*\/\/)(?!.*@\{)(?!.*\.lock$)(?!.*[./]$)[\w][\w./-]*$/;function tn(e){return e&&Qt.test(e)?`https://github.com/${e}`:void 0}function nn(e,t){let n=tn(e);if(!(!n||t===void 0||!Number.isInteger(t)||t<=0))return`${n}/pull/${t}`}function rn(e,t){let n=tn(e);if(n&&t&&en.test(t))return`${n}/tree/${t.split(`/`).map(encodeURIComponent).join(`/`)}`}function an(e,t){let n=tn(e);if(n&&t&&$t.test(t))return`${n}/commit/${t}`}function on(e){return e.slice(0,7)}function sn(e){if(e===`slack.receive`||e.startsWith(`dispatch.`))return`getting_ready`;let t=zt(e,`agent`);return t?.kind===`counted`&&t.bucket===`finishing_up`?`finishing_up`:void 0}function cn(e){return e===`request`||e===`run.agent`}var ln={getting_ready:`Getting ready`,finishing_up:`Finishing up`};function un(e){let t=e.rows.length,n=`${t} step${t===1?``:`s`}`,r=ln[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 dn(e,t){let n=t.split(`/`).map(encodeURIComponent).join(`/`);return`${e.urlBase}${n}${e.token?`?t=${encodeURIComponent(e.token)}`:``}`}function fn(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 pn(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 mn(e,t,n){let r=!!e.model&&t!==null&&Dn(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 hn(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 gn(e){let{meta:t,prOpened:n}=e,r=t?.repo&&tn(t.repo)?t.repo:void 0;if(t?.agent===`review`){if(Zt(e.requestText))return{text:`verdict, Slack only`};if(r&&t.pr!==void 0){let e=nn(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?nn(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 _n(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 vn(e={}){let t=e.openTags&&e.openTags.length>0?e.openTags:[`failed`,`infra`],n=Pt(),r=B({request:null,meta:null,context:[],references:[],log:[],reply:null,prOpened:null,placeholder:!0,allOpen:!1,stopMode:null,model:null,firstAt:null,lastAt:null,lastAtWall:null,elided:[],traceVersion:0}),i=Yt(),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=B({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 te(e){return o.get(e.index)??ee(e)}function x(e,t){let n=te(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=B(_n(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){x(e,t);return}Object.assign(n,_n(t,n.open)),v(t.tags)&&(n.open=!0);let r=o.get(e.index);r&&b(r)}function C(e,t){p&&=(r.log.push({kind:`turn`,key:_(`turn`),turn:p,note:e,...t===void 0?{}:{noteHref:t}}),null)}let w=new Map,ne=B([]);function re(e){if(e.direction===`in`){w.get(e.messageId)?.files.push(e);return}ne.push(e);let t=u.get(e.callId);t&&((t.files??=[]).push(e),t.open=!0)}function ie(e){switch(r.placeholder=!1,e.kind){case`input`:{let t={text:e.text,messageId:e.messageId,at:e.at,...e.source?{source:e.source}:{},files:[]};r.request?r.log.push({kind:`followup`,key:_(`followup`),input:t}):r.request=t,w.set(t.messageId,t);return}case`step`:ee(e.step);return;case`call`:x(e.step,e.call);return;case`result`:S(e.step,e.call);return;case`turn`:C(``),p=mn(e,r.model,m),p.model&&(m=!0),e.model&&!(r.model!==null&&Dn(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`:te(e.step).items.push({kind:`skill`,skill:e.skill});return;case`artifact`:re(e.artifact);return;case`context`:r.context.push({key:_(`ctx`),at:e.at,text:e.text});return;case`reference`:r.references.push({key:_(`ref`),at:e.at,url:e.url,channelName:e.channelName,messages:e.messages,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`)&&se(e.mode);return;case`replay_note`:r.log.push({kind:`note`,key:_(`note`),replay:!0,text:e.text});return;case`span`:{if(cn(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=B({kind:`span`,key:_(`span`),spanId:e.spanId,text:Gt(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=sn(e.name);if(i){let t=l.get(i);t||(t={group:B({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`,`#reply`),r.reply={text:e.text,at:e.at,files:ne};return}}function T(e){let t=l.get(e);t&&!t.toggled&&(t.group.open=!1)}function E(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),qt(t)&&Jt(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))ie(t)}function ae(){for(let e of u.values())if(e.status===`running`)return e;return null}function oe(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 D(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 se(e){r.stopMode=e}function O(e){r.elided.push(e),r.log.push({kind:`note`,key:_(`note`),replay:!0,text:pn(e)}),r.placeholder=!1,r.traceVersion++}return{state:r,handle:E,noteElided:O,spanSet:()=>[...a.values()],losses:e=>i.losses({windowStart:e,elided:r.elided}),pendingCall:ae,flushPendingTurn:C,closePhases(){T(`getting_ready`),T(`finishing_up`)},setAllOpen:oe,togglePhase(e){e.open=!e.open;let t=l.get(e.phase);t&&(t.toggled=!0)},reveal:D,callHeadline:e=>u.get(e)?.headline,toggleGroup(e){e.manual=!0,e.groupOpen=!e.groupOpen},toggleCall(e){e.open=!e.open},markStopping:se,opensByDefault:v}}function yn(e,t){return e.lastAt===null||e.lastAtWall===null?null:e.lastAt+(t-e.lastAtWall)}function bn(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 xn(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 Sn(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 Cn(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 wn=Symbol(`sb-runner-clock`),Tn=Symbol(`sb-artifact-links`),En=Symbol(`sb-reply-landed`);function Dn(e,t){return e===t||!e.includes(`/`)!=!t.includes(`/`)&&On(e)===On(t)}function On(e){if(!e)return`model`;let t=e.lastIndexOf(`/`);return(t===-1?e:e.slice(t+1))||e}var kn=6e4;function An(e,t,n){let r=yn(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>=kn}}var jn=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]),Mn=65536,Nn=new Set([`application/json`,`application/x-ndjson`,`application/xml`,`application/yaml`]);function Pn(e){return jn.has(e)?`image`:e.startsWith(`video/`)?`video`:e.startsWith(`audio/`)?`audio`:e.startsWith(`text/`)||Nn.has(e)?`text`:`other`}var Fn=[`data-open-images`],In={class:`mb-1.5 flex items-baseline gap-2 font-mono text-[0.68rem] font-medium uppercase tracking-wider text-dimmed`},Ln={class:`count font-normal normal-case tracking-normal`},Rn={class:`m-0 flex list-none flex-col gap-1.5 p-0`},zn=[`data-direction`,`data-kind`,`data-open`,`data-expired`],Bn={class:`flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5 font-mono text-xs`},Vn=[`title`],Hn=[`aria-expanded`,`aria-controls`,`onClick`],Un={key:1,class:`name font-medium text-toned`},Wn={class:`fact text-dimmed`},Gn={class:`fact text-dimmed`},Kn={key:2,class:`expired text-warn`},qn=[`id`,`aria-hidden`],Jn={class:`min-h-0 overflow-hidden`},Yn=[`src`,`alt`,`onError`],Xn=[`src`,`onError`],Zn=[`src`,`onError`],Qn={key:3,class:`mt-1.5`},$n={key:0,class:`text max-h-96 overflow-auto rounded border border-(--ui-border) bg-elevated p-2.5 font-mono text-xs whitespace-pre-wrap break-words text-toned`},er={key:1,class:`text-xs text-bad`},tr={key:2,class:`mt-1 text-xs text-dimmed`},nr={key:4,class:`other mt-1.5 flex flex-wrap items-baseline gap-x-3 gap-y-1 font-mono text-xs text-dimmed`},rr=[`href`,`download`],ir=0,ar=Y({__name:`MessageFiles`,props:{files:{},openImages:{type:Boolean,default:!0}},setup(e){let t=e,n=ae(Tn,null),r=B(new Set),i=B(new Set),a=B(new Set),o=B(new Map);function s(){for(let e of t.files)t.openImages&&Pn(e.contentType)===`image`&&!i.has(e.key)&&!a.has(e.key)&&(i.add(e.key),a.add(e.key))}s(),C(()=>[t.files,t.files.length],s),ir+=1;let c=`files-${ir}`,l=V(()=>t.files.map((e,t)=>({...e,href:n?dn(n,e.key):null,kind:Pn(e.contentType),open:i.has(e.key),mounted:a.has(e.key),expired:r.has(e.key),panelId:`${c}-file-${t}`})));function u(e){if(e.href&&!e.expired){if(i.has(e.key)){i.delete(e.key);return}i.add(e.key),a.add(e.key),e.kind===`text`&&!o.has(e.key)&&d(e.key,e.href)}}async function d(e,t){o.set(e,{text:``,truncated:!1});try{let n=await fetch(t,{credentials:`same-origin`});if(n.status===410){r.add(e),o.delete(e);return}if(!n.ok||!n.body)throw Error(`HTTP ${n.status}`);let i=n.body.getReader(),a=new TextDecoder,s=``,c=0,l=!1;for(;;){let{value:e,done:t}=await i.read();if(t)break;let n=Mn-c,r=e.byteLength>n?e.subarray(0,n):e;if(s+=a.decode(r,{stream:!0}),c+=r.byteLength,c>=65536){l=e.byteLength>n||!(await i.read()).done,await i.cancel();break}}o.set(e,{text:s,truncated:l})}catch(t){o.set(e,{text:``,truncated:!1,error:t instanceof Error?t.message:String(t)})}}function f(e){r.add(e),i.delete(e)}let p=e=>e===`out`?`↑ sent`:`↓ received`,m=e=>e===`out`?`sent by the run`:`received from the thread`;return(t,r)=>(L(),W(`div`,{class:`files mt-3 border-t border-(--ui-border) pt-2`,"data-open-images":e.openImages?`1`:`0`},[U(`h3`,In,[r[0]||=U(`span`,null,`Files`,-1),U(`span`,Ln,`· `+q(e.files.length)+` file`+q(e.files.length===1?``:`s`),1)]),U(`ul`,Rn,[(L(!0),W(A,null,G(l.value,e=>(L(),W(`li`,{key:e.key,class:`artifact`,"data-direction":e.direction,"data-kind":e.kind,"data-open":e.open?`1`:`0`,"data-expired":e.expired?`1`:`0`},[U(`div`,Bn,[U(`span`,{class:`dir shrink-0 select-none text-dimmed`,title:m(e.direction)},q(p(e.direction)),9,Vn),e.href&&!e.expired?(L(),W(`button`,{key:0,type:`button`,class:`name flex cursor-pointer items-baseline gap-1.5 border-0 bg-transparent p-0 font-mono text-xs font-medium text-primary hover:underline focus-visible:outline-2 focus-visible:outline-primary`,"aria-expanded":e.open?`true`:`false`,"aria-controls":e.panelId,onClick:t=>u(e)},[U(`span`,{class:J([`chev inline-block select-none text-[0.65rem] text-dimmed transition-transform motion-reduce:transition-none`,e.open?`rotate-90`:``]),"aria-hidden":`true`},`❯`,2),U(`span`,null,q(e.name),1)],8,Hn)):(L(),W(`span`,Un,q(e.name),1)),U(`span`,Wn,q(K(bt)(e.size)),1),U(`span`,Gn,q(e.contentType),1),e.expired&&K(n)?(L(),W(`span`,Kn,`expired after `+q(K(n).retentionDays)+` days`,1)):R(``,!0)]),e.href&&!e.expired?(L(),W(`div`,{key:0,id:e.panelId,class:`panel grid transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none`,style:_({gridTemplateRows:e.open?`1fr`:`0fr`}),"aria-hidden":e.open?`false`:`true`},[U(`div`,Jn,[e.mounted?(L(),W(A,{key:0},[e.kind===`image`?(L(),W(`img`,{key:0,class:`preview mt-1.5 max-h-96 max-w-full rounded border border-(--ui-border)`,src:e.href,alt:e.name,loading:`lazy`,onError:t=>f(e.key)},null,40,Yn)):e.kind===`video`?(L(),W(`video`,{key:1,class:`preview mt-1.5 max-h-96 max-w-full rounded border border-(--ui-border) bg-black`,src:e.href,controls:``,playsinline:``,preload:`metadata`,onError:t=>f(e.key)},null,40,Xn)):e.kind===`audio`?(L(),W(`audio`,{key:2,class:`preview mt-1.5 w-full max-w-xl`,src:e.href,controls:``,preload:`metadata`,onError:t=>f(e.key)},null,40,Zn)):e.kind===`text`?(L(),W(`div`,Qn,[o.get(e.key)&&!o.get(e.key).error?(L(),W(`pre`,$n,q(o.get(e.key).text),1)):R(``,!0),o.get(e.key)?.error?(L(),W(`p`,er,` could not read the file: `+q(o.get(e.key).error),1)):o.get(e.key)?.truncated?(L(),W(`p`,tr,` showing the first `+q(K(bt)(K(Mn)))+` of `+q(K(bt)(e.size)),1)):R(``,!0)])):(L(),W(`div`,nr,[U(`span`,null,`no preview for `+q(e.contentType),1),U(`a`,{class:`download inline-block rounded border border-default px-2 py-0.5 font-medium text-toned no-underline hover:bg-accented hover:text-primary focus-visible:outline-2 focus-visible:outline-primary`,href:e.href,download:e.name},`Download `+q(K(bt)(e.size)),9,rr)]))],64)):R(``,!0)])],12,qn)):R(``,!0)],8,zn))),128))])],8,Fn))}}),or=[`id`,`open`,`title`,`data-status`,`data-heat`],sr={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`},cr={key:2,class:`dollar shrink-0 select-none text-dimmed`},lr={key:3,class:`tool shrink-0 rounded bg-accented px-1.5 text-xs leading-normal text-muted`},ur={key:0,class:`cmd brief min-w-0 flex-1 truncate text-info`},dr={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`},fr={key:5,class:`cmd min-w-0 flex-1`},pr={class:`facts ml-auto flex shrink-0 gap-2.5 text-xs tabular-nums text-muted`},mr={key:0,class:`fact elapsed`,title:`since this call started (runner clock)`},hr={key:0,class:`over rounded bg-bad/15 px-1 font-medium text-bad`},gr={key:1,class:`over rounded bg-bad/15 px-1 font-medium text-bad`},_r={class:`body`},vr={key:1,class:`none px-3 py-1.5 text-xs italic text-dimmed`},yr={key:2,class:`none px-3 py-1.5 text-xs italic text-dimmed`},br=Y({__name:`CallCard`,props:{call:{}},setup(e){let t=e,n=ae(wn,null),r=ae(En,null),i=V(()=>{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`)}),a=V(()=>We(t.call.durationMs,`tool`,t.call.timedOut)),o=V(()=>qe(a.value)),s=V(()=>t.call.durationMs===void 0?-1:t.call.facts.length-1);function c(){t.call.open=!t.call.open}return(t,n)=>(L(),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":a.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:k(c,[`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`?(L(),W(`span`,sr)):(L(),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?(L(),W(`span`,cr,`$`)):(L(),W(`span`,lr,q(e.call.tool),1)),e.call.chipOnly?(L(),W(`span`,fr)):(L(),W(A,{key:4},[e.call.open?(L(),W(`code`,dr,q(e.call.title),1)):(L(),W(`code`,ur,q(e.call.headline),1))],64)),U(`span`,pr,[i.value?(L(),W(`span`,mr,q(i.value),1)):R(``,!0),(L(!0),W(A,null,G(e.call.facts,(t,n)=>(L(),W(A,{key:n},[n===s.value&&a.value.over?(L(),W(`span`,hr,`timed out`)):R(``,!0),U(`span`,{class:J([`fact`,[e.call.status!==`ok`&&n===0?`text-bad`:``,n===s.value&&a.value.over?`font-medium text-bad`:``,n===s.value&&o.value?`heat`:``,n===s.value&&a.value.level>=2&&!a.value.over?`font-medium`:``]]),style:_(n===s.value?o.value:void 0)},q(t),7)],64))),128)),a.value.over&&s.value===-1?(L(),W(`span`,gr,`timed out`)):R(``,!0)])],2),U(`div`,_r,[e.call.hasResult&&e.call.output?(L(),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?(L(),W(`div`,vr,`no output`)):(L(),W(`div`,yr,`no output yet`)),e.call.files&&e.call.files.length>0?(L(),N(ar,{key:3,class:`mx-3.5 mb-2.5`,files:e.call.files,"open-images":!K(r)},null,8,[`files`,`open-images`])):R(``,!0)])],10,or))}}),xr=[`title`],Sr=[`title`],Cr={class:`skillname whitespace-nowrap font-mono font-medium text-skill`},wr={key:0,class:`skilldesc min-w-0 flex-1 truncate text-xs text-muted`},Tr={class:`facts ml-auto flex shrink-0 gap-2.5 font-mono text-xs text-muted`},Er=[`href`],Dr={class:`fact`},Or=Y({__name:`StepItems`,props:{items:{}},setup(e){return(t,n)=>(L(!0),W(A,null,G(e.items,(e,t)=>(L(),W(A,{key:t},[e.kind===`call`?(L(),N(br,{key:0,call:e.call},null,8,[`call`])):e.kind===`quiet`?(L(),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,xr)):(L(),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)},[n[0]||=U(`span`,{class:`skillmark shrink-0 select-none text-xs`},`📚`,-1),U(`span`,Cr,`skill `+q(e.skill.name),1),e.skill.description?(L(),W(`span`,wr,q(e.skill.description),1)):R(``,!0),U(`span`,Tr,[e.skill.source?(L(),W(`a`,{key:0,class:`fact text-primary hover:underline`,href:e.skill.source,target:`_blank`,rel:`noopener noreferrer`},`source`,8,Er)):R(``,!0),U(`span`,Dr,q(K(bt)(e.skill.bodyBytes))+` into context`,1)])],8,Sr))],64))),128))}}),kr=[`id`,`data-live`],Ar={class:`head flex items-baseline gap-x-6 pb-1.5 pr-(--sb-gutter)`},jr={class:`min-w-0 flex-1`},Mr={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`},Nr=[`data-heat`,`title`],Pr=[`title`],Fr=[`title`],Ir={key:2,class:`nonar font-sans text-sm italic text-dimmed`},Lr=[`title`],Rr={key:0,class:`narration flex items-baseline gap-3 pb-1.5 pr-(--sb-gutter)`},zr={key:1,class:`narration flex items-baseline gap-3 pb-1.5 pr-(--sb-gutter)`},Br={class:`nonar flex-1 font-sans text-sm italic text-dimmed`},Vr={class:`calls flex flex-col gap-2`},Hr=[`open`,`data-group-open`],Ur=[`title`],Wr=[`data-ok`,`data-bad`,`data-infra`,`data-running`],Gr=[`data-heat`],Kr={class:`gbody flex flex-col gap-2 pb-1 pt-1.5`},qr=Y({__name:`StepBlock`,props:{step:{}},emits:[`toggleGroup`],setup(e,{emit:t}){let n=e,r=t,i=V(()=>n.step.items.filter(e=>e.kind===`call`)),a=V(()=>i.value.length>=2),o=V(()=>{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=V(()=>hn(o.value)),c=V(()=>i.value.some(e=>e.kind===`call`&&e.call.timedOut)),l=V(()=>We(o.value.ms,`tool`,c.value)),u=V(()=>qe(l.value)),d=V(()=>n.step.turn?We(n.step.turn.durationMs,`turn`):void 0),f=V(()=>d.value?qe(d.value):void 0),p=V(()=>{let e=i.value[0];return e?.kind===`call`?e.call.startedAt:void 0});return(t,n)=>(L(),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`,Ar,[U(`div`,jr,[e.step.turn?(L(),W(`div`,Mr,[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,Nr),e.step.turn.switched?(L(),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(On)(e.step.turn.model)),9,Pr)):e.step.turn.showModel?(L(),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(On)(e.step.turn.model)),9,Fr)):R(``,!0),(L(!0),W(A,null,G(e.step.turn.facts,(e,t)=>(L(),W(`span`,{key:t,class:`fact`},q(e),1))),128))])):e.step.narration===null?(L(),W(`span`,Ir,q(e.step.note),1)):(L(),N($,{key:1,text:e.step.narration},null,8,[`text`]))]),e.step.at===void 0?R(``,!0):(L(),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,Lr))]),e.step.turn&&e.step.narration!==null?(L(),W(`div`,Rr,[j($,{text:e.step.narration},null,8,[`text`])])):e.step.turn&&e.step.narration===null&&!e.step.turn.facts.length?(L(),W(`div`,zr,[U(`span`,Br,q(e.step.note),1)])):R(``,!0),U(`div`,Vr,[a.value?(L(),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]||=k(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,Wr),o.value.ms>0?(L(),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?(L(),W(A,{key:0},[F(`timed out · `)],64)):R(``,!0),F(q(K(X)(o.value.ms,`clock`)),1)],14,Gr)):R(``,!0)],8,Ur),U(`div`,Kr,[j(Or,{items:e.step.items},null,8,[`items`])])],8,Hr)):(L(),N(Or,{key:0,items:e.step.items},null,8,[`items`]))])],10,kr))}}),Jr=[`id`],Yr={class:`what`},Xr={key:0,class:`text-dimmed`},Zr={key:1,class:`dur tabular-nums text-dimmed`},Qr=[`title`],$r=Y({__name:`SpanRow`,props:{item:{}},setup(e){return(t,n)=>(L(),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`,Yr,q(e.item.text),1),e.item.open?(L(),W(`span`,Xr,`…`)):e.item.durationMs===void 0?R(``,!0):(L(),W(`span`,Zr,q(K(X)(e.item.durationMs,`precise`)),1)),e.item.at===void 0?R(``,!0):(L(),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,Qr))],8,Jr))}}),ei={"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`},ti={getting_ready:`getting ready`,finishing_up:`finishing up`};function ni(e){return ei[ti[e]]}var ri={id:`timeline`,class:`block mb-4 rounded-lg border border-default bg-(--ui-bg-muted) px-(--sb-gutter) py-3`,"data-testid":`timeline`},ii={class:`mb-2 flex items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},ai={class:`ml-auto flex items-baseline gap-3 font-normal normal-case tracking-normal`},oi=[`href`],si={class:`lede font-mono text-sm text-toned`},ci={class:`shape tabular-nums`},li={key:0,class:`current text-muted`},ui={key:0,class:`note mt-0.5 text-xs text-muted`},di=[`aria-label`],fi=[`title`,`data-term`],pi={class:`legend mt-2 flex flex-wrap gap-x-4 gap-y-1 font-mono text-xs`},mi=[`title`,`data-term`],hi={class:`term text-muted`},gi={class:`ms tabular-nums text-toned`},_i=[`title`],vi={class:`ranked mt-1 flex flex-col gap-1 font-mono text-xs`},yi={class:`ms w-14 shrink-0 tabular-nums text-toned`},bi=[`href`,`data-anchor`,`onClick`],xi=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)=>(L(),W(`section`,ri,[U(`h2`,ii,[n[0]||=U(`span`,null,`Where the time went`,-1),U(`span`,ai,[e.eventsHref?(L(),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,oi)):R(``,!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`,si,[U(`span`,ci,q(e.vm.shown?e.vm.total:e.vm.lede),1),e.vm.current?(L(),W(`span`,li,` · `+q(e.vm.current),1)):R(``,!0)]),(L(!0),W(A,null,G(e.vm.captions,e=>(L(),W(`p`,{key:e,class:`caption mt-0.5 text-xs text-muted`},q(e),1))),128)),e.vm.note?(L(),W(`p`,ui,q(e.vm.note),1)):R(``,!0),e.vm.shown?(L(),W(A,{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},[(L(!0),W(A,null,G(e.vm.bar,(e,t)=>(L(),W(`div`,{key:t,class:J([`seg h-full`,[K(ei)[e.term],e.hatched?`paint-hatched hatched`:``]]),style:_({width:`${e.pct}%`}),title:i(e),"data-term":e.term},null,14,fi))),128))],8,di),U(`ul`,pi,[(L(!0),W(A,null,G(e.vm.legend,e=>(L(),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(ei)[e.term]])},null,2),U(`span`,hi,q(e.term),1),U(`span`,gi,q(e.text),1)],8,mi))),128))]),e.vm.ranked.length>0?(L(),W(A,{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,_i),U(`ol`,vi,[(L(!0),W(A,null,G(e.vm.ranked,(e,t)=>(L(),W(`li`,{key:t,class:`flex items-baseline gap-2`},[U(`span`,yi,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:k(t=>r(`reveal`,e.anchor),[`prevent`])},q(e.label),9,bi),(L(!0),W(A,null,G(e.facts,e=>(L(),W(`span`,{key:e,class:`fact shrink-0 rounded border border-accented px-1 text-dimmed`},q(e),1))),128))]))),128))])],64)):R(``,!0)],64)):R(``,!0)]))}}),Si=[`data-position`],Ci={class:`mb-2 flex items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-ok`},wi=[`href`],Ti={key:1,class:`caption font-normal normal-case tracking-normal text-dimmed`},Ei=[`title`],Di=Y({__name:`ReplyBlock`,props:{text:{},caption:{},when:{},whenTitle:{},position:{},files:{}},setup(e){return(t,n)=>(L(),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`,Ci,[n[0]||=U(`span`,null,`Reply`,-1),e.caption.href?(L(),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,wi)):(L(),W(`span`,Ti,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,Ei)]),j($,{text:e.text},null,8,[`text`]),e.files.length>0?(L(),N(ar,{key:0,files:e.files},null,8,[`files`])):R(``,!0)],10,Si))}});function Oi(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),zt(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=zt(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(ki(e.from,n)),m.add(ki(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`&&ki(e.from,n)<=r&&ki(e.to,n)>=i)){_+=a;continue}if(t.losses.some(e=>e.kind===`elided`&&ki(e.from,n)<=r&&ki(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 ki(e,t){return Math.min(t.end,Math.max(t.start,e))}function Ai(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 ji(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 Mi(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 Ni={"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`},Pi=`Ranked by each step's own time, its children excluded — the bar counts every instant once.`,Fi=`currently delivering`,Ii=`getting ready: not recorded (too large)`,Li=`no timing data`,Ri=`not loaded (the record has the full shape)`,zi={getting_ready:`getting ready`,thinking:`thinking`,tools:`in tools`,finishing_up:`finishing up`};function Bi(e){let{spans:t,window:n,owner:r}=e,i=e.phase!==`live`,a=Oi(t,{window:n,owner:r,finished:i,losses:e.losses}),o=Ai(a),s=X(o.totalS*1e3,`clock`),c=t.find(e=>e.name===`request`&&e.parentSpanId===void 0),l=e.phase===`live`?Hi(t,r,n):void 0,u=Wi(e,l),d=l?Gt(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:Pi,debug:f,lede:s,shown:!1,bar:[],legend:[],ranked:[],note:Li};let p={total:s,current:u,openStep:d,captions:[Mi(`before`,Vi(c,`queuedBeforeMs`)),Mi(`behind`,Vi(c,`queuedBehindMs`))].filter(e=>e!==void 0),rankedNote:Pi,debug:f};if(!c)return{...p,lede:s,shown:!1,bar:[],legend:[],ranked:[],note:i?Ii:``};let m=t=>t===`not recorded`?`not recorded${e.truncated?` (too large)`:``}`:t===`not loaded`?Ri:t,h=ji(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(Ki(a))}`:s,_=h?o.items.map(({term:t,s:n})=>({term:t,text:X(n*1e3,`clock`),definition:t===`not recorded`&&e.truncated?`${Ni[t]} (too large)`:Ni[t]})):[];return{...p,lede:g,shown:h,bar:h?qi(a,l):[],legend:_,ranked:h?Ji(t,c,r,n,e.callTitle):[],note:``}}function Vi(e,t){let n=e?.attrs[t];return typeof n==`number`&&Number.isFinite(n)?n:void 0}function Hi(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=zt(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),zt(r.name,n)?.kind===`background`)return!0;r=r.parentSpanId?t.get(r.parentSpanId):void 0}return!1}function Wi(e,t){return e.phase===`delivering`?Fi:e.phase===`ended`?Sn(e.delivery??{}):t?`currently ${zi[t.bucket]} ${X(t.elapsedMs,`clock`)}`:``}function Gi(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 Ki(e){let t=[`getting ready`,-1];for(let n of Gi(e))n[1]>t[1]&&(t=n);return t[0]}function qi(e,t){let n=[],r=t=>e.windowMs>0?t/e.windowMs*100:0;for(let[i,a]of Gi(e))if(!(a<=0)){if(t&&zi[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 Ji(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`||zt(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-Yi(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??Gt(r.name),ms:d,facts:Xi(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 Yi(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 Xi(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 Zi(e){return e===`command`?`command`:`agent`}function Qi(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 $i=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,ea=/^[0-9a-f]{7,40}$/;function ta(e){if(!e.repo||!$i.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&&ea.test(e.headSha)&&(n.commit=e.number!==void 0&&n.pr?`${t}/pull/${e.number}/commits/${e.headSha}`:`${t}/commit/${e.headSha}`),n}function na(e){return e.find(e=>e.poweredBy===`meat`)??e.find(e=>e.poweredBy===`git`)??null}function ra(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 ia(e){return`The recorded diff was cut at ${e.toLocaleString(`en-US`)} characters; open the full diff on GitHub for the rest`}function aa(e){return e===`meat`?`reading diff · meat`:`full diff · git`}function oa(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 sa=e=>typeof e==`object`&&!!e,ca=e=>typeof e==`string`&&e!==``,la=e=>typeof e==`number`&&Number.isInteger(e)&&e>0;function ua(e){for(let t of e.split(/\n\s*\n/)){let e=t.split(`
9
- `).map(e=>e.trim()).filter(e=>e!==``);if(!(e.length===0||e.every(e=>e.startsWith(`#`))))return e.join(`
10
- `)}}function da(e,t){let n=t.trim().toLowerCase(),r=[],i=!1,a=!1;for(let t of e.split(`
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 fa(e){if(!ca(e.title)||e.origin!==`submitted`&&e.origin!==`parsed`)return;let t=typeof e.body==`string`?e.body:``,n=ca(e.tldr)?e.tldr:ua(t),r=da(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 pa(){let e=B({pr:{},readingDiffs:[],ready:!1});return{state:e,handle(t){if(!sa(t))return;let n=t;if(n.type===`run_meta`)ca(n.repo)&&(e.pr.repo=n.repo),la(n.pr)&&(e.pr.number=n.pr),typeof n.headSha==`string`&&ea.test(n.headSha)&&(e.pr.headSha=n.headSha);else if(n.type===`review_artifact`&&n.artifact===`reading_diff`){if(!ca(n.diff)||n.poweredBy!==`git`&&n.poweredBy!==`meat`)return;let t={poweredBy:n.poweredBy,baseRef:ca(n.baseRef)?n.baseRef:`HEAD`,diff:n.diff,truncated:n.truncated===!0,...ca(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=fa(n);t&&(e.description=t)}}}}var ma=3e3,ha={fetch:(...e)=>globalThis.fetch(...e),delay:e=>new Promise(t=>setTimeout(t,e))};function ga(e,t,n={}){let{fetch:r,delay:i}={...ha,...n},a=B({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(ma),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 _a={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`}},va={__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=ce(`badge`,t),i=te(),{orientation:a,size:o}=fe(t),{isLeading:s,isTrailing:c,leadingIconName:l,trailingIconName:u}=he(r),d=V(()=>I({extend:_a,...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)=>(L(),N(K(h),{as:K(r).as,"data-slot":`base`,class:J(d.value.base({class:[K(r).ui?.base,K(r).class]}))},{default:S(()=>[P(e.$slots,`leading`,{ui:d.value},()=>[K(s)&&K(l)?(L(),N(Se,{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?(L(),N(H,O({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`])):R(``,!0)]),P(e.$slots,`default`,{ui:d.value},()=>[K(r).label!==void 0&&K(r).label!==null?(L(),W(`span`,{key:0,"data-slot":`label`,class:J(d.value.label({class:K(r).ui?.label}))},q(K(r).label),3)):R(``,!0)]),P(e.$slots,`trailing`,{ui:d.value},()=>[K(c)&&K(u)?(L(),N(Se,{key:0,name:K(u),"data-slot":`trailingIcon`,class:J(d.value.trailingIcon({class:K(r).ui?.trailingIcon}))},null,8,[`name`,`class`])):R(``,!0)])]),_:3},8,[`as`,`class`]))}},ya={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`}},ba={__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=ce(`tabs`,r),s=te(),c=_e(ge(o,`as`,`unmountOnHide`),i),l=V(()=>I({extend:ya,...s.ui?.tabs||{}})({color:o.color,variant:o.variant,size:o.size,orientation:o.orientation})),u=M([]);function d(e,t){u.value[e]=t}return t({triggersRef:u}),(e,t)=>(L(),N(K(ft),O(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(()=>[j(K(_t),{"data-slot":`list`,class:J(l.value.list({class:K(o).ui?.list}))},{default:S(()=>[j(K(gt),{"data-slot":`indicator`,class:J(l.value.indicator({class:K(o).ui?.indicator}))},null,8,[`class`]),P(e.$slots,`list-leading`),(L(!0),W(A,null,G(K(o).items,(t,n)=>(L(),N(K(vt),{key:K(D)(t,K(o).valueKey)??n,ref_for:!0,ref:e=>d(n,e),value:K(D)(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(()=>[P(e.$slots,`leading`,{item:t,index:n,ui:l.value},()=>[t.icon?(L(),N(Se,{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?(L(),N(H,O({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`])):R(``,!0)]),K(D)(t,K(o).labelKey)||a.default?(L(),W(`span`,{key:0,"data-slot":`label`,class:J(l.value.label({class:[K(o).ui?.label,t.ui?.label]}))},[P(e.$slots,`default`,{item:t,index:n},()=>[F(q(K(D)(t,K(o).labelKey)),1)])],2)):R(``,!0),P(e.$slots,`trailing`,{item:t,index:n,ui:l.value},()=>[t.badge||t.badge===0?(L(),N(va,O({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`])):R(``,!0)])]),_:2},1032,[`value`,`disabled`,`class`]))),128)),P(e.$slots,`list-trailing`)]),_:3},8,[`class`]),K(o).content?(L(!0),W(A,{key:0},G(K(o).items,(t,n)=>(L(),N(K(ht),{key:K(D)(t,K(o).valueKey)??n,value:K(D)(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(()=>[P(e.$slots,t.slot||`content`,{item:t,index:n,ui:l.value},()=>[F(q(t.content),1)])]),_:2},1032,[`value`,`class`]))),128)):R(``,!0)]),_:3},16,[`model-value`,`default-value`,`orientation`,`activation-mode`,`class`]))}},xa;function Sa(){return xa??=Ie(()=>import(`./dist-BnwSD1cL.js`),__vite__mapDeps([0,1,2,3,4])),xa}var Ca={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`},wa=Y({__name:`FileDiffs`,props:{diff:{},theme:{},diffStyle:{}},setup(e){let t=e,n=M(null),r=M(!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 Sa();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),Ce(()=>{a++,o()}),(t,i)=>r.value?(L(),W(`pre`,Ca,q(e.diff),1)):(L(),W(`div`,{key:1,ref_key:`container`,ref:n,class:`space-y-4`,"data-testid":`file-diffs`},null,512))}});async function Ta(e){let{parsePatchFiles:t}=await Sa(),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 Ea(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 Da={dockerfile:`docker`,makefile:`makefile`,"go.mod":`go`,"go.sum":`go`,".gitignore":`gitignore`,".dockerignore":`dockerignore`},Oa={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 ka(e){let t=(e.split(`/`).pop()||e).toLowerCase(),n=Da[t];if(n)return n;let r=t.lastIndexOf(`.`);return r===-1?`text`:Oa[t.slice(r+1)]??`text`}var Aa={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 ja(e){return Aa[e]??Aa.text}function Ma(e){return ja(ka(e))}var Na={key:0,class:`flex items-center gap-2 p-4 text-sm text-(--ui-text-muted) sm:p-5`,"data-testid":`files-loading`},Pa={key:1,class:`p-4 text-sm text-(--ui-text-muted) sm:p-5`,"data-testid":`no-files`},Fa={class:`shrink-0 border-b border-(--ui-border) @2xl:w-72 @2xl:border-b-0 @2xl:border-r`,"data-testid":`file-list`},Ia={class:`@2xl:sticky @2xl:top-0 @2xl:max-h-[calc(100dvh-11rem)] @2xl:overflow-y-auto @2xl:py-3`},La=[`aria-expanded`],Ra={class:`ml-auto tabular-nums`,"data-testid":`pr-totals`},za={class:`text-(--ui-success)`},Ba={class:`text-(--ui-error)`},Va={key:1,class:`flex items-center justify-between gap-2 px-3 pb-2 text-xs text-(--ui-text-dimmed)`},Ha={"data-testid":`file-count`},Ua={class:`tabular-nums`,"data-testid":`pr-totals`},Wa={class:`text-(--ui-success)`},Ga={class:`text-(--ui-error)`},Ka=[`title`,`aria-current`,`onClick`],qa={class:`min-w-0 flex-1 whitespace-nowrap`},Ja={class:`shrink-0 text-[11px] tabular-nums`},Ya={class:`text-(--ui-success)`},Xa={class:`text-(--ui-error)`},Za=34,Qa=Y({__name:`FilesChanged`,props:{diff:{},notes:{},diffStyle:{}},setup(e){let t=e,n=T(),r=V(()=>n.value===`dark`?`dark`:`light`),i=M([]),a=M(!0),o=M(null),s=ne(`panel`),c=ne(`root`),{width:l}=me(c);C(c,e=>{e&&(l.value=e.getBoundingClientRect().width)});let u=V(()=>l.value>0&&l.value<672),d=M(!1),f=V(()=>u.value?`unified`:t.diffStyle??`unified`),p=0;async function m(){let e=++p;a.value=!0;let n=await Ta(t.diff);e===p&&(i.value=n.files,o.value=null,a.value=!1)}C(()=>t.diff,m,{immediate:!0});let h=V(()=>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=Se;return a.value?(L(),W(`div`,Na,[j(l,{name:`i-lucide-loader-circle`,class:`size-4 animate-spin`}),n[1]||=U(`span`,null,`Loading diff…`,-1)])):i.value.length===0?(L(),W(`p`,Pa,` Nothing in this diff parsed as a file. `)):(L(),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`,Fa,[U(`div`,Ia,[u.value?(L(),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},[j(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`,Ra,[U(`span`,za,`+`+q(h.value.additions),1),U(`span`,Ba,`−`+q(h.value.deletions),1)])],8,La)):(L(),W(`div`,Va,[U(`span`,Ha,q(i.value.length)+` `+q(i.value.length===1?`file`:`files`),1),U(`span`,Ua,[U(`span`,Wa,`+`+q(h.value.additions),1),U(`span`,Ga,`−`+q(h.value.deletions),1)])])),!u.value||d.value?(L(),W(`ul`,{key:2,class:J([`flex flex-col`,u.value?`pb-2`:``])},[(L(!0),W(A,null,G(i.value,e=>(L(),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)},[j(l,{name:K(Ma)(e.path),class:`size-3.5 shrink-0`},null,8,[`name`]),U(`span`,qa,q(K(Ea)(e.path,Za)),1),U(`span`,Ja,[U(`span`,Ya,`+`+q(e.additions),1),U(`span`,Xa,`−`+q(e.deletions),1)])],10,Ka)]))),128))],2)):R(``,!0)])]),U(`div`,{ref_key:`panel`,ref:s,class:`min-w-0 flex-1 overflow-x-auto`,"data-testid":`diff-column`},[(L(!0),W(A,null,G(e.notes,e=>(L(),W(`p`,{key:e,class:`px-3 pt-3 text-xs text-(--ui-text-muted)`,"data-testid":`diff-note`},q(e),1))),128)),j(wa,{diff:e.diff,theme:r.value,"diff-style":f.value},null,8,[`diff`,`theme`,`diff-style`])],512)],512))}}}),$a=Y({__name:`LabelTip`,props:{text:{},disabled:{type:Boolean,default:!1}},setup(e){return(t,n)=>{let r=Pe;return L(),N(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(()=>[P(t.$slots,`default`)]),_:3},8,[`text`,`disabled`])}}}),eo={class:`pr-review-panel @container flex h-full min-h-0 min-w-0 flex-col`,"data-testid":`pr-review-panel`},to={class:`shrink-0 border-b border-(--ui-border) px-4 pt-5 pb-4 sm:px-6`},no={class:`flex flex-col gap-3 @2xl:flex-row @2xl:items-start @2xl:justify-between @2xl:gap-4`},ro={class:`min-w-0`},io={class:`line-clamp-2 text-lg leading-snug font-semibold text-(--ui-text) @2xl:line-clamp-none @2xl:truncate`,"data-testid":`pr-title`},ao={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`},oo=[`href`],so={key:1,class:`inline-flex items-center gap-1.5`},co=[`href`],lo={title:`the base the diff is against`},uo={"data-testid":`producer-label`},fo={class:`inline-flex items-center gap-1 text-(--ui-warning)`,"data-testid":`truncated-label`},po={class:`flex shrink-0 flex-wrap items-center gap-2`},mo={key:1,class:`inline-flex shrink-0 items-center gap-1.5 text-xs text-(--ui-text-muted)`,"data-testid":`abridge-running`},ho={key:2,class:`inline-flex min-w-0 shrink items-center gap-1.5 text-xs text-(--ui-error)`,"data-testid":`abridge-failed`},go=[`title`],_o={key:0,class:`flex shrink-0 items-center justify-between gap-3 border-b border-(--ui-border) px-4 py-2 sm:px-6`},vo={class:`tabs-scroll min-w-0 overflow-x-auto`},yo={class:`min-h-0 flex-1 overflow-y-auto`},bo={key:1,class:`mx-auto max-w-3xl p-4 sm:p-6`,"data-testid":`pr-description`},xo={key:2,class:`mt-4 text-xs text-(--ui-text-dimmed) italic`,"data-testid":`description-origin`},So={key:2,class:`px-4 py-3 text-sm text-(--ui-text-muted) sm:px-6`,"data-testid":`no-diff`},Co=`switchboard:diffStyle`,wo=`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.`,To=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=V(()=>ta(n.data.pr)),a=V(()=>Qi(n.data)),o=V(()=>n.data.readingDiffs),s=V(()=>n.data.description),c=V(()=>o.value.find(e=>e.poweredBy===`git`)),l=V(()=>o.value.find(e=>e.poweredBy===`meat`)),u=V(()=>n.data.pr.headSha?.slice(0,7)),d=V(()=>{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=()=>na(o.value)?.poweredBy===`meat`?`reading`:`files`,p=M(f());C(()=>na(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=V(()=>p.value===`files`?c.value:p.value===`reading`?l.value:void 0),h=V(()=>{let e=m.value;if(!e)return[];let t=[];return e.summary&&t.push(e.summary),e.truncated&&t.push(`${ia(e.diff.length)}.`),t}),g=V(()=>s.value?oa(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=M(`unified`);E(()=>{try{localStorage.getItem(Co)===`split`&&(v.value=`split`)}catch{}});function y(e){v.value=e===`split`?`split`:`unified`;try{localStorage.setItem(Co,v.value)}catch{}}let b=V(()=>n.abridge!==void 0&&n.abridge.state.state!==`done`&&c.value!==void 0&&!l.value);return(t,n)=>{let o=Se,c=le,l=ba;return L(),W(`div`,eo,[U(`header`,to,[U(`div`,no,[U(`div`,ro,[U(`h1`,io,q(a.value),1),U(`div`,ao,[i.value.pr?(L(),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`},[j(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,oo)):e.data.pr.repo?(L(),W(`span`,so,[j(o,{name:`i-simple-icons-github`,class:`size-3.5 shrink-0`}),U(`span`,null,q(e.data.pr.repo),1)])):R(``,!0),i.value.commit?(L(),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,co)):R(``,!0),m.value?(L(),W(A,{key:3},[U(`span`,lo,`against origin/`+q(m.value.baseRef),1),j($a,{text:K(ra)(m.value.poweredBy)},{default:S(()=>[U(`span`,uo,q(K(aa)(m.value.poweredBy)),1)]),_:1},8,[`text`]),m.value.truncated?(L(),N($a,{key:0,text:K(ia)(m.value.diff.length)},{default:S(()=>[U(`span`,fo,[j(o,{name:`i-lucide-scissors`,class:`size-3.5`}),n[4]||=F(`truncated `,-1)])]),_:1},8,[`text`])):R(``,!0)],64)):R(``,!0)])]),U(`div`,po,[i.value.pr?(L(),N(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`])):R(``,!0),b.value&&e.abridge?(L(),W(A,{key:1},[e.abridge.state.state===`absent`?(L(),N($a,{key:0,text:wo},{default:S(()=>[j(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`?(L(),W(`span`,mo,[j(o,{name:`i-lucide-loader-circle`,class:`size-3.5 animate-spin`}),n[5]||=F(` Abridging… usually 1–3 minutes `,-1)])):e.abridge.state.state===`failed`?(L(),W(`span`,ho,[j(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,go),j(c,{size:`xs`,color:`neutral`,variant:`outline`,label:`Retry`,"data-testid":`abridge-retry`,onClick:n[1]||=t=>e.abridge.start()})])):R(``,!0)],64)):R(``,!0),e.closable?(L(),N(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`)})):R(``,!0)])])]),d.value.length>0?(L(),W(`div`,_o,[U(`div`,vo,[j(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?(L(),N(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`])):R(``,!0)])):R(``,!0),U(`div`,yo,[m.value?(L(),N(Qa,{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?(L(),W(`div`,bo,[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?(L(),N($,{key:0,text:s.value.tldr,class:`text-sm`,"data-testid":`description-tldr`},null,8,[`text`])):R(``,!0),s.value.whatWhy?(L(),W(A,{key:1},[n[6]||=U(`div`,{class:`mt-4 mb-2 text-xs font-medium text-(--ui-text-dimmed)`},`What & why`,-1),j($,{text:s.value.whatWhy,class:`text-sm`,"data-testid":`description-what-why`},null,8,[`text`])],64)):R(``,!0),g.value?(L(),W(`p`,xo,q(g.value),1)):R(``,!0)])):(L(),W(`p`,So,` No reading diff was produced for this review. `))])])}}}),Eo={class:`conn flex items-center gap-2 font-mono`},Do={key:0,class:`ok text-ok`,role:`img`,"aria-label":`succeeded`},Oo=[`data-heat`],ko={key:2,id:`delivery`,class:`text-xs text-muted`},Ao=[`title`],jo={key:0,id:`actions`,class:`actions flex gap-1.5`},Mo={class:`mx-auto max-w-6xl`},No={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`},Po={class:`agent text-[0.68rem] font-medium uppercase tracking-wider text-toned`},Fo={class:`model`},Io={key:0,class:`effort`},Lo=[`href`],Ro={key:2,class:`repo`},zo=[`href`],Bo={key:4,class:`reftag rounded border border-accented px-1.5 text-[0.75rem] text-toned`},Vo=[`href`,`title`],Ho=[`href`],Uo={key:1,id:`request`,class:`block mb-4 rounded-lg border border-default bg-(--ui-bg-muted) px-(--sb-gutter) py-3`},Wo={class:`mb-2 flex items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},Go={key:0,class:`source flex items-center gap-2 font-normal normal-case tracking-normal text-dimmed`},Ko=[`href`],qo={key:1},Jo={key:1},Yo=[`title`],Xo={key:3,id:`context`,class:`group mb-4 px-(--sb-gutter)`},Zo={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`},Qo={class:`count font-normal normal-case tracking-normal text-dimmed`},$o={id:`contextturns`,class:`pb-1 pl-5`},es=[`title`],ts={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`},ns={key:0,class:`count font-normal normal-case tracking-normal text-dimmed`},rs=[`aria-pressed`,`data-open`,`title`],is={id:`log`,class:`m-0 list-none p-0`},as={key:0,id:`placeholder`,class:`empty text-muted`},os=[`id`],ss={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`},cs=[`title`],ls=[`title`],us=[`title`],ds=[`href`],fs={key:3,class:`nonar font-sans italic`},ps=[`title`],ms=[`data-phase`],hs=[`aria-expanded`,`onClick`],gs={class:`glyph select-none text-dimmed`},_s={class:`what`},vs={key:0,class:`m-0 list-none p-0 pl-4`},ys={key:4,class:`followup block mt-5 rounded-lg border border-default bg-(--ui-bg-muted) px-(--sb-gutter) py-3`},bs={class:`mb-2 flex items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},xs={key:0,class:`source flex items-center gap-2 font-normal normal-case tracking-normal text-dimmed`},Ss=[`href`],Cs={key:1},ws=[`title`],Ts=[`title`],Es={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)`},Ds=[`title`],Os={class:`verb min-w-0 truncate text-toned`},ks=Y({__name:`RunPage`,setup(e){let t=Ee(`run`),n=t?.mode===`history`,r=n?`Run`:`Live run`,i=n,a=t?.artifacts??null,o=typeof window<`u`?new URLSearchParams(window.location.search).get(`open`):null,s=vn({openTags:o?o.split(`,`).map(e=>e.trim()).filter(Boolean):void 0}),l=s.state,u=M(n?`ended`:`connecting`),d=M(``),p=Re(),m=t?.mode===`live`?bn(t,p.value):null,h=M(void 0),g=M({}),v=V(()=>{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=l.stopMode;return{ok:!1,cls:e===`hard`?`red`:e===`soft`?`amber`:`grey`,word:e===`hard`?`killed`:e===`soft`?`stopped early`:`ended`}}),b=V(()=>n&&t?.mode===`history`?t.durationMs:h.value),ee=V(()=>Sn(n&&t?.mode===`history`?{finishedAt:t.finishedAt,sealedAt:t.sealedAt,replyOk:t.replyOk}:g.value)),te=V(()=>b.value===void 0?``:X(b.value,`clock`)),x=V(()=>We(b.value,`run`)),w=V(()=>qe(x.value)),ne={red:`border-bad/30 text-bad`,amber:`border-warn/30 text-warn`,grey:`border-accented text-muted`},re=V(()=>d.value?d.value:u.value===`connecting`?`connecting…`:u.value===`disconnected`?`disconnected`:u.value===`stopping`?`stopping (${l.stopMode??`soft`})`:u.value===`finished`?h.value===void 0?`delivering…`:`delivering… · ${X(h.value,`clock`)}`:m?`running · ${X(m.elapsedMs(p.value),`clock`)}`:`running`),ie=V(()=>d.value||u.value===`disconnected`?`text-bad`:u.value===`running`?`text-ok motion-safe:animate-pulse`:u.value===`finished`?`text-ok`:`text-warn motion-safe:animate-pulse`),T=V(()=>{if(!t||t.mode!==`live`&&t.mode!==`history`)return null;l.traceVersion;let e=t.receivedAt??t.startedAt,n=Zi(l.meta?.agent);if(t.mode===`history`){let r=t.durationMs??(t.finishedAt===void 0?0:Math.max(0,t.finishedAt-e));return Bi({spans:s.spanSet(),losses:s.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:s.callHeadline})}if(!m)return null;let r=u.value===`ended`?`ended`:u.value===`finished`?`delivering`:`live`,i=r===`live`?m.elapsedMs(p.value):h.value??m.elapsedMs(p.value);return Bi({spans:s.spanSet(),losses:s.losses(e),window:{start:e,end:e+i},owner:n,totalMs:i,phase:r,delivery:g.value,callTitle:s.callHeadline})}),ae=n&&t?.mode===`history`?`/runs/${encodeURIComponent(t.id)}/events`:void 0;function oe(e){s.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=M(n),se=M(!1);function O(e){t?.mode===`live`&&(e!==`hard`||c.confirm(`Hard stop: abort the run now with no summary and free its sandbox?`))&&(se.value=!0,fetch(`${t.stopUrl}&mode=${encodeURIComponent(e)}`,{method:`POST`,credentials:`same-origin`}).then(t=>{if(!t.ok)throw Error(`HTTP ${t.status}`);ce(e)}).catch(e=>{se.value=!1,d.value=`stop failed: ${e instanceof Error?e.message:`error`}`}))}function ce(e){s.markStopping(e),D.value=!0,(u.value===`connecting`||u.value===`running`)&&(u.value=`stopping`)}C(()=>l.stopMode,e=>{e&&u.value!==`ended`&&u.value!==`disconnected`&&u.value!==`finished`&&ce(e)}),n||C(u,e=>c.setFavicon(e===`ended`||e===`disconnected`||e===`finished`?Ye:Je),{immediate:!0});let ue=V(()=>!n&&u.value!==`ended`&&u.value!==`disconnected`&&u.value!==`finished`),de=V(()=>ue.value?yn(l,p.value):null);Te(wn,de),Te(Tn,a),Te(En,V(()=>l.reply!==null));let fe=V(()=>ue.value?An(l,s.pendingCall(),p.value):null),pe=[`Thinking`,`Pondering`,`Mulling it over`,`Reasoning`,`Cogitating`,`Weighing options`,`Puzzling`,`Deliberating`,`Noodling`,`Chewing on it`,`Ruminating`,`Reticulating splines`],P=V(()=>fe.value?.kind===`thinking`?T.value?.openStep||pe[Math.floor(fe.value.elapsedMs/6e3)%pe.length]:``);function me(){s.setAllOpen(!l.allOpen)}let he=V(()=>l.log.filter(e=>e.kind===`step`).length),ge=M(null);function _e(){return window.innerHeight+window.scrollY>=document.body.scrollHeight-60}let I=pa(),ve=M(!1),ye=t?.mode===`history`&&t.capabilities.readingDiffAbridge?ga(t.id,e=>I.handle(e)):void 0;Ce(()=>ye?.dispose());function be(e){let t=_e();s.handle(e),I.handle(e),t&&requestAnimationFrame(()=>ge.value?.scrollIntoView?.({block:`nearest`}))}let xe=Ue(),z=null;if(t?.mode===`history`){for(let e of t.events)s.handle(e),I.handle(e);s.closePhases()}E(()=>{if(t?.mode!==`live`)return;z=xe(t.eventsUrl),z.onopen=()=>{l.stopMode||(u.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}}be(n)},z.addEventListener(`replay_elided`,e=>{let t=fn(e);t&&s.noteElided(t)}),z.addEventListener(`finished`,e=>{let t=Cn(e);t&&m&&(h.value=m.elapsedAt(t.finishedAt)),t&&(g.value={...g.value,finishedAt:t.finishedAt}),D.value=!0,(u.value===`connecting`||u.value===`running`)&&(u.value=`finished`)}),z.addEventListener(`end`,e=>{s.flushPendingTurn(`the run ended here`),s.closePhases(),D.value=!0,h.value??=m?.elapsedMs(p.value),g.value={...g.value,...xn(e)},u.value=`ended`,z?.close()}),z.onerror=()=>{z&&z.readyState===2&&(u.value=`disconnected`)}}),Ce(()=>{z?.close()});function we(e){return e&&/^https?:\/\//.test(e)?e:``}let B=V(()=>we(l.request?.source?.url)),H=V(()=>{let e=l.meta;return{repo:tn(e?.repo),tree:rn(e?.repo,e?.ref),commit:an(e?.repo,e?.headSha),pr:nn(e?.repo,e?.pr)}}),De=V(()=>gn({meta:l.meta,requestText:l.request?.text??``,prOpened:l.prOpened}));function Oe(e){return typeof e==`number`?Be(e,p.value):``}function ke(e){return typeof e==`number`?Z(e):void 0}return(e,t)=>{let n=le,a=Pe,o=Se,c=Ct;return L(),N(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`,Eo,[u.value===`ended`?(L(),W(A,{key:0},[v.value.ok?(L(),W(`span`,Do,`✓`)):(L(),W(`span`,{key:1,class:J([`chip rounded border px-1.5 text-[0.7rem]`,ne[v.value.cls]])},q(v.value.word),3)),U(`span`,{id:`state`,class:J([`dur text-xs tabular-nums`,[w.value?`heat`:`text-muted`,x.value.level>=2?`font-medium`:``]]),style:_(w.value),"data-heat":x.value.level},q(te.value),15,Oo),ee.value?(L(),W(`span`,ko,`· `+q(ee.value),1)):R(``,!0)],64)):(L(),W(A,{key:1},[U(`span`,{id:`statedot`,class:J([`pulse text-[1.1em] leading-none`,ie.value])},`∿`,2),U(`span`,{id:`state`,class:J([`text-xs tabular-nums`,d.value?`text-bad`:`text-muted`]),title:u.value===`running`&&!d.value?`the whole run, since we received the message`:u.value===`finished`?`the agent stopped; the reply is being posted`:void 0},q(re.value),11,Ao)],64))])]),actions:S(()=>[D.value?R(``,!0):(L(),W(`span`,jo,[j(a,{text:`Soft stop: no new steps, the agent writes up what it has`},{default:S(()=>[j(n,{size:`xs`,color:`neutral`,variant:`outline`,label:`Stop`,disabled:se.value,onClick:t[0]||=e=>O(`soft`)},null,8,[`disabled`])]),_:1}),j(a,{text:`Hard stop: abort now, no summary, free the sandbox`},{default:S(()=>[j(n,{size:`xs`,color:`error`,variant:`outline`,label:`Kill`,disabled:se.value,onClick:t[1]||=e=>O(`hard`)},null,8,[`disabled`])]),_:1})]))]),default:S(()=>[U(`div`,Mo,[K(l).meta?(L(),W(`div`,No,[U(`span`,Po,q(K(l).meta.agent),1),U(`span`,Fo,q(K(l).meta.model),1),K(l).meta.effort?(L(),W(`span`,Io,q(K(l).meta.effort)+` effort`,1)):R(``,!0),H.value.repo?(L(),W(`a`,{key:1,class:`text-primary no-underline hover:underline`,href:H.value.repo,target:`_blank`,rel:`noopener noreferrer`},q(K(l).meta.repo),9,Lo)):K(l).meta.repo?(L(),W(`span`,Ro,q(K(l).meta.repo),1)):R(``,!0),H.value.tree?(L(),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:H.value.tree,target:`_blank`,rel:`noopener noreferrer`,title:`the branch on GitHub`},q(K(l).meta.ref),9,zo)):K(l).meta.ref?(L(),W(`span`,Bo,q(K(l).meta.ref),1)):R(``,!0),H.value.commit&&K(l).meta.headSha?(L(),W(`a`,{key:5,class:`sha tabular-nums text-toned no-underline hover:text-primary hover:underline`,href:H.value.commit,target:`_blank`,rel:`noopener noreferrer`,title:`the head commit ${K(l).meta.headSha}`},q(K(on)(K(l).meta.headSha)),9,Vo)):R(``,!0),H.value.pr?(L(),W(`a`,{key:6,class:`prlink whitespace-nowrap text-primary no-underline hover:underline`,href:H.value.pr,target:`_blank`,rel:`noopener noreferrer`},[j(Nt,{class:`mr-1 align-[-0.125em]`}),F(`#`+q(K(l).meta.pr),1)],8,Ho)):R(``,!0),K(I).state.ready?(L(),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=>ve.value=!0},[j(o,{name:`i-lucide-git-compare`,class:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[5]||=F(` Reading diff `,-1)])):R(``,!0)])):R(``,!0),K(l).request?(L(),W(`section`,Uo,[U(`h2`,Wo,[t[6]||=U(`span`,null,`Request`,-1),K(l).request.source?(L(),W(`span`,Go,[K(l).request.source.channel?(L(),W(A,{key:0},[j(Ke),B.value?(L(),W(`a`,{key:0,class:`text-muted no-underline hover:text-primary hover:underline`,href:B.value,target:`_blank`,rel:`noopener noreferrer`,title:`open the thread`},`#`+q(K(l).request.source.channel),9,Ko)):(L(),W(`span`,qo,`#`+q(K(l).request.source.channel),1))],64)):R(``,!0),K(l).request.source.user?(L(),W(`span`,Jo,q(K(l).request.source.user),1)):R(``,!0)])):R(``,!0),U(`span`,{class:`ts ml-auto select-none text-xs font-normal normal-case tracking-normal text-dimmed`,title:ke(K(l).request.at)},q(Oe(K(l).request.at)),9,Yo)]),j(Ot,{lines:3},{default:S(()=>[j($,{text:K(l).request.text},null,8,[`text`])]),_:1}),K(l).request.files.length>0?(L(),N(ar,{key:0,files:K(l).request.files},null,8,[`files`])):R(``,!0)])):R(``,!0),K(l).reply&&K(i)?(L(),N(Di,{key:2,position:`first`,text:K(l).reply.text,caption:De.value,when:Oe(K(l).reply.at),"when-title":ke(K(l).reply.at),files:K(l).reply.files},null,8,[`text`,`caption`,`when`,`when-title`,`files`])):R(``,!0),K(l).context.length>0?(L(),W(`details`,Xo,[U(`summary`,Zo,[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`,Qo,`· `+q(K(l).context.length)+` turn`+q(K(l).context.length===1?``:`s`),1)]),U(`div`,$o,[(L(!0),W(A,null,G(K(l).context,e=>(L(),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`},[j($,{text:e.text},null,8,[`text`]),U(`span`,{class:`ts ml-auto shrink-0 select-none font-mono text-xs text-dimmed`,title:ke(e.at)},q(Oe(e.at)),9,es)]))),128))])])):R(``,!0),U(`h2`,ts,[t[9]||=U(`span`,null,`This run`,-1),he.value>0?(L(),W(`span`,ns,`· `+q(he.value)+` step`+q(he.value===1?``:`s`),1)):R(``,!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(l).allOpen?`true`:`false`,"data-open":K(l).allOpen?`1`:`0`,title:K(l).allOpen?`Close every call card`:`Open every call card`,onClick:me},q(K(l).allOpen?`Collapse all`:`Expand all`),9,rs)]),T.value?(L(),N(xi,{key:4,vm:T.value,"events-href":K(ae),onReveal:oe},null,8,[`vm`,`events-href`])):R(``,!0),U(`ol`,is,[K(l).placeholder?(L(),W(`li`,as,`Waiting for activity…`)):R(``,!0),(L(!0),W(A,null,G(K(l).log,e=>(L(),W(A,{key:e.key},[e.kind===`step`?(L(),N(qr,{key:0,step:e,class:`mt-5 first:mt-0`,onToggleGroup:t=>K(s).toggleGroup(e)},null,8,[`step`,`onToggleGroup`])):e.kind===`turn`?(L(),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`,ss,[U(`span`,{class:J([`thought`,e.turn.quick?``:`text-warn`]),title:e.turn.label},`thought `+q(e.turn.chip),11,cs),e.turn.switched?(L(),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(On)(e.turn.model)),9,ls)):e.turn.showModel?(L(),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(On)(e.turn.model)),9,us)):R(``,!0),(L(!0),W(A,null,G(e.turn.facts,(e,t)=>(L(),W(`span`,{key:t,class:`fact`},q(e),1))),128)),e.note&&e.noteHref?(L(),W(`a`,{key:2,class:`nonar font-sans italic text-dimmed no-underline hover:text-primary hover:underline`,href:e.noteHref},q(e.note),9,ds)):e.note?(L(),W(`span`,fs,q(e.note),1)):R(``,!0),e.turn.at===void 0?R(``,!0):(L(),W(`span`,{key:4,class:`ts ml-auto select-none`,title:K(Z)(e.turn.at)},q(K(yt)(e.turn.at)),9,ps))])],8,os)):e.kind===`span`?(L(),N($r,{key:2,item:e},null,8,[`item`])):e.kind===`phase`?(L(),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:k(t=>K(s).togglePhase(e),[`prevent`])},[U(`span`,gs,q(e.open?`▾`:`▸`),1),U(`span`,{class:J([`swatch inline-block size-2 shrink-0 self-center rounded-[2px]`,K(ni)(e.phase)]),"aria-hidden":`true`},null,2),U(`span`,_s,q(K(un)(e)),1)],8,hs),e.open?(L(),W(`ul`,vs,[(L(!0),W(A,null,G(e.rows,e=>(L(),N($r,{key:e.key,item:e},null,8,[`item`]))),128))])):R(``,!0)],8,ms)):e.kind===`followup`?(L(),W(`li`,ys,[U(`h2`,bs,[t[10]||=U(`span`,null,`↪ Follow-up`,-1),e.input.source?.user?(L(),W(`span`,xs,[we(e.input.source.url)?(L(),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,Ss)):(L(),W(`span`,Cs,q(e.input.source.user),1))])):R(``,!0),U(`span`,{class:`ts ml-auto select-none text-xs font-normal normal-case tracking-normal text-dimmed`,title:ke(e.input.at)},q(Oe(e.input.at)),9,ws)]),j($,{text:e.input.text},null,8,[`text`]),e.input.files.length>0?(L(),N(ar,{key:0,files:e.input.files},null,8,[`files`])):R(``,!0)])):(L(),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?R(``,!0):(L(),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,Ts))],2))],64))),128)),fe.value?.kind===`thinking`?(L(),W(`li`,Es,[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(l).model??void 0},q(K(On)(K(l).model)),9,Ds),U(`span`,Os,q(P.value)+`…`,1),U(`span`,{class:J([`since ml-auto shrink-0 font-mono text-xs tabular-nums`,fe.value.slow?`text-warn`:`text-dimmed`])},q(K(X)(fe.value.elapsedMs,`clock`)),3)])):R(``,!0),U(`li`,{ref_key:`logEnd`,ref:ge,"aria-hidden":`true`},null,512)]),K(l).reply&&!K(i)?(L(),N(Di,{key:5,position:`last`,text:K(l).reply.text,caption:De.value,when:Oe(K(l).reply.at),"when-title":ke(K(l).reply.at),files:K(l).reply.files},null,8,[`text`,`caption`,`when`,`when-title`,`files`])):R(``,!0)]),j(c,{open:ve.value,"onUpdate:open":t[3]||=e=>ve.value=e,title:K(Qi)(K(I).state),ui:{overlay:`z-30`,content:`z-30 w-[min(96vw,90rem)] max-w-none`}},{content:S(({close:e})=>[j(To,{data:K(I).state,abridge:K(ye),closable:``,onClose:t=>e()},null,8,[`data`,`abridge`,`onClose`])]),_:1},8,[`open`,`title`])]),_:1},8,[`title`])}}}),As=Y({__name:`RunRoutePage`,setup(e){let t=ae(De,null);return(e,n)=>!K(t)||K(t).page===`runNotFound`?(L(),N(ze,{key:0})):(L(),N(ks,{key:1}))}});export{As as default};