@coreplane/switchboard 1.253.0 → 1.254.1

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 (130) hide show
  1. package/dist/assets/config/config.example.yaml +40 -11
  2. package/dist/assets/deploy/cloudflare-memory/worker.ts +310 -7
  3. package/dist/assets/package-lock.json +3 -3
  4. package/dist/assets/package.json +1 -1
  5. package/dist/assets/source.json +3 -3
  6. package/dist/assets/src/core/authz/grants.ts +6 -0
  7. package/dist/assets/src/core/authz/policy.ts +11 -0
  8. package/dist/assets/src/core/budgets.ts +8 -0
  9. package/dist/assets/src/core/coordinator/driver.ts +9 -0
  10. package/dist/assets/src/core/costs.ts +221 -2
  11. package/dist/assets/src/core/costsSnapshotStore.ts +22 -1
  12. package/dist/assets/src/core/pipelineStanding.ts +294 -0
  13. package/dist/assets/src/core/plane/decide.ts +203 -0
  14. package/dist/assets/src/core/provider.ts +11 -0
  15. package/dist/assets/src/core/runEvents.ts +27 -1
  16. package/dist/assets/src/core/runLedger/transcript.ts +23 -3
  17. package/dist/assets/src/core/runRecord.ts +15 -0
  18. package/dist/assets/src/core/runUsage.ts +41 -9
  19. package/dist/assets/src/core/ship/coordinator.ts +45 -9
  20. package/dist/assets/web/dist/.vite/manifest.json +450 -430
  21. package/dist/assets/web/dist/assets/{AppShell-Bmz8nzz3.js → AppShell-CSXDCV4x.js} +1 -1
  22. package/dist/assets/web/dist/assets/CostChart-DsuPS2g7.js +2 -0
  23. package/dist/assets/web/dist/assets/CostsPage-BuKjw3nv.js +1 -0
  24. package/dist/assets/web/dist/assets/{DeliveryPage-C7jaEJip.js → DeliveryPage-ngPsO2to.js} +1 -1
  25. package/dist/assets/web/dist/assets/{HomePage-cWbupQzy.js → HomePage-DvxTHzPx.js} +3 -3
  26. package/dist/assets/web/dist/assets/{InputMenu-C9E7YoII.js → InputMenu-BdZXnibG.js} +1 -1
  27. package/dist/assets/web/dist/assets/MetricsPage-o5fSaCTe.js +1 -0
  28. package/dist/assets/web/dist/assets/{NotFoundPage-4nlrq7DP.js → NotFoundPage-DHuWyjlq.js} +1 -1
  29. package/dist/assets/web/dist/assets/PendingTurnRow-ZYIRCCZ2.js +1 -0
  30. package/dist/assets/web/dist/assets/{PlanePage-BNy4tSgJ.js → PlanePage-DpWfiX4C.js} +1 -1
  31. package/dist/assets/web/dist/assets/{ResidentDetailPage-Dbtiq6_J.js → ResidentDetailPage-DG86v39Y.js} +1 -1
  32. package/dist/assets/web/dist/assets/{ResidentsIndexPage-CKtz9H1o.js → ResidentsIndexPage-x6p689VH.js} +1 -1
  33. package/dist/assets/web/dist/assets/RunFoldRow-DG29LOTs.js +1 -0
  34. package/dist/assets/web/dist/assets/{RunRoutePage-Clh68nw9.js → RunRoutePage-ysJBY8xQ.js} +4 -4
  35. package/dist/assets/web/dist/assets/RunsIndexPage-CuzFchcn.js +1 -0
  36. package/dist/assets/web/dist/assets/{RunsTabs-DotpuCSP.js → RunsTabs-kHbbxVHx.js} +1 -1
  37. package/dist/assets/web/dist/assets/{ScheduledPage-C8FYoZy5.js → ScheduledPage-BuLmfcbG.js} +1 -1
  38. package/dist/assets/web/dist/assets/{SettingSelect-CSiBQCSX.js → SettingSelect-BfID5nF4.js} +1 -1
  39. package/dist/assets/web/dist/assets/{SettingsPage-CkYIhLUl.js → SettingsPage-BujWkdU_.js} +1 -1
  40. package/dist/assets/web/dist/assets/{StatusDot-C0TUgnC1.js → StatusDot-C8Bc0pTX.js} +1 -1
  41. package/dist/assets/web/dist/assets/{Tooltip-CN5cZdl3.js → Tooltip-BWwJx27K.js} +1 -1
  42. package/dist/assets/web/dist/assets/{UnitRoutePage-D_EtAl8r.js → UnitRoutePage-B9kjA1AT.js} +1 -1
  43. package/dist/assets/web/dist/assets/{angular-html-qW40ZL9x.js → angular-html-C8b5YTHf.js} +1 -1
  44. package/dist/assets/web/dist/assets/{angular-ts-PUtZU8Cq.js → angular-ts-C3f4WYNe.js} +1 -1
  45. package/dist/assets/web/dist/assets/{apl-D3fC7Qjd.js → apl-DSHxUJc3.js} +1 -1
  46. package/dist/assets/web/dist/assets/{astro-Bi3JFHhh.js → astro-BSGCCBP6.js} +1 -1
  47. package/dist/assets/web/dist/assets/{blade-CSpsf9Z9.js → blade-DFeYrMKk.js} +1 -1
  48. package/dist/assets/web/dist/assets/{c-DE_b1oWP.js → c-L_QOnFVv.js} +1 -1
  49. package/dist/assets/web/dist/assets/{chapel-CWXd9giL.js → chapel-DLQWUwhu.js} +1 -1
  50. package/dist/assets/web/dist/assets/{cobol-CnMOmWNF.js → cobol-1DlMmrEO.js} +1 -1
  51. package/dist/assets/web/dist/assets/{coffee-B9WvURu8.js → coffee-BTB6os6N.js} +1 -1
  52. package/dist/assets/web/dist/assets/{cpp-BZAJXlWI.js → cpp-BvJI2z3u.js} +1 -1
  53. package/dist/assets/web/dist/assets/{crystal-Bm48wAlb.js → crystal-B11wGW_h.js} +1 -1
  54. package/dist/assets/web/dist/assets/{css-WtMeC3ab.js → css-BiIWx5Pw.js} +1 -1
  55. package/dist/assets/web/dist/assets/{dist-B1Mf2JbM.js → dist-CpnyQGOb.js} +2 -2
  56. package/dist/assets/web/dist/assets/{edge-BmwNa6Ss.js → edge-nSglEXaD.js} +1 -1
  57. package/dist/assets/web/dist/assets/{elixir-BotfP-Mn.js → elixir-x7o8qMl8.js} +1 -1
  58. package/dist/assets/web/dist/assets/{elm-DAFc6laN.js → elm-DGrRyqTQ.js} +1 -1
  59. package/dist/assets/web/dist/assets/{erb-QkOON3bB.js → erb--_dh58Nw.js} +1 -1
  60. package/dist/assets/web/dist/assets/{git-rebase-BPs-dd73.js → git-rebase-DbpUXwyg.js} +1 -1
  61. package/dist/assets/web/dist/assets/{glimmer-js-D8eooepk.js → glimmer-js-BG0CuZG5.js} +1 -1
  62. package/dist/assets/web/dist/assets/{glimmer-ts-B0bRiDVg.js → glimmer-ts-CQIl5qyR.js} +1 -1
  63. package/dist/assets/web/dist/assets/{glsl-Bv6bMe1n.js → glsl-9PJNQTcw.js} +1 -1
  64. package/dist/assets/web/dist/assets/{graphql-Bh9y-n9o.js → graphql-CzVTzjEI.js} +1 -1
  65. package/dist/assets/web/dist/assets/{hack-DSEbn7Ir.js → hack-BhCmAz3Q.js} +1 -1
  66. package/dist/assets/web/dist/assets/{haml-0NW1-z1f.js → haml-BmI12COR.js} +1 -1
  67. package/dist/assets/web/dist/assets/{handlebars-BfgCHFbK.js → handlebars-Cib-ISTS.js} +1 -1
  68. package/dist/assets/web/dist/assets/{html-CQHc0gQ5.js → html-D3lDapvI.js} +1 -1
  69. package/dist/assets/web/dist/assets/{html-derivative-B0Tm7wLP.js → html-derivative-DRPY8vOK.js} +1 -1
  70. package/dist/assets/web/dist/assets/{http-GAuU3aOF.js → http-B9VttK6m.js} +1 -1
  71. package/dist/assets/web/dist/assets/{hurl-CrDFbF5B.js → hurl-C0saNJYj.js} +1 -1
  72. package/dist/assets/web/dist/assets/{indexRow-BxKswdlK.js → indexRow-DABQtONT.js} +1 -1
  73. package/dist/assets/web/dist/assets/{java-DYv5KhUe.js → java-BCFbtYAj.js} +1 -1
  74. package/dist/assets/web/dist/assets/{javascript-32SiLGg0.js → javascript-nwBjnrhh.js} +1 -1
  75. package/dist/assets/web/dist/assets/{jinja--gJDUGYa.js → jinja-CMYO9byN.js} +1 -1
  76. package/dist/assets/web/dist/assets/{jison-BlKLGzZH.js → jison-Cko8HnE_.js} +1 -1
  77. package/dist/assets/web/dist/assets/{json-BICanD1N.js → json-Dzv__YsX.js} +1 -1
  78. package/dist/assets/web/dist/assets/{jsx-CgW3-uFT.js → jsx-CTFxagih.js} +1 -1
  79. package/dist/assets/web/dist/assets/{julia-BErRpwwL.js → julia-_Xvten1-.js} +1 -1
  80. package/dist/assets/web/dist/assets/{just-CordHv0h.js → just-bLps4qOu.js} +1 -1
  81. package/dist/assets/web/dist/assets/{latex-D7LVPLbi.js → latex-D6UaYsUP.js} +1 -1
  82. package/dist/assets/web/dist/assets/{liquid-3ehz2i4U.js → liquid-CoDIeULa.js} +1 -1
  83. package/dist/assets/web/dist/assets/{lua-C9ppSVrm.js → lua-D1KFRnVf.js} +1 -1
  84. package/dist/assets/web/dist/assets/main-C4QfwybO.css +1 -0
  85. package/dist/assets/web/dist/assets/main-Comxmwi4.js +28 -0
  86. package/dist/assets/web/dist/assets/{marko-xBZLUBEJ.js → marko-B5N5XcOw.js} +1 -1
  87. package/dist/assets/web/dist/assets/{mdc-BJxGoVgD.js → mdc-uxzjQO3q.js} +1 -1
  88. package/dist/assets/web/dist/assets/{nginx-B-sZmpsb.js → nginx-BMJxs2TK.js} +1 -1
  89. package/dist/assets/web/dist/assets/{nim--s9wRABK.js → nim-DqQ3-8p1.js} +1 -1
  90. package/dist/assets/web/dist/assets/{org-DoUvssoI.js → org-DsY6LK59.js} +1 -1
  91. package/dist/assets/web/dist/assets/{perl-B-vGHKOy.js → perl--pq9iJFp.js} +1 -1
  92. package/dist/assets/web/dist/assets/{php-CerWx_Xb.js → php-RHCMbsM2.js} +1 -1
  93. package/dist/assets/web/dist/assets/{pug-CzKrBMb1.js → pug-CFNq_FCp.js} +1 -1
  94. package/dist/assets/web/dist/assets/{qml-Bs8L8I6k.js → qml-C9Acx9E8.js} +1 -1
  95. package/dist/assets/web/dist/assets/{r-w6uG6mob.js → r-DxlU8FBd.js} +1 -1
  96. package/dist/assets/web/dist/assets/{razor-dz2oj2bd.js → razor-CLJ2kKih.js} +1 -1
  97. package/dist/assets/web/dist/assets/{regexp-CfQdprnY.js → regexp-CzmdGoEp.js} +1 -1
  98. package/dist/assets/web/dist/assets/{rst-DAOaX2tb.js → rst-D9yuxBET.js} +1 -1
  99. package/dist/assets/web/dist/assets/{ruby-QcCe4udB.js → ruby-CIRcEvnD.js} +1 -1
  100. package/dist/assets/web/dist/assets/{sas-BrM4lAAc.js → sas-LOl-uUPh.js} +1 -1
  101. package/dist/assets/web/dist/assets/{scss-DVbJXoUb.js → scss-BX2_sZHY.js} +1 -1
  102. package/dist/assets/web/dist/assets/{shellscript-09fP2hZf.js → shellscript-4d-QvKkY.js} +1 -1
  103. package/dist/assets/web/dist/assets/{shellsession-Qgr8xjZF.js → shellsession-DhB16UGy.js} +1 -1
  104. package/dist/assets/web/dist/assets/{soy-DIYeNTuz.js → soy-Cm1xTUBr.js} +1 -1
  105. package/dist/assets/web/dist/assets/{sql-CzLR9msV.js → sql-BsfcBJdu.js} +1 -1
  106. package/dist/assets/web/dist/assets/{sseReplay-BYo2EZKy.js → sseReplay-IzTdD4-3.js} +6 -6
  107. package/dist/assets/web/dist/assets/{stata-zCY1ZzH0.js → stata-Dwat3BSw.js} +1 -1
  108. package/dist/assets/web/dist/assets/{surrealql-CJIjTRV4.js → surrealql-P4rtxzAW.js} +1 -1
  109. package/dist/assets/web/dist/assets/{svelte-C5OTPFZg.js → svelte-DTcsi8S8.js} +1 -1
  110. package/dist/assets/web/dist/assets/{templ-DYj-UICF.js → templ-D-kP0Tg5.js} +1 -1
  111. package/dist/assets/web/dist/assets/{tex-xcie-3Gd.js → tex-D-4vuedK.js} +1 -1
  112. package/dist/assets/web/dist/assets/{ts-tags-CoN86VTt.js → ts-tags-jEEWYxsu.js} +1 -1
  113. package/dist/assets/web/dist/assets/{tsx-n3-No_Br.js → tsx-CFnlrVzT.js} +1 -1
  114. package/dist/assets/web/dist/assets/{twig-DPiJ7Vp1.js → twig-D5rGrPjs.js} +1 -1
  115. package/dist/assets/web/dist/assets/{typescript-BP6HBaOp.js → typescript-nYIQ35or.js} +1 -1
  116. package/dist/assets/web/dist/assets/{typst-Do9ZjsVP.js → typst-3-UX8dna.js} +1 -1
  117. package/dist/assets/web/dist/assets/{vue-CzAeXNRY.js → vue-CLIPIX03.js} +1 -1
  118. package/dist/assets/web/dist/assets/{vue-html-D7iYmYjd.js → vue-html-Ci9CpkHU.js} +1 -1
  119. package/dist/assets/web/dist/assets/{vue-vine-DtrMRsJx.js → vue-vine-DL5pEYYk.js} +1 -1
  120. package/dist/assets/web/dist/assets/{xml-DGJHo1c0.js → xml-bO80qikC.js} +1 -1
  121. package/dist/assets/web/dist/assets/{xsl-Q00kvNgW.js → xsl-BPze60Ej.js} +1 -1
  122. package/dist/assets/web/dist/assets/{yaml-F-UGKaiO.js → yaml-BQUSon_o.js} +1 -1
  123. package/dist/cli.js +35752 -33944
  124. package/package.json +1 -1
  125. package/dist/assets/web/dist/assets/CostsPage-CxTKdpzU.js +0 -2
  126. package/dist/assets/web/dist/assets/PendingTurnRow-C-pUgyyX.js +0 -1
  127. package/dist/assets/web/dist/assets/RunFoldRow-sYFtuK2G.js +0 -1
  128. package/dist/assets/web/dist/assets/RunsIndexPage-DPDbcOA_.js +0 -1
  129. package/dist/assets/web/dist/assets/main-Cv0q9y56.js +0 -28
  130. package/dist/assets/web/dist/assets/main-DKFCM-sy.css +0 -1
@@ -0,0 +1,2 @@
1
+ import{Cn as e,Cr as t,Ii as n,Li as r,Mn as i,Pi as a,Sn as o,_r as s,bn as c,ji as l,kn as u,ln as d,xi as f,yn as p}from"./browser-B6T5hjfR.js";import{d as m,f as h,l as g}from"./delivery-CTdOqpVK.js";var _=`Durable Objects`;function v(e){let t;try{t=JSON.parse(e)}catch{return null}if(typeof t!=`object`||!t)return null;let n=t;if(n.type!==`status`||typeof n.everyHours!=`number`)return null;let{type:r,...i}=n;return i}var y=e=>e===`schedule`?`on schedule`:`by ${e}`;function b(e,t){let n=[];if(e.inFlight?(n.push(`Taking a snapshot now — started ${m(e.inFlight.startedAt,t)} ${y(e.inFlight.by)}`),e.snapshot&&n.push(`showing the one from ${g(e.snapshot.takenAt)} meanwhile`)):e.snapshot?(n.push(`Snapshot from ${g(e.snapshot.takenAt)}, ${m(e.snapshot.takenAt,t)} ${y(e.snapshot.takenBy)}`),e.nextAt&&n.push(`next ${h(e.nextAt,t)}`)):e.nextAt?n.push(`No snapshot yet — next attempt ${h(e.nextAt,t)}`):n.push(`No snapshot yet — the first one is taken within a minute of startup`),e.lastFailure&&!e.inFlight){let r=e.lastFailure.count>1?` (${e.lastFailure.count} in a row)`:``;n.push(`last attempt ${m(e.lastFailure.at,t)} failed${r}: ${e.lastFailure.message.slice(0,120)}`)}return n.join(` · `)}var x=`Workers · storage · R2`,S=`LLM (Anthropic)`,C=(e,t=2)=>`$${e.toFixed(t)}`,w=e=>e.workersUsd+e.doRowsUsd+e.doStorageUsd+e.r2Usd+e.workflowsUsd;function T(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(_),e.days.some(e=>w(e)>0)&&t.push(x),e.llmAvailable&&t.push(S),t}function E(e,t){return t===`Durable Objects`?Object.values(e.durableObjects).reduce((e,t)=>e+t,0)+e.doRequestsUsd:t===`Workers · storage · R2`?w(e):t===`LLM (Anthropic)`?e.llmUsd:e.containers[t]?.total??0}var D=30.4;function O(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:te(e,t,n),llm:{range:e.totals.llmUsd,...r?{yesterday:r.llmUsd}:{},...n?{today:{usd:n.llmUsd,estimated:n.llmEstimated}}:{}},accountShare:o}}var k=e=>e.reduce((e,t)=>e+t,0)/e.length;function ee(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 te(e,t,n){let r=n?ee(e,n):1,i=t.slice(-7),a=0,o=`full-days`;i.length?a=k(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=k(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)*D,cloudRate:a,llmRate:s,cloudBasis:o,llmBasis:c,llmClosedDays:l}}function A(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 j=e=>e.account.name??`${e.account.id.slice(0,8)}…`;function M(e,t,n){let r=[`${e.date} · total ${C(e.total)}${n?` (partial day)`:``}`];for(let n of t){let t=E(e,n);t<=0||r.push(`${n} ${C(t)}${n===`LLM (Anthropic)`&&e.llmEstimated?` (estimate)`:``}`)}return r.join(`
2
+ `)}function N(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 P(e,t,n){let r=t.map(t=>({series:t,usd:E(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:N(e.date),partial:n,total:e.total,rows:r}}function F(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:C(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:M(r,t,e.range.partialLastDay&&o===a.length-1),tip:P(r,t,e.range.partialLastDay&&o===a.length-1)}),t.forEach((e,t)=>{let n=E(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 I(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 L=[`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]`],R=[`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]`],z={class:`overflow-x-auto`},B=[`viewBox`,`aria-label`],V=[`x1`,`x2`,`y1`,`y2`],H=[`x`,`y`],U=[`x`,`y`,`width`,`height`],W=[`aria-label`,`x`,`y`,`width`,`height`,`onPointerenter`,`onPointermove`],G=[`x`,`y`],K=[`x1`,`x2`,`y1`,`y2`],q={class:`tip-head mb-1.5 flex items-baseline justify-between gap-3 border-b border-muted pb-1.5`},J={class:`font-medium text-highlighted`},Y={key:0,class:`ml-1.5 font-normal text-dimmed`},X={class:`font-medium text-highlighted`},Z={class:`tip-name truncate text-muted`},ne={class:`text-highlighted`},re={class:`tip-usd`},ie={key:0,class:`ml-1 text-dimmed`},Q=256,$=12,ae=i({__name:`CostChart`,props:{model:{},label:{},format:{type:Function}},setup(i){let m=i,h=p(()=>m.model),g=p(()=>m.format??C),_=e=>44+e*20,v=f(null),y=f(null);function b(e,t){let n=y.value,r=n?.getBoundingClientRect(),i=t.clientX-(r?.left??0),a=t.clientY-(r?.top??0),o=n?.clientWidth??0,s=n?.clientHeight??0,c=_(e.tip.rows.length),l=o>0&&i+$+Q>o,u=s>0&&a+$+c>s;v.value={x:Math.max(0,l?i-$-Q:i+$),y:Math.max(0,u?a-$-c:a+$),data:e.tip}}return(f,p)=>(s(),e(`div`,{ref_key:`host`,ref:y,class:`chart-host relative`},[c(`div`,z,[(s(),e(`svg`,{class:`block h-auto w-full font-mono`,viewBox:`0 0 ${h.value.width} ${h.value.height}`,role:`img`,"aria-label":i.label},[(s(!0),e(d,null,t(h.value.gridLines,(t,n)=>(s(),e(d,{key:`g${n}`},[c(`line`,{class:`stroke-(--ui-border-muted)`,x1:h.value.marginLeft,x2:h.value.width-h.value.marginRight,y1:t.y,y2:t.y},null,8,V),c(`text`,{class:`fill-(--ui-text-dimmed) text-[11px] tabular-nums`,x:h.value.marginLeft-8,y:t.y+4,"text-anchor":`end`},r(t.label),9,H)],64))),128)),(s(!0),e(d,null,t(h.value.segments,(t,n)=>(s(),e(`rect`,{key:`s${n}`,class:a([`seg hover:opacity-85`,l(L)[t.seriesIndex%l(L).length]]),x:t.x,y:t.y,width:t.width,height:t.height},null,10,U))),128)),(s(!0),e(d,null,t(h.value.dayHovers,(t,n)=>(s(),e(`rect`,{key:`h${n}`,class:`day fill-transparent`,role:`img`,"aria-label":t.title,x:t.x,y:t.y,width:t.width,height:t.height,onPointerenter:e=>b(t,e),onPointermove:e=>b(t,e),onPointerleave:p[0]||=e=>v.value=null},null,40,W))),128)),(s(!0),e(d,null,t(h.value.dayLabels,(t,n)=>(s(),e(`text`,{key:`d${n}`,class:`fill-(--ui-text-dimmed) text-[11px]`,x:t.x,y:h.value.height-10,"text-anchor":`middle`},r(t.label),9,G))),128)),c(`line`,{class:`stroke-(--ui-border)`,x1:h.value.marginLeft,x2:h.value.width-h.value.marginRight,y1:h.value.axisY,y2:h.value.axisY},null,8,K)],8,B))]),v.value?(s(),e(`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:n({left:`${v.value.x}px`,top:`${v.value.y}px`})},[c(`div`,q,[c(`span`,J,[u(r(v.value.data.label),1),v.value.data.partial?(s(),e(`span`,Y,`partial day`)):o(``,!0)]),c(`span`,X,r(g.value(v.value.data.total)),1)]),(s(!0),e(d,null,t(v.value.data.rows,t=>(s(),e(`div`,{key:t.series,class:`tip-row flex items-baseline justify-between gap-3 leading-5`},[c(`span`,Z,r(t.series),1),c(`span`,ne,[c(`span`,re,r(g.value(t.usd)),1),t.estimated?(s(),e(`span`,ie,`est.`)):o(``,!0)])]))),128))],4)):o(``,!0)],512))}});export{R as a,A as c,I as d,T as f,E as g,C as h,x as i,N as l,O as m,_ as n,j as o,b as p,S as r,F as s,ae as t,v as u};
@@ -0,0 +1 @@
1
+ import{t as e}from"./AppShell-CSXDCV4x.js";import{Cn as t,Cr as n,Ii as r,Li as i,Mn as a,Pi as o,Qr as s,Sn as c,Tr as l,Xr as u,Xt as d,_r as f,bn as p,dr as m,en as h,hr as ee,ji as g,kn as _,ln as v,o as y,xi as b,xn as x,yn as S}from"./browser-B6T5hjfR.js";import{a as C,c as te,d as w,f as T,g as E,h as D,l as O,m as k,o as ne,p as re,s as ie,t as A,u as j}from"./CostChart-DsuPS2g7.js";import{t as ae}from"./eventSource-Bj_dZf6M.js";import{r as oe}from"./settingsApi-Dm6eaQcu.js";import{t as se}from"./wallClock-DmaC1sKA.js";var M=[`data-dimension`],ce={class:`flex flex-wrap items-center gap-x-4 gap-y-2`},N={class:`flex items-center gap-2 text-sm text-muted`},P=[`placeholder`,`aria-label`],F=[`title`],I=[`disabled`,`aria-describedby`],L={key:0,id:`me-hint`,class:`me-hint text-xs text-dimmed`},R={class:`coverage font-mono text-xs tabular-nums text-muted`},z={class:`overflow-x-auto`},le={class:`by w-full min-w-[40rem] border-collapse whitespace-nowrap font-mono text-[0.8125rem] tabular-nums`},B={class:`border-b border-muted bg-(--ui-bg-muted) px-2.5 py-1.5 text-left text-xs font-medium text-muted`},V={class:`border-b border-muted bg-(--ui-bg-muted) px-2.5 py-1.5 text-right text-xs font-medium text-muted`},H={key:0,class:`border-b border-muted bg-(--ui-bg-muted) px-2.5 py-1.5 text-right text-xs font-medium text-muted`},ue=[`title`],U={class:`text-highlighted`},de={key:0,class:`ml-1.5 text-xs text-dimmed`},fe={key:1,class:`ml-1.5 rounded-xs bg-accented px-1 text-xs text-highlighted`},W=[`title`],G={class:`border-b border-muted px-2.5 py-1.5 text-right`},K={class:`border-b border-muted px-2.5 py-1.5 text-right`},q={key:0,class:`border-b border-muted px-2.5 py-1.5 text-right`},J={class:`border-b border-muted px-2.5 py-1.5 text-right font-medium text-highlighted`},Y={class:`border-b border-muted px-2.5 py-1.5 text-right`},X={key:0},Z=[`colspan`],pe={key:0},Q=[`colspan`],me={class:`px-2.5 py-1.5 text-right text-xs text-muted`},he={class:`px-2.5 py-1.5 text-right text-xs text-muted`},ge={class:`reconciliation font-mono text-xs tabular-nums text-muted`},_e={class:`text-xs text-dimmed`},ve=a({__name:`CostsByDimension`,props:{report:{}},setup(e){let r=e,a={user:`User`,thread:`Thread`,channel:`Channel`,agent:`Agent`,model:`Model`},l=b(``),u=b(!1),m=S(()=>r.report.dimension),ee=S(()=>r.report.viewer!==void 0),y=S(()=>(r.report.viewer?.userIds.length??0)>0),x=S(()=>r.report.cloudAllocated),C=S(()=>m.value===`model`?`Turns`:`Runs`),te=e=>m.value===`model`?e.turns:e.runs,w=S(()=>{let e=l.value.trim().toLowerCase(),t=new Set(r.report.viewer?.userIds??[]);return r.report.rows.filter(n=>u.value&&!t.has(n.key)?!1:!e||n.key.toLowerCase().includes(e)||(n.label??``).toLowerCase().includes(e))}),T=S(()=>r.report.rows.reduce((e,t)=>e+t.totalUsd,0)),E=S(()=>w.value.reduce((e,t)=>e+t.totalUsd,0)),k=e=>r.report.viewer?.userIds.includes(e.key)??!1,ne=S(()=>m.value===`user`||m.value===`thread`||m.value===`channel`),re=e=>e.label?m.value===`channel`?`#${e.label}`:e.label:ne.value?e.key.replace(/^[a-z]+:/,``):e.key,ie=e=>ne.value&&e.key.includes(`:`)?e.key.split(`:`)[0]:``,A=e=>`${e} day${e===1?``:`s`}`,j=S(()=>x.value?6:5);return(r,b)=>(f(),t(`section`,{class:`by-dimension grid gap-3`,"data-dimension":m.value},[p(`div`,ce,[p(`label`,N,[b[2]||=p(`span`,null,`Filter`,-1),s(p(`input`,{"onUpdate:modelValue":b[0]||=e=>l.value=e,class:`key-filter rounded-md border border-default bg-elevated px-2.5 py-1 font-mono text-xs text-highlighted`,type:`search`,placeholder:m.value===`user`?`name or id`:a[m.value].toLowerCase(),"aria-label":`Filter by ${a[m.value].toLowerCase()}`},null,8,P),[[h,l.value]])]),ee.value?(f(),t(`label`,{key:0,class:o([`me-toggle flex items-center gap-2 text-sm`,y.value?`text-muted`:`text-dimmed`]),title:y.value?`Only your own runs`:void 0},[s(p(`input`,{"onUpdate:modelValue":b[1]||=e=>u.value=e,type:`checkbox`,disabled:!y.value,"aria-label":`Only me`,"aria-describedby":y.value?void 0:`me-hint`},null,8,I),[[d,u.value]]),b[3]||=p(`span`,null,`me`,-1),y.value?c(``,!0):(f(),t(`span`,L,`— your sign-in email matched no Slack user in this range`))],10,F)):c(``,!0),p(`p`,R,[e.report.coverage.historyOn?(f(),t(v,{key:1},[_(` runs from `+i(g(O)(e.report.coverage.from))+` to `+i(g(O)(e.report.range.to)),1),e.report.coverage.clamped?(f(),t(v,{key:0},[_(` · earlier days are past the history's `+i(e.report.coverage.retentionDays)+`-day window`,1)],64)):c(``,!0),e.report.pending>0?(f(),t(v,{key:1},[_(` · `+i(e.report.pending)+` run`+i(e.report.pending===1?``:`s`)+` still being priced`,1)],64)):c(``,!0)],64)):(f(),t(v,{key:0},[_(`run history is off — no runs to attribute`)],64))])]),p(`div`,z,[p(`table`,le,[p(`thead`,null,[p(`tr`,null,[p(`th`,B,i(a[m.value]),1),p(`th`,V,i(C.value),1),b[5]||=p(`th`,{class:`border-b border-muted bg-(--ui-bg-muted) px-2.5 py-1.5 text-right text-xs font-medium text-muted`},` LLM `,-1),x.value?(f(),t(`th`,H,[...b[4]||=[_(` Cloud `,-1),p(`span`,{class:`font-normal text-dimmed`},`allocated`,-1)]])):c(``,!0),b[6]||=p(`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),b[7]||=p(`th`,{class:`border-b border-muted bg-(--ui-bg-muted) px-2.5 py-1.5 text-right text-xs font-medium text-muted`},` Share `,-1)])]),p(`tbody`,null,[(f(!0),t(v,null,n(w.value,e=>(f(),t(`tr`,{key:e.key,class:o([`by-row`,k(e)?`is-me`:``])},[p(`td`,{class:`border-b border-muted px-2.5 py-1.5`,title:e.key},[p(`span`,U,i(re(e)),1),ie(e)?(f(),t(`span`,de,i(ie(e)),1)):c(``,!0),k(e)?(f(),t(`span`,fe,`me`)):c(``,!0),e.unpricedTokens>0?(f(),t(`span`,{key:2,class:`ml-1.5 text-xs text-warn`,title:`${e.unpricedTokens} tokens ran under a model with no price`},`unpriced tokens`,8,W)):c(``,!0)],8,ue),p(`td`,G,i(te(e)),1),p(`td`,K,i(g(D)(e.llmUsd)),1),x.value?(f(),t(`td`,q,i(g(D)(e.cloudUsd)),1)):c(``,!0),p(`td`,J,i(g(D)(e.totalUsd)),1),p(`td`,Y,i(T.value>0?Math.round(e.totalUsd/T.value*100):0)+`% `,1)],2))),128)),w.value.length===0?(f(),t(`tr`,X,[p(`td`,{class:`empty px-2.5 py-3 text-sm text-muted`,colspan:j.value},i(e.report.rows.length===0?`no runs in this range`:`no ${a[m.value].toLowerCase()} matches`),9,Z)])):c(``,!0)]),w.value.length>0&&w.value.length<e.report.rows.length?(f(),t(`tfoot`,pe,[p(`tr`,null,[p(`td`,{class:`px-2.5 py-1.5 text-xs text-muted`,colspan:j.value-2},`shown`,8,Q),p(`td`,me,i(g(D)(E.value)),1),p(`td`,he,i(T.value>0?Math.round(E.value/T.value*100):0)+`% `,1)])])):c(``,!0)])]),p(`p`,ge,[e.report.reconciliation.comparedDays>0?(f(),t(v,{key:0},[_(` LLM attributed `+i(g(D)(e.report.reconciliation.attributedLlmUsd))+` of `+i(g(D)(e.report.reconciliation.workspaceLlmUsd))+` on the workspace over `+i(A(e.report.reconciliation.comparedDays))+` · `,1),e.report.reconciliation.unattributedLlmUsd>=0?(f(),t(v,{key:0},[_(i(g(D)(e.report.reconciliation.unattributedLlmUsd))+` unattributed (router, review abridges, runs without a record, list vs invoice) `,1)],64)):(f(),t(v,{key:1},[_(i(g(D)(-e.report.reconciliation.unattributedLlmUsd))+` more attributed than the workspace figure (list vs invoice, or spend billed outside this workspace on a compared day) `,1)],64))],64)):(f(),t(v,{key:1},[_(`no day in range has a workspace LLM figure to compare against`)],64)),e.report.reconciliation.uncomparedDays>0?(f(),t(v,{key:2},[_(` · `+i(A(e.report.reconciliation.uncomparedDays))+` with `+i(g(D)(e.report.reconciliation.uncomparedLlmUsd))+` of run tokens but no workspace figure (billed outside this workspace) not compared`,1)],64)):c(``,!0),x.value?(f(),t(v,{key:3},[_(` · cloud allocated `+i(g(D)(e.report.reconciliation.cloudAllocatedUsd)),1),e.report.reconciliation.cloudUnallocatedUsd>0?(f(),t(v,{key:0},[_(` · `+i(g(D)(e.report.reconciliation.cloudUnallocatedUsd))+` on days with no runs`,1)],64)):c(``,!0)],64)):c(``,!0)]),p(`p`,_e,[m.value===`model`?(f(),t(v,{key:0},[_(` A model's LLM is the runs' tokens on it, priced through the price table (the configured rates over Anthropic list; cache writes at the 5-minute rate); a run that spent on two models counts under both, and cloud is not split by model — a container runs a run, not a model. `)],64)):(f(),t(v,{key:1},[_(` A `+i(a[m.value].toLowerCase())+`'s LLM is its runs' tokens priced through the price table (the configured rates over Anthropic list; cache writes at the 5-minute rate); a child run bills to whoever started its parent, in the child's own thread and agent. Cloud is each day's Cloudflare spend split by share of run wall-clock — an allocation, not a meter. `,1)],64))])],8,M))}}),ye={class:`mb-4 flex flex-wrap items-center gap-x-4 gap-y-2`},be={class:`flex items-center gap-1`,"aria-label":`Range`},xe={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`},Se={key:0,class:`flex items-center gap-1`,"aria-label":`Cost groups`},Ce={key:0,class:`rounded-md bg-accented px-2.5 py-1 text-xs font-medium text-highlighted`,"aria-current":`page`},we={class:`font-mono text-sm tabular-nums text-muted`},Te={key:1,class:`flex basis-full flex-wrap items-center gap-x-3 gap-y-1`},Ee={class:`font-mono text-xs tabular-nums text-dimmed`,"data-snapshot-status":``},De=[`disabled`],Oe={key:1,class:`text-xs text-error`,role:`status`,"data-snapshot-error":``},ke={class:`mb-5 grid grid-cols-[repeat(auto-fit,minmax(190px,1fr))] gap-3`},Ae={key:0,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={key:1,class:`grid gap-0.5 rounded-lg border border-default bg-elevated px-4 py-3.5`},Pe={class:`font-mono text-2xl font-medium tabular-nums`},Fe={class:`text-xs text-muted`},Ie={class:`grid gap-0.5 rounded-lg border border-default bg-elevated px-4 py-3.5`},Le={class:`font-mono text-2xl font-medium tabular-nums`},Re={class:`text-xs text-muted`},ze={class:`grid gap-0.5 rounded-lg border border-default bg-elevated px-4 py-3.5`},Be={class:`font-mono text-2xl font-medium tabular-nums`},Ve={class:`text-xs text-muted`},He={class:`grid gap-0.5 rounded-lg border border-default bg-elevated px-4 py-3.5`},Ue={class:`font-mono text-2xl font-medium tabular-nums`},We={class:`text-xs text-muted`},Ge={class:`grid gap-0.5 rounded-lg border border-default bg-elevated px-4 py-3.5`},Ke={class:`font-mono text-2xl font-medium tabular-nums`},qe={class:`text-xs text-muted`},Je=[`href`,`title`],Ye=[`href`],Xe={class:`mb-5 grid gap-3 rounded-lg border border-default bg-elevated px-5 py-4`},Ze={class:`flex flex-wrap items-baseline justify-between gap-x-4 gap-y-2`},Qe={class:`legend flex flex-wrap gap-x-4 gap-y-1.5 text-xs text-muted`},$e=[`href`,`title`],et={key:1,class:`text-xs text-warn`},tt={key:2,class:`text-xs text-muted`},nt={class:`mb-3 flex flex-wrap items-center gap-1 border-b border-default`,"aria-label":`View`},rt={key:0,class:`-mb-px border-b-2 border-primary px-3 py-1.5 text-sm font-medium text-highlighted`,"aria-current":`page`},it={key:0,class:`mb-5 grid gap-3 rounded-lg border border-default bg-elevated px-5 py-4`},at={class:`text-[0.9375rem] font-medium`},ot={class:`text-sm text-muted`},st={key:1,class:`text-sm text-warn`},ct={class:`text-xs text-muted`},lt={class:`rounded bg-accented px-1 py-0.5`},ut={key:1,class:`mb-5 grid gap-3 rounded-lg border border-default bg-elevated px-5 py-4`},dt={class:`w-full border-collapse font-mono text-[0.8125rem] tabular-nums`},ft={class:`px-2.5 py-1.5`},pt=[`href`],mt={class:`px-2.5 py-1.5 text-right`},ht={class:`px-2.5 py-1.5 text-right`},gt={class:`w-2/5 px-2.5 py-1.5`},_t={key:2,class:`mb-5 grid gap-3 rounded-lg border border-default bg-elevated px-5 py-4`},vt={open:``},yt={class:`mt-2.5 overflow-x-auto`},bt={class:`data w-full min-w-[38rem] border-collapse whitespace-nowrap font-mono text-[0.8125rem] tabular-nums`},xt=[`title`],St={key:0,class:`text-xs text-dimmed`},Ct={key:1,class:`text-xs text-dimmed`},wt={class:`border-b border-muted px-2.5 py-1.5 text-right font-medium`},Tt={class:`text-xs text-muted`},Et={class:`rounded bg-accented px-1 py-0.5`},Dt={key:3,class:`mb-5 grid gap-3 rounded-lg border border-default bg-elevated px-5 py-4`},Ot=[`data-biller`],kt={class:`text-sm`},At={key:1,class:`text-muted`},jt={key:0,class:`overflow-x-auto`},Mt={class:`data w-full border-collapse whitespace-nowrap font-mono text-[0.8125rem] tabular-nums`},Nt={key:0,class:`border-b border-muted px-2.5 py-1 text-right text-xs font-medium text-muted`},Pt=[`title`],Ft={key:0,class:`border-b border-muted px-2.5 py-1 text-right`},It={class:`border-b border-muted px-2.5 py-1 text-right`},Lt={class:`border-b border-muted px-2.5 py-1 text-right`},Rt={class:`border-b border-muted px-2.5 py-1 text-right`},zt={class:`border-t border-default pt-3.5 text-xs text-dimmed`},Bt={class:`mt-2 grid gap-1.5`},Vt=[`href`],Ht={key:2},Ut=[`href`],Wt={key:2},Gt=[`href`],Kt=[`href`],qt={class:`mb-4 flex flex-wrap items-center gap-x-4 gap-y-2`},Jt={key:0,class:`flex items-center gap-1`,"aria-label":`Cost groups`},Yt={key:0,class:`rounded-md bg-accented px-2.5 py-1 text-xs font-medium text-highlighted`,"aria-current":`page`},Xt={class:`mb-5 grid gap-2 rounded-lg border border-default bg-elevated px-5 py-4`},Zt={class:`flex flex-wrap items-center gap-x-3 gap-y-1`},Qt={class:`font-mono text-xs tabular-nums text-muted`,"data-snapshot-status":``},$t=[`disabled`],en={key:1,class:`text-xs text-error`,role:`status`,"data-snapshot-error":``},tn=a({__name:`CostsPage`,setup(a){let s=y(`costs`),d=b(s?.report??null),h=S(()=>s?.groups??[]),O=S(()=>s?.group??d.value?.group??``),M=b(s?.snapshot??null),ce=se(void 0,6e4),N=S(()=>M.value?re(M.value,ce.value):``),P=S(()=>s?.view??`daily`),F=b(s&&s.view!==`daily`?s.by??null:null),I=[{view:`daily`,tab:`Daily`,subtitle:``},{view:`users`,tab:`By user`,subtitle:`Who started the runs · LLM from their tokens through the price table · cloud allocated by wall-clock`},{view:`threads`,tab:`By thread`,subtitle:`The thread each run ran in · LLM from its tokens through the price table · cloud allocated by wall-clock`},{view:`channels`,tab:`By channel`,subtitle:`The channel each run ran in · LLM from its tokens through the price table · cloud allocated by wall-clock`},{view:`agents`,tab:`By agent`,subtitle:`The agent each run ran on · LLM from its tokens through the price table · cloud allocated by wall-clock`},{view:`models`,tab:`By model`,subtitle:`The model each turn ran on · LLM from its tokens through the price table · cloud is not split by model`}],L=S(()=>I.find(e=>e.view===P.value)??I[0]),R=S(()=>s?.canSnapshot===!0),z=S(()=>typeof window>`u`?null:new URLSearchParams(window.location.search).get(`days`)),le=e=>`/costs/${O.value}${e}${z.value?`?days=${z.value}`:``}`,B=s?.snapshot?.snapshot?.takenAt??null,V=B,H=null;async function ue(){try{let[e,t]=await Promise.all([fetch(le(`.json`),{credentials:`same-origin`}),P.value===`daily`?Promise.resolve(null):fetch(le(`/${P.value}.json`),{credentials:`same-origin`})]);return e.ok?(d.value=await e.json(),t?.ok&&(F.value=await t.json()),!0):!1}catch{return!1}}function U(){if(H||V===null||V===B)return;let e=V;H=ue().then(t=>{t&&(B=e)}).finally(()=>{H=null,V!==e&&U()})}function de(e){M.value=e;let t=e.snapshot?.takenAt??null;t&&(V=t,U())}let fe=ae(),W=null;m(()=>{O.value&&(W=fe(`/costs/${O.value}?stream=1`),W.onmessage=e=>{let t=j(e.data);t&&de(t)})}),ee(()=>W?.close());let G=b(!1),K=b(``);async function q(){G.value=!0,K.value=``;let e=await oe(fetch,`costs.snapshot`,{});e.ok||(K.value=e.failure.message),G.value=!1}function J(e,t,n){let r=[`days=${t}`];return n!==`daily`&&r.push(`view=${n}`),`/costs/${e}?${r.join(`&`)}`}let Y=S(()=>d.value?T(d.value):[]),X=S(()=>d.value?ie(d.value,Y.value):null),Z=S(()=>d.value?k(d.value):null),pe=S(()=>d.value?w(d.value):[]),Q=S(()=>d.value?te(d.value):null),me=S(()=>d.value?ne(d.value):``);function he(e){let t=Q.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 ge(e){let t=Q.value;if(t)return e===`LLM (Anthropic)`?t.anthropic:e===`Durable Objects`?t.durableObjects:e===`Workers · storage · R2`?t.workers:t.containers}let _e=S(()=>{let e=d.value,t=Z.value;if(!e||!t)return``;let n=t.projection,r=`cloud ${D(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 ${D(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}`}`}),tn=S(()=>d.value?[...d.value.days].reverse():[]),nn=S(()=>(d.value?.billers??[]).map(e=>({...e,days:[...e.days].reverse()}))),rn=[1,7,30],an=e=>e===1?`today`:`${e}d`,on=S(()=>{let e=d.value,t=Z.value;if(!e||!t)return``;if(!e.llmAvailable)return`LLM spend not configured`;let n=[];return t.llm.yesterday!==void 0&&n.push(`yesterday ${D(t.llm.yesterday)}`),t.llm.today&&n.push(`today ${D(t.llm.today.usd)}${t.llm.today.estimated?` (estimate)`:``}`),n.length?n.join(` · `):`in range`});function $(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,s)=>{let m=l(`RouterLink`);return d.value&&Z.value?(f(),x(e,{key:0,title:`${d.value.label} spend`,nav:`costs`},{default:u(()=>[p(`div`,ye,[p(`nav`,be,[(f(),t(v,null,n(rn,e=>(f(),t(v,{key:e},[e===d.value.range.days?(f(),t(`span`,xe,i(an(e)),1)):(f(),x(m,{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`,to:J(d.value.group,e,P.value)},{default:u(()=>[_(i(an(e)),1)]),_:2},1032,[`to`]))],64))),64))]),h.value.length>1?(f(),t(`nav`,Se,[(f(!0),t(v,null,n(h.value,e=>(f(),t(v,{key:e},[e===d.value.group?(f(),t(`span`,Ce,i(e),1)):(f(),x(m,{key:1,class:`rounded-md px-2.5 py-1 text-xs text-muted no-underline hover:bg-elevated hover:text-highlighted`,to:J(e,d.value.range.days,P.value)},{default:u(()=>[_(i(e),1)]),_:2},1032,[`to`]))],64))),128))])):c(``,!0),p(`p`,we,[_(i($(d.value.range.from))+` → `+i($(d.value.range.to))+` · `+i(d.value.range.days)+`d`,1),d.value.range.partialLastDay?(f(),t(v,{key:0},[_(` · today partial`)],64)):c(``,!0)]),N.value?(f(),t(`div`,Te,[p(`p`,Ee,i(N.value),1),R.value?(f(),t(`button`,{key:0,type:`button`,class:`rounded-md border border-default px-2 py-0.5 text-xs text-muted hover:bg-elevated hover:text-highlighted disabled:cursor-not-allowed disabled:opacity-60`,disabled:G.value||M.value?.inFlight!==null,"data-snapshot-now":``,onClick:q},i(M.value?.inFlight?`Taking…`:`Snapshot now`),9,De)):c(``,!0),K.value?(f(),t(`span`,Oe,i(K.value),1)):c(``,!0)])):c(``,!0)]),p(`section`,ke,[Z.value.yesterday?(f(),t(`div`,Ae,[s[0]||=p(`span`,{class:`font-mono text-[0.6875rem] font-medium uppercase tracking-widest text-dimmed`},`Yesterday`,-1),p(`span`,je,i(g(D)(Z.value.yesterday.total)),1),p(`span`,Me,i(Z.value.yesterday.date)+` · last full day`,1)])):(f(),t(`div`,Ne,[s[1]||=p(`span`,{class:`font-mono text-[0.6875rem] font-medium uppercase tracking-widest text-dimmed`},`Today so far`,-1),p(`span`,Pe,i(Z.value.today?g(D)(Z.value.today.total):`—`),1),p(`span`,Fe,i(Z.value.today?`${Z.value.today.date} · partial day, UTC`:`no day in range`),1)])),p(`div`,Ie,[s[2]||=p(`span`,{class:`font-mono text-[0.6875rem] font-medium uppercase tracking-widest text-dimmed`},`7-day average`,-1),p(`span`,Le,i(Z.value.avg7===void 0?`—`:g(D)(Z.value.avg7)),1),p(`span`,Re,i(Z.value.avg7===void 0?`no full day yet in this range`:`per day, full days only`),1)]),p(`div`,ze,[s[3]||=p(`span`,{class:`font-mono text-[0.6875rem] font-medium uppercase tracking-widest text-dimmed`},`Projected month`,-1),p(`span`,Be,i(g(D)(Z.value.projection.monthUsd,0)),1),p(`span`,Ve,i(_e.value),1)]),p(`div`,He,[s[4]||=p(`span`,{class:`font-mono text-[0.6875rem] font-medium uppercase tracking-widest text-dimmed`},`LLM spend`,-1),p(`span`,Ue,i(d.value.llmAvailable?g(D)(Z.value.llm.range):`—`),1),p(`span`,We,i(on.value),1)]),p(`div`,Ge,[s[6]||=p(`span`,{class:`font-mono text-[0.6875rem] font-medium uppercase tracking-widest text-dimmed`},`Share of account`,-1),p(`span`,Ke,i(Z.value.accountShare)+`%`,1),p(`span`,qe,[_(i(g(D)(d.value.totals.cloudUsd))+` of `+i(g(D)(d.value.account.cloudUsd))+` on `,1),Q.value?(f(),t(`a`,{key:0,class:`text-primary hover:underline`,href:Q.value.account,target:`_blank`,rel:`noopener noreferrer`,title:`Cloudflare account ${d.value.account.id}`},i(me.value),9,Je)):c(``,!0),s[5]||=_(` · Cloudflare spend in range · `,-1),Q.value?(f(),t(`a`,{key:1,class:`text-primary hover:underline`,href:Q.value.billing,target:`_blank`,rel:`noopener noreferrer`},`billing`,8,Ye)):c(``,!0)])])]),p(`section`,Xe,[p(`div`,Ze,[s[7]||=p(`div`,null,[p(`h2`,{class:`text-[0.9375rem] font-medium`},`Daily cost`),p(`p`,{class:`text-sm text-muted`},`Stacked by component · USD list price`)],-1),p(`div`,Qe,[(f(!0),t(v,null,n(Y.value,(e,n)=>(f(),t(`a`,{key:e,class:`inline-flex items-center gap-1.5 no-underline hover:text-highlighted hover:underline`,href:ge(e),target:`_blank`,rel:`noopener noreferrer`,title:`Open where ${e} is billed`},[p(`i`,{class:o([`inline-block size-2.5 rounded-xs`,g(C)[n%g(C).length]])},null,2),_(i(e),1)],8,$e))),128))])]),X.value?(f(),x(A,{key:0,model:X.value,label:`Daily cost, stacked by component`},null,8,[`model`])):c(``,!0),d.value.llmAvailable?d.value.days.some(e=>e.llmEstimated)?(f(),t(`p`,tt,[s[9]||=_(` 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),d.value.days.some(e=>e.llmUnpricedTokens>0)?(f(),t(v,{key:0},[_(` Some tokens ran under a model this page has no price for and are not in the estimate. `)],64)):c(``,!0)])):c(``,!0):(f(),t(`p`,et,[...s[8]||=[_(` LLM spend not configured — set `,-1),p(`code`,null,`ANTHROPIC_ADMIN_KEY`,-1),_(` and the group's `,-1),p(`code`,null,`anthropicWorkspaceId`,-1),_(` to layer it in. `,-1)]]))]),p(`nav`,nt,[(f(),t(v,null,n(I,e=>(f(),t(v,{key:e.view},[e.view===P.value?(f(),t(`span`,rt,i(e.tab),1)):(f(),x(m,{key:1,class:`-mb-px border-b-2 border-transparent px-3 py-1.5 text-sm text-muted no-underline hover:border-muted hover:text-highlighted`,to:J(d.value.group,d.value.range.days,e.view)},{default:u(()=>[_(i(e.tab),1)]),_:2},1032,[`to`]))],64))),64))]),P.value===`daily`?c(``,!0):(f(),t(`section`,it,[p(`div`,null,[p(`h2`,at,`Cost `+i(L.value.tab.toLowerCase()),1),p(`p`,ot,i(L.value.subtitle),1)]),F.value?(f(),x(ve,{key:0,report:F.value},null,8,[`report`])):(f(),t(`p`,st,` The `+i(L.value.tab.toLowerCase())+` report did not load with this page. `,1)),p(`p`,ct,[s[10]||=_(` Machine-readable twin: `,-1),p(`code`,lt,`GET /costs/`+i(d.value.group)+`/`+i(P.value)+`.json`,1),s[11]||=_(` (same Access gate). `,-1)])])),P.value===`daily`?(f(),t(`section`,ut,[s[12]||=p(`div`,null,[p(`h2`,{class:`text-[0.9375rem] font-medium`},`What each cloud dollar buys`)],-1),p(`table`,dt,[p(`tbody`,null,[(f(!0),t(v,null,n(pe.value,e=>(f(),t(`tr`,{key:e.label,class:`border-b border-muted`},[p(`td`,ft,[he(e.label)?(f(),t(`a`,{key:0,class:`no-underline hover:text-highlighted hover:underline`,href:he(e.label),target:`_blank`,rel:`noopener noreferrer`,title:`Open where this is billed on Cloudflare`},i(e.label),9,pt)):(f(),t(v,{key:1},[_(i(e.label),1)],64))]),p(`td`,mt,i(g(D)(e.usd)),1),p(`td`,ht,i(Math.round(e.percent))+`%`,1),p(`td`,gt,[p(`i`,{class:`block h-2.5 rounded-xs bg-primary opacity-75`,style:r({width:`${e.percent.toFixed(1)}%`})},null,4)])]))),128))])])])):c(``,!0),P.value===`daily`?(f(),t(`section`,_t,[p(`details`,vt,[s[15]||=p(`summary`,{class:`cursor-pointer text-sm text-muted`},`Table view — daily cost by component (USD)`,-1),p(`div`,yt,[p(`table`,bt,[p(`thead`,null,[p(`tr`,null,[s[13]||=p(`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),(f(!0),t(v,null,n(Y.value,e=>(f(),t(`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`},i(e),1))),128)),s[14]||=p(`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)])]),p(`tbody`,null,[(f(!0),t(v,null,n(tn.value,e=>(f(),t(`tr`,{key:e.date},[p(`td`,{class:`border-b border-muted px-2.5 py-1.5`,title:e.date},[_(i($(e.date))+` `,1),d.value.range.partialLastDay&&e.date===d.value.range.to?(f(),t(`span`,St,`(partial day`+i(e.llmEstimated?` · LLM estimated`:``)+`)`,1)):e.llmEstimated?(f(),t(`span`,Ct,`(LLM estimated)`)):c(``,!0)],8,xt),(f(!0),t(v,null,n(Y.value,n=>(f(),t(`td`,{key:n,class:`border-b border-muted px-2.5 py-1.5 text-right`},i(g(D)(g(E)(e,n),3)),1))),128)),p(`td`,wt,i(g(D)(e.total,3)),1)]))),128))])])])]),p(`p`,Tt,[s[16]||=_(` Machine-readable twin: `,-1),p(`code`,Et,`GET /costs/`+i(d.value.group)+`.json`,1),s[17]||=_(` (same Access gate). `,-1)])])):c(``,!0),P.value===`daily`&&nn.value.length?(f(),t(`section`,Dt,[s[22]||=p(`div`,null,[p(`h2`,{class:`text-[0.9375rem] font-medium`},`Invoice tie-out by biller`),p(`p`,{class:`text-xs text-muted`},[_(` Each biller's own invoice beside the summed `),p(`code`,null,`model.turn`),_(` dollars its runs attributed — an aggregator's fee against the summed fees, its BYOK upstream against the remainder. `)])],-1),(f(!0),t(v,null,n(nn.value,e=>(f(),t(`div`,{key:e.biller,class:`grid gap-1.5`,"data-biller":e.biller},[p(`p`,kt,[p(`b`,null,i(e.biller),1),e.invoice?(f(),t(v,{key:0},[_(` · invoice `+i(g(D)(e.totals.invoiceUsd,4))+` · attributed `+i(g(D)(e.totals.attributedUsd,4)),1)],64)):(f(),t(`span`,At,` · no invoice — the block names no invoice source`))]),e.days.length?(f(),t(`div`,jt,[p(`table`,Mt,[p(`thead`,null,[p(`tr`,null,[s[18]||=p(`th`,{class:`border-b border-muted px-2.5 py-1 text-left text-xs font-medium text-muted`},`Date`,-1),e.invoice?(f(),t(`th`,Nt,` Invoice `)):c(``,!0),s[19]||=p(`th`,{class:`border-b border-muted px-2.5 py-1 text-right text-xs font-medium text-muted`},`Attributed`,-1),s[20]||=p(`th`,{class:`border-b border-muted px-2.5 py-1 text-right text-xs font-medium text-muted`},` Fee (invoice / rows) `,-1),s[21]||=p(`th`,{class:`border-b border-muted px-2.5 py-1 text-right text-xs font-medium text-muted`},` Upstream (invoice / remainder) `,-1)])]),p(`tbody`,null,[(f(!0),t(v,null,n(e.days,n=>(f(),t(`tr`,{key:n.date},[p(`td`,{class:`border-b border-muted px-2.5 py-1`,title:n.date},i($(n.date)),9,Pt),e.invoice?(f(),t(`td`,Ft,i(n.invoiceUsd===void 0?`—`:g(D)(n.invoiceUsd,4)),1)):c(``,!0),p(`td`,It,i(g(D)(n.attributedUsd,4)),1),p(`td`,Lt,[n.invoiceFeeUsd!==void 0||n.attributedFeeUsd!==void 0?(f(),t(v,{key:0},[_(i(n.invoiceFeeUsd===void 0?`—`:g(D)(n.invoiceFeeUsd,4))+` / `+i(n.attributedFeeUsd===void 0?`—`:g(D)(n.attributedFeeUsd,4)),1)],64)):(f(),t(v,{key:1},[_(`—`)],64))]),p(`td`,Rt,[n.invoiceByokUsd!==void 0||n.attributedUpstreamUsd!==void 0?(f(),t(v,{key:0},[_(i(n.invoiceByokUsd===void 0?`—`:g(D)(n.invoiceByokUsd,4))+` / `+i(n.attributedUpstreamUsd===void 0?`—`:g(D)(n.attributedUpstreamUsd,4)),1)],64)):(f(),t(v,{key:1},[_(`—`)],64))])]))),128))])])])):c(``,!0)],8,Ot))),128))])):c(``,!0),p(`footer`,zt,[p(`details`,null,[s[30]||=p(`summary`,{class:`cursor-pointer text-muted`},`How these numbers are computed`,-1),p(`div`,Bt,[s[28]||=p(`div`,null,[p(`b`,null,`Snapshot.`),_(` Both billing sources and the run history are read once over the widest range this page offers and kept as a snapshot; every figure here, the JSON twins and the dimension tabs are arithmetic over it, with `),p(`em`,null,`today`),_(` the day it was taken. The line under the range says when that was, how old it is and when the next one is due (`),p(`code`,null,`costs.snapshot.everyHours`),_(`, daily by default); `),p(`code`,null,`costs snapshot`),_(` takes one now. 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),s[29]||=p(`div`,null,[p(`b`,null,`Method.`),_(` Cloudflare GraphQL Analytics, every meter a Workers deployment is billed on: `),p(`code`,null,`containersUsageAdaptiveGroups`),_(` (cpuTimeSec, allocatedMemory, allocatedDisk per app per UTC day), `),p(`code`,null,`durableObjectsPeriodicGroups`),_(` (billable `),p(`code`,null,`duration`),_(` GB-s and SQLite rows read and written per namespace), `),p(`code`,null,`durableObjectsInvocationsAdaptiveGroups`),_(` (requests per namespace), `),p(`code`,null,`durableObjectsSqlStorageGroups`),_(` (bytes stored), `),p(`code`,null,`workersInvocationsAdaptive`),_(` (requests, CPU time), `),p(`code`,null,`r2StorageAdaptiveGroups`),_(` and `),p(`code`,null,`r2OperationsAdaptiveGroups`),_(` (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),p(`div`,null,[s[23]||=p(`b`,null,`Scope.`,-1),s[24]||=_(` Attributed to this group: the Workers `,-1),(f(!0),t(v,null,n(d.value.attribution.workers,(e,n)=>(f(),t(v,{key:e},[n>0?(f(),t(v,{key:0},[_(`, `)],64)):c(``,!0),Q.value?(f(),t(`a`,{key:1,class:`font-mono hover:underline`,href:Q.value.worker(e),target:`_blank`,rel:`noopener noreferrer`},i(e),9,Vt)):(f(),t(`code`,Ht,i(e),1))],64))),128)),_(`, every Durable Object namespace they host (`+i(Object.keys(d.value.attribution.durableObjectNamespaces).length)+`), the R2 buckets named after them (`,1),(f(!0),t(v,null,n(Object.keys(d.value.attribution.r2Buckets),(e,n)=>(f(),t(v,{key:e},[n>0?(f(),t(v,{key:0},[_(`, `)],64)):c(``,!0),Q.value?(f(),t(`a`,{key:1,class:`font-mono hover:underline`,href:Q.value.bucket(e),target:`_blank`,rel:`noopener noreferrer`},i(e),9,Ut)):(f(),t(`code`,Wt,i(e),1))],64))),128)),Object.keys(d.value.attribution.r2Buckets).length===0?(f(),t(v,{key:0},[_(`none`)],64)):c(``,!0),s[25]||=_(`), and the container apps mapped in `,-1),p(`code`,null,`costs.groups.`+i(d.value.group),1),_(` (`+i(Object.keys(d.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),Q.value?(f(),t(`a`,{key:1,class:`hover:underline`,href:Q.value.account,target:`_blank`,rel:`noopener noreferrer`},`Cloudflare dashboard`,8,Gt)):c(``,!0),s[26]||=_(` for the account `,-1),p(`code`,null,i(d.value.account.id),1),_(i(d.value.account.name?` (${d.value.account.name})`:``)+`, and `,1),Q.value?(f(),t(`a`,{key:2,class:`hover:underline`,href:Q.value.anthropic,target:`_blank`,rel:`noopener noreferrer`},`Anthropic's cost page`,8,Kt)):c(``,!0),s[27]||=_(` for the LLM line. `,-1)])])])])]),_:1},8,[`title`])):(f(),x(e,{key:1,title:`${O.value} spend`,nav:`costs`},{default:u(()=>[p(`div`,qt,[h.value.length>1?(f(),t(`nav`,Jt,[(f(!0),t(v,null,n(h.value,e=>(f(),t(v,{key:e},[e===O.value?(f(),t(`span`,Yt,i(e),1)):(f(),x(m,{key:1,class:`rounded-md px-2.5 py-1 text-xs text-muted no-underline hover:bg-elevated hover:text-highlighted`,to:`/costs/${e}`},{default:u(()=>[_(i(e),1)]),_:2},1032,[`to`]))],64))),128))])):c(``,!0)]),p(`section`,Xt,[s[31]||=p(`h2`,{class:`text-sm font-medium text-highlighted`},`Nothing to show yet`,-1),p(`div`,Zt,[p(`p`,Qt,i(N.value),1),R.value?(f(),t(`button`,{key:0,type:`button`,class:`rounded-md border border-default px-2 py-0.5 text-xs text-muted hover:bg-elevated hover:text-highlighted disabled:cursor-not-allowed disabled:opacity-60`,disabled:G.value||M.value?.inFlight!==null,"data-snapshot-now":``,onClick:q},i(M.value?.inFlight?`Taking…`:`Snapshot now`),9,$t)):c(``,!0),K.value?(f(),t(`span`,en,i(K.value),1)):c(``,!0)]),s[32]||=p(`p`,{class:`text-xs text-dimmed`},[_(` The page prices a stored snapshot of both billing sources, never a live read; the figures appear here the moment the first one lands (this page listens for it), or take one now with `),p(`code`,null,`costs snapshot`),_(`. `)],-1)])]),_:1},8,[`title`]))}}});export{tn as default};
@@ -1 +1 @@
1
- import{t as e}from"./AppShell-Bmz8nzz3.js";import{An as t,Cn as n,Cr as r,Li as i,Mn as ee,Pi as a,Sn as o,Tr as te,Xr as s,_r as c,bn as l,ji as u,kn as d,ln as f,o as p,xn as m,yn as h}from"./browser-B6T5hjfR.js";import{a as g,c as ne,d as re,i as ie,l as _,n as ae,o as v,r as y,s as b,t as x,u as oe}from"./delivery-CTdOqpVK.js";import{t as se}from"./wallClock-DmaC1sKA.js";import"./budgets-CbIyPAER.js";function S(e,t){return e.truncated&&e.completeFrom!==void 0&&Date.parse(`${t}T00:00:00Z`)<Date.parse(e.completeFrom)}Object.freeze({reviewers:[],agentLogins:[],agentCoauthors:[]}),Object.freeze({default:60,min:5,max:1440});var C={class:`text-xs text-muted`},w={key:1,class:`text-highlighted`},T={class:`mb-4 flex flex-wrap items-center gap-x-4 gap-y-2`},E={key:0,class:`flex items-center gap-1`,"aria-label":`Repositories`},D={key:0,class:`rounded-md bg-accented px-2.5 py-1 text-xs font-medium text-highlighted`,"aria-current":`page`},O={class:`font-mono text-sm tabular-nums text-muted`},k={class:`mb-5 grid gap-3`},A={key:0,class:`text-sm text-muted`},j={class:`grid grid-cols-[repeat(auto-fit,minmax(190px,1fr))] gap-3`},M={class:`font-mono text-[0.6875rem] font-medium uppercase tracking-widest text-dimmed`},N={class:`font-mono text-2xl font-medium tabular-nums`},P={class:`text-xs text-muted`},F={class:`mb-5 grid gap-3 rounded-lg border border-default bg-elevated px-5 py-4`},I={class:`overflow-x-auto`},L={class:`weeks w-full min-w-[52rem] border-collapse whitespace-nowrap font-mono text-[0.8125rem] tabular-nums`},R=[`title`],z={key:0,class:`ml-1 text-xs`},B={key:0,class:`text-xs text-muted`},V={class:`mb-5 grid gap-3 rounded-lg border border-default bg-elevated px-5 py-4`},ce={key:0,class:`text-sm text-muted`},H={key:1,class:`overflow-x-auto`},U={class:`units w-full min-w-[52rem] border-collapse font-mono text-[0.8125rem] tabular-nums`},W=[`href`],G={key:1,class:`text-dimmed`},le=[`title`],ue=[`href`],de={class:`text-xs text-muted`},fe={class:`rounded bg-accented px-1 py-0.5`},pe={class:`border-t border-default pt-3.5 text-xs text-dimmed`},me={key:0,class:`mb-2 font-mono tabular-nums text-muted`},he={class:`mt-2 grid gap-1.5`},K=`border-b border-muted bg-(--ui-bg-muted) px-2.5 py-1.5 text-xs font-medium text-muted whitespace-nowrap`,q=`border-b border-muted px-2.5 py-1.5`,J=ee({__name:`DeliveryPage`,setup(ee){let J=p(`delivery`),Y=h(()=>J?.report??null),X=h(()=>J?.repos??[]),ge=h(()=>Y.value?oe(Y.value):[]),Z=h(()=>Y.value?ae(Y.value):void 0),Q=e=>Y.value?S(Y.value,e):!1,$=h(()=>Y.value?.weeks.some(e=>Q(e.week))??!1),_e=[1,2,4,8,13],ve=se(void 0,6e4),ye=typeof window>`u`?``:window.location.search;return(ee,p)=>{let h=te(`RouterLink`);return Y.value?(c(),m(e,{key:0,title:`${Y.value.repo} delivery`,nav:`delivery`},{actions:s(()=>[l(`span`,C,[(c(),n(f,null,r(_e,(e,t)=>(c(),n(f,{key:e},[t>0?(c(),n(f,{key:0},[d(` · `)],64)):o(``,!0),e===Y.value.range.weeks?(c(),n(`b`,w,i(e)+`w`,1)):(c(),m(h,{key:2,class:`text-primary hover:underline`,to:`/delivery/${Y.value.repo}?weeks=${e}`},{default:s(()=>[d(i(e)+`w`,1)]),_:2},1032,[`to`]))],64))),64))])]),default:s(()=>[l(`div`,T,[X.value.length>1?(c(),n(`nav`,E,[(c(!0),n(f,null,r(X.value,e=>(c(),n(f,{key:e},[e===Y.value.repo?(c(),n(`span`,D,i(e),1)):(c(),m(h,{key:1,class:`rounded-md px-2.5 py-1 text-xs text-muted no-underline hover:bg-elevated hover:text-highlighted`,to:`/delivery/${e}`},{default:s(()=>[d(i(e),1)]),_:2},1032,[`to`]))],64))),128))])):o(``,!0),l(`p`,O,i(u(v)(Y.value.range.since))+` → `+i(u(v)(Y.value.range.until))+` · `+i(Y.value.range.weeks)+`w · weeks start Monday, UTC `,1)]),l(`section`,k,[Z.value?(c(),n(`p`,A,i(Z.value),1)):o(``,!0),l(`div`,j,[(c(!0),n(f,null,r(ge.value,e=>(c(),n(`div`,{key:e.label,class:`grid gap-0.5 rounded-lg border border-default bg-elevated px-4 py-3.5`},[l(`span`,M,i(e.label),1),l(`span`,N,i(e.value),1),l(`span`,P,i(e.note),1)]))),128))])]),l(`section`,F,[p[0]||=l(`div`,null,[l(`h2`,{class:`text-[0.9375rem] font-medium`},`By week`),l(`p`,{class:`text-sm text-muted`},`One row per Monday-start week · merged pull requests only`)],-1),l(`div`,I,[l(`table`,L,[l(`thead`,null,[l(`tr`,null,[l(`th`,{class:a([K,`text-left`])},`Week`,2),l(`th`,{class:a([K,`text-right`])},`Merged`,2),l(`th`,{class:a([K,`text-right`])},`Agent-authored`,2),l(`th`,{class:a([K,`text-right`])},`Issue → merge`,2),l(`th`,{class:a([K,`text-right`])},`First-pass CI`,2),l(`th`,{class:a([K,`text-right`])},`Rounds / PR`,2),l(`th`,{class:a([K,`text-right`])},`Findings`,2),l(`th`,{class:a([K,`text-right`])},`No human edit`,2),l(`th`,{class:a([K,`text-right`])},`Agent run min`,2)])]),l(`tbody`,null,[(c(!0),n(f,null,r(Y.value.weeks,e=>(c(),n(`tr`,{key:e.week,class:a(Q(e.week)?`text-dimmed`:``)},[l(`td`,{class:a(q),title:`${e.week} → ${e.until}`},[d(i(u(v)(e.week))+` – `+i(u(v)(e.until))+` `,1),Q(e.week)?(c(),n(`span`,z,`(incomplete)`)):o(``,!0)],8,R),l(`td`,{class:a([q,`text-right font-medium`])},i(e.prsMerged),3),l(`td`,{class:a([q,`text-right`])},i(e.agentAuthoredPrs),3),l(`td`,{class:a([q,`text-right`])},i(u(g)(e.leadTimeHours.median)),3),l(`td`,{class:a([q,`text-right`])},i(u(x)(e)),3),l(`td`,{class:a([q,`text-right`])},i(u(ne)(e.reviewRounds.perPr)),3),l(`td`,{class:a([q,`text-right`])},i(u(y)(e)),3),l(`td`,{class:a([q,`text-right`])},i(u(b)(e.findings.noHumanEditShare)),3),l(`td`,{class:a([q,`text-right`])},i(e.agentRuns.minutes.toFixed(0)),3)],2))),128))])])]),$.value&&Y.value.completeFrom?(c(),n(`p`,B,` Incomplete weeks hold the newest pull requests the read reached — it is complete from `+i(u(_)(Y.value.completeFrom))+` — so their numbers are a floor on the merges, not the week's. `,1)):o(``,!0)]),l(`section`,V,[p[3]||=l(`div`,null,[l(`h2`,{class:`text-[0.9375rem] font-medium`},`By unit`),l(`p`,{class:`text-sm text-muted`},` One row per board issue the pull requests link · the issue's opening starts the clock `)],-1),Y.value.units.length===0?(c(),n(`p`,ce,`Nothing merged in range.`)):(c(),n(`div`,H,[l(`table`,U,[l(`thead`,null,[l(`tr`,null,[l(`th`,{class:a([K,`text-left`])},`Issue`,2),l(`th`,{class:a([K,`text-left`])},`Unit`,2),l(`th`,{class:a([K,`text-left`])},`PRs`,2),l(`th`,{class:a([K,`text-right`])},`Issue → merge`,2),l(`th`,{class:a([K,`text-right`])},`First-pass CI`,2),l(`th`,{class:a([K,`text-right`])},`Rounds`,2),l(`th`,{class:a([K,`text-right`])},`Findings`,2),l(`th`,{class:a([K,`text-right`])},`No human edit`,2)])]),l(`tbody`,null,[(c(!0),n(f,null,r(Y.value.units,e=>(c(),n(`tr`,{key:e.issue??`none`},[l(`td`,{class:a([q,`whitespace-nowrap`])},[e.issue===null?(c(),n(`span`,G,`—`)):(c(),n(`a`,{key:0,class:`text-primary hover:underline`,href:`https://github.com/${Y.value.repo}/issues/${e.issue}`},`#`+i(e.issue),9,W))],2),l(`td`,{class:a([q,`max-w-[28rem] truncate font-sans`]),title:e.title},i(e.title),11,le),l(`td`,{class:a([q,`whitespace-nowrap`])},[(c(!0),n(f,null,r(e.prs,(e,t)=>(c(),n(f,{key:e},[t>0?(c(),n(f,{key:0},[d(`, `)],64)):o(``,!0),l(`a`,{class:`text-primary hover:underline`,href:`https://github.com/${Y.value.repo}/pull/${e}`},i(e),9,ue)],64))),128))],2),l(`td`,{class:a([q,`text-right`])},i(u(g)(e.leadTimeHours.median)),3),l(`td`,{class:a([q,`text-right`])},i(u(x)(e)),3),l(`td`,{class:a([q,`text-right`])},i(e.reviewRounds.verdicts),3),l(`td`,{class:a([q,`text-right`])},i(u(y)(e)),3),l(`td`,{class:a([q,`text-right`])},i(u(b)(e.findings.noHumanEditShare)),3)]))),128))])])])),l(`p`,de,[p[1]||=d(` Machine-readable twin: `,-1),l(`code`,fe,`GET /delivery/`+i(Y.value.repo)+`.json`,1),p[2]||=d(` (same gate). `,-1)])]),l(`footer`,pe,[Y.value.snapshotAt?(c(),n(`p`,me,[d(` As of `+i(u(_)(Y.value.snapshotAt))+`, `+i(u(re)(Y.value.snapshotAt,u(ve)))+` · `,1),t(h,{class:`text-primary hover:underline`,to:`/delivery/${Y.value.repo}${u(ie)(u(ye))}`},{default:s(()=>[...p[4]||=[d(`read GitHub now`,-1)]]),_:1},8,[`to`])])):o(``,!0),l(`details`,null,[p[14]||=l(`summary`,{class:`cursor-pointer text-muted`},`How these numbers are computed`,-1),l(`div`,he,[p[12]||=l(`div`,null,[l(`b`,null,`Snapshot.`),d(` GitHub's record of the merged pull requests (each one's timeline and its branch's workflow runs, the board issue its body links) is read on an interval and kept as a snapshot the page, its JSON twin and `),l(`code`,null,`delivery report`),d(` serve; `),l(`code`,null,`?fresh=1`),d(` reads GitHub now. The run history you may see joins on every load. `)],-1),p[13]||=l(`div`,null,[l(`b`,null,`Issue → merge`),d(` runs from the linked board issue's opening (a closing keyword or a `),l(`code`,null,`board item`),d(` reference in the body) to the merge; a pull request that links no issue counts from its own opening. `),l(`b`,null,`First-pass CI`),d(` is green when every pull-request-triggered workflow run (`),l(`code`,null,`pull_request`),d(`, `),l(`code`,null,`pull_request_target`),d(`) on the first head succeeded at its first attempt — a rerun or a red run fails it; a head with no such run is not counted. `),l(`b`,null,`Review rounds`),d(` are the review agent's verdicts; a `),l(`i`,null,`fix round`),d(` is a verdict that followed a push. `),l(`b`,null,`No human edit`),d(` is the share of the agent's findings on pull requests where every push after the first verdict was an agent's: a bot login, or a commit co-authored by an agent. `),l(`b`,null,`Agent run minutes`),d(` are the finished runs of this repository that named a pull request. `)],-1),l(`div`,null,[p[6]||=l(`b`,null,`Identities.`,-1),p[7]||=d(` Verdicts by `,-1),l(`code`,null,i(Y.value.identities.reviewers.join(`, `)||`(none configured)`),1),p[8]||=d(`; agent logins end in `,-1),p[9]||=l(`code`,null,`[bot]`,-1),Y.value.identities.agentLogins.length?(c(),n(f,{key:0},[p[5]||=d(`, plus `,-1),l(`code`,null,i(Y.value.identities.agentLogins.join(`, `)),1)],64)):o(``,!0),p[10]||=d(`; agent co-authors named `,-1),l(`code`,null,i(Y.value.identities.agentCoauthors.join(`, `)||`(none)`),1),p[11]||=d(`. `,-1)])])])])]),_:1},8,[`title`])):o(``,!0)}}});export{J as default};
1
+ import{t as e}from"./AppShell-CSXDCV4x.js";import{An as t,Cn as n,Cr as r,Li as i,Mn as ee,Pi as a,Sn as o,Tr as te,Xr as s,_r as c,bn as l,ji as u,kn as d,ln as f,o as p,xn as m,yn as h}from"./browser-B6T5hjfR.js";import{a as g,c as ne,d as re,i as ie,l as _,n as ae,o as v,r as y,s as b,t as x,u as oe}from"./delivery-CTdOqpVK.js";import{t as se}from"./wallClock-DmaC1sKA.js";import"./budgets-CbIyPAER.js";function S(e,t){return e.truncated&&e.completeFrom!==void 0&&Date.parse(`${t}T00:00:00Z`)<Date.parse(e.completeFrom)}Object.freeze({reviewers:[],agentLogins:[],agentCoauthors:[]}),Object.freeze({default:60,min:5,max:1440});var C={class:`text-xs text-muted`},w={key:1,class:`text-highlighted`},T={class:`mb-4 flex flex-wrap items-center gap-x-4 gap-y-2`},E={key:0,class:`flex items-center gap-1`,"aria-label":`Repositories`},D={key:0,class:`rounded-md bg-accented px-2.5 py-1 text-xs font-medium text-highlighted`,"aria-current":`page`},O={class:`font-mono text-sm tabular-nums text-muted`},k={class:`mb-5 grid gap-3`},A={key:0,class:`text-sm text-muted`},j={class:`grid grid-cols-[repeat(auto-fit,minmax(190px,1fr))] gap-3`},M={class:`font-mono text-[0.6875rem] font-medium uppercase tracking-widest text-dimmed`},N={class:`font-mono text-2xl font-medium tabular-nums`},P={class:`text-xs text-muted`},F={class:`mb-5 grid gap-3 rounded-lg border border-default bg-elevated px-5 py-4`},I={class:`overflow-x-auto`},L={class:`weeks w-full min-w-[52rem] border-collapse whitespace-nowrap font-mono text-[0.8125rem] tabular-nums`},R=[`title`],z={key:0,class:`ml-1 text-xs`},B={key:0,class:`text-xs text-muted`},V={class:`mb-5 grid gap-3 rounded-lg border border-default bg-elevated px-5 py-4`},ce={key:0,class:`text-sm text-muted`},H={key:1,class:`overflow-x-auto`},U={class:`units w-full min-w-[52rem] border-collapse font-mono text-[0.8125rem] tabular-nums`},W=[`href`],G={key:1,class:`text-dimmed`},le=[`title`],ue=[`href`],de={class:`text-xs text-muted`},fe={class:`rounded bg-accented px-1 py-0.5`},pe={class:`border-t border-default pt-3.5 text-xs text-dimmed`},me={key:0,class:`mb-2 font-mono tabular-nums text-muted`},he={class:`mt-2 grid gap-1.5`},K=`border-b border-muted bg-(--ui-bg-muted) px-2.5 py-1.5 text-xs font-medium text-muted whitespace-nowrap`,q=`border-b border-muted px-2.5 py-1.5`,J=ee({__name:`DeliveryPage`,setup(ee){let J=p(`delivery`),Y=h(()=>J?.report??null),X=h(()=>J?.repos??[]),ge=h(()=>Y.value?oe(Y.value):[]),Z=h(()=>Y.value?ae(Y.value):void 0),Q=e=>Y.value?S(Y.value,e):!1,$=h(()=>Y.value?.weeks.some(e=>Q(e.week))??!1),_e=[1,2,4,8,13],ve=se(void 0,6e4),ye=typeof window>`u`?``:window.location.search;return(ee,p)=>{let h=te(`RouterLink`);return Y.value?(c(),m(e,{key:0,title:`${Y.value.repo} delivery`,nav:`delivery`},{actions:s(()=>[l(`span`,C,[(c(),n(f,null,r(_e,(e,t)=>(c(),n(f,{key:e},[t>0?(c(),n(f,{key:0},[d(` · `)],64)):o(``,!0),e===Y.value.range.weeks?(c(),n(`b`,w,i(e)+`w`,1)):(c(),m(h,{key:2,class:`text-primary hover:underline`,to:`/delivery/${Y.value.repo}?weeks=${e}`},{default:s(()=>[d(i(e)+`w`,1)]),_:2},1032,[`to`]))],64))),64))])]),default:s(()=>[l(`div`,T,[X.value.length>1?(c(),n(`nav`,E,[(c(!0),n(f,null,r(X.value,e=>(c(),n(f,{key:e},[e===Y.value.repo?(c(),n(`span`,D,i(e),1)):(c(),m(h,{key:1,class:`rounded-md px-2.5 py-1 text-xs text-muted no-underline hover:bg-elevated hover:text-highlighted`,to:`/delivery/${e}`},{default:s(()=>[d(i(e),1)]),_:2},1032,[`to`]))],64))),128))])):o(``,!0),l(`p`,O,i(u(v)(Y.value.range.since))+` → `+i(u(v)(Y.value.range.until))+` · `+i(Y.value.range.weeks)+`w · weeks start Monday, UTC `,1)]),l(`section`,k,[Z.value?(c(),n(`p`,A,i(Z.value),1)):o(``,!0),l(`div`,j,[(c(!0),n(f,null,r(ge.value,e=>(c(),n(`div`,{key:e.label,class:`grid gap-0.5 rounded-lg border border-default bg-elevated px-4 py-3.5`},[l(`span`,M,i(e.label),1),l(`span`,N,i(e.value),1),l(`span`,P,i(e.note),1)]))),128))])]),l(`section`,F,[p[0]||=l(`div`,null,[l(`h2`,{class:`text-[0.9375rem] font-medium`},`By week`),l(`p`,{class:`text-sm text-muted`},`One row per Monday-start week · merged pull requests only`)],-1),l(`div`,I,[l(`table`,L,[l(`thead`,null,[l(`tr`,null,[l(`th`,{class:a([K,`text-left`])},`Week`,2),l(`th`,{class:a([K,`text-right`])},`Merged`,2),l(`th`,{class:a([K,`text-right`])},`Agent-authored`,2),l(`th`,{class:a([K,`text-right`])},`Issue → merge`,2),l(`th`,{class:a([K,`text-right`])},`First-pass CI`,2),l(`th`,{class:a([K,`text-right`])},`Rounds / PR`,2),l(`th`,{class:a([K,`text-right`])},`Findings`,2),l(`th`,{class:a([K,`text-right`])},`No human edit`,2),l(`th`,{class:a([K,`text-right`])},`Agent run min`,2)])]),l(`tbody`,null,[(c(!0),n(f,null,r(Y.value.weeks,e=>(c(),n(`tr`,{key:e.week,class:a(Q(e.week)?`text-dimmed`:``)},[l(`td`,{class:a(q),title:`${e.week} → ${e.until}`},[d(i(u(v)(e.week))+` – `+i(u(v)(e.until))+` `,1),Q(e.week)?(c(),n(`span`,z,`(incomplete)`)):o(``,!0)],8,R),l(`td`,{class:a([q,`text-right font-medium`])},i(e.prsMerged),3),l(`td`,{class:a([q,`text-right`])},i(e.agentAuthoredPrs),3),l(`td`,{class:a([q,`text-right`])},i(u(g)(e.leadTimeHours.median)),3),l(`td`,{class:a([q,`text-right`])},i(u(x)(e)),3),l(`td`,{class:a([q,`text-right`])},i(u(ne)(e.reviewRounds.perPr)),3),l(`td`,{class:a([q,`text-right`])},i(u(y)(e)),3),l(`td`,{class:a([q,`text-right`])},i(u(b)(e.findings.noHumanEditShare)),3),l(`td`,{class:a([q,`text-right`])},i(e.agentRuns.minutes.toFixed(0)),3)],2))),128))])])]),$.value&&Y.value.completeFrom?(c(),n(`p`,B,` Incomplete weeks hold the newest pull requests the read reached — it is complete from `+i(u(_)(Y.value.completeFrom))+` — so their numbers are a floor on the merges, not the week's. `,1)):o(``,!0)]),l(`section`,V,[p[3]||=l(`div`,null,[l(`h2`,{class:`text-[0.9375rem] font-medium`},`By unit`),l(`p`,{class:`text-sm text-muted`},` One row per board issue the pull requests link · the issue's opening starts the clock `)],-1),Y.value.units.length===0?(c(),n(`p`,ce,`Nothing merged in range.`)):(c(),n(`div`,H,[l(`table`,U,[l(`thead`,null,[l(`tr`,null,[l(`th`,{class:a([K,`text-left`])},`Issue`,2),l(`th`,{class:a([K,`text-left`])},`Unit`,2),l(`th`,{class:a([K,`text-left`])},`PRs`,2),l(`th`,{class:a([K,`text-right`])},`Issue → merge`,2),l(`th`,{class:a([K,`text-right`])},`First-pass CI`,2),l(`th`,{class:a([K,`text-right`])},`Rounds`,2),l(`th`,{class:a([K,`text-right`])},`Findings`,2),l(`th`,{class:a([K,`text-right`])},`No human edit`,2)])]),l(`tbody`,null,[(c(!0),n(f,null,r(Y.value.units,e=>(c(),n(`tr`,{key:e.issue??`none`},[l(`td`,{class:a([q,`whitespace-nowrap`])},[e.issue===null?(c(),n(`span`,G,`—`)):(c(),n(`a`,{key:0,class:`text-primary hover:underline`,href:`https://github.com/${Y.value.repo}/issues/${e.issue}`},`#`+i(e.issue),9,W))],2),l(`td`,{class:a([q,`max-w-[28rem] truncate font-sans`]),title:e.title},i(e.title),11,le),l(`td`,{class:a([q,`whitespace-nowrap`])},[(c(!0),n(f,null,r(e.prs,(e,t)=>(c(),n(f,{key:e},[t>0?(c(),n(f,{key:0},[d(`, `)],64)):o(``,!0),l(`a`,{class:`text-primary hover:underline`,href:`https://github.com/${Y.value.repo}/pull/${e}`},i(e),9,ue)],64))),128))],2),l(`td`,{class:a([q,`text-right`])},i(u(g)(e.leadTimeHours.median)),3),l(`td`,{class:a([q,`text-right`])},i(u(x)(e)),3),l(`td`,{class:a([q,`text-right`])},i(e.reviewRounds.verdicts),3),l(`td`,{class:a([q,`text-right`])},i(u(y)(e)),3),l(`td`,{class:a([q,`text-right`])},i(u(b)(e.findings.noHumanEditShare)),3)]))),128))])])])),l(`p`,de,[p[1]||=d(` Machine-readable twin: `,-1),l(`code`,fe,`GET /delivery/`+i(Y.value.repo)+`.json`,1),p[2]||=d(` (same gate). `,-1)])]),l(`footer`,pe,[Y.value.snapshotAt?(c(),n(`p`,me,[d(` As of `+i(u(_)(Y.value.snapshotAt))+`, `+i(u(re)(Y.value.snapshotAt,u(ve)))+` · `,1),t(h,{class:`text-primary hover:underline`,to:`/delivery/${Y.value.repo}${u(ie)(u(ye))}`},{default:s(()=>[...p[4]||=[d(`read GitHub now`,-1)]]),_:1},8,[`to`])])):o(``,!0),l(`details`,null,[p[14]||=l(`summary`,{class:`cursor-pointer text-muted`},`How these numbers are computed`,-1),l(`div`,he,[p[12]||=l(`div`,null,[l(`b`,null,`Snapshot.`),d(` GitHub's record of the merged pull requests (each one's timeline and its branch's workflow runs, the board issue its body links) is read on an interval and kept as a snapshot the page, its JSON twin and `),l(`code`,null,`delivery report`),d(` serve; `),l(`code`,null,`?fresh=1`),d(` reads GitHub now. The run history you may see joins on every load. `)],-1),p[13]||=l(`div`,null,[l(`b`,null,`Issue → merge`),d(` runs from the linked board issue's opening (a closing keyword or a `),l(`code`,null,`board item`),d(` reference in the body) to the merge; a pull request that links no issue counts from its own opening. `),l(`b`,null,`First-pass CI`),d(` is green when every pull-request-triggered workflow run (`),l(`code`,null,`pull_request`),d(`, `),l(`code`,null,`pull_request_target`),d(`) on the first head succeeded at its first attempt — a rerun or a red run fails it; a head with no such run is not counted. `),l(`b`,null,`Review rounds`),d(` are the review agent's verdicts; a `),l(`i`,null,`fix round`),d(` is a verdict that followed a push. `),l(`b`,null,`No human edit`),d(` is the share of the agent's findings on pull requests where every push after the first verdict was an agent's: a bot login, or a commit co-authored by an agent. `),l(`b`,null,`Agent run minutes`),d(` are the finished runs of this repository that named a pull request. `)],-1),l(`div`,null,[p[6]||=l(`b`,null,`Identities.`,-1),p[7]||=d(` Verdicts by `,-1),l(`code`,null,i(Y.value.identities.reviewers.join(`, `)||`(none configured)`),1),p[8]||=d(`; agent logins end in `,-1),p[9]||=l(`code`,null,`[bot]`,-1),Y.value.identities.agentLogins.length?(c(),n(f,{key:0},[p[5]||=d(`, plus `,-1),l(`code`,null,i(Y.value.identities.agentLogins.join(`, `)),1)],64)):o(``,!0),p[10]||=d(`; agent co-authors named `,-1),l(`code`,null,i(Y.value.identities.agentCoauthors.join(`, `)||`(none)`),1),p[11]||=d(`. `,-1)])])])])]),_:1},8,[`title`])):o(``,!0)}}});export{J as default};
@@ -1,3 +1,3 @@
1
- import{i as e,r as t,t as n}from"./AppShell-Bmz8nzz3.js";import{An as r,Cn as i,Cr as a,Ft as o,Gr as s,Ii as c,Li as l,Mn as u,Pi as d,Pt as f,Qr as p,Sn as m,Tr as h,Xr as g,_r as _,bn as v,c as y,dr as ee,en as b,hr as x,ir as S,ji as C,kn as w,l as te,ln as ne,o as T,rn as E,sr as D,t as O,wr as k,xi as A,xn as j,y as M,yi as N,yn as P,yr as F}from"./browser-B6T5hjfR.js";import{t as I}from"./Tooltip-CN5cZdl3.js";import{i as L,n as re,r as ie,t as R}from"./PendingTurnRow-C-pUgyyX.js";import{b as ae,x as oe}from"./main-Cv0q9y56.js";import{t as se}from"./eventSource-Bj_dZf6M.js";import{t as z}from"./wallClock-DmaC1sKA.js";import{n as B,r as ce,t as V}from"./indexFormat-B-pd4r7Y.js";import{B as le,U as ue,a as de,i as fe,t as pe,w as me}from"./indexRow-BxKswdlK.js";import{i as H}from"./format-BldUwl_R.js";import{i as he,n as U,t as W}from"./durationTone-U_rOqo6r.js";import{T as ge,a as _e,c as G,d as ve,i as ye,n as be,o as xe,s as Se,t as K,u as q,v as Ce}from"./sseReplay-BYo2EZKy.js";var J=`To run this:`;function we(e,t){return e?t.trim()===``?`stop`:`steer`:`send`}var Te=`↪ Folded into`;function Ee(e){let t=e.trim();if(t.startsWith(`To run this:`)){let e=t.slice(J.length).trim(),n=e.indexOf(`
2
- `);if(n===-1)return{kind:`handBack`,command:e};let r=e.slice(n+1).trim();return r===``?{kind:`handBack`,command:e.slice(0,n).trim()}:{kind:`handBack`,command:e.slice(0,n).trim(),note:r}}return t.startsWith(Te)?{kind:`steerAck`,text:t}:{kind:`inline`,text:t}}function De(e){let t=/^\/runs\/([^/?#]+)(\?t=([^&#]+))?$/.exec(e);if(!t)return null;let n=decodeURIComponent(t[1]),r=t[3]?`?t=${t[3]}`:``;return{id:n,eventsUrl:`/runs/${t[1]}/events${r}`,stopUrl:`/runs/${t[1]}/stop${r}`}}function Y(e,t=60){let n=e.split(/\r?\n/).find(e=>e.trim()!==``)?.trim()??``;return n.length<=t?n||`New conversation`:`${n.slice(0,t-1).trimEnd()}…`}function Oe(e,t){let n=t-e;if(!(n>45e3))return`now`;let r=Math.floor(n/6e4);if(r<60)return`${Math.max(1,r)}m`;let i=Math.floor(r/60);if(i<24)return`${i}h`;let a=Math.floor(i/24);return a<7?`${a}d`:B(e,t)}function ke(e,t){let n=e.surface??`web`,r=fe[n]??n,i=e.channelName?`${r} #${e.channelName}`:r;return{title:e.excerpt||e.title,when:V(e.lastAt,t),source:n===`web`?r:`${i} · read-only here`,runs:`${e.runs} run${e.runs===1?``:`s`}`,live:e.live}}var X={min:224,default:288,max:448,step:16};function Ae(e){let t=typeof e==`string`?Number(e):e;return typeof t!=`number`||!Number.isFinite(t)?X.default:Math.min(X.max,Math.max(X.min,Math.round(t)))}var Z={width:`sb.rail.width`,collapsed:`sb.rail.collapsed`};function je(e){return{width:Ae(e.width??void 0),collapsed:e.collapsed===`1`}}function Me(e,t){let n=e<5?`Still up`:e<12?`Good morning`:e<18?`Good afternoon`:`Good evening`;return t?`${n}, ${t}.`:`${n}.`}function Ne(e,t){let n=t.trim();for(let t=e.length-1;t>=0;t--){let r=e[t];if(!r.folded&&r.text.trim()===n)return r}return null}function Pe(e,t=60){return e<=t}function Fe(e){return e.key===`Enter`&&!e.shiftKey&&!e.isComposing}function Ie(e,t){let n=e.trim().toLowerCase();if(n===``)return 0;let r=t.toLowerCase(),i=0,a=-1,o=-1;for(let e of n){if(e===` `)continue;let t=r.indexOf(e,i);if(t===-1)return null;a===-1&&(a=t),o=t,i=t+1}return a===-1?0:o-a}function Le(e,t){return t.trim()===``?[...e]:e.map((e,n)=>({row:e,i:n,score:Ie(t,e.title)})).filter(e=>e.score!==null).sort((e,t)=>e.score-t.score||e.i-t.i).map(e=>e.row)}function Re(e){if(!(e.metaKey||e.ctrlKey))return null;let t=e.key.toLowerCase();return t===`o`&&e.shiftKey?`newThread`:t===`k`&&!e.shiftKey?`search`:null}function ze(e,t){return t?``:e===`steer`?`Say what to add — it folds into the run at its next step`:e===`stop`?`A run is working — type to steer it, or stop it`:`Review a pull request, ship a fix, investigate a run… or type / for a command`}function Q(e){let t=new Map;for(let n of e){let[e,r]=n.chat.split(` `,2);if(!e)continue;let i=t.get(e)??{name:e,verbs:[]};r===void 0?i.bare=n:i.verbs.push({verb:r,command:n}),t.set(e,i)}return[...t.values()]}function Be(e,t,n){if(t===``)return[...e];let r=t.toLowerCase(),i=e.filter(e=>n(e)[0].toLowerCase().startsWith(r));return i.length>0?i:e.map((e,r)=>{let i=n(e).map(e=>Ie(t,e)).filter(e=>e!==null);return i.length===0?null:{item:e,i:r,score:Math.min(...i)}}).filter(e=>e!==null).sort((e,t)=>e.score-t.score||e.i-t.i).map(e=>e.item)}function Ve(e,t=0,n=new Set){let r=(e.args??[]).slice(t),i=(e.options??[]).filter(e=>!n.has(He(e.form))).map(e=>`[${e.form}]`);return[...r,...i].join(` `)}var He=e=>e.split(` `,1)[0];function Ue(e,t){let n=new Set,r=0;for(let i=0;i<t.length;i++){let a=t[i];if(a.startsWith(`-`)){n.add(a);let t=(e.options??[]).find(e=>He(e.form)===a);t&&t.form.includes(` `)&&i++}else r++}return{positionals:r,flags:n}}function We(e,t){let n=/^\/([^\n]*)$/.exec(e);if(!n||t.length===0)return null;let r=n[1].split(` `),i=r[r.length-1],a=r.slice(0,-1).filter(e=>e!==``),o=e.slice(0,e.length-i.length),s=Q(t);if(a.length===0)return{level:`group`,head:o,partial:i,rows:Be(s,i,e=>[e.name,...e.bare?[e.bare.describe]:[],...e.verbs.map(e=>e.command.describe)]).map(e=>({insert:e.name,label:`/${e.name}`,describe:e.bare?e.verbs.length>0?`${e.bare.describe} · also ${e.verbs.map(e=>e.verb).join(`, `)}`:e.bare.describe:e.verbs.map(e=>e.verb).join(` · `),kind:e.bare&&e.verbs.length===0?`command`:`group`,acceptable:!0}))};let c=s.find(e=>e.name===a[0]);if(!c)return null;if(a.length===1){let e=Be(c.verbs,i,e=>[e.verb,e.command.describe]);if(e.length===0&&c.bare&&i!==``)return Ke(c.bare,o,i,[]);if(e.length===0&&!c.bare)return{level:`verb`,head:o,partial:i,rows:[]};let t=e.map(e=>({insert:e.verb,label:`/${e.command.chat}`,describe:e.command.describe,kind:`command`,acceptable:!0}));return c.bare&&i===``&&t.unshift(Ge(c.bare,0,new Set)),{level:`verb`,head:o,partial:i,rows:t}}let l=c.verbs.find(e=>e.verb===a[1]);return l?Ke(l.command,o,i,a.slice(2)):c.bare?Ke(c.bare,o,i,a.slice(1)):null}function Ge(e,t,n){let r=Ve(e,t,n);return{insert:``,label:`/${e.chat}`,describe:r?`${r} — ${e.describe}`:e.describe,kind:`usage`,acceptable:!1}}function Ke(e,t,n,r){let i=Ue(e,r);return n.startsWith(`-`)?{level:`tail`,head:t,partial:n,rows:Be((e.options??[]).filter(e=>!i.flags.has(He(e.form))),n,e=>[He(e.form),e.describe]).map(e=>({insert:He(e.form),label:e.form,describe:e.describe,kind:`option`,acceptable:!0})),command:e}:{level:`tail`,head:t,partial:n,rows:[Ge(e,i.positionals,i.flags)],command:e}}function qe(e,t){let n=e.rows[t];if(!n)return null;if(n.acceptable){if(!n.insert.toLowerCase().startsWith(e.partial.toLowerCase()))return null;let t=n.insert.slice(e.partial.length);return t===``?null:{text:t,acceptable:!0}}if(e.partial!==``||n.kind!==`usage`)return null;let[r,...i]=n.describe.split(` — `);return i.length===0?null:{text:r,acceptable:!1}}function $(e,t){return`${e.head}${t.insert} `}function Je(e,t){if(!e.startsWith(`/`))return e;let n=e.slice(1),[r,i]=n.split(/\s+/,2);return t.some(e=>e.chat===r||i!==void 0&&e.chat===`${r} ${i}`)?n:e}var Ye={class:`composer-wrap relative`},Xe={key:0,class:`palette absolute bottom-full left-0 right-0 z-20 mb-2 max-h-72 overflow-y-auto rounded-xl border border-default bg-(--ui-bg-elevated) p-1 shadow-sm`,role:`listbox`,"aria-label":`Commands`,"data-testid":`palette`},Ze={key:0,class:`px-3 py-2 font-mono text-xs text-dimmed`},Qe=[`aria-selected`,`data-insert`,`data-kind`,`data-label`,`onClick`,`onMouseenter`],$e={class:`chat shrink-0 font-mono text-[0.8rem] font-medium text-highlighted`},et={class:`describe min-w-0 flex-1 truncate text-[0.8rem] text-muted`},tt={key:0,class:`shrink-0 rounded border border-default px-1 font-mono text-[0.62rem] text-dimmed`,"aria-hidden":`true`},nt=[`data-mode`],rt={class:`relative min-w-0 flex-1`},it=[`data-acceptable`],at={class:`invisible`},ot={class:`text-dimmed`},st=[`rows`,`value`,`placeholder`,`autofocus`,`aria-expanded`],ct=[`aria-hidden`,`data-hint`,`data-shown`],lt=u({__name:`ChatComposer`,props:{modelValue:{},mode:{},hint:{},autofocus:{type:Boolean},sweepOnMount:{type:Boolean},commands:{}},emits:[`update:modelValue`,`submit`,`stop`],setup(e,{expose:t,emit:n}){let o=e,c=n,u=A(null),p=A(!1),h=A(!1),y=P(()=>Math.min(8,Math.max(1,o.modelValue.split(`
3
- `).length))),b={send:{icon:`i-lucide-arrow-up`,label:`Send`},steer:{icon:`i-lucide-corner-down-right`,label:`Steer the run`},stop:{icon:`i-lucide-square`,label:`Stop the run`}},x=P(()=>b[o.mode]),C=P(()=>ze(o.mode,o.hint)),w=P(()=>o.hint?o.hint:o.mode===`steer`?`Enter folds this into the run in flight`:o.mode===`stop`?`A run is in flight · type to steer it, or stop it`:`Enter to send · Shift+Enter for a new line · / for a command`),T=P(()=>p.value||o.hint!==void 0||o.mode!==`send`),D=P(()=>We(o.modelValue,o.commands??[])),O=P(()=>D.value?.rows??[]),k=A(!1),N=A(0),F=P(()=>D.value!==null&&!k.value),I=P(()=>F.value&&D.value?qe(D.value,N.value):null);s(()=>`${D.value?.level??``}|${D.value?.head??``}`,()=>{k.value=!1,N.value=0}),s(O,e=>{N.value>=e.length&&(N.value=Math.max(0,e.length-1))});function L(e){D.value&&e.acceptable&&(c(`update:modelValue`,$(D.value,e)),z())}function re(){let e=u.value;return!e||e.selectionStart===e.value.length&&e.selectionEnd===e.value.length}function ie(e){c(`update:modelValue`,e.target.value)}function R(e){if(F.value){if(e.key===`ArrowDown`){e.preventDefault(),O.value.length>0&&(N.value=(N.value+1)%O.value.length);return}if(e.key===`ArrowUp`){e.preventDefault(),O.value.length>0&&(N.value=(N.value-1+O.value.length)%O.value.length);return}if(e.key===`Escape`){e.preventDefault(),k.value=!0;return}let t=O.value[N.value];if(e.key===`Tab`&&t?.acceptable){e.preventDefault(),L(t);return}if(e.key===`ArrowRight`&&I.value?.acceptable&&t&&re()){e.preventDefault(),L(t);return}if(e.key===`Enter`&&!e.shiftKey&&t?.acceptable){e.preventDefault(),L(t);return}}Fe(e)&&(e.preventDefault(),ae())}function ae(){o.mode===`stop`?c(`stop`):o.modelValue.trim()!==``&&c(`submit`)}function oe(){h.value=!1,S().then(()=>{h.value=!0})}function se(){p.value=!0,oe()}function z(){S().then(()=>{let e=u.value;e&&(e.focus(),e.setSelectionRange(e.value.length,e.value.length),document.activeElement===e&&!p.value&&se())})}return s(()=>o.hint,e=>{e&&z()}),ee(()=>{o.autofocus&&z(),o.sweepOnMount&&oe()}),t({focus:z}),(t,n)=>{let o=M,s=te;return _(),i(`div`,Ye,[r(f,{name:`sb-rise`},{default:g(()=>[F.value?(_(),i(`div`,Xe,[O.value.length===0?(_(),i(`p`,Ze,` No command matches "`+l(e.modelValue)+`". `,1)):m(``,!0),(_(!0),i(ne,null,a(O.value,(e,t)=>(_(),i(`button`,{key:e.label,type:`button`,role:`option`,class:d([`item flex w-full items-baseline gap-3 rounded-lg px-3 py-1.5 text-left transition-colors duration-150 ease-out`,t===N.value?`bg-(--ui-bg-accented)`:`hover:bg-(--ui-bg-muted)`]),"aria-selected":t===N.value?`true`:`false`,"data-insert":e.insert,"data-kind":e.kind,"data-label":e.label,onMousedown:n[0]||=E(()=>{},[`prevent`]),onClick:t=>L(e),onMouseenter:e=>N.value=t},[v(`span`,$e,l(e.label),1),v(`span`,et,l(e.describe),1),t===N.value&&e.acceptable?(_(),i(`kbd`,tt,`Tab`)):m(``,!0)],42,Qe))),128))])):m(``,!0)]),_:1}),v(`div`,{class:d([`ring relative rounded-2xl`,h.value?`ring-sweep`:``]),onAnimationend:n[2]||=e=>h.value=!1},[v(`form`,{class:d([`composer relative flex items-end gap-2 rounded-2xl border bg-default px-3 py-2 transition-colors duration-150 ease-out`,p.value?`border-primary`:`border-default hover:border-accented`]),"data-mode":e.mode,onSubmit:E(ae,[`prevent`])},[v(`div`,rt,[I.value?(_(),i(`div`,{key:0,class:`ghost composer-text pointer-events-none absolute inset-0 overflow-hidden whitespace-pre-wrap break-words`,"aria-hidden":`true`,"data-testid":`ghost`,"data-acceptable":I.value.acceptable?`1`:`0`},[v(`span`,at,l(e.modelValue),1),v(`span`,ot,l(I.value.text),1)],8,it)):m(``,!0),v(`textarea`,{ref_key:`box`,ref:u,class:`box composer-text relative block min-h-6 w-full resize-none bg-transparent text-highlighted outline-none placeholder:text-dimmed`,rows:y.value,value:e.modelValue,placeholder:C.value,autofocus:e.autofocus,"aria-label":`Message`,"aria-expanded":F.value?`true`:void 0,autocomplete:`off`,spellcheck:`true`,onInput:ie,onKeydown:R,onFocus:se,onBlur:n[1]||=e=>p.value=!1},null,40,st)]),r(s,{type:`submit`,class:`control shrink-0 rounded-full transition-transform duration-150 ease-out active:scale-95`,color:e.mode===`stop`?`neutral`:`primary`,variant:e.mode===`stop`?`outline`:`solid`,size:`sm`,"aria-label":x.value.label,title:x.value.label,disabled:e.mode===`send`&&e.modelValue.trim()===``,"data-mode":e.mode},{default:g(()=>[r(f,{name:`sb-fade`,mode:`out-in`},{default:g(()=>[(_(),j(o,{key:x.value.icon,name:x.value.icon,class:`size-4`,"aria-hidden":`true`},null,8,[`name`]))]),_:1})]),_:1},8,[`color`,`variant`,`aria-label`,`title`,`disabled`,`data-mode`])],42,nt)],34),v(`p`,{class:d([`hint mt-1.5 min-h-[1.1rem] select-none px-3 font-mono text-[0.7rem] text-dimmed transition-opacity duration-150 ease-out`,T.value?`opacity-100`:`opacity-0`]),"aria-hidden":T.value?void 0:`true`,"data-hint":e.hint?`handback`:e.mode,"data-shown":T.value?`1`:`0`},l(w.value),11,ct)])}}}),ut={class:`thread-tip flex max-w-xs flex-col gap-1 text-xs`},dt={class:`tip-title leading-snug text-highlighted`},ft={class:`flex flex-wrap items-center gap-x-1.5 gap-y-0.5 font-mono text-[0.68rem] text-muted`},pt={class:`tip-when tabular-nums`},mt={class:`tip-source inline-flex items-center gap-1`},ht={class:`tip-runs`},gt={key:0,class:`tip-live inline-flex items-center gap-1 text-toned`},_t=u({__name:`ThreadTip`,props:{row:{},now:{}},setup(e){let t=e,n=P(()=>ke(t.row,t.now));return(t,r)=>(_(),i(`div`,ut,[v(`p`,dt,l(n.value.title),1),v(`p`,ft,[v(`span`,pt,l(n.value.when),1),r[1]||=v(`span`,{"aria-hidden":`true`},`·`,-1),v(`span`,mt,[e.row.surface===`slack`?(_(),j(he,{key:0})):m(``,!0),w(l(n.value.source),1)]),r[2]||=v(`span`,{"aria-hidden":`true`},`·`,-1),v(`span`,ht,l(n.value.runs),1),n.value.live?(_(),i(`span`,gt,[...r[0]||=[v(`span`,{class:`size-1.5 rounded-full bg-ok`,"aria-hidden":`true`},null,-1),w(`live`,-1)]])):m(``,!0)])]))}}),vt={class:`rail flex flex-col gap-1 text-[0.8rem]`,"aria-label":`Recent threads`},yt={class:`filter mb-2 flex items-center gap-2 rounded-lg border border-default px-2.5 py-1.5 transition-colors duration-150 ease-out focus-within:border-primary hover:border-accented`},bt={key:0,class:`rounded border border-default px-1 font-mono text-[0.65rem] text-dimmed`},xt={key:0,class:`empty px-3 py-1 text-xs text-dimmed`},St={key:1,class:`nomatch px-3 py-1 text-xs text-dimmed`},Ct={key:0,class:`dot mt-px size-1.5 shrink-0 self-center rounded-full bg-ok motion-safe:animate-pulse`,"aria-label":`a run is in flight`},wt={class:`title min-w-0 flex-1 truncate text-toned group-hover:text-highlighted group-aria-[current=page]:text-highlighted`},Tt={class:`when shrink-0 font-mono text-[0.7rem] tabular-nums text-dimmed`},Et={class:`retention px-3 pt-1 text-[0.7rem] leading-relaxed text-dimmed`},Dt={class:`model px-3 pt-2 text-[0.7rem] leading-relaxed text-dimmed`,"data-testid":`what-is-a-thread`},Ot=500,kt=u({__name:`ConversationRail`,props:{rows:{},current:{},now:{},retention:{}},setup(e,{expose:t}){let n=e,s=A(``),c=A(null),u=P(()=>Le(n.rows,s.value));function d(){c.value?.focus(),c.value?.select()}function f(e){e.key===`Escape`&&(s.value=``,c.value?.blur())}return t({focusFilter:d}),(t,n)=>{let d=M,y=h(`RouterLink`),ee=I;return _(),i(`nav`,vt,[r(y,{class:`new group mb-3 flex items-center gap-2 rounded-xl bg-inverted px-3 py-2 font-medium text-inverted no-underline transition-[transform,opacity] duration-150 ease-out hover:-translate-y-px hover:opacity-90 active:translate-y-0 active:opacity-100`,to:`/threads`,"aria-current":e.current===``?`page`:void 0,"data-testid":`new-thread`},{default:g(()=>[r(d,{name:`i-lucide-plus`,class:`size-4 shrink-0 transition-transform duration-150 ease-out group-hover:rotate-90`,"aria-hidden":`true`}),n[1]||=v(`span`,null,`New thread`,-1),n[2]||=v(`span`,{class:`kbd ml-auto flex gap-0.5 font-mono text-[0.65rem] opacity-70`,"aria-label":`shortcut shift command O`},[v(`kbd`,{class:`rounded border border-current/30 px-1`},`⇧`),v(`kbd`,{class:`rounded border border-current/30 px-1`},`⌘`),v(`kbd`,{class:`rounded border border-current/30 px-1`},`O`)],-1)]),_:1},8,[`aria-current`]),v(`label`,yt,[r(d,{name:`i-lucide-search`,class:`size-3.5 shrink-0 text-dimmed`,"aria-hidden":`true`}),p(v(`input`,{ref_key:`filter`,ref:c,"onUpdate:modelValue":n[0]||=e=>s.value=e,class:`min-w-0 flex-1 bg-transparent text-[0.8rem] text-highlighted outline-none placeholder:text-dimmed`,type:`text`,placeholder:`Filter recent`,"aria-label":`Filter recent threads`,autocomplete:`off`,onKeydown:f},null,544),[[b,s.value]]),s.value?m(``,!0):(_(),i(`kbd`,bt,`⌘K`))]),n[8]||=v(`p`,{class:`label px-3 pb-1 font-mono text-[0.65rem] font-medium uppercase tracking-wider text-dimmed`},`Recent`,-1),e.rows.length===0?(_(),i(`p`,xt,`Nothing yet. Ask something.`)):u.value.length===0?(_(),i(`p`,St,`Nothing matches "`+l(s.value)+`".`,1)):m(``,!0),r(o,{name:`sb-rise`,tag:`div`,class:`rows flex flex-col gap-0.5`},{default:g(()=>[(_(!0),i(ne,null,a(u.value,t=>(_(),i(`div`,{key:t.id},[r(ee,{"delay-duration":Ot,content:{side:`right`,sideOffset:12,align:`start`},ui:{content:`h-auto max-w-xs px-2.5 py-2`}},{content:g(()=>[r(_t,{row:t,now:e.now},null,8,[`row`,`now`])]),default:g(()=>[r(y,{class:`row group relative flex items-baseline gap-2 rounded-lg px-3 py-1.5 no-underline transition-colors duration-150 ease-out hover:bg-(--ui-bg-muted) aria-[current=page]:bg-(--ui-bg-accented)`,to:`/threads/${encodeURIComponent(t.id)}`,"aria-current":t.id===e.current?`page`:void 0,"data-surface":t.surface},{default:g(()=>[n[3]||=v(`span`,{class:`bar absolute left-0 top-1/2 h-4 w-0.5 -translate-y-1/2 rounded-full bg-primary opacity-0 transition-opacity duration-150 ease-out group-aria-[current=page]:opacity-100`,"aria-hidden":`true`},null,-1),t.live?(_(),i(`span`,Ct)):m(``,!0),v(`span`,wt,l(t.title),1),v(`span`,Tt,l(C(Oe)(t.lastAt,e.now)),1)]),_:2},1032,[`to`,`aria-current`,`data-surface`])]),_:2},1024)]))),128))]),_:1}),r(y,{class:`all mt-3 flex items-center gap-1.5 px-3 py-1 text-xs font-medium text-muted no-underline transition-colors duration-150 ease-out hover:text-highlighted`,to:`/runs`,"data-testid":`all-runs`},{default:g(()=>[n[4]||=w(` All runs `,-1),r(d,{name:`i-lucide-arrow-right`,class:`size-3 transition-transform duration-150 ease-out group-hover:translate-x-0.5`,"aria-hidden":`true`})]),_:1}),v(`p`,Et,l(e.retention),1),v(`p`,Dt,[n[6]||=w(` A thread is a conversation; each message you send is a run. `,-1),r(y,{class:`text-muted hover:text-highlighted`,to:`/runs`},{default:g(()=>[...n[5]||=[w(`Runs`,-1)]]),_:1}),n[7]||=w(` lists every run across everyone's threads. `,-1)])])}}}),At={class:`empty mx-auto flex w-full max-w-2xl flex-col items-center gap-5 px-3 py-6 text-center`},jt={class:`flex flex-col gap-1.5`},Mt={class:`greeting sb-stagger text-xl font-medium tracking-tight text-highlighted`,style:{"--sb-i":`1`}},Nt={class:`sb-stagger w-full text-left`,style:{"--sb-i":`3`}},Pt={key:0,class:`chips flex flex-wrap justify-center gap-2`,"aria-label":`Suggestions`},Ft=[`onClick`],It=u({__name:`EmptyState`,props:{name:{},hour:{},suggestions:{}},emits:[`pick`],setup(e,{emit:n}){let o=n;return(n,s)=>(_(),i(`section`,At,[r(t,{draw:``,idle:``,class:`mark-lg sb-stagger text-highlighted`,style:{"font-size":`3.25rem`,"--sb-i":`0`}}),v(`div`,jt,[v(`h2`,Mt,l(C(Me)(e.hour,e.name)),1),s[0]||=v(`p`,{class:`sub sb-stagger text-[0.875rem] text-muted`,style:{"--sb-i":`2`}},` Ask in plain words. The right agent picks it up, and you watch it work here. `,-1)]),v(`div`,Nt,[k(n.$slots,`default`)]),e.suggestions.length>0?(_(),i(`ul`,Pt,[(_(!0),i(ne,null,a(e.suggestions,(e,t)=>(_(),i(`li`,{key:e,class:`sb-stagger`,style:c({"--sb-i":t+4})},[v(`button`,{type:`button`,class:`chip rounded-full border border-default px-3 py-1 text-[0.8rem] text-toned transition-[color,border-color,background-color,transform] duration-150 ease-out hover:-translate-y-px hover:border-accented hover:bg-(--ui-bg-muted) hover:text-highlighted focus-visible:outline-2 focus-visible:outline-primary active:translate-y-0`,onClick:t=>o(`pick`,e)},l(e),9,Ft)],4))),128))])):m(``,!0)]))}}),Lt=[`data-pending`],Rt={class:`meta flex items-baseline gap-2 pr-1 font-mono text-[0.7rem] text-dimmed`},zt={key:0,class:`failed text-bad`},Bt={key:0,class:`folded text-muted`},Vt=[`title`],Ht=u({__name:`PersonTurn`,props:{text:{},at:{},now:{},pending:{type:Boolean},folded:{},failed:{}},setup(e){let t=e,n=P(()=>V(t.at,t.now));return(t,a)=>(_(),i(`div`,{class:`turn person flex flex-col items-end gap-1`,"data-pending":e.pending?`1`:void 0},[v(`div`,{class:d([`bubble max-w-[min(42rem,88%)] whitespace-pre-wrap break-words rounded-2xl rounded-br-md bg-(--ui-bg-accented) px-4 py-2.5 text-[0.875rem] leading-normal text-highlighted transition-opacity duration-150 ease-out`,e.pending?`opacity-70`:``])},l(e.text),3),v(`div`,Rt,[e.failed?(_(),i(`span`,zt,l(e.failed),1)):m(``,!0),r(f,{name:`sb-fade`},{default:g(()=>[e.folded?(_(),i(`span`,Bt,`↪ folded in `+l(e.folded),1)):m(``,!0)]),_:1}),v(`span`,{class:`ts select-none`,title:C(H)(e.at)},l(n.value),9,Vt)])],8,Lt))}}),Ut=[`title`],Wt={class:`preset font-medium`},Gt={class:`reason truncate font-normal opacity-80`},Kt=u({__name:`ReceiptChip`,props:{route:{}},setup(e){let t=e,n=P(()=>pe[de(t.route.preset)]);return(t,r)=>(_(),i(`span`,{class:d([`receipt inline-flex max-w-full items-baseline gap-1.5 rounded border px-1.5 py-px font-mono text-[0.7rem] leading-relaxed`,n.value]),title:`routed: ${e.route.reason}`,"data-testid":`receipt`},[v(`span`,Wt,l(e.route.preset),1),v(`span`,Gt,`· `+l(e.route.reason),1)],10,Ut))}}),qt=[`data-phase`,`data-run-id`,`data-live`],Jt={class:`head flex flex-wrap items-baseline gap-2 font-mono text-[0.7rem] text-dimmed`},Yt={key:0,class:`model`},Xt={key:1,class:`elapsed ml-auto tabular-nums`,"data-testid":`elapsed`},Zt={key:0,class:`disconnected flex items-baseline gap-2 rounded-lg border border-dashed border-bad/40 px-3 py-2 font-mono text-xs text-bad`,"data-testid":`disconnected`},Qt=[`open`],$t={class:`flex min-h-6 cursor-pointer list-none items-baseline gap-2 font-mono text-[0.7rem] text-dimmed hover:text-toned [&::-webkit-details-marker]:hidden`},en={class:`summary`},tn={class:`pl-1 pt-1`},nn={key:0,class:`py-2 font-mono text-xs text-dimmed`},rn={key:1,class:`py-2 font-mono text-xs text-warn`},an={key:2,class:`m-0 list-none p-0`},on={key:0,class:`reply`,"data-testid":`reply`},sn={key:1,class:`outcome font-mono text-xs text-warn`,"data-testid":`outcome`},cn={key:2,class:`facts flex flex-wrap items-baseline gap-x-3 font-mono text-[0.7rem] text-dimmed`},ln=u({__name:`AssistantTurn`,props:{turn:{},now:{},live:{},fetch:{}},emits:[`ended`,`input`,`stop`],setup(e,{emit:t}){let n=e,u=t,p=G();n.live?.serverNow&&p.seedClock(n.live.serverNow);let y=p.state,b=A(n.live?`connecting`:`ended`),S=A(n.turn.route??null),te=A(!0),T=P(()=>y.reply?.text??n.turn.answer??``),E=P(()=>y.meta?.agent??n.turn.agent??``),D=P(()=>{let e=y.meta?.model??n.turn.model;return e?ve(e):``}),O=P(()=>n.live!==null&&n.live!==void 0&&b.value!==`ended`),k=P(()=>b.value===`disconnected`),M=n.live?.serverNow?Se({startedAt:n.turn.startedAt,receivedAt:n.turn.receivedAt,serverNow:n.live.serverNow},n.now):null,N=n.now,I=A(void 0),L=P(()=>n.turn.finished&&n.turn.finishedAt!==void 0?Math.max(0,n.turn.finishedAt-(n.turn.receivedAt??n.turn.startedAt)):I.value===void 0?M?M.elapsedMs(n.now):Math.max(0,n.now-N):I.value),ae=P(()=>ue(L.value,`clock`)),oe=P(()=>W(O.value?void 0:L.value,`run`)),z=P(()=>U(oe.value)),B=P(()=>O.value?Ce(y,n.now):null);F(xe,B),F(ye,null),F(_e,P(()=>y.reply!==null));let ce=P(()=>O.value?q(y,p.pendingCall(),n.now):null),V=P(()=>{let e=ce.value;return k.value||!e||e.kind===`call`?null:e.kind===`starting`?{verb:`Starting`,elapsedMs:L.value,slow:!1}:{verb:re(e.elapsedMs),elapsedMs:e.elapsedMs,slow:e.slow}}),fe=P(()=>y.log.filter(e=>e.kind===`step`)),H=P(()=>fe.value.length>0?fe.value.length:n.turn.stepCount??0),he=P(()=>n.turn.finished&&n.turn.status&&n.turn.status!==`completed`?me(n.turn.status):``),J=P(()=>`/runs/${encodeURIComponent(n.turn.id)}`),we=se(),Te=null;function Ee(e){let t=e;t.type===`route`&&typeof t.preset==`string`&&(S.value={preset:t.preset,reason:typeof t.reason==`string`?t.reason:``}),t.type===`input`&&typeof t.text==`string`&&(te.value?te.value=!1:u(`input`,t.text,t.at)),p.handle(e)}ee(()=>{n.live&&(u(`stop`,n.live.stopUrl),Te=ie({url:n.live.eventsUrl,factory:we,model:p,handle:Ee,onFinished:e=>{I.value=M&&e?M.elapsedAt(e.finishedAt):L.value},onEnd:()=>{I.value??=L.value,u(`ended`)},onDisconnected:()=>{I.value??=L.value}}),s(Te.phase,e=>b.value=e,{immediate:!0}))}),x(()=>Te?.close());let De=A(n.live!==null&&n.live!==void 0),Y=A(n.live?`ready`:`none`);s(O,e=>{e||(De.value=!1)});async function Oe(e){if(De.value=e.target.open,!De.value||Y.value!==`none`)return;Y.value=`loading`;let t=n.fetch??((...e)=>globalThis.fetch(...e));try{let e=await t(`/runs/${encodeURIComponent(n.turn.id)}/events`,{credentials:`same-origin`});if(!e.ok)throw Error(`HTTP ${e.status}`);let r=K(await e.text()).filter(e=>e.type!==`replay_note`);for(let e of(n.turn.schema??0)>=2?le(r):r)p.handle(e);p.closePhases(),Y.value=`ready`}catch{Y.value=`failed`}}let ke=P(()=>{let e=H.value;return e>0?`${e} step${e===1?``:`s`}`:O.value?`starting`:`no steps recorded`});return(t,n)=>{let s=h(`RouterLink`);return _(),i(`div`,{class:`turn assistant flex flex-col gap-2`,"data-phase":b.value,"data-run-id":e.turn.id,"data-live":O.value?`1`:void 0},[v(`div`,Jt,[r(f,{name:`sb-rise`},{default:g(()=>[S.value?(_(),j(Kt,{key:`receipt`,route:S.value},null,8,[`route`])):E.value?(_(),i(`span`,{key:`agent`,class:d([`agent rounded border px-1.5 py-px font-medium`,C(pe)[C(de)(E.value)]])},l(E.value),3)):m(``,!0)]),_:1}),D.value?(_(),i(`span`,Yt,l(D.value),1)):m(``,!0),O.value?(_(),i(`span`,Xt,l(ae.value),1)):m(``,!0)]),r(f,{name:`sb-fade`},{default:g(()=>[O.value&&V.value?(_(),j(R,{key:0,tag:`div`,verb:V.value.verb,"elapsed-ms":V.value.elapsedMs,slow:V.value.slow,model:C(y).meta?.model??e.turn.model??null},null,8,[`verb`,`elapsed-ms`,`slow`,`model`])):m(``,!0)]),_:1}),k.value?(_(),i(`p`,Zt,[n[1]||=v(`span`,null,`stream disconnected · the run may still be working`,-1),r(s,{class:`ml-auto text-primary no-underline hover:underline`,to:J.value},{default:g(()=>[...n[0]||=[w(`open the run`,-1)]]),_:1},8,[`to`])])):m(``,!0),O.value||H.value>0||Y.value!==`none`?(_(),i(`details`,{key:1,class:`work group`,open:De.value,"data-testid":`work`,onToggle:Oe},[v(`summary`,$t,[n[2]||=v(`span`,{class:`chev select-none transition-transform duration-150 ease-out group-open:rotate-90 motion-reduce:transition-none`},`❯`,-1),v(`span`,en,l(ke.value),1)]),v(`div`,tn,[Y.value===`loading`?(_(),i(`p`,nn,`reading the run's record…`)):Y.value===`failed`?(_(),i(`p`,rn,[n[4]||=w(` the run's record could not be read — `,-1),r(s,{class:`text-primary no-underline hover:underline`,to:J.value},{default:g(()=>[...n[3]||=[w(`open the run`,-1)]]),_:1},8,[`to`])])):(_(),i(`ol`,an,[r(o,{name:`sb-rise`},{default:g(()=>[(_(!0),i(ne,null,a(fe.value,e=>(_(),j(be,{key:e.key,step:e,class:`mt-3 first:mt-0`,onToggleGroup:t=>C(p).toggleGroup(e)},null,8,[`step`,`onToggleGroup`]))),128))]),_:1})]))])],40,Qt)):m(``,!0),r(f,{name:`sb-rise`},{default:g(()=>[T.value?(_(),i(`div`,on,[r(ge,{text:T.value},null,8,[`text`])])):he.value?(_(),i(`p`,sn,l(he.value),1)):m(``,!0)]),_:1}),O.value?m(``,!0):(_(),i(`div`,cn,[v(`span`,{class:d([`dur tabular-nums`,z.value?`heat`:``]),style:c(z.value)},l(ae.value),7),r(s,{class:`open text-dimmed no-underline hover:text-primary hover:underline`,to:J.value},{default:g(()=>[...n[5]||=[w(`open run`,-1)]]),_:1},8,[`to`])]))],8,qt)}}}),un={class:`turn parent flex flex-wrap items-baseline gap-x-2 gap-y-0.5 px-1 font-mono text-[0.7rem] text-dimmed`,"data-testid":`parent-word`},dn=[`href`],fn={class:`line text-muted`},pn={key:0,class:`pr text-muted`},mn=[`title`],hn=u({__name:`ParentTurn`,props:{turn:{},now:{}},setup(e){let t=e,n=P(()=>V(t.turn.at,t.now)),r=P(()=>`/runs/${encodeURIComponent(t.turn.runId)}`+(t.turn.token===void 0?``:`?t=${encodeURIComponent(t.turn.token)}`)),a=P(()=>t.turn.report??t.turn.lead??`unit ${t.turn.unit} — ${t.turn.state}`);return(t,o)=>(_(),i(`div`,un,[o[0]||=v(`span`,{class:`glyph select-none`,"aria-hidden":`true`},`⇡`,-1),v(`a`,{href:r.value,class:`label text-toned underline decoration-dotted underline-offset-2`},`Pipeline`,8,dn),v(`span`,fn,`— `+l(a.value),1),e.turn.pr===void 0?m(``,!0):(_(),i(`span`,pn,`#`+l(e.turn.pr),1)),v(`span`,{class:`ts ml-auto select-none`,title:C(H)(e.turn.at)},l(n.value),9,mn)]))}}),gn={class:`turn silent flex flex-wrap items-baseline gap-x-2 gap-y-0.5 px-1 font-mono text-[0.7rem] text-dimmed`,"data-testid":`silent-receipt`},_n={class:`reason text-muted`},vn=[`title`],yn=u({__name:`SilentTurn`,props:{reason:{},decidedAt:{},now:{}},setup(e){let t=e,n=P(()=>V(t.decidedAt,t.now));return(t,r)=>(_(),i(`div`,gn,[r[0]||=v(`span`,{class:`glyph select-none`,"aria-hidden":`true`},`◌`,-1),r[1]||=v(`span`,{class:`label`},`Read, not answered`,-1),v(`span`,_n,`— `+l(e.reason),1),v(`span`,{class:`ts ml-auto select-none`,title:C(H)(e.decidedAt)},l(n.value),9,vn)]))}});function bn(){return{runs:new Map,connected:!1}}function xn(e,t){t.type===`upsert`&&t.run?t.run.finished||!t.run.threadKey?e.runs.delete(t.run.id):e.runs.set(t.run.id,{threadKey:t.run.threadKey,startedAt:t.run.startedAt,...t.run.label===void 0?{}:{label:t.run.label},...t.run.channelId===void 0?{}:{channelId:t.run.channelId}}):t.type===`removed`&&t.id&&e.runs.delete(t.id)}function Sn(e){let t=new Map;for(let n of e.runs.values()){let e=t.get(n.threadKey)??[];e.push(n),t.set(n.threadKey,e)}return t}function Cn(e,t){return t.includes(`:`)?t:`${e}:${t}`}function wn(e){let t=e.indexOf(`:`);return t>0?e.slice(0,t):`unknown`}function Tn(e,t,n){if(!t.connected)return[...e];let r=Sn(t),i=new Set,a=e.map(e=>{let t=Cn(n,e.id);i.add(t);let a=r.get(t);if(!a)return e.live?{...e,live:!1}:e;let o=e.live?0:a.length;return{...e,live:!0,runs:e.runs+o,lastAt:Math.max(e.lastAt,...a.map(e=>e.startedAt))}}),o=[];for(let[e,t]of r){if(i.has(e))continue;let r=t.reduce((e,t)=>t.startedAt>e.startedAt?t:e),a=r.label?ce(r.label).snippet:void 0;o.push({id:e.startsWith(`${n}:`)?e.slice(n.length+1):e,title:a??r.label??e,excerpt:a??r.label??e,lastAt:r.startedAt,runs:t.length,live:!0,surface:wn(r.channelId??e)})}return o.sort((e,t)=>t.lastAt-e.lastAt),[...o,...a]}var En={key:0,class:`mx-auto my-12 max-w-xl text-center text-toned`},Dn=[`data-rail`],On={key:0,class:`relative hidden md:block`},kn=[`aria-valuemin`,`aria-valuemax`,`aria-valuenow`],An={class:`thread mx-auto flex min-h-[calc(100vh-8rem)] w-full max-w-3xl flex-col`},jn={key:4,class:`inline text-[0.875rem] text-toned`,"data-testid":`inline`},Mn={key:2,class:`elsewhere sticky bottom-0 z-10 -mx-3 mt-auto bg-default/85 px-3 py-4 text-center text-[0.8rem] text-toned backdrop-blur sm:-mx-5 sm:px-5`,"data-testid":`elsewhere`},Nn=[`href`],Pn={key:3,class:`composer-dock sticky bottom-0 z-10 -mx-3 mt-auto bg-default/85 px-3 pb-[max(0.75rem,env(safe-area-inset-bottom))] pt-3 backdrop-blur sm:-mx-5 sm:px-5`},Fn=`(min-width: 48rem)`,In=u({__name:`HomePage`,setup(t){let u=T(`home`),p=z(u?.now),h=u?.conversation??``,b=y(u?.retentionDays??null),E=0,k=e=>`${e}-${++E}`,M=N([]);for(let e of u?.turns??[]){if(`kind`in e){e.kind===`receipt`?M.push({key:k(`s`),kind:`silent`,reason:e.reason,at:e.decidedAt}):M.push({key:k(`w`),kind:`parent`,turn:e});continue}M.push({key:k(`p`),kind:`person`,text:e.request,at:e.receivedAt??e.startedAt,pending:!1});let t=!e.finished&&e.token?{eventsUrl:`/runs/${encodeURIComponent(e.id)}/events?t=${e.token}`,stopUrl:`/runs/${encodeURIComponent(e.id)}/stop?t=${e.token}`,serverNow:u?.now}:null;M.push({key:k(`a`),kind:`assistant`,turn:e,live:t,ended:e.finished})}let I=P(()=>{for(let e=M.length-1;e>=0;e--){let t=M[e];if(t.kind===`assistant`&&t.live&&!t.ended&&t.turn.hosted!==!0)return t}return null}),re=A(null),ie=A(0);F(e,ie);let R=A(``),B=A(void 0),ce=P(()=>we(I.value!==null,R.value)),V=A(!1);s(R,()=>{B.value&&R.value===``&&(B.value=void 0)});function le(e){R.value=e,de()}async function de(){if(!u||V.value)return;let e=Je(R.value.trim(),u.commands);if(e===``)return;let t=N({key:k(`p`),kind:`person`,text:e,at:p.value,pending:!0});M.push(t),R.value=``,B.value=void 0,V.value=!0,ie.value++;try{let n=await fetch(u.sendUrl,{method:`POST`,credentials:`same-origin`,headers:{"content-type":`application/json`},body:JSON.stringify({text:e})}),r=await n.json().catch(()=>({}));if(n.status===202&&typeof r.viewPath==`string`&&typeof r.runId==`string`){let n=De(r.viewPath);if(!n)throw Error(`the run's view path was not one`);t.pending=!1,O.pathname()===`/threads`&&O.replaceUrl(`/threads/${encodeURIComponent(h)}`),M.push({key:k(`a`),kind:`assistant`,turn:{id:r.runId,request:e,startedAt:p.value,receivedAt:p.value,finished:!1,eventCount:0},live:{eventsUrl:n.eventsUrl,stopUrl:n.stopUrl},ended:!1});return}if(n.ok&&typeof r.reply==`string`){t.pending=!1;let e=Ee(r.reply);e.kind===`handBack`?(R.value=e.command,B.value=e.note??`Enter runs it`):e.kind===`inline`&&M.push({key:k(`i`),kind:`inline`,text:e.text});return}throw Error(r.error??`HTTP ${n.status}`)}catch(e){t.pending=!1,t.failed=`not sent: ${e instanceof Error?e.message:`error`}`}finally{V.value=!1}}function pe(){let e=re.value;e&&fetch(`${e}${e.includes(`?`)?`&`:`?`}mode=soft`,{method:`POST`,credentials:`same-origin`})}function me(e,t,n){let r=Ne(M.filter(e=>e.kind===`person`).map(e=>({text:e.text,folded:e.folded!==void 0,ref:e})),t);if(!r)return;let i=e.turn.receivedAt??e.turn.startedAt;r.ref.folded=n===void 0?``:`at ${ue(Math.max(0,n-i),`clock`)}`}function H(e){e.ended=!0,re.value=null}let he=je({width:O.readPref(Z.width),collapsed:O.readPref(Z.collapsed)}),U=A(he.width),W=A(he.collapsed),_e=A(!1),G=A(O.mediaMatches(Fn)),ve=O.onMediaChange(Fn,e=>{G.value=e}),ye=A(null),be=A(null),xe=P(()=>G.value?W.value?`Show recent threads`:`Hide recent threads`:`Recent threads`);function Se(){if(G.value=O.mediaMatches(Fn),G.value){W.value=!W.value,O.writePref(Z.collapsed,W.value?`1`:`0`);return}_e.value=!0}function K(e,t){U.value=Ae(e),t&&O.writePref(Z.width,String(U.value))}let q=null;function Ce(e){q&&K(q.startWidth+(e.clientX-q.startX),!1)}function J(){window.removeEventListener(`pointermove`,Ce),q&&(q=null,O.writePref(Z.width,String(U.value)))}function Te(e){e.button===0&&(e.preventDefault(),q={startX:e.clientX,startWidth:U.value},e.currentTarget?.setPointerCapture?.(e.pointerId),window.addEventListener(`pointermove`,Ce),window.addEventListener(`pointerup`,J,{once:!0}))}function Oe(e){if(e.key===`ArrowRight`)K(U.value+X.step,!0);else if(e.key===`ArrowLeft`)K(U.value-X.step,!0);else if(e.key===`Home`)K(X.min,!0);else if(e.key===`End`)K(X.max,!0);else return;e.preventDefault()}D(()=>{window.removeEventListener(`pointermove`,Ce),window.removeEventListener(`pointerup`,J),ve()});function ke(e){let t=Re(e);if(t){if(e.preventDefault(),t===`newThread`){O.navigate(`/threads`);return}if(ye.value){ye.value.focusFilter();return}if(W.value&&O.mediaMatches(Fn)){W.value=!1,O.writePref(Z.collapsed,`0`),S().then(()=>ye.value?.focusFilter());return}_e.value=!0,S().then(()=>be.value?.focusFilter())}}let Me=A(null),Fe=A(!1);function Ie(){return document.body.scrollHeight-(window.innerHeight+window.scrollY)}s(()=>M.length,()=>{let e=Pe(Ie());S().then(()=>{e?Me.value?.scrollIntoView?.({block:`end`}):Fe.value=!0})});function Le(){Pe(Ie())&&(Fe.value=!1)}function ze(){Me.value?.scrollIntoView?.({block:`end`,behavior:`smooth`}),Fe.value=!1}ee(()=>{window.addEventListener(`scroll`,Le,{passive:!0}),window.addEventListener(`keydown`,ke),u&&We()}),x(()=>{window.removeEventListener(`scroll`,Le),window.removeEventListener(`keydown`,ke),Ue?.close()});let Q=N(bn()),Be=P(()=>Tn(u?.conversations??[],Q,u?.lane??``)),Ve=P(()=>{let e=I.value?.turn.id;return Q.runs.size+(e&&!Q.runs.has(e)?1:0)}),He=se(),Ue=null;function We(){Ue=He(`/runs?stream=1&mine=1`);let e=!1;Ue.onopen=()=>{e&&Q.runs.clear(),e=!0,Q.connected=!0},Ue.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch{return}xn(Q,t)}}let Ge=P(()=>{let e=M.find(e=>e.kind===`person`);return e?Y(e.text):`Switchboard`});s([Ge,Ve],([e,t])=>{O.setTitle(t>0?`(${t}) ${e}`:e),O.setFavicon(t>0?oe:ae)},{immediate:!0});let Ke=P(()=>new Date(p.value).getHours()),qe=P(()=>M.length===0),$=u?.elsewhere,Ye=$?$.surface===`web`?`This thread is another person's conversation. You can read it here.`:`This thread lives in ${fe[$.surface]??$.surface}.`:``;return(e,t)=>{let s=te,y=L;return _(),j(n,{title:`Threads`,nav:`home`},{leading:g(()=>[r(s,{class:`rail-toggle -ml-1`,size:`xs`,color:`neutral`,variant:`ghost`,icon:G.value&&!W.value?`i-lucide-panel-left-close`:`i-lucide-panel-left`,"aria-label":xe.value,"aria-expanded":G.value?!W.value:void 0,onClick:Se},null,8,[`icon`,`aria-label`,`aria-expanded`])]),default:g(()=>[C(u)?(_(),i(`div`,{key:1,class:d([`home gap-8 md:grid`,W.value?`md:grid-cols-[minmax(0,1fr)]`:`md:grid-cols-[var(--rail-w)_minmax(0,1fr)]`]),style:c({"--rail-w":`${U.value}px`}),"data-rail":W.value?`hidden`:`shown`},[W.value?m(``,!0):(_(),i(`aside`,On,[r(kt,{ref_key:`rail`,ref:ye,class:`sticky top-20`,rows:Be.value,current:C(h),now:C(p),retention:C(b)},null,8,[`rows`,`current`,`now`,`retention`]),v(`div`,{class:`handle group/handle absolute inset-y-0 -right-5 flex w-3 cursor-col-resize touch-none select-none justify-center outline-none`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize the recent threads column`,"aria-valuemin":C(X).min,"aria-valuemax":C(X).max,"aria-valuenow":U.value,tabindex:`0`,"data-testid":`rail-handle`,onPointerdown:Te,onKeydown:Oe,onDblclick:t[0]||=e=>K(C(X).default,!0)},[...t[5]||=[v(`span`,{class:`w-px rounded-full bg-(--ui-border-accented) opacity-0 transition-opacity duration-150 ease-out group-hover/handle:opacity-100 group-focus-visible/handle:opacity-100`,"aria-hidden":`true`},null,-1)]],40,kn)])),r(y,{open:_e.value,"onUpdate:open":t[1]||=e=>_e.value=e,side:`left`,title:`Recent threads`,ui:{content:`max-w-xs`}},{body:g(()=>[r(kt,{ref_key:`sheetRail`,ref:be,rows:Be.value,current:C(h),now:C(p),retention:C(b)},null,8,[`rows`,`current`,`now`,`retention`])]),_:1},8,[`open`]),v(`section`,An,[qe.value?(_(),j(It,{key:0,class:`mb-auto mt-[clamp(1.5rem,14vh,9rem)]`,name:C(u).viewer.name,hour:Ke.value,suggestions:C(u).suggestions,onPick:le},{default:g(()=>[r(lt,{modelValue:R.value,"onUpdate:modelValue":t[2]||=e=>R.value=e,mode:ce.value,hint:B.value,commands:C(u).commands,autofocus:``,"sweep-on-mount":``,onSubmit:de,onStop:pe},null,8,[`modelValue`,`mode`,`hint`,`commands`])]),_:1},8,[`name`,`hour`,`suggestions`])):(_(),j(o,{key:1,name:`sb-rise`,"move-class":`sb-move-move`,tag:`ol`,class:`transcript m-0 flex list-none flex-col gap-6 p-0 pb-32 pt-2`},{default:g(()=>[(_(!0),i(ne,null,a(M,e=>(_(),i(`li`,{key:e.key},[e.kind===`person`?(_(),j(Ht,{key:0,text:e.text,at:e.at,now:C(p),pending:e.pending,folded:e.folded,failed:e.failed},null,8,[`text`,`at`,`now`,`pending`,`folded`,`failed`])):e.kind===`assistant`?(_(),j(ln,{key:1,turn:e.turn,live:e.live,now:C(p),onInput:(t,n)=>me(e,t,n),onEnded:t=>H(e),onStop:t[3]||=e=>re.value=e},null,8,[`turn`,`live`,`now`,`onInput`,`onEnded`])):e.kind===`silent`?(_(),j(yn,{key:2,reason:e.reason,"decided-at":e.at,now:C(p)},null,8,[`reason`,`decided-at`,`now`])):e.kind===`parent`?(_(),j(hn,{key:3,turn:e.turn,now:C(p)},null,8,[`turn`,`now`])):(_(),i(`div`,jn,[r(ge,{text:e.text},null,8,[`text`])]))]))),128))]),_:1})),v(`div`,{ref_key:`end`,ref:Me,class:`end`,"aria-hidden":`true`},null,512),!qe.value&&C($)?(_(),i(`p`,Mn,[w(l(C(Ye))+` `,1),C($).url?(_(),i(`a`,{key:0,href:C($).url,target:`_blank`,rel:`noopener`,class:`text-highlighted`},`Reply there ↗`,8,Nn)):C($).surface===`web`?m(``,!0):(_(),i(ne,{key:1},[w(`Reply there.`)],64))])):qe.value?m(``,!0):(_(),i(`div`,Pn,[r(f,{name:`sb-rise`},{default:g(()=>[Fe.value?(_(),i(`button`,{key:0,type:`button`,class:`new-pill absolute -top-9 left-1/2 -translate-x-1/2 rounded-full border border-default bg-(--ui-bg-elevated) px-3 py-1 font-mono text-[0.7rem] text-toned shadow-sm hover:text-highlighted`,onClick:ze},` ↓ new `)):m(``,!0)]),_:1}),r(lt,{modelValue:R.value,"onUpdate:modelValue":t[4]||=e=>R.value=e,mode:ce.value,hint:B.value,commands:C(u).commands,autofocus:``,onSubmit:de,onStop:pe},null,8,[`modelValue`,`mode`,`hint`,`commands`])]))])],14,Dn)):(_(),i(`div`,En,`This page needs its seed.`))]),_:1})}}});export{In as default};
1
+ import{i as e,r as t,t as n}from"./AppShell-CSXDCV4x.js";import{An as r,Cn as i,Cr as a,Ft as o,Gr as s,Ii as c,Li as l,Mn as u,Pi as d,Pt as f,Qr as p,Sn as m,Tr as h,Xr as g,_r as _,bn as v,c as y,dr as ee,en as b,hr as x,ir as S,ji as C,kn as w,l as te,ln as ne,o as T,rn as E,sr as D,t as O,wr as k,xi as A,xn as j,y as M,yi as N,yn as P,yr as F}from"./browser-B6T5hjfR.js";import{t as I}from"./Tooltip-BWwJx27K.js";import{i as L,n as re,r as ie,t as R}from"./PendingTurnRow-ZYIRCCZ2.js";import{b as ae,x as oe}from"./main-Comxmwi4.js";import{t as se}from"./eventSource-Bj_dZf6M.js";import{t as z}from"./wallClock-DmaC1sKA.js";import{n as B,r as ce,t as V}from"./indexFormat-B-pd4r7Y.js";import{E as le,G as ue,H as de,a as fe,i as pe,t as me}from"./indexRow-DABQtONT.js";import{i as H}from"./format-BldUwl_R.js";import{i as he,n as U,t as W}from"./durationTone-U_rOqo6r.js";import{T as ge,a as _e,c as G,d as ve,i as ye,n as be,o as xe,s as Se,t as K,u as q,v as Ce}from"./sseReplay-IzTdD4-3.js";var J=`To run this:`;function we(e,t){return e?t.trim()===``?`stop`:`steer`:`send`}var Te=`↪ Folded into`;function Ee(e){let t=e.trim();if(t.startsWith(`To run this:`)){let e=t.slice(J.length).trim(),n=e.indexOf(`
2
+ `);if(n===-1)return{kind:`handBack`,command:e};let r=e.slice(n+1).trim();return r===``?{kind:`handBack`,command:e.slice(0,n).trim()}:{kind:`handBack`,command:e.slice(0,n).trim(),note:r}}return t.startsWith(Te)?{kind:`steerAck`,text:t}:{kind:`inline`,text:t}}function De(e){let t=/^\/runs\/([^/?#]+)(\?t=([^&#]+))?$/.exec(e);if(!t)return null;let n=decodeURIComponent(t[1]),r=t[3]?`?t=${t[3]}`:``;return{id:n,eventsUrl:`/runs/${t[1]}/events${r}`,stopUrl:`/runs/${t[1]}/stop${r}`}}function Y(e,t=60){let n=e.split(/\r?\n/).find(e=>e.trim()!==``)?.trim()??``;return n.length<=t?n||`New conversation`:`${n.slice(0,t-1).trimEnd()}…`}function Oe(e,t){let n=t-e;if(!(n>45e3))return`now`;let r=Math.floor(n/6e4);if(r<60)return`${Math.max(1,r)}m`;let i=Math.floor(r/60);if(i<24)return`${i}h`;let a=Math.floor(i/24);return a<7?`${a}d`:B(e,t)}function ke(e,t){let n=e.surface??`web`,r=pe[n]??n,i=e.channelName?`${r} #${e.channelName}`:r;return{title:e.excerpt||e.title,when:V(e.lastAt,t),source:n===`web`?r:`${i} · read-only here`,runs:`${e.runs} run${e.runs===1?``:`s`}`,live:e.live}}var X={min:224,default:288,max:448,step:16};function Ae(e){let t=typeof e==`string`?Number(e):e;return typeof t!=`number`||!Number.isFinite(t)?X.default:Math.min(X.max,Math.max(X.min,Math.round(t)))}var Z={width:`sb.rail.width`,collapsed:`sb.rail.collapsed`};function je(e){return{width:Ae(e.width??void 0),collapsed:e.collapsed===`1`}}function Me(e,t){let n=e<5?`Still up`:e<12?`Good morning`:e<18?`Good afternoon`:`Good evening`;return t?`${n}, ${t}.`:`${n}.`}function Ne(e,t){let n=t.trim();for(let t=e.length-1;t>=0;t--){let r=e[t];if(!r.folded&&r.text.trim()===n)return r}return null}function Pe(e,t=60){return e<=t}function Fe(e){return e.key===`Enter`&&!e.shiftKey&&!e.isComposing}function Ie(e,t){let n=e.trim().toLowerCase();if(n===``)return 0;let r=t.toLowerCase(),i=0,a=-1,o=-1;for(let e of n){if(e===` `)continue;let t=r.indexOf(e,i);if(t===-1)return null;a===-1&&(a=t),o=t,i=t+1}return a===-1?0:o-a}function Le(e,t){return t.trim()===``?[...e]:e.map((e,n)=>({row:e,i:n,score:Ie(t,e.title)})).filter(e=>e.score!==null).sort((e,t)=>e.score-t.score||e.i-t.i).map(e=>e.row)}function Re(e){if(!(e.metaKey||e.ctrlKey))return null;let t=e.key.toLowerCase();return t===`o`&&e.shiftKey?`newThread`:t===`k`&&!e.shiftKey?`search`:null}function ze(e,t){return t?``:e===`steer`?`Say what to add — it folds into the run at its next step`:e===`stop`?`A run is working — type to steer it, or stop it`:`Review a pull request, ship a fix, investigate a run… or type / for a command`}function Q(e){let t=new Map;for(let n of e){let[e,r]=n.chat.split(` `,2);if(!e)continue;let i=t.get(e)??{name:e,verbs:[]};r===void 0?i.bare=n:i.verbs.push({verb:r,command:n}),t.set(e,i)}return[...t.values()]}function Be(e,t,n){if(t===``)return[...e];let r=t.toLowerCase(),i=e.filter(e=>n(e)[0].toLowerCase().startsWith(r));return i.length>0?i:e.map((e,r)=>{let i=n(e).map(e=>Ie(t,e)).filter(e=>e!==null);return i.length===0?null:{item:e,i:r,score:Math.min(...i)}}).filter(e=>e!==null).sort((e,t)=>e.score-t.score||e.i-t.i).map(e=>e.item)}function Ve(e,t=0,n=new Set){let r=(e.args??[]).slice(t),i=(e.options??[]).filter(e=>!n.has(He(e.form))).map(e=>`[${e.form}]`);return[...r,...i].join(` `)}var He=e=>e.split(` `,1)[0];function Ue(e,t){let n=new Set,r=0;for(let i=0;i<t.length;i++){let a=t[i];if(a.startsWith(`-`)){n.add(a);let t=(e.options??[]).find(e=>He(e.form)===a);t&&t.form.includes(` `)&&i++}else r++}return{positionals:r,flags:n}}function We(e,t){let n=/^\/([^\n]*)$/.exec(e);if(!n||t.length===0)return null;let r=n[1].split(` `),i=r[r.length-1],a=r.slice(0,-1).filter(e=>e!==``),o=e.slice(0,e.length-i.length),s=Q(t);if(a.length===0)return{level:`group`,head:o,partial:i,rows:Be(s,i,e=>[e.name,...e.bare?[e.bare.describe]:[],...e.verbs.map(e=>e.command.describe)]).map(e=>({insert:e.name,label:`/${e.name}`,describe:e.bare?e.verbs.length>0?`${e.bare.describe} · also ${e.verbs.map(e=>e.verb).join(`, `)}`:e.bare.describe:e.verbs.map(e=>e.verb).join(` · `),kind:e.bare&&e.verbs.length===0?`command`:`group`,acceptable:!0}))};let c=s.find(e=>e.name===a[0]);if(!c)return null;if(a.length===1){let e=Be(c.verbs,i,e=>[e.verb,e.command.describe]);if(e.length===0&&c.bare&&i!==``)return Ke(c.bare,o,i,[]);if(e.length===0&&!c.bare)return{level:`verb`,head:o,partial:i,rows:[]};let t=e.map(e=>({insert:e.verb,label:`/${e.command.chat}`,describe:e.command.describe,kind:`command`,acceptable:!0}));return c.bare&&i===``&&t.unshift(Ge(c.bare,0,new Set)),{level:`verb`,head:o,partial:i,rows:t}}let l=c.verbs.find(e=>e.verb===a[1]);return l?Ke(l.command,o,i,a.slice(2)):c.bare?Ke(c.bare,o,i,a.slice(1)):null}function Ge(e,t,n){let r=Ve(e,t,n);return{insert:``,label:`/${e.chat}`,describe:r?`${r} — ${e.describe}`:e.describe,kind:`usage`,acceptable:!1}}function Ke(e,t,n,r){let i=Ue(e,r);return n.startsWith(`-`)?{level:`tail`,head:t,partial:n,rows:Be((e.options??[]).filter(e=>!i.flags.has(He(e.form))),n,e=>[He(e.form),e.describe]).map(e=>({insert:He(e.form),label:e.form,describe:e.describe,kind:`option`,acceptable:!0})),command:e}:{level:`tail`,head:t,partial:n,rows:[Ge(e,i.positionals,i.flags)],command:e}}function qe(e,t){let n=e.rows[t];if(!n)return null;if(n.acceptable){if(!n.insert.toLowerCase().startsWith(e.partial.toLowerCase()))return null;let t=n.insert.slice(e.partial.length);return t===``?null:{text:t,acceptable:!0}}if(e.partial!==``||n.kind!==`usage`)return null;let[r,...i]=n.describe.split(` — `);return i.length===0?null:{text:r,acceptable:!1}}function $(e,t){return`${e.head}${t.insert} `}function Je(e,t){if(!e.startsWith(`/`))return e;let n=e.slice(1),[r,i]=n.split(/\s+/,2);return t.some(e=>e.chat===r||i!==void 0&&e.chat===`${r} ${i}`)?n:e}var Ye={class:`composer-wrap relative`},Xe={key:0,class:`palette absolute bottom-full left-0 right-0 z-20 mb-2 max-h-72 overflow-y-auto rounded-xl border border-default bg-(--ui-bg-elevated) p-1 shadow-sm`,role:`listbox`,"aria-label":`Commands`,"data-testid":`palette`},Ze={key:0,class:`px-3 py-2 font-mono text-xs text-dimmed`},Qe=[`aria-selected`,`data-insert`,`data-kind`,`data-label`,`onClick`,`onMouseenter`],$e={class:`chat shrink-0 font-mono text-[0.8rem] font-medium text-highlighted`},et={class:`describe min-w-0 flex-1 truncate text-[0.8rem] text-muted`},tt={key:0,class:`shrink-0 rounded border border-default px-1 font-mono text-[0.62rem] text-dimmed`,"aria-hidden":`true`},nt=[`data-mode`],rt={class:`relative min-w-0 flex-1`},it=[`data-acceptable`],at={class:`invisible`},ot={class:`text-dimmed`},st=[`rows`,`value`,`placeholder`,`autofocus`,`aria-expanded`],ct=[`aria-hidden`,`data-hint`,`data-shown`],lt=u({__name:`ChatComposer`,props:{modelValue:{},mode:{},hint:{},autofocus:{type:Boolean},sweepOnMount:{type:Boolean},commands:{}},emits:[`update:modelValue`,`submit`,`stop`],setup(e,{expose:t,emit:n}){let o=e,c=n,u=A(null),p=A(!1),h=A(!1),y=P(()=>Math.min(8,Math.max(1,o.modelValue.split(`
3
+ `).length))),b={send:{icon:`i-lucide-arrow-up`,label:`Send`},steer:{icon:`i-lucide-corner-down-right`,label:`Steer the run`},stop:{icon:`i-lucide-square`,label:`Stop the run`}},x=P(()=>b[o.mode]),C=P(()=>ze(o.mode,o.hint)),w=P(()=>o.hint?o.hint:o.mode===`steer`?`Enter folds this into the run in flight`:o.mode===`stop`?`A run is in flight · type to steer it, or stop it`:`Enter to send · Shift+Enter for a new line · / for a command`),T=P(()=>p.value||o.hint!==void 0||o.mode!==`send`),D=P(()=>We(o.modelValue,o.commands??[])),O=P(()=>D.value?.rows??[]),k=A(!1),N=A(0),F=P(()=>D.value!==null&&!k.value),I=P(()=>F.value&&D.value?qe(D.value,N.value):null);s(()=>`${D.value?.level??``}|${D.value?.head??``}`,()=>{k.value=!1,N.value=0}),s(O,e=>{N.value>=e.length&&(N.value=Math.max(0,e.length-1))});function L(e){D.value&&e.acceptable&&(c(`update:modelValue`,$(D.value,e)),z())}function re(){let e=u.value;return!e||e.selectionStart===e.value.length&&e.selectionEnd===e.value.length}function ie(e){c(`update:modelValue`,e.target.value)}function R(e){if(F.value){if(e.key===`ArrowDown`){e.preventDefault(),O.value.length>0&&(N.value=(N.value+1)%O.value.length);return}if(e.key===`ArrowUp`){e.preventDefault(),O.value.length>0&&(N.value=(N.value-1+O.value.length)%O.value.length);return}if(e.key===`Escape`){e.preventDefault(),k.value=!0;return}let t=O.value[N.value];if(e.key===`Tab`&&t?.acceptable){e.preventDefault(),L(t);return}if(e.key===`ArrowRight`&&I.value?.acceptable&&t&&re()){e.preventDefault(),L(t);return}if(e.key===`Enter`&&!e.shiftKey&&t?.acceptable){e.preventDefault(),L(t);return}}Fe(e)&&(e.preventDefault(),ae())}function ae(){o.mode===`stop`?c(`stop`):o.modelValue.trim()!==``&&c(`submit`)}function oe(){h.value=!1,S().then(()=>{h.value=!0})}function se(){p.value=!0,oe()}function z(){S().then(()=>{let e=u.value;e&&(e.focus(),e.setSelectionRange(e.value.length,e.value.length),document.activeElement===e&&!p.value&&se())})}return s(()=>o.hint,e=>{e&&z()}),ee(()=>{o.autofocus&&z(),o.sweepOnMount&&oe()}),t({focus:z}),(t,n)=>{let o=M,s=te;return _(),i(`div`,Ye,[r(f,{name:`sb-rise`},{default:g(()=>[F.value?(_(),i(`div`,Xe,[O.value.length===0?(_(),i(`p`,Ze,` No command matches "`+l(e.modelValue)+`". `,1)):m(``,!0),(_(!0),i(ne,null,a(O.value,(e,t)=>(_(),i(`button`,{key:e.label,type:`button`,role:`option`,class:d([`item flex w-full items-baseline gap-3 rounded-lg px-3 py-1.5 text-left transition-colors duration-150 ease-out`,t===N.value?`bg-(--ui-bg-accented)`:`hover:bg-(--ui-bg-muted)`]),"aria-selected":t===N.value?`true`:`false`,"data-insert":e.insert,"data-kind":e.kind,"data-label":e.label,onMousedown:n[0]||=E(()=>{},[`prevent`]),onClick:t=>L(e),onMouseenter:e=>N.value=t},[v(`span`,$e,l(e.label),1),v(`span`,et,l(e.describe),1),t===N.value&&e.acceptable?(_(),i(`kbd`,tt,`Tab`)):m(``,!0)],42,Qe))),128))])):m(``,!0)]),_:1}),v(`div`,{class:d([`ring relative rounded-2xl`,h.value?`ring-sweep`:``]),onAnimationend:n[2]||=e=>h.value=!1},[v(`form`,{class:d([`composer relative flex items-end gap-2 rounded-2xl border bg-default px-3 py-2 transition-colors duration-150 ease-out`,p.value?`border-primary`:`border-default hover:border-accented`]),"data-mode":e.mode,onSubmit:E(ae,[`prevent`])},[v(`div`,rt,[I.value?(_(),i(`div`,{key:0,class:`ghost composer-text pointer-events-none absolute inset-0 overflow-hidden whitespace-pre-wrap break-words`,"aria-hidden":`true`,"data-testid":`ghost`,"data-acceptable":I.value.acceptable?`1`:`0`},[v(`span`,at,l(e.modelValue),1),v(`span`,ot,l(I.value.text),1)],8,it)):m(``,!0),v(`textarea`,{ref_key:`box`,ref:u,class:`box composer-text relative block min-h-6 w-full resize-none bg-transparent text-highlighted outline-none placeholder:text-dimmed`,rows:y.value,value:e.modelValue,placeholder:C.value,autofocus:e.autofocus,"aria-label":`Message`,"aria-expanded":F.value?`true`:void 0,autocomplete:`off`,spellcheck:`true`,onInput:ie,onKeydown:R,onFocus:se,onBlur:n[1]||=e=>p.value=!1},null,40,st)]),r(s,{type:`submit`,class:`control shrink-0 rounded-full transition-transform duration-150 ease-out active:scale-95`,color:e.mode===`stop`?`neutral`:`primary`,variant:e.mode===`stop`?`outline`:`solid`,size:`sm`,"aria-label":x.value.label,title:x.value.label,disabled:e.mode===`send`&&e.modelValue.trim()===``,"data-mode":e.mode},{default:g(()=>[r(f,{name:`sb-fade`,mode:`out-in`},{default:g(()=>[(_(),j(o,{key:x.value.icon,name:x.value.icon,class:`size-4`,"aria-hidden":`true`},null,8,[`name`]))]),_:1})]),_:1},8,[`color`,`variant`,`aria-label`,`title`,`disabled`,`data-mode`])],42,nt)],34),v(`p`,{class:d([`hint mt-1.5 min-h-[1.1rem] select-none px-3 font-mono text-[0.7rem] text-dimmed transition-opacity duration-150 ease-out`,T.value?`opacity-100`:`opacity-0`]),"aria-hidden":T.value?void 0:`true`,"data-hint":e.hint?`handback`:e.mode,"data-shown":T.value?`1`:`0`},l(w.value),11,ct)])}}}),ut={class:`thread-tip flex max-w-xs flex-col gap-1 text-xs`},dt={class:`tip-title leading-snug text-highlighted`},ft={class:`flex flex-wrap items-center gap-x-1.5 gap-y-0.5 font-mono text-[0.68rem] text-muted`},pt={class:`tip-when tabular-nums`},mt={class:`tip-source inline-flex items-center gap-1`},ht={class:`tip-runs`},gt={key:0,class:`tip-live inline-flex items-center gap-1 text-toned`},_t=u({__name:`ThreadTip`,props:{row:{},now:{}},setup(e){let t=e,n=P(()=>ke(t.row,t.now));return(t,r)=>(_(),i(`div`,ut,[v(`p`,dt,l(n.value.title),1),v(`p`,ft,[v(`span`,pt,l(n.value.when),1),r[1]||=v(`span`,{"aria-hidden":`true`},`·`,-1),v(`span`,mt,[e.row.surface===`slack`?(_(),j(he,{key:0})):m(``,!0),w(l(n.value.source),1)]),r[2]||=v(`span`,{"aria-hidden":`true`},`·`,-1),v(`span`,ht,l(n.value.runs),1),n.value.live?(_(),i(`span`,gt,[...r[0]||=[v(`span`,{class:`size-1.5 rounded-full bg-ok`,"aria-hidden":`true`},null,-1),w(`live`,-1)]])):m(``,!0)])]))}}),vt={class:`rail flex flex-col gap-1 text-[0.8rem]`,"aria-label":`Recent threads`},yt={class:`filter mb-2 flex items-center gap-2 rounded-lg border border-default px-2.5 py-1.5 transition-colors duration-150 ease-out focus-within:border-primary hover:border-accented`},bt={key:0,class:`rounded border border-default px-1 font-mono text-[0.65rem] text-dimmed`},xt={key:0,class:`empty px-3 py-1 text-xs text-dimmed`},St={key:1,class:`nomatch px-3 py-1 text-xs text-dimmed`},Ct={key:0,class:`dot mt-px size-1.5 shrink-0 self-center rounded-full bg-ok motion-safe:animate-pulse`,"aria-label":`a run is in flight`},wt={class:`title min-w-0 flex-1 truncate text-toned group-hover:text-highlighted group-aria-[current=page]:text-highlighted`},Tt={class:`when shrink-0 font-mono text-[0.7rem] tabular-nums text-dimmed`},Et={class:`retention px-3 pt-1 text-[0.7rem] leading-relaxed text-dimmed`},Dt={class:`model px-3 pt-2 text-[0.7rem] leading-relaxed text-dimmed`,"data-testid":`what-is-a-thread`},Ot=500,kt=u({__name:`ConversationRail`,props:{rows:{},current:{},now:{},retention:{}},setup(e,{expose:t}){let n=e,s=A(``),c=A(null),u=P(()=>Le(n.rows,s.value));function d(){c.value?.focus(),c.value?.select()}function f(e){e.key===`Escape`&&(s.value=``,c.value?.blur())}return t({focusFilter:d}),(t,n)=>{let d=M,y=h(`RouterLink`),ee=I;return _(),i(`nav`,vt,[r(y,{class:`new group mb-3 flex items-center gap-2 rounded-xl bg-inverted px-3 py-2 font-medium text-inverted no-underline transition-[transform,opacity] duration-150 ease-out hover:-translate-y-px hover:opacity-90 active:translate-y-0 active:opacity-100`,to:`/threads`,"aria-current":e.current===``?`page`:void 0,"data-testid":`new-thread`},{default:g(()=>[r(d,{name:`i-lucide-plus`,class:`size-4 shrink-0 transition-transform duration-150 ease-out group-hover:rotate-90`,"aria-hidden":`true`}),n[1]||=v(`span`,null,`New thread`,-1),n[2]||=v(`span`,{class:`kbd ml-auto flex gap-0.5 font-mono text-[0.65rem] opacity-70`,"aria-label":`shortcut shift command O`},[v(`kbd`,{class:`rounded border border-current/30 px-1`},`⇧`),v(`kbd`,{class:`rounded border border-current/30 px-1`},`⌘`),v(`kbd`,{class:`rounded border border-current/30 px-1`},`O`)],-1)]),_:1},8,[`aria-current`]),v(`label`,yt,[r(d,{name:`i-lucide-search`,class:`size-3.5 shrink-0 text-dimmed`,"aria-hidden":`true`}),p(v(`input`,{ref_key:`filter`,ref:c,"onUpdate:modelValue":n[0]||=e=>s.value=e,class:`min-w-0 flex-1 bg-transparent text-[0.8rem] text-highlighted outline-none placeholder:text-dimmed`,type:`text`,placeholder:`Filter recent`,"aria-label":`Filter recent threads`,autocomplete:`off`,onKeydown:f},null,544),[[b,s.value]]),s.value?m(``,!0):(_(),i(`kbd`,bt,`⌘K`))]),n[8]||=v(`p`,{class:`label px-3 pb-1 font-mono text-[0.65rem] font-medium uppercase tracking-wider text-dimmed`},`Recent`,-1),e.rows.length===0?(_(),i(`p`,xt,`Nothing yet. Ask something.`)):u.value.length===0?(_(),i(`p`,St,`Nothing matches "`+l(s.value)+`".`,1)):m(``,!0),r(o,{name:`sb-rise`,tag:`div`,class:`rows flex flex-col gap-0.5`},{default:g(()=>[(_(!0),i(ne,null,a(u.value,t=>(_(),i(`div`,{key:t.id},[r(ee,{"delay-duration":Ot,content:{side:`right`,sideOffset:12,align:`start`},ui:{content:`h-auto max-w-xs px-2.5 py-2`}},{content:g(()=>[r(_t,{row:t,now:e.now},null,8,[`row`,`now`])]),default:g(()=>[r(y,{class:`row group relative flex items-baseline gap-2 rounded-lg px-3 py-1.5 no-underline transition-colors duration-150 ease-out hover:bg-(--ui-bg-muted) aria-[current=page]:bg-(--ui-bg-accented)`,to:`/threads/${encodeURIComponent(t.id)}`,"aria-current":t.id===e.current?`page`:void 0,"data-surface":t.surface},{default:g(()=>[n[3]||=v(`span`,{class:`bar absolute left-0 top-1/2 h-4 w-0.5 -translate-y-1/2 rounded-full bg-primary opacity-0 transition-opacity duration-150 ease-out group-aria-[current=page]:opacity-100`,"aria-hidden":`true`},null,-1),t.live?(_(),i(`span`,Ct)):m(``,!0),v(`span`,wt,l(t.title),1),v(`span`,Tt,l(C(Oe)(t.lastAt,e.now)),1)]),_:2},1032,[`to`,`aria-current`,`data-surface`])]),_:2},1024)]))),128))]),_:1}),r(y,{class:`all mt-3 flex items-center gap-1.5 px-3 py-1 text-xs font-medium text-muted no-underline transition-colors duration-150 ease-out hover:text-highlighted`,to:`/runs`,"data-testid":`all-runs`},{default:g(()=>[n[4]||=w(` All runs `,-1),r(d,{name:`i-lucide-arrow-right`,class:`size-3 transition-transform duration-150 ease-out group-hover:translate-x-0.5`,"aria-hidden":`true`})]),_:1}),v(`p`,Et,l(e.retention),1),v(`p`,Dt,[n[6]||=w(` A thread is a conversation; each message you send is a run. `,-1),r(y,{class:`text-muted hover:text-highlighted`,to:`/runs`},{default:g(()=>[...n[5]||=[w(`Runs`,-1)]]),_:1}),n[7]||=w(` lists every run across everyone's threads. `,-1)])])}}}),At={class:`empty mx-auto flex w-full max-w-2xl flex-col items-center gap-5 px-3 py-6 text-center`},jt={class:`flex flex-col gap-1.5`},Mt={class:`greeting sb-stagger text-xl font-medium tracking-tight text-highlighted`,style:{"--sb-i":`1`}},Nt={class:`sb-stagger w-full text-left`,style:{"--sb-i":`3`}},Pt={key:0,class:`chips flex flex-wrap justify-center gap-2`,"aria-label":`Suggestions`},Ft=[`onClick`],It=u({__name:`EmptyState`,props:{name:{},hour:{},suggestions:{}},emits:[`pick`],setup(e,{emit:n}){let o=n;return(n,s)=>(_(),i(`section`,At,[r(t,{draw:``,idle:``,class:`mark-lg sb-stagger text-highlighted`,style:{"font-size":`3.25rem`,"--sb-i":`0`}}),v(`div`,jt,[v(`h2`,Mt,l(C(Me)(e.hour,e.name)),1),s[0]||=v(`p`,{class:`sub sb-stagger text-[0.875rem] text-muted`,style:{"--sb-i":`2`}},` Ask in plain words. The right agent picks it up, and you watch it work here. `,-1)]),v(`div`,Nt,[k(n.$slots,`default`)]),e.suggestions.length>0?(_(),i(`ul`,Pt,[(_(!0),i(ne,null,a(e.suggestions,(e,t)=>(_(),i(`li`,{key:e,class:`sb-stagger`,style:c({"--sb-i":t+4})},[v(`button`,{type:`button`,class:`chip rounded-full border border-default px-3 py-1 text-[0.8rem] text-toned transition-[color,border-color,background-color,transform] duration-150 ease-out hover:-translate-y-px hover:border-accented hover:bg-(--ui-bg-muted) hover:text-highlighted focus-visible:outline-2 focus-visible:outline-primary active:translate-y-0`,onClick:t=>o(`pick`,e)},l(e),9,Ft)],4))),128))])):m(``,!0)]))}}),Lt=[`data-pending`],Rt={class:`meta flex items-baseline gap-2 pr-1 font-mono text-[0.7rem] text-dimmed`},zt={key:0,class:`failed text-bad`},Bt={key:0,class:`folded text-muted`},Vt=[`title`],Ht=u({__name:`PersonTurn`,props:{text:{},at:{},now:{},pending:{type:Boolean},folded:{},failed:{}},setup(e){let t=e,n=P(()=>V(t.at,t.now));return(t,a)=>(_(),i(`div`,{class:`turn person flex flex-col items-end gap-1`,"data-pending":e.pending?`1`:void 0},[v(`div`,{class:d([`bubble max-w-[min(42rem,88%)] whitespace-pre-wrap break-words rounded-2xl rounded-br-md bg-(--ui-bg-accented) px-4 py-2.5 text-[0.875rem] leading-normal text-highlighted transition-opacity duration-150 ease-out`,e.pending?`opacity-70`:``])},l(e.text),3),v(`div`,Rt,[e.failed?(_(),i(`span`,zt,l(e.failed),1)):m(``,!0),r(f,{name:`sb-fade`},{default:g(()=>[e.folded?(_(),i(`span`,Bt,`↪ folded in `+l(e.folded),1)):m(``,!0)]),_:1}),v(`span`,{class:`ts select-none`,title:C(H)(e.at)},l(n.value),9,Vt)])],8,Lt))}}),Ut=[`title`],Wt={class:`preset font-medium`},Gt={class:`reason truncate font-normal opacity-80`},Kt=u({__name:`ReceiptChip`,props:{route:{}},setup(e){let t=e,n=P(()=>me[fe(t.route.preset)]);return(t,r)=>(_(),i(`span`,{class:d([`receipt inline-flex max-w-full items-baseline gap-1.5 rounded border px-1.5 py-px font-mono text-[0.7rem] leading-relaxed`,n.value]),title:`routed: ${e.route.reason}`,"data-testid":`receipt`},[v(`span`,Wt,l(e.route.preset),1),v(`span`,Gt,`· `+l(e.route.reason),1)],10,Ut))}}),qt=[`data-phase`,`data-run-id`,`data-live`],Jt={class:`head flex flex-wrap items-baseline gap-2 font-mono text-[0.7rem] text-dimmed`},Yt={key:0,class:`model`},Xt={key:1,class:`elapsed ml-auto tabular-nums`,"data-testid":`elapsed`},Zt={key:0,class:`disconnected flex items-baseline gap-2 rounded-lg border border-dashed border-bad/40 px-3 py-2 font-mono text-xs text-bad`,"data-testid":`disconnected`},Qt=[`open`],$t={class:`flex min-h-6 cursor-pointer list-none items-baseline gap-2 font-mono text-[0.7rem] text-dimmed hover:text-toned [&::-webkit-details-marker]:hidden`},en={class:`summary`},tn={class:`pl-1 pt-1`},nn={key:0,class:`py-2 font-mono text-xs text-dimmed`},rn={key:1,class:`py-2 font-mono text-xs text-warn`},an={key:2,class:`m-0 list-none p-0`},on={key:0,class:`reply`,"data-testid":`reply`},sn={key:1,class:`outcome font-mono text-xs text-warn`,"data-testid":`outcome`},cn={key:2,class:`facts flex flex-wrap items-baseline gap-x-3 font-mono text-[0.7rem] text-dimmed`},ln=u({__name:`AssistantTurn`,props:{turn:{},now:{},live:{},fetch:{}},emits:[`ended`,`input`,`stop`],setup(e,{emit:t}){let n=e,u=t,p=G();n.live?.serverNow&&p.seedClock(n.live.serverNow);let y=p.state,b=A(n.live?`connecting`:`ended`),S=A(n.turn.route??null),te=A(!0),T=P(()=>y.reply?.text??n.turn.answer??``),E=P(()=>y.meta?.agent??n.turn.agent??``),D=P(()=>{let e=y.meta?.model??n.turn.model;return e?ve(e):``}),O=P(()=>n.live!==null&&n.live!==void 0&&b.value!==`ended`),k=P(()=>b.value===`disconnected`),M=n.live?.serverNow?Se({startedAt:n.turn.startedAt,receivedAt:n.turn.receivedAt,serverNow:n.live.serverNow},n.now):null,N=n.now,I=A(void 0),L=P(()=>n.turn.finished&&n.turn.finishedAt!==void 0?Math.max(0,n.turn.finishedAt-(n.turn.receivedAt??n.turn.startedAt)):I.value===void 0?M?M.elapsedMs(n.now):Math.max(0,n.now-N):I.value),ae=P(()=>ue(L.value,`clock`)),oe=P(()=>W(O.value?void 0:L.value,`run`)),z=P(()=>U(oe.value)),B=P(()=>O.value?Ce(y,n.now):null);F(xe,B),F(ye,null),F(_e,P(()=>y.reply!==null));let ce=P(()=>O.value?q(y,p.pendingCall(),n.now):null),V=P(()=>{let e=ce.value;return k.value||!e||e.kind===`call`?null:e.kind===`starting`?{verb:`Starting`,elapsedMs:L.value,slow:!1}:{verb:re(e.elapsedMs),elapsedMs:e.elapsedMs,slow:e.slow}}),pe=P(()=>y.log.filter(e=>e.kind===`step`)),H=P(()=>pe.value.length>0?pe.value.length:n.turn.stepCount??0),he=P(()=>n.turn.finished&&n.turn.status&&n.turn.status!==`completed`?le(n.turn.status):``),J=P(()=>`/runs/${encodeURIComponent(n.turn.id)}`),we=se(),Te=null;function Ee(e){let t=e;t.type===`route`&&typeof t.preset==`string`&&(S.value={preset:t.preset,reason:typeof t.reason==`string`?t.reason:``}),t.type===`input`&&typeof t.text==`string`&&(te.value?te.value=!1:u(`input`,t.text,t.at)),p.handle(e)}ee(()=>{n.live&&(u(`stop`,n.live.stopUrl),Te=ie({url:n.live.eventsUrl,factory:we,model:p,handle:Ee,onFinished:e=>{I.value=M&&e?M.elapsedAt(e.finishedAt):L.value},onEnd:()=>{I.value??=L.value,u(`ended`)},onDisconnected:()=>{I.value??=L.value}}),s(Te.phase,e=>b.value=e,{immediate:!0}))}),x(()=>Te?.close());let De=A(n.live!==null&&n.live!==void 0),Y=A(n.live?`ready`:`none`);s(O,e=>{e||(De.value=!1)});async function Oe(e){if(De.value=e.target.open,!De.value||Y.value!==`none`)return;Y.value=`loading`;let t=n.fetch??((...e)=>globalThis.fetch(...e));try{let e=await t(`/runs/${encodeURIComponent(n.turn.id)}/events`,{credentials:`same-origin`});if(!e.ok)throw Error(`HTTP ${e.status}`);let r=K(await e.text()).filter(e=>e.type!==`replay_note`);for(let e of(n.turn.schema??0)>=2?de(r):r)p.handle(e);p.closePhases(),Y.value=`ready`}catch{Y.value=`failed`}}let ke=P(()=>{let e=H.value;return e>0?`${e} step${e===1?``:`s`}`:O.value?`starting`:`no steps recorded`});return(t,n)=>{let s=h(`RouterLink`);return _(),i(`div`,{class:`turn assistant flex flex-col gap-2`,"data-phase":b.value,"data-run-id":e.turn.id,"data-live":O.value?`1`:void 0},[v(`div`,Jt,[r(f,{name:`sb-rise`},{default:g(()=>[S.value?(_(),j(Kt,{key:`receipt`,route:S.value},null,8,[`route`])):E.value?(_(),i(`span`,{key:`agent`,class:d([`agent rounded border px-1.5 py-px font-medium`,C(me)[C(fe)(E.value)]])},l(E.value),3)):m(``,!0)]),_:1}),D.value?(_(),i(`span`,Yt,l(D.value),1)):m(``,!0),O.value?(_(),i(`span`,Xt,l(ae.value),1)):m(``,!0)]),r(f,{name:`sb-fade`},{default:g(()=>[O.value&&V.value?(_(),j(R,{key:0,tag:`div`,verb:V.value.verb,"elapsed-ms":V.value.elapsedMs,slow:V.value.slow,model:C(y).meta?.model??e.turn.model??null},null,8,[`verb`,`elapsed-ms`,`slow`,`model`])):m(``,!0)]),_:1}),k.value?(_(),i(`p`,Zt,[n[1]||=v(`span`,null,`stream disconnected · the run may still be working`,-1),r(s,{class:`ml-auto text-primary no-underline hover:underline`,to:J.value},{default:g(()=>[...n[0]||=[w(`open the run`,-1)]]),_:1},8,[`to`])])):m(``,!0),O.value||H.value>0||Y.value!==`none`?(_(),i(`details`,{key:1,class:`work group`,open:De.value,"data-testid":`work`,onToggle:Oe},[v(`summary`,$t,[n[2]||=v(`span`,{class:`chev select-none transition-transform duration-150 ease-out group-open:rotate-90 motion-reduce:transition-none`},`❯`,-1),v(`span`,en,l(ke.value),1)]),v(`div`,tn,[Y.value===`loading`?(_(),i(`p`,nn,`reading the run's record…`)):Y.value===`failed`?(_(),i(`p`,rn,[n[4]||=w(` the run's record could not be read — `,-1),r(s,{class:`text-primary no-underline hover:underline`,to:J.value},{default:g(()=>[...n[3]||=[w(`open the run`,-1)]]),_:1},8,[`to`])])):(_(),i(`ol`,an,[r(o,{name:`sb-rise`},{default:g(()=>[(_(!0),i(ne,null,a(pe.value,e=>(_(),j(be,{key:e.key,step:e,class:`mt-3 first:mt-0`,onToggleGroup:t=>C(p).toggleGroup(e)},null,8,[`step`,`onToggleGroup`]))),128))]),_:1})]))])],40,Qt)):m(``,!0),r(f,{name:`sb-rise`},{default:g(()=>[T.value?(_(),i(`div`,on,[r(ge,{text:T.value},null,8,[`text`])])):he.value?(_(),i(`p`,sn,l(he.value),1)):m(``,!0)]),_:1}),O.value?m(``,!0):(_(),i(`div`,cn,[v(`span`,{class:d([`dur tabular-nums`,z.value?`heat`:``]),style:c(z.value)},l(ae.value),7),r(s,{class:`open text-dimmed no-underline hover:text-primary hover:underline`,to:J.value},{default:g(()=>[...n[5]||=[w(`open run`,-1)]]),_:1},8,[`to`])]))],8,qt)}}}),un={class:`turn parent flex flex-wrap items-baseline gap-x-2 gap-y-0.5 px-1 font-mono text-[0.7rem] text-dimmed`,"data-testid":`parent-word`},dn=[`href`],fn={class:`line text-muted`},pn={key:0,class:`pr text-muted`},mn=[`title`],hn=u({__name:`ParentTurn`,props:{turn:{},now:{}},setup(e){let t=e,n=P(()=>V(t.turn.at,t.now)),r=P(()=>`/runs/${encodeURIComponent(t.turn.runId)}`+(t.turn.token===void 0?``:`?t=${encodeURIComponent(t.turn.token)}`)),a=P(()=>t.turn.report??t.turn.lead??`unit ${t.turn.unit} — ${t.turn.state}`);return(t,o)=>(_(),i(`div`,un,[o[0]||=v(`span`,{class:`glyph select-none`,"aria-hidden":`true`},`⇡`,-1),v(`a`,{href:r.value,class:`label text-toned underline decoration-dotted underline-offset-2`},`Pipeline`,8,dn),v(`span`,fn,`— `+l(a.value),1),e.turn.pr===void 0?m(``,!0):(_(),i(`span`,pn,`#`+l(e.turn.pr),1)),v(`span`,{class:`ts ml-auto select-none`,title:C(H)(e.turn.at)},l(n.value),9,mn)]))}}),gn={class:`turn silent flex flex-wrap items-baseline gap-x-2 gap-y-0.5 px-1 font-mono text-[0.7rem] text-dimmed`,"data-testid":`silent-receipt`},_n={class:`reason text-muted`},vn=[`title`],yn=u({__name:`SilentTurn`,props:{reason:{},decidedAt:{},now:{}},setup(e){let t=e,n=P(()=>V(t.decidedAt,t.now));return(t,r)=>(_(),i(`div`,gn,[r[0]||=v(`span`,{class:`glyph select-none`,"aria-hidden":`true`},`◌`,-1),r[1]||=v(`span`,{class:`label`},`Read, not answered`,-1),v(`span`,_n,`— `+l(e.reason),1),v(`span`,{class:`ts ml-auto select-none`,title:C(H)(e.decidedAt)},l(n.value),9,vn)]))}});function bn(){return{runs:new Map,connected:!1}}function xn(e,t){t.type===`upsert`&&t.run?t.run.finished||!t.run.threadKey?e.runs.delete(t.run.id):e.runs.set(t.run.id,{threadKey:t.run.threadKey,startedAt:t.run.startedAt,...t.run.label===void 0?{}:{label:t.run.label},...t.run.channelId===void 0?{}:{channelId:t.run.channelId}}):t.type===`removed`&&t.id&&e.runs.delete(t.id)}function Sn(e){let t=new Map;for(let n of e.runs.values()){let e=t.get(n.threadKey)??[];e.push(n),t.set(n.threadKey,e)}return t}function Cn(e,t){return t.includes(`:`)?t:`${e}:${t}`}function wn(e){let t=e.indexOf(`:`);return t>0?e.slice(0,t):`unknown`}function Tn(e,t,n){if(!t.connected)return[...e];let r=Sn(t),i=new Set,a=e.map(e=>{let t=Cn(n,e.id);i.add(t);let a=r.get(t);if(!a)return e.live?{...e,live:!1}:e;let o=e.live?0:a.length;return{...e,live:!0,runs:e.runs+o,lastAt:Math.max(e.lastAt,...a.map(e=>e.startedAt))}}),o=[];for(let[e,t]of r){if(i.has(e))continue;let r=t.reduce((e,t)=>t.startedAt>e.startedAt?t:e),a=r.label?ce(r.label).snippet:void 0;o.push({id:e.startsWith(`${n}:`)?e.slice(n.length+1):e,title:a??r.label??e,excerpt:a??r.label??e,lastAt:r.startedAt,runs:t.length,live:!0,surface:wn(r.channelId??e)})}return o.sort((e,t)=>t.lastAt-e.lastAt),[...o,...a]}var En={key:0,class:`mx-auto my-12 max-w-xl text-center text-toned`},Dn=[`data-rail`],On={key:0,class:`relative hidden md:block`},kn=[`aria-valuemin`,`aria-valuemax`,`aria-valuenow`],An={class:`thread mx-auto flex min-h-[calc(100vh-8rem)] w-full max-w-3xl flex-col`},jn={key:4,class:`inline text-[0.875rem] text-toned`,"data-testid":`inline`},Mn={key:2,class:`elsewhere sticky bottom-0 z-10 -mx-3 mt-auto bg-default/85 px-3 py-4 text-center text-[0.8rem] text-toned backdrop-blur sm:-mx-5 sm:px-5`,"data-testid":`elsewhere`},Nn=[`href`],Pn={key:3,class:`composer-dock sticky bottom-0 z-10 -mx-3 mt-auto bg-default/85 px-3 pb-[max(0.75rem,env(safe-area-inset-bottom))] pt-3 backdrop-blur sm:-mx-5 sm:px-5`},Fn=`(min-width: 48rem)`,In=u({__name:`HomePage`,setup(t){let u=T(`home`),p=z(u?.now),h=u?.conversation??``,b=y(u?.retentionDays??null),E=0,k=e=>`${e}-${++E}`,M=N([]);for(let e of u?.turns??[]){if(`kind`in e){e.kind===`receipt`?M.push({key:k(`s`),kind:`silent`,reason:e.reason,at:e.decidedAt}):M.push({key:k(`w`),kind:`parent`,turn:e});continue}M.push({key:k(`p`),kind:`person`,text:e.request,at:e.receivedAt??e.startedAt,pending:!1});let t=!e.finished&&e.token?{eventsUrl:`/runs/${encodeURIComponent(e.id)}/events?t=${e.token}`,stopUrl:`/runs/${encodeURIComponent(e.id)}/stop?t=${e.token}`,serverNow:u?.now}:null;M.push({key:k(`a`),kind:`assistant`,turn:e,live:t,ended:e.finished})}let I=P(()=>{for(let e=M.length-1;e>=0;e--){let t=M[e];if(t.kind===`assistant`&&t.live&&!t.ended&&t.turn.hosted!==!0)return t}return null}),re=A(null),ie=A(0);F(e,ie);let R=A(``),B=A(void 0),ce=P(()=>we(I.value!==null,R.value)),V=A(!1);s(R,()=>{B.value&&R.value===``&&(B.value=void 0)});function le(e){R.value=e,de()}async function de(){if(!u||V.value)return;let e=Je(R.value.trim(),u.commands);if(e===``)return;let t=N({key:k(`p`),kind:`person`,text:e,at:p.value,pending:!0});M.push(t),R.value=``,B.value=void 0,V.value=!0,ie.value++;try{let n=await fetch(u.sendUrl,{method:`POST`,credentials:`same-origin`,headers:{"content-type":`application/json`},body:JSON.stringify({text:e})}),r=await n.json().catch(()=>({}));if(n.status===202&&typeof r.viewPath==`string`&&typeof r.runId==`string`){let n=De(r.viewPath);if(!n)throw Error(`the run's view path was not one`);t.pending=!1,O.pathname()===`/threads`&&O.replaceUrl(`/threads/${encodeURIComponent(h)}`),M.push({key:k(`a`),kind:`assistant`,turn:{id:r.runId,request:e,startedAt:p.value,receivedAt:p.value,finished:!1,eventCount:0},live:{eventsUrl:n.eventsUrl,stopUrl:n.stopUrl},ended:!1});return}if(n.ok&&typeof r.reply==`string`){t.pending=!1;let e=Ee(r.reply);e.kind===`handBack`?(R.value=e.command,B.value=e.note??`Enter runs it`):e.kind===`inline`&&M.push({key:k(`i`),kind:`inline`,text:e.text});return}throw Error(r.error??`HTTP ${n.status}`)}catch(e){t.pending=!1,t.failed=`not sent: ${e instanceof Error?e.message:`error`}`}finally{V.value=!1}}function fe(){let e=re.value;e&&fetch(`${e}${e.includes(`?`)?`&`:`?`}mode=soft`,{method:`POST`,credentials:`same-origin`})}function me(e,t,n){let r=Ne(M.filter(e=>e.kind===`person`).map(e=>({text:e.text,folded:e.folded!==void 0,ref:e})),t);if(!r)return;let i=e.turn.receivedAt??e.turn.startedAt;r.ref.folded=n===void 0?``:`at ${ue(Math.max(0,n-i),`clock`)}`}function H(e){e.ended=!0,re.value=null}let he=je({width:O.readPref(Z.width),collapsed:O.readPref(Z.collapsed)}),U=A(he.width),W=A(he.collapsed),_e=A(!1),G=A(O.mediaMatches(Fn)),ve=O.onMediaChange(Fn,e=>{G.value=e}),ye=A(null),be=A(null),xe=P(()=>G.value?W.value?`Show recent threads`:`Hide recent threads`:`Recent threads`);function Se(){if(G.value=O.mediaMatches(Fn),G.value){W.value=!W.value,O.writePref(Z.collapsed,W.value?`1`:`0`);return}_e.value=!0}function K(e,t){U.value=Ae(e),t&&O.writePref(Z.width,String(U.value))}let q=null;function Ce(e){q&&K(q.startWidth+(e.clientX-q.startX),!1)}function J(){window.removeEventListener(`pointermove`,Ce),q&&(q=null,O.writePref(Z.width,String(U.value)))}function Te(e){e.button===0&&(e.preventDefault(),q={startX:e.clientX,startWidth:U.value},e.currentTarget?.setPointerCapture?.(e.pointerId),window.addEventListener(`pointermove`,Ce),window.addEventListener(`pointerup`,J,{once:!0}))}function Oe(e){if(e.key===`ArrowRight`)K(U.value+X.step,!0);else if(e.key===`ArrowLeft`)K(U.value-X.step,!0);else if(e.key===`Home`)K(X.min,!0);else if(e.key===`End`)K(X.max,!0);else return;e.preventDefault()}D(()=>{window.removeEventListener(`pointermove`,Ce),window.removeEventListener(`pointerup`,J),ve()});function ke(e){let t=Re(e);if(t){if(e.preventDefault(),t===`newThread`){O.navigate(`/threads`);return}if(ye.value){ye.value.focusFilter();return}if(W.value&&O.mediaMatches(Fn)){W.value=!1,O.writePref(Z.collapsed,`0`),S().then(()=>ye.value?.focusFilter());return}_e.value=!0,S().then(()=>be.value?.focusFilter())}}let Me=A(null),Fe=A(!1);function Ie(){return document.body.scrollHeight-(window.innerHeight+window.scrollY)}s(()=>M.length,()=>{let e=Pe(Ie());S().then(()=>{e?Me.value?.scrollIntoView?.({block:`end`}):Fe.value=!0})});function Le(){Pe(Ie())&&(Fe.value=!1)}function ze(){Me.value?.scrollIntoView?.({block:`end`,behavior:`smooth`}),Fe.value=!1}ee(()=>{window.addEventListener(`scroll`,Le,{passive:!0}),window.addEventListener(`keydown`,ke),u&&We()}),x(()=>{window.removeEventListener(`scroll`,Le),window.removeEventListener(`keydown`,ke),Ue?.close()});let Q=N(bn()),Be=P(()=>Tn(u?.conversations??[],Q,u?.lane??``)),Ve=P(()=>{let e=I.value?.turn.id;return Q.runs.size+(e&&!Q.runs.has(e)?1:0)}),He=se(),Ue=null;function We(){Ue=He(`/runs?stream=1&mine=1`);let e=!1;Ue.onopen=()=>{e&&Q.runs.clear(),e=!0,Q.connected=!0},Ue.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch{return}xn(Q,t)}}let Ge=P(()=>{let e=M.find(e=>e.kind===`person`);return e?Y(e.text):`Switchboard`});s([Ge,Ve],([e,t])=>{O.setTitle(t>0?`(${t}) ${e}`:e),O.setFavicon(t>0?oe:ae)},{immediate:!0});let Ke=P(()=>new Date(p.value).getHours()),qe=P(()=>M.length===0),$=u?.elsewhere,Ye=$?$.surface===`web`?`This thread is another person's conversation. You can read it here.`:`This thread lives in ${pe[$.surface]??$.surface}.`:``;return(e,t)=>{let s=te,y=L;return _(),j(n,{title:`Threads`,nav:`home`},{leading:g(()=>[r(s,{class:`rail-toggle -ml-1`,size:`xs`,color:`neutral`,variant:`ghost`,icon:G.value&&!W.value?`i-lucide-panel-left-close`:`i-lucide-panel-left`,"aria-label":xe.value,"aria-expanded":G.value?!W.value:void 0,onClick:Se},null,8,[`icon`,`aria-label`,`aria-expanded`])]),default:g(()=>[C(u)?(_(),i(`div`,{key:1,class:d([`home gap-8 md:grid`,W.value?`md:grid-cols-[minmax(0,1fr)]`:`md:grid-cols-[var(--rail-w)_minmax(0,1fr)]`]),style:c({"--rail-w":`${U.value}px`}),"data-rail":W.value?`hidden`:`shown`},[W.value?m(``,!0):(_(),i(`aside`,On,[r(kt,{ref_key:`rail`,ref:ye,class:`sticky top-20`,rows:Be.value,current:C(h),now:C(p),retention:C(b)},null,8,[`rows`,`current`,`now`,`retention`]),v(`div`,{class:`handle group/handle absolute inset-y-0 -right-5 flex w-3 cursor-col-resize touch-none select-none justify-center outline-none`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize the recent threads column`,"aria-valuemin":C(X).min,"aria-valuemax":C(X).max,"aria-valuenow":U.value,tabindex:`0`,"data-testid":`rail-handle`,onPointerdown:Te,onKeydown:Oe,onDblclick:t[0]||=e=>K(C(X).default,!0)},[...t[5]||=[v(`span`,{class:`w-px rounded-full bg-(--ui-border-accented) opacity-0 transition-opacity duration-150 ease-out group-hover/handle:opacity-100 group-focus-visible/handle:opacity-100`,"aria-hidden":`true`},null,-1)]],40,kn)])),r(y,{open:_e.value,"onUpdate:open":t[1]||=e=>_e.value=e,side:`left`,title:`Recent threads`,ui:{content:`max-w-xs`}},{body:g(()=>[r(kt,{ref_key:`sheetRail`,ref:be,rows:Be.value,current:C(h),now:C(p),retention:C(b)},null,8,[`rows`,`current`,`now`,`retention`])]),_:1},8,[`open`]),v(`section`,An,[qe.value?(_(),j(It,{key:0,class:`mb-auto mt-[clamp(1.5rem,14vh,9rem)]`,name:C(u).viewer.name,hour:Ke.value,suggestions:C(u).suggestions,onPick:le},{default:g(()=>[r(lt,{modelValue:R.value,"onUpdate:modelValue":t[2]||=e=>R.value=e,mode:ce.value,hint:B.value,commands:C(u).commands,autofocus:``,"sweep-on-mount":``,onSubmit:de,onStop:fe},null,8,[`modelValue`,`mode`,`hint`,`commands`])]),_:1},8,[`name`,`hour`,`suggestions`])):(_(),j(o,{key:1,name:`sb-rise`,"move-class":`sb-move-move`,tag:`ol`,class:`transcript m-0 flex list-none flex-col gap-6 p-0 pb-32 pt-2`},{default:g(()=>[(_(!0),i(ne,null,a(M,e=>(_(),i(`li`,{key:e.key},[e.kind===`person`?(_(),j(Ht,{key:0,text:e.text,at:e.at,now:C(p),pending:e.pending,folded:e.folded,failed:e.failed},null,8,[`text`,`at`,`now`,`pending`,`folded`,`failed`])):e.kind===`assistant`?(_(),j(ln,{key:1,turn:e.turn,live:e.live,now:C(p),onInput:(t,n)=>me(e,t,n),onEnded:t=>H(e),onStop:t[3]||=e=>re.value=e},null,8,[`turn`,`live`,`now`,`onInput`,`onEnded`])):e.kind===`silent`?(_(),j(yn,{key:2,reason:e.reason,"decided-at":e.at,now:C(p)},null,8,[`reason`,`decided-at`,`now`])):e.kind===`parent`?(_(),j(hn,{key:3,turn:e.turn,now:C(p)},null,8,[`turn`,`now`])):(_(),i(`div`,jn,[r(ge,{text:e.text},null,8,[`text`])]))]))),128))]),_:1})),v(`div`,{ref_key:`end`,ref:Me,class:`end`,"aria-hidden":`true`},null,512),!qe.value&&C($)?(_(),i(`p`,Mn,[w(l(C(Ye))+` `,1),C($).url?(_(),i(`a`,{key:0,href:C($).url,target:`_blank`,rel:`noopener`,class:`text-highlighted`},`Reply there ↗`,8,Nn)):C($).surface===`web`?m(``,!0):(_(),i(ne,{key:1},[w(`Reply there.`)],64))])):qe.value?m(``,!0):(_(),i(`div`,Pn,[r(f,{name:`sb-rise`},{default:g(()=>[Fe.value?(_(),i(`button`,{key:0,type:`button`,class:`new-pill absolute -top-9 left-1/2 -translate-x-1/2 rounded-full border border-default bg-(--ui-bg-elevated) px-3 py-1 font-mono text-[0.7rem] text-toned shadow-sm hover:text-highlighted`,onClick:ze},` ↓ new `)):m(``,!0)]),_:1}),r(lt,{modelValue:R.value,"onUpdate:modelValue":t[4]||=e=>R.value=e,mode:ce.value,hint:B.value,commands:C(u).commands,autofocus:``,onSubmit:de,onStop:fe},null,8,[`modelValue`,`mode`,`hint`,`commands`])]))])],14,Dn)):(_(),i(`div`,En,`This page needs its seed.`))]),_:1})}}});export{In as default};
@@ -1 +1 @@
1
- import{A as e,D as t,F as n,M as r,N as i,c as a,l as o,u as s,x as c}from"./AppShell-Bmz8nzz3.js";import{$ as l,An as u,Br as d,Cn as f,Cr as p,Ct as m,Di as h,E as g,Ei as ee,Fi as _,Gr as v,Hn as te,I as y,Ir as ne,J as re,K as b,Li as x,Mn as S,Oi as C,Pi as w,Q as T,Rr as ie,S as ae,Sn as E,St as oe,Vr as se,X as D,Xr as O,Y as ce,Z as le,_ as ue,_r as k,b as de,bn as A,dr as fe,dt as j,g as pe,gi as me,gt as M,h as he,ir as N,it as ge,ji as P,kn as F,l as _e,ln as I,m as ve,nn as L,nr as R,nt as ye,p as be,rn as z,rr as B,rt as xe,tt as Se,v as Ce,w as we,wr as V,x as Te,xi as Ee,xn as H,y as U,yn as W,z as G}from"./browser-B6T5hjfR.js";var[K,De]=b(`TagsInputRoot`),Oe=S({__name:`TagsInputRoot`,props:{modelValue:{type:[Array,null],required:!1},defaultValue:{type:Array,required:!1,default:()=>[]},addOnPaste:{type:Boolean,required:!1},addOnTab:{type:Boolean,required:!1},addOnBlur:{type:Boolean,required:!1},duplicate:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},delimiter:{type:null,required:!1,default:`,`},dir:{type:String,required:!1},max:{type:Number,required:!1,default:0},id:{type:String,required:!1},convertValue:{type:Function,required:!1},displayValue:{type:Function,required:!1,default:e=>e.toString()},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`,`invalid`,`addTag`,`removeTag`],setup(t,{emit:i}){let a=t,o=i,{addOnPaste:s,disabled:l,delimiter:d,max:f,id:p,dir:m,addOnBlur:h,addOnTab:ee}=C(a),_=r(m),v=M(a,`modelValue`,o,{defaultValue:a.defaultValue,passive:!0,deep:!0}),{forwardRef:te,currentElement:ne}=G(),{focused:re}=j(ne),b=e(ne),{getItems:x,CollectionSlot:S}=g({isProvider:!0}),w=Ee(),T=Ee(!1),ie=W(()=>Array.isArray(v.value)?[...v.value]:[]);function ae(e){if(e!==-1){let t=v.value[e];v.value=v.value.filter((t,n)=>n!==e),o(`removeTag`,t)}}return De({modelValue:v,onAddValue:e=>{let t=[...ie.value],n=t.length>0&&typeof t[0]==`object`,r=t.length>0&&typeof a.defaultValue[0]==`object`;if((n||r)&&typeof a.convertValue!=`function`)throw Error("You must provide a `convertValue` function when using objects as values.");let i=a.convertValue?a.convertValue(e):e;if(t.length>=f.value&&f.value)return o(`invalid`,i),!1;if(a.duplicate)return v.value=[...t,i],o(`addTag`,i),!0;if(t.includes(i))T.value=!0;else return v.value=[...t,i],o(`addTag`,i),!0;return o(`invalid`,i),!1},onRemoveValue:ae,onInputKeydown:e=>{if(e.isComposing)return;let t=e.target,r=x().map(e=>e.ref).filter(e=>e.dataset.disabled!==``);if(!r.length)return;let i=r.at(-1);switch(e.key){case`Delete`:case`Backspace`:if(t.selectionStart!==0||t.selectionEnd!==0)break;if(w.value){let t=r.findIndex(e=>e===w.value),n=x().find(e=>e.ref===w.value);ae(n?v.value.findIndex(e=>Se(e,n.value)):-1),w.value=w.value===i?r.at(t-1):r.at(t+1),e.preventDefault()}else e.key===`Backspace`&&(w.value=i,e.preventDefault());break;case`Home`:case`End`:case`ArrowRight`:case`ArrowLeft`:{let a=e.key===`ArrowRight`&&_.value===`ltr`||e.key===`ArrowLeft`&&_.value===`rtl`,o=!a;if(t.selectionStart!==0||t.selectionEnd!==0)break;if(o&&!w.value)w.value=i,e.preventDefault();else if(a&&i&&w.value===i)w.value=void 0,e.preventDefault();else if(w.value){let t=n(e,w.value,void 0,{itemsArray:r,loop:!1,dir:_.value});t&&(w.value=t),e.preventDefault()}break}case`ArrowUp`:case`ArrowDown`:w.value&&e.preventDefault();break;default:w.value=void 0}},selectedElement:w,isInvalidInput:T,addOnPaste:s,addOnBlur:h,addOnTab:ee,dir:_,disabled:l,delimiter:d,max:f,id:p,displayValue:a.displayValue}),(e,t)=>(k(),H(P(S),null,{default:O(()=>[u(P(y),{ref:P(te),dir:P(_),as:e.as,"as-child":e.asChild,"data-invalid":T.value?``:void 0,"data-disabled":P(l)?``:void 0,"data-focused":P(re)?``:void 0},{default:O(()=>[V(e.$slots,`default`,{modelValue:P(v)}),P(b)&&e.name?(k(),H(P(c),{key:0,name:e.name,value:P(v),required:e.required,disabled:P(l)},null,8,[`name`,`value`,`required`,`disabled`])):E(`v-if`,!0)]),_:3},8,[`dir`,`as`,`as-child`,`data-invalid`,`data-disabled`,`data-focused`])]),_:3}))}}),ke=S({__name:`TagsInputInput`,props:{placeholder:{type:String,required:!1},autoFocus:{type:Boolean,required:!1},maxLength:{type:Number,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`input`}},setup(e){let t=e,n=K(),{forwardRef:r,currentElement:a}=G();function o(e){if(n.selectedElement.value=void 0,!n.addOnBlur.value)return;let t=e.target,r=e.relatedTarget,i=t.getAttribute(`aria-controls`);i&&r?.closest(`#${CSS.escape(i)}`)||t.value&&n.onAddValue(t.value)&&(t.value=``)}function s(e){n.addOnTab.value&&d(e)}let{isComposing:c,handleCompositionStart:l,handleCompositionEnd:u}=i();async function d(e){if(c.value||(await N(),e.defaultPrevented))return;let t=e.target;t.value&&(n.onAddValue(t.value)&&(t.value=``),e.preventDefault())}function f(e){if(c.value||(n.isInvalidInput.value=!1,e.data===null))return;let t=n.delimiter.value;if(t===e.data||t instanceof RegExp&&t.test(e.data)){let r=e.target;if(r.value=r.value.replace(t,``),r.value.trim()===``){r.value=``;return}n.onAddValue(r.value)&&(r.value=``)}}function p(e){c.value||n.onInputKeydown(e)}function m(e){if(n.addOnPaste.value){e.preventDefault();let t=e.clipboardData;if(!t)return;let r=t.getData(`text`);n.delimiter.value?r.split(n.delimiter.value).forEach(e=>{n.onAddValue(e)}):n.onAddValue(r)}}return fe(()=>{let e=a.value.nodeName===`INPUT`?a.value:a.value.querySelector(`input`);e&&setTimeout(()=>{t.autoFocus&&e?.focus()},1)}),(e,t)=>(k(),H(P(y),{id:P(n).id?.value,ref:P(r),type:`text`,autocomplete:`off`,autocorrect:`off`,autocapitalize:`off`,as:e.as,"as-child":e.asChild,maxlength:e.maxLength,placeholder:e.placeholder,disabled:P(n).disabled.value,"data-invalid":P(n).isInvalidInput.value?``:void 0,onInput:f,onKeydown:[L(d,[`enter`]),L(s,[`tab`]),p],onBlur:o,onCompositionstart:P(l),onCompositionend:P(u),onPaste:m},{default:O(()=>[V(e.$slots,`default`)]),_:3},8,[`id`,`as`,`as-child`,`maxlength`,`placeholder`,`disabled`,`data-invalid`,`onCompositionstart`,`onCompositionend`]))}}),[Ae,je]=b(`TagsInputItem`),Me=S({__name:`TagsInputItem`,props:{value:{type:null,required:!0},disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,{value:n}=C(t),r=K(),{forwardRef:i,currentElement:a}=G(),{CollectionItem:o}=g(),s=W(()=>r.selectedElement.value===a.value),c=W(()=>t.disabled||r.disabled.value),l=je({value:n,isSelected:s,disabled:c,textId:``,displayValue:W(()=>r.displayValue(n.value))});return(e,t)=>(k(),H(P(o),{value:P(n)},{default:O(()=>[u(P(y),{ref:P(i),as:e.as,"as-child":e.asChild,"aria-labelledby":P(l).textId,"aria-current":s.value,"data-disabled":c.value?``:void 0,"data-state":s.value?`active`:`inactive`},{default:O(()=>[V(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`aria-labelledby`,`aria-current`,`data-disabled`,`data-state`])]),_:3},8,[`value`]))}}),Ne=S({__name:`TagsInputItemDelete`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;G();let n=K(),r=Ae(),i=W(()=>r.disabled?.value||n.disabled.value);function a(){if(i.value)return;let e=n.modelValue.value.findIndex(e=>Se(e,r.value.value));n.onRemoveValue(e)}return(e,n)=>(k(),H(P(y),B({tabindex:`-1`},t,{"aria-labelledby":P(r).textId,"aria-current":P(r).isSelected.value,"data-state":P(r).isSelected.value?`active`:`inactive`,"data-disabled":i.value?``:void 0,type:e.as===`button`?`button`:void 0,onClick:a}),{default:O(()=>[V(e.$slots,`default`)]),_:3},16,[`aria-labelledby`,`aria-current`,`data-state`,`data-disabled`,`type`]))}}),Pe=S({__name:`TagsInputItemText`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let n=e,r=Ae();return G(),r.textId||=t(void 0,`reka-tags-input-item-text`),(e,t)=>(k(),H(P(y),B(n,{id:P(r).textId}),{default:O(()=>[V(e.$slots,`default`,{},()=>[F(x(P(r).displayValue.value),1)])]),_:3},16,[`id`]))}});function Fe(e,t){if(typeof e!=`object`||!e)return!1;let n=D(e,t);return n!=null&&n!==``}function Ie(e,t){return t?{xs:44,sm:48,md:52,lg:56,xl:60}[e]:{xs:24,sm:28,md:32,lg:36,xl:40}[e]}function Le(e,t,n,r){let i=Ie(t,!0),a=Ie(t,!1);return r?()=>i:n?t=>Fe(e[t],n)?i:a:()=>a}var Re={slots:{root:`relative inline-flex items-center`,base:[`rounded-md`,`transition-colors`],leading:`absolute inset-y-0 start-0 flex items-center`,leadingIcon:`shrink-0 text-dimmed`,leadingAvatar:`shrink-0`,leadingAvatarSize:``,trailing:`group absolute inset-y-0 end-0 flex items-center disabled:cursor-not-allowed disabled:opacity-75 focus:outline-none`,trailingIcon:`shrink-0 text-dimmed`,trailingClear:`p-0`,arrow:`fill-bg stroke-default`,content:`max-h-[min(15rem,var(--reka-combobox-content-available-height,15rem))] w-(--reka-combobox-trigger-width) bg-default shadow-lg rounded-md ring ring-default overflow-hidden data-[state=open]:animate-[scale-in_100ms_var(--ease-out)] data-[state=closed]:animate-[scale-out_100ms_var(--ease-out)] origin-(--reka-combobox-content-transform-origin) pointer-events-auto flex flex-col`,viewport:`relative scroll-py-1 overflow-y-auto flex-1`,group:`p-1 isolate`,empty:`text-center text-muted`,label:`font-semibold text-highlighted`,separator:`-mx-1 my-1 h-px bg-border`,item:[`group relative w-full flex items-start gap-1.5 p-1.5 text-sm select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-md data-disabled:cursor-not-allowed data-disabled:opacity-75 text-default data-highlighted:not-data-disabled:text-highlighted data-highlighted:not-data-disabled:before:bg-elevated/50`,`transition-colors before:transition-colors`],itemLeadingIcon:[`shrink-0 text-dimmed group-data-highlighted:not-group-data-disabled:text-default`,`transition-colors`],itemLeadingAvatar:`shrink-0`,itemLeadingAvatarSize:``,itemLeadingChip:`shrink-0`,itemLeadingChipSize:``,itemTrailing:`ms-auto inline-flex gap-1.5 items-center`,itemTrailingIcon:`shrink-0`,itemWrapper:`flex-1 flex flex-col min-w-0`,itemLabel:`truncate`,itemDescription:`truncate text-muted`,tagsItem:`px-1.5 py-0.5 rounded-sm font-medium inline-flex items-center gap-0.5 ring ring-inset ring-accented bg-elevated text-default data-disabled:cursor-not-allowed data-disabled:opacity-75`,tagsItemText:`truncate`,tagsItemDelete:[`inline-flex items-center rounded-xs text-dimmed hover:text-default hover:bg-accented/75 disabled:pointer-events-none`,`transition-colors`],tagsItemDeleteIcon:`shrink-0`,tagsInput:`flex-1 border-0 bg-transparent placeholder:text-dimmed focus:outline-none disabled:cursor-not-allowed disabled:opacity-75`},variants:{fieldGroup:{horizontal:{root:`group has-focus-visible:z-[1]`,base:`group-not-only:group-first:rounded-e-none group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none`},vertical:{root:`group has-focus-visible:z-[1]`,base:`group-not-only:group-first:rounded-b-none group-not-only:group-last:rounded-t-none group-not-last:group-not-first:rounded-none`}},size:{xs:{base:`px-2 py-1 text-sm/4 gap-1`,leading:`ps-2`,trailing:`pe-2`,leadingIcon:`size-4`,leadingAvatarSize:`3xs`,trailingIcon:`size-4`,label:`p-1 text-[10px]/3 gap-1`,item:`p-1 text-xs gap-1`,itemLeadingIcon:`size-4`,itemLeadingAvatarSize:`3xs`,itemLeadingChip:`size-4`,itemLeadingChipSize:`sm`,itemTrailingIcon:`size-4`,tagsItem:`text-[10px]/3`,tagsItemDeleteIcon:`size-3`,empty:`p-2 text-xs`},sm:{base:`px-2.5 py-1.5 text-sm/4 gap-1.5`,leading:`ps-2.5`,trailing:`pe-2.5`,leadingIcon:`size-4`,leadingAvatarSize:`3xs`,trailingIcon:`size-4`,label:`p-1.5 text-[10px]/3 gap-1.5`,item:`p-1.5 text-xs gap-1.5`,itemLeadingIcon:`size-4`,itemLeadingAvatarSize:`3xs`,itemLeadingChip:`size-4`,itemLeadingChipSize:`sm`,itemTrailingIcon:`size-4`,tagsItem:`text-[10px]/3`,tagsItemDeleteIcon:`size-3`,empty:`p-2.5 text-xs`},md:{base:`px-2.5 py-1.5 text-base/5 gap-1.5`,leading:`ps-2.5`,trailing:`pe-2.5`,leadingIcon:`size-5`,leadingAvatarSize:`2xs`,trailingIcon:`size-5`,label:`p-1.5 text-xs gap-1.5`,item:`p-1.5 text-sm gap-1.5`,itemLeadingIcon:`size-5`,itemLeadingAvatarSize:`2xs`,itemLeadingChip:`size-5`,itemLeadingChipSize:`md`,itemTrailingIcon:`size-5`,tagsItem:`text-xs`,tagsItemDeleteIcon:`size-3.5`,empty:`p-2.5 text-sm`},lg:{base:`px-3 py-2 text-base/5 gap-2`,leading:`ps-3`,trailing:`pe-3`,leadingIcon:`size-5`,leadingAvatarSize:`2xs`,trailingIcon:`size-5`,label:`p-2 text-xs gap-2`,item:`p-2 text-sm gap-2`,itemLeadingIcon:`size-5`,itemLeadingAvatarSize:`2xs`,itemLeadingChip:`size-5`,itemLeadingChipSize:`md`,itemTrailingIcon:`size-5`,tagsItem:`text-xs`,tagsItemDeleteIcon:`size-3.5`,empty:`p-3 text-sm`},xl:{base:`px-3 py-2 text-base gap-2`,leading:`ps-3`,trailing:`pe-3`,leadingIcon:`size-6`,leadingAvatarSize:`xs`,trailingIcon:`size-6`,label:`p-2 text-sm gap-2`,item:`p-2 text-base gap-2`,itemLeadingIcon:`size-6`,itemLeadingAvatarSize:`xs`,itemLeadingChip:`size-6`,itemLeadingChipSize:`lg`,itemTrailingIcon:`size-6`,tagsItem:`text-sm`,tagsItemDeleteIcon:`size-4`,empty:`p-3 text-base`}},variant:{outline:`text-highlighted bg-default ring ring-inset ring-accented`,soft:`text-highlighted bg-elevated/50 hover:bg-elevated focus:bg-elevated disabled:bg-elevated/50`,subtle:`text-highlighted bg-elevated ring ring-inset ring-accented`,ghost:`text-highlighted bg-transparent hover:bg-elevated focus:bg-elevated disabled:bg-transparent dark:disabled:bg-transparent`,none:`text-highlighted bg-transparent focus:outline-none`},color:{primary:``,secondary:``,success:``,info:``,warning:``,error:``,neutral:``},leading:{true:``},trailing:{true:``},loading:{true:``},highlight:{true:``},fixed:{false:``},type:{file:`file:me-1.5 file:font-medium file:text-muted file:outline-none`},virtualize:{true:{viewport:`p-1 isolate`},false:{viewport:`divide-y divide-default`}},multiple:{true:{root:`flex-wrap`},false:{base:`w-full border-0 placeholder:text-dimmed disabled:cursor-not-allowed disabled:opacity-75`}}},compoundVariants:[{variant:`soft`,multiple:!0,class:`has-focus:bg-elevated has-focus-visible:outline-3`},{variant:`ghost`,multiple:!0,class:`has-focus:bg-elevated has-focus-visible:outline-3`},{color:`primary`,multiple:!0,variant:[`outline`,`subtle`],class:`has-focus-visible:outline-3 has-focus-visible:ring-primary`},{color:`secondary`,multiple:!0,variant:[`outline`,`subtle`],class:`has-focus-visible:outline-3 has-focus-visible:ring-secondary`},{color:`success`,multiple:!0,variant:[`outline`,`subtle`],class:`has-focus-visible:outline-3 has-focus-visible:ring-success`},{color:`info`,multiple:!0,variant:[`outline`,`subtle`],class:`has-focus-visible:outline-3 has-focus-visible:ring-info`},{color:`warning`,multiple:!0,variant:[`outline`,`subtle`],class:`has-focus-visible:outline-3 has-focus-visible:ring-warning`},{color:`error`,multiple:!0,variant:[`outline`,`subtle`],class:`has-focus-visible:outline-3 has-focus-visible:ring-error`},{color:`neutral`,multiple:!0,variant:[`outline`,`subtle`],class:`has-focus-visible:outline-3 has-focus-visible:ring-inverted`},{color:`primary`,variant:[`outline`,`subtle`],class:`outline-primary/25 focus-visible:outline-3 focus-visible:ring-primary`},{color:`secondary`,variant:[`outline`,`subtle`],class:`outline-secondary/25 focus-visible:outline-3 focus-visible:ring-secondary`},{color:`success`,variant:[`outline`,`subtle`],class:`outline-success/25 focus-visible:outline-3 focus-visible:ring-success`},{color:`info`,variant:[`outline`,`subtle`],class:`outline-info/25 focus-visible:outline-3 focus-visible:ring-info`},{color:`warning`,variant:[`outline`,`subtle`],class:`outline-warning/25 focus-visible:outline-3 focus-visible:ring-warning`},{color:`error`,variant:[`outline`,`subtle`],class:`outline-error/25 focus-visible:outline-3 focus-visible:ring-error`},{color:`primary`,variant:[`soft`,`ghost`],class:`outline-primary/25 focus-visible:outline-3`},{color:`secondary`,variant:[`soft`,`ghost`],class:`outline-secondary/25 focus-visible:outline-3`},{color:`success`,variant:[`soft`,`ghost`],class:`outline-success/25 focus-visible:outline-3`},{color:`info`,variant:[`soft`,`ghost`],class:`outline-info/25 focus-visible:outline-3`},{color:`warning`,variant:[`soft`,`ghost`],class:`outline-warning/25 focus-visible:outline-3`},{color:`error`,variant:[`soft`,`ghost`],class:`outline-error/25 focus-visible:outline-3`},{color:`primary`,highlight:!0,class:`ring ring-inset ring-primary`},{color:`secondary`,highlight:!0,class:`ring ring-inset ring-secondary`},{color:`success`,highlight:!0,class:`ring ring-inset ring-success`},{color:`info`,highlight:!0,class:`ring ring-inset ring-info`},{color:`warning`,highlight:!0,class:`ring ring-inset ring-warning`},{color:`error`,highlight:!0,class:`ring ring-inset ring-error`},{color:`neutral`,variant:[`outline`,`subtle`],class:`outline-inverted/25 focus-visible:outline-3 focus-visible:ring-inverted`},{color:`neutral`,variant:[`soft`,`ghost`],class:`outline-inverted/25 focus-visible:outline-3`},{color:`neutral`,highlight:!0,class:`ring ring-inset ring-inverted`},{leading:!0,size:`xs`,class:`ps-7`},{leading:!0,size:`sm`,class:`ps-8`},{leading:!0,size:`md`,class:`ps-9`},{leading:!0,size:`lg`,class:`ps-10`},{leading:!0,size:`xl`,class:`ps-11`},{trailing:!0,size:`xs`,class:`pe-7`},{trailing:!0,size:`sm`,class:`pe-8`},{trailing:!0,size:`md`,class:`pe-9`},{trailing:!0,size:`lg`,class:`pe-10`},{trailing:!0,size:`xl`,class:`pe-11`},{loading:!0,leading:!0,class:{leadingIcon:`animate-spin`}},{loading:!0,leading:!1,trailing:!0,class:{trailingIcon:`animate-spin`}},{fixed:!1,size:`xs`,class:`md:text-xs`},{fixed:!1,size:`sm`,class:`md:text-xs`},{fixed:!1,size:`md`,class:`md:text-sm`},{fixed:!1,size:`lg`,class:`md:text-sm`}],defaultVariants:{size:`md`,color:`primary`,variant:`outline`}},ze=Object.assign({inheritAttrs:!1},{__name:`InputMenu`,props:R({as:{type:null,required:!1},id:{type:String,required:!1},type:{type:null,required:!1,default:`text`},placeholder:{type:String,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},required:{type:Boolean,required:!1},autofocus:{type:Boolean,required:!1},autofocusDelay:{type:Number,required:!1,default:0},trailingIcon:{type:null,required:!1},selectedIcon:{type:null,required:!1},deleteIcon:{type:null,required:!1},clear:{type:[Boolean,Object],required:!1},clearIcon:{type:null,required:!1},content:{type:Object,required:!1},arrow:{type:[Boolean,Object],required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},virtualize:{type:[Boolean,Object],required:!1,default:!1},valueKey:{type:null,required:!1},labelKey:{type:null,required:!1,default:`label`},descriptionKey:{type:null,required:!1,default:`description`},items:{type:null,required:!1},defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1},modelModifiers:{type:null,required:!1},multiple:{type:Boolean,required:!1},highlight:{type:Boolean,required:!1},fixed:{type:Boolean,required:!1},mode:{type:String,required:!1,default:`combobox`},createItem:{type:[Boolean,String,Object],required:!1},filterFields:{type:Array,required:!1},ignoreFilter:{type:Boolean,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},open:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},name:{type:String,required:!1},resetSearchTermOnBlur:{type:Boolean,required:!1,default:!0},resetSearchTermOnSelect:{type:Boolean,required:!1,default:!0},resetModelValueOnClear:{type:Boolean,required:!1,default:!0},highlightOnHover:{type:Boolean,required:!1},openOnClick:{type:Boolean,required:!1},openOnFocus:{type:Boolean,required:!1},by:{type:[String,Function],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},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1}},{searchTerm:{type:String,default:``},searchTermModifiers:{}}),emits:R([`change`,`blur`,`focus`,`create`,`clear`,`highlight`,`remove-tag`,`update:modelValue`,`update:open`],[`update:searchTerm`]),setup(e,{expose:t,emit:n}){let r=e,i=n,c=d(),g=ae(`inputMenu`,r),y=ie(e,`searchTerm`,{type:String,default:``}),{t:b}=re(),S=xe(),{filterGroups:C}=a(),j=W(()=>g.mode===`autocomplete`),M=m(g,`as`,`modelValue`,`defaultValue`,`open`,`defaultOpen`,`required`,`multiple`,`resetSearchTermOnBlur`,`resetSearchTermOnSelect`,`resetModelValueOnClear`,`highlightOnHover`,`openOnClick`,`openOnFocus`,`by`),L=oe(M,`multiple`,`resetSearchTermOnSelect`,`resetModelValueOnClear`,`by`),R=Te(W(()=>j.value?L:M),i),G=W(()=>j.value?o:s),K=ne(),De=W(()=>g.multiple&&!j.value?K[`data-slot`]??`base`:`base`),Ae=we(h(()=>g.portal)),je=h(()=>ye(g.content,{side:`bottom`,sideOffset:8,collisionPadding:8,position:`popper`})),Fe=h(()=>ye(g.arrow,{rounded:!0})),Ie=W(()=>typeof g.clear==`object`?g.clear:{}),ze=h(()=>g.virtualize?ye(typeof g.virtualize==`boolean`?{}:g.virtualize,{estimateSize:Le(Y.value,at.value??`md`,g.descriptionKey,!!c[`item-description`])}):!1),{emitFormBlur:Be,emitFormFocus:Ve,emitFormChange:He,emitFormInput:Ue,size:We,color:Ge,id:Ke,name:qe,highlight:Je,disabled:Ye,ariaAttrs:Xe}=be(r),{orientation:Ze,size:Qe}=he(r),{isLeading:$e,isTrailing:et,leadingIconName:tt,trailingIconName:nt}=pe(W(()=>({icon:g.icon,leading:g.leading,leadingIcon:g.leadingIcon,trailing:g.trailing,trailingIcon:g.trailingIcon??S.ui.icons.chevronDown,loading:g.loading,loadingIcon:g.loadingIcon}))),rt=W(()=>Ge.value??g.color),it=W(()=>Je.value??g.highlight),at=W(()=>Qe.value??We.value??g.size),ot=W(()=>Ye.value??g.disabled),[st,q]=ge(),[ct,lt]=ge({props:{item:{type:[Object,String,Number,Boolean],required:!0},index:{type:Number,required:!1}}}),J=W(()=>de({extend:Re,...S.ui?.inputMenu||{}})({color:rt.value,variant:g.variant,size:at.value,loading:g.loading,highlight:it.value,fixed:g.fixed,leading:$e.value||!!g.avatar||!!c.leading,trailing:et.value||!!c.trailing,multiple:g.multiple,fieldGroup:Ze.value,virtualize:!!g.virtualize})),ut=W(()=>ft.value.flatMap(e=>e));function dt(e){return le(ut.value,e,{labelKey:g.labelKey,valueKey:g.valueKey,by:g.by})??``}let ft=W(()=>g.items?.length?T(g.items)?g.items:[g.items]:[]),pt=W(()=>{if(g.ignoreFilter||!y.value)return ft.value;let e=Array.isArray(g.filterFields)?g.filterFields:[g.labelKey];return C(ft.value,y.value,{fields:e,isStructural:e=>$(e)&&!!e.type&&[`label`,`separator`].includes(e.type)})}),Y=W(()=>pt.value.flatMap(e=>e)),X=W(()=>{if(!g.createItem||!y.value)return!1;let e=g.valueKey?{[g.valueKey]:y.value}:y.value;return typeof g.createItem==`object`&&g.createItem.when===`always`||g.createItem===`always`?!Y.value.find(t=>ce(t,e,g.by??g.valueKey)):!Y.value.length}),Z=W(()=>typeof g.createItem==`object`?g.createItem.position:`bottom`),Q=se(`inputRef`);function mt(){g.autofocus&&Q.value?.$el?.focus()}let ht;fe(()=>{N(()=>{j.value?y.value=String(g.modelValue??g.defaultValue??``):y.value=``}),ht=setTimeout(()=>{mt()},g.autofocusDelay)}),me(()=>clearTimeout(ht)),v(()=>g.modelValue,e=>{j.value&&(y.value=String(e??``))});function gt(e){if(ee(g.modelValue)===e)return;g.modelModifiers?.trim&&(typeof e==`string`||e==null)&&(e=e?.trim()??null),g.modelModifiers?.number&&(e=l(e)),g.modelModifiers?.nullable&&(e??=null),g.modelModifiers?.optional&&!g.modelModifiers?.nullable&&e!==null&&(e??=void 0);let t=new Event(`change`,{target:{value:e}});i(`change`,t),He(),Ue(),j.value?y.value=String(e??``):g.resetSearchTermOnSelect&&(y.value=``)}function _t(e){j.value||(y.value=e)}function vt(e){i(`blur`,e),Be()}function yt(e){i(`focus`,e),Ve()}let bt=Ee(!1),xt;me(()=>clearTimeout(xt));function St(e){if(bt.value=e,e){let e=new FocusEvent(`focus`);i(`focus`,e),Ve(),clearTimeout(xt)}else{let e=new FocusEvent(`blur`);i(`blur`,e),Be(),!j.value&&g.resetSearchTermOnBlur&&(xt=setTimeout(()=>{y.value=``},100))}}function Ct(e,t){if(g.multiple){let n=t.filter(t=>!Se(t,e));i(`update:modelValue`,n),i(`remove-tag`,e),gt(n)}}function wt(e){e.preventDefault(),e.stopPropagation(),i(`create`,y.value)}function Tt(e,t){if($(t)){if(t.disabled){e.preventDefault();return}t.onSelect?.(e)}}function $(e){return typeof e==`object`&&!!e}function Et(e){return g.multiple&&Array.isArray(e)?e.length===0:e==null||e===``}function Dt(){i(`clear`)}let Ot=se(`viewportRef`),kt=se(`comboboxRootRef`);return v(()=>g.items,async()=>{bt.value&&g.createItem&&(await N(),kt.value?.highlightFirstItem?.())},{flush:`post`}),t({inputRef:h(()=>Q.value?.$el),viewportRef:h(()=>Ot.value)}),(e,t)=>(k(),f(I,null,[u(P(st),null,{default:O(()=>[u(P(G).Item,{"data-slot":`item`,class:w(J.value.item({class:P(g).ui?.item})),value:y.value,onSelect:wt},{default:O(()=>[A(`span`,{"data-slot":`itemLabel`,class:w(J.value.itemLabel({class:P(g).ui?.itemLabel}))},[V(e.$slots,`create-item-label`,{item:y.value},()=>[F(x(P(b)(`inputMenu.create`,{label:y.value})),1)])],2)]),_:3},8,[`class`,`value`])]),_:3}),u(P(ct),null,{default:O(({item:t,index:n})=>[$(t)&&t.type===`label`?(k(),H(P(G).Label,{key:0,"data-slot":`label`,class:w(J.value.label({class:[P(g).ui?.label,t.ui?.label,t.class]}))},{default:O(()=>[F(x(P(D)(t,P(g).labelKey)),1)]),_:2},1032,[`class`])):$(t)&&t.type===`separator`?(k(),H(P(G).Separator,{key:1,"data-slot":`separator`,class:w(J.value.separator({class:[P(g).ui?.separator,t.ui?.separator,t.class]}))},null,8,[`class`])):(k(),H(P(G).Item,{key:2,"data-slot":`item`,class:w(J.value.item({class:[P(g).ui?.item,$(t)&&t.ui?.item,$(t)&&t.class]})),disabled:$(t)&&t.disabled,value:P(g).valueKey&&$(t)?P(D)(t,P(g).valueKey):t,onSelect:e=>Tt(e,t)},{default:O(()=>[V(e.$slots,`item`,{item:t,index:n,ui:J.value},()=>[V(e.$slots,`item-leading`,{item:t,index:n,ui:J.value},()=>[$(t)&&t.icon?(k(),H(U,{key:0,name:t.icon,"data-slot":`itemLeadingIcon`,class:w(J.value.itemLeadingIcon({class:[P(g).ui?.itemLeadingIcon,t.ui?.itemLeadingIcon]}))},null,8,[`name`,`class`])):$(t)&&t.avatar?(k(),H(ue,B({key:1,size:t.ui?.itemLeadingAvatarSize||P(g).ui?.itemLeadingAvatarSize||J.value.itemLeadingAvatarSize()},t.avatar,{"data-slot":`itemLeadingAvatar`,class:J.value.itemLeadingAvatar({class:[P(g).ui?.itemLeadingAvatar,t.ui?.itemLeadingAvatar]})}),null,16,[`size`,`class`])):$(t)&&t.chip?(k(),H(Ce,B({key:2,size:t.ui?.itemLeadingChipSize||P(g).ui?.itemLeadingChipSize||J.value.itemLeadingChipSize(),inset:``,standalone:``},t.chip,{"data-slot":`itemLeadingChip`,class:J.value.itemLeadingChip({class:[P(g).ui?.itemLeadingChip,t.ui?.itemLeadingChip]})}),null,16,[`size`,`class`])):E(``,!0)]),A(`span`,{"data-slot":`itemWrapper`,class:w(J.value.itemWrapper({class:[P(g).ui?.itemWrapper,$(t)&&t.ui?.itemWrapper]}))},[A(`span`,{"data-slot":`itemLabel`,class:w(J.value.itemLabel({class:[P(g).ui?.itemLabel,$(t)&&t.ui?.itemLabel]}))},[V(e.$slots,`item-label`,{item:t,index:n},()=>[F(x($(t)?P(D)(t,P(g).labelKey):t),1)])],2),$(t)&&(P(D)(t,P(g).descriptionKey)||c[`item-description`])?(k(),f(`span`,{key:0,"data-slot":`itemDescription`,class:w(J.value.itemDescription({class:[P(g).ui?.itemDescription,$(t)&&t.ui?.itemDescription]}))},[V(e.$slots,`item-description`,{item:t,index:n},()=>[F(x(P(D)(t,P(g).descriptionKey)),1)])],2)):E(``,!0)],2),A(`span`,{"data-slot":`itemTrailing`,class:w(J.value.itemTrailing({class:[P(g).ui?.itemTrailing,$(t)&&t.ui?.itemTrailing]}))},[V(e.$slots,`item-trailing`,{item:t,index:n,ui:J.value}),j.value?E(``,!0):(k(),H(P(G).ItemIndicator,{key:0,"as-child":``},{default:O(()=>[u(U,{name:P(g).selectedIcon||P(S).ui.icons.check,"data-slot":`itemTrailingIcon`,class:w(J.value.itemTrailingIcon({class:[P(g).ui?.itemTrailingIcon,$(t)&&t.ui?.itemTrailingIcon]}))},null,8,[`name`,`class`])]),_:2},1024))],2)])]),_:2},1032,[`class`,`disabled`,`value`,`onSelect`]))]),_:3}),u(P(G).Root,B({ref_key:`comboboxRootRef`,ref:kt},P(R),{name:P(qe),disabled:ot.value,"data-slot":e.$attrs[`data-slot`]??`root`,class:J.value.root({class:[P(g).ui?.root,P(g).class]}),"as-child":!!P(g).multiple&&!j.value,"ignore-filter":``,"onUpdate:modelValue":gt,"onUpdate:open":St}),{default:O(({modelValue:n,open:r})=>[u(P(G).Anchor,{"as-child":!P(g).multiple,"data-slot":De.value,class:w(J.value.base({class:P(g).ui?.base}))},{default:O(()=>[P(g).multiple&&!j.value?(k(),H(P(Oe),{key:0,"model-value":n,disabled:ot.value,required:P(g).required,delimiter:``,"as-child":``,onBlur:vt,onFocus:yt,onRemoveTag:e=>Ct(e,n)},{default:O(({modelValue:n})=>[(k(!0),f(I,null,p(n,(t,n)=>(k(),H(P(Me),{key:n,value:t,"data-slot":`tagsItem`,class:w(J.value.tagsItem({class:[P(g).ui?.tagsItem,$(t)&&t.ui?.tagsItem]}))},{default:O(()=>[u(P(Pe),{"data-slot":`tagsItemText`,class:w(J.value.tagsItemText({class:[P(g).ui?.tagsItemText,$(t)&&t.ui?.tagsItemText]}))},{default:O(()=>[V(e.$slots,`tags-item-text`,{item:t,index:n},()=>[F(x(dt(t)),1)])]),_:2},1032,[`class`]),u(P(Ne),{"data-slot":`tagsItemDelete`,class:w(J.value.tagsItemDelete({class:[P(g).ui?.tagsItemDelete,$(t)&&t.ui?.tagsItemDelete]})),disabled:ot.value},{default:O(()=>[V(e.$slots,`tags-item-delete`,{item:t,index:n,ui:J.value},()=>[u(U,{name:P(g).deleteIcon||P(S).ui.icons.close,"data-slot":`tagsItemDeleteIcon`,class:w(J.value.tagsItemDeleteIcon({class:[P(g).ui?.tagsItemDeleteIcon,$(t)&&t.ui?.tagsItemDeleteIcon]}))},null,8,[`name`,`class`])])]),_:2},1032,[`class`,`disabled`])]),_:2},1032,[`value`,`class`]))),128)),u(P(G).Input,{modelValue:y.value,"onUpdate:modelValue":t[1]||=e=>y.value=e,"as-child":``},{default:O(()=>[u(P(ke),B({id:P(Ke),ref_key:`inputRef`,ref:Q},{...e.$attrs,...P(Xe)},{placeholder:P(g).placeholder,"data-slot":`tagsInput`,class:J.value.tagsInput({class:P(g).ui?.tagsInput}),onChange:t[0]||=z(()=>{},[`stop`])}),null,16,[`id`,`placeholder`,`class`])]),_:1},8,[`modelValue`])]),_:3},8,[`model-value`,`disabled`,`required`,`onRemoveTag`])):(k(),H(P(G).Input,B({key:1,id:P(Ke),ref_key:`inputRef`,ref:Q},{...j.value?{}:{displayValue:dt},...e.$attrs,...P(Xe)},{"data-slot":P(g).multiple?void 0:`base`,type:P(g).type,placeholder:P(g).placeholder,required:P(g).required,onBlur:vt,onFocus:yt,onChange:t[2]||=z(()=>{},[`stop`]),"onUpdate:modelValue":_t}),null,16,[`id`,`data-slot`,`type`,`placeholder`,`required`])),P($e)||P(g).avatar||c.leading?(k(),f(`span`,{key:2,"data-slot":`leading`,class:w(J.value.leading({class:P(g).ui?.leading}))},[V(e.$slots,`leading`,{modelValue:n,open:r,ui:J.value},()=>[P($e)&&P(tt)?(k(),H(U,{key:0,name:P(tt),"data-slot":`leadingIcon`,class:w(J.value.leadingIcon({class:P(g).ui?.leadingIcon}))},null,8,[`name`,`class`])):P(g).avatar?(k(),H(ue,B({key:1,size:P(g).ui?.itemLeadingAvatarSize||J.value.itemLeadingAvatarSize()},P(g).avatar,{"data-slot":`itemLeadingAvatar`,class:J.value.itemLeadingAvatar({class:P(g).ui?.itemLeadingAvatar})}),null,16,[`size`,`class`])):E(``,!0)])],2)):E(``,!0),P(et)||c.trailing||P(g).clear?(k(),H(P(G).Trigger,{key:3,"data-slot":`trailing`,class:w(J.value.trailing({class:P(g).ui?.trailing}))},{default:O(()=>[V(e.$slots,`trailing`,{modelValue:n,open:r,ui:J.value},()=>[P(g).clear&&!Et(n)?(k(),H(P(G).Cancel,{key:0,"as-child":``},{default:O(()=>[u(_e,B({as:`span`,icon:P(g).clearIcon||P(S).ui.icons.close,size:at.value,variant:`link`,color:`neutral`,tabindex:`-1`},Ie.value,{"data-slot":`trailingClear`,class:J.value.trailingClear({class:P(g).ui?.trailingClear}),onClick:z(Dt,[`stop`])}),null,16,[`icon`,`size`,`class`])]),_:1})):P(nt)?(k(),H(U,{key:1,name:P(nt),"data-slot":`trailingIcon`,class:w(J.value.trailingIcon({class:P(g).ui?.trailingIcon}))},null,8,[`name`,`class`])):E(``,!0)])]),_:2},1032,[`class`])):E(``,!0)]),_:2},1032,[`as-child`,`data-slot`,`class`]),u(P(G).Portal,_(te(P(Ae))),{default:O(()=>[u(P(ve),null,{default:O(()=>[u(P(G).Content,B({"data-slot":`content`,class:J.value.content({class:P(g).ui?.content})},je.value,{onFocusOutside:t[3]||=z(()=>{},[`prevent`])}),{default:O(()=>[V(e.$slots,`content-top`),u(P(G).Empty,{"data-slot":`empty`,class:w(J.value.empty({class:P(g).ui?.empty}))},{default:O(()=>[V(e.$slots,`empty`,{searchTerm:y.value},()=>[F(x(y.value?P(b)(`inputMenu.noMatch`,{searchTerm:y.value}):P(b)(`inputMenu.noData`)),1)])]),_:3},8,[`class`]),A(`div`,{ref_key:`viewportRef`,ref:Ot,role:`presentation`,"data-slot":`viewport`,class:w(J.value.viewport({class:P(g).ui?.viewport}))},[P(g).virtualize?(k(),f(I,{key:0},[X.value&&Z.value===`top`?(k(),H(P(q),{key:0})):E(``,!0),u(P(G).Virtualizer,B({options:Y.value,"text-content":e=>$(e)?P(D)(e,P(g).labelKey):String(e)},ze.value),{default:O(({option:e,virtualItem:t})=>[u(P(lt),{item:e,index:t.index},null,8,[`item`,`index`])]),_:1},16,[`options`,`text-content`]),X.value&&Z.value===`bottom`?(k(),H(P(q),{key:1})):E(``,!0)],64)):(k(),f(I,{key:1},[X.value&&Z.value===`top`?(k(),H(P(G).Group,{key:0,"data-slot":`group`,class:w(J.value.group({class:P(g).ui?.group}))},{default:O(()=>[u(P(q))]),_:1},8,[`class`])):E(``,!0),(k(!0),f(I,null,p(pt.value,(e,t)=>(k(),H(P(G).Group,{key:`group-${t}`,"data-slot":`group`,class:w(J.value.group({class:P(g).ui?.group}))},{default:O(()=>[(k(!0),f(I,null,p(e,(e,n)=>(k(),H(P(lt),{key:`group-${t}-${n}`,item:e,index:n},null,8,[`item`,`index`]))),128))]),_:2},1032,[`class`]))),128)),X.value&&Z.value===`bottom`?(k(),H(P(G).Group,{key:1,"data-slot":`group`,class:w(J.value.group({class:P(g).ui?.group}))},{default:O(()=>[u(P(q))]),_:1},8,[`class`])):E(``,!0)],64))],2),V(e.$slots,`content-bottom`),P(g).arrow?(k(),H(P(G).Arrow,B({key:0},Fe.value,{"data-slot":`arrow`,class:J.value.arrow({class:P(g).ui?.arrow})}),null,16,[`class`])):E(``,!0)]),_:3},16,[`class`])]),_:3})]),_:3},16)]),_:3},16,[`name`,`disabled`,`data-slot`,`class`,`as-child`])],64))}});export{ze as t};
1
+ import{A as e,D as t,F as n,M as r,N as i,c as a,l as o,u as s,x as c}from"./AppShell-CSXDCV4x.js";import{$ as l,An as u,Br as d,Cn as f,Cr as p,Ct as m,Di as h,E as g,Ei as ee,Fi as _,Gr as v,Hn as te,I as y,Ir as ne,J as re,K as b,Li as x,Mn as S,Oi as C,Pi as w,Q as T,Rr as ie,S as ae,Sn as E,St as oe,Vr as se,X as D,Xr as O,Y as ce,Z as le,_ as ue,_r as k,b as de,bn as A,dr as fe,dt as j,g as pe,gi as me,gt as M,h as he,ir as N,it as ge,ji as P,kn as F,l as _e,ln as I,m as ve,nn as L,nr as R,nt as ye,p as be,rn as z,rr as B,rt as xe,tt as Se,v as Ce,w as we,wr as V,x as Te,xi as Ee,xn as H,y as U,yn as W,z as G}from"./browser-B6T5hjfR.js";var[K,De]=b(`TagsInputRoot`),Oe=S({__name:`TagsInputRoot`,props:{modelValue:{type:[Array,null],required:!1},defaultValue:{type:Array,required:!1,default:()=>[]},addOnPaste:{type:Boolean,required:!1},addOnTab:{type:Boolean,required:!1},addOnBlur:{type:Boolean,required:!1},duplicate:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},delimiter:{type:null,required:!1,default:`,`},dir:{type:String,required:!1},max:{type:Number,required:!1,default:0},id:{type:String,required:!1},convertValue:{type:Function,required:!1},displayValue:{type:Function,required:!1,default:e=>e.toString()},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`,`invalid`,`addTag`,`removeTag`],setup(t,{emit:i}){let a=t,o=i,{addOnPaste:s,disabled:l,delimiter:d,max:f,id:p,dir:m,addOnBlur:h,addOnTab:ee}=C(a),_=r(m),v=M(a,`modelValue`,o,{defaultValue:a.defaultValue,passive:!0,deep:!0}),{forwardRef:te,currentElement:ne}=G(),{focused:re}=j(ne),b=e(ne),{getItems:x,CollectionSlot:S}=g({isProvider:!0}),w=Ee(),T=Ee(!1),ie=W(()=>Array.isArray(v.value)?[...v.value]:[]);function ae(e){if(e!==-1){let t=v.value[e];v.value=v.value.filter((t,n)=>n!==e),o(`removeTag`,t)}}return De({modelValue:v,onAddValue:e=>{let t=[...ie.value],n=t.length>0&&typeof t[0]==`object`,r=t.length>0&&typeof a.defaultValue[0]==`object`;if((n||r)&&typeof a.convertValue!=`function`)throw Error("You must provide a `convertValue` function when using objects as values.");let i=a.convertValue?a.convertValue(e):e;if(t.length>=f.value&&f.value)return o(`invalid`,i),!1;if(a.duplicate)return v.value=[...t,i],o(`addTag`,i),!0;if(t.includes(i))T.value=!0;else return v.value=[...t,i],o(`addTag`,i),!0;return o(`invalid`,i),!1},onRemoveValue:ae,onInputKeydown:e=>{if(e.isComposing)return;let t=e.target,r=x().map(e=>e.ref).filter(e=>e.dataset.disabled!==``);if(!r.length)return;let i=r.at(-1);switch(e.key){case`Delete`:case`Backspace`:if(t.selectionStart!==0||t.selectionEnd!==0)break;if(w.value){let t=r.findIndex(e=>e===w.value),n=x().find(e=>e.ref===w.value);ae(n?v.value.findIndex(e=>Se(e,n.value)):-1),w.value=w.value===i?r.at(t-1):r.at(t+1),e.preventDefault()}else e.key===`Backspace`&&(w.value=i,e.preventDefault());break;case`Home`:case`End`:case`ArrowRight`:case`ArrowLeft`:{let a=e.key===`ArrowRight`&&_.value===`ltr`||e.key===`ArrowLeft`&&_.value===`rtl`,o=!a;if(t.selectionStart!==0||t.selectionEnd!==0)break;if(o&&!w.value)w.value=i,e.preventDefault();else if(a&&i&&w.value===i)w.value=void 0,e.preventDefault();else if(w.value){let t=n(e,w.value,void 0,{itemsArray:r,loop:!1,dir:_.value});t&&(w.value=t),e.preventDefault()}break}case`ArrowUp`:case`ArrowDown`:w.value&&e.preventDefault();break;default:w.value=void 0}},selectedElement:w,isInvalidInput:T,addOnPaste:s,addOnBlur:h,addOnTab:ee,dir:_,disabled:l,delimiter:d,max:f,id:p,displayValue:a.displayValue}),(e,t)=>(k(),H(P(S),null,{default:O(()=>[u(P(y),{ref:P(te),dir:P(_),as:e.as,"as-child":e.asChild,"data-invalid":T.value?``:void 0,"data-disabled":P(l)?``:void 0,"data-focused":P(re)?``:void 0},{default:O(()=>[V(e.$slots,`default`,{modelValue:P(v)}),P(b)&&e.name?(k(),H(P(c),{key:0,name:e.name,value:P(v),required:e.required,disabled:P(l)},null,8,[`name`,`value`,`required`,`disabled`])):E(`v-if`,!0)]),_:3},8,[`dir`,`as`,`as-child`,`data-invalid`,`data-disabled`,`data-focused`])]),_:3}))}}),ke=S({__name:`TagsInputInput`,props:{placeholder:{type:String,required:!1},autoFocus:{type:Boolean,required:!1},maxLength:{type:Number,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`input`}},setup(e){let t=e,n=K(),{forwardRef:r,currentElement:a}=G();function o(e){if(n.selectedElement.value=void 0,!n.addOnBlur.value)return;let t=e.target,r=e.relatedTarget,i=t.getAttribute(`aria-controls`);i&&r?.closest(`#${CSS.escape(i)}`)||t.value&&n.onAddValue(t.value)&&(t.value=``)}function s(e){n.addOnTab.value&&d(e)}let{isComposing:c,handleCompositionStart:l,handleCompositionEnd:u}=i();async function d(e){if(c.value||(await N(),e.defaultPrevented))return;let t=e.target;t.value&&(n.onAddValue(t.value)&&(t.value=``),e.preventDefault())}function f(e){if(c.value||(n.isInvalidInput.value=!1,e.data===null))return;let t=n.delimiter.value;if(t===e.data||t instanceof RegExp&&t.test(e.data)){let r=e.target;if(r.value=r.value.replace(t,``),r.value.trim()===``){r.value=``;return}n.onAddValue(r.value)&&(r.value=``)}}function p(e){c.value||n.onInputKeydown(e)}function m(e){if(n.addOnPaste.value){e.preventDefault();let t=e.clipboardData;if(!t)return;let r=t.getData(`text`);n.delimiter.value?r.split(n.delimiter.value).forEach(e=>{n.onAddValue(e)}):n.onAddValue(r)}}return fe(()=>{let e=a.value.nodeName===`INPUT`?a.value:a.value.querySelector(`input`);e&&setTimeout(()=>{t.autoFocus&&e?.focus()},1)}),(e,t)=>(k(),H(P(y),{id:P(n).id?.value,ref:P(r),type:`text`,autocomplete:`off`,autocorrect:`off`,autocapitalize:`off`,as:e.as,"as-child":e.asChild,maxlength:e.maxLength,placeholder:e.placeholder,disabled:P(n).disabled.value,"data-invalid":P(n).isInvalidInput.value?``:void 0,onInput:f,onKeydown:[L(d,[`enter`]),L(s,[`tab`]),p],onBlur:o,onCompositionstart:P(l),onCompositionend:P(u),onPaste:m},{default:O(()=>[V(e.$slots,`default`)]),_:3},8,[`id`,`as`,`as-child`,`maxlength`,`placeholder`,`disabled`,`data-invalid`,`onCompositionstart`,`onCompositionend`]))}}),[Ae,je]=b(`TagsInputItem`),Me=S({__name:`TagsInputItem`,props:{value:{type:null,required:!0},disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,{value:n}=C(t),r=K(),{forwardRef:i,currentElement:a}=G(),{CollectionItem:o}=g(),s=W(()=>r.selectedElement.value===a.value),c=W(()=>t.disabled||r.disabled.value),l=je({value:n,isSelected:s,disabled:c,textId:``,displayValue:W(()=>r.displayValue(n.value))});return(e,t)=>(k(),H(P(o),{value:P(n)},{default:O(()=>[u(P(y),{ref:P(i),as:e.as,"as-child":e.asChild,"aria-labelledby":P(l).textId,"aria-current":s.value,"data-disabled":c.value?``:void 0,"data-state":s.value?`active`:`inactive`},{default:O(()=>[V(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`aria-labelledby`,`aria-current`,`data-disabled`,`data-state`])]),_:3},8,[`value`]))}}),Ne=S({__name:`TagsInputItemDelete`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;G();let n=K(),r=Ae(),i=W(()=>r.disabled?.value||n.disabled.value);function a(){if(i.value)return;let e=n.modelValue.value.findIndex(e=>Se(e,r.value.value));n.onRemoveValue(e)}return(e,n)=>(k(),H(P(y),B({tabindex:`-1`},t,{"aria-labelledby":P(r).textId,"aria-current":P(r).isSelected.value,"data-state":P(r).isSelected.value?`active`:`inactive`,"data-disabled":i.value?``:void 0,type:e.as===`button`?`button`:void 0,onClick:a}),{default:O(()=>[V(e.$slots,`default`)]),_:3},16,[`aria-labelledby`,`aria-current`,`data-state`,`data-disabled`,`type`]))}}),Pe=S({__name:`TagsInputItemText`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let n=e,r=Ae();return G(),r.textId||=t(void 0,`reka-tags-input-item-text`),(e,t)=>(k(),H(P(y),B(n,{id:P(r).textId}),{default:O(()=>[V(e.$slots,`default`,{},()=>[F(x(P(r).displayValue.value),1)])]),_:3},16,[`id`]))}});function Fe(e,t){if(typeof e!=`object`||!e)return!1;let n=D(e,t);return n!=null&&n!==``}function Ie(e,t){return t?{xs:44,sm:48,md:52,lg:56,xl:60}[e]:{xs:24,sm:28,md:32,lg:36,xl:40}[e]}function Le(e,t,n,r){let i=Ie(t,!0),a=Ie(t,!1);return r?()=>i:n?t=>Fe(e[t],n)?i:a:()=>a}var Re={slots:{root:`relative inline-flex items-center`,base:[`rounded-md`,`transition-colors`],leading:`absolute inset-y-0 start-0 flex items-center`,leadingIcon:`shrink-0 text-dimmed`,leadingAvatar:`shrink-0`,leadingAvatarSize:``,trailing:`group absolute inset-y-0 end-0 flex items-center disabled:cursor-not-allowed disabled:opacity-75 focus:outline-none`,trailingIcon:`shrink-0 text-dimmed`,trailingClear:`p-0`,arrow:`fill-bg stroke-default`,content:`max-h-[min(15rem,var(--reka-combobox-content-available-height,15rem))] w-(--reka-combobox-trigger-width) bg-default shadow-lg rounded-md ring ring-default overflow-hidden data-[state=open]:animate-[scale-in_100ms_var(--ease-out)] data-[state=closed]:animate-[scale-out_100ms_var(--ease-out)] origin-(--reka-combobox-content-transform-origin) pointer-events-auto flex flex-col`,viewport:`relative scroll-py-1 overflow-y-auto flex-1`,group:`p-1 isolate`,empty:`text-center text-muted`,label:`font-semibold text-highlighted`,separator:`-mx-1 my-1 h-px bg-border`,item:[`group relative w-full flex items-start gap-1.5 p-1.5 text-sm select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-md data-disabled:cursor-not-allowed data-disabled:opacity-75 text-default data-highlighted:not-data-disabled:text-highlighted data-highlighted:not-data-disabled:before:bg-elevated/50`,`transition-colors before:transition-colors`],itemLeadingIcon:[`shrink-0 text-dimmed group-data-highlighted:not-group-data-disabled:text-default`,`transition-colors`],itemLeadingAvatar:`shrink-0`,itemLeadingAvatarSize:``,itemLeadingChip:`shrink-0`,itemLeadingChipSize:``,itemTrailing:`ms-auto inline-flex gap-1.5 items-center`,itemTrailingIcon:`shrink-0`,itemWrapper:`flex-1 flex flex-col min-w-0`,itemLabel:`truncate`,itemDescription:`truncate text-muted`,tagsItem:`px-1.5 py-0.5 rounded-sm font-medium inline-flex items-center gap-0.5 ring ring-inset ring-accented bg-elevated text-default data-disabled:cursor-not-allowed data-disabled:opacity-75`,tagsItemText:`truncate`,tagsItemDelete:[`inline-flex items-center rounded-xs text-dimmed hover:text-default hover:bg-accented/75 disabled:pointer-events-none`,`transition-colors`],tagsItemDeleteIcon:`shrink-0`,tagsInput:`flex-1 border-0 bg-transparent placeholder:text-dimmed focus:outline-none disabled:cursor-not-allowed disabled:opacity-75`},variants:{fieldGroup:{horizontal:{root:`group has-focus-visible:z-[1]`,base:`group-not-only:group-first:rounded-e-none group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none`},vertical:{root:`group has-focus-visible:z-[1]`,base:`group-not-only:group-first:rounded-b-none group-not-only:group-last:rounded-t-none group-not-last:group-not-first:rounded-none`}},size:{xs:{base:`px-2 py-1 text-sm/4 gap-1`,leading:`ps-2`,trailing:`pe-2`,leadingIcon:`size-4`,leadingAvatarSize:`3xs`,trailingIcon:`size-4`,label:`p-1 text-[10px]/3 gap-1`,item:`p-1 text-xs gap-1`,itemLeadingIcon:`size-4`,itemLeadingAvatarSize:`3xs`,itemLeadingChip:`size-4`,itemLeadingChipSize:`sm`,itemTrailingIcon:`size-4`,tagsItem:`text-[10px]/3`,tagsItemDeleteIcon:`size-3`,empty:`p-2 text-xs`},sm:{base:`px-2.5 py-1.5 text-sm/4 gap-1.5`,leading:`ps-2.5`,trailing:`pe-2.5`,leadingIcon:`size-4`,leadingAvatarSize:`3xs`,trailingIcon:`size-4`,label:`p-1.5 text-[10px]/3 gap-1.5`,item:`p-1.5 text-xs gap-1.5`,itemLeadingIcon:`size-4`,itemLeadingAvatarSize:`3xs`,itemLeadingChip:`size-4`,itemLeadingChipSize:`sm`,itemTrailingIcon:`size-4`,tagsItem:`text-[10px]/3`,tagsItemDeleteIcon:`size-3`,empty:`p-2.5 text-xs`},md:{base:`px-2.5 py-1.5 text-base/5 gap-1.5`,leading:`ps-2.5`,trailing:`pe-2.5`,leadingIcon:`size-5`,leadingAvatarSize:`2xs`,trailingIcon:`size-5`,label:`p-1.5 text-xs gap-1.5`,item:`p-1.5 text-sm gap-1.5`,itemLeadingIcon:`size-5`,itemLeadingAvatarSize:`2xs`,itemLeadingChip:`size-5`,itemLeadingChipSize:`md`,itemTrailingIcon:`size-5`,tagsItem:`text-xs`,tagsItemDeleteIcon:`size-3.5`,empty:`p-2.5 text-sm`},lg:{base:`px-3 py-2 text-base/5 gap-2`,leading:`ps-3`,trailing:`pe-3`,leadingIcon:`size-5`,leadingAvatarSize:`2xs`,trailingIcon:`size-5`,label:`p-2 text-xs gap-2`,item:`p-2 text-sm gap-2`,itemLeadingIcon:`size-5`,itemLeadingAvatarSize:`2xs`,itemLeadingChip:`size-5`,itemLeadingChipSize:`md`,itemTrailingIcon:`size-5`,tagsItem:`text-xs`,tagsItemDeleteIcon:`size-3.5`,empty:`p-3 text-sm`},xl:{base:`px-3 py-2 text-base gap-2`,leading:`ps-3`,trailing:`pe-3`,leadingIcon:`size-6`,leadingAvatarSize:`xs`,trailingIcon:`size-6`,label:`p-2 text-sm gap-2`,item:`p-2 text-base gap-2`,itemLeadingIcon:`size-6`,itemLeadingAvatarSize:`xs`,itemLeadingChip:`size-6`,itemLeadingChipSize:`lg`,itemTrailingIcon:`size-6`,tagsItem:`text-sm`,tagsItemDeleteIcon:`size-4`,empty:`p-3 text-base`}},variant:{outline:`text-highlighted bg-default ring ring-inset ring-accented`,soft:`text-highlighted bg-elevated/50 hover:bg-elevated focus:bg-elevated disabled:bg-elevated/50`,subtle:`text-highlighted bg-elevated ring ring-inset ring-accented`,ghost:`text-highlighted bg-transparent hover:bg-elevated focus:bg-elevated disabled:bg-transparent dark:disabled:bg-transparent`,none:`text-highlighted bg-transparent focus:outline-none`},color:{primary:``,secondary:``,success:``,info:``,warning:``,error:``,neutral:``},leading:{true:``},trailing:{true:``},loading:{true:``},highlight:{true:``},fixed:{false:``},type:{file:`file:me-1.5 file:font-medium file:text-muted file:outline-none`},virtualize:{true:{viewport:`p-1 isolate`},false:{viewport:`divide-y divide-default`}},multiple:{true:{root:`flex-wrap`},false:{base:`w-full border-0 placeholder:text-dimmed disabled:cursor-not-allowed disabled:opacity-75`}}},compoundVariants:[{variant:`soft`,multiple:!0,class:`has-focus:bg-elevated has-focus-visible:outline-3`},{variant:`ghost`,multiple:!0,class:`has-focus:bg-elevated has-focus-visible:outline-3`},{color:`primary`,multiple:!0,variant:[`outline`,`subtle`],class:`has-focus-visible:outline-3 has-focus-visible:ring-primary`},{color:`secondary`,multiple:!0,variant:[`outline`,`subtle`],class:`has-focus-visible:outline-3 has-focus-visible:ring-secondary`},{color:`success`,multiple:!0,variant:[`outline`,`subtle`],class:`has-focus-visible:outline-3 has-focus-visible:ring-success`},{color:`info`,multiple:!0,variant:[`outline`,`subtle`],class:`has-focus-visible:outline-3 has-focus-visible:ring-info`},{color:`warning`,multiple:!0,variant:[`outline`,`subtle`],class:`has-focus-visible:outline-3 has-focus-visible:ring-warning`},{color:`error`,multiple:!0,variant:[`outline`,`subtle`],class:`has-focus-visible:outline-3 has-focus-visible:ring-error`},{color:`neutral`,multiple:!0,variant:[`outline`,`subtle`],class:`has-focus-visible:outline-3 has-focus-visible:ring-inverted`},{color:`primary`,variant:[`outline`,`subtle`],class:`outline-primary/25 focus-visible:outline-3 focus-visible:ring-primary`},{color:`secondary`,variant:[`outline`,`subtle`],class:`outline-secondary/25 focus-visible:outline-3 focus-visible:ring-secondary`},{color:`success`,variant:[`outline`,`subtle`],class:`outline-success/25 focus-visible:outline-3 focus-visible:ring-success`},{color:`info`,variant:[`outline`,`subtle`],class:`outline-info/25 focus-visible:outline-3 focus-visible:ring-info`},{color:`warning`,variant:[`outline`,`subtle`],class:`outline-warning/25 focus-visible:outline-3 focus-visible:ring-warning`},{color:`error`,variant:[`outline`,`subtle`],class:`outline-error/25 focus-visible:outline-3 focus-visible:ring-error`},{color:`primary`,variant:[`soft`,`ghost`],class:`outline-primary/25 focus-visible:outline-3`},{color:`secondary`,variant:[`soft`,`ghost`],class:`outline-secondary/25 focus-visible:outline-3`},{color:`success`,variant:[`soft`,`ghost`],class:`outline-success/25 focus-visible:outline-3`},{color:`info`,variant:[`soft`,`ghost`],class:`outline-info/25 focus-visible:outline-3`},{color:`warning`,variant:[`soft`,`ghost`],class:`outline-warning/25 focus-visible:outline-3`},{color:`error`,variant:[`soft`,`ghost`],class:`outline-error/25 focus-visible:outline-3`},{color:`primary`,highlight:!0,class:`ring ring-inset ring-primary`},{color:`secondary`,highlight:!0,class:`ring ring-inset ring-secondary`},{color:`success`,highlight:!0,class:`ring ring-inset ring-success`},{color:`info`,highlight:!0,class:`ring ring-inset ring-info`},{color:`warning`,highlight:!0,class:`ring ring-inset ring-warning`},{color:`error`,highlight:!0,class:`ring ring-inset ring-error`},{color:`neutral`,variant:[`outline`,`subtle`],class:`outline-inverted/25 focus-visible:outline-3 focus-visible:ring-inverted`},{color:`neutral`,variant:[`soft`,`ghost`],class:`outline-inverted/25 focus-visible:outline-3`},{color:`neutral`,highlight:!0,class:`ring ring-inset ring-inverted`},{leading:!0,size:`xs`,class:`ps-7`},{leading:!0,size:`sm`,class:`ps-8`},{leading:!0,size:`md`,class:`ps-9`},{leading:!0,size:`lg`,class:`ps-10`},{leading:!0,size:`xl`,class:`ps-11`},{trailing:!0,size:`xs`,class:`pe-7`},{trailing:!0,size:`sm`,class:`pe-8`},{trailing:!0,size:`md`,class:`pe-9`},{trailing:!0,size:`lg`,class:`pe-10`},{trailing:!0,size:`xl`,class:`pe-11`},{loading:!0,leading:!0,class:{leadingIcon:`animate-spin`}},{loading:!0,leading:!1,trailing:!0,class:{trailingIcon:`animate-spin`}},{fixed:!1,size:`xs`,class:`md:text-xs`},{fixed:!1,size:`sm`,class:`md:text-xs`},{fixed:!1,size:`md`,class:`md:text-sm`},{fixed:!1,size:`lg`,class:`md:text-sm`}],defaultVariants:{size:`md`,color:`primary`,variant:`outline`}},ze=Object.assign({inheritAttrs:!1},{__name:`InputMenu`,props:R({as:{type:null,required:!1},id:{type:String,required:!1},type:{type:null,required:!1,default:`text`},placeholder:{type:String,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},required:{type:Boolean,required:!1},autofocus:{type:Boolean,required:!1},autofocusDelay:{type:Number,required:!1,default:0},trailingIcon:{type:null,required:!1},selectedIcon:{type:null,required:!1},deleteIcon:{type:null,required:!1},clear:{type:[Boolean,Object],required:!1},clearIcon:{type:null,required:!1},content:{type:Object,required:!1},arrow:{type:[Boolean,Object],required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},virtualize:{type:[Boolean,Object],required:!1,default:!1},valueKey:{type:null,required:!1},labelKey:{type:null,required:!1,default:`label`},descriptionKey:{type:null,required:!1,default:`description`},items:{type:null,required:!1},defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1},modelModifiers:{type:null,required:!1},multiple:{type:Boolean,required:!1},highlight:{type:Boolean,required:!1},fixed:{type:Boolean,required:!1},mode:{type:String,required:!1,default:`combobox`},createItem:{type:[Boolean,String,Object],required:!1},filterFields:{type:Array,required:!1},ignoreFilter:{type:Boolean,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},open:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},name:{type:String,required:!1},resetSearchTermOnBlur:{type:Boolean,required:!1,default:!0},resetSearchTermOnSelect:{type:Boolean,required:!1,default:!0},resetModelValueOnClear:{type:Boolean,required:!1,default:!0},highlightOnHover:{type:Boolean,required:!1},openOnClick:{type:Boolean,required:!1},openOnFocus:{type:Boolean,required:!1},by:{type:[String,Function],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},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1}},{searchTerm:{type:String,default:``},searchTermModifiers:{}}),emits:R([`change`,`blur`,`focus`,`create`,`clear`,`highlight`,`remove-tag`,`update:modelValue`,`update:open`],[`update:searchTerm`]),setup(e,{expose:t,emit:n}){let r=e,i=n,c=d(),g=ae(`inputMenu`,r),y=ie(e,`searchTerm`,{type:String,default:``}),{t:b}=re(),S=xe(),{filterGroups:C}=a(),j=W(()=>g.mode===`autocomplete`),M=m(g,`as`,`modelValue`,`defaultValue`,`open`,`defaultOpen`,`required`,`multiple`,`resetSearchTermOnBlur`,`resetSearchTermOnSelect`,`resetModelValueOnClear`,`highlightOnHover`,`openOnClick`,`openOnFocus`,`by`),L=oe(M,`multiple`,`resetSearchTermOnSelect`,`resetModelValueOnClear`,`by`),R=Te(W(()=>j.value?L:M),i),G=W(()=>j.value?o:s),K=ne(),De=W(()=>g.multiple&&!j.value?K[`data-slot`]??`base`:`base`),Ae=we(h(()=>g.portal)),je=h(()=>ye(g.content,{side:`bottom`,sideOffset:8,collisionPadding:8,position:`popper`})),Fe=h(()=>ye(g.arrow,{rounded:!0})),Ie=W(()=>typeof g.clear==`object`?g.clear:{}),ze=h(()=>g.virtualize?ye(typeof g.virtualize==`boolean`?{}:g.virtualize,{estimateSize:Le(Y.value,at.value??`md`,g.descriptionKey,!!c[`item-description`])}):!1),{emitFormBlur:Be,emitFormFocus:Ve,emitFormChange:He,emitFormInput:Ue,size:We,color:Ge,id:Ke,name:qe,highlight:Je,disabled:Ye,ariaAttrs:Xe}=be(r),{orientation:Ze,size:Qe}=he(r),{isLeading:$e,isTrailing:et,leadingIconName:tt,trailingIconName:nt}=pe(W(()=>({icon:g.icon,leading:g.leading,leadingIcon:g.leadingIcon,trailing:g.trailing,trailingIcon:g.trailingIcon??S.ui.icons.chevronDown,loading:g.loading,loadingIcon:g.loadingIcon}))),rt=W(()=>Ge.value??g.color),it=W(()=>Je.value??g.highlight),at=W(()=>Qe.value??We.value??g.size),ot=W(()=>Ye.value??g.disabled),[st,q]=ge(),[ct,lt]=ge({props:{item:{type:[Object,String,Number,Boolean],required:!0},index:{type:Number,required:!1}}}),J=W(()=>de({extend:Re,...S.ui?.inputMenu||{}})({color:rt.value,variant:g.variant,size:at.value,loading:g.loading,highlight:it.value,fixed:g.fixed,leading:$e.value||!!g.avatar||!!c.leading,trailing:et.value||!!c.trailing,multiple:g.multiple,fieldGroup:Ze.value,virtualize:!!g.virtualize})),ut=W(()=>ft.value.flatMap(e=>e));function dt(e){return le(ut.value,e,{labelKey:g.labelKey,valueKey:g.valueKey,by:g.by})??``}let ft=W(()=>g.items?.length?T(g.items)?g.items:[g.items]:[]),pt=W(()=>{if(g.ignoreFilter||!y.value)return ft.value;let e=Array.isArray(g.filterFields)?g.filterFields:[g.labelKey];return C(ft.value,y.value,{fields:e,isStructural:e=>$(e)&&!!e.type&&[`label`,`separator`].includes(e.type)})}),Y=W(()=>pt.value.flatMap(e=>e)),X=W(()=>{if(!g.createItem||!y.value)return!1;let e=g.valueKey?{[g.valueKey]:y.value}:y.value;return typeof g.createItem==`object`&&g.createItem.when===`always`||g.createItem===`always`?!Y.value.find(t=>ce(t,e,g.by??g.valueKey)):!Y.value.length}),Z=W(()=>typeof g.createItem==`object`?g.createItem.position:`bottom`),Q=se(`inputRef`);function mt(){g.autofocus&&Q.value?.$el?.focus()}let ht;fe(()=>{N(()=>{j.value?y.value=String(g.modelValue??g.defaultValue??``):y.value=``}),ht=setTimeout(()=>{mt()},g.autofocusDelay)}),me(()=>clearTimeout(ht)),v(()=>g.modelValue,e=>{j.value&&(y.value=String(e??``))});function gt(e){if(ee(g.modelValue)===e)return;g.modelModifiers?.trim&&(typeof e==`string`||e==null)&&(e=e?.trim()??null),g.modelModifiers?.number&&(e=l(e)),g.modelModifiers?.nullable&&(e??=null),g.modelModifiers?.optional&&!g.modelModifiers?.nullable&&e!==null&&(e??=void 0);let t=new Event(`change`,{target:{value:e}});i(`change`,t),He(),Ue(),j.value?y.value=String(e??``):g.resetSearchTermOnSelect&&(y.value=``)}function _t(e){j.value||(y.value=e)}function vt(e){i(`blur`,e),Be()}function yt(e){i(`focus`,e),Ve()}let bt=Ee(!1),xt;me(()=>clearTimeout(xt));function St(e){if(bt.value=e,e){let e=new FocusEvent(`focus`);i(`focus`,e),Ve(),clearTimeout(xt)}else{let e=new FocusEvent(`blur`);i(`blur`,e),Be(),!j.value&&g.resetSearchTermOnBlur&&(xt=setTimeout(()=>{y.value=``},100))}}function Ct(e,t){if(g.multiple){let n=t.filter(t=>!Se(t,e));i(`update:modelValue`,n),i(`remove-tag`,e),gt(n)}}function wt(e){e.preventDefault(),e.stopPropagation(),i(`create`,y.value)}function Tt(e,t){if($(t)){if(t.disabled){e.preventDefault();return}t.onSelect?.(e)}}function $(e){return typeof e==`object`&&!!e}function Et(e){return g.multiple&&Array.isArray(e)?e.length===0:e==null||e===``}function Dt(){i(`clear`)}let Ot=se(`viewportRef`),kt=se(`comboboxRootRef`);return v(()=>g.items,async()=>{bt.value&&g.createItem&&(await N(),kt.value?.highlightFirstItem?.())},{flush:`post`}),t({inputRef:h(()=>Q.value?.$el),viewportRef:h(()=>Ot.value)}),(e,t)=>(k(),f(I,null,[u(P(st),null,{default:O(()=>[u(P(G).Item,{"data-slot":`item`,class:w(J.value.item({class:P(g).ui?.item})),value:y.value,onSelect:wt},{default:O(()=>[A(`span`,{"data-slot":`itemLabel`,class:w(J.value.itemLabel({class:P(g).ui?.itemLabel}))},[V(e.$slots,`create-item-label`,{item:y.value},()=>[F(x(P(b)(`inputMenu.create`,{label:y.value})),1)])],2)]),_:3},8,[`class`,`value`])]),_:3}),u(P(ct),null,{default:O(({item:t,index:n})=>[$(t)&&t.type===`label`?(k(),H(P(G).Label,{key:0,"data-slot":`label`,class:w(J.value.label({class:[P(g).ui?.label,t.ui?.label,t.class]}))},{default:O(()=>[F(x(P(D)(t,P(g).labelKey)),1)]),_:2},1032,[`class`])):$(t)&&t.type===`separator`?(k(),H(P(G).Separator,{key:1,"data-slot":`separator`,class:w(J.value.separator({class:[P(g).ui?.separator,t.ui?.separator,t.class]}))},null,8,[`class`])):(k(),H(P(G).Item,{key:2,"data-slot":`item`,class:w(J.value.item({class:[P(g).ui?.item,$(t)&&t.ui?.item,$(t)&&t.class]})),disabled:$(t)&&t.disabled,value:P(g).valueKey&&$(t)?P(D)(t,P(g).valueKey):t,onSelect:e=>Tt(e,t)},{default:O(()=>[V(e.$slots,`item`,{item:t,index:n,ui:J.value},()=>[V(e.$slots,`item-leading`,{item:t,index:n,ui:J.value},()=>[$(t)&&t.icon?(k(),H(U,{key:0,name:t.icon,"data-slot":`itemLeadingIcon`,class:w(J.value.itemLeadingIcon({class:[P(g).ui?.itemLeadingIcon,t.ui?.itemLeadingIcon]}))},null,8,[`name`,`class`])):$(t)&&t.avatar?(k(),H(ue,B({key:1,size:t.ui?.itemLeadingAvatarSize||P(g).ui?.itemLeadingAvatarSize||J.value.itemLeadingAvatarSize()},t.avatar,{"data-slot":`itemLeadingAvatar`,class:J.value.itemLeadingAvatar({class:[P(g).ui?.itemLeadingAvatar,t.ui?.itemLeadingAvatar]})}),null,16,[`size`,`class`])):$(t)&&t.chip?(k(),H(Ce,B({key:2,size:t.ui?.itemLeadingChipSize||P(g).ui?.itemLeadingChipSize||J.value.itemLeadingChipSize(),inset:``,standalone:``},t.chip,{"data-slot":`itemLeadingChip`,class:J.value.itemLeadingChip({class:[P(g).ui?.itemLeadingChip,t.ui?.itemLeadingChip]})}),null,16,[`size`,`class`])):E(``,!0)]),A(`span`,{"data-slot":`itemWrapper`,class:w(J.value.itemWrapper({class:[P(g).ui?.itemWrapper,$(t)&&t.ui?.itemWrapper]}))},[A(`span`,{"data-slot":`itemLabel`,class:w(J.value.itemLabel({class:[P(g).ui?.itemLabel,$(t)&&t.ui?.itemLabel]}))},[V(e.$slots,`item-label`,{item:t,index:n},()=>[F(x($(t)?P(D)(t,P(g).labelKey):t),1)])],2),$(t)&&(P(D)(t,P(g).descriptionKey)||c[`item-description`])?(k(),f(`span`,{key:0,"data-slot":`itemDescription`,class:w(J.value.itemDescription({class:[P(g).ui?.itemDescription,$(t)&&t.ui?.itemDescription]}))},[V(e.$slots,`item-description`,{item:t,index:n},()=>[F(x(P(D)(t,P(g).descriptionKey)),1)])],2)):E(``,!0)],2),A(`span`,{"data-slot":`itemTrailing`,class:w(J.value.itemTrailing({class:[P(g).ui?.itemTrailing,$(t)&&t.ui?.itemTrailing]}))},[V(e.$slots,`item-trailing`,{item:t,index:n,ui:J.value}),j.value?E(``,!0):(k(),H(P(G).ItemIndicator,{key:0,"as-child":``},{default:O(()=>[u(U,{name:P(g).selectedIcon||P(S).ui.icons.check,"data-slot":`itemTrailingIcon`,class:w(J.value.itemTrailingIcon({class:[P(g).ui?.itemTrailingIcon,$(t)&&t.ui?.itemTrailingIcon]}))},null,8,[`name`,`class`])]),_:2},1024))],2)])]),_:2},1032,[`class`,`disabled`,`value`,`onSelect`]))]),_:3}),u(P(G).Root,B({ref_key:`comboboxRootRef`,ref:kt},P(R),{name:P(qe),disabled:ot.value,"data-slot":e.$attrs[`data-slot`]??`root`,class:J.value.root({class:[P(g).ui?.root,P(g).class]}),"as-child":!!P(g).multiple&&!j.value,"ignore-filter":``,"onUpdate:modelValue":gt,"onUpdate:open":St}),{default:O(({modelValue:n,open:r})=>[u(P(G).Anchor,{"as-child":!P(g).multiple,"data-slot":De.value,class:w(J.value.base({class:P(g).ui?.base}))},{default:O(()=>[P(g).multiple&&!j.value?(k(),H(P(Oe),{key:0,"model-value":n,disabled:ot.value,required:P(g).required,delimiter:``,"as-child":``,onBlur:vt,onFocus:yt,onRemoveTag:e=>Ct(e,n)},{default:O(({modelValue:n})=>[(k(!0),f(I,null,p(n,(t,n)=>(k(),H(P(Me),{key:n,value:t,"data-slot":`tagsItem`,class:w(J.value.tagsItem({class:[P(g).ui?.tagsItem,$(t)&&t.ui?.tagsItem]}))},{default:O(()=>[u(P(Pe),{"data-slot":`tagsItemText`,class:w(J.value.tagsItemText({class:[P(g).ui?.tagsItemText,$(t)&&t.ui?.tagsItemText]}))},{default:O(()=>[V(e.$slots,`tags-item-text`,{item:t,index:n},()=>[F(x(dt(t)),1)])]),_:2},1032,[`class`]),u(P(Ne),{"data-slot":`tagsItemDelete`,class:w(J.value.tagsItemDelete({class:[P(g).ui?.tagsItemDelete,$(t)&&t.ui?.tagsItemDelete]})),disabled:ot.value},{default:O(()=>[V(e.$slots,`tags-item-delete`,{item:t,index:n,ui:J.value},()=>[u(U,{name:P(g).deleteIcon||P(S).ui.icons.close,"data-slot":`tagsItemDeleteIcon`,class:w(J.value.tagsItemDeleteIcon({class:[P(g).ui?.tagsItemDeleteIcon,$(t)&&t.ui?.tagsItemDeleteIcon]}))},null,8,[`name`,`class`])])]),_:2},1032,[`class`,`disabled`])]),_:2},1032,[`value`,`class`]))),128)),u(P(G).Input,{modelValue:y.value,"onUpdate:modelValue":t[1]||=e=>y.value=e,"as-child":``},{default:O(()=>[u(P(ke),B({id:P(Ke),ref_key:`inputRef`,ref:Q},{...e.$attrs,...P(Xe)},{placeholder:P(g).placeholder,"data-slot":`tagsInput`,class:J.value.tagsInput({class:P(g).ui?.tagsInput}),onChange:t[0]||=z(()=>{},[`stop`])}),null,16,[`id`,`placeholder`,`class`])]),_:1},8,[`modelValue`])]),_:3},8,[`model-value`,`disabled`,`required`,`onRemoveTag`])):(k(),H(P(G).Input,B({key:1,id:P(Ke),ref_key:`inputRef`,ref:Q},{...j.value?{}:{displayValue:dt},...e.$attrs,...P(Xe)},{"data-slot":P(g).multiple?void 0:`base`,type:P(g).type,placeholder:P(g).placeholder,required:P(g).required,onBlur:vt,onFocus:yt,onChange:t[2]||=z(()=>{},[`stop`]),"onUpdate:modelValue":_t}),null,16,[`id`,`data-slot`,`type`,`placeholder`,`required`])),P($e)||P(g).avatar||c.leading?(k(),f(`span`,{key:2,"data-slot":`leading`,class:w(J.value.leading({class:P(g).ui?.leading}))},[V(e.$slots,`leading`,{modelValue:n,open:r,ui:J.value},()=>[P($e)&&P(tt)?(k(),H(U,{key:0,name:P(tt),"data-slot":`leadingIcon`,class:w(J.value.leadingIcon({class:P(g).ui?.leadingIcon}))},null,8,[`name`,`class`])):P(g).avatar?(k(),H(ue,B({key:1,size:P(g).ui?.itemLeadingAvatarSize||J.value.itemLeadingAvatarSize()},P(g).avatar,{"data-slot":`itemLeadingAvatar`,class:J.value.itemLeadingAvatar({class:P(g).ui?.itemLeadingAvatar})}),null,16,[`size`,`class`])):E(``,!0)])],2)):E(``,!0),P(et)||c.trailing||P(g).clear?(k(),H(P(G).Trigger,{key:3,"data-slot":`trailing`,class:w(J.value.trailing({class:P(g).ui?.trailing}))},{default:O(()=>[V(e.$slots,`trailing`,{modelValue:n,open:r,ui:J.value},()=>[P(g).clear&&!Et(n)?(k(),H(P(G).Cancel,{key:0,"as-child":``},{default:O(()=>[u(_e,B({as:`span`,icon:P(g).clearIcon||P(S).ui.icons.close,size:at.value,variant:`link`,color:`neutral`,tabindex:`-1`},Ie.value,{"data-slot":`trailingClear`,class:J.value.trailingClear({class:P(g).ui?.trailingClear}),onClick:z(Dt,[`stop`])}),null,16,[`icon`,`size`,`class`])]),_:1})):P(nt)?(k(),H(U,{key:1,name:P(nt),"data-slot":`trailingIcon`,class:w(J.value.trailingIcon({class:P(g).ui?.trailingIcon}))},null,8,[`name`,`class`])):E(``,!0)])]),_:2},1032,[`class`])):E(``,!0)]),_:2},1032,[`as-child`,`data-slot`,`class`]),u(P(G).Portal,_(te(P(Ae))),{default:O(()=>[u(P(ve),null,{default:O(()=>[u(P(G).Content,B({"data-slot":`content`,class:J.value.content({class:P(g).ui?.content})},je.value,{onFocusOutside:t[3]||=z(()=>{},[`prevent`])}),{default:O(()=>[V(e.$slots,`content-top`),u(P(G).Empty,{"data-slot":`empty`,class:w(J.value.empty({class:P(g).ui?.empty}))},{default:O(()=>[V(e.$slots,`empty`,{searchTerm:y.value},()=>[F(x(y.value?P(b)(`inputMenu.noMatch`,{searchTerm:y.value}):P(b)(`inputMenu.noData`)),1)])]),_:3},8,[`class`]),A(`div`,{ref_key:`viewportRef`,ref:Ot,role:`presentation`,"data-slot":`viewport`,class:w(J.value.viewport({class:P(g).ui?.viewport}))},[P(g).virtualize?(k(),f(I,{key:0},[X.value&&Z.value===`top`?(k(),H(P(q),{key:0})):E(``,!0),u(P(G).Virtualizer,B({options:Y.value,"text-content":e=>$(e)?P(D)(e,P(g).labelKey):String(e)},ze.value),{default:O(({option:e,virtualItem:t})=>[u(P(lt),{item:e,index:t.index},null,8,[`item`,`index`])]),_:1},16,[`options`,`text-content`]),X.value&&Z.value===`bottom`?(k(),H(P(q),{key:1})):E(``,!0)],64)):(k(),f(I,{key:1},[X.value&&Z.value===`top`?(k(),H(P(G).Group,{key:0,"data-slot":`group`,class:w(J.value.group({class:P(g).ui?.group}))},{default:O(()=>[u(P(q))]),_:1},8,[`class`])):E(``,!0),(k(!0),f(I,null,p(pt.value,(e,t)=>(k(),H(P(G).Group,{key:`group-${t}`,"data-slot":`group`,class:w(J.value.group({class:P(g).ui?.group}))},{default:O(()=>[(k(!0),f(I,null,p(e,(e,n)=>(k(),H(P(lt),{key:`group-${t}-${n}`,item:e,index:n},null,8,[`item`,`index`]))),128))]),_:2},1032,[`class`]))),128)),X.value&&Z.value===`bottom`?(k(),H(P(G).Group,{key:1,"data-slot":`group`,class:w(J.value.group({class:P(g).ui?.group}))},{default:O(()=>[u(P(q))]),_:1},8,[`class`])):E(``,!0)],64))],2),V(e.$slots,`content-bottom`),P(g).arrow?(k(),H(P(G).Arrow,B({key:0},Fe.value,{"data-slot":`arrow`,class:J.value.arrow({class:P(g).ui?.arrow})}),null,16,[`class`])):E(``,!0)]),_:3},16,[`class`])]),_:3})]),_:3},16)]),_:3},16,[`name`,`disabled`,`data-slot`,`class`,`as-child`])],64))}});export{ze as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./AppShell-CSXDCV4x.js";import{An as t,Cn as n,Cr as r,Li as i,Mn as a,Pi as o,Sn as s,Tr as c,Xr as l,_r as u,bn as d,ji as f,kn as p,ln as m,o as h,xn as g,yn as _}from"./browser-B6T5hjfR.js";import{a as v,h as y,l as b,t as x}from"./CostChart-DsuPS2g7.js";var S=e=>Math.round(e).toLocaleString(`en-US`);function C(e){let t=(Number.isFinite(e)?e:0)/1e3;return t<120?`${t.toFixed(1)}s`:`${Math.round(t/60)}m`}var w=e=>`${Math.round((Number.isFinite(e)?e:0)*100)}%`;function T(e,t){return`/metrics?days=${e}${t===void 0?``:`&agent=${encodeURIComponent(t)}`}`}function E(e){let t=e.tiles;return[{label:`Runs`,value:S(t.runs),sub:`${e.range.days}d window, UTC days`},{label:`Failed`,value:S(t.failed),sub:`runs that ended failed`},{label:`Failure rate`,value:w(t.failureRate),sub:`${S(t.failed)} of ${S(t.runs)}`},{label:`p50 wall`,value:C(t.p50WallMs),sub:`median run, runs-weighted`},{label:`p95 wall`,value:C(t.p95WallMs),sub:`runs-weighted`},{label:`LLM spend`,value:y(t.usd),sub:`priced at finish`},{label:`Unpriced tokens`,value:S(t.unpricedTokens),sub:`tokens with no price row`},{label:`Turns`,value:S(t.turns),sub:`model turns in range`}]}function D(e){let t=[];for(let n of e)for(let e of Object.keys(n.byStatus))t.includes(e)||t.push(e);return t}var O=960,k=260,A={t:12,r:12,b:30,l:48},j=e=>e<=16?1:Math.ceil(e/16);function M(e,t){let n=O-A.l-A.r,r=k-A.t-A.b,i=Math.max(1,...e.map(e=>e.runs))*1.08,a=n/Math.max(1,e.length),o=Math.min(10,a*.28),s=e=>A.t+r-e/i*r,c=Array.from({length:5},(e,t)=>{let n=i/4*t;return{y:Number(s(n).toFixed(1)),label:S(n)}}),l=[],u=[],d=[];return e.forEach((n,i)=>{let c=0,f=A.l+i*a+o/2,p=a-o,m=t.map(e=>({series:e,usd:n.byStatus[e]??0})).filter(e=>e.usd>0).sort((e,t)=>t.usd-e.usd);u.push({x:Number((A.l+i*a).toFixed(1)),y:A.t,width:Number(a.toFixed(1)),height:r,title:`${n.day} — ${S(n.runs)} runs${m.map(e=>` · ${e.series} ${S(e.usd)}`).join(``)}`,tip:{date:n.day,label:n.day,total:n.runs,partial:!1,rows:m.map(e=>({...e,estimated:!1}))}}),t.forEach((e,t)=>{let r=n.byStatus[e]??0;if(r<=0)return;let i=s(c+r),a=s(c);l.push({seriesIndex:t,x:Number(f.toFixed(1)),y:Number(i.toFixed(1)),width:Number(p.toFixed(1)),height:Number(Math.max(0,a-i-2).toFixed(1))}),c+=r}),i%j(e.length)===0&&d.push({x:Number((f+p/2).toFixed(1)),label:n.day.slice(5)})}),{width:O,height:k,gridLines:c,segments:l,dayHovers:u,dayLabels:d,axisY:Number(s(0).toFixed(1)),marginLeft:A.l,marginRight:A.r}}function N(e,t,n,r=1e-9){let i=O-A.l-A.r,a=k-A.t-A.b,o=t.flatMap(e=>e.values.filter(e=>e!==null)),s=Math.max(r,...o)*1.08,c=i/Math.max(1,e.length),l=e=>A.l+e*c+c/2,u=e=>A.t+a-e/s*a,d=Array.from({length:5},(e,t)=>{let r=s/4*t;return{y:Number(u(r).toFixed(1)),label:n(r)}}),f=e.map((e,t)=>({x:Number(l(t).toFixed(1)),label:e.slice(5),i:t})).filter(({i:t})=>t%j(e.length)===0).map(({x:e,label:t})=>({x:e,label:t})),p=t.map((t,r)=>{let i=[],a=[],o=[];return t.values.forEach((r,s)=>{if(r===null){o.length>=2&&i.push(o.join(` `)),o=[];return}let c=Number(l(s).toFixed(1)),d=Number(u(r).toFixed(1));o.push(`${c},${d}`),a.push({x:c,y:d,title:`${e[s]} — ${t.name} ${n(r)}`})}),o.length>=2&&i.push(o.join(` `)),{name:t.name,seriesIndex:r,segments:i,dots:a}});return{width:O,height:k,gridLines:d,dayLabels:f,axisY:Number(u(0).toFixed(1)),marginLeft:A.l,marginRight:A.r,lines:p}}function P(e){return N(e.map(e=>e.day),[{name:`failure rate`,values:e.map(e=>e.runs>0?(e.byStatus.failed??0)/e.runs:null)}],w,.01)}function ee(e,t,n){let r=e.map(e=>e.day),i=new Map(n.map(e=>[`${e.day}\n${e.agent}`,e.p50WallMs]));return N(r,t.map(e=>({name:e.agent,values:r.map(t=>i.get(`${t}\n${e.agent}`)??null)})),C)}function te(e){return[`Each finished run is one point, bucketed at ${e.bucket} (UTC days).`,`Dollars are priced ${e.pricing}, through the same price table the costs page uses.`,`Each run is counted ${e.completeness}, however many times its record is written.`,`The dataset keeps ${e.retentionDays} days; sampled rows are re-weighted in every figure.`]}var F=[`stroke-[#4478b8] dark:stroke-[#7aa7e0]`,`stroke-[#c8823b] dark:stroke-[#e0a95a]`,`stroke-[#4c8c57] dark:stroke-[#6fae7a]`,`stroke-[#b8963e] dark:stroke-[#d4b45a]`,`stroke-[#b0568c] dark:stroke-[#d489b8]`,`stroke-[#6b7bcc] dark:stroke-[#98a5e6]`,`stroke-[#d05252] dark:stroke-[#e07a74]`,`stroke-[#3e8e96] dark:stroke-[#6fb9c0]`],I=[`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]`],L={class:`overflow-x-auto`},R=[`viewBox`,`aria-label`],z=[`x1`,`x2`,`y1`,`y2`],B=[`x`,`y`],V=[`points`],H=[`cx`,`cy`],U=[`x`,`y`],W=[`x1`,`x2`,`y1`,`y2`],G=a({__name:`TrendLineChart`,props:{model:{},label:{}},setup(e){return(t,a)=>(u(),n(`div`,L,[(u(),n(`svg`,{class:`block h-auto w-full font-mono`,viewBox:`0 0 ${e.model.width} ${e.model.height}`,role:`img`,"aria-label":e.label},[(u(!0),n(m,null,r(e.model.gridLines,(t,r)=>(u(),n(m,{key:`g${r}`},[d(`line`,{class:`stroke-(--ui-border-muted)`,x1:e.model.marginLeft,x2:e.model.width-e.model.marginRight,y1:t.y,y2:t.y},null,8,z),d(`text`,{class:`fill-(--ui-text-dimmed) text-[11px] tabular-nums`,x:e.model.marginLeft-8,y:t.y+4,"text-anchor":`end`},i(t.label),9,B)],64))),128)),(u(!0),n(m,null,r(e.model.lines,e=>(u(),n(m,{key:e.name},[(u(!0),n(m,null,r(e.segments,(t,r)=>(u(),n(`polyline`,{key:`${e.name}-${r}`,class:o([`trend-line fill-none`,f(F)[e.seriesIndex%f(F).length]]),"stroke-width":`2`,"stroke-linejoin":`round`,"stroke-linecap":`round`,points:t},null,10,V))),128)),(u(!0),n(m,null,r(e.dots,(t,r)=>(u(),n(`circle`,{key:`${e.name}-d${r}`,class:o([`trend-dot`,f(I)[e.seriesIndex%f(I).length]]),cx:t.x,cy:t.y,r:`2.5`},[d(`title`,null,i(t.title),1)],10,H))),128))],64))),128)),(u(!0),n(m,null,r(e.model.dayLabels,(t,r)=>(u(),n(`text`,{key:`d${r}`,class:`fill-(--ui-text-dimmed) text-[11px]`,x:t.x,y:e.model.height-10,"text-anchor":`middle`},i(t.label),9,U))),128)),d(`line`,{class:`stroke-(--ui-border)`,x1:e.model.marginLeft,x2:e.model.width-e.model.marginRight,y1:e.model.axisY,y2:e.model.axisY},null,8,W)],8,R))]))}}),K={class:`mb-4 flex flex-wrap items-center gap-x-4 gap-y-2`},q={class:`flex items-center gap-1`,"aria-label":`Range`},J={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`},Y={key:0,class:`flex items-center gap-1`,"aria-label":`Agent`},X={key:0,class:`rounded-md bg-accented px-2.5 py-1 text-xs font-medium text-highlighted`,"aria-current":`page`},Z={key:0,class:`rounded-md bg-accented px-2.5 py-1 text-xs font-medium text-highlighted`,"aria-current":`page`},Q={class:`font-mono text-sm tabular-nums text-muted`,"data-metrics-range":``},$={class:`mb-5 grid grid-cols-[repeat(auto-fit,minmax(190px,1fr))] gap-3`,"data-metrics-tiles":``},ne={class:`font-mono text-[0.6875rem] font-medium uppercase tracking-widest text-dimmed`},re={class:`font-mono text-2xl font-medium tabular-nums`},ie={class:`text-xs text-muted`},ae={class:`mb-5 grid gap-3 rounded-lg border border-default bg-elevated px-5 py-4`},oe={class:`flex flex-wrap items-baseline justify-between gap-x-4 gap-y-2`},se={class:`legend flex flex-wrap gap-x-4 gap-y-1.5 text-xs text-muted`},ce={class:`mb-5 grid gap-3 rounded-lg border border-default bg-elevated px-5 py-4`},le={class:`mb-5 grid gap-3 rounded-lg border border-default bg-elevated px-5 py-4`},ue={class:`flex flex-wrap items-baseline justify-between gap-x-4 gap-y-2`},de={class:`legend flex flex-wrap gap-x-4 gap-y-1.5 text-xs text-muted`},fe={class:`mb-5 grid gap-3 rounded-lg border border-default bg-elevated px-5 py-4`},pe={class:`overflow-x-auto`},me={class:`data w-full min-w-[38rem] border-collapse whitespace-nowrap font-mono text-[0.8125rem] tabular-nums`,"data-metrics-agents":``},he={class:`border-b border-muted px-2.5 py-1.5`},ge={class:`border-b border-muted px-2.5 py-1.5 text-right`},_e={class:`border-b border-muted px-2.5 py-1.5 text-right`},ve={class:`border-b border-muted px-2.5 py-1.5 text-right`},ye={class:`border-b border-muted px-2.5 py-1.5 text-right`},be={class:`border-b border-muted px-2.5 py-1.5 text-right`},xe={class:`border-b border-muted px-2.5 py-1.5 text-right`},Se={class:`border-b border-muted px-2.5 py-1.5 text-right`},Ce={class:`border-b border-muted px-2.5 py-1.5 text-right`},we={key:0},Te={class:`border-t border-default pt-3.5 text-xs text-dimmed`,"data-metrics-footer":``},Ee=a({__name:`MetricsPage`,setup(a){let O=h(`metrics`),k=_(()=>O?.report??null),A=_(()=>k.value?.range??null),j=_(()=>k.value?E(k.value):[]),N=_(()=>k.value?D(k.value.byDay):[]),F=_(()=>k.value?M(k.value.byDay,N.value):null),I=_(()=>k.value?P(k.value.byDay):null),L=_(()=>k.value?ee(k.value.byDay,k.value.byAgent,k.value.p50ByDayAgent):null),R=_(()=>A.value?te(A.value):[]),z=[7,30,90],B=_(()=>k.value?k.value.byAgent.map(e=>e.agent):[]),V=_(()=>A.value?.agent),H=e=>new Date(e).toISOString().slice(0,10);return(a,h)=>{let _=c(`RouterLink`);return k.value&&A.value?(u(),g(e,{key:0,title:`Run metrics`,nav:`metrics`},{default:l(()=>[d(`div`,K,[d(`nav`,q,[(u(),n(m,null,r(z,e=>(u(),n(m,{key:e},[e===A.value.days?(u(),n(`span`,J,i(e)+`d`,1)):(u(),g(_,{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`,to:f(T)(e,V.value)},{default:l(()=>[p(i(e)+`d`,1)]),_:2},1032,[`to`]))],64))),64))]),B.value.length>0?(u(),n(`nav`,Y,[V.value===void 0?(u(),n(`span`,X,`all agents`)):(u(),g(_,{key:1,class:`rounded-md px-2.5 py-1 text-xs text-muted no-underline hover:bg-elevated hover:text-highlighted`,to:f(T)(A.value.days)},{default:l(()=>[...h[0]||=[p(`all agents`,-1)]]),_:1},8,[`to`])),(u(!0),n(m,null,r(B.value,e=>(u(),n(m,{key:e},[e===V.value?(u(),n(`span`,Z,i(e),1)):(u(),g(_,{key:1,class:`rounded-md px-2.5 py-1 text-xs text-muted no-underline hover:bg-elevated hover:text-highlighted`,to:f(T)(A.value.days,e)},{default:l(()=>[p(i(e),1)]),_:2},1032,[`to`]))],64))),128))])):s(``,!0),d(`p`,Q,i(f(b)(H(A.value.sinceMs)))+` → `+i(f(b)(H(A.value.untilMs-1)))+` · `+i(A.value.days)+`d · dataset `+i(k.value.dataset),1)]),d(`section`,$,[(u(!0),n(m,null,r(j.value,e=>(u(),n(`div`,{key:e.label,class:`grid gap-0.5 rounded-lg border border-default bg-elevated px-4 py-3.5`},[d(`span`,ne,i(e.label),1),d(`span`,re,i(e.value),1),d(`span`,ie,i(e.sub),1)]))),128))]),d(`section`,ae,[d(`div`,oe,[h[1]||=d(`div`,null,[d(`h2`,{class:`text-[0.9375rem] font-medium`},`Runs per day`),d(`p`,{class:`text-sm text-muted`},`Stacked by status · one point per finished run, weighted for sampling`)],-1),d(`div`,se,[(u(!0),n(m,null,r(N.value,(e,t)=>(u(),n(`span`,{key:e,class:`inline-flex items-center gap-1.5`},[d(`i`,{class:o([`inline-block size-2.5 rounded-xs`,f(v)[t%f(v).length]])},null,2),p(i(e),1)]))),128))])]),F.value?(u(),g(x,{key:0,model:F.value,label:`Runs per day, stacked by status`,format:f(S)},null,8,[`model`,`format`])):s(``,!0)]),d(`section`,ce,[h[2]||=d(`div`,null,[d(`h2`,{class:`text-[0.9375rem] font-medium`},`Failure rate per day`),d(`p`,{class:`text-sm text-muted`},`Failed share of the day's runs · a day with no runs draws a gap`)],-1),I.value?(u(),g(G,{key:0,model:I.value,label:`Failure rate per day`},null,8,[`model`])):s(``,!0)]),d(`section`,le,[d(`div`,ue,[h[3]||=d(`div`,null,[d(`h2`,{class:`text-[0.9375rem] font-medium`},`Median wall per day`),d(`p`,{class:`text-sm text-muted`},`p50 wall-clock per agent, weighted for sampling`)],-1),d(`div`,de,[(u(!0),n(m,null,r(L.value?.lines??[],e=>(u(),n(`span`,{key:e.name,class:`inline-flex items-center gap-1.5`},[d(`i`,{class:o([`inline-block size-2.5 rounded-xs`,f(v)[e.seriesIndex%f(v).length]])},null,2),p(i(e.name),1)]))),128))])]),L.value?(u(),g(G,{key:0,model:L.value,label:`Median wall-clock per day per agent`},null,8,[`model`])):s(``,!0)]),d(`section`,fe,[h[6]||=d(`div`,null,[d(`h2`,{class:`text-[0.9375rem] font-medium`},`By agent`),d(`p`,{class:`text-sm text-muted`},`Largest first · the whole range's runs per agent`)],-1),d(`div`,pe,[d(`table`,me,[d(`thead`,null,[d(`tr`,null,[h[4]||=d(`th`,{class:`border-b border-muted bg-(--ui-bg-muted) px-2.5 py-1.5 text-left text-xs font-medium text-muted`},` Agent `,-1),(u(),n(m,null,r([`Runs`,`Failed`,`Failure rate`,`p50 wall`,`p95 wall`,`LLM`,`Unpriced tokens`,`Turns`],e=>d(`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`},i(e),1)),64))])]),d(`tbody`,null,[(u(!0),n(m,null,r(k.value.byAgent,e=>(u(),n(`tr`,{key:e.agent},[d(`td`,he,[t(_,{class:`no-underline hover:text-highlighted hover:underline`,to:f(T)(A.value.days,e.agent)},{default:l(()=>[p(i(e.agent),1)]),_:2},1032,[`to`])]),d(`td`,ge,i(f(S)(e.runs)),1),d(`td`,_e,i(f(S)(e.failed)),1),d(`td`,ve,i(f(w)(e.runs>0?e.failed/e.runs:0)),1),d(`td`,ye,i(f(C)(e.p50WallMs)),1),d(`td`,be,i(f(C)(e.p95WallMs)),1),d(`td`,xe,i(f(y)(e.usd)),1),d(`td`,Se,i(f(S)(e.unpricedTokens)),1),d(`td`,Ce,i(f(S)(e.turns)),1)]))),128)),k.value.byAgent.length===0?(u(),n(`tr`,we,[...h[5]||=[d(`td`,{class:`px-2.5 py-1.5 text-muted`,colspan:`9`},`No runs in this range.`,-1)]])):s(``,!0)])])]),h[7]||=d(`p`,{class:`text-xs text-muted`},[p(` Machine-readable twin: `),d(`code`,{class:`rounded bg-accented px-1 py-0.5`},`GET /metrics.json`),p(` (same Access gate); the same report is `),d(`code`,{class:`rounded bg-accented px-1 py-0.5`},`metrics trend`),p(` on every command surface. `)],-1)]),d(`footer`,Te,[(u(!0),n(m,null,r(R.value,e=>(u(),n(`p`,{key:e},i(e),1))),128))])]),_:1})):(u(),g(e,{key:1,title:`Run metrics`,nav:`metrics`},{default:l(()=>[...h[8]||=[d(`section`,{class:`mb-5 grid gap-2 rounded-lg border border-default bg-elevated px-5 py-4`},[d(`h2`,{class:`text-sm font-medium text-highlighted`},`Nothing to show`),d(`p`,{class:`text-xs text-dimmed`},`This page did not receive its report; reload to ask again.`)],-1)]]),_:1}))}}});export{Ee as default};
@@ -1 +1 @@
1
- import{L as e,t}from"./AppShell-Bmz8nzz3.js";import{An as n,Li as r,Mn as i,Xr as a,_r as o,bn as s,c,ji as l,l as u,o as d,xn as f}from"./browser-B6T5hjfR.js";import{t as p}from"./RunsTabs-DotpuCSP.js";var m={class:`notfound mx-auto my-12 max-w-xl text-center text-toned`},h={class:`why text-[0.8rem] text-muted`},g=i({__name:`NotFoundPage`,setup(e){let i=d(`runNotFound`),g=c(i?.retentionDays??null);return(e,i)=>{let c=u;return o(),f(t,{title:`Run not found`,nav:`runs`},{default:a(()=>[n(p,{current:`runs`}),s(`section`,m,[i[0]||=s(`p`,{class:`code mb-3 font-mono text-4xl font-medium tracking-wide text-dimmed`},`404`,-1),i[1]||=s(`h2`,{class:`mb-3 text-lg font-medium tracking-tight text-highlighted`},`That run isn't here.`,-1),i[2]||=s(`p`,{class:`mb-2.5 leading-relaxed`},` It may have finished and aged out, the link may be missing its token, or it never existed — this page says the same thing in every case. `,-1),s(`p`,h,r(l(g)),1),n(c,{class:`back mt-4`,color:`neutral`,variant:`outline`,to:`/runs`,label:`← All runs`})])]),_:1})}}}),_=e({default:()=>v}),v=g;export{_ as n,v as t};
1
+ import{L as e,t}from"./AppShell-CSXDCV4x.js";import{An as n,Li as r,Mn as i,Xr as a,_r as o,bn as s,c,ji as l,l as u,o as d,xn as f}from"./browser-B6T5hjfR.js";import{t as p}from"./RunsTabs-kHbbxVHx.js";var m={class:`notfound mx-auto my-12 max-w-xl text-center text-toned`},h={class:`why text-[0.8rem] text-muted`},g=i({__name:`NotFoundPage`,setup(e){let i=d(`runNotFound`),g=c(i?.retentionDays??null);return(e,i)=>{let c=u;return o(),f(t,{title:`Run not found`,nav:`runs`},{default:a(()=>[n(p,{current:`runs`}),s(`section`,m,[i[0]||=s(`p`,{class:`code mb-3 font-mono text-4xl font-medium tracking-wide text-dimmed`},`404`,-1),i[1]||=s(`h2`,{class:`mb-3 text-lg font-medium tracking-tight text-highlighted`},`That run isn't here.`,-1),i[2]||=s(`p`,{class:`mb-2.5 leading-relaxed`},` It may have finished and aged out, the link may be missing its token, or it never existed — this page says the same thing in every case. `,-1),s(`p`,h,r(l(g)),1),n(c,{class:`back mt-4`,color:`neutral`,variant:`outline`,to:`/runs`,label:`← All runs`})])]),_:1})}}}),_=e({default:()=>v}),v=g;export{_ as n,v as t};