import{c as ot,a as u,o as gt,s as d,f as M,l as Ft}from"./BqgPKE-B.js";import{o as St}from"./C4QyggyU.js";import{f as lt,B as it,F as s,I as l,t as O,K as e,G as rt,J as a,D as nt,M as P,L as $t,O as At,aI as Lt}from"./6mnWt3YZ.js";import{l as pt,s as _t,p as st,i as tt,b as vt,a as ct}from"./BJ0MJm0w.js";import{I as ft,s as mt,b as Y,e as U,i as W,a as ht,c as bt,t as dt}from"./BfTcz1DI.js";import{c as Pt,a as Et,b as jt}from"./CIjYD0We.js";import{h as Bt}from"./CG_5BmR8.js";import"./zzPCSqzL.js";import{C as It,F as Mt}from"./BgUFc-Zd.js";import{c as zt}from"./LjIT5PsV.js";import{P as Dt}from"./CrkyYhGx.js";import{M as Rt,F as Tt}from"./Md_0usCS.js";import{C as Ot}from"./vpNtFX-q.js";import{C as Nt}from"./seHlMjav.js";import{C as Vt}from"./BNZK7cgo.js";import{C as wt}from"./X2BG5-cc.js";import{Z as Gt}from"./DoPBt9fV.js";function Ht(c,t){const r=pt(t,["children","$$slots","$$events","$$legacy"]);/**
 * @license lucide-svelte v0.469.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16"}],["path",{d:"M18 17V9"}],["path",{d:"M13 17V5"}],["path",{d:"M8 17v-3"}]];ft(c,_t({name:"chart-column"},()=>r,{get iconNode(){return $},children:(D,C)=>{var p=ot(),m=lt(p);mt(m,t,"default",{}),u(D,p)},$$slots:{default:!0}}))}function Jt(c,t){const r=pt(t,["children","$$slots","$$events","$$legacy"]);/**
 * @license lucide-svelte v0.469.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"m9 12 2 2 4-4"}]];ft(c,_t({name:"circle-check"},()=>r,{get iconNode(){return $},children:(D,C)=>{var p=ot(),m=lt(p);mt(m,t,"default",{}),u(D,p)},$$slots:{default:!0}}))}function Kt(c,t){const r=pt(t,["children","$$slots","$$events","$$legacy"]);/**
 * @license lucide-svelte v0.469.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $=[["circle",{cx:"12",cy:"12",r:"10"}]];ft(c,_t({name:"circle"},()=>r,{get iconNode(){return $},children:(D,C)=>{var p=ot(),m=lt(p);mt(m,t,"default",{}),u(D,p)},$$slots:{default:!0}}))}function Xt(c,t){const r=pt(t,["children","$$slots","$$events","$$legacy"]);/**
 * @license lucide-svelte v0.469.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $=[["circle",{cx:"12",cy:"12",r:"10"}],["polyline",{points:"12 6 12 12 16 14"}]];ft(c,_t({name:"clock"},()=>r,{get iconNode(){return $},children:(D,C)=>{var p=ot(),m=lt(p);mt(m,t,"default",{}),u(D,p)},$$slots:{default:!0}}))}function Yt(c,t){const r=pt(t,["children","$$slots","$$events","$$legacy"]);/**
 * @license lucide-svelte v0.469.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}],["circle",{cx:"9",cy:"7",r:"4"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75"}]];ft(c,_t({name:"users"},()=>r,{get iconNode(){return $},children:(D,C)=>{var p=ot(),m=lt(p);mt(m,t,"default",{}),u(D,p)},$$slots:{default:!0}}))}function Ut(c,t){const r={python:`<path d="M11.8 2.4c-3.6 0-3.4 1.6-3.4 1.6v1.6h3.5v.5H6.3S3.2 5.8 3.2 9.5s2.7 3.5 2.7 3.5h1.6v-1.7s-.1-2.7 2.6-2.7h3.5s2.5 0 2.5-2.4V4.1s.4-1.7-4.3-1.7zm-2.3 1c.4 0 .8.3.8.8s-.4.8-.8.8-.8-.3-.8-.8.4-.8.8-.8z" fill="${t}"/><path d="M12.2 21.6c3.6 0 3.4-1.6 3.4-1.6v-1.6h-3.5v-.5h5.6s3.1.3 3.1-3.4-2.7-3.5-2.7-3.5h-1.6v1.7s.1 2.7-2.6 2.7H10.4s-2.5 0-2.5 2.4v2.1s-.4 1.7 4.3 1.7zm2.3-1c-.4 0-.8-.3-.8-.8s.4-.8.8-.8.8.3.8.8-.4.8-.8.8z" fill="${t}"/>`,js:`<rect x="3" y="3" width="18" height="18" rx="2" fill="${t}" opacity=".18"/><text x="12" y="17" text-anchor="middle" font-size="11" font-weight="900" font-family="system-ui" fill="${t}">JS</text>`,ts:`<rect x="3" y="3" width="18" height="18" rx="2" fill="${t}" opacity=".18"/><text x="12" y="17" text-anchor="middle" font-size="11" font-weight="900" font-family="system-ui" fill="${t}">TS</text>`,react:`<ellipse cx="12" cy="12" rx="10" ry="4" stroke="${t}" stroke-width="1.2"/><ellipse cx="12" cy="12" rx="10" ry="4" stroke="${t}" stroke-width="1.2" transform="rotate(60 12 12)"/><ellipse cx="12" cy="12" rx="10" ry="4" stroke="${t}" stroke-width="1.2" transform="rotate(120 12 12)"/><circle cx="12" cy="12" r="2" fill="${t}"/>`,svelte:`<path d="M17.6 5.2C15.7 2.7 12.2 2.1 9.9 3.9 7.5 5.6 6.9 8.8 8.4 11l.1.1c-1.4 2-1 5 1.4 6.6 2.4 1.7 5.6 1.1 7.3-1.2.6-.9 1-2 .9-3-.1-1.6-1-3-2.4-3.8l-.1-.1c1.4-2 .8-5-1.4-6.6z" fill="${t}" opacity=".9"/><path d="M10.3 15.8c-.8.3-1.8-.2-2-1.1-.1-.3-.1-.6 0-.9l.3-.8 1.3.9c.2.2.4.4.4.7 0 .5-.2 1.1-.7 1.2z" fill="none"/>`,vue:`<path d="M2 3h4l6 10.5L18 3h4L12 21z" fill="${t}" opacity=".5"/><path d="M7 3h3l2 3.5L14 3h3L12 14z" fill="${t}"/>`,css:`<path d="M4 2l1.5 17L12 22l6.5-3L20 2z" fill="${t}" opacity=".18"/><text x="12" y="16" text-anchor="middle" font-size="9" font-weight="900" font-family="system-ui" fill="${t}">CSS</text>`,html:`<path d="M4 2l1.5 17L12 22l6.5-3L20 2z" fill="${t}" opacity=".18"/><text x="12" y="15.5" text-anchor="middle" font-size="7.5" font-weight="900" font-family="system-ui" fill="${t}">&lt;/&gt;</text>`,json:`<text x="12" y="17" text-anchor="middle" font-size="15" font-weight="300" font-family="monospace" fill="${t}">{ }</text>`,yaml:`<text x="12" y="16" text-anchor="middle" font-size="8.5" font-weight="800" font-family="system-ui" fill="${t}">YML</text>`,md:`<rect x="2" y="5" width="20" height="14" rx="2" stroke="${t}" stroke-width="1.5" fill="none"/><path d="M5.5 15V9l2.5 3.5L10.5 9v6M17 15l-2.5-3M17 9v6M14.5 12H17" stroke="${t}" stroke-width="1.4" fill="none" stroke-linecap="round" stroke-linejoin="round"/>`,go:`<text x="12" y="17" text-anchor="middle" font-size="13" font-weight="900" font-family="system-ui" fill="${t}">Go</text>`,rust:`<circle cx="12" cy="12" r="5.5" stroke="${t}" stroke-width="1.8" fill="none"/><text x="12" y="15.5" text-anchor="middle" font-size="8" font-weight="900" font-family="system-ui" fill="${t}">R</text>`+[0,60,120,180,240,300].map($=>`<line x1="${12+8.5*Math.cos($*Math.PI/180)}" y1="${12+8.5*Math.sin($*Math.PI/180)}" x2="${12+6.5*Math.cos($*Math.PI/180)}" y2="${12+6.5*Math.sin($*Math.PI/180)}" stroke="${t}" stroke-width="2" stroke-linecap="round"/>`).join(""),java:`<path d="M6 8h9v5.5c0 1.8-2 3.5-4.5 3.5S6 15.3 6 13.5z" stroke="${t}" stroke-width="1.3" fill="none"/><path d="M15 10c1.5 0 2.5.8 2.5 2s-1 2-2.5 2" stroke="${t}" stroke-width="1.3" fill="none"/><path d="M8.5 6.5c0-1 .5-1.8 1.2-1.8M11.5 6.5c0-1.2.5-2 1.2-2" stroke="${t}" stroke-width=".9" fill="none" stroke-linecap="round"/>`,ruby:`<polygon points="12,3 20,10 12,21 4,10" stroke="${t}" stroke-width="1.3" fill="${t}" fill-opacity=".15"/><polyline points="4,10 12,13 20,10" stroke="${t}" stroke-width="1" fill="none"/><line x1="12" y1="3" x2="12" y2="21" stroke="${t}" stroke-width="1"/>`,php:`<ellipse cx="12" cy="12" rx="10" ry="7" stroke="${t}" stroke-width="1.3" fill="none"/><text x="12" y="15.5" text-anchor="middle" font-size="8" font-weight="900" font-family="system-ui" fill="${t}">php</text>`,shell:`<rect x="2" y="4" width="20" height="16" rx="2.5" stroke="${t}" stroke-width="1.5" fill="none"/><polyline points="6,10 9.5,13 6,16" stroke="${t}" stroke-width="1.6" fill="none" stroke-linecap="round" stroke-linejoin="round"/><line x1="12" y1="16" x2="18" y2="16" stroke="${t}" stroke-width="1.6" stroke-linecap="round"/>`,sql:`<ellipse cx="12" cy="7" rx="7" ry="3" stroke="${t}" stroke-width="1.4" fill="none"/><path d="M5 7v10c0 1.7 3.1 3 7 3s7-1.3 7-3V7" stroke="${t}" stroke-width="1.4" fill="none"/><path d="M5 12.5c0 1.7 3.1 3 7 3s7-1.3 7-3" stroke="${t}" stroke-width=".8" fill="none" opacity=".5"/>`,cfg:`<circle cx="12" cy="12" r="3" stroke="${t}" stroke-width="1.5" fill="none"/><path d="M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9l2.1 2.1M17 17l2.1 2.1M4.9 19.1l2.1-2.1M17 7l2.1-2.1" stroke="${t}" stroke-width="1.5" stroke-linecap="round"/>`,txt:`<line x1="4" y1="6" x2="20" y2="6" stroke="${t}" stroke-width="1.5" stroke-linecap="round"/><line x1="4" y1="10" x2="16" y2="10" stroke="${t}" stroke-width="1.5" stroke-linecap="round"/><line x1="4" y1="14" x2="18" y2="14" stroke="${t}" stroke-width="1.5" stroke-linecap="round"/><line x1="4" y1="18" x2="12" y2="18" stroke="${t}" stroke-width="1.5" stroke-linecap="round"/>`,img:`<rect x="3" y="5" width="18" height="14" rx="2" stroke="${t}" stroke-width="1.3" fill="none"/><circle cx="8" cy="10" r="1.8" fill="${t}"/><polyline points="3,17 8,13 11,15 15,10 21,17" stroke="${t}" stroke-width="1.3" fill="none" stroke-linejoin="round"/>`,lock:`<rect x="6" y="11" width="12" height="9" rx="2" stroke="${t}" stroke-width="1.3" fill="none"/><path d="M8 11V8a4 4 0 0 1 8 0v3" stroke="${t}" stroke-width="1.3" fill="none"/><circle cx="12" cy="15.5" r="1.3" fill="${t}"/>`,svg:`<text x="12" y="16" text-anchor="middle" font-size="8.5" font-weight="800" font-family="system-ui" fill="${t}">SVG</text>`,c:`<text x="12" y="17" text-anchor="middle" font-size="14" font-weight="900" font-family="system-ui" fill="${t}">C</text>`,cpp:`<text x="12" y="16.5" text-anchor="middle" font-size="10" font-weight="900" font-family="system-ui" fill="${t}">C++</text>`,csharp:`<text x="12" y="16.5" text-anchor="middle" font-size="11" font-weight="900" font-family="system-ui" fill="${t}">C#</text>`,swift:`<path d="M18 4c-4.5 3.5-8.5 5.5-11.5 6 2.5-.8 5.5-3 8-5.5-2.5 3-6 5.5-10 7 2.5.5 6-.3 9.5-3-2 2.5-5 4.2-8 4.7 2 1.2 5.8.4 9.5-2-1 1.7-3 3.4-6 4.3 3.8 0 7-1.7 8.7-4.5.8-1.3.4-4.2-.7-6z" fill="${t}"/>`,kotlin:`<polygon points="3,3 21,3 12,12 21,21 3,21" fill="${t}" opacity=".7"/>`,dart:`<path d="M4 12l3-9h10l4 4v10l-9 3z" stroke="${t}" stroke-width="1.3" fill="${t}" fill-opacity=".15"/>`,other:`<circle cx="6" cy="12" r="2" fill="${t}"/><circle cx="12" cy="12" r="2" fill="${t}"/><circle cx="18" cy="12" r="2" fill="${t}"/>`,generic:`<path d="M6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z" stroke="${t}" stroke-width="1.3" fill="none"/><polyline points="14,2 14,8 20,8" stroke="${t}" stroke-width="1.3" fill="none"/>`};return r[c]||r.generic}var Wt=Ft('<path fill="none" stroke-linecap="butt" style="transition: all .15s ease; cursor: pointer;" role="img"></path>'),Zt=M('<div class="tip svelte-183lp39"><span class="tip-dot svelte-183lp39"></span> <b class="svelte-183lp39"> </b> <span class="tip-v svelte-183lp39"> </span></div>'),Qt=M('<button type="button"><span class="badge svelte-183lp39"><svg viewBox="0 0 24 24" width="15" height="15" fill="none" xmlns="http://www.w3.org/2000/svg" class="svelte-183lp39"><!></svg></span> <span class="leg-name svelte-183lp39"> </span> <span class="leg-cnt svelte-183lp39"> </span> <span class="bar-t svelte-183lp39"><span class="bar-f svelte-183lp39"></span> <span class="bar-val svelte-183lp39"> </span></span></button>'),te=M('<div class="chart-wrap svelte-183lp39"><div class="donut-box svelte-183lp39"><svg viewBox="0 0 200 200" class="donut-svg svelte-183lp39"><circle fill="none" stroke="var(--bd)" opacity="0.25"></circle><!><text text-anchor="middle" dominant-baseline="central" class="c-num svelte-183lp39"> </text><text text-anchor="middle" dominant-baseline="central" class="c-lbl svelte-183lp39">files</text></svg> <!></div> <div class="legend svelte-183lp39"></div></div>');function ee(c,t){it(t,!0);let r=st(t,"files",19,()=>({})),$=st(t,"totalFiles",3,0);const D={".py":{color:"#3572A5",name:"Python",icon:"python"},".js":{color:"#F7DF1E",name:"JavaScript",icon:"js"},".ts":{color:"#3178C6",name:"TypeScript",icon:"ts"},".jsx":{color:"#61DAFB",name:"React JSX",icon:"react"},".tsx":{color:"#3178C6",name:"React TSX",icon:"react"},".svelte":{color:"#FF3E00",name:"Svelte",icon:"svelte"},".vue":{color:"#42B883",name:"Vue",icon:"vue"},".css":{color:"#563D7C",name:"CSS",icon:"css"},".scss":{color:"#CF649A",name:"SCSS",icon:"css"},".html":{color:"#E34F26",name:"HTML",icon:"html"},".json":{color:"#A0A0A0",name:"JSON",icon:"json"},".yaml":{color:"#CB171E",name:"YAML",icon:"yaml"},".yml":{color:"#CB171E",name:"YAML",icon:"yaml"},".md":{color:"#519ABA",name:"Markdown",icon:"md"},".go":{color:"#00ADD8",name:"Go",icon:"go"},".rs":{color:"#DEA584",name:"Rust",icon:"rust"},".java":{color:"#B07219",name:"Java",icon:"java"},".rb":{color:"#CC342D",name:"Ruby",icon:"ruby"},".php":{color:"#4F5D95",name:"PHP",icon:"php"},".sh":{color:"#89E051",name:"Shell",icon:"shell"},".bat":{color:"#C1F12E",name:"Batch",icon:"shell"},".sql":{color:"#E38C00",name:"SQL",icon:"sql"},".toml":{color:"#9C4121",name:"TOML",icon:"cfg"},".cfg":{color:"#7B7B7B",name:"Config",icon:"cfg"},".txt":{color:"#6E6E6E",name:"Text",icon:"txt"},".svg":{color:"#FFB13B",name:"SVG",icon:"svg"},".png":{color:"#5A9E6F",name:"PNG",icon:"img"},".jpg":{color:"#5A9E6F",name:"JPEG",icon:"img"},".lock":{color:"#555555",name:"Lock",icon:"lock"},".c":{color:"#555555",name:"C",icon:"c"},".cpp":{color:"#F34B7D",name:"C++",icon:"cpp"},".cs":{color:"#178600",name:"C#",icon:"csharp"},".swift":{color:"#F05138",name:"Swift",icon:"swift"},".kt":{color:"#A97BFF",name:"Kotlin",icon:"kotlin"},".dart":{color:"#00B4AB",name:"Dart",icon:"dart"}},C="#555";function p(n){return D[n.toLowerCase()]||{color:C,name:n,icon:"generic"}}let m=P(()=>{const n=Object.entries(r()||{}).sort((F,L)=>L[1]-F[1]),h=$()||n.reduce((F,L)=>F+L[1],0)||1,A=h*.02,_=[];let T=0;for(const[F,L]of n)if(L>=A&&_.length<12){const H=p(F);_.push({ext:F,count:L,pct:L/h*100,...H})}else T+=L;return T>0&&_.push({ext:"other",count:T,pct:T/h*100,color:C,name:"Other",icon:"other"}),_});const z=100,x=100,S=80,E=28;function R(n){const h=n.reduce((F,L)=>F+L.count,0)||1,A=[];let _=-90;const T=n.length>1?1.5:0;for(const F of n){const L=F.count/h*360-T;if(L<=0)continue;const H=_*Math.PI/180,J=(_+L)*Math.PI/180,Q=z+S*Math.cos(H),v=x+S*Math.sin(H),f=z+S*Math.cos(J),b=x+S*Math.sin(J),Z=L>180?1:0;A.push({...F,d:`M ${Q} ${v} A ${S} ${S} 0 ${Z} 1 ${f} ${b}`}),_+=L+T}return A}let q=P(()=>R(e(m))),k=$t(null);function j(n){if(!n||n.length<7)return"#fff";const h=parseInt(n.slice(1,3),16),A=parseInt(n.slice(3,5),16),_=parseInt(n.slice(5,7),16);return(.299*h+.587*A+.114*_)/255>.55?"#111":"#fff"}var o=te(),y=s(o),i=s(y),g=s(i);Y(g,"cx",z),Y(g,"cy",x),Y(g,"r",S),Y(g,"stroke-width",E);var G=l(g);U(G,17,()=>e(q),W,(n,h,A)=>{var _=Wt();O(()=>{Y(_,"d",e(h).d),Y(_,"stroke",e(h).color),Y(_,"stroke-width",e(k)===A?E+6:E),Y(_,"opacity",e(k)!==null&&e(k)!==A?.3:1),Y(_,"aria-label",e(h).name)}),gt("mouseenter",_,()=>rt(k,A,!0)),gt("mouseleave",_,()=>rt(k,null)),u(n,_)});var B=l(G);Y(B,"x",z),Y(B,"y",x-8);var X=s(B,!0);a(B);var N=l(B);Y(N,"x",z),Y(N,"y",x+14),a(i);var V=l(i,2);{var w=n=>{var h=Zt(),A=s(h),_=l(A,2),T=s(_,!0);a(_);var F=l(_,2),L=s(F);a(F),a(h),O(H=>{bt(A,`background:${e(q)[e(k)].color??""}`),d(T,e(q)[e(k)].name),d(L,`${e(q)[e(k)].count??""} (${H??""}%)`)},[()=>e(q)[e(k)].pct.toFixed(1)]),u(n,h)};tt(V,n=>{e(k)!==null&&e(q)[e(k)]&&n(w)})}a(y);var I=l(y,2);U(I,21,()=>e(m),W,(n,h,A)=>{var _=Qt();let T;var F=s(_),L=s(F),H=s(L);Bt(H,()=>Ut(e(h).icon,j(e(h).color)),!0),a(L),a(F);var J=l(F,2),Q=s(J,!0);a(J);var v=l(J,2),f=s(v,!0);a(v);var b=l(v,2),Z=s(b),K=l(Z,2),et=s(K);a(K),a(b),a(_),O(at=>{T=ht(_,1,"leg-row svelte-183lp39",null,T,{dimmed:e(k)!==null&&e(k)!==A}),bt(F,`background:${e(h).color??""}`),d(Q,e(h).name),d(f,e(h).count),bt(Z,`width:${e(h).pct??""}%; background:${e(h).color??""}`),d(et,`${at??""}%`)},[()=>e(h).pct.toFixed(1)]),gt("mouseenter",_,()=>rt(k,A,!0)),gt("mouseleave",_,()=>rt(k,null)),u(n,_)}),a(I),a(o),O(()=>d(X,$())),u(c,o),nt()}function ut(c){return c?c>=1e6?(c/1e6).toFixed(1)+"M":c>=1e3?(c/1e3).toFixed(1)+"k":c.toLocaleString():"0"}function Ct(c){return((c==null?void 0:c.input_tokens)||0)+((c==null?void 0:c.output_tokens)||0)}function ae(c){return Object.entries(c||{}).sort((t,r)=>Ct(r[1])-Ct(t[1]))}var se=M('<span class="pipe-arrow svelte-1lm0ncb"><!></span>'),le=M('<a><span class="pipe-icon svelte-1lm0ncb"><!></span> <span class="pipe-label"> </span></a> <!>',1),re=M('<div class="widget lg pipeline-card card svelte-1lm0ncb"><h3> </h3> <div class="pipeline svelte-1lm0ncb"></div></div>');function oe(c,t){it(t,!0);const r=()=>vt(dt,"$t",$),[$,D]=ct();let C=P(()=>{var S,E,R;return(S=t.status)!=null&&S.initialized?[{id:"constitution",label:r()("dash.pipe_constitution"),done:t.status.constitution_validated,active:t.status.has_constitution&&!t.status.constitution_validated,href:"/constitution"},{id:"architecture",label:r()("dash.pipe_architecture"),done:t.status.architecture_reviewed,active:t.status.has_architecture&&!t.status.architecture_reviewed,href:"/architecture"},{id:"adr",label:r()("dash.pipe_adr"),done:t.status.architecture_reviewed&&(t.status.adr_count||0)>0,active:t.status.architecture_reviewed&&(t.status.adr_count||0)===0,href:"/adr"},{id:"devplan",label:r()("dash.pipe_devplan"),done:t.status.devplan_confirmed,active:t.status.has_devplan&&!t.status.devplan_confirmed,href:"/devplan"},{id:"tasks",label:r()("dash.pipe_tasks"),done:(((E=t.status.tasks)==null?void 0:E.length)||0)>0&&t.status.tasks.every(q=>q.current_phase==="review"),active:(((R=t.status.tasks)==null?void 0:R.length)||0)>0,href:"/tasks"}]:[]});var p=re(),m=s(p),z=s(m,!0);a(m);var x=l(m,2);U(x,21,()=>e(C),W,(S,E,R)=>{var q=le(),k=lt(q);let j;var o=s(k),y=s(o);{var i=w=>{Jt(w,{size:20})},g=w=>{Xt(w,{size:20})},G=w=>{Kt(w,{size:20})};tt(y,w=>{e(E).done?w(i):e(E).active?w(g,1):w(G,!1)})}a(o);var B=l(o,2),X=s(B,!0);a(B),a(k);var N=l(k,2);{var V=w=>{var I=se(),n=s(I);It(n,{size:16}),a(I),u(w,I)};tt(N,w=>{R<e(C).length-1&&w(V)})}O(()=>{j=ht(k,1,"pipe-step svelte-1lm0ncb",null,j,{done:e(E).done,active:e(E).active&&!e(E).done}),Y(k,"href",e(E).href),d(X,e(E).label)}),u(S,q)}),a(x),a(p),O(S=>d(z,S),[()=>r()("dash.pipeline")]),u(c,p),nt(),D()}var ie=M('<div class="widget sm summary-card svelte-qwoahx"><div class="sc-value svelte-qwoahx"> </div> <div class="sc-label svelte-qwoahx"><!> </div></div>');function kt(c,t){var r=ie(),$=s(r),D=s($,!0);a($);var C=l($,2),p=s(C);zt(p,()=>t.icon,(z,x)=>{x(z,{size:16})});var m=l(p);a(C),a(r),O(()=>{d(D,t.value),d(m,` ${t.label??""}`)}),u(c,r)}var ne=M("<div></div>"),ve=M('<div class="mp-cell svelte-100x0j8"><!> <div><!></div></div>'),ce=M('<a class="feat-item svelte-100x0j8"><div class="feat-top svelte-100x0j8"><span class="feat-name svelte-100x0j8"> </span> <span class="feat-phase svelte-100x0j8"> </span></div> <div class="mini-phases svelte-100x0j8"></div></a>'),de=M('<div class="feat-grid svelte-100x0j8"></div>'),he=M('<p class="empty-hint"> </p>'),ue=M('<div class="widget lg card"><div class="section-head"><h3><!> </h3> <a class="sec-btn" href="/tasks"> </a></div> <!></div>');function pe(c,t){it(t,!0);const r=()=>vt(dt,"$t",$),[$,D]=ct();let C=st(t,"tasks",19,()=>[]);const p=[{key:"clarify",icon:Rt},{key:"plan",icon:Ot},{key:"implement",icon:Nt},{key:"tests",icon:Tt}];function m(i,g){const G=(i==null?void 0:i[g])||"not_started";return G==="complete"?"ok":["in_progress","draft","awaiting_review"].includes(G)?"wip":""}var z=ue(),x=s(z),S=s(x),E=s(S);Dt(E,{size:16});var R=l(E);a(S);var q=l(S,2),k=s(q,!0);a(q),a(x);var j=l(x,2);{var o=i=>{var g=de();U(g,21,C,W,(G,B)=>{var X=ce(),N=s(X),V=s(N),w=s(V,!0);a(V);var I=l(V,2),n=s(I,!0);a(I),a(N);var h=l(N,2);U(h,21,()=>p,W,(A,_,T)=>{const F=P(()=>m(e(B).phases,e(_).key)),L=P(()=>e(_).icon);var H=ve(),J=s(H);{var Q=K=>{const et=P(()=>m(e(B).phases,p[T+1].key));var at=ne();let xt;O(()=>xt=ht(at,1,"mp-line svelte-100x0j8",null,xt,{"mp-line-ok":e(F)==="ok","mp-line-half":e(F)==="ok"&&e(et)!=="ok"})),u(K,at)};tt(J,K=>{T<p.length-1&&K(Q)})}var v=l(J,2),f=s(v);{var b=K=>{Vt(K,{size:12,strokeWidth:2.5})},Z=K=>{var et=ot(),at=lt(et);zt(at,()=>e(L),(xt,qt)=>{qt(xt,{size:12,strokeWidth:1.5})}),u(K,et)};tt(f,K=>{e(F)==="ok"?K(b):K(Z,!1)})}a(v),a(H),O(()=>ht(v,1,`mp-dot ${e(F)??""}`,"svelte-100x0j8")),u(A,H)}),a(h),a(X),O(A=>{Y(X,"href",`/tasks/${A??""}`),d(w,e(B).name),d(n,e(B).milestone)},[()=>encodeURIComponent(e(B).name)]),u(G,X)}),a(g),u(i,g)},y=i=>{var g=he(),G=s(g,!0);a(g),O(B=>d(G,B),[()=>r()("dash.no_data")]),u(i,g)};tt(j,i=>{var g;(g=C())!=null&&g.length?i(o):i(y,!1)})}a(z),O((i,g)=>{d(R,` ${i??""}`),d(k,g)},[()=>r()("dash.tasks_overview"),()=>r()("dash.view_all")]),u(c,z),nt(),D()}var _e=M('<div class="llm-item svelte-4yfdl2"><span class="llm-label svelte-4yfdl2"> </span> <span class="llm-val svelte-4yfdl2"> </span></div>'),fe=M('<div class="llm-item hint svelte-4yfdl2"><span class="llm-label svelte-4yfdl2"> </span></div>'),me=M('<div class="widget lg card"><div class="section-head"><h3><!> </h3> <a class="sec-btn" href="/settings"> </a></div> <div class="llm-grid svelte-4yfdl2"><div class="llm-item default svelte-4yfdl2"><span class="llm-label svelte-4yfdl2"> </span> <span class="llm-val svelte-4yfdl2"> </span></div> <!> <!></div></div>');function xe(c,t){it(t,!0);const r=()=>vt(dt,"$t",$),[$,D]=ct();let C=st(t,"config",19,()=>({})),p=st(t,"roles",19,()=>[]);var m=me(),z=s(m),x=s(z),S=s(x);wt(S,{size:16});var E=l(S);a(x);var R=l(x,2),q=s(R,!0);a(R),a(z);var k=l(z,2),j=s(k),o=s(j),y=s(o,!0);a(o);var i=l(o,2),g=s(i);a(i),a(j);var G=l(j,2);U(G,17,p,W,(N,V)=>{var w=_e(),I=s(w),n=s(I,!0);a(I);var h=l(I,2),A=s(h);a(h),a(w),O(_=>{d(n,_),d(A,`${e(V).provider??""} / ${e(V).model??""}`)},[()=>r()("settings.role_"+e(V).name)]),u(N,w)});var B=l(G,2);{var X=N=>{var V=fe(),w=s(V),I=s(w,!0);a(w),a(V),O(n=>d(I,n),[()=>r()("dash.no_roles")]),u(N,V)};tt(B,N=>{p().length===0&&N(X)})}a(k),a(m),O((N,V,w)=>{var I,n;d(E,` ${N??""}`),d(q,V),d(y,w),d(g,`${(((I=C())==null?void 0:I.llm_provider)||"—")??""} / ${(((n=C())==null?void 0:n.llm_model)||"—")??""}`)},[()=>r()("dash.llm_config"),()=>r()("dash.edit"),()=>r()("dash.default_model")]),u(c,m),nt(),D()}var ge=M('<tr><td class="al name"> </td><td class="ar num"> </td><td class="ar num"> </td></tr>'),ke=M('<table class="stat-table"><thead><tr><th class="al"> </th><th class="ar"> </th><th class="ar"> </th></tr></thead><tbody></tbody></table>'),ye=M('<p class="empty-hint"> </p>'),$e=M("<div><h3><!> </h3> <!></div>");function yt(c,t){it(t,!0);const r=()=>vt(dt,"$t",$),[$,D]=ct();let C=st(t,"data",19,()=>({})),p=st(t,"size",3,"md"),m=P(()=>ae(C()));var z=$e(),x=s(z),S=s(x);zt(S,()=>t.icon,(j,o)=>{o(j,{size:16})});var E=l(S);a(x);var R=l(x,2);{var q=j=>{var o=ke(),y=s(o),i=s(y),g=s(i),G=s(g,!0);a(g);var B=l(g),X=s(B,!0);a(B);var N=l(B),V=s(N,!0);a(N),a(i),a(y);var w=l(y);U(w,21,()=>e(m),W,(I,n)=>{var h=P(()=>At(e(n),2));let A=()=>e(h)[0],_=()=>e(h)[1];var T=ge(),F=s(T),L=s(F,!0);a(F);var H=l(F),J=s(H,!0);a(H);var Q=l(H),v=s(Q,!0);a(Q),a(T),O(f=>{d(L,A()),d(J,_().requests),d(v,f)},[()=>ut(Ct(_()))]),u(I,T)}),a(w),a(o),O((I,n,h)=>{d(G,I),d(X,n),d(V,h)},[()=>r()("stats.col_name"),()=>r()("stats.col_requests"),()=>r()("stats.col_tokens")]),u(j,o)},k=j=>{var o=ye(),y=s(o,!0);a(o),O(i=>d(y,i),[()=>r()("dash.no_data")]),u(j,o)};tt(R,j=>{e(m).length?j(q):j(k,!1)})}a(z),O(()=>{ht(z,1,`widget ${p()??""} card`),d(E,` ${t.title??""}`)}),u(c,z),nt(),D()}var we=M('<tr><td class="al mono"> </td><td class="al"> </td><td class="al"> </td><td class="al mono"> </td><td class="ar num"> </td><td class="ar num"> </td></tr>'),be=M('<div class="log-scroll"><table class="stat-table log-table"><thead><tr><th class="al"> </th><th class="al"> </th><th class="al"> </th><th class="al"> </th><th class="ar">In</th><th class="ar">Out</th></tr></thead><tbody></tbody></table></div>'),Me=M('<p class="empty-hint"> </p>'),Ce=M('<div class="widget lg card"><h3> </h3> <!></div>');function ze(c,t){it(t,!0);const r=()=>vt(dt,"$t",$),[$,D]=ct();let C=st(t,"entries",19,()=>[]);var p=Ce(),m=s(p),z=s(m,!0);a(m);var x=l(m,2);{var S=R=>{var q=be(),k=s(q),j=s(k),o=s(j),y=s(o),i=s(y,!0);a(y);var g=l(y),G=s(g,!0);a(g);var B=l(g),X=s(B,!0);a(B);var N=l(B),V=s(N,!0);a(N),Lt(2),a(o),a(j);var w=l(j);U(w,21,C,W,(I,n)=>{var h=we(),A=s(h),_=s(A,!0);a(A);var T=l(A),F=s(T,!0);a(T);var L=l(T),H=s(L,!0);a(L);var J=l(L),Q=s(J,!0);a(J);var v=l(J),f=s(v,!0);a(v);var b=l(v),Z=s(b,!0);a(b),a(h),O((K,et,at)=>{d(_,K),d(F,e(n).phase),d(H,e(n).task||"—"),d(Q,e(n).model),d(f,et),d(Z,at)},[()=>{var K;return((K=e(n).ts)==null?void 0:K.slice(11,19))||""},()=>ut(e(n).input_tokens),()=>ut(e(n).output_tokens)]),u(I,h)}),a(w),a(k),a(q),O((I,n,h,A)=>{d(i,I),d(G,n),d(X,h),d(V,A)},[()=>r()("stats.col_time"),()=>r()("stats.col_phase"),()=>r()("stats.col_task"),()=>r()("stats.col_model")]),u(R,q)},E=R=>{var q=Me(),k=s(q,!0);a(q),O(j=>d(k,j),[()=>r()("dash.no_data")]),u(R,q)};tt(x,R=>{var q;(q=C())!=null&&q.length?R(S):R(E,!1)})}a(p),O(R=>d(z,R),[()=>r()("stats.recent_log")]),u(c,p),nt(),D()}var qe=M('<div class="skel-step svelte-1ophxaq"></div>'),Fe=M('<div class="widget sm skel-card skel-summary svelte-1ophxaq"><div class="skel-line skel-big svelte-1ophxaq"></div> <div class="skel-line skel-label svelte-1ophxaq"></div></div>'),Se=M('<div class="skel-feat svelte-1ophxaq"></div>'),Ae=M('<div class="skel-line skel-leg-row svelte-1ophxaq"></div>'),Le=M('<div class="skel-tag svelte-1ophxaq"></div>'),Pe=M('<div class="skel-line skel-table-row svelte-1ophxaq"></div>'),Ee=M('<div class="skel-line skel-table-row svelte-1ophxaq"></div>'),je=M('<div class="dash-grid svelte-1ophxaq"><div class="widget lg skel-card skel-pipeline svelte-1ophxaq"><div class="skel-line skel-h3 svelte-1ophxaq"></div> <div class="skel-steps svelte-1ophxaq"></div></div> <!> <div class="widget lg skel-card svelte-1ophxaq"><div class="skel-line skel-h3 svelte-1ophxaq"></div> <div class="skel-feat-grid svelte-1ophxaq"></div></div> <div class="widget lg skel-card skel-chart svelte-1ophxaq"><div class="skel-line skel-h3 svelte-1ophxaq"></div> <div class="skel-chart-row svelte-1ophxaq"><div class="skel-donut svelte-1ophxaq"></div> <div class="skel-legend svelte-1ophxaq"></div></div></div> <div class="widget lg skel-card svelte-1ophxaq"><div class="skel-line skel-h3 svelte-1ophxaq"></div> <div class="skel-flex-row svelte-1ophxaq"></div></div> <div class="widget md skel-card svelte-1ophxaq"><div class="skel-line skel-h3 svelte-1ophxaq"></div> <!></div> <div class="widget md skel-card svelte-1ophxaq"><div class="skel-line skel-h3 svelte-1ophxaq"></div> <!></div></div>');function Be(c){var t=je(),r=s(t),$=l(s(r),2);U($,4,()=>Array(5),W,(o,y)=>{var i=qe();u(o,i)}),a($),a(r);var D=l(r,2);U(D,0,()=>Array(4),W,(o,y)=>{var i=Fe();u(o,i)});var C=l(D,2),p=l(s(C),2);U(p,4,()=>Array(4),W,(o,y)=>{var i=Se();u(o,i)}),a(p),a(C);var m=l(C,2),z=l(s(m),2),x=l(s(z),2);U(x,4,()=>Array(5),W,(o,y)=>{var i=Ae();u(o,i)}),a(x),a(z),a(m);var S=l(m,2),E=l(s(S),2);U(E,4,()=>Array(3),W,(o,y)=>{var i=Le();u(o,i)}),a(E),a(S);var R=l(S,2),q=l(s(R),2);U(q,0,()=>Array(3),W,(o,y)=>{var i=Pe();u(o,i)}),a(R);var k=l(R,2),j=l(s(k),2);U(j,0,()=>Array(3),W,(o,y)=>{var i=Ee();u(o,i)}),a(k),a(t),u(c,t)}var Ie=M('<div class="card"><p style="color:var(--rd)"> </p></div>'),De=M('<p class="empty-hint"> </p>'),Re=M('<div class="dash-grid svelte-1o7g1bz"><!> <!> <!> <!> <!> <!> <div class="widget lg card"><h3><!> </h3> <!></div> <!> <!> <!> <!> <!> <!></div>');function sa(c,t){it(t,!0);const r=()=>vt(dt,"$t",$),[$,D]=ct();let C=$t(null),p=$t(!0),m=$t("");St(async()=>{try{rt(C,await Pt("dashboard",()=>Et.getDashboard()),!0)}catch(o){rt(m,o.message,!0),jt(o.message,"dashboard")}rt(p,!1)});let z=P(()=>{var o;return(o=e(C))==null?void 0:o.status}),x=P(()=>{var o;return(o=e(C))==null?void 0:o.stats}),S=P(()=>{var o,y;return(y=(o=e(z))==null?void 0:o.config)!=null&&y.roles?Object.entries(e(z).config.roles).filter(([,i])=>i!==null).map(([i,g])=>({name:i,...g})):[]});var E=ot(),R=lt(E);{var q=o=>{Be(o)},k=o=>{var y=Ie(),i=s(y),g=s(i,!0);a(i),a(y),O(()=>d(g,e(m))),u(o,y)},j=o=>{var y=Re(),i=s(y);oe(i,{get status(){return e(z)}});var g=l(i,2);{let v=P(()=>{var b,Z;return ut((Z=(b=e(x))==null?void 0:b.tokens)==null?void 0:Z.total_tokens)}),f=P(()=>r()("stats.total_tokens"));kt(g,{get icon(){return Gt},get value(){return e(v)},get label(){return e(f)}})}var G=l(g,2);{let v=P(()=>{var b;return((b=e(x))==null?void 0:b.total_requests)||0}),f=P(()=>r()("stats.total_requests"));kt(G,{get icon(){return wt},get value(){return e(v)},get label(){return e(f)}})}var B=l(G,2);{let v=P(()=>{var b;return((b=e(x))==null?void 0:b.total_files)||0}),f=P(()=>r()("stats.total_files"));kt(B,{get icon(){return Mt},get value(){return e(v)},get label(){return e(f)}})}var X=l(B,2);{let v=P(()=>{var b;return ut((b=e(x))==null?void 0:b.total_lines)}),f=P(()=>r()("stats.total_lines"));kt(X,{get icon(){return Ht},get value(){return e(v)},get label(){return e(f)}})}var N=l(X,2);{let v=P(()=>{var f;return(f=e(z))==null?void 0:f.tasks});pe(N,{get tasks(){return e(v)}})}var V=l(N,2),w=s(V),I=s(w);Mt(I,{size:16});var n=l(I);a(w);var h=l(w,2);{var A=v=>{ee(v,{get files(){return e(x).files},get totalFiles(){return e(x).total_files}})},_=v=>{var f=De(),b=s(f,!0);a(f),O(Z=>d(b,Z),[()=>r()("dash.no_data")]),u(v,f)};tt(h,v=>{var f;((f=e(x))==null?void 0:f.total_files)>0?v(A):v(_,!1)})}a(V);var T=l(V,2);{let v=P(()=>{var f;return(f=e(z))==null?void 0:f.config});xe(T,{get config(){return e(v)},get roles(){return e(S)}})}var F=l(T,2);{let v=P(()=>r()("stats.by_model")),f=P(()=>{var b;return(b=e(x))==null?void 0:b.by_model});yt(F,{get icon(){return wt},get title(){return e(v)},get data(){return e(f)}})}var L=l(F,2);{let v=P(()=>r()("stats.by_role")),f=P(()=>{var b;return(b=e(x))==null?void 0:b.by_role});yt(L,{get icon(){return Yt},get title(){return e(v)},get data(){return e(f)}})}var H=l(L,2);{let v=P(()=>{var f;return(f=e(x))==null?void 0:f.log_entries});ze(H,{get entries(){return e(v)}})}var J=l(H,2);{let v=P(()=>r()("stats.by_phase")),f=P(()=>{var b;return(b=e(x))==null?void 0:b.by_phase});yt(J,{get icon(){return wt},get title(){return e(v)},get data(){return e(f)}})}var Q=l(J,2);{let v=P(()=>r()("stats.by_task")),f=P(()=>{var b;return(b=e(x))==null?void 0:b.by_task});yt(Q,{get icon(){return Mt},get title(){return e(v)},get data(){return e(f)}})}a(y),O(v=>d(n,` ${v??""}`),[()=>r()("stats.project_files")]),u(o,y)};tt(R,o=>{e(p)?o(q):e(m)?o(k,1):e(C)&&o(j,2)})}u(c,E),nt(),D()}export{sa as D};
