import{d as b,c as l,a as e,i as h,v as x,A as k,t as a,b as _,q as w,F as C,k as I,y as D,r as d,j as T,o as i,n as V,u as c,h as v,_ as B}from"./index.js";import{c as N,a as S,s as j,f as z,d as E}from"./client.js";const M={class:"card mb-4"},F={class:"flex gap-3 items-center"},J=["disabled"],K={key:0,style:{color:"var(--error)","font-size":"0.8rem","margin-top":"8px"}},L={class:"compare-col__header"},O={class:"mono",style:{"font-size":"0.75rem"}},P={class:"compare-section"},R={class:"compare-meta"},q={class:"compare-section"},A={class:"json-view",style:{"max-height":"160px","overflow-y":"auto"}},U={class:"compare-section"},$={class:"section__title"},G={class:"json-view",style:{"max-height":"120px","overflow-y":"auto"}},H={key:0,class:"compare-section"},Q={class:"json-view",style:{color:"var(--error)"}},W={key:1,class:"empty-state"},X=b({__name:"CompareView",setup(Y){const u=d(""),r=d(!1),n=d(""),m=d(null);async function y(){const o=u.value.split(/[,\s]+/).map(s=>s.trim()).filter(Boolean);if(o.length<2){n.value="Enter at least 2 run IDs separated by commas.";return}r.value=!0,n.value="";try{m.value=await N.compareRuns(o)}catch(s){n.value=s.message,m.value=null}finally{r.value=!1}}const p=T(()=>{var o;return((o=m.value)==null?void 0:o.runs)||[]});function g(o){var s;return((s=o.usage)==null?void 0:s.total_tokens)??0}return(o,s)=>(i(),l("div",null,[s[8]||(s[8]=e("div",{class:"page-header"},[e("div",null,[e("h1",null,"Compare Runs"),e("div",{class:"page-header__subtitle"},"Side-by-side run comparison")])],-1)),e("div",M,[e("div",F,[h(e("input",{class:"input","onUpdate:modelValue":s[0]||(s[0]=t=>u.value=t),placeholder:"Paste run IDs separated by commas…",onKeydown:k(y,["enter"])},null,544),[[x,u.value]]),e("button",{class:"btn btn--primary",disabled:r.value,onClick:y},a(r.value?"Loading…":"Compare"),9,J)]),n.value?(i(),l("div",K,a(n.value),1)):_("",!0)]),p.value.length>0?(i(),l("div",{key:0,class:"compare-grid",style:w({gridTemplateColumns:`repeat(${p.value.length}, 1fr)`})},[(i(!0),l(C,null,I(p.value,t=>{var f;return i(),l("div",{key:t.id,class:"card compare-col"},[e("div",L,[e("span",{class:V(["badge",c(S)(t.status)])},a(t.status),3),e("span",O,a(c(j)(t.id)),1)]),e("div",P,[e("div",R,[e("div",null,[s[1]||(s[1]=e("span",{class:"label"},"Model",-1)),v(" "+a(t.model),1)]),e("div",null,[s[2]||(s[2]=e("span",{class:"label"},"Created",-1)),v(" "+a(c(z)(t.created_at)),1)]),e("div",null,[s[3]||(s[3]=e("span",{class:"label"},"Duration",-1)),v(" "+a(c(E)(t.started_at,t.completed_at||t.failed_at)),1)]),e("div",null,[s[4]||(s[4]=e("span",{class:"label"},"Tokens",-1)),v(" "+a(g(t)),1)])])]),e("div",q,[s[5]||(s[5]=e("div",{class:"section__title"},"Instructions",-1)),e("div",A,a(t.instructions||"(none)"),1)]),e("div",U,[e("div",$,"Tools ("+a(((f=t.tools)==null?void 0:f.length)??0)+")",1),e("div",G,a(JSON.stringify(t.tools||[],null,2)),1)]),t.last_error?(i(),l("div",H,[s[6]||(s[6]=e("div",{class:"section__title",style:{color:"var(--error)"}},"Error",-1)),e("div",Q,a(JSON.stringify(t.last_error,null,2)),1)])):_("",!0)])}),128))],4)):!r.value&&!n.value?(i(),l("div",W,[...s[7]||(s[7]=[D('<div class="empty-state__icon" data-v-f621b5a1><svg width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" data-v-f621b5a1><line x1="18" y1="20" x2="18" y2="10" data-v-f621b5a1></line><line x1="12" y1="20" x2="12" y2="4" data-v-f621b5a1></line><line x1="6" y1="20" x2="6" y2="14" data-v-f621b5a1></line></svg></div><div class="empty-state__title" data-v-f621b5a1>Enter run IDs to compare</div><p style="color:var(--text-muted);font-size:0.85rem;margin-top:4px;" data-v-f621b5a1> Paste two or more run IDs above to see a side-by-side comparison of model, tokens, config, and more. </p>',3)])])):_("",!0)]))}}),se=B(X,[["__scopeId","data-v-f621b5a1"]]);export{se as default};
