cursor-local-remote 0.1.11 → 0.1.13

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 (117) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +63 -42
  3. package/.next/app-path-routes-manifest.json +8 -5
  4. package/.next/build-manifest.json +5 -5
  5. package/.next/prerender-manifest.json +22 -22
  6. package/.next/react-loadable-manifest.json +18 -0
  7. package/.next/server/app/_not-found/page.js +2 -2
  8. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  9. package/.next/server/app/_not-found.html +2 -2
  10. package/.next/server/app/_not-found.rsc +2 -2
  11. package/.next/server/app/api/chat/route.js +1 -1
  12. package/.next/server/app/api/chat/route.js.nft.json +1 -1
  13. package/.next/server/app/api/chat/route_client-reference-manifest.js +1 -1
  14. package/.next/server/app/api/git/route.js +2 -2
  15. package/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
  16. package/.next/server/app/api/info/route.js +1 -1
  17. package/.next/server/app/api/info/route_client-reference-manifest.js +1 -1
  18. package/.next/server/app/api/models/route.js +2 -2
  19. package/.next/server/app/api/models/route_client-reference-manifest.js +1 -1
  20. package/.next/server/app/api/notifications/test/route.js +1 -1
  21. package/.next/server/app/api/notifications/test/route.js.nft.json +1 -1
  22. package/.next/server/app/api/notifications/test/route_client-reference-manifest.js +1 -1
  23. package/.next/server/app/api/projects/route.js +2 -2
  24. package/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  25. package/.next/server/app/api/sessions/active/route_client-reference-manifest.js +1 -1
  26. package/.next/server/app/api/sessions/history/route.js +1 -1
  27. package/.next/server/app/api/sessions/history/route_client-reference-manifest.js +1 -1
  28. package/.next/server/app/api/sessions/route.js +2 -2
  29. package/.next/server/app/api/sessions/route_client-reference-manifest.js +1 -1
  30. package/.next/server/app/api/sessions/watch/route.js +2 -2
  31. package/.next/server/app/api/sessions/watch/route_client-reference-manifest.js +1 -1
  32. package/.next/server/app/api/settings/route.js +2 -2
  33. package/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
  34. package/.next/server/app/api/terminal/input/route.js +3 -0
  35. package/.next/server/app/api/terminal/input/route.js.nft.json +1 -0
  36. package/.next/server/app/api/terminal/input/route_client-reference-manifest.js +1 -0
  37. package/.next/server/app/api/terminal/route.js +3 -0
  38. package/.next/server/app/api/terminal/route.js.nft.json +1 -0
  39. package/.next/server/app/api/terminal/route_client-reference-manifest.js +1 -0
  40. package/.next/server/app/api/terminal/stream/route.js +6 -0
  41. package/.next/server/app/api/terminal/stream/route.js.nft.json +1 -0
  42. package/.next/server/app/api/terminal/stream/route_client-reference-manifest.js +1 -0
  43. package/.next/server/app/api/upload/route.js +1 -1
  44. package/.next/server/app/api/upload/route_client-reference-manifest.js +1 -1
  45. package/.next/server/app/index.html +2 -2
  46. package/.next/server/app/index.rsc +5 -5
  47. package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  48. package/.next/server/app/page.js +3 -3
  49. package/.next/server/app/page.js.nft.json +1 -1
  50. package/.next/server/app/page_client-reference-manifest.js +1 -1
  51. package/.next/server/app-paths-manifest.json +8 -5
  52. package/.next/server/chunks/184.js +18 -0
  53. package/.next/server/chunks/267.js +6 -6
  54. package/.next/server/chunks/565.js +1 -0
  55. package/.next/server/chunks/61.js +18 -0
  56. package/.next/server/chunks/611.js +1 -1
  57. package/.next/server/chunks/781.js +1 -0
  58. package/.next/server/chunks/957.js +1 -0
  59. package/.next/server/instrumentation.js +1 -1
  60. package/.next/server/instrumentation.js.nft.json +1 -1
  61. package/.next/server/middleware-build-manifest.js +1 -1
  62. package/.next/server/middleware-manifest.json +1 -1
  63. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  64. package/.next/server/pages/404.html +2 -2
  65. package/.next/server/pages/500.html +1 -1
  66. package/.next/server/pages/_document.js +1 -1
  67. package/.next/server/pages/_error.js +2 -2
  68. package/.next/static/XMu8K85CP5u5_cZgrtqTv/_buildManifest.js +1 -0
  69. package/.next/static/chunks/581.6f70e48cd8cd239c.js +1 -0
  70. package/.next/static/chunks/687-b390283af2e3452f.js +1 -0
  71. package/.next/static/chunks/877.c9578aaf7d3c8f27.js +1 -0
  72. package/.next/static/chunks/app/api/chat/route-d3038ca0da9c5380.js +1 -0
  73. package/.next/static/chunks/app/api/git/route-d3038ca0da9c5380.js +1 -0
  74. package/.next/static/chunks/app/api/info/route-d3038ca0da9c5380.js +1 -0
  75. package/.next/static/chunks/app/api/models/route-d3038ca0da9c5380.js +1 -0
  76. package/.next/static/chunks/app/api/notifications/test/route-d3038ca0da9c5380.js +1 -0
  77. package/.next/static/chunks/app/api/projects/route-d3038ca0da9c5380.js +1 -0
  78. package/.next/static/chunks/app/api/sessions/active/route-d3038ca0da9c5380.js +1 -0
  79. package/.next/static/chunks/app/api/sessions/history/route-d3038ca0da9c5380.js +1 -0
  80. package/.next/static/chunks/app/api/sessions/route-d3038ca0da9c5380.js +1 -0
  81. package/.next/static/chunks/app/api/sessions/watch/route-d3038ca0da9c5380.js +1 -0
  82. package/.next/static/chunks/app/api/settings/route-d3038ca0da9c5380.js +1 -0
  83. package/.next/static/chunks/app/api/terminal/input/route-d3038ca0da9c5380.js +1 -0
  84. package/.next/static/chunks/app/api/terminal/route-d3038ca0da9c5380.js +1 -0
  85. package/.next/static/chunks/app/api/terminal/stream/route-d3038ca0da9c5380.js +1 -0
  86. package/.next/static/chunks/app/api/upload/route-d3038ca0da9c5380.js +1 -0
  87. package/.next/static/chunks/app/manifest.webmanifest/route-d3038ca0da9c5380.js +1 -0
  88. package/.next/static/chunks/app/page-15e319bd13e0cc7c.js +1 -0
  89. package/.next/static/chunks/e868780c.80b1d92b07cbfce1.js +18 -0
  90. package/.next/static/chunks/webpack-b7a7ce1923e86513.js +1 -0
  91. package/.next/static/css/30da1f7eab9bf366.css +11 -0
  92. package/.next/static/css/4e3b3a779665aaeb.css +1 -0
  93. package/README.md +20 -0
  94. package/bin/cursor-remote.mjs +143 -14
  95. package/package.json +4 -1
  96. package/.next/server/chunks/545.js +0 -18
  97. package/.next/server/chunks/819.js +0 -1
  98. package/.next/static/JHNi3dquD5OcV7Sclue9U/_buildManifest.js +0 -1
  99. package/.next/static/chunks/391-727d95bcfba987c2.js +0 -1
  100. package/.next/static/chunks/app/api/chat/route-b00b337e85e306b9.js +0 -1
  101. package/.next/static/chunks/app/api/git/route-b00b337e85e306b9.js +0 -1
  102. package/.next/static/chunks/app/api/info/route-b00b337e85e306b9.js +0 -1
  103. package/.next/static/chunks/app/api/models/route-b00b337e85e306b9.js +0 -1
  104. package/.next/static/chunks/app/api/notifications/test/route-b00b337e85e306b9.js +0 -1
  105. package/.next/static/chunks/app/api/projects/route-b00b337e85e306b9.js +0 -1
  106. package/.next/static/chunks/app/api/sessions/active/route-b00b337e85e306b9.js +0 -1
  107. package/.next/static/chunks/app/api/sessions/history/route-b00b337e85e306b9.js +0 -1
  108. package/.next/static/chunks/app/api/sessions/route-b00b337e85e306b9.js +0 -1
  109. package/.next/static/chunks/app/api/sessions/watch/route-b00b337e85e306b9.js +0 -1
  110. package/.next/static/chunks/app/api/settings/route-b00b337e85e306b9.js +0 -1
  111. package/.next/static/chunks/app/api/upload/route-b00b337e85e306b9.js +0 -1
  112. package/.next/static/chunks/app/manifest.webmanifest/route-b00b337e85e306b9.js +0 -1
  113. package/.next/static/chunks/app/page-bdc004bf68daf19c.js +0 -1
  114. package/.next/static/chunks/webpack-d434b6449a9cd8f3.js +0 -1
  115. package/.next/static/css/5eacd01f773eed7f.css +0 -11
  116. package/.next/static/css/62c80997800f1b21.css +0 -1
  117. /package/.next/static/{JHNi3dquD5OcV7Sclue9U → XMu8K85CP5u5_cZgrtqTv}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9,26,64,97,177,237,252,276,337,413,552,822,974],{4441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=4441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9,26,64,97,177,237,252,276,337,413,552,822,974],{4441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=4441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9,26,64,97,177,237,252,276,337,413,552,822,974],{4441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=4441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9,26,64,97,177,237,252,276,337,413,552,822,974],{4441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=4441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9,26,64,97,177,237,252,276,337,413,552,822,974],{4441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=4441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9,26,64,97,177,237,252,276,337,413,552,822,974],{4441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=4441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9,26,64,97,177,237,252,276,337,413,552,822,974],{4441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=4441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9,26,64,97,177,237,252,276,337,413,552,822,974],{4441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=4441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9,26,64,97,177,237,252,276,337,413,552,822,974],{4441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=4441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9,26,64,97,177,237,252,276,337,413,552,822,974],{4441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=4441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9,26,64,97,177,237,252,276,337,413,552,822,974],{4441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=4441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9,26,64,97,177,237,252,276,337,413,552,822,974],{4441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=4441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9,26,64,97,177,237,252,276,337,413,552,822,974],{4441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=4441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[593],{169:(e,t,s)=>{"use strict";function r(e,t){let s=Error(t);return s.name="ApiError",s.status=e,s.body={error:t},s}s.d(t,{n:()=>l});let n=new Set([502,503,504]);async function a(e,t,s){let{timeoutMs:l=3e4,retries:o,...i}=t,c=new AbortController,d=setTimeout(()=>c.abort(),l);try{let l=await fetch(e,{...i,credentials:"same-origin",signal:c.signal});if(!l.ok){if(s>0&&n.has(l.status))return await new Promise(e=>setTimeout(e,500)),a(e,t,s-1);let o="HTTP ".concat(l.status);try{let e=await l.json();e.error&&(o=e.error)}catch(e){}throw r(l.status,o)}return l}catch(n){if(n instanceof Error&&"AbortError"===n.name){if(s>0)return await new Promise(e=>setTimeout(e,500)),a(e,t,s-1);throw r(0,"Request timed out")}throw n}finally{clearTimeout(d)}}function l(e){var t;let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return a(e,s,null!=(t=s.retries)?t:2)}},2673:(e,t,s)=>{Promise.resolve().then(s.bind(s,8906)),Promise.resolve().then(s.bind(s,5932))},5932:(e,t,s)=>{"use strict";s.d(t,{ErrorBoundary:()=>a});var r=s(5155),n=s(2115);class a extends n.Component{static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("Uncaught render error:",e,t.componentStack)}render(){return this.state.error?"inline"===this.props.fallback?(0,r.jsx)("div",{className:"h-full flex items-center justify-center px-6",children:(0,r.jsxs)("div",{className:"text-center max-w-sm",children:[(0,r.jsx)("p",{className:"text-[13px] font-medium text-text mb-2",children:"Something went wrong"}),(0,r.jsx)("p",{className:"text-[11px] text-text-muted mb-3 font-mono break-all",children:this.state.error.message}),(0,r.jsx)("button",{onClick:()=>this.setState({error:null}),className:"px-3 py-1 rounded-lg text-[12px] font-medium bg-bg-surface text-text border border-border hover:bg-bg-hover transition-colors",children:"Try again"})]})}):(0,r.jsx)("div",{className:"h-dvh flex items-center justify-center bg-[#0a0a0b] px-6",children:(0,r.jsxs)("div",{className:"text-center max-w-sm",children:[(0,r.jsx)("p",{className:"text-[14px] font-medium text-[#e8e8e8] mb-2",children:"Something went wrong"}),(0,r.jsx)("p",{className:"text-[12px] text-[#888] mb-4 font-mono break-all",children:this.state.error.message}),(0,r.jsx)("button",{onClick:()=>this.setState({error:null}),className:"px-4 py-1.5 rounded-lg text-[12px] font-medium bg-[#1c1c1c] text-[#e8e8e8] border border-[#2a2a2a] hover:bg-[#252525] transition-colors",children:"Try again"})]})}):this.props.children}constructor(...e){super(...e),this.state={error:null}}}},8906:(e,t,s)=>{"use strict";s.d(t,{ChatWorkspace:()=>eR});var r=s(5155),n=s(2115),a=s(154);function l(){let{trigger:e}=(0,a.Y)();return{tap:()=>e("light"),send:()=>e("success"),select:()=>e("selection"),warn:()=>e("warning"),error:()=>e("error")}}var o=s(169);function i(){var e;return"function"==typeof(null==(e=globalThis.crypto)?void 0:e.randomUUID)?globalThis.crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}async function c(){try{let e=await (0,o.n)("/api/sessions/active");if(!e.ok)return[];return(await e.json()).sessions||[]}catch(e){return[]}}function d(){try{return"1"===localStorage.getItem("clr_sound_muted")}catch(e){return!1}}function x(e){if(e.current)return e.current;try{return e.current=new AudioContext,e.current}catch(e){return null}}function u(e,t,s,r,n){let a=e.createOscillator(),l=e.createGain();a.type="sine",a.frequency.value=t,l.gain.setValueAtTime(n,s),l.gain.exponentialRampToValueAtTime(.001,s+r),a.connect(l),l.connect(e.destination),a.start(s),a.stop(s+r)}let h="Cursor Local Remote";function m(e){let t=document.querySelector("link[rel='icon']");t||((t=document.createElement("link")).rel="icon",document.head.appendChild(t)),t.href=e}function p(e){let t=Math.floor((Date.now()-e)/6e4);if(t<1)return"now";if(t<60)return"".concat(t,"m ago");let s=Math.floor(t/60);if(s<24)return"".concat(s,"h ago");let r=Math.floor(s/24);return"".concat(r,"d ago")}var f=s(6504),b=s(4514),g=s(5225);s(1226);let j={h1:e=>{let{children:t}=e;return(0,r.jsx)("h1",{className:"text-[17px] font-semibold mt-5 mb-2 text-text",children:t})},h2:e=>{let{children:t}=e;return(0,r.jsx)("h2",{className:"text-[15px] font-semibold mt-4 mb-1.5 text-text",children:t})},h3:e=>{let{children:t}=e;return(0,r.jsx)("h3",{className:"text-[14px] font-semibold mt-3 mb-1 text-text",children:t})},h4:e=>{let{children:t}=e;return(0,r.jsx)("h4",{className:"text-[13px] font-semibold mt-2.5 mb-1 text-text",children:t})},h5:e=>{let{children:t}=e;return(0,r.jsx)("h5",{className:"text-[13px] font-medium mt-2 mb-0.5 text-text-secondary",children:t})},h6:e=>{let{children:t}=e;return(0,r.jsx)("h6",{className:"text-[12px] font-medium mt-2 mb-0.5 text-text-secondary",children:t})},p:e=>{let{children:t}=e;return(0,r.jsx)("p",{className:"my-1 text-[13px] leading-[1.6]",children:t})},a:e=>{let{href:t,children:s}=e;return(0,r.jsx)("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"text-accent underline underline-offset-2 decoration-text-muted/40 hover:decoration-accent transition-colors",children:s})},pre:e=>{let{children:t}=e;return(0,r.jsx)("pre",{className:"my-2 rounded-lg bg-[#0d0d0d] border border-border px-3.5 py-3 overflow-x-auto",children:t})},code:e=>{let{className:t,children:s}=e;return t?(0,r.jsx)("code",{className:"".concat(t," text-[12px] leading-[1.7] font-mono"),children:s}):(0,r.jsx)("code",{className:"px-1.5 py-0.5 rounded bg-[#1c1c1c] text-[#d4d4d4] text-[12px] font-mono",children:s})},ul:e=>{let{children:t}=e;return(0,r.jsx)("ul",{className:"my-1.5 space-y-0.5 list-disc pl-5",children:t})},ol:e=>{let{children:t}=e;return(0,r.jsx)("ol",{className:"my-1.5 space-y-0.5 list-decimal pl-5",children:t})},li:e=>{let{children:t}=e;return(0,r.jsx)("li",{className:"text-[13px] leading-[1.6]",children:t})},hr:()=>(0,r.jsx)("hr",{className:"my-3 border-border"}),blockquote:e=>{let{children:t}=e;return(0,r.jsx)("blockquote",{className:"my-2 pl-3 border-l-2 border-border text-text-secondary italic",children:t})},table:e=>{let{children:t}=e;return(0,r.jsx)("div",{className:"my-2 overflow-x-auto",children:(0,r.jsx)("table",{className:"min-w-full text-[13px] border-collapse",children:t})})},th:e=>{let{children:t}=e;return(0,r.jsx)("th",{className:"px-3 py-1.5 text-left font-semibold border-b border-border text-text",children:t})},td:e=>{let{children:t}=e;return(0,r.jsx)("td",{className:"px-3 py-1.5 border-b border-border/50",children:t})},img:e=>{let{src:t,alt:s}=e;return(0,r.jsx)("img",{src:t,alt:null!=s?s:"",className:"my-2 max-w-full rounded",loading:"lazy"})}},v=(0,n.memo)(function(e){let{content:t}=e;return(0,r.jsx)("div",{className:"text-text",children:(0,r.jsx)(f.oz,{remarkPlugins:[b.A],rehypePlugins:[g.A],components:j,children:t})})}),y={size:14,className:""};function N(e){let{size:t=10,className:s=""}=e;return(0,r.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:s,children:(0,r.jsx)("polyline",{points:"6 9 12 15 18 9"})})}function k(e){let{size:t=y.size,className:s=y.className}=e;return(0,r.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:s,children:[(0,r.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,r.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function w(e){let{size:t=12,className:s=y.className}=e;return(0,r.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:s,children:[(0,r.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,r.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}function C(e){let{size:t=y.size,className:s=y.className}=e;return(0,r.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:s,children:(0,r.jsx)("polyline",{points:"20 6 9 17 4 12"})})}function S(e){let{size:t=y.size,className:s=y.className}=e;return(0,r.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:s,children:[(0,r.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,r.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}function E(e){let{size:t=20,className:s=y.className}=e;return(0,r.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:s,children:[(0,r.jsx)("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),(0,r.jsx)("line",{x1:"3",y1:"12",x2:"15",y2:"12"}),(0,r.jsx)("line",{x1:"3",y1:"18",x2:"18",y2:"18"})]})}function L(e){let{size:t=12,className:s=y.className}=e;return(0,r.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:s,children:[(0,r.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,r.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})}function R(e){let{size:t=y.size,className:s=y.className}=e;return(0,r.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:s,children:[(0,r.jsx)("path",{d:"M21 12a9 9 0 1 1-6.22-8.56"}),(0,r.jsx)("polyline",{points:"21 3 21 9 15 9"})]})}function W(e){let{size:t=12,className:s=y.className}=e;return(0,r.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:s,children:[(0,r.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,r.jsx)("polyline",{points:"19 12 12 19 5 12"})]})}function T(e){let{size:t=18,className:s=y.className}=e;return(0,r.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:s,children:[(0,r.jsx)("line",{x1:"12",y1:"19",x2:"12",y2:"5"}),(0,r.jsx)("polyline",{points:"5 12 12 5 19 12"})]})}function A(e){let{size:t=18,className:s=y.className}=e;return(0,r.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:s,children:(0,r.jsx)("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})})}function z(e){let{className:t="w-3 h-3"}=e;return(0,r.jsx)("span",{className:"inline-block rounded-full border-2 border-text-muted border-t-transparent animate-spin ".concat(t)})}function _(e){let{size:t=10,className:s=y.className}=e;return(0,r.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:s,children:[(0,r.jsx)("polyline",{points:"1 4 1 10 7 10"}),(0,r.jsx)("path",{d:"M3.51 15a9 9 0 1 0 2.13-9.36L1 10"})]})}function F(e){let{size:t=y.size,className:s=y.className}=e;return(0,r.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:s,children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,r.jsx)("polyline",{points:"12 6 12 12 16 14"})]})}function M(e){let{size:t=12,className:s=y.className}=e;return(0,r.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:s,children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"3"}),(0,r.jsx)("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]})}function D(e){let{size:t=14,className:s=y.className}=e;return(0,r.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:s,children:[(0,r.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,r.jsx)("polyline",{points:"7 10 12 15 17 10"}),(0,r.jsx)("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}function P(e){let{size:t=12,className:s=y.className}=e;return(0,r.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:s,children:[(0,r.jsx)("line",{x1:"6",y1:"3",x2:"6",y2:"15"}),(0,r.jsx)("circle",{cx:"18",cy:"6",r:"3"}),(0,r.jsx)("circle",{cx:"6",cy:"18",r:"3"}),(0,r.jsx)("path",{d:"M18 9a9 9 0 0 1-9 9"})]})}function I(e){let{copied:t,onClick:s}=e;return(0,r.jsx)("button",{onClick:s,className:"absolute top-2 right-0 opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded text-text-muted hover:text-text-secondary","aria-label":t?"Copied":"Copy message",children:t?(0,r.jsx)(C,{}):(0,r.jsx)(S,{})})}let O=(0,n.memo)(function(e){let{message:t}=e,s="user"===t.role,[a,o]=(0,n.useState)(!1),i=l(),c=async()=>{try{await navigator.clipboard.writeText(t.content),i.tap(),o(!0),setTimeout(()=>o(!1),1500)}catch(e){}};return s?(0,r.jsxs)("div",{className:"py-3 group relative",children:[(0,r.jsx)("div",{className:"text-[13px] leading-[1.6] text-text whitespace-pre-wrap break-words bg-bg-surface rounded-lg px-3 py-2",children:t.content}),(0,r.jsx)(I,{copied:a,onClick:c})]}):(0,r.jsxs)("div",{className:"py-3 group relative",children:[(0,r.jsx)(v,{content:t.content}),(0,r.jsx)(I,{copied:a,onClick:c})]})}),B=new Set(["edit","write","shell","todo"]);function U(e){let{className:t}=e;return(0,r.jsxs)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"3"}),(0,r.jsx)("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]})}function H(e){let{type:t}=e,s="w-3.5 h-3.5 shrink-0";switch(t){case"read":return(0,r.jsxs)("svg",{className:s,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,r.jsx)("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),(0,r.jsx)("polyline",{points:"14 2 14 8 20 8"}),(0,r.jsx)("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),(0,r.jsx)("line",{x1:"16",y1:"17",x2:"8",y2:"17"})]});case"write":case"edit":return(0,r.jsxs)("svg",{className:s,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,r.jsx)("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),(0,r.jsx)("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]});case"shell":return(0,r.jsxs)("svg",{className:s,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,r.jsx)("polyline",{points:"4 17 10 11 4 5"}),(0,r.jsx)("line",{x1:"12",y1:"19",x2:"20",y2:"19"})]});case"search":return(0,r.jsxs)("svg",{className:s,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,r.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,r.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]});case"todo":return(0,r.jsxs)("svg",{className:s,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("path",{d:"M9 11l3 3L22 4"}),(0,r.jsx)("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})]});default:return(0,r.jsx)(U,{className:s})}}function J(e){let t=e.split("/");return t.length<=3?e:".../"+t.slice(-2).join("/")}function V(e){let{status:t}=e,s="w-3 h-3 shrink-0 mt-0.5";return t.includes("COMPLETED")?(0,r.jsx)("svg",{className:"".concat(s," text-text-secondary"),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,r.jsx)("polyline",{points:"20 6 9 17 4 12"})}):t.includes("IN_PROGRESS")?(0,r.jsx)(z,{className:s}):(0,r.jsx)("svg",{className:"".concat(s," text-text-muted"),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,r.jsx)("circle",{cx:"12",cy:"12",r:"9"})})}function Q(e){let{diff:t,startLine:s}=e,n=t.split("\n"),a=void 0!==s,l=null!=s?s:1,o=null!=s?s:1,i=[];if(a)for(let e of n)e.startsWith("-")?(i.push(String(l)),l++):(e.startsWith("+")?i.push(String(o)):(i.push(String(o)),l++),o++);let c=a?String(Math.max(l,o)).length:0;return(0,r.jsx)("pre",{className:"bg-[#0d0d0d] rounded px-2 py-1.5 text-[11px] whitespace-pre-wrap break-all max-h-[300px] overflow-y-auto",children:n.map((e,t)=>(0,r.jsxs)("span",{className:e.startsWith("+")?"text-green-400/70":e.startsWith("-")?"text-red-400/70":"text-text-muted",children:[a&&(0,r.jsx)("span",{className:"text-text-muted/40 select-none inline-block mr-2",style:{width:"".concat(c,"ch"),textAlign:"right"},children:i[t]}),e,t<n.length-1?"\n":""]},t))})}function q(e){switch(e.type){case"read":return"Reading";case"write":return"Writing";case"edit":return"Editing";case"shell":return"Running";case"search":return"Searching";case"todo":return"Updating";default:return e.name}}function K(e){if("shell"===e.type&&e.command)return e.command;if("search"===e.type&&e.command){let t=e.path?" in ".concat(J(e.path)):"";return'"'.concat(e.command,'"').concat(t)}return"todo"===e.type?"todo list":e.path?J(e.path):e.name}function G(e){let t={};for(let s of e){let e=s.name||s.type;t[e]=(t[e]||0)+1}return Object.entries(t).map(e=>{let[t,s]=e;return"".concat(s," ").concat(t)}).join(", ")}function Y(e){let{toolCalls:t}=e,[s,a]=(0,n.useState)(!1),o=l(),i=t.every(e=>"completed"===e.status);return(0,r.jsxs)("div",{className:"py-1.5",children:[(0,r.jsxs)("button",{onClick:()=>{o.tap(),a(e=>!e)},"aria-expanded":s,"aria-label":"Tool call group: ".concat(G(t)),className:"flex items-center gap-2 text-[12px] text-text-muted hover:text-text-secondary transition-colors w-full text-left",children:[(0,r.jsx)("span",{className:i?"text-text-muted":"text-text-secondary",children:i?(0,r.jsx)(U,{className:"w-3.5 h-3.5 shrink-0"}):(0,r.jsx)(z,{className:"w-3.5 h-3.5"})}),(0,r.jsx)("span",{className:"flex items-center gap-1.5 min-w-0 flex-1",children:(0,r.jsx)("span",{className:"font-mono text-text-muted truncate",children:G(t)})}),(0,r.jsx)(N,{className:"shrink-0 transition-transform ".concat(s?"rotate-180":"")})]}),s&&(0,r.jsx)("div",{className:"ml-5 pl-3 border-l-2 border-border",children:t.map(e=>(0,r.jsx)($,{toolCall:e},e.id))})]})}function $(e){let{toolCall:t,defaultExpanded:s}=e,[a,o]=(0,n.useState)(null!=s&&s),i=l(),c="running"===t.status;return(0,r.jsxs)("div",{className:"py-1.5",children:[(0,r.jsxs)("button",{onClick:()=>{i.tap(),o(e=>!e)},"aria-expanded":a,"aria-label":"".concat(q(t)," ").concat(K(t)),className:"flex items-center gap-2 text-[12px] text-text-muted hover:text-text-secondary transition-colors w-full text-left",children:[(0,r.jsx)("span",{className:c?"text-text-secondary":"text-text-muted",children:c?(0,r.jsx)(z,{className:"w-3.5 h-3.5"}):(0,r.jsx)(H,{type:t.type})}),(0,r.jsxs)("span",{className:"flex items-center gap-1.5 min-w-0 flex-1",children:[(0,r.jsx)("span",{className:"font-medium ".concat(c?"text-text-secondary":"text-text-muted"),children:q(t)}),(0,r.jsx)("span",{className:"font-mono truncate",children:K(t)})]}),t.result&&(0,r.jsx)("span",{className:"text-text-muted text-[11px] shrink-0",children:t.result}),(0,r.jsx)(N,{className:"shrink-0 transition-transform ".concat(a?"rotate-180":"")})]}),a&&(0,r.jsxs)("div",{className:"mt-1.5 ml-5 pl-3 border-l-2 border-border text-[11px] font-mono text-text-muted py-1.5 space-y-1 overflow-x-auto",children:[(0,r.jsx)("p",{className:"text-text-secondary",children:t.name}),t.path&&(0,r.jsx)("p",{className:"break-all",children:t.path}),"shell"===t.type&&t.command&&(0,r.jsxs)("pre",{className:"bg-[#0d0d0d] rounded px-2 py-1.5 text-[11px] text-[#c9d1d9] whitespace-pre-wrap break-all",children:["$ ",t.command]}),"search"===t.type&&t.command&&(0,r.jsxs)("p",{children:["pattern: ",(0,r.jsx)("span",{className:"text-text-secondary",children:t.command})]}),t.todos&&t.todos.length>0&&(0,r.jsx)("ul",{className:"space-y-0.5",children:t.todos.map(e=>(0,r.jsxs)("li",{className:"flex items-start gap-1.5",children:[(0,r.jsx)(V,{status:e.status}),(0,r.jsx)("span",{className:e.status.includes("COMPLETED")?"text-text-muted line-through":"text-text-secondary",children:e.content})]},e.id))}),t.diff&&(0,r.jsx)(Q,{diff:t.diff,startLine:t.diffStartLine}),!t.diff&&!t.todos&&t.result&&(0,r.jsx)("p",{className:"text-text-secondary",children:t.result}),c&&(0,r.jsx)("p",{className:"text-text-muted animate-pulse",children:"running..."})]})]})}function X(e){let{change:t}=e,[s,a]=(0,n.useState)(!1),o=l(),i=t.diffs.length>0;return(0,r.jsxs)("li",{children:[(0,r.jsxs)("button",{onClick:()=>{i&&(o.tap(),a(e=>!e))},className:"flex items-center gap-2 text-[11px] font-mono w-full text-left py-0.5 ".concat(i?"hover:text-text-secondary cursor-pointer":""),children:[(0,r.jsxs)("svg",{className:"w-3 h-3 shrink-0 text-text-muted",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,r.jsx)("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),(0,r.jsx)("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]}),(0,r.jsx)("span",{className:"text-text-secondary truncate flex-1",title:t.path,children:t.shortPath}),(0,r.jsx)("span",{className:"text-text-muted shrink-0",children:t.edits>0&&t.writes>0?"".concat(t.edits,"e ").concat(t.writes,"w"):t.edits>0?"".concat(t.edits," edit").concat(t.edits>1?"s":""):"".concat(t.writes," write").concat(t.writes>1?"s":"")}),i&&(0,r.jsx)(N,{className:"shrink-0 transition-transform ".concat(s?"rotate-180":"")})]}),s&&t.diffs.map((e,t)=>(0,r.jsx)("div",{className:"mt-1 mb-2",children:(0,r.jsx)(Q,{diff:e.diff,startLine:e.startLine})},t))]})}function Z(e){let{toolCalls:t}=e,[s,a]=(0,n.useState)(!1),o=l(),i=function(e){let t=new Map;for(let s of e){if("write"!==s.type&&"edit"!==s.type||!s.path)continue;let e=t.get(s.path);e||(e={path:s.path,shortPath:J(s.path),writes:0,edits:0,diffs:[]},t.set(s.path,e)),"write"===s.type?e.writes++:e.edits++,s.diff&&e.diffs.push({diff:s.diff,startLine:s.diffStartLine})}return Array.from(t.values()).sort((e,t)=>t.writes+t.edits-(e.writes+e.edits))}(t);if(0===i.length)return null;let c=i.reduce((e,t)=>e+t.edits,0),d=i.reduce((e,t)=>e+t.writes,0),x=[];return c>0&&x.push("".concat(c," edit").concat(c>1?"s":"")),d>0&&x.push("".concat(d," write").concat(d>1?"s":"")),(0,r.jsxs)("div",{className:"py-2",children:[(0,r.jsxs)("button",{onClick:()=>{o.tap(),a(e=>!e)},"aria-expanded":s,"aria-label":"Changes summary: ".concat(i.length," files"),className:"flex items-center gap-2 text-[12px] text-text-muted hover:text-text-secondary transition-colors w-full text-left",children:[(0,r.jsxs)("svg",{className:"w-3.5 h-3.5 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),(0,r.jsx)("polyline",{points:"14 2 14 8 20 8"}),(0,r.jsx)("line",{x1:"12",y1:"18",x2:"12",y2:"12"}),(0,r.jsx)("line",{x1:"9",y1:"15",x2:"15",y2:"15"})]}),(0,r.jsxs)("span",{className:"font-medium text-text-secondary",children:[i.length," file",i.length>1?"s":""," changed"]}),(0,r.jsx)("span",{className:"text-text-muted text-[11px]",children:x.join(", ")}),(0,r.jsx)(N,{className:"shrink-0 transition-transform ml-auto ".concat(s?"rotate-180":"")})]}),s&&(0,r.jsx)("ul",{className:"mt-1.5 ml-5 pl-3 border-l-2 border-border space-y-0.5 py-1",children:i.map(e=>(0,r.jsx)(X,{change:e},e.path))})]})}function ee(e){let{toolCall:t,defaultOpen:s=!0}=e,[a,o]=(0,n.useState)(s),i=l(),c=t.todos;if(!c||0===c.length)return null;let d=c.filter(e=>e.status.includes("COMPLETED")).length,x=c.filter(e=>e.status.includes("IN_PROGRESS")).length;return(0,r.jsxs)("div",{className:"py-2",children:[(0,r.jsxs)("button",{onClick:()=>{i.tap(),o(e=>!e)},"aria-expanded":a,"aria-label":"Todo list: ".concat(d,"/").concat(c.length," done"),className:"flex items-center gap-2 text-[12px] text-text-muted hover:text-text-secondary transition-colors w-full text-left",children:[(0,r.jsxs)("svg",{className:"w-3.5 h-3.5 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("path",{d:"M9 11l3 3L22 4"}),(0,r.jsx)("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})]}),(0,r.jsx)("span",{className:"font-medium text-text-secondary",children:"Todo"}),(0,r.jsxs)("span",{className:"text-text-muted text-[11px]",children:[d,"/",c.length," done",x>0?" \xb7 ".concat(x," active"):""]}),(0,r.jsx)(N,{className:"shrink-0 transition-transform ml-auto ".concat(a?"rotate-180":"")})]}),a&&(0,r.jsx)("ul",{className:"mt-1.5 ml-5 pl-3 border-l-2 border-border space-y-0.5 py-1",children:c.map(e=>(0,r.jsxs)("li",{className:"flex items-start gap-1.5 text-[11px] font-mono",children:[(0,r.jsx)(V,{status:e.status}),(0,r.jsx)("span",{className:e.status.includes("COMPLETED")?"text-text-muted line-through":"text-text-secondary",children:e.content})]},e.id))})]})}function et(e){let{sessions:t,onSelect:s}=e,n=l();return 0===t.length?null:(0,r.jsxs)("div",{className:"mt-5 w-full max-w-xs",children:[(0,r.jsx)("p",{className:"text-text-muted text-[11px] font-medium mb-2 uppercase tracking-wider",children:"Recent sessions"}),(0,r.jsx)("div",{className:"space-y-1",children:t.map(e=>(0,r.jsxs)("button",{onClick:()=>{n.tap(),s(e.id,e.workspace)},className:"w-full text-left px-3 py-2 rounded-lg bg-bg-surface hover:bg-bg-hover border border-border/50 transition-colors group",children:[(0,r.jsx)("p",{className:"text-[12px] text-text-secondary group-hover:text-text truncate",children:e.title}),(0,r.jsx)("p",{className:"text-[10px] text-text-muted mt-0.5",children:p(e.updatedAt)})]},e.id))})]})}function es(e){let{msg:t,onForceSend:s,onEdit:a,onDelete:o}=e,[i,c]=(0,n.useState)(!1),[d,x]=(0,n.useState)(t.content),u=l(),h=()=>{let e=d.trim();e&&e!==t.content&&a(e),c(!1)},m=()=>{x(t.content),c(!1)};return(0,r.jsxs)("div",{className:"py-2.5 border border-dashed border-text-muted/25 rounded-lg px-3 bg-bg-surface/50",children:[(0,r.jsxs)("div",{className:"flex items-start gap-2",children:[(0,r.jsx)("span",{className:"shrink-0 mt-0.5 text-text-muted/50",children:(0,r.jsx)(F,{})}),(0,r.jsx)("div",{className:"flex-1 min-w-0",children:i?(0,r.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,r.jsx)("textarea",{autoFocus:!0,"aria-label":"Edit queued message",value:d,onChange:e=>x(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),h()),"Escape"===e.key&&m()},rows:2,className:"w-full resize-none bg-bg px-2 py-1.5 text-[13px] text-text rounded border border-border focus:outline-none focus:border-text-muted/40"}),(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)("button",{onClick:h,className:"px-2 py-0.5 text-[10px] font-medium rounded bg-bg-active text-text hover:bg-bg-hover transition-colors",children:"Save"}),(0,r.jsx)("button",{onClick:m,className:"px-2 py-0.5 text-[10px] font-medium rounded text-text-muted hover:text-text-secondary transition-colors",children:"Cancel"})]})]}):(0,r.jsx)("p",{className:"text-[13px] text-text-secondary whitespace-pre-wrap break-words",children:t.content})})]}),!i&&(0,r.jsxs)("div",{className:"flex items-center gap-1 mt-1.5 ml-5",children:[(0,r.jsx)("span",{className:"text-[10px] text-text-muted/50 mr-1",children:"Queued"}),(0,r.jsx)("button",{onClick:()=>{u.send(),s()},className:"px-2 py-0.5 text-[10px] font-medium rounded bg-bg-active text-text-secondary hover:text-text transition-colors",title:"Stop current and send this now",children:"Send now"}),(0,r.jsx)("button",{onClick:()=>{u.tap(),x(t.content),c(!0)},className:"px-2 py-0.5 text-[10px] font-medium rounded text-text-muted hover:text-text-secondary hover:bg-bg-hover transition-colors",children:"Edit"}),(0,r.jsx)("button",{onClick:()=>{u.warn(),o()},className:"px-2 py-0.5 text-[10px] font-medium rounded text-text-muted hover:text-error/80 hover:bg-error/5 transition-colors",children:"Delete"})]})]})}function er(e){var t,s,a;let o,{messages:i,toolCalls:c,isStreaming:d,isLoadingHistory:x,isWatching:u,recentSessions:h=[],onSelectSession:m,onRetry:p,queuedMessages:f=[],onForceSend:b,onEditQueued:g,onDeleteQueued:j}=e,v=l(),y=(0,n.useRef)(null),N=(0,n.useRef)(null),[k,w]=(0,n.useState)(!0),C=(0,n.useRef)(!1),S=(0,n.useCallback)(()=>{var e;null==(e=N.current)||e.scrollIntoView({behavior:"smooth"}),w(!0)},[]),E=(0,n.useCallback)(()=>{if(C.current)return;let e=y.current;e&&w(e.scrollHeight-e.scrollTop-e.clientHeight<60)},[]),L=i[i.length-1],R=d&&(null==L?void 0:L.role)==="user",T=(0,n.useRef)(null),A=(0,n.useRef)(!1);(0,n.useEffect)(()=>{var e;if(k||R){if(T.current){A.current=!0;return}C.current=!0,null==(e=N.current)||e.scrollIntoView({behavior:"smooth"}),T.current=setTimeout(()=>{if(T.current=null,C.current=!1,A.current){var e;A.current=!1,null==(e=N.current)||e.scrollIntoView({behavior:"smooth"})}},200)}},[i,c,k,R]);let F=[...i.map(e=>({kind:"message",timestamp:e.timestamp,message:e})),...c.map(e=>({kind:"toolcall",timestamp:e.timestamp,toolCall:e}))].sort((e,t)=>e.timestamp-t.timestamp),M=[],D=[],P=()=>{0!==D.length&&(1===D.length?M.push({kind:"toolcall",timestamp:D[0].timestamp,toolCall:D[0]}):M.push({kind:"toolgroup",timestamp:D[0].timestamp,toolCalls:[...D]}),D=[])};for(let e of F)"toolcall"===e.kind&&e.toolCall&&(a=e.toolCall,!B.has(a.type))?D.push(e.toolCall):(P(),M.push(e));if(P(),x)return(0,r.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,r.jsxs)("div",{className:"flex items-center gap-2 text-text-muted text-[13px]",children:[(0,r.jsx)(z,{className:"w-3.5 h-3.5"}),"Loading session..."]})});if(0===M.length)return(0,r.jsx)("div",{className:"flex-1 flex items-center justify-center px-6",children:(0,r.jsxs)("div",{className:"flex flex-col items-center max-w-sm",children:[(0,r.jsx)("p",{className:"text-text-secondary text-[13px] font-medium mb-1",children:"Cursor Remote"}),(0,r.jsx)("p",{className:"text-text-muted text-[12px] leading-relaxed",children:"Send a message to start an agent session."}),m&&(0,r.jsx)(et,{sessions:h,onSelect:m})]})});let I=c.some(e=>"running"===e.status),U=M[M.length-1],H=(null==U?void 0:U.kind)==="message"&&(null==(t=U.message)?void 0:t.role)==="user",J=d&&!I&&H;for(let e=M.length-1;e>=0;e--){let t=M[e];if("toolcall"===t.kind&&(null==(s=t.toolCall)?void 0:s.type)==="todo"){o=t.toolCall.id;break}}let V=i[i.length-1],Q=!d&&(null==V?void 0:V.role)==="user"&&p;return(0,r.jsxs)("div",{className:"flex-1 overflow-hidden relative",children:[(0,r.jsx)("div",{ref:y,onScroll:E,className:"h-full overflow-y-auto",children:(0,r.jsxs)("div",{className:"px-4 max-w-3xl mx-auto w-full",children:[(0,r.jsx)("div",{className:"divide-y divide-border/50",children:M.map((e,t)=>"message"===e.kind&&e.message?(0,r.jsx)(O,{message:e.message},e.message.id):"toolcall"===e.kind&&e.toolCall?"todo"===e.toolCall.type?(0,r.jsx)(ee,{toolCall:e.toolCall,defaultOpen:e.toolCall.id===o},e.toolCall.id):(0,r.jsx)($,{toolCall:e.toolCall},e.toolCall.id):"toolgroup"===e.kind&&e.toolCalls?(0,r.jsx)(Y,{toolCalls:e.toolCalls},"group-".concat(t)):null)}),!d&&M.length>0&&c.length>0&&(0,r.jsx)(Z,{toolCalls:c}),J&&(0,r.jsxs)("div",{className:"py-3 flex items-center gap-2 text-text-muted text-[12px]",children:[(0,r.jsx)(z,{}),"Thinking..."]}),u&&!d&&M.length>0&&(0,r.jsxs)("div",{className:"py-3 flex items-center gap-2 text-text-muted text-[11px]",children:[(0,r.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-success animate-pulse"}),"Watching for updates..."]}),Q&&(0,r.jsx)("div",{className:"py-1",children:(0,r.jsxs)("button",{onClick:()=>{v.tap(),null==p||p()},className:"flex items-center gap-1 text-[10px] text-text-muted/60 hover:text-text-muted transition-colors","aria-label":"Retry last message",children:[(0,r.jsx)(_,{}),"Retry last message"]})}),f.length>0&&(0,r.jsx)("div",{className:"space-y-2 py-2",children:f.map(e=>(0,r.jsx)(es,{msg:e,onForceSend:()=>null==b?void 0:b(e.id),onEdit:t=>null==g?void 0:g(e.id,t),onDelete:()=>null==j?void 0:j(e.id)},e.id))}),(0,r.jsx)("div",{ref:N,className:"h-4"})]})}),!k&&M.length>0&&(0,r.jsxs)("button",{onClick:S,"aria-label":"Scroll to bottom",className:"absolute bottom-3 left-1/2 -translate-x-1/2 z-10 flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-bg-elevated border border-border text-text-muted hover:text-text-secondary text-[11px] shadow-lg transition-colors",children:[(0,r.jsx)(W,{}),"Scroll to bottom"]})]})}let en=[{id:"agent",label:"Agent"},{id:"ask",label:"Ask"},{id:"plan",label:"Plan"}];function ea(e){var t;let{onSend:s,onStop:a,isStreaming:i,selectedModel:c,selectedMode:d,onModelChange:x,onModeChange:u}=e,[h,m]=(0,n.useState)(""),[p,f]=(0,n.useState)(!1),[b,g]=(0,n.useState)([]),[j,v]=(0,n.useState)(!0),[y,C]=(0,n.useState)([]),[S,E]=(0,n.useState)(!1),[L,R]=(0,n.useState)(!1),W=(0,n.useRef)(null),_=l();(0,n.useEffect)(()=>{let e=!1;return(0,o.n)("/api/models").then(e=>e.json()).then(t=>{var s;!e&&(null==(s=t.models)?void 0:s.length)>0&&g(t.models)}).catch(e=>console.error("[models] Failed to fetch:",e)).finally(()=>{e||v(!1)}),()=>{e=!0}},[]);let F=(0,n.useCallback)(e=>{let t=e.filter(e=>e.type.startsWith("image/"));if(0===t.length)return;let s=t.map(e=>({file:e,preview:URL.createObjectURL(e)}));C(e=>[...e,...s])},[]),M=(0,n.useCallback)(e=>{C(t=>(URL.revokeObjectURL(t[e].preview),t.filter((t,s)=>s!==e)))},[]),D=(0,n.useCallback)(async e=>{let t=new FormData;for(let s of e)t.append("file",s.file);let s=await (0,o.n)("/api/upload",{method:"POST",body:t});return s.ok&&(await s.json()).paths||[]},[]),P=(0,n.useCallback)(async()=>{let e=h.trim();if(!e&&0===y.length)return;_.send();let t=e;if(y.length>0){E(!0);try{let e=await D(y);if(e.length>0){let s=e.map(e=>"[Attached image: ".concat(e,"]")).join("\n");t=t?t+"\n\n"+s:s}}catch(e){console.error("[upload] Failed to upload images")}finally{E(!1)}for(let e of y)URL.revokeObjectURL(e.preview);C([])}t&&s(t),m(""),W.current&&(W.current.style.height="auto")},[h,y,s,_,D]),I=(0,n.useCallback)(()=>{_.tap(),null==a||a()},[a,_]),O=(0,n.useCallback)(e=>{let t=Array.from(e.clipboardData.items).filter(e=>e.type.startsWith("image/")).map(e=>e.getAsFile()).filter(e=>null!==e);t.length>0&&(e.preventDefault(),F(t))},[F]),B=(0,n.useCallback)(e=>{e.preventDefault(),R(!1);let t=Array.from(e.dataTransfer.files).filter(e=>e.type.startsWith("image/"));t.length>0&&F(t)},[F]),U=(0,n.useCallback)(e=>{e.preventDefault(),R(!0)},[]),H=(0,n.useCallback)(()=>{R(!1)},[]),J=(null==(t=b.find(e=>e.id===c))?void 0:t.label)||c,V=b.find(e=>"auto"===e.id),Q=b.filter(e=>"auto"!==e.id);return(0,r.jsx)("div",{className:"shrink-0 bg-bg px-4 py-3 safe-bottom",children:(0,r.jsx)("div",{className:"max-w-3xl mx-auto",children:(0,r.jsxs)("div",{className:"relative bg-bg-surface border rounded-xl focus-within:border-text-muted/40 transition-colors ".concat(L?"border-accent/60 bg-accent/5":"border-border"),onDrop:B,onDragOver:U,onDragLeave:H,children:[(0,r.jsx)("textarea",{ref:W,value:h,onChange:e=>{m(e.target.value);let t=e.target;t.style.height="auto",t.style.height=Math.min(t.scrollHeight,160)+"px"},onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),P())},onPaste:O,placeholder:i?"Type to queue a message...":"Ask Cursor anything...","aria-label":"Message input",rows:1,className:"w-full resize-none bg-transparent px-3.5 pt-2.5 pb-1 pr-10 text-[13px] text-text placeholder:text-text-muted focus:outline-none"}),y.length>0&&(0,r.jsx)("div",{className:"flex gap-2 px-3 pb-1.5 overflow-x-auto",children:y.map((e,t)=>(0,r.jsxs)("div",{className:"relative shrink-0 w-14 h-14 rounded-md overflow-hidden border border-border group",children:[(0,r.jsx)("img",{src:e.preview,alt:"",className:"w-full h-full object-cover"}),(0,r.jsx)("button",{onClick:()=>M(t),className:"absolute top-0 right-0 p-0.5 bg-black/70 rounded-bl text-white opacity-0 group-hover:opacity-100 transition-opacity","aria-label":"Remove image",children:(0,r.jsx)(k,{size:10})})]},e.preview))}),(0,r.jsxs)("div",{className:"flex items-center justify-between px-2 pb-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1",role:"radiogroup","aria-label":"Agent mode",children:[en.map(e=>(0,r.jsx)("button",{role:"radio","aria-checked":d===e.id,onClick:()=>{_.select(),u(e.id)},className:"px-3 py-1.5 rounded text-[12px] font-medium transition-colors ".concat(d===e.id?"bg-bg-active text-text":"text-text-muted hover:text-text-secondary hover:bg-bg-hover"),children:e.label},e.id)),(0,r.jsx)("span",{className:"hidden sm:inline text-[10px] text-text-muted/50 ml-2 select-none",children:"Enter ↵ send \xb7 Shift+Enter newline"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsxs)("button",{onClick:()=>{_.tap(),f(!p)},"aria-haspopup":"listbox","aria-expanded":p,"aria-label":"Select model",className:"flex items-center gap-1 px-3 py-1.5 rounded text-[12px] text-text-muted hover:text-text-secondary hover:bg-bg-hover transition-colors",children:[j?(0,r.jsx)(z,{className:"w-2.5 h-2.5"}):(0,r.jsx)("span",{className:"truncate max-w-[80px] sm:max-w-[150px]",children:J}),(0,r.jsx)(N,{})]}),p&&b.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"fixed inset-0 z-40",onClick:()=>f(!1)}),(0,r.jsxs)("div",{role:"listbox","aria-label":"Models",className:"absolute bottom-full right-0 mb-1 z-50 w-56 bg-bg-elevated border border-border rounded-lg shadow-xl py-1 max-h-80 overflow-y-auto",children:[V&&(0,r.jsx)(el,{model:V,selected:c===V.id,onSelect:()=>{x(V.id),f(!1)}},V.id),Q.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"h-px bg-border mx-2 my-1"}),Q.map(e=>(0,r.jsx)(el,{model:e,selected:c===e.id,onSelect:()=>{x(e.id),f(!1)}},e.id))]})]})]})]}),i&&(0,r.jsx)("button",{onClick:I,className:"p-2 rounded-md text-text-muted hover:text-text transition-colors","aria-label":"Stop streaming",children:(0,r.jsx)(A,{})}),(0,r.jsx)("button",{onClick:P,disabled:!h.trim()&&0===y.length||S,className:"p-2 rounded-md text-text-muted hover:text-text disabled:opacity-20 disabled:cursor-not-allowed transition-colors","aria-label":S?"Uploading...":i?"Queue message":"Send message",children:S?(0,r.jsx)(z,{className:"w-4 h-4"}):i?(0,r.jsx)(w,{size:18}):(0,r.jsx)(T,{})})]})]})]})})})}function el(e){let{model:t,selected:s,onSelect:n}=e,a=l();return(0,r.jsxs)("button",{role:"option","aria-selected":s,onClick:()=>{a.select(),n()},className:"w-full text-left px-3 py-1.5 text-[12px] flex items-center justify-between gap-2 transition-colors ".concat(s?"text-text bg-bg-active":"text-text-secondary hover:bg-bg-hover hover:text-text"),children:[(0,r.jsx)("span",{className:"truncate",children:t.label}),(0,r.jsxs)("span",{className:"flex items-center gap-1 shrink-0",children:[t.isDefault&&(0,r.jsx)("span",{className:"text-[9px] px-1 py-px rounded bg-bg-hover text-text-secondary font-medium",children:"default"}),t.isCurrent&&(0,r.jsx)("span",{className:"text-[9px] px-1 py-px rounded bg-success/15 text-success font-medium",children:"current"})]})]})}function eo(e){let{diff:t}=e;if(!t)return(0,r.jsx)("p",{className:"text-text-muted text-[11px] px-3 py-2",children:"No diff available"});let s=t.split("\n");return(0,r.jsx)("div",{className:"overflow-x-auto text-[11px] font-mono leading-[1.6]",children:s.map((e,t)=>{let s="text-text-muted px-3";return e.startsWith("+")&&!e.startsWith("+++")?s="text-success bg-success/8 px-3":e.startsWith("-")&&!e.startsWith("---")?s="text-error bg-error/8 px-3":e.startsWith("@@")?s="text-info bg-info/8 px-3":(e.startsWith("diff ")||e.startsWith("index "))&&(s="text-text-muted/50 px-3"),(0,r.jsx)("div",{className:s,children:(0,r.jsx)("span",{className:"whitespace-pre",children:e})},t)})})}function ei(e,t,s){return(0,o.n)("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:e,workspace:t,...s})})}function ec(e){var t;let{open:s,onClose:a,workspace:i}=e,[c,d]=(0,n.useState)(null),[x,u]=(0,n.useState)(!1),[h,m]=(0,n.useState)(""),[p,f]=(0,n.useState)(new Set),[b,g]=(0,n.useState)(!1),[j,v]=(0,n.useState)(!1),[y,w]=(0,n.useState)(!1),[S,E]=(0,n.useState)(!1),[L,W]=(0,n.useState)(!1),[T,A]=(0,n.useState)(!1),[_,F]=(0,n.useState)(!1),[M,D]=(0,n.useState)(!1),[P,I]=(0,n.useState)(null),[O,B]=(0,n.useState)(null),[U,H]=(0,n.useState)({}),[J,V]=(0,n.useState)(null),[Q,q]=(0,n.useState)(!1),[K,G]=(0,n.useState)(!1),[Y,$]=(0,n.useState)(!1),[X,Z]=(0,n.useState)(null),[ee,et]=(0,n.useState)(!1),[es,er]=(0,n.useState)(""),[en,ea]=(0,n.useState)(!1),el=l(),eo=i?"&workspace=".concat(encodeURIComponent(i)):"",ec=(0,n.useCallback)(()=>{u(!0),I(null),(0,o.n)("/api/git?detail=status".concat(eo)).then(e=>e.json()).then(e=>{var t;d(e),f(new Set((null!=(t=e.files)?t:[]).map(e=>e.file)))}).catch(()=>I("Failed to load git status")).finally(()=>u(!1))},[eo]),ex=(0,n.useCallback)(()=>{(0,o.n)("/api/git?detail=branches".concat(eo)).then(e=>e.json()).then(e=>Z(e)).catch(()=>{})},[eo]);(0,n.useEffect)(()=>{s&&(W(!1),A(!1),I(null),B(null),H({}),G(!1),$(!1),er(""),ec())},[s,ec]);let eu=(0,n.useCallback)(e=>{if(O===e)return void B(null);B(e),void 0===U[e]&&(V(e),(0,o.n)("/api/git?detail=diff&file=".concat(encodeURIComponent(e)).concat(eo)).then(e=>e.json()).then(t=>H(s=>({...s,[e]:t.diff||""}))).catch(()=>H(t=>({...t,[e]:"Failed to load diff"}))).finally(()=>V(null)))},[O,U,eo]),eh=(0,n.useCallback)((e,t)=>{t.stopPropagation(),el.select(),f(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]),em=(0,n.useCallback)(()=>{var e;el.tap();let t=null!=(e=null==c?void 0:c.files)?e:[];p.size===t.length?f(new Set):f(new Set(t.map(e=>e.file)))},[c,p]),ep=(0,n.useCallback)(async()=>{if(!K)return void G(!0);G(!1),q(!0),I(null);try{let e=await ei("discard",i,{files:Array.from(p)});if(!e.ok){let t=await e.json();throw Error(t.error||"Discard failed")}H({}),B(null),el.warn(),ec()}catch(e){I(e instanceof Error?e.message:"Discard failed"),el.error()}finally{q(!1)}},[K,i,p,ec,el]),ef=(0,n.useCallback)(async()=>{if(h.trim()&&0!==p.size){g(!0),I(null);try{let e=await ei("commit",i,{message:h,files:Array.from(p)});if(!e.ok){let t=await e.json();throw Error(t.error||"Commit failed")}m(""),W(!0),setTimeout(()=>W(!1),2e3),H({}),B(null),el.send(),ec()}catch(e){I(e instanceof Error?e.message:"Commit failed"),el.error()}finally{g(!1)}}},[h,i,ec,p,el]),eb=(0,n.useCallback)(async()=>{v(!0),I(null);try{let e=await ei("push",i);if(!e.ok){let t=await e.json();throw Error(t.error||"Push failed")}A(!0),setTimeout(()=>A(!1),2e3),el.send(),ec()}catch(e){I(e instanceof Error?e.message:"Push failed"),el.error()}finally{v(!1)}},[i,ec,el]),eg=(0,n.useCallback)(async()=>{w(!0),I(null);try{let e=await ei("fetch",i);if(!e.ok){let t=await e.json();throw Error(t.error||"Fetch failed")}F(!0),setTimeout(()=>F(!1),2e3),el.tap(),ec()}catch(e){I(e instanceof Error?e.message:"Fetch failed"),el.error()}finally{w(!1)}},[i,ec,el]),ej=(0,n.useCallback)(async()=>{E(!0),I(null);try{let e=await ei("pull",i);if(!e.ok){let t=await e.json();throw Error(t.error||"Pull failed")}D(!0),setTimeout(()=>D(!1),2e3),H({}),B(null),el.tap(),ec()}catch(e){I(e instanceof Error?e.message:"Pull failed"),el.error()}finally{E(!1)}},[i,ec,el]),ev=(0,n.useCallback)(async e=>{et(!0),I(null);try{let t=await ei("checkout",i,{branch:e});if(!t.ok){let e=await t.json();throw Error(e.error||"Checkout failed")}$(!1),H({}),B(null),el.tap(),ec()}catch(e){I(e instanceof Error?e.message:"Checkout failed"),el.error()}finally{et(!1)}},[i,ec,el]),ey=(0,n.useCallback)(async()=>{let e=es.trim();if(e){ea(!0),I(null);try{let t=await ei("create_branch",i,{branch:e});if(!t.ok){let e=await t.json();throw Error(e.error||"Create branch failed")}er(""),$(!1),el.send(),ec()}catch(e){I(e instanceof Error?e.message:"Create branch failed"),el.error()}finally{ea(!1)}}},[es,i,ec,el]);if(!s)return null;let eN=null!=(t=null==c?void 0:c.files)?t:[],ek=eN.length>0,ew=p.size,eC=ek&&ew===eN.length;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"fixed inset-0 z-40 bg-black/60","aria-hidden":"true",onClick:a}),(0,r.jsxs)("div",{className:"fixed inset-0 z-50 bg-bg-elevated flex flex-col sm:inset-auto sm:top-0 sm:right-0 sm:h-full sm:w-[380px] sm:border-l sm:border-border",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between h-11 px-3 border-b border-border shrink-0",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,r.jsx)("span",{className:"text-[13px] font-medium text-text-secondary shrink-0",children:"Git"}),(null==c?void 0:c.branch)&&(0,r.jsxs)("button",{onClick:()=>{$(e=>!e),X||ex()},className:"flex items-center gap-1 text-[11px] text-text-muted font-mono hover:text-text-secondary transition-colors min-w-0",children:[(0,r.jsx)("span",{className:"truncate max-w-[120px]",children:c.branch}),(0,r.jsx)(N,{size:8})]}),c&&c.ahead>0&&(0,r.jsxs)("span",{className:"text-[10px] text-info shrink-0",children:["↑",c.ahead]}),c&&c.behind>0&&(0,r.jsxs)("span",{className:"text-[10px] text-warning shrink-0",children:["↓",c.behind]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,r.jsx)("button",{onClick:()=>{ec(),H({})},disabled:x,"aria-label":"Refresh",className:"p-1 rounded-md hover:bg-bg-hover text-text-muted hover:text-text-secondary transition-colors disabled:opacity-40",children:(0,r.jsx)(R,{size:14,className:x?"animate-spin":""})}),(0,r.jsx)("button",{onClick:a,"aria-label":"Close",className:"p-1 rounded-md hover:bg-bg-hover text-text-muted hover:text-text-secondary transition-colors",children:(0,r.jsx)(k,{size:14})})]})]}),Y&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"fixed inset-0 z-40",onClick:()=>$(!1)}),(0,r.jsxs)("div",{className:"relative z-50 mx-3 mt-2 bg-bg-elevated border border-border rounded-lg shadow-xl max-h-[280px] flex flex-col",children:[ee&&(0,r.jsx)("div",{className:"flex items-center justify-center py-4",children:(0,r.jsx)(z,{})}),!ee&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"p-2 border-b border-border flex gap-1.5",children:[(0,r.jsx)("input",{value:es,onChange:e=>er(e.target.value),placeholder:"New branch name...",className:"flex-1 min-w-0 rounded border border-border bg-bg-surface px-2 py-1 text-[11px] text-text placeholder:text-text-muted/50 focus:outline-none focus:border-text-muted/40",onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),ey())}}),(0,r.jsx)("button",{onClick:ey,disabled:!es.trim()||en,className:"shrink-0 px-2 py-1 rounded text-[10px] font-medium bg-bg-surface border border-border text-text-muted hover:text-text-secondary hover:bg-bg-hover transition-colors disabled:opacity-40",children:en?(0,r.jsx)(z,{className:"w-2.5 h-2.5"}):"Create"})]}),(0,r.jsxs)("div",{className:"overflow-y-auto flex-1 py-1",children:[null==X?void 0:X.local.map(e=>(0,r.jsxs)("button",{onClick:()=>e!==X.current&&ev(e),className:"w-full text-left px-3 py-1.5 text-[11px] font-mono transition-colors ".concat(e===X.current?"text-text bg-bg-active":"text-text-secondary hover:bg-bg-hover hover:text-text"),children:[e,e===X.current&&(0,r.jsx)("span",{className:"text-text-muted ml-1",children:"(current)"})]},e)),X&&X.remoteOnly.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"h-px bg-border mx-2 my-1"}),(0,r.jsx)("div",{className:"px-3 py-1",children:(0,r.jsx)("span",{className:"text-[9px] font-medium uppercase tracking-wider text-text-muted",children:"Remote"})}),X.remoteOnly.map(e=>(0,r.jsx)("button",{onClick:()=>ev(e),className:"w-full text-left px-3 py-1.5 text-[11px] font-mono text-text-muted hover:bg-bg-hover hover:text-text-secondary transition-colors",children:e},e))]})]})]})]})]}),P&&(0,r.jsx)("div",{className:"mx-3 mt-2 px-2.5 py-2 rounded-md bg-error/10 text-error text-[11px] break-words",children:P}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto",children:x&&!c?(0,r.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,r.jsx)(z,{})}):(null==c?void 0:c.branch)?ek?(0,r.jsxs)("div",{className:"py-1",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1.5",children:[(0,r.jsx)("button",{onClick:em,className:"shrink-0 w-4 text-center","aria-label":"Toggle all",children:(0,r.jsx)("span",{className:"text-[11px] font-bold transition-colors ".concat(eC?"text-text-secondary":"text-text-muted/40"),children:eC?"✓":"–"})}),(0,r.jsxs)("span",{className:"text-[10px] font-medium uppercase tracking-wider text-text-muted flex-1",children:[ew,"/",eN.length," file",1!==eN.length?"s":""]}),ew>0&&(K?(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)("button",{onClick:ep,disabled:Q,className:"px-2 py-0.5 rounded text-[10px] font-medium bg-error/15 text-error hover:bg-error/25 transition-colors disabled:opacity-40",children:Q?(0,r.jsx)(z,{className:"w-2.5 h-2.5"}):"Discard ".concat(ew)}),(0,r.jsx)("button",{onClick:()=>G(!1),"aria-label":"Cancel",className:"p-0.5 rounded text-text-muted hover:text-text-secondary hover:bg-bg-hover transition-colors",children:(0,r.jsx)(k,{size:9})})]}):(0,r.jsx)("button",{onClick:ep,className:"px-2 py-0.5 rounded text-[10px] font-medium text-text-muted/50 hover:text-error hover:bg-error/10 transition-colors",children:"Discard"}))]}),eN.map(e=>(0,r.jsx)(ed,{file:e,checked:p.has(e.file),expanded:O===e.file,diff:U[e.file],loadingDiff:J===e.file,onToggleExpand:()=>eu(e.file),onToggleCheck:t=>eh(e.file,t)},e.file))]}):(0,r.jsxs)("div",{className:"text-center py-12",children:[(0,r.jsx)("p",{className:"text-text-muted text-[12px]",children:"Working tree clean"}),c.ahead>0&&(0,r.jsxs)("p",{className:"text-text-secondary text-[11px] mt-1",children:[c.ahead," commit",c.ahead>1?"s":""," ahead of remote"]})]}):(0,r.jsx)("p",{className:"text-text-muted text-[12px] text-center py-12",children:"Not a git repository"})}),(null==c?void 0:c.branch)&&(0,r.jsxs)("div",{className:"shrink-0 border-t border-border p-3 space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsxs)("button",{onClick:eg,disabled:y,className:"flex-1 flex items-center justify-center gap-1.5 px-3 py-1.5 rounded-md text-[11px] font-medium bg-bg-surface border border-border text-text-muted hover:text-text-secondary hover:bg-bg-hover transition-colors disabled:opacity-40 disabled:pointer-events-none",children:[y?(0,r.jsx)(z,{className:"w-3 h-3"}):_?(0,r.jsx)(C,{size:11}):(0,r.jsxs)("svg",{width:11,height:11,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("path",{d:"M21 12a9 9 0 1 1-6.22-8.56"}),(0,r.jsx)("polyline",{points:"21 3 21 9 15 9"})]}),_?"Fetched":"Fetch"]}),(0,r.jsxs)("button",{onClick:ej,disabled:S,className:"flex-1 flex items-center justify-center gap-1.5 px-3 py-1.5 rounded-md text-[11px] font-medium bg-bg-surface border border-border text-text-muted hover:text-text-secondary hover:bg-bg-hover transition-colors disabled:opacity-40 disabled:pointer-events-none",children:[S?(0,r.jsx)(z,{className:"w-3 h-3"}):M?(0,r.jsx)(C,{size:11}):(0,r.jsxs)("svg",{width:11,height:11,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,r.jsx)("polyline",{points:"19 12 12 19 5 12"})]}),M?"Pulled":"Pull"]}),(0,r.jsxs)("button",{onClick:eb,disabled:j,className:"flex-1 flex items-center justify-center gap-1.5 px-3 py-1.5 rounded-md text-[11px] font-medium bg-bg-surface border border-border text-text-muted hover:text-text-secondary hover:bg-bg-hover transition-colors disabled:opacity-40 disabled:pointer-events-none",children:[j?(0,r.jsx)(z,{className:"w-3 h-3"}):T?(0,r.jsx)(C,{size:11}):(0,r.jsxs)("svg",{width:11,height:11,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("line",{x1:"12",y1:"19",x2:"12",y2:"5"}),(0,r.jsx)("polyline",{points:"5 12 12 5 19 12"})]}),T?"Pushed":"Push"]})]}),ek&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("textarea",{value:h,onChange:e=>m(e.target.value),placeholder:"Commit message...",rows:2,className:"w-full resize-none rounded-md border border-border bg-bg-surface px-2.5 py-2 text-[12px] text-text placeholder:text-text-muted/50 focus:outline-none focus:border-text-muted/40",onKeyDown:e=>{"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),ef())}}),(0,r.jsxs)("button",{onClick:ef,disabled:b||!h.trim()||0===ew,className:"w-full flex items-center justify-center gap-1.5 px-3 py-1.5 rounded-md text-[12px] font-medium bg-bg-surface border border-border text-text-secondary hover:text-text hover:bg-bg-hover transition-colors disabled:opacity-40 disabled:pointer-events-none",children:[b?(0,r.jsx)(z,{className:"w-3 h-3"}):L?(0,r.jsx)(C,{size:12}):null,L?"Committed":ew===eN.length?"Commit all":"Commit ".concat(ew," file").concat(1!==ew?"s":"")]}),(0,r.jsx)("p",{className:"text-[10px] text-text-muted/50 text-center",children:"⌘+Enter to commit"})]})]})]})]})}function ed(e){let{file:t,checked:s,expanded:n,diff:a,loadingDiff:l,onToggleExpand:o,onToggleCheck:i}=e;return(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{onClick:o,className:"flex items-center gap-1.5 px-3 py-1.5 hover:bg-bg-hover transition-colors group cursor-pointer ".concat(n?"bg-bg-hover/50":""),children:[(0,r.jsx)("button",{onClick:i,className:"shrink-0 w-4 text-center","aria-label":s?"Deselect":"Select",children:(0,r.jsx)("span",{className:"text-[11px] font-bold transition-colors ".concat(s?"text-text-secondary":"text-text-muted/30"),children:s?"✓":"–"})}),(0,r.jsx)("span",{className:"shrink-0 w-4 text-center text-[10px] font-mono font-bold ".concat(function(e){switch(e){case"added":case"untracked":return"text-success";case"deleted":return"text-error";case"modified":return"text-warning";case"renamed":case"copied":return"text-info";default:return"text-text-muted"}}(t.status)),children:function(e){switch(e){case"added":return"A";case"untracked":return"U";case"deleted":return"D";case"modified":return"M";case"renamed":return"R";case"copied":return"C";default:return"?"}}(t.status)}),(0,r.jsx)("span",{className:"text-[11px] font-mono min-w-0 flex-1 text-text-secondary group-hover:text-text overflow-hidden text-ellipsis whitespace-nowrap",dir:"rtl",children:(0,r.jsx)("bdi",{children:t.file})}),(0,r.jsx)("svg",{width:10,height:10,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"shrink-0 text-text-muted/40 transition-transform ".concat(n?"rotate-180":""),children:(0,r.jsx)("polyline",{points:"6 9 12 15 18 9"})})]}),n&&(0,r.jsx)("div",{className:"border-t border-b border-border/50 bg-bg-surface/50 max-h-[300px] overflow-y-auto",children:l?(0,r.jsx)("div",{className:"flex items-center justify-center py-4",children:(0,r.jsx)(z,{})}):(0,r.jsx)(eo,{diff:null!=a?a:""})})]})}function ex(e){let{initialSessionId:t,initialWorkspace:s,defaultModel:a,onLabelChange:p,onStreamingChange:f,onSessionIdChange:b,onSelectSession:g,onOpenSidebar:j,onOpenSettings:v,onOpenQr:y}=e,{messages:N,toolCalls:w,sessionId:S,isStreaming:L,isLoadingHistory:R,isWatching:W,model:T,selectedModel:A,selectedMode:z,error:_,sendMessage:F,loadSession:I,setSelectedModel:O,setSelectedMode:B,stopStreaming:U,retryLastMessage:H,queuedMessages:J,forceSendQueued:V,editQueued:Q,deleteQueued:q}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"auto",t=arguments.length>1?arguments[1]:void 0,[s,r]=(0,n.useState)(null),[a,l]=(0,n.useState)(!1),[d,x]=(0,n.useState)(!1),[u,h]=(0,n.useState)(null),[m,p]=(0,n.useState)(e),[f,b]=(0,n.useState)("agent"),[g,j]=(0,n.useState)(null),v=(0,n.useRef)(null),y=(0,n.useRef)(t),N=(0,n.useRef)(!1),k=(0,n.useRef)(void 0);(0,n.useEffect)(()=>{v.current=s},[s]),(0,n.useEffect)(()=>{N.current=a},[a]);let w=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[t,s]=(0,n.useState)([]),[r,a]=(0,n.useState)([]),[l,i]=(0,n.useState)(!1),[c,d]=(0,n.useState)(!1),x=(0,n.useRef)(null),u=(0,n.useRef)(0),h=(0,n.useRef)(e.onStreamEnd),m=(0,n.useRef)(e.onStreamStart);(0,n.useEffect)(()=>{h.current=e.onStreamEnd},[e.onStreamEnd]),(0,n.useEffect)(()=>{m.current=e.onStreamStart},[e.onStreamStart]);let p=(0,n.useCallback)(()=>{x.current&&(x.current.close(),x.current=null),i(!1)},[]),f=(0,n.useCallback)(e=>{if(e.modifiedAt&&e.modifiedAt>u.current){var t,r;u.current=e.modifiedAt,(null==(t=e.messages)?void 0:t.length)>0&&s(e.messages),(null==(r=e.toolCalls)?void 0:r.length)>0&&a(e.toolCalls)}},[]),b=(0,n.useCallback)((e,t)=>{p();let r="/api/sessions/watch?id=".concat(encodeURIComponent(e));t&&(r+="&workspace=".concat(encodeURIComponent(t)));let n=new EventSource(r);x.current=n,n.addEventListener("connected",e=>{i(!0);try{var t,r,n,l;let o=JSON.parse(e.data);!0===o.isActive?(d(!0),null==(n=m.current)||n.call(m)):(d(!1),null==(l=h.current)||l.call(h)),o.modifiedAt&&(u.current=o.modifiedAt),(null==(t=o.messages)?void 0:t.length)>0&&s(o.messages),(null==(r=o.toolCalls)?void 0:r.length)>0&&a(o.toolCalls)}catch(e){console.error("[watch] Failed to parse connected event")}}),n.addEventListener("update",e=>{try{let s=JSON.parse(e.data);if(f(s),!1===s.isActive){var t;d(!1),null==(t=h.current)||t.call(h)}else!0===s.isActive&&d(!0)}catch(e){console.error("[watch] Failed to parse update event")}}),n.addEventListener("error",()=>{if(n.readyState===EventSource.CLOSED){var e;d(!1),null==(e=h.current)||e.call(h)}})},[p,f]),g=(0,n.useCallback)(async(e,t)=>{try{var r,n;let l="/api/sessions/history?id=".concat(encodeURIComponent(e));t&&(l+="&workspace=".concat(encodeURIComponent(t)));let i=await (0,o.n)(l);if(!i.ok)return;let c=await i.json();(null==(r=c.messages)?void 0:r.length)>0&&s(c.messages),(null==(n=c.toolCalls)?void 0:n.length)>0&&a(c.toolCalls),c.modifiedAt&&(u.current=c.modifiedAt)}catch(e){console.error("[watch] Failed to refresh from history")}},[]),j=(0,n.useCallback)(()=>{s([]),a([]),d(!1),u.current=0},[]);return(0,n.useEffect)(()=>()=>{p()},[p]),{messages:t,setMessages:s,toolCalls:r,setToolCalls:a,isWatching:l,isActive:c,setIsActive:d,startWatching:b,stopWatching:p,refreshFromHistory:g,resetState:j,lastModifiedRef:u}}({onStreamEnd:(0,n.useCallback)(()=>{l(!1);let e=C.dequeueNext();if(e){let t=e.model||e.mode?{model:e.model,mode:e.mode}:void 0;setTimeout(()=>{var s;null==(s=k.current)||s.call(k,e.content,t)},0)}},[]),onStreamStart:(0,n.useCallback)(()=>l(!0),[])}),C=function(e){let{selectedModel:t,selectedMode:s}=e,[r,a]=(0,n.useState)([]),l=(0,n.useRef)([]);(0,n.useEffect)(()=>{l.current=r},[r]);let o=(0,n.useCallback)(e=>{let r={id:i(),content:e,timestamp:Date.now(),model:t,mode:s};a(e=>[...e,r])},[t,s]),c=(0,n.useCallback)(()=>{let e=l.current;if(0===e.length)return null;let t=e[0];return a(e=>e.slice(1)),t},[]),d=(0,n.useCallback)(e=>{let t=l.current.find(t=>t.id===e);return t?(a(t=>t.filter(t=>t.id!==e)),t):null},[]),x=(0,n.useCallback)((e,t)=>{a(s=>s.map(s=>s.id===e?{...s,content:t}:s))},[]);return{queuedMessages:r,enqueue:o,dequeueNext:c,forceSendQueued:d,editQueued:x,deleteQueued:(0,n.useCallback)(e=>{a(t=>t.filter(t=>t.id!==e))},[]),clearQueue:(0,n.useCallback)(()=>{a([])},[])}}({selectedModel:m,selectedMode:f}),S=(0,n.useCallback)(()=>{w.stopWatching(),w.resetState(),r(null),y.current=t,h(null),j(null),l(!1),C.clearQueue()},[w,C]),E=(0,n.useCallback)(()=>{v.current&&(0,o.n)("/api/sessions/active",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:v.current})}).catch(e=>console.error("[chat] Failed to stop streaming:",e)),l(!1)},[]),L=(0,n.useCallback)(async(e,t)=>{w.stopWatching(),w.resetState(),x(!0),j(null),r(e),y.current=t;try{await w.refreshFromHistory(e,t),w.startWatching(e,t),(await c()).includes(e)&&l(!0)}catch(e){j(e instanceof Error?e.message:"Failed to load session")}finally{x(!1)}},[w]),R=(0,n.useCallback)(async(e,t)=>{var s,n,a;if(N.current)return void C.enqueue(e);w.stopWatching(),j(null),l(!0);let c={id:i(),role:"user",content:e,timestamp:Date.now()};w.setMessages(e=>[...e,c]);let d=null!=(s=null==t?void 0:t.model)?s:m,x=null!=(n=null==t?void 0:t.mode)?n:f;try{let t=await (0,o.n)("/api/chat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:e,sessionId:null!=(a=v.current)?a:void 0,model:"auto"!==d?d:void 0,mode:"agent"!==x?x:void 0,workspace:y.current})});if(!t.ok){let e=await t.json();throw Error(e.error||"HTTP ".concat(t.status))}let s=await t.json(),n=s.sessionId;v.current=n,r(n),s.model&&h(s.model),w.startWatching(n,y.current)}catch(e){if(e instanceof Error&&"AbortError"===e.name)return;j(e instanceof Error?e.message:"Unknown error"),l(!1)}},[m,f,w,C]);(0,n.useEffect)(()=>{k.current=R},[R]),(0,n.useEffect)(()=>{let e=async()=>{if("visible"!==document.visibilityState)return;let e=v.current;if(e)try{await w.refreshFromHistory(e,y.current);let t=await c();l(t.includes(e)),j(null),w.isWatching||w.startWatching(e,y.current)}catch(e){console.error("[chat] Failed to refresh on visibility change")}};return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[w]);let W=(0,n.useCallback)(e=>{let t=C.forceSendQueued(e);if(!t)return;l(!1);let s=t.model||t.mode?{model:t.model,mode:t.mode}:void 0;setTimeout(()=>{var e;null==(e=k.current)||e.call(k,t.content,s)},0)},[C]);(0,n.useEffect)(()=>{if(!a)return;let e=setInterval(async()=>{let e=v.current;if(e&&N.current)try{(await c()).includes(e)||(l(!1),await w.refreshFromHistory(e,y.current))}catch(e){}},1e4);return()=>clearInterval(e)},[a,w]);let T=(0,n.useCallback)(()=>{if(N.current)return;let e=w.messages,t=[...e].reverse().find(e=>"user"===e.role);if(!t)return;let s=t.content,r=e.findIndex(e=>e.id===t.id);r>=0&&w.setMessages(e.slice(0,r)),w.setToolCalls(e=>e.filter(e=>e.timestamp<t.timestamp)),R(s).catch(e=>console.error("[chat] Retry failed:",e))},[w,R]);return{messages:w.messages,toolCalls:w.toolCalls,sessionId:s,isStreaming:a,isLoadingHistory:d,isWatching:w.isWatching,model:u,selectedModel:m,selectedMode:f,error:g,queuedMessages:C.queuedMessages,sendMessage:R,loadSession:L,setSessionId:r,setSelectedModel:p,setSelectedMode:b,clearChat:S,stopStreaming:E,retryLastMessage:T,forceSendQueued:W,editQueued:C.editQueued,deleteQueued:C.deleteQueued}}(a,s),K=l(),G=function(){let e=(0,n.useRef)(null);return{playComplete:(0,n.useCallback)(()=>{if(d())return;let t=x(e);if(!t)return;let s=t.currentTime;u(t,880,s,.12,.15),u(t,1174.66,s+.1,.18,.12)},[]),playError:(0,n.useCallback)(()=>{if(d())return;let t=x(e);if(!t)return;let s=t.currentTime;u(t,330,s,.2,.15),u(t,220,s+.15,.25,.12)},[])}}(),Y=function(){let[e,t]=(0,n.useState)(null),s=(0,n.useRef)(null),r=(0,n.useRef)(""),a=(0,n.useRef)(null),l=(0,n.useCallback)(()=>{s.current&&(clearInterval(s.current),s.current=null),document.title=h,r.current&&m(r.current),a.current=null},[]),o=(0,n.useCallback)(()=>{t(null),l()},[l]);return{pending:e,notify:(0,n.useCallback)((e,n)=>{var o;t({type:e,elapsed:n});let i=document.querySelector("link[rel='icon']");r.current=null!=(o=null==i?void 0:i.href)?o:"/favicon.ico";let c=function(e){let t=document.createElement("canvas");t.width=32,t.height=32;let s=t.getContext("2d");return s?(s.fillStyle="#0a0a0b",s.beginPath(),s.roundRect(0,0,32,32,6),s.fill(),s.fillStyle="#e5e5e6",s.font="bold 18px sans-serif",s.textAlign="center",s.textBaseline="middle",s.fillText("C",16,17),s.fillStyle=e,s.beginPath(),s.arc(26,6,6,0,2*Math.PI),s.fill(),t.toDataURL("image/png")):""}("error"===e?"#ef4444":"#22c55e");c&&m(c);let d="error"===e?"Error - CLR":"Done! - CLR",x=!0;s.current=setInterval(()=>{document.title=x?d:h,x=!x},1e3);let u=()=>{"visible"===document.visibilityState&&(l(),document.removeEventListener("visibilitychange",u))};document.addEventListener("visibilitychange",u),a.current=()=>{l(),document.removeEventListener("visibilitychange",u)}},[l]),dismiss:o}}(),[$,X]=(0,n.useState)(""),[Z,ee]=(0,n.useState)([]),[et,es]=(0,n.useState)(0),[en,el]=(0,n.useState)(!1),[eo,ei]=(0,n.useState)(null),[ed,ex]=(0,n.useState)(!1),eu=(0,n.useRef)(0),eh=(0,n.useRef)(!1),em=(0,n.useRef)(!1),ep=(0,n.useRef)(0);(0,n.useEffect)(()=>{t&&!eh.current&&(eh.current=!0,I(t,s))},[t,s,I]);let ef=(0,n.useCallback)(()=>{if(s)return void X(s);(0,o.n)("/api/info").then(e=>e.json()).then(e=>X(e.workspace||"")).catch(e=>console.error("[workspace] Failed to fetch:",e))},[s]);(0,n.useEffect)(()=>{ef(),(0,o.n)("/api/sessions").then(e=>e.json()).then(e=>{var t;(null==(t=e.sessions)?void 0:t.length)>0&&ee(e.sessions.slice(0,3))}).catch(e=>console.error("[sessions] Failed to fetch:",e))},[ef]),(0,n.useEffect)(()=>{let e=N.filter(e=>"assistant"===e.role).length;e>eu.current&&e>0&&K.tap(),eu.current=e},[N,K]),(0,n.useEffect)(()=>{if(L&&!em.current&&(ep.current=Date.now(),Y.dismiss()),em.current&&!L){let e=Date.now()-ep.current,t=e>3e3,s=Math.floor(e/1e3);_?(t||document.hidden)&&G.playError():(t||document.hidden)&&G.playComplete(),document.hidden&&Y.notify(_?"error":"complete",s)}em.current=L,null==f||f(L)},[L,_]),(0,n.useEffect)(()=>{if(!L)return void es(0);let e=()=>es(Math.floor((Date.now()-ep.current)/1e3));e();let t=setInterval(e,1e3);return()=>clearInterval(t)},[L]),(0,n.useEffect)(()=>{null==b||b(S)},[S]),(0,n.useEffect)(()=>{let e=N.find(e=>"user"===e.role);e&&(null==p||p(e.content.slice(0,50)))},[N]);let eb=(0,n.useCallback)(async()=>{let e=function(e,t){let s=[...e.map(e=>({ts:e.timestamp,kind:"msg",msg:e})),...t.map(e=>({ts:e.timestamp,kind:"tc",tc:e}))].sort((e,t)=>e.ts-t.ts),r=[];for(let e of s)if("msg"===e.kind&&e.msg){let t="user"===e.msg.role?"User":"Assistant";r.push("## ".concat(t,"\n\n").concat(e.msg.content))}else"tc"===e.kind&&e.tc&&r.push(function(e){let t="shell"===e.type?"Shell":"search"===e.type?"Search":"edit"===e.type?"Edit":"write"===e.type?"Write":"read"===e.type?"Read":e.name,s="shell"===e.type?e.command:e.path;return s?"> **".concat(t,"** `").concat(s,"`"):"> **".concat(t,"**")}(e.tc));return r.join("\n\n")}(N,w);try{await navigator.clipboard.writeText(e),K.tap(),el(!0),setTimeout(()=>el(!1),1500)}catch(n){let t=new Blob([e],{type:"text/markdown"}),s=URL.createObjectURL(t),r=document.createElement("a");r.href=s,r.download="session-".concat((null==S?void 0:S.slice(0,8))||"export",".md"),r.click(),URL.revokeObjectURL(s)}},[N,w,S,K]);(0,n.useEffect)(()=>{if(!$)return;let e="/api/git?workspace=".concat(encodeURIComponent($)),t=()=>{(0,o.n)(e).then(e=>e.json()).then(e=>{var t;e.branch?ei({branch:e.branch,changedFiles:null!=(t=e.changedFiles)?t:0}):ei(null)}).catch(()=>{})};t();let s=setInterval(t,3e4);return()=>clearInterval(s)},[$]);let eg=$.split("/").filter(Boolean).pop()||"~",ej=et>=60?"".concat(Math.floor(et/60),"m ").concat(et%60,"s"):"".concat(et,"s");return(0,r.jsxs)("div",{className:"h-full flex flex-col",children:[(0,r.jsxs)("header",{className:"shrink-0 flex items-center justify-between h-11 px-3 border-b border-border",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("button",{onClick:()=>{K.tap(),null==j||j()},"aria-label":"Open session sidebar",className:"p-2 rounded-md hover:bg-bg-hover transition-colors text-text-muted hover:text-text-secondary",children:(0,r.jsx)(E,{})}),(0,r.jsx)("span",{className:"text-[13px] font-medium text-text-secondary",children:eg}),eo&&(0,r.jsxs)("button",{onClick:()=>ex(!0),className:"flex items-center gap-1 text-[10px] text-text-muted bg-bg-surface hover:bg-bg-hover rounded px-1.5 py-0.5 transition-colors",children:[(0,r.jsx)(P,{size:10}),(0,r.jsx)("span",{className:"truncate max-w-[80px]",children:eo.branch}),eo.changedFiles>0&&(0,r.jsxs)("span",{className:"text-warning",children:["+",eo.changedFiles]})]}),L&&(0,r.jsxs)(r.Fragment,{children:[T&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"text-text-muted text-[11px]",children:"/"}),(0,r.jsx)("span",{className:"text-[11px] text-text-muted truncate max-w-[120px]",children:T})]}),(0,r.jsx)("span",{className:"text-[11px] text-text-muted/60 tabular-nums",children:ej})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[S&&(0,r.jsx)("span",{className:"text-[10px] text-text-muted font-mono mr-1 hidden sm:inline opacity-60",children:S.slice(0,8)}),S&&N.length>0&&(0,r.jsx)("button",{onClick:eb,className:"p-2 rounded-md hover:bg-bg-hover transition-colors text-text-muted hover:text-text-secondary","aria-label":en?"Copied to clipboard":"Export conversation",children:en?(0,r.jsx)(C,{size:14}):(0,r.jsx)(D,{size:14})}),(0,r.jsx)("button",{onClick:()=>{K.tap(),null==v||v()},className:"p-2 rounded-md hover:bg-bg-hover transition-colors text-text-muted hover:text-text-secondary","aria-label":"Settings",children:(0,r.jsx)(M,{size:16})}),(0,r.jsx)("button",{onClick:()=>{K.tap(),null==y||y()},className:"p-2 rounded-md hover:bg-bg-hover transition-colors text-text-muted hover:text-text-secondary","aria-label":"Connect device",children:(0,r.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,r.jsx)("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1"}),(0,r.jsx)("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1"}),(0,r.jsx)("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1"}),(0,r.jsx)("rect",{x:"14",y:"14",width:"3",height:"3"}),(0,r.jsx)("line",{x1:"21",y1:"14",x2:"21",y2:"14.01"}),(0,r.jsx)("line",{x1:"21",y1:"21",x2:"21",y2:"21.01"})]})})]})]}),_&&(0,r.jsx)("div",{className:"shrink-0 px-4 py-2 border-b border-error/20 text-error text-[12px] bg-error/5",children:_}),Y.pending&&(0,r.jsxs)("div",{className:"shrink-0 flex items-center justify-between px-4 py-2 border-b text-[12px] ".concat("error"===Y.pending.type?"border-error/20 text-error bg-error/5":"border-success/20 text-success bg-success/5"),children:[(0,r.jsxs)("span",{children:["error"===Y.pending.type?"Agent errored":"Agent finished",null!==Y.pending.elapsed&&void 0!==Y.pending.elapsed&&Y.pending.elapsed>0&&(0,r.jsxs)("span",{className:"opacity-60 ml-1",children:["(",Y.pending.elapsed>=60?"".concat(Math.floor(Y.pending.elapsed/60),"m ").concat(Y.pending.elapsed%60,"s"):"".concat(Y.pending.elapsed,"s"),")"]})]}),(0,r.jsx)("button",{onClick:Y.dismiss,className:"p-0.5 rounded hover:bg-bg-hover transition-colors","aria-label":"Dismiss notification",children:(0,r.jsx)(k,{size:12})})]}),(0,r.jsx)(er,{messages:N,toolCalls:w,isStreaming:L,isLoadingHistory:R,isWatching:W,recentSessions:Z,onSelectSession:null!=g?g:I,onRetry:H,queuedMessages:J,onForceSend:V,onEditQueued:Q,onDeleteQueued:q}),(0,r.jsx)(ea,{onSend:F,onStop:U,isStreaming:L,selectedModel:A,selectedMode:z,onModelChange:O,onModeChange:B}),(0,r.jsx)(ec,{open:ed,onClose:()=>{ex(!1),$&&(0,o.n)("/api/git?workspace=".concat(encodeURIComponent($))).then(e=>e.json()).then(e=>{var t;e.branch?ei({branch:e.branch,changedFiles:null!=(t=e.changedFiles)?t:0}):ei(null)}).catch(()=>{})},workspace:$||void 0})]})}function eu(e){let{status:t}=e;return"streaming"===t?(0,r.jsx)("span",{className:"shrink-0 w-2 h-2 rounded-full border-[1.5px] border-success border-t-transparent animate-spin"}):(0,r.jsx)("span",{className:"shrink-0 w-1.5 h-1.5 rounded-full bg-text-muted/40"})}function eh(e){let{size:t=12,className:s=""}=e;return(0,r.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:s,children:[(0,r.jsx)("polyline",{points:"21 8 21 21 3 21 3 8"}),(0,r.jsx)("rect",{x:"1",y:"3",width:"22",height:"5"}),(0,r.jsx)("line",{x1:"10",y1:"12",x2:"14",y2:"12"})]})}function em(e){let{size:t=12,className:s=""}=e;return(0,r.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:s,children:[(0,r.jsx)("polyline",{points:"21 8 21 21 3 21 3 8"}),(0,r.jsx)("rect",{x:"1",y:"3",width:"22",height:"5"}),(0,r.jsx)("polyline",{points:"12 15 12 10"}),(0,r.jsx)("polyline",{points:"9 12 12 9 15 12"})]})}let ep="clr-selected-project",ef="clr-starred-projects";function eb(e){let{size:t=12,filled:s=!1,className:n=""}=e;return(0,r.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:s?"currentColor":"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:n,children:(0,r.jsx)("polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"})})}function eg(e){localStorage.setItem(ef,JSON.stringify(e)),(0,o.n)("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({starred_projects:JSON.stringify(e)})}).catch(()=>{})}function ej(e){let{session:t,children:s}=e,[a,l]=(0,n.useState)(!1),[o,i]=(0,n.useState)({x:0,y:0}),c=(0,n.useRef)(null);return(0,r.jsxs)("div",{ref:c,onMouseEnter:e=>{let t=e.currentTarget.getBoundingClientRect();i({x:t.left+t.width/2,y:t.top}),l(!0)},onMouseLeave:()=>l(!1),className:"relative",children:[s,a&&(0,r.jsx)("div",{className:"fixed z-[100] pointer-events-none",style:{left:o.x,top:o.y},children:(0,r.jsxs)("div",{className:"relative -translate-x-1/2 -translate-y-full -mt-1.5 max-w-[240px] px-2.5 py-1.5 rounded-md bg-bg-elevated border border-border shadow-lg",children:[(0,r.jsx)("p",{className:"text-[11px] text-text leading-snug break-words",children:t.title}),t.preview&&t.preview!==t.title&&(0,r.jsx)("p",{className:"text-[10px] text-text-muted mt-0.5 leading-snug break-words line-clamp-3",children:t.preview}),(0,r.jsx)("div",{className:"absolute left-1/2 -translate-x-1/2 top-full w-0 h-0 border-x-[5px] border-x-transparent border-t-[5px] border-t-border"})]})})]})}function ev(e){var t;let{open:s,onClose:a,currentSessionId:i,onSelectSession:c,onNewSession:d,activeStatuses:x={}}=e,[u,h]=(0,n.useState)([]),[m,f]=(0,n.useState)(!1),[b,g]=(0,n.useState)(!1),[j,v]=(0,n.useState)(null),[y,C]=(0,n.useState)(null),[S,E]=(0,n.useState)([]),[W,T]=(0,n.useState)(null),[A,_]=(0,n.useState)(!1),[F,M]=(0,n.useState)([]),D=l();(0,n.useEffect)(()=>{let e=localStorage.getItem(ep),t=function(){try{return JSON.parse(localStorage.getItem(ef)||"[]")}catch(e){return[]}}();T(e),M(t),(0,o.n)("/api/settings").then(e=>e.json()).then(e=>{var s;let r=null==(s=e.settings)?void 0:s.starred_projects;if(r)try{let e=JSON.parse(r);(e.length>0||0===t.length)&&(M(e),localStorage.setItem(ef,r))}catch(e){}else t.length>0&&eg(t)}).catch(()=>{})},[]);let P=(0,n.useCallback)((e,t)=>{e.stopPropagation(),M(e=>{let s=e.includes(t)?e.filter(e=>e!==t):[...e,t];return eg(s),s})},[]),I=(0,n.useCallback)(()=>{(0,o.n)("/api/projects").then(e=>e.json()).then(e=>{E(e.projects||[]),!W&&e.currentWorkspace&&(T(e.currentWorkspace),localStorage.setItem(ep,e.currentWorkspace))}).catch(()=>{})},[W]),O=(0,n.useCallback)(()=>{C(null);let e=new URLSearchParams;"__all__"===W?e.set("all","true"):W&&e.set("workspace",W),b&&e.set("archived","true");let t=e.toString();return(0,o.n)("/api/sessions"+(t?"?"+t:"")).then(e=>e.json()).then(e=>h(e.sessions||[])).catch(()=>C("Failed to load sessions"))},[W,b]);(0,n.useEffect)(()=>{if(!s)return;let e=!1;return f(!0),v(null),I(),O().finally(()=>{e||f(!1)}),()=>{e=!0}},[s,O,I]);let B=(0,n.useCallback)(e=>{T(e),localStorage.setItem(ep,e),_(!1)},[]),U=(e,t)=>{e.stopPropagation(),j===t?(D.error(),(0,o.n)("/api/sessions",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:t})}).then(()=>O()).catch(()=>C("Failed to delete session")).finally(()=>v(null))):(D.warn(),v(t))},H=e=>{e.stopPropagation(),v(null)},J="__all__"===W?"All projects":(null==(t=S.find(e=>e.path===W))?void 0:t.name)||(null==W?void 0:W.split("/").pop())||"Current project";return(0,r.jsxs)(r.Fragment,{children:[s&&(0,r.jsx)("div",{className:"fixed inset-0 z-40 bg-black/60","aria-hidden":"true",onClick:a}),(0,r.jsxs)("div",{role:"dialog","aria-label":"Session history","aria-hidden":!s,className:"fixed inset-0 z-50 bg-bg-elevated transform transition-transform duration-150 flex flex-col sm:inset-auto sm:top-0 sm:left-0 sm:h-full sm:w-[280px] sm:border-r sm:border-border ".concat(s?"translate-x-0":"-translate-x-full"),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between h-11 px-3 border-b border-border shrink-0",children:[(0,r.jsx)("span",{className:"text-[13px] font-medium text-text-secondary",children:"Sessions"}),(0,r.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,r.jsx)("button",{onClick:()=>{D.tap(),f(!0),O().finally(()=>f(!1))},disabled:m,"aria-label":"Refresh sessions",className:"p-1 rounded-md hover:bg-bg-hover text-text-muted hover:text-text-secondary transition-colors disabled:opacity-40",children:(0,r.jsx)(R,{size:14,className:m?"animate-spin":""})}),(0,r.jsx)("button",{onClick:a,"aria-label":"Close sidebar",className:"p-1 rounded-md hover:bg-bg-hover text-text-muted hover:text-text-secondary transition-colors",children:(0,r.jsx)(k,{size:14})})]})]}),(0,r.jsxs)("div",{className:"px-2 pt-2 pb-1 space-y-1 shrink-0",children:[(0,r.jsxs)("button",{onClick:()=>{d(W&&"__all__"!==W?W:void 0),a()},className:"w-full flex items-center gap-2 px-2.5 py-1.5 rounded-md text-[12px] text-text-muted hover:text-text-secondary hover:bg-bg-hover transition-colors",children:[(0,r.jsx)(w,{}),"New session"]}),F.length>0&&(0,r.jsx)("div",{className:"space-y-px",children:F.map(e=>{let t=S.find(t=>t.path===e),s=(null==t?void 0:t.name)||e.split("/").pop()||e,n=W===e;return(0,r.jsxs)("button",{onClick:()=>B(e),className:"w-full flex items-center gap-1.5 px-2.5 py-1.5 rounded-md text-[12px] transition-colors ".concat(n?"bg-bg-active text-text":"text-text-muted hover:text-text-secondary hover:bg-bg-hover"),children:[(0,r.jsx)(eb,{size:10,filled:!0,className:"shrink-0 text-text-secondary"}),(0,r.jsx)("span",{className:"truncate",children:s})]},e)})}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsxs)("button",{onClick:()=>{D.tap(),_(e=>!e)},className:"w-full flex items-center justify-between gap-2 px-2.5 py-1.5 rounded-md text-[12px] text-text-muted hover:text-text-secondary hover:bg-bg-hover transition-colors",children:[(0,r.jsx)("span",{className:"truncate",children:J}),(0,r.jsx)(N,{})]}),A&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"fixed inset-0 z-40",onClick:()=>_(!1)}),(0,r.jsxs)("div",{className:"absolute left-0 right-0 top-full mt-1 z-50 bg-bg-elevated border border-border rounded-lg shadow-xl py-1 max-h-60 overflow-y-auto",children:[(0,r.jsx)("button",{onClick:()=>B("__all__"),className:"w-full text-left px-3 py-1.5 text-[12px] transition-colors ".concat("__all__"===W?"text-text bg-bg-active":"text-text-secondary hover:bg-bg-hover hover:text-text"),children:"All projects"}),(0,r.jsx)("div",{className:"h-px bg-border mx-2 my-1"}),S.map(e=>(0,r.jsxs)("button",{onClick:()=>B(e.path),className:"w-full text-left px-3 py-1.5 text-[12px] transition-colors flex items-center gap-2 ".concat(W===e.path?"text-text bg-bg-active":"text-text-secondary hover:bg-bg-hover hover:text-text"),children:[(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("span",{className:"block truncate",children:e.name}),(0,r.jsx)("span",{className:"block text-[10px] text-text-muted font-mono truncate",children:e.path})]}),(0,r.jsx)("span",{onClick:t=>P(t,e.path),className:"shrink-0 p-0.5 rounded hover:bg-bg-active transition-colors ".concat(F.includes(e.path)?"text-text-secondary":"text-text-muted/30 hover:text-text-muted"),role:"button","aria-label":F.includes(e.path)?"Unstar project":"Star project",children:(0,r.jsx)(eb,{size:12,filled:F.includes(e.path)})})]},e.key))]})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsxs)("button",{onClick:()=>{D.tap(),g(e=>!e)},"aria-pressed":b,className:"flex-1 flex items-center gap-2 px-2.5 py-1.5 rounded-md text-[12px] transition-colors ".concat(b?"text-text bg-bg-active":"text-text-muted hover:text-text-secondary hover:bg-bg-hover"),children:[(0,r.jsx)(eh,{}),b?"Archived":"Archive"]}),!b&&u.length>0&&(0,r.jsx)("button",{onClick:()=>{D.warn();let e="__all__"===W?void 0:W||void 0;(0,o.n)("/api/sessions",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"archive_all",workspace:e})}).then(()=>O()).catch(()=>C("Failed to archive sessions"))},title:"Archive all visible sessions",className:"px-2 py-1.5 rounded-md text-[10px] text-text-muted hover:text-text-secondary hover:bg-bg-hover transition-colors whitespace-nowrap",children:"Archive all"})]})]}),(0,r.jsxs)("div",{className:"overflow-y-auto flex-1 px-2 pb-2",children:[y&&(0,r.jsx)("div",{className:"mx-1 mb-2 px-2.5 py-2 rounded-md bg-error/10 text-error text-[11px]",children:y}),m?(0,r.jsx)("div",{className:"flex items-center gap-2 justify-center py-8 text-text-muted text-[12px]",children:(0,r.jsx)(z,{})}):0!==u.length||y?u.map(e=>{let t=x[e.id];return(0,r.jsx)(ej,{session:e,children:(0,r.jsxs)("div",{className:"relative mb-px",children:[(0,r.jsxs)("button",{onClick:()=>{D.select(),c(e.id,e.workspace),a()},"aria-current":e.id===i?"true":void 0,className:"group w-full text-left px-2.5 py-2 rounded-md transition-colors ".concat(e.id===i?"bg-bg-active text-text":"hover:bg-bg-hover text-text-secondary"),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 flex-1 min-w-0 pr-12",children:[t&&(0,r.jsx)(eu,{status:t}),(0,r.jsx)("p",{className:"text-[12px] truncate",children:e.title})]}),(0,r.jsx)("span",{className:"text-[10px] text-text-muted shrink-0",children:p(e.updatedAt)})]}),"__all__"===W&&(0,r.jsx)("p",{className:"text-[10px] text-text-muted mt-0.5 font-mono truncate",children:e.workspace.split("/").pop()})]}),j===e.id?(0,r.jsxs)("div",{className:"absolute top-1 right-1 flex items-center gap-1",children:[(0,r.jsx)("button",{onClick:t=>U(t,e.id),className:"px-2 py-1 rounded text-[10px] font-medium bg-error/15 text-error hover:bg-error/25 transition-colors",children:"Delete"}),(0,r.jsx)("button",{onClick:H,"aria-label":"Cancel delete",className:"p-1 rounded text-text-muted hover:text-text-secondary hover:bg-bg-hover transition-colors",children:(0,r.jsx)(k,{size:10})})]}):(0,r.jsxs)("div",{className:"absolute top-1 right-1 flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-all",children:[(0,r.jsx)("button",{onClick:t=>{var s;return s=e.id,void(t.stopPropagation(),D.tap(),(0,o.n)("/api/sessions",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:b?"unarchive":"archive",sessionId:s})}).then(()=>O()).catch(()=>C("Failed to update session")))},"aria-label":b?"Unarchive session":"Archive session",className:"p-1.5 rounded hover:bg-bg-surface text-text-muted hover:text-text-secondary transition-colors",children:b?(0,r.jsx)(em,{}):(0,r.jsx)(eh,{})}),(0,r.jsx)("button",{onClick:t=>U(t,e.id),"aria-label":"Delete session",className:"p-1.5 rounded hover:bg-bg-surface text-text-muted hover:text-error transition-colors",children:(0,r.jsx)(L,{})})]})]})},e.id)}):(0,r.jsx)("p",{className:"text-text-muted text-[12px] text-center py-8",children:b?"No archived sessions":"No sessions"})]})]})]})}let ey={trust:!0,sound:!0,pwa_prompt:!0,default_model:"auto",webhook_url:""},eN={trust:{label:"Workspace trust",description:"Allow the agent to execute code and edit files without asking"},sound:{label:"Sound effects",description:"Play sounds on completion and errors"},pwa_prompt:{label:"Suggest PWA install",description:"Show the install-as-app prompt on page load"}},ek=Object.keys(eN);function ew(e){var t;let{open:s,onClose:a,onDefaultModelChange:i}=e,[c,d]=(0,n.useState)(ey),[x,u]=(0,n.useState)(!0),[h,m]=(0,n.useState)([]),[p,f]=(0,n.useState)(!1),[b,g]=(0,n.useState)(!1),[j,v]=(0,n.useState)("idle"),y=(0,n.useRef)(null),w=l();(0,n.useEffect)(()=>{if(!s)return;let e=!1;return u(!0),Promise.all([(0,o.n)("/api/settings").then(e=>e.json()),(0,o.n)("/api/models").then(e=>e.json())]).then(t=>{var s;let[r,n]=t;!e&&(d({...ey,...r.settings}),(null==(s=n.models)?void 0:s.length)>0&&m(n.models))}).catch(()=>{}).finally(()=>{e||u(!1)}),()=>{e=!0}},[s]);let S=(0,n.useCallback)(e=>{w.tap(),d(t=>{let s={...t,[e]:!t[e]};return(0,o.n)("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[e]:s[e]})}).catch(()=>{d(t)}),s})},[w]),E=(0,n.useCallback)(e=>{w.select(),d(t=>{let s={...t,default_model:e};return(0,o.n)("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({default_model:e})}).catch(()=>{d(t)}),s}),null==i||i(e),f(!1)},[i,w]),L=(0,n.useCallback)(async()=>{w.warn();try{if("serviceWorker"in navigator){let e=await navigator.serviceWorker.getRegistrations();await Promise.all(e.map(e=>e.unregister()))}if("undefined"!=typeof caches){let e=await caches.keys();await Promise.all(e.map(e=>caches.delete(e)))}g(!0),setTimeout(()=>g(!1),2e3)}catch(e){}},[w]),R=(0,n.useCallback)(e=>{d(t=>({...t,webhook_url:e})),y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{(0,o.n)("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({webhook_url:e})}).catch(()=>{})},500)},[]),W=(0,n.useCallback)(async()=>{w.tap(),v("sending");try{if(!(await (0,o.n)("/api/notifications/test",{method:"POST"})).ok)throw Error();v("ok")}catch(e){v("error")}setTimeout(()=>v("idle"),2500)},[w]),T=(null==(t=h.find(e=>e.id===c.default_model))?void 0:t.label)||c.default_model;return(0,r.jsxs)(r.Fragment,{children:[s&&(0,r.jsx)("div",{className:"fixed inset-0 z-40 bg-black/60","aria-hidden":"true",onClick:a}),(0,r.jsxs)("div",{role:"dialog","aria-label":"Settings","aria-hidden":!s,className:"fixed inset-0 z-50 bg-bg-elevated transform transition-transform duration-150 flex flex-col sm:inset-auto sm:top-0 sm:right-0 sm:h-full sm:w-[300px] sm:border-l sm:border-border ".concat(s?"translate-x-0":"translate-x-full"),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between h-11 px-3 border-b border-border shrink-0",children:[(0,r.jsx)("span",{className:"text-[13px] font-medium text-text-secondary",children:"Settings"}),(0,r.jsx)("button",{onClick:a,"aria-label":"Close settings",className:"p-1 rounded-md hover:bg-bg-hover text-text-muted hover:text-text-secondary transition-colors",children:(0,r.jsx)(k,{size:14})})]}),(0,r.jsx)("div",{className:"overflow-y-auto flex-1 p-3 space-y-1",children:x?(0,r.jsx)("div",{className:"flex justify-center py-8",children:(0,r.jsx)("span",{className:"inline-block w-3 h-3 rounded-full border-2 border-text-muted border-t-transparent animate-spin"})}):(0,r.jsxs)(r.Fragment,{children:[ek.map(e=>(0,r.jsxs)("button",{onClick:()=>S(e),className:"w-full flex items-center justify-between gap-3 px-3 py-2.5 rounded-md hover:bg-bg-hover transition-colors text-left",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("p",{className:"text-[12px] text-text",children:eN[e].label}),(0,r.jsx)("p",{className:"text-[11px] text-text-muted mt-0.5 leading-tight",children:eN[e].description})]}),(0,r.jsx)("div",{className:"shrink-0 w-8 h-[18px] rounded-full transition-colors relative ".concat(c[e]?"bg-success":"bg-bg-active"),children:(0,r.jsx)("div",{className:"absolute top-[2px] w-[14px] h-[14px] rounded-full bg-white transition-transform ".concat(c[e]?"translate-x-[16px]":"translate-x-[2px]")})})]},e)),(0,r.jsxs)("div",{className:"pt-3 mt-2 border-t border-border",children:[(0,r.jsxs)("div",{className:"px-3 py-2",children:[(0,r.jsx)("p",{className:"text-[12px] text-text",children:"Default model"}),(0,r.jsx)("p",{className:"text-[11px] text-text-muted mt-0.5 leading-tight",children:"Model used for new sessions"})]}),(0,r.jsxs)("div",{className:"relative px-3",children:[(0,r.jsxs)("button",{onClick:()=>f(e=>!e),className:"w-full flex items-center justify-between gap-2 px-3 py-2 rounded-md bg-bg-surface border border-border text-[12px] text-text hover:bg-bg-hover transition-colors",children:[(0,r.jsx)("span",{className:"truncate",children:T}),(0,r.jsx)(N,{})]}),p&&h.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"fixed inset-0 z-40",onClick:()=>f(!1)}),(0,r.jsx)("div",{className:"absolute left-3 right-3 top-full mt-1 z-50 bg-bg-elevated border border-border rounded-lg shadow-xl py-1 max-h-60 overflow-y-auto",children:h.map(e=>(0,r.jsx)("button",{onClick:()=>E(e.id),className:"w-full text-left px-3 py-1.5 text-[12px] transition-colors ".concat(c.default_model===e.id?"text-text bg-bg-active":"text-text-secondary hover:bg-bg-hover hover:text-text"),children:e.label},e.id))})]})]})]}),(0,r.jsxs)("div",{className:"pt-3 mt-2 border-t border-border",children:[(0,r.jsxs)("div",{className:"px-3 py-2",children:[(0,r.jsx)("p",{className:"text-[12px] text-text",children:"Webhook notifications"}),(0,r.jsx)("p",{className:"text-[11px] text-text-muted mt-0.5 leading-tight",children:"Get notified when the agent finishes via any webhook"})]}),(0,r.jsxs)("div",{className:"px-3 space-y-2",children:[(0,r.jsx)("input",{type:"url",value:c.webhook_url,onChange:e=>R(e.target.value),placeholder:"https://hooks.slack.com/...",className:"w-full px-3 py-2 rounded-md bg-bg-surface border border-border text-[12px] text-text placeholder:text-text-muted/50 focus:outline-none focus:border-text-muted transition-colors","aria-label":"Webhook URL"}),(0,r.jsxs)("button",{onClick:W,disabled:!c.webhook_url||"sending"===j,className:"w-full flex items-center justify-center gap-1.5 px-3 py-2 rounded-md bg-bg-surface border border-border text-[12px] text-text-muted hover:text-text-secondary hover:bg-bg-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:["sending"===j&&(0,r.jsx)("span",{className:"inline-block w-3 h-3 rounded-full border-2 border-text-muted border-t-transparent animate-spin"}),"ok"===j&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(C,{size:12})," Sent!"]}),"error"===j&&"Failed to send","idle"===j&&"Send test","sending"===j&&"Sending..."]}),(0,r.jsx)("p",{className:"text-[10px] text-text-muted/60 leading-tight px-0.5",children:"Paste a Slack, Discord, or custom webhook URL to receive push notifications when the agent completes"})]})]}),(0,r.jsxs)("div",{className:"pt-3 mt-2 border-t border-border",children:[(0,r.jsxs)("div",{className:"px-3 py-2",children:[(0,r.jsx)("p",{className:"text-[12px] text-text",children:"Cache"}),(0,r.jsx)("p",{className:"text-[11px] text-text-muted mt-0.5 leading-tight",children:"Clear cached data if the app feels stale"})]}),(0,r.jsx)("div",{className:"px-3",children:(0,r.jsx)("button",{onClick:L,className:"w-full flex items-center justify-center gap-1.5 px-3 py-2 rounded-md bg-bg-surface border border-border text-[12px] text-text-muted hover:text-text-secondary hover:bg-bg-hover transition-colors",children:b?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(C,{size:12}),"Cache cleared"]}):"Clear cache"})})]})]})})]})]})}var eC=s(2834);function eS(e){let{open:t,onClose:s}=e,[a,i]=(0,n.useState)(null),[c,d]=(0,n.useState)(null),x=l();return((0,n.useEffect)(()=>{if(!t)return;let e=!1;return(0,o.n)("/api/info").then(e=>e.json()).then(t=>{e||i(t)}).catch(()=>{e||d("Could not load network info")}),()=>{e=!0,i(null),d(null)}},[t]),t)?(0,r.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80",onClick:s,children:(0,r.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":"Connect device via QR code",className:"bg-bg-elevated border border-border rounded-xl p-6 max-w-xs w-full mx-4 text-center",onClick:e=>e.stopPropagation(),children:[(0,r.jsx)("p",{className:"text-[13px] font-medium text-text mb-1",children:"Connect device"}),(0,r.jsx)("p",{className:"text-[12px] text-text-muted mb-5",children:"Scan from any device on your network"}),a?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"bg-white rounded-lg p-3 inline-block mb-3",children:(0,r.jsx)(eC.h,{value:a.authUrl,size:180})}),(0,r.jsx)("p",{className:"font-mono text-[12px] text-text-secondary",children:a.url})]}):c?(0,r.jsx)("div",{className:"py-10 text-error text-[12px]",children:c}):(0,r.jsx)("div",{className:"py-10 text-text-muted text-[12px]",children:(0,r.jsx)(z,{className:"w-3.5 h-3.5"})}),(0,r.jsx)("button",{onClick:()=>{x.tap(),s()},className:"mt-4 w-full py-1.5 rounded-lg text-[12px] text-text-muted hover:text-text-secondary transition-colors",children:"Close"})]})}):null}var eE=s(5932);function eL(e,t){return{id:i(),sessionId:null,label:e?"Loading...":"New chat",isStreaming:!1,initialSessionId:e,initialWorkspace:t}}function eR(){var e,t;let[s,a]=(0,n.useState)(()=>{let e=function(){var e;let t=window.location.hash.match(/session=([a-f0-9-]+)/i);return null!=(e=null==t?void 0:t[1])?e:null}();return[eL(null!=e?e:void 0)]}),[i,d]=(0,n.useState)(()=>s[0].id),[x,u]=(0,n.useState)(!1),[h,m]=(0,n.useState)(!1),[p,f]=(0,n.useState)(!1),[b,g]=(0,n.useState)("auto"),j=l(),v=(0,n.useRef)(!1),y=(0,n.useRef)(!1);(0,n.useEffect)(()=>{window.location.hash.includes("session=")&&history.replaceState(null,"",window.location.pathname+window.location.search)},[]),(0,n.useEffect)(()=>{y.current||(y.current=!0,(0,o.n)("/api/settings").then(e=>e.json()).then(e=>{var t;(null==(t=e.settings)?void 0:t.default_model)&&g(e.settings.default_model)}).catch(()=>{}))},[]),(0,n.useEffect)(()=>{v.current||(v.current=!0,c().then(e=>{0!==e.length&&a(t=>{let s=[...t],r=null;for(let t=0;t<e.length;t++){let n=e[t];if(s.some(e=>e.initialSessionId===n||e.sessionId===n))continue;let a=eL(n);0!==t||1!==s.length||s[0].sessionId||s[0].isStreaming?(s.push(a),r||(r=a.id)):(s[0]=a,r=a.id)}if(r){let e=r;setTimeout(()=>d(e),0)}return s})}))},[]);let N=(0,n.useMemo)(()=>{let e={};for(let t of s)t.sessionId&&(e[t.sessionId]=t.isStreaming?"streaming":"idle");return e},[s]),k=(0,n.useCallback)(e=>{j.tap();let t=s.find(e=>e.id===i);if(t&&!t.sessionId&&!t.isStreaming){if(e&&t.initialWorkspace!==e){let t=eL(void 0,e);a(e=>e.map(e=>e.id===i?t:e)),d(t.id)}return}let r=eL(void 0,e);a(e=>[...e,r]),d(r.id)},[j,s,i]),w=(0,n.useCallback)((e,t)=>{let r=s.find(t=>t.sessionId===e);if(r)return void d(r.id);let n=eL(e,t),l=s.find(e=>e.id===i);!l||l.sessionId||l.isStreaming?a(e=>[...e,n]):a(e=>e.map(e=>e.id===i?n:e)),d(n.id)},[s,i]),C=(0,n.useCallback)((e,t)=>{a(s=>{let r=s.find(t=>t.id===e);return r&&r.label!==t?s.map(s=>s.id===e?{...s,label:t}:s):s})},[]),S=(0,n.useCallback)((e,t)=>{a(s=>{let r=s.find(t=>t.id===e);return r&&r.isStreaming!==t?s.map(s=>s.id===e?{...s,isStreaming:t}:s):s})},[]),E=(0,n.useCallback)((e,t)=>{a(s=>{let r=s.find(t=>t.id===e);return r&&r.sessionId!==t?s.map(s=>s.id===e?{...s,sessionId:t}:s):s})},[]),L=null!=(t=null==(e=s.find(e=>e.id===i))?void 0:e.sessionId)?t:null;return(0,r.jsxs)("div",{className:"h-dvh",children:[s.map(e=>(0,r.jsx)("div",{className:e.id===i?"h-full":"hidden",children:(0,r.jsx)(eE.ErrorBoundary,{fallback:"inline",children:(0,r.jsx)(ex,{initialSessionId:e.initialSessionId,initialWorkspace:e.initialWorkspace,defaultModel:b,onLabelChange:t=>C(e.id,t),onStreamingChange:t=>S(e.id,t),onSessionIdChange:t=>E(e.id,t),onSelectSession:w,onOpenSidebar:()=>u(!0),onOpenSettings:()=>m(!0),onOpenQr:()=>f(!0)})})},e.id)),(0,r.jsx)(ev,{open:x,onClose:()=>u(!1),currentSessionId:L,onSelectSession:w,onNewSession:k,activeStatuses:N}),(0,r.jsx)(ew,{open:h,onClose:()=>m(!1),onDefaultModelChange:g}),(0,r.jsx)(eS,{open:p,onClose:()=>f(!1)})]})}}},e=>{e.O(0,[481,391,441,255,358],()=>e(e.s=2673)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (()=>{"use strict";var e={},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var a=t[o]={exports:{}},i=!0;try{e[o].call(a.exports,a,a.exports,r),i=!1}finally{i&&delete t[o]}return a.exports}r.m=e,(()=>{var e=[];r.O=(t,o,n,a)=>{if(o){a=a||0;for(var i=e.length;i>0&&e[i-1][2]>a;i--)e[i]=e[i-1];e[i]=[o,n,a];return}for(var u=1/0,i=0;i<e.length;i++){for(var[o,n,a]=e[i],l=!0,c=0;c<o.length;c++)(!1&a||u>=a)&&Object.keys(r.O).every(e=>r.O[e](o[c]))?o.splice(c--,1):(l=!1,a<u&&(u=a));if(l){e.splice(i--,1);var s=n();void 0!==s&&(t=s)}}return t}})(),(()=>{var e,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;r.t=function(o,n){if(1&n&&(o=this(o)),8&n||"object"==typeof o&&o&&(4&n&&o.__esModule||16&n&&"function"==typeof o.then))return o;var a=Object.create(null);r.r(a);var i={};e=e||[null,t({}),t([]),t(t)];for(var u=2&n&&o;"object"==typeof u&&!~e.indexOf(u);u=t(u))Object.getOwnPropertyNames(u).forEach(e=>i[e]=()=>o[e]);return i.default=()=>o,r.d(a,i),a}})(),r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((t,o)=>(r.f[o](e,t),t),[])),r.u=e=>"static/chunks/"+e+".0dd3adbeaf3ef161.js",r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={},t="_N_E:";r.l=(o,n,a,i)=>{if(e[o])return void e[o].push(n);if(void 0!==a)for(var u,l,c=document.getElementsByTagName("script"),s=0;s<c.length;s++){var f=c[s];if(f.getAttribute("src")==o||f.getAttribute("data-webpack")==t+a){u=f;break}}u||(l=!0,(u=document.createElement("script")).charset="utf-8",u.timeout=120,r.nc&&u.setAttribute("nonce",r.nc),u.setAttribute("data-webpack",t+a),u.src=r.tu(o)),e[o]=[n];var d=(t,r)=>{u.onerror=u.onload=null,clearTimeout(p);var n=e[o];if(delete e[o],u.parentNode&&u.parentNode.removeChild(u),n&&n.forEach(e=>e(r)),t)return t(r)},p=setTimeout(d.bind(null,void 0,{type:"timeout",target:u}),12e4);u.onerror=d.bind(null,u.onerror),u.onload=d.bind(null,u.onload),l&&document.head.appendChild(u)}})(),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.tt=()=>(void 0===e&&(e={createScriptURL:e=>e},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("nextjs#bundler",e))),e)})(),r.tu=e=>r.tt().createScriptURL(e),r.p="/_next/",(()=>{var e={68:0,978:0,481:0};r.f.j=(t,o)=>{var n=r.o(e,t)?e[t]:void 0;if(0!==n)if(n)o.push(n[2]);else if(/^(481|68|978)$/.test(t))e[t]=0;else{var a=new Promise((r,o)=>n=e[t]=[r,o]);o.push(n[2]=a);var i=r.p+r.u(t),u=Error();r.l(i,o=>{if(r.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var a=o&&("load"===o.type?"missing":o.type),i=o&&o.target&&o.target.src;u.message="Loading chunk "+t+" failed.\n("+a+": "+i+")",u.name="ChunkLoadError",u.type=a,u.request=i,n[1](u)}},"chunk-"+t,t)}},r.O.j=t=>0===e[t];var t=(t,o)=>{var n,a,[i,u,l]=o,c=0;if(i.some(t=>0!==e[t])){for(n in u)r.o(u,n)&&(r.m[n]=u[n]);if(l)var s=l(r)}for(t&&t(o);c<i.length;c++)a=i[c],r.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return r.O(s)},o=self.webpackChunk_N_E=self.webpackChunk_N_E||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})()})();
@@ -1,11 +0,0 @@
1
- pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}
2
- /*!
3
- Theme: GitHub Dark
4
- Description: Dark theme as seen on github.com
5
- Author: github.com
6
- Maintainer: @Hirse
7
- Updated: 2021-05-15
8
-
9
- Outdated base version: https://github.com/primer/github-syntax-dark
10
- Current colors taken from GitHub's CSS
11
- */.hljs{color:#c9d1d9;background:#0d1117}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#ff7b72}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#d2a8ff}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable{color:#79c0ff}.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#a5d6ff}.hljs-built_in,.hljs-symbol{color:#ffa657}.hljs-code,.hljs-comment,.hljs-formula{color:#8b949e}.hljs-name,.hljs-quote,.hljs-selector-pseudo,.hljs-selector-tag{color:#7ee787}.hljs-subst{color:#c9d1d9}.hljs-section{color:#1f6feb;font-weight:700}.hljs-bullet{color:#f2cc60}.hljs-emphasis{color:#c9d1d9;font-style:italic}.hljs-strong{color:#c9d1d9;font-weight:700}.hljs-addition{color:#aff5b4;background-color:#033a16}.hljs-deletion{color:#ffdcd7;background-color:#67060c}
@@ -1 +0,0 @@
1
- /*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,::backdrop,:after,:before{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-duration:initial}}}@layer theme{:host,:root{--font-sans:"Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;--font-mono:"SF Mono","Fira Code","Fira Mono",Menlo,Consolas,monospace;--color-red-400:oklch(70.4% .191 22.216);--color-green-400:oklch(79.2% .209 151.711);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-3xl:48rem;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wider:.05em;--leading-tight:1.25;--leading-snug:1.375;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-bg:#000;--color-bg-elevated:#0a0a0a;--color-bg-surface:#111;--color-bg-hover:#1a1a1a;--color-bg-active:#222;--color-border:#1e1e1e;--color-text:#e8e8e8;--color-text-secondary:#999;--color-text-muted:#555;--color-accent:#e8e8e8;--color-success:#3dd68c;--color-warning:#f5a623;--color-error:#ef4444}}@layer base{*,::backdrop,:after,:before{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}:host,html{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}menu,ol,ul{list-style:none}audio,canvas,embed,iframe,img,object,svg,video{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,optgroup,select,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.top-0{top:calc(var(--spacing) * 0)}.top-1{top:calc(var(--spacing) * 1)}.top-2{top:calc(var(--spacing) * 2)}.top-\[2px\]{top:2px}.top-full{top:100%}.right-0{right:calc(var(--spacing) * 0)}.right-1{right:calc(var(--spacing) * 1)}.right-3{right:calc(var(--spacing) * 3)}.bottom-3{bottom:calc(var(--spacing) * 3)}.bottom-full{bottom:100%}.left-0{left:calc(var(--spacing) * 0)}.left-1\/2{left:50%}.left-3{left:calc(var(--spacing) * 3)}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.z-\[100\]{z-index:100}.mx-1{margin-inline:calc(var(--spacing) * 1)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-3{margin-inline:calc(var(--spacing) * 3)}.mx-4{margin-inline:calc(var(--spacing) * 4)}.mx-auto{margin-inline:auto}.my-1{margin-block:calc(var(--spacing) * 1)}.my-1\.5{margin-block:calc(var(--spacing) * 1.5)}.my-2{margin-block:calc(var(--spacing) * 2)}.my-3{margin-block:calc(var(--spacing) * 3)}.-mt-1\.5{margin-top:calc(var(--spacing) * -1.5)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mr-1{margin-right:calc(var(--spacing) * 1)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mb-0\.5{margin-bottom:calc(var(--spacing) * .5)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.mb-px{margin-bottom:1px}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-5{margin-left:calc(var(--spacing) * 5)}.ml-auto{margin-left:auto}.line-clamp-3{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.table{display:table}.h-0{height:calc(var(--spacing) * 0)}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-11{height:calc(var(--spacing) * 11)}.h-14{height:calc(var(--spacing) * 14)}.h-\[14px\]{height:14px}.h-\[18px\]{height:18px}.h-dvh{height:100dvh}.h-full{height:100%}.h-px{height:1px}.max-h-60{max-height:calc(var(--spacing) * 60)}.max-h-80{max-height:calc(var(--spacing) * 80)}.max-h-\[280px\]{max-height:280px}.max-h-\[300px\]{max-height:300px}.w-0{width:calc(var(--spacing) * 0)}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-8{width:calc(var(--spacing) * 8)}.w-14{width:calc(var(--spacing) * 14)}.w-56{width:calc(var(--spacing) * 56)}.w-\[14px\]{width:14px}.w-full{width:100%}.max-w-3xl{max-width:var(--container-3xl)}.max-w-\[80px\]{max-width:80px}.max-w-\[120px\]{max-width:120px}.max-w-\[240px\]{max-width:240px}.max-w-full{max-width:100%}.max-w-sm{max-width:var(--container-sm)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-full{min-width:100%}.flex-1{flex:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1)}.-translate-x-1\/2,.-translate-x-full{translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-full{--tw-translate-x:-100%}.translate-x-0{--tw-translate-x:calc(var(--spacing) * 0)}.translate-x-0,.translate-x-\[2px\]{translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-\[2px\]{--tw-translate-x:2px}.translate-x-\[16px\]{--tw-translate-x:16px}.translate-x-\[16px\],.translate-x-full{translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-full{--tw-translate-x:100%}.-translate-y-full{--tw-translate-y:-100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.flex-col{flex-direction:column}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-px>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(1px * var(--tw-space-y-reverse));margin-block-end:calc(1px * calc(1 - var(--tw-space-y-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-border\/50>:not(:last-child)){border-color:#1e1e1e80}@supports (color:color-mix(in lab,red,red)){:where(.divide-border\/50>:not(:last-child)){border-color:color-mix(in oklab,var(--color-border) 50%,transparent)}}.truncate{text-overflow:ellipsis;white-space:nowrap}.overflow-hidden,.truncate{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overscroll-none{overscroll-behavior:none}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e+38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-bl{border-bottom-left-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-\[1\.5px\]{border-style:var(--tw-border-style);border-width:1.5px}.border-x-\[5px\]{border-inline-style:var(--tw-border-style);border-inline-width:5px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-t-\[5px\]{border-top-style:var(--tw-border-style);border-top-width:5px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-\[\#2a2a2a\]{border-color:#2a2a2a}.border-accent\/60{border-color:#e8e8e899}@supports (color:color-mix(in lab,red,red)){.border-accent\/60{border-color:color-mix(in oklab,var(--color-accent) 60%,transparent)}}.border-border{border-color:var(--color-border)}.border-border\/50{border-color:#1e1e1e80}@supports (color:color-mix(in lab,red,red)){.border-border\/50{border-color:color-mix(in oklab,var(--color-border) 50%,transparent)}}.border-error\/20{border-color:#ef444433}@supports (color:color-mix(in lab,red,red)){.border-error\/20{border-color:color-mix(in oklab,var(--color-error) 20%,transparent)}}.border-success{border-color:var(--color-success)}.border-success\/20{border-color:#3dd68c33}@supports (color:color-mix(in lab,red,red)){.border-success\/20{border-color:color-mix(in oklab,var(--color-success) 20%,transparent)}}.border-text-muted{border-color:var(--color-text-muted)}.border-text-muted\/25{border-color:#55555540}@supports (color:color-mix(in lab,red,red)){.border-text-muted\/25{border-color:color-mix(in oklab,var(--color-text-muted) 25%,transparent)}}.border-x-transparent{border-inline-color:#0000}.border-t-border{border-top-color:var(--color-border)}.border-t-transparent{border-top-color:#0000}.bg-\[\#0a0a0b\]{background-color:#0a0a0b}.bg-\[\#0d0d0d\]{background-color:#0d0d0d}.bg-\[\#1c1c1c\]{background-color:#1c1c1c}.bg-accent\/5{background-color:#e8e8e80d}@supports (color:color-mix(in lab,red,red)){.bg-accent\/5{background-color:color-mix(in oklab,var(--color-accent) 5%,transparent)}}.bg-bg{background-color:var(--color-bg)}.bg-bg-active{background-color:var(--color-bg-active)}.bg-bg-elevated{background-color:var(--color-bg-elevated)}.bg-bg-hover{background-color:var(--color-bg-hover)}.bg-bg-hover\/50{background-color:#1a1a1a80}@supports (color:color-mix(in lab,red,red)){.bg-bg-hover\/50{background-color:color-mix(in oklab,var(--color-bg-hover) 50%,transparent)}}.bg-bg-surface{background-color:var(--color-bg-surface)}.bg-bg-surface\/50{background-color:#11111180}@supports (color:color-mix(in lab,red,red)){.bg-bg-surface\/50{background-color:color-mix(in oklab,var(--color-bg-surface) 50%,transparent)}}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\/60{background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.bg-black\/70{background-color:#000000b3}@supports (color:color-mix(in lab,red,red)){.bg-black\/70{background-color:color-mix(in oklab,var(--color-black) 70%,transparent)}}.bg-black\/80{background-color:#000c}@supports (color:color-mix(in lab,red,red)){.bg-black\/80{background-color:color-mix(in oklab,var(--color-black) 80%,transparent)}}.bg-border{background-color:var(--color-border)}.bg-error\/5{background-color:#ef44440d}@supports (color:color-mix(in lab,red,red)){.bg-error\/5{background-color:color-mix(in oklab,var(--color-error) 5%,transparent)}}.bg-error\/8{background-color:#ef444414}@supports (color:color-mix(in lab,red,red)){.bg-error\/8{background-color:color-mix(in oklab,var(--color-error) 8%,transparent)}}.bg-error\/10{background-color:#ef44441a}@supports (color:color-mix(in lab,red,red)){.bg-error\/10{background-color:color-mix(in oklab,var(--color-error) 10%,transparent)}}.bg-error\/15{background-color:#ef444426}@supports (color:color-mix(in lab,red,red)){.bg-error\/15{background-color:color-mix(in oklab,var(--color-error) 15%,transparent)}}.bg-success{background-color:var(--color-success)}.bg-success\/5{background-color:#3dd68c0d}@supports (color:color-mix(in lab,red,red)){.bg-success\/5{background-color:color-mix(in oklab,var(--color-success) 5%,transparent)}}.bg-success\/8{background-color:#3dd68c14}@supports (color:color-mix(in lab,red,red)){.bg-success\/8{background-color:color-mix(in oklab,var(--color-success) 8%,transparent)}}.bg-success\/15{background-color:#3dd68c26}@supports (color:color-mix(in lab,red,red)){.bg-success\/15{background-color:color-mix(in oklab,var(--color-success) 15%,transparent)}}.bg-text-muted\/40{background-color:#5556}@supports (color:color-mix(in lab,red,red)){.bg-text-muted\/40{background-color:color-mix(in oklab,var(--color-text-muted) 40%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.object-cover{object-fit:cover}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:calc(var(--spacing) * 1)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-6{padding:calc(var(--spacing) * 6)}.px-0\.5{padding-inline:calc(var(--spacing) * .5)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-10{padding-block:calc(var(--spacing) * 10)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-px{padding-block:1px}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-2\.5{padding-top:calc(var(--spacing) * 2.5)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pr-10{padding-right:calc(var(--spacing) * 10)}.pr-12{padding-right:calc(var(--spacing) * 12)}.pb-1{padding-bottom:calc(var(--spacing) * 1)}.pb-1\.5{padding-bottom:calc(var(--spacing) * 1.5)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-5{padding-left:calc(var(--spacing) * 5)}.text-center{text-align:center}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[12px\]{font-size:12px}.text-\[13px\]{font-size:13px}.text-\[14px\]{font-size:14px}.text-\[15px\]{font-size:15px}.text-\[17px\]{font-size:17px}.leading-\[1\.6\]{--tw-leading:1.6;line-height:1.6}.leading-\[1\.7\]{--tw-leading:1.7;line-height:1.7}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[\#888\]{color:#888}.text-\[\#c9d1d9\]{color:#c9d1d9}.text-\[\#d4d4d4\]{color:#d4d4d4}.text-\[\#e8e8e8\]{color:#e8e8e8}.text-accent{color:var(--color-accent)}.text-error{color:var(--color-error)}.text-green-400\/70{color:#05df72b3}@supports (color:color-mix(in lab,red,red)){.text-green-400\/70{color:color-mix(in oklab,var(--color-green-400) 70%,transparent)}}.text-red-400\/70{color:#ff6568b3}@supports (color:color-mix(in lab,red,red)){.text-red-400\/70{color:color-mix(in oklab,var(--color-red-400) 70%,transparent)}}.text-success{color:var(--color-success)}.text-text{color:var(--color-text)}.text-text-muted{color:var(--color-text-muted)}.text-text-muted\/30{color:#5555554d}@supports (color:color-mix(in lab,red,red)){.text-text-muted\/30{color:color-mix(in oklab,var(--color-text-muted) 30%,transparent)}}.text-text-muted\/40{color:#5556}@supports (color:color-mix(in lab,red,red)){.text-text-muted\/40{color:color-mix(in oklab,var(--color-text-muted) 40%,transparent)}}.text-text-muted\/50{color:#55555580}@supports (color:color-mix(in lab,red,red)){.text-text-muted\/50{color:color-mix(in oklab,var(--color-text-muted) 50%,transparent)}}.text-text-muted\/60{color:#5559}@supports (color:color-mix(in lab,red,red)){.text-text-muted\/60{color:color-mix(in oklab,var(--color-text-muted) 60%,transparent)}}.text-text-secondary{color:var(--color-text-secondary)}.text-warning{color:var(--color-warning)}.text-white{color:var(--color-white)}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.line-through{text-decoration-line:line-through}.underline{text-decoration-line:underline}.decoration-text-muted\/40{text-decoration-color:#5556}@supports (color:color-mix(in lab,red,red)){.decoration-text-muted\/40{-webkit-text-decoration-color:color-mix(in oklab,var(--color-text-muted) 40%,transparent);text-decoration-color:color-mix(in oklab,var(--color-text-muted) 40%,transparent)}}.underline-offset-2{text-underline-offset:2px}.opacity-0{opacity:0}.opacity-60{opacity:.6}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a)}.shadow-lg,.shadow-xl{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.select-none{-webkit-user-select:none;user-select:none}@media (hover:hover){.group-hover\:text-text:is(:where(.group):hover *){color:var(--color-text)}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.placeholder\:text-text-muted::placeholder{color:var(--color-text-muted)}.placeholder\:text-text-muted\/50::placeholder{color:#55555580}@supports (color:color-mix(in lab,red,red)){.placeholder\:text-text-muted\/50::placeholder{color:color-mix(in oklab,var(--color-text-muted) 50%,transparent)}}.focus-within\:border-text-muted\/40:focus-within{border-color:#5556}@supports (color:color-mix(in lab,red,red)){.focus-within\:border-text-muted\/40:focus-within{border-color:color-mix(in oklab,var(--color-text-muted) 40%,transparent)}}@media (hover:hover){.hover\:bg-\[\#252525\]:hover{background-color:#252525}.hover\:bg-bg-active:hover{background-color:var(--color-bg-active)}.hover\:bg-bg-hover:hover{background-color:var(--color-bg-hover)}.hover\:bg-bg-surface:hover{background-color:var(--color-bg-surface)}.hover\:bg-error\/5:hover{background-color:#ef44440d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-error\/5:hover{background-color:color-mix(in oklab,var(--color-error) 5%,transparent)}}.hover\:bg-error\/10:hover{background-color:#ef44441a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-error\/10:hover{background-color:color-mix(in oklab,var(--color-error) 10%,transparent)}}.hover\:bg-error\/25:hover{background-color:#ef444440}@supports (color:color-mix(in lab,red,red)){.hover\:bg-error\/25:hover{background-color:color-mix(in oklab,var(--color-error) 25%,transparent)}}.hover\:text-error:hover{color:var(--color-error)}.hover\:text-error\/80:hover{color:#ef4444cc}@supports (color:color-mix(in lab,red,red)){.hover\:text-error\/80:hover{color:color-mix(in oklab,var(--color-error) 80%,transparent)}}.hover\:text-text:hover{color:var(--color-text)}.hover\:text-text-muted:hover{color:var(--color-text-muted)}.hover\:text-text-secondary:hover{color:var(--color-text-secondary)}.hover\:decoration-accent:hover{-webkit-text-decoration-color:var(--color-accent);text-decoration-color:var(--color-accent)}}.focus\:border-text-muted:focus{border-color:var(--color-text-muted)}.focus\:border-text-muted\/40:focus{border-color:#5556}@supports (color:color-mix(in lab,red,red)){.focus\:border-text-muted\/40:focus{border-color:color-mix(in oklab,var(--color-text-muted) 40%,transparent)}}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-20:disabled{opacity:.2}.disabled\:opacity-40:disabled{opacity:.4}@media (min-width:40rem){.sm\:inset-auto{inset:auto}.sm\:top-0{top:calc(var(--spacing) * 0)}.sm\:right-0{right:calc(var(--spacing) * 0)}.sm\:left-0{left:calc(var(--spacing) * 0)}.sm\:inline{display:inline}.sm\:h-full{height:100%}.sm\:w-\[280px\]{width:280px}.sm\:w-\[300px\]{width:300px}.sm\:w-\[380px\]{width:380px}.sm\:max-w-\[150px\]{max-width:150px}.sm\:border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.sm\:border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.sm\:border-border{border-color:var(--color-border)}}}html{color-scheme:dark}body{background:var(--color-bg);color:var(--color-text);font-family:var(--font-sans);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}::-webkit-scrollbar{width:4px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:var(--color-border);border-radius:2px}.safe-bottom{padding-bottom:max(12px,env(safe-area-inset-bottom))}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(1turn)}}@keyframes pulse{50%{opacity:.5}}