claude-session-dashboard 0.4.5 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{_dashboard-Job6DOd1.js → _dashboard-ChSI7O-o.js} +1 -1
- package/dist/client/assets/{_sessionId-CIFXqjVa.js → _sessionId-DxfkocLt.js} +2 -2
- package/dist/client/assets/app-BAZLXX_G.css +1 -0
- package/dist/client/assets/createServerFn-DJjqV8Yc.js +1 -0
- package/dist/client/assets/index-BHwOAB5a.js +1 -0
- package/dist/client/assets/main-DMwMzWYr.js +69 -0
- package/dist/client/assets/{sessions.queries-ClgzoOt4.js → sessions.queries-D7WObk5d.js} +1 -1
- package/dist/client/assets/settings-BM0TBEkW.js +1 -0
- package/dist/client/assets/settings.types-BNSfIfFX.js +1 -0
- package/dist/client/assets/stats-wLUGXFpZ.js +4 -0
- package/dist/client/assets/useSessionCost-BPqnyONZ.js +37 -0
- package/dist/server/assets/{_dashboard-61fpMMMe.js → _dashboard-DZJZ9oYy.js} +7 -6
- package/dist/server/assets/{_sessionId-B_O50OfN.js → _sessionId-znGcd1Dj.js} +40 -11
- package/dist/server/assets/_tanstack-start-manifest_v-BNorjuP4.js +4 -0
- package/dist/server/assets/{app-info.api-CdaWsxHl.js → app-info.api-CrHplh0q.js} +31 -16
- package/dist/server/assets/{createServerRpc-Bd3B-Ah9.js → createServerRpc-D_-6bKnO.js} +1 -1
- package/dist/server/assets/{createSsrRpc-CVg2UDl0.js → createSsrRpc-OFLSk08e.js} +2 -3
- package/dist/server/assets/{index-BYcFI9Ho.js → index-BnvjnlZM.js} +27 -10
- package/dist/server/assets/{project-analytics.api-QnhRRs7T.js → project-analytics.api-6b5TIBNn.js} +10 -8
- package/dist/server/assets/{router-BvYNknMb.js → router-DAepjaOj.js} +6 -6
- package/dist/server/assets/{session-detail.api-8plxSeB0.js → session-detail.api-BQts3iQn.js} +38 -33
- package/dist/server/assets/{session-parser-DxLcS8VW.js → session-parser-DKZZMuh6.js} +122 -30
- package/dist/server/assets/{session-scanner-DRGzVO2T.js → session-scanner-CECpfGFh.js} +4 -4
- package/dist/server/assets/{sessions.api-DRmOjipJ.js → sessions.api-CQ-Lrk5S.js} +10 -8
- package/dist/server/assets/{sessions.queries-CvAnVbE8.js → sessions.queries-MfPgj6cK.js} +1 -1
- package/dist/server/assets/{settings-Ct2BZGxb.js → settings-DsLaw8yg.js} +11 -10
- package/dist/server/assets/{settings.api-C9L2GoIE.js → settings.api-Cq5KPUxN.js} +8 -7
- package/dist/server/assets/{settings.queries-BVEZA-1G.js → settings.queries-CMWxUDF-.js} +2 -2
- package/dist/server/assets/{settings.types-DntadCHo.js → settings.types-CphWe-HW.js} +10 -1
- package/dist/server/assets/{stats-CZEpvzmd.js → stats-DKbhSePW.js} +9 -9
- package/dist/server/assets/{stats.api-CH-wTCGE.js → stats.api-tIZqhk4B.js} +10 -8
- package/dist/server/assets/{useSessionCost-CyWBuljV.js → useSessionCost-iQEg4FRM.js} +2 -2
- package/dist/server/server.js +456 -817
- package/package.json +3 -2
- package/LICENSE +0 -21
- package/README.md +0 -194
- package/dist/client/assets/app-CkRVT69z.css +0 -1
- package/dist/client/assets/createServerFn-6SJrpRCO.js +0 -1
- package/dist/client/assets/index-DDr2smLW.js +0 -1
- package/dist/client/assets/main-B6FohBFQ.js +0 -69
- package/dist/client/assets/settings-DQD2EaIq.js +0 -1
- package/dist/client/assets/settings.types-LYd9Z8Y1.js +0 -1
- package/dist/client/assets/stats-CrWQ_y2R.js +0 -4
- package/dist/client/assets/useSessionCost-Drt0v6oj.js +0 -37
- package/dist/server/assets/_tanstack-start-manifest_v-Dva5sIpS.js +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,c as i,u as x,L as l,O as d}from"./main-
|
|
1
|
+
import{j as e,c as i,u as x,L as l,O as d}from"./main-DMwMzWYr.js";import{u as n,c as h,q as p}from"./createServerFn-DJjqV8Yc.js";import{a as m}from"./sessions.queries-D7WObk5d.js";function u(){const{data:r}=n(m),a=r?.length??0;return a===0?null:e.jsx("span",{className:"ml-auto rounded-full bg-emerald-500/20 px-1.5 py-0.5 text-[10px] font-medium text-emerald-400",children:a})}const g=h({method:"GET"}).handler(i("04ac41a7e3e644815167d098c2d6c3375d00a72a11e5af0d37033ba771081ba9")),y=p({queryKey:["app-info"],queryFn:()=>g(),staleTime:1/0,refetchOnWindowFocus:!1}),j=[{to:"/sessions",label:"Sessions",icon:e.jsxs("svg",{className:"h-4 w-4",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[e.jsx("line",{x1:"2",y1:"4",x2:"14",y2:"4"}),e.jsx("line",{x1:"2",y1:"8",x2:"14",y2:"8"}),e.jsx("line",{x1:"2",y1:"12",x2:"14",y2:"12"})]})},{to:"/stats",label:"Stats",icon:e.jsxs("svg",{className:"h-4 w-4",viewBox:"0 0 16 16",fill:"currentColor",children:[e.jsx("rect",{x:"1",y:"8",width:"3",height:"7",rx:"0.5"}),e.jsx("rect",{x:"6.5",y:"4",width:"3",height:"11",rx:"0.5"}),e.jsx("rect",{x:"12",y:"1",width:"3",height:"14",rx:"0.5"})]})},{to:"/settings",label:"Settings",icon:e.jsxs("svg",{className:"h-4 w-4",viewBox:"0 0 16 16",fill:"currentColor",children:[e.jsx("path",{d:"M8 10a2 2 0 100-4 2 2 0 000 4z"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.5.8a1 1 0 011-.8h1a1 1 0 011 .8l.15.9a5.5 5.5 0 011.1.64l.86-.36a1 1 0 011.17.36l.5.86a1 1 0 01-.18 1.17l-.7.55a5.5 5.5 0 010 1.27l.7.55a1 1 0 01.18 1.17l-.5.86a1 1 0 01-1.17.36l-.86-.36a5.5 5.5 0 01-1.1.64l-.14.9a1 1 0 01-1 .8h-1a1 1 0 01-1-.8l-.14-.9a5.5 5.5 0 01-1.1-.64l-.87.36a1 1 0 01-1.17-.36l-.5-.86a1 1 0 01.18-1.17l.7-.55a5.5 5.5 0 010-1.27l-.7-.55a1 1 0 01-.18-1.17l.5-.86a1 1 0 011.17-.36l.87.36a5.5 5.5 0 011.1-.64L6.5.8zM8 11a3 3 0 100-6 3 3 0 000 6z"})]})}];function f({children:r}){const a=x(),o=a[a.length-1]?.pathname??"",{data:t}=n(y);return e.jsxs("div",{className:"flex min-h-screen",children:[e.jsxs("aside",{className:"flex w-56 shrink-0 flex-col border-r border-gray-800 bg-gray-950",children:[e.jsx("div",{className:"flex h-14 items-center border-b border-gray-800 px-4",children:e.jsxs(l,{to:"/sessions",className:"text-sm font-bold text-gray-100",children:[e.jsx("span",{className:"text-brand-500",children:"Claude"})," Dashboard"]})}),e.jsx("nav",{className:"flex-1 p-3",children:j.map(s=>{const c=o.startsWith(s.to);return e.jsxs(l,{to:s.to,className:`flex items-center gap-2.5 rounded-lg px-3 py-2 text-sm transition-colors ${c?"bg-gray-800 text-gray-100":"text-gray-400 hover:bg-gray-900 hover:text-gray-200"}`,children:[e.jsx("span",{className:"text-gray-500",children:s.icon}),s.label,s.to==="/sessions"&&e.jsx(u,{})]},s.to)})}),e.jsxs("div",{className:"border-t border-gray-800 p-3 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("a",{href:"https://github.com/dlupiak/claude-session-dashboard",target:"_blank",rel:"noopener noreferrer",className:"text-gray-500 hover:text-gray-300 transition-colors",title:"GitHub Repository",children:e.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 16 16",fill:"currentColor",children:e.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})})}),e.jsx("a",{href:"https://www.npmjs.com/package/claude-session-dashboard",target:"_blank",rel:"noopener noreferrer",className:"text-gray-500 hover:text-gray-300 transition-colors",title:"npm Package",children:e.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 16 16",fill:"currentColor",children:e.jsx("path",{d:"M0 0v16h16V0H0zm13 13H8V5H5v8H3V3h10v10z"})})})]}),e.jsx("p",{className:"text-xs text-gray-500",children:"Read-only"})]}),t&&e.jsxs("p",{className:"mt-1.5 truncate text-[10px] text-gray-500",title:`v${t.version} · ${t.appPath}`,children:["v",t.version," · ",t.appPath]})]})]}),e.jsx("main",{className:"flex-1 overflow-auto",children:e.jsx("div",{className:"mx-auto max-w-5xl px-6 py-6",children:r})})]})}function w(){return e.jsx(f,{children:e.jsx(d,{})})}export{w as component};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as v,c as ae,j as e,L as W,h as G,b as ne}from"./main-B6FohBFQ.js";import{c as re,q as le,u as _}from"./createServerFn-6SJrpRCO.js";import{f as C,d as X,b as M,i as V,g as E}from"./format-Bsprb3az.js";import{r as oe,a7 as ie,l as ce,bz as de,bA as xe,aw as me,bB as ue,d as P,bC as pe,bD as ge,bE as Y,bF as he,s as fe,aa as ye,Z as be,a as je,bG as ve,bH as Ne,at as O,bI as q,bJ as ke,bn as we,bq as Te,bo as Me,bp as Se,br as Ce,bK as Ie,bL as De,bs as J,bt as Ae,bu as $e,bM as Oe}from"./useSessionCost-Drt0v6oj.js";import{s as Ee}from"./settings.types-LYd9Z8Y1.js";import{a as Pe}from"./sessions.queries-ClgzoOt4.js";class Le{constructor(s){var{x:a,y:n}=s;this.xAxisScale=a,this.yAxisScale=n}map(s,a){var n,r,{position:o}=a;return{x:(n=this.xAxisScale.map(s.x,{position:o}))!==null&&n!==void 0?n:0,y:(r=this.yAxisScale.map(s.y,{position:o}))!==null&&r!==void 0?r:0}}mapWithFallback(s,a){var n,r,{position:o,fallback:l}=a,d,i;return l==="rangeMin"?d=this.yAxisScale.rangeMin():l==="rangeMax"?d=this.yAxisScale.rangeMax():d=0,l==="rangeMin"?i=this.xAxisScale.rangeMin():l==="rangeMax"?i=this.xAxisScale.rangeMax():i=0,{x:(n=this.xAxisScale.map(s.x,{position:o}))!==null&&n!==void 0?n:i,y:(r=this.yAxisScale.map(s.y,{position:o}))!==null&&r!==void 0?r:d}}isInRange(s){var{x:a,y:n}=s,r=a==null||this.xAxisScale.isInRange(a),o=n==null||this.yAxisScale.isInRange(n);return r&&o}}function K(t,s){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);s&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function Z(t){for(var s=1;s<arguments.length;s++){var a=arguments[s]!=null?arguments[s]:{};s%2?K(Object(a),!0).forEach(function(n){Re(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):K(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function Re(t,s,a){return(s=Ue(s))in t?Object.defineProperty(t,s,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[s]=a,t}function Ue(t){var s=We(t,"string");return typeof s=="symbol"?s:s+""}function We(t,s){if(typeof t!="object"||!t)return t;var a=t[Symbol.toPrimitive];if(a!==void 0){var n=a.call(t,s);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(t)}function R(){return R=Object.assign?Object.assign.bind():function(t){for(var s=1;s<arguments.length;s++){var a=arguments[s];for(var n in a)({}).hasOwnProperty.call(a,n)&&(t[n]=a[n])}return t},R.apply(null,arguments)}var Fe=(t,s)=>{var a;if(v.isValidElement(t))a=v.cloneElement(t,s);else if(typeof t=="function")a=t(s);else{if(!O(s.x1)||!O(s.y1)||!O(s.x2)||!O(s.y2))return null;a=v.createElement("line",R({},s,{className:"recharts-reference-line-line"}))}return a},_e=(t,s,a,n,r,o)=>{var{x:l,width:d}=o,i=r.map(t,{position:a});if(!O(i)||s==="discard"&&!r.isInRange(i))return null;var g=[{x:l+d,y:i},{x:l,y:i}];return n==="left"?g.reverse():g},Xe=(t,s,a,n,r,o)=>{var{y:l,height:d}=o,i=r.map(t,{position:a});if(!O(i)||s==="discard"&&!r.isInRange(i))return null;var g=[{x:i,y:l+d},{x:i,y:l}];return n==="top"?g.reverse():g},Be=(t,s,a,n)=>{var r=[n.mapWithFallback(t[0],{position:a,fallback:"rangeMin"}),n.mapWithFallback(t[1],{position:a,fallback:"rangeMax"})];return s==="discard"&&r.some(o=>!n.isInRange(o))?null:r},ze=(t,s,a,n,r,o,l)=>{var{x:d,y:i,segment:g,ifOverflow:p}=l,f=q(d),h=q(i);return h?_e(i,p,n,o,s,a):f?Xe(d,p,n,r,t,a):g!=null&&g.length===2?Be(g,p,n,new Le({x:t,y:s})):null};function He(t){var s=ce();return v.useEffect(()=>(s(de(t)),()=>{s(xe(t))})),null}function Ge(t){var{xAxisId:s,yAxisId:a,shape:n,className:r,ifOverflow:o}=t,l=me(),d=ue(),i=P(S=>pe(S,s)),g=P(S=>ge(S,a)),p=P(S=>Y(S,"xAxis",s,l)),f=P(S=>Y(S,"yAxis",a,l)),h=he();if(!d||!h||i==null||g==null||p==null||f==null)return null;var N=ze(p,f,h,t.position,i.orientation,g.orientation,t);if(!N)return null;var k=N[0],c=N[1];if(k==null||c==null)return null;var{x:u,y:x}=k,{x:j,y:m}=c,b=o==="hidden"?"url(#".concat(d,")"):void 0,y=Z(Z({clipPath:b},fe(t)),{},{x1:u,y1:x,x2:j,y2:m}),w=ke({x1:u,y1:x,x2:j,y2:m});return v.createElement(ye,{zIndex:t.zIndex},v.createElement(be,{className:je("recharts-reference-line",r)},Fe(n,y),v.createElement(ve,R({},w,{lowerWidth:w.width,upperWidth:w.width}),v.createElement(Ne,{label:t.label}),t.children)))}var Ye={ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",label:!1,stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle",zIndex:ie.line};function F(t){var s=oe(t,Ye);return v.createElement(v.Fragment,null,v.createElement(He,{yAxisId:s.yAxisId,xAxisId:s.xAxisId,ifOverflow:s.ifOverflow,x:s.x,y:s.y,segment:s.segment}),v.createElement(Ge,s))}F.displayName="ReferenceLine";const qe=re({method:"GET"}).handler(ae("71794080473579a94431392ab409ebd02772f6a9f6a08386cadbb8c0d3cf804a"));function Ke(t,s,a){return le({queryKey:["session","detail",t],queryFn:()=>qe({data:{sessionId:t,projectPath:s}}),staleTime:a?2e3:3e4,refetchInterval:a?5e3:void 0})}function Ze(t,s,a,n){const r=[];for(const c of t)if(c.timestamp){const u=new Date(c.timestamp).getTime();isNaN(u)||r.push(u)}for(const c of s)if(c.timestamp){const u=new Date(c.timestamp).getTime();isNaN(u)||r.push(u)}for(const c of a)if(c.timestamp){const u=new Date(c.timestamp).getTime();isNaN(u)||r.push(u)}if(r.length===0)return{startMs:0,endMs:0,durationMs:0,mainLane:[],agentLanes:[],skillMarkers:[],errorMarkers:[]};const o=Math.min(...r),l=Math.max(...r),d=Math.max(l-o,1);function i(c){return(c-o)/d}const g=new Set(s.map(c=>c.toolUseId)),p=new Set(a.map(c=>c.toolUseId)),f=[];for(const c of t){if(c.type!=="assistant"||c.toolCalls.length===0)continue;const u=new Date(c.timestamp).getTime();if(!isNaN(u))for(const x of c.toolCalls)g.has(x.toolUseId)||p.has(x.toolUseId)||f.push({timestampMs:u,toolName:x.toolName,toolUseId:x.toolUseId,relativeX:i(u)})}const h=s.map(c=>{const u=new Date(c.timestamp).getTime(),x=c.durationMs?u+c.durationMs:u+d*.02,j=[];if(c.toolCalls){const m=Object.entries(c.toolCalls).sort(([,w],[,S])=>S-w),b=m.reduce((w,[,S])=>w+S,0);let y=0;for(const[w,S]of m)for(let H=0;H<S;H++){const te=b>1?y/(b-1):.5,se=u+(x-u)*te;j.push({toolName:w,count:1,relativeX:i(se)}),y++}}return{subagentType:c.subagentType,description:c.description,startMs:u,endMs:x,startX:i(u),endX:i(x),durationMs:c.durationMs??null,totalTokens:c.totalTokens??null,totalToolUseCount:c.totalToolUseCount??null,toolDots:j,skills:c.skills?.map(m=>({skill:m.skill,args:m.args}))??[]}}),N=a.map(c=>{const u=new Date(c.timestamp).getTime();return isNaN(u)?null:{skill:c.skill,args:c.args,timestampMs:u,relativeX:i(u)}}).filter(c=>c!==null),k=n.map(c=>{const u=new Date(c.timestamp).getTime();return isNaN(u)?null:{message:c.message,type:c.type,timestampMs:u,relativeX:i(u)}}).filter(c=>c!==null);return{startMs:o,endMs:l,durationMs:d,mainLane:f,agentLanes:h,skillMarkers:N,errorMarkers:k}}function B(t){const s=t.match(/^mcp__[^_]+_[^_]+_[^_]+__(.+)$/);return s?s[1]:t}const Qe={Read:"#e09070",Grep:"#e09070",Glob:"#e09070",Write:"#34d399",Edit:"#34d399",NotebookEdit:"#34d399",Bash:"#fbbf24",Task:"#818cf8",TaskCreate:"#c084fc",TaskUpdate:"#c084fc",TaskList:"#c084fc",TaskGet:"#c084fc",Skill:"#fcd34d",WebSearch:"#22d3ee",WebFetch:"#22d3ee",EnterPlanMode:"#f472b6",ExitPlanMode:"#f472b6",AskUserQuestion:"#a78bfa"},Ve="#9ca3af";function z(t){return Qe[t]??Ve}const I=90,$=16,D=24,T=32,U=8,ee=4;function Je(t,s,a){const n=s-t;if(n<=0)return[];const r=Math.max(3,Math.round(a/120)),o=n/r,l=[5e3,1e4,15e3,3e4,6e4,2*6e4,5*6e4,10*6e4,15*6e4,30*6e4,60*6e4,120*6e4],d=l.find(h=>h>=o)??l[l.length-1],g=n<5*6e4?"HH:mm:ss":"HH:mm",p=Math.ceil(t/d)*d,f=[];for(let h=p;h<=s;h+=d){const N=(h-t)/n;f.push({ms:h,label:C(new Date(h),g),x:I+N*(a-I-$)})}return f}function et({data:t,width:s,onHover:a}){const n=v.useRef(null),r=s,o=r-I-$,l=t.skillMarkers.length>0,d=t.errorMarkers.length>0;let i=D;const g=i;i+=T;const p=[];for(let x=0;x<t.agentLanes.length;x++)i+=U,p.push(i),i+=T;let f=0;l&&(i+=U,f=i,i+=T);let h=0;d&&(i+=U,h=i,i+=T);const N=Math.max(i+8,80);function k(x){return I+x*o}const c=v.useCallback(x=>{if(!n.current)return{x:0,y:0};const j=n.current.getBoundingClientRect();return{x:x.clientX-j.left,y:x.clientY-j.top}},[]),u=Je(t.startMs,t.endMs,r);return e.jsxs("svg",{ref:n,width:r,height:N,className:"select-none",role:"img","aria-label":"Session timeline showing tool calls, agent runs, and skill invocations",onMouseLeave:()=>a(null,{x:0,y:0}),children:[e.jsx("line",{x1:I,y1:D-4,x2:r-$,y2:D-4,stroke:"var(--color-gray-700)",strokeWidth:1}),u.map(x=>e.jsxs("g",{children:[e.jsx("line",{x1:x.x,y1:D-8,x2:x.x,y2:D-4,stroke:"var(--color-gray-600)",strokeWidth:1}),e.jsx("text",{x:x.x,y:D-12,textAnchor:"middle",className:"fill-gray-500 text-[10px]",children:x.label})]},x.ms)),e.jsx("text",{x:4,y:g+T/2+4,className:"fill-gray-500 text-[11px] font-medium",children:"Main"}),e.jsx("line",{x1:I,y1:g+T/2,x2:r-$,y2:g+T/2,stroke:"var(--color-gray-800)",strokeWidth:1,strokeDasharray:"2,4"}),t.mainLane.map(x=>e.jsx("circle",{cx:k(x.relativeX),cy:g+T/2,r:ee,fill:z(x.toolName),opacity:.85,className:"cursor-pointer transition-transform hover:opacity-100",onMouseEnter:j=>a({kind:"tool",toolName:x.toolName,timestamp:new Date(x.timestampMs).toISOString(),toolUseId:x.toolUseId},c(j)),onMouseLeave:()=>a(null,{x:0,y:0}),children:e.jsx("title",{children:x.toolName})},x.toolUseId)),t.agentLanes.map((x,j)=>e.jsx(tt,{lane:x,y:p[j],toX:k,laneHeight:T,onHover:a,getPosition:c},`${x.subagentType}-${j}`)),l&&e.jsxs(e.Fragment,{children:[e.jsx("text",{x:4,y:f+T/2+4,className:"fill-amber-400/70 text-[11px] font-medium",children:"Skills"}),e.jsx("line",{x1:I,y1:f+T/2,x2:r-$,y2:f+T/2,stroke:"var(--color-gray-800)",strokeWidth:1,strokeDasharray:"2,4"}),t.skillMarkers.map((x,j)=>{const m=k(x.relativeX),b=f+T/2,y=5;return e.jsx("polygon",{points:`${m},${b-y} ${m+y},${b} ${m},${b+y} ${m-y},${b}`,fill:"#fbbf24",opacity:.85,className:"cursor-pointer hover:opacity-100",onMouseEnter:w=>a({kind:"skill",skill:x.skill,args:x.args,timestamp:new Date(x.timestampMs).toISOString()},c(w)),onMouseLeave:()=>a(null,{x:0,y:0}),children:e.jsxs("title",{children:["/",x.skill]})},`${x.skill}-${j}`)})]}),d&&e.jsxs(e.Fragment,{children:[e.jsx("text",{x:4,y:h+T/2+4,className:"fill-red-400/70 text-[11px] font-medium",children:"Errors"}),e.jsx("line",{x1:I,y1:h+T/2,x2:r-$,y2:h+T/2,stroke:"var(--color-gray-800)",strokeWidth:1,strokeDasharray:"2,4"}),t.errorMarkers.map((x,j)=>{const m=k(x.relativeX),b=h+T/2,y=5;return e.jsxs("g",{className:"cursor-pointer hover:opacity-100",opacity:.85,onMouseEnter:w=>a({kind:"error",message:x.message,type:x.type,timestamp:new Date(x.timestampMs).toISOString()},c(w)),onMouseLeave:()=>a(null,{x:0,y:0}),children:[e.jsx("line",{x1:m-y,y1:b-y,x2:m+y,y2:b+y,stroke:"#f87171",strokeWidth:2,strokeLinecap:"round"}),e.jsx("line",{x1:m+y,y1:b-y,x2:m-y,y2:b+y,stroke:"#f87171",strokeWidth:2,strokeLinecap:"round"}),e.jsxs("title",{children:[x.type,": ",x.message]})]},`err-${j}`)})]})]})}function tt({lane:t,y:s,toX:a,laneHeight:n,onHover:r,getPosition:o}){const l=a(t.startX),d=Math.max(a(t.endX)-l,8),i=s+n/2,g=t.subagentType.length>10?t.subagentType.slice(0,10)+"...":t.subagentType;return e.jsxs("g",{children:[e.jsx("text",{x:4,y:i+4,className:"fill-indigo-400/70 text-[11px] font-medium",children:g}),e.jsx("rect",{x:l,y:s+2,width:d,height:n-4,rx:6,fill:"rgba(99, 102, 241, 0.08)",stroke:"rgba(99, 102, 241, 0.2)",strokeWidth:1,className:"cursor-pointer hover:fill-indigo-500/15",onMouseEnter:p=>r({kind:"agent",agent:t},o(p)),onMouseLeave:()=>r(null,{x:0,y:0}),children:e.jsxs("title",{children:[t.subagentType,": ",t.description]})}),e.jsx("line",{x1:l+4,y1:i,x2:l+d-4,y2:i,stroke:"rgba(99, 102, 241, 0.15)",strokeWidth:1}),t.toolDots.map((p,f)=>e.jsx("circle",{cx:a(p.relativeX),cy:i,r:ee-.5,fill:z(p.toolName),opacity:.75,className:"cursor-pointer hover:opacity-100",onMouseEnter:h=>r({kind:"tool",toolName:p.toolName,timestamp:new Date(t.startMs+(p.relativeX-t.startX)/(t.endX-t.startX)*(t.endMs-t.startMs)).toISOString(),toolUseId:`${t.subagentType}-${p.toolName}-${f}`},o(h)),onMouseLeave:()=>r(null,{x:0,y:0}),children:e.jsxs("title",{children:[p.toolName," (",t.subagentType,")"]})},`${p.toolName}-${f}`)),t.skills&&t.skills.length>0&&t.skills.map((p,f)=>{const h=t.startX+(t.endX-t.startX)/(t.skills.length+1)*(f+1),N=a(h),k=s+6,c=3;return e.jsx("polygon",{points:`${N},${k-c} ${N+c},${k} ${N},${k+c} ${N-c},${k}`,fill:"#fbbf24",opacity:.85,className:"cursor-pointer hover:opacity-100",onMouseEnter:u=>r({kind:"skill",skill:p.skill,args:p.args,timestamp:new Date(t.startMs).toISOString()},o(u)),onMouseLeave:()=>r(null,{x:0,y:0}),children:e.jsxs("title",{children:["/",p.skill," (",t.subagentType,")"]})},`skill-${p.skill}-${f}`)})]})}function st({item:t,position:s}){return e.jsxs("div",{className:"pointer-events-none absolute z-50 rounded-lg border border-gray-700 bg-gray-900 px-3 py-2 text-xs shadow-xl",style:{left:s.x,top:s.y,transform:"translate(-50%, -100%) translateY(-8px)"},children:[t.kind==="tool"&&e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-gray-100",children:B(t.toolName)}),e.jsx("div",{className:"text-gray-400",children:C(new Date(t.timestamp),"HH:mm:ss")}),e.jsxs("div",{className:"font-mono text-[10px] text-gray-600",children:[t.toolUseId.slice(0,16),"..."]})]}),t.kind==="agent"&&e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-indigo-300",children:t.agent.subagentType}),e.jsx("div",{className:"max-w-48 truncate text-gray-400",children:t.agent.description}),e.jsx("div",{className:"mt-1 flex items-center gap-2 text-gray-500",children:t.agent.durationMs!=null&&e.jsxs("span",{children:[C(new Date(t.agent.startMs),"HH:mm")," -"," ",C(new Date(t.agent.endMs),"HH:mm")," (",X(t.agent.durationMs),")"]})}),e.jsxs("div",{className:"flex items-center gap-2 text-gray-500",children:[t.agent.totalTokens!=null&&e.jsxs("span",{children:[M(t.agent.totalTokens)," tokens"]}),t.agent.totalToolUseCount!=null&&e.jsxs("span",{children:[t.agent.totalToolUseCount," tools"]})]})]}),t.kind==="skill"&&e.jsxs("div",{children:[e.jsxs("div",{className:"font-semibold text-amber-300",children:["/",t.skill]}),t.args&&e.jsx("div",{className:"text-gray-400",children:t.args}),e.jsx("div",{className:"text-gray-500",children:C(new Date(t.timestamp),"HH:mm:ss")})]}),t.kind==="error"&&e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-red-400",children:t.type}),e.jsx("div",{className:"max-w-48 truncate text-gray-400",children:t.message}),e.jsx("div",{className:"text-gray-500",children:C(new Date(t.timestamp),"HH:mm:ss")})]})]})}function at({toolNames:t}){const s=[...new Set(t)].slice(0,12);return s.length===0?null:e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 px-1 text-[10px] text-gray-500",children:[s.map(a=>e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"inline-block h-2 w-2 rounded-full",style:{backgroundColor:z(a)}}),e.jsx("span",{children:B(a)})]},a)),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"inline-block h-2 w-2 rotate-45 bg-amber-400"}),e.jsx("span",{children:"Skill"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-red-400 font-bold leading-none",children:"×"}),e.jsx("span",{children:"Error"})]})]})}function nt({turns:t,agents:s,skills:a,errors:n}){const r=v.useRef(null),[o,l]=v.useState(0),[d,i]=v.useState(1),[g,p]=v.useState(null);v.useEffect(()=>{if(!r.current)return;const m=new ResizeObserver(b=>{const y=b[0];y&&l(y.contentRect.width)});return m.observe(r.current),()=>m.disconnect()},[]);const f=v.useMemo(()=>Ze(t,s,a,n),[t,s,a,n]),h=v.useMemo(()=>{const m=f.mainLane.map(y=>y.toolName);for(const y of f.agentLanes)for(const w of y.toolDots)m.push(w.toolName);const b={};for(const y of m)b[y]=(b[y]??0)+1;return Object.entries(b).sort(([,y],[,w])=>w-y).map(([y])=>y)},[f]),N=(m,b)=>{p(m?{item:m,position:b}:null)};if(t.length===0)return e.jsx("div",{className:"py-8 text-center text-sm text-gray-500",children:"No timeline data available"});const k=new Set(s.map(m=>m.toolUseId)),c=new Set(a.map(m=>m.toolUseId));let u=0,x=0,j=0;for(const m of t)if(m.type==="user"&&m.message?.trim()&&u++,m.type==="assistant"){x++;for(const b of m.toolCalls)!k.has(b.toolUseId)&&!c.has(b.toolUseId)&&j++}return e.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900/50 p-4",children:[e.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-4",children:[e.jsx(A,{label:"User commands",value:u,color:"blue"}),e.jsx(A,{label:"AI responses",value:x,color:"purple"}),j>0&&e.jsx(A,{label:"Tool calls",value:j,color:"gray"}),s.length>0&&e.jsx(A,{label:"Agents",value:s.length,color:"indigo"}),a.length>0&&e.jsx(A,{label:"Skills",value:a.length,color:"amber"}),n.length>0&&e.jsx(A,{label:"Errors",value:n.length,color:"red"})]}),e.jsxs("div",{className:"mb-3 flex items-start justify-between gap-2",children:[e.jsx("div",{className:"flex-1",children:h.length>0&&e.jsx(at,{toolNames:h})}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[e.jsx("button",{type:"button",onClick:()=>i(m=>Math.max(1,m-.5)),disabled:d<=1,className:"rounded bg-gray-800 px-2 py-0.5 text-xs text-gray-300 transition-colors hover:bg-gray-700 disabled:opacity-30",title:"Zoom out",children:"−"}),e.jsx("span",{className:"min-w-[3rem] text-center text-[10px] tabular-nums text-gray-500",children:d===1?"Fit":`${d.toFixed(1)}x`}),e.jsx("button",{type:"button",onClick:()=>i(m=>Math.min(8,m+.5)),disabled:d>=8,className:"rounded bg-gray-800 px-2 py-0.5 text-xs text-gray-300 transition-colors hover:bg-gray-700 disabled:opacity-30",title:"Zoom in",children:"+"}),d>1&&e.jsx("button",{type:"button",onClick:()=>i(1),className:"ml-1 rounded bg-gray-800 px-2 py-0.5 text-[10px] text-gray-400 transition-colors hover:bg-gray-700",title:"Reset zoom",children:"Reset"})]})]}),e.jsx("div",{ref:r,className:"relative overflow-x-auto",children:o>0&&e.jsxs(e.Fragment,{children:[e.jsx(et,{data:f,width:Math.max(o*d,400),onHover:N}),g&&e.jsx(st,{item:g.item,position:g.position})]})})]})}function A({label:t,value:s,color:a}){const n={blue:"bg-brand-500/15 text-brand-400",purple:"bg-purple-500/15 text-purple-400",gray:"bg-gray-800 text-gray-300",indigo:"bg-indigo-500/15 text-indigo-400",amber:"bg-amber-500/15 text-amber-400",red:"bg-red-500/15 text-red-400"};return e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:`rounded-md px-2 py-1 text-sm font-bold tabular-nums ${n[a]}`,children:s}),e.jsx("span",{className:"text-[11px] text-gray-500",children:t})]})}function rt({contextWindow:t,tokens:s}){const[a,n]=v.useState(!1);if(!t)return e.jsx(ot,{tokens:s});const{contextLimit:r,modelName:o,systemOverhead:l,currentContextSize:d,messagesEstimate:i,freeSpace:g,autocompactBuffer:p,usagePercent:f,snapshots:h}=t,N=l/r*100,k=i/r*100,c=p/r*100,u=Math.max(0,100-N-k),x=o.replace(/^claude-/,"").split("-202")[0],j=h.map(m=>({turn:m.turnIndex,context:m.contextSize}));return e.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900/50 p-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Context Window"}),e.jsx("span",{className:"rounded bg-gray-800 px-1.5 py-0.5 text-[10px] font-mono text-gray-400",children:x})]}),e.jsxs("div",{className:"mt-1 flex items-baseline gap-1",children:[e.jsx("span",{className:"text-2xl font-bold text-gray-100",children:M(d)}),e.jsxs("span",{className:"text-sm text-gray-500",children:["/ ",M(r)]}),e.jsxs("span",{className:"text-sm text-gray-400",children:["(",f,"%)"]})]}),e.jsx("p",{className:"text-[10px] text-gray-500",children:"~estimated from token usage"}),e.jsxs("div",{className:"mt-3 flex h-3 overflow-hidden rounded-full bg-gray-800",children:[e.jsx("div",{className:"bg-purple-500",style:{width:`${N}%`},title:`System: ~${M(l)}`}),e.jsx("div",{className:"bg-brand-500",style:{width:`${k}%`},title:`Messages: ~${M(i)}`}),u>0&&e.jsx(e.Fragment,{children:u>c?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"bg-gray-700",style:{width:`${u-c}%`}}),e.jsx("div",{className:"autocompact-stripe",style:{width:`${Math.min(c,u)}%`}})]}):e.jsx("div",{className:"autocompact-stripe",style:{width:`${u}%`}})})]}),e.jsxs("div",{className:"mt-1 flex gap-3 text-[10px] text-gray-500",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-purple-500"}),"system"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-brand-500"}),"messages"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-gray-700"}),"free"]})]}),e.jsxs("div",{className:"mt-3 space-y-1.5",children:[e.jsx(L,{label:"System overhead",value:l,total:r,color:"bg-purple-500",prefix:"~"}),e.jsx(L,{label:"Messages",value:i,total:r,color:"bg-brand-500",prefix:"~"}),e.jsx(L,{label:"Autocompact buffer",value:p,total:r,color:"bg-amber-500"}),e.jsx(L,{label:"Free space",value:g,total:r,color:"bg-gray-600"})]}),j.length>1&&e.jsxs("div",{className:"mt-3",children:[e.jsx("p",{className:"mb-1 text-[10px] text-gray-500",children:"Context growth"}),e.jsx(we,{width:"100%",height:96,children:e.jsxs(Te,{data:j,children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"contextGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"#d97757",stopOpacity:.3}),e.jsx("stop",{offset:"100%",stopColor:"#d97757",stopOpacity:.05})]})}),e.jsx(Me,{domain:[0,r],hide:!0}),e.jsx(Se,{contentStyle:{background:"var(--color-gray-900)",border:"1px solid var(--color-gray-700)",borderRadius:"8px",fontSize:"11px"},labelFormatter:m=>`Turn ${m}`,formatter:m=>[M(m),"Context"]}),e.jsx(F,{y:r,stroke:"#ef4444",strokeDasharray:"4 4",strokeOpacity:.5}),e.jsx(F,{y:r-p,stroke:"#f59e0b",strokeDasharray:"2 4",strokeOpacity:.3}),e.jsx(Ce,{type:"stepAfter",dataKey:"context",stroke:"#d97757",fill:"url(#contextGrad)",strokeWidth:1.5,dot:!1})]})})]}),e.jsxs("button",{onClick:()=>n(!a),className:"mt-3 flex w-full items-center gap-1 text-xs text-gray-400 hover:text-gray-300 transition-colors",children:[e.jsx("span",{className:"text-[10px]",children:a?"▾":"▸"}),"Token Details"]}),a&&e.jsx(lt,{tokens:s}),e.jsx("style",{children:`
|
|
1
|
+
import{r as b,c as ae,j as e,L as W,h as G,b as ne}from"./main-DMwMzWYr.js";import{c as re,q as le,u as F}from"./createServerFn-DJjqV8Yc.js";import{f as S,d as X,b as M,i as V,g as E}from"./format-Bsprb3az.js";import{r as oe,a8 as ie,l as ce,bB as de,bC as xe,ax as me,bD as ue,d as P,bE as pe,bF as ge,bG as Y,bH as he,s as ye,ab as fe,_ as be,a as je,bI as ve,bJ as Ne,au as O,bK as q,bL as ke,bp as we,bs as Te,bq as Me,br as Ce,bt as Se,bM as Ie,bN as De,bu as J,bv as Ae,bw as $e,bO as Oe}from"./useSessionCost-BPqnyONZ.js";import{s as Ee}from"./settings.types-BNSfIfFX.js";import{a as Pe}from"./sessions.queries-D7WObk5d.js";class Le{constructor(s){var{x:a,y:n}=s;this.xAxisScale=a,this.yAxisScale=n}map(s,a){var n,r,{position:o}=a;return{x:(n=this.xAxisScale.map(s.x,{position:o}))!==null&&n!==void 0?n:0,y:(r=this.yAxisScale.map(s.y,{position:o}))!==null&&r!==void 0?r:0}}mapWithFallback(s,a){var n,r,{position:o,fallback:l}=a,d,i;return l==="rangeMin"?d=this.yAxisScale.rangeMin():l==="rangeMax"?d=this.yAxisScale.rangeMax():d=0,l==="rangeMin"?i=this.xAxisScale.rangeMin():l==="rangeMax"?i=this.xAxisScale.rangeMax():i=0,{x:(n=this.xAxisScale.map(s.x,{position:o}))!==null&&n!==void 0?n:i,y:(r=this.yAxisScale.map(s.y,{position:o}))!==null&&r!==void 0?r:d}}isInRange(s){var{x:a,y:n}=s,r=a==null||this.xAxisScale.isInRange(a),o=n==null||this.yAxisScale.isInRange(n);return r&&o}}function K(t,s){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);s&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function Q(t){for(var s=1;s<arguments.length;s++){var a=arguments[s]!=null?arguments[s]:{};s%2?K(Object(a),!0).forEach(function(n){Re(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):K(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function Re(t,s,a){return(s=Ue(s))in t?Object.defineProperty(t,s,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[s]=a,t}function Ue(t){var s=We(t,"string");return typeof s=="symbol"?s:s+""}function We(t,s){if(typeof t!="object"||!t)return t;var a=t[Symbol.toPrimitive];if(a!==void 0){var n=a.call(t,s);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(t)}function R(){return R=Object.assign?Object.assign.bind():function(t){for(var s=1;s<arguments.length;s++){var a=arguments[s];for(var n in a)({}).hasOwnProperty.call(a,n)&&(t[n]=a[n])}return t},R.apply(null,arguments)}var _e=(t,s)=>{var a;if(b.isValidElement(t))a=b.cloneElement(t,s);else if(typeof t=="function")a=t(s);else{if(!O(s.x1)||!O(s.y1)||!O(s.x2)||!O(s.y2))return null;a=b.createElement("line",R({},s,{className:"recharts-reference-line-line"}))}return a},Fe=(t,s,a,n,r,o)=>{var{x:l,width:d}=o,i=r.map(t,{position:a});if(!O(i)||s==="discard"&&!r.isInRange(i))return null;var g=[{x:l+d,y:i},{x:l,y:i}];return n==="left"?g.reverse():g},Xe=(t,s,a,n,r,o)=>{var{y:l,height:d}=o,i=r.map(t,{position:a});if(!O(i)||s==="discard"&&!r.isInRange(i))return null;var g=[{x:i,y:l+d},{x:i,y:l}];return n==="top"?g.reverse():g},Be=(t,s,a,n)=>{var r=[n.mapWithFallback(t[0],{position:a,fallback:"rangeMin"}),n.mapWithFallback(t[1],{position:a,fallback:"rangeMax"})];return s==="discard"&&r.some(o=>!n.isInRange(o))?null:r},He=(t,s,a,n,r,o,l)=>{var{x:d,y:i,segment:g,ifOverflow:p}=l,y=q(d),h=q(i);return h?Fe(i,p,n,o,s,a):y?Xe(d,p,n,r,t,a):g!=null&&g.length===2?Be(g,p,n,new Le({x:t,y:s})):null};function ze(t){var s=ce();return b.useEffect(()=>(s(de(t)),()=>{s(xe(t))})),null}function Ge(t){var{xAxisId:s,yAxisId:a,shape:n,className:r,ifOverflow:o}=t,l=me(),d=ue(),i=P(C=>pe(C,s)),g=P(C=>ge(C,a)),p=P(C=>Y(C,"xAxis",s,l)),y=P(C=>Y(C,"yAxis",a,l)),h=he();if(!d||!h||i==null||g==null||p==null||y==null)return null;var N=He(p,y,h,t.position,i.orientation,g.orientation,t);if(!N)return null;var k=N[0],c=N[1];if(k==null||c==null)return null;var{x:u,y:x}=k,{x:v,y:m}=c,j=o==="hidden"?"url(#".concat(d,")"):void 0,f=Q(Q({clipPath:j},ye(t)),{},{x1:u,y1:x,x2:v,y2:m}),w=ke({x1:u,y1:x,x2:v,y2:m});return b.createElement(fe,{zIndex:t.zIndex},b.createElement(be,{className:je("recharts-reference-line",r)},_e(n,f),b.createElement(ve,R({},w,{lowerWidth:w.width,upperWidth:w.width}),b.createElement(Ne,{label:t.label}),t.children)))}var Ye={ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",label:!1,stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle",zIndex:ie.line};function _(t){var s=oe(t,Ye);return b.createElement(b.Fragment,null,b.createElement(ze,{yAxisId:s.yAxisId,xAxisId:s.xAxisId,ifOverflow:s.ifOverflow,x:s.x,y:s.y,segment:s.segment}),b.createElement(Ge,s))}_.displayName="ReferenceLine";const qe=re({method:"GET"}).handler(ae("71794080473579a94431392ab409ebd02772f6a9f6a08386cadbb8c0d3cf804a"));function Ke(t,s,a){return le({queryKey:["session","detail",t],queryFn:()=>qe({data:{sessionId:t,projectPath:s}}),staleTime:a?2e3:3e4,refetchInterval:a?5e3:void 0})}function Qe(t,s,a,n){const r=[];for(const c of t)if(c.timestamp){const u=new Date(c.timestamp).getTime();isNaN(u)||r.push(u)}for(const c of s)if(c.timestamp){const u=new Date(c.timestamp).getTime();isNaN(u)||r.push(u)}for(const c of a)if(c.timestamp){const u=new Date(c.timestamp).getTime();isNaN(u)||r.push(u)}if(r.length===0)return{startMs:0,endMs:0,durationMs:0,mainLane:[],agentLanes:[],skillMarkers:[],errorMarkers:[]};const o=Math.min(...r),l=Math.max(...r),d=Math.max(l-o,1);function i(c){return(c-o)/d}const g=new Set(s.map(c=>c.toolUseId)),p=new Set(a.map(c=>c.toolUseId)),y=[];for(const c of t){if(c.type!=="assistant"||c.toolCalls.length===0)continue;const u=new Date(c.timestamp).getTime();if(!isNaN(u))for(const x of c.toolCalls)g.has(x.toolUseId)||p.has(x.toolUseId)||y.push({timestampMs:u,toolName:x.toolName,toolUseId:x.toolUseId,relativeX:i(u)})}const h=s.map(c=>{const u=new Date(c.timestamp).getTime(),x=c.durationMs?u+c.durationMs:u+d*.02,v=[];if(c.toolCalls){const m=Object.entries(c.toolCalls).sort(([,w],[,C])=>C-w),j=m.reduce((w,[,C])=>w+C,0);let f=0;for(const[w,C]of m)for(let z=0;z<C;z++){const te=j>1?f/(j-1):.5,se=u+(x-u)*te;v.push({toolName:w,count:1,relativeX:i(se)}),f++}}return{subagentType:c.subagentType,description:c.description,startMs:u,endMs:x,startX:i(u),endX:i(x),durationMs:c.durationMs??null,totalTokens:c.totalTokens??null,totalToolUseCount:c.totalToolUseCount??null,toolDots:v,skills:c.skills?.map(m=>({skill:m.skill,args:m.args}))??[]}}),N=a.map(c=>{const u=new Date(c.timestamp).getTime();return isNaN(u)?null:{skill:c.skill,args:c.args,timestampMs:u,relativeX:i(u)}}).filter(c=>c!==null),k=n.map(c=>{const u=new Date(c.timestamp).getTime();return isNaN(u)?null:{message:c.message,type:c.type,timestampMs:u,relativeX:i(u)}}).filter(c=>c!==null);return{startMs:o,endMs:l,durationMs:d,mainLane:y,agentLanes:h,skillMarkers:N,errorMarkers:k}}function B(t){const s=t.match(/^mcp__[^_]+_[^_]+_[^_]+__(.+)$/);return s?s[1]:t}const Ze={Read:"#e09070",Grep:"#e09070",Glob:"#e09070",Write:"#34d399",Edit:"#34d399",NotebookEdit:"#34d399",Bash:"#fbbf24",Task:"#818cf8",TaskCreate:"#c084fc",TaskUpdate:"#c084fc",TaskList:"#c084fc",TaskGet:"#c084fc",Skill:"#fcd34d",WebSearch:"#22d3ee",WebFetch:"#22d3ee",EnterPlanMode:"#f472b6",ExitPlanMode:"#f472b6",AskUserQuestion:"#a78bfa"},Ve="#9ca3af";function H(t){return Ze[t]??Ve}const I=90,$=16,D=24,T=32,U=8,ee=4;function Je(t,s,a){const n=s-t;if(n<=0)return[];const r=Math.max(3,Math.round(a/120)),o=n/r,l=[5e3,1e4,15e3,3e4,6e4,2*6e4,5*6e4,10*6e4,15*6e4,30*6e4,60*6e4,120*6e4],d=l.find(h=>h>=o)??l[l.length-1],g=n<5*6e4?"HH:mm:ss":"HH:mm",p=Math.ceil(t/d)*d,y=[];for(let h=p;h<=s;h+=d){const N=(h-t)/n;y.push({ms:h,label:S(new Date(h),g),x:I+N*(a-I-$)})}return y}function et({data:t,width:s,onHover:a}){const n=b.useRef(null),r=s,o=r-I-$,l=t.skillMarkers.length>0,d=t.errorMarkers.length>0;let i=D;const g=i;i+=T;const p=[];for(let x=0;x<t.agentLanes.length;x++)i+=U,p.push(i),i+=T;let y=0;l&&(i+=U,y=i,i+=T);let h=0;d&&(i+=U,h=i,i+=T);const N=Math.max(i+8,80);function k(x){return I+x*o}const c=b.useCallback(x=>{if(!n.current)return{x:0,y:0};const v=n.current.getBoundingClientRect();return{x:x.clientX-v.left,y:x.clientY-v.top}},[]),u=Je(t.startMs,t.endMs,r);return e.jsxs("svg",{ref:n,width:r,height:N,className:"select-none",role:"img","aria-label":"Session timeline showing tool calls, agent runs, and skill invocations",onMouseLeave:()=>a(null,{x:0,y:0}),children:[e.jsx("line",{x1:I,y1:D-4,x2:r-$,y2:D-4,stroke:"var(--color-gray-700)",strokeWidth:1}),u.map(x=>e.jsxs("g",{children:[e.jsx("line",{x1:x.x,y1:D-8,x2:x.x,y2:D-4,stroke:"var(--color-gray-600)",strokeWidth:1}),e.jsx("text",{x:x.x,y:D-12,textAnchor:"middle",className:"fill-gray-500 text-[10px]",children:x.label})]},x.ms)),e.jsx("text",{x:4,y:g+T/2+4,className:"fill-gray-500 text-[11px] font-medium",children:"Main"}),e.jsx("line",{x1:I,y1:g+T/2,x2:r-$,y2:g+T/2,stroke:"var(--color-gray-800)",strokeWidth:1,strokeDasharray:"2,4"}),t.mainLane.map(x=>e.jsx("circle",{cx:k(x.relativeX),cy:g+T/2,r:ee,fill:H(x.toolName),opacity:.85,className:"cursor-pointer transition-transform hover:opacity-100",onMouseEnter:v=>a({kind:"tool",toolName:x.toolName,timestamp:new Date(x.timestampMs).toISOString(),toolUseId:x.toolUseId},c(v)),onMouseLeave:()=>a(null,{x:0,y:0}),children:e.jsx("title",{children:x.toolName})},x.toolUseId)),t.agentLanes.map((x,v)=>e.jsx(tt,{lane:x,y:p[v],toX:k,laneHeight:T,onHover:a,getPosition:c},`${x.subagentType}-${v}`)),l&&e.jsxs(e.Fragment,{children:[e.jsx("text",{x:4,y:y+T/2+4,className:"fill-amber-400/70 text-[11px] font-medium",children:"Skills"}),e.jsx("line",{x1:I,y1:y+T/2,x2:r-$,y2:y+T/2,stroke:"var(--color-gray-800)",strokeWidth:1,strokeDasharray:"2,4"}),t.skillMarkers.map((x,v)=>{const m=k(x.relativeX),j=y+T/2,f=5;return e.jsx("polygon",{points:`${m},${j-f} ${m+f},${j} ${m},${j+f} ${m-f},${j}`,fill:"#fbbf24",opacity:.85,className:"cursor-pointer hover:opacity-100",onMouseEnter:w=>a({kind:"skill",skill:x.skill,args:x.args,timestamp:new Date(x.timestampMs).toISOString()},c(w)),onMouseLeave:()=>a(null,{x:0,y:0}),children:e.jsxs("title",{children:["/",x.skill]})},`${x.skill}-${v}`)})]}),d&&e.jsxs(e.Fragment,{children:[e.jsx("text",{x:4,y:h+T/2+4,className:"fill-red-400/70 text-[11px] font-medium",children:"Errors"}),e.jsx("line",{x1:I,y1:h+T/2,x2:r-$,y2:h+T/2,stroke:"var(--color-gray-800)",strokeWidth:1,strokeDasharray:"2,4"}),t.errorMarkers.map((x,v)=>{const m=k(x.relativeX),j=h+T/2,f=5;return e.jsxs("g",{className:"cursor-pointer hover:opacity-100",opacity:.85,onMouseEnter:w=>a({kind:"error",message:x.message,type:x.type,timestamp:new Date(x.timestampMs).toISOString()},c(w)),onMouseLeave:()=>a(null,{x:0,y:0}),children:[e.jsx("line",{x1:m-f,y1:j-f,x2:m+f,y2:j+f,stroke:"#f87171",strokeWidth:2,strokeLinecap:"round"}),e.jsx("line",{x1:m+f,y1:j-f,x2:m-f,y2:j+f,stroke:"#f87171",strokeWidth:2,strokeLinecap:"round"}),e.jsxs("title",{children:[x.type,": ",x.message]})]},`err-${v}`)})]})]})}function tt({lane:t,y:s,toX:a,laneHeight:n,onHover:r,getPosition:o}){const l=a(t.startX),d=Math.max(a(t.endX)-l,8),i=s+n/2,g=t.subagentType.length>10?t.subagentType.slice(0,10)+"...":t.subagentType;return e.jsxs("g",{children:[e.jsx("text",{x:4,y:i+4,className:"fill-indigo-400/70 text-[11px] font-medium",children:g}),e.jsx("rect",{x:l,y:s+2,width:d,height:n-4,rx:6,fill:"rgba(99, 102, 241, 0.08)",stroke:"rgba(99, 102, 241, 0.2)",strokeWidth:1,className:"cursor-pointer hover:fill-indigo-500/15",onMouseEnter:p=>r({kind:"agent",agent:t},o(p)),onMouseLeave:()=>r(null,{x:0,y:0}),children:e.jsxs("title",{children:[t.subagentType,": ",t.description]})}),e.jsx("line",{x1:l+4,y1:i,x2:l+d-4,y2:i,stroke:"rgba(99, 102, 241, 0.15)",strokeWidth:1}),t.toolDots.map((p,y)=>e.jsx("circle",{cx:a(p.relativeX),cy:i,r:ee-.5,fill:H(p.toolName),opacity:.75,className:"cursor-pointer hover:opacity-100",onMouseEnter:h=>r({kind:"tool",toolName:p.toolName,timestamp:new Date(t.startMs+(p.relativeX-t.startX)/(t.endX-t.startX)*(t.endMs-t.startMs)).toISOString(),toolUseId:`${t.subagentType}-${p.toolName}-${y}`},o(h)),onMouseLeave:()=>r(null,{x:0,y:0}),children:e.jsxs("title",{children:[p.toolName," (",t.subagentType,")"]})},`${p.toolName}-${y}`)),t.skills&&t.skills.length>0&&t.skills.map((p,y)=>{const h=t.startX+(t.endX-t.startX)/(t.skills.length+1)*(y+1),N=a(h),k=s+6,c=3;return e.jsx("polygon",{points:`${N},${k-c} ${N+c},${k} ${N},${k+c} ${N-c},${k}`,fill:"#fbbf24",opacity:.85,className:"cursor-pointer hover:opacity-100",onMouseEnter:u=>r({kind:"skill",skill:p.skill,args:p.args,timestamp:new Date(t.startMs).toISOString()},o(u)),onMouseLeave:()=>r(null,{x:0,y:0}),children:e.jsxs("title",{children:["/",p.skill," (",t.subagentType,")"]})},`skill-${p.skill}-${y}`)})]})}function st({item:t,position:s}){return e.jsxs("div",{className:"pointer-events-none absolute z-50 rounded-lg border border-gray-700 bg-gray-900 px-3 py-2 text-xs shadow-xl",style:{left:s.x,top:s.y,transform:"translate(-50%, -100%) translateY(-8px)"},children:[t.kind==="tool"&&e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-gray-100",children:B(t.toolName)}),e.jsx("div",{className:"text-gray-400",children:S(new Date(t.timestamp),"HH:mm:ss")}),e.jsxs("div",{className:"font-mono text-[10px] text-gray-600",children:[t.toolUseId.slice(0,16),"..."]})]}),t.kind==="agent"&&e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-indigo-300",children:t.agent.subagentType}),e.jsx("div",{className:"max-w-48 truncate text-gray-400",children:t.agent.description}),e.jsx("div",{className:"mt-1 flex items-center gap-2 text-gray-500",children:t.agent.durationMs!=null&&e.jsxs("span",{children:[S(new Date(t.agent.startMs),"HH:mm")," -"," ",S(new Date(t.agent.endMs),"HH:mm")," (",X(t.agent.durationMs),")"]})}),e.jsxs("div",{className:"flex items-center gap-2 text-gray-500",children:[t.agent.totalTokens!=null&&e.jsxs("span",{children:[M(t.agent.totalTokens)," tokens"]}),t.agent.totalToolUseCount!=null&&e.jsxs("span",{children:[t.agent.totalToolUseCount," tools"]})]})]}),t.kind==="skill"&&e.jsxs("div",{children:[e.jsxs("div",{className:"font-semibold text-amber-300",children:["/",t.skill]}),t.args&&e.jsx("div",{className:"text-gray-400",children:t.args}),e.jsx("div",{className:"text-gray-500",children:S(new Date(t.timestamp),"HH:mm:ss")})]}),t.kind==="error"&&e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-red-400",children:t.type}),e.jsx("div",{className:"max-w-48 truncate text-gray-400",children:t.message}),e.jsx("div",{className:"text-gray-500",children:S(new Date(t.timestamp),"HH:mm:ss")})]})]})}function at({toolNames:t}){const s=[...new Set(t)].slice(0,12);return s.length===0?null:e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 px-1 text-[10px] text-gray-500",children:[s.map(a=>e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"inline-block h-2 w-2 rounded-full",style:{backgroundColor:H(a)}}),e.jsx("span",{children:B(a)})]},a)),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"inline-block h-2 w-2 rotate-45 bg-amber-400"}),e.jsx("span",{children:"Skill"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-red-400 font-bold leading-none",children:"×"}),e.jsx("span",{children:"Error"})]})]})}function nt({turns:t,agents:s,skills:a,errors:n}){const r=b.useRef(null),[o,l]=b.useState(0),[d,i]=b.useState(1),[g,p]=b.useState(null);b.useEffect(()=>{if(!r.current)return;const m=new ResizeObserver(j=>{const f=j[0];f&&l(f.contentRect.width)});return m.observe(r.current),()=>m.disconnect()},[]);const y=b.useMemo(()=>Qe(t,s,a,n),[t,s,a,n]),h=b.useMemo(()=>{const m=y.mainLane.map(f=>f.toolName);for(const f of y.agentLanes)for(const w of f.toolDots)m.push(w.toolName);const j={};for(const f of m)j[f]=(j[f]??0)+1;return Object.entries(j).sort(([,f],[,w])=>w-f).map(([f])=>f)},[y]),N=(m,j)=>{p(m?{item:m,position:j}:null)};if(t.length===0)return e.jsx("div",{className:"py-8 text-center text-sm text-gray-500",children:"No timeline data available"});const k=new Set(s.map(m=>m.toolUseId)),c=new Set(a.map(m=>m.toolUseId));let u=0,x=0,v=0;for(const m of t)if(m.type==="user"&&m.message?.trim()&&u++,m.type==="assistant"){x++;for(const j of m.toolCalls)!k.has(j.toolUseId)&&!c.has(j.toolUseId)&&v++}return e.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900/50 p-4",children:[e.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-4",children:[e.jsx(A,{label:"User commands",value:u,color:"blue"}),e.jsx(A,{label:"AI responses",value:x,color:"purple"}),v>0&&e.jsx(A,{label:"Tool calls",value:v,color:"gray"}),s.length>0&&e.jsx(A,{label:"Agents",value:s.length,color:"indigo"}),a.length>0&&e.jsx(A,{label:"Skills",value:a.length,color:"amber"}),n.length>0&&e.jsx(A,{label:"Errors",value:n.length,color:"red"})]}),e.jsxs("div",{className:"mb-3 flex items-start justify-between gap-2",children:[e.jsx("div",{className:"flex-1",children:h.length>0&&e.jsx(at,{toolNames:h})}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[e.jsx("button",{type:"button",onClick:()=>i(m=>Math.max(1,m-.5)),disabled:d<=1,className:"rounded bg-gray-800 px-2 py-0.5 text-xs text-gray-300 transition-colors hover:bg-gray-700 disabled:opacity-30",title:"Zoom out",children:"−"}),e.jsx("span",{className:"min-w-[3rem] text-center text-[10px] tabular-nums text-gray-500",children:d===1?"Fit":`${d.toFixed(1)}x`}),e.jsx("button",{type:"button",onClick:()=>i(m=>Math.min(8,m+.5)),disabled:d>=8,className:"rounded bg-gray-800 px-2 py-0.5 text-xs text-gray-300 transition-colors hover:bg-gray-700 disabled:opacity-30",title:"Zoom in",children:"+"}),d>1&&e.jsx("button",{type:"button",onClick:()=>i(1),className:"ml-1 rounded bg-gray-800 px-2 py-0.5 text-[10px] text-gray-400 transition-colors hover:bg-gray-700",title:"Reset zoom",children:"Reset"})]})]}),e.jsx("div",{ref:r,className:"relative overflow-x-auto",children:o>0&&e.jsxs(e.Fragment,{children:[e.jsx(et,{data:y,width:Math.max(o*d,400),onHover:N}),g&&e.jsx(st,{item:g.item,position:g.position})]})})]})}function A({label:t,value:s,color:a}){const n={blue:"bg-brand-500/15 text-brand-400",purple:"bg-purple-500/15 text-purple-400",gray:"bg-gray-800 text-gray-300",indigo:"bg-indigo-500/15 text-indigo-400",amber:"bg-amber-500/15 text-amber-400",red:"bg-red-500/15 text-red-400"};return e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:`rounded-md px-2 py-1 text-sm font-bold tabular-nums ${n[a]}`,children:s}),e.jsx("span",{className:"text-[11px] text-gray-500",children:t})]})}function rt({contextWindow:t,tokens:s}){const[a,n]=b.useState(!1);if(!t)return e.jsx(ot,{tokens:s});const{contextLimit:r,modelName:o,systemOverhead:l,currentContextSize:d,messagesEstimate:i,freeSpace:g,autocompactBuffer:p,usagePercent:y,snapshots:h}=t,N=l/r*100,k=i/r*100,c=p/r*100,u=Math.max(0,100-N-k),x=o.replace(/^claude-/,"").split("-202")[0],v=h.map(m=>({turn:m.turnIndex,context:m.contextSize}));return e.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900/50 p-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Context Window"}),e.jsx("span",{className:"rounded bg-gray-800 px-1.5 py-0.5 text-[10px] font-mono text-gray-400",children:x})]}),e.jsxs("div",{className:"mt-1 flex items-baseline gap-1",children:[e.jsx("span",{className:"text-2xl font-bold text-gray-100",children:M(d)}),e.jsxs("span",{className:"text-sm text-gray-500",children:["/ ",M(r)]}),e.jsxs("span",{className:"text-sm text-gray-400",children:["(",y,"%)"]})]}),e.jsx("p",{className:"text-[10px] text-gray-500",children:"~estimated from token usage"}),e.jsxs("div",{className:"mt-3 flex h-3 overflow-hidden rounded-full bg-gray-800",children:[e.jsx("div",{className:"bg-purple-500",style:{width:`${N}%`},title:`System: ~${M(l)}`}),e.jsx("div",{className:"bg-brand-500",style:{width:`${k}%`},title:`Messages: ~${M(i)}`}),u>0&&e.jsx(e.Fragment,{children:u>c?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"bg-gray-700",style:{width:`${u-c}%`}}),e.jsx("div",{className:"autocompact-stripe",style:{width:`${Math.min(c,u)}%`}})]}):e.jsx("div",{className:"autocompact-stripe",style:{width:`${u}%`}})})]}),e.jsxs("div",{className:"mt-1 flex gap-3 text-[10px] text-gray-500",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-purple-500"}),"system"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-brand-500"}),"messages"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-gray-700"}),"free"]})]}),e.jsxs("div",{className:"mt-3 space-y-1.5",children:[e.jsx(L,{label:"System overhead",value:l,total:r,color:"bg-purple-500",prefix:"~"}),e.jsx(L,{label:"Messages",value:i,total:r,color:"bg-brand-500",prefix:"~"}),e.jsx(L,{label:"Autocompact buffer",value:p,total:r,color:"bg-amber-500"}),e.jsx(L,{label:"Free space",value:g,total:r,color:"bg-gray-600"})]}),v.length>1&&e.jsxs("div",{className:"mt-3",children:[e.jsx("p",{className:"mb-1 text-[10px] text-gray-500",children:"Context growth"}),e.jsx(we,{width:"100%",height:96,children:e.jsxs(Te,{data:v,children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"contextGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"#d97757",stopOpacity:.3}),e.jsx("stop",{offset:"100%",stopColor:"#d97757",stopOpacity:.05})]})}),e.jsx(Me,{domain:[0,r],hide:!0}),e.jsx(Ce,{contentStyle:{background:"var(--color-gray-900)",border:"1px solid var(--color-gray-700)",borderRadius:"8px",fontSize:"11px"},labelFormatter:m=>`Turn ${m}`,formatter:m=>[M(m),"Context"]}),e.jsx(_,{y:r,stroke:"#ef4444",strokeDasharray:"4 4",strokeOpacity:.5}),e.jsx(_,{y:r-p,stroke:"#f59e0b",strokeDasharray:"2 4",strokeOpacity:.3}),e.jsx(Se,{type:"stepAfter",dataKey:"context",stroke:"#d97757",fill:"url(#contextGrad)",strokeWidth:1.5,dot:!1})]})})]}),e.jsxs("button",{onClick:()=>n(!a),className:"mt-3 flex w-full items-center gap-1 text-xs text-gray-400 hover:text-gray-300 transition-colors",children:[e.jsx("span",{className:"text-[10px]",children:a?"▾":"▸"}),"Token Details"]}),a&&e.jsx(lt,{tokens:s}),e.jsx("style",{children:`
|
|
2
2
|
.autocompact-stripe {
|
|
3
3
|
background: repeating-linear-gradient(
|
|
4
4
|
-45deg,
|
|
@@ -9,4 +9,4 @@ import{r as v,c as ae,j as e,L as W,h as G,b as ne}from"./main-B6FohBFQ.js";impo
|
|
|
9
9
|
);
|
|
10
10
|
opacity: 0.4;
|
|
11
11
|
}
|
|
12
|
-
`})]})}function L({label:t,value:s,total:a,color:n,prefix:r=""}){const o=Math.max(0,Math.min(100,s/a*100));return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-32 text-xs text-gray-400 shrink-0",children:t}),e.jsxs("span",{className:"w-16 text-right text-xs font-mono text-gray-300 shrink-0",children:[r,M(s)]}),e.jsx("div",{className:"flex-1 h-1.5 rounded-full bg-gray-800 overflow-hidden",children:e.jsx("div",{className:`h-full rounded-full ${n}`,style:{width:`${o}%`,opacity:.7}})})]})}function lt({tokens:t}){const s=t.inputTokens+t.outputTokens+t.cacheReadInputTokens+t.cacheCreationInputTokens,a=[{label:"Input",value:t.inputTokens,color:"bg-brand-400"},{label:"Output",value:t.outputTokens,color:"bg-emerald-400"},{label:"Cache Read",value:t.cacheReadInputTokens,color:"bg-amber-400"},{label:"Cache Create",value:t.cacheCreationInputTokens,color:"bg-purple-400"}];return e.jsxs("div",{className:"mt-2 space-y-1.5",children:[a.map(n=>e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-gray-400",children:n.label}),e.jsx("span",{className:"text-xs font-mono text-gray-300",children:M(n.value)})]},n.label)),s>0&&e.jsx("div",{className:"flex h-2 overflow-hidden rounded-full bg-gray-800",children:a.filter(n=>n.value>0).map(n=>e.jsx("div",{className:`${n.color} opacity-60`,style:{width:`${n.value/s*100}%`}},n.label))})]})}function ot({tokens:t}){const s=t.inputTokens+t.outputTokens,a=s+t.cacheReadInputTokens+t.cacheCreationInputTokens,n=[{label:"Input",value:t.inputTokens,color:"text-brand-400"},{label:"Output",value:t.outputTokens,color:"text-emerald-400"},{label:"Cache Read",value:t.cacheReadInputTokens,color:"text-amber-400"},{label:"Cache Create",value:t.cacheCreationInputTokens,color:"text-purple-400"}];return e.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900/50 p-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Token Usage"}),e.jsx("p",{className:"mt-1 text-2xl font-bold text-gray-100",children:M(s)}),e.jsxs("p",{className:"text-[10px] text-gray-500",children:["input + output (",M(a)," incl. cache)"]}),e.jsx("div",{className:"mt-3 space-y-2",children:n.map(r=>e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-gray-400",children:r.label}),e.jsx("span",{className:`text-xs font-mono ${r.color}`,children:M(r.value)})]},r.label))}),a>0&&e.jsx("div",{className:"mt-3 flex h-2 overflow-hidden rounded-full bg-gray-800",children:n.filter(r=>r.value>0).map(r=>e.jsx("div",{className:`${r.color.replace("text-","bg-")} opacity-60`,style:{width:`${r.value/a*100}%`}},r.label))})]})}function it({toolFrequency:t}){const s=Object.entries(t).sort(([,n],[,r])=>r-n),a=s[0]?.[1]??1;return s.length===0?e.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900/50 p-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Tool Usage"}),e.jsx("p",{className:"mt-2 text-xs text-gray-500",children:"No tools used"})]}):e.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900/50 p-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Tool Usage"}),e.jsxs("p",{className:"mt-1 text-xs text-gray-500",children:[s.length," tools, ",s.reduce((n,[,r])=>n+r,0)," calls"]}),e.jsx("div",{className:"mt-3 space-y-1.5",children:s.slice(0,15).map(([n,r])=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-32 shrink-0 truncate text-xs font-mono text-gray-400",title:n,children:B(n)}),e.jsx("div",{className:"flex-1",children:e.jsx("div",{className:"h-4 rounded bg-brand-500/20",style:{width:`${r/a*100}%`},children:e.jsx("span",{className:"px-1.5 text-xs text-brand-300",children:r})})})]},n))})]})}function ct({errors:t}){return t.length===0?null:e.jsxs("div",{className:"rounded-xl border border-red-900/50 bg-red-950/20 p-4",children:[e.jsxs("h3",{className:"text-sm font-semibold text-red-400",children:["Errors (",t.length,")"]}),e.jsx("div",{className:"mt-3 max-h-64 space-y-2 overflow-y-auto",children:t.map((s,a)=>e.jsxs("div",{className:"rounded-lg bg-red-950/30 p-2.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-mono text-red-300",children:s.type}),s.timestamp&&e.jsx("span",{className:"text-xs text-gray-500",children:V(s.timestamp)})]}),e.jsx("p",{className:"mt-1 text-xs text-red-200/80",children:s.message})]},a))})]})}function Q(t){if(t.tokens)return t.tokens.inputTokens+t.tokens.outputTokens+t.tokens.cacheReadInputTokens+t.tokens.cacheCreationInputTokens}function dt({agents:t}){const{data:s}=_(Ee),{agentCosts:a,totalAgentCost:n}=v.useMemo(()=>{if(!s)return{agentCosts:new Map,totalAgentCost:0};const o=Ie(s),l=new Map;let d=0;for(let i=0;i<t.length;i++){const g=t[i];if(!g.tokens)continue;const f={[g.model??"claude-sonnet-4"]:g.tokens},h=De(f,o);l.set(i,h.totalUSD),d+=h.totalUSD}return{agentCosts:l,totalAgentCost:d}},[s,t]);if(t.length===0)return null;const r=t.reduce((o,l)=>o+(l.totalTokens??Q(l)??0),0);return e.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900/50 p-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Agent Dispatches"}),e.jsxs("p",{className:"mt-1 text-xs text-gray-500",children:[t.length," agent dispatch",t.length!==1?"es":"",r>0&&e.jsxs("span",{className:"ml-1 text-indigo-400",children:["(",M(r)," tokens",n>0&&` · ~${E(n)}`,")"]})]}),e.jsx("div",{className:"mt-3 space-y-1",children:t.map((o,l)=>{const d=o.totalTokens??Q(o),i=a.get(l);return e.jsxs("div",{className:"flex items-start gap-2 rounded bg-gray-950/40 px-2 py-1.5",children:[e.jsx("span",{className:"shrink-0 rounded bg-indigo-500/20 px-1.5 py-0.5 text-[10px] font-semibold text-indigo-300",children:o.subagentType}),o.model&&e.jsx("span",{className:"shrink-0 rounded bg-gray-800 px-1.5 py-0.5 text-[10px] font-mono text-gray-400",children:o.model.replace(/^claude-/,"").replace(/-\d{8}$/,"")}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-gray-400",children:o.description}),e.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[d!=null&&d>0&&e.jsx("span",{className:"text-[10px] font-mono text-indigo-400/80",children:M(d)}),i!=null&&i>0&&e.jsxs("span",{className:"text-[10px] font-mono text-emerald-400/80",children:["~",E(i)]}),o.totalToolUseCount!=null&&e.jsxs("span",{className:"text-[10px] text-gray-500",children:[o.totalToolUseCount," tools"]}),o.durationMs!=null&&e.jsx("span",{className:"text-[10px] text-gray-600",children:X(o.durationMs)}),o.timestamp&&e.jsx("span",{className:"text-[10px] text-gray-600",children:C(new Date(o.timestamp),"HH:mm:ss")})]})]},`a-${l}`)})})]})}function xt({agents:t,skills:s}){const{groups:a,totalCount:n}=v.useMemo(()=>{const r=[...s.map(l=>({...l,agentSource:null})),...t.flatMap(l=>(l.skills??[]).map(d=>({...d,agentSource:l.subagentType})))].sort((l,d)=>l.timestamp.localeCompare(d.timestamp)),o=new Map;for(const l of r){let d=o.get(l.skill);d||(d={skill:l.skill,count:0,hasInjected:!1,invocations:[]},o.set(l.skill,d)),d.count++,l.source==="injected"&&(d.hasInjected=!0),d.invocations.push({agentSource:l.agentSource,timestamp:l.timestamp,source:l.source})}return{groups:Array.from(o.values()),totalCount:r.length}},[s,t]);return n===0?null:e.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900/50 p-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Skill Invocations"}),e.jsxs("p",{className:"mt-1 text-xs text-gray-500",children:[a.length," unique skill",a.length!==1?"s":"",","," ",n," invocation",n!==1?"s":""]}),e.jsx("div",{className:"mt-3 space-y-1",children:a.map(r=>e.jsxs("div",{className:"rounded bg-gray-950/40 px-2 py-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"shrink-0 rounded bg-brand-500/20 px-1.5 py-0.5 text-[10px] font-semibold text-brand-400",children:["/",r.skill]}),e.jsxs("span",{className:"text-[10px] text-gray-500",children:["×",r.count]}),r.hasInjected&&e.jsx("span",{className:"shrink-0 rounded bg-gray-800/40 px-1 py-0.5 text-[9px] text-gray-500",children:"context"})]}),e.jsx("div",{className:"mt-1 ml-2 flex flex-wrap gap-x-1 text-[10px] text-gray-500",children:r.invocations.map((o,l)=>e.jsxs("span",{children:[e.jsx("span",{className:"text-gray-400",children:o.agentSource??"session"}),", ",e.jsx("span",{className:"text-gray-600",children:C(new Date(o.timestamp),"HH:mm:ss")}),l<r.invocations.length-1&&e.jsx("span",{className:"text-gray-700",children:"; "})]},l))})]},r.skill))})]})}const mt={pending:{label:"Pending",bg:"bg-gray-500/20",text:"text-gray-400"},in_progress:{label:"In Progress",bg:"bg-brand-500/20",text:"text-brand-400"},completed:{label:"Done",bg:"bg-emerald-500/20",text:"text-emerald-400"},deleted:{label:"Deleted",bg:"bg-red-500/20",text:"text-red-400"}};function ut({tasks:t}){if(t.length===0)return null;const s=t.filter(n=>n.status==="completed").length,a=t.filter(n=>n.status!=="deleted").length;return e.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900/50 p-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Tasks"}),e.jsxs("p",{className:"mt-1 text-xs text-gray-500",children:[s,"/",a," completed"]}),e.jsx("div",{className:"mt-3 space-y-1",children:t.map((n,r)=>{const o=mt[n.status];return e.jsxs("div",{className:"flex items-start gap-2 rounded bg-gray-950/40 px-2 py-1.5",children:[e.jsx("span",{className:`shrink-0 rounded px-1.5 py-0.5 text-[10px] font-semibold ${o.bg} ${o.text}`,children:o.label}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"text-xs text-gray-300",children:n.subject}),n.description&&e.jsx("p",{className:"mt-0.5 truncate text-[10px] text-gray-500",children:n.description})]}),n.taskId&&e.jsxs("span",{className:"shrink-0 text-[10px] font-mono text-gray-600",children:["#",n.taskId]}),n.timestamp&&e.jsx("span",{className:"shrink-0 text-[10px] text-gray-600",children:C(new Date(n.timestamp),"HH:mm:ss")})]},n.taskId||r)})})]})}function pt({tokensByModel:t}){const{cost:s,isLoading:a}=J(t);return a?e.jsx("div",{className:"rounded-xl border border-gray-800 bg-gray-900/50 p-4",children:e.jsx("div",{className:"h-6 w-32 animate-pulse rounded bg-gray-800"})}):!s||s.totalUSD===0?e.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900/50 p-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Cost Estimation"}),e.jsx("p",{className:"mt-2 text-xs text-gray-500",children:"No token data available"})]}):e.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900/50 p-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Cost Estimation"}),e.jsxs("span",{className:"font-mono text-lg font-bold text-gray-100",children:["~",E(s.totalUSD)]})]}),e.jsxs("div",{className:"mt-4",children:[e.jsx("p",{className:"text-xs font-medium text-gray-400",children:"By Category"}),e.jsx(gt,{cost:s}),e.jsx(ht,{cost:s})]}),e.jsxs("div",{className:"mt-4",children:[e.jsx("p",{className:"text-xs font-medium text-gray-400",children:"By Model"}),e.jsx(ft,{cost:s})]}),e.jsxs("div",{className:"mt-3 flex items-center justify-between border-t border-gray-800 pt-3",children:[e.jsx("p",{className:"text-[10px] text-gray-600",children:"Estimated based on API pricing. Actual costs may vary."}),e.jsx(W,{to:"/settings",className:"text-[10px] text-gray-500 hover:text-gray-300",children:"Configure pricing"})]})]})}function gt({cost:t}){const s=[{label:"Input tokens",value:t.byCategory.input,color:"text-brand-400"},{label:"Output tokens",value:t.byCategory.output,color:"text-emerald-400"},{label:"Cache read",value:t.byCategory.cacheRead,color:"text-amber-400"},{label:"Cache write",value:t.byCategory.cacheWrite,color:"text-purple-400"}];return e.jsx("div",{className:"mt-2 space-y-1",children:s.map(a=>e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-gray-400",children:a.label}),e.jsx("span",{className:`font-mono text-xs ${a.color}`,children:E(a.value)})]},a.label))})}function ht({cost:t}){if(t.totalUSD===0)return null;const s=[{key:"input",value:t.byCategory.input,color:"bg-brand-400"},{key:"output",value:t.byCategory.output,color:"bg-emerald-400"},{key:"cacheRead",value:t.byCategory.cacheRead,color:"bg-amber-400"},{key:"cacheWrite",value:t.byCategory.cacheWrite,color:"bg-purple-400"}];return e.jsx("div",{className:"mt-2 flex h-2 overflow-hidden rounded-full bg-gray-800",children:s.map(a=>{const n=a.value/t.totalUSD*100;return n<.5?null:e.jsx("div",{className:`${a.color} opacity-60`,style:{width:`${n}%`}},a.key)})})}function ft({cost:t}){const s=Object.values(t.byModel).sort((a,n)=>n.totalCost-a.totalCost);return s.length===0?null:e.jsx("div",{className:"mt-2 space-y-1",children:s.map(a=>{const n=t.totalUSD>0?Math.round(a.totalCost/t.totalUSD*100):0;return e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-mono text-xs text-gray-300",children:a.displayName}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-mono text-xs text-gray-300",children:E(a.totalCost)}),e.jsxs("span",{className:"text-[10px] text-gray-500",children:["(",n,"%)"]}),e.jsxs("span",{className:"text-[10px] text-gray-600",children:[M(a.tokens.inputTokens+a.tokens.outputTokens+a.tokens.cacheReadInputTokens+a.tokens.cacheCreationInputTokens)," ","tok"]})]})]},a.modelId)})})}function yt({tokensByModel:t}){const{cost:s,isLoading:a}=J(t);return a||!s||s.totalUSD===0?null:e.jsxs("span",{className:"font-mono text-xs text-emerald-400",title:"Estimated cost based on API pricing",children:["~",E(s.totalUSD)]})}function bt(){return e.jsxs("div",{className:"mb-4 flex items-center gap-2 rounded-lg border border-emerald-800 bg-emerald-900/30 px-4 py-2 text-sm text-emerald-300",children:[e.jsxs("span",{className:"relative flex h-2 w-2",children:[e.jsx("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-emerald-400 opacity-75"}),e.jsx("span",{className:"relative inline-flex h-2 w-2 rounded-full bg-emerald-500"})]}),"This session is currently active. Data refreshes automatically."]})}function jt(t){const{data:s}=_(Pe);return s?.some(a=>a.sessionId===t)??!1}function St(){const{sessionId:t}=G.useParams(),{project:s=""}=G.useSearch(),{privacyMode:a,anonymizeProjectName:n,anonymizeBranch:r}=ne(),o=jt(t),{data:l,isLoading:d,error:i}=_(Ke(t,s,o));if(d)return e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"h-8 w-48 animate-pulse rounded bg-gray-800"}),e.jsx("div",{className:"h-64 animate-pulse rounded-xl bg-gray-900/50"})]});if(i||!l)return e.jsxs("div",{className:"py-12 text-center",children:[e.jsxs("p",{className:"text-sm text-red-400",children:["Failed to load session: ",i?.message??"Not found"]}),e.jsx(W,{to:"/sessions",className:"mt-2 inline-block text-sm text-brand-300 hover:underline",children:"Back to sessions"})]});const g=l.turns[0]?.timestamp,p=l.turns[l.turns.length-1]?.timestamp,f=g&&p?new Date(p).getTime()-new Date(g).getTime():0;return e.jsxs("div",{children:[o&&e.jsx(bt,{}),e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{children:[e.jsx(W,{to:"/sessions",className:"text-xs text-gray-500 hover:text-gray-300",children:"← Sessions"}),e.jsx("h1",{className:"mt-1 text-xl font-bold text-gray-100",children:a?n(l.projectName):l.projectName}),e.jsxs("div",{className:"mt-1 flex items-center gap-3 text-xs text-gray-400",children:[l.branch&&e.jsx("span",{className:"font-mono",children:r(l.branch)}),g&&e.jsx("span",{children:V(g)}),e.jsx("span",{children:X(f)}),e.jsxs("span",{children:[l.turns.length," turns"]}),e.jsx(yt,{tokensByModel:l.tokensByModel})]}),l.models.length>0&&e.jsx("div",{className:"mt-1 flex gap-1",children:l.models.map(h=>e.jsx("span",{className:"rounded bg-gray-800 px-1.5 py-0.5 text-[10px] font-mono text-gray-400",children:h.replace(/^claude-/,"").split("-202")[0]},h))})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Ae,{options:[{label:"Export Session (JSON)",onClick:()=>$e(Oe(l),`session-${t.slice(0,8)}.json`,"application/json")}]}),e.jsx("span",{className:"font-mono text-xs text-gray-600",children:t.slice(0,8)})]})]}),e.jsxs("div",{className:"mt-6 grid grid-cols-1 gap-4 md:grid-cols-2",children:[e.jsx(rt,{contextWindow:l.contextWindow,tokens:l.totalTokens}),e.jsx(it,{toolFrequency:l.toolFrequency})]}),e.jsx("div",{className:"mt-4",children:e.jsx(pt,{tokensByModel:l.tokensByModel})}),l.agents.length>0&&e.jsx("div",{className:"mt-4",children:e.jsx(dt,{agents:l.agents})}),l.tasks.length>0&&e.jsx("div",{className:"mt-4",children:e.jsx(ut,{tasks:l.tasks})}),e.jsx("div",{className:"mt-4",children:e.jsx(ct,{errors:l.errors})}),e.jsxs("div",{className:"mt-6",children:[e.jsx("h2",{className:"mb-3 text-sm font-semibold text-gray-300",children:"Timeline"}),e.jsx(nt,{turns:l.turns,agents:l.agents,skills:l.skills,errors:l.errors})]}),(l.skills.length>0||l.agents.some(h=>(h.skills?.length??0)>0))&&e.jsx("div",{className:"mt-6",children:e.jsx(xt,{agents:l.agents,skills:l.skills})})]})}export{St as component};
|
|
12
|
+
`})]})}function L({label:t,value:s,total:a,color:n,prefix:r=""}){const o=Math.max(0,Math.min(100,s/a*100));return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-32 text-xs text-gray-400 shrink-0",children:t}),e.jsxs("span",{className:"w-16 text-right text-xs font-mono text-gray-300 shrink-0",children:[r,M(s)]}),e.jsx("div",{className:"flex-1 h-1.5 rounded-full bg-gray-800 overflow-hidden",children:e.jsx("div",{className:`h-full rounded-full ${n}`,style:{width:`${o}%`,opacity:.7}})})]})}function lt({tokens:t}){const s=t.inputTokens+t.outputTokens+t.cacheReadInputTokens+t.cacheCreationInputTokens,a=[{label:"Input",value:t.inputTokens,color:"bg-brand-400"},{label:"Output",value:t.outputTokens,color:"bg-emerald-400"},{label:"Cache Read",value:t.cacheReadInputTokens,color:"bg-amber-400"},{label:"Cache Create",value:t.cacheCreationInputTokens,color:"bg-purple-400"}];return e.jsxs("div",{className:"mt-2 space-y-1.5",children:[a.map(n=>e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-gray-400",children:n.label}),e.jsx("span",{className:"text-xs font-mono text-gray-300",children:M(n.value)})]},n.label)),s>0&&e.jsx("div",{className:"flex h-2 overflow-hidden rounded-full bg-gray-800",children:a.filter(n=>n.value>0).map(n=>e.jsx("div",{className:`${n.color} opacity-60`,style:{width:`${n.value/s*100}%`}},n.label))})]})}function ot({tokens:t}){const s=t.inputTokens+t.outputTokens,a=s+t.cacheReadInputTokens+t.cacheCreationInputTokens,n=[{label:"Input",value:t.inputTokens,color:"text-brand-400"},{label:"Output",value:t.outputTokens,color:"text-emerald-400"},{label:"Cache Read",value:t.cacheReadInputTokens,color:"text-amber-400"},{label:"Cache Create",value:t.cacheCreationInputTokens,color:"text-purple-400"}];return e.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900/50 p-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Token Usage"}),e.jsx("p",{className:"mt-1 text-2xl font-bold text-gray-100",children:M(s)}),e.jsxs("p",{className:"text-[10px] text-gray-500",children:["input + output (",M(a)," incl. cache)"]}),e.jsx("div",{className:"mt-3 space-y-2",children:n.map(r=>e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-gray-400",children:r.label}),e.jsx("span",{className:`text-xs font-mono ${r.color}`,children:M(r.value)})]},r.label))}),a>0&&e.jsx("div",{className:"mt-3 flex h-2 overflow-hidden rounded-full bg-gray-800",children:n.filter(r=>r.value>0).map(r=>e.jsx("div",{className:`${r.color.replace("text-","bg-")} opacity-60`,style:{width:`${r.value/a*100}%`}},r.label))})]})}function it({toolFrequency:t}){const s=Object.entries(t).sort(([,n],[,r])=>r-n),a=s[0]?.[1]??1;return s.length===0?e.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900/50 p-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Tool Usage"}),e.jsx("p",{className:"mt-2 text-xs text-gray-500",children:"No tools used"})]}):e.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900/50 p-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Tool Usage"}),e.jsxs("p",{className:"mt-1 text-xs text-gray-500",children:[s.length," tools, ",s.reduce((n,[,r])=>n+r,0)," calls"]}),e.jsx("div",{className:"mt-3 space-y-1.5",children:s.slice(0,15).map(([n,r])=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-32 shrink-0 truncate text-xs font-mono text-gray-400",title:n,children:B(n)}),e.jsx("div",{className:"flex-1",children:e.jsx("div",{className:"h-4 rounded bg-brand-500/20",style:{width:`${r/a*100}%`},children:e.jsx("span",{className:"px-1.5 text-xs text-brand-300",children:r})})})]},n))})]})}function ct({errors:t}){return t.length===0?null:e.jsxs("div",{className:"rounded-xl border border-red-900/50 bg-red-950/20 p-4",children:[e.jsxs("h3",{className:"text-sm font-semibold text-red-400",children:["Errors (",t.length,")"]}),e.jsx("div",{className:"mt-3 max-h-64 space-y-2 overflow-y-auto",children:t.map((s,a)=>e.jsxs("div",{className:"rounded-lg bg-red-950/30 p-2.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-mono text-red-300",children:s.type}),s.timestamp&&e.jsx("span",{className:"text-xs text-gray-500",children:V(s.timestamp)})]}),e.jsx("p",{className:"mt-1 text-xs text-red-200/80",children:s.message})]},a))})]})}function Z(t){if(t.tokens)return t.tokens.inputTokens+t.tokens.outputTokens+t.tokens.cacheReadInputTokens+t.tokens.cacheCreationInputTokens}function dt({agents:t}){const{data:s}=F(Ee),{agentCosts:a,totalAgentCost:n}=b.useMemo(()=>{if(!s)return{agentCosts:new Map,totalAgentCost:0};const o=Ie(s),l=new Map;let d=0;for(let i=0;i<t.length;i++){const g=t[i];if(!g.tokens)continue;const y={[g.model??"claude-sonnet-4"]:g.tokens},h=De(y,o);l.set(i,h.totalUSD),d+=h.totalUSD}return{agentCosts:l,totalAgentCost:d}},[s,t]);if(t.length===0)return null;const r=t.reduce((o,l)=>o+(l.totalTokens??Z(l)??0),0);return e.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900/50 p-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Agent Dispatches"}),e.jsxs("p",{className:"mt-1 text-xs text-gray-500",children:[t.length," agent dispatch",t.length!==1?"es":"",r>0&&e.jsxs("span",{className:"ml-1 text-indigo-400",children:["(",M(r)," tokens",n>0&&` · ~${E(n)}`,")"]})]}),e.jsx("div",{className:"mt-3 space-y-1",children:t.map((o,l)=>{const d=o.totalTokens??Z(o),i=a.get(l);return e.jsxs("div",{className:"flex items-start gap-2 rounded bg-gray-950/40 px-2 py-1.5",children:[e.jsx("span",{className:"shrink-0 rounded bg-indigo-500/20 px-1.5 py-0.5 text-[10px] font-semibold text-indigo-300",children:o.subagentType}),o.model&&e.jsx("span",{className:"shrink-0 rounded bg-gray-800 px-1.5 py-0.5 text-[10px] font-mono text-gray-400",children:o.model.replace(/^claude-/,"").replace(/-\d{8}$/,"")}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-gray-400",children:o.description}),e.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[d!=null&&d>0&&e.jsx("span",{className:"text-[10px] font-mono text-indigo-400/80",children:M(d)}),i!=null&&i>0&&e.jsxs("span",{className:"text-[10px] font-mono text-emerald-400/80",children:["~",E(i)]}),o.totalToolUseCount!=null&&e.jsxs("span",{className:"text-[10px] text-gray-500",children:[o.totalToolUseCount," tools"]}),o.durationMs!=null&&e.jsx("span",{className:"text-[10px] text-gray-600",children:X(o.durationMs)}),o.timestamp&&e.jsx("span",{className:"text-[10px] text-gray-600",children:S(new Date(o.timestamp),"HH:mm:ss")})]})]},`a-${l}`)})})]})}function xt({agents:t,skills:s}){const{groups:a,totalCount:n}=b.useMemo(()=>{const r=[...s.map(l=>({...l,agentSource:null})),...t.flatMap(l=>(l.skills??[]).map(d=>({...d,agentSource:l.subagentType})))].sort((l,d)=>l.timestamp.localeCompare(d.timestamp)),o=new Map;for(const l of r){let d=o.get(l.skill);d||(d={skill:l.skill,count:0,hasInjected:!1,invocations:[]},o.set(l.skill,d)),d.count++,l.source==="injected"&&(d.hasInjected=!0),d.invocations.push({agentSource:l.agentSource,timestamp:l.timestamp,source:l.source})}return{groups:Array.from(o.values()),totalCount:r.length}},[s,t]);return n===0?null:e.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900/50 p-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Skill Invocations"}),e.jsxs("p",{className:"mt-1 text-xs text-gray-500",children:[a.length," unique skill",a.length!==1?"s":"",","," ",n," invocation",n!==1?"s":""]}),e.jsx("div",{className:"mt-3 space-y-1",children:a.map(r=>e.jsxs("div",{className:"rounded bg-gray-950/40 px-2 py-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"shrink-0 rounded bg-brand-500/20 px-1.5 py-0.5 text-[10px] font-semibold text-brand-400",children:["/",r.skill]}),e.jsxs("span",{className:"text-[10px] text-gray-500",children:["×",r.count]}),r.hasInjected&&e.jsx("span",{className:"shrink-0 rounded bg-gray-800/40 px-1 py-0.5 text-[9px] text-gray-500",children:"context"})]}),e.jsx("div",{className:"mt-1 ml-2 flex flex-wrap gap-x-1 text-[10px] text-gray-500",children:r.invocations.map((o,l)=>e.jsxs("span",{children:[e.jsx("span",{className:"text-gray-400",children:o.agentSource??"session"}),", ",e.jsx("span",{className:"text-gray-600",children:S(new Date(o.timestamp),"HH:mm:ss")}),l<r.invocations.length-1&&e.jsx("span",{className:"text-gray-700",children:"; "})]},l))})]},r.skill))})]})}const mt={pending:{label:"Pending",bg:"bg-gray-500/20",text:"text-gray-400"},in_progress:{label:"In Progress",bg:"bg-brand-500/20",text:"text-brand-400"},completed:{label:"Done",bg:"bg-emerald-500/20",text:"text-emerald-400"},deleted:{label:"Deleted",bg:"bg-red-500/20",text:"text-red-400"}};function ut({tasks:t}){if(t.length===0)return null;const s=t.filter(n=>n.status==="completed").length,a=t.filter(n=>n.status!=="deleted").length;return e.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900/50 p-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Tasks"}),e.jsxs("p",{className:"mt-1 text-xs text-gray-500",children:[s,"/",a," completed"]}),e.jsx("div",{className:"mt-3 space-y-1",children:t.map((n,r)=>{const o=mt[n.status];return e.jsxs("div",{className:"flex items-start gap-2 rounded bg-gray-950/40 px-2 py-1.5",children:[e.jsx("span",{className:`shrink-0 rounded px-1.5 py-0.5 text-[10px] font-semibold ${o.bg} ${o.text}`,children:o.label}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"text-xs text-gray-300",children:n.subject}),n.description&&e.jsx("p",{className:"mt-0.5 truncate text-[10px] text-gray-500",children:n.description})]}),n.taskId&&e.jsxs("span",{className:"shrink-0 text-[10px] font-mono text-gray-600",children:["#",n.taskId]}),n.timestamp&&e.jsx("span",{className:"shrink-0 text-[10px] text-gray-600",children:S(new Date(n.timestamp),"HH:mm:ss")})]},n.taskId||r)})})]})}function pt({tokensByModel:t}){const{cost:s,isLoading:a}=J(t);return a?e.jsx("div",{className:"rounded-xl border border-gray-800 bg-gray-900/50 p-4",children:e.jsx("div",{className:"h-6 w-32 animate-pulse rounded bg-gray-800"})}):!s||s.totalUSD===0?e.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900/50 p-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Cost Estimation"}),e.jsx("p",{className:"mt-2 text-xs text-gray-500",children:"No token data available"})]}):e.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900/50 p-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Cost Estimation"}),e.jsxs("span",{className:"font-mono text-lg font-bold text-gray-100",children:["~",E(s.totalUSD)]})]}),e.jsxs("div",{className:"mt-4",children:[e.jsx("p",{className:"text-xs font-medium text-gray-400",children:"By Category"}),e.jsx(gt,{cost:s}),e.jsx(ht,{cost:s})]}),e.jsxs("div",{className:"mt-4",children:[e.jsx("p",{className:"text-xs font-medium text-gray-400",children:"By Model"}),e.jsx(yt,{cost:s})]}),e.jsxs("div",{className:"mt-3 flex items-center justify-between border-t border-gray-800 pt-3",children:[e.jsx("p",{className:"text-[10px] text-gray-600",children:"Estimated based on API pricing. Actual costs may vary."}),e.jsx(W,{to:"/settings",className:"text-[10px] text-gray-500 hover:text-gray-300",children:"Configure pricing"})]})]})}function gt({cost:t}){const s=[{label:"Input tokens",value:t.byCategory.input,color:"text-brand-400"},{label:"Output tokens",value:t.byCategory.output,color:"text-emerald-400"},{label:"Cache read",value:t.byCategory.cacheRead,color:"text-amber-400"},{label:"Cache write",value:t.byCategory.cacheWrite,color:"text-purple-400"}];return e.jsx("div",{className:"mt-2 space-y-1",children:s.map(a=>e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-gray-400",children:a.label}),e.jsx("span",{className:`font-mono text-xs ${a.color}`,children:E(a.value)})]},a.label))})}function ht({cost:t}){if(t.totalUSD===0)return null;const s=[{key:"input",value:t.byCategory.input,color:"bg-brand-400"},{key:"output",value:t.byCategory.output,color:"bg-emerald-400"},{key:"cacheRead",value:t.byCategory.cacheRead,color:"bg-amber-400"},{key:"cacheWrite",value:t.byCategory.cacheWrite,color:"bg-purple-400"}];return e.jsx("div",{className:"mt-2 flex h-2 overflow-hidden rounded-full bg-gray-800",children:s.map(a=>{const n=a.value/t.totalUSD*100;return n<.5?null:e.jsx("div",{className:`${a.color} opacity-60`,style:{width:`${n}%`}},a.key)})})}function yt({cost:t}){const s=Object.values(t.byModel).sort((a,n)=>n.totalCost-a.totalCost);return s.length===0?null:e.jsx("div",{className:"mt-2 space-y-1",children:s.map(a=>{const n=t.totalUSD>0?Math.round(a.totalCost/t.totalUSD*100):0;return e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-mono text-xs text-gray-300",children:a.displayName}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-mono text-xs text-gray-300",children:E(a.totalCost)}),e.jsxs("span",{className:"text-[10px] text-gray-500",children:["(",n,"%)"]}),e.jsxs("span",{className:"text-[10px] text-gray-600",children:[M(a.tokens.inputTokens+a.tokens.outputTokens+a.tokens.cacheReadInputTokens+a.tokens.cacheCreationInputTokens)," ","tok"]})]})]},a.modelId)})})}function ft({tokensByModel:t}){const{cost:s,isLoading:a}=J(t);return a||!s||s.totalUSD===0?null:e.jsxs("span",{className:"font-mono text-xs text-emerald-400",title:"Estimated cost based on API pricing",children:["~",E(s.totalUSD)]})}function bt(){return e.jsxs("div",{className:"mb-4 flex items-center gap-2 rounded-lg border border-emerald-800 bg-emerald-900/30 px-4 py-2 text-sm text-emerald-300",children:[e.jsxs("span",{className:"relative flex h-2 w-2",children:[e.jsx("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-emerald-400 opacity-75"}),e.jsx("span",{className:"relative inline-flex h-2 w-2 rounded-full bg-emerald-500"})]}),"This session is currently active. Data refreshes automatically."]})}function jt(t){const{data:s}=F(Pe);return s?.some(a=>a.sessionId===t)??!1}function vt({sessionId:t}){const[s,a]=b.useState(!1),n=b.useRef(void 0);b.useEffect(()=>()=>clearTimeout(n.current),[]);async function r(){try{await navigator.clipboard.writeText(`claude --resume ${t}`),a(!0),clearTimeout(n.current),n.current=setTimeout(()=>a(!1),2e3)}catch{}}return e.jsxs("span",{className:"inline-flex items-center gap-1.5 font-mono text-xs text-gray-600",children:[e.jsx("span",{children:t}),e.jsx("button",{type:"button",onClick:r,className:"rounded px-1 py-0.5 text-gray-500 hover:bg-gray-800 hover:text-gray-300",title:"Copy resume command",children:s?"Copied!":"Copy"})]})}function St(){const{sessionId:t}=G.useParams(),{project:s=""}=G.useSearch(),{privacyMode:a,anonymizeProjectName:n,anonymizeBranch:r}=ne(),o=jt(t),{data:l,isLoading:d,error:i}=F(Ke(t,s,o));if(d)return e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"h-8 w-48 animate-pulse rounded bg-gray-800"}),e.jsx("div",{className:"h-64 animate-pulse rounded-xl bg-gray-900/50"})]});if(i||!l)return e.jsxs("div",{className:"py-12 text-center",children:[e.jsxs("p",{className:"text-sm text-red-400",children:["Failed to load session: ",i?.message??"Not found"]}),e.jsx(W,{to:"/sessions",className:"mt-2 inline-block text-sm text-brand-300 hover:underline",children:"Back to sessions"})]});const g=l.turns[0]?.timestamp,p=l.turns[l.turns.length-1]?.timestamp,y=g&&p?new Date(p).getTime()-new Date(g).getTime():0;return e.jsxs("div",{children:[o&&e.jsx(bt,{}),e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{children:[e.jsx(W,{to:"/sessions",className:"text-xs text-gray-500 hover:text-gray-300",children:"← Sessions"}),e.jsx("h1",{className:"mt-1 text-xl font-bold text-gray-100",children:a?n(l.projectName):l.projectName}),e.jsxs("div",{className:"mt-1 flex items-center gap-3 text-xs text-gray-400",children:[l.branch&&e.jsx("span",{className:"font-mono",children:r(l.branch)}),g&&e.jsx("span",{children:V(g)}),e.jsx("span",{children:X(y)}),e.jsxs("span",{children:[l.turns.length," turns"]}),e.jsx(ft,{tokensByModel:l.tokensByModel})]}),l.models.length>0&&e.jsx("div",{className:"mt-1 flex gap-1",children:l.models.map(h=>e.jsx("span",{className:"rounded bg-gray-800 px-1.5 py-0.5 text-[10px] font-mono text-gray-400",children:h.replace(/^claude-/,"").split("-202")[0]},h))})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Ae,{options:[{label:"Export Session (JSON)",onClick:()=>$e(Oe(l),`session-${t.slice(0,8)}.json`,"application/json")}]}),e.jsx(vt,{sessionId:t})]})]}),e.jsxs("div",{className:"mt-6 grid grid-cols-1 gap-4 md:grid-cols-2",children:[e.jsx(rt,{contextWindow:l.contextWindow,tokens:l.totalTokens}),e.jsx(it,{toolFrequency:l.toolFrequency})]}),e.jsx("div",{className:"mt-4",children:e.jsx(pt,{tokensByModel:l.tokensByModel})}),l.agents.length>0&&e.jsx("div",{className:"mt-4",children:e.jsx(dt,{agents:l.agents})}),l.tasks.length>0&&e.jsx("div",{className:"mt-4",children:e.jsx(ut,{tasks:l.tasks})}),e.jsx("div",{className:"mt-4",children:e.jsx(ct,{errors:l.errors})}),e.jsxs("div",{className:"mt-6",children:[e.jsx("h2",{className:"mb-3 text-sm font-semibold text-gray-300",children:"Timeline"}),e.jsx(nt,{turns:l.turns,agents:l.agents,skills:l.skills,errors:l.errors})]}),(l.skills.length>0||l.agents.some(h=>(h.skills?.length??0)>0))&&e.jsx("div",{className:"mt-6",children:e.jsx(xt,{agents:l.agents,skills:l.skills})})]})}export{St as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-outline-style:solid}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-900:oklch(39.6% .141 25.723);--color-red-950:oklch(25.8% .092 26.042);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-800:oklch(43.2% .095 166.913);--color-emerald-900:oklch(37.8% .077 168.94);--color-cyan-400:oklch(78.9% .154 211.53);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-800:oklch(42.4% .199 265.638);--color-blue-950:oklch(28.2% .091 267.935);--color-indigo-300:oklch(78.5% .115 274.713);--color-indigo-400:oklch(67.3% .182 276.935);--color-indigo-500:oklch(58.5% .233 277.117);--color-indigo-900:oklch(35.9% .144 278.697);--color-indigo-950:oklch(25.7% .09 281.288);--color-violet-400:oklch(70.2% .183 293.541);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-500:oklch(62.7% .265 303.9);--color-purple-800:oklch(43.8% .218 303.724);--color-purple-950:oklch(29.1% .149 302.717);--color-pink-400:oklch(71.8% .202 349.761);--color-gray-100:#eae6dc;--color-gray-200:#e0dbd0;--color-gray-300:#cdc8b8;--color-gray-400:#a39e90;--color-gray-500:#7a7668;--color-gray-600:#565349;--color-gray-700:#3d3b36;--color-gray-800:#2a2926;--color-gray-900:#1c1c1a;--color-gray-950:#141413;--color-white:#fff;--spacing:.25rem;--container-5xl:64rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--leading-tight:1.25;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--animate-ping:ping 1s cubic-bezier(0, 0, .2, 1) infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-brand-300:#f0b8a0;--color-brand-400:#e09070;--color-brand-500:#d97757;--color-brand-600:#c4643f}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.-top-8{top:calc(var(--spacing) * -8)}.right-0{right:calc(var(--spacing) * 0)}.bottom-0{bottom:calc(var(--spacing) * 0)}.left-1\/2{left:50%}.isolate{isolation:isolate}.z-10{z-index:10}.z-50{z-index:50}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-auto{margin-inline:auto}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-8{height:calc(var(--spacing) * 8)}.h-14{height:calc(var(--spacing) * 14)}.h-20{height:calc(var(--spacing) * 20)}.h-28{height:calc(var(--spacing) * 28)}.h-32{height:calc(var(--spacing) * 32)}.h-64{height:calc(var(--spacing) * 64)}.h-72{height:calc(var(--spacing) * 72)}.h-full{height:100%}.max-h-64{max-height:calc(var(--spacing) * 64)}.min-h-screen{min-height:100vh}.w-2{width:calc(var(--spacing) * 2)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-9{width:calc(var(--spacing) * 9)}.w-16{width:calc(var(--spacing) * 16)}.w-20{width:calc(var(--spacing) * 20)}.w-32{width:calc(var(--spacing) * 32)}.w-48{width:calc(var(--spacing) * 48)}.w-56{width:calc(var(--spacing) * 56)}.w-full{width:100%}.max-w-5xl{max-width:var(--container-5xl)}.max-w-48{max-width:calc(var(--spacing) * 48)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-\[2rem\]{min-width:2rem}.min-w-\[3rem\]{min-width:3rem}.min-w-\[200px\]{min-width:200px}.flex-1{flex:1}.shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-\[3px\]{--tw-translate-x:3px;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-\[18px\]{--tw-translate-x:18px;translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-45{rotate:45deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-ping{animation:var(--animate-ping)}.animate-pulse{animation:var(--animate-pulse)}.cursor-help{cursor:help}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-1{column-gap:calc(var(--spacing) * 1)}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-y-1{row-gap:calc(var(--spacing) * 1)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.rounded-l-lg{border-top-left-radius:var(--radius-lg);border-bottom-left-radius:var(--radius-lg)}.rounded-r-lg{border-top-right-radius:var(--radius-lg);border-bottom-right-radius:var(--radius-lg)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-blue-800{border-color:var(--color-blue-800)}.border-brand-500{border-color:var(--color-brand-500)}.border-brand-500\/50{border-color:#d9775780}@supports (color:color-mix(in lab,red,red)){.border-brand-500\/50{border-color:color-mix(in oklab,var(--color-brand-500) 50%,transparent)}}.border-emerald-800{border-color:var(--color-emerald-800)}.border-gray-700{border-color:var(--color-gray-700)}.border-gray-800{border-color:var(--color-gray-800)}.border-gray-800\/50{border-color:#2a292680}@supports (color:color-mix(in lab,red,red)){.border-gray-800\/50{border-color:color-mix(in oklab,var(--color-gray-800) 50%,transparent)}}.border-indigo-500\/10{border-color:#625fff1a}@supports (color:color-mix(in lab,red,red)){.border-indigo-500\/10{border-color:color-mix(in oklab,var(--color-indigo-500) 10%,transparent)}}.border-indigo-500\/20{border-color:#625fff33}@supports (color:color-mix(in lab,red,red)){.border-indigo-500\/20{border-color:color-mix(in oklab,var(--color-indigo-500) 20%,transparent)}}.border-purple-800{border-color:var(--color-purple-800)}.border-red-900\/50{border-color:#82181a80}@supports (color:color-mix(in lab,red,red)){.border-red-900\/50{border-color:color-mix(in oklab,var(--color-red-900) 50%,transparent)}}.border-transparent{border-color:#0000}.bg-amber-400{background-color:var(--color-amber-400)}.bg-amber-500{background-color:var(--color-amber-500)}.bg-amber-500\/15{background-color:#f99c0026}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/15{background-color:color-mix(in oklab,var(--color-amber-500) 15%,transparent)}}.bg-blue-950{background-color:var(--color-blue-950)}.bg-brand-400{background-color:var(--color-brand-400)}.bg-brand-500{background-color:var(--color-brand-500)}.bg-brand-500\/10{background-color:#d977571a}@supports (color:color-mix(in lab,red,red)){.bg-brand-500\/10{background-color:color-mix(in oklab,var(--color-brand-500) 10%,transparent)}}.bg-brand-500\/15{background-color:#d9775726}@supports (color:color-mix(in lab,red,red)){.bg-brand-500\/15{background-color:color-mix(in oklab,var(--color-brand-500) 15%,transparent)}}.bg-brand-500\/20{background-color:#d9775733}@supports (color:color-mix(in lab,red,red)){.bg-brand-500\/20{background-color:color-mix(in oklab,var(--color-brand-500) 20%,transparent)}}.bg-brand-600{background-color:var(--color-brand-600)}.bg-emerald-400{background-color:var(--color-emerald-400)}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-emerald-500\/15{background-color:#00bb7f26}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/15{background-color:color-mix(in oklab,var(--color-emerald-500) 15%,transparent)}}.bg-emerald-500\/20{background-color:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/20{background-color:color-mix(in oklab,var(--color-emerald-500) 20%,transparent)}}.bg-emerald-900\/30{background-color:#004e3b4d}@supports (color:color-mix(in lab,red,red)){.bg-emerald-900\/30{background-color:color-mix(in oklab,var(--color-emerald-900) 30%,transparent)}}.bg-gray-500{background-color:var(--color-gray-500)}.bg-gray-500\/15{background-color:#7a766826}@supports (color:color-mix(in lab,red,red)){.bg-gray-500\/15{background-color:color-mix(in oklab,var(--color-gray-500) 15%,transparent)}}.bg-gray-500\/20{background-color:#7a766833}@supports (color:color-mix(in lab,red,red)){.bg-gray-500\/20{background-color:color-mix(in oklab,var(--color-gray-500) 20%,transparent)}}.bg-gray-600{background-color:var(--color-gray-600)}.bg-gray-700{background-color:var(--color-gray-700)}.bg-gray-800{background-color:var(--color-gray-800)}.bg-gray-800\/40{background-color:#2a292666}@supports (color:color-mix(in lab,red,red)){.bg-gray-800\/40{background-color:color-mix(in oklab,var(--color-gray-800) 40%,transparent)}}.bg-gray-800\/50{background-color:#2a292680}@supports (color:color-mix(in lab,red,red)){.bg-gray-800\/50{background-color:color-mix(in oklab,var(--color-gray-800) 50%,transparent)}}.bg-gray-900{background-color:var(--color-gray-900)}.bg-gray-900\/50{background-color:#1c1c1a80}@supports (color:color-mix(in lab,red,red)){.bg-gray-900\/50{background-color:color-mix(in oklab,var(--color-gray-900) 50%,transparent)}}.bg-gray-950{background-color:var(--color-gray-950)}.bg-gray-950\/40{background-color:#14141366}@supports (color:color-mix(in lab,red,red)){.bg-gray-950\/40{background-color:color-mix(in oklab,var(--color-gray-950) 40%,transparent)}}.bg-indigo-500\/15{background-color:#625fff26}@supports (color:color-mix(in lab,red,red)){.bg-indigo-500\/15{background-color:color-mix(in oklab,var(--color-indigo-500) 15%,transparent)}}.bg-indigo-500\/20{background-color:#625fff33}@supports (color:color-mix(in lab,red,red)){.bg-indigo-500\/20{background-color:color-mix(in oklab,var(--color-indigo-500) 20%,transparent)}}.bg-indigo-900\/30{background-color:#312c854d}@supports (color:color-mix(in lab,red,red)){.bg-indigo-900\/30{background-color:color-mix(in oklab,var(--color-indigo-900) 30%,transparent)}}.bg-indigo-950\/15{background-color:#1e1a4d26}@supports (color:color-mix(in lab,red,red)){.bg-indigo-950\/15{background-color:color-mix(in oklab,var(--color-indigo-950) 15%,transparent)}}.bg-purple-400{background-color:var(--color-purple-400)}.bg-purple-500{background-color:var(--color-purple-500)}.bg-purple-500\/15{background-color:#ac4bff26}@supports (color:color-mix(in lab,red,red)){.bg-purple-500\/15{background-color:color-mix(in oklab,var(--color-purple-500) 15%,transparent)}}.bg-purple-950{background-color:var(--color-purple-950)}.bg-red-500\/15{background-color:#fb2c3626}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/15{background-color:color-mix(in oklab,var(--color-red-500) 15%,transparent)}}.bg-red-500\/20{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/20{background-color:color-mix(in oklab,var(--color-red-500) 20%,transparent)}}.bg-red-950\/20{background-color:#46080933}@supports (color:color-mix(in lab,red,red)){.bg-red-950\/20{background-color:color-mix(in oklab,var(--color-red-950) 20%,transparent)}}.bg-red-950\/30{background-color:#4608094d}@supports (color:color-mix(in lab,red,red)){.bg-red-950\/30{background-color:color-mix(in oklab,var(--color-red-950) 30%,transparent)}}.bg-white{background-color:var(--color-white)}.fill-amber-400\/70{fill:#fcbb00b3}@supports (color:color-mix(in lab,red,red)){.fill-amber-400\/70{fill:color-mix(in oklab,var(--color-amber-400) 70%,transparent)}}.fill-gray-500{fill:var(--color-gray-500)}.fill-indigo-400\/70{fill:#7d87ffb3}@supports (color:color-mix(in lab,red,red)){.fill-indigo-400\/70{fill:color-mix(in oklab,var(--color-indigo-400) 70%,transparent)}}.fill-red-400\/70{fill:#ff6568b3}@supports (color:color-mix(in lab,red,red)){.fill-red-400\/70{fill:color-mix(in oklab,var(--color-red-400) 70%,transparent)}}.p-2\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-12{padding-block:calc(var(--spacing) * 12)}.pt-1\.5{padding-top:calc(var(--spacing) * 1.5)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-none{--tw-leading:1;line-height:1}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.whitespace-nowrap{white-space:nowrap}.text-amber-300{color:var(--color-amber-300)}.text-amber-400{color:var(--color-amber-400)}.text-amber-400\/60{color:#fcbb0099}@supports (color:color-mix(in lab,red,red)){.text-amber-400\/60{color:color-mix(in oklab,var(--color-amber-400) 60%,transparent)}}.text-blue-400{color:var(--color-blue-400)}.text-brand-300{color:var(--color-brand-300)}.text-brand-400{color:var(--color-brand-400)}.text-brand-500{color:var(--color-brand-500)}.text-cyan-400{color:var(--color-cyan-400)}.text-emerald-300{color:var(--color-emerald-300)}.text-emerald-400{color:var(--color-emerald-400)}.text-emerald-400\/80{color:#00d294cc}@supports (color:color-mix(in lab,red,red)){.text-emerald-400\/80{color:color-mix(in oklab,var(--color-emerald-400) 80%,transparent)}}.text-gray-100{color:var(--color-gray-100)}.text-gray-200{color:var(--color-gray-200)}.text-gray-300{color:var(--color-gray-300)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-indigo-300{color:var(--color-indigo-300)}.text-indigo-300\/70{color:#a4b3ffb3}@supports (color:color-mix(in lab,red,red)){.text-indigo-300\/70{color:color-mix(in oklab,var(--color-indigo-300) 70%,transparent)}}.text-indigo-400{color:var(--color-indigo-400)}.text-indigo-400\/50{color:#7d87ff80}@supports (color:color-mix(in lab,red,red)){.text-indigo-400\/50{color:color-mix(in oklab,var(--color-indigo-400) 50%,transparent)}}.text-indigo-400\/80{color:#7d87ffcc}@supports (color:color-mix(in lab,red,red)){.text-indigo-400\/80{color:color-mix(in oklab,var(--color-indigo-400) 80%,transparent)}}.text-pink-400{color:var(--color-pink-400)}.text-purple-400{color:var(--color-purple-400)}.text-red-200\/80{color:#ffcacacc}@supports (color:color-mix(in lab,red,red)){.text-red-200\/80{color:color-mix(in oklab,var(--color-red-200) 80%,transparent)}}.text-red-300{color:var(--color-red-300)}.text-red-400{color:var(--color-red-400)}.text-violet-400{color:var(--color-violet-400)}.capitalize{text-transform:capitalize}.lowercase{text-transform:lowercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.placeholder-gray-500::placeholder{color:var(--color-gray-500)}.opacity-60{opacity:.6}.opacity-75{opacity:.75}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\:block:is(:where(.group):hover *){display:block}.hover\:border-gray-600:hover{border-color:var(--color-gray-600)}.hover\:border-gray-700:hover{border-color:var(--color-gray-700)}.hover\:bg-brand-500:hover{background-color:var(--color-brand-500)}.hover\:bg-gray-700:hover{background-color:var(--color-gray-700)}.hover\:bg-gray-800:hover{background-color:var(--color-gray-800)}.hover\:bg-gray-800\/30:hover{background-color:#2a29264d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-gray-800\/30:hover{background-color:color-mix(in oklab,var(--color-gray-800) 30%,transparent)}}.hover\:bg-gray-900:hover{background-color:var(--color-gray-900)}.hover\:bg-indigo-950\/30:hover{background-color:#1e1a4d4d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-indigo-950\/30:hover{background-color:color-mix(in oklab,var(--color-indigo-950) 30%,transparent)}}.hover\:fill-indigo-500\/15:hover{fill:#625fff26}@supports (color:color-mix(in lab,red,red)){.hover\:fill-indigo-500\/15:hover{fill:color-mix(in oklab,var(--color-indigo-500) 15%,transparent)}}.hover\:text-gray-200:hover{color:var(--color-gray-200)}.hover\:text-gray-300:hover{color:var(--color-gray-300)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}}.focus\:border-brand-500:focus{border-color:var(--color-brand-500)}.focus\:ring-1:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-brand-500:focus{--tw-ring-color:var(--color-brand-500)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:outline:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.focus-visible\:outline-2:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.focus-visible\:outline-offset-2:focus-visible{outline-offset:2px}.focus-visible\:outline-brand-500:focus-visible{outline-color:var(--color-brand-500)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-40:disabled{opacity:.4}@media(hover:hover){.disabled\:hover\:bg-gray-800:disabled:hover{background-color:var(--color-gray-800)}.disabled\:hover\:text-gray-400:disabled:hover{color:var(--color-gray-400)}}@media(min-width:40rem){.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:justify-between{justify-content:space-between}}@media(min-width:48rem){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media(min-width:64rem){.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}}:root{color-scheme:dark}:root[data-theme=light]{color-scheme:light;--color-gray-50:#141413;--color-gray-100:#1c1c1a;--color-gray-200:#2a2926;--color-gray-300:#3d3b36;--color-gray-400:#565349;--color-gray-500:#7a7668;--color-gray-600:#a39e90;--color-gray-700:#cdc8b8;--color-gray-800:#e0dbd0;--color-gray-900:#eae6dc;--color-gray-950:#f5f3ec}body{background-color:var(--color-gray-950);color:var(--color-gray-100);transition:background-color .15s,color .15s}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}@keyframes pulse{50%{opacity:.5}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{S as te,E as V,F as p,s as _,G as R,q as F,H as x,I as L,J as se,K as E,M as re,N as ne,P as B,o as J,r as v,t as Y,p as ie,Q as ae,T as k,U as oe,V as he}from"./main-DMwMzWYr.js";function $(e){if(Array.isArray(e))return e.flatMap(o=>$(o));if(typeof e!="string")return[];const t=[];let s=0,r,a,i,n,h;const u=()=>{for(;s<e.length&&/\s/.test(e.charAt(s));)s+=1;return s<e.length},c=()=>(a=e.charAt(s),a!=="="&&a!==";"&&a!==",");for(;s<e.length;){for(r=s,h=!1;u();)if(a=e.charAt(s),a===","){for(i=s,s+=1,u(),n=s;s<e.length&&c();)s+=1;s<e.length&&e.charAt(s)==="="?(h=!0,s=n,t.push(e.slice(r,i)),r=s):s=i+1}else s+=1;(!h||s>=e.length)&&t.push(e.slice(r))}return t}function ce(e){return e instanceof Headers?e:Array.isArray(e)?new Headers(e):typeof e=="object"?new Headers(e):null}function le(...e){return e.reduce((t,s)=>{const r=ce(s);if(!r)return t;for(const[a,i]of r.entries())a==="set-cookie"?$(i).forEach(n=>t.append("set-cookie",n)):t.set(a,i);return t},new Headers)}var ue=class extends te{constructor(e,t){super(),this.options=t,this.#s=e,this.#n=null,this.#r=V(),this.bindMethods(),this.setOptions(t)}#s;#e=void 0;#p=void 0;#t=void 0;#a;#l;#r;#n;#v;#u;#d;#o;#h;#i;#f=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),W(this.#e,this.options)?this.#c():this.updateResult(),this.#m())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Q(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Q(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#R(),this.#g(),this.#e.removeObserver(this)}setOptions(e){const t=this.options,s=this.#e;if(this.options=this.#s.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof p(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#O(),this.#e.setOptions(this.options),t._defaulted&&!_(this.options,t)&&this.#s.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const r=this.hasListeners();r&&G(this.#e,s,this.options,t)&&this.#c(),this.updateResult(),r&&(this.#e!==s||p(this.options.enabled,this.#e)!==p(t.enabled,this.#e)||R(this.options.staleTime,this.#e)!==R(t.staleTime,this.#e))&&this.#y();const a=this.#w();r&&(this.#e!==s||p(this.options.enabled,this.#e)!==p(t.enabled,this.#e)||a!==this.#i)&&this.#b(a)}getOptimisticResult(e){const t=this.#s.getQueryCache().build(this.#s,e),s=this.createResult(t,e);return fe(this,s)&&(this.#t=s,this.#l=this.options,this.#a=this.#e.state),s}getCurrentResult(){return this.#t}trackResult(e,t){return new Proxy(e,{get:(s,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#r.status==="pending"&&this.#r.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,r))})}trackProp(e){this.#f.add(e)}getCurrentQuery(){return this.#e}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#s.defaultQueryOptions(e),s=this.#s.getQueryCache().build(this.#s,t);return s.fetch().then(()=>this.createResult(s,t))}fetch(e){return this.#c({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#t))}#c(e){this.#O();let t=this.#e.fetch(this.options,e);return e?.throwOnError||(t=t.catch(F)),t}#y(){this.#R();const e=R(this.options.staleTime,this.#e);if(x||this.#t.isStale||!L(e))return;const s=se(this.#t.dataUpdatedAt,e)+1;this.#o=E.setTimeout(()=>{this.#t.isStale||this.updateResult()},s)}#w(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#b(e){this.#g(),this.#i=e,!(x||p(this.options.enabled,this.#e)===!1||!L(this.#i)||this.#i===0)&&(this.#h=E.setInterval(()=>{(this.options.refetchIntervalInBackground||re.isFocused())&&this.#c()},this.#i))}#m(){this.#y(),this.#b(this.#w())}#R(){this.#o&&(E.clearTimeout(this.#o),this.#o=void 0)}#g(){this.#h&&(E.clearInterval(this.#h),this.#h=void 0)}createResult(e,t){const s=this.#e,r=this.options,a=this.#t,i=this.#a,n=this.#l,u=e!==s?e.state:this.#p,{state:c}=e;let o={...c},d=!1,l;if(t._optimisticResults){const f=this.hasListeners(),m=!f&&W(e,t),g=f&&G(e,s,t,r);(m||g)&&(o={...o,...ne(c.data,e.options)}),t._optimisticResults==="isRestoring"&&(o.fetchStatus="idle")}let{error:y,errorUpdatedAt:N,status:b}=o;l=o.data;let A=!1;if(t.placeholderData!==void 0&&l===void 0&&b==="pending"){let f;a?.isPlaceholderData&&t.placeholderData===n?.placeholderData?(f=a.data,A=!0):f=typeof t.placeholderData=="function"?t.placeholderData(this.#d?.state.data,this.#d):t.placeholderData,f!==void 0&&(b="success",l=B(a?.data,f,t),d=!0)}if(t.select&&l!==void 0&&!A)if(a&&l===i?.data&&t.select===this.#v)l=this.#u;else try{this.#v=t.select,l=t.select(l),l=B(a?.data,l,t),this.#u=l,this.#n=null}catch(f){this.#n=f}this.#n&&(y=this.#n,l=this.#u,N=Date.now(),b="error");const C=o.fetchStatus==="fetching",M=b==="pending",I=b==="error",D=M&&C,j=l!==void 0,w={status:b,fetchStatus:o.fetchStatus,isPending:M,isSuccess:b==="success",isError:I,isInitialLoading:D,isLoading:D,data:l,dataUpdatedAt:o.dataUpdatedAt,error:y,errorUpdatedAt:N,failureCount:o.fetchFailureCount,failureReason:o.fetchFailureReason,errorUpdateCount:o.errorUpdateCount,isFetched:o.dataUpdateCount>0||o.errorUpdateCount>0,isFetchedAfterMount:o.dataUpdateCount>u.dataUpdateCount||o.errorUpdateCount>u.errorUpdateCount,isFetching:C,isRefetching:C&&!M,isLoadingError:I&&!j,isPaused:o.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:I&&j,isStale:U(e,t),refetch:this.refetch,promise:this.#r,isEnabled:p(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const f=w.data!==void 0,m=w.status==="error"&&!f,g=S=>{m?S.reject(w.error):f&&S.resolve(w.data)},H=()=>{const S=this.#r=w.promise=V();g(S)},O=this.#r;switch(O.status){case"pending":e.queryHash===s.queryHash&&g(O);break;case"fulfilled":(m||w.data!==O.value)&&H();break;case"rejected":(!m||w.error!==O.reason)&&H();break}}return w}updateResult(){const e=this.#t,t=this.createResult(this.#e,this.options);if(this.#a=this.#e.state,this.#l=this.options,this.#a.data!==void 0&&(this.#d=this.#e),_(t,e))return;this.#t=t;const s=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,a=typeof r=="function"?r():r;if(a==="all"||!a&&!this.#f.size)return!0;const i=new Set(a??this.#f);return this.options.throwOnError&&i.add("error"),Object.keys(this.#t).some(n=>{const h=n;return this.#t[h]!==e[h]&&i.has(h)})};this.#S({listeners:s()})}#O(){const e=this.#s.getQueryCache().build(this.#s,this.options);if(e===this.#e)return;const t=this.#e;this.#e=e,this.#p=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#m()}#S(e){J.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#t)}),this.#s.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function de(e,t){return p(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function W(e,t){return de(e,t)||e.state.data!==void 0&&Q(e,t,t.refetchOnMount)}function Q(e,t,s){if(p(t.enabled,e)!==!1&&R(t.staleTime,e)!=="static"){const r=typeof s=="function"?s(e):s;return r==="always"||r!==!1&&U(e,t)}return!1}function G(e,t,s,r){return(e!==t||p(r.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&U(e,s)}function U(e,t){return p(t.enabled,e)!==!1&&e.isStaleByTime(R(t.staleTime,e))}function fe(e,t){return!_(e.getCurrentResult(),t)}var X=v.createContext(!1),pe=()=>v.useContext(X);X.Provider;function ve(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var ye=v.createContext(ve()),we=()=>v.useContext(ye),be=(e,t,s)=>{const r=s?.state.error&&typeof e.throwOnError=="function"?Y(e.throwOnError,[s.state.error,s]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},me=e=>{v.useEffect(()=>{e.clearReset()},[e])},Re=({result:e,errorResetBoundary:t,throwOnError:s,query:r,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(a&&e.data===void 0||Y(s,[e.error,r])),ge=e=>{if(e.suspense){const s=a=>a==="static"?a:Math.max(a??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...a)=>s(r(...a)):s(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Oe=(e,t)=>e.isLoading&&e.isFetching&&!t,Se=(e,t)=>e?.suspense&&t.isPending,z=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function Ee(e,t,s){const r=pe(),a=we(),i=ie(),n=i.defaultQueryOptions(e);i.getDefaultOptions().queries?._experimental_beforeQuery?.(n);const h=i.getQueryCache().get(n.queryHash);n._optimisticResults=r?"isRestoring":"optimistic",ge(n),be(n,a,h),me(a);const u=!i.getQueryCache().get(n.queryHash),[c]=v.useState(()=>new t(i,n)),o=c.getOptimisticResult(n),d=!r&&e.subscribed!==!1;if(v.useSyncExternalStore(v.useCallback(l=>{const y=d?c.subscribe(J.batchCalls(l)):F;return c.updateResult(),y},[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),v.useEffect(()=>{c.setOptions(n)},[n,c]),Se(n,o))throw z(n,c,a);if(Re({result:o,errorResetBoundary:a,throwOnError:n.throwOnError,query:h,suspense:n.suspense}))throw o.error;return i.getDefaultOptions().queries?._experimental_afterQuery?.(n,o),n.experimental_prefetchInRender&&!x&&Oe(o,r)&&(u?z(n,c,a):h?.promise)?.catch(F).finally(()=>{c.updateResult()}),n.notifyOnChangeProps?o:c.trackResult(o)}function Fe(e,t){return Ee(e,ue)}function xe(e){return e}function K(e){return e!=="__proto__"&&e!=="constructor"&&e!=="prototype"}function P(e,t){const s=Object.create(null);if(e)for(const r of Object.keys(e))K(r)&&(s[r]=e[r]);if(t&&typeof t=="object")for(const r of Object.keys(t))K(r)&&(s[r]=t[r]);return s}function Z(e){return Object.create(null)}var ee=()=>{throw new Error("createServerOnlyFn() functions can only be called on the server!")},T=(e,t)=>{const s=t||e||{};return typeof s.method>"u"&&(s.method="GET"),Object.assign(i=>T(void 0,{...s,...i}),{options:s,middleware:i=>{const n=[...s.middleware||[]];i.map(u=>{k in u?u.options.middleware&&n.push(...u.options.middleware):n.push(u)});const h=T(void 0,{...s,middleware:n});return h[k]=!0,h},inputValidator:i=>T(void 0,{...s,inputValidator:i}),handler:(...i)=>{const[n,h]=i,u={...s,extractedFn:n,serverFn:h},c=[...u.middleware||[],Ie(u)];return n.method=s.method,Object.assign(async o=>{const d=await q(c,"client",{...n,...u,data:o?.data,headers:o?.headers,signal:o?.signal,fetch:o?.fetch,context:Z()}),l=ae(d.error);if(l)throw l;if(d.error)throw d.error;return d.result},{...n,method:s.method,__executeServer:async o=>{const d=ee(),l=d.contextAfterGlobalMiddlewares;return await q(c,"server",{...n,...o,serverFnMeta:n.serverFnMeta,context:P(l,o.context),request:d.request}).then(y=>({result:y.result,error:y.error,context:y.sendContext}))}})}})};async function q(e,t,s){let r=Ce([...oe()?.functionMiddleware||[],...e]);if(t==="server"){const i=ee();i?.executedRequestMiddlewares&&(r=r.filter(n=>!i.executedRequestMiddlewares.has(n)))}const a=async i=>{const n=r.shift();if(!n)return i;try{"inputValidator"in n.options&&n.options.inputValidator&&t==="server"&&(i.data=await Me(n.options.inputValidator,i.data));let h;if(t==="client"?"client"in n.options&&(h=n.options.client):"server"in n.options&&(h=n.options.server),h){const c=await h({...i,next:async(o={})=>{const d=await a({...i,...o,context:P(i.context,o.context),sendContext:P(i.sendContext,o.sendContext),headers:le(i.headers,o.headers),_callSiteFetch:i._callSiteFetch,fetch:i._callSiteFetch??o.fetch??i.fetch,result:o.result!==void 0?o.result:o instanceof Response?o:i.result,error:o.error??i.error});if(d.error)throw d.error;return d}});if(he(c))return{...i,error:c};if(c instanceof Response)return{...i,result:c};if(!c)throw new Error("User middleware returned undefined. You must call next() or return a result in your middlewares.");return c}return a(i)}catch(h){return{...i,error:h}}};return a({...s,headers:s.headers||{},sendContext:s.sendContext||{},context:s.context||Z(),_callSiteFetch:s.fetch})}function Ce(e,t=100){const s=new Set,r=[],a=(i,n)=>{if(n>t)throw new Error(`Middleware nesting depth exceeded maximum of ${t}. Check for circular references.`);i.forEach(h=>{h.options.middleware&&a(h.options.middleware,n+1),s.has(h)||(s.add(h),r.push(h))})};return a(e,0),r}async function Me(e,t){if(e==null)return{};if("~standard"in e){const s=await e["~standard"].validate(t);if(s.issues)throw new Error(JSON.stringify(s.issues,void 0,2));return s.value}if("parse"in e)return e.parse(t);if(typeof e=="function")return e(t);throw new Error("Invalid validator type!")}function Ie(e){return{"~types":void 0,options:{inputValidator:e.inputValidator,client:async({next:t,sendContext:s,fetch:r,...a})=>{const i={...a,context:s,fetch:r};return t(await e.extractedFn?.(i))},server:async({next:t,...s})=>{const r=await e.serverFn?.(s);return t({...s,result:r})}}}}export{T as c,xe as q,Fe as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,r as g,b as N,L as T,e as S,f as w}from"./main-DMwMzWYr.js";import{u as j}from"./createServerFn-DJjqV8Yc.js";import{p as D,a as R}from"./sessions.queries-D7WObk5d.js";import{d as P,e as $,h as k}from"./format-Bsprb3az.js";const M={windows:"bg-blue-950 text-blue-400 border border-blue-800",wsl:"bg-purple-950 text-purple-400 border border-purple-800"},v="bg-gray-800 text-gray-400 border border-gray-700";function B({sourceLabel:t,platform:a,className:s}){const r=a?M[a]??v:v;return e.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${r}${s?` ${s}`:""}`,children:t})}function _({isActive:t}){return t?e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-emerald-500/15 px-2.5 py-0.5 text-xs font-medium text-emerald-400",children:[e.jsxs("span",{className:"relative flex h-2 w-2",children:[e.jsx("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-emerald-400 opacity-75"}),e.jsx("span",{className:"relative inline-flex h-2 w-2 rounded-full bg-emerald-500"})]}),"Active"]}):e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-gray-500/15 px-2.5 py-0.5 text-xs font-medium text-gray-400",children:[e.jsx("span",{className:"h-2 w-2 rounded-full bg-gray-500"}),"Completed"]})}function F({startedAt:t}){const[a,s]=g.useState(()=>Date.now()-new Date(t).getTime());return g.useEffect(()=>{const r=setInterval(()=>{s(Date.now()-new Date(t).getTime())},1e3);return()=>clearInterval(r)},[t]),e.jsx("span",{className:"text-emerald-400",children:P(a)})}function Q({session:t}){const{privacyMode:a,anonymizePath:s,anonymizeProjectName:r,anonymizeBranch:i}=N(),l=a?r(t.projectName):t.projectName,c=t.cwd?s(t.cwd,t.projectName):null,m=t.branch?i(t.branch):null;return e.jsxs(T,{to:"/sessions/$sessionId",params:{sessionId:t.sessionId},search:{project:t.projectPath},className:"group block rounded-xl border border-gray-800 bg-gray-900/50 p-4 transition-all hover:border-gray-700 hover:bg-gray-900",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"truncate text-sm font-semibold text-gray-100",children:l}),e.jsx(_,{isActive:t.isActive}),t.sourceLabel&&e.jsx(B,{sourceLabel:t.sourceLabel,platform:t.sourcePlatform})]}),m&&e.jsx("p",{className:"mt-1 truncate text-xs text-gray-500",children:e.jsx("span",{className:"font-mono",children:m})})]}),e.jsx("span",{className:"shrink-0 text-xs text-gray-500",children:$(t.lastActiveAt)})]}),e.jsxs("div",{className:"mt-3 flex items-center gap-4 text-xs text-gray-400",children:[e.jsx("span",{title:"Duration",children:t.isActive?e.jsx(F,{startedAt:t.startedAt}):P(t.durationMs)}),e.jsxs("span",{title:"Messages",children:[t.messageCount," msgs"]}),t.model&&e.jsx("span",{title:"Model",className:"truncate font-mono text-gray-500",children:t.model.replace(/^claude-/,"").split("-202")[0]}),e.jsx("span",{title:"File size",className:"text-gray-500",children:k(t.fileSizeBytes)}),e.jsx("span",{title:"Session ID",className:"font-mono text-gray-500",children:t.sessionId.slice(0,8)})]}),c&&e.jsx("p",{className:"mt-2 truncate text-xs font-mono text-gray-600",children:c})]})}function Y({projects:t,activeCount:a}){const s=S(),{search:r,status:i,project:l}=w.useSearch(),{privacyMode:c,anonymizeProjectName:m}=N(),[h,d]=g.useState(r),o=g.useRef(null);g.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),g.useEffect(()=>{d(r)},[r]);function f(n){d(n),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{s({to:"/sessions",search:p=>({...p,search:n,page:1})})},300)}function y(n){s({to:"/sessions",search:p=>({...p,status:n,page:1})})}function b(n){s({to:"/sessions",search:p=>({...p,project:n,page:1})})}return e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("input",{type:"text",placeholder:"Search sessions...",value:h,onChange:n=>f(n.target.value),className:"rounded-lg border border-gray-700 bg-gray-800/50 px-3 py-1.5 text-sm text-gray-200 placeholder-gray-500 outline-none focus:border-brand-500 focus:ring-1 focus:ring-brand-500"}),e.jsx("div",{className:"flex rounded-lg border border-gray-700 text-xs",children:["all","active","completed"].map(n=>e.jsxs("button",{onClick:()=>y(n),className:`px-3 py-1.5 capitalize transition-colors ${i===n?"bg-gray-700 text-gray-100":"text-gray-400 hover:text-gray-200"} ${n==="all"?"rounded-l-lg":""} ${n==="completed"?"rounded-r-lg":""}`,children:[n,n==="active"&&a>0&&e.jsxs("span",{className:"ml-1 text-emerald-400",children:["(",a,")"]})]},n))}),t.length>1&&e.jsxs("select",{value:l,onChange:n=>b(n.target.value),className:"rounded-lg border border-gray-700 bg-gray-800/50 px-3 py-1.5 text-sm text-gray-200 outline-none focus:border-brand-500",children:[e.jsx("option",{value:"",children:"All projects"}),t.map(n=>e.jsx("option",{value:n,children:c?m(n):n},n))]})]})}const C="claude-dashboard:page-size",A=[5,10,25,50];function I(t){return A.includes(t)}function O(){if(typeof window>"u")return null;try{const t=localStorage.getItem(C);if(t!==null){const a=Number(t);if(I(a))return a}}catch{}return null}function V(){const[t,a]=g.useState(O),s=g.useCallback(r=>{if(I(r))try{localStorage.setItem(C,String(r)),a(r)}catch{}},[]);return{storedPageSize:t,setPageSize:s}}function G({page:t,totalPages:a,totalCount:s,pageSize:r,onPageChange:i,onPageSizeChange:l}){if(s===0)return null;const c=(t-1)*r+1,m=Math.min(t*r,s),h=a>1,d=h?K(t,a):[];return e.jsxs("div",{className:"flex flex-col items-center gap-3 sm:flex-row sm:justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("select",{value:r,onChange:o=>l(Number(o.target.value)),className:"rounded-lg border border-gray-700 bg-gray-800/50 px-2 py-1 text-xs text-gray-200 outline-none focus:border-brand-500",children:A.map(o=>e.jsxs("option",{value:o,children:[o," / page"]},o))}),e.jsxs("p",{className:"text-xs text-gray-400",children:["Showing"," ",e.jsxs("span",{className:"font-mono text-gray-300",children:[c,"-",m]})," ","of"," ",e.jsx("span",{className:"font-mono text-gray-300",children:s})," sessions"]})]}),h&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:()=>i(t-1),disabled:t<=1,className:"rounded-lg border border-gray-700 bg-gray-800 px-2.5 py-1.5 text-xs text-gray-400 transition-colors hover:bg-gray-700 hover:text-gray-200 disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:bg-gray-800 disabled:hover:text-gray-400",children:"Previous"}),d.map((o,f)=>o==="ellipsis"?e.jsx("span",{className:"px-1.5 text-xs text-gray-500",children:"..."},`ellipsis-${f}`):e.jsx("button",{onClick:()=>i(o),className:`min-w-[2rem] rounded-lg px-2 py-1.5 text-xs font-mono transition-colors ${o===t?"bg-brand-600 text-gray-100":"border border-gray-700 bg-gray-800 text-gray-400 hover:bg-gray-700 hover:text-gray-200"}`,children:o},o)),e.jsx("button",{onClick:()=>i(t+1),disabled:t>=a,className:"rounded-lg border border-gray-700 bg-gray-800 px-2.5 py-1.5 text-xs text-gray-400 transition-colors hover:bg-gray-700 hover:text-gray-200 disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:bg-gray-800 disabled:hover:text-gray-400",children:"Next"})]})]})}function K(t,a){if(a<=7)return Array.from({length:a},(l,c)=>c+1);const s=new Set;s.add(1),s.add(a);for(let l=t-2;l<=t+2;l++)l>=1&&l<=a&&s.add(l);const r=Array.from(s).sort((l,c)=>l-c),i=[];for(let l=0;l<r.length;l++)l>0&&r[l]-r[l-1]>1&&i.push("ellipsis"),i.push(r[l]);return i}function U(){const t=S(),{page:a,pageSize:s,search:r,status:i,project:l}=w.useSearch(),{storedPageSize:c,setPageSize:m}=V(),h=g.useRef(!1);g.useEffect(()=>{c!==null&&!h.current&&c!==s&&(h.current=!0,t({to:"/sessions",search:u=>({...u,pageSize:c,page:1}),replace:!0}))},[c,s,t]);const{data:d,isLoading:o}=j(D({page:a,pageSize:s,search:r,status:i,project:l})),{data:f=[]}=j(R),y=g.useMemo(()=>{if(!d)return[];const u=new Set(f.map(x=>x.sessionId));return d.sessions.map(x=>({...x,isActive:u.has(x.sessionId)||x.isActive}))},[d,f]);function b(u){t({to:"/sessions",search:x=>({...x,page:u})})}function n(u){m(u),t({to:"/sessions",search:x=>({...x,pageSize:u,page:1})})}if(o)return e.jsx("div",{className:"space-y-3",children:Array.from({length:s}).map((u,x)=>e.jsx("div",{className:"h-28 animate-pulse rounded-xl border border-gray-800 bg-gray-900/50"},x))});const p=d?.totalCount??0,z=d?.totalPages??1,L=d?.projects??[],E=f.length;return e.jsxs("div",{children:[e.jsx(Y,{projects:L,activeCount:E}),e.jsx("div",{className:"mt-4 space-y-2",children:y.length===0?e.jsx("div",{className:"py-12 text-center text-sm text-gray-500",children:p===0&&!r&&i==="all"&&!l?"No sessions found in ~/.claude":"No sessions match your filters"}):y.map(u=>e.jsx(Q,{session:u},u.sessionId))}),e.jsx("div",{className:"mt-4",children:e.jsx(G,{page:d?.page??a,totalPages:z,totalCount:p,pageSize:s,onPageChange:b,onPageSizeChange:n})})]})}function W(){return e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-100",children:"Sessions"}),e.jsx("p",{className:"mt-1 text-sm text-gray-400",children:"All Claude Code sessions from ~/.claude"}),e.jsx("div",{className:"mt-6",children:e.jsx(U,{})})]})}export{W as component};
|