@kimuson/claude-code-viewer 0.0.9 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/README.md +1 -1
  2. package/dist/standalone/.next/BUILD_ID +1 -1
  3. package/dist/standalone/.next/app-build-manifest.json +23 -18
  4. package/dist/standalone/.next/app-path-routes-manifest.json +1 -1
  5. package/dist/standalone/.next/build-manifest.json +2 -2
  6. package/dist/standalone/.next/prerender-manifest.json +1 -51
  7. package/dist/standalone/.next/react-loadable-manifest.json +1 -1
  8. package/dist/standalone/.next/server/app/_not-found/page.js +2 -2
  9. package/dist/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  10. package/dist/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  11. package/dist/standalone/.next/server/app/_not-found.html +1 -1
  12. package/dist/standalone/.next/server/app/_not-found.rsc +18 -17
  13. package/dist/standalone/.next/server/app/api/[[...route]]/route.js +13 -3
  14. package/dist/standalone/.next/server/app/api/[[...route]]/route.js.nft.json +1 -1
  15. package/dist/standalone/.next/server/app/api/[[...route]]/route_client-reference-manifest.js +1 -1
  16. package/dist/standalone/.next/server/app/index.html +1 -1
  17. package/dist/standalone/.next/server/app/index.rsc +19 -18
  18. package/dist/standalone/.next/server/app/page.js +2 -2
  19. package/dist/standalone/.next/server/app/page.js.nft.json +1 -1
  20. package/dist/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  21. package/dist/standalone/.next/server/app/projects/[projectId]/page.js +2 -2
  22. package/dist/standalone/.next/server/app/projects/[projectId]/page.js.nft.json +1 -1
  23. package/dist/standalone/.next/server/app/projects/[projectId]/page_client-reference-manifest.js +1 -1
  24. package/dist/standalone/.next/server/app/projects/[projectId]/sessions/[sessionId]/page.js +3 -7
  25. package/dist/standalone/.next/server/app/projects/[projectId]/sessions/[sessionId]/page.js.nft.json +1 -1
  26. package/dist/standalone/.next/server/app/projects/[projectId]/sessions/[sessionId]/page_client-reference-manifest.js +1 -1
  27. package/dist/standalone/.next/server/app/projects/page.js +2 -2
  28. package/dist/standalone/.next/server/app/projects/page.js.nft.json +1 -1
  29. package/dist/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  30. package/dist/standalone/.next/server/app-paths-manifest.json +1 -1
  31. package/dist/standalone/.next/server/chunks/144.js +1 -0
  32. package/dist/standalone/.next/server/chunks/161.js +1 -0
  33. package/dist/standalone/.next/server/chunks/388.js +9 -0
  34. package/dist/standalone/.next/server/chunks/389.js +1 -0
  35. package/dist/standalone/.next/server/chunks/451.js +1 -0
  36. package/dist/standalone/.next/server/chunks/522.js +5 -0
  37. package/dist/standalone/.next/server/chunks/63.js +9 -0
  38. package/dist/standalone/.next/server/chunks/705.js +9 -0
  39. package/dist/standalone/.next/server/chunks/781.js +9 -0
  40. package/dist/standalone/.next/server/chunks/791.js +1 -0
  41. package/dist/standalone/.next/server/chunks/852.js +1 -0
  42. package/dist/standalone/.next/server/chunks/856.js +1 -1
  43. package/dist/standalone/.next/server/chunks/902.js +22 -0
  44. package/dist/standalone/.next/server/chunks/914.js +1 -0
  45. package/dist/standalone/.next/server/chunks/942.js +5 -0
  46. package/dist/standalone/.next/server/chunks/997.js +1 -0
  47. package/dist/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
  48. package/dist/standalone/.next/server/pages/404.html +1 -1
  49. package/dist/standalone/.next/server/pages/500.html +1 -1
  50. package/dist/standalone/.next/server/pages-manifest.json +1 -2
  51. package/dist/standalone/.next/static/-IIvPzgFKOrPTwJWbCFbN/_buildManifest.js +1 -0
  52. package/dist/standalone/.next/static/-IIvPzgFKOrPTwJWbCFbN/_ssgManifest.js +1 -0
  53. package/dist/standalone/.next/static/0s5c6k0my6qOdeLpUYduU/_buildManifest.js +1 -0
  54. package/dist/standalone/.next/static/0s5c6k0my6qOdeLpUYduU/_ssgManifest.js +1 -0
  55. package/dist/standalone/.next/static/2WjtgNUcg91Bcreklxqxp/_buildManifest.js +1 -0
  56. package/dist/standalone/.next/static/2WjtgNUcg91Bcreklxqxp/_ssgManifest.js +1 -0
  57. package/dist/standalone/.next/static/3wUyAp1hHYhcdsJulD71A/_buildManifest.js +1 -0
  58. package/dist/standalone/.next/static/3wUyAp1hHYhcdsJulD71A/_ssgManifest.js +1 -0
  59. package/dist/standalone/.next/static/4N8RL28w5jrZdQ-1sMMIq/_buildManifest.js +1 -0
  60. package/dist/standalone/.next/static/4N8RL28w5jrZdQ-1sMMIq/_ssgManifest.js +1 -0
  61. package/dist/standalone/.next/static/5AUO0zgGdttgCNx_mWteG/_buildManifest.js +1 -0
  62. package/dist/standalone/.next/static/5AUO0zgGdttgCNx_mWteG/_ssgManifest.js +1 -0
  63. package/dist/standalone/.next/static/698PYz5QwFZuAn2e9RH8C/_buildManifest.js +1 -0
  64. package/dist/standalone/.next/static/698PYz5QwFZuAn2e9RH8C/_ssgManifest.js +1 -0
  65. package/dist/standalone/.next/static/8DnHa44e9AArokHSXrcsI/_buildManifest.js +1 -0
  66. package/dist/standalone/.next/static/8DnHa44e9AArokHSXrcsI/_ssgManifest.js +1 -0
  67. package/dist/standalone/.next/static/EIL5npT28-fn4fSGUWrc8/_buildManifest.js +1 -0
  68. package/dist/standalone/.next/static/EIL5npT28-fn4fSGUWrc8/_ssgManifest.js +1 -0
  69. package/dist/standalone/.next/static/IOhSwXFlUVKXfDsM06h4V/_buildManifest.js +1 -0
  70. package/dist/standalone/.next/static/IOhSwXFlUVKXfDsM06h4V/_ssgManifest.js +1 -0
  71. package/dist/standalone/.next/static/SEBz9OZpEQ6TnqzeJMw8F/_buildManifest.js +1 -0
  72. package/dist/standalone/.next/static/SEBz9OZpEQ6TnqzeJMw8F/_ssgManifest.js +1 -0
  73. package/dist/standalone/.next/static/T3zQfL4k5EGmOyq6yYkh_/_buildManifest.js +1 -0
  74. package/dist/standalone/.next/static/T3zQfL4k5EGmOyq6yYkh_/_ssgManifest.js +1 -0
  75. package/dist/standalone/.next/static/W4GtvpXwWodCDdggwkxOX/_buildManifest.js +1 -0
  76. package/dist/standalone/.next/static/W4GtvpXwWodCDdggwkxOX/_ssgManifest.js +1 -0
  77. package/dist/standalone/.next/static/W5CW36NTaXhL6uyyPwVCF/_buildManifest.js +1 -0
  78. package/dist/standalone/.next/static/W5CW36NTaXhL6uyyPwVCF/_ssgManifest.js +1 -0
  79. package/dist/standalone/.next/static/X4tH_cQbzXceXn-a6E2ps/_buildManifest.js +1 -0
  80. package/dist/standalone/.next/static/X4tH_cQbzXceXn-a6E2ps/_ssgManifest.js +1 -0
  81. package/dist/standalone/.next/static/XHD-ZWwPpwboATLIQpO4r/_buildManifest.js +1 -0
  82. package/dist/standalone/.next/static/XHD-ZWwPpwboATLIQpO4r/_ssgManifest.js +1 -0
  83. package/dist/standalone/.next/static/Y5DbqR5i6bYEsNIGUxchh/_buildManifest.js +1 -0
  84. package/dist/standalone/.next/static/Y5DbqR5i6bYEsNIGUxchh/_ssgManifest.js +1 -0
  85. package/dist/standalone/.next/static/b0Lnuz5_C3sn8k4UNpCRv/_buildManifest.js +1 -0
  86. package/dist/standalone/.next/static/b0Lnuz5_C3sn8k4UNpCRv/_ssgManifest.js +1 -0
  87. package/dist/standalone/.next/static/bF5XFDQE8k1mIDZjTpdZl/_buildManifest.js +1 -0
  88. package/dist/standalone/.next/static/bF5XFDQE8k1mIDZjTpdZl/_ssgManifest.js +1 -0
  89. package/dist/standalone/.next/static/bUS3oITEgVt2-me9Yhouc/_buildManifest.js +1 -0
  90. package/dist/standalone/.next/static/bUS3oITEgVt2-me9Yhouc/_ssgManifest.js +1 -0
  91. package/dist/standalone/.next/static/chunks/150-423be7500182cc33.js +1 -0
  92. package/dist/standalone/.next/static/chunks/219-3522179604e6066c.js +16 -0
  93. package/dist/standalone/.next/static/chunks/251-c78cf6d746377497.js +1 -0
  94. package/dist/standalone/.next/static/chunks/311-8ddb4880d5fee039.js +1 -0
  95. package/dist/standalone/.next/static/chunks/33-366ba0d0a94aa3c4.js +1 -0
  96. package/dist/standalone/.next/static/chunks/409-7242985dd65d8d0a.js +1 -0
  97. package/dist/standalone/.next/static/chunks/409-89924c7045c85d4d.js +1 -0
  98. package/dist/standalone/.next/static/chunks/409-8e5de6996e43c44c.js +1 -0
  99. package/dist/standalone/.next/static/chunks/409-b1dba29a07ae758a.js +1 -0
  100. package/dist/standalone/.next/static/chunks/409-dbcdfb0a640d2f16.js +1 -0
  101. package/dist/standalone/.next/static/chunks/412-2403338d7a344504.js +1 -0
  102. package/dist/standalone/.next/static/chunks/5-3d4eff5d72d53094.js +1 -0
  103. package/dist/standalone/.next/static/chunks/5-55adc565d173510e.js +1 -0
  104. package/dist/standalone/.next/static/chunks/559-4a9cb1227f1261b7.js +16 -0
  105. package/dist/standalone/.next/static/chunks/583-5caa5b2bfe8a2df8.js +1 -0
  106. package/dist/standalone/.next/static/chunks/595-52c0638105e94677.js +16 -0
  107. package/dist/standalone/.next/static/chunks/608-b86cfa3cfb160138.js +1 -0
  108. package/dist/standalone/.next/static/chunks/608-ca4efe3ce4fe39a5.js +1 -0
  109. package/dist/standalone/.next/static/chunks/730-1d22f1bf654b6820.js +16 -0
  110. package/dist/standalone/.next/static/chunks/830-6e23a90b5a6129bd.js +16 -0
  111. package/dist/standalone/.next/static/chunks/884-279acd79efa6e9a9.js +1 -0
  112. package/dist/standalone/.next/static/chunks/98-9a09a0ec86541f6f.js +1 -0
  113. package/dist/standalone/.next/static/chunks/984-bb9e4d0b54a7feae.js +16 -0
  114. package/dist/standalone/.next/static/chunks/app/layout-248f77cb1dbbb2f1.js +1 -0
  115. package/dist/standalone/.next/static/chunks/app/layout-61da9bef4edbd721.js +1 -0
  116. package/dist/standalone/.next/static/chunks/app/layout-9cc578291d1122a6.js +1 -0
  117. package/dist/standalone/.next/static/chunks/app/layout-df3fe9e7453a44b8.js +1 -0
  118. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/page-017f8e1a8383e65e.js +1 -0
  119. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/page-0f45fc00d7175cae.js +1 -0
  120. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/page-35f34576b393594d.js +1 -0
  121. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/page-60ed06e2d8d22cb2.js +1 -0
  122. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/page-9af32caff2a4976d.js +1 -0
  123. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/page-a80c2e583d03357d.js +1 -0
  124. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/page-ad7bf7983bb30c87.js +1 -0
  125. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/page-b63764462f54f2b5.js +1 -0
  126. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-03ef02af087afc6b.js +1 -0
  127. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-1ec8a186b7ec29eb.js +1 -0
  128. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-38b196c8794a039c.js +1 -0
  129. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-3bce8fbc542864bc.js +1 -0
  130. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-3caf2718308efd7c.js +1 -0
  131. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-5c73f56ab45c8d63.js +1 -0
  132. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-7327712352196987.js +1 -0
  133. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-78abd82b3673601b.js +1 -0
  134. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-7d9772e3e18620b2.js +1 -0
  135. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-7e03ad068ad34e14.js +1 -0
  136. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-88f34cd031f28e09.js +1 -0
  137. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-8c83ef1c4c77523c.js +1 -0
  138. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-935bedd35de577e3.js +1 -0
  139. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-bb728f4bbfea646c.js +1 -0
  140. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-c0e036944a6ac016.js +1 -0
  141. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-e26692214649a2aa.js +1 -0
  142. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-e67af2503b1ebdc2.js +1 -0
  143. package/dist/standalone/.next/static/chunks/app/projects/page-0a575db7be576968.js +1 -0
  144. package/dist/standalone/.next/static/chunks/app/projects/page-68046792ceaef9df.js +1 -0
  145. package/dist/standalone/.next/static/chunks/app/projects/page-9b96f0e12f54372e.js +1 -0
  146. package/dist/standalone/.next/static/css/31cea2df842c4c03.css +3 -0
  147. package/dist/standalone/.next/static/css/462242960d6ce780.css +3 -0
  148. package/dist/standalone/.next/static/css/736c23b2e8dc3f6b.css +3 -0
  149. package/dist/standalone/.next/static/css/8b7e282cc0b7d79b.css +3 -0
  150. package/dist/standalone/.next/static/css/a3d3768acd87162f.css +3 -0
  151. package/dist/standalone/.next/static/css/b1a4c8257c96f3e5.css +3 -0
  152. package/dist/standalone/.next/static/css/d7126693e49651c5.css +3 -0
  153. package/dist/standalone/.next/static/css/e2d764fdabf9fe7c.css +3 -0
  154. package/dist/standalone/.next/static/css/fe4d89aa2fe70ed7.css +3 -0
  155. package/dist/standalone/.next/static/jzCawpNJ_5UTY8p7oQDfU/_buildManifest.js +1 -0
  156. package/dist/standalone/.next/static/jzCawpNJ_5UTY8p7oQDfU/_ssgManifest.js +1 -0
  157. package/dist/standalone/.next/static/kiCbJQ67aOIy8KF8CxcWF/_buildManifest.js +1 -0
  158. package/dist/standalone/.next/static/kiCbJQ67aOIy8KF8CxcWF/_ssgManifest.js +1 -0
  159. package/dist/standalone/.next/static/llWcBaLinPeFWO-DeRCO1/_buildManifest.js +1 -0
  160. package/dist/standalone/.next/static/llWcBaLinPeFWO-DeRCO1/_ssgManifest.js +1 -0
  161. package/dist/standalone/.next/static/n5ByUeVZI4rMF6_3jTTX4/_buildManifest.js +1 -0
  162. package/dist/standalone/.next/static/n5ByUeVZI4rMF6_3jTTX4/_ssgManifest.js +1 -0
  163. package/dist/standalone/.next/static/nrRdBRNH-XGdnlJwLXOk1/_buildManifest.js +1 -0
  164. package/dist/standalone/.next/static/nrRdBRNH-XGdnlJwLXOk1/_ssgManifest.js +1 -0
  165. package/dist/standalone/.next/static/q951Du7jKgT3tazxs0jAW/_buildManifest.js +1 -0
  166. package/dist/standalone/.next/static/q951Du7jKgT3tazxs0jAW/_ssgManifest.js +1 -0
  167. package/dist/standalone/.next/static/tOczoqzLEaSm1a2E0hv1s/_buildManifest.js +1 -0
  168. package/dist/standalone/.next/static/tOczoqzLEaSm1a2E0hv1s/_ssgManifest.js +1 -0
  169. package/dist/standalone/.next/static/wUD6Y_u_-tDhO52jWPYQZ/_buildManifest.js +1 -0
  170. package/dist/standalone/.next/static/wUD6Y_u_-tDhO52jWPYQZ/_ssgManifest.js +1 -0
  171. package/dist/standalone/package.json +5 -2
  172. package/package.json +5 -2
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[177],{6415:()=>{},8022:(e,t,s)=>{"use strict";s.d(t,{ServerEventsProvider:()=>h});var r=s(89835),i=s(13881),n=s(55931),a=s(15915),u=s(53630);let o=e=>e.split("\n\n").filter(e=>e.length>0).map(e=>(e=>{let t=e.split("\n"),s=t.findIndex(e=>e.startsWith("event:")),r=t.findIndex(e=>e.startsWith("data:")),i=t.findIndex(e=>e.startsWith("id:")),n=e=>Math.min(...[s,r,i,t.length].filter(t=>t>e));if(-1===s||-1===r||-1===i)throw console.error("failed",e),Error("Failed to parse SSE event");let a=t.slice(s,n(s)).join("\n"),u=t.slice(r,n(r)).join("\n");return{id:t.slice(i,n(i)).join("\n").slice(3).trim(),event:a.slice(6).trim(),data:JSON.parse(u.slice(u.indexOf("{"),u.indexOf("}")+1))}})(e)),l=!1;function h(e){let{children:t}=e,s=(0,i.useQueryClient)(),h=(0,n.useCallback)(async()=>{var e;console.log("listening to events");let t=await u.s.api.events.state_changes.$get();if(!t.ok)throw Error("Failed to fetch events");let r=null==(e=t.body)?void 0:e.getReader();if(!r)throw Error("Failed to get reader");let i=new TextDecoder;for(;;){let{done:e,value:t}=await r.read();if(e)break;for(let e of o(i.decode(t)))console.log("data",e),"project_changed"===e.data.type&&await s.invalidateQueries({queryKey:a._.queryKey}),"session_changed"===e.data.type&&await s.invalidateQueries({queryKey:["sessions"]})}},[s]);return(0,n.useEffect)(()=>{!1===l&&h().then(()=>{console.log("registered events listener"),l=!0}).catch(e=>{console.error("failed to register events listener",e),l=!0})},[h]),(0,r.jsx)(r.Fragment,{children:t})}},15915:(e,t,s)=>{"use strict";s.d(t,{Y:()=>a,_:()=>n});var r=s(45320),i=s(53630);let n={queryKey:["projects"],queryFn:async()=>{let e=await i.s.api.projects.$get(),{projects:t}=await e.json();return t}},a=()=>(0,r.useSuspenseQuery)({queryKey:n.queryKey,queryFn:n.queryFn})},47055:(e,t,s)=>{"use strict";s.d(t,{RootErrorBoundary:()=>o});var r=s(89835),i=s(55931);let n=(0,i.createContext)(null),a={didCatch:!1,error:null};class u extends i.Component{static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){let{error:e}=this.state;if(null!==e){for(var t,s,r=arguments.length,i=Array(r),n=0;n<r;n++)i[n]=arguments[n];null==(t=(s=this.props).onReset)||t.call(s,{args:i,reason:"imperative-api"}),this.setState(a)}}componentDidCatch(e,t){var s,r;null==(s=(r=this.props).onError)||s.call(r,e,t)}componentDidUpdate(e,t){let{didCatch:s}=this.state,{resetKeys:r}=this.props;if(s&&null!==t.error&&function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length!==t.length||e.some((e,s)=>!Object.is(e,t[s]))}(e.resetKeys,r)){var i,n;null==(i=(n=this.props).onReset)||i.call(n,{next:r,prev:e.resetKeys,reason:"keys"}),this.setState(a)}}render(){let{children:e,fallbackRender:t,FallbackComponent:s,fallback:r}=this.props,{didCatch:a,error:u}=this.state,o=e;if(a){let e={error:u,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof t)o=t(e);else if(s)o=(0,i.createElement)(s,e);else if(void 0!==r)o=r;else throw u}return(0,i.createElement)(n.Provider,{value:{didCatch:a,error:u,resetErrorBoundary:this.resetErrorBoundary}},o)}constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=a}}let o=e=>{let{children:t}=e;return(0,r.jsx)(u,{FallbackComponent:e=>{let{error:t}=e;return(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{children:"Error"}),(0,r.jsx)("p",{children:t.message})]})},children:t})}},53630:(e,t,s)=>{"use strict";s.d(t,{s:()=>r});let r=(0,s(74865).hc)("/")},65866:e=>{e.exports={style:{fontFamily:"'Geist Mono', 'Geist Mono Fallback'",fontStyle:"normal"},className:"__className_9a8899",variable:"__variable_9a8899"}},79420:(e,t,s)=>{Promise.resolve().then(s.bind(s,98613)),Promise.resolve().then(s.bind(s,72611)),Promise.resolve().then(s.bind(s,13881)),Promise.resolve().then(s.bind(s,85452)),Promise.resolve().then(s.bind(s,120)),Promise.resolve().then(s.bind(s,27740)),Promise.resolve().then(s.bind(s,59054)),Promise.resolve().then(s.bind(s,8120)),Promise.resolve().then(s.bind(s,9161)),Promise.resolve().then(s.bind(s,63812)),Promise.resolve().then(s.bind(s,86260)),Promise.resolve().then(s.bind(s,15312)),Promise.resolve().then(s.bind(s,45320)),Promise.resolve().then(s.t.bind(s,91198,23)),Promise.resolve().then(s.t.bind(s,65866,23)),Promise.resolve().then(s.bind(s,47055)),Promise.resolve().then(s.bind(s,8022)),Promise.resolve().then(s.t.bind(s,6415,23)),Promise.resolve().then(s.bind(s,83972))},83972:(e,t,s)=>{"use strict";let r;s.d(t,{QueryClientProviderWrapper:()=>g});var i=s(89835),n=s(18832),a=s(94081),u=s(43409),o=s(36906),l=class extends o.Q{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,s){let r=t.queryKey,i=t.queryHash??(0,n.F$)(r,t),u=this.get(i);return u||(u=new a.X({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:s,defaultOptions:e.getQueryDefaults(r)}),this.add(u)),u}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){u.jG.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,n.MK)(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,n.MK)(e,t)):t}notify(e){u.jG.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){u.jG.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){u.jG.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},h=s(94828),c=class extends o.Q{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#s=new Map,this.#r=0}#t;#s;#r;build(e,t,s){let r=new h.s({mutationCache:this,mutationId:++this.#r,options:e.defaultMutationOptions(t),state:s});return this.add(r),r}add(e){this.#t.add(e);let t=d(e);if("string"==typeof t){let s=this.#s.get(t);s?s.push(e):this.#s.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){let t=d(e);if("string"==typeof t){let s=this.#s.get(t);if(s)if(s.length>1){let t=s.indexOf(e);-1!==t&&s.splice(t,1)}else s[0]===e&&this.#s.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=d(e);if("string"!=typeof t)return!0;{let s=this.#s.get(t),r=s?.find(e=>"pending"===e.state.status);return!r||r===e}}runNext(e){let t=d(e);if("string"!=typeof t)return Promise.resolve();{let s=this.#s.get(t)?.find(t=>t!==e&&t.state.isPaused);return s?.continue()??Promise.resolve()}}clear(){u.jG.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#s.clear()})}getAll(){return Array.from(this.#t)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,n.nJ)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,n.nJ)(e,t))}notify(e){u.jG.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return u.jG.batch(()=>Promise.all(e.map(e=>e.continue().catch(n.lQ))))}};function d(e){return e.options.scope?.id}var f=s(28700),y=s(69715),p=s(10215),m=class{#i;#n;#a;#u;#o;#l;#h;#c;constructor(e={}){this.#i=e.queryCache||new l,this.#n=e.mutationCache||new c,this.#a=e.defaultOptions||{},this.#u=new Map,this.#o=new Map,this.#l=0}mount(){this.#l++,1===this.#l&&(this.#h=f.m.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#i.onFocus())}),this.#c=y.t.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#i.onOnline())}))}unmount(){this.#l--,0===this.#l&&(this.#h?.(),this.#h=void 0,this.#c?.(),this.#c=void 0)}isFetching(e){return this.#i.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#n.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#i.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),s=this.#i.build(this,t),r=s.state.data;return void 0===r?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime((0,n.d2)(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#i.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,s){let r=this.defaultQueryOptions({queryKey:e}),i=this.#i.get(r.queryHash),a=i?.state.data,u=(0,n.Zw)(t,a);if(void 0!==u)return this.#i.build(this,r).setData(u,{...s,manual:!0})}setQueriesData(e,t,s){return u.jG.batch(()=>this.#i.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,s)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#i.get(t.queryHash)?.state}removeQueries(e){let t=this.#i;u.jG.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let s=this.#i;return u.jG.batch(()=>(s.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){let s={revert:!0,...t};return Promise.all(u.jG.batch(()=>this.#i.findAll(e).map(e=>e.cancel(s)))).then(n.lQ).catch(n.lQ)}invalidateQueries(e,t={}){return u.jG.batch(()=>(this.#i.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,t={}){let s={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(u.jG.batch(()=>this.#i.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,s);return s.throwOnError||(t=t.catch(n.lQ)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(n.lQ)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let s=this.#i.build(this,t);return s.isStaleByTime((0,n.d2)(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(n.lQ).catch(n.lQ)}fetchInfiniteQuery(e){return e.behavior=(0,p.PL)(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(n.lQ).catch(n.lQ)}ensureInfiniteQueryData(e){return e.behavior=(0,p.PL)(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return y.t.isOnline()?this.#n.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#i}getMutationCache(){return this.#n}getDefaultOptions(){return this.#a}setDefaultOptions(e){this.#a=e}setQueryDefaults(e,t){this.#u.set((0,n.EN)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#u.values()],s={};return t.forEach(t=>{(0,n.Cp)(e,t.queryKey)&&Object.assign(s,t.defaultOptions)}),s}setMutationDefaults(e,t){this.#o.set((0,n.EN)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#o.values()],s={};return t.forEach(t=>{(0,n.Cp)(e,t.mutationKey)&&Object.assign(s,t.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#a.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,n.F$)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===n.hT&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#a.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#i.clear(),this.#n.clear()}},v=s(13881);let b=()=>new m({defaultOptions:{queries:{refetchOnWindowFocus:!0,refetchInterval:3e5,retry:!1}}}),g=e=>{let{children:t}=e,s=n.S$?b():(null!=r||(r=b()),r);return(0,i.jsx)(v.QueryClientProvider,{client:s,children:t})}},91198:e=>{e.exports={style:{fontFamily:"'Geist', 'Geist Fallback'",fontStyle:"normal"},className:"__className_5cfdac",variable:"__variable_5cfdac"}}},e=>{e.O(0,[350,33,900,341,358],()=>e(e.s=79420)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[177],{207:(e,t,s)=>{"use strict";s.d(t,{QueryClientProviderWrapper:()=>v});var i=s(89835),r=s(13881),a=s(18832),n=s(94081),o=s(43409),u=s(36906),l=class extends u.Q{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,s){let i=t.queryKey,r=t.queryHash??(0,a.F$)(i,t),o=this.get(r);return o||(o=new n.X({client:e,queryKey:i,queryHash:r,options:e.defaultQueryOptions(t),state:s,defaultOptions:e.getQueryDefaults(i)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){o.jG.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,a.MK)(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,a.MK)(e,t)):t}notify(e){o.jG.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){o.jG.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){o.jG.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},h=s(94828),c=class extends u.Q{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#s=new Map,this.#i=0}#t;#s;#i;build(e,t,s){let i=new h.s({mutationCache:this,mutationId:++this.#i,options:e.defaultMutationOptions(t),state:s});return this.add(i),i}add(e){this.#t.add(e);let t=d(e);if("string"==typeof t){let s=this.#s.get(t);s?s.push(e):this.#s.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){let t=d(e);if("string"==typeof t){let s=this.#s.get(t);if(s)if(s.length>1){let t=s.indexOf(e);-1!==t&&s.splice(t,1)}else s[0]===e&&this.#s.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=d(e);if("string"!=typeof t)return!0;{let s=this.#s.get(t),i=s?.find(e=>"pending"===e.state.status);return!i||i===e}}runNext(e){let t=d(e);if("string"!=typeof t)return Promise.resolve();{let s=this.#s.get(t)?.find(t=>t!==e&&t.state.isPaused);return s?.continue()??Promise.resolve()}}clear(){o.jG.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#s.clear()})}getAll(){return Array.from(this.#t)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,a.nJ)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,a.nJ)(e,t))}notify(e){o.jG.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return o.jG.batch(()=>Promise.all(e.map(e=>e.continue().catch(a.lQ))))}};function d(e){return e.options.scope?.id}var f=s(28700),p=s(69715);function y(e){return{onFetch:(t,s)=>{let i=t.options,r=t.fetchOptions?.meta?.fetchMore?.direction,n=t.state.data?.pages||[],o=t.state.data?.pageParams||[],u={pages:[],pageParams:[]},l=0,h=async()=>{let s=!1,h=(0,a.ZM)(t.options,t.fetchOptions),c=async(e,i,r)=>{if(s)return Promise.reject();if(null==i&&e.pages.length)return Promise.resolve(e);let n=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:i,direction:r?"backward":"forward",meta:t.options.meta};return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(t.signal.aborted?s=!0:t.signal.addEventListener("abort",()=>{s=!0}),t.signal)}),e})(),o=await h(n),{maxPages:u}=t.options,l=r?a.ZZ:a.y9;return{pages:l(e.pages,o,u),pageParams:l(e.pageParams,i,u)}};if(r&&n.length){let e="backward"===r,t={pages:n,pageParams:o},s=(e?function(e,{pages:t,pageParams:s}){return t.length>0?e.getPreviousPageParam?.(t[0],t,s[0],s):void 0}:m)(i,t);u=await c(t,s,e)}else{let t=e??n.length;do{let e=0===l?o[0]??i.initialPageParam:m(i,u);if(l>0&&null==e)break;u=await c(u,e),l++}while(l<t)}return u};t.options.persister?t.fetchFn=()=>t.options.persister?.(h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s):t.fetchFn=h}}}function m(e,{pages:t,pageParams:s}){let i=t.length-1;return t.length>0?e.getNextPageParam(t[i],t,s[i],s):void 0}let g=new class{#r;#a;#n;#o;#u;#l;#h;#c;constructor(e={}){this.#r=e.queryCache||new l,this.#a=e.mutationCache||new c,this.#n=e.defaultOptions||{},this.#o=new Map,this.#u=new Map,this.#l=0}mount(){this.#l++,1===this.#l&&(this.#h=f.m.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#r.onFocus())}),this.#c=p.t.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#r.onOnline())}))}unmount(){this.#l--,0===this.#l&&(this.#h?.(),this.#h=void 0,this.#c?.(),this.#c=void 0)}isFetching(e){return this.#r.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#a.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#r.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),s=this.#r.build(this,t),i=s.state.data;return void 0===i?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime((0,a.d2)(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return this.#r.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,s){let i=this.defaultQueryOptions({queryKey:e}),r=this.#r.get(i.queryHash),n=r?.state.data,o=(0,a.Zw)(t,n);if(void 0!==o)return this.#r.build(this,i).setData(o,{...s,manual:!0})}setQueriesData(e,t,s){return o.jG.batch(()=>this.#r.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,s)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#r.get(t.queryHash)?.state}removeQueries(e){let t=this.#r;o.jG.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let s=this.#r;return o.jG.batch(()=>(s.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){let s={revert:!0,...t};return Promise.all(o.jG.batch(()=>this.#r.findAll(e).map(e=>e.cancel(s)))).then(a.lQ).catch(a.lQ)}invalidateQueries(e,t={}){return o.jG.batch(()=>(this.#r.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,t={}){let s={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(o.jG.batch(()=>this.#r.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,s);return s.throwOnError||(t=t.catch(a.lQ)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(a.lQ)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let s=this.#r.build(this,t);return s.isStaleByTime((0,a.d2)(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(a.lQ).catch(a.lQ)}fetchInfiniteQuery(e){return e.behavior=y(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(a.lQ).catch(a.lQ)}ensureInfiniteQueryData(e){return e.behavior=y(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return p.t.isOnline()?this.#a.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#r}getMutationCache(){return this.#a}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#o.set((0,a.EN)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#o.values()],s={};return t.forEach(t=>{(0,a.Cp)(e,t.queryKey)&&Object.assign(s,t.defaultOptions)}),s}setMutationDefaults(e,t){this.#u.set((0,a.EN)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#u.values()],s={};return t.forEach(t=>{(0,a.Cp)(e,t.mutationKey)&&Object.assign(s,t.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,a.F$)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===a.hT&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#r.clear(),this.#a.clear()}}({defaultOptions:{queries:{refetchOnWindowFocus:!0,refetchInterval:3e5,retry:!1}}}),v=e=>{let{children:t}=e;return(0,i.jsx)(r.Ht,{client:g,children:t})}},6415:()=>{},8022:(e,t,s)=>{"use strict";s.d(t,{ServerEventsProvider:()=>l});var i=s(89835),r=s(13881),a=s(55931),n=s(53630);let o=e=>e.split("\n\n").filter(e=>e.length>0).map(e=>(e=>{let t=e.split("\n"),s=t.findIndex(e=>e.startsWith("event:")),i=t.findIndex(e=>e.startsWith("data:")),r=t.findIndex(e=>e.startsWith("id:")),a=e=>Math.min(...[s,i,r,t.length].filter(t=>t>e));if(-1===s||-1===i||-1===r)throw console.error("failed",e),Error("Failed to parse SSE event");let n=t.slice(s,a(s)).join("\n"),o=t.slice(i,a(i)).join("\n");return{id:t.slice(r,a(r)).join("\n").slice(3).trim(),event:n.slice(6).trim(),data:JSON.parse(o.slice(o.indexOf("{"),o.indexOf("}")+1))}})(e)),u=!1;function l(e){let{children:t}=e,s=(0,r.jE)(),l=(0,a.useCallback)(async()=>{var e;console.log("listening to events");let t=await n.s.api.events.state_changes.$get();if(!t.ok)throw Error("Failed to fetch events");let i=null==(e=t.body)?void 0:e.getReader();if(!i)throw Error("Failed to get reader");let r=new TextDecoder;for(;;){let{done:e,value:t}=await i.read();if(e)break;for(let e of o(r.decode(t)))console.log("data",e),"project_changed"===e.data.type&&(console.log("invalidating projects"),await s.invalidateQueries({queryKey:["projects"]})),"session_changed"===e.data.type&&(console.log("invalidating sessions"),await s.invalidateQueries({queryKey:["sessions"]}))}},[s]);return(0,a.useEffect)(()=>{!1===u&&l().then(()=>{console.log("registered events listener"),u=!0}).catch(e=>{console.error("failed to register events listener",e),u=!0})},[l]),(0,i.jsx)(i.Fragment,{children:t})}},36036:(e,t,s)=>{Promise.resolve().then(s.t.bind(s,91198,23)),Promise.resolve().then(s.t.bind(s,65866,23)),Promise.resolve().then(s.bind(s,47055)),Promise.resolve().then(s.bind(s,8022)),Promise.resolve().then(s.t.bind(s,6415,23)),Promise.resolve().then(s.bind(s,207))},47055:(e,t,s)=>{"use strict";s.d(t,{RootErrorBoundary:()=>u});var i=s(89835),r=s(55931);let a=(0,r.createContext)(null),n={didCatch:!1,error:null};class o extends r.Component{static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){let{error:e}=this.state;if(null!==e){for(var t,s,i=arguments.length,r=Array(i),a=0;a<i;a++)r[a]=arguments[a];null==(t=(s=this.props).onReset)||t.call(s,{args:r,reason:"imperative-api"}),this.setState(n)}}componentDidCatch(e,t){var s,i;null==(s=(i=this.props).onError)||s.call(i,e,t)}componentDidUpdate(e,t){let{didCatch:s}=this.state,{resetKeys:i}=this.props;if(s&&null!==t.error&&function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length!==t.length||e.some((e,s)=>!Object.is(e,t[s]))}(e.resetKeys,i)){var r,a;null==(r=(a=this.props).onReset)||r.call(a,{next:i,prev:e.resetKeys,reason:"keys"}),this.setState(n)}}render(){let{children:e,fallbackRender:t,FallbackComponent:s,fallback:i}=this.props,{didCatch:n,error:o}=this.state,u=e;if(n){let e={error:o,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof t)u=t(e);else if(s)u=(0,r.createElement)(s,e);else if(void 0!==i)u=i;else throw o}return(0,r.createElement)(a.Provider,{value:{didCatch:n,error:o,resetErrorBoundary:this.resetErrorBoundary}},u)}constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=n}}let u=e=>{let{children:t}=e;return(0,i.jsx)(o,{FallbackComponent:e=>{let{error:t}=e;return(0,i.jsxs)("div",{children:[(0,i.jsx)("h1",{children:"Error"}),(0,i.jsx)("p",{children:t.message})]})},children:t})}},53630:(e,t,s)=>{"use strict";s.d(t,{s:()=>i});let i=(0,s(74865).hc)("/")},65866:e=>{e.exports={style:{fontFamily:"'Geist Mono', 'Geist Mono Fallback'",fontStyle:"normal"},className:"__className_9a8899",variable:"__variable_9a8899"}},91198:e=>{e.exports={style:{fontFamily:"'Geist', 'Geist Fallback'",fontStyle:"normal"},className:"__className_5cfdac",variable:"__variable_5cfdac"}},94828:(e,t,s)=>{"use strict";s.d(t,{$:()=>o,s:()=>n});var i=s(43409),r=s(92160),a=s(77628),n=class extends r.k{#d;#a;#f;constructor(e){super(),this.mutationId=e.mutationId,this.#a=e.mutationCache,this.#d=[],this.state=e.state||o(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#d.includes(e)||(this.#d.push(e),this.clearGcTimeout(),this.#a.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#d=this.#d.filter(t=>t!==e),this.scheduleGc(),this.#a.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#d.length||("pending"===this.state.status?this.scheduleGc():this.#a.remove(this))}continue(){return this.#f?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#p({type:"continue"})};this.#f=(0,a.II)({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#p({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#p({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#a.canRun(this)});let s="pending"===this.state.status,i=!this.#f.canStart();try{if(s)t();else{this.#p({type:"pending",variables:e,isPaused:i}),await this.#a.config.onMutate?.(e,this);let t=await this.options.onMutate?.(e);t!==this.state.context&&this.#p({type:"pending",context:t,variables:e,isPaused:i})}let r=await this.#f.start();return await this.#a.config.onSuccess?.(r,e,this.state.context,this),await this.options.onSuccess?.(r,e,this.state.context),await this.#a.config.onSettled?.(r,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(r,null,e,this.state.context),this.#p({type:"success",data:r}),r}catch(t){try{throw await this.#a.config.onError?.(t,e,this.state.context,this),await this.options.onError?.(t,e,this.state.context),await this.#a.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,t,e,this.state.context),t}finally{this.#p({type:"error",error:t})}}finally{this.#a.runNext(this)}}#p(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),i.jG.batch(()=>{this.#d.forEach(t=>{t.onMutationUpdate(e)}),this.#a.notify({mutation:this,type:"updated",action:e})})}};function o(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}}},e=>{e.O(0,[350,449,900,341,358],()=>e(e.s=36036)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[177],{6415:()=>{},8022:(e,t,s)=>{"use strict";s.d(t,{ServerEventsProvider:()=>o});var r=s(89835),i=s(13881),n=s(55931),a=s(53630);let u=e=>e.split("\n\n").filter(e=>e.length>0).map(e=>(e=>{let t=e.split("\n"),s=t.findIndex(e=>e.startsWith("event:")),r=t.findIndex(e=>e.startsWith("data:")),i=t.findIndex(e=>e.startsWith("id:")),n=e=>Math.min(...[s,r,i,t.length].filter(t=>t>e));if(-1===s||-1===r||-1===i)throw console.error("failed",e),Error("Failed to parse SSE event");let a=t.slice(s,n(s)).join("\n"),u=t.slice(r,n(r)).join("\n");return{id:t.slice(i,n(i)).join("\n").slice(3).trim(),event:a.slice(6).trim(),data:JSON.parse(u.slice(u.indexOf("{"),u.indexOf("}")+1))}})(e)),l=!1;function o(e){let{children:t}=e,s=(0,i.useQueryClient)(),o=(0,n.useCallback)(async()=>{var e;console.log("listening to events");let t=await a.s.api.events.state_changes.$get();if(!t.ok)throw Error("Failed to fetch events");let r=null==(e=t.body)?void 0:e.getReader();if(!r)throw Error("Failed to get reader");let i=new TextDecoder;for(;;){let{done:e,value:t}=await r.read();if(e)break;for(let e of u(i.decode(t)))console.log("data",e),"project_changed"===e.data.type&&(console.log("invalidating projects"),await s.invalidateQueries({queryKey:["projects"]})),"session_changed"===e.data.type&&(console.log("invalidating sessions"),await s.invalidateQueries({queryKey:["sessions"]}))}},[s]);return(0,n.useEffect)(()=>{!1===l&&o().then(()=>{console.log("registered events listener"),l=!0}).catch(e=>{console.error("failed to register events listener",e),l=!0})},[o]),(0,r.jsx)(r.Fragment,{children:t})}},36036:(e,t,s)=>{Promise.resolve().then(s.t.bind(s,91198,23)),Promise.resolve().then(s.t.bind(s,65866,23)),Promise.resolve().then(s.bind(s,47055)),Promise.resolve().then(s.bind(s,8022)),Promise.resolve().then(s.t.bind(s,6415,23)),Promise.resolve().then(s.bind(s,83972))},47055:(e,t,s)=>{"use strict";s.d(t,{RootErrorBoundary:()=>l});var r=s(89835),i=s(55931);let n=(0,i.createContext)(null),a={didCatch:!1,error:null};class u extends i.Component{static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){let{error:e}=this.state;if(null!==e){for(var t,s,r=arguments.length,i=Array(r),n=0;n<r;n++)i[n]=arguments[n];null==(t=(s=this.props).onReset)||t.call(s,{args:i,reason:"imperative-api"}),this.setState(a)}}componentDidCatch(e,t){var s,r;null==(s=(r=this.props).onError)||s.call(r,e,t)}componentDidUpdate(e,t){let{didCatch:s}=this.state,{resetKeys:r}=this.props;if(s&&null!==t.error&&function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length!==t.length||e.some((e,s)=>!Object.is(e,t[s]))}(e.resetKeys,r)){var i,n;null==(i=(n=this.props).onReset)||i.call(n,{next:r,prev:e.resetKeys,reason:"keys"}),this.setState(a)}}render(){let{children:e,fallbackRender:t,FallbackComponent:s,fallback:r}=this.props,{didCatch:a,error:u}=this.state,l=e;if(a){let e={error:u,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof t)l=t(e);else if(s)l=(0,i.createElement)(s,e);else if(void 0!==r)l=r;else throw u}return(0,i.createElement)(n.Provider,{value:{didCatch:a,error:u,resetErrorBoundary:this.resetErrorBoundary}},l)}constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=a}}let l=e=>{let{children:t}=e;return(0,r.jsx)(u,{FallbackComponent:e=>{let{error:t}=e;return(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{children:"Error"}),(0,r.jsx)("p",{children:t.message})]})},children:t})}},53630:(e,t,s)=>{"use strict";s.d(t,{s:()=>r});let r=(0,s(74865).hc)("/")},65866:e=>{e.exports={style:{fontFamily:"'Geist Mono', 'Geist Mono Fallback'",fontStyle:"normal"},className:"__className_9a8899",variable:"__variable_9a8899"}},83972:(e,t,s)=>{"use strict";let r;s.d(t,{QueryClientProviderWrapper:()=>b});var i=s(89835),n=s(18832),a=s(94081),u=s(43409),l=s(36906),o=class extends l.Q{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,s){let r=t.queryKey,i=t.queryHash??(0,n.F$)(r,t),u=this.get(i);return u||(u=new a.X({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:s,defaultOptions:e.getQueryDefaults(r)}),this.add(u)),u}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){u.jG.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,n.MK)(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,n.MK)(e,t)):t}notify(e){u.jG.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){u.jG.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){u.jG.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},h=s(94828),c=class extends l.Q{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#s=new Map,this.#r=0}#t;#s;#r;build(e,t,s){let r=new h.s({mutationCache:this,mutationId:++this.#r,options:e.defaultMutationOptions(t),state:s});return this.add(r),r}add(e){this.#t.add(e);let t=d(e);if("string"==typeof t){let s=this.#s.get(t);s?s.push(e):this.#s.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){let t=d(e);if("string"==typeof t){let s=this.#s.get(t);if(s)if(s.length>1){let t=s.indexOf(e);-1!==t&&s.splice(t,1)}else s[0]===e&&this.#s.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=d(e);if("string"!=typeof t)return!0;{let s=this.#s.get(t),r=s?.find(e=>"pending"===e.state.status);return!r||r===e}}runNext(e){let t=d(e);if("string"!=typeof t)return Promise.resolve();{let s=this.#s.get(t)?.find(t=>t!==e&&t.state.isPaused);return s?.continue()??Promise.resolve()}}clear(){u.jG.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#s.clear()})}getAll(){return Array.from(this.#t)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,n.nJ)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,n.nJ)(e,t))}notify(e){u.jG.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return u.jG.batch(()=>Promise.all(e.map(e=>e.continue().catch(n.lQ))))}};function d(e){return e.options.scope?.id}var f=s(28700),y=s(69715),p=s(10215),m=class{#i;#n;#a;#u;#l;#o;#h;#c;constructor(e={}){this.#i=e.queryCache||new o,this.#n=e.mutationCache||new c,this.#a=e.defaultOptions||{},this.#u=new Map,this.#l=new Map,this.#o=0}mount(){this.#o++,1===this.#o&&(this.#h=f.m.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#i.onFocus())}),this.#c=y.t.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#i.onOnline())}))}unmount(){this.#o--,0===this.#o&&(this.#h?.(),this.#h=void 0,this.#c?.(),this.#c=void 0)}isFetching(e){return this.#i.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#n.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#i.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),s=this.#i.build(this,t),r=s.state.data;return void 0===r?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime((0,n.d2)(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#i.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,s){let r=this.defaultQueryOptions({queryKey:e}),i=this.#i.get(r.queryHash),a=i?.state.data,u=(0,n.Zw)(t,a);if(void 0!==u)return this.#i.build(this,r).setData(u,{...s,manual:!0})}setQueriesData(e,t,s){return u.jG.batch(()=>this.#i.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,s)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#i.get(t.queryHash)?.state}removeQueries(e){let t=this.#i;u.jG.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let s=this.#i;return u.jG.batch(()=>(s.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){let s={revert:!0,...t};return Promise.all(u.jG.batch(()=>this.#i.findAll(e).map(e=>e.cancel(s)))).then(n.lQ).catch(n.lQ)}invalidateQueries(e,t={}){return u.jG.batch(()=>(this.#i.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,t={}){let s={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(u.jG.batch(()=>this.#i.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,s);return s.throwOnError||(t=t.catch(n.lQ)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(n.lQ)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let s=this.#i.build(this,t);return s.isStaleByTime((0,n.d2)(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(n.lQ).catch(n.lQ)}fetchInfiniteQuery(e){return e.behavior=(0,p.PL)(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(n.lQ).catch(n.lQ)}ensureInfiniteQueryData(e){return e.behavior=(0,p.PL)(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return y.t.isOnline()?this.#n.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#i}getMutationCache(){return this.#n}getDefaultOptions(){return this.#a}setDefaultOptions(e){this.#a=e}setQueryDefaults(e,t){this.#u.set((0,n.EN)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#u.values()],s={};return t.forEach(t=>{(0,n.Cp)(e,t.queryKey)&&Object.assign(s,t.defaultOptions)}),s}setMutationDefaults(e,t){this.#l.set((0,n.EN)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#l.values()],s={};return t.forEach(t=>{(0,n.Cp)(e,t.mutationKey)&&Object.assign(s,t.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#a.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,n.F$)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===n.hT&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#a.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#i.clear(),this.#n.clear()}},v=s(13881);let g=()=>new m({defaultOptions:{queries:{refetchOnWindowFocus:!0,refetchInterval:3e5,retry:!1}}}),b=e=>{let{children:t}=e,s=n.S$?g():(null!=r||(r=g()),r);return(0,i.jsx)(v.QueryClientProvider,{client:s,children:t})}},91198:e=>{e.exports={style:{fontFamily:"'Geist', 'Geist Fallback'",fontStyle:"normal"},className:"__className_5cfdac",variable:"__variable_5cfdac"}}},e=>{e.O(0,[350,412,900,341,358],()=>e(e.s=36036)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[177],{6415:()=>{},8022:(e,t,s)=>{"use strict";s.d(t,{ServerEventsProvider:()=>d});var r=s(89835),i=s(13881),n=s(27608),a=s(55931),u=s(89854),o=s(15915),l=s(53630);let h=e=>e.split("\n\n").filter(e=>e.length>0).map(e=>(e=>{let t=e.split("\n"),s=t.findIndex(e=>e.startsWith("event:")),r=t.findIndex(e=>e.startsWith("data:")),i=t.findIndex(e=>e.startsWith("id:")),n=e=>Math.min(...[s,r,i,t.length].filter(t=>t>e));if(-1===s||-1===r||-1===i)throw console.error("failed",e),Error("Failed to parse SSE event");let a=t.slice(s,n(s)).join("\n"),u=t.slice(r,n(r)).join("\n");return{id:t.slice(i,n(i)).join("\n").slice(3).trim(),event:a.slice(6).trim(),data:JSON.parse(u.slice(u.indexOf("{"),u.lastIndexOf("}")+1))}})(e)),c=!1;function d(e){let{children:t}=e,s=(0,i.useQueryClient)(),d=(0,n.Xr)(u.r),f=(0,a.useCallback)(async()=>{var e;console.log("listening to events");let t=await l.s.api.events.state_changes.$get();if(!t.ok)throw Error("Failed to fetch events");let r=null==(e=t.body)?void 0:e.getReader();if(!r)throw Error("Failed to get reader");let i=new TextDecoder;for(;;){let{done:e,value:t}=await r.read();if(e)break;for(let e of h(i.decode(t)))console.log("data",e),"project_changed"===e.data.type&&await s.invalidateQueries({queryKey:o._.queryKey}),"session_changed"===e.data.type&&await s.invalidateQueries({queryKey:["sessions"]}),"task_changed"===e.data.type&&d(e.data.data)}},[s,d]);return(0,a.useEffect)(()=>{!1===c&&f().then(()=>{console.log("registered events listener"),c=!0}).catch(e=>{console.error("failed to register events listener",e),c=!0})},[f]),(0,r.jsx)(r.Fragment,{children:t})}},15915:(e,t,s)=>{"use strict";s.d(t,{Y:()=>a,_:()=>n});var r=s(45320),i=s(53630);let n={queryKey:["projects"],queryFn:async()=>{let e=await i.s.api.projects.$get(),{projects:t}=await e.json();return t}},a=()=>(0,r.useSuspenseQuery)({queryKey:n.queryKey,queryFn:n.queryFn})},47055:(e,t,s)=>{"use strict";s.d(t,{RootErrorBoundary:()=>o});var r=s(89835),i=s(55931);let n=(0,i.createContext)(null),a={didCatch:!1,error:null};class u extends i.Component{static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){let{error:e}=this.state;if(null!==e){for(var t,s,r=arguments.length,i=Array(r),n=0;n<r;n++)i[n]=arguments[n];null==(t=(s=this.props).onReset)||t.call(s,{args:i,reason:"imperative-api"}),this.setState(a)}}componentDidCatch(e,t){var s,r;null==(s=(r=this.props).onError)||s.call(r,e,t)}componentDidUpdate(e,t){let{didCatch:s}=this.state,{resetKeys:r}=this.props;if(s&&null!==t.error&&function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length!==t.length||e.some((e,s)=>!Object.is(e,t[s]))}(e.resetKeys,r)){var i,n;null==(i=(n=this.props).onReset)||i.call(n,{next:r,prev:e.resetKeys,reason:"keys"}),this.setState(a)}}render(){let{children:e,fallbackRender:t,FallbackComponent:s,fallback:r}=this.props,{didCatch:a,error:u}=this.state,o=e;if(a){let e={error:u,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof t)o=t(e);else if(s)o=(0,i.createElement)(s,e);else if(void 0!==r)o=r;else throw u}return(0,i.createElement)(n.Provider,{value:{didCatch:a,error:u,resetErrorBoundary:this.resetErrorBoundary}},o)}constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=a}}let o=e=>{let{children:t}=e;return(0,r.jsx)(u,{FallbackComponent:e=>{let{error:t}=e;return(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{children:"Error"}),(0,r.jsx)("p",{children:t.message})]})},children:t})}},53630:(e,t,s)=>{"use strict";s.d(t,{s:()=>r});let r=(0,s(74865).hc)("/")},65866:e=>{e.exports={style:{fontFamily:"'Geist Mono', 'Geist Mono Fallback'",fontStyle:"normal"},className:"__className_9a8899",variable:"__variable_9a8899"}},79420:(e,t,s)=>{Promise.resolve().then(s.bind(s,98613)),Promise.resolve().then(s.bind(s,72611)),Promise.resolve().then(s.bind(s,13881)),Promise.resolve().then(s.bind(s,85452)),Promise.resolve().then(s.bind(s,120)),Promise.resolve().then(s.bind(s,27740)),Promise.resolve().then(s.bind(s,59054)),Promise.resolve().then(s.bind(s,8120)),Promise.resolve().then(s.bind(s,9161)),Promise.resolve().then(s.bind(s,63812)),Promise.resolve().then(s.bind(s,86260)),Promise.resolve().then(s.bind(s,15312)),Promise.resolve().then(s.bind(s,45320)),Promise.resolve().then(s.t.bind(s,91198,23)),Promise.resolve().then(s.t.bind(s,65866,23)),Promise.resolve().then(s.bind(s,47055)),Promise.resolve().then(s.bind(s,8022)),Promise.resolve().then(s.t.bind(s,6415,23)),Promise.resolve().then(s.bind(s,83972))},83972:(e,t,s)=>{"use strict";let r;s.d(t,{QueryClientProviderWrapper:()=>g});var i=s(89835),n=s(18832),a=s(94081),u=s(43409),o=s(36906),l=class extends o.Q{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,s){let r=t.queryKey,i=t.queryHash??(0,n.F$)(r,t),u=this.get(i);return u||(u=new a.X({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:s,defaultOptions:e.getQueryDefaults(r)}),this.add(u)),u}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){u.jG.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,n.MK)(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,n.MK)(e,t)):t}notify(e){u.jG.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){u.jG.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){u.jG.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},h=s(94828),c=class extends o.Q{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#s=new Map,this.#r=0}#t;#s;#r;build(e,t,s){let r=new h.s({mutationCache:this,mutationId:++this.#r,options:e.defaultMutationOptions(t),state:s});return this.add(r),r}add(e){this.#t.add(e);let t=d(e);if("string"==typeof t){let s=this.#s.get(t);s?s.push(e):this.#s.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){let t=d(e);if("string"==typeof t){let s=this.#s.get(t);if(s)if(s.length>1){let t=s.indexOf(e);-1!==t&&s.splice(t,1)}else s[0]===e&&this.#s.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=d(e);if("string"!=typeof t)return!0;{let s=this.#s.get(t),r=s?.find(e=>"pending"===e.state.status);return!r||r===e}}runNext(e){let t=d(e);if("string"!=typeof t)return Promise.resolve();{let s=this.#s.get(t)?.find(t=>t!==e&&t.state.isPaused);return s?.continue()??Promise.resolve()}}clear(){u.jG.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#s.clear()})}getAll(){return Array.from(this.#t)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,n.nJ)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,n.nJ)(e,t))}notify(e){u.jG.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return u.jG.batch(()=>Promise.all(e.map(e=>e.continue().catch(n.lQ))))}};function d(e){return e.options.scope?.id}var f=s(28700),y=s(69715),p=s(10215),m=class{#i;#n;#a;#u;#o;#l;#h;#c;constructor(e={}){this.#i=e.queryCache||new l,this.#n=e.mutationCache||new c,this.#a=e.defaultOptions||{},this.#u=new Map,this.#o=new Map,this.#l=0}mount(){this.#l++,1===this.#l&&(this.#h=f.m.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#i.onFocus())}),this.#c=y.t.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#i.onOnline())}))}unmount(){this.#l--,0===this.#l&&(this.#h?.(),this.#h=void 0,this.#c?.(),this.#c=void 0)}isFetching(e){return this.#i.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#n.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#i.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),s=this.#i.build(this,t),r=s.state.data;return void 0===r?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime((0,n.d2)(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#i.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,s){let r=this.defaultQueryOptions({queryKey:e}),i=this.#i.get(r.queryHash),a=i?.state.data,u=(0,n.Zw)(t,a);if(void 0!==u)return this.#i.build(this,r).setData(u,{...s,manual:!0})}setQueriesData(e,t,s){return u.jG.batch(()=>this.#i.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,s)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#i.get(t.queryHash)?.state}removeQueries(e){let t=this.#i;u.jG.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let s=this.#i;return u.jG.batch(()=>(s.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){let s={revert:!0,...t};return Promise.all(u.jG.batch(()=>this.#i.findAll(e).map(e=>e.cancel(s)))).then(n.lQ).catch(n.lQ)}invalidateQueries(e,t={}){return u.jG.batch(()=>(this.#i.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,t={}){let s={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(u.jG.batch(()=>this.#i.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,s);return s.throwOnError||(t=t.catch(n.lQ)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(n.lQ)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let s=this.#i.build(this,t);return s.isStaleByTime((0,n.d2)(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(n.lQ).catch(n.lQ)}fetchInfiniteQuery(e){return e.behavior=(0,p.PL)(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(n.lQ).catch(n.lQ)}ensureInfiniteQueryData(e){return e.behavior=(0,p.PL)(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return y.t.isOnline()?this.#n.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#i}getMutationCache(){return this.#n}getDefaultOptions(){return this.#a}setDefaultOptions(e){this.#a=e}setQueryDefaults(e,t){this.#u.set((0,n.EN)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#u.values()],s={};return t.forEach(t=>{(0,n.Cp)(e,t.queryKey)&&Object.assign(s,t.defaultOptions)}),s}setMutationDefaults(e,t){this.#o.set((0,n.EN)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#o.values()],s={};return t.forEach(t=>{(0,n.Cp)(e,t.mutationKey)&&Object.assign(s,t.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#a.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,n.F$)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===n.hT&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#a.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#i.clear(),this.#n.clear()}},v=s(13881);let b=()=>new m({defaultOptions:{queries:{refetchOnWindowFocus:!0,refetchInterval:3e5,retry:!1}}}),g=e=>{let{children:t}=e,s=n.S$?b():(null!=r||(r=b()),r);return(0,i.jsx)(v.QueryClientProvider,{client:s,children:t})}},89854:(e,t,s)=>{"use strict";s.d(t,{r:()=>r});let r=(0,s(48304).eU)([])},91198:e=>{e.exports={style:{fontFamily:"'Geist', 'Geist Fallback'",fontStyle:"normal"},className:"__className_5cfdac",variable:"__variable_5cfdac"}}},e=>{e.O(0,[350,33,608,900,341,358],()=>e(e.s=79420)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[332],{17352:(e,s,t)=>{Promise.resolve().then(t.bind(t,98613)),Promise.resolve().then(t.bind(t,72611)),Promise.resolve().then(t.bind(t,13881)),Promise.resolve().then(t.bind(t,85452)),Promise.resolve().then(t.bind(t,120)),Promise.resolve().then(t.bind(t,27740)),Promise.resolve().then(t.bind(t,59054)),Promise.resolve().then(t.bind(t,8120)),Promise.resolve().then(t.bind(t,9161)),Promise.resolve().then(t.bind(t,63812)),Promise.resolve().then(t.bind(t,86260)),Promise.resolve().then(t.bind(t,15312)),Promise.resolve().then(t.bind(t,45320)),Promise.resolve().then(t.bind(t,88747))},65492:(e,s,t)=>{"use strict";t.d(s,{A:()=>r});let r=(0,t(92398).A)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]])},88747:(e,s,t)=>{"use strict";t.d(s,{ProjectPageContent:()=>U});var r=t(89835),n=t(13881),a=t(50417),i=t(65492),o=t(62520),l=t(26057),d=t(75123),c=t.n(d),u=t(55931),m=t(80942),h=t(75284),x=t(90229),f=t(89379),p=t(3908),b=t(32056),v=t(6806),j=t(71637),g=t(78837),y="Checkbox",[N,k]=(0,f.A)(y),[w,C]=N(y);function P(e){let{__scopeCheckbox:s,checked:t,children:n,defaultChecked:a,disabled:i,form:o,name:l,onCheckedChange:d,required:c,value:m="on",internal_do_not_use_render:h}=e,[x,f]=(0,b.i)({prop:t,defaultProp:null!=a&&a,onChange:d,caller:y}),[p,v]=u.useState(null),[j,g]=u.useState(null),N=u.useRef(!1),k=!p||!!o||!!p.closest("form"),C={checked:x,disabled:i,setChecked:f,control:p,setControl:v,name:l,form:o,value:m,hasConsumerStoppedPropagationRef:N,required:c,defaultChecked:!q(a)&&a,isFormControl:k,bubbleInput:j,setBubbleInput:g};return(0,r.jsx)(w,{scope:s,...C,children:"function"==typeof h?h(C):n})}var S="CheckboxTrigger",A=u.forwardRef((e,s)=>{let{__scopeCheckbox:t,onKeyDown:n,onClick:a,...i}=e,{control:o,value:l,disabled:d,checked:c,required:m,setControl:h,setChecked:f,hasConsumerStoppedPropagationRef:b,isFormControl:v,bubbleInput:j}=C(S,t),y=(0,x.s)(s,h),N=u.useRef(c);return u.useEffect(()=>{let e=null==o?void 0:o.form;if(e){let s=()=>f(N.current);return e.addEventListener("reset",s),()=>e.removeEventListener("reset",s)}},[o,f]),(0,r.jsx)(g.sG.button,{type:"button",role:"checkbox","aria-checked":q(c)?"mixed":c,"aria-required":m,"data-state":z(c),"data-disabled":d?"":void 0,disabled:d,value:l,...i,ref:y,onKeyDown:(0,p.mK)(n,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:(0,p.mK)(a,e=>{f(e=>!!q(e)||!e),j&&v&&(b.current=e.isPropagationStopped(),b.current||e.stopPropagation())})})});A.displayName=S;var E=u.forwardRef((e,s)=>{let{__scopeCheckbox:t,name:n,checked:a,defaultChecked:i,required:o,disabled:l,value:d,onCheckedChange:c,form:u,...m}=e;return(0,r.jsx)(P,{__scopeCheckbox:t,checked:a,defaultChecked:i,disabled:l,required:o,onCheckedChange:c,name:n,form:u,value:d,internal_do_not_use_render:e=>{let{isFormControl:n}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(A,{...m,ref:s,__scopeCheckbox:t}),n&&(0,r.jsx)(_,{__scopeCheckbox:t})]})}})});E.displayName=y;var R="CheckboxIndicator",K=u.forwardRef((e,s)=>{let{__scopeCheckbox:t,forceMount:n,...a}=e,i=C(R,t);return(0,r.jsx)(j.C,{present:n||q(i.checked)||!0===i.checked,children:(0,r.jsx)(g.sG.span,{"data-state":z(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:s,style:{pointerEvents:"none",...e.style}})})});K.displayName=R;var M="CheckboxBubbleInput",_=u.forwardRef((e,s)=>{let{__scopeCheckbox:t,...n}=e,{control:a,hasConsumerStoppedPropagationRef:i,checked:o,defaultChecked:l,required:d,disabled:c,name:m,value:h,form:f,bubbleInput:p,setBubbleInput:b}=C(M,t),j=(0,x.s)(s,b),y=function(e){let s=u.useRef({value:e,previous:e});return u.useMemo(()=>(s.current.value!==e&&(s.current.previous=s.current.value,s.current.value=e),s.current.previous),[e])}(o),N=function(e){let[s,t]=u.useState(void 0);return(0,v.N)(()=>{if(e){t({width:e.offsetWidth,height:e.offsetHeight});let s=new ResizeObserver(s=>{let r,n;if(!Array.isArray(s)||!s.length)return;let a=s[0];if("borderBoxSize"in a){let e=a.borderBoxSize,s=Array.isArray(e)?e[0]:e;r=s.inlineSize,n=s.blockSize}else r=e.offsetWidth,n=e.offsetHeight;t({width:r,height:n})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}t(void 0)},[e]),s}(a);u.useEffect(()=>{if(!p)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,s=!i.current;if(y!==o&&e){let t=new Event("click",{bubbles:s});p.indeterminate=q(o),e.call(p,!q(o)&&o),p.dispatchEvent(t)}},[p,y,o,i]);let k=u.useRef(!q(o)&&o);return(0,r.jsx)(g.sG.input,{type:"checkbox","aria-hidden":!0,defaultChecked:null!=l?l:k.current,required:d,disabled:c,name:m,value:h,form:f,...n,tabIndex:-1,ref:j,style:{...n.style,...N,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});function q(e){return"indeterminate"===e}function z(e){return q(e)?"indeterminate":e?"checked":"unchecked"}_.displayName=M;var I=t(91260),B=t(18237);function F(e){let{className:s,...t}=e;return(0,r.jsx)(E,{"data-slot":"checkbox",className:(0,B.cn)("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",s),...t,children:(0,r.jsx)(K,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:(0,r.jsx)(I.A,{className:"size-3.5"})})})}var H=t(45320),Q=t(59054),L=t(53630);let O={queryKey:["config"],queryFn:async()=>{let e=await L.s.api.config.$get();return await e.json()}};var $=t(5685),D=t(72667),W=t(51290);let U=e=>{var s,t;let{projectId:d}=e,x=(0,u.useId)(),{data:{project:f,sessions:p}}=(0,$.B)(d),{config:b,updateConfig:v}=(()=>{let e=(0,n.useQueryClient)(),{data:s}=(0,H.useSuspenseQuery)({...O}),t=(0,Q.useMutation)({mutationFn:async e=>{let s=await L.s.api.config.$put({json:e});return await s.json()},onSuccess:()=>{e.invalidateQueries({queryKey:O.queryKey})}});return{config:null==s?void 0:s.config,updateConfig:(0,u.useCallback)(e=>{t.mutate(e)},[t])}})(),j=(0,n.useQueryClient)();return console.log("debug",b),(0,u.useEffect)(()=>{j.invalidateQueries({queryKey:(0,$.M)(d).queryKey})},[d,j.invalidateQueries]),(0,r.jsxs)("div",{className:"container mx-auto px-4 py-8",children:[(0,r.jsxs)("header",{className:"mb-8",children:[(0,r.jsx)(m.$,{asChild:!0,variant:"ghost",className:"mb-4",children:(0,r.jsxs)(c(),{href:"/projects",className:"flex items-center gap-2",children:[(0,r.jsx)(a.A,{className:"w-4 h-4"}),"Back to Projects"]})}),(0,r.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(i.A,{className:"w-6 h-6"}),(0,r.jsx)("h1",{className:"text-3xl font-bold",children:null!=(s=f.meta.projectPath)?s:f.claudeProjectPath})]}),(0,r.jsx)(W.c,{projectId:d,trigger:(0,r.jsxs)(m.$,{size:"lg",className:"gap-2",children:[(0,r.jsx)(o.A,{className:"w-5 h-5"}),"Start New Chat"]})})]}),(0,r.jsxs)("p",{className:"text-muted-foreground font-mono text-sm",children:["History File: ",null!=(t=f.claudeProjectPath)?t:"unknown"]})]}),(0,r.jsx)("main",{children:(0,r.jsxs)("section",{children:[(0,r.jsxs)("h2",{className:"text-xl font-semibold mb-4",children:["Conversation Sessions"," ",p.length>0?"(".concat(p.length,")"):""]}),(0,r.jsxs)("div",{className:"mb-6 p-4 bg-muted/50 rounded-lg",children:[(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(F,{id:x,checked:null==b?void 0:b.hideNoUserMessageSession,onCheckedChange:async()=>{v({...b,hideNoUserMessageSession:!(null==b?void 0:b.hideNoUserMessageSession)}),await j.invalidateQueries({queryKey:O.queryKey})}}),(0,r.jsx)("label",{htmlFor:x,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Hide sessions without user messages"})]}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground mt-1 ml-6",children:"Only show sessions that contain user commands or messages"})]}),0===p.length?(0,r.jsx)(h.Zp,{children:(0,r.jsxs)(h.Wu,{className:"flex flex-col items-center justify-center py-12",children:[(0,r.jsx)(l.A,{className:"w-12 h-12 text-muted-foreground mb-4"}),(0,r.jsx)("h3",{className:"text-lg font-medium mb-2",children:"No sessions found"}),(0,r.jsx)("p",{className:"text-muted-foreground text-center max-w-md mb-6",children:"No conversation sessions found for this project. Start a conversation with Claude Code in this project to create sessions."}),(0,r.jsx)(W.c,{projectId:d,trigger:(0,r.jsxs)(m.$,{size:"lg",className:"gap-2",children:[(0,r.jsx)(o.A,{className:"w-5 h-5"}),"Start First Chat"]})})]})}):(0,r.jsx)("div",{className:"grid gap-4 md:grid-cols-1 lg:grid-cols-1",children:p.map(e=>(0,r.jsxs)(h.Zp,{className:"hover:shadow-md transition-shadow",children:[(0,r.jsxs)(h.aR,{children:[(0,r.jsx)(h.ZB,{className:"flex items-center gap-2",children:(0,r.jsx)("span",{className:"break-all overflow-ellipsis line-clamp-2 text-xl",children:null!==e.meta.firstCommand?(0,D.H)(e.meta.firstCommand):e.id})}),(0,r.jsx)(h.BT,{className:"font-mono text-xs",children:e.id})]}),(0,r.jsxs)(h.Wu,{className:"space-y-2",children:[(0,r.jsxs)("p",{className:"text-sm text-muted-foreground",children:[e.meta.messageCount," messages"]}),(0,r.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Last modified:"," ",e.meta.lastModifiedAt?new Date(e.meta.lastModifiedAt).toLocaleDateString():""]}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground font-mono",children:e.jsonlFilePath})]}),(0,r.jsx)(h.Wu,{className:"pt-0",children:(0,r.jsx)(m.$,{asChild:!0,className:"w-full",children:(0,r.jsx)(c(),{href:"/projects/".concat(d,"/sessions/").concat(encodeURIComponent(e.id)),children:"View Session"})})})]},e.id))})]})})]})}}},e=>{e.O(0,[33,150,583,409,900,341,358],()=>e(e.s=17352)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[332],{17352:(e,s,t)=>{Promise.resolve().then(t.bind(t,98613)),Promise.resolve().then(t.bind(t,72611)),Promise.resolve().then(t.bind(t,13881)),Promise.resolve().then(t.bind(t,85452)),Promise.resolve().then(t.bind(t,120)),Promise.resolve().then(t.bind(t,27740)),Promise.resolve().then(t.bind(t,59054)),Promise.resolve().then(t.bind(t,8120)),Promise.resolve().then(t.bind(t,9161)),Promise.resolve().then(t.bind(t,63812)),Promise.resolve().then(t.bind(t,86260)),Promise.resolve().then(t.bind(t,15312)),Promise.resolve().then(t.bind(t,45320)),Promise.resolve().then(t.bind(t,88747))},65492:(e,s,t)=>{"use strict";t.d(s,{A:()=>r});let r=(0,t(92398).A)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]])},88747:(e,s,t)=>{"use strict";t.d(s,{ProjectPageContent:()=>D});var r=t(89835),n=t(13881),i=t(50417),a=t(65492),o=t(62520),l=t(26057),d=t(75123),c=t.n(d),u=t(55931),m=t(80942),h=t(75284),x=t(90229),f=t(89379),p=t(3908),v=t(32056),j=t(6806),b=t(71637),g=t(78837),y="Checkbox",[N,w]=(0,f.A)(y),[k,C]=N(y);function S(e){let{__scopeCheckbox:s,checked:t,children:n,defaultChecked:i,disabled:a,form:o,name:l,onCheckedChange:d,required:c,value:m="on",internal_do_not_use_render:h}=e,[x,f]=(0,v.i)({prop:t,defaultProp:null!=i&&i,onChange:d,caller:y}),[p,j]=u.useState(null),[b,g]=u.useState(null),N=u.useRef(!1),w=!p||!!o||!!p.closest("form"),C={checked:x,disabled:a,setChecked:f,control:p,setControl:j,name:l,form:o,value:m,hasConsumerStoppedPropagationRef:N,required:c,defaultChecked:!_(i)&&i,isFormControl:w,bubbleInput:b,setBubbleInput:g};return(0,r.jsx)(k,{scope:s,...C,children:"function"==typeof h?h(C):n})}var P="CheckboxTrigger",A=u.forwardRef((e,s)=>{let{__scopeCheckbox:t,onKeyDown:n,onClick:i,...a}=e,{control:o,value:l,disabled:d,checked:c,required:m,setControl:h,setChecked:f,hasConsumerStoppedPropagationRef:v,isFormControl:j,bubbleInput:b}=C(P,t),y=(0,x.s)(s,h),N=u.useRef(c);return u.useEffect(()=>{let e=null==o?void 0:o.form;if(e){let s=()=>f(N.current);return e.addEventListener("reset",s),()=>e.removeEventListener("reset",s)}},[o,f]),(0,r.jsx)(g.sG.button,{type:"button",role:"checkbox","aria-checked":_(c)?"mixed":c,"aria-required":m,"data-state":z(c),"data-disabled":d?"":void 0,disabled:d,value:l,...a,ref:y,onKeyDown:(0,p.mK)(n,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:(0,p.mK)(i,e=>{f(e=>!!_(e)||!e),b&&j&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})})});A.displayName=P;var E=u.forwardRef((e,s)=>{let{__scopeCheckbox:t,name:n,checked:i,defaultChecked:a,required:o,disabled:l,value:d,onCheckedChange:c,form:u,...m}=e;return(0,r.jsx)(S,{__scopeCheckbox:t,checked:i,defaultChecked:a,disabled:l,required:o,onCheckedChange:c,name:n,form:u,value:d,internal_do_not_use_render:e=>{let{isFormControl:n}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(A,{...m,ref:s,__scopeCheckbox:t}),n&&(0,r.jsx)(R,{__scopeCheckbox:t})]})}})});E.displayName=y;var K="CheckboxIndicator",q=u.forwardRef((e,s)=>{let{__scopeCheckbox:t,forceMount:n,...i}=e,a=C(K,t);return(0,r.jsx)(b.C,{present:n||_(a.checked)||!0===a.checked,children:(0,r.jsx)(g.sG.span,{"data-state":z(a.checked),"data-disabled":a.disabled?"":void 0,...i,ref:s,style:{pointerEvents:"none",...e.style}})})});q.displayName=K;var M="CheckboxBubbleInput",R=u.forwardRef((e,s)=>{let{__scopeCheckbox:t,...n}=e,{control:i,hasConsumerStoppedPropagationRef:a,checked:o,defaultChecked:l,required:d,disabled:c,name:m,value:h,form:f,bubbleInput:p,setBubbleInput:v}=C(M,t),b=(0,x.s)(s,v),y=function(e){let s=u.useRef({value:e,previous:e});return u.useMemo(()=>(s.current.value!==e&&(s.current.previous=s.current.value,s.current.value=e),s.current.previous),[e])}(o),N=function(e){let[s,t]=u.useState(void 0);return(0,j.N)(()=>{if(e){t({width:e.offsetWidth,height:e.offsetHeight});let s=new ResizeObserver(s=>{let r,n;if(!Array.isArray(s)||!s.length)return;let i=s[0];if("borderBoxSize"in i){let e=i.borderBoxSize,s=Array.isArray(e)?e[0]:e;r=s.inlineSize,n=s.blockSize}else r=e.offsetWidth,n=e.offsetHeight;t({width:r,height:n})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}t(void 0)},[e]),s}(i);u.useEffect(()=>{if(!p)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,s=!a.current;if(y!==o&&e){let t=new Event("click",{bubbles:s});p.indeterminate=_(o),e.call(p,!_(o)&&o),p.dispatchEvent(t)}},[p,y,o,a]);let w=u.useRef(!_(o)&&o);return(0,r.jsx)(g.sG.input,{type:"checkbox","aria-hidden":!0,defaultChecked:null!=l?l:w.current,required:d,disabled:c,name:m,value:h,form:f,...n,tabIndex:-1,ref:b,style:{...n.style,...N,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});function _(e){return"indeterminate"===e}function z(e){return _(e)?"indeterminate":e?"checked":"unchecked"}R.displayName=M;var F=t(91260),I=t(18237);function B(e){let{className:s,...t}=e;return(0,r.jsx)(E,{"data-slot":"checkbox",className:(0,I.cn)("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",s),...t,children:(0,r.jsx)(q,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:(0,r.jsx)(F.A,{className:"size-3.5"})})})}var H=t(45320),Q=t(59054),T=t(53630);let L={queryKey:["config"],queryFn:async()=>{let e=await T.s.api.config.$get();return await e.json()}};var O=t(5685),U=t(72667),$=t(51290);let D=e=>{var s,t;let{projectId:d}=e,x=(0,u.useId)(),{data:{project:f,sessions:p}}=(0,O.B)(d),{config:v,updateConfig:j}=(()=>{let e=(0,n.useQueryClient)(),{data:s}=(0,H.useSuspenseQuery)({...L}),t=(0,Q.useMutation)({mutationFn:async e=>{let s=await T.s.api.config.$put({json:e});return await s.json()},onSuccess:()=>{e.invalidateQueries({queryKey:L.queryKey})}});return{config:null==s?void 0:s.config,updateConfig:(0,u.useCallback)(e=>{t.mutate(e)},[t])}})(),b=(0,n.useQueryClient)();return(0,u.useEffect)(()=>{b.invalidateQueries({queryKey:(0,O.M)(d).queryKey})},[v.hideNoUserMessageSession,v.unifySameTitleSession]),(0,r.jsxs)("div",{className:"container mx-auto px-4 py-8",children:[(0,r.jsxs)("header",{className:"mb-8",children:[(0,r.jsx)(m.$,{asChild:!0,variant:"ghost",className:"mb-4",children:(0,r.jsxs)(c(),{href:"/projects",className:"flex items-center gap-2",children:[(0,r.jsx)(i.A,{className:"w-4 h-4"}),"Back to Projects"]})}),(0,r.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(a.A,{className:"w-6 h-6"}),(0,r.jsx)("h1",{className:"text-3xl font-bold",children:null!=(s=f.meta.projectPath)?s:f.claudeProjectPath})]}),(0,r.jsx)($.c,{projectId:d,trigger:(0,r.jsxs)(m.$,{size:"lg",className:"gap-2",children:[(0,r.jsx)(o.A,{className:"w-5 h-5"}),"Start New Chat"]})})]}),(0,r.jsxs)("p",{className:"text-muted-foreground font-mono text-sm",children:["History File: ",null!=(t=f.claudeProjectPath)?t:"unknown"]})]}),(0,r.jsx)("main",{children:(0,r.jsxs)("section",{children:[(0,r.jsxs)("h2",{className:"text-xl font-semibold mb-4",children:["Conversation Sessions"," ",p.length>0?"(".concat(p.length,")"):""]}),(0,r.jsxs)("div",{className:"mb-6 p-4 bg-muted/50 rounded-lg space-y-4",children:[(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(B,{id:x,checked:null==v?void 0:v.hideNoUserMessageSession,onCheckedChange:async()=>{j({...v,hideNoUserMessageSession:!(null==v?void 0:v.hideNoUserMessageSession)}),await b.invalidateQueries({queryKey:L.queryKey})}}),(0,r.jsx)("label",{htmlFor:x,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Hide sessions without user messages"})]}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground mt-1 ml-6",children:"Only show sessions that contain user commands or messages"}),(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(B,{id:"".concat(x,"-unify"),checked:null==v?void 0:v.unifySameTitleSession,onCheckedChange:async()=>{j({...v,unifySameTitleSession:!(null==v?void 0:v.unifySameTitleSession)}),await b.invalidateQueries({queryKey:L.queryKey})}}),(0,r.jsx)("label",{htmlFor:"".concat(x,"-unify"),className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Unify sessions with same title"})]}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground mt-1 ml-6",children:"Show only the latest session when multiple sessions have the same title"})]}),0===p.length?(0,r.jsx)(h.Zp,{children:(0,r.jsxs)(h.Wu,{className:"flex flex-col items-center justify-center py-12",children:[(0,r.jsx)(l.A,{className:"w-12 h-12 text-muted-foreground mb-4"}),(0,r.jsx)("h3",{className:"text-lg font-medium mb-2",children:"No sessions found"}),(0,r.jsx)("p",{className:"text-muted-foreground text-center max-w-md mb-6",children:"No conversation sessions found for this project. Start a conversation with Claude Code in this project to create sessions."}),(0,r.jsx)($.c,{projectId:d,trigger:(0,r.jsxs)(m.$,{size:"lg",className:"gap-2",children:[(0,r.jsx)(o.A,{className:"w-5 h-5"}),"Start First Chat"]})})]})}):(0,r.jsx)("div",{className:"grid gap-4 md:grid-cols-1 lg:grid-cols-1",children:p.map(e=>(0,r.jsxs)(h.Zp,{className:"hover:shadow-md transition-shadow",children:[(0,r.jsxs)(h.aR,{children:[(0,r.jsx)(h.ZB,{className:"flex items-center gap-2",children:(0,r.jsx)("span",{className:"break-all overflow-ellipsis line-clamp-2 text-xl",children:null!==e.meta.firstCommand?(0,U.H)(e.meta.firstCommand):e.id})}),(0,r.jsx)(h.BT,{className:"font-mono text-xs",children:e.id})]}),(0,r.jsxs)(h.Wu,{className:"space-y-2",children:[(0,r.jsxs)("p",{className:"text-sm text-muted-foreground",children:[e.meta.messageCount," messages"]}),(0,r.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Last modified:"," ",e.meta.lastModifiedAt?new Date(e.meta.lastModifiedAt).toLocaleDateString():""]}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground font-mono",children:e.jsonlFilePath})]}),(0,r.jsx)(h.Wu,{className:"pt-0",children:(0,r.jsx)(m.$,{asChild:!0,className:"w-full",children:(0,r.jsx)(c(),{href:"/projects/".concat(d,"/sessions/").concat(encodeURIComponent(e.id)),children:"View Session"})})})]},e.id))})]})})]})}}},e=>{e.O(0,[33,150,583,409,900,341,358],()=>e(e.s=17352)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[332],{17352:(e,s,t)=>{Promise.resolve().then(t.bind(t,98613)),Promise.resolve().then(t.bind(t,72611)),Promise.resolve().then(t.bind(t,13881)),Promise.resolve().then(t.bind(t,85452)),Promise.resolve().then(t.bind(t,120)),Promise.resolve().then(t.bind(t,27740)),Promise.resolve().then(t.bind(t,59054)),Promise.resolve().then(t.bind(t,8120)),Promise.resolve().then(t.bind(t,9161)),Promise.resolve().then(t.bind(t,63812)),Promise.resolve().then(t.bind(t,86260)),Promise.resolve().then(t.bind(t,15312)),Promise.resolve().then(t.bind(t,45320)),Promise.resolve().then(t.bind(t,88747))},65492:(e,s,t)=>{"use strict";t.d(s,{A:()=>r});let r=(0,t(92398).A)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]])},88747:(e,s,t)=>{"use strict";t.d(s,{ProjectPageContent:()=>D});var r=t(89835),n=t(13881),i=t(50417),a=t(65492),o=t(62520),l=t(26057),d=t(75123),c=t.n(d),u=t(55931),m=t(80942),h=t(75284),x=t(90229),f=t(89379),p=t(3908),v=t(32056),j=t(6806),b=t(71637),g=t(78837),y="Checkbox",[N,w]=(0,f.A)(y),[k,C]=N(y);function S(e){let{__scopeCheckbox:s,checked:t,children:n,defaultChecked:i,disabled:a,form:o,name:l,onCheckedChange:d,required:c,value:m="on",internal_do_not_use_render:h}=e,[x,f]=(0,v.i)({prop:t,defaultProp:null!=i&&i,onChange:d,caller:y}),[p,j]=u.useState(null),[b,g]=u.useState(null),N=u.useRef(!1),w=!p||!!o||!!p.closest("form"),C={checked:x,disabled:a,setChecked:f,control:p,setControl:j,name:l,form:o,value:m,hasConsumerStoppedPropagationRef:N,required:c,defaultChecked:!_(i)&&i,isFormControl:w,bubbleInput:b,setBubbleInput:g};return(0,r.jsx)(k,{scope:s,...C,children:"function"==typeof h?h(C):n})}var P="CheckboxTrigger",A=u.forwardRef((e,s)=>{let{__scopeCheckbox:t,onKeyDown:n,onClick:i,...a}=e,{control:o,value:l,disabled:d,checked:c,required:m,setControl:h,setChecked:f,hasConsumerStoppedPropagationRef:v,isFormControl:j,bubbleInput:b}=C(P,t),y=(0,x.s)(s,h),N=u.useRef(c);return u.useEffect(()=>{let e=null==o?void 0:o.form;if(e){let s=()=>f(N.current);return e.addEventListener("reset",s),()=>e.removeEventListener("reset",s)}},[o,f]),(0,r.jsx)(g.sG.button,{type:"button",role:"checkbox","aria-checked":_(c)?"mixed":c,"aria-required":m,"data-state":z(c),"data-disabled":d?"":void 0,disabled:d,value:l,...a,ref:y,onKeyDown:(0,p.mK)(n,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:(0,p.mK)(i,e=>{f(e=>!!_(e)||!e),b&&j&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})})});A.displayName=P;var E=u.forwardRef((e,s)=>{let{__scopeCheckbox:t,name:n,checked:i,defaultChecked:a,required:o,disabled:l,value:d,onCheckedChange:c,form:u,...m}=e;return(0,r.jsx)(S,{__scopeCheckbox:t,checked:i,defaultChecked:a,disabled:l,required:o,onCheckedChange:c,name:n,form:u,value:d,internal_do_not_use_render:e=>{let{isFormControl:n}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(A,{...m,ref:s,__scopeCheckbox:t}),n&&(0,r.jsx)(R,{__scopeCheckbox:t})]})}})});E.displayName=y;var K="CheckboxIndicator",q=u.forwardRef((e,s)=>{let{__scopeCheckbox:t,forceMount:n,...i}=e,a=C(K,t);return(0,r.jsx)(b.C,{present:n||_(a.checked)||!0===a.checked,children:(0,r.jsx)(g.sG.span,{"data-state":z(a.checked),"data-disabled":a.disabled?"":void 0,...i,ref:s,style:{pointerEvents:"none",...e.style}})})});q.displayName=K;var M="CheckboxBubbleInput",R=u.forwardRef((e,s)=>{let{__scopeCheckbox:t,...n}=e,{control:i,hasConsumerStoppedPropagationRef:a,checked:o,defaultChecked:l,required:d,disabled:c,name:m,value:h,form:f,bubbleInput:p,setBubbleInput:v}=C(M,t),b=(0,x.s)(s,v),y=function(e){let s=u.useRef({value:e,previous:e});return u.useMemo(()=>(s.current.value!==e&&(s.current.previous=s.current.value,s.current.value=e),s.current.previous),[e])}(o),N=function(e){let[s,t]=u.useState(void 0);return(0,j.N)(()=>{if(e){t({width:e.offsetWidth,height:e.offsetHeight});let s=new ResizeObserver(s=>{let r,n;if(!Array.isArray(s)||!s.length)return;let i=s[0];if("borderBoxSize"in i){let e=i.borderBoxSize,s=Array.isArray(e)?e[0]:e;r=s.inlineSize,n=s.blockSize}else r=e.offsetWidth,n=e.offsetHeight;t({width:r,height:n})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}t(void 0)},[e]),s}(i);u.useEffect(()=>{if(!p)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,s=!a.current;if(y!==o&&e){let t=new Event("click",{bubbles:s});p.indeterminate=_(o),e.call(p,!_(o)&&o),p.dispatchEvent(t)}},[p,y,o,a]);let w=u.useRef(!_(o)&&o);return(0,r.jsx)(g.sG.input,{type:"checkbox","aria-hidden":!0,defaultChecked:null!=l?l:w.current,required:d,disabled:c,name:m,value:h,form:f,...n,tabIndex:-1,ref:b,style:{...n.style,...N,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});function _(e){return"indeterminate"===e}function z(e){return _(e)?"indeterminate":e?"checked":"unchecked"}R.displayName=M;var F=t(91260),I=t(18237);function B(e){let{className:s,...t}=e;return(0,r.jsx)(E,{"data-slot":"checkbox",className:(0,I.cn)("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",s),...t,children:(0,r.jsx)(q,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:(0,r.jsx)(F.A,{className:"size-3.5"})})})}var H=t(45320),Q=t(59054),T=t(53630);let L={queryKey:["config"],queryFn:async()=>{let e=await T.s.api.config.$get();return await e.json()}};var O=t(5685),U=t(72667),$=t(51290);let D=e=>{var s,t;let{projectId:d}=e,x=(0,u.useId)(),{data:{project:f,sessions:p}}=(0,O.B)(d),{config:v,updateConfig:j}=(()=>{let e=(0,n.useQueryClient)(),{data:s}=(0,H.useSuspenseQuery)({...L}),t=(0,Q.useMutation)({mutationFn:async e=>{let s=await T.s.api.config.$put({json:e});return await s.json()},onSuccess:async()=>{await e.invalidateQueries({queryKey:L.queryKey})}});return{config:null==s?void 0:s.config,updateConfig:(0,u.useCallback)(e=>{t.mutate(e)},[t])}})(),b=(0,n.useQueryClient)();return(0,u.useEffect)(()=>{b.invalidateQueries({queryKey:(0,O.M)(d).queryKey})},[v.hideNoUserMessageSession,v.unifySameTitleSession]),(0,r.jsxs)("div",{className:"container mx-auto px-4 py-8",children:[(0,r.jsxs)("header",{className:"mb-8",children:[(0,r.jsx)(m.$,{asChild:!0,variant:"ghost",className:"mb-4",children:(0,r.jsxs)(c(),{href:"/projects",className:"flex items-center gap-2",children:[(0,r.jsx)(i.A,{className:"w-4 h-4"}),"Back to Projects"]})}),(0,r.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(a.A,{className:"w-6 h-6"}),(0,r.jsx)("h1",{className:"text-3xl font-bold",children:null!=(s=f.meta.projectPath)?s:f.claudeProjectPath})]}),(0,r.jsx)($.c,{projectId:d,trigger:(0,r.jsxs)(m.$,{size:"lg",className:"gap-2",children:[(0,r.jsx)(o.A,{className:"w-5 h-5"}),"Start New Chat"]})})]}),(0,r.jsxs)("p",{className:"text-muted-foreground font-mono text-sm",children:["History File: ",null!=(t=f.claudeProjectPath)?t:"unknown"]})]}),(0,r.jsx)("main",{children:(0,r.jsxs)("section",{children:[(0,r.jsxs)("h2",{className:"text-xl font-semibold mb-4",children:["Conversation Sessions"," ",p.length>0?"(".concat(p.length,")"):""]}),(0,r.jsxs)("div",{className:"mb-6 p-4 bg-muted/50 rounded-lg space-y-4",children:[(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(B,{id:x,checked:null==v?void 0:v.hideNoUserMessageSession,onCheckedChange:async()=>{j({...v,hideNoUserMessageSession:!(null==v?void 0:v.hideNoUserMessageSession)}),await b.invalidateQueries({queryKey:L.queryKey})}}),(0,r.jsx)("label",{htmlFor:x,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Hide sessions without user messages"})]}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground mt-1 ml-6",children:"Only show sessions that contain user commands or messages"}),(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(B,{id:"".concat(x,"-unify"),checked:null==v?void 0:v.unifySameTitleSession,onCheckedChange:async()=>{j({...v,unifySameTitleSession:!(null==v?void 0:v.unifySameTitleSession)}),await b.invalidateQueries({queryKey:L.queryKey})}}),(0,r.jsx)("label",{htmlFor:"".concat(x,"-unify"),className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Unify sessions with same title"})]}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground mt-1 ml-6",children:"Show only the latest session when multiple sessions have the same title"})]}),0===p.length?(0,r.jsx)(h.Zp,{children:(0,r.jsxs)(h.Wu,{className:"flex flex-col items-center justify-center py-12",children:[(0,r.jsx)(l.A,{className:"w-12 h-12 text-muted-foreground mb-4"}),(0,r.jsx)("h3",{className:"text-lg font-medium mb-2",children:"No sessions found"}),(0,r.jsx)("p",{className:"text-muted-foreground text-center max-w-md mb-6",children:"No conversation sessions found for this project. Start a conversation with Claude Code in this project to create sessions."}),(0,r.jsx)($.c,{projectId:d,trigger:(0,r.jsxs)(m.$,{size:"lg",className:"gap-2",children:[(0,r.jsx)(o.A,{className:"w-5 h-5"}),"Start First Chat"]})})]})}):(0,r.jsx)("div",{className:"grid gap-4 md:grid-cols-1 lg:grid-cols-1",children:p.map(e=>(0,r.jsxs)(h.Zp,{className:"hover:shadow-md transition-shadow",children:[(0,r.jsxs)(h.aR,{children:[(0,r.jsx)(h.ZB,{className:"flex items-center gap-2",children:(0,r.jsx)("span",{className:"break-all overflow-ellipsis line-clamp-2 text-xl",children:null!==e.meta.firstCommand?(0,U.H)(e.meta.firstCommand):e.id})}),(0,r.jsx)(h.BT,{className:"font-mono text-xs",children:e.id})]}),(0,r.jsxs)(h.Wu,{className:"space-y-2",children:[(0,r.jsxs)("p",{className:"text-sm text-muted-foreground",children:[e.meta.messageCount," messages"]}),(0,r.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Last modified:"," ",e.meta.lastModifiedAt?new Date(e.meta.lastModifiedAt).toLocaleDateString():""]}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground font-mono",children:e.jsonlFilePath})]}),(0,r.jsx)(h.Wu,{className:"pt-0",children:(0,r.jsx)(m.$,{asChild:!0,className:"w-full",children:(0,r.jsx)(c(),{href:"/projects/".concat(d,"/sessions/").concat(encodeURIComponent(e.id)),children:"View Session"})})})]},e.id))})]})})]})}}},e=>{e.O(0,[33,150,583,409,900,341,358],()=>e(e.s=17352)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[332],{17352:(e,s,t)=>{Promise.resolve().then(t.bind(t,98613)),Promise.resolve().then(t.bind(t,72611)),Promise.resolve().then(t.bind(t,13881)),Promise.resolve().then(t.bind(t,85452)),Promise.resolve().then(t.bind(t,120)),Promise.resolve().then(t.bind(t,27740)),Promise.resolve().then(t.bind(t,59054)),Promise.resolve().then(t.bind(t,8120)),Promise.resolve().then(t.bind(t,9161)),Promise.resolve().then(t.bind(t,63812)),Promise.resolve().then(t.bind(t,86260)),Promise.resolve().then(t.bind(t,15312)),Promise.resolve().then(t.bind(t,45320)),Promise.resolve().then(t.bind(t,27249))},27249:(e,s,t)=>{"use strict";t.d(s,{ProjectPageContent:()=>p});var a=t(89835),n=t(13881),i=t(50417),l=t(65492),r=t(62520),o=t(26057),c=t(75123),d=t.n(c),m=t(55931),h=t(57981),x=t(80942),j=t(75284),u=t(89290),f=t(5685),N=t(72667),g=t(51290);let p=e=>{var s,t;let{projectId:c}=e,{data:{project:p,sessions:v}}=(0,f.B)(c),{config:b}=(0,u.U)(),P=(0,n.useQueryClient)();return(0,m.useEffect)(()=>{P.invalidateQueries({queryKey:(0,f.M)(c).queryKey})},[b.hideNoUserMessageSession,b.unifySameTitleSession]),(0,a.jsxs)("div",{className:"container mx-auto px-4 py-8",children:[(0,a.jsxs)("header",{className:"mb-8",children:[(0,a.jsx)(x.$,{asChild:!0,variant:"ghost",className:"mb-4",children:(0,a.jsxs)(d(),{href:"/projects",className:"flex items-center gap-2",children:[(0,a.jsx)(i.A,{className:"w-4 h-4"}),"Back to Projects"]})}),(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)(l.A,{className:"w-6 h-6"}),(0,a.jsx)("h1",{className:"text-3xl font-bold",children:null!=(s=p.meta.projectPath)?s:p.claudeProjectPath})]}),(0,a.jsx)(g.c,{projectId:c,trigger:(0,a.jsxs)(x.$,{size:"lg",className:"gap-2",children:[(0,a.jsx)(r.A,{className:"w-5 h-5"}),"Start New Chat"]})})]}),(0,a.jsxs)("p",{className:"text-muted-foreground font-mono text-sm",children:["History File: ",null!=(t=p.claudeProjectPath)?t:"unknown"]})]}),(0,a.jsx)("main",{children:(0,a.jsxs)("section",{children:[(0,a.jsxs)("h2",{className:"text-xl font-semibold mb-4",children:["Conversation Sessions"," ",v.length>0?"(".concat(v.length,")"):""]}),(0,a.jsx)("div",{className:"mb-6 p-4 bg-muted/50 rounded-lg",children:(0,a.jsx)(h.o,{onConfigChange:()=>{P.invalidateQueries({queryKey:(0,f.M)(c).queryKey})}})}),0===v.length?(0,a.jsx)(j.Zp,{children:(0,a.jsxs)(j.Wu,{className:"flex flex-col items-center justify-center py-12",children:[(0,a.jsx)(o.A,{className:"w-12 h-12 text-muted-foreground mb-4"}),(0,a.jsx)("h3",{className:"text-lg font-medium mb-2",children:"No sessions found"}),(0,a.jsx)("p",{className:"text-muted-foreground text-center max-w-md mb-6",children:"No conversation sessions found for this project. Start a conversation with Claude Code in this project to create sessions."}),(0,a.jsx)(g.c,{projectId:c,trigger:(0,a.jsxs)(x.$,{size:"lg",className:"gap-2",children:[(0,a.jsx)(r.A,{className:"w-5 h-5"}),"Start First Chat"]})})]})}):(0,a.jsx)("div",{className:"grid gap-4 md:grid-cols-1 lg:grid-cols-1",children:v.map(e=>(0,a.jsxs)(j.Zp,{className:"hover:shadow-md transition-shadow",children:[(0,a.jsxs)(j.aR,{children:[(0,a.jsx)(j.ZB,{className:"flex items-center gap-2",children:(0,a.jsx)("span",{className:"break-all overflow-ellipsis line-clamp-2 text-xl",children:null!==e.meta.firstCommand?(0,N.H)(e.meta.firstCommand):e.id})}),(0,a.jsx)(j.BT,{className:"font-mono text-xs",children:e.id})]}),(0,a.jsxs)(j.Wu,{className:"space-y-2",children:[(0,a.jsxs)("p",{className:"text-sm text-muted-foreground",children:[e.meta.messageCount," messages"]}),(0,a.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Last modified:"," ",e.meta.lastModifiedAt?new Date(e.meta.lastModifiedAt).toLocaleDateString():""]}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground font-mono",children:e.jsonlFilePath})]}),(0,a.jsx)(j.Wu,{className:"pt-0",children:(0,a.jsx)(x.$,{asChild:!0,className:"w-full",children:(0,a.jsx)(d(),{href:"/projects/".concat(c,"/sessions/").concat(encodeURIComponent(e.id)),children:"View Session"})})})]},e.id))})]})})]})}},65492:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(92398).A)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]])}},e=>{e.O(0,[33,150,311,5,900,341,358],()=>e(e.s=17352)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[332],{17352:(e,s,t)=>{Promise.resolve().then(t.bind(t,98613)),Promise.resolve().then(t.bind(t,72611)),Promise.resolve().then(t.bind(t,13881)),Promise.resolve().then(t.bind(t,85452)),Promise.resolve().then(t.bind(t,120)),Promise.resolve().then(t.bind(t,27740)),Promise.resolve().then(t.bind(t,59054)),Promise.resolve().then(t.bind(t,8120)),Promise.resolve().then(t.bind(t,9161)),Promise.resolve().then(t.bind(t,63812)),Promise.resolve().then(t.bind(t,86260)),Promise.resolve().then(t.bind(t,15312)),Promise.resolve().then(t.bind(t,45320)),Promise.resolve().then(t.bind(t,88747))},65492:(e,s,t)=>{"use strict";t.d(s,{A:()=>r});let r=(0,t(92398).A)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]])},88747:(e,s,t)=>{"use strict";t.d(s,{ProjectPageContent:()=>W});var r=t(89835),n=t(13881),a=t(50417),i=t(65492),o=t(62520),l=t(26057),d=t(75123),c=t.n(d),u=t(55931),m=t(80942),h=t(75284),x=t(90229),f=t(89379),p=t(3908),j=t(32056),b=t(6806),g=t(71637),v=t(78837),N="Checkbox",[y,k]=(0,f.A)(N),[w,C]=y(N);function P(e){let{__scopeCheckbox:s,checked:t,children:n,defaultChecked:a,disabled:i,form:o,name:l,onCheckedChange:d,required:c,value:m="on",internal_do_not_use_render:h}=e,[x,f]=(0,j.i)({prop:t,defaultProp:null!=a&&a,onChange:d,caller:N}),[p,b]=u.useState(null),[g,v]=u.useState(null),y=u.useRef(!1),k=!p||!!o||!!p.closest("form"),C={checked:x,disabled:i,setChecked:f,control:p,setControl:b,name:l,form:o,value:m,hasConsumerStoppedPropagationRef:y,required:c,defaultChecked:!I(a)&&a,isFormControl:k,bubbleInput:g,setBubbleInput:v};return(0,r.jsx)(w,{scope:s,...C,children:"function"==typeof h?h(C):n})}var S="CheckboxTrigger",A=u.forwardRef((e,s)=>{let{__scopeCheckbox:t,onKeyDown:n,onClick:a,...i}=e,{control:o,value:l,disabled:d,checked:c,required:m,setControl:h,setChecked:f,hasConsumerStoppedPropagationRef:j,isFormControl:b,bubbleInput:g}=C(S,t),N=(0,x.s)(s,h),y=u.useRef(c);return u.useEffect(()=>{let e=null==o?void 0:o.form;if(e){let s=()=>f(y.current);return e.addEventListener("reset",s),()=>e.removeEventListener("reset",s)}},[o,f]),(0,r.jsx)(v.sG.button,{type:"button",role:"checkbox","aria-checked":I(c)?"mixed":c,"aria-required":m,"data-state":B(c),"data-disabled":d?"":void 0,disabled:d,value:l,...i,ref:N,onKeyDown:(0,p.mK)(n,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:(0,p.mK)(a,e=>{f(e=>!!I(e)||!e),g&&b&&(j.current=e.isPropagationStopped(),j.current||e.stopPropagation())})})});A.displayName=S;var E=u.forwardRef((e,s)=>{let{__scopeCheckbox:t,name:n,checked:a,defaultChecked:i,required:o,disabled:l,value:d,onCheckedChange:c,form:u,...m}=e;return(0,r.jsx)(P,{__scopeCheckbox:t,checked:a,defaultChecked:i,disabled:l,required:o,onCheckedChange:c,name:n,form:u,value:d,internal_do_not_use_render:e=>{let{isFormControl:n}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(A,{...m,ref:s,__scopeCheckbox:t}),n&&(0,r.jsx)(M,{__scopeCheckbox:t})]})}})});E.displayName=N;var R="CheckboxIndicator",_=u.forwardRef((e,s)=>{let{__scopeCheckbox:t,forceMount:n,...a}=e,i=C(R,t);return(0,r.jsx)(g.C,{present:n||I(i.checked)||!0===i.checked,children:(0,r.jsx)(v.sG.span,{"data-state":B(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:s,style:{pointerEvents:"none",...e.style}})})});_.displayName=R;var z="CheckboxBubbleInput",M=u.forwardRef((e,s)=>{let{__scopeCheckbox:t,...n}=e,{control:a,hasConsumerStoppedPropagationRef:i,checked:o,defaultChecked:l,required:d,disabled:c,name:m,value:h,form:f,bubbleInput:p,setBubbleInput:j}=C(z,t),g=(0,x.s)(s,j),N=function(e){let s=u.useRef({value:e,previous:e});return u.useMemo(()=>(s.current.value!==e&&(s.current.previous=s.current.value,s.current.value=e),s.current.previous),[e])}(o),y=function(e){let[s,t]=u.useState(void 0);return(0,b.N)(()=>{if(e){t({width:e.offsetWidth,height:e.offsetHeight});let s=new ResizeObserver(s=>{let r,n;if(!Array.isArray(s)||!s.length)return;let a=s[0];if("borderBoxSize"in a){let e=a.borderBoxSize,s=Array.isArray(e)?e[0]:e;r=s.inlineSize,n=s.blockSize}else r=e.offsetWidth,n=e.offsetHeight;t({width:r,height:n})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}t(void 0)},[e]),s}(a);u.useEffect(()=>{if(!p)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,s=!i.current;if(N!==o&&e){let t=new Event("click",{bubbles:s});p.indeterminate=I(o),e.call(p,!I(o)&&o),p.dispatchEvent(t)}},[p,N,o,i]);let k=u.useRef(!I(o)&&o);return(0,r.jsx)(v.sG.input,{type:"checkbox","aria-hidden":!0,defaultChecked:null!=l?l:k.current,required:d,disabled:c,name:m,value:h,form:f,...n,tabIndex:-1,ref:g,style:{...n.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});function I(e){return"indeterminate"===e}function B(e){return I(e)?"indeterminate":e?"checked":"unchecked"}M.displayName=z;var F=t(91260),H=t(18237);function K(e){let{className:s,...t}=e;return(0,r.jsx)(E,{"data-slot":"checkbox",className:(0,H.cn)("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",s),...t,children:(0,r.jsx)(_,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:(0,r.jsx)(F.A,{className:"size-3.5"})})})}var q=t(45320),L=t(59054),O=t(53630),Q=t(5685),$=t(72667),D=t(51290);let W=e=>{var s,t;let{projectId:d}=e,x=(0,u.useId)(),{data:{project:f,sessions:p}}=(0,Q.B)(d),{config:j,updateConfig:b}=(()=>{let e=(0,n.useQueryClient)(),{data:s}=(0,q.useSuspenseQuery)({queryKey:["config"],queryFn:async()=>{let e=await O.s.api.config.$get();return await e.json()}}),t=(0,L.useMutation)({mutationFn:async e=>{let s=await O.s.api.config.$put({json:e});return await s.json()},onSuccess:()=>{e.invalidateQueries({queryKey:["config"]})}});return{config:null==s?void 0:s.config,updateConfig:(0,u.useCallback)(e=>{t.mutate(e)},[t])}})(),g=(0,n.useQueryClient)();return(0,r.jsxs)("div",{className:"container mx-auto px-4 py-8",children:[(0,r.jsxs)("header",{className:"mb-8",children:[(0,r.jsx)(m.$,{asChild:!0,variant:"ghost",className:"mb-4",children:(0,r.jsxs)(c(),{href:"/projects",className:"flex items-center gap-2",children:[(0,r.jsx)(a.A,{className:"w-4 h-4"}),"Back to Projects"]})}),(0,r.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(i.A,{className:"w-6 h-6"}),(0,r.jsx)("h1",{className:"text-3xl font-bold",children:null!=(s=f.meta.projectPath)?s:f.claudeProjectPath})]}),(0,r.jsx)(D.c,{projectId:d,trigger:(0,r.jsxs)(m.$,{size:"lg",className:"gap-2",children:[(0,r.jsx)(o.A,{className:"w-5 h-5"}),"Start New Chat"]})})]}),(0,r.jsxs)("p",{className:"text-muted-foreground font-mono text-sm",children:["History File: ",null!=(t=f.claudeProjectPath)?t:"unknown"]})]}),(0,r.jsx)("main",{children:(0,r.jsxs)("section",{children:[(0,r.jsxs)("h2",{className:"text-xl font-semibold mb-4",children:["Conversation Sessions"," ",p.length>0?"(".concat(p.length,")"):""]}),(0,r.jsxs)("div",{className:"mb-6 p-4 bg-muted/50 rounded-lg",children:[(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(K,{id:x,checked:!(null==j?void 0:j.hideNoUserMessageSession),onCheckedChange:async()=>{b({...j,hideNoUserMessageSession:!(null==j?void 0:j.hideNoUserMessageSession)}),await g.invalidateQueries({queryKey:["config"]}),await g.invalidateQueries({queryKey:["projects",d]})}}),(0,r.jsx)("label",{htmlFor:x,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Hide sessions without user messages"})]}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground mt-1 ml-6",children:"Only show sessions that contain user commands or messages"})]}),0===p.length?(0,r.jsx)(h.Zp,{children:(0,r.jsxs)(h.Wu,{className:"flex flex-col items-center justify-center py-12",children:[(0,r.jsx)(l.A,{className:"w-12 h-12 text-muted-foreground mb-4"}),(0,r.jsx)("h3",{className:"text-lg font-medium mb-2",children:"No sessions found"}),(0,r.jsx)("p",{className:"text-muted-foreground text-center max-w-md mb-6",children:"No conversation sessions found for this project. Start a conversation with Claude Code in this project to create sessions."}),(0,r.jsx)(D.c,{projectId:d,trigger:(0,r.jsxs)(m.$,{size:"lg",className:"gap-2",children:[(0,r.jsx)(o.A,{className:"w-5 h-5"}),"Start First Chat"]})})]})}):(0,r.jsx)("div",{className:"grid gap-4 md:grid-cols-1 lg:grid-cols-1",children:p.map(e=>(0,r.jsxs)(h.Zp,{className:"hover:shadow-md transition-shadow",children:[(0,r.jsxs)(h.aR,{children:[(0,r.jsx)(h.ZB,{className:"flex items-center gap-2",children:(0,r.jsx)("span",{className:"break-all overflow-ellipsis line-clamp-2 text-xl",children:null!==e.meta.firstCommand?(0,$.H)(e.meta.firstCommand):e.id})}),(0,r.jsx)(h.BT,{className:"font-mono text-xs",children:e.id})]}),(0,r.jsxs)(h.Wu,{className:"space-y-2",children:[(0,r.jsxs)("p",{className:"text-sm text-muted-foreground",children:[e.meta.messageCount," messages"]}),(0,r.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Last modified:"," ",e.meta.lastModifiedAt?new Date(e.meta.lastModifiedAt).toLocaleDateString():""]}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground font-mono",children:e.jsonlFilePath})]}),(0,r.jsx)(h.Wu,{className:"pt-0",children:(0,r.jsx)(m.$,{asChild:!0,className:"w-full",children:(0,r.jsx)(c(),{href:"/projects/".concat(d,"/sessions/").concat(encodeURIComponent(e.id)),children:"View Session"})})})]},e.id))})]})})]})}}},e=>{e.O(0,[412,98,583,409,900,341,358],()=>e(e.s=17352)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[332],{17352:(e,s,t)=>{Promise.resolve().then(t.bind(t,98613)),Promise.resolve().then(t.bind(t,72611)),Promise.resolve().then(t.bind(t,13881)),Promise.resolve().then(t.bind(t,85452)),Promise.resolve().then(t.bind(t,120)),Promise.resolve().then(t.bind(t,27740)),Promise.resolve().then(t.bind(t,59054)),Promise.resolve().then(t.bind(t,8120)),Promise.resolve().then(t.bind(t,9161)),Promise.resolve().then(t.bind(t,63812)),Promise.resolve().then(t.bind(t,86260)),Promise.resolve().then(t.bind(t,15312)),Promise.resolve().then(t.bind(t,45320)),Promise.resolve().then(t.bind(t,88747))},65492:(e,s,t)=>{"use strict";t.d(s,{A:()=>r});let r=(0,t(92398).A)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]])},88747:(e,s,t)=>{"use strict";t.d(s,{ProjectPageContent:()=>W});var r=t(89835),n=t(13881),a=t(50417),i=t(65492),o=t(62520),l=t(26057),d=t(75123),c=t.n(d),u=t(55931),m=t(80942),h=t(75284),x=t(90229),f=t(89379),p=t(3908),b=t(32056),j=t(6806),v=t(71637),g=t(78837),y="Checkbox",[N,k]=(0,f.A)(y),[w,C]=N(y);function P(e){let{__scopeCheckbox:s,checked:t,children:n,defaultChecked:a,disabled:i,form:o,name:l,onCheckedChange:d,required:c,value:m="on",internal_do_not_use_render:h}=e,[x,f]=(0,b.i)({prop:t,defaultProp:null!=a&&a,onChange:d,caller:y}),[p,j]=u.useState(null),[v,g]=u.useState(null),N=u.useRef(!1),k=!p||!!o||!!p.closest("form"),C={checked:x,disabled:i,setChecked:f,control:p,setControl:j,name:l,form:o,value:m,hasConsumerStoppedPropagationRef:N,required:c,defaultChecked:!q(a)&&a,isFormControl:k,bubbleInput:v,setBubbleInput:g};return(0,r.jsx)(w,{scope:s,...C,children:"function"==typeof h?h(C):n})}var S="CheckboxTrigger",A=u.forwardRef((e,s)=>{let{__scopeCheckbox:t,onKeyDown:n,onClick:a,...i}=e,{control:o,value:l,disabled:d,checked:c,required:m,setControl:h,setChecked:f,hasConsumerStoppedPropagationRef:b,isFormControl:j,bubbleInput:v}=C(S,t),y=(0,x.s)(s,h),N=u.useRef(c);return u.useEffect(()=>{let e=null==o?void 0:o.form;if(e){let s=()=>f(N.current);return e.addEventListener("reset",s),()=>e.removeEventListener("reset",s)}},[o,f]),(0,r.jsx)(g.sG.button,{type:"button",role:"checkbox","aria-checked":q(c)?"mixed":c,"aria-required":m,"data-state":z(c),"data-disabled":d?"":void 0,disabled:d,value:l,...i,ref:y,onKeyDown:(0,p.mK)(n,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:(0,p.mK)(a,e=>{f(e=>!!q(e)||!e),v&&j&&(b.current=e.isPropagationStopped(),b.current||e.stopPropagation())})})});A.displayName=S;var E=u.forwardRef((e,s)=>{let{__scopeCheckbox:t,name:n,checked:a,defaultChecked:i,required:o,disabled:l,value:d,onCheckedChange:c,form:u,...m}=e;return(0,r.jsx)(P,{__scopeCheckbox:t,checked:a,defaultChecked:i,disabled:l,required:o,onCheckedChange:c,name:n,form:u,value:d,internal_do_not_use_render:e=>{let{isFormControl:n}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(A,{...m,ref:s,__scopeCheckbox:t}),n&&(0,r.jsx)(_,{__scopeCheckbox:t})]})}})});E.displayName=y;var M="CheckboxIndicator",R=u.forwardRef((e,s)=>{let{__scopeCheckbox:t,forceMount:n,...a}=e,i=C(M,t);return(0,r.jsx)(v.C,{present:n||q(i.checked)||!0===i.checked,children:(0,r.jsx)(g.sG.span,{"data-state":z(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:s,style:{pointerEvents:"none",...e.style}})})});R.displayName=M;var K="CheckboxBubbleInput",_=u.forwardRef((e,s)=>{let{__scopeCheckbox:t,...n}=e,{control:a,hasConsumerStoppedPropagationRef:i,checked:o,defaultChecked:l,required:d,disabled:c,name:m,value:h,form:f,bubbleInput:p,setBubbleInput:b}=C(K,t),v=(0,x.s)(s,b),y=function(e){let s=u.useRef({value:e,previous:e});return u.useMemo(()=>(s.current.value!==e&&(s.current.previous=s.current.value,s.current.value=e),s.current.previous),[e])}(o),N=function(e){let[s,t]=u.useState(void 0);return(0,j.N)(()=>{if(e){t({width:e.offsetWidth,height:e.offsetHeight});let s=new ResizeObserver(s=>{let r,n;if(!Array.isArray(s)||!s.length)return;let a=s[0];if("borderBoxSize"in a){let e=a.borderBoxSize,s=Array.isArray(e)?e[0]:e;r=s.inlineSize,n=s.blockSize}else r=e.offsetWidth,n=e.offsetHeight;t({width:r,height:n})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}t(void 0)},[e]),s}(a);u.useEffect(()=>{if(!p)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,s=!i.current;if(y!==o&&e){let t=new Event("click",{bubbles:s});p.indeterminate=q(o),e.call(p,!q(o)&&o),p.dispatchEvent(t)}},[p,y,o,i]);let k=u.useRef(!q(o)&&o);return(0,r.jsx)(g.sG.input,{type:"checkbox","aria-hidden":!0,defaultChecked:null!=l?l:k.current,required:d,disabled:c,name:m,value:h,form:f,...n,tabIndex:-1,ref:v,style:{...n.style,...N,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});function q(e){return"indeterminate"===e}function z(e){return q(e)?"indeterminate":e?"checked":"unchecked"}_.displayName=K;var I=t(91260),B=t(18237);function F(e){let{className:s,...t}=e;return(0,r.jsx)(E,{"data-slot":"checkbox",className:(0,B.cn)("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",s),...t,children:(0,r.jsx)(R,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:(0,r.jsx)(I.A,{className:"size-3.5"})})})}var H=t(45320),L=t(59054),O=t(53630);let Q={queryKey:["config"],queryFn:async()=>{let e=await O.s.api.config.$get();return await e.json()}};var $=t(5685),D=t(72667),U=t(51290);let W=e=>{var s,t;let{projectId:d}=e,x=(0,u.useId)(),{data:{project:f,sessions:p}}=(0,$.B)(d),{config:b,updateConfig:j}=(()=>{let e=(0,n.useQueryClient)(),{data:s}=(0,H.useSuspenseQuery)({...Q}),t=(0,L.useMutation)({mutationFn:async e=>{let s=await O.s.api.config.$put({json:e});return await s.json()},onSuccess:()=>{e.invalidateQueries({queryKey:Q.queryKey})}});return{config:null==s?void 0:s.config,updateConfig:(0,u.useCallback)(e=>{t.mutate(e)},[t])}})(),v=(0,n.useQueryClient)();return(0,u.useEffect)(()=>{v.invalidateQueries({queryKey:(0,$.M)(d).queryKey})},[b.hideNoUserMessageSession]),(0,r.jsxs)("div",{className:"container mx-auto px-4 py-8",children:[(0,r.jsxs)("header",{className:"mb-8",children:[(0,r.jsx)(m.$,{asChild:!0,variant:"ghost",className:"mb-4",children:(0,r.jsxs)(c(),{href:"/projects",className:"flex items-center gap-2",children:[(0,r.jsx)(a.A,{className:"w-4 h-4"}),"Back to Projects"]})}),(0,r.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(i.A,{className:"w-6 h-6"}),(0,r.jsx)("h1",{className:"text-3xl font-bold",children:null!=(s=f.meta.projectPath)?s:f.claudeProjectPath})]}),(0,r.jsx)(U.c,{projectId:d,trigger:(0,r.jsxs)(m.$,{size:"lg",className:"gap-2",children:[(0,r.jsx)(o.A,{className:"w-5 h-5"}),"Start New Chat"]})})]}),(0,r.jsxs)("p",{className:"text-muted-foreground font-mono text-sm",children:["History File: ",null!=(t=f.claudeProjectPath)?t:"unknown"]})]}),(0,r.jsx)("main",{children:(0,r.jsxs)("section",{children:[(0,r.jsxs)("h2",{className:"text-xl font-semibold mb-4",children:["Conversation Sessions"," ",p.length>0?"(".concat(p.length,")"):""]}),(0,r.jsxs)("div",{className:"mb-6 p-4 bg-muted/50 rounded-lg",children:[(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(F,{id:x,checked:null==b?void 0:b.hideNoUserMessageSession,onCheckedChange:async()=>{j({...b,hideNoUserMessageSession:!(null==b?void 0:b.hideNoUserMessageSession)}),await v.invalidateQueries({queryKey:Q.queryKey})}}),(0,r.jsx)("label",{htmlFor:x,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Hide sessions without user messages"})]}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground mt-1 ml-6",children:"Only show sessions that contain user commands or messages"})]}),0===p.length?(0,r.jsx)(h.Zp,{children:(0,r.jsxs)(h.Wu,{className:"flex flex-col items-center justify-center py-12",children:[(0,r.jsx)(l.A,{className:"w-12 h-12 text-muted-foreground mb-4"}),(0,r.jsx)("h3",{className:"text-lg font-medium mb-2",children:"No sessions found"}),(0,r.jsx)("p",{className:"text-muted-foreground text-center max-w-md mb-6",children:"No conversation sessions found for this project. Start a conversation with Claude Code in this project to create sessions."}),(0,r.jsx)(U.c,{projectId:d,trigger:(0,r.jsxs)(m.$,{size:"lg",className:"gap-2",children:[(0,r.jsx)(o.A,{className:"w-5 h-5"}),"Start First Chat"]})})]})}):(0,r.jsx)("div",{className:"grid gap-4 md:grid-cols-1 lg:grid-cols-1",children:p.map(e=>(0,r.jsxs)(h.Zp,{className:"hover:shadow-md transition-shadow",children:[(0,r.jsxs)(h.aR,{children:[(0,r.jsx)(h.ZB,{className:"flex items-center gap-2",children:(0,r.jsx)("span",{className:"break-all overflow-ellipsis line-clamp-2 text-xl",children:null!==e.meta.firstCommand?(0,D.H)(e.meta.firstCommand):e.id})}),(0,r.jsx)(h.BT,{className:"font-mono text-xs",children:e.id})]}),(0,r.jsxs)(h.Wu,{className:"space-y-2",children:[(0,r.jsxs)("p",{className:"text-sm text-muted-foreground",children:[e.meta.messageCount," messages"]}),(0,r.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Last modified:"," ",e.meta.lastModifiedAt?new Date(e.meta.lastModifiedAt).toLocaleDateString():""]}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground font-mono",children:e.jsonlFilePath})]}),(0,r.jsx)(h.Wu,{className:"pt-0",children:(0,r.jsx)(m.$,{asChild:!0,className:"w-full",children:(0,r.jsx)(c(),{href:"/projects/".concat(d,"/sessions/").concat(encodeURIComponent(e.id)),children:"View Session"})})})]},e.id))})]})})]})}}},e=>{e.O(0,[33,150,583,409,900,341,358],()=>e(e.s=17352)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[332],{17352:(e,s,t)=>{Promise.resolve().then(t.bind(t,98613)),Promise.resolve().then(t.bind(t,72611)),Promise.resolve().then(t.bind(t,13881)),Promise.resolve().then(t.bind(t,85452)),Promise.resolve().then(t.bind(t,120)),Promise.resolve().then(t.bind(t,27740)),Promise.resolve().then(t.bind(t,59054)),Promise.resolve().then(t.bind(t,8120)),Promise.resolve().then(t.bind(t,9161)),Promise.resolve().then(t.bind(t,63812)),Promise.resolve().then(t.bind(t,86260)),Promise.resolve().then(t.bind(t,15312)),Promise.resolve().then(t.bind(t,45320)),Promise.resolve().then(t.bind(t,27249))},27249:(e,s,t)=>{"use strict";t.d(s,{ProjectPageContent:()=>g});var a=t(89835),i=t(13881),n=t(50417),l=t(65492),o=t(62520),r=t(26057),d=t(75123),c=t.n(d),m=t(55931),h=t(80942),x=t(75284),u=t(77633),j=t(89290),f=t(5685),p=t(72667),N=t(51290);let g=e=>{var s,t;let{projectId:d}=e,g=(0,m.useId)(),{data:{project:v,sessions:b}}=(0,f.B)(d),{config:y,updateConfig:w}=(0,j.U)(),P=(0,i.useQueryClient)();return(0,m.useEffect)(()=>{P.invalidateQueries({queryKey:(0,f.M)(d).queryKey})},[y.hideNoUserMessageSession,y.unifySameTitleSession]),(0,a.jsxs)("div",{className:"container mx-auto px-4 py-8",children:[(0,a.jsxs)("header",{className:"mb-8",children:[(0,a.jsx)(h.$,{asChild:!0,variant:"ghost",className:"mb-4",children:(0,a.jsxs)(c(),{href:"/projects",className:"flex items-center gap-2",children:[(0,a.jsx)(n.A,{className:"w-4 h-4"}),"Back to Projects"]})}),(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)(l.A,{className:"w-6 h-6"}),(0,a.jsx)("h1",{className:"text-3xl font-bold",children:null!=(s=v.meta.projectPath)?s:v.claudeProjectPath})]}),(0,a.jsx)(N.c,{projectId:d,trigger:(0,a.jsxs)(h.$,{size:"lg",className:"gap-2",children:[(0,a.jsx)(o.A,{className:"w-5 h-5"}),"Start New Chat"]})})]}),(0,a.jsxs)("p",{className:"text-muted-foreground font-mono text-sm",children:["History File: ",null!=(t=v.claudeProjectPath)?t:"unknown"]})]}),(0,a.jsx)("main",{children:(0,a.jsxs)("section",{children:[(0,a.jsxs)("h2",{className:"text-xl font-semibold mb-4",children:["Conversation Sessions"," ",b.length>0?"(".concat(b.length,")"):""]}),(0,a.jsxs)("div",{className:"mb-6 p-4 bg-muted/50 rounded-lg space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(u.S,{id:g,checked:null==y?void 0:y.hideNoUserMessageSession,onCheckedChange:async()=>{w({...y,hideNoUserMessageSession:!(null==y?void 0:y.hideNoUserMessageSession)}),await P.invalidateQueries({queryKey:j.R.queryKey})}}),(0,a.jsx)("label",{htmlFor:g,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Hide sessions without user messages"})]}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-1 ml-6",children:"Only show sessions that contain user commands or messages"}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(u.S,{id:"".concat(g,"-unify"),checked:null==y?void 0:y.unifySameTitleSession,onCheckedChange:async()=>{w({...y,unifySameTitleSession:!(null==y?void 0:y.unifySameTitleSession)}),await P.invalidateQueries({queryKey:j.R.queryKey})}}),(0,a.jsx)("label",{htmlFor:"".concat(g,"-unify"),className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Unify sessions with same title"})]}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-1 ml-6",children:"Show only the latest session when multiple sessions have the same title"})]}),0===b.length?(0,a.jsx)(x.Zp,{children:(0,a.jsxs)(x.Wu,{className:"flex flex-col items-center justify-center py-12",children:[(0,a.jsx)(r.A,{className:"w-12 h-12 text-muted-foreground mb-4"}),(0,a.jsx)("h3",{className:"text-lg font-medium mb-2",children:"No sessions found"}),(0,a.jsx)("p",{className:"text-muted-foreground text-center max-w-md mb-6",children:"No conversation sessions found for this project. Start a conversation with Claude Code in this project to create sessions."}),(0,a.jsx)(N.c,{projectId:d,trigger:(0,a.jsxs)(h.$,{size:"lg",className:"gap-2",children:[(0,a.jsx)(o.A,{className:"w-5 h-5"}),"Start First Chat"]})})]})}):(0,a.jsx)("div",{className:"grid gap-4 md:grid-cols-1 lg:grid-cols-1",children:b.map(e=>(0,a.jsxs)(x.Zp,{className:"hover:shadow-md transition-shadow",children:[(0,a.jsxs)(x.aR,{children:[(0,a.jsx)(x.ZB,{className:"flex items-center gap-2",children:(0,a.jsx)("span",{className:"break-all overflow-ellipsis line-clamp-2 text-xl",children:null!==e.meta.firstCommand?(0,p.H)(e.meta.firstCommand):e.id})}),(0,a.jsx)(x.BT,{className:"font-mono text-xs",children:e.id})]}),(0,a.jsxs)(x.Wu,{className:"space-y-2",children:[(0,a.jsxs)("p",{className:"text-sm text-muted-foreground",children:[e.meta.messageCount," messages"]}),(0,a.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Last modified:"," ",e.meta.lastModifiedAt?new Date(e.meta.lastModifiedAt).toLocaleDateString():""]}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground font-mono",children:e.jsonlFilePath})]}),(0,a.jsx)(x.Wu,{className:"pt-0",children:(0,a.jsx)(h.$,{asChild:!0,className:"w-full",children:(0,a.jsx)(c(),{href:"/projects/".concat(d,"/sessions/").concat(encodeURIComponent(e.id)),children:"View Session"})})})]},e.id))})]})})]})}},65492:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(92398).A)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]])}},e=>{e.O(0,[33,150,311,884,900,341,358],()=>e(e.s=17352)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[332],{5685:(e,s,t)=>{"use strict";t.d(s,{B:()=>n});var a=t(45320),r=t(53630);let n=e=>(0,a.U)({queryKey:["projects",e],queryFn:async()=>{let s=await r.s.api.projects[":projectId"].$get({param:{projectId:e}});return await s.json()},refetchOnReconnect:!0})},18237:(e,s,t)=>{"use strict";t.d(s,{cn:()=>n});var a=t(98951),r=t(42411);function n(){for(var e=arguments.length,s=Array(e),t=0;t<e;t++)s[t]=arguments[t];return(0,r.QP)((0,a.$)(s))}},42207:(e,s,t)=>{"use strict";t.d(s,{ProjectPageContent:()=>w});var a=t(89835),r=t(27608),n=t(50417),i=t(65492),o=t(26057),d=t(75123),c=t.n(d),l=t(55931),m=t(80942),u=t(75284),h=t(74889),x=t(91260),g=t(18237);function f(e){let{className:s,...t}=e;return(0,a.jsx)(h.bL,{"data-slot":"checkbox",className:(0,g.cn)("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",s),...t,children:(0,a.jsx)(h.C1,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:(0,a.jsx)(x.A,{className:"size-3.5"})})})}var p=t(5685),v=t(72667),b=t(48304);let j=(0,t(89230).tG)("session-filters",{hideSessionsWithoutUserMessages:!0}),N=(0,b.eU)(e=>e(j).hideSessionsWithoutUserMessages,(e,s,t)=>{let a=e(j);s(j,{...a,hideSessionsWithoutUserMessages:t})}),w=e=>{var s,t;let{projectId:d}=e,h=(0,l.useId)(),{data:{project:x,sessions:g}}=(0,p.B)(d),[b,j]=(0,r.fp)(N),w=b?g.filter(e=>null!==e.meta.firstCommand):g;return(0,a.jsxs)("div",{className:"container mx-auto px-4 py-8",children:[(0,a.jsxs)("header",{className:"mb-8",children:[(0,a.jsx)(m.$,{asChild:!0,variant:"ghost",className:"mb-4",children:(0,a.jsxs)(c(),{href:"/projects",className:"flex items-center gap-2",children:[(0,a.jsx)(n.A,{className:"w-4 h-4"}),"Back to Projects"]})}),(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,a.jsx)(i.A,{className:"w-6 h-6"}),(0,a.jsx)("h1",{className:"text-3xl font-bold",children:null!=(s=x.meta.projectPath)?s:x.claudeProjectPath})]}),(0,a.jsxs)("p",{className:"text-muted-foreground font-mono text-sm",children:["History File: ",null!=(t=x.claudeProjectPath)?t:"unknown"]})]}),(0,a.jsx)("main",{children:(0,a.jsxs)("section",{children:[(0,a.jsxs)("h2",{className:"text-xl font-semibold mb-4",children:["Conversation Sessions"," ",w.length>0?"(".concat(w.length,")"):"",b&&w.length!==g.length&&(0,a.jsxs)("span",{className:"text-sm text-muted-foreground ml-2",children:["of ",g.length," total"]})]}),(0,a.jsxs)("div",{className:"mb-6 p-4 bg-muted/50 rounded-lg",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(f,{id:h,checked:b,onCheckedChange:j}),(0,a.jsx)("label",{htmlFor:h,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Hide sessions without user messages"})]}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-1 ml-6",children:"Only show sessions that contain user commands or messages"})]}),0===w.length?(0,a.jsx)(u.Zp,{children:(0,a.jsxs)(u.Wu,{className:"flex flex-col items-center justify-center py-12",children:[(0,a.jsx)(o.A,{className:"w-12 h-12 text-muted-foreground mb-4"}),(0,a.jsx)("h3",{className:"text-lg font-medium mb-2",children:"No sessions found"}),(0,a.jsx)("p",{className:"text-muted-foreground text-center max-w-md",children:"No conversation sessions found for this project. Start a conversation with Claude Code in this project to create sessions."})]})}):(0,a.jsx)("div",{className:"grid gap-4 md:grid-cols-1 lg:grid-cols-1",children:w.map(e=>(0,a.jsxs)(u.Zp,{className:"hover:shadow-md transition-shadow",children:[(0,a.jsxs)(u.aR,{children:[(0,a.jsx)(u.ZB,{className:"flex items-center gap-2",children:(0,a.jsx)("span",{className:"break-all overflow-ellipsis line-clamp-2 text-xl",children:null!==e.meta.firstCommand?(0,v.H)(e.meta.firstCommand):e.id})}),(0,a.jsx)(u.BT,{className:"font-mono text-xs",children:e.id})]}),(0,a.jsxs)(u.Wu,{className:"space-y-2",children:[(0,a.jsxs)("p",{className:"text-sm text-muted-foreground",children:[e.meta.messageCount," messages"]}),(0,a.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Last modified:"," ",e.meta.lastModifiedAt?new Date(e.meta.lastModifiedAt).toLocaleDateString():""]}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground font-mono",children:e.jsonlFilePath})]}),(0,a.jsx)(u.Wu,{className:"pt-0",children:(0,a.jsx)(m.$,{asChild:!0,className:"w-full",children:(0,a.jsx)(c(),{href:"/projects/".concat(d,"/sessions/").concat(encodeURIComponent(e.id)),children:"View Session"})})})]},e.id))})]})})]})}},53630:(e,s,t)=>{"use strict";t.d(s,{s:()=>a});let a=(0,t(74865).hc)("/")},72667:(e,s,t)=>{"use strict";t.d(s,{H:()=>a});let a=e=>{switch(e.kind){case"command":if(void 0===e.commandArgs)return e.commandName;return"".concat(e.commandName," ").concat(e.commandArgs);case"local-command":return e.stdout;case"text":return e.content;default:throw Error("Invalid first command")}}},75284:(e,s,t)=>{"use strict";t.d(s,{BT:()=>d,Wu:()=>c,ZB:()=>o,Zp:()=>n,aR:()=>i});var a=t(89835),r=t(18237);function n(e){let{className:s,...t}=e;return(0,a.jsx)("div",{"data-slot":"card",className:(0,r.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",s),...t})}function i(e){let{className:s,...t}=e;return(0,a.jsx)("div",{"data-slot":"card-header",className:(0,r.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",s),...t})}function o(e){let{className:s,...t}=e;return(0,a.jsx)("div",{"data-slot":"card-title",className:(0,r.cn)("leading-none font-semibold",s),...t})}function d(e){let{className:s,...t}=e;return(0,a.jsx)("div",{"data-slot":"card-description",className:(0,r.cn)("text-muted-foreground text-sm",s),...t})}function c(e){let{className:s,...t}=e;return(0,a.jsx)("div",{"data-slot":"card-content",className:(0,r.cn)("px-6",s),...t})}},80942:(e,s,t)=>{"use strict";t.d(s,{$:()=>d});var a=t(89835),r=t(8607),n=t(7951),i=t(18237);let o=(0,n.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function d(e){let{className:s,variant:t,size:n,asChild:d=!1,...c}=e,l=d?r.DX:"button";return(0,a.jsx)(l,{"data-slot":"button",className:(0,i.cn)(o({variant:t,size:n,className:s})),...c})}},82288:(e,s,t)=>{Promise.resolve().then(t.bind(t,42207))}},e=>{e.O(0,[449,251,655,900,341,358],()=>e(e.s=82288)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[998],{71968:(e,s,t)=>{"use strict";t.d(s,{SessionPageContent:()=>eb});var r=t(89835),a=t(59054),n=t(50417),i=t(58903),l=t(93856),d=t(38514),o=t(75123),c=t.n(o),m=t(55931),u=t(80942),x=t(53630),h=t(72667),p=t(63812),g=t(27608),b=t(89854),f=t(45320),j=t(41633),v=t(40138);let N=e=>{let{conversation:s,sidechainConversations:t,getToolResult:a}=e,n=(e=>{let s=e.at(0),t="".concat(e.length," conversations (").concat((null==s?void 0:s.type)!=="summary"?null==s?void 0:s.uuid:"",")");if(!s||"user"!==s.type)return t;let r="string"==typeof s.message.content?s.message.content:(()=>{let e=s.message.content.at(0);return void 0===e?null:"string"==typeof e?e:"text"===e.type?e.text:null})();return null!=r?r:t})(t),i="summary"!==s.type?s.uuid:s.leafUuid;return(0,r.jsxs)(v.lG,{children:[(0,r.jsx)(v.zM,{asChild:!0,children:(0,r.jsx)(u.$,{variant:"outline",size:"sm",className:"w-full mb-3 items-center justify-start",children:(0,r.jsxs)("div",{className:"flex items-center gap-2 overflow-hidden",children:[(0,r.jsx)(j.A,{className:"h-4 w-4 flex-shrink-0"}),(0,r.jsxs)("span",{className:"overflow-hidden text-ellipsis",children:["View Task: ",n]})]})})}),(0,r.jsxs)(v.Cf,{className:"!w-[1200px] !max-w-none max-h-[80vh] overflow-hidden flex flex-col",children:[(0,r.jsxs)(v.c7,{children:[(0,r.jsx)(v.L3,{children:n.length>100?"".concat(n.slice(0,100),"..."):n}),(0,r.jsxs)(v.rr,{children:["Root UUID: ",i]})]}),(0,r.jsx)("div",{className:"flex-1 overflow-auto",children:(0,r.jsx)(X,{conversations:t,getToolResult:a})})]})]})};var y=t(55407),w=t(5530),k=t(9005),A=t(68607),C=t(36703),S=t(83632),T=t(8607),I=t(7951),R=t(18237);let P=(0,I.F)("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function M(e){let{className:s,variant:t,asChild:a=!1,...n}=e,i=a?T.DX:"span";return(0,r.jsx)(i,{"data-slot":"badge",className:(0,R.cn)(P({variant:t}),s),...n})}var U=t(75284),_=t(45730),D=t(35853),E=t(35880),z=t(96318);let F=e=>{let{content:s,className:t=""}=e;return(0,r.jsx)("div",{className:"prose prose-neutral dark:prose-invert max-w-none ".concat(t),children:(0,r.jsx)(D.oz,{remarkPlugins:[z.A],components:{h1(e){let{children:s,...t}=e;return(0,r.jsx)("h1",{className:"text-3xl font-bold mb-6 mt-8 pb-3 border-b border-border text-foreground",...t,children:s})},h2(e){let{children:s,...t}=e;return(0,r.jsx)("h2",{className:"text-2xl font-semibold mb-4 mt-8 pb-2 border-b border-border/50 text-foreground",...t,children:s})},h3(e){let{children:s,...t}=e;return(0,r.jsx)("h3",{className:"text-xl font-semibold mb-3 mt-6 text-foreground",...t,children:s})},h4(e){let{children:s,...t}=e;return(0,r.jsx)("h4",{className:"text-lg font-medium mb-2 mt-4 text-foreground",...t,children:s})},h5(e){let{children:s,...t}=e;return(0,r.jsx)("h5",{className:"text-base font-medium mb-2 mt-4 text-foreground",...t,children:s})},h6(e){let{children:s,...t}=e;return(0,r.jsx)("h6",{className:"text-sm font-medium mb-2 mt-4 text-muted-foreground",...t,children:s})},p(e){let{children:s,...t}=e;return(0,r.jsx)("p",{className:"mb-4 leading-7 text-foreground",...t,children:s})},ul(e){let{children:s,...t}=e;return(0,r.jsx)("ul",{className:"mb-4 ml-6 list-disc space-y-2",...t,children:s})},ol(e){let{children:s,...t}=e;return(0,r.jsx)("ol",{className:"mb-4 ml-6 list-decimal space-y-2",...t,children:s})},li(e){let{children:s,...t}=e;return(0,r.jsx)("li",{className:"leading-7 text-foreground",...t,children:s})},code(e){let{className:s,children:t,...a}=e,n=/language-(\w+)/.exec(s||"");return n?(0,r.jsxs)("div",{className:"relative my-6",children:[(0,r.jsx)("div",{className:"flex items-center justify-between bg-muted/30 px-4 py-2 border-b border-border rounded-t-lg",children:(0,r.jsx)("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:n[1]})}),(0,r.jsx)(C.A,{style:E.A,language:n[1],PreTag:"div",className:"!mt-0 !rounded-t-none !rounded-b-lg !border-t-0 !border !border-border",customStyle:{margin:0,borderTopLeftRadius:0,borderTopRightRadius:0},children:String(t).replace(/\n$/,"")})]}):(0,r.jsx)("code",{className:"bg-muted/70 px-2 py-1 rounded-md text-sm font-mono text-foreground border",...a,children:t})},pre(e){let{children:s,...t}=e;return(0,r.jsx)("pre",{...t,children:s})},blockquote(e){let{children:s,...t}=e;return(0,r.jsx)("blockquote",{className:"border-l-4 border-primary/30 bg-muted/30 pl-6 pr-4 py-4 my-6 italic rounded-r-lg",...t,children:(0,r.jsx)("div",{className:"text-muted-foreground",children:s})})},a(e){let{children:s,href:t,...a}=e;return(0,r.jsx)("a",{href:t,className:"text-primary hover:text-primary/80 underline underline-offset-4 decoration-primary/30 hover:decoration-primary/60 transition-colors",...a,children:s})},table(e){let{children:s,...t}=e;return(0,r.jsx)("div",{className:"overflow-x-auto my-6 rounded-lg border border-border",children:(0,r.jsx)("table",{className:"min-w-full border-collapse",...t,children:s})})},thead(e){let{children:s,...t}=e;return(0,r.jsx)("thead",{className:"bg-muted/50",...t,children:s})},th(e){let{children:s,...t}=e;return(0,r.jsx)("th",{className:"border-b border-border px-4 py-3 text-left font-semibold text-foreground",...t,children:s})},td(e){let{children:s,...t}=e;return(0,r.jsx)("td",{className:"border-b border-border px-4 py-3 text-foreground",...t,children:s})},hr(e){let{...s}=e;return(0,r.jsx)("hr",{className:"my-8 border-t border-border",...s})},strong(e){let{children:s,...t}=e;return(0,r.jsx)("strong",{className:"font-semibold text-foreground",...t,children:s})},em(e){let{children:s,...t}=e;return(0,r.jsx)("em",{className:"italic text-foreground",...t,children:s})}},children:s})})},$=e=>{let{content:s,getToolResult:t}=e;if("text"===s.type)return(0,r.jsx)("div",{className:"w-full mx-2 my-6",children:(0,r.jsx)(F,{content:s.text})});if("thinking"===s.type)return(0,r.jsx)(U.Zp,{className:"bg-muted/50 border-dashed gap-2 py-3 mb-2",children:(0,r.jsxs)(_.Nt,{children:[(0,r.jsx)(_.R6,{asChild:!0,children:(0,r.jsx)(U.aR,{className:"cursor-pointer hover:bg-muted/80 rounded-t-lg transition-colors py-0 px-4",children:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(y.A,{className:"h-4 w-4 text-muted-foreground"}),(0,r.jsx)(U.ZB,{className:"text-sm font-medium",children:"Thinking"}),(0,r.jsx)(w.A,{className:"h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})})}),(0,r.jsx)(_.Ke,{children:(0,r.jsx)(U.Wu,{className:"py-0 px-4",children:(0,r.jsx)("div",{className:"text-sm text-muted-foreground whitespace-pre-wrap font-mono",children:s.thinking})})})]})});if("tool_use"===s.type){let e=t(s.id);return(0,r.jsxs)(U.Zp,{className:"border-blue-200 bg-blue-50/50 dark:border-blue-800 dark:bg-blue-950/20 gap-2 py-3 mb-2",children:[(0,r.jsxs)(U.aR,{className:"py-0 px-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(k.A,{className:"h-4 w-4 text-blue-600 dark:text-blue-400"}),(0,r.jsx)(U.ZB,{className:"text-sm font-medium",children:"Tool Use"}),(0,r.jsx)(M,{variant:"outline",className:"border-blue-300 text-blue-700 dark:border-blue-700 dark:text-blue-300",children:s.name})]}),(0,r.jsxs)(U.BT,{className:"text-xs",children:["Tool execution with ID: ",s.id]})]}),(0,r.jsxs)(U.Wu,{className:"space-y-2 py-0 px-4",children:[(0,r.jsxs)(_.Nt,{children:[(0,r.jsx)(_.R6,{asChild:!0,children:(0,r.jsxs)("div",{className:"flex items-center justify-between cursor-pointer hover:bg-muted/50 rounded p-2 -mx-2",children:[(0,r.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:"Input Parameters"}),(0,r.jsx)(w.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),(0,r.jsx)(_.Ke,{children:(0,r.jsx)(C.A,{style:S.A,language:"json",PreTag:"div",className:"text-xs",children:JSON.stringify(s.input,null,2)})})]}),e&&(0,r.jsxs)(_.Nt,{children:[(0,r.jsx)(_.R6,{asChild:!0,children:(0,r.jsxs)("div",{className:"flex items-center justify-between cursor-pointer hover:bg-muted/50 rounded p-2 -mx-2",children:[(0,r.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:"Tool Result"}),(0,r.jsx)(w.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),(0,r.jsx)(_.Ke,{children:(0,r.jsx)("div",{className:"bg-background rounded border p-2 mt-1",children:"string"==typeof e.content?(0,r.jsx)("pre",{className:"text-xs overflow-x-auto whitespace-pre-line",children:e.content}):e.content.map(e=>{if("image"===e.type)return(0,r.jsx)(A.default,{src:"data:".concat(e.source.media_type,";base64,").concat(e.source.data),alt:"Tool Result"},e.source.data);if("text"===e.type)return(0,r.jsx)("pre",{className:"text-xs overflow-x-auto whitespace-pre-line",children:e.text},e.text);throw Error("Unexpected tool result content type")})})})]})]})]})}return s.type,null},Z=e=>{let{children:s}=e;return(0,r.jsxs)(_.Nt,{children:[(0,r.jsx)(_.R6,{asChild:!0,children:(0,r.jsxs)("div",{className:"flex items-center justify-between cursor-pointer hover:bg-muted/50 rounded p-2 -mx-2",children:[(0,r.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:"Meta Information"}),(0,r.jsx)(w.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),(0,r.jsx)(_.Ke,{children:(0,r.jsx)("div",{className:"bg-background rounded border p-3 mt-2",children:s})})]})},B=e=>{let{children:s}=e;return(0,r.jsxs)(_.Nt,{children:[(0,r.jsx)(_.R6,{asChild:!0,children:(0,r.jsxs)("div",{className:"flex items-center justify-between cursor-pointer hover:bg-muted/50 rounded p-2 -mx-2",children:[(0,r.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:"Summarized"}),(0,r.jsx)(w.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),(0,r.jsx)(_.Ke,{children:(0,r.jsx)("div",{className:"bg-background rounded border p-3 mt-2",children:(0,r.jsx)("pre",{className:"text-xs overflow-x-auto",children:s})})})]})},K=e=>{let{children:s}=e;return(0,r.jsxs)(_.Nt,{children:[(0,r.jsx)(_.R6,{asChild:!0,children:(0,r.jsxs)("div",{className:"flex items-center justify-between cursor-pointer hover:bg-muted/50 rounded p-2 -mx-2",children:[(0,r.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:"System Message"}),(0,r.jsx)(w.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),(0,r.jsx)(_.Ke,{children:(0,r.jsx)("div",{className:"bg-background rounded border p-3 mt-2",children:(0,r.jsx)("pre",{className:"text-xs overflow-x-auto",children:s})})})]})};var q=t(93021),L=t(28043),W=t(72676),O=t(5556);let H=RegExp("<(?<tag>[^>]+)>(?<content>\\s*[^<]*?\\s*)<\\/\\k<tag>>","g"),V=O.Ik({tag:O.Yj(),content:O.Yj()}),Q=e=>{let{text:s,id:t}=e,a=(e=>{var s,t,r,a;let n=Array.from(e.matchAll(H)).map(e=>V.safeParse(e.groups)).filter(e=>e.success).map(e=>e.data);if(0===n.length)return{kind:"text",content:e};let i=null==(s=n.find(e=>"command-name"===e.tag))?void 0:s.content,l=null==(t=n.find(e=>"command-args"===e.tag))?void 0:t.content,d=null==(r=n.find(e=>"command-message"===e.tag))?void 0:r.content,o=null==(a=n.find(e=>"local-command-stdout"===e.tag))?void 0:a.content;switch(!0){case void 0!==i:return{kind:"command",commandName:i,commandArgs:l,commandMessage:d};case void 0!==o:return{kind:"local-command",stdout:o};default:return{kind:"text",content:e}}})(s);return"command"===a.kind?(0,r.jsxs)(U.Zp,{className:"border-green-200 bg-green-50/50 dark:border-green-800 dark:bg-green-950/20 gap-2 py-3 mb-3",id:t,children:[(0,r.jsx)(U.aR,{className:"py-0 px-4",children:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(W.A,{className:"h-4 w-4 text-green-600 dark:text-green-400"}),(0,r.jsx)(U.ZB,{className:"text-sm font-medium",children:"Claude Code Command"}),(0,r.jsx)(M,{variant:"outline",className:"border-green-300 text-green-700 dark:border-green-700 dark:text-green-300",children:a.commandName})]})}),a.commandArgs||a.commandMessage?(0,r.jsx)(U.Wu,{className:"py-0 px-4",children:(0,r.jsx)("div",{className:"space-y-2",children:(0,r.jsxs)("div",{children:[a.commandArgs&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"Arguments:"}),(0,r.jsx)("div",{className:"bg-background rounded border p-2 mt-1",children:(0,r.jsx)("code",{className:"text-xs whitespace-pre-line",children:a.commandArgs})})]}),a.commandMessage&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"Message:"}),(0,r.jsx)("div",{className:"bg-background rounded border p-2 mt-1",children:(0,r.jsx)("code",{className:"text-xs whitespace-pre-line",children:a.commandMessage})})]})]})})}):null]}):"local-command"===a.kind?(0,r.jsxs)(U.Zp,{className:"border-green-200 bg-green-50/50 dark:border-green-800 dark:bg-green-950/20 gap-2 py-3 mb-3",children:[(0,r.jsx)(U.aR,{className:"py-0 px-4",children:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(W.A,{className:"h-4 w-4 text-green-600 dark:text-green-400"}),(0,r.jsx)(U.ZB,{className:"text-sm font-medium",children:"Local Command"})]})}),(0,r.jsx)(U.Wu,{className:"py-0 px-4",children:(0,r.jsx)("pre",{className:"text-xs overflow-x-auto",children:a.stdout})})]}):(0,r.jsx)(F,{className:"w-full px-3 py-3 mb-5 border border-border rounded-lg bg-slate-50",content:a.content})},Y=e=>{let{content:s,id:t}=e;return"string"==typeof s?(0,r.jsx)(Q,{text:s,id:t}):"text"===s.type?(0,r.jsx)(Q,{text:s.text,id:t}):"image"===s.type?"base64"===s.source.type?(0,r.jsxs)(U.Zp,{className:"border-purple-200 bg-purple-50/50 dark:border-purple-800 dark:bg-purple-950/20",id:t,children:[(0,r.jsxs)(U.aR,{children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(q.A,{className:"h-4 w-4 text-purple-600 dark:text-purple-400"}),(0,r.jsx)(U.ZB,{className:"text-sm font-medium",children:"Image"}),(0,r.jsx)(M,{variant:"outline",className:"border-purple-300 text-purple-700 dark:border-purple-700 dark:text-purple-300",children:s.source.media_type})]}),(0,r.jsx)(U.BT,{className:"text-xs",children:"User uploaded image content"})]}),(0,r.jsx)(U.Wu,{children:(0,r.jsx)("div",{className:"rounded-lg border overflow-hidden bg-background",children:(0,r.jsx)(A.default,{src:"data:".concat(s.source.media_type,";base64,").concat(s.source.data),alt:"User uploaded content",className:"max-w-full h-auto max-h-96 object-contain"})})})]}):(0,r.jsx)(U.Zp,{className:"border-red-200 bg-red-50/50 dark:border-red-800 dark:bg-red-950/20",id:t,children:(0,r.jsxs)(U.aR,{children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(L.A,{className:"h-4 w-4 text-red-600 dark:text-red-400"}),(0,r.jsx)(U.ZB,{className:"text-sm font-medium",children:"Unsupported Media"}),(0,r.jsx)(M,{variant:"destructive",children:"Error"})]}),(0,r.jsx)(U.BT,{className:"text-xs",children:"Media type not supported for display"})]})}):(s.type,null)},G=e=>{let{conversation:s,getToolResult:t,isRootSidechain:a,getSidechainConversations:n}=e;if("summary"===s.type)return(0,r.jsx)(B,{children:s.summary});if("system"===s.type)return(0,r.jsx)(K,{children:s.content});if(s.isSidechain)return a(s)?(0,r.jsx)(N,{conversation:s,sidechainConversations:n(s.uuid).map(e=>"summary"===e.type?e:{...e,isSidechain:!1}),getToolResult:t}):null;if("user"===s.type){let e="string"==typeof s.message.content?(0,r.jsx)(Y,{content:s.message.content,id:"message-".concat(s.uuid)}):(0,r.jsx)("ul",{className:"w-full",id:"message-".concat(s.uuid),children:s.message.content.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)(Y,{content:e})},e.toString()))});return!0===s.isMeta?(0,r.jsx)(Z,{children:e}):e}return"assistant"===s.type?(0,r.jsx)("ul",{className:"w-full",children:s.message.content.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)($,{content:e,getToolResult:t})},e.toString()))}):null},J=e=>{if("user"===e.type)return"user_".concat(e.uuid);if("assistant"===e.type)return"assistant_".concat(e.uuid);if("system"===e.type)return"system_".concat(e.uuid);if("summary"===e.type)return"summary_".concat(e.leafUuid);throw Error("Unknown conversation type: ".concat(e))},X=e=>{let{conversations:s,getToolResult:t}=e,{isRootSidechain:a,getSidechainConversations:n}=(e=>{let s=(0,m.useMemo)(()=>new Map(e.filter(e=>"summary"!==e.type).map(e=>[e.uuid,e])),[e]),t=(0,m.useCallback)(e=>{if("summary"===e.type||null===e.parentUuid)return e;let r=s.get(e.parentUuid);return void 0===r?e:t(r)},[s]),r=(0,m.useMemo)(()=>{let s=e.filter(e=>"summary"!==e.type).filter(e=>!0===e.isSidechain),r=new Map;for(let e of s){let s=t(e);if("summary"!==s.type)if(r.has(s.uuid)){var a;null==(a=r.get(s.uuid))||a.push(e)}else r.set(s.uuid,[e])}return r},[e,t]);return{isRootSidechain:(0,m.useCallback)(e=>"summary"!==e.type&&r.has(e.uuid),[r]),getSidechainConversations:(0,m.useCallback)(e=>{var s;return null!=(s=r.get(e))?s:[]},[r])}})(s);return(0,r.jsx)("ul",{children:s.flatMap(e=>{let s=(0,r.jsx)(G,{conversation:e,getToolResult:t,isRootSidechain:a,getSidechainConversations:n},J(e)),i="summary"!==e.type&&e.isSidechain;return[(0,r.jsx)("li",{className:"w-full flex ".concat(i||"assistant"===e.type||"system"===e.type||"summary"===e.type?"justify-start":"justify-end"),children:(0,r.jsx)("div",{className:"w-[85%]",children:s})},J(e))]})})};var ee=t(70038),es=t(79588),et=t(31264),er=t(19611);let ea=e=>{let{projectId:s,sessionId:t,isPausedTask:n,isRunningTask:l}=e,d=(0,es.useRouter)(),o=(0,m.useRef)(null),c=(0,a.useMutation)({mutationFn:async e=>{let r=await x.s.api.projects[":projectId"].sessions[":sessionId"].resume.$post({param:{projectId:s,sessionId:t},json:{resumeMessage:e.message}});if(!r.ok)throw Error(r.statusText);return r.json()},onSuccess:async e=>{t!==e.sessionId&&d.push("/projects/".concat(s,"/sessions/").concat(e.sessionId,"#message-").concat(e.userMessageId)),p("")}}),[h,p]=(0,m.useState)(""),g=(0,m.useRef)(null),b=(0,m.useId)(),f=()=>{h.trim()&&c.mutate({message:h.trim()})};return(0,r.jsxs)("div",{className:"border-t border-border/50 bg-muted/20 p-4 mt-6",children:[c.error&&(0,r.jsxs)("div",{className:"flex items-center gap-2 p-3 mb-3 text-sm text-destructive bg-destructive/10 border border-destructive/20 rounded-md",children:[(0,r.jsx)(L.A,{className:"w-4 h-4"}),(0,r.jsx)("span",{children:"Failed to resume chat. Please try again."})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(et.T,{ref:o,value:h,onChange:e=>p(e.target.value),onKeyDown:e=>{var s;(null==(s=g.current)||!s.handleKeyDown(e))&&"Enter"===e.key&&e.shiftKey&&(e.preventDefault(),f())},placeholder:"Type your message... (Start with / for commands, Shift+Enter to send)",className:"min-h-[60px] resize-none",disabled:c.isPending,maxLength:4e3,"aria-label":"Message input with command completion","aria-describedby":b,"aria-expanded":h.startsWith("/"),"aria-haspopup":"listbox",role:"combobox","aria-autocomplete":"list"}),(0,r.jsx)(er.s,{ref:g,projectId:s,inputValue:h,onCommandSelect:e=>{var s;p(e),null==(s=o.current)||s.focus()},className:"absolute top-full left-0 right-0"})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("span",{className:"text-xs text-muted-foreground",id:b,children:[h.length,"/4000"]}),(0,r.jsx)(u.$,{onClick:f,disabled:!h.trim()||c.isPending,size:"default",className:"gap-2",children:c.isPending?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.A,{className:"w-4 h-4 animate-spin"}),"Starting... This may take a while."]}):n||l?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ee.A,{className:"w-4 h-4"}),"Send"]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ee.A,{className:"w-4 h-4"}),"Resume"]})})]})]})]})};var en=t(26057),ei=t(9187),el=t(5685),ed=t(62520),eo=t(51290);let ec=e=>{let{sessions:s,currentSessionId:t,projectId:a}=e,n=(0,g.md)(b.r);return(0,r.jsxs)("div",{className:"h-full flex flex-col",children:[(0,r.jsxs)("div",{className:"border-b border-sidebar-border p-4",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,r.jsx)("h2",{className:"font-semibold text-lg",children:"Sessions"}),(0,r.jsx)(eo.c,{projectId:a,trigger:(0,r.jsxs)(u.$,{size:"sm",variant:"outline",className:"gap-1.5",children:[(0,r.jsx)(ed.A,{className:"w-3.5 h-3.5"}),"New"]})})]}),(0,r.jsxs)("p",{className:"text-xs text-sidebar-foreground/70",children:[s.length," total"]})]}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto p-2 space-y-0.5",children:s.map(e=>{let s=e.id===t,i=null!==e.meta.firstCommand?(0,h.H)(e.meta.firstCommand):e.id,l=n.find(s=>s.sessionId===e.id),d=(null==l?void 0:l.status)==="running",o=(null==l?void 0:l.status)==="paused";return(0,r.jsx)(c(),{href:"/projects/".concat(a,"/sessions/").concat(encodeURIComponent(e.id)),className:(0,R.cn)("block rounded-lg p-2.5 transition-all duration-200 hover:bg-blue-50/60 hover:border-blue-300/60 hover:shadow-sm border border-sidebar-border/40 bg-sidebar/30",s&&"bg-blue-100 border-blue-400 shadow-md ring-1 ring-blue-200/50 hover:bg-blue-100 hover:border-blue-400"),children:(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,r.jsx)("h3",{className:"text-sm font-medium line-clamp-2 leading-tight text-sidebar-foreground flex-1",children:i}),(d||o)&&(0,r.jsx)(M,{variant:d?"default":"secondary",className:(0,R.cn)("text-xs",d&&"bg-green-500 text-white",o&&"bg-yellow-500 text-white"),children:d?"Running":"Paused"})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1 text-xs text-sidebar-foreground/70",children:[(0,r.jsx)(en.A,{className:"w-3 h-3"}),(0,r.jsx)("span",{children:e.meta.messageCount})]}),e.meta.lastModifiedAt&&(0,r.jsx)("span",{className:"text-xs text-sidebar-foreground/60",children:new Date(e.meta.lastModifiedAt).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]})]})},e.id)})})]})};var em=t(57981);let eu=()=>(0,r.jsxs)("div",{className:"h-full flex flex-col",children:[(0,r.jsxs)("div",{className:"border-b border-sidebar-border p-4",children:[(0,r.jsx)("h2",{className:"font-semibold text-lg",children:"Settings"}),(0,r.jsx)("p",{className:"text-xs text-sidebar-foreground/70",children:"Display and behavior preferences"})]}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto p-4 space-y-6",children:(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("h3",{className:"font-medium text-sm text-sidebar-foreground",children:"Session Display"}),(0,r.jsx)(em.o,{})]})})]});var ex=t(54058);let eh=e=>{let{task:s,projectId:t,onAbortTask:a,onCopyTaskId:n,isAbortPending:i}=e;return(0,r.jsxs)(c(),{href:"/projects/".concat(t,"/sessions/").concat(encodeURIComponent(s.sessionId)),className:"block rounded-lg p-3 border border-sidebar-border/40 bg-sidebar/30 hover:bg-sidebar-accent/20 transition-colors space-y-2 group",children:[(0,r.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:["running"===s.status?(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"}),(0,r.jsx)(ex.A,{className:"w-3 h-3 text-green-600"})]}):(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsx)("div",{className:"w-2 h-2 bg-orange-500 rounded-full"}),(0,r.jsx)(d.A,{className:"w-3 h-3 text-orange-600"})]}),(0,r.jsx)("span",{className:"text-xs font-medium text-sidebar-foreground",children:s.status.toUpperCase()})]}),(0,r.jsx)(u.$,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 opacity-0 group-hover:opacity-100 hover:opacity-100 transition-opacity",onClick:e=>{e.preventDefault(),e.stopPropagation(),a(s.sessionId)},disabled:i,title:"Abort task",children:(0,r.jsx)(l.A,{className:"w-3 h-3"})})]}),(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsxs)("div",{className:"text-xs text-sidebar-foreground/70",children:["Task ID:",(0,r.jsx)("button",{type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),n(s.id)},className:"ml-1 font-mono hover:text-sidebar-foreground transition-colors",title:"Click to copy",children:s.id.slice(-8)})]}),(0,r.jsxs)("div",{className:"text-xs text-sidebar-foreground/70",children:["Session:",(0,r.jsx)("span",{className:"ml-1 font-mono text-sidebar-foreground",children:s.sessionId.slice(-8)})]}),s.userMessageId&&(0,r.jsxs)("div",{className:"text-xs text-sidebar-foreground/70",children:["Message:",(0,r.jsx)("span",{className:"ml-1 font-mono",children:s.userMessageId.slice(-8)})]})]})]})},ep=e=>{let{projectId:s}=e,[t]=(0,g.fp)(b.r),n=(0,a.useMutation)({mutationFn:async e=>{let s=await x.s.api.tasks.abort.$post({json:{sessionId:e}});if(!s.ok)throw Error(s.statusText);return s.json()}}),i=e=>{navigator.clipboard.writeText(e)},l=t.filter(e=>"running"===e.status),d=t.filter(e=>"paused"===e.status);return(0,r.jsxs)("div",{className:"h-full flex flex-col",children:[(0,r.jsxs)("div",{className:"border-b border-sidebar-border p-4",children:[(0,r.jsx)("h2",{className:"font-semibold text-lg",children:"Alive Sessions"}),(0,r.jsxs)("p",{className:"text-xs text-sidebar-foreground/70",children:[l.length," running, ",d.length," paused"]})]}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto p-2 space-y-4",children:0===t.length?(0,r.jsx)("div",{className:"flex-1 flex items-center justify-center pt-8",children:(0,r.jsxs)("div",{className:"text-center text-sidebar-foreground/60",children:[(0,r.jsx)(ei.A,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),(0,r.jsx)("p",{className:"text-sm",children:"No alive sessions"})]})}):(0,r.jsxs)(r.Fragment,{children:[l.length>0&&(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,r.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"}),(0,r.jsxs)("h3",{className:"text-xs font-semibold text-sidebar-foreground uppercase tracking-wide",children:["Running (",l.length,")"]})]}),(0,r.jsx)("div",{className:"space-y-2",children:l.map(e=>(0,r.jsx)(eh,{task:e,projectId:s,onAbortTask:e=>n.mutate(e),onCopyTaskId:i,isAbortPending:n.isPending},e.id))})]}),d.length>0&&(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,r.jsx)("div",{className:"w-2 h-2 bg-orange-500 rounded-full"}),(0,r.jsxs)("h3",{className:"text-xs font-semibold text-sidebar-foreground uppercase tracking-wide",children:["Paused (",d.length,")"]})]}),(0,r.jsx)("div",{className:"space-y-2",children:d.map(e=>(0,r.jsx)(eh,{task:e,projectId:s,onAbortTask:e=>n.mutate(e),onCopyTaskId:i,isAbortPending:n.isPending},e.id))})]})]})})]})},eg=e=>{let{currentSessionId:s,projectId:t,className:a}=e,{data:{sessions:n}}=(0,el.B)(t),[i,l]=(0,m.useState)("sessions"),[d,o]=(0,m.useState)(!0),c=e=>{i===e&&d?o(!1):(l(e),o(!0))};return(0,r.jsx)("div",{className:(0,R.cn)("hidden md:flex h-full",a),children:(0,r.jsxs)("div",{className:(0,R.cn)("h-full border-r border-sidebar-border transition-all duration-300 ease-in-out flex bg-sidebar text-sidebar-foreground",d?"w-72 lg:w-80":"w-12"),children:[(0,r.jsx)("div",{className:"w-12 flex flex-col border-r border-sidebar-border bg-sidebar/50",children:(0,r.jsxs)("div",{className:"flex flex-col p-2 space-y-1",children:[(0,r.jsx)("button",{type:"button",onClick:()=>c("sessions"),className:(0,R.cn)("w-8 h-8 flex items-center justify-center rounded-md transition-colors","hover:bg-sidebar-accent hover:text-sidebar-accent-foreground","sessions"===i&&d?"bg-sidebar-accent text-sidebar-accent-foreground shadow-sm":"text-sidebar-foreground/70"),title:"Sessions",children:(0,r.jsx)(en.A,{className:"w-4 h-4"})}),(0,r.jsx)("button",{type:"button",onClick:()=>c("tasks"),className:(0,R.cn)("w-8 h-8 flex items-center justify-center rounded-md transition-colors","hover:bg-sidebar-accent hover:text-sidebar-accent-foreground","tasks"===i&&d?"bg-sidebar-accent text-sidebar-accent-foreground shadow-sm":"text-sidebar-foreground/70"),title:"Tasks",children:(0,r.jsx)(ei.A,{className:"w-4 h-4"})}),(0,r.jsx)("button",{type:"button",onClick:()=>c("settings"),className:(0,R.cn)("w-8 h-8 flex items-center justify-center rounded-md transition-colors","hover:bg-sidebar-accent hover:text-sidebar-accent-foreground","settings"===i&&d?"bg-sidebar-accent text-sidebar-accent-foreground shadow-sm":"text-sidebar-foreground/70"),title:"Settings",children:(0,r.jsx)(k.A,{className:"w-4 h-4"})})]})}),d&&(0,r.jsx)("div",{className:"flex-1 flex flex-col overflow-hidden",children:(()=>{switch(i){case"sessions":return(0,r.jsx)(ec,{sessions:n,currentSessionId:s,projectId:t});case"tasks":return(0,r.jsx)(ep,{projectId:t});case"settings":return(0,r.jsx)(eu,{});default:return null}})()})]})})},eb=e=>{let{projectId:s,sessionId:t}=e,{session:o,conversations:j,getToolResult:v}=((e,s)=>{let t=(0,f.useSuspenseQuery)({...((e,s)=>({queryKey:["sessions",s],queryFn:async()=>(await x.s.api.projects[":projectId"].sessions[":sessionId"].$get({param:{projectId:e,sessionId:s}})).json()}))(e,s)}),r=(0,m.useMemo)(()=>new Map(t.data.session.conversations.flatMap(e=>"user"!==e.type||"string"==typeof e.message.content?[]:e.message.content.flatMap(e=>"string"==typeof e||"tool_result"!==e.type?[]:[[e.tool_use_id,e]]))),[t.data.session.conversations]),a=(0,m.useCallback)(e=>r.get(e),[r]);return{session:t.data.session,conversations:t.data.session.conversations,getToolResult:a}})(s,t),N=(0,a.useMutation)({mutationFn:async e=>{let s=await x.s.api.tasks.abort.$post({json:{sessionId:e}});if(!s.ok)throw Error(s.statusText);return s.json()}}),{isRunningTask:y,isPausedTask:w}=(e=>{let[s,t]=(0,g.fp)(b.r);return(0,p.useQuery)({queryKey:["aliveTasks"],queryFn:async()=>{let e=await x.s.api.tasks.alive.$get({});if(!e.ok)throw Error(e.statusText);return t((await e.json()).aliveTasks),e.json()},refetchOnReconnect:!0}),(0,m.useMemo)(()=>{let t=s.find(s=>s.sessionId===e);return{aliveTask:s.find(s=>s.sessionId===e),isRunningTask:(null==t?void 0:t.status)==="running",isPausedTask:(null==t?void 0:t.status)==="paused"}},[s,e])})(t),[k,A]=(0,m.useState)(0),C=(0,m.useRef)(null);return(0,m.useEffect)(()=>{if(y&&j.length!==k){A(j.length);let e=C.current;e&&e.scrollTo({top:e.scrollHeight,behavior:"smooth"})}},[j,y,k]),(0,r.jsxs)("div",{className:"flex h-screen",children:[(0,r.jsx)(eg,{currentSessionId:t,projectId:s}),(0,r.jsx)("div",{className:"flex-1 flex flex-col overflow-hidden",children:(0,r.jsxs)("div",{ref:C,className:"max-w-none flex-1 overflow-y-auto",children:[(0,r.jsxs)("header",{className:"px-3 py-3 sticky top-0 z-10 bg-background w-full",children:[(0,r.jsx)(u.$,{asChild:!0,variant:"ghost",children:(0,r.jsxs)(c(),{href:"/projects/".concat(s),className:"flex items-center gap-2",children:[(0,r.jsx)(n.A,{className:"w-4 h-4"}),"Back to Session List"]})}),(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)("div",{className:"flex items-center gap-3",children:(0,r.jsx)("h1",{className:"text-3xl font-bold break-all overflow-ellipsis line-clamp-2 px-5",children:null!==o.meta.firstCommand?(0,h.H)(o.meta.firstCommand):t})}),y&&(0,r.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-primary/10 border border-primary/20 rounded-lg",children:[(0,r.jsx)(i.A,{className:"w-4 h-4 animate-spin"}),(0,r.jsx)("div",{className:"flex-1",children:(0,r.jsx)("p",{className:"text-sm font-medium",children:"Conversation is in progress..."})}),(0,r.jsxs)(u.$,{variant:"ghost",size:"sm",onClick:()=>{N.mutate(t)},children:[(0,r.jsx)(l.A,{className:"w-4 h-4"}),"Abort"]})]}),w&&(0,r.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-primary/10 border border-primary/20 rounded-lg",children:[(0,r.jsx)(d.A,{className:"w-4 h-4"}),(0,r.jsx)("div",{className:"flex-1",children:(0,r.jsx)("p",{className:"text-sm font-medium",children:"Conversation is paused..."})}),(0,r.jsxs)(u.$,{variant:"ghost",size:"sm",onClick:()=>{N.mutate(t)},children:[(0,r.jsx)(l.A,{className:"w-4 h-4"}),"Abort"]})]}),(0,r.jsxs)("p",{className:"text-muted-foreground font-mono text-sm",children:["Session ID: ",t]})]})]}),(0,r.jsxs)("main",{className:"w-full px-20 pb-20 relative z-5",children:[(0,r.jsx)(X,{conversations:j,getToolResult:v}),(0,r.jsx)(ea,{projectId:s,sessionId:t,isPausedTask:w,isRunningTask:y})]})]})})]})}},82791:(e,s,t)=>{Promise.resolve().then(t.bind(t,98613)),Promise.resolve().then(t.bind(t,72611)),Promise.resolve().then(t.bind(t,13881)),Promise.resolve().then(t.bind(t,85452)),Promise.resolve().then(t.bind(t,120)),Promise.resolve().then(t.bind(t,27740)),Promise.resolve().then(t.bind(t,59054)),Promise.resolve().then(t.bind(t,8120)),Promise.resolve().then(t.bind(t,9161)),Promise.resolve().then(t.bind(t,63812)),Promise.resolve().then(t.bind(t,86260)),Promise.resolve().then(t.bind(t,15312)),Promise.resolve().then(t.bind(t,45320)),Promise.resolve().then(t.bind(t,71968))},89854:(e,s,t)=>{"use strict";t.d(s,{r:()=>r});let r=(0,t(48304).eU)([])}},e=>{e.O(0,[33,150,311,608,830,5,900,341,358],()=>e(e.s=82791)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[998],{56812:(e,s,r)=>{"use strict";r.d(s,{SessionPageContent:()=>ed});var t=r(89835),a=r(50417),n=r(58903),l=r(75123),d=r.n(l),i=r(55931),o=r(80942),c=r(72667),m=r(63812),u=r(53630),x=r(45320),h=r(41633),p=r(40138);let g=e=>{let{conversation:s,sidechainConversations:r,getToolResult:a}=e,n=(e=>{let s=e.at(0),r="".concat(e.length," conversations (").concat((null==s?void 0:s.type)!=="summary"?null==s?void 0:s.uuid:"",")");if(!s||"user"!==s.type)return r;let t="string"==typeof s.message.content?s.message.content:(()=>{let e=s.message.content.at(0);return void 0===e?null:"string"==typeof e?e:"text"===e.type?e.text:null})();return null!=t?t:r})(r),l="summary"!==s.type?s.uuid:s.leafUuid;return(0,t.jsxs)(p.lG,{children:[(0,t.jsx)(p.zM,{asChild:!0,children:(0,t.jsx)(o.$,{variant:"outline",size:"sm",className:"w-full mb-3 items-center justify-start",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 overflow-hidden",children:[(0,t.jsx)(h.A,{className:"h-4 w-4 flex-shrink-0"}),(0,t.jsxs)("span",{className:"overflow-hidden text-ellipsis",children:["View Task: ",n]})]})})}),(0,t.jsxs)(p.Cf,{className:"!w-[1200px] !max-w-none max-h-[80vh] overflow-hidden flex flex-col",children:[(0,t.jsxs)(p.c7,{children:[(0,t.jsx)(p.L3,{children:n.length>100?"".concat(n.slice(0,100),"..."):n}),(0,t.jsxs)(p.rr,{children:["Root UUID: ",l]})]}),(0,t.jsx)("div",{className:"flex-1 overflow-auto",children:(0,t.jsx)(H,{conversations:r,getToolResult:a})})]})]})};var b=r(55407),f=r(5530),j=r(9005),v=r(68607),N=r(8607),y=r(7951),w=r(18237);let k=(0,y.F)("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function C(e){let{className:s,variant:r,asChild:a=!1,...n}=e,l=a?N.DX:"span";return(0,t.jsx)(l,{"data-slot":"badge",className:(0,w.cn)(k({variant:r}),s),...n})}var R=r(75284),S=r(45730),A=r(35853),T=r(36703),M=r(35880),I=r(96318);let P=e=>{let{content:s,className:r=""}=e;return(0,t.jsx)("div",{className:"prose prose-neutral dark:prose-invert max-w-none ".concat(r),children:(0,t.jsx)(A.oz,{remarkPlugins:[I.A],components:{h1(e){let{children:s,...r}=e;return(0,t.jsx)("h1",{className:"text-3xl font-bold mb-6 mt-8 pb-3 border-b border-border text-foreground",...r,children:s})},h2(e){let{children:s,...r}=e;return(0,t.jsx)("h2",{className:"text-2xl font-semibold mb-4 mt-8 pb-2 border-b border-border/50 text-foreground",...r,children:s})},h3(e){let{children:s,...r}=e;return(0,t.jsx)("h3",{className:"text-xl font-semibold mb-3 mt-6 text-foreground",...r,children:s})},h4(e){let{children:s,...r}=e;return(0,t.jsx)("h4",{className:"text-lg font-medium mb-2 mt-4 text-foreground",...r,children:s})},h5(e){let{children:s,...r}=e;return(0,t.jsx)("h5",{className:"text-base font-medium mb-2 mt-4 text-foreground",...r,children:s})},h6(e){let{children:s,...r}=e;return(0,t.jsx)("h6",{className:"text-sm font-medium mb-2 mt-4 text-muted-foreground",...r,children:s})},p(e){let{children:s,...r}=e;return(0,t.jsx)("p",{className:"mb-4 leading-7 text-foreground",...r,children:s})},ul(e){let{children:s,...r}=e;return(0,t.jsx)("ul",{className:"mb-4 ml-6 list-disc space-y-2",...r,children:s})},ol(e){let{children:s,...r}=e;return(0,t.jsx)("ol",{className:"mb-4 ml-6 list-decimal space-y-2",...r,children:s})},li(e){let{children:s,...r}=e;return(0,t.jsx)("li",{className:"leading-7 text-foreground",...r,children:s})},code(e){let{className:s,children:r,...a}=e,n=/language-(\w+)/.exec(s||"");return n?(0,t.jsxs)("div",{className:"relative my-6",children:[(0,t.jsx)("div",{className:"flex items-center justify-between bg-muted/30 px-4 py-2 border-b border-border rounded-t-lg",children:(0,t.jsx)("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:n[1]})}),(0,t.jsx)(T.A,{style:M.A,language:n[1],PreTag:"div",className:"!mt-0 !rounded-t-none !rounded-b-lg !border-t-0 !border !border-border",customStyle:{margin:0,borderTopLeftRadius:0,borderTopRightRadius:0},children:String(r).replace(/\n$/,"")})]}):(0,t.jsx)("code",{className:"bg-muted/70 px-2 py-1 rounded-md text-sm font-mono text-foreground border",...a,children:r})},pre(e){let{children:s,...r}=e;return(0,t.jsx)("pre",{...r,children:s})},blockquote(e){let{children:s,...r}=e;return(0,t.jsx)("blockquote",{className:"border-l-4 border-primary/30 bg-muted/30 pl-6 pr-4 py-4 my-6 italic rounded-r-lg",...r,children:(0,t.jsx)("div",{className:"text-muted-foreground",children:s})})},a(e){let{children:s,href:r,...a}=e;return(0,t.jsx)("a",{href:r,className:"text-primary hover:text-primary/80 underline underline-offset-4 decoration-primary/30 hover:decoration-primary/60 transition-colors",...a,children:s})},table(e){let{children:s,...r}=e;return(0,t.jsx)("div",{className:"overflow-x-auto my-6 rounded-lg border border-border",children:(0,t.jsx)("table",{className:"min-w-full border-collapse",...r,children:s})})},thead(e){let{children:s,...r}=e;return(0,t.jsx)("thead",{className:"bg-muted/50",...r,children:s})},th(e){let{children:s,...r}=e;return(0,t.jsx)("th",{className:"border-b border-border px-4 py-3 text-left font-semibold text-foreground",...r,children:s})},td(e){let{children:s,...r}=e;return(0,t.jsx)("td",{className:"border-b border-border px-4 py-3 text-foreground",...r,children:s})},hr(e){let{...s}=e;return(0,t.jsx)("hr",{className:"my-8 border-t border-border",...s})},strong(e){let{children:s,...r}=e;return(0,t.jsx)("strong",{className:"font-semibold text-foreground",...r,children:s})},em(e){let{children:s,...r}=e;return(0,t.jsx)("em",{className:"italic text-foreground",...r,children:s})}},children:s})})},_=e=>{let{content:s,getToolResult:r}=e;if("text"===s.type)return(0,t.jsx)("div",{className:"w-full mx-2 my-6",children:(0,t.jsx)(P,{content:s.text})});if("thinking"===s.type)return(0,t.jsx)(R.Zp,{className:"bg-muted/50 border-dashed gap-2 py-3 mb-2",children:(0,t.jsxs)(S.Nt,{children:[(0,t.jsx)(S.R6,{asChild:!0,children:(0,t.jsx)(R.aR,{className:"cursor-pointer hover:bg-muted/80 rounded-t-lg transition-colors py-0 px-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(b.A,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(R.ZB,{className:"text-sm font-medium",children:"Thinking"}),(0,t.jsx)(f.A,{className:"h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})})}),(0,t.jsx)(S.Ke,{children:(0,t.jsx)(R.Wu,{className:"py-0 px-4",children:(0,t.jsx)("div",{className:"text-sm text-muted-foreground whitespace-pre-wrap font-mono",children:s.thinking})})})]})});if("tool_use"===s.type){let e=r(s.id);return(0,t.jsxs)(R.Zp,{className:"border-blue-200 bg-blue-50/50 dark:border-blue-800 dark:bg-blue-950/20 gap-2 py-3 mb-2",children:[(0,t.jsxs)(R.aR,{className:"py-0 px-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(j.A,{className:"h-4 w-4 text-blue-600 dark:text-blue-400"}),(0,t.jsx)(R.ZB,{className:"text-sm font-medium",children:"Tool Use"}),(0,t.jsx)(C,{variant:"outline",className:"border-blue-300 text-blue-700 dark:border-blue-700 dark:text-blue-300",children:s.name})]}),(0,t.jsxs)(R.BT,{className:"text-xs",children:["Tool execution with ID: ",s.id]})]}),(0,t.jsxs)(R.Wu,{className:"space-y-2 py-0 px-4",children:[(0,t.jsxs)(S.Nt,{children:[(0,t.jsx)(S.R6,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex items-center justify-between cursor-pointer hover:bg-muted/50 rounded p-2 -mx-2",children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:"Input Parameters"}),(0,t.jsx)(f.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),(0,t.jsx)(S.Ke,{children:(0,t.jsx)("div",{className:"bg-background rounded border p-2 mt-1",children:(0,t.jsx)("pre",{className:"text-xs overflow-x-auto",children:JSON.stringify(s.input,null,2)})})})]}),e&&(0,t.jsxs)(S.Nt,{children:[(0,t.jsx)(S.R6,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex items-center justify-between cursor-pointer hover:bg-muted/50 rounded p-2 -mx-2",children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:"Tool Result"}),(0,t.jsx)(f.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),(0,t.jsx)(S.Ke,{children:(0,t.jsx)("div",{className:"bg-background rounded border p-2 mt-1",children:"string"==typeof e.content?(0,t.jsx)("pre",{className:"text-xs overflow-x-auto whitespace-pre-line",children:e.content}):e.content.map(e=>{if("image"===e.type)return(0,t.jsx)(v.default,{src:"data:".concat(e.source.media_type,";base64,").concat(e.source.data),alt:"Tool Result"},e.source.data);if("text"===e.type)return(0,t.jsx)("pre",{className:"text-xs overflow-x-auto whitespace-pre-line",children:e.text},e.text);throw Error("Unexpected tool result content type")})})})]})]})]})}return s.type,null},U=e=>{let{children:s}=e;return(0,t.jsxs)(S.Nt,{children:[(0,t.jsx)(S.R6,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex items-center justify-between cursor-pointer hover:bg-muted/50 rounded p-2 -mx-2",children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:"Meta Information"}),(0,t.jsx)(f.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),(0,t.jsx)(S.Ke,{children:(0,t.jsx)("div",{className:"bg-background rounded border p-3 mt-2",children:s})})]})},Z=e=>{let{children:s}=e;return(0,t.jsxs)(S.Nt,{children:[(0,t.jsx)(S.R6,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex items-center justify-between cursor-pointer hover:bg-muted/50 rounded p-2 -mx-2",children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:"Summarized"}),(0,t.jsx)(f.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),(0,t.jsx)(S.Ke,{children:(0,t.jsx)("div",{className:"bg-background rounded border p-3 mt-2",children:(0,t.jsx)("pre",{className:"text-xs overflow-x-auto",children:s})})})]})},B=e=>{let{children:s}=e;return(0,t.jsxs)(S.Nt,{children:[(0,t.jsx)(S.R6,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex items-center justify-between cursor-pointer hover:bg-muted/50 rounded p-2 -mx-2",children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:"System Message"}),(0,t.jsx)(f.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),(0,t.jsx)(S.Ke,{children:(0,t.jsx)("div",{className:"bg-background rounded border p-3 mt-2",children:(0,t.jsx)("pre",{className:"text-xs overflow-x-auto",children:s})})})]})};var z=r(93021),E=r(28043),K=r(72676),F=r(5556);let D=RegExp("<(?<tag>[^>]+)>(?<content>\\s*[^<]*?\\s*)<\\/\\k<tag>>","g"),$=F.Ik({tag:F.Yj(),content:F.Yj()}),W=e=>{let{text:s}=e,r=(e=>{var s,r,t,a;let n=Array.from(e.matchAll(D)).map(e=>$.safeParse(e.groups)).filter(e=>e.success).map(e=>e.data);if(0===n.length)return{kind:"text",content:e};let l=null==(s=n.find(e=>"command-name"===e.tag))?void 0:s.content,d=null==(r=n.find(e=>"command-args"===e.tag))?void 0:r.content,i=null==(t=n.find(e=>"command-message"===e.tag))?void 0:t.content,o=null==(a=n.find(e=>"local-command-stdout"===e.tag))?void 0:a.content;switch(!0){case void 0!==l:return{kind:"command",commandName:l,commandArgs:d,commandMessage:i};case void 0!==o:return{kind:"local-command",stdout:o};default:return{kind:"text",content:e}}})(s);return"command"===r.kind?(0,t.jsxs)(R.Zp,{className:"border-green-200 bg-green-50/50 dark:border-green-800 dark:bg-green-950/20 gap-2 py-3 mb-3",children:[(0,t.jsx)(R.aR,{className:"py-0 px-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(K.A,{className:"h-4 w-4 text-green-600 dark:text-green-400"}),(0,t.jsx)(R.ZB,{className:"text-sm font-medium",children:"Claude Code Command"}),(0,t.jsx)(C,{variant:"outline",className:"border-green-300 text-green-700 dark:border-green-700 dark:text-green-300",children:r.commandName})]})}),r.commandArgs||r.commandMessage?(0,t.jsx)(R.Wu,{className:"py-0 px-4",children:(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{children:[r.commandArgs&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"Arguments:"}),(0,t.jsx)("div",{className:"bg-background rounded border p-2 mt-1",children:(0,t.jsx)("code",{className:"text-xs whitespace-pre-line",children:r.commandArgs})})]}),r.commandMessage&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"Message:"}),(0,t.jsx)("div",{className:"bg-background rounded border p-2 mt-1",children:(0,t.jsx)("code",{className:"text-xs whitespace-pre-line",children:r.commandMessage})})]})]})})}):null]}):"local-command"===r.kind?(0,t.jsxs)(R.Zp,{className:"border-green-200 bg-green-50/50 dark:border-green-800 dark:bg-green-950/20 gap-2 py-3 mb-3",children:[(0,t.jsx)(R.aR,{className:"py-0 px-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(K.A,{className:"h-4 w-4 text-green-600 dark:text-green-400"}),(0,t.jsx)(R.ZB,{className:"text-sm font-medium",children:"Local Command"})]})}),(0,t.jsx)(R.Wu,{className:"py-0 px-4",children:(0,t.jsx)("pre",{className:"text-xs overflow-x-auto",children:r.stdout})})]}):(0,t.jsx)(P,{className:"w-full px-3 py-3 mb-5 border border-border rounded-lg bg-slate-50",content:r.content})},q=e=>{let{content:s}=e;return"string"==typeof s?(0,t.jsx)(W,{text:s}):"text"===s.type?(0,t.jsx)(W,{text:s.text}):"image"===s.type?"base64"===s.source.type?(0,t.jsxs)(R.Zp,{className:"border-purple-200 bg-purple-50/50 dark:border-purple-800 dark:bg-purple-950/20",children:[(0,t.jsxs)(R.aR,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(z.A,{className:"h-4 w-4 text-purple-600 dark:text-purple-400"}),(0,t.jsx)(R.ZB,{className:"text-sm font-medium",children:"Image"}),(0,t.jsx)(C,{variant:"outline",className:"border-purple-300 text-purple-700 dark:border-purple-700 dark:text-purple-300",children:s.source.media_type})]}),(0,t.jsx)(R.BT,{className:"text-xs",children:"User uploaded image content"})]}),(0,t.jsx)(R.Wu,{children:(0,t.jsx)("div",{className:"rounded-lg border overflow-hidden bg-background",children:(0,t.jsx)(v.default,{src:"data:".concat(s.source.media_type,";base64,").concat(s.source.data),alt:"User uploaded content",className:"max-w-full h-auto max-h-96 object-contain"})})})]}):(0,t.jsx)(R.Zp,{className:"border-red-200 bg-red-50/50 dark:border-red-800 dark:bg-red-950/20",children:(0,t.jsxs)(R.aR,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(E.A,{className:"h-4 w-4 text-red-600 dark:text-red-400"}),(0,t.jsx)(R.ZB,{className:"text-sm font-medium",children:"Unsupported Media"}),(0,t.jsx)(C,{variant:"destructive",children:"Error"})]}),(0,t.jsx)(R.BT,{className:"text-xs",children:"Media type not supported for display"})]})}):(s.type,null)},L=e=>{let{conversation:s,getToolResult:r,isRootSidechain:a,getSidechainConversations:n}=e;if("summary"===s.type)return(0,t.jsx)(Z,{children:s.summary});if("system"===s.type)return(0,t.jsx)(B,{children:s.content});if(s.isSidechain)return a(s)?(0,t.jsx)(g,{conversation:s,sidechainConversations:n(s.uuid).map(e=>"summary"===e.type?e:{...e,isSidechain:!1}),getToolResult:r}):null;if("user"===s.type){let e="string"==typeof s.message.content?(0,t.jsx)(q,{content:s.message.content}):(0,t.jsx)("ul",{className:"w-full",id:"message-".concat(s.uuid),children:s.message.content.map(e=>(0,t.jsx)("li",{children:(0,t.jsx)(q,{content:e})},e.toString()))});return!0===s.isMeta?(0,t.jsx)(U,{children:e}):e}return"assistant"===s.type?(0,t.jsx)("ul",{className:"w-full",children:s.message.content.map(e=>(0,t.jsx)("li",{children:(0,t.jsx)(_,{content:e,getToolResult:r})},e.toString()))}):null},O=e=>{if("user"===e.type)return"user_".concat(e.uuid);if("assistant"===e.type)return"assistant_".concat(e.uuid);if("system"===e.type)return"system_".concat(e.uuid);if("summary"===e.type)return"summary_".concat(e.leafUuid);throw Error("Unknown conversation type: ".concat(e))},H=e=>{let{conversations:s,getToolResult:r}=e,{isRootSidechain:a,getSidechainConversations:n}=(e=>{let s=(0,i.useMemo)(()=>new Map(e.filter(e=>"summary"!==e.type).map(e=>[e.uuid,e])),[e]),r=(0,i.useCallback)(e=>{if("summary"===e.type||null===e.parentUuid)return e;let t=s.get(e.parentUuid);return void 0===t?e:r(t)},[s]),t=(0,i.useMemo)(()=>{let s=e.filter(e=>"summary"!==e.type).filter(e=>!0===e.isSidechain),t=new Map;for(let e of s){let s=r(e);if("summary"!==s.type)if(t.has(s.uuid)){var a;null==(a=t.get(s.uuid))||a.push(e)}else t.set(s.uuid,[e])}return t},[e,r]);return{isRootSidechain:(0,i.useCallback)(e=>"summary"!==e.type&&t.has(e.uuid),[t]),getSidechainConversations:(0,i.useCallback)(e=>{var s;return null!=(s=t.get(e))?s:[]},[t])}})(s);return(0,t.jsx)("ul",{children:s.flatMap(e=>{let s=(0,t.jsx)(L,{conversation:e,getToolResult:r,isRootSidechain:a,getSidechainConversations:n},O(e)),l="summary"!==e.type&&e.isSidechain;return[(0,t.jsx)("li",{className:"w-full flex ".concat(l||"assistant"===e.type||"system"===e.type||"summary"===e.type?"justify-start":"justify-end"),children:(0,t.jsx)("div",{className:"w-[85%]",children:s})},O(e))]})})};var V=r(59054),Q=r(26057),Y=r(70038),G=r(79588),J=r(31264),X=r(19611);let ee=e=>{let{projectId:s,sessionId:r}=e,a=(0,G.useRouter)(),l=(0,i.useRef)(null),d=(0,V.useMutation)({mutationFn:async e=>{let t=await u.s.api.projects[":projectId"].sessions[":sessionId"].resume.$post({param:{projectId:s,sessionId:r},json:{resumeMessage:e.message}});if(!t.ok)throw Error(t.statusText);return t.json()},onSuccess:e=>{m(""),a.push("/projects/".concat(s,"/sessions/").concat(e.nextSessionId,"#message-").concat(e.userMessageId))}}),[c,m]=(0,i.useState)(""),x=(0,i.useRef)(null),h=(0,i.useId)(),p=()=>{c.trim()&&d.mutate({message:c.trim()})};return(0,t.jsxs)(R.Zp,{className:"border-t rounded-t-none border-x-0 bg-background/50 backdrop-blur-sm mt-10",children:[(0,t.jsxs)(R.aR,{className:"pb-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(Q.A,{className:"w-5 h-5 text-primary"}),(0,t.jsx)(R.ZB,{className:"text-lg",children:"Continue Conversation"})]}),(0,t.jsx)(R.BT,{children:"Start a new conversation based on this session's context"})]}),(0,t.jsxs)(R.Wu,{className:"space-y-4",children:[d.error&&(0,t.jsxs)("div",{className:"flex items-center gap-2 p-3 text-sm text-destructive bg-destructive/10 border border-destructive/20 rounded-md",children:[(0,t.jsx)(E.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{children:"Failed to resume chat. Please try again."})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(J.T,{ref:l,value:c,onChange:e=>m(e.target.value),onKeyDown:e=>{var s;(null==(s=x.current)||!s.handleKeyDown(e))&&"Enter"===e.key&&e.shiftKey&&(e.preventDefault(),p())},placeholder:"Type your message here... (Start with / for commands, Shift+Enter to send)",className:"min-h-[80px] resize-none",disabled:d.isPending,maxLength:4e3,"aria-label":"Message input with command completion","aria-describedby":h,"aria-expanded":c.startsWith("/"),"aria-haspopup":"listbox",role:"combobox","aria-autocomplete":"list"}),(0,t.jsx)(X.s,{ref:x,projectId:s,inputValue:c,onCommandSelect:e=>{var s;m(e),null==(s=l.current)||s.focus()},className:"absolute top-full left-0 right-0"})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",id:h,children:[c.length,"/4000 characters • Use arrow keys to navigate commands"]}),(0,t.jsx)(o.$,{onClick:p,disabled:!c.trim()||d.isPending,size:"lg",className:"gap-2",children:d.isPending?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.A,{className:"w-4 h-4 animate-spin"}),"Starting..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Y.A,{className:"w-4 h-4"}),"Resume Chat"]})})]})]})]})]})};var es=r(62520),er=r(12240),et=r(51290),ea=r(5685);let en=e=>{let{sessions:s,currentSessionId:r,projectId:a}=e;return(0,t.jsxs)("div",{className:"h-full flex flex-col bg-sidebar text-sidebar-foreground",children:[(0,t.jsxs)("div",{className:"border-b border-sidebar-border p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsx)("h2",{className:"font-semibold text-lg",children:"Sessions"}),(0,t.jsx)(et.c,{projectId:a,trigger:(0,t.jsxs)(o.$,{size:"sm",variant:"outline",className:"gap-1.5 mr-5",children:[(0,t.jsx)(es.A,{className:"w-3.5 h-3.5"}),"New"]})})]}),(0,t.jsxs)("p",{className:"text-xs text-sidebar-foreground/70",children:[s.length," total"]})]}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto p-2 space-y-0.5",children:s.map(e=>{let s=e.id===r,n=null!==e.meta.firstCommand?(0,c.H)(e.meta.firstCommand):e.id;return(0,t.jsx)(d(),{href:"/projects/".concat(a,"/sessions/").concat(encodeURIComponent(e.id)),className:(0,w.cn)("block rounded-lg p-2.5 transition-all duration-200 hover:bg-blue-50/60 hover:border-blue-300/60 hover:shadow-sm border border-sidebar-border/40 bg-sidebar/30",s&&"bg-blue-100 border-blue-400 shadow-md ring-1 ring-blue-200/50 hover:bg-blue-100 hover:border-blue-400"),children:(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("h3",{className:"text-sm font-medium line-clamp-2 leading-tight text-sidebar-foreground",children:n}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1 text-xs text-sidebar-foreground/70",children:[(0,t.jsx)(Q.A,{className:"w-3 h-3"}),(0,t.jsx)("span",{children:e.meta.messageCount})]}),e.meta.lastModifiedAt&&(0,t.jsx)("span",{className:"text-xs text-sidebar-foreground/60",children:new Date(e.meta.lastModifiedAt).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]})]})},e.id)})})]})},el=e=>{let{currentSessionId:s,projectId:r,className:a}=e,{data:{sessions:n}}=(0,ea.B)(r),[l,d]=(0,i.useState)(!1);return(0,t.jsx)(S.Nt,{open:!l,onOpenChange:e=>d(!e),className:(0,w.cn)("hidden md:flex h-full",a),children:(0,t.jsx)("div",{className:"relative h-full",children:(0,t.jsxs)("div",{className:(0,w.cn)("h-full border-r border-sidebar-border transition-all duration-300 ease-in-out",l?"w-12":"w-72 lg:w-80"),children:[(0,t.jsx)(S.R6,{asChild:!0,children:(0,t.jsx)(o.$,{variant:"ghost",size:"icon",className:"absolute -right-3 top-4 z-10 bg-background border border-sidebar-border shadow-sm",children:(0,t.jsx)(er.A,{className:(0,w.cn)("w-4 h-4 transition-transform duration-200",l&&"rotate-180")})})}),(0,t.jsx)(S.Ke,{className:"h-full data-[state=closed]:animate-slide-out-to-left data-[state=open]:animate-slide-in-from-left",children:(0,t.jsx)(en,{sessions:n,currentSessionId:s,projectId:r})}),l&&(0,t.jsx)("div",{className:"h-full bg-sidebar border-r border-sidebar-border flex flex-col items-center pt-16",children:(0,t.jsx)(Q.A,{className:"w-5 h-5 text-sidebar-foreground/70"})})]})})})},ed=e=>{let{projectId:s,sessionId:r}=e,{session:l,conversations:h,getToolResult:p}=((e,s)=>{let r=(0,x.useSuspenseQuery)({...((e,s)=>({queryKey:["sessions",s],queryFn:async()=>(await u.s.api.projects[":projectId"].sessions[":sessionId"].$get({param:{projectId:e,sessionId:s}})).json()}))(e,s)}),t=(0,i.useMemo)(()=>new Map(r.data.session.conversations.flatMap(e=>"user"!==e.type||"string"==typeof e.message.content?[]:e.message.content.flatMap(e=>"string"==typeof e||"tool_result"!==e.type?[]:[[e.tool_use_id,e]]))),[r.data.session.conversations]),a=(0,i.useCallback)(e=>t.get(e),[t]);return{session:r.data.session,conversations:r.data.session.conversations,getToolResult:a}})(s,r),{isResummingTask:g}=(e=>{let{data:s,isLoading:r}=(0,m.useQuery)({queryKey:["runningTasks"],queryFn:async()=>{let e=await u.s.api.tasks.running.$get({});if(!e.ok)throw Error(e.statusText);return e.json()},refetchInterval:e=>{var s,r,t;return(null!=(t=null==(r=e.state.data)||null==(s=r.runningTasks)?void 0:s.length)?t:0)>0&&2e3},staleTime:3e4,gcTime:3e5,refetchOnWindowFocus:!0});return{...(0,i.useMemo)(()=>{var r;let t=null==s?void 0:s.runningTasks.find(s=>s.nextSessionId===e);return{isResummingTask:!!t,task:t,hasRunningTasks:(null!=(r=null==s?void 0:s.runningTasks.length)?r:0)>0}},[s,e]),isLoading:r}})(r),[b,f]=(0,i.useState)(0),j=(0,i.useRef)(null);return(0,i.useEffect)(()=>{if(g&&h.length!==b){f(h.length);let e=j.current;e&&e.scrollTo({top:e.scrollHeight,behavior:"smooth"})}},[h,g,b]),(0,t.jsxs)("div",{className:"flex h-screen",children:[(0,t.jsx)(el,{currentSessionId:r,projectId:s}),(0,t.jsx)("div",{className:"flex-1 flex flex-col overflow-hidden",children:(0,t.jsxs)("div",{ref:j,className:"max-w-none flex-1 overflow-y-auto",children:[(0,t.jsxs)("header",{className:"px-3 py-3 sticky top-0 z-10 bg-background w-full",children:[(0,t.jsx)(o.$,{asChild:!0,variant:"ghost",children:(0,t.jsxs)(d(),{href:"/projects/".concat(s),className:"flex items-center gap-2",children:[(0,t.jsx)(a.A,{className:"w-4 h-4"}),"Back to Session List"]})}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("div",{className:"flex items-center gap-3",children:(0,t.jsx)("h1",{className:"text-3xl font-bold break-all overflow-ellipsis line-clamp-2 px-5",children:null!==l.meta.firstCommand?(0,c.H)(l.meta.firstCommand):r})}),g&&(0,t.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-primary/10 border border-primary/20 rounded-lg",children:[(0,t.jsx)(n.A,{className:"w-4 h-4 animate-spin"}),(0,t.jsx)("div",{className:"flex-1",children:(0,t.jsx)("p",{className:"text-sm font-medium",children:"Conversation is being resumed..."})})]}),(0,t.jsxs)("p",{className:"text-muted-foreground font-mono text-sm",children:["Session ID: ",r]})]})]}),(0,t.jsxs)("main",{className:"w-full px-20 pb-20 relative z-5",children:[(0,t.jsx)(H,{conversations:h,getToolResult:p}),(0,t.jsx)(ee,{projectId:s,sessionId:r})]})]})})]})}},82791:(e,s,r)=>{Promise.resolve().then(r.bind(r,98613)),Promise.resolve().then(r.bind(r,72611)),Promise.resolve().then(r.bind(r,13881)),Promise.resolve().then(r.bind(r,85452)),Promise.resolve().then(r.bind(r,120)),Promise.resolve().then(r.bind(r,27740)),Promise.resolve().then(r.bind(r,59054)),Promise.resolve().then(r.bind(r,8120)),Promise.resolve().then(r.bind(r,9161)),Promise.resolve().then(r.bind(r,63812)),Promise.resolve().then(r.bind(r,86260)),Promise.resolve().then(r.bind(r,15312)),Promise.resolve().then(r.bind(r,45320)),Promise.resolve().then(r.bind(r,56812))}},e=>{e.O(0,[412,98,583,730,409,900,341,358],()=>e(e.s=82791)),_N_E=e.O()}]);