truecourse 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "truecourse",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Visualize your codebase architecture as an interactive graph",
5
5
  "type": "module",
6
6
  "bin": {
@@ -10,19 +10,19 @@
10
10
  "node": ">=20"
11
11
  },
12
12
  "dependencies": {
13
- "tree-sitter": "^0.21.1",
14
- "tree-sitter-typescript": "^0.21.2",
15
- "tree-sitter-javascript": "^0.21.4",
16
- "embedded-postgres": "18.3.0-beta.16",
13
+ "@clack/prompts": "^0.9.0",
14
+ "commander": "^12.1.0",
17
15
  "dotenv": "^16.4.0",
16
+ "embedded-postgres": "18.3.0-beta.16",
18
17
  "postgres": "^3.4.0",
19
- "commander": "^12.1.0",
20
- "@clack/prompts": "^0.9.0"
18
+ "tree-sitter": "^0.21.1",
19
+ "tree-sitter-javascript": "^0.21.4",
20
+ "tree-sitter-typescript": "^0.21.2"
21
21
  },
22
22
  "license": "MIT",
23
23
  "repository": {
24
24
  "type": "git",
25
- "url": "https://github.com/specmind/truecourse"
25
+ "url": "https://github.com/truecourse-ai/truecourse"
26
26
  },
27
27
  "keywords": [
28
28
  "codebase",
package/public/404.html CHANGED
@@ -1,4 +1,4 @@
1
- <!DOCTYPE html><!--qkaM__kJMthFE7DbnSDij--><html lang="en" class="font-sans"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/49e7ab4429e483d4.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-2f0ed87fd33e9d1c.js"/><script src="/_next/static/chunks/a51c26f2-7912c8e37f20294d.js" async=""></script><script src="/_next/static/chunks/597-63908a91b482ecc2.js" async=""></script><script src="/_next/static/chunks/main-app-6713e5440a400899.js" async=""></script><meta name="robots" content="noindex"/><link rel="preconnect" href="https://fonts.googleapis.com"/><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="anonymous"/><title>404: This page could not be found.</title><title>TrueCourse</title><meta name="description" content="Visualize your codebase architecture"/><link href="https://fonts.googleapis.com/css2?family=Geist:wght@100..900&amp;family=Inter:wght@400..700&amp;display=swap" rel="stylesheet"/><script>
1
+ <!DOCTYPE html><!--bPWCf_gzBKdFUdcy_Q1EJ--><html lang="en" class="font-sans"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/49e7ab4429e483d4.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-2f0ed87fd33e9d1c.js"/><script src="/_next/static/chunks/a51c26f2-7912c8e37f20294d.js" async=""></script><script src="/_next/static/chunks/597-63908a91b482ecc2.js" async=""></script><script src="/_next/static/chunks/main-app-598d148dafd4bc32.js" async=""></script><meta name="robots" content="noindex"/><link rel="preconnect" href="https://fonts.googleapis.com"/><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="anonymous"/><title>404: This page could not be found.</title><title>TrueCourse</title><meta name="description" content="Visualize your codebase architecture"/><link href="https://fonts.googleapis.com/css2?family=Geist:wght@100..900&amp;family=Inter:wght@400..700&amp;display=swap" rel="stylesheet"/><script>
2
2
  (function() {
3
3
  try {
4
4
  var stored = localStorage.getItem('theme');
@@ -9,4 +9,4 @@
9
9
  }
10
10
  } catch (e) {}
11
11
  })();
12
- </script><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="font-sans"><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-2f0ed87fd33e9d1c.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[2064,[],\"\"]\n3:I[982,[],\"\"]\n4:I[1597,[],\"OutletBoundary\"]\n6:I[7544,[],\"AsyncMetadataOutlet\"]\n8:I[1597,[],\"ViewportBoundary\"]\na:I[1597,[],\"MetadataBoundary\"]\nb:\"$Sreact.suspense\"\nd:I[2044,[],\"\"]\n:HL[\"/_next/static/css/49e7ab4429e483d4.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"qkaM-_kJMthFE7DbnSDij\",\"p\":\"\",\"c\":[\"\",\"_not-found\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/49e7ab4429e483d4.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"className\":\"font-sans\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"link\",null,{\"rel\":\"preconnect\",\"href\":\"https://fonts.googleapis.com\"}],[\"$\",\"link\",null,{\"rel\":\"preconnect\",\"href\":\"https://fonts.gstatic.com\",\"crossOrigin\":\"anonymous\"}],[\"$\",\"link\",null,{\"href\":\"https://fonts.googleapis.com/css2?family=Geist:wght@100..900\u0026family=Inter:wght@400..700\u0026display=swap\",\"rel\":\"stylesheet\"}],[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n (function() {\\n try {\\n var stored = localStorage.getItem('theme');\\n if (stored === 'dark' || (!stored \u0026\u0026 window.matchMedia('(prefers-color-scheme: dark)').matches)) {\\n document.documentElement.classList.add('dark');\\n } else {\\n document.documentElement.classList.remove('dark');\\n }\\n } catch (e) {}\\n })();\\n \"}}]]}],[\"$\",\"body\",null,{\"className\":\"font-sans\",\"suppressHydrationWarning\":true,\"children\":[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]]}]]}],{\"children\":[\"/_not-found\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L4\",null,{\"children\":[\"$L5\",[\"$\",\"$L6\",null,{\"promise\":\"$@7\"}]]}]]}],{},null,false]},null,false]},null,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],null],[\"$\",\"$La\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$b\",null,{\"fallback\":null,\"children\":\"$Lc\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$d\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n5:null\n"])</script><script>self.__next_f.push([1,"7:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"TrueCourse\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Visualize your codebase architecture\"}]],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"c:\"$7:metadata\"\n"])</script></body></html>
12
+ </script><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="font-sans"><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-2f0ed87fd33e9d1c.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[2064,[],\"\"]\n3:I[982,[],\"\"]\n4:I[1597,[],\"OutletBoundary\"]\n6:I[7544,[],\"AsyncMetadataOutlet\"]\n8:I[1597,[],\"ViewportBoundary\"]\na:I[1597,[],\"MetadataBoundary\"]\nb:\"$Sreact.suspense\"\nd:I[2044,[],\"\"]\n:HL[\"/_next/static/css/49e7ab4429e483d4.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"bPWCf-gzBKdFUdcy_Q1EJ\",\"p\":\"\",\"c\":[\"\",\"_not-found\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/49e7ab4429e483d4.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"className\":\"font-sans\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"link\",null,{\"rel\":\"preconnect\",\"href\":\"https://fonts.googleapis.com\"}],[\"$\",\"link\",null,{\"rel\":\"preconnect\",\"href\":\"https://fonts.gstatic.com\",\"crossOrigin\":\"anonymous\"}],[\"$\",\"link\",null,{\"href\":\"https://fonts.googleapis.com/css2?family=Geist:wght@100..900\u0026family=Inter:wght@400..700\u0026display=swap\",\"rel\":\"stylesheet\"}],[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n (function() {\\n try {\\n var stored = localStorage.getItem('theme');\\n if (stored === 'dark' || (!stored \u0026\u0026 window.matchMedia('(prefers-color-scheme: dark)').matches)) {\\n document.documentElement.classList.add('dark');\\n } else {\\n document.documentElement.classList.remove('dark');\\n }\\n } catch (e) {}\\n })();\\n \"}}]]}],[\"$\",\"body\",null,{\"className\":\"font-sans\",\"suppressHydrationWarning\":true,\"children\":[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]]}]]}],{\"children\":[\"/_not-found\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L4\",null,{\"children\":[\"$L5\",[\"$\",\"$L6\",null,{\"promise\":\"$@7\"}]]}]]}],{},null,false]},null,false]},null,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],null],[\"$\",\"$La\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$b\",null,{\"fallback\":null,\"children\":\"$Lc\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$d\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n5:null\n"])</script><script>self.__next_f.push([1,"7:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"TrueCourse\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Visualize your codebase architecture\"}]],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"c:\"$7:metadata\"\n"])</script></body></html>
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[492],{572:(e,t,l)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"HTTPAccessErrorFallback",{enumerable:!0,get:function(){return o}});let r=l(6409),n=l(6032);function o(e){let{status:t,message:l}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("title",{children:t+": "+l}),(0,r.jsx)("div",{style:n.styles.error,children:(0,r.jsxs)("div",{children:[(0,r.jsx)("style",{dangerouslySetInnerHTML:{__html:"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}),(0,r.jsx)("h1",{className:"next-error-h1",style:n.styles.h1,children:t}),(0,r.jsx)("div",{style:n.styles.desc,children:(0,r.jsx)("h2",{style:n.styles.h2,children:l})})]})})]})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},4042:(e,t,l)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o}});let r=l(6409),n=l(572),o=function(){return(0,r.jsx)("html",{children:(0,r.jsx)("body",{children:(0,r.jsx)(n.HTTPAccessErrorFallback,{status:404,message:"This page could not be found."})})})};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6032:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"styles",{enumerable:!0,get:function(){return l}});let l={error:{fontFamily:'system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"',height:"100vh",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},desc:{display:"inline-block"},h1:{display:"inline-block",margin:"0 20px 0 0",padding:"0 23px 0 0",fontSize:24,fontWeight:500,verticalAlign:"top",lineHeight:"49px"},h2:{fontSize:14,fontWeight:400,lineHeight:"49px",margin:0}};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6949:(e,t,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/_not-found/page",function(){return l(4042)}])}},e=>{e.O(0,[429,597,358],()=>e(e.s=6949)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[177],{5658:(e,s,_)=>{Promise.resolve().then(_.t.bind(_,7013,23))},7013:()=>{}},e=>{e.O(0,[726,429,597,358],()=>e(e.s=5658)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[974],{432:(e,t,a)=>{"use strict";a.d(t,{L8:()=>o,LY:()=>c,M2:()=>l,S:()=>m,Vl:()=>f,XT:()=>u,YN:()=>i,aE:()=>p,ge:()=>x,kP:()=>g,lS:()=>h,sv:()=>d});let r=(0,a(2011).T)();class s extends Error{constructor(e,t){super(t),this.status=e,this.name="ApiError"}}async function n(e,t){let a="".concat(r).concat(e),n=await fetch(a,{...t,headers:{"Content-Type":"application/json",...null==t?void 0:t.headers}});if(!n.ok){let e=await n.text().catch(()=>"Unknown error");throw new s(n.status,e)}return n.json()}function i(){return n("/api/repos")}function o(e){return n("/api/repos/".concat(e))}function d(e){return n("/api/repos",{method:"POST",body:JSON.stringify({path:e})})}function l(e){return n("/api/repos/".concat(e),{method:"DELETE"})}function c(e,t){return n("/api/repos/".concat(e,"/analyze"),{method:"POST",body:JSON.stringify({branch:t})})}function u(e,t){let a=t?"?branch=".concat(encodeURIComponent(t)):"";return n("/api/repos/".concat(e,"/graph").concat(a))}function m(e,t,a){let r=a?"?branch=".concat(encodeURIComponent(a)):"";return n("/api/repos/".concat(e,"/graph/positions").concat(r),{method:"PUT",body:JSON.stringify({positions:t})})}function p(e,t){let a=t?"?branch=".concat(encodeURIComponent(t)):"";return n("/api/repos/".concat(e,"/graph/positions").concat(a),{method:"DELETE"})}function x(e){return n("/api/repos/".concat(e,"/insights"))}function h(e){return n("/api/repos/".concat(e,"/conversations"))}function g(e,t){return n("/api/repos/".concat(e,"/chat/").concat(t))}function f(e,t,a,n,i,o){let d=new AbortController;return fetch("".concat(r,"/api/repos/").concat(e,"/chat"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:t,nodeContext:null==o?void 0:o.nodeContext,conversationId:null==o?void 0:o.conversationId}),signal:d.signal}).then(async e=>{var t;if(!e.ok)throw new s(e.status,await e.text());let r=e.headers.get("X-Conversation-Id")||void 0,i=null==(t=e.body)?void 0:t.getReader();if(!i)throw Error("No response body");let o=new TextDecoder,d="";for(;;){let{done:e,value:t}=await i.read();if(e)break;let s=(d+=o.decode(t,{stream:!0})).split("\n");for(let e of(d=s.pop()||"",s))if(e.startsWith("data: ")){let t=e.slice(6);if("[DONE]"===t)return void n(r);try{let e=JSON.parse(t);e.content&&a(e.content)}catch(e){a(t)}}}n(r)}).catch(e=>{"AbortError"!==e.name&&i(e)}),d}},553:(e,t,a)=>{"use strict";a.d(t,{Y:()=>h});var r=a(6409),s=a(7367),n=a(8925),i=a(1540),o=a(7054),d=a(3218),l=a(2368),c=a(9235),u=a(7505),m=a.n(u),p=a(4669),x=a(4846);function h(e){let{repoName:t,branches:a,selectedBranch:u,onBranchChange:h,onAnalyze:g,isAnalyzing:f,showBack:v,backHref:b="/",isSidebarOpen:y,onToggleSidebar:j}=e,[N,w]=(0,p.useState)(!1);return(0,p.useEffect)(()=>{w(document.documentElement.classList.contains("dark"))},[]),(0,r.jsxs)("header",{className:"flex h-14 items-center justify-between border-b border-border bg-card px-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[v&&(0,r.jsx)(m(),{href:b,className:(0,x.r)({variant:"ghost",size:"icon-sm"}),children:(0,r.jsx)(s.A,{className:"h-5 w-5"})}),(0,r.jsx)(m(),{href:"/",className:"text-lg font-bold text-foreground",children:"TrueCourse"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[t&&(0,r.jsx)("span",{className:"text-sm font-medium text-foreground",children:t}),a&&a.length>0&&(0,r.jsxs)("div",{className:"flex items-center gap-1.5 rounded-md border border-border bg-muted px-2 py-1",children:[(0,r.jsx)(n.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,r.jsx)("select",{value:u||"",onChange:e=>null==h?void 0:h(e.target.value),className:"bg-transparent text-sm text-foreground outline-none",children:a.map(e=>(0,r.jsx)("option",{value:e,children:e},e))})]}),g&&(0,r.jsxs)(x.$,{size:"sm",onClick:g,disabled:f,children:[f&&(0,r.jsx)(i.A,{className:"h-3.5 w-3.5 animate-spin"}),f?"Analyzing...":"Analyze"]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[j&&(0,r.jsx)(x.$,{variant:"ghost",size:"icon-sm",onClick:j,"aria-label":y?"Close panel":"Open panel",children:y?(0,r.jsx)(o.A,{className:"h-5 w-5"}):(0,r.jsx)(d.A,{className:"h-5 w-5"})}),(0,r.jsx)(x.$,{variant:"ghost",size:"icon-sm",onClick:()=>{let e=!N;w(e),document.documentElement.classList.toggle("dark",e),localStorage.setItem("theme",e?"dark":"light")},"aria-label":"Toggle theme",children:N?(0,r.jsx)(l.A,{className:"h-5 w-5"}):(0,r.jsx)(c.A,{className:"h-5 w-5"})})]})]})}},2011:(e,t,a)=>{"use strict";function r(){return""}a.d(t,{T:()=>r})},2054:(e,t,a)=>{"use strict";a.d(t,{p:()=>i});var r=a(6409);a(4669);var s=a(7350),n=a(6669);function i(e){let{className:t,type:a,...i}=e;return(0,r.jsx)(s.p,{type:a,"data-slot":"input",className:(0,n.cn)("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",t),...i})}},3316:(e,t,a)=>{"use strict";a.d(t,{BT:()=>d,Wu:()=>l,ZB:()=>o,Zp:()=>n,aR:()=>i,wL:()=>c});var r=a(6409);a(4669);var s=a(6669);function n(e){let{className:t,size:a="default",...n}=e;return(0,r.jsx)("div",{"data-slot":"card","data-size":a,className:(0,s.cn)("group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",t),...n})}function i(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"card-header",className:(0,s.cn)("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",t),...a})}function o(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"card-title",className:(0,s.cn)("text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",t),...a})}function d(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"card-description",className:(0,s.cn)("text-sm text-muted-foreground",t),...a})}function l(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"card-content",className:(0,s.cn)("px-4 group-data-[size=sm]/card:px-3",t),...a})}function c(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"card-footer",className:(0,s.cn)("flex items-center rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/card:p-3",t),...a})}},3840:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>k});var r=a(6409),s=a(553),n=a(4669),i=a(9383);let o=(0,i.A)("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);var d=a(1540),l=a(726),c=a(2054),u=a(4846);function m(e){let{onAdd:t}=e,[a,s]=(0,n.useState)(""),[i,m]=(0,n.useState)(!1),[p,x]=(0,n.useState)(null),h=async e=>{if(e.preventDefault(),a.trim()){m(!0),x(null);try{await t(a.trim()),s("")}catch(e){x(e instanceof Error?e.message:"Failed to add repository")}finally{m(!1)}}};return(0,r.jsxs)("form",{onSubmit:h,className:"w-full",children:[(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsxs)("div",{className:"relative flex-1",children:[(0,r.jsx)(o,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,r.jsx)(c.p,{type:"text",value:a,onChange:e=>s(e.target.value),placeholder:"Paste repository path...",className:"pl-10"})]}),(0,r.jsxs)(u.$,{type:"submit",disabled:i||!a.trim(),children:[i?(0,r.jsx)(d.A,{className:"h-4 w-4 animate-spin"}):(0,r.jsx)(l.A,{className:"h-4 w-4"}),"Add Repository"]})]}),p&&(0,r.jsx)("p",{className:"mt-2 text-sm text-destructive",children:p})]})}var p=a(7505),x=a.n(p);let h=(0,i.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"}]]),g=(0,i.A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);var f=a(1160);let v=(0,i.A)("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]),b=(0,i.A)("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);var y=a(3316);function j(e){let{repos:t,onAnalyze:a,onDelete:s}=e;return 0===t.length?(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed border-border py-16",children:[(0,r.jsx)(h,{className:"mb-4 h-12 w-12 text-muted-foreground"}),(0,r.jsx)("p",{className:"text-lg font-medium text-foreground",children:"No repositories yet"}),(0,r.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"Add a repository path above to get started"})]}):(0,r.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:t.map(e=>(0,r.jsxs)(y.Zp,{className:"flex flex-col transition-shadow hover:shadow-md",children:[(0,r.jsxs)(y.aR,{className:"flex flex-row items-start justify-between space-y-0 pb-2",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)(y.ZB,{className:"truncate text-base",children:e.name}),(0,r.jsx)(y.BT,{className:"mt-0.5 truncate text-xs",children:e.path})]}),(0,r.jsx)(u.$,{variant:"ghost",size:"icon-xs",onClick:()=>s(e.id),className:"ml-2 flex-shrink-0 text-muted-foreground hover:text-destructive","aria-label":"Delete repository",children:(0,r.jsx)(g,{className:"h-4 w-4"})})]}),(0,r.jsx)(y.Wu,{className:"pb-2",children:e.lastAnalyzed&&(0,r.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[(0,r.jsx)(f.A,{className:"h-3 w-3"}),(0,r.jsxs)("span",{children:["Analyzed"," ",new Date(e.lastAnalyzed).toLocaleDateString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})]})]})}),(0,r.jsxs)(y.wL,{className:"mt-auto gap-2",children:[(0,r.jsxs)(u.$,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>a(e.id),children:[(0,r.jsx)(v,{className:"h-3.5 w-3.5"}),"Analyze"]}),(0,r.jsxs)(x(),{href:"/repos/".concat(e.id),className:(0,u.r)({size:"sm",className:"flex-1"}),children:[(0,r.jsx)(b,{className:"h-3.5 w-3.5"}),"View Graph"]})]})]},e.id))})}var N=a(432),w=a(5500);function k(){let{repos:e,isLoading:t,error:a,addRepo:i,deleteRepo:o,analyzeRepo:l}=function(){let[e,t]=(0,n.useState)([]),[a,r]=(0,n.useState)(!0),[s,i]=(0,n.useState)(null),o=(0,n.useCallback)(async()=>{r(!0),i(null);try{let e=await N.YN();t(e)}catch(e){i(e instanceof Error?e.message:"Failed to fetch repos")}finally{r(!1)}},[]);(0,n.useEffect)(()=>{o()},[o]);let d=(0,n.useCallback)(async e=>{try{let a=await N.sv(e);return t(e=>[...e,a]),a}catch(e){throw i(e instanceof Error?e.message:"Failed to add repo"),e}},[]);return{repos:e,isLoading:a,error:s,addRepo:d,deleteRepo:(0,n.useCallback)(async e=>{try{await N.M2(e),t(t=>t.filter(t=>t.id!==e))}catch(e){throw i(e instanceof Error?e.message:"Failed to delete repo"),e}},[]),analyzeRepo:(0,n.useCallback)(async(e,t)=>{try{return await N.LY(e,t)}catch(e){throw i(e instanceof Error?e.message:"Failed to start analysis"),e}},[]),refetch:o}}(),c=async e=>{try{await l(e)}catch(e){}},u=async e=>{try{await o(e)}catch(e){}};return(0,r.jsxs)("div",{className:"flex min-h-screen flex-col",children:[(0,r.jsx)(s.Y,{}),(0,r.jsxs)("main",{className:"mx-auto w-full max-w-5xl flex-1 px-4 py-8",children:[(0,r.jsxs)("div",{className:"mb-8 text-center",children:[(0,r.jsx)("h1",{className:"text-3xl font-bold text-foreground",children:"TrueCourse"}),(0,r.jsx)("p",{className:"mt-2 text-muted-foreground",children:"Visualize and understand your codebase architecture"})]}),(0,r.jsx)("div",{className:"mb-8",children:(0,r.jsx)(m,{onAdd:i})}),a&&(0,r.jsx)(w.Fc,{variant:"destructive",className:"mb-6",children:(0,r.jsx)(w.TN,{children:a})}),t?(0,r.jsx)("div",{className:"flex items-center justify-center py-16",children:(0,r.jsx)(d.A,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):(0,r.jsx)(j,{repos:e,onAnalyze:c,onDelete:u})]})]})}},4846:(e,t,a)=>{"use strict";a.d(t,{$:()=>d,r:()=>o});var r=a(6409),s=a(7248),n=a(268),i=a(6669);let o=(0,n.F)("group/button inline-flex shrink-0 cursor-pointer items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function d(e){let{className:t,variant:a="default",size:n="default",...d}=e;return(0,r.jsx)(s.$,{"data-slot":"button",className:(0,i.cn)(o({variant:a,size:n,className:t})),...d})}},5500:(e,t,a)=>{"use strict";a.d(t,{Fc:()=>o,TN:()=>l,XL:()=>d});var r=a(6409);a(4669);var s=a(268),n=a(6669);let i=(0,s.F)("group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current"}},defaultVariants:{variant:"default"}});function o(e){let{className:t,variant:a,...s}=e;return(0,r.jsx)("div",{"data-slot":"alert",role:"alert",className:(0,n.cn)(i({variant:a}),t),...s})}function d(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"alert-title",className:(0,n.cn)("font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground",t),...a})}function l(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"alert-description",className:(0,n.cn)("text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",t),...a})}},6669:(e,t,a)=>{"use strict";a.d(t,{cn:()=>n});var r=a(1754),s=a(3225);function n(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,s.QP)((0,r.$)(t))}},8329:(e,t,a)=>{Promise.resolve().then(a.bind(a,3840))}},e=>{e.O(0,[414,429,597,358],()=>e(e.s=8329)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[302],{432:(e,t,a)=>{"use strict";a.d(t,{L8:()=>l,LY:()=>c,M2:()=>d,S:()=>x,Vl:()=>g,XT:()=>u,YN:()=>i,aE:()=>m,ge:()=>p,kP:()=>f,lS:()=>h,sv:()=>o});let r=(0,a(2011).T)();class s extends Error{constructor(e,t){super(t),this.status=e,this.name="ApiError"}}async function n(e,t){let a="".concat(r).concat(e),n=await fetch(a,{...t,headers:{"Content-Type":"application/json",...null==t?void 0:t.headers}});if(!n.ok){let e=await n.text().catch(()=>"Unknown error");throw new s(n.status,e)}return n.json()}function i(){return n("/api/repos")}function l(e){return n("/api/repos/".concat(e))}function o(e){return n("/api/repos",{method:"POST",body:JSON.stringify({path:e})})}function d(e){return n("/api/repos/".concat(e),{method:"DELETE"})}function c(e,t){return n("/api/repos/".concat(e,"/analyze"),{method:"POST",body:JSON.stringify({branch:t})})}function u(e,t){let a=t?"?branch=".concat(encodeURIComponent(t)):"";return n("/api/repos/".concat(e,"/graph").concat(a))}function x(e,t,a){let r=a?"?branch=".concat(encodeURIComponent(a)):"";return n("/api/repos/".concat(e,"/graph/positions").concat(r),{method:"PUT",body:JSON.stringify({positions:t})})}function m(e,t){let a=t?"?branch=".concat(encodeURIComponent(t)):"";return n("/api/repos/".concat(e,"/graph/positions").concat(a),{method:"DELETE"})}function p(e){return n("/api/repos/".concat(e,"/insights"))}function h(e){return n("/api/repos/".concat(e,"/conversations"))}function f(e,t){return n("/api/repos/".concat(e,"/chat/").concat(t))}function g(e,t,a,n,i,l){let o=new AbortController;return fetch("".concat(r,"/api/repos/").concat(e,"/chat"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:t,nodeContext:null==l?void 0:l.nodeContext,conversationId:null==l?void 0:l.conversationId}),signal:o.signal}).then(async e=>{var t;if(!e.ok)throw new s(e.status,await e.text());let r=e.headers.get("X-Conversation-Id")||void 0,i=null==(t=e.body)?void 0:t.getReader();if(!i)throw Error("No response body");let l=new TextDecoder,o="";for(;;){let{done:e,value:t}=await i.read();if(e)break;let s=(o+=l.decode(t,{stream:!0})).split("\n");for(let e of(o=s.pop()||"",s))if(e.startsWith("data: ")){let t=e.slice(6);if("[DONE]"===t)return void n(r);try{let e=JSON.parse(t);e.content&&a(e.content)}catch(e){a(t)}}}n(r)}).catch(e=>{"AbortError"!==e.name&&i(e)}),o}},553:(e,t,a)=>{"use strict";a.d(t,{Y:()=>h});var r=a(6409),s=a(7367),n=a(8925),i=a(1540),l=a(7054),o=a(3218),d=a(2368),c=a(9235),u=a(7505),x=a.n(u),m=a(4669),p=a(4846);function h(e){let{repoName:t,branches:a,selectedBranch:u,onBranchChange:h,onAnalyze:f,isAnalyzing:g,showBack:v,backHref:b="/",isSidebarOpen:j,onToggleSidebar:y}=e,[N,w]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{w(document.documentElement.classList.contains("dark"))},[]),(0,r.jsxs)("header",{className:"flex h-14 items-center justify-between border-b border-border bg-card px-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[v&&(0,r.jsx)(x(),{href:b,className:(0,p.r)({variant:"ghost",size:"icon-sm"}),children:(0,r.jsx)(s.A,{className:"h-5 w-5"})}),(0,r.jsx)(x(),{href:"/",className:"text-lg font-bold text-foreground",children:"TrueCourse"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[t&&(0,r.jsx)("span",{className:"text-sm font-medium text-foreground",children:t}),a&&a.length>0&&(0,r.jsxs)("div",{className:"flex items-center gap-1.5 rounded-md border border-border bg-muted px-2 py-1",children:[(0,r.jsx)(n.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,r.jsx)("select",{value:u||"",onChange:e=>null==h?void 0:h(e.target.value),className:"bg-transparent text-sm text-foreground outline-none",children:a.map(e=>(0,r.jsx)("option",{value:e,children:e},e))})]}),f&&(0,r.jsxs)(p.$,{size:"sm",onClick:f,disabled:g,children:[g&&(0,r.jsx)(i.A,{className:"h-3.5 w-3.5 animate-spin"}),g?"Analyzing...":"Analyze"]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[y&&(0,r.jsx)(p.$,{variant:"ghost",size:"icon-sm",onClick:y,"aria-label":j?"Close panel":"Open panel",children:j?(0,r.jsx)(l.A,{className:"h-5 w-5"}):(0,r.jsx)(o.A,{className:"h-5 w-5"})}),(0,r.jsx)(p.$,{variant:"ghost",size:"icon-sm",onClick:()=>{let e=!N;w(e),document.documentElement.classList.toggle("dark",e),localStorage.setItem("theme",e?"dark":"light")},"aria-label":"Toggle theme",children:N?(0,r.jsx)(d.A,{className:"h-5 w-5"}):(0,r.jsx)(c.A,{className:"h-5 w-5"})})]})]})}},2011:(e,t,a)=>{"use strict";function r(){return""}a.d(t,{T:()=>r})},2054:(e,t,a)=>{"use strict";a.d(t,{p:()=>i});var r=a(6409);a(4669);var s=a(7350),n=a(6669);function i(e){let{className:t,type:a,...i}=e;return(0,r.jsx)(s.p,{type:a,"data-slot":"input",className:(0,n.cn)("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",t),...i})}},3316:(e,t,a)=>{"use strict";a.d(t,{BT:()=>o,Wu:()=>d,ZB:()=>l,Zp:()=>n,aR:()=>i,wL:()=>c});var r=a(6409);a(4669);var s=a(6669);function n(e){let{className:t,size:a="default",...n}=e;return(0,r.jsx)("div",{"data-slot":"card","data-size":a,className:(0,s.cn)("group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",t),...n})}function i(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"card-header",className:(0,s.cn)("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",t),...a})}function l(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"card-title",className:(0,s.cn)("text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",t),...a})}function o(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"card-description",className:(0,s.cn)("text-sm text-muted-foreground",t),...a})}function d(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"card-content",className:(0,s.cn)("px-4 group-data-[size=sm]/card:px-3",t),...a})}function c(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"card-footer",className:(0,s.cn)("flex items-center rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/card:p-3",t),...a})}},4846:(e,t,a)=>{"use strict";a.d(t,{$:()=>o,r:()=>l});var r=a(6409),s=a(7248),n=a(268),i=a(6669);let l=(0,n.F)("group/button inline-flex shrink-0 cursor-pointer items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function o(e){let{className:t,variant:a="default",size:n="default",...o}=e;return(0,r.jsx)(s.$,{"data-slot":"button",className:(0,i.cn)(l({variant:a,size:n,className:t})),...o})}},5111:(e,t,a)=>{"use strict";a.d(t,{default:()=>eH});var r=a(6409),s=a(4669),n=a(9730),i=a(1540),l=a(5847),o=a(1791),d=a(8485),c=a(553),u=a(8670),x=a(7832),m=a(6176),p=a(1264),h=a(5676),f=a(6669);function g(e){let{className:t,children:a,...s}=e;return(0,r.jsxs)(u.V,{"data-slot":"scroll-area",className:(0,f.cn)("relative",t),...s,children:[(0,r.jsx)(x.B,{"data-slot":"scroll-area-viewport",className:"size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1",children:a}),(0,r.jsx)(v,{}),(0,r.jsx)(m.I,{})]})}function v(e){let{className:t,orientation:a="vertical",...s}=e;return(0,r.jsx)(p.V,{"data-slot":"scroll-area-scrollbar","data-orientation":a,orientation:a,className:(0,f.cn)("flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent",t),...s,children:(0,r.jsx)(h.l,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"})})}function b(e){let{children:t,isOpen:a,defaultWidth:n=320,minWidth:i=260,maxWidth:l=600}=e,[o,d]=(0,s.useState)(n),c=(0,s.useRef)(!1),u=(0,s.useCallback)(e=>{e.preventDefault(),c.current=!0;let t=e.clientX,a=e=>{c.current&&d(Math.min(l,Math.max(i,o+(t-e.clientX))))},r=()=>{c.current=!1,document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",r)};document.addEventListener("mousemove",a),document.addEventListener("mouseup",r)},[o,i,l]);return a?(0,r.jsxs)("aside",{className:"relative flex-shrink-0 border-l border-border bg-card",style:{width:o},children:[(0,r.jsx)("div",{className:"absolute inset-y-0 left-0 z-10 w-1 cursor-col-resize hover:bg-primary/30 active:bg-primary/50",onMouseDown:u}),(0,r.jsx)(g,{className:"h-full",children:t})]}):null}var j=a(2759);a(5285);var y=a(4819),N=a(8984),w=a(5929),k=a(6661),C=a(7113),z=a(8197),S=a(5784),A=a(3316);let E={api:"Routes & Controllers",service:"Business Logic",data:"Database & ORM",external:"HTTP Clients"},T=[{layer:"api",color:"#3b82f6",label:E.api},{layer:"service",color:"#10b981",label:E.service},{layer:"data",color:"#8b5cf6",label:E.data},{layer:"external",color:"#f97316",label:E.external}],_={frontend:N.A,"api-server":w.A,worker:k.A,library:C.A,unknown:C.A},F=(0,s.memo)(function(e){let{id:t,data:a,selected:s}=e,{label:n,description:i,serviceInfo:l,insightCount:o,hasHighSeverity:d,onExplain:c}=a,u=_[l.type]||C.A,x=l.layers.map(e=>e.layer);return(0,r.jsxs)(A.Zp,{className:"relative min-w-[220px] !gap-0 !py-0 rounded-md shadow-md transition-all ".concat(s?"border-primary ring-2 ring-primary ring-opacity-30":""),children:[(0,r.jsx)(j.h7,{type:"target",position:y.yX.Top,className:"!invisible"}),(0,r.jsxs)(A.Wu,{className:"p-3",children:[(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("div",{className:"flex h-9 w-9 flex-shrink-0 items-center justify-center rounded-lg bg-muted",children:(0,r.jsx)(u,{className:"h-5 w-5 text-primary"})}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("h3",{className:"truncate text-sm font-bold text-foreground",children:n}),l.framework&&(0,r.jsx)("p",{className:"mt-0.5 text-[10px] italic text-muted-foreground",children:l.framework})]}),d&&(0,r.jsx)("div",{className:"flex-shrink-0",children:(0,r.jsx)(z.A,{className:"h-4 w-4 text-amber-500"})})]}),(0,r.jsx)("div",{className:"mx-auto mt-2 w-2/3 border-t border-border"}),i&&(0,r.jsx)("p",{className:"mt-2 max-w-[240px] text-[10px] leading-tight text-muted-foreground",children:i}),x.length>0&&(0,r.jsx)("div",{className:"mt-2 flex flex-wrap gap-1",children:T.map(e=>{let{layer:t,label:a,color:s}=e;return x.includes(t)?(0,r.jsx)("span",{className:"inline-flex items-center rounded-sm border px-1.5 py-0.5 text-[9px] text-muted-foreground",style:{borderColor:s},children:a},t):null})}),o>0&&(0,r.jsxs)("div",{className:"mt-2 rounded-md bg-muted px-2 py-1 text-center text-[10px] text-muted-foreground",children:[o," insight",1!==o?"s":""]}),(0,r.jsx)("div",{className:"mx-auto mt-2 w-2/3 border-t border-border"}),(0,r.jsxs)("div",{className:"mt-2 flex items-center justify-between",children:[(0,r.jsxs)("span",{className:"text-[9px] text-muted-foreground",children:[l.fileCount," files"]}),c&&(0,r.jsxs)("button",{className:"flex cursor-pointer items-center gap-1 rounded-sm border border-border bg-muted px-1.5 py-0.5 text-[9px] text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",onClick:e=>{e.stopPropagation(),c(t)},children:[(0,r.jsx)(S.A,{className:"h-2.5 w-2.5"}),"Explain"]})]})]}),(0,r.jsx)(j.h7,{type:"source",position:y.yX.Bottom,className:"!invisible"})]})}),L=(0,s.memo)(function(e){var t,a;let{id:s,sourceX:n,sourceY:i,targetX:l,targetY:o,sourcePosition:d,targetPosition:c,data:u,selected:x}=e;null==u||u.dependencyCount;let m=null!=(t=null==u?void 0:u.hasHttpCalls)&&t,p=null!=(a=null==u?void 0:u.label)?a:"",[h,f,g]=(0,y.Fp)({sourceX:n,sourceY:i,targetX:l,targetY:o,sourcePosition:d,targetPosition:c});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("path",{id:s,d:h,fill:"none",stroke:x?"var(--primary)":"var(--muted-foreground)",strokeWidth:m?1.5:1,strokeDasharray:m?"8 4":"2 3",opacity:.6,className:"animate-edge-flow"}),p&&(0,r.jsx)(j.rV,{children:(0,r.jsx)("div",{style:{position:"absolute",transform:"translate(-50%, -50%) translate(".concat(f,"px, ").concat(g,"px)"),pointerEvents:"all"},className:"rounded bg-card px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground shadow-sm border border-border",children:p})})]})});var I=a(1047),R=a(5608),D=a(3503),P=a(3159),O=a(4846),$=a(6858);function V(e){let{className:t,orientation:a="horizontal",...s}=e;return(0,r.jsx)($.w,{"data-slot":"separator",orientation:a,className:(0,f.cn)("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",t),...s})}function H(e){let{onAutoLayout:t}=e,{zoomIn:a,zoomOut:s,fitView:n}=(0,j.VH)();return(0,r.jsxs)("div",{className:"absolute bottom-4 left-4 z-10 flex flex-col gap-1 rounded-lg border border-border bg-card p-1 shadow-md",children:[(0,r.jsx)(O.$,{variant:"ghost",size:"icon-xs",onClick:()=>a(),"aria-label":"Zoom in",children:(0,r.jsx)(I.A,{className:"h-4 w-4"})}),(0,r.jsx)(O.$,{variant:"ghost",size:"icon-xs",onClick:()=>s(),"aria-label":"Zoom out",children:(0,r.jsx)(R.A,{className:"h-4 w-4"})}),(0,r.jsx)(V,{}),(0,r.jsx)(O.$,{variant:"ghost",size:"icon-xs",onClick:()=>n({padding:.3,duration:300}),"aria-label":"Fit view",children:(0,r.jsx)(D.A,{className:"h-4 w-4"})}),t&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(V,{}),(0,r.jsx)(O.$,{variant:"ghost",size:"icon-xs",onClick:()=>{t(),setTimeout(()=>n({padding:.3,duration:300}),50)},"aria-label":"Auto layout",children:(0,r.jsx)(P.A,{className:"h-4 w-4"})})]})]})}var M=a(432);let B={service:F},X={dependency:L};function Z(e){let{initialNodes:t,initialEdges:a,onNodeSelect:n,onExplainNode:i,selectedNodeId:l,repoId:o,branch:d,onRefetch:c}=e,[u,x]=(0,s.useState)(!1),m=(0,s.useRef)([]),[p,h,f]=(0,j.ck)(t),[g,v,b]=(0,j.fM)(a);m.current=p,(0,s.useMemo)(()=>{h(t.map(e=>({...e,selected:e.id===l,data:{...e.data,onExplain:i}}))),v(a)},[t,a,h,v,i,l]);let y=(0,s.useCallback)(()=>{let e={};for(let t of m.current)e[t.id]=t.position;x(!0),M.S(o,e,d).finally(()=>x(!1))},[o,d]),N=(0,s.useCallback)(()=>{M.aE(o,d).then(()=>null==c?void 0:c()).catch(()=>{})},[o,d,c]),w=(0,s.useCallback)((e,t)=>{null==n||n(t.id)},[n]),k=(0,s.useCallback)(()=>{null==n||n(null)},[n]);return(0,r.jsxs)("div",{className:"h-full w-full",children:[u&&(0,r.jsx)("div",{className:"absolute left-1/2 top-3 z-20 -translate-x-1/2 rounded-md border border-border bg-card px-3 py-1 text-xs text-muted-foreground shadow-sm",children:"Saving..."}),(0,r.jsxs)(j.Gc,{nodes:p,edges:g,onNodesChange:f,onEdgesChange:b,onNodeClick:w,onNodeDragStop:y,onPaneClick:k,nodeTypes:B,edgeTypes:X,nodesConnectable:!1,fitView:!0,fitViewOptions:{padding:.3},minZoom:.1,maxZoom:2,proOptions:{hideAttribution:!0},children:[(0,r.jsx)(j.VS,{variant:j._5.Dots,gap:20,size:1}),(0,r.jsx)(j.of,{nodeStrokeWidth:3,className:"!bg-card !border-border",maskColor:"rgba(0, 0, 0, 0.1)"}),(0,r.jsx)(H,{onAutoLayout:N})]})]})}var Q=a(3417),W=a(8974),J=a(1879),U=a(7033),Y=a(113),q=a(268);let K=(0,q.F)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function G(e){let{className:t,variant:a="default",render:r,...s}=e;return(0,Y.C)({defaultTagName:"span",props:(0,U.v6)({className:(0,f.cn)(K({variant:a}),t)},s),render:r,state:{slot:"badge",variant:a}})}let ee={info:"border-l-blue-500",low:"border-l-green-500",medium:"border-l-yellow-500",high:"border-l-orange-500",critical:"border-l-red-500"},et={info:"bg-blue-500/10 text-blue-600 dark:text-blue-400",low:"bg-green-500/10 text-green-600 dark:text-green-400",medium:"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400",high:"bg-orange-500/10 text-orange-600 dark:text-orange-400",critical:"bg-red-500/10 text-red-600 dark:text-red-400"};function ea(e){let{insight:t}=e,[a,n]=(0,s.useState)(!1),i=async()=>{t.fixPrompt&&(await navigator.clipboard.writeText(t.fixPrompt),n(!0),setTimeout(()=>n(!1),2e3))};return(0,r.jsx)(A.Zp,{className:"border-l-4 rounded-sm p-3 ".concat(ee[t.severity]||"border-l-gray-500"),children:(0,r.jsxs)(A.Wu,{className:"p-0",children:[(0,r.jsxs)("div",{className:"mb-1.5 flex items-center gap-2",children:[(0,r.jsx)(G,{className:"rounded-sm px-2 py-0.5 text-[10px] font-semibold uppercase ".concat(et[t.severity]||""),children:t.type}),(0,r.jsx)(G,{className:"rounded-sm px-1.5 py-0.5 text-[10px] font-medium ".concat(et[t.severity]||""),children:t.severity})]}),(0,r.jsx)("h4",{className:"text-sm font-bold text-foreground",children:t.title}),(0,r.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-muted-foreground",children:t.content}),t.targetServiceName&&(0,r.jsxs)("p",{className:"mt-2 text-[10px] text-muted-foreground",children:["Target:"," ",(0,r.jsx)("span",{className:"font-medium text-foreground",children:t.targetServiceName})]}),t.fixPrompt&&(0,r.jsx)(O.$,{variant:"outline",size:"xs",onClick:i,className:"mt-2 text-[10px] text-muted-foreground hover:text-foreground",children:a?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(W.A,{className:"h-3 w-3 text-emerald-500"}),"Copied!"]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(J.A,{className:"h-3 w-3"}),"Copy Fix Prompt"]})})]})})}var er=a(7367),es=a(1160),en=a(726),ei=a(3418),el=a(8713);function eo(e){let{message:t}=e;if("system"===t.role)return(0,r.jsxs)("div",{className:"flex items-center justify-center gap-1.5 py-2",children:[(0,r.jsx)(ei.A,{className:"h-3 w-3 text-muted-foreground"}),(0,r.jsx)("span",{className:"text-[11px] text-muted-foreground",children:t.content})]});let a="user"===t.role;return a||t.content?a?(0,r.jsx)("div",{className:"flex justify-end",children:(0,r.jsx)("div",{className:"max-w-[85%] rounded-2xl bg-primary px-3 py-2 text-sm text-primary-foreground",children:(0,r.jsx)("p",{className:"whitespace-pre-wrap break-words leading-relaxed",children:t.content})})}):(0,r.jsx)("div",{className:"text-sm text-foreground",children:(0,r.jsx)("div",{className:"prose prose-sm dark:prose-invert max-w-none break-words leading-relaxed [&_p]:my-1 [&_ul]:my-1 [&_ol]:my-1 [&_li]:my-0 [&_h1]:text-base [&_h2]:text-sm [&_h3]:text-sm [&_pre]:text-xs [&_code]:text-xs",children:(0,r.jsx)(el.oz,{children:t.content})})}):null}var ed=a(4611);function ec(e){let{onSend:t,disabled:a}=e,[n,i]=(0,s.useState)(""),l=(0,s.useRef)(null),o=()=>{n.trim()&&!a&&(t(n.trim()),i(""),l.current&&(l.current.style.height="auto"))};return(0,r.jsx)("div",{className:"border-t border-border p-3",children:(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("textarea",{ref:l,value:n,onChange:e=>i(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),o())},onInput:()=>{let e=l.current;e&&(e.style.height="auto",e.style.height="".concat(Math.min(e.scrollHeight,150),"px"))},placeholder:"Ask about architecture...",rows:2,disabled:a,className:"w-full resize-none rounded-lg border border-border bg-muted px-3 py-2.5 pr-10 text-sm text-foreground placeholder:text-muted-foreground focus:border-primary focus:outline-none disabled:opacity-50",style:{maxHeight:150}}),(0,r.jsx)("button",{onClick:o,disabled:a||!n.trim(),"aria-label":"Send message",className:"absolute bottom-2.5 right-2.5 flex h-6 w-6 items-center justify-center rounded-full bg-primary text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-30 disabled:cursor-not-allowed cursor-pointer",children:(0,r.jsx)(ed.A,{className:"h-3.5 w-3.5"})})]})})}function eu(e){let{repoId:t,explainRequest:a,onExplainHandled:n}=e,{messages:l,isStreaming:o,isLoadingHistory:d,conversationList:c,sendMessage:u,explainNode:x,newConversation:m,fetchConversations:p,loadConversation:h}=function(e){let[t,a]=(0,s.useState)([]),[r,n]=(0,s.useState)(!1),[i,l]=(0,s.useState)([]),[o,d]=(0,s.useState)(!1),c=(0,s.useRef)(null),u=(0,s.useRef)(void 0),x=(0,s.useRef)(0),m=()=>(x.current+=1,"msg-".concat(x.current)),p=(0,s.useCallback)(t=>{if(!t.trim()||r)return;let s={id:m(),role:"user",content:t,timestamp:new Date},i=m(),l={id:i,role:"assistant",content:"",timestamp:new Date};a(e=>[...e,s,l]),n(!0),c.current=(0,M.Vl)(e,t,e=>{a(t=>t.map(t=>t.id===i?{...t,content:t.content+e}:t))},e=>{e&&(u.current=e),n(!1)},e=>{a(t=>t.map(t=>t.id===i?{...t,content:"Error: ".concat(e.message)}:t)),n(!1)},{conversationId:u.current})},[e,r]),h=(0,s.useCallback)((e,t)=>{p('Explain the "'.concat(t,'" service — what does it do, how does it fit into the architecture, and are there any concerns?'))},[p]),f=(0,s.useCallback)(()=>{c.current&&c.current.abort(),a([]),n(!1),u.current=void 0},[]),g=(0,s.useCallback)(async()=>{try{let t=await (0,M.lS)(e);l(t)}catch(e){}},[e]),v=(0,s.useCallback)(async t=>{if(!r){d(!0);try{let r=await (0,M.kP)(e,t);u.current=t,a(r.messages.map(e=>({id:e.id,role:e.role,content:e.content,timestamp:new Date(e.createdAt)})))}catch(e){}finally{d(!1)}}},[e,r]);return{messages:t,isStreaming:r,isLoadingHistory:o,conversationList:i,sendMessage:p,explainNode:h,newConversation:f,fetchConversations:g,loadConversation:v}}(t),f=(0,s.useRef)(null),g=(0,s.useRef)(null),[v,b]=(0,s.useState)(!1),j=l[l.length-1];return((0,s.useEffect)(()=>{g.current&&(g.current.scrollTop=g.current.scrollHeight)},[null==j?void 0:j.content,l.length]),(0,s.useEffect)(()=>{a&&a.nodeId!==f.current&&(f.current=a.nodeId,x(a.nodeId,a.nodeName),null==n||n())},[a,x,n]),v)?(0,r.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 border-b border-border px-3 py-2",children:[(0,r.jsx)("button",{onClick:()=>b(!1),className:"flex cursor-pointer items-center justify-center rounded-md p-1 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground","aria-label":"Back to chat",children:(0,r.jsx)(er.A,{className:"h-4 w-4"})}),(0,r.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Conversations"})]}),(0,r.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto",children:0===c.length?(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,r.jsx)(es.A,{className:"mb-3 h-8 w-8 text-muted-foreground"}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"No conversations yet"})]}):(0,r.jsx)("div",{className:"divide-y divide-border",children:c.map(e=>(0,r.jsxs)("button",{onClick:()=>{h(e.id),b(!1)},className:"w-full cursor-pointer px-3 py-2.5 text-left transition-colors hover:bg-accent",children:[(0,r.jsx)("p",{className:"truncate text-sm text-foreground",children:e.preview}),(0,r.jsx)("p",{className:"mt-0.5 text-[10px] text-muted-foreground",children:new Date(e.updatedAt).toLocaleDateString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})})]},e.id))})})]}):(0,r.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,r.jsxs)("div",{className:"flex items-center justify-end gap-1 border-b border-border px-2 py-1.5",children:[(0,r.jsx)("button",{onClick:()=>{m(),b(!1)},className:"flex cursor-pointer items-center justify-center rounded-md p-1 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground","aria-label":"New conversation",title:"New conversation",children:(0,r.jsx)(en.A,{className:"h-4 w-4"})}),(0,r.jsx)("button",{onClick:()=>{p(),b(!0)},className:"flex cursor-pointer items-center justify-center rounded-md p-1 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground","aria-label":"Conversation history",title:"Conversation history",children:(0,r.jsx)(es.A,{className:"h-4 w-4"})})]}),(0,r.jsx)("div",{ref:g,className:"min-h-0 flex-1 overflow-y-auto",children:(0,r.jsxs)("div",{className:"space-y-3 p-3",children:[d?(0,r.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,r.jsx)(i.A,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):0===l.length?(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,r.jsx)(S.A,{className:"mb-3 h-8 w-8 text-muted-foreground"}),(0,r.jsx)("p",{className:"text-sm font-medium text-foreground",children:"Architecture Chat"}),(0,r.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:"Ask questions about your codebase architecture"})]}):l.map(e=>(0,r.jsx)(eo,{message:e},e.id)),o&&(()=>{let e=[...l].reverse().find(e=>"assistant"===e.role),t=!!(null==e?void 0:e.content);return(0,r.jsx)("div",{className:"flex items-center gap-2 py-1 text-xs text-muted-foreground",children:t?(0,r.jsxs)("span",{className:"inline-flex gap-0.5",children:[(0,r.jsx)("span",{className:"h-1 w-1 animate-bounce rounded-full bg-muted-foreground [animation-delay:0ms]"}),(0,r.jsx)("span",{className:"h-1 w-1 animate-bounce rounded-full bg-muted-foreground [animation-delay:150ms]"}),(0,r.jsx)("span",{className:"h-1 w-1 animate-bounce rounded-full bg-muted-foreground [animation-delay:300ms]"})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.A,{className:"h-3 w-3 animate-spin"}),"Thinking..."]})})})()]})}),(0,r.jsx)(ec,{onSend:e=>{u(e)},disabled:o})]})}var ex=a(5133),em=a(6333),ep=a(5468);function eh(e){let{className:t,orientation:a="horizontal",...s}=e;return(0,r.jsx)(ex.p,{"data-slot":"tabs","data-orientation":a,className:(0,f.cn)("group/tabs flex gap-2 data-horizontal:flex-col",t),...s})}let ef=(0,q.F)("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function eg(e){let{className:t,variant:a="default",...s}=e;return(0,r.jsx)(em.j,{"data-slot":"tabs-list","data-variant":a,className:(0,f.cn)(ef({variant:a}),t),...s})}function ev(e){let{className:t,...a}=e;return(0,r.jsx)(ep.M,{"data-slot":"tabs-trigger",className:(0,f.cn)("relative inline-flex h-[calc(100%-1px)] flex-1 cursor-pointer items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",t),...a})}function eb(e){let{insights:t,isLoading:a,repoId:s,selectedService:n,selectedServiceName:l,activeTab:o="insights",onTabChange:d,explainRequest:c,onExplainHandled:u}=e,x="chat"===o;return(0,r.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,r.jsx)(eh,{value:o,onValueChange:e=>null==d?void 0:d(String(e)),className:"flex flex-shrink-0 flex-col",children:(0,r.jsxs)(eg,{variant:"line",className:"w-full",children:[(0,r.jsxs)(ev,{value:"insights",children:[(0,r.jsx)(Q.A,{className:"h-4 w-4"}),"Insights"]}),(0,r.jsxs)(ev,{value:"chat",children:[(0,r.jsx)(S.A,{className:"h-4 w-4"}),"Chat"]})]})}),(0,r.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto ".concat(x?"hidden":""),children:(0,r.jsxs)("div",{className:"p-3",children:[n&&(0,r.jsxs)("div",{className:"mb-3 rounded-md bg-muted px-3 py-1.5 text-xs text-muted-foreground",children:["Filtered by:"," ",(0,r.jsx)("span",{className:"font-medium text-foreground",children:l||n})]}),a?(0,r.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,r.jsx)(i.A,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):0===t.length?(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,r.jsx)(Q.A,{className:"mb-3 h-8 w-8 text-muted-foreground"}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:n?"No insights for this service":"No insights yet. Run an analysis to get insights."})]}):(0,r.jsx)("div",{className:"space-y-3",children:t.map(e=>(0,r.jsx)(ea,{insight:e},e.id))})]})}),(0,r.jsx)("div",{className:"min-h-0 flex-1 overflow-hidden ".concat(x?"":"hidden"),children:(0,r.jsx)(eu,{repoId:s,selectedService:n,explainRequest:c,onExplainHandled:u})})]})}var ej=a(6540),ey=a(5694),eN=a(8682),ew=a(2054);function ek(e){let{serviceTypes:t,frameworks:a,onFilterChange:n}=e,[i,l]=(0,s.useState)(!1),[o,d]=(0,s.useState)({excludedTypes:new Set,excludedFrameworks:new Set,searchQuery:"",showLabels:!0}),c=e=>{d(e),n(e)},u=o.excludedTypes.size>0||o.excludedFrameworks.size>0||o.searchQuery.length>0;return(0,r.jsxs)("div",{className:"absolute left-4 top-4 z-10",children:[(0,r.jsxs)(O.$,{variant:"outline",onClick:()=>l(!i),className:"shadow-md",children:[(0,r.jsx)(ej.A,{className:"h-4 w-4"}),"Filters",u&&(0,r.jsx)("span",{className:"ml-1 flex h-4 w-4 items-center justify-center rounded-full bg-primary text-[10px] text-primary-foreground",children:o.excludedTypes.size+o.excludedFrameworks.size+ +!!o.searchQuery})]}),i&&(0,r.jsx)(A.Zp,{className:"mt-2 w-64 shadow-lg",children:(0,r.jsxs)(A.Wu,{className:"p-4",children:[(0,r.jsxs)("div",{className:"mb-3 flex items-center justify-between",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Filters"}),(0,r.jsx)(O.$,{variant:"ghost",size:"icon-xs",onClick:()=>l(!1),children:(0,r.jsx)(ey.A,{className:"h-4 w-4"})})]}),(0,r.jsxs)("div",{className:"relative mb-3",children:[(0,r.jsx)(eN.A,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),(0,r.jsx)(ew.p,{type:"text",value:o.searchQuery,onChange:e=>c({...o,searchQuery:e.target.value}),placeholder:"Search services...",className:"pl-8 text-xs"})]}),(0,r.jsxs)("div",{className:"mb-3",children:[(0,r.jsx)("h4",{className:"mb-1.5 text-xs font-medium text-muted-foreground",children:"Service Type"}),(0,r.jsx)("div",{className:"space-y-1",children:t.map(e=>(0,r.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 text-xs text-foreground",children:[(0,r.jsx)("input",{type:"checkbox",checked:!o.excludedTypes.has(e),onChange:()=>(e=>{let t=new Set(o.excludedTypes);t.has(e)?t.delete(e):t.add(e),c({...o,excludedTypes:t})})(e),className:"rounded border-border accent-primary"}),e]},e))})]}),a.length>0&&(0,r.jsxs)("div",{className:"mb-3",children:[(0,r.jsx)("h4",{className:"mb-1.5 text-xs font-medium text-muted-foreground",children:"Framework"}),(0,r.jsx)("div",{className:"space-y-1",children:a.map(e=>(0,r.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 text-xs text-foreground",children:[(0,r.jsx)("input",{type:"checkbox",checked:!o.excludedFrameworks.has(e),onChange:()=>(e=>{let t=new Set(o.excludedFrameworks);t.has(e)?t.delete(e):t.add(e),c({...o,excludedFrameworks:t})})(e),className:"rounded border-border accent-primary"}),e]},e))})]}),(0,r.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 text-xs text-foreground",children:[(0,r.jsx)("input",{type:"checkbox",checked:o.showLabels,onChange:()=>c({...o,showLabels:!o.showLabels}),className:"rounded border-border accent-primary"}),"Show dependency labels"]})]})})]})}var eC=a(1010);let ez=(0,a(2011).T)()||window.location.origin,eS=null;function eA(){return eS||(eS=(0,eC.io)(ez,{autoConnect:!1,reconnection:!0,reconnectionAttempts:10,reconnectionDelay:1e3,reconnectionDelayMax:5e3,transports:["websocket","polling"]})),eS}function eE(e){let t=eA();t.connected&&t.emit("joinRepo",e)}var eT=a(5500),e_=a(4274),eF=a(1393),eL=a(9663),eI=a(3714),eR=a(4113);function eD(e){let{className:t,children:a,value:s,...n}=e;return(0,r.jsxs)(e_.w,{value:s,"data-slot":"progress",className:(0,f.cn)("flex flex-wrap gap-3",t),...n,children:[a,(0,r.jsx)(eP,{children:(0,r.jsx)(eO,{})})]})}function eP(e){let{className:t,...a}=e;return(0,r.jsx)(eF.X,{className:(0,f.cn)("relative flex h-1 w-full items-center overflow-x-hidden rounded-full bg-muted",t),"data-slot":"progress-track",...a})}function eO(e){let{className:t,...a}=e;return(0,r.jsx)(eL.Z,{"data-slot":"progress-indicator",className:(0,f.cn)("h-full bg-primary transition-all",t),...a})}function e$(e){let{className:t,...a}=e;return(0,r.jsx)(eI.u,{className:(0,f.cn)("text-sm font-medium",t),"data-slot":"progress-label",...a})}function eV(e){let{className:t,...a}=e;return(0,r.jsx)(eR.D,{className:(0,f.cn)("ml-auto text-sm text-muted-foreground tabular-nums",t),"data-slot":"progress-value",...a})}function eH(){var e,t;let a=(0,n.useParams)(),u=Array.isArray(a.slug)?a.slug[0]:"",[x,m]=(0,s.useState)(null),[p,h]=(0,s.useState)(),[f,g]=(0,s.useState)(null),[v,j]=(0,s.useState)([]),[y,N]=(0,s.useState)([]),[w,k]=(0,s.useState)(!1),[C,z]=(0,s.useState)("insights"),[S,A]=(0,s.useState)(null),[E,T]=(0,s.useState)(!0),{nodes:_,edges:F,isLoading:L,error:I,refetch:R}=function(e,t){let[a,r]=(0,s.useState)([]),[n,i]=(0,s.useState)([]),[l,o]=(0,s.useState)(!0),[d,c]=(0,s.useState)(null),u=(0,s.useCallback)(async()=>{if(e){o(!0),c(null);try{let a=await M.XT(e,t),s=a.nodes.map(e=>({id:e.id,type:"service",position:e.position,data:{label:e.data.label,description:e.data.description,serviceInfo:{type:e.data.serviceType||"unknown",framework:e.data.framework||null,fileCount:e.data.fileCount||0,layers:(e.data.layers||[]).map(e=>({layer:e,confidence:1,evidence:[]})),rootPath:e.data.rootPath||""},insightCount:0,hasHighSeverity:!1}})),n=a.edges.map(e=>({id:e.id,source:e.source,target:e.target,type:"dependency",data:{label:"http"===e.data.dependencyType?"".concat(e.data.dependencyCount||0," HTTP call").concat(1!==(e.data.dependencyCount||0)?"s":""):"".concat(e.data.dependencyCount||0," import").concat(1!==(e.data.dependencyCount||0)?"s":""),dependencyCount:e.data.dependencyCount||0,hasHttpCalls:"http"===e.data.dependencyType}}));r(s),i(n)}catch(e){c(e instanceof Error?e.message:"Failed to fetch graph")}finally{o(!1)}}},[e,t]);return(0,s.useEffect)(()=>{u()},[u]),{nodes:a,edges:n,isLoading:l,error:d,refetch:u,setNodes:r,setEdges:i}}(u,p),{isConnected:D,analysisProgress:P,onEvent:$}=function(e){let[t,a]=(0,s.useState)(!1),[r,n]=(0,s.useState)(null),i=(0,s.useRef)(new Map);return(0,s.useEffect)(()=>{let t=function(){let e=eA();return e.connected||e.connect(),e}();function r(){a(!0),e&&eE(e)}function s(){a(!1)}function l(e){n(e)}function o(e){var t;n(null),null==(t=i.current.get("analysis:complete"))||t.forEach(t=>t(e))}return t.on("connect",r),t.on("disconnect",s),t.on("analysis:progress",l),t.on("analysis:complete",o),t.on("files:changed",e=>{var t;null==(t=i.current.get("files:changed"))||t.forEach(t=>t(e))}),t.on("insights:ready",e=>{var t;n(null),null==(t=i.current.get("insights:ready"))||t.forEach(t=>t(e))}),t.connected&&e&&eE(e),()=>{e&&function(e){let t=eA();t.connected&&t.emit("leaveRepo",e)}(e),t.off("connect",r),t.off("disconnect",s),t.off("analysis:progress",l),t.off("analysis:complete",o),(null==eS?void 0:eS.connected)&&eS.disconnect()}},[e]),{isConnected:t,analysisProgress:r,onEvent:(0,s.useCallback)((e,t)=>{let a=i.current.get(e)||[];return a.push(t),i.current.set(e,a),()=>{let a=i.current.get(e)||[];i.current.set(e,a.filter(e=>e!==t))}},[])}}(u),{insights:V,isLoading:H,refetch:B}=function(e,t){let[a,r]=(0,s.useState)([]),[n,i]=(0,s.useState)(!0),[l,o]=(0,s.useState)(null),d=(0,s.useCallback)(async()=>{if(e){i(!0),o(null);try{let t=await M.ge(e);r(t)}catch(e){o(e instanceof Error?e.message:"Failed to fetch insights")}finally{i(!1)}}},[e]);return(0,s.useEffect)(()=>{d()},[d]),{insights:(0,s.useMemo)(()=>{let e={critical:0,high:1,medium:2,low:3,info:4},r=[...a].sort((t,a)=>{var r,s;return(null!=(r=e[t.severity])?r:5)-(null!=(s=e[a.severity])?s:5)});return t?r.filter(e=>e.targetServiceId===t):r},[a,t]),allInsights:a,isLoading:n,error:l,refetch:d}}(u,null!=f?f:void 0);(0,s.useEffect)(()=>{u&&M.L8(u).then(m).catch(()=>{})},[u]),(0,s.useEffect)(()=>{(null==x?void 0:x.defaultBranch)&&!p&&h(x.defaultBranch)},[x,p]),(0,s.useEffect)(()=>{j(_),N(F)},[_,F]),(0,s.useEffect)(()=>$("analysis:complete",()=>{k(!1),R()}),[$,R]),(0,s.useEffect)(()=>$("insights:ready",()=>{B()}),[$,B]);let X=async()=>{try{k(!0),await M.LY(u,p)}catch(e){k(!1)}},Q=(0,s.useCallback)(e=>{g(e)},[]),W=(0,s.useCallback)(e=>{var t;let a=(null==(t=_.find(t=>t.id===e))?void 0:t.data.label)||e;g(e),z("chat"),A({nodeId:e,nodeName:a})},[_]),J=(0,s.useCallback)(e=>{let t=_;if(e.excludedTypes.size>0&&(t=t.filter(t=>!e.excludedTypes.has(t.data.serviceInfo.type))),e.excludedFrameworks.size>0&&(t=t.filter(t=>{let a=t.data.serviceInfo.framework;return!a||!e.excludedFrameworks.has(a)})),e.searchQuery){let a=e.searchQuery.toLowerCase();t=t.filter(e=>e.data.label.toLowerCase().includes(a))}let a=new Set(t.map(e=>e.id)),r=F.filter(e=>a.has(e.source)&&a.has(e.target));j(t),N(r)},[_,F]);u||(0,n.redirect)("/");let U=f&&null!=(t=null==(e=_.find(e=>e.id===f))?void 0:e.data.label)?t:null,Y=[...new Set(_.map(e=>e.data.serviceInfo.type))],q=[...new Set(_.map(e=>e.data.serviceInfo.framework).filter(e=>!!e))];return(0,r.jsxs)("div",{className:"flex h-screen flex-col",children:[(0,r.jsx)(c.Y,{repoName:null==x?void 0:x.name,branches:null==x?void 0:x.branches,selectedBranch:p,onBranchChange:h,onAnalyze:X,isAnalyzing:w,showBack:!0,backHref:"/",isSidebarOpen:E,onToggleSidebar:()=>T(e=>!e)}),(0,r.jsxs)("div",{className:"flex flex-1 overflow-hidden",children:[(0,r.jsxs)("div",{className:"relative flex-1",children:[P&&(0,r.jsxs)("div",{className:"absolute bottom-4 left-1/2 z-20 w-72 -translate-x-1/2 rounded-lg border border-border bg-card p-3 shadow-lg",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,r.jsx)(i.A,{className:"h-3.5 w-3.5 shrink-0 animate-spin text-primary"}),(0,r.jsx)(eD,{value:P.percent,className:"flex-1 gap-1",children:(0,r.jsxs)("div",{className:"flex w-full items-center justify-between",children:[(0,r.jsx)(e$,{className:"text-[11px] font-medium capitalize",children:P.step}),(0,r.jsx)(eV,{className:"text-[11px]"})]})})]}),P.detail&&(0,r.jsx)("p",{className:"mt-1.5 pl-6 text-[10px] text-muted-foreground",children:P.detail})]}),(0,r.jsx)("div",{className:"absolute right-3 top-2 z-20 flex items-center gap-1.5 rounded-full bg-card px-2 py-1 text-[10px] shadow-sm border border-border",children:D?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.A,{className:"h-3 w-3 text-emerald-500"}),(0,r.jsx)("span",{className:"text-emerald-500",children:"Live"})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.A,{className:"h-3 w-3 text-muted-foreground"}),(0,r.jsx)("span",{className:"text-muted-foreground",children:"Offline"})]})}),L?(0,r.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,r.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,r.jsx)(i.A,{className:"h-10 w-10 animate-spin text-primary"}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading graph..."})]})}):I?(0,r.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,r.jsxs)("div",{className:"flex flex-col items-center gap-3 text-center",children:[(0,r.jsx)(d.A,{className:"h-10 w-10 text-destructive"}),(0,r.jsxs)(eT.Fc,{variant:"destructive",className:"max-w-sm",children:[(0,r.jsx)(eT.XL,{children:"Failed to load graph"}),(0,r.jsx)(eT.TN,{children:I})]}),(0,r.jsx)(O.$,{onClick:()=>R(),className:"mt-2",children:"Retry"})]})}):0===v.length&&0===_.length?(0,r.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,r.jsxs)("div",{className:"flex flex-col items-center gap-3 text-center",children:[(0,r.jsx)(d.A,{className:"h-10 w-10 text-muted-foreground"}),(0,r.jsxs)(eT.Fc,{className:"max-w-sm",children:[(0,r.jsx)(eT.XL,{children:"No graph data"}),(0,r.jsx)(eT.TN,{children:"Run an analysis to generate the architecture graph"})]}),(0,r.jsxs)(O.$,{onClick:X,disabled:w,className:"mt-2",children:[w&&(0,r.jsx)(i.A,{className:"h-4 w-4 animate-spin"}),w?"Analyzing...":"Analyze Repository"]})]})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ek,{serviceTypes:Y,frameworks:q,onFilterChange:J}),(0,r.jsx)(Z,{initialNodes:v,initialEdges:y,onNodeSelect:Q,onExplainNode:W,selectedNodeId:f,repoId:u,branch:p,onRefetch:R})]})]}),(0,r.jsx)(b,{isOpen:E,children:(0,r.jsx)(eb,{insights:V,isLoading:H,repoId:u,selectedService:f,selectedServiceName:U,activeTab:C,onTabChange:z,explainRequest:S,onExplainHandled:()=>A(null)})})]})]})}},5500:(e,t,a)=>{"use strict";a.d(t,{Fc:()=>l,TN:()=>d,XL:()=>o});var r=a(6409);a(4669);var s=a(268),n=a(6669);let i=(0,s.F)("group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current"}},defaultVariants:{variant:"default"}});function l(e){let{className:t,variant:a,...s}=e;return(0,r.jsx)("div",{"data-slot":"alert",role:"alert",className:(0,n.cn)(i({variant:a}),t),...s})}function o(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"alert-title",className:(0,n.cn)("font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground",t),...a})}function d(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"alert-description",className:(0,n.cn)("text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",t),...a})}},6669:(e,t,a)=>{"use strict";a.d(t,{cn:()=>n});var r=a(1754),s=a(3225);function n(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,s.QP)((0,r.$)(t))}},6916:(e,t,a)=>{Promise.resolve().then(a.bind(a,5111))}},e=>{e.O(0,[206,763,414,728,429,597,358],()=>e(e.s=6916)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[302],{432:(e,t,a)=>{"use strict";a.d(t,{L8:()=>l,LY:()=>c,M2:()=>d,S:()=>x,Vl:()=>g,XT:()=>u,YN:()=>i,aE:()=>m,ge:()=>p,kP:()=>f,lS:()=>h,sv:()=>o});let r=(0,a(2011).T)();class s extends Error{constructor(e,t){super(t),this.status=e,this.name="ApiError"}}async function n(e,t){let a="".concat(r).concat(e),n=await fetch(a,{...t,headers:{"Content-Type":"application/json",...null==t?void 0:t.headers}});if(!n.ok){let e=await n.text().catch(()=>"Unknown error");throw new s(n.status,e)}return n.json()}function i(){return n("/api/repos")}function l(e){return n("/api/repos/".concat(e))}function o(e){return n("/api/repos",{method:"POST",body:JSON.stringify({path:e})})}function d(e){return n("/api/repos/".concat(e),{method:"DELETE"})}function c(e,t){return n("/api/repos/".concat(e,"/analyze"),{method:"POST",body:JSON.stringify({branch:t})})}function u(e,t){let a=t?"?branch=".concat(encodeURIComponent(t)):"";return n("/api/repos/".concat(e,"/graph").concat(a))}function x(e,t,a){let r=a?"?branch=".concat(encodeURIComponent(a)):"";return n("/api/repos/".concat(e,"/graph/positions").concat(r),{method:"PUT",body:JSON.stringify({positions:t})})}function m(e,t){let a=t?"?branch=".concat(encodeURIComponent(t)):"";return n("/api/repos/".concat(e,"/graph/positions").concat(a),{method:"DELETE"})}function p(e){return n("/api/repos/".concat(e,"/insights"))}function h(e){return n("/api/repos/".concat(e,"/conversations"))}function f(e,t){return n("/api/repos/".concat(e,"/chat/").concat(t))}function g(e,t,a,n,i,l){let o=new AbortController;return fetch("".concat(r,"/api/repos/").concat(e,"/chat"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:t,nodeContext:null==l?void 0:l.nodeContext,conversationId:null==l?void 0:l.conversationId}),signal:o.signal}).then(async e=>{var t;if(!e.ok)throw new s(e.status,await e.text());let r=e.headers.get("X-Conversation-Id")||void 0,i=null==(t=e.body)?void 0:t.getReader();if(!i)throw Error("No response body");let l=new TextDecoder,o="";for(;;){let{done:e,value:t}=await i.read();if(e)break;let s=(o+=l.decode(t,{stream:!0})).split("\n");for(let e of(o=s.pop()||"",s))if(e.startsWith("data: ")){let t=e.slice(6);if("[DONE]"===t)return void n(r);try{let e=JSON.parse(t);e.content&&a(e.content)}catch(e){a(t)}}}n(r)}).catch(e=>{"AbortError"!==e.name&&i(e)}),o}},553:(e,t,a)=>{"use strict";a.d(t,{Y:()=>h});var r=a(6409),s=a(7367),n=a(8925),i=a(1540),l=a(7054),o=a(3218),d=a(2368),c=a(9235),u=a(7505),x=a.n(u),m=a(4669),p=a(4846);function h(e){let{repoName:t,branches:a,selectedBranch:u,onBranchChange:h,onAnalyze:f,isAnalyzing:g,showBack:v,backHref:b="/",isSidebarOpen:j,onToggleSidebar:y}=e,[N,w]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{w(document.documentElement.classList.contains("dark"))},[]),(0,r.jsxs)("header",{className:"flex h-14 items-center justify-between border-b border-border bg-card px-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[v&&(0,r.jsx)(x(),{href:b,className:(0,p.r)({variant:"ghost",size:"icon-sm"}),children:(0,r.jsx)(s.A,{className:"h-5 w-5"})}),(0,r.jsx)(x(),{href:"/",className:"text-lg font-bold text-foreground",children:"TrueCourse"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[t&&(0,r.jsx)("span",{className:"text-sm font-medium text-foreground",children:t}),a&&a.length>0&&(0,r.jsxs)("div",{className:"flex items-center gap-1.5 rounded-md border border-border bg-muted px-2 py-1",children:[(0,r.jsx)(n.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,r.jsx)("select",{value:u||"",onChange:e=>null==h?void 0:h(e.target.value),className:"bg-transparent text-sm text-foreground outline-none",children:a.map(e=>(0,r.jsx)("option",{value:e,children:e},e))})]}),f&&(0,r.jsxs)(p.$,{size:"sm",onClick:f,disabled:g,children:[g&&(0,r.jsx)(i.A,{className:"h-3.5 w-3.5 animate-spin"}),g?"Analyzing...":"Analyze"]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[y&&(0,r.jsx)(p.$,{variant:"ghost",size:"icon-sm",onClick:y,"aria-label":j?"Close panel":"Open panel",children:j?(0,r.jsx)(l.A,{className:"h-5 w-5"}):(0,r.jsx)(o.A,{className:"h-5 w-5"})}),(0,r.jsx)(p.$,{variant:"ghost",size:"icon-sm",onClick:()=>{let e=!N;w(e),document.documentElement.classList.toggle("dark",e),localStorage.setItem("theme",e?"dark":"light")},"aria-label":"Toggle theme",children:N?(0,r.jsx)(d.A,{className:"h-5 w-5"}):(0,r.jsx)(c.A,{className:"h-5 w-5"})})]})]})}},2011:(e,t,a)=>{"use strict";function r(){return""}a.d(t,{T:()=>r})},2054:(e,t,a)=>{"use strict";a.d(t,{p:()=>i});var r=a(6409);a(4669);var s=a(7350),n=a(6669);function i(e){let{className:t,type:a,...i}=e;return(0,r.jsx)(s.p,{type:a,"data-slot":"input",className:(0,n.cn)("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",t),...i})}},3316:(e,t,a)=>{"use strict";a.d(t,{BT:()=>o,Wu:()=>d,ZB:()=>l,Zp:()=>n,aR:()=>i,wL:()=>c});var r=a(6409);a(4669);var s=a(6669);function n(e){let{className:t,size:a="default",...n}=e;return(0,r.jsx)("div",{"data-slot":"card","data-size":a,className:(0,s.cn)("group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",t),...n})}function i(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"card-header",className:(0,s.cn)("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",t),...a})}function l(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"card-title",className:(0,s.cn)("text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",t),...a})}function o(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"card-description",className:(0,s.cn)("text-sm text-muted-foreground",t),...a})}function d(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"card-content",className:(0,s.cn)("px-4 group-data-[size=sm]/card:px-3",t),...a})}function c(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"card-footer",className:(0,s.cn)("flex items-center rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/card:p-3",t),...a})}},4846:(e,t,a)=>{"use strict";a.d(t,{$:()=>o,r:()=>l});var r=a(6409),s=a(7248),n=a(268),i=a(6669);let l=(0,n.F)("group/button inline-flex shrink-0 cursor-pointer items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function o(e){let{className:t,variant:a="default",size:n="default",...o}=e;return(0,r.jsx)(s.$,{"data-slot":"button",className:(0,i.cn)(l({variant:a,size:n,className:t})),...o})}},5111:(e,t,a)=>{"use strict";a.d(t,{default:()=>eH});var r=a(6409),s=a(4669),n=a(9730),i=a(1540),l=a(5847),o=a(1791),d=a(8485),c=a(553),u=a(8670),x=a(7832),m=a(6176),p=a(1264),h=a(5676),f=a(6669);function g(e){let{className:t,children:a,...s}=e;return(0,r.jsxs)(u.V,{"data-slot":"scroll-area",className:(0,f.cn)("relative",t),...s,children:[(0,r.jsx)(x.B,{"data-slot":"scroll-area-viewport",className:"size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1",children:a}),(0,r.jsx)(v,{}),(0,r.jsx)(m.I,{})]})}function v(e){let{className:t,orientation:a="vertical",...s}=e;return(0,r.jsx)(p.V,{"data-slot":"scroll-area-scrollbar","data-orientation":a,orientation:a,className:(0,f.cn)("flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent",t),...s,children:(0,r.jsx)(h.l,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"})})}function b(e){let{children:t,isOpen:a,defaultWidth:n=320,minWidth:i=260,maxWidth:l=600}=e,[o,d]=(0,s.useState)(n),c=(0,s.useRef)(!1),u=(0,s.useCallback)(e=>{e.preventDefault(),c.current=!0;let t=e.clientX,a=e=>{c.current&&d(Math.min(l,Math.max(i,o+(t-e.clientX))))},r=()=>{c.current=!1,document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",r)};document.addEventListener("mousemove",a),document.addEventListener("mouseup",r)},[o,i,l]);return a?(0,r.jsxs)("aside",{className:"relative flex-shrink-0 border-l border-border bg-card",style:{width:o},children:[(0,r.jsx)("div",{className:"absolute inset-y-0 left-0 z-10 w-1 cursor-col-resize hover:bg-primary/30 active:bg-primary/50",onMouseDown:u}),(0,r.jsx)(g,{className:"h-full",children:t})]}):null}var j=a(2759);a(5285);var y=a(4819),N=a(8984),w=a(5929),k=a(6661),C=a(7113),z=a(8197),S=a(5784),A=a(3316);let E={api:"Routes & Controllers",service:"Business Logic",data:"Database & ORM",external:"HTTP Clients"},T=[{layer:"api",color:"#3b82f6",label:E.api},{layer:"service",color:"#10b981",label:E.service},{layer:"data",color:"#8b5cf6",label:E.data},{layer:"external",color:"#f97316",label:E.external}],_={frontend:N.A,"api-server":w.A,worker:k.A,library:C.A,unknown:C.A},F=(0,s.memo)(function(e){let{id:t,data:a,selected:s}=e,{label:n,description:i,serviceInfo:l,insightCount:o,hasHighSeverity:d,onExplain:c}=a,u=_[l.type]||C.A,x=l.layers.map(e=>e.layer);return(0,r.jsxs)(A.Zp,{className:"relative min-w-[220px] !gap-0 !py-0 rounded-md shadow-md transition-all ".concat(s?"border-primary ring-2 ring-primary ring-opacity-30":""),children:[(0,r.jsx)(j.h7,{type:"target",position:y.yX.Top,className:"!invisible"}),(0,r.jsxs)(A.Wu,{className:"p-3",children:[(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("div",{className:"flex h-9 w-9 flex-shrink-0 items-center justify-center rounded-lg bg-muted",children:(0,r.jsx)(u,{className:"h-5 w-5 text-primary"})}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("h3",{className:"truncate text-sm font-bold text-foreground",children:n}),l.framework&&(0,r.jsx)("p",{className:"mt-0.5 text-[10px] italic text-muted-foreground",children:l.framework})]}),d&&(0,r.jsx)("div",{className:"flex-shrink-0",children:(0,r.jsx)(z.A,{className:"h-4 w-4 text-amber-500"})})]}),(0,r.jsx)("div",{className:"mx-auto mt-2 w-2/3 border-t border-border"}),i&&(0,r.jsx)("p",{className:"mt-2 max-w-[240px] text-[10px] leading-tight text-muted-foreground",children:i}),x.length>0&&(0,r.jsx)("div",{className:"mt-2 flex flex-wrap gap-1",children:T.map(e=>{let{layer:t,label:a,color:s}=e;return x.includes(t)?(0,r.jsx)("span",{className:"inline-flex items-center rounded-sm border px-1.5 py-0.5 text-[9px] text-muted-foreground",style:{borderColor:s},children:a},t):null})}),o>0&&(0,r.jsxs)("div",{className:"mt-2 rounded-md bg-muted px-2 py-1 text-center text-[10px] text-muted-foreground",children:[o," insight",1!==o?"s":""]}),(0,r.jsx)("div",{className:"mx-auto mt-2 w-2/3 border-t border-border"}),(0,r.jsxs)("div",{className:"mt-2 flex items-center justify-between",children:[(0,r.jsxs)("span",{className:"text-[9px] text-muted-foreground",children:[l.fileCount," files"]}),c&&(0,r.jsxs)("button",{className:"flex cursor-pointer items-center gap-1 rounded-sm border border-border bg-muted px-1.5 py-0.5 text-[9px] text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",onClick:e=>{e.stopPropagation(),c(t)},children:[(0,r.jsx)(S.A,{className:"h-2.5 w-2.5"}),"Explain"]})]})]}),(0,r.jsx)(j.h7,{type:"source",position:y.yX.Bottom,className:"!invisible"})]})}),L=(0,s.memo)(function(e){var t,a;let{id:s,sourceX:n,sourceY:i,targetX:l,targetY:o,sourcePosition:d,targetPosition:c,data:u,selected:x}=e;null==u||u.dependencyCount;let m=null!=(t=null==u?void 0:u.hasHttpCalls)&&t,p=null!=(a=null==u?void 0:u.label)?a:"",[h,f,g]=(0,y.Fp)({sourceX:n,sourceY:i,targetX:l,targetY:o,sourcePosition:d,targetPosition:c});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("path",{id:s,d:h,fill:"none",stroke:x?"var(--primary)":"var(--muted-foreground)",strokeWidth:m?1.5:1,strokeDasharray:m?"8 4":"2 3",opacity:.6,className:"animate-edge-flow"}),p&&(0,r.jsx)(j.rV,{children:(0,r.jsx)("div",{style:{position:"absolute",transform:"translate(-50%, -50%) translate(".concat(f,"px, ").concat(g,"px)"),pointerEvents:"all"},className:"rounded bg-card px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground shadow-sm border border-border",children:p})})]})});var I=a(1047),R=a(5608),D=a(3503),P=a(3159),O=a(4846),$=a(6858);function V(e){let{className:t,orientation:a="horizontal",...s}=e;return(0,r.jsx)($.w,{"data-slot":"separator",orientation:a,className:(0,f.cn)("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",t),...s})}function H(e){let{onAutoLayout:t}=e,{zoomIn:a,zoomOut:s,fitView:n}=(0,j.VH)();return(0,r.jsxs)("div",{className:"absolute bottom-4 left-4 z-10 flex flex-col gap-1 rounded-lg border border-border bg-card p-1 shadow-md",children:[(0,r.jsx)(O.$,{variant:"ghost",size:"icon-xs",onClick:()=>a(),"aria-label":"Zoom in",children:(0,r.jsx)(I.A,{className:"h-4 w-4"})}),(0,r.jsx)(O.$,{variant:"ghost",size:"icon-xs",onClick:()=>s(),"aria-label":"Zoom out",children:(0,r.jsx)(R.A,{className:"h-4 w-4"})}),(0,r.jsx)(V,{}),(0,r.jsx)(O.$,{variant:"ghost",size:"icon-xs",onClick:()=>n({padding:.3,duration:300}),"aria-label":"Fit view",children:(0,r.jsx)(D.A,{className:"h-4 w-4"})}),t&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(V,{}),(0,r.jsx)(O.$,{variant:"ghost",size:"icon-xs",onClick:()=>{t(),setTimeout(()=>n({padding:.3,duration:300}),50)},"aria-label":"Auto layout",children:(0,r.jsx)(P.A,{className:"h-4 w-4"})})]})]})}var M=a(432);let B={service:F},X={dependency:L};function Z(e){let{initialNodes:t,initialEdges:a,onNodeSelect:n,onExplainNode:i,selectedNodeId:l,repoId:o,branch:d,onRefetch:c}=e,[u,x]=(0,s.useState)(!1),m=(0,s.useRef)([]),[p,h,f]=(0,j.ck)(t),[g,v,b]=(0,j.fM)(a);m.current=p,(0,s.useMemo)(()=>{h(t.map(e=>({...e,selected:e.id===l,data:{...e.data,onExplain:i}}))),v(a)},[t,a,h,v,i,l]);let y=(0,s.useCallback)(()=>{let e={};for(let t of m.current)e[t.id]=t.position;x(!0),M.S(o,e,d).finally(()=>x(!1))},[o,d]),N=(0,s.useCallback)(()=>{M.aE(o,d).then(()=>null==c?void 0:c()).catch(()=>{})},[o,d,c]),w=(0,s.useCallback)((e,t)=>{null==n||n(t.id)},[n]),k=(0,s.useCallback)(()=>{null==n||n(null)},[n]);return(0,r.jsxs)("div",{className:"h-full w-full",children:[u&&(0,r.jsx)("div",{className:"absolute left-1/2 top-3 z-20 -translate-x-1/2 rounded-md border border-border bg-card px-3 py-1 text-xs text-muted-foreground shadow-sm",children:"Saving..."}),(0,r.jsxs)(j.Gc,{nodes:p,edges:g,onNodesChange:f,onEdgesChange:b,onNodeClick:w,onNodeDragStop:y,onPaneClick:k,nodeTypes:B,edgeTypes:X,nodesConnectable:!1,fitView:!0,fitViewOptions:{padding:.3},minZoom:.1,maxZoom:2,proOptions:{hideAttribution:!0},children:[(0,r.jsx)(j.VS,{variant:j._5.Dots,gap:20,size:1}),(0,r.jsx)(j.of,{nodeStrokeWidth:3,className:"!bg-card !border-border",maskColor:"rgba(0, 0, 0, 0.1)"}),(0,r.jsx)(H,{onAutoLayout:N})]})]})}var Q=a(3417),W=a(8974),J=a(1879),U=a(7033),Y=a(113),q=a(268);let K=(0,q.F)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function G(e){let{className:t,variant:a="default",render:r,...s}=e;return(0,Y.C)({defaultTagName:"span",props:(0,U.v6)({className:(0,f.cn)(K({variant:a}),t)},s),render:r,state:{slot:"badge",variant:a}})}let ee={info:"border-l-blue-500",low:"border-l-green-500",medium:"border-l-yellow-500",high:"border-l-orange-500",critical:"border-l-red-500"},et={info:"bg-blue-500/10 text-blue-600 dark:text-blue-400",low:"bg-green-500/10 text-green-600 dark:text-green-400",medium:"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400",high:"bg-orange-500/10 text-orange-600 dark:text-orange-400",critical:"bg-red-500/10 text-red-600 dark:text-red-400"};function ea(e){let{insight:t}=e,[a,n]=(0,s.useState)(!1),i=async()=>{t.fixPrompt&&(await navigator.clipboard.writeText(t.fixPrompt),n(!0),setTimeout(()=>n(!1),2e3))};return(0,r.jsx)(A.Zp,{className:"border-l-4 rounded-sm p-3 ".concat(ee[t.severity]||"border-l-gray-500"),children:(0,r.jsxs)(A.Wu,{className:"p-0",children:[(0,r.jsxs)("div",{className:"mb-1.5 flex items-center gap-2",children:[(0,r.jsx)(G,{className:"rounded-sm px-2 py-0.5 text-[10px] font-semibold uppercase ".concat(et[t.severity]||""),children:t.type}),(0,r.jsx)(G,{className:"rounded-sm px-1.5 py-0.5 text-[10px] font-medium ".concat(et[t.severity]||""),children:t.severity})]}),(0,r.jsx)("h4",{className:"text-sm font-bold text-foreground",children:t.title}),(0,r.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-muted-foreground",children:t.content}),t.targetServiceName&&(0,r.jsxs)("p",{className:"mt-2 text-[10px] text-muted-foreground",children:["Target:"," ",(0,r.jsx)("span",{className:"font-medium text-foreground",children:t.targetServiceName})]}),t.fixPrompt&&(0,r.jsx)(O.$,{variant:"outline",size:"xs",onClick:i,className:"mt-2 text-[10px] text-muted-foreground hover:text-foreground",children:a?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(W.A,{className:"h-3 w-3 text-emerald-500"}),"Copied!"]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(J.A,{className:"h-3 w-3"}),"Copy Fix Prompt"]})})]})})}var er=a(7367),es=a(1160),en=a(726),ei=a(3418),el=a(8713);function eo(e){let{message:t}=e;if("system"===t.role)return(0,r.jsxs)("div",{className:"flex items-center justify-center gap-1.5 py-2",children:[(0,r.jsx)(ei.A,{className:"h-3 w-3 text-muted-foreground"}),(0,r.jsx)("span",{className:"text-[11px] text-muted-foreground",children:t.content})]});let a="user"===t.role;return a||t.content?a?(0,r.jsx)("div",{className:"flex justify-end",children:(0,r.jsx)("div",{className:"max-w-[85%] rounded-2xl bg-primary px-3 py-2 text-sm text-primary-foreground",children:(0,r.jsx)("p",{className:"whitespace-pre-wrap break-words leading-relaxed",children:t.content})})}):(0,r.jsx)("div",{className:"text-sm text-foreground",children:(0,r.jsx)("div",{className:"prose prose-sm dark:prose-invert max-w-none break-words leading-relaxed [&_p]:my-1 [&_ul]:my-1 [&_ol]:my-1 [&_li]:my-0 [&_h1]:text-base [&_h2]:text-sm [&_h3]:text-sm [&_pre]:text-xs [&_code]:text-xs",children:(0,r.jsx)(el.oz,{children:t.content})})}):null}var ed=a(4611);function ec(e){let{onSend:t,disabled:a}=e,[n,i]=(0,s.useState)(""),l=(0,s.useRef)(null),o=()=>{n.trim()&&!a&&(t(n.trim()),i(""),l.current&&(l.current.style.height="auto"))};return(0,r.jsx)("div",{className:"border-t border-border p-3",children:(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("textarea",{ref:l,value:n,onChange:e=>i(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),o())},onInput:()=>{let e=l.current;e&&(e.style.height="auto",e.style.height="".concat(Math.min(e.scrollHeight,150),"px"))},placeholder:"Ask about architecture...",rows:2,disabled:a,className:"w-full resize-none rounded-lg border border-border bg-muted px-3 py-2.5 pr-10 text-sm text-foreground placeholder:text-muted-foreground focus:border-primary focus:outline-none disabled:opacity-50",style:{maxHeight:150}}),(0,r.jsx)("button",{onClick:o,disabled:a||!n.trim(),"aria-label":"Send message",className:"absolute bottom-2.5 right-2.5 flex h-6 w-6 items-center justify-center rounded-full bg-primary text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-30 disabled:cursor-not-allowed cursor-pointer",children:(0,r.jsx)(ed.A,{className:"h-3.5 w-3.5"})})]})})}function eu(e){let{repoId:t,explainRequest:a,onExplainHandled:n}=e,{messages:l,isStreaming:o,isLoadingHistory:d,conversationList:c,sendMessage:u,explainNode:x,newConversation:m,fetchConversations:p,loadConversation:h}=function(e){let[t,a]=(0,s.useState)([]),[r,n]=(0,s.useState)(!1),[i,l]=(0,s.useState)([]),[o,d]=(0,s.useState)(!1),c=(0,s.useRef)(null),u=(0,s.useRef)(void 0),x=(0,s.useRef)(0),m=()=>(x.current+=1,"msg-".concat(x.current)),p=(0,s.useCallback)(t=>{if(!t.trim()||r)return;let s={id:m(),role:"user",content:t,timestamp:new Date},i=m(),l={id:i,role:"assistant",content:"",timestamp:new Date};a(e=>[...e,s,l]),n(!0),c.current=(0,M.Vl)(e,t,e=>{a(t=>t.map(t=>t.id===i?{...t,content:t.content+e}:t))},e=>{e&&(u.current=e),n(!1)},e=>{a(t=>t.map(t=>t.id===i?{...t,content:"Error: ".concat(e.message)}:t)),n(!1)},{conversationId:u.current})},[e,r]),h=(0,s.useCallback)((e,t)=>{p('Explain the "'.concat(t,'" service — what does it do, how does it fit into the architecture, and are there any concerns?'))},[p]),f=(0,s.useCallback)(()=>{c.current&&c.current.abort(),a([]),n(!1),u.current=void 0},[]),g=(0,s.useCallback)(async()=>{try{let t=await (0,M.lS)(e);l(t)}catch(e){}},[e]),v=(0,s.useCallback)(async t=>{if(!r){d(!0);try{let r=await (0,M.kP)(e,t);u.current=t,a(r.messages.map(e=>({id:e.id,role:e.role,content:e.content,timestamp:new Date(e.createdAt)})))}catch(e){}finally{d(!1)}}},[e,r]);return{messages:t,isStreaming:r,isLoadingHistory:o,conversationList:i,sendMessage:p,explainNode:h,newConversation:f,fetchConversations:g,loadConversation:v}}(t),f=(0,s.useRef)(null),g=(0,s.useRef)(null),[v,b]=(0,s.useState)(!1),j=l[l.length-1];return((0,s.useEffect)(()=>{g.current&&(g.current.scrollTop=g.current.scrollHeight)},[null==j?void 0:j.content,l.length]),(0,s.useEffect)(()=>{a&&a.nodeId!==f.current&&(f.current=a.nodeId,x(a.nodeId,a.nodeName),null==n||n())},[a,x,n]),v)?(0,r.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 border-b border-border px-3 py-2",children:[(0,r.jsx)("button",{onClick:()=>b(!1),className:"flex cursor-pointer items-center justify-center rounded-md p-1 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground","aria-label":"Back to chat",children:(0,r.jsx)(er.A,{className:"h-4 w-4"})}),(0,r.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Conversations"})]}),(0,r.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto",children:0===c.length?(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,r.jsx)(es.A,{className:"mb-3 h-8 w-8 text-muted-foreground"}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"No conversations yet"})]}):(0,r.jsx)("div",{className:"divide-y divide-border",children:c.map(e=>(0,r.jsxs)("button",{onClick:()=>{h(e.id),b(!1)},className:"w-full cursor-pointer px-3 py-2.5 text-left transition-colors hover:bg-accent",children:[(0,r.jsx)("p",{className:"truncate text-sm text-foreground",children:e.preview}),(0,r.jsx)("p",{className:"mt-0.5 text-[10px] text-muted-foreground",children:new Date(e.updatedAt).toLocaleDateString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})})]},e.id))})})]}):(0,r.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,r.jsxs)("div",{className:"flex items-center justify-end gap-1 border-b border-border px-2 py-1.5",children:[(0,r.jsx)("button",{onClick:()=>{m(),b(!1)},className:"flex cursor-pointer items-center justify-center rounded-md p-1 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground","aria-label":"New conversation",title:"New conversation",children:(0,r.jsx)(en.A,{className:"h-4 w-4"})}),(0,r.jsx)("button",{onClick:()=>{p(),b(!0)},className:"flex cursor-pointer items-center justify-center rounded-md p-1 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground","aria-label":"Conversation history",title:"Conversation history",children:(0,r.jsx)(es.A,{className:"h-4 w-4"})})]}),(0,r.jsx)("div",{ref:g,className:"min-h-0 flex-1 overflow-y-auto",children:(0,r.jsxs)("div",{className:"space-y-3 p-3",children:[d?(0,r.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,r.jsx)(i.A,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):0===l.length?(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,r.jsx)(S.A,{className:"mb-3 h-8 w-8 text-muted-foreground"}),(0,r.jsx)("p",{className:"text-sm font-medium text-foreground",children:"Architecture Chat"}),(0,r.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:"Ask questions about your codebase architecture"})]}):l.map(e=>(0,r.jsx)(eo,{message:e},e.id)),o&&(()=>{let e=[...l].reverse().find(e=>"assistant"===e.role),t=!!(null==e?void 0:e.content);return(0,r.jsx)("div",{className:"flex items-center gap-2 py-1 text-xs text-muted-foreground",children:t?(0,r.jsxs)("span",{className:"inline-flex gap-0.5",children:[(0,r.jsx)("span",{className:"h-1 w-1 animate-bounce rounded-full bg-muted-foreground [animation-delay:0ms]"}),(0,r.jsx)("span",{className:"h-1 w-1 animate-bounce rounded-full bg-muted-foreground [animation-delay:150ms]"}),(0,r.jsx)("span",{className:"h-1 w-1 animate-bounce rounded-full bg-muted-foreground [animation-delay:300ms]"})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.A,{className:"h-3 w-3 animate-spin"}),"Thinking..."]})})})()]})}),(0,r.jsx)(ec,{onSend:e=>{u(e)},disabled:o})]})}var ex=a(5133),em=a(6333),ep=a(5468);function eh(e){let{className:t,orientation:a="horizontal",...s}=e;return(0,r.jsx)(ex.p,{"data-slot":"tabs","data-orientation":a,className:(0,f.cn)("group/tabs flex gap-2 data-horizontal:flex-col",t),...s})}let ef=(0,q.F)("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function eg(e){let{className:t,variant:a="default",...s}=e;return(0,r.jsx)(em.j,{"data-slot":"tabs-list","data-variant":a,className:(0,f.cn)(ef({variant:a}),t),...s})}function ev(e){let{className:t,...a}=e;return(0,r.jsx)(ep.M,{"data-slot":"tabs-trigger",className:(0,f.cn)("relative inline-flex h-[calc(100%-1px)] flex-1 cursor-pointer items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",t),...a})}function eb(e){let{insights:t,isLoading:a,repoId:s,selectedService:n,selectedServiceName:l,activeTab:o="insights",onTabChange:d,explainRequest:c,onExplainHandled:u}=e,x="chat"===o;return(0,r.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,r.jsx)(eh,{value:o,onValueChange:e=>null==d?void 0:d(String(e)),className:"flex flex-shrink-0 flex-col",children:(0,r.jsxs)(eg,{variant:"line",className:"w-full",children:[(0,r.jsxs)(ev,{value:"insights",children:[(0,r.jsx)(Q.A,{className:"h-4 w-4"}),"Insights"]}),(0,r.jsxs)(ev,{value:"chat",children:[(0,r.jsx)(S.A,{className:"h-4 w-4"}),"Chat"]})]})}),(0,r.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto ".concat(x?"hidden":""),children:(0,r.jsxs)("div",{className:"p-3",children:[n&&(0,r.jsxs)("div",{className:"mb-3 rounded-md bg-muted px-3 py-1.5 text-xs text-muted-foreground",children:["Filtered by:"," ",(0,r.jsx)("span",{className:"font-medium text-foreground",children:l||n})]}),a?(0,r.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,r.jsx)(i.A,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):0===t.length?(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,r.jsx)(Q.A,{className:"mb-3 h-8 w-8 text-muted-foreground"}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:n?"No insights for this service":"No insights yet. Run an analysis to get insights."})]}):(0,r.jsx)("div",{className:"space-y-3",children:t.map(e=>(0,r.jsx)(ea,{insight:e},e.id))})]})}),(0,r.jsx)("div",{className:"min-h-0 flex-1 overflow-hidden ".concat(x?"":"hidden"),children:(0,r.jsx)(eu,{repoId:s,selectedService:n,explainRequest:c,onExplainHandled:u})})]})}var ej=a(6540),ey=a(5694),eN=a(8682),ew=a(2054);function ek(e){let{serviceTypes:t,frameworks:a,onFilterChange:n}=e,[i,l]=(0,s.useState)(!1),[o,d]=(0,s.useState)({excludedTypes:new Set,excludedFrameworks:new Set,searchQuery:"",showLabels:!0}),c=e=>{d(e),n(e)},u=o.excludedTypes.size>0||o.excludedFrameworks.size>0||o.searchQuery.length>0;return(0,r.jsxs)("div",{className:"absolute left-4 top-4 z-10",children:[(0,r.jsxs)(O.$,{variant:"outline",onClick:()=>l(!i),className:"shadow-md",children:[(0,r.jsx)(ej.A,{className:"h-4 w-4"}),"Filters",u&&(0,r.jsx)("span",{className:"ml-1 flex h-4 w-4 items-center justify-center rounded-full bg-primary text-[10px] text-primary-foreground",children:o.excludedTypes.size+o.excludedFrameworks.size+ +!!o.searchQuery})]}),i&&(0,r.jsx)(A.Zp,{className:"mt-2 w-64 shadow-lg",children:(0,r.jsxs)(A.Wu,{className:"p-4",children:[(0,r.jsxs)("div",{className:"mb-3 flex items-center justify-between",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Filters"}),(0,r.jsx)(O.$,{variant:"ghost",size:"icon-xs",onClick:()=>l(!1),children:(0,r.jsx)(ey.A,{className:"h-4 w-4"})})]}),(0,r.jsxs)("div",{className:"relative mb-3",children:[(0,r.jsx)(eN.A,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),(0,r.jsx)(ew.p,{type:"text",value:o.searchQuery,onChange:e=>c({...o,searchQuery:e.target.value}),placeholder:"Search services...",className:"pl-8 text-xs"})]}),(0,r.jsxs)("div",{className:"mb-3",children:[(0,r.jsx)("h4",{className:"mb-1.5 text-xs font-medium text-muted-foreground",children:"Service Type"}),(0,r.jsx)("div",{className:"space-y-1",children:t.map(e=>(0,r.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 text-xs text-foreground",children:[(0,r.jsx)("input",{type:"checkbox",checked:!o.excludedTypes.has(e),onChange:()=>(e=>{let t=new Set(o.excludedTypes);t.has(e)?t.delete(e):t.add(e),c({...o,excludedTypes:t})})(e),className:"rounded border-border accent-primary"}),e]},e))})]}),a.length>0&&(0,r.jsxs)("div",{className:"mb-3",children:[(0,r.jsx)("h4",{className:"mb-1.5 text-xs font-medium text-muted-foreground",children:"Framework"}),(0,r.jsx)("div",{className:"space-y-1",children:a.map(e=>(0,r.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 text-xs text-foreground",children:[(0,r.jsx)("input",{type:"checkbox",checked:!o.excludedFrameworks.has(e),onChange:()=>(e=>{let t=new Set(o.excludedFrameworks);t.has(e)?t.delete(e):t.add(e),c({...o,excludedFrameworks:t})})(e),className:"rounded border-border accent-primary"}),e]},e))})]}),(0,r.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 text-xs text-foreground",children:[(0,r.jsx)("input",{type:"checkbox",checked:o.showLabels,onChange:()=>c({...o,showLabels:!o.showLabels}),className:"rounded border-border accent-primary"}),"Show dependency labels"]})]})})]})}var eC=a(1010);let ez=(0,a(2011).T)()||window.location.origin,eS=null;function eA(){return eS||(eS=(0,eC.io)(ez,{autoConnect:!1,reconnection:!0,reconnectionAttempts:10,reconnectionDelay:1e3,reconnectionDelayMax:5e3,transports:["websocket","polling"]})),eS}function eE(e){let t=eA();t.connected&&t.emit("joinRepo",e)}var eT=a(5500),e_=a(4274),eF=a(1393),eL=a(9663),eI=a(3714),eR=a(4113);function eD(e){let{className:t,children:a,value:s,...n}=e;return(0,r.jsxs)(e_.w,{value:s,"data-slot":"progress",className:(0,f.cn)("flex flex-wrap gap-3",t),...n,children:[a,(0,r.jsx)(eP,{children:(0,r.jsx)(eO,{})})]})}function eP(e){let{className:t,...a}=e;return(0,r.jsx)(eF.X,{className:(0,f.cn)("relative flex h-1 w-full items-center overflow-x-hidden rounded-full bg-muted",t),"data-slot":"progress-track",...a})}function eO(e){let{className:t,...a}=e;return(0,r.jsx)(eL.Z,{"data-slot":"progress-indicator",className:(0,f.cn)("h-full bg-primary transition-all",t),...a})}function e$(e){let{className:t,...a}=e;return(0,r.jsx)(eI.u,{className:(0,f.cn)("text-sm font-medium",t),"data-slot":"progress-label",...a})}function eV(e){let{className:t,...a}=e;return(0,r.jsx)(eR.D,{className:(0,f.cn)("ml-auto text-sm text-muted-foreground tabular-nums",t),"data-slot":"progress-value",...a})}function eH(){var e,t;let a=(0,n.useParams)(),u=Array.isArray(a.slug)?a.slug[0]:"",[x,m]=(0,s.useState)(null),[p,h]=(0,s.useState)(),[f,g]=(0,s.useState)(null),[v,j]=(0,s.useState)([]),[y,N]=(0,s.useState)([]),[w,k]=(0,s.useState)(!1),[C,z]=(0,s.useState)("insights"),[S,A]=(0,s.useState)(null),[E,T]=(0,s.useState)(!0),{nodes:_,edges:F,isLoading:L,error:I,refetch:R}=function(e,t){let[a,r]=(0,s.useState)([]),[n,i]=(0,s.useState)([]),[l,o]=(0,s.useState)(!0),[d,c]=(0,s.useState)(null),u=(0,s.useCallback)(async()=>{if(e){o(!0),c(null);try{let a=await M.XT(e,t),s=a.nodes.map(e=>({id:e.id,type:"service",position:e.position,data:{label:e.data.label,description:e.data.description,serviceInfo:{type:e.data.serviceType||"unknown",framework:e.data.framework||null,fileCount:e.data.fileCount||0,layers:(e.data.layers||[]).map(e=>({layer:e,confidence:1,evidence:[]})),rootPath:e.data.rootPath||""},insightCount:0,hasHighSeverity:!1}})),n=a.edges.map(e=>({id:e.id,source:e.source,target:e.target,type:"dependency",data:{label:"http"===e.data.dependencyType?"".concat(e.data.dependencyCount||0," HTTP call").concat(1!==(e.data.dependencyCount||0)?"s":""):"".concat(e.data.dependencyCount||0," import").concat(1!==(e.data.dependencyCount||0)?"s":""),dependencyCount:e.data.dependencyCount||0,hasHttpCalls:"http"===e.data.dependencyType}}));r(s),i(n)}catch(e){c(e instanceof Error?e.message:"Failed to fetch graph")}finally{o(!1)}}},[e,t]);return(0,s.useEffect)(()=>{u()},[u]),{nodes:a,edges:n,isLoading:l,error:d,refetch:u,setNodes:r,setEdges:i}}(u,p),{isConnected:D,analysisProgress:P,onEvent:$}=function(e){let[t,a]=(0,s.useState)(!1),[r,n]=(0,s.useState)(null),i=(0,s.useRef)(new Map);return(0,s.useEffect)(()=>{let t=function(){let e=eA();return e.connected||e.connect(),e}();function r(){a(!0),e&&eE(e)}function s(){a(!1)}function l(e){n(e)}function o(e){var t;n(null),null==(t=i.current.get("analysis:complete"))||t.forEach(t=>t(e))}return t.on("connect",r),t.on("disconnect",s),t.on("analysis:progress",l),t.on("analysis:complete",o),t.on("files:changed",e=>{var t;null==(t=i.current.get("files:changed"))||t.forEach(t=>t(e))}),t.on("insights:ready",e=>{var t;n(null),null==(t=i.current.get("insights:ready"))||t.forEach(t=>t(e))}),t.connected&&e&&eE(e),()=>{e&&function(e){let t=eA();t.connected&&t.emit("leaveRepo",e)}(e),t.off("connect",r),t.off("disconnect",s),t.off("analysis:progress",l),t.off("analysis:complete",o),(null==eS?void 0:eS.connected)&&eS.disconnect()}},[e]),{isConnected:t,analysisProgress:r,onEvent:(0,s.useCallback)((e,t)=>{let a=i.current.get(e)||[];return a.push(t),i.current.set(e,a),()=>{let a=i.current.get(e)||[];i.current.set(e,a.filter(e=>e!==t))}},[])}}(u),{insights:V,isLoading:H,refetch:B}=function(e,t){let[a,r]=(0,s.useState)([]),[n,i]=(0,s.useState)(!0),[l,o]=(0,s.useState)(null),d=(0,s.useCallback)(async()=>{if(e){i(!0),o(null);try{let t=await M.ge(e);r(t)}catch(e){o(e instanceof Error?e.message:"Failed to fetch insights")}finally{i(!1)}}},[e]);return(0,s.useEffect)(()=>{d()},[d]),{insights:(0,s.useMemo)(()=>{let e={critical:0,high:1,medium:2,low:3,info:4},r=[...a].sort((t,a)=>{var r,s;return(null!=(r=e[t.severity])?r:5)-(null!=(s=e[a.severity])?s:5)});return t?r.filter(e=>e.targetServiceId===t):r},[a,t]),allInsights:a,isLoading:n,error:l,refetch:d}}(u,null!=f?f:void 0);(0,s.useEffect)(()=>{u&&M.L8(u).then(m).catch(()=>{})},[u]),(0,s.useEffect)(()=>{(null==x?void 0:x.defaultBranch)&&!p&&h(x.defaultBranch)},[x,p]),(0,s.useEffect)(()=>{j(_),N(F)},[_,F]),(0,s.useEffect)(()=>$("analysis:complete",()=>{k(!1),R()}),[$,R]),(0,s.useEffect)(()=>$("insights:ready",()=>{B()}),[$,B]);let X=async()=>{try{k(!0),await M.LY(u,p)}catch(e){k(!1)}},Q=(0,s.useCallback)(e=>{g(e)},[]),W=(0,s.useCallback)(e=>{var t;let a=(null==(t=_.find(t=>t.id===e))?void 0:t.data.label)||e;g(e),z("chat"),A({nodeId:e,nodeName:a})},[_]),J=(0,s.useCallback)(e=>{let t=_;if(e.excludedTypes.size>0&&(t=t.filter(t=>!e.excludedTypes.has(t.data.serviceInfo.type))),e.excludedFrameworks.size>0&&(t=t.filter(t=>{let a=t.data.serviceInfo.framework;return!a||!e.excludedFrameworks.has(a)})),e.searchQuery){let a=e.searchQuery.toLowerCase();t=t.filter(e=>e.data.label.toLowerCase().includes(a))}let a=new Set(t.map(e=>e.id)),r=F.filter(e=>a.has(e.source)&&a.has(e.target));j(t),N(r)},[_,F]);u||(0,n.redirect)("/");let U=f&&null!=(t=null==(e=_.find(e=>e.id===f))?void 0:e.data.label)?t:null,Y=[...new Set(_.map(e=>e.data.serviceInfo.type))],q=[...new Set(_.map(e=>e.data.serviceInfo.framework).filter(e=>!!e))];return(0,r.jsxs)("div",{className:"flex h-screen flex-col",children:[(0,r.jsx)(c.Y,{repoName:null==x?void 0:x.name,branches:null==x?void 0:x.branches,selectedBranch:p,onBranchChange:h,onAnalyze:X,isAnalyzing:w,showBack:!0,backHref:"/",isSidebarOpen:E,onToggleSidebar:()=>T(e=>!e)}),(0,r.jsxs)("div",{className:"flex flex-1 overflow-hidden",children:[(0,r.jsxs)("div",{className:"relative flex-1",children:[P&&(0,r.jsxs)("div",{className:"absolute bottom-4 left-1/2 z-20 w-72 -translate-x-1/2 rounded-lg border border-border bg-card p-3 shadow-lg",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,r.jsx)(i.A,{className:"h-3.5 w-3.5 shrink-0 animate-spin text-primary"}),(0,r.jsx)(eD,{value:P.percent,className:"flex-1 gap-1",children:(0,r.jsxs)("div",{className:"flex w-full items-center justify-between",children:[(0,r.jsx)(e$,{className:"text-[11px] font-medium capitalize",children:P.step}),(0,r.jsx)(eV,{className:"text-[11px]"})]})})]}),P.detail&&(0,r.jsx)("p",{className:"mt-1.5 pl-6 text-[10px] text-muted-foreground",children:P.detail})]}),(0,r.jsx)("div",{className:"absolute right-3 top-2 z-20 flex items-center gap-1.5 rounded-full bg-card px-2 py-1 text-[10px] shadow-sm border border-border",children:D?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.A,{className:"h-3 w-3 text-emerald-500"}),(0,r.jsx)("span",{className:"text-emerald-500",children:"Live"})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.A,{className:"h-3 w-3 text-muted-foreground"}),(0,r.jsx)("span",{className:"text-muted-foreground",children:"Offline"})]})}),L?(0,r.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,r.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,r.jsx)(i.A,{className:"h-10 w-10 animate-spin text-primary"}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading graph..."})]})}):I?(0,r.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,r.jsxs)("div",{className:"flex flex-col items-center gap-3 text-center",children:[(0,r.jsx)(d.A,{className:"h-10 w-10 text-destructive"}),(0,r.jsxs)(eT.Fc,{variant:"destructive",className:"max-w-sm",children:[(0,r.jsx)(eT.XL,{children:"Failed to load graph"}),(0,r.jsx)(eT.TN,{children:I})]}),(0,r.jsx)(O.$,{onClick:()=>R(),className:"mt-2",children:"Retry"})]})}):0===v.length&&0===_.length?(0,r.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,r.jsxs)("div",{className:"flex flex-col items-center gap-3 text-center",children:[(0,r.jsx)(d.A,{className:"h-10 w-10 text-muted-foreground"}),(0,r.jsxs)(eT.Fc,{className:"max-w-sm",children:[(0,r.jsx)(eT.XL,{children:"No graph data"}),(0,r.jsx)(eT.TN,{children:"Run an analysis to generate the architecture graph"})]}),(0,r.jsxs)(O.$,{onClick:X,disabled:w,className:"mt-2",children:[w&&(0,r.jsx)(i.A,{className:"h-4 w-4 animate-spin"}),w?"Analyzing...":"Analyze Repository"]})]})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ek,{serviceTypes:Y,frameworks:q,onFilterChange:J}),(0,r.jsx)(Z,{initialNodes:v,initialEdges:y,onNodeSelect:Q,onExplainNode:W,selectedNodeId:f,repoId:u,branch:p,onRefetch:R})]})]}),(0,r.jsx)(b,{isOpen:E,children:(0,r.jsx)(eb,{insights:V,isLoading:H,repoId:u,selectedService:f,selectedServiceName:U,activeTab:C,onTabChange:z,explainRequest:S,onExplainHandled:()=>A(null)})})]})]})}},5500:(e,t,a)=>{"use strict";a.d(t,{Fc:()=>l,TN:()=>d,XL:()=>o});var r=a(6409);a(4669);var s=a(268),n=a(6669);let i=(0,s.F)("group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current"}},defaultVariants:{variant:"default"}});function l(e){let{className:t,variant:a,...s}=e;return(0,r.jsx)("div",{"data-slot":"alert",role:"alert",className:(0,n.cn)(i({variant:a}),t),...s})}function o(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"alert-title",className:(0,n.cn)("font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground",t),...a})}function d(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"alert-description",className:(0,n.cn)("text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",t),...a})}},6669:(e,t,a)=>{"use strict";a.d(t,{cn:()=>n});var r=a(1754),s=a(3225);function n(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,s.QP)((0,r.$)(t))}},9766:(e,t,a)=>{Promise.resolve().then(a.bind(a,5111))}},e=>{e.O(0,[206,763,414,728,429,597,358],()=>e(e.s=9766)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[358],{4236:(e,s,n)=>{Promise.resolve().then(n.t.bind(n,2044,23)),Promise.resolve().then(n.t.bind(n,1405,23)),Promise.resolve().then(n.t.bind(n,4559,23)),Promise.resolve().then(n.t.bind(n,6791,23)),Promise.resolve().then(n.t.bind(n,2064,23)),Promise.resolve().then(n.t.bind(n,7544,23)),Promise.resolve().then(n.t.bind(n,982,23)),Promise.resolve().then(n.t.bind(n,1597,23)),Promise.resolve().then(n.bind(n,1960))},9351:()=>{}},e=>{var s=s=>e(e.s=s);e.O(0,[429,597],()=>(s(3212),s(4236))),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[358],{2998:(e,s,n)=>{Promise.resolve().then(n.t.bind(n,2044,23)),Promise.resolve().then(n.t.bind(n,1405,23)),Promise.resolve().then(n.t.bind(n,4559,23)),Promise.resolve().then(n.t.bind(n,6791,23)),Promise.resolve().then(n.t.bind(n,2064,23)),Promise.resolve().then(n.t.bind(n,7544,23)),Promise.resolve().then(n.t.bind(n,982,23)),Promise.resolve().then(n.t.bind(n,1597,23)),Promise.resolve().then(n.bind(n,1960))},9351:()=>{}},e=>{var s=s=>e(e.s=s);e.O(0,[429,597],()=>(s(3212),s(2998))),_N_E=e.O()}]);
package/public/index.html CHANGED
@@ -1,4 +1,4 @@
1
- <!DOCTYPE html><!--qkaM__kJMthFE7DbnSDij--><html lang="en" class="font-sans"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/49e7ab4429e483d4.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-2f0ed87fd33e9d1c.js"/><script src="/_next/static/chunks/a51c26f2-7912c8e37f20294d.js" async=""></script><script src="/_next/static/chunks/597-63908a91b482ecc2.js" async=""></script><script src="/_next/static/chunks/main-app-6713e5440a400899.js" async=""></script><script src="/_next/static/chunks/414-8318b3e90e55d32a.js" async=""></script><script src="/_next/static/chunks/app/page-a584f9a9455d99db.js" async=""></script><link rel="preconnect" href="https://fonts.googleapis.com"/><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="anonymous"/><title>TrueCourse</title><meta name="description" content="Visualize your codebase architecture"/><link href="https://fonts.googleapis.com/css2?family=Geist:wght@100..900&amp;family=Inter:wght@400..700&amp;display=swap" rel="stylesheet"/><script>
1
+ <!DOCTYPE html><!--bPWCf_gzBKdFUdcy_Q1EJ--><html lang="en" class="font-sans"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/49e7ab4429e483d4.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-2f0ed87fd33e9d1c.js"/><script src="/_next/static/chunks/a51c26f2-7912c8e37f20294d.js" async=""></script><script src="/_next/static/chunks/597-63908a91b482ecc2.js" async=""></script><script src="/_next/static/chunks/main-app-598d148dafd4bc32.js" async=""></script><script src="/_next/static/chunks/414-8318b3e90e55d32a.js" async=""></script><script src="/_next/static/chunks/app/page-59b2858b3b17446e.js" async=""></script><link rel="preconnect" href="https://fonts.googleapis.com"/><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="anonymous"/><title>TrueCourse</title><meta name="description" content="Visualize your codebase architecture"/><link href="https://fonts.googleapis.com/css2?family=Geist:wght@100..900&amp;family=Inter:wght@400..700&amp;display=swap" rel="stylesheet"/><script>
2
2
  (function() {
3
3
  try {
4
4
  var stored = localStorage.getItem('theme');
@@ -9,4 +9,4 @@
9
9
  }
10
10
  } catch (e) {}
11
11
  })();
12
- </script><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="font-sans"><div hidden=""><!--$--><!--/$--></div><div class="flex min-h-screen flex-col"><header class="flex h-14 items-center justify-between border-b border-border bg-card px-4"><div class="flex items-center gap-3"><a class="text-lg font-bold text-foreground" href="/">TrueCourse</a></div><div class="flex items-center gap-3"></div><div class="flex items-center gap-1"><button type="button" tabindex="0" data-slot="button" aria-label="Toggle theme" class="group/button inline-flex shrink-0 cursor-pointer items-center justify-center border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&amp;_svg]:pointer-events-none [&amp;_svg]:shrink-0 [&amp;_svg:not([class*=&#x27;size-&#x27;])]:size-4 hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50 size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-moon h-5 w-5"><path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"></path></svg></button></div></header><main class="mx-auto w-full max-w-5xl flex-1 px-4 py-8"><div class="mb-8 text-center"><h1 class="text-3xl font-bold text-foreground">TrueCourse</h1><p class="mt-2 text-muted-foreground">Visualize and understand your codebase architecture</p></div><div class="mb-8"><form class="w-full"><div class="flex gap-2"><div class="relative flex-1"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-folder-open absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"><path d="m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2"></path></svg><input id="base-ui-_R_4l9btb_" type="text" data-slot="input" placeholder="Paste repository path..." class="h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 pl-10" value=""/></div><button type="submit" data-disabled="" tabindex="0" disabled="" data-slot="button" class="group/button inline-flex shrink-0 cursor-pointer items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&amp;_svg]:pointer-events-none [&amp;_svg]:shrink-0 [&amp;_svg:not([class*=&#x27;size-&#x27;])]:size-4 bg-primary text-primary-foreground [a]:hover:bg-primary/80 h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-plus h-4 w-4"><path d="M5 12h14"></path><path d="M12 5v14"></path></svg>Add Repository</button></div></form></div><div class="flex items-center justify-center py-16"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-loader-circle h-8 w-8 animate-spin text-muted-foreground"><path d="M21 12a9 9 0 1 1-6.219-8.56"></path></svg></div></main></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-2f0ed87fd33e9d1c.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[2064,[],\"\"]\n3:I[982,[],\"\"]\n4:I[1405,[],\"ClientPageRoot\"]\n5:I[3840,[\"414\",\"static/chunks/414-8318b3e90e55d32a.js\",\"974\",\"static/chunks/app/page-a584f9a9455d99db.js\"],\"default\"]\n8:I[1597,[],\"OutletBoundary\"]\na:I[7544,[],\"AsyncMetadataOutlet\"]\nc:I[1597,[],\"ViewportBoundary\"]\ne:I[1597,[],\"MetadataBoundary\"]\nf:\"$Sreact.suspense\"\n11:I[2044,[],\"\"]\n:HL[\"/_next/static/css/49e7ab4429e483d4.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"qkaM-_kJMthFE7DbnSDij\",\"p\":\"\",\"c\":[\"\",\"\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/49e7ab4429e483d4.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"className\":\"font-sans\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"link\",null,{\"rel\":\"preconnect\",\"href\":\"https://fonts.googleapis.com\"}],[\"$\",\"link\",null,{\"rel\":\"preconnect\",\"href\":\"https://fonts.gstatic.com\",\"crossOrigin\":\"anonymous\"}],[\"$\",\"link\",null,{\"href\":\"https://fonts.googleapis.com/css2?family=Geist:wght@100..900\u0026family=Inter:wght@400..700\u0026display=swap\",\"rel\":\"stylesheet\"}],[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n (function() {\\n try {\\n var stored = localStorage.getItem('theme');\\n if (stored === 'dark' || (!stored \u0026\u0026 window.matchMedia('(prefers-color-scheme: dark)').matches)) {\\n document.documentElement.classList.add('dark');\\n } else {\\n document.documentElement.classList.remove('dark');\\n }\\n } catch (e) {}\\n })();\\n \"}}]]}],[\"$\",\"body\",null,{\"className\":\"font-sans\",\"suppressHydrationWarning\":true,\"children\":[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]]}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"$L4\",null,{\"Component\":\"$5\",\"searchParams\":{},\"params\":{},\"promises\":[\"$@6\",\"$@7\"]}],null,[\"$\",\"$L8\",null,{\"children\":[\"$L9\",[\"$\",\"$La\",null,{\"promise\":\"$@b\"}]]}]]}],{},null,false]},null,false],[\"$\",\"$1\",\"h\",{\"children\":[null,[[\"$\",\"$Lc\",null,{\"children\":\"$Ld\"}],null],[\"$\",\"$Le\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$f\",null,{\"fallback\":null,\"children\":\"$L10\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$11\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"6:{}\n7:\"$0:f:0:1:2:children:1:props:children:0:props:params\"\n"])</script><script>self.__next_f.push([1,"d:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n9:null\n"])</script><script>self.__next_f.push([1,"b:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"TrueCourse\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Visualize your codebase architecture\"}]],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"10:\"$b:metadata\"\n"])</script></body></html>
12
+ </script><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="font-sans"><div hidden=""><!--$--><!--/$--></div><div class="flex min-h-screen flex-col"><header class="flex h-14 items-center justify-between border-b border-border bg-card px-4"><div class="flex items-center gap-3"><a class="text-lg font-bold text-foreground" href="/">TrueCourse</a></div><div class="flex items-center gap-3"></div><div class="flex items-center gap-1"><button type="button" tabindex="0" data-slot="button" aria-label="Toggle theme" class="group/button inline-flex shrink-0 cursor-pointer items-center justify-center border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&amp;_svg]:pointer-events-none [&amp;_svg]:shrink-0 [&amp;_svg:not([class*=&#x27;size-&#x27;])]:size-4 hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50 size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-moon h-5 w-5"><path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"></path></svg></button></div></header><main class="mx-auto w-full max-w-5xl flex-1 px-4 py-8"><div class="mb-8 text-center"><h1 class="text-3xl font-bold text-foreground">TrueCourse</h1><p class="mt-2 text-muted-foreground">Visualize and understand your codebase architecture</p></div><div class="mb-8"><form class="w-full"><div class="flex gap-2"><div class="relative flex-1"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-folder-open absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"><path d="m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2"></path></svg><input id="base-ui-_R_4l9btb_" type="text" data-slot="input" placeholder="Paste repository path..." class="h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 pl-10" value=""/></div><button type="submit" data-disabled="" tabindex="0" disabled="" data-slot="button" class="group/button inline-flex shrink-0 cursor-pointer items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&amp;_svg]:pointer-events-none [&amp;_svg]:shrink-0 [&amp;_svg:not([class*=&#x27;size-&#x27;])]:size-4 bg-primary text-primary-foreground [a]:hover:bg-primary/80 h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-plus h-4 w-4"><path d="M5 12h14"></path><path d="M12 5v14"></path></svg>Add Repository</button></div></form></div><div class="flex items-center justify-center py-16"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-loader-circle h-8 w-8 animate-spin text-muted-foreground"><path d="M21 12a9 9 0 1 1-6.219-8.56"></path></svg></div></main></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-2f0ed87fd33e9d1c.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[2064,[],\"\"]\n3:I[982,[],\"\"]\n4:I[1405,[],\"ClientPageRoot\"]\n5:I[3840,[\"414\",\"static/chunks/414-8318b3e90e55d32a.js\",\"974\",\"static/chunks/app/page-59b2858b3b17446e.js\"],\"default\"]\n8:I[1597,[],\"OutletBoundary\"]\na:I[7544,[],\"AsyncMetadataOutlet\"]\nc:I[1597,[],\"ViewportBoundary\"]\ne:I[1597,[],\"MetadataBoundary\"]\nf:\"$Sreact.suspense\"\n11:I[2044,[],\"\"]\n:HL[\"/_next/static/css/49e7ab4429e483d4.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"bPWCf-gzBKdFUdcy_Q1EJ\",\"p\":\"\",\"c\":[\"\",\"\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/49e7ab4429e483d4.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"className\":\"font-sans\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"link\",null,{\"rel\":\"preconnect\",\"href\":\"https://fonts.googleapis.com\"}],[\"$\",\"link\",null,{\"rel\":\"preconnect\",\"href\":\"https://fonts.gstatic.com\",\"crossOrigin\":\"anonymous\"}],[\"$\",\"link\",null,{\"href\":\"https://fonts.googleapis.com/css2?family=Geist:wght@100..900\u0026family=Inter:wght@400..700\u0026display=swap\",\"rel\":\"stylesheet\"}],[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n (function() {\\n try {\\n var stored = localStorage.getItem('theme');\\n if (stored === 'dark' || (!stored \u0026\u0026 window.matchMedia('(prefers-color-scheme: dark)').matches)) {\\n document.documentElement.classList.add('dark');\\n } else {\\n document.documentElement.classList.remove('dark');\\n }\\n } catch (e) {}\\n })();\\n \"}}]]}],[\"$\",\"body\",null,{\"className\":\"font-sans\",\"suppressHydrationWarning\":true,\"children\":[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]]}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"$L4\",null,{\"Component\":\"$5\",\"searchParams\":{},\"params\":{},\"promises\":[\"$@6\",\"$@7\"]}],null,[\"$\",\"$L8\",null,{\"children\":[\"$L9\",[\"$\",\"$La\",null,{\"promise\":\"$@b\"}]]}]]}],{},null,false]},null,false],[\"$\",\"$1\",\"h\",{\"children\":[null,[[\"$\",\"$Lc\",null,{\"children\":\"$Ld\"}],null],[\"$\",\"$Le\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$f\",null,{\"fallback\":null,\"children\":\"$L10\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$11\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"6:{}\n7:\"$0:f:0:1:2:children:1:props:children:0:props:params\"\n"])</script><script>self.__next_f.push([1,"d:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n9:null\n"])</script><script>self.__next_f.push([1,"b:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"TrueCourse\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Visualize your codebase architecture\"}]],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"10:\"$b:metadata\"\n"])</script></body></html>
package/public/index.txt CHANGED
@@ -2,7 +2,7 @@
2
2
  2:I[2064,[],""]
3
3
  3:I[982,[],""]
4
4
  4:I[1405,[],"ClientPageRoot"]
5
- 5:I[3840,["414","static/chunks/414-8318b3e90e55d32a.js","974","static/chunks/app/page-a584f9a9455d99db.js"],"default"]
5
+ 5:I[3840,["414","static/chunks/414-8318b3e90e55d32a.js","974","static/chunks/app/page-59b2858b3b17446e.js"],"default"]
6
6
  8:I[1597,[],"OutletBoundary"]
7
7
  a:I[7544,[],"AsyncMetadataOutlet"]
8
8
  c:I[1597,[],"ViewportBoundary"]
@@ -10,7 +10,7 @@ e:I[1597,[],"MetadataBoundary"]
10
10
  f:"$Sreact.suspense"
11
11
  11:I[2044,[],""]
12
12
  :HL["/_next/static/css/49e7ab4429e483d4.css","style"]
13
- 0:{"P":null,"b":"qkaM-_kJMthFE7DbnSDij","p":"","c":["",""],"i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/49e7ab4429e483d4.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"className":"font-sans","children":[["$","head",null,{"children":[["$","link",null,{"rel":"preconnect","href":"https://fonts.googleapis.com"}],["$","link",null,{"rel":"preconnect","href":"https://fonts.gstatic.com","crossOrigin":"anonymous"}],["$","link",null,{"href":"https://fonts.googleapis.com/css2?family=Geist:wght@100..900&family=Inter:wght@400..700&display=swap","rel":"stylesheet"}],["$","script",null,{"dangerouslySetInnerHTML":{"__html":"\n (function() {\n try {\n var stored = localStorage.getItem('theme');\n if (stored === 'dark' || (!stored && window.matchMedia('(prefers-color-scheme: dark)').matches)) {\n document.documentElement.classList.add('dark');\n } else {\n document.documentElement.classList.remove('dark');\n }\n } catch (e) {}\n })();\n "}}]]}],["$","body",null,{"className":"font-sans","suppressHydrationWarning":true,"children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]]}]]}],{"children":["__PAGE__",["$","$1","c",{"children":[["$","$L4",null,{"Component":"$5","searchParams":{},"params":{},"promises":["$@6","$@7"]}],null,["$","$L8",null,{"children":["$L9",["$","$La",null,{"promise":"$@b"}]]}]]}],{},null,false]},null,false],["$","$1","h",{"children":[null,[["$","$Lc",null,{"children":"$Ld"}],null],["$","$Le",null,{"children":["$","div",null,{"hidden":true,"children":["$","$f",null,{"fallback":null,"children":"$L10"}]}]}]]}],false]],"m":"$undefined","G":["$11",[]],"s":false,"S":true}
13
+ 0:{"P":null,"b":"bPWCf-gzBKdFUdcy_Q1EJ","p":"","c":["",""],"i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/49e7ab4429e483d4.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"className":"font-sans","children":[["$","head",null,{"children":[["$","link",null,{"rel":"preconnect","href":"https://fonts.googleapis.com"}],["$","link",null,{"rel":"preconnect","href":"https://fonts.gstatic.com","crossOrigin":"anonymous"}],["$","link",null,{"href":"https://fonts.googleapis.com/css2?family=Geist:wght@100..900&family=Inter:wght@400..700&display=swap","rel":"stylesheet"}],["$","script",null,{"dangerouslySetInnerHTML":{"__html":"\n (function() {\n try {\n var stored = localStorage.getItem('theme');\n if (stored === 'dark' || (!stored && window.matchMedia('(prefers-color-scheme: dark)').matches)) {\n document.documentElement.classList.add('dark');\n } else {\n document.documentElement.classList.remove('dark');\n }\n } catch (e) {}\n })();\n "}}]]}],["$","body",null,{"className":"font-sans","suppressHydrationWarning":true,"children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]]}]]}],{"children":["__PAGE__",["$","$1","c",{"children":[["$","$L4",null,{"Component":"$5","searchParams":{},"params":{},"promises":["$@6","$@7"]}],null,["$","$L8",null,{"children":["$L9",["$","$La",null,{"promise":"$@b"}]]}]]}],{},null,false]},null,false],["$","$1","h",{"children":[null,[["$","$Lc",null,{"children":"$Ld"}],null],["$","$Le",null,{"children":["$","div",null,{"hidden":true,"children":["$","$f",null,{"fallback":null,"children":"$L10"}]}]}]]}],false]],"m":"$undefined","G":["$11",[]],"s":false,"S":true}
14
14
  6:{}
15
15
  7:"$0:f:0:1:2:children:1:props:children:0:props:params"
16
16
  d:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]
package/public/repos.html CHANGED
@@ -1 +1 @@
1
- <!DOCTYPE html><!--qkaM__kJMthFE7DbnSDij--><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-2f0ed87fd33e9d1c.js"/><script src="/_next/static/chunks/a51c26f2-7912c8e37f20294d.js" async=""></script><script src="/_next/static/chunks/597-63908a91b482ecc2.js" async=""></script><script src="/_next/static/chunks/main-app-6713e5440a400899.js" async=""></script><title>TrueCourse</title><meta name="description" content="Visualize your codebase architecture"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><script src="/_next/static/chunks/webpack-2f0ed87fd33e9d1c.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[2064,[],\"\"]\n3:I[982,[],\"\"]\n4:I[5111,[\"763\",\"static/chunks/7273c211-8e9085ce5065411a.js\",\"414\",\"static/chunks/414-8318b3e90e55d32a.js\",\"728\",\"static/chunks/728-8bf3f63c2116a9f4.js\",\"302\",\"static/chunks/app/repos/%5B%5B...slug%5D%5D/page-e5fdcbd6e95a0351.js\"],\"default\"]\n5:I[1597,[],\"OutletBoundary\"]\n7:I[7544,[],\"AsyncMetadataOutlet\"]\n9:I[1597,[],\"ViewportBoundary\"]\nb:I[1597,[],\"MetadataBoundary\"]\nc:\"$Sreact.suspense\"\ne:I[2044,[],\"\"]\n:HL[\"/_next/static/css/49e7ab4429e483d4.css\",\"style\"]\n:HL[\"/_next/static/css/599369d853c61df7.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"qkaM-_kJMthFE7DbnSDij\",\"p\":\"\",\"c\":[\"\",\"repos\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"repos\",{\"children\":[[\"slug\",\"\",\"oc\"],{\"children\":[\"__PAGE__\",{}]}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/49e7ab4429e483d4.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"className\":\"font-sans\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"link\",null,{\"rel\":\"preconnect\",\"href\":\"https://fonts.googleapis.com\"}],[\"$\",\"link\",null,{\"rel\":\"preconnect\",\"href\":\"https://fonts.gstatic.com\",\"crossOrigin\":\"anonymous\"}],[\"$\",\"link\",null,{\"href\":\"https://fonts.googleapis.com/css2?family=Geist:wght@100..900\u0026family=Inter:wght@400..700\u0026display=swap\",\"rel\":\"stylesheet\"}],[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n (function() {\\n try {\\n var stored = localStorage.getItem('theme');\\n if (stored === 'dark' || (!stored \u0026\u0026 window.matchMedia('(prefers-color-scheme: dark)').matches)) {\\n document.documentElement.classList.add('dark');\\n } else {\\n document.documentElement.classList.remove('dark');\\n }\\n } catch (e) {}\\n })();\\n \"}}]]}],[\"$\",\"body\",null,{\"className\":\"font-sans\",\"suppressHydrationWarning\":true,\"children\":[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]]}]]}],{\"children\":[\"repos\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"slug\",\"\",\"oc\"],[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"$L4\",null,{}],[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/599369d853c61df7.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"$L5\",null,{\"children\":[\"$L6\",[\"$\",\"$L7\",null,{\"promise\":\"$@8\"}]]}]]}],{},null,false]},null,false]},null,false]},null,false],[\"$\",\"$1\",\"h\",{\"children\":[null,[[\"$\",\"$L9\",null,{\"children\":\"$La\"}],null],[\"$\",\"$Lb\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$c\",null,{\"fallback\":null,\"children\":\"$Ld\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$e\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"a:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n6:null\n"])</script><script>self.__next_f.push([1,"8:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"TrueCourse\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Visualize your codebase architecture\"}]],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"d:\"$8:metadata\"\n"])</script></body></html>
1
+ <!DOCTYPE html><!--bPWCf_gzBKdFUdcy_Q1EJ--><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-2f0ed87fd33e9d1c.js"/><script src="/_next/static/chunks/a51c26f2-7912c8e37f20294d.js" async=""></script><script src="/_next/static/chunks/597-63908a91b482ecc2.js" async=""></script><script src="/_next/static/chunks/main-app-598d148dafd4bc32.js" async=""></script><title>TrueCourse</title><meta name="description" content="Visualize your codebase architecture"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><script src="/_next/static/chunks/webpack-2f0ed87fd33e9d1c.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[2064,[],\"\"]\n3:I[982,[],\"\"]\n4:I[5111,[\"763\",\"static/chunks/7273c211-8e9085ce5065411a.js\",\"414\",\"static/chunks/414-8318b3e90e55d32a.js\",\"728\",\"static/chunks/728-8bf3f63c2116a9f4.js\",\"302\",\"static/chunks/app/repos/%5B%5B...slug%5D%5D/page-a9fc239dd01f7549.js\"],\"default\"]\n5:I[1597,[],\"OutletBoundary\"]\n7:I[7544,[],\"AsyncMetadataOutlet\"]\n9:I[1597,[],\"ViewportBoundary\"]\nb:I[1597,[],\"MetadataBoundary\"]\nc:\"$Sreact.suspense\"\ne:I[2044,[],\"\"]\n:HL[\"/_next/static/css/49e7ab4429e483d4.css\",\"style\"]\n:HL[\"/_next/static/css/599369d853c61df7.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"bPWCf-gzBKdFUdcy_Q1EJ\",\"p\":\"\",\"c\":[\"\",\"repos\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"repos\",{\"children\":[[\"slug\",\"\",\"oc\"],{\"children\":[\"__PAGE__\",{}]}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/49e7ab4429e483d4.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"className\":\"font-sans\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"link\",null,{\"rel\":\"preconnect\",\"href\":\"https://fonts.googleapis.com\"}],[\"$\",\"link\",null,{\"rel\":\"preconnect\",\"href\":\"https://fonts.gstatic.com\",\"crossOrigin\":\"anonymous\"}],[\"$\",\"link\",null,{\"href\":\"https://fonts.googleapis.com/css2?family=Geist:wght@100..900\u0026family=Inter:wght@400..700\u0026display=swap\",\"rel\":\"stylesheet\"}],[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n (function() {\\n try {\\n var stored = localStorage.getItem('theme');\\n if (stored === 'dark' || (!stored \u0026\u0026 window.matchMedia('(prefers-color-scheme: dark)').matches)) {\\n document.documentElement.classList.add('dark');\\n } else {\\n document.documentElement.classList.remove('dark');\\n }\\n } catch (e) {}\\n })();\\n \"}}]]}],[\"$\",\"body\",null,{\"className\":\"font-sans\",\"suppressHydrationWarning\":true,\"children\":[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]]}]]}],{\"children\":[\"repos\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"slug\",\"\",\"oc\"],[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"$L4\",null,{}],[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/599369d853c61df7.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"$L5\",null,{\"children\":[\"$L6\",[\"$\",\"$L7\",null,{\"promise\":\"$@8\"}]]}]]}],{},null,false]},null,false]},null,false]},null,false],[\"$\",\"$1\",\"h\",{\"children\":[null,[[\"$\",\"$L9\",null,{\"children\":\"$La\"}],null],[\"$\",\"$Lb\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$c\",null,{\"fallback\":null,\"children\":\"$Ld\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$e\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"a:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n6:null\n"])</script><script>self.__next_f.push([1,"8:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"TrueCourse\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Visualize your codebase architecture\"}]],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"d:\"$8:metadata\"\n"])</script></body></html>
package/public/repos.txt CHANGED
@@ -1,7 +1,7 @@
1
1
  1:"$Sreact.fragment"
2
2
  2:I[2064,[],""]
3
3
  3:I[982,[],""]
4
- 4:I[5111,["763","static/chunks/7273c211-8e9085ce5065411a.js","414","static/chunks/414-8318b3e90e55d32a.js","728","static/chunks/728-8bf3f63c2116a9f4.js","302","static/chunks/app/repos/%5B%5B...slug%5D%5D/page-e5fdcbd6e95a0351.js"],"default"]
4
+ 4:I[5111,["763","static/chunks/7273c211-8e9085ce5065411a.js","414","static/chunks/414-8318b3e90e55d32a.js","728","static/chunks/728-8bf3f63c2116a9f4.js","302","static/chunks/app/repos/%5B%5B...slug%5D%5D/page-a9fc239dd01f7549.js"],"default"]
5
5
  5:I[1597,[],"OutletBoundary"]
6
6
  7:I[7544,[],"AsyncMetadataOutlet"]
7
7
  9:I[1597,[],"ViewportBoundary"]
@@ -10,7 +10,7 @@ c:"$Sreact.suspense"
10
10
  e:I[2044,[],""]
11
11
  :HL["/_next/static/css/49e7ab4429e483d4.css","style"]
12
12
  :HL["/_next/static/css/599369d853c61df7.css","style"]
13
- 0:{"P":null,"b":"qkaM-_kJMthFE7DbnSDij","p":"","c":["","repos"],"i":false,"f":[[["",{"children":["repos",{"children":[["slug","","oc"],{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],["",["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/49e7ab4429e483d4.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"className":"font-sans","children":[["$","head",null,{"children":[["$","link",null,{"rel":"preconnect","href":"https://fonts.googleapis.com"}],["$","link",null,{"rel":"preconnect","href":"https://fonts.gstatic.com","crossOrigin":"anonymous"}],["$","link",null,{"href":"https://fonts.googleapis.com/css2?family=Geist:wght@100..900&family=Inter:wght@400..700&display=swap","rel":"stylesheet"}],["$","script",null,{"dangerouslySetInnerHTML":{"__html":"\n (function() {\n try {\n var stored = localStorage.getItem('theme');\n if (stored === 'dark' || (!stored && window.matchMedia('(prefers-color-scheme: dark)').matches)) {\n document.documentElement.classList.add('dark');\n } else {\n document.documentElement.classList.remove('dark');\n }\n } catch (e) {}\n })();\n "}}]]}],["$","body",null,{"className":"font-sans","suppressHydrationWarning":true,"children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]]}]]}],{"children":["repos",["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["slug","","oc"],["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":["__PAGE__",["$","$1","c",{"children":[["$","$L4",null,{}],[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/599369d853c61df7.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","$L5",null,{"children":["$L6",["$","$L7",null,{"promise":"$@8"}]]}]]}],{},null,false]},null,false]},null,false]},null,false],["$","$1","h",{"children":[null,[["$","$L9",null,{"children":"$La"}],null],["$","$Lb",null,{"children":["$","div",null,{"hidden":true,"children":["$","$c",null,{"fallback":null,"children":"$Ld"}]}]}]]}],false]],"m":"$undefined","G":["$e",[]],"s":false,"S":true}
13
+ 0:{"P":null,"b":"bPWCf-gzBKdFUdcy_Q1EJ","p":"","c":["","repos"],"i":false,"f":[[["",{"children":["repos",{"children":[["slug","","oc"],{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],["",["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/49e7ab4429e483d4.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"className":"font-sans","children":[["$","head",null,{"children":[["$","link",null,{"rel":"preconnect","href":"https://fonts.googleapis.com"}],["$","link",null,{"rel":"preconnect","href":"https://fonts.gstatic.com","crossOrigin":"anonymous"}],["$","link",null,{"href":"https://fonts.googleapis.com/css2?family=Geist:wght@100..900&family=Inter:wght@400..700&display=swap","rel":"stylesheet"}],["$","script",null,{"dangerouslySetInnerHTML":{"__html":"\n (function() {\n try {\n var stored = localStorage.getItem('theme');\n if (stored === 'dark' || (!stored && window.matchMedia('(prefers-color-scheme: dark)').matches)) {\n document.documentElement.classList.add('dark');\n } else {\n document.documentElement.classList.remove('dark');\n }\n } catch (e) {}\n })();\n "}}]]}],["$","body",null,{"className":"font-sans","suppressHydrationWarning":true,"children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]]}]]}],{"children":["repos",["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["slug","","oc"],["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":["__PAGE__",["$","$1","c",{"children":[["$","$L4",null,{}],[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/599369d853c61df7.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","$L5",null,{"children":["$L6",["$","$L7",null,{"promise":"$@8"}]]}]]}],{},null,false]},null,false]},null,false]},null,false],["$","$1","h",{"children":[null,[["$","$L9",null,{"children":"$La"}],null],["$","$Lb",null,{"children":["$","div",null,{"hidden":true,"children":["$","$c",null,{"fallback":null,"children":"$Ld"}]}]}]]}],false]],"m":"$undefined","G":["$e",[]],"s":false,"S":true}
14
14
  a:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]
15
15
  6:null
16
16
  8:{"metadata":[["$","title","0",{"children":"TrueCourse"}],["$","meta","1",{"name":"description","content":"Visualize your codebase architecture"}]],"error":null,"digest":"$undefined"}
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[492],{12:(e,t,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/_not-found/page",function(){return l(4042)}])},572:(e,t,l)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"HTTPAccessErrorFallback",{enumerable:!0,get:function(){return o}});let r=l(6409),n=l(6032);function o(e){let{status:t,message:l}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("title",{children:t+": "+l}),(0,r.jsx)("div",{style:n.styles.error,children:(0,r.jsxs)("div",{children:[(0,r.jsx)("style",{dangerouslySetInnerHTML:{__html:"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}),(0,r.jsx)("h1",{className:"next-error-h1",style:n.styles.h1,children:t}),(0,r.jsx)("div",{style:n.styles.desc,children:(0,r.jsx)("h2",{style:n.styles.h2,children:l})})]})})]})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},4042:(e,t,l)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o}});let r=l(6409),n=l(572),o=function(){return(0,r.jsx)("html",{children:(0,r.jsx)("body",{children:(0,r.jsx)(n.HTTPAccessErrorFallback,{status:404,message:"This page could not be found."})})})};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6032:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"styles",{enumerable:!0,get:function(){return l}});let l={error:{fontFamily:'system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"',height:"100vh",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},desc:{display:"inline-block"},h1:{display:"inline-block",margin:"0 20px 0 0",padding:"0 23px 0 0",fontSize:24,fontWeight:500,verticalAlign:"top",lineHeight:"49px"},h2:{fontSize:14,fontWeight:400,lineHeight:"49px",margin:0}};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}},e=>{e.O(0,[429,597,358],()=>e(e.s=12)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[177],{7013:()=>{},7952:(e,s,_)=>{Promise.resolve().then(_.t.bind(_,7013,23))}},e=>{e.O(0,[726,429,597,358],()=>e(e.s=7952)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[974],{432:(e,t,a)=>{"use strict";a.d(t,{L8:()=>o,LY:()=>c,M2:()=>l,S:()=>m,Vl:()=>f,XT:()=>u,YN:()=>i,aE:()=>p,ge:()=>x,kP:()=>g,lS:()=>h,sv:()=>d});let r=(0,a(2011).T)();class s extends Error{constructor(e,t){super(t),this.status=e,this.name="ApiError"}}async function n(e,t){let a="".concat(r).concat(e),n=await fetch(a,{...t,headers:{"Content-Type":"application/json",...null==t?void 0:t.headers}});if(!n.ok){let e=await n.text().catch(()=>"Unknown error");throw new s(n.status,e)}return n.json()}function i(){return n("/api/repos")}function o(e){return n("/api/repos/".concat(e))}function d(e){return n("/api/repos",{method:"POST",body:JSON.stringify({path:e})})}function l(e){return n("/api/repos/".concat(e),{method:"DELETE"})}function c(e,t){return n("/api/repos/".concat(e,"/analyze"),{method:"POST",body:JSON.stringify({branch:t})})}function u(e,t){let a=t?"?branch=".concat(encodeURIComponent(t)):"";return n("/api/repos/".concat(e,"/graph").concat(a))}function m(e,t,a){let r=a?"?branch=".concat(encodeURIComponent(a)):"";return n("/api/repos/".concat(e,"/graph/positions").concat(r),{method:"PUT",body:JSON.stringify({positions:t})})}function p(e,t){let a=t?"?branch=".concat(encodeURIComponent(t)):"";return n("/api/repos/".concat(e,"/graph/positions").concat(a),{method:"DELETE"})}function x(e){return n("/api/repos/".concat(e,"/insights"))}function h(e){return n("/api/repos/".concat(e,"/conversations"))}function g(e,t){return n("/api/repos/".concat(e,"/chat/").concat(t))}function f(e,t,a,n,i,o){let d=new AbortController;return fetch("".concat(r,"/api/repos/").concat(e,"/chat"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:t,nodeContext:null==o?void 0:o.nodeContext,conversationId:null==o?void 0:o.conversationId}),signal:d.signal}).then(async e=>{var t;if(!e.ok)throw new s(e.status,await e.text());let r=e.headers.get("X-Conversation-Id")||void 0,i=null==(t=e.body)?void 0:t.getReader();if(!i)throw Error("No response body");let o=new TextDecoder,d="";for(;;){let{done:e,value:t}=await i.read();if(e)break;let s=(d+=o.decode(t,{stream:!0})).split("\n");for(let e of(d=s.pop()||"",s))if(e.startsWith("data: ")){let t=e.slice(6);if("[DONE]"===t)return void n(r);try{let e=JSON.parse(t);e.content&&a(e.content)}catch(e){a(t)}}}n(r)}).catch(e=>{"AbortError"!==e.name&&i(e)}),d}},553:(e,t,a)=>{"use strict";a.d(t,{Y:()=>h});var r=a(6409),s=a(7367),n=a(8925),i=a(1540),o=a(7054),d=a(3218),l=a(2368),c=a(9235),u=a(7505),m=a.n(u),p=a(4669),x=a(4846);function h(e){let{repoName:t,branches:a,selectedBranch:u,onBranchChange:h,onAnalyze:g,isAnalyzing:f,showBack:v,backHref:b="/",isSidebarOpen:y,onToggleSidebar:j}=e,[N,w]=(0,p.useState)(!1);return(0,p.useEffect)(()=>{w(document.documentElement.classList.contains("dark"))},[]),(0,r.jsxs)("header",{className:"flex h-14 items-center justify-between border-b border-border bg-card px-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[v&&(0,r.jsx)(m(),{href:b,className:(0,x.r)({variant:"ghost",size:"icon-sm"}),children:(0,r.jsx)(s.A,{className:"h-5 w-5"})}),(0,r.jsx)(m(),{href:"/",className:"text-lg font-bold text-foreground",children:"TrueCourse"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[t&&(0,r.jsx)("span",{className:"text-sm font-medium text-foreground",children:t}),a&&a.length>0&&(0,r.jsxs)("div",{className:"flex items-center gap-1.5 rounded-md border border-border bg-muted px-2 py-1",children:[(0,r.jsx)(n.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,r.jsx)("select",{value:u||"",onChange:e=>null==h?void 0:h(e.target.value),className:"bg-transparent text-sm text-foreground outline-none",children:a.map(e=>(0,r.jsx)("option",{value:e,children:e},e))})]}),g&&(0,r.jsxs)(x.$,{size:"sm",onClick:g,disabled:f,children:[f&&(0,r.jsx)(i.A,{className:"h-3.5 w-3.5 animate-spin"}),f?"Analyzing...":"Analyze"]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[j&&(0,r.jsx)(x.$,{variant:"ghost",size:"icon-sm",onClick:j,"aria-label":y?"Close panel":"Open panel",children:y?(0,r.jsx)(o.A,{className:"h-5 w-5"}):(0,r.jsx)(d.A,{className:"h-5 w-5"})}),(0,r.jsx)(x.$,{variant:"ghost",size:"icon-sm",onClick:()=>{let e=!N;w(e),document.documentElement.classList.toggle("dark",e),localStorage.setItem("theme",e?"dark":"light")},"aria-label":"Toggle theme",children:N?(0,r.jsx)(l.A,{className:"h-5 w-5"}):(0,r.jsx)(c.A,{className:"h-5 w-5"})})]})]})}},879:(e,t,a)=>{Promise.resolve().then(a.bind(a,3840))},2011:(e,t,a)=>{"use strict";function r(){return""}a.d(t,{T:()=>r})},2054:(e,t,a)=>{"use strict";a.d(t,{p:()=>i});var r=a(6409);a(4669);var s=a(7350),n=a(6669);function i(e){let{className:t,type:a,...i}=e;return(0,r.jsx)(s.p,{type:a,"data-slot":"input",className:(0,n.cn)("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",t),...i})}},3316:(e,t,a)=>{"use strict";a.d(t,{BT:()=>d,Wu:()=>l,ZB:()=>o,Zp:()=>n,aR:()=>i,wL:()=>c});var r=a(6409);a(4669);var s=a(6669);function n(e){let{className:t,size:a="default",...n}=e;return(0,r.jsx)("div",{"data-slot":"card","data-size":a,className:(0,s.cn)("group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",t),...n})}function i(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"card-header",className:(0,s.cn)("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",t),...a})}function o(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"card-title",className:(0,s.cn)("text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",t),...a})}function d(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"card-description",className:(0,s.cn)("text-sm text-muted-foreground",t),...a})}function l(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"card-content",className:(0,s.cn)("px-4 group-data-[size=sm]/card:px-3",t),...a})}function c(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"card-footer",className:(0,s.cn)("flex items-center rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/card:p-3",t),...a})}},3840:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>k});var r=a(6409),s=a(553),n=a(4669),i=a(9383);let o=(0,i.A)("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);var d=a(1540),l=a(726),c=a(2054),u=a(4846);function m(e){let{onAdd:t}=e,[a,s]=(0,n.useState)(""),[i,m]=(0,n.useState)(!1),[p,x]=(0,n.useState)(null),h=async e=>{if(e.preventDefault(),a.trim()){m(!0),x(null);try{await t(a.trim()),s("")}catch(e){x(e instanceof Error?e.message:"Failed to add repository")}finally{m(!1)}}};return(0,r.jsxs)("form",{onSubmit:h,className:"w-full",children:[(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsxs)("div",{className:"relative flex-1",children:[(0,r.jsx)(o,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,r.jsx)(c.p,{type:"text",value:a,onChange:e=>s(e.target.value),placeholder:"Paste repository path...",className:"pl-10"})]}),(0,r.jsxs)(u.$,{type:"submit",disabled:i||!a.trim(),children:[i?(0,r.jsx)(d.A,{className:"h-4 w-4 animate-spin"}):(0,r.jsx)(l.A,{className:"h-4 w-4"}),"Add Repository"]})]}),p&&(0,r.jsx)("p",{className:"mt-2 text-sm text-destructive",children:p})]})}var p=a(7505),x=a.n(p);let h=(0,i.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"}]]),g=(0,i.A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);var f=a(1160);let v=(0,i.A)("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]),b=(0,i.A)("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);var y=a(3316);function j(e){let{repos:t,onAnalyze:a,onDelete:s}=e;return 0===t.length?(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed border-border py-16",children:[(0,r.jsx)(h,{className:"mb-4 h-12 w-12 text-muted-foreground"}),(0,r.jsx)("p",{className:"text-lg font-medium text-foreground",children:"No repositories yet"}),(0,r.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"Add a repository path above to get started"})]}):(0,r.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:t.map(e=>(0,r.jsxs)(y.Zp,{className:"flex flex-col transition-shadow hover:shadow-md",children:[(0,r.jsxs)(y.aR,{className:"flex flex-row items-start justify-between space-y-0 pb-2",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)(y.ZB,{className:"truncate text-base",children:e.name}),(0,r.jsx)(y.BT,{className:"mt-0.5 truncate text-xs",children:e.path})]}),(0,r.jsx)(u.$,{variant:"ghost",size:"icon-xs",onClick:()=>s(e.id),className:"ml-2 flex-shrink-0 text-muted-foreground hover:text-destructive","aria-label":"Delete repository",children:(0,r.jsx)(g,{className:"h-4 w-4"})})]}),(0,r.jsx)(y.Wu,{className:"pb-2",children:e.lastAnalyzed&&(0,r.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[(0,r.jsx)(f.A,{className:"h-3 w-3"}),(0,r.jsxs)("span",{children:["Analyzed"," ",new Date(e.lastAnalyzed).toLocaleDateString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})]})]})}),(0,r.jsxs)(y.wL,{className:"mt-auto gap-2",children:[(0,r.jsxs)(u.$,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>a(e.id),children:[(0,r.jsx)(v,{className:"h-3.5 w-3.5"}),"Analyze"]}),(0,r.jsxs)(x(),{href:"/repos/".concat(e.id),className:(0,u.r)({size:"sm",className:"flex-1"}),children:[(0,r.jsx)(b,{className:"h-3.5 w-3.5"}),"View Graph"]})]})]},e.id))})}var N=a(432),w=a(5500);function k(){let{repos:e,isLoading:t,error:a,addRepo:i,deleteRepo:o,analyzeRepo:l}=function(){let[e,t]=(0,n.useState)([]),[a,r]=(0,n.useState)(!0),[s,i]=(0,n.useState)(null),o=(0,n.useCallback)(async()=>{r(!0),i(null);try{let e=await N.YN();t(e)}catch(e){i(e instanceof Error?e.message:"Failed to fetch repos")}finally{r(!1)}},[]);(0,n.useEffect)(()=>{o()},[o]);let d=(0,n.useCallback)(async e=>{try{let a=await N.sv(e);return t(e=>[...e,a]),a}catch(e){throw i(e instanceof Error?e.message:"Failed to add repo"),e}},[]);return{repos:e,isLoading:a,error:s,addRepo:d,deleteRepo:(0,n.useCallback)(async e=>{try{await N.M2(e),t(t=>t.filter(t=>t.id!==e))}catch(e){throw i(e instanceof Error?e.message:"Failed to delete repo"),e}},[]),analyzeRepo:(0,n.useCallback)(async(e,t)=>{try{return await N.LY(e,t)}catch(e){throw i(e instanceof Error?e.message:"Failed to start analysis"),e}},[]),refetch:o}}(),c=async e=>{try{await l(e)}catch(e){}},u=async e=>{try{await o(e)}catch(e){}};return(0,r.jsxs)("div",{className:"flex min-h-screen flex-col",children:[(0,r.jsx)(s.Y,{}),(0,r.jsxs)("main",{className:"mx-auto w-full max-w-5xl flex-1 px-4 py-8",children:[(0,r.jsxs)("div",{className:"mb-8 text-center",children:[(0,r.jsx)("h1",{className:"text-3xl font-bold text-foreground",children:"TrueCourse"}),(0,r.jsx)("p",{className:"mt-2 text-muted-foreground",children:"Visualize and understand your codebase architecture"})]}),(0,r.jsx)("div",{className:"mb-8",children:(0,r.jsx)(m,{onAdd:i})}),a&&(0,r.jsx)(w.Fc,{variant:"destructive",className:"mb-6",children:(0,r.jsx)(w.TN,{children:a})}),t?(0,r.jsx)("div",{className:"flex items-center justify-center py-16",children:(0,r.jsx)(d.A,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):(0,r.jsx)(j,{repos:e,onAnalyze:c,onDelete:u})]})]})}},4846:(e,t,a)=>{"use strict";a.d(t,{$:()=>d,r:()=>o});var r=a(6409),s=a(7248),n=a(268),i=a(6669);let o=(0,n.F)("group/button inline-flex shrink-0 cursor-pointer items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function d(e){let{className:t,variant:a="default",size:n="default",...d}=e;return(0,r.jsx)(s.$,{"data-slot":"button",className:(0,i.cn)(o({variant:a,size:n,className:t})),...d})}},5500:(e,t,a)=>{"use strict";a.d(t,{Fc:()=>o,TN:()=>l,XL:()=>d});var r=a(6409);a(4669);var s=a(268),n=a(6669);let i=(0,s.F)("group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current"}},defaultVariants:{variant:"default"}});function o(e){let{className:t,variant:a,...s}=e;return(0,r.jsx)("div",{"data-slot":"alert",role:"alert",className:(0,n.cn)(i({variant:a}),t),...s})}function d(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"alert-title",className:(0,n.cn)("font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground",t),...a})}function l(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"alert-description",className:(0,n.cn)("text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",t),...a})}},6669:(e,t,a)=>{"use strict";a.d(t,{cn:()=>n});var r=a(1754),s=a(3225);function n(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,s.QP)((0,r.$)(t))}}},e=>{e.O(0,[414,429,597,358],()=>e(e.s=879)),_N_E=e.O()}]);