@jetcrab/pi-desk 1.1.29-dev → 1.1.30-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/docs/plugins.md +2 -2
  2. package/package.json +1 -1
  3. package/src/client/l1_entry/pages/l1-error-page.tsx +1 -1
  4. package/src/client/l1_entry/providers/l1-app-providers.tsx +2 -0
  5. package/src/client/l2_biz/auth/l2-login.module.css +1 -1
  6. package/src/client/l2_biz/plugin-host/l2-plugin-composer-panel.tsx +1 -1
  7. package/src/client/l2_biz/plugin-host/l2-plugin-contribution-host.tsx +1 -1
  8. package/src/client/l2_biz/plugin-host/l2-plugin-session-header-layout.ts +6 -3
  9. package/src/client/l2_biz/plugin-host/l2-plugin-session-header.tsx +75 -18
  10. package/src/client/l2_biz/project-preview/l2-project-preview-dialog.tsx +2 -2
  11. package/src/client/l2_biz/project-preview/l2-project-preview-page.tsx +1 -1
  12. package/src/client/l2_biz/settings/l2-settings.tsx +1 -1
  13. package/src/client/l2_biz/settings/l2-skills-settings.tsx +1 -1
  14. package/src/client/l2_biz/task-center/l2-task-center.tsx +1 -1
  15. package/src/client/l2_biz/workbench/file-workspace/l2-plugin-standalone-file-preview.tsx +1 -1
  16. package/src/client/l2_biz/workbench/file-workspace/l2-work-session-file-preview.tsx +1 -1
  17. package/src/client/l2_biz/workbench/l2-workbench.tsx +1 -1
  18. package/src/client/l4_foundation/desktop-window/l4-desktop-titlebar.tsx +188 -0
  19. package/src/client/l4_foundation/desktop-window/l4-desktop-window.css +107 -0
  20. package/src/client/l4_foundation/desktop-window/l4-desktop-window.ts +20 -0
  21. package/src/client/l4_foundation/ui/l4-app-dialog.tsx +2 -2
  22. package/temp/build/pi-desk/release/.next/BUILD_ID +1 -1
  23. package/temp/build/pi-desk/release/.next/build-manifest.json +3 -3
  24. package/temp/build/pi-desk/release/.next/required-server-files.js +2 -2
  25. package/temp/build/pi-desk/release/.next/required-server-files.json +2 -2
  26. package/temp/build/pi-desk/release/.next/server/app/_global-error/page.js +1 -1
  27. package/temp/build/pi-desk/release/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  28. package/temp/build/pi-desk/release/.next/server/app/_global-error.html +1 -1
  29. package/temp/build/pi-desk/release/.next/server/app/_global-error.rsc +3 -3
  30. package/temp/build/pi-desk/release/.next/server/app/_global-error.segments/_full.segment.rsc +3 -3
  31. package/temp/build/pi-desk/release/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +3 -3
  32. package/temp/build/pi-desk/release/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  33. package/temp/build/pi-desk/release/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  34. package/temp/build/pi-desk/release/.next/server/app/api/health/route.js +1 -1
  35. package/temp/build/pi-desk/release/.next/server/app/login/page_client-reference-manifest.js +1 -1
  36. package/temp/build/pi-desk/release/.next/server/app/page.js +5 -5
  37. package/temp/build/pi-desk/release/.next/server/app/page_client-reference-manifest.js +1 -1
  38. package/temp/build/pi-desk/release/.next/server/app/project-preview/page.js +1 -1
  39. package/temp/build/pi-desk/release/.next/server/app/project-preview/page_client-reference-manifest.js +1 -1
  40. package/temp/build/pi-desk/release/.next/server/chunks/27344.js +1 -1
  41. package/temp/build/pi-desk/release/.next/server/chunks/35985.js +2 -2
  42. package/temp/build/pi-desk/release/.next/server/middleware-build-manifest.js +1 -1
  43. package/temp/build/pi-desk/release/.next/server/pages/500.html +1 -1
  44. package/temp/build/pi-desk/release/.next/static/chunks/{65232-a8571f78020eede2.js → 65232-f5b71cec787a30ec.js} +1 -1
  45. package/temp/build/pi-desk/release/.next/static/chunks/app/error-1ab62762c5f4144f.js +1 -0
  46. package/temp/build/pi-desk/release/.next/static/chunks/app/layout-ca5ef5994165eb2e.js +1 -0
  47. package/temp/build/pi-desk/release/.next/static/chunks/app/not-found-b8b9b7ef5ccb7601.js +1 -0
  48. package/temp/build/pi-desk/release/.next/static/chunks/app/page-978906de76a8dcfe.js +158 -0
  49. package/temp/build/pi-desk/release/.next/static/chunks/app/project-preview/{page-e1dbfcfc0f333e01.js → page-aaa845016a934245.js} +1 -1
  50. package/temp/build/pi-desk/release/.next/static/chunks/{webpack-c0b805df46fcf8b3.js → webpack-a84310d111797bef.js} +1 -1
  51. package/temp/build/pi-desk/release/.next/static/css/053a8d82c09326cd.css +1 -0
  52. package/temp/build/pi-desk/release/.next/static/css/1cc92eec583aa639.css +1 -0
  53. package/temp/build/pi-desk/release/.next/static/css/3c59ac068ae404da.css +1 -0
  54. package/temp/build/pi-desk/release/.next/trace-build +1 -1
  55. package/temp/build/pi-desk/release/.next/static/chunks/app/error-216b14b5da089ed3.js +0 -1
  56. package/temp/build/pi-desk/release/.next/static/chunks/app/layout-2c6a573d3004516e.js +0 -1
  57. package/temp/build/pi-desk/release/.next/static/chunks/app/not-found-720cdf6a606b821a.js +0 -1
  58. package/temp/build/pi-desk/release/.next/static/chunks/app/page-f78be007d97f0d95.js +0 -158
  59. package/temp/build/pi-desk/release/.next/static/css/2bdcf40eca12b794.css +0 -1
  60. package/temp/build/pi-desk/release/.next/static/css/a677e7fbf6e2173e.css +0 -1
  61. /package/temp/build/pi-desk/release/.next/static/{Yyfg-r17aYmEzlYYlIwDo → ErYBfYXAir5b-6rlacGvL}/_buildManifest.js +0 -0
  62. /package/temp/build/pi-desk/release/.next/static/{Yyfg-r17aYmEzlYYlIwDo → ErYBfYXAir5b-6rlacGvL}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],lowPriorityFiles:["static/Yyfg-r17aYmEzlYYlIwDo/_buildManifest.js","static/Yyfg-r17aYmEzlYYlIwDo/_ssgManifest.js"],rootMainFiles:["static/chunks/webpack-c0b805df46fcf8b3.js","static/chunks/e388c842-1ca92f1ea0dfe8ee.js","static/chunks/64444-3e955f910569274d.js","static/chunks/main-app-6230945a5a062fce.js"],rootMainFilesTree:{},pages:{"/_app":[]}};
1
+ globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],lowPriorityFiles:["static/ErYBfYXAir5b-6rlacGvL/_buildManifest.js","static/ErYBfYXAir5b-6rlacGvL/_ssgManifest.js"],rootMainFiles:["static/chunks/webpack-a84310d111797bef.js","static/chunks/e388c842-1ca92f1ea0dfe8ee.js","static/chunks/64444-3e955f910569274d.js","static/chunks/main-app-6230945a5a062fce.js"],rootMainFilesTree:{},pages:{"/_app":[]}};
@@ -1 +1 @@
1
- <!DOCTYPE html><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-c0b805df46fcf8b3.js"/><script src="/_next/static/chunks/e388c842-1ca92f1ea0dfe8ee.js" async=""></script><script src="/_next/static/chunks/64444-3e955f910569274d.js" async=""></script><script src="/_next/static/chunks/main-app-6230945a5a062fce.js" async=""></script><script src="/_next/static/chunks/57235-03ba1044f22b6c84.js" async=""></script><script src="/_next/static/chunks/22092-6d1bfbefa825ec03.js" async=""></script><script src="/_next/static/chunks/app/error-216b14b5da089ed3.js" async=""></script><script src="/_next/static/chunks/app/not-found-720cdf6a606b821a.js" async=""></script><script src="/_next/static/chunks/app/global-error-6f5fc4928fd1966c.js" async=""></script><title>500: This page couldn’t load</title><style>:root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }</style><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><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;display:flex;align-items:center;justify-content:center"><div style="margin-top:-32px;max-width:325px;padding:32px 28px;text-align:left"><svg width="32" height="32" viewBox="-0.2 -1.5 32 32" fill="none" style="margin-bottom:24px"><path d="M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z" fill="var(--next-error-title)"></path></svg><h1 style="font-size:24px;font-weight:500;letter-spacing:-0.02em;line-height:32px;margin:0 0 12px 0;color:var(--next-error-title)">This page couldn’t load</h1><p style="font-size:14px;font-weight:400;line-height:21px;margin:0 0 20px 0;color:var(--next-error-message)">A server error occurred. Reload to try again.</p><form style="margin:0"><button type="submit" style="display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;font-size:14px;font-weight:500;line-height:20px;border-radius:6px;cursor:pointer;color:var(--next-error-btn-text);background:var(--next-error-btn-bg);border:var(--next-error-btn-border)">Reload</button></form></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-c0b805df46fcf8b3.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[90184,[],\"\"]\n3:I[84845,[\"57235\",\"static/chunks/57235-03ba1044f22b6c84.js\",\"22092\",\"static/chunks/22092-6d1bfbefa825ec03.js\",\"18039\",\"static/chunks/app/error-216b14b5da089ed3.js\"],\"default\"]\n4:I[44478,[],\"\"]\n5:I[66999,[\"57235\",\"static/chunks/57235-03ba1044f22b6c84.js\",\"22092\",\"static/chunks/22092-6d1bfbefa825ec03.js\",\"24345\",\"static/chunks/app/not-found-720cdf6a606b821a.js\"],\"L1ErrorPage\"]\n6:I[14405,[],\"OutletBoundary\"]\n7:\"$Sreact.suspense\"\na:I[14405,[],\"ViewportBoundary\"]\nc:I[14405,[],\"MetadataBoundary\"]\ne:I[71713,[\"34219\",\"static/chunks/app/global-error-6f5fc4928fd1966c.js\"],\"default\"]\n9:X\n0:{\"P\":null,\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"_global-error\",{\"children\":[\"__PAGE__\",{},\"$undefined\",\"$undefined\",4624]},\"$undefined\",\"$undefined\",4624]},\"$undefined\",\"$undefined\",4624],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$3\",\"errorStyles\":[],\"errorScripts\":null,\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"$L5\",null,{\"notFound\":true}],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"title\",null,{\"children\":\"500: This page couldn’t load\"}],[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }\"}}]]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"marginTop\":\"-32px\",\"maxWidth\":\"325px\",\"padding\":\"32px 28px\",\"textAlign\":\"left\"},\"children\":[[\"$\",\"svg\",null,{\"width\":\"32\",\"height\":\"32\",\"viewBox\":\"-0.2 -1.5 32 32\",\"fill\":\"none\",\"style\":{\"marginBottom\":\"24px\"},\"children\":[\"$\",\"path\",null,{\"d\":\"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z\",\"fill\":\"var(--next-error-title)\"}]}],[\"$\",\"h1\",null,{\"style\":{\"fontSize\":\"24px\",\"fontWeight\":500,\"letterSpacing\":\"-0.02em\",\"lineHeight\":\"32px\",\"margin\":\"0 0 12px 0\",\"color\":\"var(--next-error-title)\"},\"children\":\"This page couldn’t load\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":\"14px\",\"fontWeight\":400,\"lineHeight\":\"21px\",\"margin\":\"0 0 20px 0\",\"color\":\"var(--next-error-message)\"},\"children\":\"A server error occurred. Reload to try again.\"}],[\"$\",\"form\",null,{\"style\":{\"margin\":0},\"children\":[\"$\",\"button\",null,{\"type\":\"submit\",\"style\":{\"display\":\"inline-flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"height\":\"32px\",\"padding\":\"0 12px\",\"fontSize\":\"14px\",\"fontWeight\":500,\"lineHeight\":\"20px\",\"borderRadius\":\"6px\",\"cursor\":\"pointer\",\"color\":\"var(--next-error-btn-text)\",\"background\":\"var(--next-error-btn-bg)\",\"border\":\"var(--next-error-btn-border)\"},\"children\":\"Reload\"}]}]]}]}]}]]}],null,[\"$\",\"$L6\",null,{\"children\":[\"$\",\"$7\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@8\"}]}]]}],{},null,false,null]},null,false,\"$9\"]},null,false,\"$9\"],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$La\",null,{\"children\":\"$Lb\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$Lc\",null,{\"children\":[\"$\",\"$7\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Ld\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$e\",[]],\"S\":true,\"h\":null,\"r\":\"$undefined\",\"s\":\"$undefined\",\"a\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"Yyfg-r17aYmEzlYYlIwDo\"}\n9:C\nb:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n8:null\nd:[]\n"])</script></body></html>
1
+ <!DOCTYPE html><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-a84310d111797bef.js"/><script src="/_next/static/chunks/e388c842-1ca92f1ea0dfe8ee.js" async=""></script><script src="/_next/static/chunks/64444-3e955f910569274d.js" async=""></script><script src="/_next/static/chunks/main-app-6230945a5a062fce.js" async=""></script><script src="/_next/static/chunks/57235-03ba1044f22b6c84.js" async=""></script><script src="/_next/static/chunks/22092-6d1bfbefa825ec03.js" async=""></script><script src="/_next/static/chunks/app/error-1ab62762c5f4144f.js" async=""></script><script src="/_next/static/chunks/app/not-found-b8b9b7ef5ccb7601.js" async=""></script><script src="/_next/static/chunks/app/global-error-6f5fc4928fd1966c.js" async=""></script><title>500: This page couldn’t load</title><style>:root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }</style><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><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;display:flex;align-items:center;justify-content:center"><div style="margin-top:-32px;max-width:325px;padding:32px 28px;text-align:left"><svg width="32" height="32" viewBox="-0.2 -1.5 32 32" fill="none" style="margin-bottom:24px"><path d="M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z" fill="var(--next-error-title)"></path></svg><h1 style="font-size:24px;font-weight:500;letter-spacing:-0.02em;line-height:32px;margin:0 0 12px 0;color:var(--next-error-title)">This page couldn’t load</h1><p style="font-size:14px;font-weight:400;line-height:21px;margin:0 0 20px 0;color:var(--next-error-message)">A server error occurred. Reload to try again.</p><form style="margin:0"><button type="submit" style="display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;font-size:14px;font-weight:500;line-height:20px;border-radius:6px;cursor:pointer;color:var(--next-error-btn-text);background:var(--next-error-btn-bg);border:var(--next-error-btn-border)">Reload</button></form></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-a84310d111797bef.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[90184,[],\"\"]\n3:I[84845,[\"57235\",\"static/chunks/57235-03ba1044f22b6c84.js\",\"22092\",\"static/chunks/22092-6d1bfbefa825ec03.js\",\"18039\",\"static/chunks/app/error-1ab62762c5f4144f.js\"],\"default\"]\n4:I[44478,[],\"\"]\n5:I[66999,[\"57235\",\"static/chunks/57235-03ba1044f22b6c84.js\",\"22092\",\"static/chunks/22092-6d1bfbefa825ec03.js\",\"24345\",\"static/chunks/app/not-found-b8b9b7ef5ccb7601.js\"],\"L1ErrorPage\"]\n6:I[14405,[],\"OutletBoundary\"]\n7:\"$Sreact.suspense\"\na:I[14405,[],\"ViewportBoundary\"]\nc:I[14405,[],\"MetadataBoundary\"]\ne:I[71713,[\"34219\",\"static/chunks/app/global-error-6f5fc4928fd1966c.js\"],\"default\"]\n9:X\n0:{\"P\":null,\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"_global-error\",{\"children\":[\"__PAGE__\",{},\"$undefined\",\"$undefined\",4624]},\"$undefined\",\"$undefined\",4624]},\"$undefined\",\"$undefined\",4624],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$3\",\"errorStyles\":[],\"errorScripts\":null,\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"$L5\",null,{\"notFound\":true}],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"title\",null,{\"children\":\"500: This page couldn’t load\"}],[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }\"}}]]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"marginTop\":\"-32px\",\"maxWidth\":\"325px\",\"padding\":\"32px 28px\",\"textAlign\":\"left\"},\"children\":[[\"$\",\"svg\",null,{\"width\":\"32\",\"height\":\"32\",\"viewBox\":\"-0.2 -1.5 32 32\",\"fill\":\"none\",\"style\":{\"marginBottom\":\"24px\"},\"children\":[\"$\",\"path\",null,{\"d\":\"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z\",\"fill\":\"var(--next-error-title)\"}]}],[\"$\",\"h1\",null,{\"style\":{\"fontSize\":\"24px\",\"fontWeight\":500,\"letterSpacing\":\"-0.02em\",\"lineHeight\":\"32px\",\"margin\":\"0 0 12px 0\",\"color\":\"var(--next-error-title)\"},\"children\":\"This page couldn’t load\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":\"14px\",\"fontWeight\":400,\"lineHeight\":\"21px\",\"margin\":\"0 0 20px 0\",\"color\":\"var(--next-error-message)\"},\"children\":\"A server error occurred. Reload to try again.\"}],[\"$\",\"form\",null,{\"style\":{\"margin\":0},\"children\":[\"$\",\"button\",null,{\"type\":\"submit\",\"style\":{\"display\":\"inline-flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"height\":\"32px\",\"padding\":\"0 12px\",\"fontSize\":\"14px\",\"fontWeight\":500,\"lineHeight\":\"20px\",\"borderRadius\":\"6px\",\"cursor\":\"pointer\",\"color\":\"var(--next-error-btn-text)\",\"background\":\"var(--next-error-btn-bg)\",\"border\":\"var(--next-error-btn-border)\"},\"children\":\"Reload\"}]}]]}]}]}]]}],null,[\"$\",\"$L6\",null,{\"children\":[\"$\",\"$7\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@8\"}]}]]}],{},null,false,null]},null,false,\"$9\"]},null,false,\"$9\"],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$La\",null,{\"children\":\"$Lb\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$Lc\",null,{\"children\":[\"$\",\"$7\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Ld\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$e\",[]],\"S\":true,\"h\":null,\"r\":\"$undefined\",\"s\":\"$undefined\",\"a\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"ErYBfYXAir5b-6rlacGvL\"}\n9:C\nb:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n8:null\nd:[]\n"])</script></body></html>
@@ -1,4 +1,4 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[65232],{1364:(e,t,s)=>{"use strict";s.d(t,{Ip:()=>g,JW:()=>m,K5:()=>v,Rc:()=>f,kt:()=>x,tz:()=>p});var i=s(7962);s(69266);var r=s(85137),a=s(79102),n=s(66467),o=s(60454),l=s(93750),c=s(39608),d=s(4947),u=s(49426),h=s(13464);function p({...e}){return(0,i.jsx)(r.D,{"data-slot":"context-menu",...e})}function m({...e}){return(0,i.jsx)(a.g,{"data-slot":"context-menu-portal",...e})}function f({className:e,...t}){return(0,i.jsx)(n.R,{"data-slot":"context-menu-trigger",className:(0,u.cn)("select-none",e),...t})}function g({className:e,align:t="start",alignOffset:s=4,side:r="right",sideOffset:n=0,finalFocus:c=!1,...d}){return(0,i.jsx)(a.g,{children:(0,i.jsx)(o.y,{className:"isolate z-50 outline-none",align:t,alignOffset:s,side:r,sideOffset:n,children:(0,i.jsx)(l._,{"data-slot":"context-menu-content",finalFocus:c,className:(0,u.cn)(h.hD,e),...d})})})}function x({className:e,inset:t,variant:s="default",...r}){return(0,i.jsx)(c.D,{"data-slot":"context-menu-item","data-inset":t,"data-variant":s,className:(0,u.cn)(h.S6,h.dQ,"group/context-menu-item",e),...r})}function v({className:e,...t}){return(0,i.jsx)(d.w,{"data-slot":"context-menu-separator",className:(0,u.cn)("-mx-1 my-1 h-px bg-border",e),...t})}},5464:(e,t,s)=>{"use strict";s.d(t,{Hl:()=>k,YM:()=>S,YV:()=>b,_Y:()=>N,hA:()=>j,uX:()=>R,vu:()=>C});var i=s(7962);s(69266);var r=s(76815),a=s(21702),n=s(60530),o=s(86023),l=s(57284),c=s(72512),d=s(49264),u=s(82611),h=s(40709),p=s(93061),m=s(87425),f=s(51173),g=s(49362),x=s(78121),v=s(49426);function b({onOpenChange:e,...t}){return(0,i.jsx)(r.D,{"data-slot":"app-dialog",...t,onOpenChange:(s,i)=>{s||!1===t.modal||"outside-press"!==i.reason||i.event.target instanceof Element&&"app-dialog-backdrop"===i.event.target.getAttribute("data-slot")?e?.(s,i):i.cancel()}})}function y({...e}){return(0,i.jsx)(a.Z,{"data-slot":"app-dialog-portal",...e})}function w({className:e,...t}){return(0,i.jsx)(n.X,{"data-slot":"app-dialog-backdrop",className:(0,v.cn)("fixed inset-0 z-[100] bg-black/35 duration-100 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...t})}function j({className:e,children:t,showCloseButton:s=!0,finalFocus:r=!1,backdropClassName:a,...n}){let{t:c}=(0,x.Bd)("common");return(0,i.jsxs)(y,{children:[(0,i.jsx)(w,{className:a,forceRender:!!a}),(0,i.jsxs)(o.h,{"data-slot":"app-dialog-content",finalFocus:r,className:(0,v.cn)("fixed top-1/2 left-1/2 z-[110] flex max-h-[calc(100dvh-2rem)] w-[calc(100%-2rem)] max-w-[27.5rem] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-border bg-popover text-sm text-popover-foreground shadow-lg outline-none duration-100 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...n,children:[t,s?(0,i.jsxs)(l.H,{"data-slot":"app-dialog-close-button","aria-label":c("closeDialog"),title:c("closeDialog"),className:"absolute top-2 right-2 flex size-8 cursor-pointer items-center justify-center rounded-lg text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground active:bg-foreground/14 focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",children:[(0,i.jsx)(g.A,{className:"size-4"}),(0,i.jsx)("span",{className:"sr-only",children:c("closeDialog")})]}):null]})]})}function k({className:e,...t}){return(0,i.jsx)("div",{"data-slot":"app-dialog-header",className:(0,v.cn)("flex shrink-0 flex-col gap-1.5",e),...t})}function N({className:e,children:t,...s}){return(0,i.jsxs)(u.V,{"data-slot":"app-dialog-body",className:(0,v.cn)("relative min-h-0 flex-1 overflow-hidden",e),...s,children:[(0,i.jsx)(h.B,{"data-slot":"app-dialog-body-viewport",className:"h-full max-h-[inherit] w-full overscroll-contain rounded-[inherit] outline-none focus-visible:ring-2 focus-visible:ring-ring",children:t}),(0,i.jsx)(p.V,{"data-slot":"app-dialog-body-scrollbar",orientation:"vertical",className:"flex h-full w-2.5 touch-none border-l border-l-transparent p-px select-none",children:(0,i.jsx)(m.l,{"data-slot":"app-dialog-body-thumb",className:"relative flex-1 rounded-full bg-muted-foreground/45 hover:bg-muted-foreground/70"})}),(0,i.jsx)(f.I,{})]})}function C({className:e,...t}){return(0,i.jsx)("div",{"data-slot":"app-dialog-footer",className:(0,v.cn)("flex shrink-0 flex-wrap justify-end gap-2 border-t bg-popover px-4 py-3",e),...t})}function S({className:e,...t}){return(0,i.jsx)(c.L,{"data-slot":"app-dialog-title",className:(0,v.cn)("text-lg leading-[1.4] font-semibold",e),...t})}function R({className:e,...t}){return(0,i.jsx)(d.r,{"data-slot":"app-dialog-description",className:(0,v.cn)("text-sm leading-5 text-muted-foreground",e),...t})}},7237:(e,t,s)=>{"use strict";function i(e){let t=atob(e.data),s=new Uint8Array(t.length);for(let e=0;e<t.length;e+=1)s[e]=t.charCodeAt(e);return new Blob([s],{type:e.mimeType})}s.d(t,{E:()=>i})},8001:(e,t,s)=>{"use strict";s.d(t,{IV:()=>m,om:()=>b,e6:()=>w,XC:()=>v});var i=s(7962),r=s(10672),a=s(69075),n=s(45216),o=s(94173),l=s(14510),c=s(3058),d=s(90458),u=s(78121),h=s(10508),p=s(49426);let m={input:["dataPiMarkdownProgress"],blockquote:["dataPiMarkdownAlert"]};function f(e){return{type:"paragraph",children:[],data:{hName:"input",hProperties:{type:"checkbox",disabled:!0,checked:"[x]"===e.toLowerCase(),..."[-]"===e?{dataPiMarkdownProgress:"true"}:{}}}}}var g=s(83029),x=s.n(g);let v=[...Object.values(h.U2),function(){return(e,t)=>{let s=String(t.value),i=(e,t)=>{let i=e.position?.start.offset;return void 0!==i&&s.slice(i,i+t.length)===t},r=e=>{let t=e.children?.[0];if("tableCell"===e.type&&e.children?.length===1&&t?.type==="text"){let s=t.value??"";/^\[[ xX-]\]$/.test(s)&&i(t,s)&&(e.children=[f(s)])}else if("listItem"===e.type&&t?.type==="paragraph"){let s=t.children?.[0];s?.type==="text"&&/^\[-\](?:\s|$)/.test(s.value??"")&&i(s,"[-]")&&(s.value=s.value.slice(3),t.children.unshift(f("[-]")),e.data={...e.data,hProperties:{className:["task-list-item"]}})}else if("blockquote"===e.type&&t?.type==="paragraph"){let s=t.children?.[0],r=s?.value?.match(/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\][ \t]*(?:\r?\n|$)/);s?.type==="text"&&r&&i(s,`[!${r[1]}]`)&&(r[0].endsWith("\n")||1===t.children.length||t.children[1]?.type==="break")&&(s.value=s.value.slice(r[0].length),s.value||(t.children.shift(),t.children[0]?.type==="break"&&t.children.shift()),0===t.children.length&&e.children.shift(),e.data={...e.data,hProperties:{dataPiMarkdownAlert:r[1].toLowerCase()}})}for(let t of e.children??[])r(t)};r(e)}}],b=x().markdown,y={note:{icon:r.A,label:"markdownNote"},tip:{icon:a.A,label:"markdownTip"},important:{icon:n.A,label:"markdownImportant"},warning:{icon:o.A,label:"markdownWarning"},caution:{icon:l.A,label:"markdownCaution"}},w={input:function({"data-pi-markdown-progress":e,...t}){let{t:s}=(0,u.Bd)("common");if(delete t.node,"checkbox"!==t.type)return(0,i.jsx)("input",{...t});let r=e?"progress":t.checked?"completed":"pending",a=e?"[-]":t.checked?"[x]":"[ ]",n=s(e?"markdownProgress":t.checked?"markdownCompleted":"markdownPending");return(0,i.jsxs)("span",{className:x().status,"data-state":r,role:"img","aria-label":n,title:n,children:[e?(0,i.jsx)(c.A,{"aria-hidden":"true"}):t.checked?(0,i.jsx)(d.A,{"aria-hidden":"true"}):null,(0,i.jsx)("span",{className:"sr-only","aria-hidden":"true",children:a})]})},blockquote:function({"data-pi-markdown-alert":e,className:t,children:s,...r}){let{t:a}=(0,u.Bd)("common");delete r.node;let n=Object.entries(y).find(([t])=>t===e)?.[1];if(!n)return(0,i.jsx)("blockquote",{...r,"data-streamdown":"blockquote",className:(0,p.cn)("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),children:s});let o=n.icon;return(0,i.jsxs)("aside",{className:x().alert,role:"note","aria-label":a(n.label),children:[(0,i.jsxs)("div",{className:x().alertTitle,children:[(0,i.jsx)(o,{"aria-hidden":"true"}),a(n.label)]}),(0,i.jsx)("div",{className:x().alertBody,children:s})]})}}},8596:e=>{e.exports={tree:"l3-project-file-browser_tree__KA1C9"}},9736:(e,t,s)=>{"use strict";s.d(t,{F:()=>U});var i=s(7962),r=s(14044),a=s(36670),n=s(65770),o=s(66584),l=s(31761),c=s(90213),d=s(41148),u=s(69266),h=s(78121),p=s(15265),m=s(5816),f=s(49426),g=s(81649),x=s(95526);let v=(0,u.createContext)({expandedPaths:new Set,togglePath:()=>{}}),b=({expanded:e,defaultExpanded:t=new Set,selectedPath:s,onSelect:r,onExpandedChange:a,className:n,children:o,...l})=>{let[c,d]=(0,u.useState)(t),h=e??c,p=(0,u.useCallback)(e=>{let t=new Set(h);t.has(e)?t.delete(e):t.add(e),d(t),a?.(t)},[h,a]),m=(0,u.useMemo)(()=>({expandedPaths:h,onSelect:r,selectedPath:s,togglePath:p}),[h,r,s,p]);return(0,i.jsx)(v.Provider,{value:m,children:(0,i.jsx)("div",{className:(0,f.cn)("rounded-lg border bg-background font-sans text-sm",n),role:"tree",...l,children:(0,i.jsx)("div",{className:"p-2",children:o})})})},y=({className:e,children:t,...s})=>(0,i.jsx)("span",{className:(0,f.cn)("shrink-0",e),...s,children:t}),w=({className:e,children:t,...s})=>(0,i.jsx)("span",{className:(0,f.cn)("truncate",e),...s,children:t}),j=(0,u.createContext)({name:"",path:""}),k=({path:e,name:t,icon:s,className:r,children:a,...n})=>{let{selectedPath:o,onSelect:l}=(0,u.useContext)(v),c=o===e,d=(0,u.useCallback)(()=>{l?.(e)},[l,e]),h=(0,u.useCallback)(t=>{("Enter"===t.key||" "===t.key)&&l?.(e)},[l,e]),p=(0,u.useMemo)(()=>({name:t,path:e}),[t,e]);return(0,i.jsx)(j.Provider,{value:p,children:(0,i.jsx)("div",{className:(0,f.cn)("flex min-h-9 cursor-pointer items-center gap-2 rounded-md px-2 py-1 outline-none transition-colors hover:bg-foreground/8 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",c&&"bg-accent",r),onClick:d,onKeyDown:h,role:"treeitem","aria-selected":c,tabIndex:0,...n,children:a??(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:"size-6 shrink-0"}),(0,i.jsx)(y,{children:s??(0,i.jsx)(x.A,{className:"size-4 text-muted-foreground"})}),(0,i.jsx)(w,{children:t})]})})})};var N=s(74675),C=s(69272),S=s(50479);function R({directory:e,expanded:t,onToggle:s,children:r,...n}){let l=e.label.split("/"),c=l.at(-1),d=l.slice(0,-1).join(" \\ "),u=l.join(" \\ "),h=t?S.A:o.A;return(0,i.jsx)(g.Nt,{open:t,onOpenChange:s,children:(0,i.jsxs)("div",{role:"treeitem","aria-expanded":t,"aria-selected":!1,title:e.targetPath,...n,children:[(0,i.jsx)("div",{className:"flex min-h-9 items-center rounded-sm px-2 py-1 transition-colors hover:bg-foreground/8",children:(0,i.jsxs)(g.R6,{className:"flex min-h-7 min-w-0 flex-1 cursor-pointer items-center gap-2 rounded-sm bg-transparent p-0 text-left text-sm outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring","aria-label":u,onKeyDown:e=>{("ArrowLeft"===e.key&&t||"ArrowRight"===e.key&&!t)&&(e.preventDefault(),e.stopPropagation(),s())},children:[(0,i.jsx)("span",{className:"flex size-6 shrink-0 items-center justify-center",children:(0,i.jsx)(a.A,{className:(0,f.cn)("size-4 text-muted-foreground transition-transform",t&&"rotate-90")})}),(0,i.jsx)(h,{className:"size-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),(0,i.jsxs)("span",{className:"flex min-w-0 items-baseline",children:[d?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:"min-w-0 shrink-[2] truncate text-muted-foreground",children:d}),(0,i.jsx)("span",{className:"shrink-0 px-1 text-muted-foreground","aria-hidden":"true",children:"\\"})]}):null,(0,i.jsx)("span",{className:"min-w-0 truncate",children:c})]})]})}),(0,i.jsx)(g.Ke,{children:(0,i.jsx)("div",{role:"group",className:"ml-4 border-l pl-2",children:r})})]})})}var z=s(86963),D=s(49362),A=s(17511),M=s(32892);let P=["all","files","content"],$=[{key:"caseSensitive",label:"searchCaseSensitive",text:"Aa"},{key:"wholeWord",label:"searchWholeWord",text:"Ab"},{key:"regex",label:"searchRegex",text:".*"}];function T({input:e,inputRef:t,invalid:s,onQueryChange:r,onOptionsChange:a,onComposingChange:n,onClose:o,onOpenFirst:l,onFocusResults:c}){let{t:p}=(0,h.Bd)("projectFiles"),[m,g]=(0,u.useState)(null),x=(0,u.useRef)(!1);(0,u.useEffect)(()=>()=>n(!1),[n]);let v=p("files"===e.scope?"searchFiles":"content"===e.scope?"searchContent":"searchAll");return(0,i.jsxs)("div",{className:"shrink-0 px-1 pt-1",children:[(0,i.jsxs)(A.MG,{className:"rounded-md",children:[(0,i.jsx)(A.Sq,{className:"pl-1.5 py-0",children:(0,i.jsx)(d.A,{className:"size-3.5"})}),(0,i.jsx)(A.iV,{ref:t,"data-testid":"project-file-search",className:"min-h-7 min-w-0 px-1.5 py-0.5 text-sm placeholder:text-xs",value:m??e.query,placeholder:v,"aria-label":v,"aria-invalid":s||void 0,autoComplete:"off",spellCheck:!1,onChange:e=>{x.current?g(e.target.value):r(e.target.value)},onCompositionStart:e=>{x.current=!0,g(e.currentTarget.value),n(!0)},onCompositionEnd:e=>{x.current=!1,g(null),r(e.currentTarget.value),n(!1)},onKeyDown:e=>{e.nativeEvent.isComposing||x.current||("Enter"===e.key?(e.preventDefault(),l()):"ArrowDown"===e.key&&(e.preventDefault(),c()))}}),(0,i.jsx)(A.Sq,{align:"inline-end",className:"pr-0.5 py-0 has-[>button]:mr-0",children:(0,i.jsxs)(M.m_,{children:[(0,i.jsx)(M.k$,{render:(0,i.jsx)(A.Ik,{size:"icon-xs",className:"min-h-7","aria-label":p("closeSearch"),onClick:o}),children:(0,i.jsx)(D.A,{className:"size-4"})}),(0,i.jsx)(M.ZI,{children:p("closeSearch")})]})})]}),(0,i.jsxs)("div",{className:"flex min-h-7 flex-wrap items-center justify-between gap-x-1",children:[(0,i.jsx)("div",{className:"flex min-w-0 items-center",role:"radiogroup","aria-label":p("searchScope"),children:P.map((t,s)=>(0,i.jsx)(z.$,{type:"button",role:"radio","aria-checked":e.scope===t,tabIndex:e.scope===t?0:-1,disabled:null!==m,variant:"ghost",size:"sm","data-testid":`project-search-scope-${t}`,className:(0,f.cn)("px-1 text-xs",e.scope===t&&"bg-accent text-accent-foreground"),onClick:()=>a({scope:t}),onKeyDown:e=>{let t="ArrowRight"===e.key||"ArrowDown"===e.key,i="ArrowLeft"===e.key||"ArrowUp"===e.key;if(!t&&!i&&"Home"!==e.key&&"End"!==e.key)return;e.preventDefault();let r="Home"===e.key?0:"End"===e.key?2:(s+(t?1:2))%3;a({scope:P[r]}),e.currentTarget.parentElement?.querySelectorAll('[role="radio"]')[r]?.focus()},children:p("all"===t?"searchScopeAll":"files"===t?"searchScopeFiles":"searchScopeContent")},t))}),(0,i.jsx)("div",{className:"ml-auto flex items-center",children:$.map(({key:t,label:s,text:r})=>(0,i.jsxs)(M.m_,{children:[(0,i.jsx)(M.k$,{render:(0,i.jsx)(z.$,{type:"button",variant:"ghost",size:"icon-sm",disabled:null!==m,"aria-label":p(s),"aria-pressed":e[t],"data-testid":`project-search-option-${t}`,className:(0,f.cn)("font-mono text-xs text-muted-foreground","wholeWord"===t&&"underline underline-offset-4"),onClick:()=>a({[t]:!e[t]})}),children:r}),(0,i.jsx)(M.ZI,{children:p(s)})]},t))})]})]})}function O(e,t,s=0){let r=[],a=0;for(let n of t){let t=Math.max(a,n.start-s,0),o=Math.min(n.end-s,e.length);o<=t||(r.push(e.slice(a,t)),r.push((0,i.jsx)("mark",{className:"rounded-sm bg-foreground/15 text-inherit",children:e.slice(t,o)},`${t}:${o}`)),a=o)}return r.push(e.slice(a)),r}function L({search:e,resultsRef:t,activePath:s,onOpen:n,wrapFile:o,renderFileIcon:l,fileDecoration:c}){let{t:p}=(0,h.Bd)("projectFiles"),m=(0,u.useId)(),[g,x]=(0,u.useState)(!1),[v,b]=(0,u.useState)(new Set),[y,w]=(0,u.useState)(null),j=new Map;for(let t of e.contentMatches){let e=j.get(t.path);e?e.push(t):j.set(t.path,[t])}let k=!!e.query.trim(),C=k&&"ready"===e.status,S=e.fileMatches.length,R=e.contentMatches.length,D="all"===e.scope&&S>3&&R>0&&!g,A=D?e.fileMatches.slice(0,3):e.fileMatches,M=p("searchCounts",{files:new Set([...e.fileMatches.map(e=>e.path),...j.keys()]).size,lines:R}),P=e=>{b(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})};return(0,i.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,i.jsxs)("div",{className:"flex min-h-6 flex-wrap items-center justify-between gap-x-2 px-2 text-xs text-muted-foreground",role:"status","aria-live":"polite",children:[(0,i.jsx)("span",{children:p("searchResults")}),C?(0,i.jsx)("span",{className:"tabular-nums",children:e.truncated?p("searchShownCounts",{counts:M}):M}):null]}),(0,i.jsx)(N.V,{className:"min-h-0 flex-1",viewportClassName:"pb-2",children:(0,i.jsx)("div",{ref:t,role:"region","aria-label":p("searchResults"),"aria-busy":k&&"loading"===e.status,onKeyDown:e=>{if("ArrowDown"!==e.key&&"ArrowUp"!==e.key&&"Home"!==e.key&&"End"!==e.key)return;let t=[...e.currentTarget.querySelectorAll("button")].filter(e=>!e.disabled&&!e.closest("[hidden]")),s=t.indexOf(document.activeElement);if(s<0)return;e.preventDefault();let i="Home"===e.key?0:"End"===e.key?t.length-1:Math.max(0,Math.min(t.length-1,s+("ArrowDown"===e.key?1:-1)));t[i]?.focus()},children:k?"loading"===e.status?(0,i.jsxs)("div",{className:"flex min-h-10 items-center gap-2 px-3 text-xs text-muted-foreground",children:[(0,i.jsx)(r.A,{className:"size-3.5 animate-spin"}),p("searching")]}):"error"===e.status?(0,i.jsx)("p",{role:"alert",className:"mx-3 my-2 break-words rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:e.error||p("searchFailed")}):C&&0===S&&0===R?(0,i.jsxs)("div",{className:"px-5 py-9 text-center text-sm text-muted-foreground",children:[(0,i.jsx)(d.A,{className:"mx-auto mb-3 size-6"}),(0,i.jsx)("p",{children:p(e.truncated?"resultLimit":"noMatches")}),(0,i.jsx)("p",{className:"mt-2 text-xs",children:p("searchTryOptions")})]}):C?(0,i.jsxs)(i.Fragment,{children:[S>0?(0,i.jsxs)("section",{children:["all"===e.scope?(0,i.jsxs)("h3",{className:"flex min-h-6 items-center gap-2 px-2 text-xs text-muted-foreground",children:[p("searchFileHeading"),(0,i.jsx)("span",{className:"tabular-nums",children:S})]}):null,A.map(({path:e,ranges:t})=>{let r=e.lastIndexOf("/"),a=c(e);return o(e,void 0,(0,i.jsxs)(z.$,{type:"button",variant:"ghost","data-testid":`project-search-result-${e}`,"data-search-result":"true",className:(0,f.cn)("mx-1 flex min-h-6 w-[calc(100%-0.5rem)] justify-start gap-1 px-1 py-0 text-left font-normal [@media(pointer:coarse)]:min-h-9",s===e&&"bg-accent"),title:e,onClick:()=>n(e),children:[(0,i.jsx)("span",{className:"shrink-0",children:l(e)}),(0,i.jsxs)("span",{className:"flex min-w-0 flex-1 items-baseline gap-1.5",children:[(0,i.jsx)("span",{className:(0,f.cn)("truncate text-sm",a.className),children:O(e.slice(r+1),t,r+1)}),r>=0?(0,i.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:O(e.slice(0,r),t)}):null]}),a.badge?(0,i.jsx)("span",{className:(0,f.cn)("text-xs",a.className),"aria-label":p("gitStatus",{status:a.badge}),children:a.badge}):null]},e))}),D?(0,i.jsx)(z.$,{type:"button",variant:"ghost",size:"sm",className:"ml-5 min-h-6 py-0 text-xs text-muted-foreground [@media(pointer:coarse)]:min-h-9",onClick:()=>x(!0),children:p("searchExpandFiles",{count:S-3})}):null]}):null,R>0?(0,i.jsxs)("section",{className:(0,f.cn)(S>0&&"mt-1"),children:["all"===e.scope?(0,i.jsxs)("h3",{className:"flex min-h-6 flex-wrap items-center gap-x-2 px-2 text-xs text-muted-foreground",children:[p("searchContentHeading"),(0,i.jsx)("span",{children:p("searchContentCounts",{lines:R,files:j.size})})]}):null,[...j].map(([e,t],s)=>{let r=e.lastIndexOf("/"),c=!v.has(e),d=`${m}-${s}`;return(0,i.jsxs)("section",{className:"mb-1",children:[(0,i.jsxs)(z.$,{type:"button",variant:"ghost",className:"min-h-6 w-full justify-start gap-1 rounded-none px-2 py-0 text-left font-normal [@media(pointer:coarse)]:min-h-9",title:e,"aria-expanded":c,"aria-controls":d,onClick:()=>P(e),onKeyDown:t=>{("ArrowLeft"===t.key&&c||"ArrowRight"===t.key&&!c)&&(t.preventDefault(),P(e))},children:[(0,i.jsx)(a.A,{className:(0,f.cn)("size-3 shrink-0 text-muted-foreground transition-transform motion-reduce:transition-none",c&&"rotate-90")}),(0,i.jsx)("span",{className:"shrink-0",children:l(e)}),(0,i.jsxs)("span",{className:"min-w-0 truncate text-sm",children:[e.slice(r+1),(0,i.jsx)("span",{className:"ml-1.5 text-xs text-muted-foreground",children:e.slice(0,Math.max(0,r))})]}),(0,i.jsx)("span",{className:"ml-auto shrink-0 rounded bg-muted px-1 text-xs text-muted-foreground tabular-nums",children:t.length})]}),(0,i.jsx)("div",{id:d,hidden:!c,children:t.map(({line:t,text:s,ranges:r})=>o(e,t,(0,i.jsxs)(z.$,{type:"button",variant:"ghost","data-testid":`project-search-line-${e}-${t}`,"data-search-result":"true",className:(0,f.cn)("min-h-6 w-full justify-start gap-1 rounded-none border-l-2 border-transparent py-0 pr-2 pl-5 text-left font-mono font-normal [@media(pointer:coarse)]:min-h-9",y?.path===e&&y.line===t&&"border-l-foreground/50 bg-accent"),title:s,"aria-label":p("searchOpenLine",{path:e,line:t}),onClick:()=>{w({path:e,line:t}),n(e,t)},children:[(0,i.jsx)("span",{className:"min-w-5 shrink-0 text-right text-xs text-muted-foreground tabular-nums",children:t}),(0,i.jsx)("span",{className:"min-w-0 truncate whitespace-pre text-sm",children:O(s,r)})]},`${e}:${t}`)))})]},e)})]}):null,e.truncated?(0,i.jsx)("p",{className:"px-3 py-2 text-xs leading-5 text-muted-foreground",children:p("resultLimit")}):null]}):null:(0,i.jsxs)("div",{className:"px-5 py-9 text-center text-sm text-muted-foreground",children:[(0,i.jsx)(d.A,{className:"mx-auto mb-3 size-6"}),(0,i.jsx)("p",{children:p("searchStart")}),(0,i.jsx)("p",{className:"mt-2 text-xs",children:p("files"===e.scope?"searchFiles":"content"===e.scope?"searchContent":"searchAll")})]})})}),"files"!==e.scope?(0,i.jsx)("p",{className:"shrink-0 px-2 py-1 text-xs leading-5 text-muted-foreground",children:p("searchTextLimit")}):null]})}var E=s(35989),I=s(60682),q=s(14512),F=s(8596),_=s.n(F),W=s(82075);let B=[],H=new WeakMap;function Y(e){return(0,i.jsx)(C.s,{path:e,className:"size-4 text-muted-foreground"})}function V(e){if(e)return(0,E.iH)(e.change)}function K({state:e,onRetry:t}){let{t:s}=(0,h.Bd)("projectFiles");return e&&"idle"!==e.status&&"loading"!==e.status?"error"!==e.status?null:(0,i.jsx)("button",{type:"button",onClick:t,className:"min-h-8 w-full rounded px-2 text-left text-xs text-destructive hover:bg-destructive/10",children:s("retryReading",{error:e.error})}):(0,i.jsxs)("div",{className:"flex min-h-8 items-center gap-2 px-2 text-xs text-muted-foreground",children:[(0,i.jsx)(r.A,{className:"size-3.5 animate-spin"})," ",s("reading")]})}function U({cwd:e,projectName:t,runtime:s,gitRuntime:r,onOpenGitBranches:g,onFileOpened:x,rootTitle:v,showRootTitle:j=!0,gitReadOnly:C=!1}){let S,D,A,{t:M}=(0,h.Bd)("projectFiles"),{locale:P}=(0,m.i)();(0,u.useSyncExternalStore)(s.subscribe,s.getRevision,s.getRevision),(0,u.useSyncExternalStore)(r.subscribe,r.getRevision,r.getRevision);let $=s.state,O=r.getWorkspace(e),F=(0,u.useRef)(null),J=(0,u.useRef)(null),G=(0,u.useRef)(null),Q=(0,u.useRef)(null),X=(0,u.useRef)(null),[Z,ee]=(0,u.useState)(!1),et=(0,u.useRef)({}),es=(0,u.useCallback)(e=>{e?H.set(s,et.current):H.get(s)===et.current&&H.delete(s),ee(e)},[s]),ei=$.searchOpen,er=()=>{ee(!1),s.setSearchOpen(!1),requestAnimationFrame(()=>X.current?.focus())},[ea,en]=(0,u.useState)({}),eo=(e,t)=>{let s=ea[e]??300;return s<t?(0,i.jsx)("button",{type:"button",className:"min-h-8 px-3 text-sm text-muted-foreground hover:bg-accent",onClick:t=>{t.stopPropagation(),en(t=>({...t,[e]:s+300}))},children:M("showMore",{visible:s,total:t})}):null},el=$?.search.query??"",ec=O?.snapshot.repositories??B,ed=(0,E.eP)(ec),eu=new Map(ed.map(e=>[e.projectPath,e])),eh=ec.map(e=>e.root).filter(Boolean),ep=(0,u.useCallback)(()=>{r.refreshSnapshot(e);let t=r.getWorkspace(e);if(s.state.searchOpen||t?.changesOnly)return;let i=t?.layout==="repository"&&(1!==t.snapshot.repositories.length||t.snapshot.repositories[0]?.root!=="")?[...t.expandedRepositories].sort((e,t)=>t.length-e.length):[""],a=s.state.expandedPaths,n=new Set(i);for(let e of a){let t=i.find(t=>!t||e.startsWith(`${t}/`));if(void 0===t)continue;let s=e.slice(t?t.length+1:0).split("/");s.slice(0,-1).every((e,i)=>a.has((0,W._J)(t,s.slice(0,i+1).join("/"))))&&n.add(e)}s.refreshDirectories(n)},[e,r,s]);(0,q.L)(F,ep),(0,u.useEffect)(()=>{let e=J.current;e&&!ei&&(e.scrollTop=$.treeScrollTop)},[ei,$]),(0,u.useEffect)(()=>{if(!ei||!el.trim()||Z)return;let e=window.setTimeout(()=>{H.has(s)||s.search(el)},220);return()=>window.clearTimeout(e)},[Z,s,ei,el]);let em=[...O?.expandedRepositories??[]].join("\0");(0,u.useEffect)(()=>{if(O&&"repository"===O.layout)for(let e of O.expandedRepositories)s.ensureDirectory(e)},[em,O,s]);let ef=new Set(eh),eg=(e,t)=>{let i=new Set($.expandedPaths);for(let s of e.paths)t?i.add(s):i.delete(s);s.setExpandedPaths(i,!1),t&&!O?.changesOnly&&Promise.all(e.paths.map(e=>s.ensureDirectory(e,!0))).then(()=>s.expandDirectoryChain(e.path,ef))},ex=(e,t)=>{s.openFile(e,t),x?.()},ev=e=>{s.openDiff(e.repositoryRoot,e.path),x?.()},eb=(t,r)=>(0,i.jsx)(I.J,{cwd:e,path:t.targetPath,type:"directory",trigger:r,expanded:$.expandedPaths.has(t.path),onToggle:()=>eg(t,!$.expandedPaths.has(t.path)),onReveal:s.canReveal?(e,t)=>s.revealFile(e,t):void 0},(0,W.Im)("directory",t.path)),ey=(t,r,a=null,n=!1,o)=>(0,i.jsx)(I.J,{cwd:e,path:t,type:"file",trigger:r,openLabel:M(n?"viewDiff":"openPreview"),onOpen:()=>n&&a?ev(a):ex(t,o),oldPath:a?.change.oldPath?(0,W._J)(a.repositoryRoot,a.change.oldPath):void 0,onReveal:s.canReveal?(e,t)=>s.revealFile(e,t):void 0},void 0===o?(0,W.Im)("file",t):`${t}:${o}`),ew=(e,t,s,r)=>ey(e,(0,i.jsxs)(k,{path:(0,W.Im)("file",e),name:t,title:e,"data-testid":`project-file-${e}`,onClick:()=>{r&&s?ev(s):ex(e)},children:[(0,i.jsx)("span",{className:"size-6 shrink-0"}),(0,i.jsx)(y,{children:Y(e)}),(0,i.jsx)(w,{"data-testid":`project-file-name-${e}`,className:(0,f.cn)("min-w-0 flex-1",V(s)),children:t}),s?(0,i.jsx)("span",{className:(0,f.cn)("text-xs tabular-nums",V(s)),"aria-label":M("gitStatus",{status:(0,E.XB)(s.change)}),children:(0,E.XB)(s.change)}):null]}),s,r),ej=(e,t,r)=>{let a=$?.directories.get(e);if(a?.status!=="ready")return(0,i.jsx)(K,{state:a,onRetry:()=>void s.ensureDirectory(e)});let n=r?a.entries.filter(s=>{let i;return i=(0,W._J)(e,s.name),!eh.some(e=>e!==t&&i===e)}):a.entries;return(0,i.jsxs)(i.Fragment,{children:[n.slice(0,ea[`directory:${e}`]??300).map(a=>{let n=(0,W._J)(e,a.name);if("file"===a.type)return ew(n,a.name,eu.get(n)??null,!1);let o=s.compactDirectory(n,ef);return eb(o,(0,i.jsx)(R,{directory:o,expanded:$.expandedPaths.has(n),onToggle:()=>eg(o,!$.expandedPaths.has(n)),"data-testid":`project-folder-${n}`,children:ej(o.targetPath,t,r)}))}),eo(`directory:${e}`,n.length),a.truncated?(0,i.jsx)("p",{className:"px-2 py-2 text-xs leading-5 text-amber-600 dark:text-amber-400",children:M("directoryLimit")}):null,0===n.length?(0,i.jsx)("p",{className:"px-2 py-2 text-xs text-muted-foreground",children:M("emptyDirectory")}):null]})},ek=(e,t)=>{let s=e.get(t);if(!s)return null;let r=[...s.directories.keys()].sort(W.Kn),a=[...s.files].sort(W.Kn),n=ea[`changes:${t}`]??300;return(0,i.jsxs)(i.Fragment,{children:[r.slice(0,n).map(t=>{let s=(0,W.xV)(t,e,ef);return eb(s,(0,i.jsx)(R,{directory:s,expanded:$.expandedPaths.has(t),onToggle:()=>eg(s,!$.expandedPaths.has(t)),"data-testid":`project-folder-${t}`,children:ek(e,s.targetPath)}))}),a.slice(0,Math.max(0,n-r.length)).map(e=>ew(e,e.slice(e.lastIndexOf("/")+1),eu.get(e)??null,!0)),eo(`changes:${t}`,r.length+a.length)]})},eN=e=>{let t=e.slice(5),s=eu.get(t);O?.changesOnly&&s?ev(s):ex(t)},eC=(c,d,u)=>{if(O?.changesOnly&&!c)return null;let h=O?.expandedRepositories.has(d)??!1,m=c?.state==="ready"?ed.filter(e=>e.repositoryRoot===d):[],x=m.length;if(O?.changesOnly&&c?.state==="ready"&&0===x)return null;let v=(0,W.OA)(m.map(e=>e.projectPath),d);return(0,i.jsxs)("section",{"data-testid":`project-git-repository-${d||"root"}`,className:"border-b last:border-b-0",children:[(0,i.jsxs)("div",{className:"flex min-h-8 items-center gap-1 px-1 py-0.5",children:[(0,i.jsxs)("button",{"data-testid":`project-git-repository-toggle-${d||"root"}`,type:"button",className:"flex min-w-0 flex-1 items-center gap-1 rounded-md px-1 py-0.5 text-left hover:bg-muted/60","aria-expanded":h,onClick:()=>{h&&s.cancelDirectoryExpansion(d),r.toggleRepository(e,d),h||s.ensureDirectory(d,!0)},children:[(0,i.jsx)(a.A,{className:(0,f.cn)("size-3 shrink-0 text-muted-foreground transition-transform",h&&"rotate-90")}),c?(0,i.jsx)(n.A,{className:"size-4 shrink-0 text-muted-foreground"}):(0,i.jsx)(o.A,{className:"size-4 shrink-0 text-muted-foreground"}),(0,i.jsx)("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",title:c&&d||t,children:u})]}),c?(0,i.jsxs)("button",{"data-testid":`project-git-branch-${d||"root"}`,type:"button",disabled:C||"ready"!==c.state,className:(0,f.cn)((0,z.r)({variant:"ghost",size:"sm"}),"max-w-28 shrink gap-1 font-mono text-xs text-muted-foreground"),title:"ready"===c.state?M(C?"gitBranchReadOnly":"gitBranches"):(0,p.fD)(c.message,P),"aria-label":M(C?"gitBranchReadOnly":"gitBranches"),onClick:()=>g(d),children:[(0,i.jsx)(l.A,{className:"size-3 shrink-0"}),(0,i.jsx)("span",{className:"min-w-0 truncate",children:"ready"===c.state?(0,E.ws)(c.head):M("unavailable")}),x>0?(0,i.jsx)("span",{className:"rounded-md bg-muted px-1 text-xs text-status-warning",children:x}):null]}):null]}),h?O?.changesOnly?(0,i.jsx)(b,{className:"rounded-none border-0 bg-transparent px-1 pb-1",selectedPath:$?.activeDiff?(0,W.Im)("file",(0,E.oW)($.activeDiff.repositoryRoot,$.activeDiff.path)):void 0,onSelect:eN,children:x>0?ek(v,d):(0,i.jsx)("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:M("noChanges")})}):(0,i.jsx)(b,{className:"rounded-none border-0 bg-transparent px-1 pb-1",selectedPath:$.activePath?(0,W.Im)("file",$.activePath):void 0,onSelect:eN,children:ej(d,c?.root??null,!0)}):null]},c?`git:${d}`:"workspace")},eS=1===ec.length&&ec[0]?.root===""?ec[0]:null,eR=ec.length>0&&!eS,ez=eR?O?.layout??"directory":"directory",eD=eS?(0,i.jsxs)("button",{type:"button",disabled:C||"ready"!==eS.state,className:(0,f.cn)((0,z.r)({variant:"ghost",size:"sm"}),"max-w-32 shrink gap-1 font-mono text-xs text-muted-foreground",!j&&"min-w-0 flex-1 justify-start"),"aria-label":M(C?"gitBranchReadOnly":"gitBranches"),title:"ready"===eS.state?`${M(C?"gitBranchReadOnly":"gitBranches")} \xb7 ${(0,E.ws)(eS.head)}`:(0,p.fD)(eS.message,P),onClick:()=>g(""),children:[(0,i.jsx)(l.A,{className:"size-3 shrink-0"}),(0,i.jsx)("span",{className:"truncate",children:"ready"===eS.state?(0,E.ws)(eS.head):M("unavailable")})]}):null,eA=(0,i.jsxs)("div",{className:"flex min-h-8 min-w-0 flex-wrap items-center gap-x-1 gap-y-0.5 outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",tabIndex:j?void 0:0,"aria-label":M("projectFiles",{name:t}),children:[eR?(0,i.jsx)("div",{className:"flex shrink-0 gap-0.5",role:"group","aria-label":M("layout"),children:["directory","repository"].map(t=>(0,i.jsx)("button",{"data-testid":`project-file-layout-${t}`,type:"button","aria-pressed":ez===t,className:(0,f.cn)((0,z.r)({variant:"ghost",size:"sm"}),ez===t&&"bg-accent text-accent-foreground"),onClick:()=>{s.cancelDirectoryExpansion(),r.setLayout(e,t)},children:M("directory"===t?"directory":"repository")},t))}):null,ec.length>0?(0,i.jsxs)("button",{"data-testid":"project-git-changes-toggle",type:"button","aria-pressed":O?.changesOnly??!1,className:(0,f.cn)((0,z.r)({variant:"ghost",size:"sm"}),"min-w-0 gap-1",O?.changesOnly&&"bg-accent text-accent-foreground"),onClick:()=>{s.cancelDirectoryExpansion(),r.setChangesOnly(e,!O?.changesOnly)},children:[(0,i.jsx)(c.A,{className:"size-3 shrink-0"}),(0,i.jsx)("span",{className:"truncate",children:M("changesOnly")}),(0,i.jsx)("span",{className:"rounded-md bg-muted px-1 font-mono text-xs",children:ed.length})]}):null,j?null:eD,(0,i.jsx)("button",{ref:X,type:"button",className:(0,f.cn)((0,z.r)({variant:"ghost",size:"icon-sm"}),"ml-auto"),"aria-label":M("searchProject"),title:M("searchProject"),onClick:()=>{s.setSearchOpen(!0),requestAnimationFrame(()=>G.current?.focus())},children:(0,i.jsx)(d.A,{className:"size-3.5"})})]});return(0,i.jsxs)("section",{ref:F,className:"flex h-full min-h-0 flex-col bg-sidebar","aria-label":M("projectFiles",{name:t}),onKeyDown:e=>{!ei||"Escape"!==e.key||(e.stopPropagation(),e.nativeEvent.isComposing||Z||(e.preventDefault(),er()))},children:[ei?(0,i.jsx)(T,{input:$.search,inputRef:G,invalid:"error"===$.search.status,onQueryChange:e=>s.setSearchQuery(e),onOptionsChange:e=>s.setSearchOptions(e),onComposingChange:es,onClose:er,onOpenFirst:()=>{let e=s.state.search;if("ready"!==e.status)return;let t=e.fileMatches[0],i=e.contentMatches[0];t?ex(t.path):i&&ex(i.path,i.line)},onFocusResults:()=>Q.current?.querySelector("button")?.focus()}):(0,i.jsxs)("div",{className:"border-b px-1",children:[j?(0,i.jsxs)("div",{className:"flex min-h-7 min-w-0 items-center gap-1",children:[(0,i.jsx)(I.J,{cwd:e,path:"",type:"directory",onReveal:s.canReveal?(e,t)=>s.revealFile(e,t):void 0,trigger:v?(0,i.jsx)("div",{className:"flex min-w-0 flex-1",children:v}):(0,i.jsxs)("div",{tabIndex:0,className:"flex min-w-0 flex-1 items-baseline gap-1",children:[(0,i.jsx)("p",{className:"shrink-0 truncate text-xs font-semibold",title:t,children:t}),(0,i.jsx)("span",{className:"text-xs text-muted-foreground",children:"\xb7"}),(0,i.jsx)("p",{className:"min-w-0 truncate font-mono text-xs text-muted-foreground",title:e,children:(S=e.replaceAll("\\","/").split("/").filter(Boolean)).length<=2?e:`…/${S.slice(-2).join("/")}`})]})}),eD]}):null,j?eA:(0,i.jsx)(I.J,{cwd:e,path:"",type:"directory",onReveal:s.canReveal?(e,t)=>s.revealFile(e,t):void 0,trigger:eA})]}),ei?(0,i.jsx)(L,{search:$.search,resultsRef:Q,activePath:$.activeDiff?null:$.activePath,onOpen:ex,wrapFile:(e,t,s)=>ey(e,s,eu.get(e)??null,!1,t),renderFileIcon:Y,fileDecoration:e=>{let t=eu.get(e)??null;return{className:V(t),badge:t?(0,E.XB)(t.change):void 0}}},JSON.stringify([$.search.query,$.search.scope,$.search.caseSensitive,$.search.wholeWord,$.search.regex])):(0,i.jsxs)(N.V,{className:(0,f.cn)(_().tree,"min-h-0 flex-1"),viewportClassName:"py-0.5",viewportRef:J,onViewportScroll:e=>s.setTreeScrollTop(e.currentTarget.scrollTop),children:[ec.filter(e=>"unavailable"===e.state).map(e=>"unavailable"===e.state?(0,i.jsxs)("p",{role:"alert",className:"mx-2 mb-1 break-words rounded-md bg-muted px-2 py-2 text-sm text-destructive",children:[e.root||t,":",(0,p.fD)(e.message,P)]},e.root):null),O?.snapshot.status==="error"?(0,i.jsx)("p",{className:"mx-2 mb-1 rounded-md bg-muted px-2 py-2 text-sm text-destructive",children:O.snapshot.error}):null,"repository"===ez?(D=ec.some(e=>""===e.root),A=O?.changesOnly?ec.filter(e=>"unavailable"===e.state||e.changes.length>0):ec,(0,i.jsxs)("div",{className:"px-1",children:[D?null:eC(null,"",t),A.map(e=>eC(e,e.root,(0,E.Hj)(t,e.root))),O?.changesOnly&&0===A.length?(0,i.jsx)("p",{className:"px-2 py-5 text-center text-xs text-muted-foreground",children:M("noChangedFiles")}):null]})):(()=>{if(O?.changesOnly){let e=(0,W.OA)(ed.map(e=>e.projectPath));return(0,i.jsx)(b,{className:"rounded-none border-0 bg-transparent",selectedPath:$?.activeDiff?(0,W.Im)("file",(0,E.oW)($.activeDiff.repositoryRoot,$.activeDiff.path)):$.activePath?(0,W.Im)("file",$.activePath):void 0,onSelect:eN,children:ed.length>0?ek(e,""):(0,i.jsx)("p",{className:"px-2 py-5 text-center text-xs text-muted-foreground",children:ec.some(e=>"unavailable"===e.state)?M("incompleteRepository"):M("noChangedFiles")})})}return(0,i.jsx)(b,{className:"rounded-none border-0 bg-transparent",selectedPath:$.activePath?(0,W.Im)("file",$.activePath):void 0,onSelect:eN,children:ej("",null,!1)})})()]})]})}},13464:(e,t,s)=>{"use strict";s.d(t,{S6:()=>i,dQ:()=>r,hD:()=>a});let i="relative flex min-h-7 cursor-pointer items-center gap-2 rounded-md px-2 py-1 text-sm leading-5 outline-none select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",r="data-[variant=destructive]:text-destructive data-[variant=destructive]:data-highlighted:bg-destructive/10 data-[variant=destructive]:data-highlighted:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive",a="z-50 max-h-(--available-height) min-w-60 max-w-[calc(100vw-2rem)] origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-md outline-none transition-[opacity,transform] duration-100 ease-out data-starting-style:scale-[0.98] data-starting-style:opacity-0 data-ending-style:scale-[0.98] data-ending-style:opacity-0 motion-reduce:transition-none"},14512:(e,t,s)=>{"use strict";s.d(t,{L:()=>r});var i=s(69266);function r(e,t,s=!0){(0,i.useEffect)(()=>{let i;if(!s)return;let r=()=>"visible"===document.visibilityState&&!!e.current?.getClientRects().length&&!e.current?.closest('[inert], [aria-hidden="true"]'),a=()=>{i=void 0,r()&&t()},n=()=>{void 0!==i&&clearTimeout(i),i=void 0,r()&&(i=setTimeout(a,150))};return a(),window.addEventListener("focus",n),document.addEventListener("visibilitychange",n),()=>{void 0!==i&&clearTimeout(i),window.removeEventListener("focus",n),document.removeEventListener("visibilitychange",n)}},[s,e,t])}},15265:(e,t,s)=>{"use strict";s.d(t,{fD:()=>a,qf:()=>r});var i=s(38979);let r=i.KC([i.Yj(),i.Ik({default:i.Yj(),translations:i.g1(i.Yj().min(1).max(35),i.Yj()).refine(e=>Object.keys(e).length<=16,"too many translations")}).strict()]);function a(e,t){return"string"==typeof e?e:e.translations[t]??e.translations[t.split("-")[0]]??e.default}},17511:(e,t,s)=>{"use strict";s.d(t,{Ik:()=>p,MG:()=>c,Sq:()=>u,iV:()=>m,oR:()=>f});var i=s(7962);s(69266);var r=s(73392),a=s(49426),n=s(86963),o=s(73429),l=s(68017);function c({className:e,...t}){return(0,i.jsx)("div",{"data-slot":"input-group",role:"group",className:(0,a.cn)("group/input-group relative flex min-h-8 w-full min-w-0 items-center rounded-lg border border-input bg-card transition-colors duration-150 outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-muted has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:outline-2 has-[[data-slot=input-group-control]:focus-visible]:outline-solid has-[[data-slot=input-group-control]:focus-visible]:-outline-offset-2 has-[[data-slot=input-group-control]:focus-visible]:outline-ring has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",e),...t})}let d=(0,r.F)("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]","block-start":"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function u({className:e,align:t="inline-start",...s}){return(0,i.jsx)("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:(0,a.cn)(d({align:t}),e),onClick:e=>{e.target.closest("button")||e.currentTarget.parentElement?.querySelector("input")?.focus()},...s})}let h=(0,r.F)("flex items-center gap-2 text-sm shadow-none",{variants:{size:{xs:"min-h-7 gap-2 rounded-md px-2",sm:"","icon-xs":"size-7 rounded-md p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function p({className:e,type:t="button",variant:s="ghost",size:r="xs",...o}){return(0,i.jsx)(n.$,{type:t,"data-size":r,variant:s,className:(0,a.cn)(h({size:r}),e),...o})}function m({className:e,...t}){return(0,i.jsx)(o.p,{"data-slot":"input-group-control",className:(0,a.cn)("flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:outline-none focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0",e),...t})}function f({className:e,...t}){return(0,i.jsx)(l.T,{"data-slot":"input-group-control",className:(0,a.cn)("flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:outline-none focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0",e),...t})}},18302:(e,t,s)=>{"use strict";function i(e,t,s){e.addCommand(t,s,"editorTextFocus && !findWidgetVisible && !suggestWidgetVisible && !renameInputVisible && !parameterHintsVisible && !referenceSearchVisible && !editorHoverVisible && !editorHoverFocused")}s.d(t,{e:()=>i})},20476:(e,t,s)=>{"use strict";s.d(t,{Wq:()=>d,ku:()=>h,lU:()=>u});var i=s(67765);let r="pi-super:image-preview-mode",a="compressed",n=new Set,o=a,l=!1;function c(){if(!l){l=!0;try{let e=i.p$.safeParse(window.localStorage.getItem(r));o=e.success?e.data:a}catch{o=a}}}function d(){return c(),o}function u(e){if(c(),o!==e){o=e;try{window.localStorage.setItem(r,e)}catch{}for(let e of[...n])e()}}function h(e){return n.add(e),()=>n.delete(e)}},24985:(e,t,s)=>{"use strict";s.d(t,{FJ:()=>b,Ww:()=>o,cP:()=>l,gf:()=>x,u2:()=>f,y2:()=>n,yl:()=>m,zp:()=>h,zt:()=>g});var i=s(38979),r=s(15265),a=s(67765);let n=100,o=a.rh,l=i.Yj().trim().min(1).max(1024),c=i.gM("type",[i.Ik({type:i.eu("branch"),name:l}).strict(),i.Ik({type:i.eu("detached"),commit:i.Yj().regex(/^[0-9a-f]{40,64}$/)}).strict()]),d=i.k5(["added","modified","deleted","renamed","unmerged","untracked"]),u=i.Ik({path:a._g,oldPath:a._g.nullable(),indexStatus:d.nullable(),worktreeStatus:d.nullable()}).strict(),h=i.Ik({root:o,state:i.eu("ready"),head:c,changes:i.YO(u).max(5e4)}).strict(),p=i.Ik({root:o,state:i.eu("unavailable"),message:r.qf.refine(e=>("string"==typeof e?[e]:[e.default,...Object.values(e.translations)]).every(e=>e.length>0&&e.length<=2e3))}).strict(),m=i.gM("state",[h.omit({changes:!0}),p]),f=i.gM("state",[h,p]),g=i.gM("type",[i.Ik({type:i.eu("local"),name:l}).strict(),i.Ik({type:i.eu("remote"),name:l}).strict()]),x=i.Ik({head:c,recent:i.YO(l).max(5),local:i.YO(l).max(1e4),remote:i.YO(l).max(1e4)}).strict(),v=i.Ik({path:a._g,content:i.Yj()}).strict(),b=i.gM("kind",[i.Ik({kind:i.eu("text"),original:v,modified:v}).strict(),i.Ik({kind:i.eu("binary")}).strict(),i.Ik({kind:i.eu("too_large")}).strict()])},28460:(e,t,s)=>{"use strict";s.d(t,{Cp:()=>g,ph:()=>x,Tk:()=>f});var i=s(93119),r=s(93320),a=s(29029),n=s(56592);class o{constructor(e,t){this.cwd=e,this.reader=t,this.state={snapshot:{status:"idle",repositories:[],error:null},layout:"directory",changesOnly:!1,expandedRepositories:new Set},this.listeners=new Set,this.revision=0,this.request=null,this.disposed=!1,this.subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e)),this.getRevision=()=>this.revision}getWorkspace(e){return e===this.cwd?this.state:null}ensureSnapshot(e){return e!==this.cwd||"ready"===this.state.snapshot.status||this.request?Promise.resolve():this.load(!1)}refreshSnapshot(e){return e===this.cwd?this.load(!0):Promise.resolve()}setLayout(e,t){this.state.layout=t,this.publish()}setChangesOnly(e,t){this.state.changesOnly=t,this.publish()}toggleRepository(e,t){let s=new Set(this.state.expandedRepositories);s.has(t)?s.delete(t):s.add(t),this.state.expandedRepositories=s,this.publish()}dispose(){this.disposed=!0,this.request?.abort(),this.request=null,this.listeners.clear()}async load(e){if(this.disposed||this.request)return;let t=new AbortController;this.request=t,"ready"!==this.state.snapshot.status&&(this.state.snapshot={...this.state.snapshot,status:"loading",error:null},this.publish());try{let s=await this.reader.snapshot(t.signal,e);if(this.request!==t)return;this.state.snapshot={status:"ready",repositories:s.repositories,error:null}}catch(e){if(this.request!==t)return;this.state.snapshot={...this.state.snapshot,status:"error",error:e instanceof Error?e.message:"读取 Git 状态失败"}}this.request===t&&(this.request=null,this.publish())}publish(){if(!this.disposed)for(let e of(this.revision+=1,this.listeners))e()}}var l=s(20476),c=s(42643),d=s(73230),u=s(82075);function h(e,t){return(0,d.B)({msg:c.p["zh-CN"][e],i18n:{key:`projectHistory:${e}`,...t?{params:t}:{}}})}function p(){return{status:"idle",data:null,error:null}}class m{constructor(e,t){this.reader=e,this.files=t,this.state={repositoryRoot:null,mode:"history",tip:"HEAD",base:"",target:"HEAD",strategy:"merge-base",query:"",author:"",authorSuggestions:[],selectedCommit:null,selectedChangePath:null,branches:p(),log:p(),changes:p()},this.scroll={log:0,changes:0},this.listeners=new Set,this.requests=new Map,this.revision=0,this.disposed=!1,this.logPage=1,this.changesPage=1,this.range=null,this.selection=null,this.restoredCommit=null,this.restoredChangePath=null,this.restoredChangesScroll=null,this.queryTimer=null,this.collapsedDirectories=new Set,this.changeTree=(0,u.OA)([]),this.changeRows=[],this.changeRowHeight=36,this.subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e)),this.getRevision=()=>this.revision}getChangeRows(){return this.changeRows}restoreBrowsing(e,t=!0){Object.assign(this.state,{repositoryRoot:e.repositoryRoot,mode:e.mode,tip:e.tip,base:e.base,target:e.target,strategy:e.strategy,query:e.query,author:e.author}),this.scroll.log=e.logScroll,this.restoredChangesScroll=e.changesScroll,this.restoredCommit=e.selectedCommit,this.restoredChangePath=e.selectedChangePath,t&&null!==e.repositoryRoot&&(this.loadBranches(),this.reload())}selectChange(e){this.state.changes.data?.items.some(t=>t.path===e)&&(this.state.selectedChangePath=e,this.publish())}toggleChangeDirectory(e){let t=this.changeRows.find(t=>t.directory?.path===e);if(t?.directory){if(t.expanded)this.collapsedDirectories.add(e);else for(let e of t.directory.paths)this.collapsedDirectories.delete(e);this.rebuildChangeRows(),this.publish()}}setScroll(e,t){this.scroll[e]=t}setChangeRowHeight(e){this.changeRowHeight!==e&&(this.scroll.changes=this.scroll.changes/this.changeRowHeight*e,this.changeRowHeight=e,this.publish())}setRepository(e){if(e===this.state.repositoryRoot){"idle"===this.state.branches.status&&(this.loadBranches(),this.reload());return}this.cancel("branches"),this.state.repositoryRoot=e,this.state.tip=this.state.target="HEAD",this.state.base="",this.state.author="",this.state.authorSuggestions=[],this.state.branches=p(),this.resetSelection(),this.loadBranches(),this.reload()}setMode(e){this.state.mode!==e&&(this.state.mode=e,this.resetSelection(),this.reload())}setRevision(e,t){this.state[e]!==t&&(this.state[e]=t,this.resetSelection(),this.reload())}setStrategy(e){this.state.strategy!==e&&(this.state.strategy=e,this.resetSelection(),this.reload())}setQuery(e){this.setLogFilter("query",e)}setAuthor(e){this.setLogFilter("author",e)}setLogFilter(e,t){this.state[e]=t,this.resetSelection(),this.queryTimer=setTimeout(()=>{this.queryTimer=null,this.reload()},220)}refresh(){this.resetSelection(),this.loadBranches(),this.reload()}async reload(){if(!this.disposed&&null!==this.state.repositoryRoot){if("compare"===this.state.mode)return this.state.base?void await this.loadChanges({base:this.state.base,target:this.state.target,strategy:this.state.strategy},1,!0):void this.publish();await this.loadLog(1)}}selectCommit(e,t){let s="string"==typeof e?e:e.oid;this.state.selectedCommit=s,this.scroll.changes=0,this.loadChanges({commit:s,...t?{parent:t}:{}},1)}showAggregate(){this.range&&(this.state.selectedCommit=null,this.loadChanges(this.range,1))}loadMoreLog(){("ready"===this.state.log.status||"error"===this.state.log.status)&&this.state.log.data?.hasMore&&!(this.state.log.data.items.length>=2e3)&&this.loadLog(this.logPage+1)}loadMoreChanges(){this.selection&&"ready"===this.state.changes.status&&this.state.changes.data?.hasMore&&this.loadChanges(this.selection,this.changesPage+1)}openChange(e){if(null===this.state.repositoryRoot)return;let t=this.state.changes.data,s=t?.items.find(t=>t.path===e);if(!t||!s)return;this.state.selectedChangePath=e,this.publish();let{original:i,target:r}=t.comparison,a=i?i.slice(0,8):h("emptyRevision"),n=h(this.state.selectedCommit||"merge-base"!==this.state.strategy?"historyDiffDirect":"historyDiffAncestor",{left:a,target:r.slice(0,8)});this.files.openDiff(this.state.repositoryRoot,e,{baseCommit:i,targetCommit:r,...s.oldPath?{oldPath:s.oldPath}:{}},n)}dispose(){for(let e of(this.disposed=!0,this.queryTimer&&clearTimeout(this.queryTimer),this.requests.values()))e.abort();this.requests.clear(),this.resetChangeTree(),this.listeners.clear()}async loadBranches(){let e=this.state.repositoryRoot;if(null===e||this.disposed)return;let t=this.begin("branches");this.state.branches={status:"loading",data:this.state.branches.data,error:null},this.publish();try{let s=await this.reader.branches(e,t.signal);if(!this.current("branches",t))return;this.state.branches={status:"ready",data:s,error:null}}catch(e){if(!this.current("branches",t))return;this.state.branches={status:"error",data:null,error:this.error(e)}}this.requests.delete("branches"),this.publish()}async loadLog(e){let t=this.state.repositoryRoot;if(this.disposed||null===t)return;let s=e>1?this.state.log.data:null,i=s?.tip??("compare"===this.state.mode?this.range?.target:this.state.tip),r=s?.exclude??("compare"===this.state.mode?this.range?.base:void 0);if(!i)return;let a=this.begin("log");this.state.log={status:"loading",data:s,error:null},this.publish();try{let n=await this.reader.log(t,{tip:i,...r?{exclude:r}:{},query:this.state.query,...this.state.author.trim()?{author:this.state.author.trim()}:{},page:{index:e,size:50}},a.signal);if(!this.current("log",a))return;for(let{author:t}of(this.logPage=e,n.items))t&&this.state.authorSuggestions.length<200&&!this.state.authorSuggestions.includes(t)&&this.state.authorSuggestions.push(t);if(this.state.log={status:"ready",data:{...n,items:[...s?.items??[],...n.items].slice(0,2e3)},error:null},1===e&&n.items[0]){let e=n.items.find(e=>e.oid===this.restoredCommit);this.restoredCommit=null,e?(this.state.selectedCommit=e.oid,this.loadChanges({commit:e.oid},1)):"history"===this.state.mode&&this.selectCommit(n.items[0])}}catch(e){if(!this.current("log",a))return;this.state.log={status:"error",data:s,error:this.error(e)}}this.requests.delete("log"),this.publish()}async loadChanges(e,t,s=!1){let i=this.state.repositoryRoot;if(this.disposed||null===i)return;let r=this.begin("changes"),a=t>1?this.state.changes.data:null;1===t&&this.resetChangeTree(),this.selection=e,this.state.changes={status:"loading",data:a,error:null},this.publish();try{let n=await this.reader.changes(i,{selection:e,page:{index:t,size:200}},r.signal);if(!this.current("changes",r))return;this.changesPage=t;let o=[...a?.items??[],...n.items];this.state.changes={status:"ready",data:{...n,items:o},error:null},this.changeTree=(0,u.OA)(o.map(e=>e.path)),null!==this.restoredChangesScroll&&(this.scroll.changes=this.restoredChangesScroll,this.restoredChangesScroll=null),this.rebuildChangeRows(),this.restoredChangePath&&o.some(e=>e.path===this.restoredChangePath)&&(this.state.selectedChangePath=this.restoredChangePath,this.restoredChangePath=null),this.selection="commit"in e?{commit:n.comparison.target,...n.commit?.selectedParent?{parent:n.commit.selectedParent}:{}}:{base:n.comparison.base,target:n.comparison.target,strategy:e.strategy},s&&"base"in this.selection&&(this.range=this.selection,this.loadLog(1))}catch(e){if(!this.current("changes",r))return;this.state.changes={status:"error",data:a,error:this.error(e)}}this.requests.delete("changes"),this.publish()}resetSelection(){this.restoredCommit=null,this.restoredChangePath=null,this.restoredChangesScroll=null,this.queryTimer&&clearTimeout(this.queryTimer),this.queryTimer=null,this.scroll.log=this.scroll.changes=0,this.cancel("log"),this.cancel("changes"),this.range=null,this.selection=null,this.state.selectedCommit=null,this.state.log=p(),this.state.changes=p(),this.resetChangeTree(),this.publish()}resetChangeTree(){this.collapsedDirectories.clear(),this.changeTree=(0,u.OA)([]),this.changeRows=[],this.state.selectedChangePath=null,this.scroll.changes=0}rebuildChangeRows(){let e=this.changeRowHeight,t=Math.floor(this.scroll.changes/e),s=this.changeRows[t],i=this.scroll.changes%e;this.changeRows=(0,u.qV)(this.changeTree,this.collapsedDirectories);let r=s?this.changeRows.findIndex(e=>e.key===s.key):-1;this.scroll.changes=r>=0?r*e+i:Math.min(this.scroll.changes,Math.max(0,(this.changeRows.length-1)*e))}begin(e){this.cancel(e);let t=new AbortController;return this.requests.set(e,t),t}cancel(e){this.requests.get(e)?.abort(),this.requests.delete(e)}current(e,t){return!this.disposed&&this.requests.get(e)===t}error(e){return e instanceof Error?e.message:h("historyReadFailed")}publish(){if(!this.disposed)for(let e of(this.revision+=1,this.listeners))e()}}function f(e,t){return(0,r.QL)(e,{path:"/api/pi/directories/list",request:a.FH,response:a.N$},{forceRefresh:!1},t)}function g(e,t,s){return(0,r.QL)(e,{path:"/api/pi/directory-entries/list",request:a.rB,response:a.rn},{cwd:t},s)}function x(e,t,s,a,c,d={}){let u=(0,r.Y4)(e,{cwd:t},d.onUnauthorized),h=new n.h(t,u,{imagePreviewMode:l.Wq,onNotice:s,reveal:(s,r="file")=>(0,i.P)(e,{cwd:t},s,r),maxTabs:20}),p=new o(t,u),f=new m(u,h),g=!1;return{files:h,git:p,history:f,restore(){if(!g&&(g=!0,p.setLayout(t,c.treeLayout),a)){for(let e of(p.setChangesOnly(t,a.changesOnly),a.expandedRepositories))p.toggleRepository(t,e);h.restoreBrowsing(a),f.restoreBrowsing(a.history,!d.lazyHistory)}},dispose(){f.dispose(),p.dispose(),h.dispose()}}}},29029:(e,t,s)=>{"use strict";s.d(t,{FH:()=>l,N$:()=>c,qY:()=>f,rB:()=>u,rn:()=>h});var i=s(38979),r=s(66453),a=s(70698),n=s(80077);let o=i.Ik({cwd:r.m4,sessionCount:i.ai().int().nonnegative(),updatedAt:a.k}).strict(),l=i.Ik({forceRefresh:i.zM().default(!1)}).strict(),c=i.Ik({directories:i.YO(o)}).strict();i.Ik({cwd:r.m4,ignored:i.zM()}).strict(),i.Ik({}).strict();let d=i.Ik({cwd:r.m4,name:i.Yj().trim().min(1)}).strict(),u=i.Ik({cwd:r.m4.nullable()}).strict(),h=i.Ik({cwd:r.m4.nullable(),parentCwd:r.m4.nullable(),directories:i.YO(d)}).strict(),p=n.Jk,m=i.Ik({sessionId:r.$E,cwd:r.m4,name:i.Yj().nullable(),createdAt:a.k,updatedAt:a.k,messageCount:i.ai().int().nonnegative(),userMessageCount:i.ai().int().nonnegative(),firstMessage:i.Yj().max(160),matches:i.YO(p).min(1).max(4).nullable()}).strict();n.Gm.extend({cwd:r.m4,forceRefresh:i.zM().default(!1)});let f=i.Ik({cwd:r.m4,sessions:i.YO(m)}).strict();i.Ik({cwd:r.m4,sessionId:r.$E,query:i.Yj().trim().max(120).default(""),page:i.Ik({index:i.ai().int().positive(),size:i.ai().int().positive().max(50)}).strict()}).strict();let g=i.Ik({entryId:r.Rv,timestampMs:a.k,text:i.Yj()}).strict();i.Ik({page:i.Ik({index:i.ai().int().positive(),size:i.ai().int().positive(),total:i.ai().int().nonnegative()}).strict(),messages:i.YO(g)}).strict()},35842:(e,t,s)=>{"use strict";s.d(t,{X:()=>x});var i=s(7962),r=s(49362),a=s(69266),n=s(78121),o=s(49426),l=s(86963),c=s(69272),d=s(1364),u=s(56592),h=s(73165),p=s(35989);let m=[{scope:"current",label:"closeTab"},{scope:"others",label:"closeOtherTabs"},{scope:"right",label:"closeRightTabs"},{scope:"left",label:"closeLeftTabs"},{scope:"all",label:"closeAllTabs"}];function f(e,t){let s=e.replaceAll("\\","/").split("/"),i=t.map(e=>e.replaceAll("\\","/")).filter(e=>e!==s.join("/"));for(let e=1;e<s.length;e++){let t=s.slice(-e).join("/");if(!i.some(s=>s.split("/").slice(-e).join("/")===t))return t}return s.join("/")}function g(e,t){let s=t.offsetLeft,i=s+t.offsetWidth;s<e.scrollLeft?e.scrollLeft=s:i>e.scrollLeft+e.clientWidth&&(e.scrollLeft=i-e.clientWidth)}function x({cwd:e,gitRuntime:t,paths:s,activePath:v,diffs:b,activeDiff:y,mobile:w,actions:j,onActivate:k,onClose:N}){let{t:C}=(0,n.Bd)("projectFiles");(0,a.useSyncExternalStore)(t.subscribe,t.getRevision,t.getRevision);let S=t.getWorkspace(e)?.snapshot,R=(0,a.useRef)(null),z=(0,a.useRef)(!1),D=[...s,...b.map(e=>[e.repositoryRoot,e.path].filter(Boolean).join("/"))],A=s.map(e=>({target:e,key:`file:${e}`,path:e,label:f(e,D),title:e,testId:`file-tab-${e}`}));for(let e of b){let t=[e.repositoryRoot,e.path].filter(Boolean).join("/"),s=e.comparison,i=s?`${s.baseCommit?.slice(0,7)??"∅"} → ${s.targetCommit.slice(0,7)}`:"",r=(0,u.Q)(e);A.push({target:e,key:`diff:${r}`,path:t,label:`${f(t,D)} \xb7 Diff`,revisions:i,title:[t,s?.oldPath,s?`${s.baseCommit??"∅"} → ${s.targetCommit}`:null].filter(Boolean).join("\n"),testId:`file-diff-tab-${t}${s?`-${r}`:""}`})}let M=y?`diff:${(0,u.Q)(y)}`:`file:${v}`;return((0,a.useLayoutEffect)(()=>{let e=R.current;if(!e)return;let t=()=>{let t=e.querySelector('[aria-selected="true"]')?.closest("[data-file-tab]");t&&g(e,t)};t();let s=new ResizeObserver(t);return s.observe(e),()=>s.disconnect()},[M,b,s]),0===A.length)?null:(0,i.jsxs)("div",{className:"flex min-w-0 max-w-full shrink-0 flex-col border-b bg-muted","data-testid":"file-tabs",children:[(0,i.jsx)("div",{className:"min-w-0 max-w-full",children:(0,i.jsx)("div",{ref:R,role:"tablist","aria-label":C("openFiles"),"aria-orientation":"horizontal",className:"relative flex min-w-0 flex-nowrap items-stretch overflow-x-auto overflow-y-hidden overscroll-x-contain [scrollbar-color:var(--border)_transparent] [scrollbar-width:thin]",children:A.map((t,s)=>{let a=t.key===M,n="string"!=typeof t.target,u=n||S?.status!=="ready"?void 0:(0,p.lN)(e,t.path,S.repositories)?.change,f=n?C("closeDiff",{name:`${t.path.split("/").at(-1)}${t.revisions?` \xb7 ${t.revisions}`:""}`}):C("closeFile",{name:t.path.split("/").at(-1)});return(0,i.jsxs)(d.tz,{onOpenChange:(e,t)=>{e&&"pointerType"in t.event&&"touch"===t.event.pointerType&&(z.current=!0)},children:[(0,i.jsxs)(d.Rc,{render:(0,i.jsx)("div",{"data-file-tab":!0,"data-testid":t.testId,title:t.title,className:(0,o.cn)("flex shrink-0 items-center border-r text-sm transition-colors",w?"h-9":"h-8",t.revisions?"max-w-[min(100%,20rem)]":"max-w-[min(100%,15rem)]",a?"bg-background text-foreground shadow-[inset_0_-2px_0_var(--foreground)]":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),onPointerDown:e=>{"touch"===e.pointerType&&(z.current=!1)}}),children:[(0,i.jsxs)("button",{type:"button",role:"tab","aria-selected":a,className:"flex h-full min-w-0 flex-1 cursor-pointer items-center gap-2 pl-3 pr-1 outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",onFocus:e=>{let t=e.currentTarget.closest("[data-file-tab]");R.current&&t&&g(R.current,t)},onClick:()=>{if(z.current){z.current=!1;return}k(t.target)},onKeyDown:e=>{if("F10"===e.key&&e.shiftKey){e.preventDefault(),e.stopPropagation();let t=e.currentTarget.closest('[data-slot="context-menu-trigger"]');if(t){let e=t.getBoundingClientRect();t.dispatchEvent(new MouseEvent("contextmenu",{bubbles:!0,cancelable:!0,clientX:e.left+e.width/2,clientY:e.top+e.height/2}))}return}let t="ArrowRight"===e.key||"ArrowDown"===e.key?1:"ArrowLeft"===e.key||"ArrowUp"===e.key?-1:0;if(!t)return;e.preventDefault();let i=(s+t+A.length)%A.length,r=R.current?.querySelectorAll('[role="tab"]');r?.[i]?.focus({preventScroll:!0})},children:[(0,i.jsx)(c.s,{path:t.path,className:"size-4 shrink-0"}),(0,i.jsx)("span",{className:(0,o.cn)("truncate",u&&(0,p.iH)(u)),children:t.label}),t.revisions?(0,i.jsx)("span",{className:"max-w-36 truncate font-mono text-xs",children:t.revisions}):null,u?(0,i.jsx)("span",{className:(0,o.cn)("shrink-0 text-xs",(0,p.iH)(u)),"aria-label":C("gitStatus",{status:(0,p.XB)(u)}),children:(0,p.XB)(u)}):null]}),(0,i.jsx)(l.$,{variant:"ghost",size:"icon",className:(0,o.cn)("shrink-0 rounded-none",w&&"size-9"),"data-testid":n?t.testId.replace("file-diff-tab-","file-diff-tab-close-"):`file-tab-close-${t.path}`,"aria-label":f,onClick:e=>{if(e.stopPropagation(),z.current){z.current=!1;return}N(t.target,"current")},children:(0,i.jsx)(r.A,{className:"size-3.5"})})]}),(0,i.jsx)(h.D,{children:m.map(({scope:e,label:r})=>(0,i.jsxs)("span",{children:["all"===e?(0,i.jsx)(d.K5,{}):null,(0,i.jsx)(d.kt,{disabled:"others"===e?A.length<=1:"left"===e?0===s:"right"===e&&s===A.length-1,onClick:()=>{z.current=!1,N(t.target,e)},children:C(r)})]},e))})]},t.key)})})}),j?(0,i.jsx)("div",{className:(0,o.cn)("flex min-h-9 min-w-0 max-w-full flex-wrap items-center justify-end gap-1 overflow-x-auto border-t bg-background p-1 [&>*]:min-w-0 [&>*]:max-w-full [&>span]:break-all [&>[role=group]]:flex-wrap",w&&"[&_button]:min-h-9 [&_button]:min-w-9"),role:"group","aria-label":C("fileActions"),children:j}):null]})}},35907:e=>{e.exports={document:"l3-markdown-preview_document__tuJfC"}},35989:(e,t,s)=>{"use strict";s.d(t,{A_:()=>d,Hj:()=>l,XB:()=>u,eP:()=>m,iH:()=>h,lN:()=>p,oW:()=>o,oY:()=>n,ws:()=>c});var i=s(15265),r=s(93540),a=s(82075);function n(e){let t=new Map;for(let s of e){let e=s.split("/").filter(Boolean),i=t,r="";for(let[t,a]of e.entries()){r=r?`${r}/${a}`:a;let n=i.get(a);n||(n={name:a,path:r,branchName:null,children:new Map},i.set(a,n)),t===e.length-1&&(n.branchName=s),i=n.children}}return function e(t){return[...t].sort((e,t)=>e.name.localeCompare(t.name,void 0,{numeric:!0,sensitivity:"base"})).map(t=>({name:t.name,path:t.path,branchName:t.branchName,children:e(t.children.values())}))}(t.values())}function o(e,t){return(0,a._J)(e,t)}function l(e,t){return t.split("/").at(-1)||e}function c(e){return"branch"===e.type?e.name:`@ ${e.commit.slice(0,7)}`}function d(e,t,s="en"){if(0===t.length)return null;let a=r.C[s];if(1===t.length){let r=t[0],n=l(e,r.root);if("unavailable"===r.state){let e=a.gitUnavailable;return{full:r.root?`${n} \xb7 ${e}`:e,compact:"Git !",title:`${n}${"en"===s?": ":":"}${(0,i.fD)(r.message,s)}`,diverged:!0}}let o=c(r.head);return{full:r.root?`${n} \xb7 ${o}`:o,compact:o,title:`${a.gitBranches}: ${n} \xb7 ${o}`,diverged:"detached"===r.head.type}}let n=`${t.length} ${a.repositoriesUnit}`;return{full:n,compact:`Git ${t.length}`,title:`${a.gitBranches}: ${n}`,diverged:!1}}function u(e){let t=[e.indexStatus,e.worktreeStatus];return t.includes("unmerged")?"!":t.includes("deleted")?"D":t.includes("renamed")?"R":t.includes("added")?"A":t.includes("modified")?"M":"?"}function h(e){let t=u(e);return"D"===t?"text-muted-foreground":"?"===t?"text-red-600 dark:text-red-400":"A"===t?"text-emerald-600 dark:text-emerald-400":"!"===t?"text-violet-600 dark:text-violet-400":"text-blue-600 dark:text-blue-400"}function p(e,t,s){if(/^(?:[a-z]:|\/|\\\\)/i.test(t))return null;let i=/^[a-z]:[\\/]/i.test(e)||e.startsWith("\\\\"),r=e=>i?e.toLowerCase():e,a=[...s].sort((e,t)=>t.root.length-e.root.length).find(e=>!e.root||r(t).startsWith(`${r(e.root)}/`));if(!a)return null;let n=a.root?t.slice(a.root.length+1):t;return{repository:a,path:n,change:"ready"===a.state?a.changes.find(e=>r(e.path)===r(n)):void 0}}function m(e){return e.flatMap(e=>"ready"===e.state?e.changes.map(t=>({repositoryRoot:e.root,repository:e,path:t.path,projectPath:o(e.root,t.path),change:t})):[])}},36510:(e,t,s)=>{"use strict";s.d(t,{z:()=>r});let i=`<script>
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[65232],{1364:(e,t,s)=>{"use strict";s.d(t,{Ip:()=>g,JW:()=>m,K5:()=>v,Rc:()=>f,kt:()=>x,tz:()=>p});var i=s(7962);s(69266);var r=s(85137),a=s(79102),n=s(66467),o=s(60454),l=s(93750),c=s(39608),d=s(4947),u=s(49426),h=s(13464);function p({...e}){return(0,i.jsx)(r.D,{"data-slot":"context-menu",...e})}function m({...e}){return(0,i.jsx)(a.g,{"data-slot":"context-menu-portal",...e})}function f({className:e,...t}){return(0,i.jsx)(n.R,{"data-slot":"context-menu-trigger",className:(0,u.cn)("select-none",e),...t})}function g({className:e,align:t="start",alignOffset:s=4,side:r="right",sideOffset:n=0,finalFocus:c=!1,...d}){return(0,i.jsx)(a.g,{children:(0,i.jsx)(o.y,{className:"isolate z-50 outline-none",align:t,alignOffset:s,side:r,sideOffset:n,children:(0,i.jsx)(l._,{"data-slot":"context-menu-content",finalFocus:c,className:(0,u.cn)(h.hD,e),...d})})})}function x({className:e,inset:t,variant:s="default",...r}){return(0,i.jsx)(c.D,{"data-slot":"context-menu-item","data-inset":t,"data-variant":s,className:(0,u.cn)(h.S6,h.dQ,"group/context-menu-item",e),...r})}function v({className:e,...t}){return(0,i.jsx)(d.w,{"data-slot":"context-menu-separator",className:(0,u.cn)("-mx-1 my-1 h-px bg-border",e),...t})}},5464:(e,t,s)=>{"use strict";s.d(t,{Hl:()=>k,YM:()=>S,YV:()=>b,_Y:()=>N,hA:()=>j,uX:()=>R,vu:()=>C});var i=s(7962);s(69266);var r=s(76815),a=s(21702),n=s(60530),o=s(86023),l=s(57284),c=s(72512),d=s(49264),u=s(82611),h=s(40709),p=s(93061),m=s(87425),f=s(51173),g=s(49362),x=s(78121),v=s(49426);function b({onOpenChange:e,...t}){return(0,i.jsx)(r.D,{"data-slot":"app-dialog",...t,onOpenChange:(s,i)=>{s||!1===t.modal||"outside-press"!==i.reason||i.event.target instanceof Element&&"app-dialog-backdrop"===i.event.target.getAttribute("data-slot")?e?.(s,i):i.cancel()}})}function y({...e}){return(0,i.jsx)(a.Z,{"data-slot":"app-dialog-portal",...e})}function w({className:e,...t}){return(0,i.jsx)(n.X,{"data-slot":"app-dialog-backdrop",className:(0,v.cn)("fixed inset-x-0 top-[var(--pi-desk-window-inset)] bottom-0 z-[100] bg-black/35 duration-100 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...t})}function j({className:e,children:t,showCloseButton:s=!0,finalFocus:r=!1,backdropClassName:a,...n}){let{t:c}=(0,x.Bd)("common");return(0,i.jsxs)(y,{children:[(0,i.jsx)(w,{className:a,forceRender:!!a}),(0,i.jsxs)(o.h,{"data-slot":"app-dialog-content",finalFocus:r,className:(0,v.cn)("fixed top-[calc(50%+var(--pi-desk-window-inset)/2)] left-1/2 z-[110] flex max-h-[calc(var(--pi-desk-content-height)-2rem)] w-[calc(100%-2rem)] max-w-[27.5rem] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-border bg-popover text-sm text-popover-foreground shadow-lg outline-none duration-100 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...n,children:[t,s?(0,i.jsxs)(l.H,{"data-slot":"app-dialog-close-button","aria-label":c("closeDialog"),title:c("closeDialog"),className:"absolute top-2 right-2 flex size-8 cursor-pointer items-center justify-center rounded-lg text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground active:bg-foreground/14 focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",children:[(0,i.jsx)(g.A,{className:"size-4"}),(0,i.jsx)("span",{className:"sr-only",children:c("closeDialog")})]}):null]})]})}function k({className:e,...t}){return(0,i.jsx)("div",{"data-slot":"app-dialog-header",className:(0,v.cn)("flex shrink-0 flex-col gap-1.5",e),...t})}function N({className:e,children:t,...s}){return(0,i.jsxs)(u.V,{"data-slot":"app-dialog-body",className:(0,v.cn)("relative min-h-0 flex-1 overflow-hidden",e),...s,children:[(0,i.jsx)(h.B,{"data-slot":"app-dialog-body-viewport",className:"h-full max-h-[inherit] w-full overscroll-contain rounded-[inherit] outline-none focus-visible:ring-2 focus-visible:ring-ring",children:t}),(0,i.jsx)(p.V,{"data-slot":"app-dialog-body-scrollbar",orientation:"vertical",className:"flex h-full w-2.5 touch-none border-l border-l-transparent p-px select-none",children:(0,i.jsx)(m.l,{"data-slot":"app-dialog-body-thumb",className:"relative flex-1 rounded-full bg-muted-foreground/45 hover:bg-muted-foreground/70"})}),(0,i.jsx)(f.I,{})]})}function C({className:e,...t}){return(0,i.jsx)("div",{"data-slot":"app-dialog-footer",className:(0,v.cn)("flex shrink-0 flex-wrap justify-end gap-2 border-t bg-popover px-4 py-3",e),...t})}function S({className:e,...t}){return(0,i.jsx)(c.L,{"data-slot":"app-dialog-title",className:(0,v.cn)("text-lg leading-[1.4] font-semibold",e),...t})}function R({className:e,...t}){return(0,i.jsx)(d.r,{"data-slot":"app-dialog-description",className:(0,v.cn)("text-sm leading-5 text-muted-foreground",e),...t})}},7237:(e,t,s)=>{"use strict";function i(e){let t=atob(e.data),s=new Uint8Array(t.length);for(let e=0;e<t.length;e+=1)s[e]=t.charCodeAt(e);return new Blob([s],{type:e.mimeType})}s.d(t,{E:()=>i})},8001:(e,t,s)=>{"use strict";s.d(t,{IV:()=>m,om:()=>b,e6:()=>w,XC:()=>v});var i=s(7962),r=s(10672),a=s(69075),n=s(45216),o=s(94173),l=s(14510),c=s(3058),d=s(90458),u=s(78121),h=s(10508),p=s(49426);let m={input:["dataPiMarkdownProgress"],blockquote:["dataPiMarkdownAlert"]};function f(e){return{type:"paragraph",children:[],data:{hName:"input",hProperties:{type:"checkbox",disabled:!0,checked:"[x]"===e.toLowerCase(),..."[-]"===e?{dataPiMarkdownProgress:"true"}:{}}}}}var g=s(83029),x=s.n(g);let v=[...Object.values(h.U2),function(){return(e,t)=>{let s=String(t.value),i=(e,t)=>{let i=e.position?.start.offset;return void 0!==i&&s.slice(i,i+t.length)===t},r=e=>{let t=e.children?.[0];if("tableCell"===e.type&&e.children?.length===1&&t?.type==="text"){let s=t.value??"";/^\[[ xX-]\]$/.test(s)&&i(t,s)&&(e.children=[f(s)])}else if("listItem"===e.type&&t?.type==="paragraph"){let s=t.children?.[0];s?.type==="text"&&/^\[-\](?:\s|$)/.test(s.value??"")&&i(s,"[-]")&&(s.value=s.value.slice(3),t.children.unshift(f("[-]")),e.data={...e.data,hProperties:{className:["task-list-item"]}})}else if("blockquote"===e.type&&t?.type==="paragraph"){let s=t.children?.[0],r=s?.value?.match(/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\][ \t]*(?:\r?\n|$)/);s?.type==="text"&&r&&i(s,`[!${r[1]}]`)&&(r[0].endsWith("\n")||1===t.children.length||t.children[1]?.type==="break")&&(s.value=s.value.slice(r[0].length),s.value||(t.children.shift(),t.children[0]?.type==="break"&&t.children.shift()),0===t.children.length&&e.children.shift(),e.data={...e.data,hProperties:{dataPiMarkdownAlert:r[1].toLowerCase()}})}for(let t of e.children??[])r(t)};r(e)}}],b=x().markdown,y={note:{icon:r.A,label:"markdownNote"},tip:{icon:a.A,label:"markdownTip"},important:{icon:n.A,label:"markdownImportant"},warning:{icon:o.A,label:"markdownWarning"},caution:{icon:l.A,label:"markdownCaution"}},w={input:function({"data-pi-markdown-progress":e,...t}){let{t:s}=(0,u.Bd)("common");if(delete t.node,"checkbox"!==t.type)return(0,i.jsx)("input",{...t});let r=e?"progress":t.checked?"completed":"pending",a=e?"[-]":t.checked?"[x]":"[ ]",n=s(e?"markdownProgress":t.checked?"markdownCompleted":"markdownPending");return(0,i.jsxs)("span",{className:x().status,"data-state":r,role:"img","aria-label":n,title:n,children:[e?(0,i.jsx)(c.A,{"aria-hidden":"true"}):t.checked?(0,i.jsx)(d.A,{"aria-hidden":"true"}):null,(0,i.jsx)("span",{className:"sr-only","aria-hidden":"true",children:a})]})},blockquote:function({"data-pi-markdown-alert":e,className:t,children:s,...r}){let{t:a}=(0,u.Bd)("common");delete r.node;let n=Object.entries(y).find(([t])=>t===e)?.[1];if(!n)return(0,i.jsx)("blockquote",{...r,"data-streamdown":"blockquote",className:(0,p.cn)("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),children:s});let o=n.icon;return(0,i.jsxs)("aside",{className:x().alert,role:"note","aria-label":a(n.label),children:[(0,i.jsxs)("div",{className:x().alertTitle,children:[(0,i.jsx)(o,{"aria-hidden":"true"}),a(n.label)]}),(0,i.jsx)("div",{className:x().alertBody,children:s})]})}}},8596:e=>{e.exports={tree:"l3-project-file-browser_tree__KA1C9"}},9736:(e,t,s)=>{"use strict";s.d(t,{F:()=>U});var i=s(7962),r=s(14044),a=s(36670),n=s(65770),o=s(66584),l=s(31761),c=s(90213),d=s(41148),u=s(69266),h=s(78121),p=s(15265),m=s(5816),f=s(49426),g=s(81649),x=s(95526);let v=(0,u.createContext)({expandedPaths:new Set,togglePath:()=>{}}),b=({expanded:e,defaultExpanded:t=new Set,selectedPath:s,onSelect:r,onExpandedChange:a,className:n,children:o,...l})=>{let[c,d]=(0,u.useState)(t),h=e??c,p=(0,u.useCallback)(e=>{let t=new Set(h);t.has(e)?t.delete(e):t.add(e),d(t),a?.(t)},[h,a]),m=(0,u.useMemo)(()=>({expandedPaths:h,onSelect:r,selectedPath:s,togglePath:p}),[h,r,s,p]);return(0,i.jsx)(v.Provider,{value:m,children:(0,i.jsx)("div",{className:(0,f.cn)("rounded-lg border bg-background font-sans text-sm",n),role:"tree",...l,children:(0,i.jsx)("div",{className:"p-2",children:o})})})},y=({className:e,children:t,...s})=>(0,i.jsx)("span",{className:(0,f.cn)("shrink-0",e),...s,children:t}),w=({className:e,children:t,...s})=>(0,i.jsx)("span",{className:(0,f.cn)("truncate",e),...s,children:t}),j=(0,u.createContext)({name:"",path:""}),k=({path:e,name:t,icon:s,className:r,children:a,...n})=>{let{selectedPath:o,onSelect:l}=(0,u.useContext)(v),c=o===e,d=(0,u.useCallback)(()=>{l?.(e)},[l,e]),h=(0,u.useCallback)(t=>{("Enter"===t.key||" "===t.key)&&l?.(e)},[l,e]),p=(0,u.useMemo)(()=>({name:t,path:e}),[t,e]);return(0,i.jsx)(j.Provider,{value:p,children:(0,i.jsx)("div",{className:(0,f.cn)("flex min-h-9 cursor-pointer items-center gap-2 rounded-md px-2 py-1 outline-none transition-colors hover:bg-foreground/8 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",c&&"bg-accent",r),onClick:d,onKeyDown:h,role:"treeitem","aria-selected":c,tabIndex:0,...n,children:a??(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:"size-6 shrink-0"}),(0,i.jsx)(y,{children:s??(0,i.jsx)(x.A,{className:"size-4 text-muted-foreground"})}),(0,i.jsx)(w,{children:t})]})})})};var N=s(74675),C=s(69272),S=s(50479);function R({directory:e,expanded:t,onToggle:s,children:r,...n}){let l=e.label.split("/"),c=l.at(-1),d=l.slice(0,-1).join(" \\ "),u=l.join(" \\ "),h=t?S.A:o.A;return(0,i.jsx)(g.Nt,{open:t,onOpenChange:s,children:(0,i.jsxs)("div",{role:"treeitem","aria-expanded":t,"aria-selected":!1,title:e.targetPath,...n,children:[(0,i.jsx)("div",{className:"flex min-h-9 items-center rounded-sm px-2 py-1 transition-colors hover:bg-foreground/8",children:(0,i.jsxs)(g.R6,{className:"flex min-h-7 min-w-0 flex-1 cursor-pointer items-center gap-2 rounded-sm bg-transparent p-0 text-left text-sm outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring","aria-label":u,onKeyDown:e=>{("ArrowLeft"===e.key&&t||"ArrowRight"===e.key&&!t)&&(e.preventDefault(),e.stopPropagation(),s())},children:[(0,i.jsx)("span",{className:"flex size-6 shrink-0 items-center justify-center",children:(0,i.jsx)(a.A,{className:(0,f.cn)("size-4 text-muted-foreground transition-transform",t&&"rotate-90")})}),(0,i.jsx)(h,{className:"size-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),(0,i.jsxs)("span",{className:"flex min-w-0 items-baseline",children:[d?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:"min-w-0 shrink-[2] truncate text-muted-foreground",children:d}),(0,i.jsx)("span",{className:"shrink-0 px-1 text-muted-foreground","aria-hidden":"true",children:"\\"})]}):null,(0,i.jsx)("span",{className:"min-w-0 truncate",children:c})]})]})}),(0,i.jsx)(g.Ke,{children:(0,i.jsx)("div",{role:"group",className:"ml-4 border-l pl-2",children:r})})]})})}var z=s(86963),D=s(49362),A=s(17511),M=s(32892);let P=["all","files","content"],$=[{key:"caseSensitive",label:"searchCaseSensitive",text:"Aa"},{key:"wholeWord",label:"searchWholeWord",text:"Ab"},{key:"regex",label:"searchRegex",text:".*"}];function T({input:e,inputRef:t,invalid:s,onQueryChange:r,onOptionsChange:a,onComposingChange:n,onClose:o,onOpenFirst:l,onFocusResults:c}){let{t:p}=(0,h.Bd)("projectFiles"),[m,g]=(0,u.useState)(null),x=(0,u.useRef)(!1);(0,u.useEffect)(()=>()=>n(!1),[n]);let v=p("files"===e.scope?"searchFiles":"content"===e.scope?"searchContent":"searchAll");return(0,i.jsxs)("div",{className:"shrink-0 px-1 pt-1",children:[(0,i.jsxs)(A.MG,{className:"rounded-md",children:[(0,i.jsx)(A.Sq,{className:"pl-1.5 py-0",children:(0,i.jsx)(d.A,{className:"size-3.5"})}),(0,i.jsx)(A.iV,{ref:t,"data-testid":"project-file-search",className:"min-h-7 min-w-0 px-1.5 py-0.5 text-sm placeholder:text-xs",value:m??e.query,placeholder:v,"aria-label":v,"aria-invalid":s||void 0,autoComplete:"off",spellCheck:!1,onChange:e=>{x.current?g(e.target.value):r(e.target.value)},onCompositionStart:e=>{x.current=!0,g(e.currentTarget.value),n(!0)},onCompositionEnd:e=>{x.current=!1,g(null),r(e.currentTarget.value),n(!1)},onKeyDown:e=>{e.nativeEvent.isComposing||x.current||("Enter"===e.key?(e.preventDefault(),l()):"ArrowDown"===e.key&&(e.preventDefault(),c()))}}),(0,i.jsx)(A.Sq,{align:"inline-end",className:"pr-0.5 py-0 has-[>button]:mr-0",children:(0,i.jsxs)(M.m_,{children:[(0,i.jsx)(M.k$,{render:(0,i.jsx)(A.Ik,{size:"icon-xs",className:"min-h-7","aria-label":p("closeSearch"),onClick:o}),children:(0,i.jsx)(D.A,{className:"size-4"})}),(0,i.jsx)(M.ZI,{children:p("closeSearch")})]})})]}),(0,i.jsxs)("div",{className:"flex min-h-7 flex-wrap items-center justify-between gap-x-1",children:[(0,i.jsx)("div",{className:"flex min-w-0 items-center",role:"radiogroup","aria-label":p("searchScope"),children:P.map((t,s)=>(0,i.jsx)(z.$,{type:"button",role:"radio","aria-checked":e.scope===t,tabIndex:e.scope===t?0:-1,disabled:null!==m,variant:"ghost",size:"sm","data-testid":`project-search-scope-${t}`,className:(0,f.cn)("px-1 text-xs",e.scope===t&&"bg-accent text-accent-foreground"),onClick:()=>a({scope:t}),onKeyDown:e=>{let t="ArrowRight"===e.key||"ArrowDown"===e.key,i="ArrowLeft"===e.key||"ArrowUp"===e.key;if(!t&&!i&&"Home"!==e.key&&"End"!==e.key)return;e.preventDefault();let r="Home"===e.key?0:"End"===e.key?2:(s+(t?1:2))%3;a({scope:P[r]}),e.currentTarget.parentElement?.querySelectorAll('[role="radio"]')[r]?.focus()},children:p("all"===t?"searchScopeAll":"files"===t?"searchScopeFiles":"searchScopeContent")},t))}),(0,i.jsx)("div",{className:"ml-auto flex items-center",children:$.map(({key:t,label:s,text:r})=>(0,i.jsxs)(M.m_,{children:[(0,i.jsx)(M.k$,{render:(0,i.jsx)(z.$,{type:"button",variant:"ghost",size:"icon-sm",disabled:null!==m,"aria-label":p(s),"aria-pressed":e[t],"data-testid":`project-search-option-${t}`,className:(0,f.cn)("font-mono text-xs text-muted-foreground","wholeWord"===t&&"underline underline-offset-4"),onClick:()=>a({[t]:!e[t]})}),children:r}),(0,i.jsx)(M.ZI,{children:p(s)})]},t))})]})]})}function O(e,t,s=0){let r=[],a=0;for(let n of t){let t=Math.max(a,n.start-s,0),o=Math.min(n.end-s,e.length);o<=t||(r.push(e.slice(a,t)),r.push((0,i.jsx)("mark",{className:"rounded-sm bg-foreground/15 text-inherit",children:e.slice(t,o)},`${t}:${o}`)),a=o)}return r.push(e.slice(a)),r}function L({search:e,resultsRef:t,activePath:s,onOpen:n,wrapFile:o,renderFileIcon:l,fileDecoration:c}){let{t:p}=(0,h.Bd)("projectFiles"),m=(0,u.useId)(),[g,x]=(0,u.useState)(!1),[v,b]=(0,u.useState)(new Set),[y,w]=(0,u.useState)(null),j=new Map;for(let t of e.contentMatches){let e=j.get(t.path);e?e.push(t):j.set(t.path,[t])}let k=!!e.query.trim(),C=k&&"ready"===e.status,S=e.fileMatches.length,R=e.contentMatches.length,D="all"===e.scope&&S>3&&R>0&&!g,A=D?e.fileMatches.slice(0,3):e.fileMatches,M=p("searchCounts",{files:new Set([...e.fileMatches.map(e=>e.path),...j.keys()]).size,lines:R}),P=e=>{b(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})};return(0,i.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,i.jsxs)("div",{className:"flex min-h-6 flex-wrap items-center justify-between gap-x-2 px-2 text-xs text-muted-foreground",role:"status","aria-live":"polite",children:[(0,i.jsx)("span",{children:p("searchResults")}),C?(0,i.jsx)("span",{className:"tabular-nums",children:e.truncated?p("searchShownCounts",{counts:M}):M}):null]}),(0,i.jsx)(N.V,{className:"min-h-0 flex-1",viewportClassName:"pb-2",children:(0,i.jsx)("div",{ref:t,role:"region","aria-label":p("searchResults"),"aria-busy":k&&"loading"===e.status,onKeyDown:e=>{if("ArrowDown"!==e.key&&"ArrowUp"!==e.key&&"Home"!==e.key&&"End"!==e.key)return;let t=[...e.currentTarget.querySelectorAll("button")].filter(e=>!e.disabled&&!e.closest("[hidden]")),s=t.indexOf(document.activeElement);if(s<0)return;e.preventDefault();let i="Home"===e.key?0:"End"===e.key?t.length-1:Math.max(0,Math.min(t.length-1,s+("ArrowDown"===e.key?1:-1)));t[i]?.focus()},children:k?"loading"===e.status?(0,i.jsxs)("div",{className:"flex min-h-10 items-center gap-2 px-3 text-xs text-muted-foreground",children:[(0,i.jsx)(r.A,{className:"size-3.5 animate-spin"}),p("searching")]}):"error"===e.status?(0,i.jsx)("p",{role:"alert",className:"mx-3 my-2 break-words rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:e.error||p("searchFailed")}):C&&0===S&&0===R?(0,i.jsxs)("div",{className:"px-5 py-9 text-center text-sm text-muted-foreground",children:[(0,i.jsx)(d.A,{className:"mx-auto mb-3 size-6"}),(0,i.jsx)("p",{children:p(e.truncated?"resultLimit":"noMatches")}),(0,i.jsx)("p",{className:"mt-2 text-xs",children:p("searchTryOptions")})]}):C?(0,i.jsxs)(i.Fragment,{children:[S>0?(0,i.jsxs)("section",{children:["all"===e.scope?(0,i.jsxs)("h3",{className:"flex min-h-6 items-center gap-2 px-2 text-xs text-muted-foreground",children:[p("searchFileHeading"),(0,i.jsx)("span",{className:"tabular-nums",children:S})]}):null,A.map(({path:e,ranges:t})=>{let r=e.lastIndexOf("/"),a=c(e);return o(e,void 0,(0,i.jsxs)(z.$,{type:"button",variant:"ghost","data-testid":`project-search-result-${e}`,"data-search-result":"true",className:(0,f.cn)("mx-1 flex min-h-6 w-[calc(100%-0.5rem)] justify-start gap-1 px-1 py-0 text-left font-normal [@media(pointer:coarse)]:min-h-9",s===e&&"bg-accent"),title:e,onClick:()=>n(e),children:[(0,i.jsx)("span",{className:"shrink-0",children:l(e)}),(0,i.jsxs)("span",{className:"flex min-w-0 flex-1 items-baseline gap-1.5",children:[(0,i.jsx)("span",{className:(0,f.cn)("truncate text-sm",a.className),children:O(e.slice(r+1),t,r+1)}),r>=0?(0,i.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:O(e.slice(0,r),t)}):null]}),a.badge?(0,i.jsx)("span",{className:(0,f.cn)("text-xs",a.className),"aria-label":p("gitStatus",{status:a.badge}),children:a.badge}):null]},e))}),D?(0,i.jsx)(z.$,{type:"button",variant:"ghost",size:"sm",className:"ml-5 min-h-6 py-0 text-xs text-muted-foreground [@media(pointer:coarse)]:min-h-9",onClick:()=>x(!0),children:p("searchExpandFiles",{count:S-3})}):null]}):null,R>0?(0,i.jsxs)("section",{className:(0,f.cn)(S>0&&"mt-1"),children:["all"===e.scope?(0,i.jsxs)("h3",{className:"flex min-h-6 flex-wrap items-center gap-x-2 px-2 text-xs text-muted-foreground",children:[p("searchContentHeading"),(0,i.jsx)("span",{children:p("searchContentCounts",{lines:R,files:j.size})})]}):null,[...j].map(([e,t],s)=>{let r=e.lastIndexOf("/"),c=!v.has(e),d=`${m}-${s}`;return(0,i.jsxs)("section",{className:"mb-1",children:[(0,i.jsxs)(z.$,{type:"button",variant:"ghost",className:"min-h-6 w-full justify-start gap-1 rounded-none px-2 py-0 text-left font-normal [@media(pointer:coarse)]:min-h-9",title:e,"aria-expanded":c,"aria-controls":d,onClick:()=>P(e),onKeyDown:t=>{("ArrowLeft"===t.key&&c||"ArrowRight"===t.key&&!c)&&(t.preventDefault(),P(e))},children:[(0,i.jsx)(a.A,{className:(0,f.cn)("size-3 shrink-0 text-muted-foreground transition-transform motion-reduce:transition-none",c&&"rotate-90")}),(0,i.jsx)("span",{className:"shrink-0",children:l(e)}),(0,i.jsxs)("span",{className:"min-w-0 truncate text-sm",children:[e.slice(r+1),(0,i.jsx)("span",{className:"ml-1.5 text-xs text-muted-foreground",children:e.slice(0,Math.max(0,r))})]}),(0,i.jsx)("span",{className:"ml-auto shrink-0 rounded bg-muted px-1 text-xs text-muted-foreground tabular-nums",children:t.length})]}),(0,i.jsx)("div",{id:d,hidden:!c,children:t.map(({line:t,text:s,ranges:r})=>o(e,t,(0,i.jsxs)(z.$,{type:"button",variant:"ghost","data-testid":`project-search-line-${e}-${t}`,"data-search-result":"true",className:(0,f.cn)("min-h-6 w-full justify-start gap-1 rounded-none border-l-2 border-transparent py-0 pr-2 pl-5 text-left font-mono font-normal [@media(pointer:coarse)]:min-h-9",y?.path===e&&y.line===t&&"border-l-foreground/50 bg-accent"),title:s,"aria-label":p("searchOpenLine",{path:e,line:t}),onClick:()=>{w({path:e,line:t}),n(e,t)},children:[(0,i.jsx)("span",{className:"min-w-5 shrink-0 text-right text-xs text-muted-foreground tabular-nums",children:t}),(0,i.jsx)("span",{className:"min-w-0 truncate whitespace-pre text-sm",children:O(s,r)})]},`${e}:${t}`)))})]},e)})]}):null,e.truncated?(0,i.jsx)("p",{className:"px-3 py-2 text-xs leading-5 text-muted-foreground",children:p("resultLimit")}):null]}):null:(0,i.jsxs)("div",{className:"px-5 py-9 text-center text-sm text-muted-foreground",children:[(0,i.jsx)(d.A,{className:"mx-auto mb-3 size-6"}),(0,i.jsx)("p",{children:p("searchStart")}),(0,i.jsx)("p",{className:"mt-2 text-xs",children:p("files"===e.scope?"searchFiles":"content"===e.scope?"searchContent":"searchAll")})]})})}),"files"!==e.scope?(0,i.jsx)("p",{className:"shrink-0 px-2 py-1 text-xs leading-5 text-muted-foreground",children:p("searchTextLimit")}):null]})}var E=s(35989),I=s(60682),q=s(14512),F=s(8596),_=s.n(F),W=s(82075);let B=[],H=new WeakMap;function Y(e){return(0,i.jsx)(C.s,{path:e,className:"size-4 text-muted-foreground"})}function V(e){if(e)return(0,E.iH)(e.change)}function K({state:e,onRetry:t}){let{t:s}=(0,h.Bd)("projectFiles");return e&&"idle"!==e.status&&"loading"!==e.status?"error"!==e.status?null:(0,i.jsx)("button",{type:"button",onClick:t,className:"min-h-8 w-full rounded px-2 text-left text-xs text-destructive hover:bg-destructive/10",children:s("retryReading",{error:e.error})}):(0,i.jsxs)("div",{className:"flex min-h-8 items-center gap-2 px-2 text-xs text-muted-foreground",children:[(0,i.jsx)(r.A,{className:"size-3.5 animate-spin"})," ",s("reading")]})}function U({cwd:e,projectName:t,runtime:s,gitRuntime:r,onOpenGitBranches:g,onFileOpened:x,rootTitle:v,showRootTitle:j=!0,gitReadOnly:C=!1}){let S,D,A,{t:M}=(0,h.Bd)("projectFiles"),{locale:P}=(0,m.i)();(0,u.useSyncExternalStore)(s.subscribe,s.getRevision,s.getRevision),(0,u.useSyncExternalStore)(r.subscribe,r.getRevision,r.getRevision);let $=s.state,O=r.getWorkspace(e),F=(0,u.useRef)(null),J=(0,u.useRef)(null),G=(0,u.useRef)(null),Q=(0,u.useRef)(null),X=(0,u.useRef)(null),[Z,ee]=(0,u.useState)(!1),et=(0,u.useRef)({}),es=(0,u.useCallback)(e=>{e?H.set(s,et.current):H.get(s)===et.current&&H.delete(s),ee(e)},[s]),ei=$.searchOpen,er=()=>{ee(!1),s.setSearchOpen(!1),requestAnimationFrame(()=>X.current?.focus())},[ea,en]=(0,u.useState)({}),eo=(e,t)=>{let s=ea[e]??300;return s<t?(0,i.jsx)("button",{type:"button",className:"min-h-8 px-3 text-sm text-muted-foreground hover:bg-accent",onClick:t=>{t.stopPropagation(),en(t=>({...t,[e]:s+300}))},children:M("showMore",{visible:s,total:t})}):null},el=$?.search.query??"",ec=O?.snapshot.repositories??B,ed=(0,E.eP)(ec),eu=new Map(ed.map(e=>[e.projectPath,e])),eh=ec.map(e=>e.root).filter(Boolean),ep=(0,u.useCallback)(()=>{r.refreshSnapshot(e);let t=r.getWorkspace(e);if(s.state.searchOpen||t?.changesOnly)return;let i=t?.layout==="repository"&&(1!==t.snapshot.repositories.length||t.snapshot.repositories[0]?.root!=="")?[...t.expandedRepositories].sort((e,t)=>t.length-e.length):[""],a=s.state.expandedPaths,n=new Set(i);for(let e of a){let t=i.find(t=>!t||e.startsWith(`${t}/`));if(void 0===t)continue;let s=e.slice(t?t.length+1:0).split("/");s.slice(0,-1).every((e,i)=>a.has((0,W._J)(t,s.slice(0,i+1).join("/"))))&&n.add(e)}s.refreshDirectories(n)},[e,r,s]);(0,q.L)(F,ep),(0,u.useEffect)(()=>{let e=J.current;e&&!ei&&(e.scrollTop=$.treeScrollTop)},[ei,$]),(0,u.useEffect)(()=>{if(!ei||!el.trim()||Z)return;let e=window.setTimeout(()=>{H.has(s)||s.search(el)},220);return()=>window.clearTimeout(e)},[Z,s,ei,el]);let em=[...O?.expandedRepositories??[]].join("\0");(0,u.useEffect)(()=>{if(O&&"repository"===O.layout)for(let e of O.expandedRepositories)s.ensureDirectory(e)},[em,O,s]);let ef=new Set(eh),eg=(e,t)=>{let i=new Set($.expandedPaths);for(let s of e.paths)t?i.add(s):i.delete(s);s.setExpandedPaths(i,!1),t&&!O?.changesOnly&&Promise.all(e.paths.map(e=>s.ensureDirectory(e,!0))).then(()=>s.expandDirectoryChain(e.path,ef))},ex=(e,t)=>{s.openFile(e,t),x?.()},ev=e=>{s.openDiff(e.repositoryRoot,e.path),x?.()},eb=(t,r)=>(0,i.jsx)(I.J,{cwd:e,path:t.targetPath,type:"directory",trigger:r,expanded:$.expandedPaths.has(t.path),onToggle:()=>eg(t,!$.expandedPaths.has(t.path)),onReveal:s.canReveal?(e,t)=>s.revealFile(e,t):void 0},(0,W.Im)("directory",t.path)),ey=(t,r,a=null,n=!1,o)=>(0,i.jsx)(I.J,{cwd:e,path:t,type:"file",trigger:r,openLabel:M(n?"viewDiff":"openPreview"),onOpen:()=>n&&a?ev(a):ex(t,o),oldPath:a?.change.oldPath?(0,W._J)(a.repositoryRoot,a.change.oldPath):void 0,onReveal:s.canReveal?(e,t)=>s.revealFile(e,t):void 0},void 0===o?(0,W.Im)("file",t):`${t}:${o}`),ew=(e,t,s,r)=>ey(e,(0,i.jsxs)(k,{path:(0,W.Im)("file",e),name:t,title:e,"data-testid":`project-file-${e}`,onClick:()=>{r&&s?ev(s):ex(e)},children:[(0,i.jsx)("span",{className:"size-6 shrink-0"}),(0,i.jsx)(y,{children:Y(e)}),(0,i.jsx)(w,{"data-testid":`project-file-name-${e}`,className:(0,f.cn)("min-w-0 flex-1",V(s)),children:t}),s?(0,i.jsx)("span",{className:(0,f.cn)("text-xs tabular-nums",V(s)),"aria-label":M("gitStatus",{status:(0,E.XB)(s.change)}),children:(0,E.XB)(s.change)}):null]}),s,r),ej=(e,t,r)=>{let a=$?.directories.get(e);if(a?.status!=="ready")return(0,i.jsx)(K,{state:a,onRetry:()=>void s.ensureDirectory(e)});let n=r?a.entries.filter(s=>{let i;return i=(0,W._J)(e,s.name),!eh.some(e=>e!==t&&i===e)}):a.entries;return(0,i.jsxs)(i.Fragment,{children:[n.slice(0,ea[`directory:${e}`]??300).map(a=>{let n=(0,W._J)(e,a.name);if("file"===a.type)return ew(n,a.name,eu.get(n)??null,!1);let o=s.compactDirectory(n,ef);return eb(o,(0,i.jsx)(R,{directory:o,expanded:$.expandedPaths.has(n),onToggle:()=>eg(o,!$.expandedPaths.has(n)),"data-testid":`project-folder-${n}`,children:ej(o.targetPath,t,r)}))}),eo(`directory:${e}`,n.length),a.truncated?(0,i.jsx)("p",{className:"px-2 py-2 text-xs leading-5 text-amber-600 dark:text-amber-400",children:M("directoryLimit")}):null,0===n.length?(0,i.jsx)("p",{className:"px-2 py-2 text-xs text-muted-foreground",children:M("emptyDirectory")}):null]})},ek=(e,t)=>{let s=e.get(t);if(!s)return null;let r=[...s.directories.keys()].sort(W.Kn),a=[...s.files].sort(W.Kn),n=ea[`changes:${t}`]??300;return(0,i.jsxs)(i.Fragment,{children:[r.slice(0,n).map(t=>{let s=(0,W.xV)(t,e,ef);return eb(s,(0,i.jsx)(R,{directory:s,expanded:$.expandedPaths.has(t),onToggle:()=>eg(s,!$.expandedPaths.has(t)),"data-testid":`project-folder-${t}`,children:ek(e,s.targetPath)}))}),a.slice(0,Math.max(0,n-r.length)).map(e=>ew(e,e.slice(e.lastIndexOf("/")+1),eu.get(e)??null,!0)),eo(`changes:${t}`,r.length+a.length)]})},eN=e=>{let t=e.slice(5),s=eu.get(t);O?.changesOnly&&s?ev(s):ex(t)},eC=(c,d,u)=>{if(O?.changesOnly&&!c)return null;let h=O?.expandedRepositories.has(d)??!1,m=c?.state==="ready"?ed.filter(e=>e.repositoryRoot===d):[],x=m.length;if(O?.changesOnly&&c?.state==="ready"&&0===x)return null;let v=(0,W.OA)(m.map(e=>e.projectPath),d);return(0,i.jsxs)("section",{"data-testid":`project-git-repository-${d||"root"}`,className:"border-b last:border-b-0",children:[(0,i.jsxs)("div",{className:"flex min-h-8 items-center gap-1 px-1 py-0.5",children:[(0,i.jsxs)("button",{"data-testid":`project-git-repository-toggle-${d||"root"}`,type:"button",className:"flex min-w-0 flex-1 items-center gap-1 rounded-md px-1 py-0.5 text-left hover:bg-muted/60","aria-expanded":h,onClick:()=>{h&&s.cancelDirectoryExpansion(d),r.toggleRepository(e,d),h||s.ensureDirectory(d,!0)},children:[(0,i.jsx)(a.A,{className:(0,f.cn)("size-3 shrink-0 text-muted-foreground transition-transform",h&&"rotate-90")}),c?(0,i.jsx)(n.A,{className:"size-4 shrink-0 text-muted-foreground"}):(0,i.jsx)(o.A,{className:"size-4 shrink-0 text-muted-foreground"}),(0,i.jsx)("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",title:c&&d||t,children:u})]}),c?(0,i.jsxs)("button",{"data-testid":`project-git-branch-${d||"root"}`,type:"button",disabled:C||"ready"!==c.state,className:(0,f.cn)((0,z.r)({variant:"ghost",size:"sm"}),"max-w-28 shrink gap-1 font-mono text-xs text-muted-foreground"),title:"ready"===c.state?M(C?"gitBranchReadOnly":"gitBranches"):(0,p.fD)(c.message,P),"aria-label":M(C?"gitBranchReadOnly":"gitBranches"),onClick:()=>g(d),children:[(0,i.jsx)(l.A,{className:"size-3 shrink-0"}),(0,i.jsx)("span",{className:"min-w-0 truncate",children:"ready"===c.state?(0,E.ws)(c.head):M("unavailable")}),x>0?(0,i.jsx)("span",{className:"rounded-md bg-muted px-1 text-xs text-status-warning",children:x}):null]}):null]}),h?O?.changesOnly?(0,i.jsx)(b,{className:"rounded-none border-0 bg-transparent px-1 pb-1",selectedPath:$?.activeDiff?(0,W.Im)("file",(0,E.oW)($.activeDiff.repositoryRoot,$.activeDiff.path)):void 0,onSelect:eN,children:x>0?ek(v,d):(0,i.jsx)("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:M("noChanges")})}):(0,i.jsx)(b,{className:"rounded-none border-0 bg-transparent px-1 pb-1",selectedPath:$.activePath?(0,W.Im)("file",$.activePath):void 0,onSelect:eN,children:ej(d,c?.root??null,!0)}):null]},c?`git:${d}`:"workspace")},eS=1===ec.length&&ec[0]?.root===""?ec[0]:null,eR=ec.length>0&&!eS,ez=eR?O?.layout??"directory":"directory",eD=eS?(0,i.jsxs)("button",{type:"button",disabled:C||"ready"!==eS.state,className:(0,f.cn)((0,z.r)({variant:"ghost",size:"sm"}),"max-w-32 shrink gap-1 font-mono text-xs text-muted-foreground",!j&&"min-w-0 flex-1 justify-start"),"aria-label":M(C?"gitBranchReadOnly":"gitBranches"),title:"ready"===eS.state?`${M(C?"gitBranchReadOnly":"gitBranches")} \xb7 ${(0,E.ws)(eS.head)}`:(0,p.fD)(eS.message,P),onClick:()=>g(""),children:[(0,i.jsx)(l.A,{className:"size-3 shrink-0"}),(0,i.jsx)("span",{className:"truncate",children:"ready"===eS.state?(0,E.ws)(eS.head):M("unavailable")})]}):null,eA=(0,i.jsxs)("div",{className:"flex min-h-8 min-w-0 flex-wrap items-center gap-x-1 gap-y-0.5 outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",tabIndex:j?void 0:0,"aria-label":M("projectFiles",{name:t}),children:[eR?(0,i.jsx)("div",{className:"flex shrink-0 gap-0.5",role:"group","aria-label":M("layout"),children:["directory","repository"].map(t=>(0,i.jsx)("button",{"data-testid":`project-file-layout-${t}`,type:"button","aria-pressed":ez===t,className:(0,f.cn)((0,z.r)({variant:"ghost",size:"sm"}),ez===t&&"bg-accent text-accent-foreground"),onClick:()=>{s.cancelDirectoryExpansion(),r.setLayout(e,t)},children:M("directory"===t?"directory":"repository")},t))}):null,ec.length>0?(0,i.jsxs)("button",{"data-testid":"project-git-changes-toggle",type:"button","aria-pressed":O?.changesOnly??!1,className:(0,f.cn)((0,z.r)({variant:"ghost",size:"sm"}),"min-w-0 gap-1",O?.changesOnly&&"bg-accent text-accent-foreground"),onClick:()=>{s.cancelDirectoryExpansion(),r.setChangesOnly(e,!O?.changesOnly)},children:[(0,i.jsx)(c.A,{className:"size-3 shrink-0"}),(0,i.jsx)("span",{className:"truncate",children:M("changesOnly")}),(0,i.jsx)("span",{className:"rounded-md bg-muted px-1 font-mono text-xs",children:ed.length})]}):null,j?null:eD,(0,i.jsx)("button",{ref:X,type:"button",className:(0,f.cn)((0,z.r)({variant:"ghost",size:"icon-sm"}),"ml-auto"),"aria-label":M("searchProject"),title:M("searchProject"),onClick:()=>{s.setSearchOpen(!0),requestAnimationFrame(()=>G.current?.focus())},children:(0,i.jsx)(d.A,{className:"size-3.5"})})]});return(0,i.jsxs)("section",{ref:F,className:"flex h-full min-h-0 flex-col bg-sidebar","aria-label":M("projectFiles",{name:t}),onKeyDown:e=>{!ei||"Escape"!==e.key||(e.stopPropagation(),e.nativeEvent.isComposing||Z||(e.preventDefault(),er()))},children:[ei?(0,i.jsx)(T,{input:$.search,inputRef:G,invalid:"error"===$.search.status,onQueryChange:e=>s.setSearchQuery(e),onOptionsChange:e=>s.setSearchOptions(e),onComposingChange:es,onClose:er,onOpenFirst:()=>{let e=s.state.search;if("ready"!==e.status)return;let t=e.fileMatches[0],i=e.contentMatches[0];t?ex(t.path):i&&ex(i.path,i.line)},onFocusResults:()=>Q.current?.querySelector("button")?.focus()}):(0,i.jsxs)("div",{className:"border-b px-1",children:[j?(0,i.jsxs)("div",{className:"flex min-h-7 min-w-0 items-center gap-1",children:[(0,i.jsx)(I.J,{cwd:e,path:"",type:"directory",onReveal:s.canReveal?(e,t)=>s.revealFile(e,t):void 0,trigger:v?(0,i.jsx)("div",{className:"flex min-w-0 flex-1",children:v}):(0,i.jsxs)("div",{tabIndex:0,className:"flex min-w-0 flex-1 items-baseline gap-1",children:[(0,i.jsx)("p",{className:"shrink-0 truncate text-xs font-semibold",title:t,children:t}),(0,i.jsx)("span",{className:"text-xs text-muted-foreground",children:"\xb7"}),(0,i.jsx)("p",{className:"min-w-0 truncate font-mono text-xs text-muted-foreground",title:e,children:(S=e.replaceAll("\\","/").split("/").filter(Boolean)).length<=2?e:`…/${S.slice(-2).join("/")}`})]})}),eD]}):null,j?eA:(0,i.jsx)(I.J,{cwd:e,path:"",type:"directory",onReveal:s.canReveal?(e,t)=>s.revealFile(e,t):void 0,trigger:eA})]}),ei?(0,i.jsx)(L,{search:$.search,resultsRef:Q,activePath:$.activeDiff?null:$.activePath,onOpen:ex,wrapFile:(e,t,s)=>ey(e,s,eu.get(e)??null,!1,t),renderFileIcon:Y,fileDecoration:e=>{let t=eu.get(e)??null;return{className:V(t),badge:t?(0,E.XB)(t.change):void 0}}},JSON.stringify([$.search.query,$.search.scope,$.search.caseSensitive,$.search.wholeWord,$.search.regex])):(0,i.jsxs)(N.V,{className:(0,f.cn)(_().tree,"min-h-0 flex-1"),viewportClassName:"py-0.5",viewportRef:J,onViewportScroll:e=>s.setTreeScrollTop(e.currentTarget.scrollTop),children:[ec.filter(e=>"unavailable"===e.state).map(e=>"unavailable"===e.state?(0,i.jsxs)("p",{role:"alert",className:"mx-2 mb-1 break-words rounded-md bg-muted px-2 py-2 text-sm text-destructive",children:[e.root||t,":",(0,p.fD)(e.message,P)]},e.root):null),O?.snapshot.status==="error"?(0,i.jsx)("p",{className:"mx-2 mb-1 rounded-md bg-muted px-2 py-2 text-sm text-destructive",children:O.snapshot.error}):null,"repository"===ez?(D=ec.some(e=>""===e.root),A=O?.changesOnly?ec.filter(e=>"unavailable"===e.state||e.changes.length>0):ec,(0,i.jsxs)("div",{className:"px-1",children:[D?null:eC(null,"",t),A.map(e=>eC(e,e.root,(0,E.Hj)(t,e.root))),O?.changesOnly&&0===A.length?(0,i.jsx)("p",{className:"px-2 py-5 text-center text-xs text-muted-foreground",children:M("noChangedFiles")}):null]})):(()=>{if(O?.changesOnly){let e=(0,W.OA)(ed.map(e=>e.projectPath));return(0,i.jsx)(b,{className:"rounded-none border-0 bg-transparent",selectedPath:$?.activeDiff?(0,W.Im)("file",(0,E.oW)($.activeDiff.repositoryRoot,$.activeDiff.path)):$.activePath?(0,W.Im)("file",$.activePath):void 0,onSelect:eN,children:ed.length>0?ek(e,""):(0,i.jsx)("p",{className:"px-2 py-5 text-center text-xs text-muted-foreground",children:ec.some(e=>"unavailable"===e.state)?M("incompleteRepository"):M("noChangedFiles")})})}return(0,i.jsx)(b,{className:"rounded-none border-0 bg-transparent",selectedPath:$.activePath?(0,W.Im)("file",$.activePath):void 0,onSelect:eN,children:ej("",null,!1)})})()]})]})}},13464:(e,t,s)=>{"use strict";s.d(t,{S6:()=>i,dQ:()=>r,hD:()=>a});let i="relative flex min-h-7 cursor-pointer items-center gap-2 rounded-md px-2 py-1 text-sm leading-5 outline-none select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",r="data-[variant=destructive]:text-destructive data-[variant=destructive]:data-highlighted:bg-destructive/10 data-[variant=destructive]:data-highlighted:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive",a="z-50 max-h-(--available-height) min-w-60 max-w-[calc(100vw-2rem)] origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-md outline-none transition-[opacity,transform] duration-100 ease-out data-starting-style:scale-[0.98] data-starting-style:opacity-0 data-ending-style:scale-[0.98] data-ending-style:opacity-0 motion-reduce:transition-none"},14512:(e,t,s)=>{"use strict";s.d(t,{L:()=>r});var i=s(69266);function r(e,t,s=!0){(0,i.useEffect)(()=>{let i;if(!s)return;let r=()=>"visible"===document.visibilityState&&!!e.current?.getClientRects().length&&!e.current?.closest('[inert], [aria-hidden="true"]'),a=()=>{i=void 0,r()&&t()},n=()=>{void 0!==i&&clearTimeout(i),i=void 0,r()&&(i=setTimeout(a,150))};return a(),window.addEventListener("focus",n),document.addEventListener("visibilitychange",n),()=>{void 0!==i&&clearTimeout(i),window.removeEventListener("focus",n),document.removeEventListener("visibilitychange",n)}},[s,e,t])}},15265:(e,t,s)=>{"use strict";s.d(t,{fD:()=>a,qf:()=>r});var i=s(38979);let r=i.KC([i.Yj(),i.Ik({default:i.Yj(),translations:i.g1(i.Yj().min(1).max(35),i.Yj()).refine(e=>Object.keys(e).length<=16,"too many translations")}).strict()]);function a(e,t){return"string"==typeof e?e:e.translations[t]??e.translations[t.split("-")[0]]??e.default}},17511:(e,t,s)=>{"use strict";s.d(t,{Ik:()=>p,MG:()=>c,Sq:()=>u,iV:()=>m,oR:()=>f});var i=s(7962);s(69266);var r=s(73392),a=s(49426),n=s(86963),o=s(73429),l=s(68017);function c({className:e,...t}){return(0,i.jsx)("div",{"data-slot":"input-group",role:"group",className:(0,a.cn)("group/input-group relative flex min-h-8 w-full min-w-0 items-center rounded-lg border border-input bg-card transition-colors duration-150 outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-muted has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:outline-2 has-[[data-slot=input-group-control]:focus-visible]:outline-solid has-[[data-slot=input-group-control]:focus-visible]:-outline-offset-2 has-[[data-slot=input-group-control]:focus-visible]:outline-ring has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",e),...t})}let d=(0,r.F)("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]","block-start":"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function u({className:e,align:t="inline-start",...s}){return(0,i.jsx)("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:(0,a.cn)(d({align:t}),e),onClick:e=>{e.target.closest("button")||e.currentTarget.parentElement?.querySelector("input")?.focus()},...s})}let h=(0,r.F)("flex items-center gap-2 text-sm shadow-none",{variants:{size:{xs:"min-h-7 gap-2 rounded-md px-2",sm:"","icon-xs":"size-7 rounded-md p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function p({className:e,type:t="button",variant:s="ghost",size:r="xs",...o}){return(0,i.jsx)(n.$,{type:t,"data-size":r,variant:s,className:(0,a.cn)(h({size:r}),e),...o})}function m({className:e,...t}){return(0,i.jsx)(o.p,{"data-slot":"input-group-control",className:(0,a.cn)("flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:outline-none focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0",e),...t})}function f({className:e,...t}){return(0,i.jsx)(l.T,{"data-slot":"input-group-control",className:(0,a.cn)("flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:outline-none focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0",e),...t})}},18302:(e,t,s)=>{"use strict";function i(e,t,s){e.addCommand(t,s,"editorTextFocus && !findWidgetVisible && !suggestWidgetVisible && !renameInputVisible && !parameterHintsVisible && !referenceSearchVisible && !editorHoverVisible && !editorHoverFocused")}s.d(t,{e:()=>i})},20476:(e,t,s)=>{"use strict";s.d(t,{Wq:()=>d,ku:()=>h,lU:()=>u});var i=s(67765);let r="pi-super:image-preview-mode",a="compressed",n=new Set,o=a,l=!1;function c(){if(!l){l=!0;try{let e=i.p$.safeParse(window.localStorage.getItem(r));o=e.success?e.data:a}catch{o=a}}}function d(){return c(),o}function u(e){if(c(),o!==e){o=e;try{window.localStorage.setItem(r,e)}catch{}for(let e of[...n])e()}}function h(e){return n.add(e),()=>n.delete(e)}},24985:(e,t,s)=>{"use strict";s.d(t,{FJ:()=>b,Ww:()=>o,cP:()=>l,gf:()=>x,u2:()=>f,y2:()=>n,yl:()=>m,zp:()=>h,zt:()=>g});var i=s(38979),r=s(15265),a=s(67765);let n=100,o=a.rh,l=i.Yj().trim().min(1).max(1024),c=i.gM("type",[i.Ik({type:i.eu("branch"),name:l}).strict(),i.Ik({type:i.eu("detached"),commit:i.Yj().regex(/^[0-9a-f]{40,64}$/)}).strict()]),d=i.k5(["added","modified","deleted","renamed","unmerged","untracked"]),u=i.Ik({path:a._g,oldPath:a._g.nullable(),indexStatus:d.nullable(),worktreeStatus:d.nullable()}).strict(),h=i.Ik({root:o,state:i.eu("ready"),head:c,changes:i.YO(u).max(5e4)}).strict(),p=i.Ik({root:o,state:i.eu("unavailable"),message:r.qf.refine(e=>("string"==typeof e?[e]:[e.default,...Object.values(e.translations)]).every(e=>e.length>0&&e.length<=2e3))}).strict(),m=i.gM("state",[h.omit({changes:!0}),p]),f=i.gM("state",[h,p]),g=i.gM("type",[i.Ik({type:i.eu("local"),name:l}).strict(),i.Ik({type:i.eu("remote"),name:l}).strict()]),x=i.Ik({head:c,recent:i.YO(l).max(5),local:i.YO(l).max(1e4),remote:i.YO(l).max(1e4)}).strict(),v=i.Ik({path:a._g,content:i.Yj()}).strict(),b=i.gM("kind",[i.Ik({kind:i.eu("text"),original:v,modified:v}).strict(),i.Ik({kind:i.eu("binary")}).strict(),i.Ik({kind:i.eu("too_large")}).strict()])},28460:(e,t,s)=>{"use strict";s.d(t,{Cp:()=>g,ph:()=>x,Tk:()=>f});var i=s(93119),r=s(93320),a=s(29029),n=s(56592);class o{constructor(e,t){this.cwd=e,this.reader=t,this.state={snapshot:{status:"idle",repositories:[],error:null},layout:"directory",changesOnly:!1,expandedRepositories:new Set},this.listeners=new Set,this.revision=0,this.request=null,this.disposed=!1,this.subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e)),this.getRevision=()=>this.revision}getWorkspace(e){return e===this.cwd?this.state:null}ensureSnapshot(e){return e!==this.cwd||"ready"===this.state.snapshot.status||this.request?Promise.resolve():this.load(!1)}refreshSnapshot(e){return e===this.cwd?this.load(!0):Promise.resolve()}setLayout(e,t){this.state.layout=t,this.publish()}setChangesOnly(e,t){this.state.changesOnly=t,this.publish()}toggleRepository(e,t){let s=new Set(this.state.expandedRepositories);s.has(t)?s.delete(t):s.add(t),this.state.expandedRepositories=s,this.publish()}dispose(){this.disposed=!0,this.request?.abort(),this.request=null,this.listeners.clear()}async load(e){if(this.disposed||this.request)return;let t=new AbortController;this.request=t,"ready"!==this.state.snapshot.status&&(this.state.snapshot={...this.state.snapshot,status:"loading",error:null},this.publish());try{let s=await this.reader.snapshot(t.signal,e);if(this.request!==t)return;this.state.snapshot={status:"ready",repositories:s.repositories,error:null}}catch(e){if(this.request!==t)return;this.state.snapshot={...this.state.snapshot,status:"error",error:e instanceof Error?e.message:"读取 Git 状态失败"}}this.request===t&&(this.request=null,this.publish())}publish(){if(!this.disposed)for(let e of(this.revision+=1,this.listeners))e()}}var l=s(20476),c=s(42643),d=s(73230),u=s(82075);function h(e,t){return(0,d.B)({msg:c.p["zh-CN"][e],i18n:{key:`projectHistory:${e}`,...t?{params:t}:{}}})}function p(){return{status:"idle",data:null,error:null}}class m{constructor(e,t){this.reader=e,this.files=t,this.state={repositoryRoot:null,mode:"history",tip:"HEAD",base:"",target:"HEAD",strategy:"merge-base",query:"",author:"",authorSuggestions:[],selectedCommit:null,selectedChangePath:null,branches:p(),log:p(),changes:p()},this.scroll={log:0,changes:0},this.listeners=new Set,this.requests=new Map,this.revision=0,this.disposed=!1,this.logPage=1,this.changesPage=1,this.range=null,this.selection=null,this.restoredCommit=null,this.restoredChangePath=null,this.restoredChangesScroll=null,this.queryTimer=null,this.collapsedDirectories=new Set,this.changeTree=(0,u.OA)([]),this.changeRows=[],this.changeRowHeight=36,this.subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e)),this.getRevision=()=>this.revision}getChangeRows(){return this.changeRows}restoreBrowsing(e,t=!0){Object.assign(this.state,{repositoryRoot:e.repositoryRoot,mode:e.mode,tip:e.tip,base:e.base,target:e.target,strategy:e.strategy,query:e.query,author:e.author}),this.scroll.log=e.logScroll,this.restoredChangesScroll=e.changesScroll,this.restoredCommit=e.selectedCommit,this.restoredChangePath=e.selectedChangePath,t&&null!==e.repositoryRoot&&(this.loadBranches(),this.reload())}selectChange(e){this.state.changes.data?.items.some(t=>t.path===e)&&(this.state.selectedChangePath=e,this.publish())}toggleChangeDirectory(e){let t=this.changeRows.find(t=>t.directory?.path===e);if(t?.directory){if(t.expanded)this.collapsedDirectories.add(e);else for(let e of t.directory.paths)this.collapsedDirectories.delete(e);this.rebuildChangeRows(),this.publish()}}setScroll(e,t){this.scroll[e]=t}setChangeRowHeight(e){this.changeRowHeight!==e&&(this.scroll.changes=this.scroll.changes/this.changeRowHeight*e,this.changeRowHeight=e,this.publish())}setRepository(e){if(e===this.state.repositoryRoot){"idle"===this.state.branches.status&&(this.loadBranches(),this.reload());return}this.cancel("branches"),this.state.repositoryRoot=e,this.state.tip=this.state.target="HEAD",this.state.base="",this.state.author="",this.state.authorSuggestions=[],this.state.branches=p(),this.resetSelection(),this.loadBranches(),this.reload()}setMode(e){this.state.mode!==e&&(this.state.mode=e,this.resetSelection(),this.reload())}setRevision(e,t){this.state[e]!==t&&(this.state[e]=t,this.resetSelection(),this.reload())}setStrategy(e){this.state.strategy!==e&&(this.state.strategy=e,this.resetSelection(),this.reload())}setQuery(e){this.setLogFilter("query",e)}setAuthor(e){this.setLogFilter("author",e)}setLogFilter(e,t){this.state[e]=t,this.resetSelection(),this.queryTimer=setTimeout(()=>{this.queryTimer=null,this.reload()},220)}refresh(){this.resetSelection(),this.loadBranches(),this.reload()}async reload(){if(!this.disposed&&null!==this.state.repositoryRoot){if("compare"===this.state.mode)return this.state.base?void await this.loadChanges({base:this.state.base,target:this.state.target,strategy:this.state.strategy},1,!0):void this.publish();await this.loadLog(1)}}selectCommit(e,t){let s="string"==typeof e?e:e.oid;this.state.selectedCommit=s,this.scroll.changes=0,this.loadChanges({commit:s,...t?{parent:t}:{}},1)}showAggregate(){this.range&&(this.state.selectedCommit=null,this.loadChanges(this.range,1))}loadMoreLog(){("ready"===this.state.log.status||"error"===this.state.log.status)&&this.state.log.data?.hasMore&&!(this.state.log.data.items.length>=2e3)&&this.loadLog(this.logPage+1)}loadMoreChanges(){this.selection&&"ready"===this.state.changes.status&&this.state.changes.data?.hasMore&&this.loadChanges(this.selection,this.changesPage+1)}openChange(e){if(null===this.state.repositoryRoot)return;let t=this.state.changes.data,s=t?.items.find(t=>t.path===e);if(!t||!s)return;this.state.selectedChangePath=e,this.publish();let{original:i,target:r}=t.comparison,a=i?i.slice(0,8):h("emptyRevision"),n=h(this.state.selectedCommit||"merge-base"!==this.state.strategy?"historyDiffDirect":"historyDiffAncestor",{left:a,target:r.slice(0,8)});this.files.openDiff(this.state.repositoryRoot,e,{baseCommit:i,targetCommit:r,...s.oldPath?{oldPath:s.oldPath}:{}},n)}dispose(){for(let e of(this.disposed=!0,this.queryTimer&&clearTimeout(this.queryTimer),this.requests.values()))e.abort();this.requests.clear(),this.resetChangeTree(),this.listeners.clear()}async loadBranches(){let e=this.state.repositoryRoot;if(null===e||this.disposed)return;let t=this.begin("branches");this.state.branches={status:"loading",data:this.state.branches.data,error:null},this.publish();try{let s=await this.reader.branches(e,t.signal);if(!this.current("branches",t))return;this.state.branches={status:"ready",data:s,error:null}}catch(e){if(!this.current("branches",t))return;this.state.branches={status:"error",data:null,error:this.error(e)}}this.requests.delete("branches"),this.publish()}async loadLog(e){let t=this.state.repositoryRoot;if(this.disposed||null===t)return;let s=e>1?this.state.log.data:null,i=s?.tip??("compare"===this.state.mode?this.range?.target:this.state.tip),r=s?.exclude??("compare"===this.state.mode?this.range?.base:void 0);if(!i)return;let a=this.begin("log");this.state.log={status:"loading",data:s,error:null},this.publish();try{let n=await this.reader.log(t,{tip:i,...r?{exclude:r}:{},query:this.state.query,...this.state.author.trim()?{author:this.state.author.trim()}:{},page:{index:e,size:50}},a.signal);if(!this.current("log",a))return;for(let{author:t}of(this.logPage=e,n.items))t&&this.state.authorSuggestions.length<200&&!this.state.authorSuggestions.includes(t)&&this.state.authorSuggestions.push(t);if(this.state.log={status:"ready",data:{...n,items:[...s?.items??[],...n.items].slice(0,2e3)},error:null},1===e&&n.items[0]){let e=n.items.find(e=>e.oid===this.restoredCommit);this.restoredCommit=null,e?(this.state.selectedCommit=e.oid,this.loadChanges({commit:e.oid},1)):"history"===this.state.mode&&this.selectCommit(n.items[0])}}catch(e){if(!this.current("log",a))return;this.state.log={status:"error",data:s,error:this.error(e)}}this.requests.delete("log"),this.publish()}async loadChanges(e,t,s=!1){let i=this.state.repositoryRoot;if(this.disposed||null===i)return;let r=this.begin("changes"),a=t>1?this.state.changes.data:null;1===t&&this.resetChangeTree(),this.selection=e,this.state.changes={status:"loading",data:a,error:null},this.publish();try{let n=await this.reader.changes(i,{selection:e,page:{index:t,size:200}},r.signal);if(!this.current("changes",r))return;this.changesPage=t;let o=[...a?.items??[],...n.items];this.state.changes={status:"ready",data:{...n,items:o},error:null},this.changeTree=(0,u.OA)(o.map(e=>e.path)),null!==this.restoredChangesScroll&&(this.scroll.changes=this.restoredChangesScroll,this.restoredChangesScroll=null),this.rebuildChangeRows(),this.restoredChangePath&&o.some(e=>e.path===this.restoredChangePath)&&(this.state.selectedChangePath=this.restoredChangePath,this.restoredChangePath=null),this.selection="commit"in e?{commit:n.comparison.target,...n.commit?.selectedParent?{parent:n.commit.selectedParent}:{}}:{base:n.comparison.base,target:n.comparison.target,strategy:e.strategy},s&&"base"in this.selection&&(this.range=this.selection,this.loadLog(1))}catch(e){if(!this.current("changes",r))return;this.state.changes={status:"error",data:a,error:this.error(e)}}this.requests.delete("changes"),this.publish()}resetSelection(){this.restoredCommit=null,this.restoredChangePath=null,this.restoredChangesScroll=null,this.queryTimer&&clearTimeout(this.queryTimer),this.queryTimer=null,this.scroll.log=this.scroll.changes=0,this.cancel("log"),this.cancel("changes"),this.range=null,this.selection=null,this.state.selectedCommit=null,this.state.log=p(),this.state.changes=p(),this.resetChangeTree(),this.publish()}resetChangeTree(){this.collapsedDirectories.clear(),this.changeTree=(0,u.OA)([]),this.changeRows=[],this.state.selectedChangePath=null,this.scroll.changes=0}rebuildChangeRows(){let e=this.changeRowHeight,t=Math.floor(this.scroll.changes/e),s=this.changeRows[t],i=this.scroll.changes%e;this.changeRows=(0,u.qV)(this.changeTree,this.collapsedDirectories);let r=s?this.changeRows.findIndex(e=>e.key===s.key):-1;this.scroll.changes=r>=0?r*e+i:Math.min(this.scroll.changes,Math.max(0,(this.changeRows.length-1)*e))}begin(e){this.cancel(e);let t=new AbortController;return this.requests.set(e,t),t}cancel(e){this.requests.get(e)?.abort(),this.requests.delete(e)}current(e,t){return!this.disposed&&this.requests.get(e)===t}error(e){return e instanceof Error?e.message:h("historyReadFailed")}publish(){if(!this.disposed)for(let e of(this.revision+=1,this.listeners))e()}}function f(e,t){return(0,r.QL)(e,{path:"/api/pi/directories/list",request:a.FH,response:a.N$},{forceRefresh:!1},t)}function g(e,t,s){return(0,r.QL)(e,{path:"/api/pi/directory-entries/list",request:a.rB,response:a.rn},{cwd:t},s)}function x(e,t,s,a,c,d={}){let u=(0,r.Y4)(e,{cwd:t},d.onUnauthorized),h=new n.h(t,u,{imagePreviewMode:l.Wq,onNotice:s,reveal:(s,r="file")=>(0,i.P)(e,{cwd:t},s,r),maxTabs:20}),p=new o(t,u),f=new m(u,h),g=!1;return{files:h,git:p,history:f,restore(){if(!g&&(g=!0,p.setLayout(t,c.treeLayout),a)){for(let e of(p.setChangesOnly(t,a.changesOnly),a.expandedRepositories))p.toggleRepository(t,e);h.restoreBrowsing(a),f.restoreBrowsing(a.history,!d.lazyHistory)}},dispose(){f.dispose(),p.dispose(),h.dispose()}}}},29029:(e,t,s)=>{"use strict";s.d(t,{FH:()=>l,N$:()=>c,qY:()=>f,rB:()=>u,rn:()=>h});var i=s(38979),r=s(66453),a=s(70698),n=s(80077);let o=i.Ik({cwd:r.m4,sessionCount:i.ai().int().nonnegative(),updatedAt:a.k}).strict(),l=i.Ik({forceRefresh:i.zM().default(!1)}).strict(),c=i.Ik({directories:i.YO(o)}).strict();i.Ik({cwd:r.m4,ignored:i.zM()}).strict(),i.Ik({}).strict();let d=i.Ik({cwd:r.m4,name:i.Yj().trim().min(1)}).strict(),u=i.Ik({cwd:r.m4.nullable()}).strict(),h=i.Ik({cwd:r.m4.nullable(),parentCwd:r.m4.nullable(),directories:i.YO(d)}).strict(),p=n.Jk,m=i.Ik({sessionId:r.$E,cwd:r.m4,name:i.Yj().nullable(),createdAt:a.k,updatedAt:a.k,messageCount:i.ai().int().nonnegative(),userMessageCount:i.ai().int().nonnegative(),firstMessage:i.Yj().max(160),matches:i.YO(p).min(1).max(4).nullable()}).strict();n.Gm.extend({cwd:r.m4,forceRefresh:i.zM().default(!1)});let f=i.Ik({cwd:r.m4,sessions:i.YO(m)}).strict();i.Ik({cwd:r.m4,sessionId:r.$E,query:i.Yj().trim().max(120).default(""),page:i.Ik({index:i.ai().int().positive(),size:i.ai().int().positive().max(50)}).strict()}).strict();let g=i.Ik({entryId:r.Rv,timestampMs:a.k,text:i.Yj()}).strict();i.Ik({page:i.Ik({index:i.ai().int().positive(),size:i.ai().int().positive(),total:i.ai().int().nonnegative()}).strict(),messages:i.YO(g)}).strict()},35842:(e,t,s)=>{"use strict";s.d(t,{X:()=>x});var i=s(7962),r=s(49362),a=s(69266),n=s(78121),o=s(49426),l=s(86963),c=s(69272),d=s(1364),u=s(56592),h=s(73165),p=s(35989);let m=[{scope:"current",label:"closeTab"},{scope:"others",label:"closeOtherTabs"},{scope:"right",label:"closeRightTabs"},{scope:"left",label:"closeLeftTabs"},{scope:"all",label:"closeAllTabs"}];function f(e,t){let s=e.replaceAll("\\","/").split("/"),i=t.map(e=>e.replaceAll("\\","/")).filter(e=>e!==s.join("/"));for(let e=1;e<s.length;e++){let t=s.slice(-e).join("/");if(!i.some(s=>s.split("/").slice(-e).join("/")===t))return t}return s.join("/")}function g(e,t){let s=t.offsetLeft,i=s+t.offsetWidth;s<e.scrollLeft?e.scrollLeft=s:i>e.scrollLeft+e.clientWidth&&(e.scrollLeft=i-e.clientWidth)}function x({cwd:e,gitRuntime:t,paths:s,activePath:v,diffs:b,activeDiff:y,mobile:w,actions:j,onActivate:k,onClose:N}){let{t:C}=(0,n.Bd)("projectFiles");(0,a.useSyncExternalStore)(t.subscribe,t.getRevision,t.getRevision);let S=t.getWorkspace(e)?.snapshot,R=(0,a.useRef)(null),z=(0,a.useRef)(!1),D=[...s,...b.map(e=>[e.repositoryRoot,e.path].filter(Boolean).join("/"))],A=s.map(e=>({target:e,key:`file:${e}`,path:e,label:f(e,D),title:e,testId:`file-tab-${e}`}));for(let e of b){let t=[e.repositoryRoot,e.path].filter(Boolean).join("/"),s=e.comparison,i=s?`${s.baseCommit?.slice(0,7)??"∅"} → ${s.targetCommit.slice(0,7)}`:"",r=(0,u.Q)(e);A.push({target:e,key:`diff:${r}`,path:t,label:`${f(t,D)} \xb7 Diff`,revisions:i,title:[t,s?.oldPath,s?`${s.baseCommit??"∅"} → ${s.targetCommit}`:null].filter(Boolean).join("\n"),testId:`file-diff-tab-${t}${s?`-${r}`:""}`})}let M=y?`diff:${(0,u.Q)(y)}`:`file:${v}`;return((0,a.useLayoutEffect)(()=>{let e=R.current;if(!e)return;let t=()=>{let t=e.querySelector('[aria-selected="true"]')?.closest("[data-file-tab]");t&&g(e,t)};t();let s=new ResizeObserver(t);return s.observe(e),()=>s.disconnect()},[M,b,s]),0===A.length)?null:(0,i.jsxs)("div",{className:"flex min-w-0 max-w-full shrink-0 flex-col border-b bg-muted","data-testid":"file-tabs",children:[(0,i.jsx)("div",{className:"min-w-0 max-w-full",children:(0,i.jsx)("div",{ref:R,role:"tablist","aria-label":C("openFiles"),"aria-orientation":"horizontal",className:"relative flex min-w-0 flex-nowrap items-stretch overflow-x-auto overflow-y-hidden overscroll-x-contain [scrollbar-color:var(--border)_transparent] [scrollbar-width:thin]",children:A.map((t,s)=>{let a=t.key===M,n="string"!=typeof t.target,u=n||S?.status!=="ready"?void 0:(0,p.lN)(e,t.path,S.repositories)?.change,f=n?C("closeDiff",{name:`${t.path.split("/").at(-1)}${t.revisions?` \xb7 ${t.revisions}`:""}`}):C("closeFile",{name:t.path.split("/").at(-1)});return(0,i.jsxs)(d.tz,{onOpenChange:(e,t)=>{e&&"pointerType"in t.event&&"touch"===t.event.pointerType&&(z.current=!0)},children:[(0,i.jsxs)(d.Rc,{render:(0,i.jsx)("div",{"data-file-tab":!0,"data-testid":t.testId,title:t.title,className:(0,o.cn)("flex shrink-0 items-center border-r text-sm transition-colors",w?"h-9":"h-8",t.revisions?"max-w-[min(100%,20rem)]":"max-w-[min(100%,15rem)]",a?"bg-background text-foreground shadow-[inset_0_-2px_0_var(--foreground)]":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),onPointerDown:e=>{"touch"===e.pointerType&&(z.current=!1)}}),children:[(0,i.jsxs)("button",{type:"button",role:"tab","aria-selected":a,className:"flex h-full min-w-0 flex-1 cursor-pointer items-center gap-2 pl-3 pr-1 outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",onFocus:e=>{let t=e.currentTarget.closest("[data-file-tab]");R.current&&t&&g(R.current,t)},onClick:()=>{if(z.current){z.current=!1;return}k(t.target)},onKeyDown:e=>{if("F10"===e.key&&e.shiftKey){e.preventDefault(),e.stopPropagation();let t=e.currentTarget.closest('[data-slot="context-menu-trigger"]');if(t){let e=t.getBoundingClientRect();t.dispatchEvent(new MouseEvent("contextmenu",{bubbles:!0,cancelable:!0,clientX:e.left+e.width/2,clientY:e.top+e.height/2}))}return}let t="ArrowRight"===e.key||"ArrowDown"===e.key?1:"ArrowLeft"===e.key||"ArrowUp"===e.key?-1:0;if(!t)return;e.preventDefault();let i=(s+t+A.length)%A.length,r=R.current?.querySelectorAll('[role="tab"]');r?.[i]?.focus({preventScroll:!0})},children:[(0,i.jsx)(c.s,{path:t.path,className:"size-4 shrink-0"}),(0,i.jsx)("span",{className:(0,o.cn)("truncate",u&&(0,p.iH)(u)),children:t.label}),t.revisions?(0,i.jsx)("span",{className:"max-w-36 truncate font-mono text-xs",children:t.revisions}):null,u?(0,i.jsx)("span",{className:(0,o.cn)("shrink-0 text-xs",(0,p.iH)(u)),"aria-label":C("gitStatus",{status:(0,p.XB)(u)}),children:(0,p.XB)(u)}):null]}),(0,i.jsx)(l.$,{variant:"ghost",size:"icon",className:(0,o.cn)("shrink-0 rounded-none",w&&"size-9"),"data-testid":n?t.testId.replace("file-diff-tab-","file-diff-tab-close-"):`file-tab-close-${t.path}`,"aria-label":f,onClick:e=>{if(e.stopPropagation(),z.current){z.current=!1;return}N(t.target,"current")},children:(0,i.jsx)(r.A,{className:"size-3.5"})})]}),(0,i.jsx)(h.D,{children:m.map(({scope:e,label:r})=>(0,i.jsxs)("span",{children:["all"===e?(0,i.jsx)(d.K5,{}):null,(0,i.jsx)(d.kt,{disabled:"others"===e?A.length<=1:"left"===e?0===s:"right"===e&&s===A.length-1,onClick:()=>{z.current=!1,N(t.target,e)},children:C(r)})]},e))})]},t.key)})})}),j?(0,i.jsx)("div",{className:(0,o.cn)("flex min-h-9 min-w-0 max-w-full flex-wrap items-center justify-end gap-1 overflow-x-auto border-t bg-background p-1 [&>*]:min-w-0 [&>*]:max-w-full [&>span]:break-all [&>[role=group]]:flex-wrap",w&&"[&_button]:min-h-9 [&_button]:min-w-9"),role:"group","aria-label":C("fileActions"),children:j}):null]})}},35907:e=>{e.exports={document:"l3-markdown-preview_document__tuJfC"}},35989:(e,t,s)=>{"use strict";s.d(t,{A_:()=>d,Hj:()=>l,XB:()=>u,eP:()=>m,iH:()=>h,lN:()=>p,oW:()=>o,oY:()=>n,ws:()=>c});var i=s(15265),r=s(93540),a=s(82075);function n(e){let t=new Map;for(let s of e){let e=s.split("/").filter(Boolean),i=t,r="";for(let[t,a]of e.entries()){r=r?`${r}/${a}`:a;let n=i.get(a);n||(n={name:a,path:r,branchName:null,children:new Map},i.set(a,n)),t===e.length-1&&(n.branchName=s),i=n.children}}return function e(t){return[...t].sort((e,t)=>e.name.localeCompare(t.name,void 0,{numeric:!0,sensitivity:"base"})).map(t=>({name:t.name,path:t.path,branchName:t.branchName,children:e(t.children.values())}))}(t.values())}function o(e,t){return(0,a._J)(e,t)}function l(e,t){return t.split("/").at(-1)||e}function c(e){return"branch"===e.type?e.name:`@ ${e.commit.slice(0,7)}`}function d(e,t,s="en"){if(0===t.length)return null;let a=r.C[s];if(1===t.length){let r=t[0],n=l(e,r.root);if("unavailable"===r.state){let e=a.gitUnavailable;return{full:r.root?`${n} \xb7 ${e}`:e,compact:"Git !",title:`${n}${"en"===s?": ":":"}${(0,i.fD)(r.message,s)}`,diverged:!0}}let o=c(r.head);return{full:r.root?`${n} \xb7 ${o}`:o,compact:o,title:`${a.gitBranches}: ${n} \xb7 ${o}`,diverged:"detached"===r.head.type}}let n=`${t.length} ${a.repositoriesUnit}`;return{full:n,compact:`Git ${t.length}`,title:`${a.gitBranches}: ${n}`,diverged:!1}}function u(e){let t=[e.indexStatus,e.worktreeStatus];return t.includes("unmerged")?"!":t.includes("deleted")?"D":t.includes("renamed")?"R":t.includes("added")?"A":t.includes("modified")?"M":"?"}function h(e){let t=u(e);return"D"===t?"text-muted-foreground":"?"===t?"text-red-600 dark:text-red-400":"A"===t?"text-emerald-600 dark:text-emerald-400":"!"===t?"text-violet-600 dark:text-violet-400":"text-blue-600 dark:text-blue-400"}function p(e,t,s){if(/^(?:[a-z]:|\/|\\\\)/i.test(t))return null;let i=/^[a-z]:[\\/]/i.test(e)||e.startsWith("\\\\"),r=e=>i?e.toLowerCase():e,a=[...s].sort((e,t)=>t.root.length-e.root.length).find(e=>!e.root||r(t).startsWith(`${r(e.root)}/`));if(!a)return null;let n=a.root?t.slice(a.root.length+1):t;return{repository:a,path:n,change:"ready"===a.state?a.changes.find(e=>r(e.path)===r(n)):void 0}}function m(e){return e.flatMap(e=>"ready"===e.state?e.changes.map(t=>({repositoryRoot:e.root,repository:e,path:t.path,projectPath:o(e.root,t.path),change:t})):[])}},36510:(e,t,s)=>{"use strict";s.d(t,{z:()=>r});let i=`<script>
2
2
  window.addEventListener('keydown', function (event) {
3
3
  if (event.defaultPrevented || event.isComposing || event.repeat) return;
4
4
  if (event.key === 'Escape' && !event.ctrlKey && !event.altKey && !event.metaKey && !event.shiftKey) {
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[18039],{49426:(e,r,t)=>{"use strict";t.d(r,{cn:()=>a});var n=t(77694),i=t(37810);function a(...e){return(0,i.QP)((0,n.$)(e))}},50771:(e,r,t)=>{Promise.resolve().then(t.bind(t,84845))},66999:(e,r,t)=>{"use strict";t.d(r,{L1ErrorPage:()=>s});var n=t(7962),i=t(81881),a=t.n(i),o=t(78121),d=t(86963);function s({retry:e,notFound:r=!1}){let{t}=(0,o.Bd)("common");return(0,n.jsx)("main",{className:"flex min-h-[var(--pi-desk-content-height)] items-center justify-center bg-background p-4 text-foreground",children:(0,n.jsxs)("div",{className:"w-full max-w-md space-y-4 text-center",children:[(0,n.jsx)("h1",{className:"text-xl font-semibold",children:t(r?"notFound":"pageError")}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[e?(0,n.jsx)(d.$,{type:"button",onClick:e,children:t("recover")}):null,(0,n.jsx)(d.$,{variant:"outline",render:(0,n.jsx)(a(),{href:"/"}),children:t("backHome")})]})]})})}},84845:(e,r,t)=>{"use strict";t.r(r),t.d(r,{default:()=>o});var n=t(7962),i=t(69266),a=t(66999);function o({error:e,reset:r}){return(0,i.useEffect)(()=>{console.error("[Pi Desk][Page] 页面渲染失败",e)},[e]),(0,n.jsx)(a.L1ErrorPage,{retry:r})}},86963:(e,r,t)=>{"use strict";t.d(r,{$:()=>s,r:()=>d});var n=t(7962),i=t(28549),a=t(73392),o=t(49426);let d=(0,a.F)("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap cursor-pointer transition-colors duration-150 ease-out outline-none select-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-solid focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 aria-pressed:bg-accent aria-pressed:text-accent-foreground aria-pressed:hover:bg-[color-mix(in_oklab,var(--accent),var(--foreground)_5%)] 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 hover:bg-[color-mix(in_oklab,var(--primary),var(--primary-foreground)_8%)] active:bg-[color-mix(in_oklab,var(--primary),var(--primary-foreground)_14%)]",outline:"border-border bg-card text-card-foreground hover:bg-accent active:bg-[color-mix(in_oklab,var(--accent),var(--foreground)_6%)] aria-expanded:bg-accent aria-expanded:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklab,var(--secondary),var(--foreground)_8%)] active:bg-[color-mix(in_oklab,var(--secondary),var(--foreground)_14%)] aria-expanded:bg-accent aria-expanded:text-accent-foreground",ghost:"hover:bg-foreground/8 hover:text-foreground active:bg-foreground/14 aria-expanded:bg-accent aria-expanded:text-accent-foreground",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-foreground underline underline-offset-4 hover:text-muted-foreground"},size:{default:"min-h-8 gap-2 px-2 py-1",xs:"min-h-7 gap-2 rounded-md px-2 py-0.5 text-sm",sm:"min-h-7 gap-2 rounded-md px-2 py-0.5 text-sm",lg:"min-h-10 gap-2 px-3 py-2",icon:"size-8","icon-xs":"size-7 rounded-md","icon-sm":"size-7 rounded-md","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function s({className:e,variant:r="default",size:t="default",...a}){return(0,n.jsx)(i.$,{"data-slot":"button",className:(0,o.cn)(d({variant:r,size:t,className:e})),...a})}}},e=>{e.O(0,[57235,22092,4904,64444,77358],()=>e(e.s=50771)),_N_E=e.O()}]);