claudedash 1.1.21 → 1.1.23

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 (32) hide show
  1. package/README.md +12 -11
  2. package/dist/cli.js +1 -1
  3. package/dist/core/types.d.ts +1 -0
  4. package/dist/core/types.d.ts.map +1 -1
  5. package/dist/public/404/index.html +1 -1
  6. package/dist/public/404.html +1 -1
  7. package/dist/public/__next.__PAGE__.txt +2 -2
  8. package/dist/public/__next._full.txt +3 -3
  9. package/dist/public/__next._head.txt +1 -1
  10. package/dist/public/__next._index.txt +2 -2
  11. package/dist/public/__next._tree.txt +2 -2
  12. package/dist/public/_next/static/chunks/{4e6e8f15ae4855e7.js → 7670fc6947cf005f.js} +5 -5
  13. package/dist/public/_next/static/chunks/{ca5e0a147fb6f55a.js → 78d1f77be9851162.js} +1 -1
  14. package/dist/public/_next/static/chunks/7b538cfc9523cbc9.css +2 -0
  15. package/dist/public/_not-found/__next._full.txt +2 -2
  16. package/dist/public/_not-found/__next._head.txt +1 -1
  17. package/dist/public/_not-found/__next._index.txt +2 -2
  18. package/dist/public/_not-found/__next._not-found.__PAGE__.txt +1 -1
  19. package/dist/public/_not-found/__next._not-found.txt +1 -1
  20. package/dist/public/_not-found/__next._tree.txt +2 -2
  21. package/dist/public/_not-found/index.html +1 -1
  22. package/dist/public/_not-found/index.txt +2 -2
  23. package/dist/public/index.html +1 -1
  24. package/dist/public/index.txt +3 -3
  25. package/dist/server/routes/live.d.ts.map +1 -1
  26. package/dist/server/routes/live.js +50 -5
  27. package/dist/server/routes/live.js.map +1 -1
  28. package/package.json +1 -1
  29. package/dist/public/_next/static/chunks/6738f2f314ba2080.css +0 -2
  30. /package/dist/public/_next/static/{w2zTveDspeTAIEShNK2C9 → 42Y9bPQWeEWWh1BYF5KDb}/_buildManifest.js +0 -0
  31. /package/dist/public/_next/static/{w2zTveDspeTAIEShNK2C9 → 42Y9bPQWeEWWh1BYF5KDb}/_clientMiddlewareManifest.json +0 -0
  32. /package/dist/public/_next/static/{w2zTveDspeTAIEShNK2C9 → 42Y9bPQWeEWWh1BYF5KDb}/_ssgManifest.js +0 -0
@@ -1,7 +1,7 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,21475,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var s={assign:function(){return i},searchParamsToUrlQuery:function(){return n},urlQueryToSearchParams:function(){return l}};for(var a in s)Object.defineProperty(r,a,{enumerable:!0,get:s[a]});function n(e){let t={};for(let[r,s]of e.entries()){let e=t[r];void 0===e?t[r]=s:Array.isArray(e)?e.push(s):t[r]=[e,s]}return t}function o(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function l(e){let t=new URLSearchParams;for(let[r,s]of Object.entries(e))if(Array.isArray(s))for(let e of s)t.append(r,o(e));else t.set(r,o(s));return t}function i(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,s]of r.entries())e.append(t,s)}return e}},78559,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var s={formatUrl:function(){return l},formatWithValidation:function(){return d},urlObjectKeys:function(){return i}};for(var a in s)Object.defineProperty(r,a,{enumerable:!0,get:s[a]});let n=e.r(87533)._(e.r(21475)),o=/https?|ftp|gopher|file/;function l(e){let{auth:t,hostname:r}=e,s=e.protocol||"",a=e.pathname||"",l=e.hash||"",i=e.query||"",d=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?d=t+e.host:r&&(d=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(d+=":"+e.port)),i&&"object"==typeof i&&(i=String(n.urlQueryToSearchParams(i)));let c=e.search||i&&`?${i}`||"";return s&&!s.endsWith(":")&&(s+=":"),e.slashes||(!s||o.test(s))&&!1!==d?(d="//"+(d||""),a&&"/"!==a[0]&&(a="/"+a)):d||(d=""),l&&"#"!==l[0]&&(l="#"+l),c&&"?"!==c[0]&&(c="?"+c),a=a.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${s}${d}${a}${c}${l}`}let i=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function d(e){return l(e)}},65445,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return a}});let s=e.r(4);function a(e,t){let r=(0,s.useRef)(null),a=(0,s.useRef)(null);return(0,s.useCallback)(s=>{if(null===s){let e=r.current;e&&(r.current=null,e());let t=a.current;t&&(a.current=null,t())}else e&&(r.current=n(e,s)),t&&(a.current=n(t,s))},[e,t])}function n(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},45212,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var s={DecodeError:function(){return g},MiddlewareNotFoundError:function(){return y},MissingStaticPage:function(){return v},NormalizeError:function(){return b},PageNotFoundError:function(){return j},SP:function(){return h},ST:function(){return f},WEB_VITALS:function(){return n},execOnce:function(){return o},getDisplayName:function(){return u},getLocationOrigin:function(){return d},getURL:function(){return c},isAbsoluteUrl:function(){return i},isResSent:function(){return m},loadGetInitialProps:function(){return p},normalizeRepeatedSlashes:function(){return x},stringifyError:function(){return N}};for(var a in s)Object.defineProperty(r,a,{enumerable:!0,get:s[a]});let n=["CLS","FCP","FID","INP","LCP","TTFB"];function o(e){let t,r=!1;return(...s)=>(r||(r=!0,t=e(...s)),t)}let l=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,i=e=>l.test(e);function d(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function c(){let{href:e}=window.location,t=d();return e.substring(t.length)}function u(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function m(e){return e.finished||e.headersSent}function x(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function p(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await p(t.Component,t.ctx)}:{};let s=await e.getInitialProps(t);if(r&&m(r))return s;if(!s)throw Object.defineProperty(Error(`"${u(e)}.getInitialProps()" should resolve to an object. But found "${s}" instead.`),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return s}let h="u">typeof performance,f=h&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class g extends Error{}class b extends Error{}class j extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class v extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class y extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function N(e){return JSON.stringify({message:e.message,stack:e.stack})}},81412,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return n}});let s=e.r(45212),a=e.r(35814);function n(e){if(!(0,s.isAbsoluteUrl)(e))return!0;try{let t=(0,s.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,a.hasBasePath)(r.pathname)}catch(e){return!1}}},44083,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return s}});let s=e=>{}},56640,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var s={default:function(){return g},useLinkStatus:function(){return j}};for(var a in s)Object.defineProperty(r,a,{enumerable:!0,get:s[a]});let n=e.r(87533),o=e.r(27493),l=n._(e.r(4)),i=e.r(78559),d=e.r(94132),c=e.r(65445),u=e.r(45212),m=e.r(43612);e.r(90976);let x=e.r(39271),p=e.r(81412),h=e.r(68714);function f(e){return"string"==typeof e?e:(0,i.formatUrl)(e)}function g(t){var r;let s,a,n,[i,g]=(0,l.useOptimistic)(x.IDLE_LINK_STATUS),j=(0,l.useRef)(null),{href:v,as:y,children:N,prefetch:k=null,passHref:w,replace:C,shallow:S,scroll:E,onClick:z,onMouseEnter:T,onTouchStart:M,legacyBehavior:$=!1,onNavigate:R,ref:D,unstable_dynamicOnHover:A,...L}=t;s=N,$&&("string"==typeof s||"number"==typeof s)&&(s=(0,o.jsx)("a",{children:s}));let P=l.default.useContext(d.AppRouterContext),O=!1!==k,_=!1!==k?null===(r=k)||"auto"===r?h.FetchStrategy.PPR:h.FetchStrategy.Full:h.FetchStrategy.PPR,{href:I,as:U}=l.default.useMemo(()=>{let e=f(v);return{href:e,as:y?f(y):e}},[v,y]);if($){if(s?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});a=l.default.Children.only(s)}let F=$?a&&"object"==typeof a&&a.ref:D,W=l.default.useCallback(e=>(null!==P&&(j.current=(0,x.mountLinkInstance)(e,I,P,_,O,g)),()=>{j.current&&((0,x.unmountLinkForCurrentNavigation)(j.current),j.current=null),(0,x.unmountPrefetchableInstance)(e)}),[O,I,P,_,g]),B={ref:(0,c.useMergedRef)(W,F),onClick(t){$||"function"!=typeof z||z(t),$&&a.props&&"function"==typeof a.props.onClick&&a.props.onClick(t),!P||t.defaultPrevented||function(t,r,s,a,n,o,i){if("u">typeof window){let d,{nodeName:c}=t.currentTarget;if("A"===c.toUpperCase()&&((d=t.currentTarget.getAttribute("target"))&&"_self"!==d||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,p.isLocalURL)(r)){n&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),i){let e=!1;if(i({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:u}=e.r(87046);l.default.startTransition(()=>{u(s||r,n?"replace":"push",o??!0,a.current)})}}(t,I,U,j,C,E,R)},onMouseEnter(e){$||"function"!=typeof T||T(e),$&&a.props&&"function"==typeof a.props.onMouseEnter&&a.props.onMouseEnter(e),P&&O&&(0,x.onNavigationIntent)(e.currentTarget,!0===A)},onTouchStart:function(e){$||"function"!=typeof M||M(e),$&&a.props&&"function"==typeof a.props.onTouchStart&&a.props.onTouchStart(e),P&&O&&(0,x.onNavigationIntent)(e.currentTarget,!0===A)}};return(0,u.isAbsoluteUrl)(U)?B.href=U:$&&!w&&("a"!==a.type||"href"in a.props)||(B.href=(0,m.addBasePath)(U)),n=$?l.default.cloneElement(a,B):(0,o.jsx)("a",{...L,...B,children:s}),(0,o.jsx)(b.Provider,{value:i,children:n})}e.r(44083);let b=(0,l.createContext)(x.IDLE_LINK_STATUS),j=()=>(0,l.useContext)(b);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},23733,e=>{"use strict";var t=e.i(27493),r=e.i(4);let s=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),a=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)};var n={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let o=(0,r.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:o,className:l="",children:i,iconNode:d,...c},u)=>(0,r.createElement)("svg",{ref:u,...n,width:t,height:t,stroke:e,strokeWidth:o?24*Number(a)/Number(t):a,className:s("lucide",l),...!i&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(c)&&{"aria-hidden":"true"},...c},[...d.map(([e,t])=>(0,r.createElement)(e,t)),...Array.isArray(i)?i:[i]])),l=(e,t)=>{let n=(0,r.forwardRef)(({className:n,...l},i)=>(0,r.createElement)(o,{ref:i,iconNode:t,className:s(`lucide-${a(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,n),...l}));return n.displayName=a(e),n},i=l("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),d=l("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),c=l("radio",[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]),u=l("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]),m=l("git-branch",[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]]),x=l("lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]),p=l("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),h=l("panel-left-close",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]),f=l("chart-no-axes-column",[["path",{d:"M5 21v-6",key:"1hz6c0"}],["path",{d:"M12 21V3",key:"1lcnhd"}],["path",{d:"M19 21V9",key:"unv183"}]]),g=l("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),b=l("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),j=l("keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]),v=l("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var y=e.i(4730);let N=l("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]),k=l("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]),w=l("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),C=l("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),S=l("git-commit-horizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]),E=l("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);function z(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function T(...e){return t=>{let r=!1,s=e.map(e=>{let s=z(e,t);return r||"function"!=typeof s||(r=!0),s});if(r)return()=>{for(let t=0;t<s.length;t++){let r=s[t];"function"==typeof r?r():z(e[t],null)}}}}function M(...e){return r.useCallback(T(...e),e)}e.i(9854);var $=Symbol("radix.slottable");function R(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===$}var D=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,s)=>{var a,n;let o,l,i,d=(n=a=`Primitive.${s}`,(o=r.forwardRef((e,t)=>{let{children:s,...a}=e;if(r.isValidElement(s)){var n;let e,o,l=(n=s,(o=(e=Object.getOwnPropertyDescriptor(n.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?n.ref:(o=(e=Object.getOwnPropertyDescriptor(n,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?n.props.ref:n.props.ref||n.ref),i=function(e,t){let r={...t};for(let s in t){let a=e[s],n=t[s];/^on[A-Z]/.test(s)?a&&n?r[s]=(...e)=>{let t=n(...e);return a(...e),t}:a&&(r[s]=a):"style"===s?r[s]={...a,...n}:"className"===s&&(r[s]=[a,n].filter(Boolean).join(" "))}return{...e,...r}}(a,s.props);return s.type!==r.Fragment&&(i.ref=t?T(t,l):l),r.cloneElement(s,i)}return r.Children.count(s)>1?r.Children.only(null):null})).displayName=`${n}.SlotClone`,l=o,(i=r.forwardRef((e,s)=>{let{children:a,...n}=e,o=r.Children.toArray(a),i=o.find(R);if(i){let e=i.props.children,a=o.map(t=>t!==i?t:r.Children.count(e)>1?r.Children.only(null):r.isValidElement(e)?e.props.children:null);return(0,t.jsx)(l,{...n,ref:s,children:r.isValidElement(e)?r.cloneElement(e,void 0,a):null})}return(0,t.jsx)(l,{...n,ref:s,children:a})})).displayName=`${a}.Slot`,i),c=r.forwardRef((e,r)=>{let{asChild:a,...n}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,t.jsx)(a?d:s,{...n,ref:r})});return c.displayName=`Primitive.${s}`,{...e,[s]:c}},{}),A=globalThis?.document?r.useLayoutEffect:()=>{},L=e=>{var t;let s,a,{present:n,children:o}=e,l=function(e){var t,s;let[a,n]=r.useState(),o=r.useRef(null),l=r.useRef(e),i=r.useRef("none"),[d,c]=(t=e?"mounted":"unmounted",s={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},r.useReducer((e,t)=>s[e][t]??e,t));return r.useEffect(()=>{let e=P(o.current);i.current="mounted"===d?e:"none"},[d]),A(()=>{let t=o.current,r=l.current;if(r!==e){let s=i.current,a=P(t);e?c("MOUNT"):"none"===a||t?.display==="none"?c("UNMOUNT"):r&&s!==a?c("ANIMATION_OUT"):c("UNMOUNT"),l.current=e}},[e,c]),A(()=>{if(a){let e,t=a.ownerDocument.defaultView??window,r=r=>{let s=P(o.current).includes(CSS.escape(r.animationName));if(r.target===a&&s&&(c("ANIMATION_END"),!l.current)){let r=a.style.animationFillMode;a.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===a.style.animationFillMode&&(a.style.animationFillMode=r)})}},s=e=>{e.target===a&&(i.current=P(o.current))};return a.addEventListener("animationstart",s),a.addEventListener("animationcancel",r),a.addEventListener("animationend",r),()=>{t.clearTimeout(e),a.removeEventListener("animationstart",s),a.removeEventListener("animationcancel",r),a.removeEventListener("animationend",r)}}c("ANIMATION_END")},[a,c]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:r.useCallback(e=>{o.current=e?getComputedStyle(e):null,n(e)},[])}}(n),i="function"==typeof o?o({present:l.isPresent}):r.Children.only(o),d=M(l.ref,(t=i,(a=(s=Object.getOwnPropertyDescriptor(t.props,"ref")?.get)&&"isReactWarning"in s&&s.isReactWarning)?t.ref:(a=(s=Object.getOwnPropertyDescriptor(t,"ref")?.get)&&"isReactWarning"in s&&s.isReactWarning)?t.props.ref:t.props.ref||t.ref));return"function"==typeof o||l.isPresent?r.cloneElement(i,{ref:d}):null};function P(e){return e?.animationName||"none"}function O(e){let t=r.useRef(e);return r.useEffect(()=>{t.current=e}),r.useMemo(()=>(...e)=>t.current?.(...e),[])}L.displayName="Presence";var _=r.createContext(void 0);function I(e,t,{checkForDefaultPrevented:r=!0}={}){return function(s){if(e?.(s),!1===r||!s.defaultPrevented)return t?.(s)}}"u">typeof window&&window.document&&window.document.createElement;var U="ScrollArea",[F,W]=function(e,s=[]){let a=[],n=()=>{let t=a.map(e=>r.createContext(e));return function(s){let a=s?.[e]||t;return r.useMemo(()=>({[`__scope${e}`]:{...s,[e]:a}}),[s,a])}};return n.scopeName=e,[function(s,n){let o=r.createContext(n),l=a.length;a=[...a,n];let i=s=>{let{scope:a,children:n,...i}=s,d=a?.[e]?.[l]||o,c=r.useMemo(()=>i,Object.values(i));return(0,t.jsx)(d.Provider,{value:c,children:n})};return i.displayName=s+"Provider",[i,function(t,a){let i=a?.[e]?.[l]||o,d=r.useContext(i);if(d)return d;if(void 0!==n)return n;throw Error(`\`${t}\` must be used within \`${s}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let s=()=>{let s=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let a=s.reduce((t,{useScope:r,scopeName:s})=>{let a=r(e)[`__scope${s}`];return{...t,...a}},{});return r.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return s.scopeName=t.scopeName,s}(n,...s)]}(U),[B,q]=F(U),H=r.forwardRef((e,s)=>{let a,{__scopeScrollArea:n,type:o="hover",dir:l,scrollHideDelay:i=600,...d}=e,[c,u]=r.useState(null),[m,x]=r.useState(null),[p,h]=r.useState(null),[f,g]=r.useState(null),[b,j]=r.useState(null),[v,y]=r.useState(0),[N,k]=r.useState(0),[w,C]=r.useState(!1),[S,E]=r.useState(!1),z=M(s,e=>u(e)),T=(a=r.useContext(_),l||a||"ltr");return(0,t.jsx)(B,{scope:n,type:o,dir:T,scrollHideDelay:i,scrollArea:c,viewport:m,onViewportChange:x,content:p,onContentChange:h,scrollbarX:f,onScrollbarXChange:g,scrollbarXEnabled:w,onScrollbarXEnabledChange:C,scrollbarY:b,onScrollbarYChange:j,scrollbarYEnabled:S,onScrollbarYEnabledChange:E,onCornerWidthChange:y,onCornerHeightChange:k,children:(0,t.jsx)(D.div,{dir:T,...d,ref:z,style:{position:"relative","--radix-scroll-area-corner-width":v+"px","--radix-scroll-area-corner-height":N+"px",...e.style}})})});H.displayName=U;var K="ScrollAreaViewport",V=r.forwardRef((e,s)=>{let{__scopeScrollArea:a,children:n,nonce:o,...l}=e,i=q(K,a),d=M(s,r.useRef(null),i.onViewportChange);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),(0,t.jsx)(D.div,{"data-radix-scroll-area-viewport":"",...l,ref:d,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:(0,t.jsx)("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});V.displayName=K;var G="ScrollAreaScrollbar",Y=r.forwardRef((e,s)=>{let{forceMount:a,...n}=e,o=q(G,e.__scopeScrollArea),{onScrollbarXEnabledChange:l,onScrollbarYEnabledChange:i}=o,d="horizontal"===e.orientation;return r.useEffect(()=>(d?l(!0):i(!0),()=>{d?l(!1):i(!1)}),[d,l,i]),"hover"===o.type?(0,t.jsx)(X,{...n,ref:s,forceMount:a}):"scroll"===o.type?(0,t.jsx)(Q,{...n,ref:s,forceMount:a}):"auto"===o.type?(0,t.jsx)(J,{...n,ref:s,forceMount:a}):"always"===o.type?(0,t.jsx)(Z,{...n,ref:s}):null});Y.displayName=G;var X=r.forwardRef((e,s)=>{let{forceMount:a,...n}=e,o=q(G,e.__scopeScrollArea),[l,i]=r.useState(!1);return r.useEffect(()=>{let e=o.scrollArea,t=0;if(e){let r=()=>{window.clearTimeout(t),i(!0)},s=()=>{t=window.setTimeout(()=>i(!1),o.scrollHideDelay)};return e.addEventListener("pointerenter",r),e.addEventListener("pointerleave",s),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",r),e.removeEventListener("pointerleave",s)}}},[o.scrollArea,o.scrollHideDelay]),(0,t.jsx)(L,{present:a||l,children:(0,t.jsx)(J,{"data-state":l?"visible":"hidden",...n,ref:s})})}),Q=r.forwardRef((e,s)=>{var a;let{forceMount:n,...o}=e,l=q(G,e.__scopeScrollArea),i="horizontal"===e.orientation,d=eg(()=>u("SCROLL_END"),100),[c,u]=(a={hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}},r.useReducer((e,t)=>a[e][t]??e,"hidden"));return r.useEffect(()=>{if("idle"===c){let e=window.setTimeout(()=>u("HIDE"),l.scrollHideDelay);return()=>window.clearTimeout(e)}},[c,l.scrollHideDelay,u]),r.useEffect(()=>{let e=l.viewport,t=i?"scrollLeft":"scrollTop";if(e){let r=e[t],s=()=>{let s=e[t];r!==s&&(u("SCROLL"),d()),r=s};return e.addEventListener("scroll",s),()=>e.removeEventListener("scroll",s)}},[l.viewport,i,u,d]),(0,t.jsx)(L,{present:n||"hidden"!==c,children:(0,t.jsx)(Z,{"data-state":"hidden"===c?"hidden":"visible",...o,ref:s,onPointerEnter:I(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:I(e.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),J=r.forwardRef((e,s)=>{let a=q(G,e.__scopeScrollArea),{forceMount:n,...o}=e,[l,i]=r.useState(!1),d="horizontal"===e.orientation,c=eg(()=>{if(a.viewport){let e=a.viewport.offsetWidth<a.viewport.scrollWidth,t=a.viewport.offsetHeight<a.viewport.scrollHeight;i(d?e:t)}},10);return eb(a.viewport,c),eb(a.content,c),(0,t.jsx)(L,{present:n||l,children:(0,t.jsx)(Z,{"data-state":l?"visible":"hidden",...o,ref:s})})}),Z=r.forwardRef((e,s)=>{let{orientation:a="vertical",...n}=e,o=q(G,e.__scopeScrollArea),l=r.useRef(null),i=r.useRef(0),[d,c]=r.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=em(d.viewport,d.content),m={...n,sizes:d,onSizesChange:c,hasThumb:!!(u>0&&u<1),onThumbChange:e=>l.current=e,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:e=>i.current=e};function x(e,t){return function(e,t,r,s="ltr"){let a=ex(r),n=t||a/2,o=r.scrollbar.paddingStart+n,l=r.scrollbar.size-r.scrollbar.paddingEnd-(a-n),i=r.content-r.viewport;return eh([o,l],"ltr"===s?[0,i]:[-1*i,0])(e)}(e,i.current,d,t)}return"horizontal"===a?(0,t.jsx)(ee,{...m,ref:s,onThumbPositionChange:()=>{if(o.viewport&&l.current){let e=ep(o.viewport.scrollLeft,d,o.dir);l.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{o.viewport&&(o.viewport.scrollLeft=e)},onDragScroll:e=>{o.viewport&&(o.viewport.scrollLeft=x(e,o.dir))}}):"vertical"===a?(0,t.jsx)(et,{...m,ref:s,onThumbPositionChange:()=>{if(o.viewport&&l.current){let e=ep(o.viewport.scrollTop,d);l.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{o.viewport&&(o.viewport.scrollTop=e)},onDragScroll:e=>{o.viewport&&(o.viewport.scrollTop=x(e))}}):null}),ee=r.forwardRef((e,s)=>{let{sizes:a,onSizesChange:n,...o}=e,l=q(G,e.__scopeScrollArea),[i,d]=r.useState(),c=r.useRef(null),u=M(s,c,l.onScrollbarXChange);return r.useEffect(()=>{c.current&&d(getComputedStyle(c.current))},[c]),(0,t.jsx)(ea,{"data-orientation":"horizontal",...o,ref:u,sizes:a,style:{bottom:0,left:"rtl"===l.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===l.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":ex(a)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,r)=>{if(l.viewport){var s,a;let n=l.viewport.scrollLeft+t.deltaX;e.onWheelScroll(n),s=n,a=r,s>0&&s<a&&t.preventDefault()}},onResize:()=>{c.current&&l.viewport&&i&&n({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:eu(i.paddingLeft),paddingEnd:eu(i.paddingRight)}})}})}),et=r.forwardRef((e,s)=>{let{sizes:a,onSizesChange:n,...o}=e,l=q(G,e.__scopeScrollArea),[i,d]=r.useState(),c=r.useRef(null),u=M(s,c,l.onScrollbarYChange);return r.useEffect(()=>{c.current&&d(getComputedStyle(c.current))},[c]),(0,t.jsx)(ea,{"data-orientation":"vertical",...o,ref:u,sizes:a,style:{top:0,right:"ltr"===l.dir?0:void 0,left:"rtl"===l.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":ex(a)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,r)=>{if(l.viewport){var s,a;let n=l.viewport.scrollTop+t.deltaY;e.onWheelScroll(n),s=n,a=r,s>0&&s<a&&t.preventDefault()}},onResize:()=>{c.current&&l.viewport&&i&&n({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:eu(i.paddingTop),paddingEnd:eu(i.paddingBottom)}})}})}),[er,es]=F(G),ea=r.forwardRef((e,s)=>{let{__scopeScrollArea:a,sizes:n,hasThumb:o,onThumbChange:l,onThumbPointerUp:i,onThumbPointerDown:d,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:m,onResize:x,...p}=e,h=q(G,a),[f,g]=r.useState(null),b=M(s,e=>g(e)),j=r.useRef(null),v=r.useRef(""),y=h.viewport,N=n.content-n.viewport,k=O(m),w=O(c),C=eg(x,10);function S(e){j.current&&u({x:e.clientX-j.current.left,y:e.clientY-j.current.top})}return r.useEffect(()=>{let e=e=>{let t=e.target;f?.contains(t)&&k(e,N)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[y,f,N,k]),r.useEffect(w,[n,w]),eb(f,C),eb(h.content,C),(0,t.jsx)(er,{scope:a,scrollbar:f,hasThumb:o,onThumbChange:O(l),onThumbPointerUp:O(i),onThumbPositionChange:w,onThumbPointerDown:O(d),children:(0,t.jsx)(D.div,{...p,ref:b,style:{position:"absolute",...p.style},onPointerDown:I(e.onPointerDown,e=>{0===e.button&&(e.target.setPointerCapture(e.pointerId),j.current=f.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),S(e))}),onPointerMove:I(e.onPointerMove,S),onPointerUp:I(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=v.current,h.viewport&&(h.viewport.style.scrollBehavior=""),j.current=null})})})}),en="ScrollAreaThumb",eo=r.forwardRef((e,r)=>{let{forceMount:s,...a}=e,n=es(en,e.__scopeScrollArea);return(0,t.jsx)(L,{present:s||n.hasThumb,children:(0,t.jsx)(el,{ref:r,...a})})}),el=r.forwardRef((e,s)=>{let{__scopeScrollArea:a,style:n,...o}=e,l=q(en,a),i=es(en,a),{onThumbPositionChange:d}=i,c=M(s,e=>i.onThumbChange(e)),u=r.useRef(void 0),m=eg(()=>{u.current&&(u.current(),u.current=void 0)},100);return r.useEffect(()=>{let e=l.viewport;if(e){let t=()=>{m(),u.current||(u.current=ef(e,d),d())};return d(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[l.viewport,m,d]),(0,t.jsx)(D.div,{"data-state":i.hasThumb?"visible":"hidden",...o,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:I(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),r=e.clientX-t.left,s=e.clientY-t.top;i.onThumbPointerDown({x:r,y:s})}),onPointerUp:I(e.onPointerUp,i.onThumbPointerUp)})});eo.displayName=en;var ei="ScrollAreaCorner",ed=r.forwardRef((e,r)=>{let s=q(ei,e.__scopeScrollArea),a=!!(s.scrollbarX&&s.scrollbarY);return"scroll"!==s.type&&a?(0,t.jsx)(ec,{...e,ref:r}):null});ed.displayName=ei;var ec=r.forwardRef((e,s)=>{let{__scopeScrollArea:a,...n}=e,o=q(ei,a),[l,i]=r.useState(0),[d,c]=r.useState(0),u=!!(l&&d);return eb(o.scrollbarX,()=>{let e=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(e),c(e)}),eb(o.scrollbarY,()=>{let e=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(e),i(e)}),u?(0,t.jsx)(D.div,{...n,ref:s,style:{width:l,height:d,position:"absolute",right:"ltr"===o.dir?0:void 0,left:"rtl"===o.dir?0:void 0,bottom:0,...e.style}}):null});function eu(e){return e?parseInt(e,10):0}function em(e,t){let r=e/t;return isNaN(r)?0:r}function ex(e){let t=em(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd;return Math.max((e.scrollbar.size-r)*t,18)}function ep(e,t,r="ltr"){let s=ex(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,n=t.scrollbar.size-a,o=t.content-t.viewport,l=function(e,[t,r]){return Math.min(r,Math.max(t,e))}(e,"ltr"===r?[0,o]:[-1*o,0]);return eh([0,o],[0,n-s])(l)}function eh(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let s=(t[1]-t[0])/(e[1]-e[0]);return t[0]+s*(r-e[0])}}var ef=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},s=0;return!function a(){let n={left:e.scrollLeft,top:e.scrollTop},o=r.left!==n.left,l=r.top!==n.top;(o||l)&&t(),r=n,s=window.requestAnimationFrame(a)}(),()=>window.cancelAnimationFrame(s)};function eg(e,t){let s=O(e),a=r.useRef(0);return r.useEffect(()=>()=>window.clearTimeout(a.current),[]),r.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(s,t)},[s,t])}function eb(e,t){let r=O(t);A(()=>{let t=0;if(e){let s=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(r)});return s.observe(e),()=>{window.cancelAnimationFrame(t),s.unobserve(e)}}},[e,r])}let ej=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),ev=[],ey=(e,t,r)=>{if(0==e.length-t)return r.classGroupId;let s=e[t],a=r.nextPart.get(s);if(a){let r=ey(e,t+1,a);if(r)return r}let n=r.validators;if(null===n)return;let o=0===t?e.join("-"):e.slice(t).join("-"),l=n.length;for(let e=0;e<l;e++){let t=n[e];if(t.validator(o))return t.classGroupId}},eN=(e,t)=>{let r=ej();for(let s in e)ek(e[s],r,s,t);return r},ek=(e,t,r,s)=>{let a=e.length;for(let n=0;n<a;n++)ew(e[n],t,r,s)},ew=(e,t,r,s)=>{"string"==typeof e?eC(e,t,r):"function"==typeof e?eS(e,t,r,s):eE(e,t,r,s)},eC=(e,t,r)=>{(""===e?t:ez(t,e)).classGroupId=r},eS=(e,t,r,s)=>{eT(e)?ek(e(s),t,r,s):(null===t.validators&&(t.validators=[]),t.validators.push({classGroupId:r,validator:e}))},eE=(e,t,r,s)=>{let a=Object.entries(e),n=a.length;for(let e=0;e<n;e++){let[n,o]=a[e];ek(o,ez(t,n),r,s)}},ez=(e,t)=>{let r=e,s=t.split("-"),a=s.length;for(let e=0;e<a;e++){let t=s[e],a=r.nextPart.get(t);a||(a=ej(),r.nextPart.set(t,a)),r=a}return r},eT=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,eM=[],e$=(e,t,r,s,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:s,isExternal:a}),eR=/\s+/,eD=e=>{let t;if("string"==typeof e)return e;let r="";for(let s=0;s<e.length;s++)e[s]&&(t=eD(e[s]))&&(r&&(r+=" "),r+=t);return r},eA=[],eL=e=>{let t=t=>t[e]||eA;return t.isThemeGetter=!0,t},eP=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,eO=/^\((?:(\w[\w-]*):)?(.+)\)$/i,e_=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,eI=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,eU=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,eF=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,eW=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,eB=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,eq=e=>e_.test(e),eH=e=>!!e&&!Number.isNaN(Number(e)),eK=e=>!!e&&Number.isInteger(Number(e)),eV=e=>e.endsWith("%")&&eH(e.slice(0,-1)),eG=e=>eI.test(e),eY=()=>!0,eX=e=>eU.test(e)&&!eF.test(e),eQ=()=>!1,eJ=e=>eW.test(e),eZ=e=>eB.test(e),e0=e=>!e2(e)&&!te(e),e1=e=>ti(e,tm,eQ),e2=e=>eP.test(e),e3=e=>ti(e,tx,eX),e5=e=>ti(e,tp,eH),e4=e=>ti(e,tf,eY),e6=e=>ti(e,th,eQ),e8=e=>ti(e,tc,eQ),e7=e=>ti(e,tu,eZ),e9=e=>ti(e,tg,eJ),te=e=>eO.test(e),tt=e=>td(e,tx),tr=e=>td(e,th),ts=e=>td(e,tc),ta=e=>td(e,tm),tn=e=>td(e,tu),to=e=>td(e,tg,!0),tl=e=>td(e,tf,!0),ti=(e,t,r)=>{let s=eP.exec(e);return!!s&&(s[1]?t(s[1]):r(s[2]))},td=(e,t,r=!1)=>{let s=eO.exec(e);return!!s&&(s[1]?t(s[1]):r)},tc=e=>"position"===e||"percentage"===e,tu=e=>"image"===e||"url"===e,tm=e=>"length"===e||"size"===e||"bg-size"===e,tx=e=>"length"===e,tp=e=>"number"===e,th=e=>"family-name"===e,tf=e=>"number"===e||"weight"===e,tg=e=>"shadow"===e,tb=((e,...t)=>{let r,s,a,n,o=e=>{let t=s(e);if(t)return t;let n=((e,t)=>{let{parseClassName:r,getClassGroupId:s,getConflictingClassGroupIds:a,sortModifiers:n}=t,o=[],l=e.trim().split(eR),i="";for(let e=l.length-1;e>=0;e-=1){let t=l[e],{isExternal:d,modifiers:c,hasImportantModifier:u,baseClassName:m,maybePostfixModifierPosition:x}=r(t);if(d){i=t+(i.length>0?" "+i:i);continue}let p=!!x,h=s(p?m.substring(0,x):m);if(!h){if(!p||!(h=s(m))){i=t+(i.length>0?" "+i:i);continue}p=!1}let f=0===c.length?"":1===c.length?c[0]:n(c).join(":"),g=u?f+"!":f,b=g+h;if(o.indexOf(b)>-1)continue;o.push(b);let j=a(h,p);for(let e=0;e<j.length;++e){let t=j[e];o.push(g+t)}i=t+(i.length>0?" "+i:i)}return i})(e,r);return a(e,n),n};return n=l=>{var i;let d;return s=(r={cache:(e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,r=Object.create(null),s=Object.create(null),a=(a,n)=>{r[a]=n,++t>e&&(t=0,s=r,r=Object.create(null))};return{get(e){let t=r[e];return void 0!==t?t:void 0!==(t=s[e])?(a(e,t),t):void 0},set(e,t){e in r?r[e]=t:a(e,t)}}})((i=t.reduce((e,t)=>t(e),e())).cacheSize),parseClassName:(e=>{let{prefix:t,experimentalParseClassName:r}=e,s=e=>{let t,r=[],s=0,a=0,n=0,o=e.length;for(let l=0;l<o;l++){let o=e[l];if(0===s&&0===a){if(":"===o){r.push(e.slice(n,l)),n=l+1;continue}if("/"===o){t=l;continue}}"["===o?s++:"]"===o?s--:"("===o?a++:")"===o&&a--}let l=0===r.length?e:e.slice(n),i=l,d=!1;return l.endsWith("!")?(i=l.slice(0,-1),d=!0):l.startsWith("!")&&(i=l.slice(1),d=!0),e$(r,d,i,t&&t>n?t-n:void 0)};if(t){let e=t+":",r=s;s=t=>t.startsWith(e)?r(t.slice(e.length)):e$(eM,!1,t,void 0,!0)}if(r){let e=s;s=t=>r({className:t,parseClassName:e})}return s})(i),sortModifiers:(d=new Map,i.orderSensitiveModifiers.forEach((e,t)=>{d.set(e,1e6+t)}),e=>{let t=[],r=[];for(let s=0;s<e.length;s++){let a=e[s],n="["===a[0],o=d.has(a);n||o?(r.length>0&&(r.sort(),t.push(...r),r=[]),t.push(a)):r.push(a)}return r.length>0&&(r.sort(),t.push(...r)),t}),...(e=>{let t=(e=>{let{theme:t,classGroups:r}=e;return eN(r,t)})(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]")){var r;let t,s,a;return -1===(r=e).slice(1,-1).indexOf(":")?void 0:(s=(t=r.slice(1,-1)).indexOf(":"),(a=t.slice(0,s))?"arbitrary.."+a:void 0)}let s=e.split("-"),a=+(""===s[0]&&s.length>1);return ey(s,a,t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=s[e],a=r[e];if(t){if(a){let e=Array(a.length+t.length);for(let t=0;t<a.length;t++)e[t]=a[t];for(let r=0;r<t.length;r++)e[a.length+r]=t[r];return e}return t}return a||ev}return r[e]||ev}}})(i)}).cache.get,a=r.cache.set,n=o,o(l)},(...e)=>n(((...e)=>{let t,r,s=0,a="";for(;s<e.length;)(t=e[s++])&&(r=eD(t))&&(a&&(a+=" "),a+=r);return a})(...e))})(()=>{let e=eL("color"),t=eL("font"),r=eL("text"),s=eL("font-weight"),a=eL("tracking"),n=eL("leading"),o=eL("breakpoint"),l=eL("container"),i=eL("spacing"),d=eL("radius"),c=eL("shadow"),u=eL("inset-shadow"),m=eL("text-shadow"),x=eL("drop-shadow"),p=eL("blur"),h=eL("perspective"),f=eL("aspect"),g=eL("ease"),b=eL("animate"),j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],v=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],y=()=>[...v(),te,e2],N=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],w=()=>[te,e2,i],C=()=>[eq,"full","auto",...w()],S=()=>[eK,"none","subgrid",te,e2],E=()=>["auto",{span:["full",eK,te,e2]},eK,te,e2],z=()=>[eK,"auto",te,e2],T=()=>["auto","min","max","fr",te,e2],M=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],$=()=>["start","end","center","stretch","center-safe","end-safe"],R=()=>["auto",...w()],D=()=>[eq,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],A=()=>[eq,"screen","full","dvw","lvw","svw","min","max","fit",...w()],L=()=>[eq,"screen","full","lh","dvh","lvh","svh","min","max","fit",...w()],P=()=>[e,te,e2],O=()=>[...v(),ts,e8,{position:[te,e2]}],_=()=>["no-repeat",{repeat:["","x","y","space","round"]}],I=()=>["auto","cover","contain",ta,e1,{size:[te,e2]}],U=()=>[eV,tt,e3],F=()=>["","none","full",d,te,e2],W=()=>["",eH,tt,e3],B=()=>["solid","dashed","dotted","double"],q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],H=()=>[eH,eV,ts,e8],K=()=>["","none",p,te,e2],V=()=>["none",eH,te,e2],G=()=>["none",eH,te,e2],Y=()=>[eH,te,e2],X=()=>[eq,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[eG],breakpoint:[eG],color:[eY],container:[eG],"drop-shadow":[eG],ease:["in","out","in-out"],font:[e0],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[eG],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[eG],shadow:[eG],spacing:["px",eH],text:[eG],"text-shadow":[eG],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",eq,e2,te,f]}],container:["container"],columns:[{columns:[eH,e2,te,l]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:y()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:C()}],"inset-x":[{"inset-x":C()}],"inset-y":[{"inset-y":C()}],start:[{"inset-s":C(),start:C()}],end:[{"inset-e":C(),end:C()}],"inset-bs":[{"inset-bs":C()}],"inset-be":[{"inset-be":C()}],top:[{top:C()}],right:[{right:C()}],bottom:[{bottom:C()}],left:[{left:C()}],visibility:["visible","invisible","collapse"],z:[{z:[eK,"auto",te,e2]}],basis:[{basis:[eq,"full","auto",l,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[eH,eq,"auto","initial","none",e2]}],grow:[{grow:["",eH,te,e2]}],shrink:[{shrink:["",eH,te,e2]}],order:[{order:[eK,"first","last","none",te,e2]}],"grid-cols":[{"grid-cols":S()}],"col-start-end":[{col:E()}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":S()}],"row-start-end":[{row:E()}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":T()}],"auto-rows":[{"auto-rows":T()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...M(),"normal"]}],"justify-items":[{"justify-items":[...$(),"normal"]}],"justify-self":[{"justify-self":["auto",...$()]}],"align-content":[{content:["normal",...M()]}],"align-items":[{items:[...$(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...$(),{baseline:["","last"]}]}],"place-content":[{"place-content":M()}],"place-items":[{"place-items":[...$(),"baseline"]}],"place-self":[{"place-self":["auto",...$()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:R()}],mx:[{mx:R()}],my:[{my:R()}],ms:[{ms:R()}],me:[{me:R()}],mbs:[{mbs:R()}],mbe:[{mbe:R()}],mt:[{mt:R()}],mr:[{mr:R()}],mb:[{mb:R()}],ml:[{ml:R()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:D()}],"inline-size":[{inline:["auto",...A()]}],"min-inline-size":[{"min-inline":["auto",...A()]}],"max-inline-size":[{"max-inline":["none",...A()]}],"block-size":[{block:["auto",...L()]}],"min-block-size":[{"min-block":["auto",...L()]}],"max-block-size":[{"max-block":["none",...L()]}],w:[{w:[l,"screen",...D()]}],"min-w":[{"min-w":[l,"screen","none",...D()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...D()]}],h:[{h:["screen","lh",...D()]}],"min-h":[{"min-h":["screen","lh","none",...D()]}],"max-h":[{"max-h":["screen","lh",...D()]}],"font-size":[{text:["base",r,tt,e3]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,tl,e4]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",eV,e2]}],"font-family":[{font:[tr,e6,t]}],"font-features":[{"font-features":[e2]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,te,e2]}],"line-clamp":[{"line-clamp":[eH,"none",te,e5]}],leading:[{leading:[n,...w()]}],"list-image":[{"list-image":["none",te,e2]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",te,e2]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:[eH,"from-font","auto",te,e3]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[eH,"auto",te,e2]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",te,e2]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",te,e2]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:O()}],"bg-repeat":[{bg:_()}],"bg-size":[{bg:I()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},eK,te,e2],radial:["",te,e2],conic:[eK,te,e2]},tn,e7]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:U()}],"gradient-via-pos":[{via:U()}],"gradient-to-pos":[{to:U()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:W()}],"border-w-x":[{"border-x":W()}],"border-w-y":[{"border-y":W()}],"border-w-s":[{"border-s":W()}],"border-w-e":[{"border-e":W()}],"border-w-bs":[{"border-bs":W()}],"border-w-be":[{"border-be":W()}],"border-w-t":[{"border-t":W()}],"border-w-r":[{"border-r":W()}],"border-w-b":[{"border-b":W()}],"border-w-l":[{"border-l":W()}],"divide-x":[{"divide-x":W()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":W()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...B(),"hidden","none"]}],"divide-style":[{divide:[...B(),"hidden","none"]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-bs":[{"border-bs":P()}],"border-color-be":[{"border-be":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...B(),"none","hidden"]}],"outline-offset":[{"outline-offset":[eH,te,e2]}],"outline-w":[{outline:["",eH,tt,e3]}],"outline-color":[{outline:P()}],shadow:[{shadow:["","none",c,to,e9]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":["none",u,to,e9]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:W()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[eH,e3]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":W()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":["none",m,to,e9]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[eH,te,e2]}],"mix-blend":[{"mix-blend":[...q(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":q()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[eH]}],"mask-image-linear-from-pos":[{"mask-linear-from":H()}],"mask-image-linear-to-pos":[{"mask-linear-to":H()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":H()}],"mask-image-t-to-pos":[{"mask-t-to":H()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":H()}],"mask-image-r-to-pos":[{"mask-r-to":H()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":H()}],"mask-image-b-to-pos":[{"mask-b-to":H()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":H()}],"mask-image-l-to-pos":[{"mask-l-to":H()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":H()}],"mask-image-x-to-pos":[{"mask-x-to":H()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":H()}],"mask-image-y-to-pos":[{"mask-y-to":H()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[te,e2]}],"mask-image-radial-from-pos":[{"mask-radial-from":H()}],"mask-image-radial-to-pos":[{"mask-radial-to":H()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":v()}],"mask-image-conic-pos":[{"mask-conic":[eH]}],"mask-image-conic-from-pos":[{"mask-conic-from":H()}],"mask-image-conic-to-pos":[{"mask-conic-to":H()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:O()}],"mask-repeat":[{mask:_()}],"mask-size":[{mask:I()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",te,e2]}],filter:[{filter:["","none",te,e2]}],blur:[{blur:K()}],brightness:[{brightness:[eH,te,e2]}],contrast:[{contrast:[eH,te,e2]}],"drop-shadow":[{"drop-shadow":["","none",x,to,e9]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:["",eH,te,e2]}],"hue-rotate":[{"hue-rotate":[eH,te,e2]}],invert:[{invert:["",eH,te,e2]}],saturate:[{saturate:[eH,te,e2]}],sepia:[{sepia:["",eH,te,e2]}],"backdrop-filter":[{"backdrop-filter":["","none",te,e2]}],"backdrop-blur":[{"backdrop-blur":K()}],"backdrop-brightness":[{"backdrop-brightness":[eH,te,e2]}],"backdrop-contrast":[{"backdrop-contrast":[eH,te,e2]}],"backdrop-grayscale":[{"backdrop-grayscale":["",eH,te,e2]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[eH,te,e2]}],"backdrop-invert":[{"backdrop-invert":["",eH,te,e2]}],"backdrop-opacity":[{"backdrop-opacity":[eH,te,e2]}],"backdrop-saturate":[{"backdrop-saturate":[eH,te,e2]}],"backdrop-sepia":[{"backdrop-sepia":["",eH,te,e2]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",te,e2]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[eH,"initial",te,e2]}],ease:[{ease:["linear","initial",g,te,e2]}],delay:[{delay:[eH,te,e2]}],animate:[{animate:["none",b,te,e2]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[h,te,e2]}],"perspective-origin":[{"perspective-origin":y()}],rotate:[{rotate:V()}],"rotate-x":[{"rotate-x":V()}],"rotate-y":[{"rotate-y":V()}],"rotate-z":[{"rotate-z":V()}],scale:[{scale:G()}],"scale-x":[{"scale-x":G()}],"scale-y":[{"scale-y":G()}],"scale-z":[{"scale-z":G()}],"scale-3d":["scale-3d"],skew:[{skew:Y()}],"skew-x":[{"skew-x":Y()}],"skew-y":[{"skew-y":Y()}],transform:[{transform:[te,e2,"","none","gpu","cpu"]}],"transform-origin":[{origin:y()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:X()}],"translate-x":[{"translate-x":X()}],"translate-y":[{"translate-y":X()}],"translate-z":[{"translate-z":X()}],"translate-none":["translate-none"],accent:[{accent:P()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:P()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",te,e2]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",te,e2]}],fill:[{fill:["none",...P()]}],"stroke-w":[{stroke:[eH,tt,e3,e5]}],stroke:[{stroke:["none",...P()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function tj(...e){return tb(function(){for(var e,t,r=0,s="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=function e(t){var r,s,a="";if("string"==typeof t||"number"==typeof t)a+=t;else if("object"==typeof t)if(Array.isArray(t)){var n=t.length;for(r=0;r<n;r++)t[r]&&(s=e(t[r]))&&(a&&(a+=" "),a+=s)}else for(s in t)t[s]&&(a&&(a+=" "),a+=s);return a}(e))&&(s&&(s+=" "),s+=t);return s}(e))}function tv({className:e,children:r,...s}){return(0,t.jsxs)(H,{"data-slot":"scroll-area",className:tj("relative overflow-hidden",e),...s,children:[(0,t.jsx)(V,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1 !overflow-y-auto [&>div]:!block",children:r}),(0,t.jsx)(ty,{}),(0,t.jsx)(ed,{})]})}function ty({className:e,orientation:r="vertical",...s}){return(0,t.jsx)(Y,{"data-slot":"scroll-area-scrollbar",orientation:r,className:tj("flex touch-none p-px transition-colors select-none","vertical"===r&&"h-full w-2.5 border-l border-l-transparent","horizontal"===r&&"h-2.5 flex-col border-t border-t-transparent",e),...s,children:(0,t.jsx)(eo,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}function tN({lines:e}){let[s,a]=(0,r.useState)(0),[n,o]=(0,r.useState)(0),[l,i]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let t=e[s];if(!l&&n<t.length){let e=setTimeout(()=>o(e=>e+1),40+30*Math.random());return()=>clearTimeout(e)}if(!l&&n===t.length){let e=setTimeout(()=>i(!0),2e3);return()=>clearTimeout(e)}if(l&&n>0){let e=setTimeout(()=>o(e=>e-1),20);return()=>clearTimeout(e)}l&&0===n&&(i(!1),a(t=>(t+1)%e.length))},[n,l,s,e]),(0,t.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,t.jsx)("div",{className:"text-muted-foreground/30 text-4xl font-bold select-none",children:">_"}),(0,t.jsx)("div",{className:"h-8 flex items-center",children:(0,t.jsx)("span",{className:"text-sm text-muted-foreground/60 typing-cursor pr-1",children:e[s].slice(0,n)})})]})}function tk({wt:e,selected:r,onClick:s}){return(0,t.jsxs)("button",{onClick:s,className:`w-full text-left rounded-lg border p-3 transition-colors ${r?"bg-accent border-ring":"bg-card border-border hover:bg-accent/50"}`,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,t.jsx)(m,{className:"size-3.5 text-chart-4 shrink-0"}),(0,t.jsx)("span",{className:"text-sm font-semibold text-foreground truncate font-mono",children:e.worktreeName??e.branch}),e.isClaudeManaged&&(0,t.jsxs)("span",{className:"flex items-center gap-0.5 text-[10px] text-chart-4 bg-chart-4/10 px-1.5 py-0.5 rounded border border-chart-4/20 shrink-0 ml-auto",children:[(0,t.jsx)(E,{className:"size-2.5"}),"claude"]})]}),e.worktreeName&&(0,t.jsx)("div",{className:"text-[11px] text-muted-foreground/50 font-mono truncate mb-0.5",children:e.branch}),(0,t.jsx)("div",{className:"text-[11px] text-muted-foreground/60 font-mono truncate mb-2",children:e.path}),(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[e.dirty?(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[11px] text-chart-3 bg-chart-3/10 px-1.5 py-0.5 rounded",children:[(0,t.jsx)(w,{className:"size-2.5"}),"dirty"]}):(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[11px] text-chart-2 bg-chart-2/10 px-1.5 py-0.5 rounded",children:[(0,t.jsx)(C,{className:"size-2.5"}),"clean"]}),e.aheadCount>0&&(0,t.jsxs)("span",{className:"flex items-center gap-0.5 text-[11px] text-chart-2",children:[(0,t.jsx)(N,{className:"size-2.5"}),e.aheadCount]}),e.behindCount>0&&(0,t.jsxs)("span",{className:"flex items-center gap-0.5 text-[11px] text-chart-5",children:[(0,t.jsx)(k,{className:"size-2.5"}),e.behindCount]}),0===e.aheadCount&&0===e.behindCount&&(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground/40",children:"synced"}),(e.associatedTasks?.length??0)>0&&(0,t.jsxs)("span",{className:"ml-auto text-[11px] bg-chart-4/20 text-chart-4 px-1.5 py-0.5 rounded",children:[e.associatedTasks.length," task",1!==e.associatedTasks.length?"s":""]})]})]})}function tw({wt:e}){return(0,t.jsxs)("div",{className:"h-full flex flex-col",children:[(0,t.jsxs)("div",{className:"px-5 py-4 border-b border-border bg-sidebar/40 shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,t.jsx)(m,{className:"size-4 text-chart-4"}),(0,t.jsx)("span",{className:"text-base font-semibold text-foreground font-mono",children:e.worktreeName??e.branch}),e.isClaudeManaged&&(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[11px] text-chart-4 bg-chart-4/10 px-2 py-0.5 rounded-full border border-chart-4/20",children:[(0,t.jsx)(E,{className:"size-3"}),"Claude-managed"]})]}),e.worktreeName&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground/50 font-mono mb-0.5",children:e.branch}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground/60 font-mono",children:e.path}),(0,t.jsxs)("div",{className:"flex items-center gap-3 mt-3 flex-wrap",children:[e.dirty?(0,t.jsxs)("span",{className:"flex items-center gap-1 text-xs text-chart-3 bg-chart-3/10 px-2 py-0.5 rounded-full border border-chart-3/20",children:[(0,t.jsx)(w,{className:"size-3"}),"Uncommitted changes"]}):(0,t.jsxs)("span",{className:"flex items-center gap-1 text-xs text-chart-2 bg-chart-2/10 px-2 py-0.5 rounded-full border border-chart-2/20",children:[(0,t.jsx)(C,{className:"size-3"}),"Working tree clean"]}),e.aheadCount>0&&(0,t.jsxs)("span",{className:"flex items-center gap-1 text-xs text-chart-2",children:[(0,t.jsx)(N,{className:"size-3"}),e.aheadCount," ahead"]}),e.behindCount>0&&(0,t.jsxs)("span",{className:"flex items-center gap-1 text-xs text-chart-5",children:[(0,t.jsx)(k,{className:"size-3"}),e.behindCount," behind"]})]})]}),(0,t.jsx)(tv,{className:"flex-1",children:(0,t.jsxs)("div",{className:"p-5 space-y-5",children:[e.head&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-2",children:"HEAD Commit"}),(0,t.jsxs)("div",{className:"flex items-center gap-2 bg-card border border-border rounded px-3 py-2",children:[(0,t.jsx)(S,{className:"size-3.5 text-chart-4 shrink-0"}),(0,t.jsx)("code",{className:"text-xs text-chart-4 font-mono",children:e.head.slice(0,12)}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground font-mono",children:e.head})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-2",children:"Full Path"}),(0,t.jsx)("div",{className:"bg-card border border-border rounded px-3 py-2",children:(0,t.jsx)("code",{className:"text-xs text-muted-foreground font-mono break-all",children:e.path})})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-2",children:["Associated Tasks",(e.associatedTasks?.length??0)>0&&(0,t.jsxs)("span",{className:"ml-1.5 text-muted-foreground/40 normal-case",children:["(",e.associatedTasks.length,")"]})]}),(e.associatedTasks?.length??0)===0?(0,t.jsx)("p",{className:"text-xs text-muted-foreground/40 py-2",children:"No tasks associated with this worktree"}):(0,t.jsx)("div",{className:"space-y-2",children:e.associatedTasks.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 p-3 rounded bg-card border border-border",children:[(0,t.jsxs)("span",{className:"font-mono text-xs text-muted-foreground shrink-0",children:["#",e.taskId]}),(0,t.jsx)("span",{className:"text-xs text-foreground truncate flex-1",children:e.taskSubject}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground/40 font-mono shrink-0",children:e.sessionId.slice(0,8)})]},`${e.sessionId}-${e.taskId}`))})]})]})})]})}function tC(){let[e,s]=(0,r.useState)([]),[a,n]=(0,r.useState)(!0),[o,l]=(0,r.useState)(null),[i,c]=(0,r.useState)(null),u=(0,r.useRef)(null),x=async()=>{try{let e=await fetch("/worktrees");if(!e.ok)return;let t=(await e.json()).worktrees??[];s(t),l(new Date),c(e=>e?t.find(t=>t.path===e.path)??t[0]??null:t[0]??null)}catch{}finally{n(!1)}};return(0,r.useEffect)(()=>(x(),u.current=setInterval(x,3e4),()=>{u.current&&clearInterval(u.current)}),[]),(0,t.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden",children:[(0,t.jsxs)("div",{className:"bg-sidebar border-b border-sidebar-border px-4 py-2 flex items-center justify-between shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(m,{className:"size-4 text-muted-foreground"}),(0,t.jsx)("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Git Worktrees"}),e.length>0&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground/60 bg-muted px-1.5 py-0.5 rounded",children:e.length})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[o&&(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground/40",children:o.toLocaleTimeString()}),(0,t.jsx)("button",{onClick:x,className:"p-1 rounded hover:bg-sidebar-accent transition-colors",title:"Refresh worktrees",children:(0,t.jsx)(d,{className:"size-3.5 text-muted-foreground"})})]})]}),a?(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center text-muted-foreground/40 text-xs",children:"Loading..."}):0===e.length?(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center p-8",children:(0,t.jsx)(tN,{lines:["No git worktrees detected","claude --worktree <name>","Creates .claude/worktrees/<name>/ automatically","Run parallel agents in isolated worktrees"]})}):(0,t.jsxs)("div",{className:"flex-1 flex overflow-hidden",children:[(0,t.jsx)("div",{className:"w-72 min-w-[240px] border-r border-border flex flex-col overflow-hidden",children:(0,t.jsx)(tv,{className:"flex-1",children:(0,t.jsx)("div",{className:"p-3 space-y-2",children:e.map(e=>(0,t.jsx)(tk,{wt:e,selected:i?.path===e.path,onClick:()=>c(e)},e.path))})})}),(0,t.jsx)("div",{className:"flex-1 overflow-hidden",children:i?(0,t.jsx)(tw,{wt:i}):(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center text-muted-foreground/40 text-xs",children:"Select a worktree to see details"})})]})]})}let tS=l("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),tE=l("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),tz=l("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);function tT(e){switch(e){case"critical":return"text-chart-5";case"warn":return"text-chart-3";default:return"text-chart-2"}}function tM({level:e}){let r=`size-3.5 ${tT(e)}`;return"critical"===e?(0,t.jsx)(w,{className:r}):"warn"===e?(0,t.jsx)(tz,{className:r}):(0,t.jsx)(C,{className:r})}function t$(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(0)}K`:String(e)}function tR({health:e}){if(!e)return(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground/40",children:"ctx –"});let{percentage:r,warningLevel:s}=e;return(0,t.jsxs)("span",{className:`inline-flex items-center gap-1 text-[10px] font-mono ${tT(s)}`,title:`Context: ${r}% used (${s})
2
- Tokens: ${t$(e.tokensUsed)}${e.maxTokens?` / ${t$(e.maxTokens)}`:""}`,children:[(0,t.jsx)(tM,{level:s}),r,"%"]})}function tD({health:e}){if(!e)return(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground/40",children:[(0,t.jsx)("div",{className:"flex-1 bg-muted rounded-full h-1.5"}),(0,t.jsx)("span",{className:"font-mono shrink-0",children:"–"})]});let{percentage:r,warningLevel:s,tokensUsed:a,maxTokens:n}=e,o=function(e){switch(e){case"critical":return"bg-chart-5";case"warn":return"bg-chart-3";default:return"bg-chart-2"}}(s);return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"flex-1 bg-muted rounded-full h-1.5 overflow-hidden",title:`${r}% context used`,children:(0,t.jsx)("div",{className:`${o} h-1.5 rounded-full transition-all`,style:{width:`${Math.min(100,r)}%`}})}),(0,t.jsxs)("div",{className:`flex items-center gap-1 text-[10px] font-mono shrink-0 ${tT(s)}`,children:[(0,t.jsx)(tM,{level:s}),(0,t.jsxs)("span",{children:[r,"%"]})]})]}),"safe"!==s&&(0,t.jsxs)("div",{className:`flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded ${"critical"===s?"bg-chart-5/10 text-chart-5":"bg-chart-3/10 text-chart-3"}`,children:[(0,t.jsx)(tM,{level:s}),(0,t.jsxs)("span",{children:["critical"===s?"Context critical":"Context warn",n?` \xb7 ${t$(a)} / ${t$(n)}`:""]})]})]})}function tA(e){switch(e){case"DONE":case"completed":return"bg-chart-2/20 text-chart-2";case"FAILED":return"bg-chart-5/20 text-chart-5";case"BLOCKED":return"bg-chart-3/20 text-chart-3";case"READY":case"pending":return"bg-chart-1/20 text-chart-1";case"in_progress":return"bg-chart-4/20 text-chart-4";default:return"bg-muted text-muted-foreground"}}let tL=new Set,tP=new Set,tO=null,t_=!1;function tI(){return tO&&tO.readyState!==EventSource.CLOSED||((tO=new EventSource("/events/")).onopen=()=>{t_=!0,tP.forEach(e=>e(!0))},tO.onerror=()=>{t_=!1,tP.forEach(e=>e(!1))},tO.onmessage=e=>{try{let t=JSON.parse(e.data);tL.forEach(e=>e(t))}catch{}}),tO}function tU(e){let t=(0,r.useRef)(e);(0,r.useEffect)(()=>{t.current=e}),(0,r.useEffect)(()=>{let e=e=>t.current(e);return tL.add(e),tI(),()=>{tL.delete(e)}},[])}function tF(){let[e,t]=(0,r.useState)(t_);return(0,r.useEffect)(()=>(tP.add(t),tI(),()=>{tP.delete(t)}),[]),e}let tW=[];function tB({searchQuery:e,sidebarCollapsed:s}){let a,n,o,[l,i]=(0,r.useState)(!1),{sessions:d,selectedSession:c,setSelectedSession:u,sessionCounts:m}=function(e=!1){let[t,s]=(0,r.useState)([]),[a,n]=(0,r.useState)(null),[o,l]=(0,r.useState)(null),i=(0,r.useRef)(null),d=tF();(0,r.useEffect)(()=>{i.current=a?.id??null},[a]);let c=(0,r.useCallback)(async()=>{try{let t=e?"/sessions?days=all":"/sessions",r=await fetch(t);if(!r.ok)return;let a=await r.json();tW=a.sessions,s(a.sessions),null!=a.total&&l({total:a.total,filtered:a.filtered??a.sessions.length});let o=i.current;if(!o&&a.sessions.length>0)n(a.sessions[0]);else if(o){let e=a.sessions.find(e=>e.id===o);e&&n(e)}}catch{}},[e]);return(0,r.useEffect)(()=>{c()},[c]),tU(e=>{"sessions"===e.type&&c()}),{sessions:t,selectedSession:a,setSelectedSession:n,connected:d,sessionCounts:o}}(l),[x,p]=(0,r.useState)(null),[h,f]=(0,r.useState)(!1),[g,b]=(0,r.useState)(!1),[j,v]=(0,r.useState)(!1),[y,N]=(0,r.useState)(null),k=(0,r.useRef)(null),[w,C]=(0,r.useState)(null),[S,E]=(0,r.useState)([]),[z,T]=(0,r.useState)([]),[M,$]=(0,r.useState)(null),[R,D]=(0,r.useState)(null),A=(0,r.useRef)(new Map);(0,r.useEffect)(()=>{let e=Date.now(),t=A.current,r=e-6e5;for(let s of d){let a=s.tokenUsage?.inputTokens??0;if(a<=0)continue;let n=t.get(s.id)??[];for(n.push({ts:e,tokens:a});n.length>1&&n[0].ts<r;)n.shift();t.set(s.id,n)}},[d]);let L=e=>{let t=A.current.get(e);if(!t||t.length<2)return null;let r=t[0],s=t[t.length-1],a=s.tokens-r.tokens,n=(s.ts-r.ts)/6e4;return n<.25||a<=0?null:a/n};(0,r.useEffect)(()=>{let e=new AbortController,{signal:t}=e;function r(){fetch("/queue",{signal:t}).then(e=>e.ok?e.json():null).then(e=>{e&&!e.errors?.length&&C(e.summary)}).catch(()=>{}),fetch("/agents",{signal:t}).then(e=>e.ok?e.json():null).then(e=>{e?.agents&&E(e.agents)}).catch(()=>{}),fetch("/hook/events",{signal:t}).then(e=>e.ok?e.json():null).then(e=>{if(!e?.events)return;let t=e.events.find(e=>"PreCompact"===e.event||"PostCompact"===e.event);t&&$({at:t.receivedAt,phase:"PreCompact"===t.event?"pre":"post"})}).catch(()=>{})}r();let s=setInterval(r,15e3);return()=>{clearInterval(s),e.abort()}},[]),(0,r.useEffect)(()=>{let e=new AbortController,t=()=>{fetch("/billing-block",{signal:e.signal}).then(e=>e.ok?e.json():null).then(e=>{e&&D(e)}).catch(()=>{})};t();let r=setInterval(t,3e5);return()=>{clearInterval(r),e.abort()}},[]);let P=(0,r.useCallback)(()=>{fetch("/history").then(e=>e.ok?e.json():null).then(e=>{if(!e?.prompts)return;let t=new Map;for(let r of e.prompts){let e=t.get(r.sessionId);(!e||r.timestamp>e.timestamp)&&t.set(r.sessionId,r)}T([...t.values()].sort((e,t)=>t.timestamp.localeCompare(e.timestamp)).slice(0,5).map(e=>({sessionId:e.sessionId,projectName:e.projectName,lastPrompt:e.display,updatedAt:e.timestamp})))}).catch(()=>{})},[]);(0,r.useEffect)(()=>{P()},[P]),tU(e=>{"sessions"===e.type&&P()});let O=`You MUST use the TodoWrite tool to track your work.
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,21475,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var s={assign:function(){return i},searchParamsToUrlQuery:function(){return n},urlQueryToSearchParams:function(){return l}};for(var a in s)Object.defineProperty(r,a,{enumerable:!0,get:s[a]});function n(e){let t={};for(let[r,s]of e.entries()){let e=t[r];void 0===e?t[r]=s:Array.isArray(e)?e.push(s):t[r]=[e,s]}return t}function o(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function l(e){let t=new URLSearchParams;for(let[r,s]of Object.entries(e))if(Array.isArray(s))for(let e of s)t.append(r,o(e));else t.set(r,o(s));return t}function i(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,s]of r.entries())e.append(t,s)}return e}},78559,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var s={formatUrl:function(){return l},formatWithValidation:function(){return d},urlObjectKeys:function(){return i}};for(var a in s)Object.defineProperty(r,a,{enumerable:!0,get:s[a]});let n=e.r(87533)._(e.r(21475)),o=/https?|ftp|gopher|file/;function l(e){let{auth:t,hostname:r}=e,s=e.protocol||"",a=e.pathname||"",l=e.hash||"",i=e.query||"",d=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?d=t+e.host:r&&(d=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(d+=":"+e.port)),i&&"object"==typeof i&&(i=String(n.urlQueryToSearchParams(i)));let c=e.search||i&&`?${i}`||"";return s&&!s.endsWith(":")&&(s+=":"),e.slashes||(!s||o.test(s))&&!1!==d?(d="//"+(d||""),a&&"/"!==a[0]&&(a="/"+a)):d||(d=""),l&&"#"!==l[0]&&(l="#"+l),c&&"?"!==c[0]&&(c="?"+c),a=a.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${s}${d}${a}${c}${l}`}let i=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function d(e){return l(e)}},65445,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return a}});let s=e.r(4);function a(e,t){let r=(0,s.useRef)(null),a=(0,s.useRef)(null);return(0,s.useCallback)(s=>{if(null===s){let e=r.current;e&&(r.current=null,e());let t=a.current;t&&(a.current=null,t())}else e&&(r.current=n(e,s)),t&&(a.current=n(t,s))},[e,t])}function n(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},45212,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var s={DecodeError:function(){return g},MiddlewareNotFoundError:function(){return y},MissingStaticPage:function(){return v},NormalizeError:function(){return b},PageNotFoundError:function(){return j},SP:function(){return h},ST:function(){return f},WEB_VITALS:function(){return n},execOnce:function(){return o},getDisplayName:function(){return u},getLocationOrigin:function(){return d},getURL:function(){return c},isAbsoluteUrl:function(){return i},isResSent:function(){return m},loadGetInitialProps:function(){return p},normalizeRepeatedSlashes:function(){return x},stringifyError:function(){return N}};for(var a in s)Object.defineProperty(r,a,{enumerable:!0,get:s[a]});let n=["CLS","FCP","FID","INP","LCP","TTFB"];function o(e){let t,r=!1;return(...s)=>(r||(r=!0,t=e(...s)),t)}let l=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,i=e=>l.test(e);function d(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function c(){let{href:e}=window.location,t=d();return e.substring(t.length)}function u(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function m(e){return e.finished||e.headersSent}function x(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function p(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await p(t.Component,t.ctx)}:{};let s=await e.getInitialProps(t);if(r&&m(r))return s;if(!s)throw Object.defineProperty(Error(`"${u(e)}.getInitialProps()" should resolve to an object. But found "${s}" instead.`),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return s}let h="u">typeof performance,f=h&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class g extends Error{}class b extends Error{}class j extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class v extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class y extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function N(e){return JSON.stringify({message:e.message,stack:e.stack})}},81412,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return n}});let s=e.r(45212),a=e.r(35814);function n(e){if(!(0,s.isAbsoluteUrl)(e))return!0;try{let t=(0,s.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,a.hasBasePath)(r.pathname)}catch(e){return!1}}},44083,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return s}});let s=e=>{}},56640,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var s={default:function(){return g},useLinkStatus:function(){return j}};for(var a in s)Object.defineProperty(r,a,{enumerable:!0,get:s[a]});let n=e.r(87533),o=e.r(27493),l=n._(e.r(4)),i=e.r(78559),d=e.r(94132),c=e.r(65445),u=e.r(45212),m=e.r(43612);e.r(90976);let x=e.r(39271),p=e.r(81412),h=e.r(68714);function f(e){return"string"==typeof e?e:(0,i.formatUrl)(e)}function g(t){var r;let s,a,n,[i,g]=(0,l.useOptimistic)(x.IDLE_LINK_STATUS),j=(0,l.useRef)(null),{href:v,as:y,children:N,prefetch:k=null,passHref:w,replace:C,shallow:S,scroll:E,onClick:z,onMouseEnter:T,onTouchStart:M,legacyBehavior:$=!1,onNavigate:R,ref:D,unstable_dynamicOnHover:A,...L}=t;s=N,$&&("string"==typeof s||"number"==typeof s)&&(s=(0,o.jsx)("a",{children:s}));let P=l.default.useContext(d.AppRouterContext),O=!1!==k,I=!1!==k?null===(r=k)||"auto"===r?h.FetchStrategy.PPR:h.FetchStrategy.Full:h.FetchStrategy.PPR,{href:_,as:U}=l.default.useMemo(()=>{let e=f(v);return{href:e,as:y?f(y):e}},[v,y]);if($){if(s?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});a=l.default.Children.only(s)}let F=$?a&&"object"==typeof a&&a.ref:D,W=l.default.useCallback(e=>(null!==P&&(j.current=(0,x.mountLinkInstance)(e,_,P,I,O,g)),()=>{j.current&&((0,x.unmountLinkForCurrentNavigation)(j.current),j.current=null),(0,x.unmountPrefetchableInstance)(e)}),[O,_,P,I,g]),B={ref:(0,c.useMergedRef)(W,F),onClick(t){$||"function"!=typeof z||z(t),$&&a.props&&"function"==typeof a.props.onClick&&a.props.onClick(t),!P||t.defaultPrevented||function(t,r,s,a,n,o,i){if("u">typeof window){let d,{nodeName:c}=t.currentTarget;if("A"===c.toUpperCase()&&((d=t.currentTarget.getAttribute("target"))&&"_self"!==d||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,p.isLocalURL)(r)){n&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),i){let e=!1;if(i({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:u}=e.r(87046);l.default.startTransition(()=>{u(s||r,n?"replace":"push",o??!0,a.current)})}}(t,_,U,j,C,E,R)},onMouseEnter(e){$||"function"!=typeof T||T(e),$&&a.props&&"function"==typeof a.props.onMouseEnter&&a.props.onMouseEnter(e),P&&O&&(0,x.onNavigationIntent)(e.currentTarget,!0===A)},onTouchStart:function(e){$||"function"!=typeof M||M(e),$&&a.props&&"function"==typeof a.props.onTouchStart&&a.props.onTouchStart(e),P&&O&&(0,x.onNavigationIntent)(e.currentTarget,!0===A)}};return(0,u.isAbsoluteUrl)(U)?B.href=U:$&&!w&&("a"!==a.type||"href"in a.props)||(B.href=(0,m.addBasePath)(U)),n=$?l.default.cloneElement(a,B):(0,o.jsx)("a",{...L,...B,children:s}),(0,o.jsx)(b.Provider,{value:i,children:n})}e.r(44083);let b=(0,l.createContext)(x.IDLE_LINK_STATUS),j=()=>(0,l.useContext)(b);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},23733,e=>{"use strict";var t=e.i(27493),r=e.i(4);let s=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),a=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)};var n={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let o=(0,r.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:o,className:l="",children:i,iconNode:d,...c},u)=>(0,r.createElement)("svg",{ref:u,...n,width:t,height:t,stroke:e,strokeWidth:o?24*Number(a)/Number(t):a,className:s("lucide",l),...!i&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(c)&&{"aria-hidden":"true"},...c},[...d.map(([e,t])=>(0,r.createElement)(e,t)),...Array.isArray(i)?i:[i]])),l=(e,t)=>{let n=(0,r.forwardRef)(({className:n,...l},i)=>(0,r.createElement)(o,{ref:i,iconNode:t,className:s(`lucide-${a(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,n),...l}));return n.displayName=a(e),n},i=l("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),d=l("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),c=l("radio",[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]),u=l("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]),m=l("git-branch",[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]]),x=l("lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]),p=l("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),h=l("panel-left-close",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]),f=l("chart-no-axes-column",[["path",{d:"M5 21v-6",key:"1hz6c0"}],["path",{d:"M12 21V3",key:"1lcnhd"}],["path",{d:"M19 21V9",key:"unv183"}]]),g=l("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),b=l("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),j=l("keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]),v=l("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var y=e.i(4730);let N=l("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]),k=l("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]),w=l("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),C=l("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),S=l("git-commit-horizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]),E=l("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);function z(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function T(...e){return t=>{let r=!1,s=e.map(e=>{let s=z(e,t);return r||"function"!=typeof s||(r=!0),s});if(r)return()=>{for(let t=0;t<s.length;t++){let r=s[t];"function"==typeof r?r():z(e[t],null)}}}}function M(...e){return r.useCallback(T(...e),e)}e.i(9854);var $=Symbol("radix.slottable");function R(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===$}var D=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,s)=>{var a,n;let o,l,i,d=(n=a=`Primitive.${s}`,(o=r.forwardRef((e,t)=>{let{children:s,...a}=e;if(r.isValidElement(s)){var n;let e,o,l=(n=s,(o=(e=Object.getOwnPropertyDescriptor(n.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?n.ref:(o=(e=Object.getOwnPropertyDescriptor(n,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?n.props.ref:n.props.ref||n.ref),i=function(e,t){let r={...t};for(let s in t){let a=e[s],n=t[s];/^on[A-Z]/.test(s)?a&&n?r[s]=(...e)=>{let t=n(...e);return a(...e),t}:a&&(r[s]=a):"style"===s?r[s]={...a,...n}:"className"===s&&(r[s]=[a,n].filter(Boolean).join(" "))}return{...e,...r}}(a,s.props);return s.type!==r.Fragment&&(i.ref=t?T(t,l):l),r.cloneElement(s,i)}return r.Children.count(s)>1?r.Children.only(null):null})).displayName=`${n}.SlotClone`,l=o,(i=r.forwardRef((e,s)=>{let{children:a,...n}=e,o=r.Children.toArray(a),i=o.find(R);if(i){let e=i.props.children,a=o.map(t=>t!==i?t:r.Children.count(e)>1?r.Children.only(null):r.isValidElement(e)?e.props.children:null);return(0,t.jsx)(l,{...n,ref:s,children:r.isValidElement(e)?r.cloneElement(e,void 0,a):null})}return(0,t.jsx)(l,{...n,ref:s,children:a})})).displayName=`${a}.Slot`,i),c=r.forwardRef((e,r)=>{let{asChild:a,...n}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,t.jsx)(a?d:s,{...n,ref:r})});return c.displayName=`Primitive.${s}`,{...e,[s]:c}},{}),A=globalThis?.document?r.useLayoutEffect:()=>{},L=e=>{var t;let s,a,{present:n,children:o}=e,l=function(e){var t,s;let[a,n]=r.useState(),o=r.useRef(null),l=r.useRef(e),i=r.useRef("none"),[d,c]=(t=e?"mounted":"unmounted",s={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},r.useReducer((e,t)=>s[e][t]??e,t));return r.useEffect(()=>{let e=P(o.current);i.current="mounted"===d?e:"none"},[d]),A(()=>{let t=o.current,r=l.current;if(r!==e){let s=i.current,a=P(t);e?c("MOUNT"):"none"===a||t?.display==="none"?c("UNMOUNT"):r&&s!==a?c("ANIMATION_OUT"):c("UNMOUNT"),l.current=e}},[e,c]),A(()=>{if(a){let e,t=a.ownerDocument.defaultView??window,r=r=>{let s=P(o.current).includes(CSS.escape(r.animationName));if(r.target===a&&s&&(c("ANIMATION_END"),!l.current)){let r=a.style.animationFillMode;a.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===a.style.animationFillMode&&(a.style.animationFillMode=r)})}},s=e=>{e.target===a&&(i.current=P(o.current))};return a.addEventListener("animationstart",s),a.addEventListener("animationcancel",r),a.addEventListener("animationend",r),()=>{t.clearTimeout(e),a.removeEventListener("animationstart",s),a.removeEventListener("animationcancel",r),a.removeEventListener("animationend",r)}}c("ANIMATION_END")},[a,c]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:r.useCallback(e=>{o.current=e?getComputedStyle(e):null,n(e)},[])}}(n),i="function"==typeof o?o({present:l.isPresent}):r.Children.only(o),d=M(l.ref,(t=i,(a=(s=Object.getOwnPropertyDescriptor(t.props,"ref")?.get)&&"isReactWarning"in s&&s.isReactWarning)?t.ref:(a=(s=Object.getOwnPropertyDescriptor(t,"ref")?.get)&&"isReactWarning"in s&&s.isReactWarning)?t.props.ref:t.props.ref||t.ref));return"function"==typeof o||l.isPresent?r.cloneElement(i,{ref:d}):null};function P(e){return e?.animationName||"none"}function O(e){let t=r.useRef(e);return r.useEffect(()=>{t.current=e}),r.useMemo(()=>(...e)=>t.current?.(...e),[])}L.displayName="Presence";var I=r.createContext(void 0);function _(e,t,{checkForDefaultPrevented:r=!0}={}){return function(s){if(e?.(s),!1===r||!s.defaultPrevented)return t?.(s)}}"u">typeof window&&window.document&&window.document.createElement;var U="ScrollArea",[F,W]=function(e,s=[]){let a=[],n=()=>{let t=a.map(e=>r.createContext(e));return function(s){let a=s?.[e]||t;return r.useMemo(()=>({[`__scope${e}`]:{...s,[e]:a}}),[s,a])}};return n.scopeName=e,[function(s,n){let o=r.createContext(n),l=a.length;a=[...a,n];let i=s=>{let{scope:a,children:n,...i}=s,d=a?.[e]?.[l]||o,c=r.useMemo(()=>i,Object.values(i));return(0,t.jsx)(d.Provider,{value:c,children:n})};return i.displayName=s+"Provider",[i,function(t,a){let i=a?.[e]?.[l]||o,d=r.useContext(i);if(d)return d;if(void 0!==n)return n;throw Error(`\`${t}\` must be used within \`${s}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let s=()=>{let s=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let a=s.reduce((t,{useScope:r,scopeName:s})=>{let a=r(e)[`__scope${s}`];return{...t,...a}},{});return r.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return s.scopeName=t.scopeName,s}(n,...s)]}(U),[B,q]=F(U),H=r.forwardRef((e,s)=>{let a,{__scopeScrollArea:n,type:o="hover",dir:l,scrollHideDelay:i=600,...d}=e,[c,u]=r.useState(null),[m,x]=r.useState(null),[p,h]=r.useState(null),[f,g]=r.useState(null),[b,j]=r.useState(null),[v,y]=r.useState(0),[N,k]=r.useState(0),[w,C]=r.useState(!1),[S,E]=r.useState(!1),z=M(s,e=>u(e)),T=(a=r.useContext(I),l||a||"ltr");return(0,t.jsx)(B,{scope:n,type:o,dir:T,scrollHideDelay:i,scrollArea:c,viewport:m,onViewportChange:x,content:p,onContentChange:h,scrollbarX:f,onScrollbarXChange:g,scrollbarXEnabled:w,onScrollbarXEnabledChange:C,scrollbarY:b,onScrollbarYChange:j,scrollbarYEnabled:S,onScrollbarYEnabledChange:E,onCornerWidthChange:y,onCornerHeightChange:k,children:(0,t.jsx)(D.div,{dir:T,...d,ref:z,style:{position:"relative","--radix-scroll-area-corner-width":v+"px","--radix-scroll-area-corner-height":N+"px",...e.style}})})});H.displayName=U;var K="ScrollAreaViewport",V=r.forwardRef((e,s)=>{let{__scopeScrollArea:a,children:n,nonce:o,...l}=e,i=q(K,a),d=M(s,r.useRef(null),i.onViewportChange);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),(0,t.jsx)(D.div,{"data-radix-scroll-area-viewport":"",...l,ref:d,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:(0,t.jsx)("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});V.displayName=K;var G="ScrollAreaScrollbar",Y=r.forwardRef((e,s)=>{let{forceMount:a,...n}=e,o=q(G,e.__scopeScrollArea),{onScrollbarXEnabledChange:l,onScrollbarYEnabledChange:i}=o,d="horizontal"===e.orientation;return r.useEffect(()=>(d?l(!0):i(!0),()=>{d?l(!1):i(!1)}),[d,l,i]),"hover"===o.type?(0,t.jsx)(X,{...n,ref:s,forceMount:a}):"scroll"===o.type?(0,t.jsx)(Q,{...n,ref:s,forceMount:a}):"auto"===o.type?(0,t.jsx)(J,{...n,ref:s,forceMount:a}):"always"===o.type?(0,t.jsx)(Z,{...n,ref:s}):null});Y.displayName=G;var X=r.forwardRef((e,s)=>{let{forceMount:a,...n}=e,o=q(G,e.__scopeScrollArea),[l,i]=r.useState(!1);return r.useEffect(()=>{let e=o.scrollArea,t=0;if(e){let r=()=>{window.clearTimeout(t),i(!0)},s=()=>{t=window.setTimeout(()=>i(!1),o.scrollHideDelay)};return e.addEventListener("pointerenter",r),e.addEventListener("pointerleave",s),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",r),e.removeEventListener("pointerleave",s)}}},[o.scrollArea,o.scrollHideDelay]),(0,t.jsx)(L,{present:a||l,children:(0,t.jsx)(J,{"data-state":l?"visible":"hidden",...n,ref:s})})}),Q=r.forwardRef((e,s)=>{var a;let{forceMount:n,...o}=e,l=q(G,e.__scopeScrollArea),i="horizontal"===e.orientation,d=eg(()=>u("SCROLL_END"),100),[c,u]=(a={hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}},r.useReducer((e,t)=>a[e][t]??e,"hidden"));return r.useEffect(()=>{if("idle"===c){let e=window.setTimeout(()=>u("HIDE"),l.scrollHideDelay);return()=>window.clearTimeout(e)}},[c,l.scrollHideDelay,u]),r.useEffect(()=>{let e=l.viewport,t=i?"scrollLeft":"scrollTop";if(e){let r=e[t],s=()=>{let s=e[t];r!==s&&(u("SCROLL"),d()),r=s};return e.addEventListener("scroll",s),()=>e.removeEventListener("scroll",s)}},[l.viewport,i,u,d]),(0,t.jsx)(L,{present:n||"hidden"!==c,children:(0,t.jsx)(Z,{"data-state":"hidden"===c?"hidden":"visible",...o,ref:s,onPointerEnter:_(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:_(e.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),J=r.forwardRef((e,s)=>{let a=q(G,e.__scopeScrollArea),{forceMount:n,...o}=e,[l,i]=r.useState(!1),d="horizontal"===e.orientation,c=eg(()=>{if(a.viewport){let e=a.viewport.offsetWidth<a.viewport.scrollWidth,t=a.viewport.offsetHeight<a.viewport.scrollHeight;i(d?e:t)}},10);return eb(a.viewport,c),eb(a.content,c),(0,t.jsx)(L,{present:n||l,children:(0,t.jsx)(Z,{"data-state":l?"visible":"hidden",...o,ref:s})})}),Z=r.forwardRef((e,s)=>{let{orientation:a="vertical",...n}=e,o=q(G,e.__scopeScrollArea),l=r.useRef(null),i=r.useRef(0),[d,c]=r.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=em(d.viewport,d.content),m={...n,sizes:d,onSizesChange:c,hasThumb:!!(u>0&&u<1),onThumbChange:e=>l.current=e,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:e=>i.current=e};function x(e,t){return function(e,t,r,s="ltr"){let a=ex(r),n=t||a/2,o=r.scrollbar.paddingStart+n,l=r.scrollbar.size-r.scrollbar.paddingEnd-(a-n),i=r.content-r.viewport;return eh([o,l],"ltr"===s?[0,i]:[-1*i,0])(e)}(e,i.current,d,t)}return"horizontal"===a?(0,t.jsx)(ee,{...m,ref:s,onThumbPositionChange:()=>{if(o.viewport&&l.current){let e=ep(o.viewport.scrollLeft,d,o.dir);l.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{o.viewport&&(o.viewport.scrollLeft=e)},onDragScroll:e=>{o.viewport&&(o.viewport.scrollLeft=x(e,o.dir))}}):"vertical"===a?(0,t.jsx)(et,{...m,ref:s,onThumbPositionChange:()=>{if(o.viewport&&l.current){let e=ep(o.viewport.scrollTop,d);l.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{o.viewport&&(o.viewport.scrollTop=e)},onDragScroll:e=>{o.viewport&&(o.viewport.scrollTop=x(e))}}):null}),ee=r.forwardRef((e,s)=>{let{sizes:a,onSizesChange:n,...o}=e,l=q(G,e.__scopeScrollArea),[i,d]=r.useState(),c=r.useRef(null),u=M(s,c,l.onScrollbarXChange);return r.useEffect(()=>{c.current&&d(getComputedStyle(c.current))},[c]),(0,t.jsx)(ea,{"data-orientation":"horizontal",...o,ref:u,sizes:a,style:{bottom:0,left:"rtl"===l.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===l.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":ex(a)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,r)=>{if(l.viewport){var s,a;let n=l.viewport.scrollLeft+t.deltaX;e.onWheelScroll(n),s=n,a=r,s>0&&s<a&&t.preventDefault()}},onResize:()=>{c.current&&l.viewport&&i&&n({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:eu(i.paddingLeft),paddingEnd:eu(i.paddingRight)}})}})}),et=r.forwardRef((e,s)=>{let{sizes:a,onSizesChange:n,...o}=e,l=q(G,e.__scopeScrollArea),[i,d]=r.useState(),c=r.useRef(null),u=M(s,c,l.onScrollbarYChange);return r.useEffect(()=>{c.current&&d(getComputedStyle(c.current))},[c]),(0,t.jsx)(ea,{"data-orientation":"vertical",...o,ref:u,sizes:a,style:{top:0,right:"ltr"===l.dir?0:void 0,left:"rtl"===l.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":ex(a)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,r)=>{if(l.viewport){var s,a;let n=l.viewport.scrollTop+t.deltaY;e.onWheelScroll(n),s=n,a=r,s>0&&s<a&&t.preventDefault()}},onResize:()=>{c.current&&l.viewport&&i&&n({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:eu(i.paddingTop),paddingEnd:eu(i.paddingBottom)}})}})}),[er,es]=F(G),ea=r.forwardRef((e,s)=>{let{__scopeScrollArea:a,sizes:n,hasThumb:o,onThumbChange:l,onThumbPointerUp:i,onThumbPointerDown:d,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:m,onResize:x,...p}=e,h=q(G,a),[f,g]=r.useState(null),b=M(s,e=>g(e)),j=r.useRef(null),v=r.useRef(""),y=h.viewport,N=n.content-n.viewport,k=O(m),w=O(c),C=eg(x,10);function S(e){j.current&&u({x:e.clientX-j.current.left,y:e.clientY-j.current.top})}return r.useEffect(()=>{let e=e=>{let t=e.target;f?.contains(t)&&k(e,N)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[y,f,N,k]),r.useEffect(w,[n,w]),eb(f,C),eb(h.content,C),(0,t.jsx)(er,{scope:a,scrollbar:f,hasThumb:o,onThumbChange:O(l),onThumbPointerUp:O(i),onThumbPositionChange:w,onThumbPointerDown:O(d),children:(0,t.jsx)(D.div,{...p,ref:b,style:{position:"absolute",...p.style},onPointerDown:_(e.onPointerDown,e=>{0===e.button&&(e.target.setPointerCapture(e.pointerId),j.current=f.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),S(e))}),onPointerMove:_(e.onPointerMove,S),onPointerUp:_(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=v.current,h.viewport&&(h.viewport.style.scrollBehavior=""),j.current=null})})})}),en="ScrollAreaThumb",eo=r.forwardRef((e,r)=>{let{forceMount:s,...a}=e,n=es(en,e.__scopeScrollArea);return(0,t.jsx)(L,{present:s||n.hasThumb,children:(0,t.jsx)(el,{ref:r,...a})})}),el=r.forwardRef((e,s)=>{let{__scopeScrollArea:a,style:n,...o}=e,l=q(en,a),i=es(en,a),{onThumbPositionChange:d}=i,c=M(s,e=>i.onThumbChange(e)),u=r.useRef(void 0),m=eg(()=>{u.current&&(u.current(),u.current=void 0)},100);return r.useEffect(()=>{let e=l.viewport;if(e){let t=()=>{m(),u.current||(u.current=ef(e,d),d())};return d(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[l.viewport,m,d]),(0,t.jsx)(D.div,{"data-state":i.hasThumb?"visible":"hidden",...o,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:_(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),r=e.clientX-t.left,s=e.clientY-t.top;i.onThumbPointerDown({x:r,y:s})}),onPointerUp:_(e.onPointerUp,i.onThumbPointerUp)})});eo.displayName=en;var ei="ScrollAreaCorner",ed=r.forwardRef((e,r)=>{let s=q(ei,e.__scopeScrollArea),a=!!(s.scrollbarX&&s.scrollbarY);return"scroll"!==s.type&&a?(0,t.jsx)(ec,{...e,ref:r}):null});ed.displayName=ei;var ec=r.forwardRef((e,s)=>{let{__scopeScrollArea:a,...n}=e,o=q(ei,a),[l,i]=r.useState(0),[d,c]=r.useState(0),u=!!(l&&d);return eb(o.scrollbarX,()=>{let e=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(e),c(e)}),eb(o.scrollbarY,()=>{let e=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(e),i(e)}),u?(0,t.jsx)(D.div,{...n,ref:s,style:{width:l,height:d,position:"absolute",right:"ltr"===o.dir?0:void 0,left:"rtl"===o.dir?0:void 0,bottom:0,...e.style}}):null});function eu(e){return e?parseInt(e,10):0}function em(e,t){let r=e/t;return isNaN(r)?0:r}function ex(e){let t=em(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd;return Math.max((e.scrollbar.size-r)*t,18)}function ep(e,t,r="ltr"){let s=ex(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,n=t.scrollbar.size-a,o=t.content-t.viewport,l=function(e,[t,r]){return Math.min(r,Math.max(t,e))}(e,"ltr"===r?[0,o]:[-1*o,0]);return eh([0,o],[0,n-s])(l)}function eh(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let s=(t[1]-t[0])/(e[1]-e[0]);return t[0]+s*(r-e[0])}}var ef=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},s=0;return!function a(){let n={left:e.scrollLeft,top:e.scrollTop},o=r.left!==n.left,l=r.top!==n.top;(o||l)&&t(),r=n,s=window.requestAnimationFrame(a)}(),()=>window.cancelAnimationFrame(s)};function eg(e,t){let s=O(e),a=r.useRef(0);return r.useEffect(()=>()=>window.clearTimeout(a.current),[]),r.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(s,t)},[s,t])}function eb(e,t){let r=O(t);A(()=>{let t=0;if(e){let s=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(r)});return s.observe(e),()=>{window.cancelAnimationFrame(t),s.unobserve(e)}}},[e,r])}let ej=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),ev=[],ey=(e,t,r)=>{if(0==e.length-t)return r.classGroupId;let s=e[t],a=r.nextPart.get(s);if(a){let r=ey(e,t+1,a);if(r)return r}let n=r.validators;if(null===n)return;let o=0===t?e.join("-"):e.slice(t).join("-"),l=n.length;for(let e=0;e<l;e++){let t=n[e];if(t.validator(o))return t.classGroupId}},eN=(e,t)=>{let r=ej();for(let s in e)ek(e[s],r,s,t);return r},ek=(e,t,r,s)=>{let a=e.length;for(let n=0;n<a;n++)ew(e[n],t,r,s)},ew=(e,t,r,s)=>{"string"==typeof e?eC(e,t,r):"function"==typeof e?eS(e,t,r,s):eE(e,t,r,s)},eC=(e,t,r)=>{(""===e?t:ez(t,e)).classGroupId=r},eS=(e,t,r,s)=>{eT(e)?ek(e(s),t,r,s):(null===t.validators&&(t.validators=[]),t.validators.push({classGroupId:r,validator:e}))},eE=(e,t,r,s)=>{let a=Object.entries(e),n=a.length;for(let e=0;e<n;e++){let[n,o]=a[e];ek(o,ez(t,n),r,s)}},ez=(e,t)=>{let r=e,s=t.split("-"),a=s.length;for(let e=0;e<a;e++){let t=s[e],a=r.nextPart.get(t);a||(a=ej(),r.nextPart.set(t,a)),r=a}return r},eT=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,eM=[],e$=(e,t,r,s,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:s,isExternal:a}),eR=/\s+/,eD=e=>{let t;if("string"==typeof e)return e;let r="";for(let s=0;s<e.length;s++)e[s]&&(t=eD(e[s]))&&(r&&(r+=" "),r+=t);return r},eA=[],eL=e=>{let t=t=>t[e]||eA;return t.isThemeGetter=!0,t},eP=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,eO=/^\((?:(\w[\w-]*):)?(.+)\)$/i,eI=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,e_=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,eU=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,eF=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,eW=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,eB=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,eq=e=>eI.test(e),eH=e=>!!e&&!Number.isNaN(Number(e)),eK=e=>!!e&&Number.isInteger(Number(e)),eV=e=>e.endsWith("%")&&eH(e.slice(0,-1)),eG=e=>e_.test(e),eY=()=>!0,eX=e=>eU.test(e)&&!eF.test(e),eQ=()=>!1,eJ=e=>eW.test(e),eZ=e=>eB.test(e),e0=e=>!e2(e)&&!te(e),e1=e=>ti(e,tm,eQ),e2=e=>eP.test(e),e3=e=>ti(e,tx,eX),e5=e=>ti(e,tp,eH),e4=e=>ti(e,tf,eY),e6=e=>ti(e,th,eQ),e8=e=>ti(e,tc,eQ),e7=e=>ti(e,tu,eZ),e9=e=>ti(e,tg,eJ),te=e=>eO.test(e),tt=e=>td(e,tx),tr=e=>td(e,th),ts=e=>td(e,tc),ta=e=>td(e,tm),tn=e=>td(e,tu),to=e=>td(e,tg,!0),tl=e=>td(e,tf,!0),ti=(e,t,r)=>{let s=eP.exec(e);return!!s&&(s[1]?t(s[1]):r(s[2]))},td=(e,t,r=!1)=>{let s=eO.exec(e);return!!s&&(s[1]?t(s[1]):r)},tc=e=>"position"===e||"percentage"===e,tu=e=>"image"===e||"url"===e,tm=e=>"length"===e||"size"===e||"bg-size"===e,tx=e=>"length"===e,tp=e=>"number"===e,th=e=>"family-name"===e,tf=e=>"number"===e||"weight"===e,tg=e=>"shadow"===e,tb=((e,...t)=>{let r,s,a,n,o=e=>{let t=s(e);if(t)return t;let n=((e,t)=>{let{parseClassName:r,getClassGroupId:s,getConflictingClassGroupIds:a,sortModifiers:n}=t,o=[],l=e.trim().split(eR),i="";for(let e=l.length-1;e>=0;e-=1){let t=l[e],{isExternal:d,modifiers:c,hasImportantModifier:u,baseClassName:m,maybePostfixModifierPosition:x}=r(t);if(d){i=t+(i.length>0?" "+i:i);continue}let p=!!x,h=s(p?m.substring(0,x):m);if(!h){if(!p||!(h=s(m))){i=t+(i.length>0?" "+i:i);continue}p=!1}let f=0===c.length?"":1===c.length?c[0]:n(c).join(":"),g=u?f+"!":f,b=g+h;if(o.indexOf(b)>-1)continue;o.push(b);let j=a(h,p);for(let e=0;e<j.length;++e){let t=j[e];o.push(g+t)}i=t+(i.length>0?" "+i:i)}return i})(e,r);return a(e,n),n};return n=l=>{var i;let d;return s=(r={cache:(e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,r=Object.create(null),s=Object.create(null),a=(a,n)=>{r[a]=n,++t>e&&(t=0,s=r,r=Object.create(null))};return{get(e){let t=r[e];return void 0!==t?t:void 0!==(t=s[e])?(a(e,t),t):void 0},set(e,t){e in r?r[e]=t:a(e,t)}}})((i=t.reduce((e,t)=>t(e),e())).cacheSize),parseClassName:(e=>{let{prefix:t,experimentalParseClassName:r}=e,s=e=>{let t,r=[],s=0,a=0,n=0,o=e.length;for(let l=0;l<o;l++){let o=e[l];if(0===s&&0===a){if(":"===o){r.push(e.slice(n,l)),n=l+1;continue}if("/"===o){t=l;continue}}"["===o?s++:"]"===o?s--:"("===o?a++:")"===o&&a--}let l=0===r.length?e:e.slice(n),i=l,d=!1;return l.endsWith("!")?(i=l.slice(0,-1),d=!0):l.startsWith("!")&&(i=l.slice(1),d=!0),e$(r,d,i,t&&t>n?t-n:void 0)};if(t){let e=t+":",r=s;s=t=>t.startsWith(e)?r(t.slice(e.length)):e$(eM,!1,t,void 0,!0)}if(r){let e=s;s=t=>r({className:t,parseClassName:e})}return s})(i),sortModifiers:(d=new Map,i.orderSensitiveModifiers.forEach((e,t)=>{d.set(e,1e6+t)}),e=>{let t=[],r=[];for(let s=0;s<e.length;s++){let a=e[s],n="["===a[0],o=d.has(a);n||o?(r.length>0&&(r.sort(),t.push(...r),r=[]),t.push(a)):r.push(a)}return r.length>0&&(r.sort(),t.push(...r)),t}),...(e=>{let t=(e=>{let{theme:t,classGroups:r}=e;return eN(r,t)})(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]")){var r;let t,s,a;return -1===(r=e).slice(1,-1).indexOf(":")?void 0:(s=(t=r.slice(1,-1)).indexOf(":"),(a=t.slice(0,s))?"arbitrary.."+a:void 0)}let s=e.split("-"),a=+(""===s[0]&&s.length>1);return ey(s,a,t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=s[e],a=r[e];if(t){if(a){let e=Array(a.length+t.length);for(let t=0;t<a.length;t++)e[t]=a[t];for(let r=0;r<t.length;r++)e[a.length+r]=t[r];return e}return t}return a||ev}return r[e]||ev}}})(i)}).cache.get,a=r.cache.set,n=o,o(l)},(...e)=>n(((...e)=>{let t,r,s=0,a="";for(;s<e.length;)(t=e[s++])&&(r=eD(t))&&(a&&(a+=" "),a+=r);return a})(...e))})(()=>{let e=eL("color"),t=eL("font"),r=eL("text"),s=eL("font-weight"),a=eL("tracking"),n=eL("leading"),o=eL("breakpoint"),l=eL("container"),i=eL("spacing"),d=eL("radius"),c=eL("shadow"),u=eL("inset-shadow"),m=eL("text-shadow"),x=eL("drop-shadow"),p=eL("blur"),h=eL("perspective"),f=eL("aspect"),g=eL("ease"),b=eL("animate"),j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],v=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],y=()=>[...v(),te,e2],N=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],w=()=>[te,e2,i],C=()=>[eq,"full","auto",...w()],S=()=>[eK,"none","subgrid",te,e2],E=()=>["auto",{span:["full",eK,te,e2]},eK,te,e2],z=()=>[eK,"auto",te,e2],T=()=>["auto","min","max","fr",te,e2],M=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],$=()=>["start","end","center","stretch","center-safe","end-safe"],R=()=>["auto",...w()],D=()=>[eq,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],A=()=>[eq,"screen","full","dvw","lvw","svw","min","max","fit",...w()],L=()=>[eq,"screen","full","lh","dvh","lvh","svh","min","max","fit",...w()],P=()=>[e,te,e2],O=()=>[...v(),ts,e8,{position:[te,e2]}],I=()=>["no-repeat",{repeat:["","x","y","space","round"]}],_=()=>["auto","cover","contain",ta,e1,{size:[te,e2]}],U=()=>[eV,tt,e3],F=()=>["","none","full",d,te,e2],W=()=>["",eH,tt,e3],B=()=>["solid","dashed","dotted","double"],q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],H=()=>[eH,eV,ts,e8],K=()=>["","none",p,te,e2],V=()=>["none",eH,te,e2],G=()=>["none",eH,te,e2],Y=()=>[eH,te,e2],X=()=>[eq,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[eG],breakpoint:[eG],color:[eY],container:[eG],"drop-shadow":[eG],ease:["in","out","in-out"],font:[e0],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[eG],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[eG],shadow:[eG],spacing:["px",eH],text:[eG],"text-shadow":[eG],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",eq,e2,te,f]}],container:["container"],columns:[{columns:[eH,e2,te,l]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:y()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:C()}],"inset-x":[{"inset-x":C()}],"inset-y":[{"inset-y":C()}],start:[{"inset-s":C(),start:C()}],end:[{"inset-e":C(),end:C()}],"inset-bs":[{"inset-bs":C()}],"inset-be":[{"inset-be":C()}],top:[{top:C()}],right:[{right:C()}],bottom:[{bottom:C()}],left:[{left:C()}],visibility:["visible","invisible","collapse"],z:[{z:[eK,"auto",te,e2]}],basis:[{basis:[eq,"full","auto",l,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[eH,eq,"auto","initial","none",e2]}],grow:[{grow:["",eH,te,e2]}],shrink:[{shrink:["",eH,te,e2]}],order:[{order:[eK,"first","last","none",te,e2]}],"grid-cols":[{"grid-cols":S()}],"col-start-end":[{col:E()}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":S()}],"row-start-end":[{row:E()}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":T()}],"auto-rows":[{"auto-rows":T()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...M(),"normal"]}],"justify-items":[{"justify-items":[...$(),"normal"]}],"justify-self":[{"justify-self":["auto",...$()]}],"align-content":[{content:["normal",...M()]}],"align-items":[{items:[...$(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...$(),{baseline:["","last"]}]}],"place-content":[{"place-content":M()}],"place-items":[{"place-items":[...$(),"baseline"]}],"place-self":[{"place-self":["auto",...$()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:R()}],mx:[{mx:R()}],my:[{my:R()}],ms:[{ms:R()}],me:[{me:R()}],mbs:[{mbs:R()}],mbe:[{mbe:R()}],mt:[{mt:R()}],mr:[{mr:R()}],mb:[{mb:R()}],ml:[{ml:R()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:D()}],"inline-size":[{inline:["auto",...A()]}],"min-inline-size":[{"min-inline":["auto",...A()]}],"max-inline-size":[{"max-inline":["none",...A()]}],"block-size":[{block:["auto",...L()]}],"min-block-size":[{"min-block":["auto",...L()]}],"max-block-size":[{"max-block":["none",...L()]}],w:[{w:[l,"screen",...D()]}],"min-w":[{"min-w":[l,"screen","none",...D()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...D()]}],h:[{h:["screen","lh",...D()]}],"min-h":[{"min-h":["screen","lh","none",...D()]}],"max-h":[{"max-h":["screen","lh",...D()]}],"font-size":[{text:["base",r,tt,e3]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,tl,e4]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",eV,e2]}],"font-family":[{font:[tr,e6,t]}],"font-features":[{"font-features":[e2]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,te,e2]}],"line-clamp":[{"line-clamp":[eH,"none",te,e5]}],leading:[{leading:[n,...w()]}],"list-image":[{"list-image":["none",te,e2]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",te,e2]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:[eH,"from-font","auto",te,e3]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[eH,"auto",te,e2]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",te,e2]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",te,e2]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:O()}],"bg-repeat":[{bg:I()}],"bg-size":[{bg:_()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},eK,te,e2],radial:["",te,e2],conic:[eK,te,e2]},tn,e7]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:U()}],"gradient-via-pos":[{via:U()}],"gradient-to-pos":[{to:U()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:W()}],"border-w-x":[{"border-x":W()}],"border-w-y":[{"border-y":W()}],"border-w-s":[{"border-s":W()}],"border-w-e":[{"border-e":W()}],"border-w-bs":[{"border-bs":W()}],"border-w-be":[{"border-be":W()}],"border-w-t":[{"border-t":W()}],"border-w-r":[{"border-r":W()}],"border-w-b":[{"border-b":W()}],"border-w-l":[{"border-l":W()}],"divide-x":[{"divide-x":W()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":W()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...B(),"hidden","none"]}],"divide-style":[{divide:[...B(),"hidden","none"]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-bs":[{"border-bs":P()}],"border-color-be":[{"border-be":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...B(),"none","hidden"]}],"outline-offset":[{"outline-offset":[eH,te,e2]}],"outline-w":[{outline:["",eH,tt,e3]}],"outline-color":[{outline:P()}],shadow:[{shadow:["","none",c,to,e9]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":["none",u,to,e9]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:W()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[eH,e3]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":W()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":["none",m,to,e9]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[eH,te,e2]}],"mix-blend":[{"mix-blend":[...q(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":q()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[eH]}],"mask-image-linear-from-pos":[{"mask-linear-from":H()}],"mask-image-linear-to-pos":[{"mask-linear-to":H()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":H()}],"mask-image-t-to-pos":[{"mask-t-to":H()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":H()}],"mask-image-r-to-pos":[{"mask-r-to":H()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":H()}],"mask-image-b-to-pos":[{"mask-b-to":H()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":H()}],"mask-image-l-to-pos":[{"mask-l-to":H()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":H()}],"mask-image-x-to-pos":[{"mask-x-to":H()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":H()}],"mask-image-y-to-pos":[{"mask-y-to":H()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[te,e2]}],"mask-image-radial-from-pos":[{"mask-radial-from":H()}],"mask-image-radial-to-pos":[{"mask-radial-to":H()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":v()}],"mask-image-conic-pos":[{"mask-conic":[eH]}],"mask-image-conic-from-pos":[{"mask-conic-from":H()}],"mask-image-conic-to-pos":[{"mask-conic-to":H()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:O()}],"mask-repeat":[{mask:I()}],"mask-size":[{mask:_()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",te,e2]}],filter:[{filter:["","none",te,e2]}],blur:[{blur:K()}],brightness:[{brightness:[eH,te,e2]}],contrast:[{contrast:[eH,te,e2]}],"drop-shadow":[{"drop-shadow":["","none",x,to,e9]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:["",eH,te,e2]}],"hue-rotate":[{"hue-rotate":[eH,te,e2]}],invert:[{invert:["",eH,te,e2]}],saturate:[{saturate:[eH,te,e2]}],sepia:[{sepia:["",eH,te,e2]}],"backdrop-filter":[{"backdrop-filter":["","none",te,e2]}],"backdrop-blur":[{"backdrop-blur":K()}],"backdrop-brightness":[{"backdrop-brightness":[eH,te,e2]}],"backdrop-contrast":[{"backdrop-contrast":[eH,te,e2]}],"backdrop-grayscale":[{"backdrop-grayscale":["",eH,te,e2]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[eH,te,e2]}],"backdrop-invert":[{"backdrop-invert":["",eH,te,e2]}],"backdrop-opacity":[{"backdrop-opacity":[eH,te,e2]}],"backdrop-saturate":[{"backdrop-saturate":[eH,te,e2]}],"backdrop-sepia":[{"backdrop-sepia":["",eH,te,e2]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",te,e2]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[eH,"initial",te,e2]}],ease:[{ease:["linear","initial",g,te,e2]}],delay:[{delay:[eH,te,e2]}],animate:[{animate:["none",b,te,e2]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[h,te,e2]}],"perspective-origin":[{"perspective-origin":y()}],rotate:[{rotate:V()}],"rotate-x":[{"rotate-x":V()}],"rotate-y":[{"rotate-y":V()}],"rotate-z":[{"rotate-z":V()}],scale:[{scale:G()}],"scale-x":[{"scale-x":G()}],"scale-y":[{"scale-y":G()}],"scale-z":[{"scale-z":G()}],"scale-3d":["scale-3d"],skew:[{skew:Y()}],"skew-x":[{"skew-x":Y()}],"skew-y":[{"skew-y":Y()}],transform:[{transform:[te,e2,"","none","gpu","cpu"]}],"transform-origin":[{origin:y()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:X()}],"translate-x":[{"translate-x":X()}],"translate-y":[{"translate-y":X()}],"translate-z":[{"translate-z":X()}],"translate-none":["translate-none"],accent:[{accent:P()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:P()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",te,e2]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",te,e2]}],fill:[{fill:["none",...P()]}],"stroke-w":[{stroke:[eH,tt,e3,e5]}],stroke:[{stroke:["none",...P()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function tj(...e){return tb(function(){for(var e,t,r=0,s="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=function e(t){var r,s,a="";if("string"==typeof t||"number"==typeof t)a+=t;else if("object"==typeof t)if(Array.isArray(t)){var n=t.length;for(r=0;r<n;r++)t[r]&&(s=e(t[r]))&&(a&&(a+=" "),a+=s)}else for(s in t)t[s]&&(a&&(a+=" "),a+=s);return a}(e))&&(s&&(s+=" "),s+=t);return s}(e))}function tv({className:e,children:r,...s}){return(0,t.jsxs)(H,{"data-slot":"scroll-area",className:tj("relative overflow-hidden",e),...s,children:[(0,t.jsx)(V,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1 !overflow-y-auto [&>div]:!block",children:r}),(0,t.jsx)(ty,{}),(0,t.jsx)(ed,{})]})}function ty({className:e,orientation:r="vertical",...s}){return(0,t.jsx)(Y,{"data-slot":"scroll-area-scrollbar",orientation:r,className:tj("flex touch-none p-px transition-colors select-none","vertical"===r&&"h-full w-2.5 border-l border-l-transparent","horizontal"===r&&"h-2.5 flex-col border-t border-t-transparent",e),...s,children:(0,t.jsx)(eo,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}function tN({lines:e}){let[s,a]=(0,r.useState)(0),[n,o]=(0,r.useState)(0),[l,i]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let t=e[s];if(!l&&n<t.length){let e=setTimeout(()=>o(e=>e+1),40+30*Math.random());return()=>clearTimeout(e)}if(!l&&n===t.length){let e=setTimeout(()=>i(!0),2e3);return()=>clearTimeout(e)}if(l&&n>0){let e=setTimeout(()=>o(e=>e-1),20);return()=>clearTimeout(e)}l&&0===n&&(i(!1),a(t=>(t+1)%e.length))},[n,l,s,e]),(0,t.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,t.jsx)("div",{className:"text-muted-foreground/30 text-4xl font-bold select-none",children:">_"}),(0,t.jsx)("div",{className:"h-8 flex items-center",children:(0,t.jsx)("span",{className:"text-sm text-muted-foreground/60 typing-cursor pr-1",children:e[s].slice(0,n)})})]})}function tk({wt:e,selected:r,onClick:s}){return(0,t.jsxs)("button",{onClick:s,className:`w-full text-left rounded-lg border p-3 transition-colors ${r?"bg-accent border-ring":"bg-card border-border hover:bg-accent/50"}`,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,t.jsx)(m,{className:"size-3.5 text-chart-4 shrink-0"}),(0,t.jsx)("span",{className:"text-sm font-semibold text-foreground truncate font-mono",children:e.worktreeName??e.branch}),e.isClaudeManaged&&(0,t.jsxs)("span",{className:"flex items-center gap-0.5 text-[10px] text-chart-4 bg-chart-4/10 px-1.5 py-0.5 rounded border border-chart-4/20 shrink-0 ml-auto",children:[(0,t.jsx)(E,{className:"size-2.5"}),"claude"]})]}),e.worktreeName&&(0,t.jsx)("div",{className:"text-[11px] text-muted-foreground/50 font-mono truncate mb-0.5",children:e.branch}),(0,t.jsx)("div",{className:"text-[11px] text-muted-foreground/60 font-mono truncate mb-2",children:e.path}),(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[e.dirty?(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[11px] text-chart-3 bg-chart-3/10 px-1.5 py-0.5 rounded",children:[(0,t.jsx)(w,{className:"size-2.5"}),"dirty"]}):(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[11px] text-chart-2 bg-chart-2/10 px-1.5 py-0.5 rounded",children:[(0,t.jsx)(C,{className:"size-2.5"}),"clean"]}),e.aheadCount>0&&(0,t.jsxs)("span",{className:"flex items-center gap-0.5 text-[11px] text-chart-2",children:[(0,t.jsx)(N,{className:"size-2.5"}),e.aheadCount]}),e.behindCount>0&&(0,t.jsxs)("span",{className:"flex items-center gap-0.5 text-[11px] text-chart-5",children:[(0,t.jsx)(k,{className:"size-2.5"}),e.behindCount]}),0===e.aheadCount&&0===e.behindCount&&(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground/40",children:"synced"}),(e.associatedTasks?.length??0)>0&&(0,t.jsxs)("span",{className:"ml-auto text-[11px] bg-chart-4/20 text-chart-4 px-1.5 py-0.5 rounded",children:[e.associatedTasks.length," task",1!==e.associatedTasks.length?"s":""]})]})]})}function tw({wt:e}){return(0,t.jsxs)("div",{className:"h-full flex flex-col",children:[(0,t.jsxs)("div",{className:"px-5 py-4 border-b border-border bg-sidebar/40 shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,t.jsx)(m,{className:"size-4 text-chart-4"}),(0,t.jsx)("span",{className:"text-base font-semibold text-foreground font-mono",children:e.worktreeName??e.branch}),e.isClaudeManaged&&(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[11px] text-chart-4 bg-chart-4/10 px-2 py-0.5 rounded-full border border-chart-4/20",children:[(0,t.jsx)(E,{className:"size-3"}),"Claude-managed"]})]}),e.worktreeName&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground/50 font-mono mb-0.5",children:e.branch}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground/60 font-mono",children:e.path}),(0,t.jsxs)("div",{className:"flex items-center gap-3 mt-3 flex-wrap",children:[e.dirty?(0,t.jsxs)("span",{className:"flex items-center gap-1 text-xs text-chart-3 bg-chart-3/10 px-2 py-0.5 rounded-full border border-chart-3/20",children:[(0,t.jsx)(w,{className:"size-3"}),"Uncommitted changes"]}):(0,t.jsxs)("span",{className:"flex items-center gap-1 text-xs text-chart-2 bg-chart-2/10 px-2 py-0.5 rounded-full border border-chart-2/20",children:[(0,t.jsx)(C,{className:"size-3"}),"Working tree clean"]}),e.aheadCount>0&&(0,t.jsxs)("span",{className:"flex items-center gap-1 text-xs text-chart-2",children:[(0,t.jsx)(N,{className:"size-3"}),e.aheadCount," ahead"]}),e.behindCount>0&&(0,t.jsxs)("span",{className:"flex items-center gap-1 text-xs text-chart-5",children:[(0,t.jsx)(k,{className:"size-3"}),e.behindCount," behind"]})]})]}),(0,t.jsx)(tv,{className:"flex-1",children:(0,t.jsxs)("div",{className:"p-5 space-y-5",children:[e.head&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-2",children:"HEAD Commit"}),(0,t.jsxs)("div",{className:"flex items-center gap-2 bg-card border border-border rounded px-3 py-2",children:[(0,t.jsx)(S,{className:"size-3.5 text-chart-4 shrink-0"}),(0,t.jsx)("code",{className:"text-xs text-chart-4 font-mono",children:e.head.slice(0,12)}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground font-mono",children:e.head})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-2",children:"Full Path"}),(0,t.jsx)("div",{className:"bg-card border border-border rounded px-3 py-2",children:(0,t.jsx)("code",{className:"text-xs text-muted-foreground font-mono break-all",children:e.path})})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-2",children:["Associated Tasks",(e.associatedTasks?.length??0)>0&&(0,t.jsxs)("span",{className:"ml-1.5 text-muted-foreground/40 normal-case",children:["(",e.associatedTasks.length,")"]})]}),(e.associatedTasks?.length??0)===0?(0,t.jsx)("p",{className:"text-xs text-muted-foreground/40 py-2",children:"No tasks associated with this worktree"}):(0,t.jsx)("div",{className:"space-y-2",children:e.associatedTasks.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 p-3 rounded bg-card border border-border",children:[(0,t.jsxs)("span",{className:"font-mono text-xs text-muted-foreground shrink-0",children:["#",e.taskId]}),(0,t.jsx)("span",{className:"text-xs text-foreground truncate flex-1",children:e.taskSubject}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground/40 font-mono shrink-0",children:e.sessionId.slice(0,8)})]},`${e.sessionId}-${e.taskId}`))})]})]})})]})}function tC(){let[e,s]=(0,r.useState)([]),[a,n]=(0,r.useState)(!0),[o,l]=(0,r.useState)(null),[i,c]=(0,r.useState)(null),u=(0,r.useRef)(null),x=async()=>{try{let e=await fetch("/worktrees");if(!e.ok)return;let t=(await e.json()).worktrees??[];s(t),l(new Date),c(e=>e?t.find(t=>t.path===e.path)??t[0]??null:t[0]??null)}catch{}finally{n(!1)}};return(0,r.useEffect)(()=>(x(),u.current=setInterval(x,3e4),()=>{u.current&&clearInterval(u.current)}),[]),(0,t.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden",children:[(0,t.jsxs)("div",{className:"bg-sidebar border-b border-sidebar-border px-4 py-2 flex items-center justify-between shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(m,{className:"size-4 text-muted-foreground"}),(0,t.jsx)("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Git Worktrees"}),e.length>0&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground/60 bg-muted px-1.5 py-0.5 rounded",children:e.length})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[o&&(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground/40",children:o.toLocaleTimeString()}),(0,t.jsx)("button",{onClick:x,className:"p-1 rounded hover:bg-sidebar-accent transition-colors",title:"Refresh worktrees",children:(0,t.jsx)(d,{className:"size-3.5 text-muted-foreground"})})]})]}),a?(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center text-muted-foreground/40 text-xs",children:"Loading..."}):0===e.length?(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center p-8",children:(0,t.jsx)(tN,{lines:["No git worktrees detected","claude --worktree <name>","Creates .claude/worktrees/<name>/ automatically","Run parallel agents in isolated worktrees"]})}):(0,t.jsxs)("div",{className:"flex-1 flex overflow-hidden",children:[(0,t.jsx)("div",{className:"w-72 min-w-[240px] border-r border-border flex flex-col overflow-hidden",children:(0,t.jsx)(tv,{className:"flex-1",children:(0,t.jsx)("div",{className:"p-3 space-y-2",children:e.map(e=>(0,t.jsx)(tk,{wt:e,selected:i?.path===e.path,onClick:()=>c(e)},e.path))})})}),(0,t.jsx)("div",{className:"flex-1 overflow-hidden",children:i?(0,t.jsx)(tw,{wt:i}):(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center text-muted-foreground/40 text-xs",children:"Select a worktree to see details"})})]})]})}let tS=l("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),tE=l("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),tz=l("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);function tT(e){switch(e){case"critical":return"text-chart-5";case"warn":return"text-chart-3";default:return"text-chart-2"}}function tM({level:e}){let r=`size-3.5 ${tT(e)}`;return"critical"===e?(0,t.jsx)(w,{className:r}):"warn"===e?(0,t.jsx)(tz,{className:r}):(0,t.jsx)(C,{className:r})}function t$(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(0)}K`:String(e)}function tR({health:e}){if(!e)return(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground/40",children:"ctx –"});let{percentage:r,warningLevel:s}=e;return(0,t.jsxs)("span",{className:`inline-flex items-center gap-1 text-[10px] font-mono ${tT(s)}`,title:`Context: ${r}% used (${s})
2
+ Tokens: ${t$(e.tokensUsed)}${e.maxTokens?` / ${t$(e.maxTokens)}`:""}`,children:[(0,t.jsx)(tM,{level:s}),r,"%"]})}function tD({health:e}){if(!e)return(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground/40",children:[(0,t.jsx)("div",{className:"flex-1 bg-muted rounded-full h-1.5"}),(0,t.jsx)("span",{className:"font-mono shrink-0",children:"–"})]});let{percentage:r,warningLevel:s,tokensUsed:a,maxTokens:n}=e,o=function(e){switch(e){case"critical":return"bg-chart-5";case"warn":return"bg-chart-3";default:return"bg-chart-2"}}(s);return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"flex-1 bg-muted rounded-full h-1.5 overflow-hidden",title:`${r}% context used`,children:(0,t.jsx)("div",{className:`${o} h-1.5 rounded-full transition-all`,style:{width:`${Math.min(100,r)}%`}})}),(0,t.jsxs)("div",{className:`flex items-center gap-1 text-[10px] font-mono shrink-0 ${tT(s)}`,children:[(0,t.jsx)(tM,{level:s}),(0,t.jsxs)("span",{children:[r,"%"]})]})]}),"safe"!==s&&(0,t.jsxs)("div",{className:`flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded ${"critical"===s?"bg-chart-5/10 text-chart-5":"bg-chart-3/10 text-chart-3"}`,children:[(0,t.jsx)(tM,{level:s}),(0,t.jsxs)("span",{children:["critical"===s?"Context critical":"Context warn",n?` \xb7 ${t$(a)} / ${t$(n)}`:""]})]})]})}function tA(e){switch(e){case"DONE":case"completed":return"bg-chart-2/20 text-chart-2";case"FAILED":return"bg-chart-5/20 text-chart-5";case"BLOCKED":return"bg-chart-3/20 text-chart-3";case"READY":case"pending":return"bg-chart-1/20 text-chart-1";case"in_progress":return"bg-chart-4/20 text-chart-4";default:return"bg-muted text-muted-foreground"}}let tL=new Set,tP=new Set,tO=null,tI=!1;function t_(){return tO&&tO.readyState!==EventSource.CLOSED||((tO=new EventSource("/events/")).onopen=()=>{tI=!0,tP.forEach(e=>e(!0))},tO.onerror=()=>{tI=!1,tP.forEach(e=>e(!1))},tO.onmessage=e=>{try{let t=JSON.parse(e.data);tL.forEach(e=>e(t))}catch{}}),tO}function tU(e){let t=(0,r.useRef)(e);(0,r.useEffect)(()=>{t.current=e}),(0,r.useEffect)(()=>{let e=e=>t.current(e);return tL.add(e),t_(),()=>{tL.delete(e)}},[])}function tF(){let[e,t]=(0,r.useState)(tI);return(0,r.useEffect)(()=>(tP.add(t),t_(),()=>{tP.delete(t)}),[]),e}let tW=[];function tB({searchQuery:e,sidebarCollapsed:s}){let a,n,o,[l,i]=(0,r.useState)(!1),{sessions:d,selectedSession:c,setSelectedSession:u,sessionCounts:m}=function(e=!1){let[t,s]=(0,r.useState)([]),[a,n]=(0,r.useState)(null),[o,l]=(0,r.useState)(null),i=(0,r.useRef)(null),d=tF();(0,r.useEffect)(()=>{i.current=a?.id??null},[a]);let c=(0,r.useCallback)(async()=>{try{let t=e?"/sessions?days=all":"/sessions",r=await fetch(t);if(!r.ok)return;let a=await r.json();tW=a.sessions,s(a.sessions),null!=a.total&&l({total:a.total,filtered:a.filtered??a.sessions.length});let o=i.current;if(!o&&a.sessions.length>0)n(a.sessions[0]);else if(o){let e=a.sessions.find(e=>e.id===o);e&&n(e)}}catch{}},[e]);return(0,r.useEffect)(()=>{c()},[c]),tU(e=>{"sessions"===e.type&&c()}),{sessions:t,selectedSession:a,setSelectedSession:n,connected:d,sessionCounts:o}}(l),[x,p]=(0,r.useState)(null),[h,f]=(0,r.useState)(!1),[g,b]=(0,r.useState)(!1),[j,v]=(0,r.useState)(!1),[y,N]=(0,r.useState)(null),k=(0,r.useRef)(null),[w,C]=(0,r.useState)(null),[S,E]=(0,r.useState)([]),[z,T]=(0,r.useState)([]),[M,$]=(0,r.useState)(null),[R,D]=(0,r.useState)(null),A=(0,r.useRef)(new Map);(0,r.useEffect)(()=>{let e=Date.now(),t=A.current,r=e-6e5;for(let s of d){let a=s.tokenUsage?.inputTokens??0;if(a<=0)continue;let n=t.get(s.id)??[];for(n.push({ts:e,tokens:a});n.length>1&&n[0].ts<r;)n.shift();t.set(s.id,n)}},[d]);let L=e=>{let t=A.current.get(e);if(!t||t.length<2)return null;let r=t[0],s=t[t.length-1],a=s.tokens-r.tokens,n=(s.ts-r.ts)/6e4;return n<.25||a<=0?null:a/n};(0,r.useEffect)(()=>{let e=new AbortController,{signal:t}=e;function r(){fetch("/queue",{signal:t}).then(e=>e.ok?e.json():null).then(e=>{e&&!e.errors?.length&&C(e.summary)}).catch(()=>{}),fetch("/agents",{signal:t}).then(e=>e.ok?e.json():null).then(e=>{e?.agents&&E(e.agents)}).catch(()=>{}),fetch("/hook/events",{signal:t}).then(e=>e.ok?e.json():null).then(e=>{if(!e?.events)return;let t=e.events.find(e=>"PreCompact"===e.event||"PostCompact"===e.event);t&&$({at:t.receivedAt,phase:"PreCompact"===t.event?"pre":"post"})}).catch(()=>{})}r();let s=setInterval(r,15e3);return()=>{clearInterval(s),e.abort()}},[]),(0,r.useEffect)(()=>{let e=new AbortController,t=()=>{fetch("/billing-block",{signal:e.signal}).then(e=>e.ok?e.json():null).then(e=>{e&&D(e)}).catch(()=>{})};t();let r=setInterval(t,3e5);return()=>{clearInterval(r),e.abort()}},[]);let P=(0,r.useCallback)(()=>{fetch("/history").then(e=>e.ok?e.json():null).then(e=>{if(!e?.prompts)return;let t=new Map;for(let r of e.prompts){let e=t.get(r.sessionId);(!e||r.timestamp>e.timestamp)&&t.set(r.sessionId,r)}T([...t.values()].sort((e,t)=>t.timestamp.localeCompare(e.timestamp)).slice(0,5).map(e=>({sessionId:e.sessionId,projectName:e.projectName,lastPrompt:e.display,updatedAt:e.timestamp})))}).catch(()=>{})},[]);(0,r.useEffect)(()=>{P()},[P]),tU(e=>{"sessions"===e.type&&P()});let O=`You MUST use the TodoWrite tool to track your work.
3
3
  At the START of any multi-step task, create a todo list with all steps.
4
- Mark each task in_progress before starting, completed after finishing.`;(0,r.useEffect)(()=>{let e=d.some(e=>e.tasks.length>0);if(e){b(!1),k.current&&clearTimeout(k.current);return}return d.length>0&&!e&&(k.current&&clearTimeout(k.current),k.current=setTimeout(()=>b(!0),3e4)),()=>{k.current&&clearTimeout(k.current)}},[d]);let _=e=>{let t=`claude resume ${e}`;navigator.clipboard.writeText(t),fetch(`/sessions/${e}/resume-cmd`,{method:"POST"}).catch(()=>{}),N(t),setTimeout(()=>N(null),3e3)},I=d.filter(e=>null!=e.contextHealth),U=I.length>0?{percentage:a=Math.max(...I.map(e=>e.contextHealth.percentage)),warningLevel:a>=75?"critical":a>=65?"warn":"safe"}:null;if(0===d.length)return(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,t.jsx)(tN,{lines:["Start a Claude Code session to see tasks here","npx claudedash start → launch dashboard","Agent uses TodoWrite to track progress","Sessions appear here in real-time"]})});let F=(c?.tasks||[]).filter(t=>t.subject.toLowerCase().includes(e.toLowerCase())||t.description.toLowerCase().includes(e.toLowerCase())||t.id.toLowerCase().includes(e.toLowerCase())),W=F.filter(e=>"pending"===e.status),B=F.filter(e=>"in_progress"===e.status),q=F.filter(e=>"completed"===e.status),H=e=>e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(0)}K`:String(e),K=e=>e.inputTokens+e.outputTokens+e.cacheCreationTokens+e.cacheReadTokens;return(0,t.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden",children:[y&&(0,t.jsxs)("div",{className:"bg-chart-4/10 border-b border-chart-4/30 px-4 py-2 flex items-center gap-3 text-xs shrink-0",children:[(0,t.jsx)(tS,{className:"size-3 text-chart-4 shrink-0"}),(0,t.jsx)("span",{className:"text-foreground/80",children:"Copied to clipboard:"}),(0,t.jsx)("code",{className:"font-mono text-chart-4 bg-chart-4/10 px-1.5 py-0.5 rounded",children:y}),(0,t.jsx)("button",{onClick:()=>N(null),className:"ml-auto text-muted-foreground hover:text-foreground",children:"×"})]}),g&&(0,t.jsxs)("div",{className:"bg-chart-3/10 border-b border-chart-3/30 px-4 py-2.5 flex items-start gap-3 text-xs shrink-0",children:[(0,t.jsx)("span",{className:"text-chart-3 mt-0.5 shrink-0",children:"⚠"}),(0,t.jsxs)("div",{className:"flex-1 text-foreground/80",children:[(0,t.jsx)("span",{className:"font-semibold text-foreground",children:"Agent setup missing."})," ","Sessions are visible but no tasks have appeared in 30 seconds. Add this to your project's"," ",(0,t.jsx)("code",{className:"bg-muted px-1 rounded",children:"CLAUDE.md"}),":",(0,t.jsx)("div",{className:"mt-1.5 font-mono bg-muted/60 rounded px-2 py-1 text-[10px] leading-relaxed whitespace-pre",children:O})]}),(0,t.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(O),v(!0),setTimeout(()=>v(!1),2e3)},className:"flex items-center gap-1.5 shrink-0 text-chart-3 hover:text-foreground transition-colors border border-chart-3/30 rounded px-2 py-1",children:j?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(tE,{className:"size-3"}),(0,t.jsx)("span",{children:"Copied"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(tS,{className:"size-3"}),(0,t.jsx)("span",{children:"Copy"})]})}),(0,t.jsx)("button",{onClick:()=>b(!1),className:"text-muted-foreground hover:text-foreground shrink-0 ml-1",children:"×"})]}),(0,t.jsxs)("div",{className:"flex-1 flex overflow-hidden",children:[(0,t.jsxs)("div",{className:`bg-sidebar border-r border-sidebar-border flex flex-col overflow-hidden transition-all duration-300 ${s?"w-0 border-r-0":"w-[220px]"}`,children:[(0,t.jsxs)("div",{className:"p-3 border-b border-sidebar-border flex items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Sessions"}),m&&m.total>m.filtered&&!l&&(0,t.jsxs)("button",{onClick:()=>i(!0),className:"text-[9px] text-muted-foreground/60 hover:text-muted-foreground underline shrink-0",title:`${m.total-m.filtered} older sessions hidden`,children:["+",m.total-m.filtered," older"]}),l&&(0,t.jsx)("button",{onClick:()=>i(!1),className:"text-[9px] text-muted-foreground/60 hover:text-muted-foreground underline shrink-0",children:"7d only"})]}),(0,t.jsx)(tv,{className:"flex-1",children:(0,t.jsx)("div",{className:"p-2 space-y-1",children:d.map(e=>{let r,s;return(0,t.jsxs)("div",{className:"relative group",children:[(0,t.jsxs)("button",{onClick:()=>{u(e),p(null)},className:`w-full text-left p-2.5 rounded-lg transition-colors ${c?.id===e.id?"bg-accent border border-ring":"hover:bg-accent/50 border border-transparent"}`,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[e.tasks.some(e=>"in_progress"===e.status)&&(0,t.jsxs)("span",{className:"relative flex size-2",children:[(0,t.jsx)("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-chart-2 opacity-75"}),(0,t.jsx)("span",{className:"relative inline-flex rounded-full size-2 bg-chart-2"})]}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground truncate",children:e.projectName||e.id.slice(0,8)})]}),e.projectName&&(0,t.jsx)("div",{className:"text-[10px] text-muted-foreground/60 font-mono truncate mb-1",children:e.id.slice(0,8)}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"flex-1 bg-muted rounded-full h-1.5",children:(0,t.jsx)("div",{className:"bg-chart-2 h-1.5 rounded-full transition-all",style:{width:`${0===e.tasks.length?0:Math.round(e.tasks.filter(e=>"completed"===e.status).length/e.tasks.length*100)}%`}})}),(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground shrink-0",children:[e.tasks.filter(e=>"completed"===e.status).length,"/",e.tasks.length]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between text-[10px] text-muted-foreground/60 mt-1",children:[(0,t.jsx)("span",{children:(e=>{let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;let r=Math.floor(t/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`})(e.updatedAt)}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[e.tokenUsage&&(0,t.jsxs)("span",{title:`In: ${H(e.tokenUsage.inputTokens)} | Out: ${H(e.tokenUsage.outputTokens)} | Cache: ${H(e.tokenUsage.cacheReadTokens)}`,children:[H(K(e.tokenUsage))," tok"]}),(0,t.jsx)(tR,{health:e.contextHealth})]})]}),(r=L(e.id),s=(e=>{let t=L(e.id);if(!t||!e.contextHealth?.maxTokens)return null;let r=e.contextHealth.maxTokens-e.contextHealth.tokensUsed;return r<=0?0:Math.round(r/t)})(e),r?(0,t.jsxs)("div",{className:"text-[9px] text-muted-foreground/50 mt-0.5 leading-tight",children:[H(Math.round(r)),"/min",null!=s&&(0,t.jsxs)("span",{className:"ml-1 text-chart-3",children:["~",s,"min"]})]}):null),((e.linesAdded??0)>0||(e.gitCommits??0)>0)&&(0,t.jsxs)("div",{className:"flex items-center gap-2 text-[10px] mt-1",children:[(e.linesAdded??0)>0&&(0,t.jsxs)("span",{className:"text-chart-2",children:["+",H(e.linesAdded)," lines"]}),(e.gitCommits??0)>0&&(0,t.jsxs)("span",{className:"text-chart-1",children:[e.gitCommits," commit",1!==e.gitCommits?"s":""]}),e.languages&&Object.keys(e.languages).slice(0,2).map(e=>(0,t.jsx)("span",{className:"text-muted-foreground/50",children:e},e))]})]}),(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),_(e.id)},title:`Copy 'claude resume ${e.id}' to clipboard`,className:"absolute top-2 right-2 p-1 rounded opacity-0 group-hover:opacity-100 hover:bg-accent transition-all text-muted-foreground hover:text-foreground",children:(0,t.jsx)(tS,{className:"size-2.5"})})]},e.id)})})}),z.filter(e=>!d.some(t=>t.id===e.sessionId)).length>0&&(0,t.jsxs)("div",{className:"border-t border-sidebar-border p-2 space-y-1 shrink-0",children:[(0,t.jsx)("span",{className:"text-[9px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Resume"}),z.filter(e=>!d.some(t=>t.id===e.sessionId)).slice(0,3).map(e=>(0,t.jsxs)("button",{onClick:()=>_(e.sessionId),title:`Copy: claude resume ${e.sessionId}`,className:"w-full text-left group flex items-start gap-1.5 p-1.5 rounded hover:bg-accent/50 transition-colors",children:[(0,t.jsx)(tS,{className:"size-2.5 mt-0.5 shrink-0 text-muted-foreground group-hover:text-foreground"}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("div",{className:"text-[10px] font-medium text-foreground truncate leading-tight",children:e.projectName??e.sessionId.slice(0,8)}),(0,t.jsx)("div",{className:"text-[9px] text-muted-foreground truncate leading-tight",children:e.lastPrompt.length>40?e.lastPrompt.slice(0,40)+"…":e.lastPrompt})]})]},e.sessionId))]}),M&&(o=(n=Math.floor((Date.now()-new Date(M.at).getTime())/6e4))<1?"just now":n<60?`${n}m ago`:`${Math.floor(n/60)}h ago`,(0,t.jsx)("div",{className:"border-t border-sidebar-border px-2 py-1.5 shrink-0",children:(0,t.jsxs)("div",{className:"text-[9px] text-muted-foreground leading-tight",children:[(0,t.jsx)("span",{className:"font-medium text-chart-4",children:"compact"})," ",o," · state saved"]})})),R?.active&&null!=R.minutesRemaining&&(0,t.jsxs)("div",{className:"border-t border-sidebar-border px-2 py-1.5 shrink-0",children:[(0,t.jsx)("span",{className:"text-[9px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Billing Block"}),(0,t.jsxs)("div",{className:"text-[9px] text-chart-3 mt-0.5 leading-tight",children:["~",R.minutesRemaining,"min left",null!=R.estimatedCostUSD&&null!=R.minutesElapsed&&R.minutesElapsed>0&&(0,t.jsxs)("span",{className:"ml-1 text-muted-foreground",children:["· est. $",(R.estimatedCostUSD*(1+R.minutesRemaining/R.minutesElapsed)).toFixed(2)]})]})]}),(w||S.length>0)&&(0,t.jsxs)("div",{className:"border-t border-sidebar-border p-2 space-y-2 shrink-0",children:[w&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("span",{className:"text-[9px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Queue"}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-1 text-[9px]",children:[w.ready>0&&(0,t.jsxs)("span",{className:"px-1.5 py-0.5 rounded bg-chart-2/15 text-chart-2 font-medium",children:[w.ready," READY"]}),w.done>0&&(0,t.jsxs)("span",{className:"px-1.5 py-0.5 rounded bg-muted text-muted-foreground",children:[w.done," DONE"]}),w.blocked>0&&(0,t.jsxs)("span",{className:"px-1.5 py-0.5 rounded bg-chart-5/15 text-chart-5 font-semibold",children:[w.blocked," BLOCKED"]}),w.failed>0&&(0,t.jsxs)("span",{className:"px-1.5 py-0.5 rounded bg-destructive/15 text-destructive",children:[w.failed," FAILED"]})]})]}),S.length>0&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("span",{className:"text-[9px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Agents"}),S.map(e=>(0,t.jsxs)("div",{className:`text-[9px] leading-tight ${e.isStale?"opacity-40":""}`,children:[(0,t.jsx)("span",{className:"font-medium text-foreground truncate block",children:e.name}),e.taskId&&(0,t.jsx)("span",{className:"text-muted-foreground",children:e.taskId})]},e.agentId))]})]})]}),(0,t.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden",children:[U&&"safe"!==U.warningLevel&&(0,t.jsxs)("div",{className:`px-4 py-1.5 flex items-center gap-2 text-xs border-b shrink-0 ${"critical"===U.warningLevel?"bg-chart-5/10 border-chart-5/20 text-chart-5":"bg-chart-3/10 border-chart-3/20 text-chart-3"}`,children:[(0,t.jsx)(tR,{health:{...U,tokensUsed:0}}),(0,t.jsxs)("span",{children:["Highest context across ",I.length," session",1!==I.length?"s":"",":"," ",U.percentage,"% (",U.warningLevel,")"]})]}),c?(0,t.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden",children:[c.tokenUsage&&(0,t.jsxs)("div",{className:"bg-sidebar border-b border-sidebar-border px-4 py-2 flex items-center gap-6 text-xs shrink-0",children:[(0,t.jsx)("span",{className:"text-muted-foreground font-medium",children:"Tokens:"}),(0,t.jsxs)("span",{className:"text-foreground",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"In "}),H(c.tokenUsage.inputTokens)]}),(0,t.jsxs)("span",{className:"text-foreground",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Out "}),H(c.tokenUsage.outputTokens)]}),(0,t.jsxs)("span",{className:"text-foreground",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Cache Write "}),H(c.tokenUsage.cacheCreationTokens)]}),(0,t.jsxs)("span",{className:"text-foreground",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Cache Read "}),H(c.tokenUsage.cacheReadTokens)]}),(0,t.jsxs)("span",{className:"text-muted-foreground/60",children:["Total:"," ",H(K(c.tokenUsage))]}),c.contextHealth&&(0,t.jsx)("div",{className:"ml-auto w-48",children:(0,t.jsx)(tD,{health:c.contextHealth})})]}),(0,t.jsxs)("div",{className:"flex-1 flex overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex-1 flex gap-4 p-4 overflow-x-auto",children:[(0,t.jsx)(tq,{title:"Pending",count:W.length,tasks:W,statusColor:"chart-1",selectedTask:x,setSelectedTask:p}),(0,t.jsx)(tq,{title:"In Progress",count:B.length,tasks:B,statusColor:"chart-4",selectedTask:x,setSelectedTask:p}),(0,t.jsx)(tq,{title:"Completed",count:q.length,tasks:q,statusColor:"chart-2",selectedTask:x,setSelectedTask:p})]}),x&&(0,t.jsxs)("div",{className:"w-[350px] bg-sidebar border-l border-border flex flex-col shrink-0",children:[(0,t.jsxs)("div",{className:"p-4 border-b border-border flex items-center justify-between",children:[(0,t.jsx)("span",{className:`text-xs px-2 py-0.5 rounded font-semibold ${tA(x.status)}`,children:function(e){switch(e){case"pending":return"PENDING";case"in_progress":return"IN PROGRESS";case"completed":return"COMPLETED";default:return e}}(x.status)}),(0,t.jsx)("button",{onClick:()=>p(null),className:"text-muted-foreground hover:text-foreground text-sm",children:"×"})]}),(0,t.jsx)(tv,{className:"flex-1",children:(0,t.jsxs)("div",{className:"p-4 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground mb-1",children:x.subject}),"in_progress"===x.status&&x.activeForm&&(0,t.jsx)("p",{className:"text-xs text-chart-4 italic",children:x.activeForm})]}),x.description&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-xs font-semibold text-muted-foreground uppercase mb-1",children:"Description"}),(0,t.jsx)("p",{className:"text-xs text-foreground/80 leading-relaxed whitespace-pre-wrap",children:x.description})]}),x.blockedBy.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-xs font-semibold text-muted-foreground uppercase mb-1",children:"Blocked By"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:x.blockedBy.map(e=>(0,t.jsxs)("span",{className:"text-xs bg-chart-3/20 text-chart-3 px-2 py-0.5 rounded",children:["Task #",e]},e))})]}),x.blocks.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-xs font-semibold text-muted-foreground uppercase mb-1",children:"Blocks"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:x.blocks.map(e=>(0,t.jsxs)("span",{className:"text-xs bg-muted text-muted-foreground px-2 py-0.5 rounded",children:["Task #",e]},e))})]}),(0,t.jsxs)("div",{className:"pt-2 border-t border-border space-y-2",children:[(0,t.jsx)("button",{onClick:()=>{var e;return e=x.id,void(navigator.clipboard.writeText(e),f(!0),setTimeout(()=>f(!1),2e3))},className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:h?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(tE,{className:"size-3 text-chart-2"}),(0,t.jsx)("span",{className:"text-chart-2",children:"Copied"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(tS,{className:"size-3"}),(0,t.jsxs)("span",{children:["Copy ID: ",x.id]})]})}),c&&(0,t.jsxs)("button",{onClick:()=>_(c.id),className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",title:`Copy 'claude resume ${c.id}' to clipboard`,children:[(0,t.jsx)(tS,{className:"size-3"}),(0,t.jsx)("span",{children:"Resume session"})]})]})]})})]})]})]}):(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,t.jsx)("div",{className:"text-center",children:(0,t.jsx)("p",{className:"text-muted-foreground",children:"Select a session from the sidebar"})})})]})]})]})}function tq({title:e,count:r,tasks:s,statusColor:a,selectedTask:n,setSelectedTask:o}){return(0,t.jsxs)("div",{className:"flex-1 min-w-[250px] flex flex-col",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3 px-1",children:[(0,t.jsx)("div",{className:`size-2 rounded-full bg-${a}`}),(0,t.jsx)("span",{className:"text-xs font-semibold text-muted-foreground uppercase",children:e}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground/60 bg-muted px-1.5 py-0.5 rounded",children:r})]}),(0,t.jsx)(tv,{className:"flex-1",children:(0,t.jsx)("div",{className:"space-y-2 pr-1",children:s.map(e=>(0,t.jsxs)("button",{onClick:()=>o(e),className:`w-full text-left p-3 rounded-lg border transition-colors ${n?.id===e.id?"bg-accent border-ring":"bg-card border-border hover:bg-accent/50"}`,children:[(0,t.jsx)("div",{className:"flex items-center justify-between mb-1",children:(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground font-mono",children:["#",e.id]})}),(0,t.jsx)("p",{className:"text-sm text-foreground line-clamp-2 mb-1",children:e.subject}),"in_progress"===e.status&&e.activeForm&&(0,t.jsx)("p",{className:"text-xs text-chart-4 italic truncate",children:e.activeForm}),e.blockedBy.length>0&&(0,t.jsx)("div",{className:"flex items-center gap-1 mt-1.5",children:(0,t.jsxs)("span",{className:"text-[10px] text-chart-3",children:["Blocked by #",e.blockedBy[0],e.blockedBy.length>1?` +${e.blockedBy.length-1}`:""]})})]},e.id))})})]})}let tH=l("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),tK=l("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),tV=l("brain",[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]),tG=l("wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]),tY=l("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),tX=l("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),tQ=l("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]),tJ=l("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]),tZ=l("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),t0=l("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);function t1({label:e,passed:r}){return(0,t.jsxs)("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded text-[10px] font-semibold ${r?"bg-chart-2/15 text-chart-2":"bg-chart-5/15 text-chart-5"}`,children:[r?(0,t.jsx)(C,{className:"size-2.5"}):(0,t.jsx)(t0,{className:"size-2.5"}),e]})}function t2({events:e}){return 0===e.length?(0,t.jsx)("div",{className:"py-8",children:(0,t.jsx)(tN,{lines:["No quality checks logged yet",'Add "quality": {"lint": true} to meta',"Track lint, typecheck, and test results","Results appear here per task"]})}):(0,t.jsx)("div",{className:"space-y-2",children:e.map(e=>{let r=e.checks,s=Object.values(r).every(Boolean),a=Object.values(r).some(e=>!1===e);return(0,t.jsx)("div",{className:`p-3 rounded-lg border transition-colors ${a?"bg-chart-5/5 border-chart-5/20":s?"bg-chart-2/5 border-chart-2/20":"bg-card border-border"}`,children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"mt-0.5 shrink-0",children:a?(0,t.jsx)(t0,{className:"size-3.5 text-chart-5"}):(0,t.jsx)(C,{className:"size-3.5 text-chart-2"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,t.jsx)(g,{className:"size-3 text-muted-foreground shrink-0"}),(0,t.jsx)("span",{className:"text-xs font-mono text-foreground truncate",children:e.file}),e.taskId&&(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground/60 shrink-0",children:["(",e.taskId,")"]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-1.5 mb-1.5",children:[void 0!==r.lint&&(0,t.jsx)(t1,{label:"lint",passed:r.lint}),void 0!==r.typecheck&&(0,t.jsx)(t1,{label:"typecheck",passed:r.typecheck}),void 0!==r.test&&(0,t.jsx)(t1,{label:"test",passed:r.test})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 text-[10px] text-muted-foreground/50",children:[(0,t.jsx)(tX,{className:"size-2.5"}),(0,t.jsxs)("span",{children:[function(e){try{return new Date(e).toLocaleDateString([],{month:"short",day:"numeric"})}catch{return""}}(e.timestamp)," ",function(e){try{return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return e}}(e.timestamp)]})]})]})]})},`${e.timestamp}-${e.file}`)})})}let t3=null,t5=[{status:"READY",label:"Ready",colorClass:"text-chart-1 border-chart-1/30 bg-chart-1/5"},{status:"IN_PROGRESS",label:"In Progress",colorClass:"text-chart-4 border-chart-4/30 bg-chart-4/5"},{status:"DONE",label:"Done",colorClass:"text-chart-2 border-chart-2/30 bg-chart-2/5"},{status:"BLOCKED",label:"Blocked",colorClass:"text-chart-3 border-chart-3/30 bg-chart-3/5"}];function t4({task:e,selected:r,onClick:s}){return(0,t.jsxs)("button",{onClick:s,className:`w-full text-left p-3 rounded-lg border transition-colors ${r?"bg-accent border-ring":"bg-card border-border hover:bg-accent/50"}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsx)("span",{className:"text-xs font-mono text-muted-foreground",children:e.id}),"string"==typeof e.lastEvent?.meta?.commit&&(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[10px] text-chart-4/70 font-mono",children:[(0,t.jsx)(S,{className:"size-2.5"}),e.lastEvent.meta.commit.slice(0,7)]})]}),(0,t.jsx)("p",{className:"text-xs text-foreground line-clamp-2",children:e.description}),(0,t.jsx)("span",{className:"mt-1.5 inline-block text-[10px] text-muted-foreground/60",children:e.area})]})}function t6({tasks:e,selectedTaskId:r,onSelectTask:s}){return(0,t.jsx)("div",{className:"flex-1 flex gap-3 p-3 overflow-x-auto overflow-y-hidden min-w-0",children:t5.map(({status:a,label:n,colorClass:o})=>{let l=e.filter(e=>e.status===a);return(0,t.jsxs)("div",{className:`flex flex-col rounded-lg border ${o} min-w-[200px] flex-1`,children:[(0,t.jsxs)("div",{className:`px-3 py-2 flex items-center justify-between border-b ${o} rounded-t-lg`,children:[(0,t.jsx)("span",{className:"text-xs font-semibold uppercase tracking-wide",children:n}),(0,t.jsx)("span",{className:"text-xs opacity-60",children:l.length})]}),(0,t.jsx)(tv,{className:"flex-1",children:(0,t.jsx)("div",{className:"p-2 space-y-2",children:0===l.length?(0,t.jsx)("p",{className:"text-[11px] text-muted-foreground/40 text-center py-4",children:"Empty"}):l.map(e=>(0,t.jsx)(t4,{task:e,selected:r===e.id,onClick:()=>s(e)},e.id))})})]},a)})})}function t8({task:e,snapshot:s,qualityEvents:a,onUpdateStatus:n,onClose:o,actionToast:l,onDismissToast:i}){let[d,c]=(0,r.useState)(!1),u=e=>s?.tasks.filter(t=>t.dependsOn.includes(e))??[];return(0,t.jsxs)("div",{className:"flex flex-col h-full",children:[(0,t.jsxs)("div",{className:"px-4 py-3 border-b border-border bg-sidebar/50 shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)("span",{className:"text-xs font-mono text-muted-foreground flex-1",children:e.id}),(0,t.jsx)("span",{className:`text-[11px] px-2 py-0.5 rounded font-semibold ${tA(e.status)}`,children:e.status}),(0,t.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(e.id),c(!0),setTimeout(()=>c(!1),2e3)},className:"p-1 rounded hover:bg-accent transition-colors",title:"Copy task ID",children:d?(0,t.jsx)(tE,{className:"size-3 text-chart-2"}):(0,t.jsx)(tS,{className:"size-3 text-muted-foreground"})}),(0,t.jsx)("button",{onClick:o,className:"p-1 rounded hover:bg-accent transition-colors",title:"Clear selection",children:(0,t.jsx)(v,{className:"size-3 text-muted-foreground"})})]}),("READY"===e.status||"BLOCKED"===e.status)&&(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsxs)("button",{onClick:()=>n(e.id,"DONE"),className:"flex-1 flex items-center justify-center gap-1.5 px-2 py-1 rounded bg-chart-2/10 text-chart-2 hover:bg-chart-2/20 transition-colors text-xs font-medium border border-chart-2/20",children:[(0,t.jsx)(tE,{className:"size-3"}),"Mark Done"]}),(0,t.jsxs)("button",{onClick:()=>n(e.id,"BLOCKED"),className:"flex-1 flex items-center justify-center gap-1.5 px-2 py-1 rounded bg-chart-3/10 text-chart-3 hover:bg-chart-3/20 transition-colors text-xs font-medium border border-chart-3/20",children:[(0,t.jsx)(w,{className:"size-3"}),"Block"]})]}),l&&(0,t.jsxs)("div",{className:"mt-2 flex items-center gap-2 text-[11px] text-chart-2 bg-chart-2/10 rounded px-2 py-1",children:[(0,t.jsx)(tE,{className:"size-3 shrink-0"}),(0,t.jsx)("span",{className:"flex-1",children:l}),(0,t.jsx)("button",{onClick:i,className:"text-chart-2/60 hover:text-chart-2",children:"×"})]})]}),(0,t.jsx)(tv,{className:"flex-1",children:(0,t.jsxs)("div",{className:"p-4 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:"Description"}),(0,t.jsx)("p",{className:"text-sm text-foreground/90 leading-relaxed",children:e.description})]}),e.acceptanceCriteria&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:"Acceptance Criteria"}),(0,t.jsx)("p",{className:"text-xs text-foreground/80 leading-relaxed bg-muted/40 rounded p-2",children:e.acceptanceCriteria})]}),(0,t.jsx)("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:(0,t.jsxs)("span",{children:["Area: ",(0,t.jsx)("span",{className:"text-foreground",children:e.area})]})}),e.dependsOn.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:"Dependencies"}),(0,t.jsx)("div",{className:"space-y-1",children:e.dependsOn.map(e=>{let r=s?.tasks.find(t=>t.id===e);return(0,t.jsxs)("div",{className:"flex items-center justify-between p-2 rounded bg-card border border-border",children:[(0,t.jsx)("span",{className:"text-xs font-mono text-foreground",children:e}),r&&(0,t.jsx)("span",{className:`text-[11px] px-1.5 py-0.5 rounded font-semibold ${tA(r.status)}`,children:r.status})]},e)})})]}),u(e.id).length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:"Blocks"}),(0,t.jsx)("div",{className:"space-y-1",children:u(e.id).map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between p-2 rounded bg-card border border-border",children:[(0,t.jsx)("span",{className:"text-xs font-mono text-foreground",children:e.id}),(0,t.jsx)("span",{className:`text-[11px] px-1.5 py-0.5 rounded font-semibold ${tA(e.status)}`,children:e.status})]},e.id))})]}),e.lastEvent&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:"Last Execution"}),(0,t.jsxs)("div",{className:"bg-card rounded-lg p-3 space-y-2 text-sm border border-border",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-xs font-mono text-foreground",children:e.lastEvent.agent}),(0,t.jsx)("span",{className:`px-1.5 py-0.5 rounded text-[11px] font-semibold ${tA(e.lastEvent.status)}`,children:e.lastEvent.status})]}),(0,t.jsx)("span",{className:"text-muted-foreground text-[11px]",children:new Date(e.lastEvent.timestamp).toLocaleString()})]}),e.lastEvent.reason&&(0,t.jsx)("div",{className:"text-xs text-chart-3 bg-chart-3/10 p-2 rounded",children:e.lastEvent.reason}),e.lastEvent.meta?.duration!=null&&(0,t.jsxs)("div",{className:"flex items-center gap-4 text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(tX,{className:"size-3"}),String(e.lastEvent.meta.duration),"s"]}),null!=e.lastEvent.meta.stepCount&&(0,t.jsxs)("span",{children:[String(e.lastEvent.meta.stepCount)," steps"]})]}),"string"==typeof e.lastEvent.meta?.commit&&(0,t.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 bg-background rounded",children:[(0,t.jsx)(S,{className:"size-3 text-chart-4 shrink-0"}),(0,t.jsx)("code",{className:"text-xs text-chart-4 font-mono",children:String(e.lastEvent.meta.commit).slice(0,7)}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground truncate",children:String(e.lastEvent.meta.commitMsg||"")})]}),Array.isArray(e.lastEvent.meta?.steps)&&(0,t.jsx)("div",{className:"pt-2 border-t border-border space-y-1",children:e.lastEvent.meta.steps.map(e=>(0,t.jsxs)("div",{className:"flex items-start gap-2 py-1 px-1.5 rounded hover:bg-background/50",children:[(0,t.jsxs)("div",{className:"mt-0.5",children:["thought"===e.type&&(0,t.jsx)(tV,{className:"size-3 text-chart-4"}),"tool_call"===e.type&&(0,t.jsx)(tG,{className:"size-3 text-chart-1"}),"observation"===e.type&&(0,t.jsx)(tY,{className:"size-3 text-chart-2"}),"error"===e.type&&(0,t.jsx)(w,{className:"size-3 text-chart-5"})]}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-foreground truncate",children:e.name}),(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground/60 shrink-0",children:[e.duration,"ms"]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground/80 truncate",children:e.summary})]})]},`${e.type}-${e.name}`))}),e.lastEvent.meta&&!Array.isArray(e.lastEvent.meta.steps)&&(0,t.jsx)("div",{className:"pt-2 border-t border-border",children:(0,t.jsx)("pre",{className:"text-xs text-muted-foreground bg-background p-2 rounded overflow-auto",children:JSON.stringify(e.lastEvent.meta,null,2)})})]})]}),a.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:"Quality Checks"}),(0,t.jsx)(t2,{events:a})]})]})})]})}function t7({searchQuery:e,sidebarCollapsed:s}){let{data:a,refresh:n}=function(){let[e,t]=(0,r.useState)(null),s=(0,r.useCallback)(async()=>{try{let e=await fetch("/snapshot");if(!e.ok)return;let r=await e.json();t3=r,t(r)}catch{}},[]);return(0,r.useEffect)(()=>{s()},[s]),tU(e=>{"plan"===e.type&&s()}),{data:e,refresh:s}}(),[o,l]=(0,r.useState)(null),[i,d]=(0,r.useState)(new Set),[c,u]=(0,r.useState)([]),[m,x]=(0,r.useState)(null),[p,h]=(0,r.useState)(!1),[f,g]=(0,r.useState)(""),[b,j]=(0,r.useState)(""),[y,N]=(0,r.useState)(""),[k,w]=(0,r.useState)(""),[C,E]=(0,r.useState)(!1),[z,T]=(0,r.useState)(()=>localStorage.getItem("plan-view-mode")??"list");(0,r.useEffect)(()=>{localStorage.setItem("plan-view-mode",z)},[z]);let M=async()=>{if(f.trim()){E(!0);try{let e={description:f.trim()};b.trim()&&(e.slice=b.trim()),y.trim()&&(e.area=y.trim()),k.trim()&&(e.ac=k.trim()),(await fetch("/plan/task",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(g(""),j(""),N(""),w(""),h(!1),n())}catch{}finally{E(!1)}}},$=async(e,t)=>{try{(await fetch(`/plan/task/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:t})})).ok&&(x(`Task ${e} marked ${t}`),setTimeout(()=>x(null),5e3),n())}catch{}};if((0,r.useEffect)(()=>{a?.snapshot&&d(e=>e.size>0?e:new Set(Object.keys(a.snapshot.slices)))},[a]),(0,r.useEffect)(()=>{if(!o)return void u([]);let e=new AbortController;return fetch(`/quality-timeline?taskId=${encodeURIComponent(o.id)}`,{signal:e.signal}).then(e=>e.ok?e.json():{events:[]}).then(e=>u(e.events??[])).catch(()=>u([])),()=>e.abort()},[o?.id]),!a||!a.snapshot)return(0,t.jsx)("div",{className:"flex-1 p-8",children:(0,t.jsx)("div",{className:"max-w-4xl mx-auto",children:(0,t.jsxs)("div",{className:"bg-destructive/10 border border-destructive rounded-lg p-6",children:[(0,t.jsx)("h2",{className:"text-xl font-bold text-destructive-foreground mb-4",children:a?.queueErrors?.length?"Queue Parse Errors":"Plan Mode Not Available"}),(0,t.jsx)("div",{className:"space-y-2",children:a?.queueErrors?.map(e=>(0,t.jsx)("div",{className:"text-destructive-foreground text-sm",children:e},e))||(0,t.jsx)("div",{className:"text-muted-foreground text-sm",children:'Run "claudedash init" to set up Plan mode'})})]})})});let R=a.snapshot,D=R.tasks.filter(t=>t.description.toLowerCase().includes(e.toLowerCase())||t.id.toLowerCase().includes(e.toLowerCase())),A=D.reduce((e,t)=>(e[t.slice]||(e[t.slice]=[]),e[t.slice].push(t),e),{});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:`bg-sidebar border-r border-sidebar-border flex flex-col overflow-hidden transition-all duration-300 ${s?"w-0 min-w-0 border-r-0":"w-72 min-w-[280px]"}`,children:[(0,t.jsxs)("div",{className:"px-3 py-2 border-b border-sidebar-border shrink-0 flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Tasks"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-[10px] flex-1",children:[(0,t.jsxs)("span",{className:"text-muted-foreground/50",children:[R.summary.total,"T"]}),(0,t.jsxs)("span",{className:"text-chart-2 font-medium",children:[R.summary.done,"✓"]}),R.summary.failed>0&&(0,t.jsxs)("span",{className:"text-chart-5 font-medium",children:[R.summary.failed,"✗"]}),R.summary.blocked>0&&(0,t.jsxs)("span",{className:"text-chart-3 font-medium",children:[R.summary.blocked,"⊘"]}),(0,t.jsxs)("span",{className:"text-chart-1 font-medium",children:[R.summary.ready,"→"]})]}),(0,t.jsxs)("div",{className:"flex items-center bg-muted rounded p-0.5 gap-0.5",children:[(0,t.jsx)("button",{onClick:()=>T("list"),title:"List view",className:`p-1 rounded transition-colors ${"list"===z?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:(0,t.jsx)(tQ,{className:"size-3"})}),(0,t.jsx)("button",{onClick:()=>T("kanban"),title:"Kanban view",className:`p-1 rounded transition-colors ${"kanban"===z?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:(0,t.jsx)(tJ,{className:"size-3"})})]})]}),(0,t.jsx)("div",{className:"px-3 py-2 border-b border-sidebar-border shrink-0",children:p?(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("textarea",{value:f,onChange:e=>g(e.target.value),onKeyDown:e=>{"Escape"===e.key&&(h(!1),g(""),j(""),N(""),w(""))},placeholder:"Description (required)...",rows:2,className:"w-full bg-background border border-border rounded px-2 py-1.5 text-xs text-foreground placeholder-muted-foreground focus:outline-none focus:border-ring resize-none"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsxs)("select",{value:b,onChange:e=>j(e.target.value),className:"flex-1 bg-background border border-border rounded px-2 py-1.5 text-xs text-foreground focus:outline-none focus:border-ring",children:[(0,t.jsx)("option",{value:"",children:"Slice (last)"}),Object.keys(R.slices).map(e=>(0,t.jsx)("option",{value:e,children:e},e))]}),(0,t.jsx)("input",{type:"text",value:y,onChange:e=>N(e.target.value),placeholder:"Area",className:"flex-1 bg-background border border-border rounded px-2 py-1.5 text-xs text-foreground placeholder-muted-foreground focus:outline-none focus:border-ring"})]}),(0,t.jsx)("input",{type:"text",value:k,onChange:e=>w(e.target.value),placeholder:"Acceptance criteria (optional)",className:"w-full bg-background border border-border rounded px-2 py-1.5 text-xs text-foreground placeholder-muted-foreground focus:outline-none focus:border-ring"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)("button",{onClick:()=>void M(),disabled:!f.trim()||C,className:"flex-1 text-xs py-1 rounded bg-chart-2/10 text-chart-2 border border-chart-2/20 hover:bg-chart-2/20 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:C?"Adding…":"Add task"}),(0,t.jsx)("button",{onClick:()=>{h(!1),g(""),j(""),N(""),w("")},className:"text-xs py-1 px-2 rounded text-muted-foreground hover:text-foreground transition-colors",children:(0,t.jsx)(v,{className:"size-3"})})]})]}):(0,t.jsxs)("button",{onClick:()=>h(!0),className:"w-full flex items-center justify-center gap-1.5 text-xs text-muted-foreground hover:text-foreground py-1.5 border border-dashed border-border rounded hover:border-ring transition-colors",children:[(0,t.jsx)(tZ,{className:"size-3"}),"Add task"]})}),(0,t.jsx)(tv,{className:"flex-1",children:(0,t.jsx)("div",{className:"p-3 space-y-3",children:Object.entries(A).map(([e,r])=>(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("button",{onClick:()=>{d(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})},className:"w-full flex items-center justify-between px-2 py-1.5 bg-muted rounded text-xs font-semibold text-muted-foreground hover:bg-muted/80 transition-colors",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[i.has(e)?(0,t.jsx)(tK,{className:"size-3.5"}):(0,t.jsx)(tH,{className:"size-3.5"}),(0,t.jsxs)("span",{children:[e," • ",r.length," tasks"]})]}),(0,t.jsxs)("span",{className:"text-muted-foreground/60",children:[r.filter(e=>"DONE"===e.status).length,"/",r.length]})]}),i.has(e)&&r.map(e=>(0,t.jsxs)("button",{onClick:()=>l(e),className:`w-full text-left p-3 rounded-lg border transition-colors ${o?.id===e.id?"bg-accent border-ring":"bg-card border-border hover:bg-accent/50"}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1.5",children:[(0,t.jsx)("span",{className:"text-sm font-mono text-foreground",children:e.id}),(0,t.jsx)("span",{className:`text-xs px-2 py-0.5 rounded font-semibold ${tA(e.status)}`,children:e.status})]}),(0,t.jsx)("div",{className:"text-sm text-muted-foreground line-clamp-2",children:e.description}),(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground/60",children:e.area}),"string"==typeof e.lastEvent?.meta?.commit&&(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[10px] text-chart-4/70 font-mono",children:[(0,t.jsx)(S,{className:"size-2.5"}),String(e.lastEvent.meta.commit).slice(0,7)]})]})]},e.id))]},e))})})]}),"kanban"===z&&(0,t.jsx)(t6,{tasks:D,selectedTaskId:o?.id,onSelectTask:l}),(0,t.jsx)("div",{className:`border-l border-border flex flex-col overflow-hidden ${"kanban"===z?"w-[380px] min-w-[380px] shrink-0":"flex-1"}`,children:o?(0,t.jsx)(t8,{task:o,snapshot:R,qualityEvents:c,onUpdateStatus:$,onClose:()=>l(null),actionToast:m,onDismissToast:()=>x(null)}):(0,t.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 text-muted-foreground/40",children:[(0,t.jsx)(tJ,{className:"size-8 opacity-20"}),(0,t.jsx)("p",{className:"text-xs",children:"Select a task to view details"})]})})]})}var t9=e.i(56640);let re=`
4
+ Mark each task in_progress before starting, completed after finishing.`;(0,r.useEffect)(()=>{let e=d.some(e=>e.tasks.length>0);if(e){b(!1),k.current&&clearTimeout(k.current);return}return d.length>0&&!e&&(k.current&&clearTimeout(k.current),k.current=setTimeout(()=>b(!0),3e4)),()=>{k.current&&clearTimeout(k.current)}},[d]);let I=e=>{let t=`claude resume ${e}`;navigator.clipboard.writeText(t),fetch(`/sessions/${e}/resume-cmd`,{method:"POST"}).catch(()=>{}),N(t),setTimeout(()=>N(null),3e3)},_=(0,r.useCallback)((e,t)=>{fetch(`/sessions/${e}/tasks/${t}`,{method:"DELETE"}).catch(()=>{})},[]),U=d.filter(e=>null!=e.contextHealth),F=U.length>0?{percentage:a=Math.max(...U.map(e=>e.contextHealth.percentage)),warningLevel:a>=75?"critical":a>=65?"warn":"safe"}:null;if(0===d.length)return(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,t.jsx)(tN,{lines:["Start a Claude Code session to see tasks here","npx claudedash start → launch dashboard","Agent uses TodoWrite to track progress","Sessions appear here in real-time"]})});let W=(c?.tasks||[]).filter(t=>t.subject.toLowerCase().includes(e.toLowerCase())||t.description.toLowerCase().includes(e.toLowerCase())||t.id.toLowerCase().includes(e.toLowerCase())),B=W.filter(e=>"pending"===e.status),q=W.filter(e=>"in_progress"===e.status),H=W.filter(e=>"completed"===e.status),K=e=>e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(0)}K`:String(e),V=e=>e.inputTokens+e.outputTokens+e.cacheCreationTokens+e.cacheReadTokens;return(0,t.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden",children:[y&&(0,t.jsxs)("div",{className:"bg-chart-4/10 border-b border-chart-4/30 px-4 py-2 flex items-center gap-3 text-xs shrink-0",children:[(0,t.jsx)(tS,{className:"size-3 text-chart-4 shrink-0"}),(0,t.jsx)("span",{className:"text-foreground/80",children:"Copied to clipboard:"}),(0,t.jsx)("code",{className:"font-mono text-chart-4 bg-chart-4/10 px-1.5 py-0.5 rounded",children:y}),(0,t.jsx)("button",{onClick:()=>N(null),className:"ml-auto text-muted-foreground hover:text-foreground",children:"×"})]}),g&&(0,t.jsxs)("div",{className:"bg-chart-3/10 border-b border-chart-3/30 px-4 py-2.5 flex items-start gap-3 text-xs shrink-0",children:[(0,t.jsx)("span",{className:"text-chart-3 mt-0.5 shrink-0",children:"⚠"}),(0,t.jsxs)("div",{className:"flex-1 text-foreground/80",children:[(0,t.jsx)("span",{className:"font-semibold text-foreground",children:"Agent setup missing."})," ","Sessions are visible but no tasks have appeared in 30 seconds. Add this to your project's"," ",(0,t.jsx)("code",{className:"bg-muted px-1 rounded",children:"CLAUDE.md"}),":",(0,t.jsx)("div",{className:"mt-1.5 font-mono bg-muted/60 rounded px-2 py-1 text-[10px] leading-relaxed whitespace-pre",children:O})]}),(0,t.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(O),v(!0),setTimeout(()=>v(!1),2e3)},className:"flex items-center gap-1.5 shrink-0 text-chart-3 hover:text-foreground transition-colors border border-chart-3/30 rounded px-2 py-1",children:j?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(tE,{className:"size-3"}),(0,t.jsx)("span",{children:"Copied"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(tS,{className:"size-3"}),(0,t.jsx)("span",{children:"Copy"})]})}),(0,t.jsx)("button",{onClick:()=>b(!1),className:"text-muted-foreground hover:text-foreground shrink-0 ml-1",children:"×"})]}),(0,t.jsxs)("div",{className:"flex-1 flex overflow-hidden",children:[(0,t.jsxs)("div",{className:`bg-sidebar border-r border-sidebar-border flex flex-col overflow-hidden transition-all duration-300 ${s?"w-0 border-r-0":"w-[220px]"}`,children:[(0,t.jsxs)("div",{className:"p-3 border-b border-sidebar-border flex items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Sessions"}),m&&m.total>m.filtered&&!l&&(0,t.jsxs)("button",{onClick:()=>i(!0),className:"text-[9px] text-muted-foreground/60 hover:text-muted-foreground underline shrink-0",title:`${m.total-m.filtered} older sessions hidden`,children:["+",m.total-m.filtered," older"]}),l&&(0,t.jsx)("button",{onClick:()=>i(!1),className:"text-[9px] text-muted-foreground/60 hover:text-muted-foreground underline shrink-0",children:"7d only"})]}),(0,t.jsx)(tv,{className:"flex-1",children:(0,t.jsx)("div",{className:"p-2 space-y-1",children:d.map(e=>{let r,s;return(0,t.jsxs)("div",{className:"relative group",children:[(0,t.jsxs)("button",{onClick:()=>{u(e),p(null)},className:`w-full text-left p-2.5 rounded-lg transition-colors ${c?.id===e.id?"bg-accent border border-ring":"hover:bg-accent/50 border border-transparent"}`,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[e.tasks.some(e=>"in_progress"===e.status)&&(0,t.jsxs)("span",{className:"relative flex size-2",children:[(0,t.jsx)("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-chart-2 opacity-75"}),(0,t.jsx)("span",{className:"relative inline-flex rounded-full size-2 bg-chart-2"})]}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground truncate",children:e.projectName||e.id.slice(0,8)})]}),e.projectName&&(0,t.jsx)("div",{className:"text-[10px] text-muted-foreground/60 font-mono truncate mb-1",children:e.id.slice(0,8)}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"flex-1 bg-muted rounded-full h-1.5",children:(0,t.jsx)("div",{className:"bg-chart-2 h-1.5 rounded-full transition-all",style:{width:`${0===e.tasks.length?0:Math.round(e.tasks.filter(e=>"completed"===e.status).length/e.tasks.length*100)}%`}})}),(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground shrink-0",children:[e.tasks.filter(e=>"completed"===e.status).length,"/",e.tasks.length]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between text-[10px] text-muted-foreground/60 mt-1",children:[(0,t.jsx)("span",{children:(e=>{let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;let r=Math.floor(t/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`})(e.updatedAt)}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[e.tokenUsage&&(0,t.jsxs)("span",{title:`In: ${K(e.tokenUsage.inputTokens)} | Out: ${K(e.tokenUsage.outputTokens)} | Cache: ${K(e.tokenUsage.cacheReadTokens)}`,children:[K(V(e.tokenUsage))," tok"]}),(0,t.jsx)(tR,{health:e.contextHealth})]})]}),(r=L(e.id),s=(e=>{let t=L(e.id);if(!t||!e.contextHealth?.maxTokens)return null;let r=e.contextHealth.maxTokens-e.contextHealth.tokensUsed;return r<=0?0:Math.round(r/t)})(e),r?(0,t.jsxs)("div",{className:"text-[9px] text-muted-foreground/50 mt-0.5 leading-tight",children:[K(Math.round(r)),"/min",null!=s&&(0,t.jsxs)("span",{className:"ml-1 text-chart-3",children:["~",s,"min"]})]}):null),((e.linesAdded??0)>0||(e.gitCommits??0)>0)&&(0,t.jsxs)("div",{className:"flex items-center gap-2 text-[10px] mt-1",children:[(e.linesAdded??0)>0&&(0,t.jsxs)("span",{className:"text-chart-2",children:["+",K(e.linesAdded)," lines"]}),(e.gitCommits??0)>0&&(0,t.jsxs)("span",{className:"text-chart-1",children:[e.gitCommits," commit",1!==e.gitCommits?"s":""]}),e.languages&&Object.keys(e.languages).slice(0,2).map(e=>(0,t.jsx)("span",{className:"text-muted-foreground/50",children:e},e))]})]}),(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),I(e.id)},title:`Copy 'claude resume ${e.id}' to clipboard`,className:"absolute top-2 right-2 p-1 rounded opacity-0 group-hover:opacity-100 hover:bg-accent transition-all text-muted-foreground hover:text-foreground",children:(0,t.jsx)(tS,{className:"size-2.5"})})]},e.id)})})}),z.filter(e=>!d.some(t=>t.id===e.sessionId)).length>0&&(0,t.jsxs)("div",{className:"border-t border-sidebar-border p-2 space-y-1 shrink-0",children:[(0,t.jsx)("span",{className:"text-[9px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Resume"}),z.filter(e=>!d.some(t=>t.id===e.sessionId)).slice(0,3).map(e=>(0,t.jsxs)("button",{onClick:()=>I(e.sessionId),title:`Copy: claude resume ${e.sessionId}`,className:"w-full text-left group flex items-start gap-1.5 p-1.5 rounded hover:bg-accent/50 transition-colors",children:[(0,t.jsx)(tS,{className:"size-2.5 mt-0.5 shrink-0 text-muted-foreground group-hover:text-foreground"}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("div",{className:"text-[10px] font-medium text-foreground truncate leading-tight",children:e.projectName??e.sessionId.slice(0,8)}),(0,t.jsx)("div",{className:"text-[9px] text-muted-foreground truncate leading-tight",children:e.lastPrompt.length>40?e.lastPrompt.slice(0,40)+"…":e.lastPrompt})]})]},e.sessionId))]}),M&&(o=(n=Math.floor((Date.now()-new Date(M.at).getTime())/6e4))<1?"just now":n<60?`${n}m ago`:`${Math.floor(n/60)}h ago`,(0,t.jsx)("div",{className:"border-t border-sidebar-border px-2 py-1.5 shrink-0",children:(0,t.jsxs)("div",{className:"text-[9px] text-muted-foreground leading-tight",children:[(0,t.jsx)("span",{className:"font-medium text-chart-4",children:"compact"})," ",o," · state saved"]})})),R?.active&&null!=R.minutesRemaining&&(0,t.jsxs)("div",{className:"border-t border-sidebar-border px-2 py-1.5 shrink-0",children:[(0,t.jsx)("span",{className:"text-[9px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Billing Block"}),(0,t.jsxs)("div",{className:"text-[9px] text-chart-3 mt-0.5 leading-tight",children:["~",R.minutesRemaining,"min left",null!=R.estimatedCostUSD&&null!=R.minutesElapsed&&R.minutesElapsed>0&&(0,t.jsxs)("span",{className:"ml-1 text-muted-foreground",children:["· est. $",(R.estimatedCostUSD*(1+R.minutesRemaining/R.minutesElapsed)).toFixed(2)]})]})]}),(w||S.length>0)&&(0,t.jsxs)("div",{className:"border-t border-sidebar-border p-2 space-y-2 shrink-0",children:[w&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("span",{className:"text-[9px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Queue"}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-1 text-[9px]",children:[w.ready>0&&(0,t.jsxs)("span",{className:"px-1.5 py-0.5 rounded bg-chart-2/15 text-chart-2 font-medium",children:[w.ready," READY"]}),w.done>0&&(0,t.jsxs)("span",{className:"px-1.5 py-0.5 rounded bg-muted text-muted-foreground",children:[w.done," DONE"]}),w.blocked>0&&(0,t.jsxs)("span",{className:"px-1.5 py-0.5 rounded bg-chart-5/15 text-chart-5 font-semibold",children:[w.blocked," BLOCKED"]}),w.failed>0&&(0,t.jsxs)("span",{className:"px-1.5 py-0.5 rounded bg-destructive/15 text-destructive",children:[w.failed," FAILED"]})]})]}),S.length>0&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("span",{className:"text-[9px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Agents"}),S.map(e=>(0,t.jsxs)("div",{className:`text-[9px] leading-tight ${e.isStale?"opacity-40":""}`,children:[(0,t.jsx)("span",{className:"font-medium text-foreground truncate block",children:e.name}),e.taskId&&(0,t.jsx)("span",{className:"text-muted-foreground",children:e.taskId})]},e.agentId))]})]})]}),(0,t.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden",children:[F&&"safe"!==F.warningLevel&&(0,t.jsxs)("div",{className:`px-4 py-1.5 flex items-center gap-2 text-xs border-b shrink-0 ${"critical"===F.warningLevel?"bg-chart-5/10 border-chart-5/20 text-chart-5":"bg-chart-3/10 border-chart-3/20 text-chart-3"}`,children:[(0,t.jsx)(tR,{health:{...F,tokensUsed:0}}),(0,t.jsxs)("span",{children:["Highest context across ",U.length," session",1!==U.length?"s":"",":"," ",F.percentage,"% (",F.warningLevel,")"]})]}),c?(0,t.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden",children:[c.tokenUsage&&(0,t.jsxs)("div",{className:"bg-sidebar border-b border-sidebar-border px-4 py-2 flex items-center gap-6 text-xs shrink-0",children:[(0,t.jsx)("span",{className:"text-muted-foreground font-medium",children:"Tokens:"}),(0,t.jsxs)("span",{className:"text-foreground",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"In "}),K(c.tokenUsage.inputTokens)]}),(0,t.jsxs)("span",{className:"text-foreground",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Out "}),K(c.tokenUsage.outputTokens)]}),(0,t.jsxs)("span",{className:"text-foreground",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Cache Write "}),K(c.tokenUsage.cacheCreationTokens)]}),(0,t.jsxs)("span",{className:"text-foreground",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Cache Read "}),K(c.tokenUsage.cacheReadTokens)]}),(0,t.jsxs)("span",{className:"text-muted-foreground/60",children:["Total:"," ",K(V(c.tokenUsage))]}),c.contextHealth&&(0,t.jsx)("div",{className:"ml-auto w-48",children:(0,t.jsx)(tD,{health:c.contextHealth})})]}),(0,t.jsxs)("div",{className:"flex-1 flex overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex-1 flex gap-4 p-4 overflow-x-auto",children:[(0,t.jsx)(tq,{title:"Pending",count:B.length,tasks:B,statusColor:"chart-1",selectedTask:x,setSelectedTask:p,sessionId:c?.id??"",onDismiss:e=>_(c?.id??"",e)}),(0,t.jsx)(tq,{title:"In Progress",count:q.length,tasks:q,statusColor:"chart-4",selectedTask:x,setSelectedTask:p,sessionId:c?.id??"",onDismiss:e=>_(c?.id??"",e)}),(0,t.jsx)(tq,{title:"Completed",count:H.length,tasks:H,statusColor:"chart-2",selectedTask:x,setSelectedTask:p,sessionId:c?.id??"",onDismiss:e=>_(c?.id??"",e)})]}),x&&(0,t.jsxs)("div",{className:"w-[350px] bg-sidebar border-l border-border flex flex-col shrink-0",children:[(0,t.jsxs)("div",{className:"p-4 border-b border-border flex items-center justify-between",children:[(0,t.jsx)("span",{className:`text-xs px-2 py-0.5 rounded font-semibold ${tA(x.status)}`,children:function(e){switch(e){case"pending":return"PENDING";case"in_progress":return"IN PROGRESS";case"completed":return"COMPLETED";default:return e}}(x.status)}),(0,t.jsx)("button",{onClick:()=>p(null),className:"text-muted-foreground hover:text-foreground text-sm",children:"×"})]}),(0,t.jsx)(tv,{className:"flex-1",children:(0,t.jsxs)("div",{className:"p-4 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground mb-1",children:x.subject}),"in_progress"===x.status&&x.activeForm&&(0,t.jsx)("p",{className:"text-xs text-chart-4 italic",children:x.activeForm})]}),x.description&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-xs font-semibold text-muted-foreground uppercase mb-1",children:"Description"}),(0,t.jsx)("p",{className:"text-xs text-foreground/80 leading-relaxed whitespace-pre-wrap",children:x.description})]}),x.blockedBy.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-xs font-semibold text-muted-foreground uppercase mb-1",children:"Blocked By"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:x.blockedBy.map(e=>(0,t.jsxs)("span",{className:"text-xs bg-chart-3/20 text-chart-3 px-2 py-0.5 rounded",children:["Task #",e]},e))})]}),x.blocks.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-xs font-semibold text-muted-foreground uppercase mb-1",children:"Blocks"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:x.blocks.map(e=>(0,t.jsxs)("span",{className:"text-xs bg-muted text-muted-foreground px-2 py-0.5 rounded",children:["Task #",e]},e))})]}),(0,t.jsxs)("div",{className:"pt-2 border-t border-border space-y-2",children:[(0,t.jsx)("button",{onClick:()=>{var e;return e=x.id,void(navigator.clipboard.writeText(e),f(!0),setTimeout(()=>f(!1),2e3))},className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:h?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(tE,{className:"size-3 text-chart-2"}),(0,t.jsx)("span",{className:"text-chart-2",children:"Copied"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(tS,{className:"size-3"}),(0,t.jsxs)("span",{children:["Copy ID: ",x.id]})]})}),c&&(0,t.jsxs)("button",{onClick:()=>I(c.id),className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",title:`Copy 'claude resume ${c.id}' to clipboard`,children:[(0,t.jsx)(tS,{className:"size-3"}),(0,t.jsx)("span",{children:"Resume session"})]})]})]})})]})]})]}):(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,t.jsx)("div",{className:"text-center",children:(0,t.jsx)("p",{className:"text-muted-foreground",children:"Select a session from the sidebar"})})})]})]})]})}function tq({title:e,count:r,tasks:s,statusColor:a,selectedTask:n,setSelectedTask:o,sessionId:l,onDismiss:i}){return(0,t.jsxs)("div",{className:"flex-1 min-w-[250px] flex flex-col",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3 px-1",children:[(0,t.jsx)("div",{className:`size-2 rounded-full bg-${a}`}),(0,t.jsx)("span",{className:"text-xs font-semibold text-muted-foreground uppercase",children:e}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground/60 bg-muted px-1.5 py-0.5 rounded",children:r})]}),(0,t.jsx)(tv,{className:"flex-1",children:(0,t.jsx)("div",{className:"space-y-2 pr-1",children:s.map(e=>(0,t.jsxs)("div",{className:"group relative",children:[(0,t.jsxs)("button",{onClick:()=>o(e),className:`w-full text-left p-3 rounded-lg border transition-colors ${n?.id===e.id?"bg-accent border-ring":"bg-card border-border hover:bg-accent/50"}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground font-mono",children:["#",e.id]}),e.isStale&&(0,t.jsx)("span",{className:"text-[9px] font-medium px-1 py-0.5 rounded bg-muted text-muted-foreground/70 uppercase tracking-wide",children:"stale"})]}),(0,t.jsx)("p",{className:"text-sm text-foreground line-clamp-2 mb-1",children:e.subject}),"in_progress"===e.status&&e.activeForm&&(0,t.jsx)("p",{className:"text-xs text-chart-4 italic truncate",children:e.activeForm}),e.blockedBy.length>0&&(0,t.jsx)("div",{className:"flex items-center gap-1 mt-1.5",children:(0,t.jsxs)("span",{className:"text-[10px] text-chart-3",children:["Blocked by #",e.blockedBy[0],e.blockedBy.length>1?` +${e.blockedBy.length-1}`:""]})})]}),(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),i(e.id)},title:"Dismiss task",className:"absolute top-1.5 right-1.5 opacity-0 group-hover:opacity-100 transition-opacity p-0.5 rounded hover:bg-muted text-muted-foreground/60 hover:text-foreground",children:(0,t.jsx)(v,{className:"size-3"})})]},e.id))})})]})}let tH=l("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),tK=l("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),tV=l("brain",[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]),tG=l("wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]),tY=l("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),tX=l("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),tQ=l("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]),tJ=l("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]),tZ=l("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),t0=l("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);function t1({label:e,passed:r}){return(0,t.jsxs)("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded text-[10px] font-semibold ${r?"bg-chart-2/15 text-chart-2":"bg-chart-5/15 text-chart-5"}`,children:[r?(0,t.jsx)(C,{className:"size-2.5"}):(0,t.jsx)(t0,{className:"size-2.5"}),e]})}function t2({events:e}){return 0===e.length?(0,t.jsx)("div",{className:"py-8",children:(0,t.jsx)(tN,{lines:["No quality checks logged yet",'Add "quality": {"lint": true} to meta',"Track lint, typecheck, and test results","Results appear here per task"]})}):(0,t.jsx)("div",{className:"space-y-2",children:e.map(e=>{let r=e.checks,s=Object.values(r).every(Boolean),a=Object.values(r).some(e=>!1===e);return(0,t.jsx)("div",{className:`p-3 rounded-lg border transition-colors ${a?"bg-chart-5/5 border-chart-5/20":s?"bg-chart-2/5 border-chart-2/20":"bg-card border-border"}`,children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"mt-0.5 shrink-0",children:a?(0,t.jsx)(t0,{className:"size-3.5 text-chart-5"}):(0,t.jsx)(C,{className:"size-3.5 text-chart-2"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,t.jsx)(g,{className:"size-3 text-muted-foreground shrink-0"}),(0,t.jsx)("span",{className:"text-xs font-mono text-foreground truncate",children:e.file}),e.taskId&&(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground/60 shrink-0",children:["(",e.taskId,")"]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-1.5 mb-1.5",children:[void 0!==r.lint&&(0,t.jsx)(t1,{label:"lint",passed:r.lint}),void 0!==r.typecheck&&(0,t.jsx)(t1,{label:"typecheck",passed:r.typecheck}),void 0!==r.test&&(0,t.jsx)(t1,{label:"test",passed:r.test})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 text-[10px] text-muted-foreground/50",children:[(0,t.jsx)(tX,{className:"size-2.5"}),(0,t.jsxs)("span",{children:[function(e){try{return new Date(e).toLocaleDateString([],{month:"short",day:"numeric"})}catch{return""}}(e.timestamp)," ",function(e){try{return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return e}}(e.timestamp)]})]})]})]})},`${e.timestamp}-${e.file}`)})})}let t3=null,t5=[{status:"READY",label:"Ready",colorClass:"text-chart-1 border-chart-1/30 bg-chart-1/5"},{status:"IN_PROGRESS",label:"In Progress",colorClass:"text-chart-4 border-chart-4/30 bg-chart-4/5"},{status:"DONE",label:"Done",colorClass:"text-chart-2 border-chart-2/30 bg-chart-2/5"},{status:"BLOCKED",label:"Blocked",colorClass:"text-chart-3 border-chart-3/30 bg-chart-3/5"}];function t4({task:e,selected:r,onClick:s}){return(0,t.jsxs)("button",{onClick:s,className:`w-full text-left p-3 rounded-lg border transition-colors ${r?"bg-accent border-ring":"bg-card border-border hover:bg-accent/50"}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsx)("span",{className:"text-xs font-mono text-muted-foreground",children:e.id}),"string"==typeof e.lastEvent?.meta?.commit&&(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[10px] text-chart-4/70 font-mono",children:[(0,t.jsx)(S,{className:"size-2.5"}),e.lastEvent.meta.commit.slice(0,7)]})]}),(0,t.jsx)("p",{className:"text-xs text-foreground line-clamp-2",children:e.description}),(0,t.jsx)("span",{className:"mt-1.5 inline-block text-[10px] text-muted-foreground/60",children:e.area})]})}function t6({tasks:e,selectedTaskId:r,onSelectTask:s}){return(0,t.jsx)("div",{className:"flex-1 flex gap-3 p-3 overflow-x-auto overflow-y-hidden min-w-0",children:t5.map(({status:a,label:n,colorClass:o})=>{let l=e.filter(e=>e.status===a);return(0,t.jsxs)("div",{className:`flex flex-col rounded-lg border ${o} min-w-[200px] flex-1`,children:[(0,t.jsxs)("div",{className:`px-3 py-2 flex items-center justify-between border-b ${o} rounded-t-lg`,children:[(0,t.jsx)("span",{className:"text-xs font-semibold uppercase tracking-wide",children:n}),(0,t.jsx)("span",{className:"text-xs opacity-60",children:l.length})]}),(0,t.jsx)(tv,{className:"flex-1",children:(0,t.jsx)("div",{className:"p-2 space-y-2",children:0===l.length?(0,t.jsx)("p",{className:"text-[11px] text-muted-foreground/40 text-center py-4",children:"Empty"}):l.map(e=>(0,t.jsx)(t4,{task:e,selected:r===e.id,onClick:()=>s(e)},e.id))})})]},a)})})}function t8({task:e,snapshot:s,qualityEvents:a,onUpdateStatus:n,onClose:o,actionToast:l,onDismissToast:i}){let[d,c]=(0,r.useState)(!1),u=e=>s?.tasks.filter(t=>t.dependsOn.includes(e))??[];return(0,t.jsxs)("div",{className:"flex flex-col h-full",children:[(0,t.jsxs)("div",{className:"px-4 py-3 border-b border-border bg-sidebar/50 shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)("span",{className:"text-xs font-mono text-muted-foreground flex-1",children:e.id}),(0,t.jsx)("span",{className:`text-[11px] px-2 py-0.5 rounded font-semibold ${tA(e.status)}`,children:e.status}),(0,t.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(e.id),c(!0),setTimeout(()=>c(!1),2e3)},className:"p-1 rounded hover:bg-accent transition-colors",title:"Copy task ID",children:d?(0,t.jsx)(tE,{className:"size-3 text-chart-2"}):(0,t.jsx)(tS,{className:"size-3 text-muted-foreground"})}),(0,t.jsx)("button",{onClick:o,className:"p-1 rounded hover:bg-accent transition-colors",title:"Clear selection",children:(0,t.jsx)(v,{className:"size-3 text-muted-foreground"})})]}),("READY"===e.status||"BLOCKED"===e.status)&&(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsxs)("button",{onClick:()=>n(e.id,"DONE"),className:"flex-1 flex items-center justify-center gap-1.5 px-2 py-1 rounded bg-chart-2/10 text-chart-2 hover:bg-chart-2/20 transition-colors text-xs font-medium border border-chart-2/20",children:[(0,t.jsx)(tE,{className:"size-3"}),"Mark Done"]}),(0,t.jsxs)("button",{onClick:()=>n(e.id,"BLOCKED"),className:"flex-1 flex items-center justify-center gap-1.5 px-2 py-1 rounded bg-chart-3/10 text-chart-3 hover:bg-chart-3/20 transition-colors text-xs font-medium border border-chart-3/20",children:[(0,t.jsx)(w,{className:"size-3"}),"Block"]})]}),l&&(0,t.jsxs)("div",{className:"mt-2 flex items-center gap-2 text-[11px] text-chart-2 bg-chart-2/10 rounded px-2 py-1",children:[(0,t.jsx)(tE,{className:"size-3 shrink-0"}),(0,t.jsx)("span",{className:"flex-1",children:l}),(0,t.jsx)("button",{onClick:i,className:"text-chart-2/60 hover:text-chart-2",children:"×"})]})]}),(0,t.jsx)(tv,{className:"flex-1",children:(0,t.jsxs)("div",{className:"p-4 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:"Description"}),(0,t.jsx)("p",{className:"text-sm text-foreground/90 leading-relaxed",children:e.description})]}),e.acceptanceCriteria&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:"Acceptance Criteria"}),(0,t.jsx)("p",{className:"text-xs text-foreground/80 leading-relaxed bg-muted/40 rounded p-2",children:e.acceptanceCriteria})]}),(0,t.jsx)("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:(0,t.jsxs)("span",{children:["Area: ",(0,t.jsx)("span",{className:"text-foreground",children:e.area})]})}),e.dependsOn.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:"Dependencies"}),(0,t.jsx)("div",{className:"space-y-1",children:e.dependsOn.map(e=>{let r=s?.tasks.find(t=>t.id===e);return(0,t.jsxs)("div",{className:"flex items-center justify-between p-2 rounded bg-card border border-border",children:[(0,t.jsx)("span",{className:"text-xs font-mono text-foreground",children:e}),r&&(0,t.jsx)("span",{className:`text-[11px] px-1.5 py-0.5 rounded font-semibold ${tA(r.status)}`,children:r.status})]},e)})})]}),u(e.id).length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:"Blocks"}),(0,t.jsx)("div",{className:"space-y-1",children:u(e.id).map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between p-2 rounded bg-card border border-border",children:[(0,t.jsx)("span",{className:"text-xs font-mono text-foreground",children:e.id}),(0,t.jsx)("span",{className:`text-[11px] px-1.5 py-0.5 rounded font-semibold ${tA(e.status)}`,children:e.status})]},e.id))})]}),e.lastEvent&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:"Last Execution"}),(0,t.jsxs)("div",{className:"bg-card rounded-lg p-3 space-y-2 text-sm border border-border",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-xs font-mono text-foreground",children:e.lastEvent.agent}),(0,t.jsx)("span",{className:`px-1.5 py-0.5 rounded text-[11px] font-semibold ${tA(e.lastEvent.status)}`,children:e.lastEvent.status})]}),(0,t.jsx)("span",{className:"text-muted-foreground text-[11px]",children:new Date(e.lastEvent.timestamp).toLocaleString()})]}),e.lastEvent.reason&&(0,t.jsx)("div",{className:"text-xs text-chart-3 bg-chart-3/10 p-2 rounded",children:e.lastEvent.reason}),e.lastEvent.meta?.duration!=null&&(0,t.jsxs)("div",{className:"flex items-center gap-4 text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(tX,{className:"size-3"}),String(e.lastEvent.meta.duration),"s"]}),null!=e.lastEvent.meta.stepCount&&(0,t.jsxs)("span",{children:[String(e.lastEvent.meta.stepCount)," steps"]})]}),"string"==typeof e.lastEvent.meta?.commit&&(0,t.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 bg-background rounded",children:[(0,t.jsx)(S,{className:"size-3 text-chart-4 shrink-0"}),(0,t.jsx)("code",{className:"text-xs text-chart-4 font-mono",children:String(e.lastEvent.meta.commit).slice(0,7)}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground truncate",children:String(e.lastEvent.meta.commitMsg||"")})]}),Array.isArray(e.lastEvent.meta?.steps)&&(0,t.jsx)("div",{className:"pt-2 border-t border-border space-y-1",children:e.lastEvent.meta.steps.map(e=>(0,t.jsxs)("div",{className:"flex items-start gap-2 py-1 px-1.5 rounded hover:bg-background/50",children:[(0,t.jsxs)("div",{className:"mt-0.5",children:["thought"===e.type&&(0,t.jsx)(tV,{className:"size-3 text-chart-4"}),"tool_call"===e.type&&(0,t.jsx)(tG,{className:"size-3 text-chart-1"}),"observation"===e.type&&(0,t.jsx)(tY,{className:"size-3 text-chart-2"}),"error"===e.type&&(0,t.jsx)(w,{className:"size-3 text-chart-5"})]}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-foreground truncate",children:e.name}),(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground/60 shrink-0",children:[e.duration,"ms"]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground/80 truncate",children:e.summary})]})]},`${e.type}-${e.name}`))}),e.lastEvent.meta&&!Array.isArray(e.lastEvent.meta.steps)&&(0,t.jsx)("div",{className:"pt-2 border-t border-border",children:(0,t.jsx)("pre",{className:"text-xs text-muted-foreground bg-background p-2 rounded overflow-auto",children:JSON.stringify(e.lastEvent.meta,null,2)})})]})]}),a.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:"Quality Checks"}),(0,t.jsx)(t2,{events:a})]})]})})]})}function t7({searchQuery:e,sidebarCollapsed:s}){let{data:a,loading:n,refresh:o}=function(){let[e,t]=(0,r.useState)(()=>t3),[s,a]=(0,r.useState)(()=>null===t3),n=(0,r.useCallback)(async()=>{try{let e=await fetch("/snapshot");if(!e.ok)return;let r=await e.json();t3=r,t(r)}catch{}finally{a(!1)}},[]);return(0,r.useEffect)(()=>{n()},[n]),tU(e=>{"plan"===e.type&&n()}),{data:e,loading:s,refresh:n}}(),[l,i]=(0,r.useState)(null),[d,c]=(0,r.useState)(new Set),[u,m]=(0,r.useState)([]),[x,p]=(0,r.useState)(null),[h,f]=(0,r.useState)(!1),[g,b]=(0,r.useState)(""),[j,y]=(0,r.useState)(""),[N,k]=(0,r.useState)(""),[w,C]=(0,r.useState)(""),[E,z]=(0,r.useState)(!1),[T,M]=(0,r.useState)(()=>localStorage.getItem("plan-view-mode")??"list");(0,r.useEffect)(()=>{localStorage.setItem("plan-view-mode",T)},[T]);let $=async()=>{if(g.trim()){z(!0);try{let e={description:g.trim()};j.trim()&&(e.slice=j.trim()),N.trim()&&(e.area=N.trim()),w.trim()&&(e.ac=w.trim()),(await fetch("/plan/task",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(b(""),y(""),k(""),C(""),f(!1),o())}catch{}finally{z(!1)}}},R=async(e,t)=>{try{(await fetch(`/plan/task/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:t})})).ok&&(p(`Task ${e} marked ${t}`),setTimeout(()=>p(null),5e3),o())}catch{}};if((0,r.useEffect)(()=>{a?.snapshot&&c(e=>e.size>0?e:new Set(Object.keys(a.snapshot.slices)))},[a]),(0,r.useEffect)(()=>{if(!l)return void m([]);let e=new AbortController;return fetch(`/quality-timeline?taskId=${encodeURIComponent(l.id)}`,{signal:e.signal}).then(e=>e.ok?e.json():{events:[]}).then(e=>m(e.events??[])).catch(()=>m([])),()=>e.abort()},[l?.id]),n)return(0,t.jsx)("div",{className:"flex-1"});if(!a||!a.snapshot)return(0,t.jsx)("div",{className:"flex-1 p-8",children:(0,t.jsx)("div",{className:"max-w-4xl mx-auto",children:(0,t.jsxs)("div",{className:"bg-destructive/10 border border-destructive rounded-lg p-6",children:[(0,t.jsx)("h2",{className:"text-xl font-bold text-destructive-foreground mb-4",children:a?.queueErrors?.length?"Queue Parse Errors":"Plan Mode Not Available"}),(0,t.jsx)("div",{className:"space-y-2",children:a?.queueErrors?.map(e=>(0,t.jsx)("div",{className:"text-destructive-foreground text-sm",children:e},e))||(0,t.jsx)("div",{className:"text-muted-foreground text-sm",children:'Run "claudedash init" to set up Plan mode'})})]})})});let D=a.snapshot,A=D.tasks.filter(t=>t.description.toLowerCase().includes(e.toLowerCase())||t.id.toLowerCase().includes(e.toLowerCase())),L=A.reduce((e,t)=>(e[t.slice]||(e[t.slice]=[]),e[t.slice].push(t),e),{});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:`bg-sidebar border-r border-sidebar-border flex flex-col overflow-hidden transition-all duration-300 ${s?"w-0 min-w-0 border-r-0":"w-72 min-w-[280px]"}`,children:[(0,t.jsxs)("div",{className:"px-3 py-2 border-b border-sidebar-border shrink-0 flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Tasks"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-[10px] flex-1",children:[(0,t.jsxs)("span",{className:"text-muted-foreground/50",children:[D.summary.total,"T"]}),(0,t.jsxs)("span",{className:"text-chart-2 font-medium",children:[D.summary.done,"✓"]}),D.summary.failed>0&&(0,t.jsxs)("span",{className:"text-chart-5 font-medium",children:[D.summary.failed,"✗"]}),D.summary.blocked>0&&(0,t.jsxs)("span",{className:"text-chart-3 font-medium",children:[D.summary.blocked,"⊘"]}),(0,t.jsxs)("span",{className:"text-chart-1 font-medium",children:[D.summary.ready,"→"]})]}),(0,t.jsxs)("div",{className:"flex items-center bg-muted rounded p-0.5 gap-0.5",children:[(0,t.jsx)("button",{onClick:()=>M("list"),title:"List view",className:`p-1 rounded transition-colors ${"list"===T?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:(0,t.jsx)(tQ,{className:"size-3"})}),(0,t.jsx)("button",{onClick:()=>M("kanban"),title:"Kanban view",className:`p-1 rounded transition-colors ${"kanban"===T?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:(0,t.jsx)(tJ,{className:"size-3"})})]})]}),(0,t.jsx)("div",{className:"px-3 py-2 border-b border-sidebar-border shrink-0",children:h?(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("textarea",{value:g,onChange:e=>b(e.target.value),onKeyDown:e=>{"Escape"===e.key&&(f(!1),b(""),y(""),k(""),C(""))},placeholder:"Description (required)...",rows:2,className:"w-full bg-background border border-border rounded px-2 py-1.5 text-xs text-foreground placeholder-muted-foreground focus:outline-none focus:border-ring resize-none"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsxs)("select",{value:j,onChange:e=>y(e.target.value),className:"flex-1 bg-background border border-border rounded px-2 py-1.5 text-xs text-foreground focus:outline-none focus:border-ring",children:[(0,t.jsx)("option",{value:"",children:"Slice (last)"}),Object.keys(D.slices).map(e=>(0,t.jsx)("option",{value:e,children:e},e))]}),(0,t.jsx)("input",{type:"text",value:N,onChange:e=>k(e.target.value),placeholder:"Area",className:"flex-1 bg-background border border-border rounded px-2 py-1.5 text-xs text-foreground placeholder-muted-foreground focus:outline-none focus:border-ring"})]}),(0,t.jsx)("input",{type:"text",value:w,onChange:e=>C(e.target.value),placeholder:"Acceptance criteria (optional)",className:"w-full bg-background border border-border rounded px-2 py-1.5 text-xs text-foreground placeholder-muted-foreground focus:outline-none focus:border-ring"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)("button",{onClick:()=>void $(),disabled:!g.trim()||E,className:"flex-1 text-xs py-1 rounded bg-chart-2/10 text-chart-2 border border-chart-2/20 hover:bg-chart-2/20 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:E?"Adding…":"Add task"}),(0,t.jsx)("button",{onClick:()=>{f(!1),b(""),y(""),k(""),C("")},className:"text-xs py-1 px-2 rounded text-muted-foreground hover:text-foreground transition-colors",children:(0,t.jsx)(v,{className:"size-3"})})]})]}):(0,t.jsxs)("button",{onClick:()=>f(!0),className:"w-full flex items-center justify-center gap-1.5 text-xs text-muted-foreground hover:text-foreground py-1.5 border border-dashed border-border rounded hover:border-ring transition-colors",children:[(0,t.jsx)(tZ,{className:"size-3"}),"Add task"]})}),(0,t.jsx)(tv,{className:"flex-1",children:(0,t.jsx)("div",{className:"p-3 space-y-3",children:Object.entries(L).map(([e,r])=>(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("button",{onClick:()=>{c(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})},className:"w-full flex items-center justify-between px-2 py-1.5 bg-muted rounded text-xs font-semibold text-muted-foreground hover:bg-muted/80 transition-colors",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[d.has(e)?(0,t.jsx)(tK,{className:"size-3.5"}):(0,t.jsx)(tH,{className:"size-3.5"}),(0,t.jsxs)("span",{children:[e," • ",r.length," tasks"]})]}),(0,t.jsxs)("span",{className:"text-muted-foreground/60",children:[r.filter(e=>"DONE"===e.status).length,"/",r.length]})]}),d.has(e)&&r.map(e=>(0,t.jsxs)("button",{onClick:()=>i(e),className:`w-full text-left p-3 rounded-lg border transition-colors ${l?.id===e.id?"bg-accent border-ring":"bg-card border-border hover:bg-accent/50"}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1.5",children:[(0,t.jsx)("span",{className:"text-sm font-mono text-foreground",children:e.id}),(0,t.jsx)("span",{className:`text-xs px-2 py-0.5 rounded font-semibold ${tA(e.status)}`,children:e.status})]}),(0,t.jsx)("div",{className:"text-sm text-muted-foreground line-clamp-2",children:e.description}),(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground/60",children:e.area}),"string"==typeof e.lastEvent?.meta?.commit&&(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[10px] text-chart-4/70 font-mono",children:[(0,t.jsx)(S,{className:"size-2.5"}),String(e.lastEvent.meta.commit).slice(0,7)]})]})]},e.id))]},e))})})]}),"kanban"===T&&(0,t.jsx)(t6,{tasks:A,selectedTaskId:l?.id,onSelectTask:i}),(0,t.jsx)("div",{className:`border-l border-border flex flex-col overflow-hidden ${"kanban"===T?"w-[380px] min-w-[380px] shrink-0":"flex-1"}`,children:l?(0,t.jsx)(t8,{task:l,snapshot:D,qualityEvents:u,onUpdateStatus:R,onClose:()=>i(null),actionToast:x,onDismissToast:()=>p(null)}):(0,t.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 text-muted-foreground/40",children:[(0,t.jsx)(tJ,{className:"size-8 opacity-20"}),(0,t.jsx)("p",{className:"text-xs",children:"Select a task to view details"})]})})]})}var t9=e.i(56640);let re=`
5
5
  *, *::before, *::after { box-sizing: border-box; }
6
6
  html { color-scheme: dark; }
7
7
  body {
@@ -113,5 +113,5 @@ img { max-width: 100%; border-radius: 6px; }
113
113
  .feedback-header, .feedback-section h3 { color: #a1a1aa !important; }
114
114
  .feedback-intro { color: #71717a !important; }
115
115
  .subtitle { color: #a1a1aa !important; }
116
- `;function rt(){let[e,s]=(0,r.useState)(null),[a,n]=(0,r.useState)(!1),[o,l]=(0,r.useState)(!0),i=()=>{l(!0),n(!1),s(null),fetch("/claude-insights").then(e=>{if(!e.ok)return n(!0),null;let t=e.headers.get("content-type");return t?.includes("application/json")?(n(!0),null):e.text()}).then(e=>{let t;e&&s((t=`<style>${re}</style>`,e.includes("</head>")?e.replace("</head>",`${t}</head>`):e.includes("<body")?e.replace("<body",`${t}<body`):t+e))}).catch(()=>n(!0)).finally(()=>l(!1))};return((0,r.useEffect)(()=>{i()},[]),o)?(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)(x,{className:"size-10 mx-auto mb-3 text-muted-foreground animate-pulse"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Loading insights..."})]})}):(0,t.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden",children:[(0,t.jsxs)("div",{className:"px-4 py-2 border-b border-border bg-sidebar/30 flex items-center justify-between shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(x,{className:"size-4 text-chart-3"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:"Claude Code Insights"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"Usage analytics from /insight command"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("button",{onClick:i,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center gap-1",title:"Refresh report",children:[(0,t.jsx)(d,{className:"size-3"}),"Refresh"]}),(0,t.jsx)(t9.default,{href:"/claude-insights",target:"_blank",rel:"noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Open in new tab →"})]})]}),a?(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center p-8",children:(0,t.jsxs)("div",{className:"max-w-lg w-full",children:[(0,t.jsx)(x,{className:"size-12 mx-auto mb-5 text-muted-foreground"}),(0,t.jsx)(tN,{lines:["Unlock deep insights into your Claude Code usage...","Discover what's working, what's slowing you down...","See your most-used tools, friction points, and wins...","Get personalized CLAUDE.md suggestions...","Open Claude Code and run: /insight"]}),(0,t.jsxs)("div",{className:"mt-6 bg-muted/50 border border-border rounded-lg p-5",children:[(0,t.jsxs)("h3",{className:"text-sm font-semibold mb-3 flex items-center gap-2",children:[(0,t.jsx)(tV,{className:"size-4"}),"How to generate your report:"]}),(0,t.jsxs)("ol",{className:"text-xs text-muted-foreground space-y-2 list-decimal list-inside",children:[(0,t.jsx)("li",{children:"Open a Claude Code session in your terminal"}),(0,t.jsxs)("li",{children:["Type"," ",(0,t.jsx)("code",{className:"bg-background px-1.5 py-0.5 rounded font-mono text-foreground",children:"/insight"})," ","and press Enter"]}),(0,t.jsx)("li",{children:"Wait 10–30 seconds while Claude analyzes your usage"}),(0,t.jsxs)("li",{children:["Click"," ",(0,t.jsxs)("button",{onClick:i,className:"inline-flex items-center gap-1 text-primary hover:underline",children:[(0,t.jsx)(d,{className:"size-3"}),"Refresh"]})," ","above to view your report"]})]})]})]})}):(0,t.jsx)("iframe",{srcDoc:e??"",sandbox:"allow-scripts allow-same-origin",className:"flex-1 w-full border-0 bg-[#18181b]",title:"Claude Code Insights Report"})]})}let rr=l("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),rs=l("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]),ra=l("dollar-sign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]),rn=l("award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]),ro=l("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);function rl(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function ri(e){return e.includes("opus-4-6")?"Opus 4.6":e.includes("sonnet-4-6")?"Sonnet 4.6":e.includes("haiku-4-5")?"Haiku 4.5":e.includes("opus-4-5")?"Opus 4.5":e.includes("sonnet-4-5")?"Sonnet 4.5":e.includes("3-5-sonnet")?"Sonnet 3.5":e.includes("3-5-haiku")?"Haiku 3.5":e.split("-").slice(0,3).join(" ")}function rd(e){return e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function rc({label:e,value:r,sub:s,colorClass:a}){return(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg p-4",children:[(0,t.jsx)("div",{className:`text-2xl font-bold ${a??"text-foreground"}`,children:r}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:e}),s&&(0,t.jsx)("div",{className:"text-[11px] text-muted-foreground/60 mt-0.5",children:s})]})}function ru({data:e}){if(0===e.length)return null;let r=Math.max(...e.map(e=>e.messageCount),1);return(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:"Last 7 Days — Messages"}),(0,t.jsx)("div",{className:"flex items-end gap-1.5 h-24",children:e.map(e=>{let s=e.messageCount/r*100,a=new Date(e.date).toLocaleDateString("en",{weekday:"short"});return(0,t.jsxs)("div",{className:"flex-1 flex flex-col items-center gap-1 group relative",children:[(0,t.jsxs)("div",{className:"absolute bottom-full mb-1 left-1/2 -translate-x-1/2 bg-popover border border-border text-[10px] text-foreground px-2 py-1 rounded whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity z-10 pointer-events-none",children:[e.date,": ",rl(e.messageCount)," msgs · ",e.sessionCount," sessions"]}),(0,t.jsx)("div",{className:"w-full rounded-sm bg-chart-1/70 hover:bg-chart-1 transition-colors min-h-[2px]",style:{height:`${Math.max(s,2)}%`}}),(0,t.jsx)("span",{className:"text-[9px] text-muted-foreground/60",children:a})]},e.date)})})]})}function rm({hourCounts:e}){let r=Math.max(...Object.values(e),1),s=Array.from({length:24},(e,t)=>t);return(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:"Peak Hours"}),(0,t.jsx)("div",{className:"flex gap-0.5",children:s.map(s=>{let a=e[String(s)]??0,n=a/r;return(0,t.jsxs)("div",{className:"relative group flex-1",children:[(0,t.jsx)("div",{className:"h-6 rounded-sm bg-chart-2",style:{opacity:n<.1?.06:n<.3?.2:n<.6?.5:.85}}),(0,t.jsxs)("div",{className:"absolute bottom-full mb-1 left-1/2 -translate-x-1/2 bg-popover border border-border text-[10px] text-foreground px-1.5 py-0.5 rounded whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity z-10 pointer-events-none",children:[s,":00 · ",a]})]},s)})}),(0,t.jsxs)("div",{className:"flex justify-between text-[9px] text-muted-foreground/40 mt-1",children:[(0,t.jsx)("span",{children:"00:00"}),(0,t.jsx)("span",{children:"06:00"}),(0,t.jsx)("span",{children:"12:00"}),(0,t.jsx)("span",{children:"18:00"}),(0,t.jsx)("span",{children:"23:00"})]})]})}function rx({modelUsage:e}){let r=Object.entries(e);return 0===r.length?null:(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:"Model Usage"}),(0,t.jsx)("div",{className:"space-y-2",children:r.map(([e,r])=>{let s=r.inputTokens+r.outputTokens+r.cacheReadInputTokens;return(0,t.jsxs)("div",{className:"bg-sidebar/50 border border-border rounded-lg px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:ri(e)}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:[rl(s)," total tokens"]})]}),(0,t.jsxs)("div",{className:"flex gap-4 text-[11px]",children:[(0,t.jsxs)("span",{className:"text-chart-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"In "}),rl(r.inputTokens)]}),(0,t.jsxs)("span",{className:"text-chart-2",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Out "}),rl(r.outputTokens)]}),(0,t.jsxs)("span",{className:"text-chart-4",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Cache "}),rl(r.cacheReadInputTokens)]})]})]},e)})})]})}function rp({s:e}){let[s,a]=(0,r.useState)(!1),n=Object.entries(e.languages).sort((e,t)=>t[1]-e[1]).slice(0,3).map(([e])=>e),o=Object.entries(e.toolCounts).sort((e,t)=>t[1]-e[1]).slice(0,3);return(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg overflow-hidden",children:[(0,t.jsxs)("button",{onClick:()=>a(e=>!e),className:"w-full text-left px-4 py-3 hover:bg-accent/40 transition-colors flex items-start gap-3",children:[s?(0,t.jsx)(tK,{className:"size-3.5 text-muted-foreground mt-0.5 shrink-0"}):(0,t.jsx)(tH,{className:"size-3.5 text-muted-foreground mt-0.5 shrink-0"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground truncate",children:e.projectName??e.sessionId.slice(0,8)}),n.length>0&&(0,t.jsx)("div",{className:"flex gap-1",children:n.map(e=>(0,t.jsx)("span",{className:"text-[10px] bg-muted text-muted-foreground px-1.5 py-0.5 rounded",children:e},e))})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3 text-[11px] text-muted-foreground",children:[e.startTime&&(0,t.jsx)("span",{children:function(e){let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;let r=Math.floor(t/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}(e.startTime)}),e.durationMinutes&&(0,t.jsxs)("span",{children:[(0,t.jsx)(tX,{className:"size-3 inline mr-0.5"}),e.durationMinutes,"m"]}),(0,t.jsxs)("span",{children:[(0,t.jsx)(rs,{className:"size-3 inline mr-0.5"}),e.userMessageCount," msgs"]}),e.gitCommits>0&&(0,t.jsxs)("span",{className:"text-chart-2",children:[(0,t.jsx)(S,{className:"size-3 inline mr-0.5"}),e.gitCommits," commits"]}),e.linesAdded>0&&(0,t.jsxs)("span",{className:"text-chart-1",children:["+",rl(e.linesAdded)," lines"]})]})]})]}),s&&(0,t.jsxs)("div",{className:"border-t border-border px-4 py-3 bg-sidebar/30 space-y-3",children:[e.firstPrompt&&(0,t.jsxs)("p",{className:"text-[11px] text-muted-foreground/80 italic line-clamp-2",children:["“",e.firstPrompt.slice(0,200),e.firstPrompt.length>200?"…":"","”"]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-4 text-[11px]",children:[(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Tokens in/out: "}),rl(e.inputTokens)," / ",rl(e.outputTokens)]}),(e.filesModified??0)>0&&(0,t.jsxs)("span",{children:[e.filesModified," files modified"]}),(e.linesRemoved??0)>0&&(0,t.jsxs)("span",{className:"text-chart-5",children:["-",rl(e.linesRemoved)," lines"]}),e.toolErrors>0&&(0,t.jsxs)("span",{className:"text-chart-5",children:[e.toolErrors," tool errors"]}),(e.userInterruptions??0)>0&&(0,t.jsxs)("span",{className:(e.userInterruptions??0)>3?"text-chart-3 font-medium":"text-muted-foreground",children:[e.userInterruptions," interruption",(e.userInterruptions??0)!==1?"s":"",(e.userInterruptions??0)>3?" ⚠":""]}),e.usesTaskAgent&&(0,t.jsx)("span",{className:"text-chart-2",children:"Task Agent"}),e.usesMcp&&(0,t.jsx)("span",{className:"text-chart-4",children:"MCP"}),e.usesWebSearch&&(0,t.jsx)("span",{className:"text-chart-4",children:"Web Search"}),e.durationMinutes&&e.linesAdded>0&&(0,t.jsxs)("span",{className:"text-muted-foreground/60",children:[Math.round(e.linesAdded/e.durationMinutes)," lines/min"]})]}),o.length>0&&(0,t.jsx)("div",{className:"flex gap-2 flex-wrap",children:o.map(([e,r])=>(0,t.jsxs)("span",{className:"text-[10px] bg-muted text-muted-foreground px-2 py-0.5 rounded",children:[e,": ",String(r)]},e))})]})]})}function rh({label:e,value:r,max:s,colorClass:a,sub:n}){let o=s>0?r/s*100:0;return(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground w-36 shrink-0 truncate",children:e}),(0,t.jsx)("div",{className:"flex-1 bg-muted rounded-full h-1.5 relative",children:(0,t.jsx)("div",{className:`${a} h-1.5 rounded-full transition-all`,style:{width:`${o}%`}})}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground w-8 text-right shrink-0",children:r}),n&&(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground/60 w-16 shrink-0",children:n})]})}function rf({s:e}){var s,a;let[n,o]=(0,r.useState)(!1);return(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg overflow-hidden",children:[(0,t.jsxs)("button",{onClick:()=>o(e=>!e),className:"w-full text-left px-4 py-3 hover:bg-accent/40 transition-colors flex items-start gap-3",children:[n?(0,t.jsx)(tK,{className:"size-3.5 text-muted-foreground mt-0.5 shrink-0"}):(0,t.jsx)(tH,{className:"size-3.5 text-muted-foreground mt-0.5 shrink-0"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,t.jsx)("span",{className:`text-[10px] font-medium px-2 py-0.5 rounded-full border ${"fully_achieved"===e.outcome?"border-chart-2/40 text-chart-2 bg-chart-2/10":"mostly_achieved"===e.outcome?"border-chart-1/40 text-chart-1 bg-chart-1/10":"partially_achieved"===e.outcome?"border-chart-3/40 text-chart-3 bg-chart-3/10":"border-chart-5/40 text-chart-5 bg-chart-5/10"}`,children:rd(e.outcome)}),(0,t.jsx)("span",{className:`text-[10px] ${"essential"===(s=e.helpfulness)?"text-chart-2":"very_helpful"===s?"text-chart-1":"moderately_helpful"===s?"text-chart-3":"text-chart-5"}`,children:"essential"===(a=e.helpfulness)?"Essential":"very_helpful"===a?"Very Helpful":"moderately_helpful"===a?"Moderate":a.replace(/_/g," ")}),e.sessionType&&(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground/50",children:e.sessionType.replace(/_/g," ")})]}),e.goal&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:e.goal})]})]}),n&&(0,t.jsxs)("div",{className:"border-t border-border px-4 py-3 bg-sidebar/30 space-y-2",children:[e.briefSummary&&(0,t.jsx)("p",{className:"text-[11px] text-muted-foreground/80",children:e.briefSummary}),e.frictionDetail&&(0,t.jsxs)("p",{className:"text-[11px] text-chart-3/80 italic",children:["⚠ ",e.frictionDetail.slice(0,200),e.frictionDetail.length>200?"…":""]}),Object.keys(e.frictionCounts).length>0&&(0,t.jsx)("div",{className:"flex gap-2 flex-wrap",children:Object.entries(e.frictionCounts).map(([e,r])=>(0,t.jsxs)("span",{className:"text-[10px] bg-chart-5/10 text-chart-5 px-2 py-0.5 rounded",children:[e.replace(/_/g," "),": ",r]},e))}),e.satisfiedCount>0||e.dissatisfiedCount>0?(0,t.jsxs)("div",{className:"text-[11px] text-muted-foreground",children:["Satisfaction: ",(0,t.jsxs)("span",{className:"text-chart-2",children:[e.satisfiedCount," ✓"]}),e.dissatisfiedCount>0&&(0,t.jsxs)("span",{className:"text-chart-5 ml-2",children:[e.dissatisfiedCount," ✗"]})]}):null]})]})}function rg({data:e}){let{aggregate:r,sessions:s}=e;if(!r||0===s.length)return(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg p-5 text-center",children:[(0,t.jsx)(rn,{className:"size-8 mx-auto mb-2 text-muted-foreground/30"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"No session quality data yet"}),(0,t.jsxs)("p",{className:"text-[11px] text-muted-foreground/60 mt-1",children:["Generated from ",(0,t.jsx)("code",{className:"bg-muted px-1 rounded",children:"~/.claude/usage-data/facets/"})]})]});let a=Math.max(...Object.values(r.outcomeCounts),1),n=r.topFriction[0]?.count??1,o=["fully_achieved","mostly_achieved","partially_achieved","not_achieved","unclear_from_transcript"],l=[...o.filter(e=>r.outcomeCounts[e]).map(e=>[e,r.outcomeCounts[e]]),...Object.entries(r.outcomeCounts).filter(([e])=>!o.includes(e))];return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg p-5 space-y-3",children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Outcome Distribution"}),l.map(([e,r])=>(0,t.jsx)(rh,{label:rd(e),value:r,max:a,colorClass:"fully_achieved"===e?"bg-chart-2":"mostly_achieved"===e?"bg-chart-1":"partially_achieved"===e?"bg-chart-3":"bg-chart-5"},e)),null!==r.satisfactionRate&&(0,t.jsxs)("div",{className:"pt-2 border-t border-border text-[11px] text-muted-foreground",children:["User satisfaction rate: ",(0,t.jsxs)("span",{className:"text-chart-2 font-medium",children:[r.satisfactionRate,"%"]}),(0,t.jsxs)("span",{className:"ml-2 opacity-50",children:["(",r.satisfiedTotal," satisfied, ",r.dissatisfiedTotal," dissatisfied)"]})]})]}),(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg p-5 space-y-3",children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Top Friction Points"}),r.topFriction.slice(0,6).map(({type:e,count:r})=>(0,t.jsx)(rh,{label:e.replace(/_/g," "),value:r,max:n,colorClass:"bg-chart-5/60"},e)),0===r.topFriction.length&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"No friction events recorded"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:["Analyzed Sessions (",s.length,")"]}),(0,t.jsx)("div",{className:"space-y-2",children:s.map(e=>(0,t.jsx)(rf,{s:e},e.sessionId))})]})]})}function rb({data:e}){let{aggregate:s,sessions:a}=e,[n,o]=(0,r.useState)(null);if(!s||0===a.length)return(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg p-5 text-center",children:[(0,t.jsx)(tG,{className:"size-8 mx-auto mb-2 text-muted-foreground/30"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"No conversation data found"}),(0,t.jsxs)("p",{className:"text-[11px] text-muted-foreground/60 mt-1",children:["Parses ",(0,t.jsx)("code",{className:"bg-muted px-1 rounded",children:"~/.claude/projects/"})," JSONL files"]})]});let l=s.topTools[0]?.count??1,i=["bg-chart-1","bg-chart-2","bg-chart-3","bg-chart-4","bg-chart-5"];return(0,t.jsx)("div",{className:"space-y-4",children:(0,t.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg p-5 space-y-3",children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Top Tools (All Time)"}),s.topTools.map(({name:e,count:r},a)=>{let n=Math.round(r/s.totalToolCalls*100);return(0,t.jsx)(rh,{label:e,value:r,max:l,colorClass:i[a%i.length],sub:`${n}%`},e)}),(0,t.jsxs)("div",{className:"pt-2 border-t border-border text-[11px] text-muted-foreground",children:[rl(s.totalToolCalls)," total calls ·"," ",s.totalErrors," errors ·"," ",(0,t.jsxs)("span",{className:s.errorRate>5?"text-chart-5":"text-chart-2",children:[s.errorRate.toFixed(1),"% error rate"]})]})]}),(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg p-5",children:[(0,t.jsxs)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:["Recent Conversations (",a.length,")"]}),(0,t.jsx)("div",{className:"space-y-2",children:a.slice(0,8).map(e=>(0,t.jsxs)("div",{className:"rounded border border-border overflow-hidden",children:[(0,t.jsxs)("button",{onClick:()=>o(n===e.sessionId?null:e.sessionId),className:"w-full text-left px-3 py-2 hover:bg-accent/30 transition-colors flex items-center gap-2 text-[11px]",children:[n===e.sessionId?(0,t.jsx)(tK,{className:"size-3 text-muted-foreground shrink-0"}):(0,t.jsx)(tH,{className:"size-3 text-muted-foreground shrink-0"}),(0,t.jsx)("span",{className:"font-medium text-foreground truncate flex-1",children:e.projectName??e.sessionId.slice(0,8)}),(0,t.jsxs)("span",{className:"text-muted-foreground shrink-0",children:[e.messageCount," msgs"]}),e.errorCount>0&&(0,t.jsxs)("span",{className:"text-chart-5 shrink-0",children:[e.errorCount," err"]})]}),n===e.sessionId&&(0,t.jsxs)("div",{className:"border-t border-border px-3 py-2 bg-sidebar/30 text-[10px] space-y-1.5",children:[e.cwd&&(0,t.jsx)("div",{className:"text-muted-foreground/60 font-mono truncate",children:e.cwd}),(0,t.jsx)("div",{className:"flex gap-2 flex-wrap",children:e.topTools.map(({name:e,count:r})=>(0,t.jsxs)("span",{className:"bg-muted text-muted-foreground px-1.5 py-0.5 rounded",children:[e,": ",r]},e))}),(0,t.jsxs)("div",{className:"text-muted-foreground",children:["R:",e.fileOps.read," W:",e.fileOps.write," E:",e.fileOps.edit," file ops"]})]})]},e.sessionId))})]})]})})}function rj({data:e}){let r=e.perModel.filter(e=>null!==e.estimatedCostUSD);return 0===r.length?null:(0,t.jsxs)("div",{className:"bg-chart-4/5 border border-chart-4/20 rounded-lg p-5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(ra,{className:"size-4 text-chart-4"}),(0,t.jsx)("h4",{className:"text-sm font-semibold text-foreground",children:"Estimated Cost"})]}),(0,t.jsxs)("div",{className:"text-xl font-bold text-chart-4",children:["~$",e.totalCostUSD.toFixed(2)]})]}),(0,t.jsx)("div",{className:"space-y-2 mb-3",children:r.map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between text-[11px]",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:ri(e.model)}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("span",{className:"text-muted-foreground/60",children:[rl(e.inputTokens+e.outputTokens)," tok"]}),(0,t.jsxs)("span",{className:"font-medium text-foreground",children:["$",(e.estimatedCostUSD??0).toFixed(2)]})]})]},e.model))}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground/50",children:e.disclaimer})]})}function rv({data:e}){if(!e.active||!e.tokensUsed)return null;let r=e.minutesElapsed??0,s=Math.min(r/300*100,100),a=s>90?"text-chart-5":s>70?"text-chart-3":"text-chart-2";return(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(rr,{className:`size-3.5 ${a}`}),(0,t.jsx)("span",{className:"text-xs font-semibold text-foreground",children:"Current 5h Billing Block"})]}),(0,t.jsxs)("span",{className:`text-sm font-bold ${a}`,children:["~$",(e.estimatedCostUSD??0).toFixed(2)]})]}),(0,t.jsx)("div",{className:"bg-muted rounded-full h-1.5 mb-2",children:(0,t.jsx)("div",{className:`${s>90?"bg-chart-5":s>70?"bg-chart-3":"bg-chart-2"} h-1.5 rounded-full transition-all`,style:{width:`${s}%`}})}),(0,t.jsxs)("div",{className:"flex items-center justify-between text-[10px] text-muted-foreground",children:[(0,t.jsxs)("span",{children:[r,"m elapsed"]}),(0,t.jsxs)("span",{children:[rl(e.tokensUsed??0)," tokens"]}),(0,t.jsxs)("span",{children:[e.minutesRemaining??0,"m remaining"]})]}),e.breakdown&&(0,t.jsxs)("div",{className:"flex gap-3 mt-2 text-[10px] text-muted-foreground/60",children:[(0,t.jsxs)("span",{children:["In: ",rl(e.breakdown.input)]}),(0,t.jsxs)("span",{children:["Out: ",rl(e.breakdown.output)]}),(0,t.jsxs)("span",{children:["Cache: ",rl(e.breakdown.cacheRead)]})]})]})}function ry({data:e}){let[s,a]=(0,r.useState)(""),[n,o]=(0,r.useState)(null),l=s?e.prompts.filter(e=>e.display.toLowerCase().includes(s.toLowerCase())||(e.projectName??"").toLowerCase().includes(s.toLowerCase())):e.prompts,i=e.topProjects[0]?.count??1;return(0,t.jsxs)("div",{className:"space-y-4",children:[e.topProjects.length>0&&(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg p-5 space-y-2",children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:"Most Active Projects"}),e.topProjects.slice(0,5).map(({path:e,name:r,count:s})=>(0,t.jsx)(rh,{label:r,value:s,max:i,colorClass:"bg-chart-4",sub:`${s} prompts`},e))]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,t.jsxs)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide",children:["Recent Prompts (",e.total,")"]}),(0,t.jsx)("input",{type:"text",placeholder:"Search prompts…",value:s,onChange:e=>a(e.target.value),className:"ml-auto bg-background border border-border rounded-lg px-3 py-1 text-xs text-foreground placeholder-muted-foreground focus:outline-none focus:border-ring w-48"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[l.slice(0,30).map((e,r)=>{let s=`${e.sessionId}-${r}`,a=n===s;return(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg overflow-hidden",children:[(0,t.jsxs)("button",{onClick:()=>o(a?null:s),className:"w-full text-left px-3 py-2 hover:bg-accent/30 transition-colors flex items-start gap-2",children:[(0,t.jsx)(ro,{className:"size-3 text-muted-foreground shrink-0 mt-0.5"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("p",{className:"text-xs text-foreground truncate",children:e.display||"(empty)"}),(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-0.5 text-[10px] text-muted-foreground/60",children:[e.projectName&&(0,t.jsx)("span",{children:e.projectName}),(0,t.jsx)("span",{children:new Date(e.timestamp).toLocaleDateString("en",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})})]})]})]}),a&&(0,t.jsxs)("div",{className:"border-t border-border px-3 py-2 bg-sidebar/30 text-[10px] text-muted-foreground/70 space-y-1",children:[(0,t.jsx)("p",{className:"break-words",children:e.display}),(0,t.jsx)("p",{className:"font-mono opacity-50",children:e.project})]})]},s)}),0===l.length&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60 text-center py-4",children:"No matching prompts"})]})]})]})}let rN={Bash:"⚡",Read:"📖",Edit:"✏️",Write:"💾",Glob:"🔍",Grep:"🔎",Task:"🤖",WebFetch:"🌐",WebSearch:"🔍",TodoWrite:"📋"};function rk({events:e,hasHooks:r}){return r?(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg p-5",children:[(0,t.jsxs)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:["Live Tool Events (",e.length,")"]}),(0,t.jsxs)("div",{className:"space-y-1 max-h-64 overflow-y-auto",children:[e.slice(0,50).map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 text-[11px] py-0.5",children:[(0,t.jsx)("span",{className:"shrink-0",children:rN[e.tool??""]??"🔧"}),(0,t.jsx)("span",{className:"font-medium text-foreground",children:e.tool??e.event}),e.session&&(0,t.jsx)("span",{className:"text-muted-foreground/50 font-mono",children:e.session.slice(0,6)}),(0,t.jsx)("span",{className:"ml-auto text-muted-foreground/40 shrink-0",children:new Date(e.receivedAt).toLocaleTimeString("en",{hour:"2-digit",minute:"2-digit",second:"2-digit"})})]},e.receivedAt)),0===e.length&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:"Waiting for events… Run a Claude Code session."})]})]}):(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg p-5 text-center",children:[(0,t.jsx)(rr,{className:"size-8 mx-auto mb-2 text-muted-foreground/30"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"No hook events yet"}),(0,t.jsx)("p",{className:"text-[11px] text-muted-foreground/60 mb-3",children:"Install hooks for real-time tool event streaming:"}),(0,t.jsx)("code",{className:"text-[11px] bg-muted px-2 py-1 rounded",children:"npx claudedash hooks install"})]})}function rw(){let[e,s]=(0,r.useState)(null),[a,n]=(0,r.useState)([]),[o,l]=(0,r.useState)(null),[i,c]=(0,r.useState)(null),[u,m]=(0,r.useState)(null),[x,p]=(0,r.useState)(null),[h,g]=(0,r.useState)(null),[b,j]=(0,r.useState)([]),[v,y]=(0,r.useState)(!1),[N,k]=(0,r.useState)(!0),[w,C]=(0,r.useState)(!1),[S,E]=(0,r.useState)("overview"),z=async()=>{k(!0),C(!1);try{let[e,t,r,a,o,i,d,u]=await Promise.all([fetch("/usage"),fetch("/activity/sessions"),fetch("/facets"),fetch("/conversations"),fetch("/cost"),fetch("/history"),fetch("/billing-block"),fetch("/hook/events")]);if(e.ok&&s(await e.json()),t.ok){let e=await t.json();n(e.sessions)}if(r.ok&&l(await r.json()),a.ok&&c(await a.json()),o.ok&&m(await o.json()),i.ok&&p(await i.json()),d.ok&&g(await d.json()),u.ok){let e=await u.json();j(e.events),y(e.events.length>0)}e.ok||t.ok||C(!0)}catch{C(!0)}finally{k(!1)}};if((0,r.useEffect)(()=>{z()},[]),N)return(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)(f,{className:"size-10 mx-auto mb-3 text-muted-foreground animate-pulse"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Loading activity data…"})]})});if(w||!e)return(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center p-8",children:(0,t.jsxs)("div",{className:"text-center max-w-sm",children:[(0,t.jsx)(f,{className:"size-12 mx-auto mb-4 text-muted-foreground/30"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"No activity data found"}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground/60",children:["Start a Claude Code session to generate"," ",(0,t.jsx)("code",{className:"bg-muted px-1 rounded",children:"~/.claude/stats-cache.json"})]})]})});let T=a.reduce((e,t)=>e+(t.linesAdded??0),0),M=a.reduce((e,t)=>e+(t.gitCommits??0),0),$=o?.sessions.length??0,R=i?.sessions.length??0,D=x?.total??0,A=b.length,L=[{id:"overview",label:"Overview"},{id:"quality",label:`Quality${$>0?` (${$})`:""}`},{id:"tools",label:`Tools${R>0?` (${R})`:""}`},{id:"history",label:`History${D>0?` (${D})`:""}`},{id:"hooks",label:`Hooks${A>0?` (${A})`:""}`}];return(0,t.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden",children:[(0,t.jsxs)("div",{className:"px-4 py-2 border-b border-border bg-sidebar/30 flex items-center justify-between shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(f,{className:"size-4 text-chart-1"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:"Activity"}),e.lastComputedDate&&(0,t.jsxs)("span",{className:"text-xs text-muted-foreground hidden sm:inline",children:["Updated: ",e.lastComputedDate]})]}),(0,t.jsx)("div",{className:"flex items-center bg-muted rounded-lg p-0.5",children:L.map(({id:e,label:r})=>(0,t.jsx)("button",{onClick:()=>E(e),className:`px-3 py-1 rounded text-xs font-medium transition-colors ${S===e?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:r},e))})]}),(0,t.jsxs)("button",{onClick:z,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center gap-1",children:[(0,t.jsx)(d,{className:"size-3"}),"Refresh"]})]}),(0,t.jsx)(tv,{className:"flex-1",children:(0,t.jsxs)("div",{className:"p-6 space-y-8 max-w-4xl mx-auto",children:["overview"===S&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[(0,t.jsx)(rc,{label:"Total Sessions",value:rl(e.totalSessions),sub:e.firstSessionDate?`Since ${new Date(e.firstSessionDate).toLocaleDateString("en",{month:"short",day:"numeric"})}`:void 0,colorClass:"text-chart-1"}),(0,t.jsx)(rc,{label:"Total Messages",value:rl(e.totalMessages),colorClass:"text-chart-2"}),(0,t.jsx)(rc,{label:"Lines Added",value:T>0?`+${rl(T)}`:"—",colorClass:"text-chart-4"}),(0,t.jsx)(rc,{label:"Git Commits",value:M>0?rl(M):"—",colorClass:"text-chart-3"})]}),h&&(0,t.jsx)(rv,{data:h}),u&&(0,t.jsx)(rj,{data:u}),e.dailyActivity.length>0&&(0,t.jsx)("div",{className:"bg-card border border-border rounded-lg p-5",children:(0,t.jsx)(ru,{data:e.dailyActivity})}),(0,t.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[Object.keys(e.hourCounts).length>0&&(0,t.jsx)("div",{className:"bg-card border border-border rounded-lg p-5",children:(0,t.jsx)(rm,{hourCounts:e.hourCounts})}),Object.keys(e.modelUsage).length>0&&(0,t.jsx)("div",{className:"bg-card border border-border rounded-lg p-5",children:(0,t.jsx)(rx,{modelUsage:e.modelUsage})})]}),e.longestSession&&(0,t.jsxs)("div",{className:"bg-chart-4/5 border border-chart-4/20 rounded-lg px-5 py-4 flex items-center gap-4",children:[(0,t.jsx)(rr,{className:"size-5 text-chart-4 shrink-0"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-xs font-semibold text-foreground",children:"Longest session: "}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:[e.longestSession.messageCount," messages ·"," ",Math.round(e.longestSession.duration/6e4),"m ·"," ",new Date(e.longestSession.timestamp).toLocaleDateString()]})]})]}),a.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:["Recent Sessions (",a.length,")"]}),(0,t.jsx)("div",{className:"space-y-2",children:a.map(e=>(0,t.jsx)(rp,{s:e},e.sessionId))})]})]}),"quality"===S&&o&&(0,t.jsx)(rg,{data:o}),"tools"===S&&i&&(0,t.jsx)(rb,{data:i}),"history"===S&&x&&(0,t.jsx)(ry,{data:x}),"hooks"===S&&(0,t.jsx)(rk,{events:b,hasHooks:v})]})})]})}let rC=l("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);function rS({content:e}){let r=e.split("\n"),s=[],a=!1,n=[],o=0,l=()=>{n.length>0&&(s.push((0,t.jsx)("pre",{className:"bg-muted rounded-md p-3 text-[11px] font-mono overflow-x-auto mb-3 text-foreground/80",children:n.join("\n")},o++)),n=[])};for(let e of r){if(e.startsWith("```")){a?(l(),a=!1):a=!0;continue}if(a){n.push(e);continue}if(e.startsWith("# "))s.push((0,t.jsx)("h2",{className:"text-base font-bold text-foreground mt-4 mb-2",children:e.slice(2)},o++));else if(e.startsWith("## "))s.push((0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground mt-3 mb-1.5",children:e.slice(3)},o++));else if(e.startsWith("### "))s.push((0,t.jsx)("h4",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mt-2 mb-1",children:e.slice(4)},o++));else if(e.startsWith("- ")||e.startsWith("* "))s.push((0,t.jsx)("li",{className:"text-xs text-muted-foreground ml-4 mb-0.5 list-disc",children:e.slice(2)},o++));else if(e.match(/^\d+\. /)){let r=e.replace(/^\d+\. /,"");s.push((0,t.jsx)("li",{className:"text-xs text-muted-foreground ml-4 mb-0.5 list-decimal",children:r},o++))}else if(""===e.trim())s.push((0,t.jsx)("div",{className:"h-2"},o++));else{let r=e.split(/(`[^`]+`)/g);s.push((0,t.jsx)("p",{className:"text-xs text-muted-foreground mb-0.5",children:r.map(e=>e.startsWith("`")&&e.endsWith("`")?(0,t.jsx)("code",{className:"bg-muted px-1 rounded text-[11px] font-mono text-foreground",children:e.slice(1,-1)},e):e)},o++))}}return l(),(0,t.jsx)("div",{children:s})}function rE(){let[e,s]=(0,r.useState)([]),[a,n]=(0,r.useState)(null),[o,l]=(0,r.useState)(!0),i=async()=>{l(!0);try{let e=await fetch("/plans");if(e.ok){let t=await e.json();s(t.plans),t.plans.length>0&&!a&&n(t.plans[0])}}catch{}finally{l(!1)}};return((0,r.useEffect)(()=>{i()},[]),o)?(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,t.jsx)(g,{className:"size-8 text-muted-foreground/30 animate-pulse"})}):0===e.length?(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center p-8",children:(0,t.jsxs)("div",{className:"text-center max-w-sm",children:[(0,t.jsx)(g,{className:"size-12 mx-auto mb-4 text-muted-foreground/30"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"No plans yet"}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground/60",children:["Use ",(0,t.jsx)("code",{className:"bg-muted px-1 rounded",children:"/plan"})," in Claude Code to generate plan documents. They are saved to ",(0,t.jsx)("code",{className:"bg-muted px-1 rounded",children:"~/.claude/plans/"})]})]})}):(0,t.jsxs)("div",{className:"flex-1 flex overflow-hidden",children:[(0,t.jsxs)("div",{className:"w-64 border-r border-border flex flex-col shrink-0",children:[(0,t.jsxs)("div",{className:"px-4 py-2 border-b border-border bg-sidebar/30 flex items-center justify-between shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(g,{className:"size-3.5 text-chart-3"}),(0,t.jsxs)("span",{className:"text-xs font-medium",children:["Plans (",e.length,")"]})]}),(0,t.jsx)("button",{onClick:i,className:"p-1 rounded hover:bg-accent/50 transition-colors",children:(0,t.jsx)(d,{className:"size-3 text-muted-foreground"})})]}),(0,t.jsx)(tv,{className:"flex-1",children:(0,t.jsx)("div",{className:"p-2 space-y-1",children:e.map(e=>{var r;let s;return(0,t.jsxs)("button",{onClick:()=>n(e),className:`w-full text-left px-3 py-2.5 rounded-lg transition-colors flex items-start gap-2 ${a?.id===e.id?"bg-accent text-foreground":"hover:bg-accent/50 text-muted-foreground"}`,children:[(0,t.jsx)(tH,{className:"size-3 shrink-0 mt-0.5 opacity-50"}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:"text-xs font-medium truncate leading-tight",children:e.title}),(0,t.jsxs)("p",{className:"text-[10px] text-muted-foreground/60 mt-0.5 flex items-center gap-1",children:[(0,t.jsx)(rC,{className:"size-2.5"}),(r=e.createdAt,0===(s=Math.floor((Date.now()-new Date(r).getTime())/864e5))?"today":1===s?"yesterday":s<7?`${s}d ago`:s<30?`${Math.floor(s/7)}w ago`:`${Math.floor(s/30)}mo ago`)]})]})]},e.id)})})})]}),(0,t.jsx)("div",{className:"flex-1 flex flex-col overflow-hidden",children:a?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"px-6 py-3 border-b border-border bg-sidebar/20 shrink-0",children:[(0,t.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:a.title}),(0,t.jsxs)("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:[(0,t.jsx)(rC,{className:"size-2.5 inline mr-1"}),new Date(a.createdAt).toLocaleDateString("en",{year:"numeric",month:"long",day:"numeric"}),(0,t.jsx)("span",{className:"ml-2 font-mono opacity-50",children:a.filename})]})]}),(0,t.jsx)(tv,{className:"flex-1",children:(0,t.jsx)("div",{className:"p-6 max-w-3xl",children:(0,t.jsx)(rS,{content:a.content})})})]}):(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center text-muted-foreground text-sm",children:"Select a plan"})})]})}let rz=l("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);function rT(){let[e,s]=(0,r.useState)(null),[a,n]=(0,r.useState)(!0),[o,l]=(0,r.useState)("plan"),[i,c]=(0,r.useState)(""),[u,m]=(0,r.useState)(""),[x,p]=(0,r.useState)({status:"idle"}),h=(0,r.useCallback)(()=>{n(!0),fetch("/claudemd").then(e=>e.json()).then(e=>{s(e),c(e.plan.content),m(e.project.content),n(!1)}).catch(()=>n(!1))},[]);(0,r.useEffect)(()=>{h()},[h]);let f=async e=>{p({status:"saving"});let t="plan"===e?i:u;try{let r=await fetch("/claudemd",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:e,content:t})});if(r.ok)p({status:"saved"}),setTimeout(()=>p({status:"idle"}),2e3);else{let e=await r.json();p({status:"error",message:e.error??"Save failed"})}}catch{p({status:"error",message:"Network error"})}};if(a)return(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center text-muted-foreground text-sm",children:"Loading…"});let b=[{key:"plan",label:".claudedash/CLAUDE.md",subtitle:"Plan mode instructions injected into every agent context"},{key:"project",label:"CLAUDE.md",subtitle:"Project root — global agent instructions for this repository"}],j=e?.[o],v="plan"===o?c:m;return(0,t.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden",children:[(0,t.jsxs)("div",{className:"border-b border-border px-4 py-3 flex items-center justify-between shrink-0 bg-background",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(g,{className:"size-4 text-muted-foreground"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-sm font-medium text-foreground",children:"CLAUDE.md Editor"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Edit agent instruction files"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:["saved"===x.status&&(0,t.jsxs)("div",{className:"flex items-center gap-1 text-xs text-chart-2",children:[(0,t.jsx)(C,{className:"size-3"})," Saved"]}),"error"===x.status&&(0,t.jsxs)("div",{className:"flex items-center gap-1 text-xs text-destructive",children:[(0,t.jsx)(w,{className:"size-3"})," ",x.message]}),(0,t.jsx)("button",{onClick:h,className:"p-1.5 rounded hover:bg-muted transition-colors",title:"Reload from disk",children:(0,t.jsx)(d,{className:"size-3.5 text-muted-foreground"})}),(0,t.jsxs)("button",{onClick:()=>void f(o),disabled:"saving"===x.status||!j?.path,className:"flex items-center gap-1.5 px-3 py-1.5 rounded bg-primary text-primary-foreground text-xs font-medium hover:bg-primary/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:[(0,t.jsx)(rz,{className:"size-3"}),"saving"===x.status?"Saving…":"Save"]})]})]}),(0,t.jsx)("div",{className:"border-b border-border px-4 flex items-center gap-1 shrink-0 bg-background",children:b.map(e=>(0,t.jsx)("button",{onClick:()=>l(e.key),className:`px-3 py-2 text-xs font-medium border-b-2 transition-colors ${o===e.key?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"}`,children:e.label},e.key))}),b.find(e=>e.key===o)&&(0,t.jsxs)("div",{className:"px-4 py-2 bg-muted/30 border-b border-border shrink-0",children:[(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[b.find(e=>e.key===o)?.subtitle,j?.path&&(0,t.jsx)("span",{className:"ml-2 font-mono opacity-60",children:j.path})]}),!j?.exists&&(0,t.jsx)("p",{className:"text-xs text-amber-500 mt-0.5",children:"File does not exist yet — saving will create it."})]}),(0,t.jsx)(tv,{className:"flex-1",children:(0,t.jsx)("div",{className:"p-4 h-full",children:j?.path?(0,t.jsx)("textarea",{value:"plan"===o?i:u,onChange:e=>v(e.target.value),spellCheck:!1,className:"w-full min-h-[60vh] bg-transparent text-sm font-mono text-foreground placeholder-muted-foreground resize-none focus:outline-none leading-relaxed",placeholder:"# CLAUDE.md Start writing agent instructions..."}):(0,t.jsxs)("div",{className:"flex items-center justify-center h-48 text-muted-foreground text-sm",children:["Plan mode not configured — run ",(0,t.jsx)("code",{className:"mx-1 bg-muted px-1 rounded",children:"claudedash init"})," first."]})})})]})}function rM(e,t){"Notification"in window&&"granted"===Notification.permission&&new Notification(e,{body:t})}let r$="claudedash";function rR(e,t){"u">typeof document&&(t>0?document.title=`[⚠ ${t} failed] ${r$}`:e>0?document.title=`[⚠ ${e} blocked] ${r$}`:document.title=r$)}let rD={top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2",right:"left-full top-1/2 -translate-y-1/2 ml-2"};function rA({content:e,children:r,side:s="bottom"}){return(0,t.jsxs)("div",{className:"relative group inline-flex",children:[r,(0,t.jsx)("div",{role:"tooltip",className:`absolute ${rD[s]} px-2 py-1 bg-popover border border-border text-popover-foreground text-[11px] leading-snug rounded shadow-lg whitespace-nowrap pointer-events-none opacity-0 group-hover:opacity-100 transition-opacity duration-150 z-50`,children:e})]})}let rL=[{id:"live",icon:c,label:"Live",tooltip:"Real-time Claude Code session monitor",show:e=>e.live},{id:"plan",icon:u,label:"Queue",tooltip:"Task queue tracker — queue.md · execution.log · agent status",show:e=>e.plan},{id:"worktrees",icon:m,label:"Worktrees",tooltip:"Git worktree status across parallel branches",show:e=>e.live||e.plan},{id:"activity",icon:f,label:"Activity",tooltip:"Usage stats, session history and token breakdown",show:()=>!0},{id:"plans",icon:g,label:"Docs",tooltip:"Claude Code plan documents from ~/.claude/plans/",show:()=>!0},{id:"claudemd",icon:b,label:"Config",tooltip:"Edit CLAUDE.md agent instruction files",show:e=>e.plan}];function rP(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function rO(){let[e,s]=(0,r.useState)("live"),[a,n]=(0,r.useState)({live:!1,plan:!1}),[o,l]=(0,r.useState)(!0),[c,u]=(0,r.useState)(null),[m,g]=(0,r.useState)(""),[b,N]=(0,r.useState)(!1),[k,w]=(0,r.useState)(null),[C,S]=(0,r.useState)(!1),E=(0,r.useRef)(null),{showDeniedBanner:z,dismissDeniedBanner:T,sseConnected:M}=function(){let[e,t]=(0,r.useState)(!1),s=tF(),a=(0,r.useRef)(new Map),n=(0,r.useRef)(new Map),o=(0,r.useRef)(!1),l=(0,r.useRef)(!1),i=(0,r.useRef)(new Set);return(0,r.useEffect)(()=>{if("Notification"in window){if("denied"===Notification.permission)return void t(!0);"default"===Notification.permission&&Notification.requestPermission().then(e=>{"denied"===e&&t(!0)})}},[]),tU(e=>{if("sessions"===e.type){let e=tW,t=e.flatMap(e=>e.tasks);if(o.current)for(let t of function(e,t){let r=[];for(let s of t)for(let t of s.tasks){let a=e.get(t.id);a&&a!==t.status&&"completed"===t.status&&r.push({subject:t.subject,project:s.projectName??null})}return r}(a.current,e)){let e=`live:${t.subject}`;i.current.has(e)||(i.current.add(e),rM("Task completed ✓",t.project?`${t.subject}
117
- ${t.project}`:t.subject))}rR(0,0);let r=new Map;for(let e of t)r.set(e.id,e.status);a.current=r,o.current=!0}if("task-blocked"===e.type){let t=`blocked:${e.task_id}:${e.reason??""}`;i.current.has(t)||(i.current.add(t),rM(`Task BLOCKED: ${e.task_id??"?"}`,e.reason?`${e.reason}`:`Reported by ${e.agent??"agent"}`))}if("plan"===e.type){let e=t3,t=e?.snapshot?.tasks??[];if(l.current)for(let e of function(e,t){let r=[];for(let s of t){let t=e.get(s.id);t&&t!==s.status&&("DONE"===s.status||"FAILED"===s.status||"BLOCKED"===s.status)&&r.push({id:s.id,description:s.description,status:s.status})}return r}(n.current,t)){let t=`plan:${e.id}:${e.status}`;i.current.has(t)||(i.current.add(t),"DONE"===e.status?rM("Plan task done ✓",`${e.id}: ${e.description}`):"FAILED"===e.status?rM("Task failed ✗",`${e.id}: ${e.description}`):"BLOCKED"===e.status&&rM("Task blocked ⚠",`${e.id}: ${e.description}`))}let r=e?.snapshot?.summary.failed??0;rR(e?.snapshot?.summary.blocked??0,r);let s=new Map;for(let e of t)s.set(e.id,e.status);n.current=s,l.current=!0}}),{showDeniedBanner:e,dismissDeniedBanner:()=>t(!1),sseConnected:s}}();if(!function({setMode:e,availableModes:t,setSearchFocused:s,clearSearch:a,setShowCheatsheet:n,showCheatsheet:o}){let l=(0,r.useCallback)(r=>{let l=r.target;if("INPUT"===l.tagName||"TEXTAREA"===l.tagName||l.isContentEditable){"Escape"===r.key&&(a(),l.blur());return}if(!r.metaKey&&!r.ctrlKey&&!r.altKey)switch(r.key){case"?":n(!o);break;case"Escape":o?n(!1):a();break;case"l":case"L":t.live&&e("live");break;case"q":case"Q":t.plan&&e("plan");break;case"a":case"A":e("activity");break;case"d":case"D":e("plans");break;case"w":case"W":e("worktrees");break;case"c":case"C":t.plan&&e("claudemd");break;case"/":r.preventDefault(),s()}},[e,t,s,a,n,o]);(0,r.useEffect)(()=>(document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)),[l])}({setMode:s,availableModes:a,setSearchFocused:()=>E.current?.focus(),clearSearch:()=>g(""),setShowCheatsheet:S,showCheatsheet:C}),(0,r.useEffect)(()=>{let e=new AbortController;return fetch("/usage",{signal:e.signal}).then(e=>e.ok?e.json():null).then(e=>{e&&w(e)}).catch(()=>{}),()=>e.abort()},[]),(0,r.useEffect)(()=>{let e=new AbortController;return fetch("/health",{signal:e.signal}).then(e=>e.json()).then(e=>{n(e.modes),e.modes.live?s("live"):e.modes.plan?s("plan"):s("activity"),l(!1)}).catch(()=>{u("Failed to connect to server"),l(!1)}),()=>e.abort()},[]),o)return(0,t.jsx)("div",{className:"h-screen bg-background flex items-center justify-center",children:(0,t.jsx)("div",{className:"text-muted-foreground",children:"Loading..."})});if(c)return(0,t.jsx)("div",{className:"h-screen bg-background flex items-center justify-center",children:(0,t.jsxs)("div",{className:"text-destructive-foreground",children:["Error: ",c]})});let $=k?[`${rP(k.totalMessages)} messages \xb7 ${rP(k.totalSessions)} sessions`,k.firstSessionDate?`Since ${new Date(k.firstSessionDate).toLocaleDateString()}`:null,k.lastComputedDate?`Stats date: ${k.lastComputedDate}`:null].filter(Boolean).join(" · "):"";return(0,t.jsxs)("div",{className:"h-screen bg-background flex flex-col overflow-hidden",children:[z&&(0,t.jsxs)("div",{className:"bg-destructive/10 border-b border-destructive/30 px-4 py-2 flex items-center justify-between text-xs text-destructive shrink-0",children:[(0,t.jsx)("span",{children:"Browser notifications are blocked. Enable them in your browser settings to get alerts when tasks fail or complete."}),(0,t.jsx)("button",{onClick:T,className:"ml-4 text-destructive/70 hover:text-destructive font-medium shrink-0",children:"Dismiss"})]}),(0,t.jsxs)("div",{className:"bg-sidebar border-b border-sidebar-border px-4 py-2 flex items-center justify-between shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)(rA,{content:b?"Expand sidebar":"Collapse sidebar",side:"bottom",children:(0,t.jsx)("button",{onClick:()=>N(!b),className:"p-1.5 rounded hover:bg-sidebar-accent transition-colors",children:b?(0,t.jsx)(p,{className:"size-4"}):(0,t.jsx)(h,{className:"size-4"})})}),(0,t.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,t.jsx)("h1",{className:"text-lg font-semibold text-foreground",children:"claudedash"}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground bg-muted px-2 py-0.5 rounded",children:["v",y.default.version]})]}),(0,t.jsx)("div",{className:"flex items-center bg-muted rounded-lg p-0.5",children:rL.filter(e=>e.show(a)).map(({id:r,icon:a,label:n,tooltip:o})=>(0,t.jsx)(rA,{content:o,side:"bottom",children:(0,t.jsxs)("button",{onClick:()=>s(r),className:`flex items-center gap-1.5 px-3 py-1 rounded text-xs font-medium transition-colors ${e===r?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:[(0,t.jsx)(a,{className:"size-3"}),n]})},r))})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(i,{className:"absolute left-3 top-1/2 -translate-y-1/2 size-3.5 text-muted-foreground"}),(0,t.jsx)("input",{ref:E,type:"text",placeholder:"Filter... (/)",value:m,onChange:e=>g(e.target.value),className:"bg-background border border-border rounded-lg pl-8 pr-3 py-1.5 text-xs text-foreground placeholder-muted-foreground focus:outline-none focus:border-ring w-48"})]}),k&&(0,t.jsx)(rA,{content:$,side:"bottom",children:(0,t.jsxs)("button",{onClick:()=>s("activity"),className:"flex items-center gap-1.5 px-2 py-1 rounded bg-muted/60 hover:bg-muted transition-colors text-xs text-muted-foreground cursor-pointer",children:[(0,t.jsx)(f,{className:"size-3 text-chart-1"}),(0,t.jsx)("span",{className:"font-medium text-foreground",children:rP(k.totalMessages)}),(0,t.jsx)("span",{className:"opacity-50",children:"msgs"}),(0,t.jsx)("span",{className:"opacity-30",children:"·"}),(0,t.jsx)("span",{className:"font-medium text-foreground",children:rP(k.totalSessions)}),(0,t.jsx)("span",{className:"opacity-50",children:"sessions"})]})}),(0,t.jsx)(rA,{content:M?"Live connection active · Server-Sent Events":"Connecting to server…",side:"bottom",children:(0,t.jsxs)("div",{className:"flex items-center gap-1.5 px-2 py-1.5 text-xs text-muted-foreground cursor-default",children:[(0,t.jsx)("span",{className:`size-2 rounded-full ${M?"bg-chart-2 animate-pulse":"bg-muted-foreground/40"}`}),(0,t.jsx)("span",{className:"hidden sm:inline",children:M?"live":"connecting"})]})}),(0,t.jsx)(rA,{content:"Claude Code usage analytics · Run /insight to generate",side:"bottom",children:(0,t.jsx)("button",{onClick:()=>{s(e=>"insights"===e?a.live?"live":a.plan?"plan":"activity":"insights")},className:`p-1.5 rounded transition-colors ${"insights"===e?"bg-sidebar-accent text-chart-3":"hover:bg-sidebar-accent text-muted-foreground hover:text-foreground"}`,children:(0,t.jsx)(x,{className:"size-4"})})}),(0,t.jsx)(rA,{content:"Keyboard shortcuts (?)",side:"bottom",children:(0,t.jsx)("button",{onClick:()=>S(!0),className:"p-1.5 rounded hover:bg-sidebar-accent transition-colors",children:(0,t.jsx)(j,{className:"size-3.5 text-muted-foreground"})})}),(0,t.jsx)(rA,{content:"Reload dashboard",side:"bottom",children:(0,t.jsx)("button",{className:"p-1.5 rounded hover:bg-sidebar-accent transition-colors",onClick:()=>window.location.reload(),children:(0,t.jsx)(d,{className:"size-3.5 text-muted-foreground"})})})]})]}),C&&(0,t.jsx)("div",{role:"presentation",className:"fixed inset-0 z-50 bg-black/50 flex items-center justify-center",onClick:()=>S(!1),onKeyDown:e=>{"Escape"===e.key&&S(!1)},children:(0,t.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":"Keyboard Shortcuts",className:"bg-background border border-border rounded-xl shadow-xl p-6 w-80 max-w-full",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsxs)("h2",{className:"text-sm font-semibold text-foreground flex items-center gap-2",children:[(0,t.jsx)(j,{className:"size-4"})," Keyboard Shortcuts"]}),(0,t.jsx)("button",{onClick:()=>S(!1),className:"text-muted-foreground hover:text-foreground",children:(0,t.jsx)(v,{className:"size-4"})})]}),(0,t.jsx)("div",{className:"space-y-1 text-xs",children:[["L","Live view",a.live],["Q","Queue view",a.plan],["A","Activity view",!0],["D","Docs view",!0],["W","Worktrees view",a.live||a.plan],["C","Config (CLAUDE.md)",a.plan],["/","Focus search",!0],["Esc","Clear search / close",!0],["?","Toggle this cheatsheet",!0]].filter(([,,e])=>e).map(([e,r])=>(0,t.jsxs)("div",{className:"flex items-center justify-between py-1 border-b border-border/40 last:border-0",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:String(r)}),(0,t.jsx)("kbd",{className:"px-2 py-0.5 bg-muted rounded text-[10px] font-mono text-foreground border border-border",children:String(e)})]},String(e)))})]})}),(0,t.jsx)("div",{className:"flex-1 flex overflow-hidden",children:"live"===e?(0,t.jsx)(tB,{searchQuery:m,sidebarCollapsed:b}):"plan"===e?(0,t.jsx)(t7,{searchQuery:m,sidebarCollapsed:b}):"worktrees"===e?(0,t.jsx)(tC,{}):"activity"===e?(0,t.jsx)(rw,{}):"plans"===e?(0,t.jsx)(rE,{}):"claudemd"===e?(0,t.jsx)(rT,{}):(0,t.jsx)(rt,{})})]})}e.s(["default",()=>rO],23733)}]);
116
+ `;function rt(){let[e,s]=(0,r.useState)(null),[a,n]=(0,r.useState)(!1),[o,l]=(0,r.useState)(!0),i=()=>{l(!0),n(!1),s(null),fetch("/claude-insights").then(e=>{if(!e.ok)return n(!0),null;let t=e.headers.get("content-type");return t?.includes("application/json")?(n(!0),null):e.text()}).then(e=>{let t;e&&s((t=`<style>${re}</style>`,e.includes("</head>")?e.replace("</head>",`${t}</head>`):e.includes("<body")?e.replace("<body",`${t}<body`):t+e))}).catch(()=>n(!0)).finally(()=>l(!1))};return((0,r.useEffect)(()=>{i()},[]),o)?(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)(x,{className:"size-10 mx-auto mb-3 text-muted-foreground animate-pulse"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Loading insights..."})]})}):(0,t.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden",children:[(0,t.jsxs)("div",{className:"px-4 py-2 border-b border-border bg-sidebar/30 flex items-center justify-between shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(x,{className:"size-4 text-chart-3"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:"Claude Code Insights"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"Usage analytics from /insight command"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("button",{onClick:i,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center gap-1",title:"Refresh report",children:[(0,t.jsx)(d,{className:"size-3"}),"Refresh"]}),(0,t.jsx)(t9.default,{href:"/claude-insights",target:"_blank",rel:"noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Open in new tab →"})]})]}),a?(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center p-8",children:(0,t.jsxs)("div",{className:"max-w-lg w-full",children:[(0,t.jsx)(x,{className:"size-12 mx-auto mb-5 text-muted-foreground"}),(0,t.jsx)(tN,{lines:["Unlock deep insights into your Claude Code usage...","Discover what's working, what's slowing you down...","See your most-used tools, friction points, and wins...","Get personalized CLAUDE.md suggestions...","Open Claude Code and run: /insight"]}),(0,t.jsxs)("div",{className:"mt-6 bg-muted/50 border border-border rounded-lg p-5",children:[(0,t.jsxs)("h3",{className:"text-sm font-semibold mb-3 flex items-center gap-2",children:[(0,t.jsx)(tV,{className:"size-4"}),"How to generate your report:"]}),(0,t.jsxs)("ol",{className:"text-xs text-muted-foreground space-y-2 list-decimal list-inside",children:[(0,t.jsx)("li",{children:"Open a Claude Code session in your terminal"}),(0,t.jsxs)("li",{children:["Type"," ",(0,t.jsx)("code",{className:"bg-background px-1.5 py-0.5 rounded font-mono text-foreground",children:"/insight"})," ","and press Enter"]}),(0,t.jsx)("li",{children:"Wait 10–30 seconds while Claude analyzes your usage"}),(0,t.jsxs)("li",{children:["Click"," ",(0,t.jsxs)("button",{onClick:i,className:"inline-flex items-center gap-1 text-primary hover:underline",children:[(0,t.jsx)(d,{className:"size-3"}),"Refresh"]})," ","above to view your report"]})]})]})]})}):(0,t.jsx)("iframe",{srcDoc:e??"",sandbox:"allow-scripts allow-same-origin",className:"flex-1 w-full border-0 bg-[#18181b]",title:"Claude Code Insights Report"})]})}let rr=l("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),rs=l("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]),ra=l("dollar-sign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]),rn=l("award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]),ro=l("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);function rl(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function ri(e){return e.includes("opus-4-6")?"Opus 4.6":e.includes("sonnet-4-6")?"Sonnet 4.6":e.includes("haiku-4-5")?"Haiku 4.5":e.includes("opus-4-5")?"Opus 4.5":e.includes("sonnet-4-5")?"Sonnet 4.5":e.includes("3-5-sonnet")?"Sonnet 3.5":e.includes("3-5-haiku")?"Haiku 3.5":e.split("-").slice(0,3).join(" ")}function rd(e){return e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function rc({label:e,value:r,sub:s,colorClass:a}){return(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg p-4",children:[(0,t.jsx)("div",{className:`text-2xl font-bold ${a??"text-foreground"}`,children:r}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:e}),s&&(0,t.jsx)("div",{className:"text-[11px] text-muted-foreground/60 mt-0.5",children:s})]})}function ru({data:e}){if(0===e.length)return null;let r=Math.max(...e.map(e=>e.messageCount),1);return(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:"Last 7 Days — Messages"}),(0,t.jsx)("div",{className:"flex items-end gap-1.5 h-24",children:e.map(e=>{let s=e.messageCount/r*100,a=new Date(e.date).toLocaleDateString("en",{weekday:"short"});return(0,t.jsxs)("div",{className:"flex-1 flex flex-col items-center gap-1 group relative",children:[(0,t.jsxs)("div",{className:"absolute bottom-full mb-1 left-1/2 -translate-x-1/2 bg-popover border border-border text-[10px] text-foreground px-2 py-1 rounded whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity z-10 pointer-events-none",children:[e.date,": ",rl(e.messageCount)," msgs · ",e.sessionCount," sessions"]}),(0,t.jsx)("div",{className:"w-full rounded-sm bg-chart-1/70 hover:bg-chart-1 transition-colors min-h-[2px]",style:{height:`${Math.max(s,2)}%`}}),(0,t.jsx)("span",{className:"text-[9px] text-muted-foreground/60",children:a})]},e.date)})})]})}function rm({hourCounts:e}){let r=Math.max(...Object.values(e),1),s=Array.from({length:24},(e,t)=>t);return(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:"Peak Hours"}),(0,t.jsx)("div",{className:"flex gap-0.5",children:s.map(s=>{let a=e[String(s)]??0,n=a/r;return(0,t.jsxs)("div",{className:"relative group flex-1",children:[(0,t.jsx)("div",{className:"h-6 rounded-sm bg-chart-2",style:{opacity:n<.1?.06:n<.3?.2:n<.6?.5:.85}}),(0,t.jsxs)("div",{className:"absolute bottom-full mb-1 left-1/2 -translate-x-1/2 bg-popover border border-border text-[10px] text-foreground px-1.5 py-0.5 rounded whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity z-10 pointer-events-none",children:[s,":00 · ",a]})]},s)})}),(0,t.jsxs)("div",{className:"flex justify-between text-[9px] text-muted-foreground/40 mt-1",children:[(0,t.jsx)("span",{children:"00:00"}),(0,t.jsx)("span",{children:"06:00"}),(0,t.jsx)("span",{children:"12:00"}),(0,t.jsx)("span",{children:"18:00"}),(0,t.jsx)("span",{children:"23:00"})]})]})}function rx({modelUsage:e}){let r=Object.entries(e);return 0===r.length?null:(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:"Model Usage"}),(0,t.jsx)("div",{className:"space-y-2",children:r.map(([e,r])=>{let s=r.inputTokens+r.outputTokens+r.cacheReadInputTokens;return(0,t.jsxs)("div",{className:"bg-sidebar/50 border border-border rounded-lg px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:ri(e)}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:[rl(s)," total tokens"]})]}),(0,t.jsxs)("div",{className:"flex gap-4 text-[11px]",children:[(0,t.jsxs)("span",{className:"text-chart-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"In "}),rl(r.inputTokens)]}),(0,t.jsxs)("span",{className:"text-chart-2",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Out "}),rl(r.outputTokens)]}),(0,t.jsxs)("span",{className:"text-chart-4",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Cache "}),rl(r.cacheReadInputTokens)]})]})]},e)})})]})}function rp({s:e}){let[s,a]=(0,r.useState)(!1),n=Object.entries(e.languages).sort((e,t)=>t[1]-e[1]).slice(0,3).map(([e])=>e),o=Object.entries(e.toolCounts).sort((e,t)=>t[1]-e[1]).slice(0,3);return(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg overflow-hidden",children:[(0,t.jsxs)("button",{onClick:()=>a(e=>!e),className:"w-full text-left px-4 py-3 hover:bg-accent/40 transition-colors flex items-start gap-3",children:[s?(0,t.jsx)(tK,{className:"size-3.5 text-muted-foreground mt-0.5 shrink-0"}):(0,t.jsx)(tH,{className:"size-3.5 text-muted-foreground mt-0.5 shrink-0"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground truncate",children:e.projectName??e.sessionId.slice(0,8)}),n.length>0&&(0,t.jsx)("div",{className:"flex gap-1",children:n.map(e=>(0,t.jsx)("span",{className:"text-[10px] bg-muted text-muted-foreground px-1.5 py-0.5 rounded",children:e},e))})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3 text-[11px] text-muted-foreground",children:[e.startTime&&(0,t.jsx)("span",{children:function(e){let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;let r=Math.floor(t/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}(e.startTime)}),e.durationMinutes&&(0,t.jsxs)("span",{children:[(0,t.jsx)(tX,{className:"size-3 inline mr-0.5"}),e.durationMinutes,"m"]}),(0,t.jsxs)("span",{children:[(0,t.jsx)(rs,{className:"size-3 inline mr-0.5"}),e.userMessageCount," msgs"]}),e.gitCommits>0&&(0,t.jsxs)("span",{className:"text-chart-2",children:[(0,t.jsx)(S,{className:"size-3 inline mr-0.5"}),e.gitCommits," commits"]}),e.linesAdded>0&&(0,t.jsxs)("span",{className:"text-chart-1",children:["+",rl(e.linesAdded)," lines"]})]})]})]}),s&&(0,t.jsxs)("div",{className:"border-t border-border px-4 py-3 bg-sidebar/30 space-y-3",children:[e.firstPrompt&&(0,t.jsxs)("p",{className:"text-[11px] text-muted-foreground/80 italic line-clamp-2",children:["“",e.firstPrompt.slice(0,200),e.firstPrompt.length>200?"…":"","”"]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-4 text-[11px]",children:[(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Tokens in/out: "}),rl(e.inputTokens)," / ",rl(e.outputTokens)]}),(e.filesModified??0)>0&&(0,t.jsxs)("span",{children:[e.filesModified," files modified"]}),(e.linesRemoved??0)>0&&(0,t.jsxs)("span",{className:"text-chart-5",children:["-",rl(e.linesRemoved)," lines"]}),e.toolErrors>0&&(0,t.jsxs)("span",{className:"text-chart-5",children:[e.toolErrors," tool errors"]}),(e.userInterruptions??0)>0&&(0,t.jsxs)("span",{className:(e.userInterruptions??0)>3?"text-chart-3 font-medium":"text-muted-foreground",children:[e.userInterruptions," interruption",(e.userInterruptions??0)!==1?"s":"",(e.userInterruptions??0)>3?" ⚠":""]}),e.usesTaskAgent&&(0,t.jsx)("span",{className:"text-chart-2",children:"Task Agent"}),e.usesMcp&&(0,t.jsx)("span",{className:"text-chart-4",children:"MCP"}),e.usesWebSearch&&(0,t.jsx)("span",{className:"text-chart-4",children:"Web Search"}),e.durationMinutes&&e.linesAdded>0&&(0,t.jsxs)("span",{className:"text-muted-foreground/60",children:[Math.round(e.linesAdded/e.durationMinutes)," lines/min"]})]}),o.length>0&&(0,t.jsx)("div",{className:"flex gap-2 flex-wrap",children:o.map(([e,r])=>(0,t.jsxs)("span",{className:"text-[10px] bg-muted text-muted-foreground px-2 py-0.5 rounded",children:[e,": ",String(r)]},e))})]})]})}function rh({label:e,value:r,max:s,colorClass:a,sub:n}){let o=s>0?r/s*100:0;return(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground w-36 shrink-0 truncate",children:e}),(0,t.jsx)("div",{className:"flex-1 bg-muted rounded-full h-1.5 relative",children:(0,t.jsx)("div",{className:`${a} h-1.5 rounded-full transition-all`,style:{width:`${o}%`}})}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground w-8 text-right shrink-0",children:r}),n&&(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground/60 w-16 shrink-0",children:n})]})}function rf({s:e}){var s,a;let[n,o]=(0,r.useState)(!1);return(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg overflow-hidden",children:[(0,t.jsxs)("button",{onClick:()=>o(e=>!e),className:"w-full text-left px-4 py-3 hover:bg-accent/40 transition-colors flex items-start gap-3",children:[n?(0,t.jsx)(tK,{className:"size-3.5 text-muted-foreground mt-0.5 shrink-0"}):(0,t.jsx)(tH,{className:"size-3.5 text-muted-foreground mt-0.5 shrink-0"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,t.jsx)("span",{className:`text-[10px] font-medium px-2 py-0.5 rounded-full border ${"fully_achieved"===e.outcome?"border-chart-2/40 text-chart-2 bg-chart-2/10":"mostly_achieved"===e.outcome?"border-chart-1/40 text-chart-1 bg-chart-1/10":"partially_achieved"===e.outcome?"border-chart-3/40 text-chart-3 bg-chart-3/10":"border-chart-5/40 text-chart-5 bg-chart-5/10"}`,children:rd(e.outcome)}),(0,t.jsx)("span",{className:`text-[10px] ${"essential"===(s=e.helpfulness)?"text-chart-2":"very_helpful"===s?"text-chart-1":"moderately_helpful"===s?"text-chart-3":"text-chart-5"}`,children:"essential"===(a=e.helpfulness)?"Essential":"very_helpful"===a?"Very Helpful":"moderately_helpful"===a?"Moderate":a.replace(/_/g," ")}),e.sessionType&&(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground/50",children:e.sessionType.replace(/_/g," ")})]}),e.goal&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:e.goal})]})]}),n&&(0,t.jsxs)("div",{className:"border-t border-border px-4 py-3 bg-sidebar/30 space-y-2",children:[e.briefSummary&&(0,t.jsx)("p",{className:"text-[11px] text-muted-foreground/80",children:e.briefSummary}),e.frictionDetail&&(0,t.jsxs)("p",{className:"text-[11px] text-chart-3/80 italic",children:["⚠ ",e.frictionDetail.slice(0,200),e.frictionDetail.length>200?"…":""]}),Object.keys(e.frictionCounts).length>0&&(0,t.jsx)("div",{className:"flex gap-2 flex-wrap",children:Object.entries(e.frictionCounts).map(([e,r])=>(0,t.jsxs)("span",{className:"text-[10px] bg-chart-5/10 text-chart-5 px-2 py-0.5 rounded",children:[e.replace(/_/g," "),": ",r]},e))}),e.satisfiedCount>0||e.dissatisfiedCount>0?(0,t.jsxs)("div",{className:"text-[11px] text-muted-foreground",children:["Satisfaction: ",(0,t.jsxs)("span",{className:"text-chart-2",children:[e.satisfiedCount," ✓"]}),e.dissatisfiedCount>0&&(0,t.jsxs)("span",{className:"text-chart-5 ml-2",children:[e.dissatisfiedCount," ✗"]})]}):null]})]})}function rg({data:e}){let{aggregate:r,sessions:s}=e;if(!r||0===s.length)return(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg p-5 text-center",children:[(0,t.jsx)(rn,{className:"size-8 mx-auto mb-2 text-muted-foreground/30"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"No session quality data yet"}),(0,t.jsxs)("p",{className:"text-[11px] text-muted-foreground/60 mt-1",children:["Generated from ",(0,t.jsx)("code",{className:"bg-muted px-1 rounded",children:"~/.claude/usage-data/facets/"})]})]});let a=Math.max(...Object.values(r.outcomeCounts),1),n=r.topFriction[0]?.count??1,o=["fully_achieved","mostly_achieved","partially_achieved","not_achieved","unclear_from_transcript"],l=[...o.filter(e=>r.outcomeCounts[e]).map(e=>[e,r.outcomeCounts[e]]),...Object.entries(r.outcomeCounts).filter(([e])=>!o.includes(e))];return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg p-5 space-y-3",children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Outcome Distribution"}),l.map(([e,r])=>(0,t.jsx)(rh,{label:rd(e),value:r,max:a,colorClass:"fully_achieved"===e?"bg-chart-2":"mostly_achieved"===e?"bg-chart-1":"partially_achieved"===e?"bg-chart-3":"bg-chart-5"},e)),null!==r.satisfactionRate&&(0,t.jsxs)("div",{className:"pt-2 border-t border-border text-[11px] text-muted-foreground",children:["User satisfaction rate: ",(0,t.jsxs)("span",{className:"text-chart-2 font-medium",children:[r.satisfactionRate,"%"]}),(0,t.jsxs)("span",{className:"ml-2 opacity-50",children:["(",r.satisfiedTotal," satisfied, ",r.dissatisfiedTotal," dissatisfied)"]})]})]}),(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg p-5 space-y-3",children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Top Friction Points"}),r.topFriction.slice(0,6).map(({type:e,count:r})=>(0,t.jsx)(rh,{label:e.replace(/_/g," "),value:r,max:n,colorClass:"bg-chart-5/60"},e)),0===r.topFriction.length&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"No friction events recorded"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:["Analyzed Sessions (",s.length,")"]}),(0,t.jsx)("div",{className:"space-y-2",children:s.map(e=>(0,t.jsx)(rf,{s:e},e.sessionId))})]})]})}function rb({data:e}){let{aggregate:s,sessions:a}=e,[n,o]=(0,r.useState)(null);if(!s||0===a.length)return(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg p-5 text-center",children:[(0,t.jsx)(tG,{className:"size-8 mx-auto mb-2 text-muted-foreground/30"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"No conversation data found"}),(0,t.jsxs)("p",{className:"text-[11px] text-muted-foreground/60 mt-1",children:["Parses ",(0,t.jsx)("code",{className:"bg-muted px-1 rounded",children:"~/.claude/projects/"})," JSONL files"]})]});let l=s.topTools[0]?.count??1,i=["bg-chart-1","bg-chart-2","bg-chart-3","bg-chart-4","bg-chart-5"];return(0,t.jsx)("div",{className:"space-y-4",children:(0,t.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg p-5 space-y-3",children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Top Tools (All Time)"}),s.topTools.map(({name:e,count:r},a)=>{let n=Math.round(r/s.totalToolCalls*100);return(0,t.jsx)(rh,{label:e,value:r,max:l,colorClass:i[a%i.length],sub:`${n}%`},e)}),(0,t.jsxs)("div",{className:"pt-2 border-t border-border text-[11px] text-muted-foreground",children:[rl(s.totalToolCalls)," total calls ·"," ",s.totalErrors," errors ·"," ",(0,t.jsxs)("span",{className:s.errorRate>5?"text-chart-5":"text-chart-2",children:[s.errorRate.toFixed(1),"% error rate"]})]})]}),(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg p-5",children:[(0,t.jsxs)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:["Recent Conversations (",a.length,")"]}),(0,t.jsx)("div",{className:"space-y-2",children:a.slice(0,8).map(e=>(0,t.jsxs)("div",{className:"rounded border border-border overflow-hidden",children:[(0,t.jsxs)("button",{onClick:()=>o(n===e.sessionId?null:e.sessionId),className:"w-full text-left px-3 py-2 hover:bg-accent/30 transition-colors flex items-center gap-2 text-[11px]",children:[n===e.sessionId?(0,t.jsx)(tK,{className:"size-3 text-muted-foreground shrink-0"}):(0,t.jsx)(tH,{className:"size-3 text-muted-foreground shrink-0"}),(0,t.jsx)("span",{className:"font-medium text-foreground truncate flex-1",children:e.projectName??e.sessionId.slice(0,8)}),(0,t.jsxs)("span",{className:"text-muted-foreground shrink-0",children:[e.messageCount," msgs"]}),e.errorCount>0&&(0,t.jsxs)("span",{className:"text-chart-5 shrink-0",children:[e.errorCount," err"]})]}),n===e.sessionId&&(0,t.jsxs)("div",{className:"border-t border-border px-3 py-2 bg-sidebar/30 text-[10px] space-y-1.5",children:[e.cwd&&(0,t.jsx)("div",{className:"text-muted-foreground/60 font-mono truncate",children:e.cwd}),(0,t.jsx)("div",{className:"flex gap-2 flex-wrap",children:e.topTools.map(({name:e,count:r})=>(0,t.jsxs)("span",{className:"bg-muted text-muted-foreground px-1.5 py-0.5 rounded",children:[e,": ",r]},e))}),(0,t.jsxs)("div",{className:"text-muted-foreground",children:["R:",e.fileOps.read," W:",e.fileOps.write," E:",e.fileOps.edit," file ops"]})]})]},e.sessionId))})]})]})})}function rj({data:e}){let r=e.perModel.filter(e=>null!==e.estimatedCostUSD);return 0===r.length?null:(0,t.jsxs)("div",{className:"bg-chart-4/5 border border-chart-4/20 rounded-lg p-5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(ra,{className:"size-4 text-chart-4"}),(0,t.jsx)("h4",{className:"text-sm font-semibold text-foreground",children:"Estimated Cost"})]}),(0,t.jsxs)("div",{className:"text-xl font-bold text-chart-4",children:["~$",e.totalCostUSD.toFixed(2)]})]}),(0,t.jsx)("div",{className:"space-y-2 mb-3",children:r.map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between text-[11px]",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:ri(e.model)}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("span",{className:"text-muted-foreground/60",children:[rl(e.inputTokens+e.outputTokens)," tok"]}),(0,t.jsxs)("span",{className:"font-medium text-foreground",children:["$",(e.estimatedCostUSD??0).toFixed(2)]})]})]},e.model))}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground/50",children:e.disclaimer})]})}function rv({data:e}){if(!e.active||!e.tokensUsed)return null;let r=e.minutesElapsed??0,s=Math.min(r/300*100,100),a=s>90?"text-chart-5":s>70?"text-chart-3":"text-chart-2";return(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(rr,{className:`size-3.5 ${a}`}),(0,t.jsx)("span",{className:"text-xs font-semibold text-foreground",children:"Current 5h Billing Block"})]}),(0,t.jsxs)("span",{className:`text-sm font-bold ${a}`,children:["~$",(e.estimatedCostUSD??0).toFixed(2)]})]}),(0,t.jsx)("div",{className:"bg-muted rounded-full h-1.5 mb-2",children:(0,t.jsx)("div",{className:`${s>90?"bg-chart-5":s>70?"bg-chart-3":"bg-chart-2"} h-1.5 rounded-full transition-all`,style:{width:`${s}%`}})}),(0,t.jsxs)("div",{className:"flex items-center justify-between text-[10px] text-muted-foreground",children:[(0,t.jsxs)("span",{children:[r,"m elapsed"]}),(0,t.jsxs)("span",{children:[rl(e.tokensUsed??0)," tokens"]}),(0,t.jsxs)("span",{children:[e.minutesRemaining??0,"m remaining"]})]}),e.breakdown&&(0,t.jsxs)("div",{className:"flex gap-3 mt-2 text-[10px] text-muted-foreground/60",children:[(0,t.jsxs)("span",{children:["In: ",rl(e.breakdown.input)]}),(0,t.jsxs)("span",{children:["Out: ",rl(e.breakdown.output)]}),(0,t.jsxs)("span",{children:["Cache: ",rl(e.breakdown.cacheRead)]})]})]})}function ry({data:e}){let[s,a]=(0,r.useState)(""),[n,o]=(0,r.useState)(null),l=s?e.prompts.filter(e=>e.display.toLowerCase().includes(s.toLowerCase())||(e.projectName??"").toLowerCase().includes(s.toLowerCase())):e.prompts,i=e.topProjects[0]?.count??1;return(0,t.jsxs)("div",{className:"space-y-4",children:[e.topProjects.length>0&&(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg p-5 space-y-2",children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:"Most Active Projects"}),e.topProjects.slice(0,5).map(({path:e,name:r,count:s})=>(0,t.jsx)(rh,{label:r,value:s,max:i,colorClass:"bg-chart-4",sub:`${s} prompts`},e))]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,t.jsxs)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide",children:["Recent Prompts (",e.total,")"]}),(0,t.jsx)("input",{type:"text",placeholder:"Search prompts…",value:s,onChange:e=>a(e.target.value),className:"ml-auto bg-background border border-border rounded-lg px-3 py-1 text-xs text-foreground placeholder-muted-foreground focus:outline-none focus:border-ring w-48"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[l.slice(0,30).map((e,r)=>{let s=`${e.sessionId}-${r}`,a=n===s;return(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg overflow-hidden",children:[(0,t.jsxs)("button",{onClick:()=>o(a?null:s),className:"w-full text-left px-3 py-2 hover:bg-accent/30 transition-colors flex items-start gap-2",children:[(0,t.jsx)(ro,{className:"size-3 text-muted-foreground shrink-0 mt-0.5"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("p",{className:"text-xs text-foreground truncate",children:e.display||"(empty)"}),(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-0.5 text-[10px] text-muted-foreground/60",children:[e.projectName&&(0,t.jsx)("span",{children:e.projectName}),(0,t.jsx)("span",{children:new Date(e.timestamp).toLocaleDateString("en",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})})]})]})]}),a&&(0,t.jsxs)("div",{className:"border-t border-border px-3 py-2 bg-sidebar/30 text-[10px] text-muted-foreground/70 space-y-1",children:[(0,t.jsx)("p",{className:"break-words",children:e.display}),(0,t.jsx)("p",{className:"font-mono opacity-50",children:e.project})]})]},s)}),0===l.length&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60 text-center py-4",children:"No matching prompts"})]})]})]})}let rN={Bash:"⚡",Read:"📖",Edit:"✏️",Write:"💾",Glob:"🔍",Grep:"🔎",Task:"🤖",WebFetch:"🌐",WebSearch:"🔍",TodoWrite:"📋"};function rk({events:e,hasHooks:r}){return r?(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg p-5",children:[(0,t.jsxs)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:["Live Tool Events (",e.length,")"]}),(0,t.jsxs)("div",{className:"space-y-1 max-h-64 overflow-y-auto",children:[e.slice(0,50).map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 text-[11px] py-0.5",children:[(0,t.jsx)("span",{className:"shrink-0",children:rN[e.tool??""]??"🔧"}),(0,t.jsx)("span",{className:"font-medium text-foreground",children:e.tool??e.event}),e.session&&(0,t.jsx)("span",{className:"text-muted-foreground/50 font-mono",children:e.session.slice(0,6)}),(0,t.jsx)("span",{className:"ml-auto text-muted-foreground/40 shrink-0",children:new Date(e.receivedAt).toLocaleTimeString("en",{hour:"2-digit",minute:"2-digit",second:"2-digit"})})]},e.receivedAt)),0===e.length&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:"Waiting for events… Run a Claude Code session."})]})]}):(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg p-5 text-center",children:[(0,t.jsx)(rr,{className:"size-8 mx-auto mb-2 text-muted-foreground/30"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"No hook events yet"}),(0,t.jsx)("p",{className:"text-[11px] text-muted-foreground/60 mb-3",children:"Install hooks for real-time tool event streaming:"}),(0,t.jsx)("code",{className:"text-[11px] bg-muted px-2 py-1 rounded",children:"npx claudedash hooks install"})]})}function rw(){let[e,s]=(0,r.useState)(null),[a,n]=(0,r.useState)([]),[o,l]=(0,r.useState)(null),[i,c]=(0,r.useState)(null),[u,m]=(0,r.useState)(null),[x,p]=(0,r.useState)(null),[h,g]=(0,r.useState)(null),[b,j]=(0,r.useState)([]),[v,y]=(0,r.useState)(!1),[N,k]=(0,r.useState)(!0),[w,C]=(0,r.useState)(!1),[S,E]=(0,r.useState)("overview"),z=(0,r.useRef)(!1),T=(0,r.useCallback)(async(e=!0)=>{e&&k(!0),C(!1);try{let[e,t,r,a,o,i,d,u]=await Promise.all([fetch("/usage"),fetch("/activity/sessions"),fetch("/facets"),fetch("/conversations"),fetch("/cost"),fetch("/history"),fetch("/billing-block"),fetch("/hook/events")]);if(e.ok&&s(await e.json()),t.ok){let e=await t.json();n(e.sessions)}if(r.ok&&l(await r.json()),a.ok&&c(await a.json()),o.ok&&m(await o.json()),i.ok&&p(await i.json()),d.ok&&g(await d.json()),u.ok){let e=await u.json();j(e.events),y(e.events.length>0)}e.ok||t.ok||C(!0)}catch{C(!0)}finally{e&&k(!1)}},[]);if((0,r.useEffect)(()=>{T(!0);let e=setInterval(()=>{T(!1)},3e4);return()=>clearInterval(e)},[T]),tU(e=>{"sessions"===e.type?T(!1):"hook"===e.type&&(j(t=>[e,...t].slice(0,100)),y(!0),z.current||(z.current=!0,setTimeout(()=>{z.current=!1,T(!1)},2e3)))}),N)return(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)(f,{className:"size-10 mx-auto mb-3 text-muted-foreground animate-pulse"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Loading activity data…"})]})});if(w||!e)return(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center p-8",children:(0,t.jsxs)("div",{className:"text-center max-w-sm",children:[(0,t.jsx)(f,{className:"size-12 mx-auto mb-4 text-muted-foreground/30"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"No activity data found"}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground/60",children:["Start a Claude Code session to generate"," ",(0,t.jsx)("code",{className:"bg-muted px-1 rounded",children:"~/.claude/stats-cache.json"})]})]})});let M=a.reduce((e,t)=>e+(t.linesAdded??0),0),$=a.reduce((e,t)=>e+(t.gitCommits??0),0),R=o?.sessions.length??0,D=i?.sessions.length??0,A=x?.total??0,L=b.length,P=[{id:"overview",label:"Overview"},{id:"quality",label:`Quality${R>0?` (${R})`:""}`},{id:"tools",label:`Tools${D>0?` (${D})`:""}`},{id:"history",label:`History${A>0?` (${A})`:""}`},{id:"hooks",label:`Hooks${L>0?` (${L})`:""}`}];return(0,t.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden",children:[(0,t.jsxs)("div",{className:"px-4 py-2 border-b border-border bg-sidebar/30 flex items-center justify-between shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(f,{className:"size-4 text-chart-1"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:"Activity"}),e.lastComputedDate&&(0,t.jsxs)("span",{className:"text-xs text-muted-foreground hidden sm:inline",children:["Updated: ",e.lastComputedDate]})]}),(0,t.jsx)("div",{className:"flex items-center bg-muted rounded-lg p-0.5",children:P.map(({id:e,label:r})=>(0,t.jsx)("button",{onClick:()=>E(e),className:`px-3 py-1 rounded text-xs font-medium transition-colors ${S===e?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:r},e))})]}),(0,t.jsxs)("button",{onClick:()=>void T(!0),className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center gap-1",children:[(0,t.jsx)(d,{className:"size-3"}),"Refresh"]})]}),(0,t.jsx)(tv,{className:"flex-1",children:(0,t.jsxs)("div",{className:"p-6 space-y-8 max-w-4xl mx-auto",children:["overview"===S&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[(0,t.jsx)(rc,{label:"Total Sessions",value:rl(e.totalSessions),sub:e.firstSessionDate?`Since ${new Date(e.firstSessionDate).toLocaleDateString("en",{month:"short",day:"numeric"})}`:void 0,colorClass:"text-chart-1"}),(0,t.jsx)(rc,{label:"Total Messages",value:rl(e.totalMessages),colorClass:"text-chart-2"}),(0,t.jsx)(rc,{label:"Lines Added",value:M>0?`+${rl(M)}`:"—",colorClass:"text-chart-4"}),(0,t.jsx)(rc,{label:"Git Commits",value:$>0?rl($):"—",colorClass:"text-chart-3"})]}),h&&(0,t.jsx)(rv,{data:h}),u&&(0,t.jsx)(rj,{data:u}),e.dailyActivity.length>0&&(0,t.jsx)("div",{className:"bg-card border border-border rounded-lg p-5",children:(0,t.jsx)(ru,{data:e.dailyActivity})}),(0,t.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[Object.keys(e.hourCounts).length>0&&(0,t.jsx)("div",{className:"bg-card border border-border rounded-lg p-5",children:(0,t.jsx)(rm,{hourCounts:e.hourCounts})}),Object.keys(e.modelUsage).length>0&&(0,t.jsx)("div",{className:"bg-card border border-border rounded-lg p-5",children:(0,t.jsx)(rx,{modelUsage:e.modelUsage})})]}),e.longestSession&&(0,t.jsxs)("div",{className:"bg-chart-4/5 border border-chart-4/20 rounded-lg px-5 py-4 flex items-center gap-4",children:[(0,t.jsx)(rr,{className:"size-5 text-chart-4 shrink-0"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-xs font-semibold text-foreground",children:"Longest session: "}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:[e.longestSession.messageCount," messages ·"," ",Math.round(e.longestSession.duration/6e4),"m ·"," ",new Date(e.longestSession.timestamp).toLocaleDateString()]})]})]}),a.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:["Recent Sessions (",a.length,")"]}),(0,t.jsx)("div",{className:"space-y-2",children:a.map(e=>(0,t.jsx)(rp,{s:e},e.sessionId))})]})]}),"quality"===S&&o&&(0,t.jsx)(rg,{data:o}),"tools"===S&&i&&(0,t.jsx)(rb,{data:i}),"history"===S&&x&&(0,t.jsx)(ry,{data:x}),"hooks"===S&&(0,t.jsx)(rk,{events:b,hasHooks:v})]})})]})}let rC=l("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);function rS({content:e}){let r=e.split("\n"),s=[],a=!1,n=[],o=0,l=()=>{n.length>0&&(s.push((0,t.jsx)("pre",{className:"bg-muted rounded-md p-3 text-[11px] font-mono overflow-x-auto mb-3 text-foreground/80",children:n.join("\n")},o++)),n=[])};for(let e of r){if(e.startsWith("```")){a?(l(),a=!1):a=!0;continue}if(a){n.push(e);continue}if(e.startsWith("# "))s.push((0,t.jsx)("h2",{className:"text-base font-bold text-foreground mt-4 mb-2",children:e.slice(2)},o++));else if(e.startsWith("## "))s.push((0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground mt-3 mb-1.5",children:e.slice(3)},o++));else if(e.startsWith("### "))s.push((0,t.jsx)("h4",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mt-2 mb-1",children:e.slice(4)},o++));else if(e.startsWith("- ")||e.startsWith("* "))s.push((0,t.jsx)("li",{className:"text-xs text-muted-foreground ml-4 mb-0.5 list-disc",children:e.slice(2)},o++));else if(e.match(/^\d+\. /)){let r=e.replace(/^\d+\. /,"");s.push((0,t.jsx)("li",{className:"text-xs text-muted-foreground ml-4 mb-0.5 list-decimal",children:r},o++))}else if(""===e.trim())s.push((0,t.jsx)("div",{className:"h-2"},o++));else{let r=e.split(/(`[^`]+`)/g);s.push((0,t.jsx)("p",{className:"text-xs text-muted-foreground mb-0.5",children:r.map(e=>e.startsWith("`")&&e.endsWith("`")?(0,t.jsx)("code",{className:"bg-muted px-1 rounded text-[11px] font-mono text-foreground",children:e.slice(1,-1)},e):e)},o++))}}return l(),(0,t.jsx)("div",{children:s})}function rE(){let[e,s]=(0,r.useState)([]),[a,n]=(0,r.useState)(null),[o,l]=(0,r.useState)(!0),i=async()=>{l(!0);try{let e=await fetch("/plans");if(e.ok){let t=await e.json();s(t.plans),t.plans.length>0&&!a&&n(t.plans[0])}}catch{}finally{l(!1)}};return((0,r.useEffect)(()=>{i()},[]),o)?(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,t.jsx)(g,{className:"size-8 text-muted-foreground/30 animate-pulse"})}):0===e.length?(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center p-8",children:(0,t.jsxs)("div",{className:"text-center max-w-sm",children:[(0,t.jsx)(g,{className:"size-12 mx-auto mb-4 text-muted-foreground/30"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"No plans yet"}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground/60",children:["Use ",(0,t.jsx)("code",{className:"bg-muted px-1 rounded",children:"/plan"})," in Claude Code to generate plan documents. They are saved to ",(0,t.jsx)("code",{className:"bg-muted px-1 rounded",children:"~/.claude/plans/"})]})]})}):(0,t.jsxs)("div",{className:"flex-1 flex overflow-hidden",children:[(0,t.jsxs)("div",{className:"w-64 border-r border-border flex flex-col shrink-0",children:[(0,t.jsxs)("div",{className:"px-4 py-2 border-b border-border bg-sidebar/30 flex items-center justify-between shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(g,{className:"size-3.5 text-chart-3"}),(0,t.jsxs)("span",{className:"text-xs font-medium",children:["Plans (",e.length,")"]})]}),(0,t.jsx)("button",{onClick:i,className:"p-1 rounded hover:bg-accent/50 transition-colors",children:(0,t.jsx)(d,{className:"size-3 text-muted-foreground"})})]}),(0,t.jsx)(tv,{className:"flex-1",children:(0,t.jsx)("div",{className:"p-2 space-y-1",children:e.map(e=>{var r;let s;return(0,t.jsxs)("button",{onClick:()=>n(e),className:`w-full text-left px-3 py-2.5 rounded-lg transition-colors flex items-start gap-2 ${a?.id===e.id?"bg-accent text-foreground":"hover:bg-accent/50 text-muted-foreground"}`,children:[(0,t.jsx)(tH,{className:"size-3 shrink-0 mt-0.5 opacity-50"}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:"text-xs font-medium truncate leading-tight",children:e.title}),(0,t.jsxs)("p",{className:"text-[10px] text-muted-foreground/60 mt-0.5 flex items-center gap-1",children:[(0,t.jsx)(rC,{className:"size-2.5"}),(r=e.createdAt,0===(s=Math.floor((Date.now()-new Date(r).getTime())/864e5))?"today":1===s?"yesterday":s<7?`${s}d ago`:s<30?`${Math.floor(s/7)}w ago`:`${Math.floor(s/30)}mo ago`)]})]})]},e.id)})})})]}),(0,t.jsx)("div",{className:"flex-1 flex flex-col overflow-hidden",children:a?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"px-6 py-3 border-b border-border bg-sidebar/20 shrink-0",children:[(0,t.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:a.title}),(0,t.jsxs)("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:[(0,t.jsx)(rC,{className:"size-2.5 inline mr-1"}),new Date(a.createdAt).toLocaleDateString("en",{year:"numeric",month:"long",day:"numeric"}),(0,t.jsx)("span",{className:"ml-2 font-mono opacity-50",children:a.filename})]})]}),(0,t.jsx)(tv,{className:"flex-1",children:(0,t.jsx)("div",{className:"p-6 max-w-3xl",children:(0,t.jsx)(rS,{content:a.content})})})]}):(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center text-muted-foreground text-sm",children:"Select a plan"})})]})}let rz=l("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);function rT(){let[e,s]=(0,r.useState)(null),[a,n]=(0,r.useState)(!0),[o,l]=(0,r.useState)("plan"),[i,c]=(0,r.useState)(""),[u,m]=(0,r.useState)(""),[x,p]=(0,r.useState)({status:"idle"}),h=(0,r.useCallback)(()=>{n(!0),fetch("/claudemd").then(e=>e.json()).then(e=>{s(e),c(e.plan.content),m(e.project.content),n(!1)}).catch(()=>n(!1))},[]);(0,r.useEffect)(()=>{h()},[h]);let f=async e=>{p({status:"saving"});let t="plan"===e?i:u;try{let r=await fetch("/claudemd",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:e,content:t})});if(r.ok)p({status:"saved"}),setTimeout(()=>p({status:"idle"}),2e3);else{let e=await r.json();p({status:"error",message:e.error??"Save failed"})}}catch{p({status:"error",message:"Network error"})}};if(a)return(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center text-muted-foreground text-sm",children:"Loading…"});let b=[{key:"plan",label:".claudedash/CLAUDE.md",subtitle:"Plan mode instructions injected into every agent context"},{key:"project",label:"CLAUDE.md",subtitle:"Project root — global agent instructions for this repository"}],j=e?.[o],v="plan"===o?c:m;return(0,t.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden",children:[(0,t.jsxs)("div",{className:"border-b border-border px-4 py-3 flex items-center justify-between shrink-0 bg-background",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(g,{className:"size-4 text-muted-foreground"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-sm font-medium text-foreground",children:"CLAUDE.md Editor"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Edit agent instruction files"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:["saved"===x.status&&(0,t.jsxs)("div",{className:"flex items-center gap-1 text-xs text-chart-2",children:[(0,t.jsx)(C,{className:"size-3"})," Saved"]}),"error"===x.status&&(0,t.jsxs)("div",{className:"flex items-center gap-1 text-xs text-destructive",children:[(0,t.jsx)(w,{className:"size-3"})," ",x.message]}),(0,t.jsx)("button",{onClick:h,className:"p-1.5 rounded hover:bg-muted transition-colors",title:"Reload from disk",children:(0,t.jsx)(d,{className:"size-3.5 text-muted-foreground"})}),(0,t.jsxs)("button",{onClick:()=>void f(o),disabled:"saving"===x.status||!j?.path,className:"flex items-center gap-1.5 px-3 py-1.5 rounded bg-primary text-primary-foreground text-xs font-medium hover:bg-primary/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:[(0,t.jsx)(rz,{className:"size-3"}),"saving"===x.status?"Saving…":"Save"]})]})]}),(0,t.jsx)("div",{className:"border-b border-border px-4 flex items-center gap-1 shrink-0 bg-background",children:b.map(e=>(0,t.jsx)("button",{onClick:()=>l(e.key),className:`px-3 py-2 text-xs font-medium border-b-2 transition-colors ${o===e.key?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"}`,children:e.label},e.key))}),b.find(e=>e.key===o)&&(0,t.jsxs)("div",{className:"px-4 py-2 bg-muted/30 border-b border-border shrink-0",children:[(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[b.find(e=>e.key===o)?.subtitle,j?.path&&(0,t.jsx)("span",{className:"ml-2 font-mono opacity-60",children:j.path})]}),!j?.exists&&(0,t.jsx)("p",{className:"text-xs text-amber-500 mt-0.5",children:"File does not exist yet — saving will create it."})]}),(0,t.jsx)(tv,{className:"flex-1",children:(0,t.jsx)("div",{className:"p-4 h-full",children:j?.path?(0,t.jsx)("textarea",{value:"plan"===o?i:u,onChange:e=>v(e.target.value),spellCheck:!1,className:"w-full min-h-[60vh] bg-transparent text-sm font-mono text-foreground placeholder-muted-foreground resize-none focus:outline-none leading-relaxed",placeholder:"# CLAUDE.md Start writing agent instructions..."}):(0,t.jsxs)("div",{className:"flex items-center justify-center h-48 text-muted-foreground text-sm",children:["Plan mode not configured — run ",(0,t.jsx)("code",{className:"mx-1 bg-muted px-1 rounded",children:"claudedash init"})," first."]})})})]})}function rM(e,t){"Notification"in window&&"granted"===Notification.permission&&new Notification(e,{body:t})}let r$="claudedash";function rR(e,t){"u">typeof document&&(t>0?document.title=`[⚠ ${t} failed] ${r$}`:e>0?document.title=`[⚠ ${e} blocked] ${r$}`:document.title=r$)}let rD={top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2",right:"left-full top-1/2 -translate-y-1/2 ml-2"};function rA({content:e,children:r,side:s="bottom"}){return(0,t.jsxs)("div",{className:"relative group inline-flex",children:[r,(0,t.jsx)("div",{role:"tooltip",className:`absolute ${rD[s]} px-2 py-1 bg-popover border border-border text-popover-foreground text-[11px] leading-snug rounded shadow-lg whitespace-nowrap pointer-events-none opacity-0 group-hover:opacity-100 transition-opacity duration-150 z-50`,children:e})]})}let rL=[{id:"live",icon:c,label:"Live",tooltip:"Real-time Claude Code session monitor",show:e=>e.live},{id:"plan",icon:u,label:"Queue",tooltip:"Task queue tracker — queue.md · execution.log · agent status",show:e=>e.plan},{id:"worktrees",icon:m,label:"Worktrees",tooltip:"Git worktree status across parallel branches",show:e=>e.live||e.plan},{id:"activity",icon:f,label:"Activity",tooltip:"Usage stats, session history and token breakdown",show:()=>!0},{id:"plans",icon:g,label:"Docs",tooltip:"Claude Code plan documents from ~/.claude/plans/",show:()=>!0},{id:"claudemd",icon:b,label:"Config",tooltip:"Edit CLAUDE.md agent instruction files",show:e=>e.plan}];function rP(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function rO(){let[e,s]=(0,r.useState)("live"),[a,n]=(0,r.useState)({live:!1,plan:!1}),[o,l]=(0,r.useState)(!0),[c,u]=(0,r.useState)(null),[m,g]=(0,r.useState)(""),[b,N]=(0,r.useState)(!1),[k,w]=(0,r.useState)(null),[C,S]=(0,r.useState)(!1),E=(0,r.useRef)(null),{showDeniedBanner:z,dismissDeniedBanner:T,sseConnected:M}=function(){let[e,t]=(0,r.useState)(!1),s=tF(),a=(0,r.useRef)(new Map),n=(0,r.useRef)(new Map),o=(0,r.useRef)(!1),l=(0,r.useRef)(!1),i=(0,r.useRef)(new Set);return(0,r.useEffect)(()=>{if("Notification"in window){if("denied"===Notification.permission)return void t(!0);"default"===Notification.permission&&Notification.requestPermission().then(e=>{"denied"===e&&t(!0)})}},[]),tU(e=>{if("sessions"===e.type){let e=tW;if(o.current)for(let t of function(e,t){let r=[];for(let s of t)for(let t of s.tasks){let a=`${s.id}:${t.id}`,n=e.get(a);n&&n!==t.status&&"completed"===t.status&&r.push({subject:t.subject,project:s.projectName??null})}return r}(a.current,e)){let e=`live:${t.subject}`;i.current.has(e)||(i.current.add(e),rM("Task completed ✓",t.project?`${t.subject}
117
+ ${t.project}`:t.subject))}rR(0,0);let t=new Map;for(let r of e)for(let e of r.tasks)t.set(`${r.id}:${e.id}`,e.status);a.current=t,o.current=!0}if("task-blocked"===e.type){let t=`blocked:${e.task_id}:${e.reason??""}`;i.current.has(t)||(i.current.add(t),rM(`Task BLOCKED: ${e.task_id??"?"}`,e.reason?`${e.reason}`:`Reported by ${e.agent??"agent"}`))}if("plan"===e.type){let e=t3,t=e?.snapshot?.tasks??[];if(l.current)for(let e of function(e,t){let r=[];for(let s of t){let t=e.get(s.id);t&&t!==s.status&&("DONE"===s.status||"FAILED"===s.status||"BLOCKED"===s.status)&&r.push({id:s.id,description:s.description,status:s.status})}return r}(n.current,t)){let t=`plan:${e.id}:${e.status}`;i.current.has(t)||(i.current.add(t),"DONE"===e.status?rM("Plan task done ✓",`${e.id}: ${e.description}`):"FAILED"===e.status?rM("Task failed ✗",`${e.id}: ${e.description}`):"BLOCKED"===e.status&&rM("Task blocked ⚠",`${e.id}: ${e.description}`))}let r=e?.snapshot?.summary.failed??0;rR(e?.snapshot?.summary.blocked??0,r);let s=new Map;for(let e of t)s.set(e.id,e.status);n.current=s,l.current=!0}}),{showDeniedBanner:e,dismissDeniedBanner:()=>t(!1),sseConnected:s}}();if(!function({setMode:e,availableModes:t,setSearchFocused:s,clearSearch:a,setShowCheatsheet:n,showCheatsheet:o}){let l=(0,r.useCallback)(r=>{let l=r.target;if("INPUT"===l.tagName||"TEXTAREA"===l.tagName||l.isContentEditable){"Escape"===r.key&&(a(),l.blur());return}if(!r.metaKey&&!r.ctrlKey&&!r.altKey)switch(r.key){case"?":n(!o);break;case"Escape":o?n(!1):a();break;case"l":case"L":t.live&&e("live");break;case"q":case"Q":t.plan&&e("plan");break;case"a":case"A":e("activity");break;case"d":case"D":e("plans");break;case"w":case"W":e("worktrees");break;case"c":case"C":t.plan&&e("claudemd");break;case"/":r.preventDefault(),s()}},[e,t,s,a,n,o]);(0,r.useEffect)(()=>(document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)),[l])}({setMode:s,availableModes:a,setSearchFocused:()=>E.current?.focus(),clearSearch:()=>g(""),setShowCheatsheet:S,showCheatsheet:C}),(0,r.useEffect)(()=>{let e=new AbortController;return fetch("/usage",{signal:e.signal}).then(e=>e.ok?e.json():null).then(e=>{e&&w(e)}).catch(()=>{}),()=>e.abort()},[]),(0,r.useEffect)(()=>{let e=new AbortController;return fetch("/health",{signal:e.signal}).then(e=>e.json()).then(e=>{n(e.modes),e.modes.live?s("live"):e.modes.plan?s("plan"):s("activity"),l(!1)}).catch(()=>{u("Failed to connect to server"),l(!1)}),()=>e.abort()},[]),o)return(0,t.jsx)("div",{className:"h-screen bg-background flex items-center justify-center",children:(0,t.jsx)("div",{className:"text-muted-foreground",children:"Loading..."})});if(c)return(0,t.jsx)("div",{className:"h-screen bg-background flex items-center justify-center",children:(0,t.jsxs)("div",{className:"text-destructive-foreground",children:["Error: ",c]})});let $=k?[`${rP(k.totalMessages)} messages \xb7 ${rP(k.totalSessions)} sessions`,k.firstSessionDate?`Since ${new Date(k.firstSessionDate).toLocaleDateString()}`:null,k.lastComputedDate?`Stats date: ${k.lastComputedDate}`:null].filter(Boolean).join(" · "):"";return(0,t.jsxs)("div",{className:"h-screen bg-background flex flex-col overflow-hidden",children:[z&&(0,t.jsxs)("div",{className:"bg-destructive/10 border-b border-destructive/30 px-4 py-2 flex items-center justify-between text-xs text-destructive shrink-0",children:[(0,t.jsx)("span",{children:"Browser notifications are blocked. Enable them in your browser settings to get alerts when tasks fail or complete."}),(0,t.jsx)("button",{onClick:T,className:"ml-4 text-destructive/70 hover:text-destructive font-medium shrink-0",children:"Dismiss"})]}),(0,t.jsxs)("div",{className:"bg-sidebar border-b border-sidebar-border px-4 py-2 flex items-center justify-between shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)(rA,{content:b?"Expand sidebar":"Collapse sidebar",side:"bottom",children:(0,t.jsx)("button",{onClick:()=>N(!b),className:"p-1.5 rounded hover:bg-sidebar-accent transition-colors",children:b?(0,t.jsx)(p,{className:"size-4"}):(0,t.jsx)(h,{className:"size-4"})})}),(0,t.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,t.jsx)("h1",{className:"text-lg font-semibold text-foreground",children:"claudedash"}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground bg-muted px-2 py-0.5 rounded",children:["v",y.default.version]})]}),(0,t.jsx)("div",{className:"flex items-center bg-muted rounded-lg p-0.5",children:rL.filter(e=>e.show(a)).map(({id:r,icon:a,label:n,tooltip:o})=>(0,t.jsx)(rA,{content:o,side:"bottom",children:(0,t.jsxs)("button",{onClick:()=>s(r),className:`flex items-center gap-1.5 px-3 py-1 rounded text-xs font-medium transition-colors ${e===r?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:[(0,t.jsx)(a,{className:"size-3"}),n]})},r))})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(i,{className:"absolute left-3 top-1/2 -translate-y-1/2 size-3.5 text-muted-foreground"}),(0,t.jsx)("input",{ref:E,type:"text",placeholder:"Filter... (/)",value:m,onChange:e=>g(e.target.value),className:"bg-background border border-border rounded-lg pl-8 pr-3 py-1.5 text-xs text-foreground placeholder-muted-foreground focus:outline-none focus:border-ring w-48"})]}),k&&(0,t.jsx)(rA,{content:$,side:"bottom",children:(0,t.jsxs)("button",{onClick:()=>s("activity"),className:"flex items-center gap-1.5 px-2 py-1 rounded bg-muted/60 hover:bg-muted transition-colors text-xs text-muted-foreground cursor-pointer",children:[(0,t.jsx)(f,{className:"size-3 text-chart-1"}),(0,t.jsx)("span",{className:"font-medium text-foreground",children:rP(k.totalMessages)}),(0,t.jsx)("span",{className:"opacity-50",children:"msgs"}),(0,t.jsx)("span",{className:"opacity-30",children:"·"}),(0,t.jsx)("span",{className:"font-medium text-foreground",children:rP(k.totalSessions)}),(0,t.jsx)("span",{className:"opacity-50",children:"sessions"})]})}),(0,t.jsx)(rA,{content:M?"Live connection active · Server-Sent Events":"Connecting to server…",side:"bottom",children:(0,t.jsxs)("div",{className:"flex items-center gap-1.5 px-2 py-1.5 text-xs text-muted-foreground cursor-default",children:[(0,t.jsx)("span",{className:`size-2 rounded-full ${M?"bg-chart-2 animate-pulse":"bg-muted-foreground/40"}`}),(0,t.jsx)("span",{className:"hidden sm:inline",children:M?"live":"connecting"})]})}),(0,t.jsx)(rA,{content:"Claude Code usage analytics · Run /insight to generate",side:"bottom",children:(0,t.jsx)("button",{onClick:()=>{s(e=>"insights"===e?a.live?"live":a.plan?"plan":"activity":"insights")},className:`p-1.5 rounded transition-colors ${"insights"===e?"bg-sidebar-accent text-chart-3":"hover:bg-sidebar-accent text-muted-foreground hover:text-foreground"}`,children:(0,t.jsx)(x,{className:"size-4"})})}),(0,t.jsx)(rA,{content:"Keyboard shortcuts (?)",side:"bottom",children:(0,t.jsx)("button",{onClick:()=>S(!0),className:"p-1.5 rounded hover:bg-sidebar-accent transition-colors",children:(0,t.jsx)(j,{className:"size-3.5 text-muted-foreground"})})}),(0,t.jsx)(rA,{content:"Reload dashboard",side:"bottom",children:(0,t.jsx)("button",{className:"p-1.5 rounded hover:bg-sidebar-accent transition-colors",onClick:()=>window.location.reload(),children:(0,t.jsx)(d,{className:"size-3.5 text-muted-foreground"})})})]})]}),C&&(0,t.jsx)("div",{role:"presentation",className:"fixed inset-0 z-50 bg-black/50 flex items-center justify-center",onClick:()=>S(!1),onKeyDown:e=>{"Escape"===e.key&&S(!1)},children:(0,t.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":"Keyboard Shortcuts",className:"bg-background border border-border rounded-xl shadow-xl p-6 w-80 max-w-full",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsxs)("h2",{className:"text-sm font-semibold text-foreground flex items-center gap-2",children:[(0,t.jsx)(j,{className:"size-4"})," Keyboard Shortcuts"]}),(0,t.jsx)("button",{onClick:()=>S(!1),className:"text-muted-foreground hover:text-foreground",children:(0,t.jsx)(v,{className:"size-4"})})]}),(0,t.jsx)("div",{className:"space-y-1 text-xs",children:[["L","Live view",a.live],["Q","Queue view",a.plan],["A","Activity view",!0],["D","Docs view",!0],["W","Worktrees view",a.live||a.plan],["C","Config (CLAUDE.md)",a.plan],["/","Focus search",!0],["Esc","Clear search / close",!0],["?","Toggle this cheatsheet",!0]].filter(([,,e])=>e).map(([e,r])=>(0,t.jsxs)("div",{className:"flex items-center justify-between py-1 border-b border-border/40 last:border-0",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:String(r)}),(0,t.jsx)("kbd",{className:"px-2 py-0.5 bg-muted rounded text-[10px] font-mono text-foreground border border-border",children:String(e)})]},String(e)))})]})}),(0,t.jsx)("div",{className:"flex-1 flex overflow-hidden",children:"live"===e?(0,t.jsx)(tB,{searchQuery:m,sidebarCollapsed:b}):"plan"===e?(0,t.jsx)(t7,{searchQuery:m,sidebarCollapsed:b}):"worktrees"===e?(0,t.jsx)(tC,{}):"activity"===e?(0,t.jsx)(rw,{}):"plans"===e?(0,t.jsx)(rE,{}):"claudemd"===e?(0,t.jsx)(rT,{}):(0,t.jsx)(rt,{})})]})}e.s(["default",()=>rO],23733)}]);