codesesh 1.0.9 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/README.md +3 -0
  2. package/dist/{chunk-MOZLVHCC.js → chunk-2LXZFMSH.js} +10 -2
  3. package/dist/{chunk-MOZLVHCC.js.map → chunk-2LXZFMSH.js.map} +1 -1
  4. package/dist/{chunk-5YY675UR.js → chunk-543OWZIC.js} +2 -2
  5. package/dist/{chunk-CIMPLUT6.js → chunk-56FKVL5K.js} +5 -5
  6. package/dist/{chunk-QFG33PKR.js → chunk-CYZ6OC6J.js} +2 -2
  7. package/dist/{chunk-RDTQ2WPR.js → chunk-DWY4HWVI.js} +2 -2
  8. package/dist/{chunk-ZLU7ODBV.js → chunk-R6QKSHPH.js} +2 -2
  9. package/dist/{chunk-ZDH2BKQK.js → chunk-WRVILHZR.js} +366 -25
  10. package/dist/chunk-WRVILHZR.js.map +1 -0
  11. package/dist/{discovery-MS2ZSMZ5.js → discovery-NTMSA6UE.js} +5 -5
  12. package/dist/index.js +36 -9
  13. package/dist/index.js.map +1 -1
  14. package/dist/project-identity-worker.js +4 -4
  15. package/dist/scan-refresh-worker.js +6 -6
  16. package/dist/search-index-worker.js +6 -6
  17. package/dist/session-detail-worker.js +6 -6
  18. package/dist/smart-tag-worker.js +3 -3
  19. package/dist/web/assets/{DetailLanding-Dgb2Qg8H.js → DetailLanding-D1FLK4EW.js} +1 -1
  20. package/dist/web/assets/{InteractiveReceipt-SckXLiPB.js → InteractiveReceipt-C7FJhzdv.js} +1 -1
  21. package/dist/web/assets/{OverviewScreen-D44AMeDu.js → OverviewScreen-DX7F_6dH.js} +1 -1
  22. package/dist/web/assets/{PrismHighlighter-D7JLjKja.js → PrismHighlighter-DZ2CWVc0.js} +1 -1
  23. package/dist/web/assets/{Projects-DVHOqH2Z.js → Projects-B_7w5TDw.js} +1 -1
  24. package/dist/web/assets/{SearchResultsPanel-B1WEw9Q5.js → SearchResultsPanel-BMBhKuPS.js} +1 -1
  25. package/dist/web/assets/SessionDetail-wJYzzF0i.js +53 -0
  26. package/dist/web/assets/{index-BIpTq_7T.js → index-DUcpWdzX.js} +2 -2
  27. package/dist/web/icon/agent/minimax-code.svg +1 -0
  28. package/dist/web/index.html +1 -1
  29. package/package.json +1 -1
  30. package/dist/chunk-ZDH2BKQK.js.map +0 -1
  31. package/dist/web/assets/SessionDetail-J00I4QfE.js +0 -53
  32. /package/dist/{chunk-5YY675UR.js.map → chunk-543OWZIC.js.map} +0 -0
  33. /package/dist/{chunk-CIMPLUT6.js.map → chunk-56FKVL5K.js.map} +0 -0
  34. /package/dist/{chunk-QFG33PKR.js.map → chunk-CYZ6OC6J.js.map} +0 -0
  35. /package/dist/{chunk-RDTQ2WPR.js.map → chunk-DWY4HWVI.js.map} +0 -0
  36. /package/dist/{chunk-ZLU7ODBV.js.map → chunk-R6QKSHPH.js.map} +0 -0
  37. /package/dist/{discovery-MS2ZSMZ5.js.map → discovery-NTMSA6UE.js.map} +0 -0
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DetailLanding-Dgb2Qg8H.js","assets/jsx-runtime-D3jfb0Ew.js","assets/translate-CLoII3EO.js","assets/SmartTagChips-BMP9pPRw.js","assets/api-CtZGdxlN.js","assets/session-indexes-3LjxBYNe.js","assets/panel-B-5dVddJ.js","assets/utils-BuYa9y6l.js","assets/OverviewScreen-D44AMeDu.js","assets/CustomTimeWindowDialog-CGPvUFkc.js","assets/DialogTitle-B8zPwJB8.js","assets/Projects-DVHOqH2Z.js","assets/SessionDetail-J00I4QfE.js","assets/SearchResultsPanel-B1WEw9Q5.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DetailLanding-D1FLK4EW.js","assets/jsx-runtime-D3jfb0Ew.js","assets/translate-CLoII3EO.js","assets/SmartTagChips-BMP9pPRw.js","assets/api-CtZGdxlN.js","assets/session-indexes-3LjxBYNe.js","assets/panel-B-5dVddJ.js","assets/utils-BuYa9y6l.js","assets/OverviewScreen-DX7F_6dH.js","assets/CustomTimeWindowDialog-CGPvUFkc.js","assets/DialogTitle-B8zPwJB8.js","assets/Projects-B_7w5TDw.js","assets/SessionDetail-wJYzzF0i.js","assets/SearchResultsPanel-BMBhKuPS.js"])))=>i.map(i=>d[i]);
2
2
  import{a as e,n as t,r as n,t as r}from"./jsx-runtime-D3jfb0Ew.js";import{$ as i,$t as a,A as o,At as s,B as c,Bt as l,C as u,Cn as d,Ct as f,D as p,Dt as m,E as h,Et as g,F as _,Ft as v,G as y,Gt as b,H as x,Ht as S,I as C,It as w,J as T,Jt as E,K as D,Kt as O,L as k,M as A,N as j,Nt as M,O as N,Ot as P,P as ee,Pt as te,Q as F,Qt as ne,R as I,Rt as re,S as ie,Sn as ae,St as L,T as R,Tt as oe,U as z,Ut as se,V as ce,Vt as le,W as B,Wt as V,X as ue,Xt as de,Y as fe,Yt as pe,Z as me,Zt as he,_ as ge,_n as _e,_t as ve,a as ye,an as H,at as be,b as xe,bn as Se,bt as Ce,c as we,cn as Te,ct as Ee,d as De,dn as Oe,dt as ke,en as Ae,et as je,f as Me,fn as Ne,ft as Pe,g as Fe,gn as Ie,gt as Le,h as Re,hn as ze,ht as Be,i as Ve,in as He,it as Ue,j as We,jt as Ge,k as Ke,kt as qe,l as Je,ln as Ye,lt as Xe,m as Ze,mn as Qe,mt as $e,n as et,nn as tt,nt as U,o as nt,on as rt,ot as it,p as at,pn as ot,pt as st,q as ct,qt as lt,r as ut,rn as dt,rt as ft,s as pt,sn as mt,st as ht,t as gt,tn as _t,tt as vt,u as yt,un as bt,ut as xt,v as St,vn as Ct,vt as wt,w as Tt,wt as Et,x as Dt,xn as Ot,xt as kt,y as At,yn as jt,yt as Mt,z as Nt,zt as Pt}from"./DialogTitle-B8zPwJB8.js";import{A as Ft,C as It,D as Lt,E as Rt,M as zt,N as Bt,O as Vt,P as Ht,S as Ut,T as Wt,_ as Gt,a as Kt,b as qt,c as Jt,d as Yt,f as Xt,g as Zt,h as Qt,i as $t,j as en,k as tn,l as nn,m as rn,n as an,o as on,p as sn,r as cn,s as ln,t as un,u as dn,v as fn,w as pn,x as mn,y as hn}from"./CustomTimeWindowDialog-CGPvUFkc.js";import{A as gn,C as _n,D as vn,E as yn,O as bn,S as xn,T as Sn,_ as Cn,a as wn,b as Tn,c as En,f as Dn,g as On,h as kn,i as An,j as jn,k as Mn,l as Nn,n as Pn,o as Fn,r as In,t as W,u as Ln,w as Rn,x as zn,y as Bn}from"./translate-CLoII3EO.js";import{n as Vn,t as Hn}from"./SmartTagChips-BMP9pPRw.js";import{_ as Un,a as Wn,c as Gn,d as Kn,f as qn,g as Jn,h as Yn,i as Xn,l as Zn,m as Qn,n as $n,p as er,r as tr,s as nr,t as rr,u as ir,v as ar}from"./api-CtZGdxlN.js";import{a as or,c as sr,d as cr,f as lr,g as ur,h as dr,i as fr,l as pr,m as mr,n as hr,o as gr,p as _r,r as vr,s as yr,t as br,u as xr}from"./session-indexes-3LjxBYNe.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var Sr=n((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Cr=n(((e,t)=>{t.exports=Sr()})),wr=n((e=>{var n=Cr(),r=t(),i=d();function a(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function s(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function c(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(s(e)!==e)throw Error(a(188))}function f(e){var t=e.alternate;if(!t){if(t=s(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return u(i),e;if(o===r)return u(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var c=!1,l=i.child;l;){if(l===n){c=!0,n=i,r=o;break}if(l===r){c=!0,r=i,n=o;break}l=l.sibling}if(!c){for(l=o.child;l;){if(l===n){c=!0,n=o,r=i;break}if(l===r){c=!0,r=o,n=i;break}l=l.sibling}if(!c)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}function m(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&m(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function h(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function g(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function _(e){var t=[null,null],n=h(e);return n===null||v(t,e,n.child,{foundSelf:!1}),t}function v(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&v(e,t,n.child,r))return!0;n=n.sibling}return!1}function y(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(a(559))}}var b=null,x=null;function S(e,t,n){return e===n||e===t&&(b=e,!0)}function C(e,t,n){return e===n?(x=e,!1):e===t&&(x!==null&&(b=e),!0)}function w(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function T(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var E=Object.assign,D=Symbol.for(`react.element`),O=Symbol.for(`react.transitional.element`),k=Symbol.for(`react.portal`),A=Symbol.for(`react.fragment`),j=Symbol.for(`react.strict_mode`),M=Symbol.for(`react.profiler`),N=Symbol.for(`react.consumer`),P=Symbol.for(`react.context`),ee=Symbol.for(`react.forward_ref`),te=Symbol.for(`react.suspense`),F=Symbol.for(`react.suspense_list`),ne=Symbol.for(`react.memo`),I=Symbol.for(`react.lazy`),re=Symbol.for(`react.activity`),ie=Symbol.for(`react.legacy_hidden`),ae=Symbol.for(`react.memo_cache_sentinel`),L=Symbol.for(`react.view_transition`),R=Symbol.for(`react.recoverable`),oe=Symbol.iterator;function z(e){return typeof e!=`object`||!e?null:(e=oe&&e[oe]||e[`@@iterator`],typeof e==`function`?e:null)}var se=Symbol.for(`react.client.reference`);function ce(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===se?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case A:return`Fragment`;case M:return`Profiler`;case j:return`StrictMode`;case te:return`Suspense`;case F:return`SuspenseList`;case re:return`Activity`;case L:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case k:return`Portal`;case P:return e.displayName||`Context`;case N:return(e._context.displayName||`Context`)+`.Consumer`;case ee:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ne:return t=e.displayName||null,t===null?ce(e.type)||`Memo`:t;case I:t=e._payload,e=e._init;try{return ce(e(t))}catch{}}return null}var le=Array.isArray,B=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue={pending:!1,data:null,method:null,action:null},de=[],fe=-1;function pe(e){return{current:e}}function me(e){0>fe||(e.current=de[fe],de[fe]=null,fe--)}function he(e,t){fe++,de[fe]=e.current,e.current=t}var ge=pe(null),_e=pe(null),ve=pe(null),ye=pe(null);function H(e,t){switch(he(ve,t),he(_e,e),he(ge,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?hp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=hp(t),e=gp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}me(ge),he(ge,e)}function be(){me(ge),me(_e),me(ve)}function xe(e){var t=e.memoizedState;t!==null&&(uh._currentValue=t.memoizedState,he(ye,e)),t=ge.current;var n=gp(t,e.type);t!==n&&(he(_e,e),he(ge,n))}function Se(e){_e.current===e&&(me(ge),me(_e)),ye.current===e&&(me(ye),uh._currentValue=ue)}var Ce,we;function Te(e){if(Ce===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ce=t&&t[1]||``,we=-1<e.stack.indexOf(`
3
3
  at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
4
  `+Ce+e+we}var Ee=!1;function De(e,t){if(!e||Ee)return``;Ee=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
@@ -1407,7 +1407,7 @@ Error generating stack: `+e.message+`
1407
1407
  [data-type='item'] [data-session-title-scroll-complete] {
1408
1408
  text-overflow: clip;
1409
1409
  }
1410
- `,Hx=.08,Ux=16,Wx=700,Gx=1/3,Kx=1.3333333333333333,qx=.6666666666666667/Kx;function Jx(e,t){let n=e.composedPath(),r=n.find(e=>e instanceof HTMLElement&&e.parentElement?.getAttribute(`data-item-section`)===`decoration`);if(t.requireDecoration&&!r)return null;let i=n.find(e=>e instanceof HTMLElement&&e.getAttribute(`data-type`)===`item`);if(!i)return null;let a=i.getAttribute(`data-item-path`);return a?{item:i,anchor:r??i.querySelector(`[data-item-section='decoration'] > span`)??i,path:a}:null}function Yx(e){e?.dispatchEvent(new KeyboardEvent(`keydown`,{key:`ArrowDown`,bubbles:!0,cancelable:!0}))}function Xx(e){let t=e.shadowRoot;if(!t)return()=>{};let n=new Set,r=new Set,i=new WeakMap,a=new WeakMap;function o(e){let t=i.get(e);t!==void 0&&cancelAnimationFrame(t),a.get(e)?.remove(),a.delete(e),r.delete(e),i.delete(e),n.delete(e),e.scrollLeft=0,e.removeAttribute(`data-session-title-scroll`),e.removeAttribute(`data-session-title-scroll-complete`)}function s(e){if(Qx()||e.hasAttribute(`data-session-title-scroll-complete`))return;o(e);let t=e.querySelector(`[data-truncate-group-container="middle"]`),s=t?.getBoundingClientRect().width??0;if(!t||s<=e.clientWidth+1)return;let c=t.cloneNode(!0);c.dataset.sessionTitleScrollCopy=`true`,c.setAttribute(`aria-hidden`,`true`),c.style.marginInlineStart=`${Ux}px`,e.append(c),a.set(e,c),r.add(e),e.setAttribute(`data-session-title-scroll`,`running`);let l=s+Ux,u=Math.max(Wx,l/Hx*Kx),d=performance.now();n.add(e);let f=t=>{if(!n.has(e))return;let r=Math.min(1,Math.max(0,(t-d)/u));if(e.scrollLeft=l*$x(r),r>=1){n.delete(e),i.delete(e),e.removeAttribute(`data-session-title-scroll`),e.setAttribute(`data-session-title-scroll-complete`,`true`);return}i.set(e,requestAnimationFrame(f))};i.set(e,requestAnimationFrame(f))}function c(e){let t=Zx(e.target),n=e.relatedTarget;!t||n instanceof Node&&t.contains(n)||s(t)}function l(e){let t=Zx(e.target),n=e.relatedTarget;!t||n instanceof Node&&t.contains(n)||o(t)}return t.addEventListener(`pointerover`,c),t.addEventListener(`pointerout`,l),()=>{t.removeEventListener(`pointerover`,c),t.removeEventListener(`pointerout`,l);for(let e of r)o(e)}}function Zx(e){if(!(e instanceof Element))return null;let t=e.closest(`[data-item-section="content"]`);return!t||t.parentElement?.getAttribute(`data-type`)!==`item`?null:t}function Qx(){return globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches??!1}function $x(e){if(e<=qx)return e/qx*.6666666666666667;let t=(e-qx)/.4999999999999999;return .6666666666666667+Gx*(t*(2-t))}function eS(e){return e.replaceAll(`/`,`∕`).trim()||`(untitled)`}function tS(e){return e.replace(/\/+$/,``).split(`/`).at(-1)?.trim()||`(unknown)`}function nS(e){let t=e.project_identity;if(t)return{key:On(t),label:t.displayName||tS(e.directory)};let n=tS(e.directory);return{key:n===`(unknown)`?`__unknown__`:`path:${e.directory||n}`,label:n}}function rS(e){return e.time_updated??e.time_created}function iS(e,t,n){let r=e.get(t.path)??2**53-1,i=e.get(n.path)??2**53-1;return r===i?t.path.localeCompare(n.path):r-i}function aS(){let e=new Set,t=new Map;return function(n){if(!e.has(n))return e.add(n),n;let r=t.get(n)??2,i=`${n} (${r})`;for(;e.has(i);)r+=1,i=`${n} (${r})`;return t.set(n,r+1),e.add(i),i}}var oS=`Unmounted`,sS=`Deeper sessions`;function cS(e,{groupByProject:t=!0}={}){let n=new Map,r=new Map,i=new Map,a=new Map,o=new Map,s=aS(),c=[],l=Ln(e),u=new Map;for(let e of l.roots){let t=e.session,{key:n,label:r}=nS(t),i=rS(t),a=u.get(n);a?(a.nodes.push(e),i>a.maxTime&&(a.maxTime=i)):u.set(n,{label:r,nodes:[e],maxTime:i})}let d=t?[...u.values()].sort((e,t)=>e.label===`(unknown)`?1:t.label===`(unknown)`?-1:t.maxTime-e.maxTime):[{label:null,nodes:l.roots}];l.orphans.length>0&&d.push({label:W(oS),nodes:l.orphans});let f=0,p=aS();for(let e of d){let t=``;if(e.label!==null){let r=p(eS(e.label));t=`${r}/`,n.set(t,f),n.set(r,f),f+=1,a.set(t,`${e.nodes.length}`),a.set(r,`${e.nodes.length}`)}let l=new Map,u=[];for(let n=e.nodes.length-1;n>=0;--n)u.push({node:e.nodes[n],parentPath:t,siblingTitleCounts:l,depth:0,flattened:!1});for(;u.length>0;){let e=u.pop(),{node:l,parentPath:d,siblingTitleCounts:p}=e,m=l.session,h=Rc(m);p.set(h,(p.get(h)??0)+1);let g=s(`${d}${(p.get(h)??1)>1?`${eS(h)} #${m.reference.sessionId.slice(0,8)}`:eS(h)}`),_=vr(m),v=!e.flattened&&l.children.length>0,y=v?`${g}/`:g;if(v?(n.set(g,f),n.set(y,f),o.set(g,m),o.set(y,m)):(c.push(g),n.set(g,f),o.set(g,m)),f+=1,r.set(_,y),i.set(_,t),l.children.length===0)continue;if(e.flattened){for(let t=l.children.length-1;t>=0;--t)u.push({node:l.children[t],parentPath:d,siblingTitleCounts:p,depth:e.depth,flattened:!0});continue}let b=new Map;if(e.depth+1<32){for(let t=l.children.length-1;t>=0;--t)u.push({node:l.children[t],parentPath:y,siblingTitleCounts:b,depth:e.depth+1,flattened:!1});continue}let x=s(`${y}${W(sS)}`),S=`${x}/`;n.set(x,f),n.set(S,f),a.set(x,`${l.descendantCount}`),a.set(S,`${l.descendantCount}`),f+=1;for(let t=l.children.length-1;t>=0;--t)u.push({node:l.children[t],parentPath:S,siblingTitleCounts:b,depth:e.depth+1,flattened:!0})}}return{paths:c,sortOrderByPath:n,pathBySessionReference:r,groupPathBySessionReference:i,groupCountByPath:a,sessionByPath:o}}function lS(e,t){if(!Wr())return t();let n=performance.now(),r=t(),i=performance.now();return qr({id:e,source:`custom-timing`,phase:`measure`,actualDuration:Math.round((i-n)*100)/100,baseDuration:0,startTime:n,commitTime:i}),r}var uS=(0,G.memo)(function({sessions:e,activeSessionReference:t,selectedSessionReference:n,onSelectSession:r,bookmarkedSessionReferences:i,onCopySessionAsMarkdown:a,onToggleBookmark:o,onRenameSession:s,groupByProject:c=!0}){let l=Pn(),[u,d]=(0,G.useState)(null),f=(0,G.useRef)(null),p=(0,G.useRef)(null),m=(0,G.useRef)(null),h=(0,G.useMemo)(()=>lS(`SessionTreeSidebar:buildTreeModel`,()=>cS(e,{groupByProject:c})),[l,e,c]),g=(0,G.useRef)(h.sortOrderByPath),_=(0,G.useRef)(h.groupCountByPath),v=(0,G.useRef)(h.sessionByPath),y=(0,G.useRef)(r),b=(0,G.useRef)(a),x=(0,G.useRef)(o),S=(0,G.useRef)(s),C=(0,G.useRef)(!1),w={"--trees-bg-override":`transparent`,"--trees-border-color-override":`var(--console-border)`,"--trees-fg-override":`var(--console-text)`,"--trees-fg-muted-override":`var(--console-muted)`,"--trees-font-family-override":`var(--font-mono)`,"--trees-font-size-override":`12px`,"--trees-item-margin-x-override":`0px`,"--trees-item-padding-x-override":`4px`,"--trees-padding-inline-override":`4px`,"--trees-selected-bg-override":n!==null&&n!==t?`transparent`:`var(--brand-soft)`},{model:T}=Bx({flattenEmptyDirectories:!1,initialExpansion:`closed`,paths:h.paths,sort:(e,t)=>iS(g.current,e,t),density:`compact`,unsafeCSS:Vx,onSelectionChange(e){if(C.current)return;let t=v.current.get(e[0]??``);t&&y.current(t)},renderRowDecoration({item:e}){return v.current.get(e.path)?{text:`⋯`,title:W(`Session options`)}:_.current.get(e.path)?{text:_.current.get(e.path),title:W(`Sessions`)}:null}});(0,G.useEffect)(()=>{g.current=h.sortOrderByPath,_.current=h.groupCountByPath,v.current=h.sessionByPath,T.resetPaths(h.paths)},[T,h]),(0,G.useEffect)(()=>{y.current=r},[r]),(0,G.useEffect)(()=>{b.current=a},[a]),(0,G.useEffect)(()=>{x.current=o},[o]),(0,G.useEffect)(()=>{S.current=s},[s]),(0,G.useEffect)(()=>{let e,t=0,n=()=>{let r=T.getFileTreeContainer();if(!r){t=requestAnimationFrame(n);return}e=Xx(r)};return n(),()=>{t&&cancelAnimationFrame(t),e?.()}},[T]);function E(e,t,n){f.current=t,p.current=n,d(e),Yx(m.current)}function D(e){let t=Jx(e.nativeEvent,{requireDecoration:!0}),n=t?v.current.get(t.path):null;t&&n&&(e.preventDefault(),e.stopPropagation(),E(n,t.anchor,t.item))}function O(e){if(e.key!==`ContextMenu`&&!(e.shiftKey&&e.key===`F10`))return;let t=Jx(e.nativeEvent,{requireDecoration:!1}),n=t?v.current.get(t.path):null;t&&n&&(e.preventDefault(),e.stopPropagation(),E(n,t.anchor,t.item))}return(0,G.useEffect)(()=>{let e=h.pathBySessionReference.get(t??``),r=h.pathBySessionReference.get(n??``)??e,i=n??t??``,a=h.groupPathBySessionReference.get(i);C.current=!0;try{for(let t of T.getSelectedPaths())t!==e&&T.getItem(t)?.deselect();e&&!T.getSelectedPaths().includes(e)&&T.getItem(e)?.select()}finally{C.current=!1}if(r&&t){let e=r.split(`/`).filter(Boolean);for(let t=1;t<=e.length;t+=1){let n=`${e.slice(0,t).join(`/`)}/`,r=T.getItem(n);r&&`expand`in r&&r.expand()}let t=a?T.getItem(a):null;t&&`expand`in t&&t.expand(),T.focusPath(r);return}a&&T.focusPath(a)},[t,T,h,n]),(0,K.jsxs)(`div`,{className:`session-tree h-[min(560px,calc(100vh-410px))] min-h-56 overflow-hidden`,style:w,onClickCapture:D,onKeyDownCapture:O,children:[(0,K.jsx)(pf,{model:T,style:{height:`100%`},"aria-label":W(`Sessions`)}),(0,K.jsxs)(Ld,{modal:!1,children:[(0,K.jsx)(qd,{ref:m,tabIndex:-1,"aria-hidden":`true`,className:`pointer-events-none absolute size-0 opacity-0`}),(0,K.jsx)($u,{children:(0,K.jsx)(Od,{anchor:f,side:`bottom`,align:`end`,sideOffset:4,className:`z-40`,children:(0,K.jsx)(Xu,{finalFocus:p,className:`motion-menu w-36 rounded-md border border-[var(--console-border)] bg-[var(--console-surface)] p-1 shadow-[var(--shadow-overlay)] focus-visible:outline-none`,children:u?(0,K.jsx)(Xd,{bookmarked:i.has(vr(u)),onCopyAsMarkdown:()=>b.current(u),onRename:()=>S.current(u),onToggleBookmark:()=>x.current(u)}):null})})})]})]})}),dS=50;function fS(e){return`flex items-center gap-2 rounded-sm px-3 py-1.5 text-left motion-hover focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none ${e?`bg-[var(--brand-soft)] text-[var(--brand)]`:`text-[var(--console-muted)] hover:bg-[var(--console-surface-muted)] hover:text-[var(--console-text)]`}`}function pS({scanning:e,empty:t}){Pn();let n=No();return(0,K.jsx)(`span`,{className:`console-mono block rounded-sm px-3 py-1.5 text-xs text-[var(--console-muted)]`,children:n?.active?e:t})}function mS({projects:e,selectedProjectNavigationId:t}){Pn();let n=e.slice(0,dS),r=t?e.find(e=>{let n=fr(e);return On(n)===t}):void 0;return r&&!n.includes(r)&&n.push(r),(0,K.jsx)(K.Fragment,{children:n.map(e=>{let n=fr(e),r=t===On(n);return(0,K.jsx)(`li`,{children:(0,K.jsxs)(gr,{to:or(n),"data-active":r?`true`:void 0,className:`min-w-0 ${fS(r)}`,children:[(0,K.jsx)(`span`,{className:`console-mono min-w-0 flex-1 truncate text-xs`,children:e.displayName}),(0,K.jsx)(`span`,{className:`console-mono shrink-0 text-[11px] text-[var(--console-muted)]`,children:e.sessionCount})]})},`${e.identityKind}:${e.identityKey}`)})})}function hS({collapsed:e,mobileOpen:t,onMobileOpenChange:n,children:r}){return Pn(),(0,G.useEffect)(()=>{if(!t||typeof window.matchMedia!=`function`)return;let e=window.matchMedia(`(min-width: 1025px)`),r=()=>{e.matches&&n(!1)};return e.addEventListener(`change`,r),r(),()=>e.removeEventListener(`change`,r)},[t,n]),t?(0,K.jsx)(Nu,{open:!0,onOpenChange:n,title:W(`Navigation`),variant:`mobile`,side:`left`,children:r}):(0,K.jsx)(`aside`,{"aria-label":W(`Primary navigation`),className:`w-64 shrink-0 flex-col border-r border-[var(--console-border)] bg-[var(--console-sidebar-bg)] ${e?`hidden`:`hidden min-[1025px]:flex`}`,children:r})}function gS({model:{sidebarCollapsed:e,mobileNavigationOpen:t,viewState:n,agentCatalog:r,projects:i,projectCount:a,projectsError:o,projectsLoading:s,selectedProjectNavigationId:c,bookmarkedSessions:l,bookmarksError:u,bookmarksLoading:d,sidebarSessions:f,sidebarSessionLookup:p,bookmarkedSidebarSessionReferences:m,isSearchMode:h,shortcutHelpOpen:g,dismissShortcutHint:_},actions:{onCollapse:v,onMobileNavigationOpenChange:y,onToggleBookmark:b,onSelectFlatSidebarSession:x,onCopySessionAsMarkdown:S,onToggleSidebarSessionBookmark:C,onRenameSession:w,onRenameBookmarkedSession:T,onRetryProjects:E,onRetryBookmarks:D}}){Pn();let O=Wc(),k=n.mode===`session`?Cn(n.activeAgentKey,n.activeSessionId):null,A=n.mode===`root`,j=n.mode===`projects`,{selectedSessionReference:M,selectSession:N}=Gc({viewState:n,sessions:f,sessionLookup:p,isSearchMode:h,shortcutHelpOpen:g,dismissShortcutHint:_,onOpenSession:x}),P=(0,G.useCallback)(e=>{N(e),x(e)},[x,N]);return(0,K.jsx)(hS,{collapsed:e,mobileOpen:t,onMobileOpenChange:y,children:(0,K.jsxs)(`div`,{className:`console-scrollbar flex-1 space-y-8 overflow-y-auto px-4 py-6`,children:[(0,K.jsx)(`section`,{children:(0,K.jsxs)(`ul`,{ref:O,"data-fluid-hover":`y`,className:`console-scrollbar max-h-[min(320px,calc(100vh-400px))] space-y-1 overflow-y-auto pr-1`,children:[(0,K.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,K.jsxs)(gr,{"data-fluid-item":!0,to:`/`,"data-active":A?`true`:void 0,className:`min-w-0 flex-1 ${fS(A)}`,children:[(0,K.jsx)(`img`,{src:`/logo.svg?v=3`,alt:W(`Dashboard`),className:`size-3.5 rounded-[2px]`}),(0,K.jsx)(`span`,{className:`console-mono line-clamp-1 flex-1 text-xs`,children:W(`Dashboard`)})]}),t?null:(0,K.jsx)(`button`,{type:`button`,"aria-expanded":`true`,"aria-label":W(`Collapse sidebar`),title:W(`Collapse sidebar`),onClick:v,className:`shrink-0 rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)] p-1 text-[var(--console-muted)] motion-hover hover:bg-[var(--console-surface-muted)] hover:text-[var(--console-text)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none`,children:(0,K.jsx)(gu,{className:`size-4`})})]}),(0,K.jsx)(`li`,{children:(0,K.jsxs)(gr,{"data-fluid-item":!0,to:`/projects`,"data-active":j?`true`:void 0,className:fS(j),children:[(0,K.jsx)(`span`,{className:`console-mono min-w-0 flex-1 truncate text-xs`,children:W(`Projects`)}),(0,K.jsx)(`span`,{className:`console-mono shrink-0 text-[11px] text-[var(--console-muted)]`,children:a})]})}),(0,K.jsx)(mS,{projects:i,selectedProjectNavigationId:c}),o?(0,K.jsx)(`li`,{children:(0,K.jsx)(Kt,{title:W(`Couldn't load projects.`),message:o,onRetry:E,className:`px-3 py-2`})}):i.length===0&&!s?(0,K.jsx)(`li`,{children:(0,K.jsx)(pS,{scanning:W(`Scanning projects...`),empty:W(`No projects found`)})}):null]})}),(0,K.jsxs)(`section`,{children:[(0,K.jsx)(`h3`,{className:`console-eyebrow mb-3`,children:W(`BOOKMARKS`)}),u?(0,K.jsx)(Kt,{title:W(`Couldn't load bookmarks.`),message:u,onRetry:D,className:`mb-2 px-3 py-2`}):null,l.length===0&&d?(0,K.jsx)(`span`,{className:`console-mono block rounded-sm px-3 py-1.5 text-xs text-[var(--console-muted)]`,children:W(`Loading bookmarks...`)}):l.length===0&&!u?(0,K.jsx)(`span`,{className:`console-mono block rounded-sm px-3 py-1.5 text-xs text-[var(--console-muted)]`,children:W(`No bookmarks yet`)}):(0,K.jsx)(`ul`,{className:`space-y-1`,children:l.map(e=>{let{reference:t}=e,i=n.mode===`session`&&n.activeAgentKey===t.agentName&&n.activeSessionId===t.sessionId,a=gs(r,t.agentName),o=e.availability===`available`,s=o?void 0:e.display_title,c=e.availability===`agent-unavailable`?W(`Agent unavailable`):W(`Session unavailable`),l=o?Rc(e.session):s??t.sessionId,u=s?`${a?.displayName??t.agentName} · ${t.sessionId} · ${c}`:`${a?.displayName??t.agentName} · ${c}`,d=(0,K.jsxs)(K.Fragment,{children:[a?.icon?(0,K.jsx)(Kc,{icon:a.icon,iconColored:a.iconColored,alt:a.displayName,className:`mt-0.5 size-3.5 shrink-0 object-contain`}):null,(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`span`,{className:`console-mono line-clamp-1 block text-xs`,children:l}),(0,K.jsx)(`span`,{className:`console-mono mt-0.5 line-clamp-1 block text-[10px] text-[var(--console-muted)]`,children:o?a?.displayName??t.agentName:u})]})]});return(0,K.jsx)(`li`,{children:(0,K.jsxs)(`div`,{"data-active":i?`true`:void 0,className:`flex items-start gap-2 rounded-sm px-2 py-1.5 motion-hover ${i?`bg-[var(--brand-soft)] text-[var(--brand)]`:`text-[var(--console-muted)] hover:bg-[var(--console-surface-muted)] hover:text-[var(--console-text)]`}`,children:[o?(0,K.jsx)(gr,{to:Mn(e.session),className:`flex min-w-0 flex-1 items-start gap-2`,children:d}):(0,K.jsx)(`div`,{className:`flex min-w-0 flex-1 items-start gap-2`,"aria-disabled":`true`,children:d}),(0,K.jsx)(Zd,{bookmarked:!0,onCopyAsMarkdown:o?()=>S(e.session):void 0,onRename:()=>T(e),onToggleBookmark:()=>b(e)})]})},ts(t))})})]}),c?(0,K.jsxs)(`section`,{children:[(0,K.jsxs)(`h3`,{className:`console-eyebrow mb-3`,children:[W(`SESSIONS`),` `,f.length>0?(0,K.jsx)(`span`,{className:`ml-2 text-[10px] font-normal text-[var(--console-muted)]`,children:W(`Navigate j k · Open Enter`)}):null]}),f.length===0?(0,K.jsx)(pS,{scanning:W(`Scanning sessions...`),empty:W(`No sessions yet`)}):(0,K.jsx)(Yr,{id:`SessionTreeSidebar`,detail:{sessions:f.length},children:(0,K.jsx)(uS,{sessions:f,activeSessionReference:k,selectedSessionReference:M,onSelectSession:P,bookmarkedSessionReferences:m,onCopySessionAsMarkdown:S,onToggleBookmark:C,onRenameSession:w,groupByProject:!1})})]}):null]})})}var _S=[{title:`Navigation`,items:[{keys:`j / k`,description:`Move through sessions or search results`},{keys:`Enter`,description:`Open the current selection`},{keys:`g / G`,description:`Jump to the first or last item`}]},{title:`Search & Help`,items:[{keys:`Cmd/Ctrl K`,description:`Open global search`},{keys:`/`,description:`Focus the search box`},{keys:`Esc`,description:`Exit search or close the current detail view`},{keys:`?`,description:`Open this shortcuts panel`}]}];function vS({open:e,onClose:t}){return Pn(),(0,K.jsx)(et,{open:e,onOpenChange:e=>e?void 0:t(),children:(0,K.jsxs)(Ve,{children:[(0,K.jsx)(Oe,{className:`shortcut-overlay fixed inset-0 z-50 bg-[var(--scrim)]`}),(0,K.jsxs)(pt,{className:`shortcut-content fixed left-1/2 top-1/2 z-50 w-[calc(100%-2rem)] max-w-2xl origin-center -translate-x-1/2 -translate-y-1/2 rounded-lg border border-[var(--console-border)] bg-[var(--console-surface)] p-5 shadow-[var(--shadow-overlay)] outline-none`,children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`console-eyebrow`,children:W(`Keyboard Shortcuts`)}),(0,K.jsx)(gt,{className:`console-display mt-2 text-[19px] font-semibold text-[var(--console-text)]`,children:W(`Navigate without leaving the keyboard`)})]}),(0,K.jsx)(qe,{className:`console-mono rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2 py-1 text-xs text-[var(--console-text)] motion-hover hover:bg-[var(--console-surface)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none`,children:`Esc`})]}),(0,K.jsx)(`div`,{className:`mt-5 grid gap-4 md:grid-cols-2`,children:_S.map(e=>(0,K.jsxs)(`div`,{className:`rounded-md border border-[var(--console-border)] bg-[var(--console-surface-muted)] p-4`,children:[(0,K.jsx)(`h3`,{className:`console-eyebrow`,children:W(e.title)}),(0,K.jsx)(`div`,{className:`mt-3 space-y-3`,children:e.items.map(e=>(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`console-mono text-xs text-[var(--console-text)]`,children:e.keys}),(0,K.jsx)(`p`,{className:`mt-1 text-[13px] leading-6 text-[var(--console-text-secondary)]`,children:W(e.description)})]},e.keys))})]},W(e.title)))})]})]})})}var yS=class extends G.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error(`ErrorBoundary caught error:`,e,t)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,K.jsx)(bS,{error:this.state.error}):this.props.children}};function bS({error:e}){return Pn(),(0,K.jsxs)(`div`,{role:`alert`,className:`rounded-md border border-[var(--console-error-border)] bg-[var(--console-error-bg)] p-6`,children:[(0,K.jsx)(`h3`,{className:`console-mono mb-2 text-sm font-semibold text-[var(--console-error)]`,children:W(`Something went wrong`)}),(0,K.jsx)(`p`,{className:`console-mono mb-3 text-xs text-[var(--console-text-secondary)]`,children:e?.message||W(`Unknown error`)}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>window.location.reload(),className:`console-mono rounded border border-[var(--console-border)] bg-[var(--console-surface)] px-2 py-1 text-xs text-[var(--console-text)]`,children:W(`Reload page`)})]})}var xS=[{id:`1`,roleWidth:`w-14`,timeWidth:`w-20`,bodyWidths:[`w-full`,`w-10/12`,`w-7/12`]},{id:`2`,roleWidth:`w-16`,timeWidth:`w-24`,bodyWidths:[`w-9/12`,`w-7/12`]},{id:`3`,roleWidth:`w-14`,timeWidth:`w-16`,bodyWidths:[`w-full`,`w-11/12`,`w-8/12`,`w-5/12`]},{id:`4`,roleWidth:`w-16`,timeWidth:`w-20`,bodyWidths:[`w-10/12`,`w-8/12`]},{id:`5`,roleWidth:`w-14`,timeWidth:`w-24`,bodyWidths:[`w-full`,`w-10/12`,`w-9/12`]}],SS=[`w-8/12`,`w-7/12`,`w-9/12`,`w-6/12`,`w-10/12`,`w-7/12`];function CS({className:e}){return Pn(),(0,K.jsx)(`div`,{className:`skeleton-shimmer rounded-sm ${e}`})}function wS(){return Pn(),(0,K.jsxs)(`div`,{className:`mx-auto grid min-h-full w-full max-w-[1440px] gap-6 px-2 md:px-4 min-[1025px]:grid-cols-[288px_minmax(0,1fr)] min-[1025px]:items-start`,children:[(0,K.jsxs)(`div`,{className:`hidden rounded-lg border border-[var(--console-border)] bg-[var(--console-surface-muted)] p-3 min-[1025px]:block`,children:[(0,K.jsx)(CS,{className:`h-2.5 w-20`}),(0,K.jsx)(`div`,{className:`mt-4 space-y-2.5`,children:SS.map((e,t)=>(0,K.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,K.jsx)(CS,{className:`size-3.5 shrink-0`}),(0,K.jsx)(CS,{className:`h-3 ${e}`})]},`${t}-${e}`))})]}),(0,K.jsx)(`div`,{className:`flex min-w-0 flex-col gap-8`,children:xS.map(e=>(0,K.jsx)(`article`,{className:`w-full border-l-2 border-[var(--console-thread)] pl-4 pr-3 md:pr-5`,children:(0,K.jsxs)(`div`,{className:`flex gap-4`,children:[(0,K.jsx)(`div`,{className:`shrink-0 pt-1`,children:(0,K.jsx)(`div`,{className:`flex size-8 items-center justify-center rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)]`,children:(0,K.jsx)(CS,{className:`size-3.5`})})}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(CS,{className:`${e.roleWidth} h-3`}),(0,K.jsx)(CS,{className:`${e.timeWidth} h-2.5`})]}),(0,K.jsx)(`div`,{className:`rounded-lg border border-[var(--console-border)] bg-[var(--console-surface)] p-4 shadow-[var(--shadow-raised)]`,children:(0,K.jsx)(`div`,{className:`space-y-2`,children:e.bodyWidths.map(t=>(0,K.jsx)(CS,{className:`${t} h-3`},`${e.id}-${t}`))})})]})]})},e.id))})]})}var TS=(0,G.lazy)(()=>ur(()=>import(`./DetailLanding-Dgb2Qg8H.js`).then(e=>({default:e.DetailLanding})),__vite__mapDeps([0,1,2,3,4,5,6,7]))),ES=(0,G.lazy)(()=>ur(()=>import(`./OverviewScreen-D44AMeDu.js`).then(e=>({default:e.OverviewScreen})),__vite__mapDeps([8,1,9,10,2,4,7,6]))),DS=(0,G.lazy)(()=>ur(()=>import(`./Projects-DVHOqH2Z.js`).then(e=>({default:e.ProjectsOverview})),__vite__mapDeps([11,1,9,10,2,4,5,7,6,8]))),OS=(0,G.lazy)(()=>ur(()=>import(`./Projects-DVHOqH2Z.js`).then(e=>({default:e.ProjectDashboardView})),__vite__mapDeps([11,1,9,10,2,4,5,7,6,8]))),kS=(0,G.lazy)(()=>ur(()=>import(`./SessionDetail-J00I4QfE.js`).then(e=>({default:e.SessionDetail})),__vite__mapDeps([12,1,10,2,5,7]))),AS=(0,G.lazy)(()=>ur(()=>import(`./SearchResultsPanel-B1WEw9Q5.js`).then(e=>({default:e.SearchResultsPanel})),__vite__mapDeps([13,1,2,3,4,5])));function jS({children:e}){Pn();let t=cr();return(0,K.jsx)(yS,{children:(0,K.jsx)(G.Suspense,{fallback:(0,K.jsx)(wS,{}),children:e})},t.pathname)}function MS(e){return e.map(e=>({key:e.name.toLowerCase(),name:e.displayName,icon:e.icon,iconColored:e.iconColored,count:e.count}))}function NS({search:e}){Pn();let t=e.state.status===`loaded`?e.state.results.length:0;return(0,K.jsx)(Yr,{id:`SearchResultsPanel`,detail:{results:t,loading:e.state.status===`loading`},children:(0,K.jsx)(jS,{children:(0,K.jsx)(AS,{query:e.query,state:e.state,agentNameMap:e.agentNameMap,agents:e.agents,projects:e.projectOptions,filters:e.filters,onChangeFilters:e.onChangeFilters,onOpenResult:e.onClose,onRetry:e.onRetry,selectedIndex:e.selectedIndex,registerResultRef:e.registerResultRef})})})}function PS({load:e}){return Pn(),(0,K.jsxs)(`div`,{role:`alert`,className:`mx-auto max-w-4xl rounded-sm border border-[var(--console-error-border)] bg-[var(--console-error-bg)] p-6 text-sm text-[var(--console-error)]`,children:[(0,K.jsx)(`p`,{children:e.error}),(0,K.jsx)(`button`,{type:`button`,onClick:e.retry,className:`console-mono mt-4 rounded-sm border border-[var(--console-error-border)] px-3 py-1.5 text-xs motion-hover hover:bg-[var(--console-surface-muted)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none`,children:W(`Retry`)})]})}function FS({route:e}){return Pn(),(0,K.jsx)(Yr,{id:`OverviewScreen`,detail:{projects:e.projectCount},children:(0,K.jsx)(jS,{children:(0,K.jsx)(ES,{window:e.overview.window,agentCatalog:e.agentCatalog,rangePreset:e.overview.rangePreset,onRangeChange:e.overview.onRangeChange,onSelectCustom:e.overview.onSelectCustom})})})}function IS({route:e}){return Pn(),(0,K.jsx)(jS,{children:(0,K.jsx)(DS,{initialPage:e.projectPage,window:e.window,agentCatalog:e.agentCatalog,loading:e.projectsLoad.loading,error:e.projectsLoad.error,onRetry:e.projectsLoad.retry})})}function LS({route:e}){return Pn(),(0,K.jsx)(jS,{children:(0,K.jsx)(OS,{project:e.project,loading:e.projectLoad.loading,error:e.projectLoad.error,onRetry:e.projectLoad.retry,agentCatalog:e.agentCatalog,projectKey:e.activeProjectKey,sessions:e.sessions,activeAgent:e.agentFilter.selectedAgent,onChangeAgent:e.agentFilter.onChangeAgent,timeWindow:e.overview.window,rangePreset:e.overview.rangePreset,onRangeChange:e.overview.onRangeChange,onSelectCustom:e.overview.onSelectCustom})})}function RS({route:e}){Pn();let t=(0,G.useMemo)(()=>MS(e.agents),[e.agents]),n=e.bookmarks.toggleSessionBookmark,r=(0,G.useCallback)(e=>n(e,e.reference.agentName),[n]);return(0,K.jsx)(jS,{children:(0,K.jsx)(TS,{type:`agent`,agentCatalog:e.agentCatalog,sessions:e.sessions,agentItems:t,activeAgentKey:e.activeAgentKey,isBookmarked:e.bookmarks.isBookmarked,onToggleBookmark:r})})}function zS({route:e}){let t=Pn(),n=(0,G.useMemo)(()=>MS(e.agents),[e.agents]),r=e.detail.session,i=r?.reference.agentName,a=r?.reference.sessionId,o=(0,G.useMemo)(()=>!i||!a?[]:e.childSessionsByParentRouteKey.get(Cn(i,a))??[],[t,e.childSessionsByParentRouteKey,i,a]),s=e.bookmarks.toggleSessionBookmark,c=(0,G.useCallback)(e=>s(e,e.reference.agentName),[s]);return e.detail.loading?(0,K.jsx)(wS,{}):e.detail.error?.kind===`missing`?(0,K.jsx)(jS,{children:(0,K.jsx)(TS,{type:`missing-session`,agentCatalog:e.agentCatalog,sessions:e.sessions,agentItems:n,activeAgentKey:e.activeAgentKey,attemptedSessionId:e.activeSessionId,isBookmarked:e.bookmarks.isBookmarked,onToggleBookmark:c})}):e.detail.error?.kind===`load-failed`?(0,K.jsx)(jS,{children:(0,K.jsx)(TS,{type:`load-failed`,agentCatalog:e.agentCatalog,sessions:e.sessions,agentItems:n,loadFailureMessage:e.detail.error.message,isBookmarked:e.bookmarks.isBookmarked,onToggleBookmark:c,onRetry:e.detail.retry})}):r?(0,K.jsx)(Yr,{id:`SessionDetail`,detail:{messages:r.messages.length,session:r.reference.sessionId},children:(0,K.jsx)(jS,{children:(0,K.jsx)(kS,{session:r,agentCatalog:e.agentCatalog,highlightQuery:e.detailHighlightQuery,childSessions:o},`${r.reference.agentName}/${r.reference.sessionId}`)})}):(0,K.jsx)(wS,{})}function BS({route:e}){Pn();let t=(0,G.useMemo)(()=>MS(e.agents),[e.agents]);return(0,K.jsx)(jS,{children:(0,K.jsx)(TS,{type:`missing-agent`,agentCatalog:e.agentCatalog,sessions:e.sessions,agentItems:t,attemptedAgentKey:e.attemptedKey,isBookmarked:e.bookmarks.isBookmarked,onToggleBookmark:t=>e.bookmarks.toggleSessionBookmark(t,t.reference.agentName)})})}function VS(){return Pn(),(0,K.jsxs)(`div`,{role:`alert`,className:`rounded-md border border-[var(--console-border)] bg-[var(--console-surface)] p-6`,children:[(0,K.jsx)(`h3`,{className:`console-mono mb-2 text-sm font-semibold text-[var(--console-text)]`,children:W(`Page not found`)}),(0,K.jsx)(`p`,{className:`console-mono mb-3 text-xs text-[var(--console-text-secondary)]`,children:W(`This address does not match any dashboard, agent, or session route.`)}),(0,K.jsx)(gr,{to:`/`,className:`console-mono text-xs text-[var(--console-accent)] underline underline-offset-2`,children:W(`Back to dashboard`)})]})}function HS({route:e}){switch(Pn(),e.mode){case`root`:return(0,K.jsx)(FS,{route:e});case`projects`:return(0,K.jsx)(IS,{route:e});case`project`:return(0,K.jsx)(LS,{route:e});case`agent`:return(0,K.jsx)(RS,{route:e});case`session`:return(0,K.jsx)(zS,{route:e});case`missingAgent`:return(0,K.jsx)(BS,{route:e});case`invalidRoute`:return(0,K.jsx)(VS,{})}}function US({load:e,search:t,route:n}){return Pn(),e.loading?(0,K.jsx)(wS,{}):t.active?(0,K.jsx)(NS,{search:t}):e.error?(0,K.jsx)(PS,{load:e}):(0,K.jsx)(HS,{route:n})}var WS=[{value:`7d`,label:`Last 7 days`},{value:`14d`,label:`Last 14 days`},{value:`30d`,label:`Last 30 days`},{value:`90d`,label:`Last 90 days`},{value:`all`,label:`All time`}];function GS({window:e,preset:t,customFrom:n,customTo:r,onSelectPreset:i,onSelectCustom:a}){Pn();let[o,s]=(0,G.useState)(!1),c=$t({window:e}),l=()=>s(!0);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,K.jsxs)(`label`,{className:`relative block`,children:[(0,K.jsx)(`span`,{className:`sr-only`,children:W(`Session time range`)}),(0,K.jsxs)(`select`,{value:t,title:c??W(`Session time range`),onChange:e=>{let t=e.target.value;t===`custom`?l():i(t)},className:`console-mono w-24 appearance-none rounded-full border border-[var(--console-border)] bg-[var(--console-surface)] py-[5px] pr-6 pl-[13px] text-[11px] text-[var(--console-text)] outline-none hover:border-[var(--console-border-strong)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--console-bg)] sm:w-auto sm:max-w-44 sm:pr-7`,children:[WS.map(e=>(0,K.jsx)(`option`,{value:e.value,children:W(e.label)},e.value)),(0,K.jsx)(`option`,{value:`custom`,children:W(`Custom range`)})]}),(0,K.jsx)(`span`,{"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 right-2 -translate-y-1/2 text-[10px] text-[var(--console-muted)]`,children:`▾`})]}),t===`custom`?(0,K.jsx)(`button`,{type:`button`,onClick:l,"aria-label":W(`Edit custom time range`),className:`console-mono motion-hover motion-press rounded-full border border-[var(--brand)] bg-[var(--brand)] px-[13px] py-[5px] text-[11px] text-[var(--brand-fg)] hover:bg-[var(--brand-hover)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--console-bg)]`,children:W(`Edit`)}):null]}),(0,K.jsx)(un,{open:o,onOpenChange:s,window:e,customFrom:n,customTo:r,onSelectCustom:a})]})}var KS=(0,G.forwardRef)(function({onSubmit:e},t){Pn();let[n,r]=(0,G.useState)(``),i=(0,G.useRef)(null);return(0,G.useImperativeHandle)(t,()=>({clear(){r(``)},focusAndSelect(){i.current?.focus(),i.current?.select()}}),[]),(0,K.jsx)(Yr,{id:`SearchControls`,children:(0,K.jsxs)(`form`,{className:`order-3 col-span-2 flex w-full items-center justify-center gap-2 sm:order-none sm:col-span-1 sm:mx-auto sm:max-w-[560px]`,onSubmit:t=>{t.preventDefault(),e(n)},children:[(0,K.jsxs)(`label`,{className:`flex min-w-0 flex-1 items-center rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)] px-2 py-1 focus-within:border-[var(--brand-line)] focus-within:ring-2 focus-within:ring-[var(--brand)]`,children:[(0,K.jsx)(`span`,{className:`sr-only`,children:W(`Search Sessions`)}),(0,K.jsx)(`input`,{ref:i,type:`search`,name:`session-search`,autoComplete:`off`,value:n,onChange:e=>r(e.target.value),placeholder:W(`Search sessions… /`),className:`console-mono w-full min-w-0 bg-transparent text-xs text-[var(--console-text)] outline-none placeholder:text-[var(--console-muted)]`})]}),(0,K.jsx)(`button`,{type:`submit`,className:`console-mono rounded-sm border border-[var(--console-border-strong)] bg-[var(--console-surface-muted)] px-3 py-1 text-xs text-[var(--console-text)] motion-hover hover:bg-[var(--console-surface)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none`,children:W(`Search`)})]})})});function qS(){let{preference:e}=(0,G.useSyncExternalStore)(Fn,In,In);return(0,K.jsxs)(`label`,{className:`console-mono flex shrink-0 items-center gap-1 text-xs text-[var(--console-muted)]`,children:[(0,K.jsx)(`span`,{className:`sr-only`,children:W(`Language`)}),(0,K.jsxs)(`select`,{value:e,onChange:e=>wn(e.target.value),className:`max-w-28 rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)] px-1.5 py-1 text-[var(--console-text)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none`,children:[(0,K.jsx)(`option`,{value:`system`,children:W(`Follow system`)}),(0,K.jsx)(`option`,{value:`zh-CN`,children:`简体中文`}),(0,K.jsx)(`option`,{value:`en`,children:`English`}),(0,K.jsx)(`option`,{value:`ja`,children:`日本語`})]})]})}var JS={light:`dark`,dark:`system`,system:`light`},YS={light:wu,dark:pu,system:fu},XS={light:`Light`,dark:`Dark`,system:`System`};function ZS({theme:e,onChange:t}){Pn();let n=YS[e],r=JS[e];return(0,K.jsx)(`button`,{type:`button`,onClick:()=>t(r),"aria-label":W(`Theme: {0}. Switch to {1}.`,[W(XS[e]),W(XS[r])]),title:W(`Theme: {0} (click for {1})`,[W(XS[e]),W(XS[r])]),className:`console-mono motion-hover motion-press rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)] p-1.5 text-[var(--console-muted)] hover:bg-[var(--console-surface-muted)] hover:text-[var(--console-text)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--console-bg)] focus-visible:outline-none`,children:(0,K.jsx)(n,{"aria-hidden":`true`,className:`size-4`})})}function QS({searchControlsRef:e,onSubmitSearch:t,theme:n,onChangeTheme:r,onShowShortcuts:i,timeWindow:a}){return Pn(),(0,K.jsx)(`header`,{className:`shrink-0 border-b border-[var(--console-border)] bg-[var(--console-surface)]/85 backdrop-blur-sm`,children:(0,K.jsxs)(`div`,{className:`grid min-h-14 grid-cols-[auto_1fr] items-center gap-3 px-4 py-2 sm:grid-cols-[auto_1fr_auto] sm:py-0`,children:[(0,K.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,K.jsxs)(gr,{to:`/`,className:`flex items-center gap-2 text-[var(--console-text)]`,children:[(0,K.jsx)(`img`,{src:`/logo.svg?v=3`,alt:`CodeSesh`,className:`h-6 w-6 rounded-sm`}),(0,K.jsx)(`span`,{className:`console-display text-sm font-semibold uppercase tracking-[0.05em]`,children:`CodeSesh`})]})}),(0,K.jsx)(KS,{ref:e,onSubmit:t}),(0,K.jsxs)(`div`,{className:`flex items-center flex-wrap justify-end gap-2`,children:[(0,K.jsx)(qS,{}),(0,K.jsx)(ZS,{theme:n,onChange:r}),(0,K.jsxs)(`button`,{type:`button`,onClick:i,className:`console-mono rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)] px-2 py-1 text-xs text-[var(--console-text)] motion-hover hover:bg-[var(--console-surface-muted)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none`,title:W(`Show keyboard shortcuts`),children:[`?`,(0,K.jsxs)(`span`,{className:`hidden sm:inline`,children:[` `,W(`Shortcuts`)]})]}),a?(0,K.jsx)(GS,{window:a.value,preset:a.preset,customFrom:a.customFrom,customTo:a.customTo,onSelectPreset:a.onSelectPreset,onSelectCustom:a.onSelectCustom}):null,(0,K.jsxs)(`span`,{className:`console-mono hidden rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2 py-1 text-xs text-[var(--console-muted)] sm:inline-flex`,children:[`v`,`1.0.9`]})]})]})})}function $S(e){return`'${e.replace(/'/g,`'\\''`)}'`}function eC({resumeCommandPrefix:e,sessionId:t,directory:n}){if(!e)return null;let r=`${e} ${$S(t)}`,i=n??``;return i.trim()?`cd ${$S(i)} && ${r}`:r}async function tC(e){if(typeof navigator<`u`&&navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(e),!0}catch{}if(typeof document>`u`)return!1;let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select();let n=!1;try{n=document.execCommand(`copy`)}catch{n=!1}return document.body.removeChild(t),n}function nC({resumeCommandPrefix:e,sessionId:t,directory:n,className:r=``}){Pn();let[i,a]=(0,G.useState)(!1),o=eC({resumeCommandPrefix:e,sessionId:t,directory:n});return(0,G.useEffect)(()=>{if(!i)return;let e=window.setTimeout(()=>a(!1),1500);return()=>window.clearTimeout(e)},[i]),o?(0,K.jsxs)(`button`,{type:`button`,onClick:e=>{e.preventDefault(),e.stopPropagation(),tC(o).then(e=>{e&&a(!0)})},"aria-label":W(i?`Resume command copied: {0}`:`Copy resume command: {0}`,[o]),title:W(i?`Copied: {0}`:`Copy: {0}`,[o]),className:`console-mono motion-hover motion-press inline-flex items-center gap-1.5 rounded-sm border px-2 py-1 text-[11px] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--console-bg)] focus-visible:outline-none ${r} ${i?`border-[var(--positive)] bg-[var(--positive-soft)] text-[var(--positive)]`:`border-[var(--console-border)] bg-[var(--console-surface-muted)] text-[var(--console-muted)] hover:border-[var(--console-border-strong)] hover:text-[var(--console-text)]`}`,children:[i?(0,K.jsx)(Ul,{className:`size-3`,strokeWidth:1.8}):(0,K.jsx)($l,{className:`size-3`,strokeWidth:1.8}),(0,K.jsx)(`span`,{children:W(i?`Copied`:`Copy resume`)}),(0,K.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,children:i?W(`Resume command copied`):``})]}):null}function rC({visible:e}){Pn();let t=No(),n=an(t),r=t?[t.phase,t.scanningAgents[0]??``,t.completedAgents.length,t.totalAgents,t.backfill.active,t.backfill.currentAgent??``,t.backfill.pendingAgents.length,t.backfill.failedAgents.length].join(`|`):null;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:e&&n?`flow-root`:void 0,children:e&&n?(0,K.jsx)(`p`,{title:n,className:`console-mono mt-2 w-fit max-w-full truncate rounded-sm border border-[var(--console-warning-border)] bg-[var(--console-warning-bg)] px-2 py-1 text-[11px] leading-relaxed text-[var(--console-warning)]`,children:n}):null}),(0,K.jsx)(iC,{visible:e,label:n},r??`idle`)]})}function iC({visible:e,label:t}){Pn();let[n]=(0,G.useState)(t);return(0,K.jsx)(`div`,{className:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:e?n:null})}function aC({model:{mobileNavigationOpen:e,sidebarCollapsed:t,route:n,shortcutHintVisible:r,sessionBackHintVisible:i,resumeSession:a,sessionCopyNotice:o,liveNotice:s,scanStatusVisible:c,sessionLoadNotice:l},actions:{onOpenMobileNavigation:u,onExpandSidebar:d,onDismissShortcutHint:f,onRetrySessionLoad:p}}){return Pn(),(0,K.jsxs)(`section`,{className:`flex shrink-0 items-start gap-3 border-b border-[var(--console-border)] bg-[var(--console-surface)]/70 px-4 py-3 backdrop-blur-sm md:px-8`,children:[(0,K.jsx)(`button`,{type:`button`,"aria-expanded":e,"aria-label":W(`Open navigation`),title:W(`Open navigation`),onClick:u,className:`mt-0.5 inline-flex shrink-0 rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)] p-1 text-[var(--console-muted)] motion-hover hover:bg-[var(--console-surface-muted)] hover:text-[var(--console-text)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none min-[1025px]:hidden`,children:(0,K.jsx)(_u,{className:`size-4`})}),t?(0,K.jsx)(`button`,{type:`button`,"aria-expanded":`false`,"aria-label":W(`Expand sidebar`),title:W(`Expand sidebar`),onClick:d,className:`mt-0.5 hidden shrink-0 rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)] p-1 text-[var(--console-muted)] motion-hover hover:bg-[var(--console-surface-muted)] hover:text-[var(--console-text)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none min-[1025px]:inline-flex`,children:(0,K.jsx)(_u,{className:`size-4`})}):null,(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[n.breadcrumbs.length>1?(0,K.jsx)(`nav`,{"aria-label":W(`Breadcrumb`),className:`console-mono mb-2 flex flex-wrap items-center gap-1 text-[11px] text-[var(--console-muted)]`,children:n.breadcrumbs.map((e,t)=>(0,K.jsxs)(`span`,{className:t===n.breadcrumbs.length-2?`flex min-w-0 items-center gap-1`:`hidden min-w-0 items-center gap-1 sm:flex`,children:[e.to?(0,K.jsx)(gr,{to:e.to,className:`truncate motion-hover hover:text-[var(--console-text)]`,children:e.label}):(0,K.jsx)(`span`,{className:`text-[var(--console-text)]`,children:e.label}),t<n.breadcrumbs.length-1?(0,K.jsx)(`span`,{children:`/`}):null]},`${e.label}-${t}`))}):null,(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[n.contextLabel===n.title?null:(0,K.jsx)(`span`,{className:`console-eyebrow hidden shrink-0 rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-1.5 py-0.5 sm:inline-flex`,children:n.contextLabel}),(0,K.jsx)(`h1`,{className:`console-display min-w-0 break-words text-xl font-semibold sm:text-2xl text-[var(--console-text)]`,children:n.title})]}),(0,K.jsx)(`div`,{className:`console-mono mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-[var(--console-muted)]`,children:n.subtitle}),(0,K.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2`,children:[r?(0,K.jsxs)(`div`,{className:`console-mono hidden items-center gap-2 rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2 py-1 text-[11px] text-[var(--console-text)] sm:inline-flex`,children:[(0,K.jsx)(`span`,{children:W(`Keyboard navigation available`)}),(0,K.jsx)(`span`,{className:`rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)] px-1`,children:`?`}),(0,K.jsx)(`button`,{type:`button`,onClick:f,className:`text-[var(--console-muted)] motion-hover hover:text-[var(--console-text)]`,"aria-label":W(`Dismiss keyboard shortcuts hint`),children:`×`})]}):null,i?(0,K.jsx)(`span`,{className:`console-mono hidden rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2 py-1 text-[11px] text-[var(--console-muted)] sm:inline-flex`,children:W(`Esc back`)}):null,a?(0,K.jsx)(nC,{...a}):null]}),(0,K.jsxs)(`div`,{"aria-live":`polite`,children:[o?(0,K.jsx)(`p`,{className:`console-mono mt-2 inline-flex rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2 py-1 text-[11px] text-[var(--console-text)]`,children:o}):null,s?(0,K.jsx)(`p`,{className:`console-mono mt-2 inline-flex rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2 py-1 text-[11px] text-[var(--console-text)]`,children:s}):null]}),(0,K.jsx)(rC,{visible:c}),l?(0,K.jsxs)(`div`,{role:l.error?`alert`:`status`,className:`console-mono mt-2 flex flex-wrap items-center gap-2 rounded-sm border border-[var(--console-warning-border)] bg-[var(--console-warning-bg)] px-2 py-1 text-[11px] text-[var(--console-warning)]`,children:[(0,K.jsx)(`span`,{children:l.error??W(`Loading sessions… Results are not yet complete.`)}),l.error?(0,K.jsx)(`button`,{type:`button`,disabled:l.loading,onClick:p,className:`rounded-sm border border-current px-2 py-1 focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none disabled:opacity-50`,children:W(`Retry session load`)}):null]}):null]})]})}function oC({locationPath:e,mode:t,searchActive:n,sessionCount:r,children:i}){return(0,K.jsx)(`section`,{className:`console-scrollbar bg-grid min-h-0 flex-1 overflow-y-auto px-4 py-6 md:px-8`,children:(0,K.jsx)(yS,{children:(0,K.jsx)(Yr,{id:`MainContent`,detail:{mode:t,search:n,sessions:r},children:i})},e)})}var sC={user:`User`,assistant:`Assistant`,tool:`Tool`};function cC(e,t){let n=t;for(let t of e.matchAll(/`+/g))n=Math.max(n,t[0].length+1);return"`".repeat(n)}function lC(e){let t=e.replace(/\s+/g,` `).trim(),n=cC(t,1),r=t.startsWith("`")||t.endsWith("`");return`${n}${r?` `:``}${t}${r?` `:``}${n}`}function uC(e,t){let n=cC(e,3);return`${n}${t}\n${e}${e.endsWith(`
1410
+ `,Hx=.08,Ux=16,Wx=700,Gx=1/3,Kx=1.3333333333333333,qx=.6666666666666667/Kx;function Jx(e,t){let n=e.composedPath(),r=n.find(e=>e instanceof HTMLElement&&e.parentElement?.getAttribute(`data-item-section`)===`decoration`);if(t.requireDecoration&&!r)return null;let i=n.find(e=>e instanceof HTMLElement&&e.getAttribute(`data-type`)===`item`);if(!i)return null;let a=i.getAttribute(`data-item-path`);return a?{item:i,anchor:r??i.querySelector(`[data-item-section='decoration'] > span`)??i,path:a}:null}function Yx(e){e?.dispatchEvent(new KeyboardEvent(`keydown`,{key:`ArrowDown`,bubbles:!0,cancelable:!0}))}function Xx(e){let t=e.shadowRoot;if(!t)return()=>{};let n=new Set,r=new Set,i=new WeakMap,a=new WeakMap;function o(e){let t=i.get(e);t!==void 0&&cancelAnimationFrame(t),a.get(e)?.remove(),a.delete(e),r.delete(e),i.delete(e),n.delete(e),e.scrollLeft=0,e.removeAttribute(`data-session-title-scroll`),e.removeAttribute(`data-session-title-scroll-complete`)}function s(e){if(Qx()||e.hasAttribute(`data-session-title-scroll-complete`))return;o(e);let t=e.querySelector(`[data-truncate-group-container="middle"]`),s=t?.getBoundingClientRect().width??0;if(!t||s<=e.clientWidth+1)return;let c=t.cloneNode(!0);c.dataset.sessionTitleScrollCopy=`true`,c.setAttribute(`aria-hidden`,`true`),c.style.marginInlineStart=`${Ux}px`,e.append(c),a.set(e,c),r.add(e),e.setAttribute(`data-session-title-scroll`,`running`);let l=s+Ux,u=Math.max(Wx,l/Hx*Kx),d=performance.now();n.add(e);let f=t=>{if(!n.has(e))return;let r=Math.min(1,Math.max(0,(t-d)/u));if(e.scrollLeft=l*$x(r),r>=1){n.delete(e),i.delete(e),e.removeAttribute(`data-session-title-scroll`),e.setAttribute(`data-session-title-scroll-complete`,`true`);return}i.set(e,requestAnimationFrame(f))};i.set(e,requestAnimationFrame(f))}function c(e){let t=Zx(e.target),n=e.relatedTarget;!t||n instanceof Node&&t.contains(n)||s(t)}function l(e){let t=Zx(e.target),n=e.relatedTarget;!t||n instanceof Node&&t.contains(n)||o(t)}return t.addEventListener(`pointerover`,c),t.addEventListener(`pointerout`,l),()=>{t.removeEventListener(`pointerover`,c),t.removeEventListener(`pointerout`,l);for(let e of r)o(e)}}function Zx(e){if(!(e instanceof Element))return null;let t=e.closest(`[data-item-section="content"]`);return!t||t.parentElement?.getAttribute(`data-type`)!==`item`?null:t}function Qx(){return globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches??!1}function $x(e){if(e<=qx)return e/qx*.6666666666666667;let t=(e-qx)/.4999999999999999;return .6666666666666667+Gx*(t*(2-t))}function eS(e){return e.replaceAll(`/`,`∕`).trim()||`(untitled)`}function tS(e){return e.replace(/\/+$/,``).split(`/`).at(-1)?.trim()||`(unknown)`}function nS(e){let t=e.project_identity;if(t)return{key:On(t),label:t.displayName||tS(e.directory)};let n=tS(e.directory);return{key:n===`(unknown)`?`__unknown__`:`path:${e.directory||n}`,label:n}}function rS(e){return e.time_updated??e.time_created}function iS(e,t,n){let r=e.get(t.path)??2**53-1,i=e.get(n.path)??2**53-1;return r===i?t.path.localeCompare(n.path):r-i}function aS(){let e=new Set,t=new Map;return function(n){if(!e.has(n))return e.add(n),n;let r=t.get(n)??2,i=`${n} (${r})`;for(;e.has(i);)r+=1,i=`${n} (${r})`;return t.set(n,r+1),e.add(i),i}}var oS=`Unmounted`,sS=`Deeper sessions`;function cS(e,{groupByProject:t=!0}={}){let n=new Map,r=new Map,i=new Map,a=new Map,o=new Map,s=aS(),c=[],l=Ln(e),u=new Map;for(let e of l.roots){let t=e.session,{key:n,label:r}=nS(t),i=rS(t),a=u.get(n);a?(a.nodes.push(e),i>a.maxTime&&(a.maxTime=i)):u.set(n,{label:r,nodes:[e],maxTime:i})}let d=t?[...u.values()].sort((e,t)=>e.label===`(unknown)`?1:t.label===`(unknown)`?-1:t.maxTime-e.maxTime):[{label:null,nodes:l.roots}];l.orphans.length>0&&d.push({label:W(oS),nodes:l.orphans});let f=0,p=aS();for(let e of d){let t=``;if(e.label!==null){let r=p(eS(e.label));t=`${r}/`,n.set(t,f),n.set(r,f),f+=1,a.set(t,`${e.nodes.length}`),a.set(r,`${e.nodes.length}`)}let l=new Map,u=[];for(let n=e.nodes.length-1;n>=0;--n)u.push({node:e.nodes[n],parentPath:t,siblingTitleCounts:l,depth:0,flattened:!1});for(;u.length>0;){let e=u.pop(),{node:l,parentPath:d,siblingTitleCounts:p}=e,m=l.session,h=Rc(m);p.set(h,(p.get(h)??0)+1);let g=s(`${d}${(p.get(h)??1)>1?`${eS(h)} #${m.reference.sessionId.slice(0,8)}`:eS(h)}`),_=vr(m),v=!e.flattened&&l.children.length>0,y=v?`${g}/`:g;if(v?(n.set(g,f),n.set(y,f),o.set(g,m),o.set(y,m)):(c.push(g),n.set(g,f),o.set(g,m)),f+=1,r.set(_,y),i.set(_,t),l.children.length===0)continue;if(e.flattened){for(let t=l.children.length-1;t>=0;--t)u.push({node:l.children[t],parentPath:d,siblingTitleCounts:p,depth:e.depth,flattened:!0});continue}let b=new Map;if(e.depth+1<32){for(let t=l.children.length-1;t>=0;--t)u.push({node:l.children[t],parentPath:y,siblingTitleCounts:b,depth:e.depth+1,flattened:!1});continue}let x=s(`${y}${W(sS)}`),S=`${x}/`;n.set(x,f),n.set(S,f),a.set(x,`${l.descendantCount}`),a.set(S,`${l.descendantCount}`),f+=1;for(let t=l.children.length-1;t>=0;--t)u.push({node:l.children[t],parentPath:S,siblingTitleCounts:b,depth:e.depth+1,flattened:!0})}}return{paths:c,sortOrderByPath:n,pathBySessionReference:r,groupPathBySessionReference:i,groupCountByPath:a,sessionByPath:o}}function lS(e,t){if(!Wr())return t();let n=performance.now(),r=t(),i=performance.now();return qr({id:e,source:`custom-timing`,phase:`measure`,actualDuration:Math.round((i-n)*100)/100,baseDuration:0,startTime:n,commitTime:i}),r}var uS=(0,G.memo)(function({sessions:e,activeSessionReference:t,selectedSessionReference:n,onSelectSession:r,bookmarkedSessionReferences:i,onCopySessionAsMarkdown:a,onToggleBookmark:o,onRenameSession:s,groupByProject:c=!0}){let l=Pn(),[u,d]=(0,G.useState)(null),f=(0,G.useRef)(null),p=(0,G.useRef)(null),m=(0,G.useRef)(null),h=(0,G.useMemo)(()=>lS(`SessionTreeSidebar:buildTreeModel`,()=>cS(e,{groupByProject:c})),[l,e,c]),g=(0,G.useRef)(h.sortOrderByPath),_=(0,G.useRef)(h.groupCountByPath),v=(0,G.useRef)(h.sessionByPath),y=(0,G.useRef)(r),b=(0,G.useRef)(a),x=(0,G.useRef)(o),S=(0,G.useRef)(s),C=(0,G.useRef)(!1),w={"--trees-bg-override":`transparent`,"--trees-border-color-override":`var(--console-border)`,"--trees-fg-override":`var(--console-text)`,"--trees-fg-muted-override":`var(--console-muted)`,"--trees-font-family-override":`var(--font-mono)`,"--trees-font-size-override":`12px`,"--trees-item-margin-x-override":`0px`,"--trees-item-padding-x-override":`4px`,"--trees-padding-inline-override":`4px`,"--trees-selected-bg-override":n!==null&&n!==t?`transparent`:`var(--brand-soft)`},{model:T}=Bx({flattenEmptyDirectories:!1,initialExpansion:`closed`,paths:h.paths,sort:(e,t)=>iS(g.current,e,t),density:`compact`,unsafeCSS:Vx,onSelectionChange(e){if(C.current)return;let t=v.current.get(e[0]??``);t&&y.current(t)},renderRowDecoration({item:e}){return v.current.get(e.path)?{text:`⋯`,title:W(`Session options`)}:_.current.get(e.path)?{text:_.current.get(e.path),title:W(`Sessions`)}:null}});(0,G.useEffect)(()=>{g.current=h.sortOrderByPath,_.current=h.groupCountByPath,v.current=h.sessionByPath,T.resetPaths(h.paths)},[T,h]),(0,G.useEffect)(()=>{y.current=r},[r]),(0,G.useEffect)(()=>{b.current=a},[a]),(0,G.useEffect)(()=>{x.current=o},[o]),(0,G.useEffect)(()=>{S.current=s},[s]),(0,G.useEffect)(()=>{let e,t=0,n=()=>{let r=T.getFileTreeContainer();if(!r){t=requestAnimationFrame(n);return}e=Xx(r)};return n(),()=>{t&&cancelAnimationFrame(t),e?.()}},[T]);function E(e,t,n){f.current=t,p.current=n,d(e),Yx(m.current)}function D(e){let t=Jx(e.nativeEvent,{requireDecoration:!0}),n=t?v.current.get(t.path):null;t&&n&&(e.preventDefault(),e.stopPropagation(),E(n,t.anchor,t.item))}function O(e){if(e.key!==`ContextMenu`&&!(e.shiftKey&&e.key===`F10`))return;let t=Jx(e.nativeEvent,{requireDecoration:!1}),n=t?v.current.get(t.path):null;t&&n&&(e.preventDefault(),e.stopPropagation(),E(n,t.anchor,t.item))}return(0,G.useEffect)(()=>{let e=h.pathBySessionReference.get(t??``),r=h.pathBySessionReference.get(n??``)??e,i=n??t??``,a=h.groupPathBySessionReference.get(i);C.current=!0;try{for(let t of T.getSelectedPaths())t!==e&&T.getItem(t)?.deselect();e&&!T.getSelectedPaths().includes(e)&&T.getItem(e)?.select()}finally{C.current=!1}if(r&&t){let e=r.split(`/`).filter(Boolean);for(let t=1;t<=e.length;t+=1){let n=`${e.slice(0,t).join(`/`)}/`,r=T.getItem(n);r&&`expand`in r&&r.expand()}let t=a?T.getItem(a):null;t&&`expand`in t&&t.expand(),T.focusPath(r);return}a&&T.focusPath(a)},[t,T,h,n]),(0,K.jsxs)(`div`,{className:`session-tree h-[min(560px,calc(100vh-410px))] min-h-56 overflow-hidden`,style:w,onClickCapture:D,onKeyDownCapture:O,children:[(0,K.jsx)(pf,{model:T,style:{height:`100%`},"aria-label":W(`Sessions`)}),(0,K.jsxs)(Ld,{modal:!1,children:[(0,K.jsx)(qd,{ref:m,tabIndex:-1,"aria-hidden":`true`,className:`pointer-events-none absolute size-0 opacity-0`}),(0,K.jsx)($u,{children:(0,K.jsx)(Od,{anchor:f,side:`bottom`,align:`end`,sideOffset:4,className:`z-40`,children:(0,K.jsx)(Xu,{finalFocus:p,className:`motion-menu w-36 rounded-md border border-[var(--console-border)] bg-[var(--console-surface)] p-1 shadow-[var(--shadow-overlay)] focus-visible:outline-none`,children:u?(0,K.jsx)(Xd,{bookmarked:i.has(vr(u)),onCopyAsMarkdown:()=>b.current(u),onRename:()=>S.current(u),onToggleBookmark:()=>x.current(u)}):null})})})]})]})}),dS=50;function fS(e){return`flex items-center gap-2 rounded-sm px-3 py-1.5 text-left motion-hover focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none ${e?`bg-[var(--brand-soft)] text-[var(--brand)]`:`text-[var(--console-muted)] hover:bg-[var(--console-surface-muted)] hover:text-[var(--console-text)]`}`}function pS({scanning:e,empty:t}){Pn();let n=No();return(0,K.jsx)(`span`,{className:`console-mono block rounded-sm px-3 py-1.5 text-xs text-[var(--console-muted)]`,children:n?.active?e:t})}function mS({projects:e,selectedProjectNavigationId:t}){Pn();let n=e.slice(0,dS),r=t?e.find(e=>{let n=fr(e);return On(n)===t}):void 0;return r&&!n.includes(r)&&n.push(r),(0,K.jsx)(K.Fragment,{children:n.map(e=>{let n=fr(e),r=t===On(n);return(0,K.jsx)(`li`,{children:(0,K.jsxs)(gr,{to:or(n),"data-active":r?`true`:void 0,className:`min-w-0 ${fS(r)}`,children:[(0,K.jsx)(`span`,{className:`console-mono min-w-0 flex-1 truncate text-xs`,children:e.displayName}),(0,K.jsx)(`span`,{className:`console-mono shrink-0 text-[11px] text-[var(--console-muted)]`,children:e.sessionCount})]})},`${e.identityKind}:${e.identityKey}`)})})}function hS({collapsed:e,mobileOpen:t,onMobileOpenChange:n,children:r}){return Pn(),(0,G.useEffect)(()=>{if(!t||typeof window.matchMedia!=`function`)return;let e=window.matchMedia(`(min-width: 1025px)`),r=()=>{e.matches&&n(!1)};return e.addEventListener(`change`,r),r(),()=>e.removeEventListener(`change`,r)},[t,n]),t?(0,K.jsx)(Nu,{open:!0,onOpenChange:n,title:W(`Navigation`),variant:`mobile`,side:`left`,children:r}):(0,K.jsx)(`aside`,{"aria-label":W(`Primary navigation`),className:`w-64 shrink-0 flex-col border-r border-[var(--console-border)] bg-[var(--console-sidebar-bg)] ${e?`hidden`:`hidden min-[1025px]:flex`}`,children:r})}function gS({model:{sidebarCollapsed:e,mobileNavigationOpen:t,viewState:n,agentCatalog:r,projects:i,projectCount:a,projectsError:o,projectsLoading:s,selectedProjectNavigationId:c,bookmarkedSessions:l,bookmarksError:u,bookmarksLoading:d,sidebarSessions:f,sidebarSessionLookup:p,bookmarkedSidebarSessionReferences:m,isSearchMode:h,shortcutHelpOpen:g,dismissShortcutHint:_},actions:{onCollapse:v,onMobileNavigationOpenChange:y,onToggleBookmark:b,onSelectFlatSidebarSession:x,onCopySessionAsMarkdown:S,onToggleSidebarSessionBookmark:C,onRenameSession:w,onRenameBookmarkedSession:T,onRetryProjects:E,onRetryBookmarks:D}}){Pn();let O=Wc(),k=n.mode===`session`?Cn(n.activeAgentKey,n.activeSessionId):null,A=n.mode===`root`,j=n.mode===`projects`,{selectedSessionReference:M,selectSession:N}=Gc({viewState:n,sessions:f,sessionLookup:p,isSearchMode:h,shortcutHelpOpen:g,dismissShortcutHint:_,onOpenSession:x}),P=(0,G.useCallback)(e=>{N(e),x(e)},[x,N]);return(0,K.jsx)(hS,{collapsed:e,mobileOpen:t,onMobileOpenChange:y,children:(0,K.jsxs)(`div`,{className:`console-scrollbar flex-1 space-y-8 overflow-y-auto px-4 py-6`,children:[(0,K.jsx)(`section`,{children:(0,K.jsxs)(`ul`,{ref:O,"data-fluid-hover":`y`,className:`console-scrollbar max-h-[min(320px,calc(100vh-400px))] space-y-1 overflow-y-auto pr-1`,children:[(0,K.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,K.jsxs)(gr,{"data-fluid-item":!0,to:`/`,"data-active":A?`true`:void 0,className:`min-w-0 flex-1 ${fS(A)}`,children:[(0,K.jsx)(`img`,{src:`/logo.svg?v=3`,alt:W(`Dashboard`),className:`size-3.5 rounded-[2px]`}),(0,K.jsx)(`span`,{className:`console-mono line-clamp-1 flex-1 text-xs`,children:W(`Dashboard`)})]}),t?null:(0,K.jsx)(`button`,{type:`button`,"aria-expanded":`true`,"aria-label":W(`Collapse sidebar`),title:W(`Collapse sidebar`),onClick:v,className:`shrink-0 rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)] p-1 text-[var(--console-muted)] motion-hover hover:bg-[var(--console-surface-muted)] hover:text-[var(--console-text)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none`,children:(0,K.jsx)(gu,{className:`size-4`})})]}),(0,K.jsx)(`li`,{children:(0,K.jsxs)(gr,{"data-fluid-item":!0,to:`/projects`,"data-active":j?`true`:void 0,className:fS(j),children:[(0,K.jsx)(`span`,{className:`console-mono min-w-0 flex-1 truncate text-xs`,children:W(`Projects`)}),(0,K.jsx)(`span`,{className:`console-mono shrink-0 text-[11px] text-[var(--console-muted)]`,children:a})]})}),(0,K.jsx)(mS,{projects:i,selectedProjectNavigationId:c}),o?(0,K.jsx)(`li`,{children:(0,K.jsx)(Kt,{title:W(`Couldn't load projects.`),message:o,onRetry:E,className:`px-3 py-2`})}):i.length===0&&!s?(0,K.jsx)(`li`,{children:(0,K.jsx)(pS,{scanning:W(`Scanning projects...`),empty:W(`No projects found`)})}):null]})}),(0,K.jsxs)(`section`,{children:[(0,K.jsx)(`h3`,{className:`console-eyebrow mb-3`,children:W(`BOOKMARKS`)}),u?(0,K.jsx)(Kt,{title:W(`Couldn't load bookmarks.`),message:u,onRetry:D,className:`mb-2 px-3 py-2`}):null,l.length===0&&d?(0,K.jsx)(`span`,{className:`console-mono block rounded-sm px-3 py-1.5 text-xs text-[var(--console-muted)]`,children:W(`Loading bookmarks...`)}):l.length===0&&!u?(0,K.jsx)(`span`,{className:`console-mono block rounded-sm px-3 py-1.5 text-xs text-[var(--console-muted)]`,children:W(`No bookmarks yet`)}):(0,K.jsx)(`ul`,{className:`space-y-1`,children:l.map(e=>{let{reference:t}=e,i=n.mode===`session`&&n.activeAgentKey===t.agentName&&n.activeSessionId===t.sessionId,a=gs(r,t.agentName),o=e.availability===`available`,s=o?void 0:e.display_title,c=e.availability===`agent-unavailable`?W(`Agent unavailable`):W(`Session unavailable`),l=o?Rc(e.session):s??t.sessionId,u=s?`${a?.displayName??t.agentName} · ${t.sessionId} · ${c}`:`${a?.displayName??t.agentName} · ${c}`,d=(0,K.jsxs)(K.Fragment,{children:[a?.icon?(0,K.jsx)(Kc,{icon:a.icon,iconColored:a.iconColored,alt:a.displayName,className:`mt-0.5 size-3.5 shrink-0 object-contain`}):null,(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`span`,{className:`console-mono line-clamp-1 block text-xs`,children:l}),(0,K.jsx)(`span`,{className:`console-mono mt-0.5 line-clamp-1 block text-[10px] text-[var(--console-muted)]`,children:o?a?.displayName??t.agentName:u})]})]});return(0,K.jsx)(`li`,{children:(0,K.jsxs)(`div`,{"data-active":i?`true`:void 0,className:`flex items-start gap-2 rounded-sm px-2 py-1.5 motion-hover ${i?`bg-[var(--brand-soft)] text-[var(--brand)]`:`text-[var(--console-muted)] hover:bg-[var(--console-surface-muted)] hover:text-[var(--console-text)]`}`,children:[o?(0,K.jsx)(gr,{to:Mn(e.session),className:`flex min-w-0 flex-1 items-start gap-2`,children:d}):(0,K.jsx)(`div`,{className:`flex min-w-0 flex-1 items-start gap-2`,"aria-disabled":`true`,children:d}),(0,K.jsx)(Zd,{bookmarked:!0,onCopyAsMarkdown:o?()=>S(e.session):void 0,onRename:()=>T(e),onToggleBookmark:()=>b(e)})]})},ts(t))})})]}),c?(0,K.jsxs)(`section`,{children:[(0,K.jsxs)(`h3`,{className:`console-eyebrow mb-3`,children:[W(`SESSIONS`),` `,f.length>0?(0,K.jsx)(`span`,{className:`ml-2 text-[10px] font-normal text-[var(--console-muted)]`,children:W(`Navigate j k · Open Enter`)}):null]}),f.length===0?(0,K.jsx)(pS,{scanning:W(`Scanning sessions...`),empty:W(`No sessions yet`)}):(0,K.jsx)(Yr,{id:`SessionTreeSidebar`,detail:{sessions:f.length},children:(0,K.jsx)(uS,{sessions:f,activeSessionReference:k,selectedSessionReference:M,onSelectSession:P,bookmarkedSessionReferences:m,onCopySessionAsMarkdown:S,onToggleBookmark:C,onRenameSession:w,groupByProject:!1})})]}):null]})})}var _S=[{title:`Navigation`,items:[{keys:`j / k`,description:`Move through sessions or search results`},{keys:`Enter`,description:`Open the current selection`},{keys:`g / G`,description:`Jump to the first or last item`}]},{title:`Search & Help`,items:[{keys:`Cmd/Ctrl K`,description:`Open global search`},{keys:`/`,description:`Focus the search box`},{keys:`Esc`,description:`Exit search or close the current detail view`},{keys:`?`,description:`Open this shortcuts panel`}]}];function vS({open:e,onClose:t}){return Pn(),(0,K.jsx)(et,{open:e,onOpenChange:e=>e?void 0:t(),children:(0,K.jsxs)(Ve,{children:[(0,K.jsx)(Oe,{className:`shortcut-overlay fixed inset-0 z-50 bg-[var(--scrim)]`}),(0,K.jsxs)(pt,{className:`shortcut-content fixed left-1/2 top-1/2 z-50 w-[calc(100%-2rem)] max-w-2xl origin-center -translate-x-1/2 -translate-y-1/2 rounded-lg border border-[var(--console-border)] bg-[var(--console-surface)] p-5 shadow-[var(--shadow-overlay)] outline-none`,children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`console-eyebrow`,children:W(`Keyboard Shortcuts`)}),(0,K.jsx)(gt,{className:`console-display mt-2 text-[19px] font-semibold text-[var(--console-text)]`,children:W(`Navigate without leaving the keyboard`)})]}),(0,K.jsx)(qe,{className:`console-mono rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2 py-1 text-xs text-[var(--console-text)] motion-hover hover:bg-[var(--console-surface)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none`,children:`Esc`})]}),(0,K.jsx)(`div`,{className:`mt-5 grid gap-4 md:grid-cols-2`,children:_S.map(e=>(0,K.jsxs)(`div`,{className:`rounded-md border border-[var(--console-border)] bg-[var(--console-surface-muted)] p-4`,children:[(0,K.jsx)(`h3`,{className:`console-eyebrow`,children:W(e.title)}),(0,K.jsx)(`div`,{className:`mt-3 space-y-3`,children:e.items.map(e=>(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`console-mono text-xs text-[var(--console-text)]`,children:e.keys}),(0,K.jsx)(`p`,{className:`mt-1 text-[13px] leading-6 text-[var(--console-text-secondary)]`,children:W(e.description)})]},e.keys))})]},W(e.title)))})]})]})})}var yS=class extends G.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error(`ErrorBoundary caught error:`,e,t)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,K.jsx)(bS,{error:this.state.error}):this.props.children}};function bS({error:e}){return Pn(),(0,K.jsxs)(`div`,{role:`alert`,className:`rounded-md border border-[var(--console-error-border)] bg-[var(--console-error-bg)] p-6`,children:[(0,K.jsx)(`h3`,{className:`console-mono mb-2 text-sm font-semibold text-[var(--console-error)]`,children:W(`Something went wrong`)}),(0,K.jsx)(`p`,{className:`console-mono mb-3 text-xs text-[var(--console-text-secondary)]`,children:e?.message||W(`Unknown error`)}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>window.location.reload(),className:`console-mono rounded border border-[var(--console-border)] bg-[var(--console-surface)] px-2 py-1 text-xs text-[var(--console-text)]`,children:W(`Reload page`)})]})}var xS=[{id:`1`,roleWidth:`w-14`,timeWidth:`w-20`,bodyWidths:[`w-full`,`w-10/12`,`w-7/12`]},{id:`2`,roleWidth:`w-16`,timeWidth:`w-24`,bodyWidths:[`w-9/12`,`w-7/12`]},{id:`3`,roleWidth:`w-14`,timeWidth:`w-16`,bodyWidths:[`w-full`,`w-11/12`,`w-8/12`,`w-5/12`]},{id:`4`,roleWidth:`w-16`,timeWidth:`w-20`,bodyWidths:[`w-10/12`,`w-8/12`]},{id:`5`,roleWidth:`w-14`,timeWidth:`w-24`,bodyWidths:[`w-full`,`w-10/12`,`w-9/12`]}],SS=[`w-8/12`,`w-7/12`,`w-9/12`,`w-6/12`,`w-10/12`,`w-7/12`];function CS({className:e}){return Pn(),(0,K.jsx)(`div`,{className:`skeleton-shimmer rounded-sm ${e}`})}function wS(){return Pn(),(0,K.jsxs)(`div`,{className:`mx-auto grid min-h-full w-full max-w-[1440px] gap-6 px-2 md:px-4 min-[1025px]:grid-cols-[288px_minmax(0,1fr)] min-[1025px]:items-start`,children:[(0,K.jsxs)(`div`,{className:`hidden rounded-lg border border-[var(--console-border)] bg-[var(--console-surface-muted)] p-3 min-[1025px]:block`,children:[(0,K.jsx)(CS,{className:`h-2.5 w-20`}),(0,K.jsx)(`div`,{className:`mt-4 space-y-2.5`,children:SS.map((e,t)=>(0,K.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,K.jsx)(CS,{className:`size-3.5 shrink-0`}),(0,K.jsx)(CS,{className:`h-3 ${e}`})]},`${t}-${e}`))})]}),(0,K.jsx)(`div`,{className:`flex min-w-0 flex-col gap-8`,children:xS.map(e=>(0,K.jsx)(`article`,{className:`w-full border-l-2 border-[var(--console-thread)] pl-4 pr-3 md:pr-5`,children:(0,K.jsxs)(`div`,{className:`flex gap-4`,children:[(0,K.jsx)(`div`,{className:`shrink-0 pt-1`,children:(0,K.jsx)(`div`,{className:`flex size-8 items-center justify-center rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)]`,children:(0,K.jsx)(CS,{className:`size-3.5`})})}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(CS,{className:`${e.roleWidth} h-3`}),(0,K.jsx)(CS,{className:`${e.timeWidth} h-2.5`})]}),(0,K.jsx)(`div`,{className:`rounded-lg border border-[var(--console-border)] bg-[var(--console-surface)] p-4 shadow-[var(--shadow-raised)]`,children:(0,K.jsx)(`div`,{className:`space-y-2`,children:e.bodyWidths.map(t=>(0,K.jsx)(CS,{className:`${t} h-3`},`${e.id}-${t}`))})})]})]})},e.id))})]})}var TS=(0,G.lazy)(()=>ur(()=>import(`./DetailLanding-D1FLK4EW.js`).then(e=>({default:e.DetailLanding})),__vite__mapDeps([0,1,2,3,4,5,6,7]))),ES=(0,G.lazy)(()=>ur(()=>import(`./OverviewScreen-DX7F_6dH.js`).then(e=>({default:e.OverviewScreen})),__vite__mapDeps([8,1,9,10,2,4,7,6]))),DS=(0,G.lazy)(()=>ur(()=>import(`./Projects-B_7w5TDw.js`).then(e=>({default:e.ProjectsOverview})),__vite__mapDeps([11,1,9,10,2,4,5,7,6,8]))),OS=(0,G.lazy)(()=>ur(()=>import(`./Projects-B_7w5TDw.js`).then(e=>({default:e.ProjectDashboardView})),__vite__mapDeps([11,1,9,10,2,4,5,7,6,8]))),kS=(0,G.lazy)(()=>ur(()=>import(`./SessionDetail-wJYzzF0i.js`).then(e=>({default:e.SessionDetail})),__vite__mapDeps([12,1,10,2,5,7]))),AS=(0,G.lazy)(()=>ur(()=>import(`./SearchResultsPanel-BMBhKuPS.js`).then(e=>({default:e.SearchResultsPanel})),__vite__mapDeps([13,1,2,3,4,5])));function jS({children:e}){Pn();let t=cr();return(0,K.jsx)(yS,{children:(0,K.jsx)(G.Suspense,{fallback:(0,K.jsx)(wS,{}),children:e})},t.pathname)}function MS(e){return e.map(e=>({key:e.name.toLowerCase(),name:e.displayName,icon:e.icon,iconColored:e.iconColored,count:e.count}))}function NS({search:e}){Pn();let t=e.state.status===`loaded`?e.state.results.length:0;return(0,K.jsx)(Yr,{id:`SearchResultsPanel`,detail:{results:t,loading:e.state.status===`loading`},children:(0,K.jsx)(jS,{children:(0,K.jsx)(AS,{query:e.query,state:e.state,agentNameMap:e.agentNameMap,agents:e.agents,projects:e.projectOptions,filters:e.filters,onChangeFilters:e.onChangeFilters,onOpenResult:e.onClose,onRetry:e.onRetry,selectedIndex:e.selectedIndex,registerResultRef:e.registerResultRef})})})}function PS({load:e}){return Pn(),(0,K.jsxs)(`div`,{role:`alert`,className:`mx-auto max-w-4xl rounded-sm border border-[var(--console-error-border)] bg-[var(--console-error-bg)] p-6 text-sm text-[var(--console-error)]`,children:[(0,K.jsx)(`p`,{children:e.error}),(0,K.jsx)(`button`,{type:`button`,onClick:e.retry,className:`console-mono mt-4 rounded-sm border border-[var(--console-error-border)] px-3 py-1.5 text-xs motion-hover hover:bg-[var(--console-surface-muted)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none`,children:W(`Retry`)})]})}function FS({route:e}){return Pn(),(0,K.jsx)(Yr,{id:`OverviewScreen`,detail:{projects:e.projectCount},children:(0,K.jsx)(jS,{children:(0,K.jsx)(ES,{window:e.overview.window,agentCatalog:e.agentCatalog,rangePreset:e.overview.rangePreset,onRangeChange:e.overview.onRangeChange,onSelectCustom:e.overview.onSelectCustom})})})}function IS({route:e}){return Pn(),(0,K.jsx)(jS,{children:(0,K.jsx)(DS,{initialPage:e.projectPage,window:e.window,agentCatalog:e.agentCatalog,loading:e.projectsLoad.loading,error:e.projectsLoad.error,onRetry:e.projectsLoad.retry})})}function LS({route:e}){return Pn(),(0,K.jsx)(jS,{children:(0,K.jsx)(OS,{project:e.project,loading:e.projectLoad.loading,error:e.projectLoad.error,onRetry:e.projectLoad.retry,agentCatalog:e.agentCatalog,projectKey:e.activeProjectKey,sessions:e.sessions,activeAgent:e.agentFilter.selectedAgent,onChangeAgent:e.agentFilter.onChangeAgent,timeWindow:e.overview.window,rangePreset:e.overview.rangePreset,onRangeChange:e.overview.onRangeChange,onSelectCustom:e.overview.onSelectCustom})})}function RS({route:e}){Pn();let t=(0,G.useMemo)(()=>MS(e.agents),[e.agents]),n=e.bookmarks.toggleSessionBookmark,r=(0,G.useCallback)(e=>n(e,e.reference.agentName),[n]);return(0,K.jsx)(jS,{children:(0,K.jsx)(TS,{type:`agent`,agentCatalog:e.agentCatalog,sessions:e.sessions,agentItems:t,activeAgentKey:e.activeAgentKey,isBookmarked:e.bookmarks.isBookmarked,onToggleBookmark:r})})}function zS({route:e}){let t=Pn(),n=(0,G.useMemo)(()=>MS(e.agents),[e.agents]),r=e.detail.session,i=r?.reference.agentName,a=r?.reference.sessionId,o=(0,G.useMemo)(()=>!i||!a?[]:e.childSessionsByParentRouteKey.get(Cn(i,a))??[],[t,e.childSessionsByParentRouteKey,i,a]),s=e.bookmarks.toggleSessionBookmark,c=(0,G.useCallback)(e=>s(e,e.reference.agentName),[s]);return e.detail.loading?(0,K.jsx)(wS,{}):e.detail.error?.kind===`missing`?(0,K.jsx)(jS,{children:(0,K.jsx)(TS,{type:`missing-session`,agentCatalog:e.agentCatalog,sessions:e.sessions,agentItems:n,activeAgentKey:e.activeAgentKey,attemptedSessionId:e.activeSessionId,isBookmarked:e.bookmarks.isBookmarked,onToggleBookmark:c})}):e.detail.error?.kind===`load-failed`?(0,K.jsx)(jS,{children:(0,K.jsx)(TS,{type:`load-failed`,agentCatalog:e.agentCatalog,sessions:e.sessions,agentItems:n,loadFailureMessage:e.detail.error.message,isBookmarked:e.bookmarks.isBookmarked,onToggleBookmark:c,onRetry:e.detail.retry})}):r?(0,K.jsx)(Yr,{id:`SessionDetail`,detail:{messages:r.messages.length,session:r.reference.sessionId},children:(0,K.jsx)(jS,{children:(0,K.jsx)(kS,{session:r,agentCatalog:e.agentCatalog,highlightQuery:e.detailHighlightQuery,childSessions:o},`${r.reference.agentName}/${r.reference.sessionId}`)})}):(0,K.jsx)(wS,{})}function BS({route:e}){Pn();let t=(0,G.useMemo)(()=>MS(e.agents),[e.agents]);return(0,K.jsx)(jS,{children:(0,K.jsx)(TS,{type:`missing-agent`,agentCatalog:e.agentCatalog,sessions:e.sessions,agentItems:t,attemptedAgentKey:e.attemptedKey,isBookmarked:e.bookmarks.isBookmarked,onToggleBookmark:t=>e.bookmarks.toggleSessionBookmark(t,t.reference.agentName)})})}function VS(){return Pn(),(0,K.jsxs)(`div`,{role:`alert`,className:`rounded-md border border-[var(--console-border)] bg-[var(--console-surface)] p-6`,children:[(0,K.jsx)(`h3`,{className:`console-mono mb-2 text-sm font-semibold text-[var(--console-text)]`,children:W(`Page not found`)}),(0,K.jsx)(`p`,{className:`console-mono mb-3 text-xs text-[var(--console-text-secondary)]`,children:W(`This address does not match any dashboard, agent, or session route.`)}),(0,K.jsx)(gr,{to:`/`,className:`console-mono text-xs text-[var(--console-accent)] underline underline-offset-2`,children:W(`Back to dashboard`)})]})}function HS({route:e}){switch(Pn(),e.mode){case`root`:return(0,K.jsx)(FS,{route:e});case`projects`:return(0,K.jsx)(IS,{route:e});case`project`:return(0,K.jsx)(LS,{route:e});case`agent`:return(0,K.jsx)(RS,{route:e});case`session`:return(0,K.jsx)(zS,{route:e});case`missingAgent`:return(0,K.jsx)(BS,{route:e});case`invalidRoute`:return(0,K.jsx)(VS,{})}}function US({load:e,search:t,route:n}){return Pn(),e.loading?(0,K.jsx)(wS,{}):t.active?(0,K.jsx)(NS,{search:t}):e.error?(0,K.jsx)(PS,{load:e}):(0,K.jsx)(HS,{route:n})}var WS=[{value:`7d`,label:`Last 7 days`},{value:`14d`,label:`Last 14 days`},{value:`30d`,label:`Last 30 days`},{value:`90d`,label:`Last 90 days`},{value:`all`,label:`All time`}];function GS({window:e,preset:t,customFrom:n,customTo:r,onSelectPreset:i,onSelectCustom:a}){Pn();let[o,s]=(0,G.useState)(!1),c=$t({window:e}),l=()=>s(!0);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,K.jsxs)(`label`,{className:`relative block`,children:[(0,K.jsx)(`span`,{className:`sr-only`,children:W(`Session time range`)}),(0,K.jsxs)(`select`,{value:t,title:c??W(`Session time range`),onChange:e=>{let t=e.target.value;t===`custom`?l():i(t)},className:`console-mono w-24 appearance-none rounded-full border border-[var(--console-border)] bg-[var(--console-surface)] py-[5px] pr-6 pl-[13px] text-[11px] text-[var(--console-text)] outline-none hover:border-[var(--console-border-strong)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--console-bg)] sm:w-auto sm:max-w-44 sm:pr-7`,children:[WS.map(e=>(0,K.jsx)(`option`,{value:e.value,children:W(e.label)},e.value)),(0,K.jsx)(`option`,{value:`custom`,children:W(`Custom range`)})]}),(0,K.jsx)(`span`,{"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 right-2 -translate-y-1/2 text-[10px] text-[var(--console-muted)]`,children:`▾`})]}),t===`custom`?(0,K.jsx)(`button`,{type:`button`,onClick:l,"aria-label":W(`Edit custom time range`),className:`console-mono motion-hover motion-press rounded-full border border-[var(--brand)] bg-[var(--brand)] px-[13px] py-[5px] text-[11px] text-[var(--brand-fg)] hover:bg-[var(--brand-hover)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--console-bg)]`,children:W(`Edit`)}):null]}),(0,K.jsx)(un,{open:o,onOpenChange:s,window:e,customFrom:n,customTo:r,onSelectCustom:a})]})}var KS=(0,G.forwardRef)(function({onSubmit:e},t){Pn();let[n,r]=(0,G.useState)(``),i=(0,G.useRef)(null);return(0,G.useImperativeHandle)(t,()=>({clear(){r(``)},focusAndSelect(){i.current?.focus(),i.current?.select()}}),[]),(0,K.jsx)(Yr,{id:`SearchControls`,children:(0,K.jsxs)(`form`,{className:`order-3 col-span-2 flex w-full items-center justify-center gap-2 sm:order-none sm:col-span-1 sm:mx-auto sm:max-w-[560px]`,onSubmit:t=>{t.preventDefault(),e(n)},children:[(0,K.jsxs)(`label`,{className:`flex min-w-0 flex-1 items-center rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)] px-2 py-1 focus-within:border-[var(--brand-line)] focus-within:ring-2 focus-within:ring-[var(--brand)]`,children:[(0,K.jsx)(`span`,{className:`sr-only`,children:W(`Search Sessions`)}),(0,K.jsx)(`input`,{ref:i,type:`search`,name:`session-search`,autoComplete:`off`,value:n,onChange:e=>r(e.target.value),placeholder:W(`Search sessions… /`),className:`console-mono w-full min-w-0 bg-transparent text-xs text-[var(--console-text)] outline-none placeholder:text-[var(--console-muted)]`})]}),(0,K.jsx)(`button`,{type:`submit`,className:`console-mono rounded-sm border border-[var(--console-border-strong)] bg-[var(--console-surface-muted)] px-3 py-1 text-xs text-[var(--console-text)] motion-hover hover:bg-[var(--console-surface)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none`,children:W(`Search`)})]})})});function qS(){let{preference:e}=(0,G.useSyncExternalStore)(Fn,In,In);return(0,K.jsxs)(`label`,{className:`console-mono flex shrink-0 items-center gap-1 text-xs text-[var(--console-muted)]`,children:[(0,K.jsx)(`span`,{className:`sr-only`,children:W(`Language`)}),(0,K.jsxs)(`select`,{value:e,onChange:e=>wn(e.target.value),className:`max-w-28 rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)] px-1.5 py-1 text-[var(--console-text)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none`,children:[(0,K.jsx)(`option`,{value:`system`,children:W(`Follow system`)}),(0,K.jsx)(`option`,{value:`zh-CN`,children:`简体中文`}),(0,K.jsx)(`option`,{value:`en`,children:`English`}),(0,K.jsx)(`option`,{value:`ja`,children:`日本語`})]})]})}var JS={light:`dark`,dark:`system`,system:`light`},YS={light:wu,dark:pu,system:fu},XS={light:`Light`,dark:`Dark`,system:`System`};function ZS({theme:e,onChange:t}){Pn();let n=YS[e],r=JS[e];return(0,K.jsx)(`button`,{type:`button`,onClick:()=>t(r),"aria-label":W(`Theme: {0}. Switch to {1}.`,[W(XS[e]),W(XS[r])]),title:W(`Theme: {0} (click for {1})`,[W(XS[e]),W(XS[r])]),className:`console-mono motion-hover motion-press rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)] p-1.5 text-[var(--console-muted)] hover:bg-[var(--console-surface-muted)] hover:text-[var(--console-text)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--console-bg)] focus-visible:outline-none`,children:(0,K.jsx)(n,{"aria-hidden":`true`,className:`size-4`})})}function QS({searchControlsRef:e,onSubmitSearch:t,theme:n,onChangeTheme:r,onShowShortcuts:i,timeWindow:a}){return Pn(),(0,K.jsx)(`header`,{className:`shrink-0 border-b border-[var(--console-border)] bg-[var(--console-surface)]/85 backdrop-blur-sm`,children:(0,K.jsxs)(`div`,{className:`grid min-h-14 grid-cols-[auto_1fr] items-center gap-3 px-4 py-2 sm:grid-cols-[auto_1fr_auto] sm:py-0`,children:[(0,K.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,K.jsxs)(gr,{to:`/`,className:`flex items-center gap-2 text-[var(--console-text)]`,children:[(0,K.jsx)(`img`,{src:`/logo.svg?v=3`,alt:`CodeSesh`,className:`h-6 w-6 rounded-sm`}),(0,K.jsx)(`span`,{className:`console-display text-sm font-semibold uppercase tracking-[0.05em]`,children:`CodeSesh`})]})}),(0,K.jsx)(KS,{ref:e,onSubmit:t}),(0,K.jsxs)(`div`,{className:`flex items-center flex-wrap justify-end gap-2`,children:[(0,K.jsx)(qS,{}),(0,K.jsx)(ZS,{theme:n,onChange:r}),(0,K.jsxs)(`button`,{type:`button`,onClick:i,className:`console-mono rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)] px-2 py-1 text-xs text-[var(--console-text)] motion-hover hover:bg-[var(--console-surface-muted)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none`,title:W(`Show keyboard shortcuts`),children:[`?`,(0,K.jsxs)(`span`,{className:`hidden sm:inline`,children:[` `,W(`Shortcuts`)]})]}),a?(0,K.jsx)(GS,{window:a.value,preset:a.preset,customFrom:a.customFrom,customTo:a.customTo,onSelectPreset:a.onSelectPreset,onSelectCustom:a.onSelectCustom}):null,(0,K.jsxs)(`span`,{className:`console-mono hidden rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2 py-1 text-xs text-[var(--console-muted)] sm:inline-flex`,children:[`v`,`1.0.10`]})]})]})})}function $S(e){return`'${e.replace(/'/g,`'\\''`)}'`}function eC({resumeCommandPrefix:e,sessionId:t,directory:n}){if(!e)return null;let r=`${e} ${$S(t)}`,i=n??``;return i.trim()?`cd ${$S(i)} && ${r}`:r}async function tC(e){if(typeof navigator<`u`&&navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(e),!0}catch{}if(typeof document>`u`)return!1;let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select();let n=!1;try{n=document.execCommand(`copy`)}catch{n=!1}return document.body.removeChild(t),n}function nC({resumeCommandPrefix:e,sessionId:t,directory:n,className:r=``}){Pn();let[i,a]=(0,G.useState)(!1),o=eC({resumeCommandPrefix:e,sessionId:t,directory:n});return(0,G.useEffect)(()=>{if(!i)return;let e=window.setTimeout(()=>a(!1),1500);return()=>window.clearTimeout(e)},[i]),o?(0,K.jsxs)(`button`,{type:`button`,onClick:e=>{e.preventDefault(),e.stopPropagation(),tC(o).then(e=>{e&&a(!0)})},"aria-label":W(i?`Resume command copied: {0}`:`Copy resume command: {0}`,[o]),title:W(i?`Copied: {0}`:`Copy: {0}`,[o]),className:`console-mono motion-hover motion-press inline-flex items-center gap-1.5 rounded-sm border px-2 py-1 text-[11px] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--console-bg)] focus-visible:outline-none ${r} ${i?`border-[var(--positive)] bg-[var(--positive-soft)] text-[var(--positive)]`:`border-[var(--console-border)] bg-[var(--console-surface-muted)] text-[var(--console-muted)] hover:border-[var(--console-border-strong)] hover:text-[var(--console-text)]`}`,children:[i?(0,K.jsx)(Ul,{className:`size-3`,strokeWidth:1.8}):(0,K.jsx)($l,{className:`size-3`,strokeWidth:1.8}),(0,K.jsx)(`span`,{children:W(i?`Copied`:`Copy resume`)}),(0,K.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,children:i?W(`Resume command copied`):``})]}):null}function rC({visible:e}){Pn();let t=No(),n=an(t),r=t?[t.phase,t.scanningAgents[0]??``,t.completedAgents.length,t.totalAgents,t.backfill.active,t.backfill.currentAgent??``,t.backfill.pendingAgents.length,t.backfill.failedAgents.length].join(`|`):null;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:e&&n?`flow-root`:void 0,children:e&&n?(0,K.jsx)(`p`,{title:n,className:`console-mono mt-2 w-fit max-w-full truncate rounded-sm border border-[var(--console-warning-border)] bg-[var(--console-warning-bg)] px-2 py-1 text-[11px] leading-relaxed text-[var(--console-warning)]`,children:n}):null}),(0,K.jsx)(iC,{visible:e,label:n},r??`idle`)]})}function iC({visible:e,label:t}){Pn();let[n]=(0,G.useState)(t);return(0,K.jsx)(`div`,{className:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:e?n:null})}function aC({model:{mobileNavigationOpen:e,sidebarCollapsed:t,route:n,shortcutHintVisible:r,sessionBackHintVisible:i,resumeSession:a,sessionCopyNotice:o,liveNotice:s,scanStatusVisible:c,sessionLoadNotice:l},actions:{onOpenMobileNavigation:u,onExpandSidebar:d,onDismissShortcutHint:f,onRetrySessionLoad:p}}){return Pn(),(0,K.jsxs)(`section`,{className:`flex shrink-0 items-start gap-3 border-b border-[var(--console-border)] bg-[var(--console-surface)]/70 px-4 py-3 backdrop-blur-sm md:px-8`,children:[(0,K.jsx)(`button`,{type:`button`,"aria-expanded":e,"aria-label":W(`Open navigation`),title:W(`Open navigation`),onClick:u,className:`mt-0.5 inline-flex shrink-0 rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)] p-1 text-[var(--console-muted)] motion-hover hover:bg-[var(--console-surface-muted)] hover:text-[var(--console-text)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none min-[1025px]:hidden`,children:(0,K.jsx)(_u,{className:`size-4`})}),t?(0,K.jsx)(`button`,{type:`button`,"aria-expanded":`false`,"aria-label":W(`Expand sidebar`),title:W(`Expand sidebar`),onClick:d,className:`mt-0.5 hidden shrink-0 rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)] p-1 text-[var(--console-muted)] motion-hover hover:bg-[var(--console-surface-muted)] hover:text-[var(--console-text)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none min-[1025px]:inline-flex`,children:(0,K.jsx)(_u,{className:`size-4`})}):null,(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[n.breadcrumbs.length>1?(0,K.jsx)(`nav`,{"aria-label":W(`Breadcrumb`),className:`console-mono mb-2 flex flex-wrap items-center gap-1 text-[11px] text-[var(--console-muted)]`,children:n.breadcrumbs.map((e,t)=>(0,K.jsxs)(`span`,{className:t===n.breadcrumbs.length-2?`flex min-w-0 items-center gap-1`:`hidden min-w-0 items-center gap-1 sm:flex`,children:[e.to?(0,K.jsx)(gr,{to:e.to,className:`truncate motion-hover hover:text-[var(--console-text)]`,children:e.label}):(0,K.jsx)(`span`,{className:`text-[var(--console-text)]`,children:e.label}),t<n.breadcrumbs.length-1?(0,K.jsx)(`span`,{children:`/`}):null]},`${e.label}-${t}`))}):null,(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[n.contextLabel===n.title?null:(0,K.jsx)(`span`,{className:`console-eyebrow hidden shrink-0 rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-1.5 py-0.5 sm:inline-flex`,children:n.contextLabel}),(0,K.jsx)(`h1`,{className:`console-display min-w-0 break-words text-xl font-semibold sm:text-2xl text-[var(--console-text)]`,children:n.title})]}),(0,K.jsx)(`div`,{className:`console-mono mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-[var(--console-muted)]`,children:n.subtitle}),(0,K.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2`,children:[r?(0,K.jsxs)(`div`,{className:`console-mono hidden items-center gap-2 rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2 py-1 text-[11px] text-[var(--console-text)] sm:inline-flex`,children:[(0,K.jsx)(`span`,{children:W(`Keyboard navigation available`)}),(0,K.jsx)(`span`,{className:`rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)] px-1`,children:`?`}),(0,K.jsx)(`button`,{type:`button`,onClick:f,className:`text-[var(--console-muted)] motion-hover hover:text-[var(--console-text)]`,"aria-label":W(`Dismiss keyboard shortcuts hint`),children:`×`})]}):null,i?(0,K.jsx)(`span`,{className:`console-mono hidden rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2 py-1 text-[11px] text-[var(--console-muted)] sm:inline-flex`,children:W(`Esc back`)}):null,a?(0,K.jsx)(nC,{...a}):null]}),(0,K.jsxs)(`div`,{"aria-live":`polite`,children:[o?(0,K.jsx)(`p`,{className:`console-mono mt-2 inline-flex rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2 py-1 text-[11px] text-[var(--console-text)]`,children:o}):null,s?(0,K.jsx)(`p`,{className:`console-mono mt-2 inline-flex rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2 py-1 text-[11px] text-[var(--console-text)]`,children:s}):null]}),(0,K.jsx)(rC,{visible:c}),l?(0,K.jsxs)(`div`,{role:l.error?`alert`:`status`,className:`console-mono mt-2 flex flex-wrap items-center gap-2 rounded-sm border border-[var(--console-warning-border)] bg-[var(--console-warning-bg)] px-2 py-1 text-[11px] text-[var(--console-warning)]`,children:[(0,K.jsx)(`span`,{children:l.error??W(`Loading sessions… Results are not yet complete.`)}),l.error?(0,K.jsx)(`button`,{type:`button`,disabled:l.loading,onClick:p,className:`rounded-sm border border-current px-2 py-1 focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none disabled:opacity-50`,children:W(`Retry session load`)}):null]}):null]})]})}function oC({locationPath:e,mode:t,searchActive:n,sessionCount:r,children:i}){return(0,K.jsx)(`section`,{className:`console-scrollbar bg-grid min-h-0 flex-1 overflow-y-auto px-4 py-6 md:px-8`,children:(0,K.jsx)(yS,{children:(0,K.jsx)(Yr,{id:`MainContent`,detail:{mode:t,search:n,sessions:r},children:i})},e)})}var sC={user:`User`,assistant:`Assistant`,tool:`Tool`};function cC(e,t){let n=t;for(let t of e.matchAll(/`+/g))n=Math.max(n,t[0].length+1);return"`".repeat(n)}function lC(e){let t=e.replace(/\s+/g,` `).trim(),n=cC(t,1),r=t.startsWith("`")||t.endsWith("`");return`${n}${r?` `:``}${t}${r?` `:``}${n}`}function uC(e,t){let n=cC(e,3);return`${n}${t}\n${e}${e.endsWith(`
1411
1411
  `)?``:`
1412
1412
  `}${n}`}function dC(e){if(typeof e==`string`){try{let t=JSON.parse(e);if(typeof t==`object`&&t)return{content:JSON.stringify(t,null,2),language:`json`}}catch{}return{content:e,language:`text`}}try{let t=JSON.stringify(e,null,2);if(t!==void 0)return{content:t,language:`json`}}catch{}return{content:String(e),language:`text`}}function fC(e,t){let{content:n,language:r}=dC(t);return`#### ${e}\n\n${uC(n,r)}`}function pC(e){return(e.title?.trim()||e.tool.trim()||`tool`).replace(/^tool:\s*/i,``)}function mC(e){let t=[`### Tool: ${lC(pC(e))}`,`Status: ${lC(e.state.status)}`];return e.state.input!==void 0&&t.push(fC(`Input`,e.state.input)),e.state.output!==void 0&&e.state.output!==null&&t.push(fC(`Output`,e.state.output)),e.state.error!==void 0&&e.state.error!==null&&t.push(fC(`Error`,e.state.error)),e.state.metadata!==void 0&&e.state.metadata!==null&&t.push(fC(`Metadata`,e.state.metadata)),t.join(`
1413
1413
 
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"><path d="M3 19V5h3l6 8 6-8h3v14h-3V10l-6 8-6-8v9H3Z" fill="currentColor"/></svg>
@@ -11,7 +11,7 @@
11
11
  <title>CodeSesh</title>
12
12
  <script src="/theme-bootstrap.js"></script>
13
13
  <style>:root{--console-bg:#f7f6f3;--console-sidebar-bg:#fbfaf8;--console-surface:#fff;--console-surface-muted:#fbfaf8;--console-surface-sunken:#f1f0ec;--console-border:#e6e4de;--console-text:#16161a;--console-muted:#71707a}.dark{--console-bg:#101012;--console-sidebar-bg:#0b0b0d;--console-surface:#18181b;--console-surface-muted:#1e1e22;--console-surface-sunken:#0b0b0d;--console-border:#2a2a30;--console-text:#f3f2ef;--console-muted:#8e8e98}body{background:var(--console-bg);color:var(--console-text);margin:0;font-family:IBM Plex Sans Variable,IBM Plex Sans,PingFang SC,Hiragino Sans GB,Noto Sans SC,-apple-system,sans-serif}.app-shell{flex-direction:column;height:100vh;display:flex;overflow:hidden}.app-header{border-bottom:1px solid var(--console-border);background:#ffffffd9;grid-template-columns:auto 1fr auto;align-items:center;gap:12px;min-height:56px;padding:0 16px;display:grid}.dark .app-header{background:#18181bd9}.app-brand,.app-search,.app-pill,.app-sidebar-line,.app-card,.app-line{border-radius:6px}.app-brand{letter-spacing:.05em;align-items:center;gap:8px;font:600 13px JetBrains Mono Variable,JetBrains Mono,SFMono-Regular,Menlo,monospace;display:flex}.app-brand img{width:24px;height:24px}.app-search{border:1px solid var(--console-border);background:#fff;max-width:560px;height:28px}.dark .app-search{background:var(--console-surface)}.app-pill{border:1px solid var(--console-border);background:var(--console-surface-muted);width:88px;height:26px}.app-body{flex:1;min-height:0;display:flex}.app-sidebar{border-right:1px solid var(--console-border);background:var(--console-sidebar-bg);width:256px;padding:24px 16px}.app-sidebar-line{background:var(--console-surface-muted);height:26px;margin-bottom:8px}.app-main{flex:1;min-width:0}.app-titlebar{border-bottom:1px solid var(--console-border);background:#ffffffb3;padding:18px 32px}.dark .app-titlebar{background:#18181bb3}.app-title{background:var(--console-surface-muted);border-radius:6px;width:220px;height:24px}.app-content{gap:12px;padding:24px 32px;display:grid}.app-card{border:1px solid var(--console-border);background:#fffc;height:96px;padding:16px}.dark .app-card{background:#18181bcc}.app-line{background:var(--console-surface-muted);height:12px;margin-bottom:12px}.app-line.short{width:46%}@media (width<=1023px){.app-sidebar{display:none}.app-header{grid-template-columns:auto 1fr}.app-pill{display:none}}</style>
14
- <script type="module" crossorigin src="/assets/index-BIpTq_7T.js"></script>
14
+ <script type="module" crossorigin src="/assets/index-DUcpWdzX.js"></script>
15
15
  <link rel="modulepreload" crossorigin href="/assets/jsx-runtime-D3jfb0Ew.js">
16
16
  <link rel="modulepreload" crossorigin href="/assets/DialogTitle-B8zPwJB8.js">
17
17
  <link rel="modulepreload" crossorigin href="/assets/translate-CLoII3EO.js">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codesesh",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "Browse local AI coding-agent sessions in one Web UI.",
5
5
  "keywords": [
6
6
  "ai",