@shepai/cli 1.127.1 → 1.127.3-pr400.67a8317

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 (173) hide show
  1. package/dist/eslint.config.mjs +6 -0
  2. package/dist/packages/core/src/application/ports/output/services/git-pr-service.interface.d.ts +5 -2
  3. package/dist/packages/core/src/application/ports/output/services/git-pr-service.interface.d.ts.map +1 -1
  4. package/dist/packages/core/src/application/use-cases/agents/approve-agent-run.use-case.d.ts.map +1 -1
  5. package/dist/packages/core/src/application/use-cases/agents/approve-agent-run.use-case.js +7 -2
  6. package/dist/packages/core/src/application/use-cases/agents/reject-agent-run.use-case.d.ts.map +1 -1
  7. package/dist/packages/core/src/application/use-cases/agents/reject-agent-run.use-case.js +7 -2
  8. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/merge/merge.node.d.ts.map +1 -1
  9. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/merge/merge.node.js +1 -0
  10. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/merge-prompts.d.ts.map +1 -1
  11. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/merge-prompts.js +3 -2
  12. package/dist/packages/core/src/infrastructure/services/git/git-pr.service.d.ts.map +1 -1
  13. package/dist/packages/core/src/infrastructure/services/git/git-pr.service.js +2 -10
  14. package/dist/src/presentation/web/app/actions/approve-feature.d.ts.map +1 -1
  15. package/dist/src/presentation/web/app/actions/approve-feature.js +4 -9
  16. package/dist/src/presentation/web/app/actions/reject-feature.d.ts.map +1 -1
  17. package/dist/src/presentation/web/app/actions/reject-feature.js +4 -9
  18. package/dist/src/presentation/web/components/common/control-center-drawer/feature-drawer-client.d.ts.map +1 -1
  19. package/dist/src/presentation/web/components/common/control-center-drawer/feature-drawer-client.js +18 -0
  20. package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.d.ts.map +1 -1
  21. package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.js +2 -1
  22. package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-running-controls.d.ts +12 -0
  23. package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-running-controls.d.ts.map +1 -0
  24. package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-running-controls.js +19 -0
  25. package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-running-controls.stories.d.ts +26 -0
  26. package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-running-controls.stories.d.ts.map +1 -0
  27. package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-running-controls.stories.js +91 -0
  28. package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.d.ts.map +1 -1
  29. package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.js +3 -9
  30. package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.stories.d.ts +0 -4
  31. package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.stories.d.ts.map +1 -1
  32. package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.stories.js +0 -13
  33. package/dist/tsconfig.build.tsbuildinfo +1 -1
  34. package/package.json +5 -5
  35. package/web/.next/BUILD_ID +1 -1
  36. package/web/.next/build-manifest.json +2 -2
  37. package/web/.next/fallback-build-manifest.json +2 -2
  38. package/web/.next/prerender-manifest.json +3 -3
  39. package/web/.next/required-server-files.js +3 -3
  40. package/web/.next/required-server-files.json +3 -3
  41. package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +22 -22
  42. package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -1
  43. package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +1 -1
  44. package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +22 -22
  45. package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
  46. package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
  47. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +28 -28
  48. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  49. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  50. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +28 -28
  51. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
  52. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
  53. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +20 -20
  54. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
  55. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  56. package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +22 -22
  57. package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
  58. package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
  59. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +28 -28
  60. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  61. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  62. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +28 -28
  63. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
  64. package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
  65. package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +20 -20
  66. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  67. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  68. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +20 -20
  69. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
  70. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  71. package/web/.next/server/app/_global-error.html +2 -2
  72. package/web/.next/server/app/_global-error.rsc +1 -1
  73. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  74. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  75. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  76. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  77. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  78. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  79. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  80. package/web/.next/server/app/api/attachments/preview/route.js.nft.json +1 -1
  81. package/web/.next/server/app/api/evidence/route.js.nft.json +1 -1
  82. package/web/.next/server/app/api/graph-data/route.js.nft.json +1 -1
  83. package/web/.next/server/app/settings/page/server-reference-manifest.json +6 -6
  84. package/web/.next/server/app/settings/page.js.nft.json +1 -1
  85. package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  86. package/web/.next/server/app/skills/page/server-reference-manifest.json +6 -6
  87. package/web/.next/server/app/skills/page.js.nft.json +1 -1
  88. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  89. package/web/.next/server/app/tools/page/server-reference-manifest.json +6 -6
  90. package/web/.next/server/app/tools/page.js.nft.json +1 -1
  91. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  92. package/web/.next/server/app/version/page/server-reference-manifest.json +1 -1
  93. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  94. package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
  95. package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_adopt_page_actions_fbb88113.js +1 -1
  96. package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_adopt_page_actions_fbb88113.js.map +1 -1
  97. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
  98. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
  99. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_fdfbf5cc.js +1 -1
  100. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_fdfbf5cc.js.map +1 -1
  101. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_d8fa0b5f.js +1 -1
  102. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_d8fa0b5f.js.map +1 -1
  103. package/web/.next/server/chunks/ssr/[root-of-the-server]__02c84e6b._.js +1 -1
  104. package/web/.next/server/chunks/ssr/[root-of-the-server]__02c84e6b._.js.map +1 -1
  105. package/web/.next/server/chunks/ssr/[root-of-the-server]__06fef644._.js +1 -1
  106. package/web/.next/server/chunks/ssr/[root-of-the-server]__1aa034e9._.js +1 -1
  107. package/web/.next/server/chunks/ssr/[root-of-the-server]__1aa034e9._.js.map +1 -1
  108. package/web/.next/server/chunks/ssr/[root-of-the-server]__357de47c._.js +2 -2
  109. package/web/.next/server/chunks/ssr/[root-of-the-server]__357de47c._.js.map +1 -1
  110. package/web/.next/server/chunks/ssr/[root-of-the-server]__430169b6._.js +1 -1
  111. package/web/.next/server/chunks/ssr/[root-of-the-server]__430169b6._.js.map +1 -1
  112. package/web/.next/server/chunks/ssr/[root-of-the-server]__67fe07fe._.js +1 -1
  113. package/web/.next/server/chunks/ssr/[root-of-the-server]__6b17a22d._.js +1 -1
  114. package/web/.next/server/chunks/ssr/[root-of-the-server]__6b17a22d._.js.map +1 -1
  115. package/web/.next/server/chunks/ssr/[root-of-the-server]__6bb00d90._.js +2 -2
  116. package/web/.next/server/chunks/ssr/[root-of-the-server]__6bb00d90._.js.map +1 -1
  117. package/web/.next/server/chunks/ssr/[root-of-the-server]__6cc70784._.js +1 -1
  118. package/web/.next/server/chunks/ssr/[root-of-the-server]__6cc70784._.js.map +1 -1
  119. package/web/.next/server/chunks/ssr/[root-of-the-server]__804c006d._.js +1 -1
  120. package/web/.next/server/chunks/ssr/[root-of-the-server]__804c006d._.js.map +1 -1
  121. package/web/.next/server/chunks/ssr/[root-of-the-server]__8c553503._.js +2 -2
  122. package/web/.next/server/chunks/ssr/[root-of-the-server]__a50a7e39._.js +2 -2
  123. package/web/.next/server/chunks/ssr/[root-of-the-server]__a50a7e39._.js.map +1 -1
  124. package/web/.next/server/chunks/ssr/[root-of-the-server]__e44ae5ca._.js +1 -1
  125. package/web/.next/server/chunks/ssr/[root-of-the-server]__e44ae5ca._.js.map +1 -1
  126. package/web/.next/server/chunks/ssr/{_bf4b41df._.js → _0c916cd8._.js} +2 -2
  127. package/web/.next/server/chunks/ssr/_0c916cd8._.js.map +1 -0
  128. package/web/.next/server/chunks/ssr/_2f6f48b8._.js +1 -1
  129. package/web/.next/server/chunks/ssr/_2f6f48b8._.js.map +1 -1
  130. package/web/.next/server/chunks/ssr/_7dca1882._.js +1 -1
  131. package/web/.next/server/chunks/ssr/_7dca1882._.js.map +1 -1
  132. package/web/.next/server/chunks/ssr/_832c379b._.js +3 -0
  133. package/web/.next/server/chunks/ssr/{_74d521f8._.js.map → _832c379b._.js.map} +1 -1
  134. package/web/.next/server/chunks/ssr/_a187fd7e._.js +1 -1
  135. package/web/.next/server/chunks/ssr/_a187fd7e._.js.map +1 -1
  136. package/web/.next/server/chunks/ssr/_a9f57758._.js +1 -1
  137. package/web/.next/server/chunks/ssr/_f39a1adb._.js +1 -1
  138. package/web/.next/server/chunks/ssr/_f39a1adb._.js.map +1 -1
  139. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
  140. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
  141. package/web/.next/server/chunks/ssr/{src_presentation_web_06785be9._.js → src_presentation_web_5914be6c._.js} +2 -2
  142. package/web/.next/server/chunks/ssr/{src_presentation_web_06785be9._.js.map → src_presentation_web_5914be6c._.js.map} +1 -1
  143. package/web/.next/server/chunks/ssr/src_presentation_web_9db47db7._.js +2 -2
  144. package/web/.next/server/chunks/ssr/src_presentation_web_9db47db7._.js.map +1 -1
  145. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_f66cd328.js +1 -1
  146. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_f66cd328.js.map +1 -1
  147. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
  148. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
  149. package/web/.next/server/chunks/ssr/src_presentation_web_ede4a227._.js +2 -2
  150. package/web/.next/server/chunks/ssr/src_presentation_web_ede4a227._.js.map +1 -1
  151. package/web/.next/server/pages/500.html +2 -2
  152. package/web/.next/server/server-reference-manifest.js +1 -1
  153. package/web/.next/server/server-reference-manifest.json +36 -36
  154. package/web/.next/static/chunks/{482a55bb430177bf.js → 10f102e4f3d30fab.js} +1 -1
  155. package/web/.next/static/chunks/{0155709661cf13bb.js → 4265877011a68ce0.js} +2 -2
  156. package/web/.next/static/chunks/{fa08696e9e0c9721.js → 53941e038c6b975c.js} +1 -1
  157. package/web/.next/static/chunks/722c4b021a197a84.js +2 -0
  158. package/web/.next/static/chunks/{b634743a6340996d.js → 736d94180ff7f37d.js} +1 -1
  159. package/web/.next/static/chunks/{3abe7cc28ed09cde.js → 78d9c944f56f22b4.js} +1 -1
  160. package/web/.next/static/chunks/{cfc13d600bdf979d.js → a0f0cb1ede328514.js} +1 -1
  161. package/web/.next/static/chunks/a5804ae1a0c23932.js +1 -0
  162. package/web/.next/static/chunks/{0d5206b65702d33b.js → a835d31cfedb9077.js} +1 -1
  163. package/web/.next/static/chunks/{15a07720df80cca0.js → ad3b1560b2612b59.js} +1 -1
  164. package/web/.next/static/chunks/{9f48bc344ab9f852.js → afa4210db783bc6f.js} +1 -1
  165. package/web/.next/static/chunks/f7d4ca49260314fb.css +1 -0
  166. package/web/.next/server/chunks/ssr/_74d521f8._.js +0 -3
  167. package/web/.next/server/chunks/ssr/_bf4b41df._.js.map +0 -1
  168. package/web/.next/static/chunks/33d2f67ad4814aba.css +0 -1
  169. package/web/.next/static/chunks/b21a9f82d73db5d4.js +0 -2
  170. package/web/.next/static/chunks/fae74406f108b48d.js +0 -1
  171. /package/web/.next/static/{MIGfBdLuSQCaxd2gpUKCz → SUd6bpgXghiSZx_3nWE4Y}/_buildManifest.js +0 -0
  172. /package/web/.next/static/{MIGfBdLuSQCaxd2gpUKCz → SUd6bpgXghiSZx_3nWE4Y}/_clientMiddlewareManifest.json +0 -0
  173. /package/web/.next/static/{MIGfBdLuSQCaxd2gpUKCz → SUd6bpgXghiSZx_3nWE4Y}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,24270,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},98127,e=>{"use strict";var t=e.i(20314),r=e.i(31777);function n({className:e,type:n,...o}){return(0,t.jsx)("input",{type:n,"data-slot":"input",className:(0,r.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...o})}e.s(["Input",()=>n])},81975,e=>{"use strict";let t=(0,e.i(3645).default)("wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]);e.s(["Wrench",()=>t],81975)},80986,e=>{"use strict";let t=(0,e.i(3645).default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["default",()=>t])},30090,e=>{"use strict";let t=(0,e.i(3645).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["default",()=>t])},54277,e=>{"use strict";var t=e.i(30090);e.s(["CircleX",()=>t.default])},49228,e=>{"use strict";let t=(0,e.i(3645).default)("git-branch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);e.s(["GitBranch",()=>t],49228)},66033,e=>{"use strict";var t=e.i(79054);e.i(20314);var r=t.createContext(void 0);function n(e){let n=t.useContext(r);return e||n||"ltr"}e.s(["useDirection",()=>n])},3214,e=>{"use strict";let t=(0,e.i(3645).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",()=>t],3214)},10942,94819,e=>{"use strict";var t=e.i(80986);e.s(["CircleCheck",()=>t.default],10942);let r=(0,e.i(3645).default)("ban",[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["Ban",()=>r],94819)},39443,e=>{"use strict";var t=e.i(20314),r=e.i(79054);let n=(0,e.i(18354).createLogger)("[SSE]");function o(e,t,r,n){if("u"<typeof EventSource)return()=>{};let o=null,i=!1,a=1e3,u=null,s=null;return!function l(){i||(o=new EventSource(e?`/api/agent-events?runId=${encodeURIComponent(e)}`:"/api/agent-events"),n("connecting"),o.onopen=()=>{n("connected"),s=setTimeout(()=>{s=null,a=1e3},5e3)},o.onerror=()=>{o?.close(),o=null,n("disconnected"),null!==s&&(clearTimeout(s),s=null);let e=a;a=Math.min(2*e,3e4),u=setTimeout(()=>{u=null,l()},e)},o.addEventListener("notification",e=>{let n=JSON.parse(e.data);t(e=>{let t=[...e,n];return t.length>500?t.slice(-250):t}),r(n)}))}(),()=>{i=!0,null!==u&&(clearTimeout(u),u=null),null!==s&&(clearTimeout(s),s=null),o&&(o.close(),o=null)}}let i=(0,r.createContext)(null);function a({children:e,runId:a}){let{events:u,lastEvent:s,connectionStatus:l}=function(e){let[t,i]=(0,r.useState)([]),[a,u]=(0,r.useState)(null),[s,l]=(0,r.useState)("disconnected"),c=e?.runId,f=(0,r.useRef)(null),d=(0,r.useCallback)(e=>{let t=e.data;if(t&&"object"==typeof t)if("notification"===t.type){let e=t.data;n.debug("event received:",e.eventType,e),i(t=>{let r=[...t,e];return r.length>500?r.slice(-250):r}),u(e)}else"status"===t.type&&l(t.status)},[]);return(0,r.useEffect)(()=>{let e="u">typeof location&&new URLSearchParams(location.search).has("sse");if(!navigator.serviceWorker||e)return o(c,i,u,l);let t=!1,r={current:void 0};function n(e){t||(f.current=e,e.postMessage({type:"subscribe",runId:c}),l("connecting"))}function a(){if(t)return;let e=navigator.serviceWorker.controller;e&&(f.current=e,e.postMessage({type:"subscribe",runId:c}),l("connecting"))}return navigator.serviceWorker.addEventListener("message",d),navigator.serviceWorker.addEventListener("controllerchange",a),navigator.serviceWorker.register("/agent-events-sw.js",{scope:"/"}).then(e=>{if(t)return;let a=e.active??e.installing??e.waiting;if(!a){r.current=o(c,i,u,l);return}if("activated"===a.state)n(a);else{let e=()=>{"activated"===a.state&&(a.removeEventListener("statechange",e),n(a))};a.addEventListener("statechange",e)}}).catch(()=>{t||(r.current=o(c,i,u,l))}),()=>{t=!0,navigator.serviceWorker.removeEventListener("message",d),navigator.serviceWorker.removeEventListener("controllerchange",a),f.current?.postMessage({type:"unsubscribe"}),f.current=null,r.current?.()}},[c,d]),{events:t,lastEvent:a,connectionStatus:s}}({runId:a}),c=(0,r.useMemo)(()=>({events:u,lastEvent:s,connectionStatus:l}),[u,s,l]);return(0,t.jsx)(i.Provider,{value:c,children:e})}function u(){let e=(0,r.useContext)(i);if(!e)throw Error("useAgentEventsContext must be used within an <AgentEventsProvider>");return e}e.s(["AgentEventsProvider",()=>a,"useAgentEventsContext",()=>u],39443)},27069,e=>{"use strict";function t(e,[t,r]){return Math.min(r,Math.max(t,e))}e.s(["clamp",()=>t])},12103,e=>{"use strict";let t=(0,e.i(3645).default)("puzzle",[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]);e.s(["Puzzle",()=>t],12103)},78521,e=>{"use strict";var t=e.i(21023);let r=(0,t.createServerReference)("00afc78142895adc5cd92ad7dc38c12bcd7247f7b9",t.callServer,void 0,t.findSourceMapURL,"pickFolder");async function n(){let e=await r();if(e.error)throw Error(e.error);return e.path}e.s(["pickFolder",()=>n],78521)},91925,e=>{"use strict";let t=(0,e.i(3645).default)("folder-plus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);e.s(["FolderPlus",()=>t],91925)},5147,e=>{"use strict";var t=e.i(20314),r=e.i(79054);let n={"action-required":"action-needed",running:"in-progress",done:"done",blocked:"blocked",pending:"pending",error:"error",creating:null,deleting:null};function o(e){return n[e]}let i=(0,r.createContext)(null);function a({children:e}){let[n,o]=(0,r.useState)([]),[a,u]=(0,r.useState)(!1),s=(0,r.useMemo)(()=>({features:n,setFeatures:o,hasRepositories:a,setHasRepositories:u}),[n,a]);return(0,t.jsx)(i.Provider,{value:s,children:e})}function u(){let e=(0,r.useContext)(i);if(!e)throw Error("useSidebarFeaturesContext must be used within a <SidebarFeaturesProvider>");return e}e.s(["SidebarFeaturesProvider",()=>a,"mapNodeStateToSidebarStatus",()=>o,"useSidebarFeaturesContext",()=>u])},76314,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={assign:function(){return s},searchParamsToUrlQuery:function(){return i},urlQueryToSearchParams:function(){return u}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});function i(e){let t={};for(let[r,n]of e.entries()){let e=t[r];void 0===e?t[r]=n:Array.isArray(e)?e.push(n):t[r]=[e,n]}return t}function a(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function u(e){let t=new URLSearchParams;for(let[r,n]of Object.entries(e))if(Array.isArray(n))for(let e of n)t.append(r,a(e));else t.set(r,a(n));return t}function s(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,n]of r.entries())e.append(t,n)}return e}},95889,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return u},formatWithValidation:function(){return l},urlObjectKeys:function(){return s}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let i=e.r(44066)._(e.r(76314)),a=/https?|ftp|gopher|file/;function u(e){let{auth:t,hostname:r}=e,n=e.protocol||"",o=e.pathname||"",u=e.hash||"",s=e.query||"",l=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?l=t+e.host:r&&(l=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(l+=":"+e.port)),s&&"object"==typeof s&&(s=String(i.urlQueryToSearchParams(s)));let c=e.search||s&&`?${s}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||a.test(n))&&!1!==l?(l="//"+(l||""),o&&"/"!==o[0]&&(o="/"+o)):l||(l=""),u&&"#"!==u[0]&&(u="#"+u),c&&"?"!==c[0]&&(c="?"+c),o=o.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${n}${l}${o}${c}${u}`}let s=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function l(e){return u(e)}},58464,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={DecodeError:function(){return v},MiddlewareNotFoundError:function(){return P},MissingStaticPage:function(){return E},NormalizeError:function(){return m},PageNotFoundError:function(){return b},SP:function(){return g},ST:function(){return y},WEB_VITALS:function(){return i},execOnce:function(){return a},getDisplayName:function(){return f},getLocationOrigin:function(){return l},getURL:function(){return c},isAbsoluteUrl:function(){return s},isResSent:function(){return d},loadGetInitialProps:function(){return h},normalizeRepeatedSlashes:function(){return p},stringifyError:function(){return x}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let i=["CLS","FCP","FID","INP","LCP","TTFB"];function a(e){let t,r=!1;return(...n)=>(r||(r=!0,t=e(...n)),t)}let u=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,s=e=>u.test(e);function l(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function c(){let{href:e}=window.location,t=l();return e.substring(t.length)}function f(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function d(e){return e.finished||e.headersSent}function p(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function h(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await h(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&d(r))return n;if(!n)throw Object.defineProperty(Error(`"${f(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return n}let g="u">typeof performance,y=g&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class v extends Error{}class m extends Error{}class b extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class E extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class P extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function x(e){return JSON.stringify({message:e.message,stack:e.stack})}},51380,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return i}});let n=e.r(58464),o=e.r(53626);function i(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,o.hasBasePath)(r.pathname)}catch(e){return!1}}},38670,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},24035,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return v},useLinkStatus:function(){return b}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let i=e.r(44066),a=e.r(20314),u=i._(e.r(79054)),s=e.r(95889),l=e.r(18152),c=e.r(80764),f=e.r(58464),d=e.r(99267);e.r(24270);let p=e.r(59624),h=e.r(51380),g=e.r(95555);function y(e){return"string"==typeof e?e:(0,s.formatUrl)(e)}function v(t){var r;let n,o,i,[s,v]=(0,u.useOptimistic)(p.IDLE_LINK_STATUS),b=(0,u.useRef)(null),{href:E,as:P,children:x,prefetch:S=null,passHref:k,replace:C,shallow:w,scroll:O,onClick:T,onMouseEnter:L,onTouchStart:M,legacyBehavior:_=!1,onNavigate:j,ref:R,unstable_dynamicOnHover:N,...A}=t;n=x,_&&("string"==typeof n||"number"==typeof n)&&(n=(0,a.jsx)("a",{children:n}));let U=u.default.useContext(l.AppRouterContext),I=!1!==S,F=!1!==S?null===(r=S)||"auto"===r?g.FetchStrategy.PPR:g.FetchStrategy.Full:g.FetchStrategy.PPR,{href:$,as:z}=u.default.useMemo(()=>{let e=y(E);return{href:e,as:P?y(P):e}},[E,P]);if(_){if(n?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});o=u.default.Children.only(n)}let B=_?o&&"object"==typeof o&&o.ref:R,D=u.default.useCallback(e=>(null!==U&&(b.current=(0,p.mountLinkInstance)(e,$,U,F,I,v)),()=>{b.current&&((0,p.unmountLinkForCurrentNavigation)(b.current),b.current=null),(0,p.unmountPrefetchableInstance)(e)}),[I,$,U,F,v]),W={ref:(0,c.useMergedRef)(D,B),onClick(t){_||"function"!=typeof T||T(t),_&&o.props&&"function"==typeof o.props.onClick&&o.props.onClick(t),!U||t.defaultPrevented||function(t,r,n,o,i,a,s){if("u">typeof window){let l,{nodeName:c}=t.currentTarget;if("A"===c.toUpperCase()&&((l=t.currentTarget.getAttribute("target"))&&"_self"!==l||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,h.isLocalURL)(r)){i&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),s){let e=!1;if(s({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:f}=e.r(81574);u.default.startTransition(()=>{f(n||r,i?"replace":"push",a??!0,o.current)})}}(t,$,z,b,C,O,j)},onMouseEnter(e){_||"function"!=typeof L||L(e),_&&o.props&&"function"==typeof o.props.onMouseEnter&&o.props.onMouseEnter(e),U&&I&&(0,p.onNavigationIntent)(e.currentTarget,!0===N)},onTouchStart:function(e){_||"function"!=typeof M||M(e),_&&o.props&&"function"==typeof o.props.onTouchStart&&o.props.onTouchStart(e),U&&I&&(0,p.onNavigationIntent)(e.currentTarget,!0===N)}};return(0,f.isAbsoluteUrl)(z)?W.href=z:_&&!k&&("a"!==o.type||"href"in o.props)||(W.href=(0,d.addBasePath)(z)),i=_?u.default.cloneElement(o,W):(0,a.jsx)("a",{...A,...W,children:n}),(0,a.jsx)(m.Provider,{value:s,children:i})}e.r(38670);let m=(0,u.createContext)(p.IDLE_LINK_STATUS),b=()=>(0,u.useContext)(m);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,24270,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},98127,e=>{"use strict";var t=e.i(20314),r=e.i(31777);function n({className:e,type:n,...o}){return(0,t.jsx)("input",{type:n,"data-slot":"input",className:(0,r.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...o})}e.s(["Input",()=>n])},81975,e=>{"use strict";let t=(0,e.i(3645).default)("wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]);e.s(["Wrench",()=>t],81975)},80986,e=>{"use strict";let t=(0,e.i(3645).default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["default",()=>t])},30090,e=>{"use strict";let t=(0,e.i(3645).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["default",()=>t])},54277,e=>{"use strict";var t=e.i(30090);e.s(["CircleX",()=>t.default])},49228,e=>{"use strict";let t=(0,e.i(3645).default)("git-branch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);e.s(["GitBranch",()=>t],49228)},66033,e=>{"use strict";var t=e.i(79054);e.i(20314);var r=t.createContext(void 0);function n(e){let n=t.useContext(r);return e||n||"ltr"}e.s(["useDirection",()=>n])},3214,e=>{"use strict";let t=(0,e.i(3645).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",()=>t],3214)},10942,94819,e=>{"use strict";var t=e.i(80986);e.s(["CircleCheck",()=>t.default],10942);let r=(0,e.i(3645).default)("ban",[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["Ban",()=>r],94819)},39443,e=>{"use strict";var t=e.i(20314),r=e.i(79054);let n=(0,e.i(18354).createLogger)("[SSE]");function o(e,t,r,n){if("u"<typeof EventSource)return()=>{};let o=null,i=!1,a=1e3,u=null,s=null;return!function l(){i||(o=new EventSource(e?`/api/agent-events?runId=${encodeURIComponent(e)}`:"/api/agent-events"),n("connecting"),o.onopen=()=>{n("connected"),s=setTimeout(()=>{s=null,a=1e3},5e3)},o.onerror=()=>{o?.close(),o=null,n("disconnected"),null!==s&&(clearTimeout(s),s=null);let e=a;a=Math.min(2*e,3e4),u=setTimeout(()=>{u=null,l()},e)},o.addEventListener("notification",e=>{let n=JSON.parse(e.data);t(e=>{let t=[...e,n];return t.length>500?t.slice(-250):t}),r(n)}))}(),()=>{i=!0,null!==u&&(clearTimeout(u),u=null),null!==s&&(clearTimeout(s),s=null),o&&(o.close(),o=null)}}let i=(0,r.createContext)(null);function a({children:e,runId:a}){let{events:u,lastEvent:s,connectionStatus:l}=function(e){let[t,i]=(0,r.useState)([]),[a,u]=(0,r.useState)(null),[s,l]=(0,r.useState)("disconnected"),c=e?.runId,f=(0,r.useRef)(null),d=(0,r.useCallback)(e=>{let t=e.data;if(t&&"object"==typeof t)if("notification"===t.type){let e=t.data;n.debug("event received:",e.eventType,e),i(t=>{let r=[...t,e];return r.length>500?r.slice(-250):r}),u(e)}else"status"===t.type&&l(t.status)},[]);return(0,r.useEffect)(()=>{let e="u">typeof location&&new URLSearchParams(location.search).has("sse");if(!navigator.serviceWorker||e)return o(c,i,u,l);let t=!1,r={current:void 0};function n(e){t||(f.current=e,e.postMessage({type:"subscribe",runId:c}),l("connecting"))}function a(){if(t)return;let e=navigator.serviceWorker.controller;e&&(f.current=e,e.postMessage({type:"subscribe",runId:c}),l("connecting"))}return navigator.serviceWorker.addEventListener("message",d),navigator.serviceWorker.addEventListener("controllerchange",a),navigator.serviceWorker.register("/agent-events-sw.js",{scope:"/"}).then(e=>{if(t)return;let a=e.active??e.installing??e.waiting;if(!a){r.current=o(c,i,u,l);return}if("activated"===a.state)n(a);else{let e=()=>{"activated"===a.state&&(a.removeEventListener("statechange",e),n(a))};a.addEventListener("statechange",e)}}).catch(()=>{t||(r.current=o(c,i,u,l))}),()=>{t=!0,navigator.serviceWorker.removeEventListener("message",d),navigator.serviceWorker.removeEventListener("controllerchange",a),f.current?.postMessage({type:"unsubscribe"}),f.current=null,r.current?.()}},[c,d]),{events:t,lastEvent:a,connectionStatus:s}}({runId:a}),c=(0,r.useMemo)(()=>({events:u,lastEvent:s,connectionStatus:l}),[u,s,l]);return(0,t.jsx)(i.Provider,{value:c,children:e})}function u(){let e=(0,r.useContext)(i);if(!e)throw Error("useAgentEventsContext must be used within an <AgentEventsProvider>");return e}e.s(["AgentEventsProvider",()=>a,"useAgentEventsContext",()=>u],39443)},27069,e=>{"use strict";function t(e,[t,r]){return Math.min(r,Math.max(t,e))}e.s(["clamp",()=>t])},12103,e=>{"use strict";let t=(0,e.i(3645).default)("puzzle",[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]);e.s(["Puzzle",()=>t],12103)},78521,e=>{"use strict";var t=e.i(21023);let r=(0,t.createServerReference)("00b24a547de74a99460fec707bee1e49dc49e0858d",t.callServer,void 0,t.findSourceMapURL,"pickFolder");async function n(){let e=await r();if(e.error)throw Error(e.error);return e.path}e.s(["pickFolder",()=>n],78521)},91925,e=>{"use strict";let t=(0,e.i(3645).default)("folder-plus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);e.s(["FolderPlus",()=>t],91925)},5147,e=>{"use strict";var t=e.i(20314),r=e.i(79054);let n={"action-required":"action-needed",running:"in-progress",done:"done",blocked:"blocked",pending:"pending",error:"error",creating:null,deleting:null};function o(e){return n[e]}let i=(0,r.createContext)(null);function a({children:e}){let[n,o]=(0,r.useState)([]),[a,u]=(0,r.useState)(!1),s=(0,r.useMemo)(()=>({features:n,setFeatures:o,hasRepositories:a,setHasRepositories:u}),[n,a]);return(0,t.jsx)(i.Provider,{value:s,children:e})}function u(){let e=(0,r.useContext)(i);if(!e)throw Error("useSidebarFeaturesContext must be used within a <SidebarFeaturesProvider>");return e}e.s(["SidebarFeaturesProvider",()=>a,"mapNodeStateToSidebarStatus",()=>o,"useSidebarFeaturesContext",()=>u])},76314,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={assign:function(){return s},searchParamsToUrlQuery:function(){return i},urlQueryToSearchParams:function(){return u}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});function i(e){let t={};for(let[r,n]of e.entries()){let e=t[r];void 0===e?t[r]=n:Array.isArray(e)?e.push(n):t[r]=[e,n]}return t}function a(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function u(e){let t=new URLSearchParams;for(let[r,n]of Object.entries(e))if(Array.isArray(n))for(let e of n)t.append(r,a(e));else t.set(r,a(n));return t}function s(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,n]of r.entries())e.append(t,n)}return e}},95889,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return u},formatWithValidation:function(){return l},urlObjectKeys:function(){return s}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let i=e.r(44066)._(e.r(76314)),a=/https?|ftp|gopher|file/;function u(e){let{auth:t,hostname:r}=e,n=e.protocol||"",o=e.pathname||"",u=e.hash||"",s=e.query||"",l=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?l=t+e.host:r&&(l=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(l+=":"+e.port)),s&&"object"==typeof s&&(s=String(i.urlQueryToSearchParams(s)));let c=e.search||s&&`?${s}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||a.test(n))&&!1!==l?(l="//"+(l||""),o&&"/"!==o[0]&&(o="/"+o)):l||(l=""),u&&"#"!==u[0]&&(u="#"+u),c&&"?"!==c[0]&&(c="?"+c),o=o.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${n}${l}${o}${c}${u}`}let s=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function l(e){return u(e)}},58464,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={DecodeError:function(){return v},MiddlewareNotFoundError:function(){return P},MissingStaticPage:function(){return E},NormalizeError:function(){return m},PageNotFoundError:function(){return b},SP:function(){return g},ST:function(){return y},WEB_VITALS:function(){return i},execOnce:function(){return a},getDisplayName:function(){return f},getLocationOrigin:function(){return l},getURL:function(){return c},isAbsoluteUrl:function(){return s},isResSent:function(){return d},loadGetInitialProps:function(){return h},normalizeRepeatedSlashes:function(){return p},stringifyError:function(){return x}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let i=["CLS","FCP","FID","INP","LCP","TTFB"];function a(e){let t,r=!1;return(...n)=>(r||(r=!0,t=e(...n)),t)}let u=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,s=e=>u.test(e);function l(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function c(){let{href:e}=window.location,t=l();return e.substring(t.length)}function f(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function d(e){return e.finished||e.headersSent}function p(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function h(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await h(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&d(r))return n;if(!n)throw Object.defineProperty(Error(`"${f(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return n}let g="u">typeof performance,y=g&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class v extends Error{}class m extends Error{}class b extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class E extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class P extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function x(e){return JSON.stringify({message:e.message,stack:e.stack})}},51380,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return i}});let n=e.r(58464),o=e.r(53626);function i(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,o.hasBasePath)(r.pathname)}catch(e){return!1}}},38670,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},24035,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return v},useLinkStatus:function(){return b}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let i=e.r(44066),a=e.r(20314),u=i._(e.r(79054)),s=e.r(95889),l=e.r(18152),c=e.r(80764),f=e.r(58464),d=e.r(99267);e.r(24270);let p=e.r(59624),h=e.r(51380),g=e.r(95555);function y(e){return"string"==typeof e?e:(0,s.formatUrl)(e)}function v(t){var r;let n,o,i,[s,v]=(0,u.useOptimistic)(p.IDLE_LINK_STATUS),b=(0,u.useRef)(null),{href:E,as:P,children:x,prefetch:S=null,passHref:k,replace:C,shallow:w,scroll:O,onClick:T,onMouseEnter:L,onTouchStart:M,legacyBehavior:_=!1,onNavigate:j,ref:R,unstable_dynamicOnHover:N,...A}=t;n=x,_&&("string"==typeof n||"number"==typeof n)&&(n=(0,a.jsx)("a",{children:n}));let U=u.default.useContext(l.AppRouterContext),I=!1!==S,F=!1!==S?null===(r=S)||"auto"===r?g.FetchStrategy.PPR:g.FetchStrategy.Full:g.FetchStrategy.PPR,{href:$,as:z}=u.default.useMemo(()=>{let e=y(E);return{href:e,as:P?y(P):e}},[E,P]);if(_){if(n?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});o=u.default.Children.only(n)}let B=_?o&&"object"==typeof o&&o.ref:R,D=u.default.useCallback(e=>(null!==U&&(b.current=(0,p.mountLinkInstance)(e,$,U,F,I,v)),()=>{b.current&&((0,p.unmountLinkForCurrentNavigation)(b.current),b.current=null),(0,p.unmountPrefetchableInstance)(e)}),[I,$,U,F,v]),W={ref:(0,c.useMergedRef)(D,B),onClick(t){_||"function"!=typeof T||T(t),_&&o.props&&"function"==typeof o.props.onClick&&o.props.onClick(t),!U||t.defaultPrevented||function(t,r,n,o,i,a,s){if("u">typeof window){let l,{nodeName:c}=t.currentTarget;if("A"===c.toUpperCase()&&((l=t.currentTarget.getAttribute("target"))&&"_self"!==l||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,h.isLocalURL)(r)){i&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),s){let e=!1;if(s({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:f}=e.r(81574);u.default.startTransition(()=>{f(n||r,i?"replace":"push",a??!0,o.current)})}}(t,$,z,b,C,O,j)},onMouseEnter(e){_||"function"!=typeof L||L(e),_&&o.props&&"function"==typeof o.props.onMouseEnter&&o.props.onMouseEnter(e),U&&I&&(0,p.onNavigationIntent)(e.currentTarget,!0===N)},onTouchStart:function(e){_||"function"!=typeof M||M(e),_&&o.props&&"function"==typeof o.props.onTouchStart&&o.props.onTouchStart(e),U&&I&&(0,p.onNavigationIntent)(e.currentTarget,!0===N)}};return(0,f.isAbsoluteUrl)(z)?W.href=z:_&&!k&&("a"!==o.type||"href"in o.props)||(W.href=(0,d.addBasePath)(z)),i=_?u.default.cloneElement(o,W):(0,a.jsx)("a",{...A,...W,children:n}),(0,a.jsx)(m.Provider,{value:s,children:i})}e.r(38670);let m=(0,u.createContext)(p.IDLE_LINK_STATUS),b=()=>(0,u.useContext)(m);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,41952,e=>{"use strict";var t=e.i(20314),n=e.i(79054),r=e.i(23925),a=e.i(3645);let l=(0,a.default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);var i=e.i(38573),o=e.i(49228);let s=(0,a.default)("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),d=(0,a.default)("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]),c=(0,a.default)("flag",[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]]),u=(0,a.default)("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);var p=e.i(10714),p=p,m=e.i(3214),h=e.i(30702);let f=(0,a.default)("settings-2",[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);var g=e.i(58860),x=e.i(60112),v=e.i(31777),w=e.i(41957),b=e.i(51911),y=e.i(26036),S=e.i(27069),j=e.i(91967),C=e.i(87342),k=e.i(5978),I=e.i(22528),M=e.i(66033),N=e.i(53532),P=e.i(41687),E=e.i(56720),R=e.i(13123),T=e.i(52740),A=e.i(39979),D=e.i(87620),L=e.i(86874),F=e.i(29297),H=e.i(36589),B=e.i(5192),z=e.i(23405),_=e.i(1693),V=e.i(73772),W=e.i(13044),O=[" ","Enter","ArrowUp","ArrowDown"],U=[" ","Enter"],K="Select",[q,G,$]=(0,C.createCollection)(K),[Y,Z]=(0,I.createContextScope)(K,[$,T.createPopperScope]),X=(0,T.createPopperScope)(),[Q,J]=Y(K),[ee,et]=Y(K),en=e=>{let{__scopeSelect:r,children:a,open:l,defaultOpen:i,onOpenChange:o,value:s,defaultValue:d,onValueChange:c,dir:u,name:p,autoComplete:m,disabled:h,required:f,form:g}=e,x=X(r),[v,w]=n.useState(null),[b,y]=n.useState(null),[S,j]=n.useState(!1),C=(0,M.useDirection)(u),[k,I]=(0,H.useControllableState)({prop:l,defaultProp:i??!1,onChange:o,caller:K}),[N,P]=(0,H.useControllableState)({prop:s,defaultProp:d,onChange:c,caller:K}),E=n.useRef(null),A=!v||g||!!v.closest("form"),[D,L]=n.useState(new Set),F=Array.from(D).map(e=>e.props.value).join(";");return(0,t.jsx)(T.Root,{...x,children:(0,t.jsxs)(Q,{required:f,scope:r,trigger:v,onTriggerChange:w,valueNode:b,onValueNodeChange:y,valueNodeHasChildren:S,onValueNodeHasChildrenChange:j,contentId:(0,R.useId)(),value:N,onValueChange:P,open:k,onOpenChange:I,dir:C,triggerPointerDownPosRef:E,disabled:h,children:[(0,t.jsx)(q.Provider,{scope:r,children:(0,t.jsx)(ee,{scope:e.__scopeSelect,onNativeOptionAdd:n.useCallback(e=>{L(t=>new Set(t).add(e))},[]),onNativeOptionRemove:n.useCallback(e=>{L(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:a})}),A?(0,t.jsxs)(eO,{"aria-hidden":!0,required:f,tabIndex:-1,name:p,autoComplete:m,value:N,onChange:e=>P(e.target.value),disabled:h,form:g,children:[void 0===N?(0,t.jsx)("option",{value:""}):null,Array.from(D)]},F):null]})})};en.displayName=K;var er="SelectTrigger",ea=n.forwardRef((e,r)=>{let{__scopeSelect:a,disabled:l=!1,...i}=e,o=X(a),s=J(er,a),d=s.disabled||l,c=(0,k.useComposedRefs)(r,s.onTriggerChange),u=G(a),p=n.useRef("touch"),[m,h,f]=eK(e=>{let t=u().filter(e=>!e.disabled),n=t.find(e=>e.value===s.value),r=eq(t,e,n);void 0!==r&&s.onValueChange(r.value)}),g=e=>{d||(s.onOpenChange(!0),f()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,t.jsx)(T.Anchor,{asChild:!0,...o,children:(0,t.jsx)(D.Primitive.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:d,"data-disabled":d?"":void 0,"data-placeholder":eU(s.value)?"":void 0,...i,ref:c,onClick:(0,j.composeEventHandlers)(i.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&g(e)}),onPointerDown:(0,j.composeEventHandlers)(i.onPointerDown,e=>{p.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(g(e),e.preventDefault())}),onKeyDown:(0,j.composeEventHandlers)(i.onKeyDown,e=>{let t=""!==m.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||h(e.key),(!t||" "!==e.key)&&O.includes(e.key)&&(g(),e.preventDefault())})})})});ea.displayName=er;var el="SelectValue",ei=n.forwardRef((e,n)=>{let{__scopeSelect:r,className:a,style:l,children:i,placeholder:o="",...s}=e,d=J(el,r),{onValueNodeHasChildrenChange:c}=d,u=void 0!==i,p=(0,k.useComposedRefs)(n,d.onValueNodeChange);return(0,B.useLayoutEffect)(()=>{c(u)},[c,u]),(0,t.jsx)(D.Primitive.span,{...s,ref:p,style:{pointerEvents:"none"},children:eU(d.value)?(0,t.jsx)(t.Fragment,{children:o}):i})});ei.displayName=el;var eo=n.forwardRef((e,n)=>{let{__scopeSelect:r,children:a,...l}=e;return(0,t.jsx)(D.Primitive.span,{"aria-hidden":!0,...l,ref:n,children:a||"▼"})});eo.displayName="SelectIcon";var es=e=>(0,t.jsx)(A.Portal,{asChild:!0,...e});es.displayName="SelectPortal";var ed="SelectContent",ec=n.forwardRef((e,r)=>{let a=J(ed,e.__scopeSelect),[l,i]=n.useState();return((0,B.useLayoutEffect)(()=>{i(new DocumentFragment)},[]),a.open)?(0,t.jsx)(eh,{...e,ref:r}):l?y.createPortal((0,t.jsx)(eu,{scope:e.__scopeSelect,children:(0,t.jsx)(q.Slot,{scope:e.__scopeSelect,children:(0,t.jsx)("div",{children:e.children})})}),l):null});ec.displayName=ed;var[eu,ep]=Y(ed),em=(0,L.createSlot)("SelectContent.RemoveScroll"),eh=n.forwardRef((e,r)=>{let{__scopeSelect:a,position:l="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:s,side:d,sideOffset:c,align:u,alignOffset:p,arrowPadding:m,collisionBoundary:h,collisionPadding:f,sticky:g,hideWhenDetached:x,avoidCollisions:v,...w}=e,b=J(ed,a),[y,S]=n.useState(null),[C,I]=n.useState(null),M=(0,k.useComposedRefs)(r,e=>S(e)),[R,T]=n.useState(null),[A,D]=n.useState(null),L=G(a),[F,H]=n.useState(!1),B=n.useRef(!1);n.useEffect(()=>{if(y)return(0,V.hideOthers)(y)},[y]),(0,P.useFocusGuards)();let z=n.useCallback(e=>{let[t,...n]=L().map(e=>e.ref.current),[r]=n.slice(-1),a=document.activeElement;for(let n of e)if(n===a||(n?.scrollIntoView({block:"nearest"}),n===t&&C&&(C.scrollTop=0),n===r&&C&&(C.scrollTop=C.scrollHeight),n?.focus(),document.activeElement!==a))return},[L,C]),_=n.useCallback(()=>z([R,y]),[z,R,y]);n.useEffect(()=>{F&&_()},[F,_]);let{onOpenChange:O,triggerPointerDownPosRef:U}=b;n.useEffect(()=>{if(y){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(U.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(U.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():y.contains(n.target)||O(!1),document.removeEventListener("pointermove",t),U.current=null};return null!==U.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[y,O,U]),n.useEffect(()=>{let e=()=>O(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[O]);let[K,q]=eK(e=>{let t=L().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),r=eq(t,e,n);r&&setTimeout(()=>r.ref.current.focus())}),$=n.useCallback((e,t,n)=>{let r=!B.current&&!n;(void 0!==b.value&&b.value===t||r)&&(T(e),r&&(B.current=!0))},[b.value]),Y=n.useCallback(()=>y?.focus(),[y]),Z=n.useCallback((e,t,n)=>{let r=!B.current&&!n;(void 0!==b.value&&b.value===t||r)&&D(e)},[b.value]),X="popper"===l?eg:ef,Q=X===eg?{side:d,sideOffset:c,align:u,alignOffset:p,arrowPadding:m,collisionBoundary:h,collisionPadding:f,sticky:g,hideWhenDetached:x,avoidCollisions:v}:{};return(0,t.jsx)(eu,{scope:a,content:y,viewport:C,onViewportChange:I,itemRefCallback:$,selectedItem:R,onItemLeave:Y,itemTextRefCallback:Z,focusSelectedItem:_,selectedItemText:A,position:l,isPositioned:F,searchRef:K,children:(0,t.jsx)(W.RemoveScroll,{as:em,allowPinchZoom:!0,children:(0,t.jsx)(E.FocusScope,{asChild:!0,trapped:b.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:(0,j.composeEventHandlers)(i,e=>{b.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,t.jsx)(N.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:(0,t.jsx)(X,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:e=>e.preventDefault(),...w,...Q,onPlaced:()=>H(!0),ref:M,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:(0,j.composeEventHandlers)(w.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||q(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=L().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>z(t)),e.preventDefault()}})})})})})})});eh.displayName="SelectContentImpl";var ef=n.forwardRef((e,r)=>{let{__scopeSelect:a,onPlaced:l,...i}=e,o=J(ed,a),s=ep(ed,a),[d,c]=n.useState(null),[u,p]=n.useState(null),m=(0,k.useComposedRefs)(r,e=>p(e)),h=G(a),f=n.useRef(!1),g=n.useRef(!0),{viewport:x,selectedItem:v,selectedItemText:w,focusSelectedItem:b}=s,y=n.useCallback(()=>{if(o.trigger&&o.valueNode&&d&&u&&x&&v&&w){let e=o.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=o.valueNode.getBoundingClientRect(),r=w.getBoundingClientRect();if("rtl"!==o.dir){let a=r.left-t.left,l=n.left-a,i=e.left-l,o=e.width+i,s=Math.max(o,t.width),c=window.innerWidth-10,u=(0,S.clamp)(l,[10,Math.max(10,c-s)]);d.style.minWidth=o+"px",d.style.left=u+"px"}else{let a=t.right-r.right,l=window.innerWidth-n.right-a,i=window.innerWidth-e.right-l,o=e.width+i,s=Math.max(o,t.width),c=window.innerWidth-10,u=(0,S.clamp)(l,[10,Math.max(10,c-s)]);d.style.minWidth=o+"px",d.style.right=u+"px"}let a=h(),i=window.innerHeight-20,s=x.scrollHeight,c=window.getComputedStyle(u),p=parseInt(c.borderTopWidth,10),m=parseInt(c.paddingTop,10),g=parseInt(c.borderBottomWidth,10),b=p+m+s+parseInt(c.paddingBottom,10)+g,y=Math.min(5*v.offsetHeight,b),j=window.getComputedStyle(x),C=parseInt(j.paddingTop,10),k=parseInt(j.paddingBottom,10),I=e.top+e.height/2-10,M=v.offsetHeight/2,N=p+m+(v.offsetTop+M);if(N<=I){let e=a.length>0&&v===a[a.length-1].ref.current;d.style.bottom="0px";let t=Math.max(i-I,M+(e?k:0)+(u.clientHeight-x.offsetTop-x.offsetHeight)+g);d.style.height=N+t+"px"}else{let e=a.length>0&&v===a[0].ref.current;d.style.top="0px";let t=Math.max(I,p+x.offsetTop+(e?C:0)+M);d.style.height=t+(b-N)+"px",x.scrollTop=N-I+x.offsetTop}d.style.margin="10px 0",d.style.minHeight=y+"px",d.style.maxHeight=i+"px",l?.(),requestAnimationFrame(()=>f.current=!0)}},[h,o.trigger,o.valueNode,d,u,x,v,w,o.dir,l]);(0,B.useLayoutEffect)(()=>y(),[y]);let[j,C]=n.useState();(0,B.useLayoutEffect)(()=>{u&&C(window.getComputedStyle(u).zIndex)},[u]);let I=n.useCallback(e=>{e&&!0===g.current&&(y(),b?.(),g.current=!1)},[y,b]);return(0,t.jsx)(ex,{scope:a,contentWrapper:d,shouldExpandOnScrollRef:f,onScrollButtonChange:I,children:(0,t.jsx)("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:(0,t.jsx)(D.Primitive.div,{...i,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});ef.displayName="SelectItemAlignedPosition";var eg=n.forwardRef((e,n)=>{let{__scopeSelect:r,align:a="start",collisionPadding:l=10,...i}=e,o=X(r);return(0,t.jsx)(T.Content,{...o,...i,ref:n,align:a,collisionPadding:l,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});eg.displayName="SelectPopperPosition";var[ex,ev]=Y(ed,{}),ew="SelectViewport",eb=n.forwardRef((e,r)=>{let{__scopeSelect:a,nonce:l,...i}=e,o=ep(ew,a),s=ev(ew,a),d=(0,k.useComposedRefs)(r,o.onViewportChange),c=n.useRef(0);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:l}),(0,t.jsx)(q.Slot,{scope:a,children:(0,t.jsx)(D.Primitive.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:(0,j.composeEventHandlers)(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=s;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-20,a=Math.max(parseFloat(n.style.minHeight),parseFloat(n.style.height));if(a<r){let l=a+e,i=Math.min(r,l),o=l-i;n.style.height=i+"px","0px"===n.style.bottom&&(t.scrollTop=o>0?o:0,n.style.justifyContent="flex-end")}}}c.current=t.scrollTop})})})]})});eb.displayName=ew;var ey="SelectGroup",[eS,ej]=Y(ey),eC=n.forwardRef((e,n)=>{let{__scopeSelect:r,...a}=e,l=(0,R.useId)();return(0,t.jsx)(eS,{scope:r,id:l,children:(0,t.jsx)(D.Primitive.div,{role:"group","aria-labelledby":l,...a,ref:n})})});eC.displayName=ey;var ek="SelectLabel",eI=n.forwardRef((e,n)=>{let{__scopeSelect:r,...a}=e,l=ej(ek,r);return(0,t.jsx)(D.Primitive.div,{id:l.id,...a,ref:n})});eI.displayName=ek;var eM="SelectItem",[eN,eP]=Y(eM),eE=n.forwardRef((e,r)=>{let{__scopeSelect:a,value:l,disabled:i=!1,textValue:o,...s}=e,d=J(eM,a),c=ep(eM,a),u=d.value===l,[p,m]=n.useState(o??""),[h,f]=n.useState(!1),g=(0,k.useComposedRefs)(r,e=>c.itemRefCallback?.(e,l,i)),x=(0,R.useId)(),v=n.useRef("touch"),w=()=>{i||(d.onValueChange(l),d.onOpenChange(!1))};if(""===l)throw Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return(0,t.jsx)(eN,{scope:a,value:l,disabled:i,textId:x,isSelected:u,onItemTextChange:n.useCallback(e=>{m(t=>t||(e?.textContent??"").trim())},[]),children:(0,t.jsx)(q.ItemSlot,{scope:a,value:l,disabled:i,textValue:p,children:(0,t.jsx)(D.Primitive.div,{role:"option","aria-labelledby":x,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...s,ref:g,onFocus:(0,j.composeEventHandlers)(s.onFocus,()=>f(!0)),onBlur:(0,j.composeEventHandlers)(s.onBlur,()=>f(!1)),onClick:(0,j.composeEventHandlers)(s.onClick,()=>{"mouse"!==v.current&&w()}),onPointerUp:(0,j.composeEventHandlers)(s.onPointerUp,()=>{"mouse"===v.current&&w()}),onPointerDown:(0,j.composeEventHandlers)(s.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:(0,j.composeEventHandlers)(s.onPointerMove,e=>{v.current=e.pointerType,i?c.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:(0,j.composeEventHandlers)(s.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:(0,j.composeEventHandlers)(s.onKeyDown,e=>{(c.searchRef?.current===""||" "!==e.key)&&(U.includes(e.key)&&w()," "===e.key&&e.preventDefault())})})})})});eE.displayName=eM;var eR="SelectItemText",eT=n.forwardRef((e,r)=>{let{__scopeSelect:a,className:l,style:i,...o}=e,s=J(eR,a),d=ep(eR,a),c=eP(eR,a),u=et(eR,a),[p,m]=n.useState(null),h=(0,k.useComposedRefs)(r,e=>m(e),c.onItemTextChange,e=>d.itemTextRefCallback?.(e,c.value,c.disabled)),f=p?.textContent,g=n.useMemo(()=>(0,t.jsx)("option",{value:c.value,disabled:c.disabled,children:f},c.value),[c.disabled,c.value,f]),{onNativeOptionAdd:x,onNativeOptionRemove:v}=u;return(0,B.useLayoutEffect)(()=>(x(g),()=>v(g)),[x,v,g]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(D.Primitive.span,{id:c.textId,...o,ref:h}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?y.createPortal(o.children,s.valueNode):null]})});eT.displayName=eR;var eA="SelectItemIndicator",eD=n.forwardRef((e,n)=>{let{__scopeSelect:r,...a}=e;return eP(eA,r).isSelected?(0,t.jsx)(D.Primitive.span,{"aria-hidden":!0,...a,ref:n}):null});eD.displayName=eA;var eL="SelectScrollUpButton",eF=n.forwardRef((e,r)=>{let a=ep(eL,e.__scopeSelect),l=ev(eL,e.__scopeSelect),[i,o]=n.useState(!1),s=(0,k.useComposedRefs)(r,l.onScrollButtonChange);return(0,B.useLayoutEffect)(()=>{if(a.viewport&&a.isPositioned){let e=function(){o(t.scrollTop>0)},t=a.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[a.viewport,a.isPositioned]),i?(0,t.jsx)(ez,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=a;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});eF.displayName=eL;var eH="SelectScrollDownButton",eB=n.forwardRef((e,r)=>{let a=ep(eH,e.__scopeSelect),l=ev(eH,e.__scopeSelect),[i,o]=n.useState(!1),s=(0,k.useComposedRefs)(r,l.onScrollButtonChange);return(0,B.useLayoutEffect)(()=>{if(a.viewport&&a.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;o(Math.ceil(t.scrollTop)<e)},t=a.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[a.viewport,a.isPositioned]),i?(0,t.jsx)(ez,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=a;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});eB.displayName=eH;var ez=n.forwardRef((e,r)=>{let{__scopeSelect:a,onAutoScroll:l,...i}=e,o=ep("SelectScrollButton",a),s=n.useRef(null),d=G(a),c=n.useCallback(()=>{null!==s.current&&(window.clearInterval(s.current),s.current=null)},[]);return n.useEffect(()=>()=>c(),[c]),(0,B.useLayoutEffect)(()=>{let e=d().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[d]),(0,t.jsx)(D.Primitive.div,{"aria-hidden":!0,...i,ref:r,style:{flexShrink:0,...i.style},onPointerDown:(0,j.composeEventHandlers)(i.onPointerDown,()=>{null===s.current&&(s.current=window.setInterval(l,50))}),onPointerMove:(0,j.composeEventHandlers)(i.onPointerMove,()=>{o.onItemLeave?.(),null===s.current&&(s.current=window.setInterval(l,50))}),onPointerLeave:(0,j.composeEventHandlers)(i.onPointerLeave,()=>{c()})})}),e_=n.forwardRef((e,n)=>{let{__scopeSelect:r,...a}=e;return(0,t.jsx)(D.Primitive.div,{"aria-hidden":!0,...a,ref:n})});e_.displayName="SelectSeparator";var eV="SelectArrow",eW=n.forwardRef((e,n)=>{let{__scopeSelect:r,...a}=e,l=X(r),i=J(eV,r),o=ep(eV,r);return i.open&&"popper"===o.position?(0,t.jsx)(T.Arrow,{...l,...a,ref:n}):null});eW.displayName=eV;var eO=n.forwardRef(({__scopeSelect:e,value:r,...a},l)=>{let i=n.useRef(null),o=(0,k.useComposedRefs)(l,i),s=(0,z.usePrevious)(r);return n.useEffect(()=>{let e=i.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLSelectElement.prototype,"value").set;if(s!==r&&t){let n=new Event("change",{bubbles:!0});t.call(e,r),e.dispatchEvent(n)}},[s,r]),(0,t.jsx)(D.Primitive.select,{...a,style:{..._.VISUALLY_HIDDEN_STYLES,...a.style},ref:o,defaultValue:r})});function eU(e){return""===e||void 0===e}function eK(e){let t=(0,F.useCallbackRef)(e),r=n.useRef(""),a=n.useRef(0),l=n.useCallback(e=>{let n=r.current+e;t(n),function e(t){r.current=t,window.clearTimeout(a.current),""!==t&&(a.current=window.setTimeout(()=>e(""),1e3))}(n)},[t]),i=n.useCallback(()=>{r.current="",window.clearTimeout(a.current)},[]);return n.useEffect(()=>()=>window.clearTimeout(a.current),[]),[r,l,i]}function eq(e,t,n){var r,a;let l=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,o=(r=e,a=Math.max(i,0),r.map((e,t)=>r[(a+t)%r.length]));1===l.length&&(o=o.filter(e=>e!==n));let s=o.find(e=>e.textValue.toLowerCase().startsWith(l.toLowerCase()));return s!==n?s:void 0}eO.displayName="SelectBubbleInput",e.s(["Arrow",()=>eW,"Content",()=>ec,"Group",()=>eC,"Icon",()=>eo,"Item",()=>eE,"ItemIndicator",()=>eD,"ItemText",()=>eT,"Label",()=>eI,"Portal",()=>es,"Root",()=>en,"ScrollDownButton",()=>eB,"ScrollUpButton",()=>eF,"Select",()=>en,"SelectArrow",()=>eW,"SelectContent",()=>ec,"SelectGroup",()=>eC,"SelectIcon",()=>eo,"SelectItem",()=>eE,"SelectItemIndicator",()=>eD,"SelectItemText",()=>eT,"SelectLabel",()=>eI,"SelectPortal",()=>es,"SelectScrollDownButton",()=>eB,"SelectScrollUpButton",()=>eF,"SelectSeparator",()=>e_,"SelectTrigger",()=>ea,"SelectValue",()=>ei,"SelectViewport",()=>eb,"Separator",()=>e_,"Trigger",()=>ea,"Value",()=>ei,"Viewport",()=>eb,"createSelectScope",()=>Z],83830);var eG=e.i(83830),eG=eG,e$=e.i(99105);let eY=(0,a.default)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),eZ=eG.Root;eG.Group;let eX=eG.Value,eQ=n.forwardRef(({className:e,children:n,...r},a)=>(0,t.jsxs)(eG.Trigger,{ref:a,className:(0,v.cn)("border-input ring-offset-background placeholder:text-muted-foreground focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-sm focus:ring-1 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[n,(0,t.jsx)(eG.Icon,{asChild:!0,children:(0,t.jsx)(e$.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));eQ.displayName=eG.Trigger.displayName;let eJ=n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(eG.ScrollUpButton,{ref:r,className:(0,v.cn)("flex cursor-default items-center justify-center py-1",e),...n,children:(0,t.jsx)(eY,{className:"h-4 w-4"})}));eJ.displayName=eG.ScrollUpButton.displayName;let e0=n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(eG.ScrollDownButton,{ref:r,className:(0,v.cn)("flex cursor-default items-center justify-center py-1",e),...n,children:(0,t.jsx)(e$.ChevronDown,{className:"h-4 w-4"})}));e0.displayName=eG.ScrollDownButton.displayName;let e1=n.forwardRef(({className:e,children:n,position:r="popper",...a},l)=>(0,t.jsx)(eG.Portal,{children:(0,t.jsxs)(eG.Content,{ref:l,className:(0,v.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md","popper"===r&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...a,children:[(0,t.jsx)(eJ,{}),(0,t.jsx)(eG.Viewport,{className:(0,v.cn)("p-1","popper"===r&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),(0,t.jsx)(e0,{})]})}));e1.displayName=eG.Content.displayName,n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(eG.Label,{ref:r,className:(0,v.cn)("px-2 py-1.5 text-sm font-semibold",e),...n})).displayName=eG.Label.displayName;let e2=n.forwardRef(({className:e,children:n,...a},l)=>(0,t.jsxs)(eG.Item,{ref:l,className:(0,v.cn)("focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default items-center rounded-sm py-1.5 pr-8 pl-2 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[(0,t.jsx)("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,t.jsx)(eG.ItemIndicator,{children:(0,t.jsx)(r.Check,{className:"h-4 w-4"})})}),(0,t.jsx)(eG.ItemText,{children:n})]}));e2.displayName=eG.Item.displayName,n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(eG.Separator,{ref:r,className:(0,v.cn)("bg-muted -mx-1 my-1 h-px",e),...n})).displayName=eG.Separator.displayName;var e3=e.i(21023);let e5=(0,e3.createServerReference)("4008dbb1a3979f44692136685029e30f068acd44f8",e3.callServer,void 0,e3.findSourceMapURL,"updateSettingsAction");var e4=e.i(17406),e8=e.i(98804),e6=e.i(44229),e9=e.i(83902);function e7(e){return(0,t.jsx)(e6.Code,{className:(0,v.cn)("h-4 w-4",e.className),...e})}function te({className:e}){return(0,t.jsx)(e8.default,{src:"/icons/editors/vscode.svg",alt:"VS Code",width:24,height:24,className:(0,v.cn)("rounded-sm object-contain",e)})}function tt({className:e}){return(0,t.jsx)(e8.default,{src:"/icons/agents/cursor.jpeg",alt:"Cursor",width:24,height:24,className:(0,v.cn)("rounded-sm object-contain",e)})}function tn({className:e}){return(0,t.jsx)(e8.default,{src:"/icons/editors/windsurf.svg",alt:"Windsurf",width:24,height:24,className:(0,v.cn)("rounded-sm object-contain",e)})}function tr({className:e}){return(0,t.jsx)(e8.default,{src:"/icons/editors/zed.svg",alt:"Zed",width:24,height:24,className:(0,v.cn)("rounded-sm object-contain",e)})}function ta({className:e,...n}){return(0,t.jsx)(e9.Rocket,{className:(0,v.cn)("h-4 w-4",e),...n})}te.displayName="VsCodeIcon",tt.displayName="CursorEditorIcon",tn.displayName="WindsurfIcon",tr.displayName="ZedIcon",ta.displayName="AntigravityIcon";let tl={vscode:te,cursor:tt,windsurf:tn,zed:tr,antigravity:ta};var ti=e.i(41413),to=e.i(77624),ts=["PageUp","PageDown"],td=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],tc={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},tu="Slider",[tp,tm,th]=(0,C.createCollection)(tu),[tf,tg]=(0,I.createContextScope)(tu,[th]),[tx,tv]=tf(tu),tw=n.forwardRef((e,r)=>{let{name:a,min:l=0,max:i=100,step:o=1,orientation:s="horizontal",disabled:d=!1,minStepsBetweenThumbs:c=0,defaultValue:u=[l],value:p,onValueChange:m=()=>{},onValueCommit:h=()=>{},inverted:f=!1,form:g,...x}=e,v=n.useRef(new Set),w=n.useRef(0),b="horizontal"===s,[y=[],C]=(0,H.useControllableState)({prop:p,defaultProp:u,onChange:e=>{let t=[...v.current];t[w.current]?.focus(),m(e)}}),k=n.useRef(y);function I(e,t,{commit:n}={commit:!1}){let r,a=(String(o).split(".")[1]||"").length,s=Math.round((Math.round((e-l)/o)*o+l)*(r=Math.pow(10,a)))/r,d=(0,S.clamp)(s,[l,i]);C((e=[])=>{let r=function(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}(e,d,t);if(!function(e,t){if(t>0)return Math.min(...e.slice(0,-1).map((t,n)=>e[n+1]-t))>=t;return!0}(r,c*o))return e;{w.current=r.indexOf(d);let t=String(r)!==String(e);return t&&n&&h(r),t?r:e}})}return(0,t.jsx)(tx,{scope:e.__scopeSlider,name:a,disabled:d,min:l,max:i,valueIndexToChangeRef:w,thumbs:v.current,values:y,orientation:s,form:g,children:(0,t.jsx)(tp.Provider,{scope:e.__scopeSlider,children:(0,t.jsx)(tp.Slot,{scope:e.__scopeSlider,children:(0,t.jsx)(b?tS:tj,{"aria-disabled":d,"data-disabled":d?"":void 0,...x,ref:r,onPointerDown:(0,j.composeEventHandlers)(x.onPointerDown,()=>{d||(k.current=y)}),min:l,max:i,inverted:f,onSlideStart:d?void 0:function(e){let t=function(e,t){if(1===e.length)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}(y,e);I(e,t)},onSlideMove:d?void 0:function(e){I(e,w.current)},onSlideEnd:d?void 0:function(){let e=k.current[w.current];y[w.current]!==e&&h(y)},onHomeKeyDown:()=>!d&&I(l,0,{commit:!0}),onEndKeyDown:()=>!d&&I(i,y.length-1,{commit:!0}),onStepKeyDown:({event:e,direction:t})=>{if(!d){let n=ts.includes(e.key)||e.shiftKey&&td.includes(e.key),r=w.current;I(y[r]+o*(n?10:1)*t,r,{commit:!0})}}})})})})});tw.displayName=tu;var[tb,ty]=tf(tu,{startEdge:"left",endEdge:"right",size:"width",direction:1}),tS=n.forwardRef((e,r)=>{let{min:a,max:l,dir:i,inverted:o,onSlideStart:s,onSlideMove:d,onSlideEnd:c,onStepKeyDown:u,...p}=e,[m,h]=n.useState(null),f=(0,k.useComposedRefs)(r,e=>h(e)),g=n.useRef(void 0),x=(0,M.useDirection)(i),v="ltr"===x,w=v&&!o||!v&&o;function b(e){let t=g.current||m.getBoundingClientRect(),n=tD([0,t.width],w?[a,l]:[l,a]);return g.current=t,n(e-t.left)}return(0,t.jsx)(tb,{scope:e.__scopeSlider,startEdge:w?"left":"right",endEdge:w?"right":"left",direction:w?1:-1,size:"width",children:(0,t.jsx)(tC,{dir:x,"data-orientation":"horizontal",...p,ref:f,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:e=>{let t=b(e.clientX);s?.(t)},onSlideMove:e=>{let t=b(e.clientX);d?.(t)},onSlideEnd:()=>{g.current=void 0,c?.()},onStepKeyDown:e=>{let t=tc[w?"from-left":"from-right"].includes(e.key);u?.({event:e,direction:t?-1:1})}})})}),tj=n.forwardRef((e,r)=>{let{min:a,max:l,inverted:i,onSlideStart:o,onSlideMove:s,onSlideEnd:d,onStepKeyDown:c,...u}=e,p=n.useRef(null),m=(0,k.useComposedRefs)(r,p),h=n.useRef(void 0),f=!i;function g(e){let t=h.current||p.current.getBoundingClientRect(),n=tD([0,t.height],f?[l,a]:[a,l]);return h.current=t,n(e-t.top)}return(0,t.jsx)(tb,{scope:e.__scopeSlider,startEdge:f?"bottom":"top",endEdge:f?"top":"bottom",size:"height",direction:f?1:-1,children:(0,t.jsx)(tC,{"data-orientation":"vertical",...u,ref:m,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:e=>{let t=g(e.clientY);o?.(t)},onSlideMove:e=>{let t=g(e.clientY);s?.(t)},onSlideEnd:()=>{h.current=void 0,d?.()},onStepKeyDown:e=>{let t=tc[f?"from-bottom":"from-top"].includes(e.key);c?.({event:e,direction:t?-1:1})}})})}),tC=n.forwardRef((e,n)=>{let{__scopeSlider:r,onSlideStart:a,onSlideMove:l,onSlideEnd:i,onHomeKeyDown:o,onEndKeyDown:s,onStepKeyDown:d,...c}=e,u=tv(tu,r);return(0,t.jsx)(D.Primitive.span,{...c,ref:n,onKeyDown:(0,j.composeEventHandlers)(e.onKeyDown,e=>{"Home"===e.key?(o(e),e.preventDefault()):"End"===e.key?(s(e),e.preventDefault()):ts.concat(td).includes(e.key)&&(d(e),e.preventDefault())}),onPointerDown:(0,j.composeEventHandlers)(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),u.thumbs.has(t)?t.focus():a(e)}),onPointerMove:(0,j.composeEventHandlers)(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&l(e)}),onPointerUp:(0,j.composeEventHandlers)(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),i(e))})})}),tk="SliderTrack",tI=n.forwardRef((e,n)=>{let{__scopeSlider:r,...a}=e,l=tv(tk,r);return(0,t.jsx)(D.Primitive.span,{"data-disabled":l.disabled?"":void 0,"data-orientation":l.orientation,...a,ref:n})});tI.displayName=tk;var tM="SliderRange",tN=n.forwardRef((e,r)=>{let{__scopeSlider:a,...l}=e,i=tv(tM,a),o=ty(tM,a),s=n.useRef(null),d=(0,k.useComposedRefs)(r,s),c=i.values.length,u=i.values.map(e=>tA(e,i.min,i.max)),p=c>1?Math.min(...u):0,m=100-Math.max(...u);return(0,t.jsx)(D.Primitive.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...l,ref:d,style:{...e.style,[o.startEdge]:p+"%",[o.endEdge]:m+"%"}})});tN.displayName=tM;var tP="SliderThumb",tE=n.forwardRef((e,r)=>{let a=tm(e.__scopeSlider),[l,i]=n.useState(null),o=(0,k.useComposedRefs)(r,e=>i(e)),s=n.useMemo(()=>l?a().findIndex(e=>e.ref.current===l):-1,[a,l]);return(0,t.jsx)(tR,{...e,ref:o,index:s})}),tR=n.forwardRef((e,r)=>{var a,l,i,o,s;let d,c,{__scopeSlider:u,index:p,name:m,...h}=e,f=tv(tP,u),g=ty(tP,u),[x,v]=n.useState(null),w=(0,k.useComposedRefs)(r,e=>v(e)),b=!x||f.form||!!x.closest("form"),y=(0,to.useSize)(x),S=f.values[p],C=void 0===S?0:tA(S,f.min,f.max),I=(a=p,(l=f.values.length)>2?`Value ${a+1} of ${l}`:2===l?["Minimum","Maximum"][a]:void 0),M=y?.[g.size],N=M?(i=M,o=C,s=g.direction,c=tD([0,50],[0,d=i/2]),(d-c(o)*s)*s):0;return n.useEffect(()=>{if(x)return f.thumbs.add(x),()=>{f.thumbs.delete(x)}},[x,f.thumbs]),(0,t.jsxs)("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[g.startEdge]:`calc(${C}% + ${N}px)`},children:[(0,t.jsx)(tp.ItemSlot,{scope:e.__scopeSlider,children:(0,t.jsx)(D.Primitive.span,{role:"slider","aria-label":e["aria-label"]||I,"aria-valuemin":f.min,"aria-valuenow":S,"aria-valuemax":f.max,"aria-orientation":f.orientation,"data-orientation":f.orientation,"data-disabled":f.disabled?"":void 0,tabIndex:f.disabled?void 0:0,...h,ref:w,style:void 0===S?{display:"none"}:e.style,onFocus:(0,j.composeEventHandlers)(e.onFocus,()=>{f.valueIndexToChangeRef.current=p})})}),b&&(0,t.jsx)(tT,{name:m??(f.name?f.name+(f.values.length>1?"[]":""):void 0),form:f.form,value:S},p)]})});tE.displayName=tP;var tT=n.forwardRef(({__scopeSlider:e,value:r,...a},l)=>{let i=n.useRef(null),o=(0,k.useComposedRefs)(i,l),s=(0,z.usePrevious)(r);return n.useEffect(()=>{let e=i.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value").set;if(s!==r&&t){let n=new Event("input",{bubbles:!0});t.call(e,r),e.dispatchEvent(n)}},[s,r]),(0,t.jsx)(D.Primitive.input,{style:{display:"none"},...a,ref:o,defaultValue:r})});function tA(e,t,n){return(0,S.clamp)(100/(n-t)*(e-t),[0,100])}function tD(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}tT.displayName="RadioBubbleInput",e.s(["Range",()=>tN,"Root",()=>tw,"Slider",()=>tw,"SliderRange",()=>tN,"SliderThumb",()=>tE,"SliderTrack",()=>tI,"Thumb",()=>tE,"Track",()=>tI,"createSliderScope",()=>tg],29991);var tL=e.i(29991),tL=tL;function tF({className:e,defaultValue:r,value:a,min:l=0,max:i=100,...o}){let s=n.useMemo(()=>Array.isArray(a)?a:Array.isArray(r)?r:[l,i],[a,r,l,i]);return(0,t.jsxs)(tL.Root,{"data-slot":"slider",defaultValue:r,value:a,min:l,max:i,className:(0,v.cn)("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",e),...o,children:[(0,t.jsx)(tL.Track,{"data-slot":"slider-track",className:(0,v.cn)("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:(0,t.jsx)(tL.Range,{"data-slot":"slider-range",className:(0,v.cn)("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:s.length},(e,n)=>(0,t.jsx)(tL.Thumb,{"data-slot":"slider-thumb",className:"border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},n))]})}let tH=[60,120,300,600,900,1800,2700,3600,7200,10800,14400,21600,28800,43200,86400],tB=tH.length-1;function tz(e){let t=0,n=Math.abs(e-tH[0]);for(let r=1;r<tH.length;r++){let a=Math.abs(e-tH[r]);a<n&&(n=a,t=r)}return t}function t_({id:e,testId:r,value:a,onChange:l,onBlur:i,defaultSeconds:o=1800}){var s;let d,c,u=(""===a?o:parseInt(a,10))||o,[p,m]=(0,n.useState)(()=>tz(u)),h=tz(u);h!==p&&tH[p]!==u&&m(h);let f=(0,n.useCallback)(([e])=>{m(e),l(String(tH[e]))},[l]);return(0,t.jsxs)("div",{className:"flex w-55 items-center gap-2",children:[(0,t.jsx)(tF,{id:e,"data-testid":r,min:0,max:tB,step:1,value:[p],onValueChange:f,onValueCommit:()=>i(),className:"min-w-0 flex-1"}),(0,t.jsx)("span",{className:"text-muted-foreground shrink-0 text-right text-xs tabular-nums",children:(d=Math.floor((s=tH[p])/3600),c=Math.round(s%3600/60),0===d?`${c}m`:0===c?`${d}h`:`${d}h ${c}m`)})]})}let tV=[{value:e4.EditorType.VsCode,label:"VS Code"},{value:e4.EditorType.Cursor,label:"Cursor"},{value:e4.EditorType.Windsurf,label:"Windsurf"},{value:e4.EditorType.Zed,label:"Zed"},{value:e4.EditorType.Antigravity,label:"Antigravity"}],tW=[{value:"bash",label:"Bash"},{value:"zsh",label:"Zsh"},{value:"fish",label:"Fish"}],tO=[{id:"agent",label:"Agent",icon:l},{id:"environment",label:"Environment",icon:i.Terminal},{id:"workflow",label:"Workflow",icon:o.GitBranch},{id:"ci",label:"CI",icon:s},{id:"stage-timeouts",label:"Timeouts",icon:g.Timer},{id:"notifications",label:"Notifications",icon:d},{id:"feature-flags",label:"Flags",icon:c},{id:"database",label:"Database",icon:u}];function tU({label:e,description:n,htmlFor:r,children:a}){return(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4 border-b py-2.5 last:border-b-0",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)(w.Label,{htmlFor:r,className:"cursor-pointer text-sm font-normal whitespace-nowrap",children:e}),n?(0,t.jsx)("p",{className:"text-muted-foreground text-[11px] leading-tight",children:n}):null]}),(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:a})]})}function tK({label:e,description:n,id:r,testId:a,checked:l,onChange:i,disabled:o}){return(0,t.jsx)(tU,{label:e,description:n,htmlFor:r,children:(0,t.jsx)(b.Switch,{id:r,"data-testid":a,checked:l,onCheckedChange:i,disabled:o,className:(0,v.cn)("cursor-pointer",o&&"cursor-not-allowed opacity-50")})})}function tq({icon:e,title:n,description:r,badge:a,testId:l,children:i}){return(0,t.jsxs)("div",{className:"bg-background rounded-lg border","data-testid":l,children:[(0,t.jsxs)("div",{className:"bg-muted/30 border-b px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(e,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,t.jsx)("h2",{className:"text-sm font-semibold",children:n}),a?(0,t.jsx)("span",{className:"bg-muted text-muted-foreground rounded px-1.5 py-0.5 text-[9px] font-medium tracking-wider uppercase",children:a}):null]}),(0,t.jsx)("p",{className:"text-muted-foreground mt-0.5 text-[11px]",children:r})]}),(0,t.jsx)("div",{className:"px-4",children:i})]})}function tG({id:e,testId:n,value:r,onChange:a,onBlur:l,placeholder:i,min:o=1,max:s,step:d=1,suffix:c}){let u=""===r?void 0:parseInt(r,10);return(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)("div",{className:"flex items-center overflow-hidden rounded-md border",children:[(0,t.jsx)("button",{type:"button",onClick:()=>{a(String(Math.max(o,(u??parseInt(i,10))-d)))},onMouseUp:l,className:"text-muted-foreground hover:bg-muted hover:text-foreground flex h-8 w-7 cursor-pointer items-center justify-center border-r transition-colors","aria-label":"Decrease",children:(0,t.jsx)(p.default,{className:"h-3 w-3"})}),(0,t.jsx)("input",{id:e,"data-testid":n,type:"text",inputMode:"numeric",pattern:"[0-9]*",value:r,placeholder:i,onChange:e=>{a(e.target.value.replace(/[^0-9]/g,""))},onBlur:l,className:"h-8 w-14 bg-transparent text-center text-xs outline-none"}),(0,t.jsx)("button",{type:"button",onClick:()=>{let e;e=u??parseInt(i,10),a(String(null!=s?Math.min(s,e+d):e+d))},onMouseUp:l,className:"text-muted-foreground hover:bg-muted hover:text-foreground flex h-8 w-7 cursor-pointer items-center justify-center border-l transition-colors","aria-label":"Increase",children:(0,t.jsx)(m.Plus,{className:"h-3 w-3"})})]}),c?(0,t.jsx)("span",{className:"text-muted-foreground text-[11px]",children:c}):null]})}function t$({children:e}){return(0,t.jsx)("div",{className:"border-b pt-3 pb-1",children:(0,t.jsx)("span",{className:"text-muted-foreground text-[10px] font-semibold tracking-wider uppercase",children:e})})}function tY({children:e,links:n}){return(0,t.jsxs)("div",{className:"hidden pt-2 lg:block",children:[(0,t.jsx)("p",{className:"text-muted-foreground/70 text-[11px] leading-relaxed",children:e}),null!=n&&n.length>0?(0,t.jsx)("div",{className:"mt-2 flex flex-col gap-1",children:n.map(e=>(0,t.jsxs)("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-[10px] transition-colors",children:[(0,t.jsx)(h.ExternalLink,{className:"h-2.5 w-2.5"}),e.label]},e.href))}):null]})}function tZ({settings:e,shepHome:a,dbFileSize:p,availableTerminals:m}){let{showSaving:h,showSaved:w,save:b}=function(){let[e,t]=(0,n.useTransition)(),[r,a]=(0,n.useState)(!1),[l,i]=(0,n.useState)(!1),o=(0,n.useRef)(null),s=(0,n.useRef)(!1);return(0,n.useEffect)(()=>{e&&!r&&(a(!0),s.current=!1,o.current=setTimeout(()=>{o.current=null,s.current&&(a(!1),i(!0),setTimeout(()=>i(!1),2e3))},350)),!e&&r&&(s.current=!0,o.current||(a(!1),i(!0),setTimeout(()=>i(!1),2e3)))},[e,r]),{showSaving:r,showSaved:l,save:(0,n.useCallback)(e=>{t(async()=>{let t=await e5(e);t.success||x.toast.error(t.error??"Failed to save settings")})},[t])}}(),y=e.featureFlags??{skills:!1,envDeploy:!1,debug:!1,adoptBranch:!1},[S,j]=(0,n.useState)(e.agent.type),[C,k]=(0,n.useState)(e.environment.defaultEditor),[I,M]=(0,n.useState)(e.environment.shellPreference),[N,P]=(0,n.useState)(e.environment.terminalPreference??e4.TerminalType.System),E=m?m.filter(e=>e.available):[{id:e4.TerminalType.System,name:"System Terminal",available:!0}],[R,T]=(0,n.useState)(e.workflow.openPrOnImplementationComplete),[A,D]=(0,n.useState)(e.workflow.approvalGateDefaults.pushOnImplementationComplete),[L,F]=(0,n.useState)(e.workflow.approvalGateDefaults.allowPrd),[H,B]=(0,n.useState)(e.workflow.approvalGateDefaults.allowPlan),[z,_]=(0,n.useState)(e.workflow.approvalGateDefaults.allowMerge),[V,W]=(0,n.useState)(e.workflow.enableEvidence),[O,U]=(0,n.useState)(e.workflow.commitEvidence),[K,q]=(0,n.useState)(!1!==e.workflow.ciWatchEnabled),[G,$]=(0,n.useState)(null!=e.workflow.ciMaxFixAttempts?String(e.workflow.ciMaxFixAttempts):""),[Y,Z]=(0,n.useState)(null!=e.workflow.ciWatchTimeoutMs?String(Math.round(e.workflow.ciWatchTimeoutMs/1e3)):""),[X,Q]=(0,n.useState)(null!=e.workflow.ciLogMaxChars?String(e.workflow.ciLogMaxChars):""),[J,ee]=(0,n.useState)(null!=e.workflow.ciWatchPollIntervalSeconds?String(e.workflow.ciWatchPollIntervalSeconds):""),et=e.workflow.stageTimeouts,[en,er]=(0,n.useState)(String(Math.round((et?.analyzeMs??18e5)/1e3))),[ea,el]=(0,n.useState)(String(Math.round((et?.requirementsMs??18e5)/1e3))),[ei,eo]=(0,n.useState)(String(Math.round((et?.researchMs??18e5)/1e3))),[es,ed]=(0,n.useState)(String(Math.round((et?.planMs??18e5)/1e3))),[ec,eu]=(0,n.useState)(String(Math.round((et?.implementMs??18e5)/1e3))),[ep,em]=(0,n.useState)(String(Math.round((et?.mergeMs??18e5)/1e3))),eh=e.workflow.analyzeRepoTimeouts,[ef,eg]=(0,n.useState)(String(Math.round((eh?.analyzeMs??6e5)/1e3))),[ex,ev]=(0,n.useState)(e.notifications.inApp.enabled),[ew,eb]=(0,n.useState)({...e.notifications.events}),[ey,eS]=(0,n.useState)({...y}),ej=null!=e.workflow.ciMaxFixAttempts?String(e.workflow.ciMaxFixAttempts):"",eC=null!=e.workflow.ciWatchTimeoutMs?String(Math.round(e.workflow.ciWatchTimeoutMs/1e3)):"",ek=null!=e.workflow.ciLogMaxChars?String(e.workflow.ciLogMaxChars):"",eI=null!=e.workflow.ciWatchPollIntervalSeconds?String(e.workflow.ciWatchPollIntervalSeconds):"",eM=et?.analyzeMs!=null?String(Math.round(et.analyzeMs/1e3)):"",eN=et?.requirementsMs!=null?String(Math.round(et.requirementsMs/1e3)):"",eP=et?.researchMs!=null?String(Math.round(et.researchMs/1e3)):"",eE=et?.planMs!=null?String(Math.round(et.planMs/1e3)):"",eR=et?.implementMs!=null?String(Math.round(et.implementMs/1e3)):"",eT=et?.mergeMs!=null?String(Math.round(et.mergeMs/1e3)):"",eA=eh?.analyzeMs!=null?String(Math.round(eh.analyzeMs/1e3)):"";function eD(e){if(""===e)return;let t=parseInt(e,10);return Number.isNaN(t)||t<=0?void 0:t}function eL(e){if(void 0===e)return;let t=eD(e);return null!=t?1e3*t:void 0}function eF(e={}){let t=eD(e.ciTimeout??Y);return{workflow:{openPrOnImplementationComplete:e.openPr??R,approvalGateDefaults:{pushOnImplementationComplete:e.pushOnComplete??A,allowPrd:e.allowPrd??L,allowPlan:e.allowPlan??H,allowMerge:e.allowMerge??z},enableEvidence:e.enableEvidence??V,commitEvidence:e.commitEvidence??O,ciWatchEnabled:e.ciWatchEnabled??K,ciMaxFixAttempts:eD(e.ciMaxFix??G),ciWatchTimeoutMs:null!=t?1e3*t:void 0,ciLogMaxChars:eD(e.ciLogMax??X),ciWatchPollIntervalSeconds:eD(e.ciPollInterval??J),stageTimeouts:{analyzeMs:eL(e.analyzeTimeout??en),requirementsMs:eL(e.requirementsTimeout??ea),researchMs:eL(e.researchTimeout??ei),planMs:eL(e.planTimeout??es),implementMs:eL(e.implementTimeout??ec),mergeMs:eL(e.mergeTimeout??ep)},analyzeRepoTimeouts:{analyzeMs:eL(e.analyzeRepoTimeout??ef)}}}}function eH(e={}){return{notifications:{inApp:{enabled:e.inApp??ex},events:e.events??ew}}}let[eB,ez]=(0,n.useState)("agent");(0,n.useEffect)(()=>{let e=tO.map(e=>document.getElementById(`section-${e.id}`)).filter(Boolean);if(0===e.length)return;let t=new IntersectionObserver(e=>{for(let t of e)t.isIntersecting&&ez(t.target.id.replace("section-",""))},{rootMargin:"-65px 0px -60% 0px",threshold:0});for(let n of e)t.observe(n);return()=>t.disconnect()},[]);let e_=(0,n.useCallback)(e=>{let t=document.getElementById(`section-${e}`);t&&(t.scrollIntoView({behavior:"smooth",block:"start"}),t.style.animation="none",t.offsetHeight,t.style.animation="section-flash 1s ease-out")},[]);return(0,t.jsxs)("div",{"data-testid":"settings-page-client",className:"max-w-5xl",children:[(0,t.jsx)("div",{className:"bg-background/95 supports-backdrop-filter:bg-background/80 sticky top-0 z-10 grid grid-cols-1 gap-x-5 pt-6 pb-4 backdrop-blur lg:grid-cols-[1fr_280px]",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(f,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("h1",{className:"text-sm font-bold tracking-tight",children:"Settings"}),(0,t.jsxs)("span",{className:"relative h-4 w-16",children:[(0,t.jsx)("span",{className:(0,v.cn)("text-muted-foreground absolute inset-0 flex items-center text-xs transition-opacity duration-300",h?"opacity-100":"opacity-0"),children:"Saving..."}),(0,t.jsxs)("span",{className:(0,v.cn)("absolute inset-0 flex items-center gap-1 text-xs text-green-600 transition-opacity duration-300",w&&!h?"opacity-100":"opacity-0"),children:[(0,t.jsx)(r.Check,{className:"h-3 w-3"}),"Saved"]})]}),(0,t.jsx)("nav",{className:"ml-auto flex items-center gap-0.5",children:tO.map(e=>{let n=e.icon,r=eB===e.id;return(0,t.jsxs)("button",{type:"button",onClick:()=>e_(e.id),className:(0,v.cn)("flex cursor-pointer items-center gap-1 rounded-md px-1.5 py-1 text-[11px] transition-all",r?"bg-accent text-foreground font-medium":"text-muted-foreground/60 hover:text-foreground hover:bg-accent/50"),children:[(0,t.jsx)(n,{className:"h-3 w-3"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:e.label})]},e.id)})})]})}),(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsxs)("div",{id:"section-agent",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsx)(tq,{icon:l,title:"Agent",description:"AI coding agent and authentication",testId:"agent-settings-section",children:(0,t.jsx)(tU,{label:"Agent & Model",description:"Provider and model for all operations",htmlFor:"agent-model-picker",children:(0,t.jsx)(ti.AgentModelPicker,{initialAgentType:S,initialModel:e.models.default,mode:"settings",onAgentModelChange:e=>j(e),className:"w-55"})})}),(0,t.jsx)(tY,{links:[{label:"Agent system",href:"https://github.com/shep-ai/cli/blob/main/docs/architecture/agent-system.md"},{label:"Adding agents",href:"https://github.com/shep-ai/cli/blob/main/docs/development/adding-agents.md"},{label:"Configuration guide",href:"https://github.com/shep-ai/cli/blob/main/docs/guides/configuration.md"}],children:"Choose which AI coding agent powers your features. Each agent supports different models and capabilities. Authentication is resolved automatically via your active session."})]}),(0,t.jsxs)("div",{id:"section-environment",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tq,{icon:i.Terminal,title:"Environment",description:"Editor, shell, and terminal preferences",testId:"environment-settings-section",children:[(0,t.jsx)(tU,{label:"Default Editor",description:"Editor launched for file operations",htmlFor:"default-editor",children:(0,t.jsxs)(eZ,{value:C,onValueChange:e=>{k(e),b({environment:{defaultEditor:e,shellPreference:I,terminalPreference:N}})},children:[(0,t.jsx)(eQ,{id:"default-editor","data-testid":"editor-select",className:"w-55 cursor-pointer text-xs",children:(0,t.jsx)(eX,{})}),(0,t.jsx)(e1,{children:tV.map(e=>{var n;let r=(n=e.value)&&n in tl?tl[n]:e7;return(0,t.jsx)(e2,{value:e.value,children:(0,t.jsxs)("span",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)(r,{className:"h-4 w-4 shrink-0"}),e.label]})},e.value)})})]})}),(0,t.jsx)(tU,{label:"Shell",description:"Default shell for generated scripts",htmlFor:"shell-preference",children:(0,t.jsxs)(eZ,{value:I,onValueChange:e=>{M(e),b({environment:{defaultEditor:C,shellPreference:e,terminalPreference:N}})},children:[(0,t.jsx)(eQ,{id:"shell-preference","data-testid":"shell-select",className:"w-55 cursor-pointer text-xs",children:(0,t.jsx)(eX,{})}),(0,t.jsx)(e1,{children:tW.map(e=>(0,t.jsx)(e2,{value:e.value,children:e.label},e.value))})]})}),(0,t.jsx)(tU,{label:"Terminal",description:"Terminal emulator for shell sessions",htmlFor:"terminal-preference",children:(0,t.jsxs)(eZ,{value:N,onValueChange:e=>{P(e),b({environment:{defaultEditor:C,shellPreference:I,terminalPreference:e}})},children:[(0,t.jsx)(eQ,{id:"terminal-preference","data-testid":"terminal-select",className:"w-55 cursor-pointer text-xs",children:(0,t.jsx)(eX,{})}),(0,t.jsx)(e1,{children:E.map(e=>(0,t.jsx)(e2,{value:e.id,children:e.name},e.id))})]})})]}),(0,t.jsx)(tY,{links:[{label:"Configuration guide",href:"https://github.com/shep-ai/cli/blob/main/docs/guides/configuration.md"}],children:"Your preferred editor opens files for review. The shell setting controls generated scripts. The terminal emulator is launched when opening shell sessions from the web UI."})]}),(0,t.jsxs)("div",{id:"section-workflow",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tq,{icon:o.GitBranch,title:"Workflow",description:"Automation behavior after implementation",testId:"workflow-settings-section",children:[(0,t.jsx)(t$,{children:"Approve"}),(0,t.jsx)(tK,{label:"Auto-approve PRD",description:"Skip manual review of requirements",id:"allow-prd",testId:"switch-allow-prd",checked:L,onChange:e=>{F(e),b(eF({allowPrd:e}))}}),(0,t.jsx)(tK,{label:"Auto-approve Plan",description:"Skip manual review of implementation plan",id:"allow-plan",testId:"switch-allow-plan",checked:H,onChange:e=>{B(e),b(eF({allowPlan:e}))}}),(0,t.jsx)(tK,{label:"Auto-approve Merge",description:"Merge without manual review",id:"allow-merge",testId:"switch-allow-merge",checked:z,onChange:e=>{_(e),b(eF({allowMerge:e}))}}),(0,t.jsx)(t$,{children:"Evidence"}),(0,t.jsx)(tK,{label:"Collect evidence",description:"Capture screenshots and artifacts after implementation",id:"enable-evidence",testId:"switch-enable-evidence",checked:V,onChange:e=>{W(e),e?b(eF({enableEvidence:e})):(U(!1),b(eF({enableEvidence:e,commitEvidence:!1})))}}),(0,t.jsx)(tK,{label:"Add evidence to PR",description:"Include evidence in the pull request body",id:"commit-evidence",testId:"switch-commit-evidence",checked:O,disabled:!V||!R,onChange:e=>{U(e),b(eF({commitEvidence:e}))}}),(0,t.jsx)(t$,{children:"Git"}),(0,t.jsx)(tK,{label:"Push on complete",description:"Push to remote when implementation finishes",id:"push-on-complete",testId:"switch-push-on-complete",checked:A,onChange:e=>{D(e),b(eF({pushOnComplete:e}))}}),(0,t.jsx)(tK,{label:"Open PR on complete",description:"Create a pull request when done",id:"open-pr",testId:"switch-open-pr",checked:R,onChange:e=>{T(e),e?b(eF({openPr:e})):(U(!1),b(eF({openPr:e,commitEvidence:!1})))}}),(0,t.jsx)(tK,{label:"Watch CI after push",description:"Monitor CI and auto-fix failures. Disable to avoid rate limits.",id:"ci-watch-enabled",testId:"switch-ci-watch-enabled",checked:K,onChange:e=>{q(e),b(eF({ciWatchEnabled:e}))}})]}),(0,t.jsx)(tY,{links:[{label:"Approval gates",href:"https://github.com/shep-ai/cli/blob/main/specs/016-hitl-approval-gates/spec.yaml"},{label:"Push & PR flags",href:"https://github.com/shep-ai/cli/blob/main/specs/037-feature-pr-push-flags/spec.yaml"}],children:"Control how autonomous each feature run is. Auto-approve skips the human review pause at each phase. Push and PR options control what happens after successful implementation."})]}),(0,t.jsxs)("div",{id:"section-ci",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tq,{icon:s,title:"Continuous Integration",description:"Limits and timeouts for CI monitoring",testId:"ci-settings-section",children:[(0,t.jsx)(tU,{label:"Max fix attempts",description:"Agent retries on failing CI",htmlFor:"ci-max-fix",children:(0,t.jsx)(tG,{id:"ci-max-fix",testId:"ci-max-fix-input",placeholder:"3",value:G,onChange:$,onBlur:()=>{G!==ej&&b(eF({ciMaxFix:G}))},min:1,max:10})}),(0,t.jsx)(tU,{label:"Watch timeout",description:"Max wait for CI completion",htmlFor:"ci-timeout",children:(0,t.jsx)(tG,{id:"ci-timeout",testId:"ci-timeout-input",placeholder:"300",value:Y,onChange:Z,onBlur:()=>{Y!==eC&&b(eF({ciTimeout:Y}))},min:30,step:30,suffix:"sec"})}),(0,t.jsx)(tU,{label:"Max log size",description:"Truncate CI logs beyond this limit",htmlFor:"ci-log-max",children:(0,t.jsx)(tG,{id:"ci-log-max",testId:"ci-log-max-input",placeholder:"50000",value:X,onChange:Q,onBlur:()=>{X!==ek&&b(eF({ciLogMax:X}))},min:1e3,step:5e3,suffix:"chars"})}),(0,t.jsx)(tU,{label:"Poll interval",description:"How often to check GitHub for CI status updates",htmlFor:"ci-poll-interval",children:(0,t.jsx)(tG,{id:"ci-poll-interval",testId:"ci-poll-interval-input",placeholder:"30",value:J,onChange:ee,onBlur:()=>{J!==eI&&b(eF({ciPollInterval:J}))},min:5,step:5,suffix:"sec"})})]}),(0,t.jsx)(tY,{links:[{label:"CI/CD pipeline",href:"https://github.com/shep-ai/cli/blob/main/docs/development/cicd.md"},{label:"CI security gates",href:"https://github.com/shep-ai/cli/blob/main/specs/003-cicd-security-gates/spec.md"}],children:"When a feature completes, the agent can watch CI and auto-fix failures. These limits prevent runaway retries and control how much log output is sent to the agent for analysis."})]}),(0,t.jsxs)("div",{id:"section-stage-timeouts",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tq,{icon:g.Timer,title:"Stage Timeouts",description:"Maximum execution time per agent stage",testId:"stage-timeouts-settings-section",children:[(0,t.jsx)(t$,{children:"Feature Agent"}),(0,t.jsx)(tU,{label:"Analyze",description:"Repository analysis timeout",htmlFor:"timeout-analyze",children:(0,t.jsx)(t_,{id:"timeout-analyze",testId:"timeout-analyze-input",value:en,onChange:er,onBlur:()=>{en!==eM&&b(eF({analyzeTimeout:en}))},defaultSeconds:1800})}),(0,t.jsx)(tU,{label:"Requirements",description:"Requirements gathering timeout",htmlFor:"timeout-requirements",children:(0,t.jsx)(t_,{id:"timeout-requirements",testId:"timeout-requirements-input",value:ea,onChange:el,onBlur:()=>{ea!==eN&&b(eF({requirementsTimeout:ea}))},defaultSeconds:1800})}),(0,t.jsx)(tU,{label:"Research",description:"Technical research timeout",htmlFor:"timeout-research",children:(0,t.jsx)(t_,{id:"timeout-research",testId:"timeout-research-input",value:ei,onChange:eo,onBlur:()=>{ei!==eP&&b(eF({researchTimeout:ei}))},defaultSeconds:1800})}),(0,t.jsx)(tU,{label:"Plan",description:"Implementation planning timeout",htmlFor:"timeout-plan",children:(0,t.jsx)(t_,{id:"timeout-plan",testId:"timeout-plan-input",value:es,onChange:ed,onBlur:()=>{es!==eE&&b(eF({planTimeout:es}))},defaultSeconds:1800})}),(0,t.jsx)(tU,{label:"Implement",description:"Code implementation timeout",htmlFor:"timeout-implement",children:(0,t.jsx)(t_,{id:"timeout-implement",testId:"timeout-implement-input",value:ec,onChange:eu,onBlur:()=>{ec!==eR&&b(eF({implementTimeout:ec}))},defaultSeconds:1800})}),(0,t.jsx)(tU,{label:"Merge",description:"PR creation and merge timeout",htmlFor:"timeout-merge",children:(0,t.jsx)(t_,{id:"timeout-merge",testId:"timeout-merge-input",value:ep,onChange:em,onBlur:()=>{ep!==eT&&b(eF({mergeTimeout:ep}))},defaultSeconds:1800})}),(0,t.jsx)(t$,{children:"Analyze Repository Agent"}),(0,t.jsx)(tU,{label:"Analyze",description:"Repository analysis timeout",htmlFor:"timeout-analyze-repo",children:(0,t.jsx)(t_,{id:"timeout-analyze-repo",testId:"timeout-analyze-repo-input",value:ef,onChange:eg,onBlur:()=>{ef!==eA&&b(eF({analyzeRepoTimeout:ef}))},defaultSeconds:600})})]}),(0,t.jsx)(tY,{children:"Each agent has independently configurable stage timeouts. When a stage exceeds its timeout, the agent is terminated. Longer timeouts are useful for complex implementations. Feature agent defaults to 30 minutes per stage. Analyze repository agent defaults to 10 minutes."})]}),(0,t.jsxs)("div",{id:"section-notifications",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tq,{icon:d,title:"Notifications",description:"How and when you get notified",testId:"notification-settings-section",children:[(0,t.jsx)(t$,{children:"Channels"}),(0,t.jsx)(tK,{label:"In-app",description:"Notifications inside the Shep UI",id:"notif-in-app",testId:"switch-in-app",checked:ex,onChange:e=>{ev(e),b(eH({inApp:e}))}}),(0,t.jsx)(t$,{children:"Agent Events"}),(0,t.jsx)(tK,{label:"Agent started",id:"notif-event-agentStarted",testId:"switch-event-agentStarted",checked:ew.agentStarted,onChange:e=>{let t={...ew,agentStarted:e};eb(t),b(eH({events:t}))}}),(0,t.jsx)(tK,{label:"Phase completed",id:"notif-event-phaseCompleted",testId:"switch-event-phaseCompleted",checked:ew.phaseCompleted,onChange:e=>{let t={...ew,phaseCompleted:e};eb(t),b(eH({events:t}))}}),(0,t.jsx)(tK,{label:"Waiting approval",id:"notif-event-waitingApproval",testId:"switch-event-waitingApproval",checked:ew.waitingApproval,onChange:e=>{let t={...ew,waitingApproval:e};eb(t),b(eH({events:t}))}}),(0,t.jsx)(tK,{label:"Agent completed",id:"notif-event-agentCompleted",testId:"switch-event-agentCompleted",checked:ew.agentCompleted,onChange:e=>{let t={...ew,agentCompleted:e};eb(t),b(eH({events:t}))}}),(0,t.jsx)(tK,{label:"Agent failed",id:"notif-event-agentFailed",testId:"switch-event-agentFailed",checked:ew.agentFailed,onChange:e=>{let t={...ew,agentFailed:e};eb(t),b(eH({events:t}))}}),(0,t.jsx)(t$,{children:"Pull Request Events"}),(0,t.jsx)(tK,{label:"PR merged",id:"notif-event-prMerged",testId:"switch-event-prMerged",checked:ew.prMerged,onChange:e=>{let t={...ew,prMerged:e};eb(t),b(eH({events:t}))}}),(0,t.jsx)(tK,{label:"PR closed",id:"notif-event-prClosed",testId:"switch-event-prClosed",checked:ew.prClosed,onChange:e=>{let t={...ew,prClosed:e};eb(t),b(eH({events:t}))}}),(0,t.jsx)(tK,{label:"PR checks passed",id:"notif-event-prChecksPassed",testId:"switch-event-prChecksPassed",checked:ew.prChecksPassed,onChange:e=>{let t={...ew,prChecksPassed:e};eb(t),b(eH({events:t}))}}),(0,t.jsx)(tK,{label:"PR checks failed",id:"notif-event-prChecksFailed",testId:"switch-event-prChecksFailed",checked:ew.prChecksFailed,onChange:e=>{let t={...ew,prChecksFailed:e};eb(t),b(eH({events:t}))}}),(0,t.jsx)(tK,{label:"PR blocked",id:"notif-event-prBlocked",testId:"switch-event-prBlocked",checked:ew.prBlocked,onChange:e=>{let t={...ew,prBlocked:e};eb(t),b(eH({events:t}))}}),(0,t.jsx)(tK,{label:"Merge review ready",id:"notif-event-mergeReviewReady",testId:"switch-event-mergeReviewReady",checked:ew.mergeReviewReady,onChange:e=>{let t={...ew,mergeReviewReady:e};eb(t),b(eH({events:t}))}})]}),(0,t.jsx)(tY,{links:[{label:"Notification system",href:"https://github.com/shep-ai/cli/blob/main/specs/021-agent-notifications/spec.yaml"}],children:"In-app toast notifications keep you in the loop. Fine-tune which agent lifecycle events trigger a notification."})]}),(0,t.jsxs)("div",{id:"section-feature-flags",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tq,{icon:c,title:"Feature Flags",description:"Enable or disable experimental features",badge:"Experimental",testId:"feature-flags-settings-section",children:[(0,t.jsx)(tK,{label:"Skills",description:"Enable the skills system for agent capabilities",id:"flag-skills",testId:"switch-flag-skills",checked:ey.skills,onChange:e=>{let t={...ey,skills:e};eS(t),b({featureFlags:t})}}),(0,t.jsx)(tK,{label:"Deployments",description:"Enable environment deployment workflows",id:"flag-envDeploy",testId:"switch-flag-envDeploy",checked:ey.envDeploy,onChange:e=>{let t={...ey,envDeploy:e};eS(t),b({featureFlags:t})}}),(0,t.jsx)(tK,{label:"Debug",description:"Show debug panels and verbose logging",id:"flag-debug",testId:"switch-flag-debug",checked:ey.debug,onChange:e=>{let t={...ey,debug:e};eS(t),b({featureFlags:t})}}),(0,t.jsx)(tK,{label:"Adopt Branch",description:"Import existing branches as tracked features",id:"flag-adoptBranch",testId:"switch-flag-adoptBranch",checked:ey.adoptBranch,onChange:e=>{let t={...ey,adoptBranch:e};eS(t),b({featureFlags:t})}})]}),(0,t.jsx)(tY,{children:"Experimental features that are still under development. Enable at your own risk — they may change or be removed in future versions. Debug mode adds verbose logging useful for troubleshooting."})]}),(0,t.jsxs)("div",{id:"section-database",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tq,{icon:u,title:"Database",description:"Local storage information",testId:"database-settings-section",children:[(0,t.jsx)(tU,{label:"Location",description:"Path to the local SQLite database",children:(0,t.jsx)("span",{className:"text-muted-foreground max-w-50 truncate font-mono text-xs","data-testid":"shep-home-path",children:a})}),(0,t.jsx)(tU,{label:"Size",children:(0,t.jsx)("span",{className:"text-muted-foreground text-xs","data-testid":"db-file-size",children:p})})]}),(0,t.jsx)(tY,{links:[{label:"Settings service",href:"https://github.com/shep-ai/cli/blob/main/docs/architecture/settings-service.md"},{label:"Settings spec",href:"https://github.com/shep-ai/cli/blob/main/specs/005-global-settings-service/spec.md"}],children:"All settings are stored in a local SQLite database at ~/.shep/data. The database uses a singleton record pattern with automatic migrations on startup."})]})]})]})}e.s(["SettingsPageClient",()=>tZ],41952)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,41952,e=>{"use strict";var t=e.i(20314),n=e.i(79054),r=e.i(23925),a=e.i(3645);let l=(0,a.default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);var i=e.i(38573),o=e.i(49228);let s=(0,a.default)("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),d=(0,a.default)("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]),c=(0,a.default)("flag",[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]]),u=(0,a.default)("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);var p=e.i(10714),p=p,m=e.i(3214),h=e.i(30702);let f=(0,a.default)("settings-2",[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);var g=e.i(58860),x=e.i(60112),v=e.i(31777),w=e.i(41957),b=e.i(51911),y=e.i(26036),S=e.i(27069),j=e.i(91967),C=e.i(87342),k=e.i(5978),I=e.i(22528),M=e.i(66033),N=e.i(53532),P=e.i(41687),E=e.i(56720),R=e.i(13123),T=e.i(52740),A=e.i(39979),D=e.i(87620),L=e.i(86874),F=e.i(29297),H=e.i(36589),B=e.i(5192),z=e.i(23405),_=e.i(1693),V=e.i(73772),W=e.i(13044),O=[" ","Enter","ArrowUp","ArrowDown"],U=[" ","Enter"],K="Select",[q,G,$]=(0,C.createCollection)(K),[Y,Z]=(0,I.createContextScope)(K,[$,T.createPopperScope]),X=(0,T.createPopperScope)(),[Q,J]=Y(K),[ee,et]=Y(K),en=e=>{let{__scopeSelect:r,children:a,open:l,defaultOpen:i,onOpenChange:o,value:s,defaultValue:d,onValueChange:c,dir:u,name:p,autoComplete:m,disabled:h,required:f,form:g}=e,x=X(r),[v,w]=n.useState(null),[b,y]=n.useState(null),[S,j]=n.useState(!1),C=(0,M.useDirection)(u),[k,I]=(0,H.useControllableState)({prop:l,defaultProp:i??!1,onChange:o,caller:K}),[N,P]=(0,H.useControllableState)({prop:s,defaultProp:d,onChange:c,caller:K}),E=n.useRef(null),A=!v||g||!!v.closest("form"),[D,L]=n.useState(new Set),F=Array.from(D).map(e=>e.props.value).join(";");return(0,t.jsx)(T.Root,{...x,children:(0,t.jsxs)(Q,{required:f,scope:r,trigger:v,onTriggerChange:w,valueNode:b,onValueNodeChange:y,valueNodeHasChildren:S,onValueNodeHasChildrenChange:j,contentId:(0,R.useId)(),value:N,onValueChange:P,open:k,onOpenChange:I,dir:C,triggerPointerDownPosRef:E,disabled:h,children:[(0,t.jsx)(q.Provider,{scope:r,children:(0,t.jsx)(ee,{scope:e.__scopeSelect,onNativeOptionAdd:n.useCallback(e=>{L(t=>new Set(t).add(e))},[]),onNativeOptionRemove:n.useCallback(e=>{L(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:a})}),A?(0,t.jsxs)(eO,{"aria-hidden":!0,required:f,tabIndex:-1,name:p,autoComplete:m,value:N,onChange:e=>P(e.target.value),disabled:h,form:g,children:[void 0===N?(0,t.jsx)("option",{value:""}):null,Array.from(D)]},F):null]})})};en.displayName=K;var er="SelectTrigger",ea=n.forwardRef((e,r)=>{let{__scopeSelect:a,disabled:l=!1,...i}=e,o=X(a),s=J(er,a),d=s.disabled||l,c=(0,k.useComposedRefs)(r,s.onTriggerChange),u=G(a),p=n.useRef("touch"),[m,h,f]=eK(e=>{let t=u().filter(e=>!e.disabled),n=t.find(e=>e.value===s.value),r=eq(t,e,n);void 0!==r&&s.onValueChange(r.value)}),g=e=>{d||(s.onOpenChange(!0),f()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,t.jsx)(T.Anchor,{asChild:!0,...o,children:(0,t.jsx)(D.Primitive.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:d,"data-disabled":d?"":void 0,"data-placeholder":eU(s.value)?"":void 0,...i,ref:c,onClick:(0,j.composeEventHandlers)(i.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&g(e)}),onPointerDown:(0,j.composeEventHandlers)(i.onPointerDown,e=>{p.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(g(e),e.preventDefault())}),onKeyDown:(0,j.composeEventHandlers)(i.onKeyDown,e=>{let t=""!==m.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||h(e.key),(!t||" "!==e.key)&&O.includes(e.key)&&(g(),e.preventDefault())})})})});ea.displayName=er;var el="SelectValue",ei=n.forwardRef((e,n)=>{let{__scopeSelect:r,className:a,style:l,children:i,placeholder:o="",...s}=e,d=J(el,r),{onValueNodeHasChildrenChange:c}=d,u=void 0!==i,p=(0,k.useComposedRefs)(n,d.onValueNodeChange);return(0,B.useLayoutEffect)(()=>{c(u)},[c,u]),(0,t.jsx)(D.Primitive.span,{...s,ref:p,style:{pointerEvents:"none"},children:eU(d.value)?(0,t.jsx)(t.Fragment,{children:o}):i})});ei.displayName=el;var eo=n.forwardRef((e,n)=>{let{__scopeSelect:r,children:a,...l}=e;return(0,t.jsx)(D.Primitive.span,{"aria-hidden":!0,...l,ref:n,children:a||"▼"})});eo.displayName="SelectIcon";var es=e=>(0,t.jsx)(A.Portal,{asChild:!0,...e});es.displayName="SelectPortal";var ed="SelectContent",ec=n.forwardRef((e,r)=>{let a=J(ed,e.__scopeSelect),[l,i]=n.useState();return((0,B.useLayoutEffect)(()=>{i(new DocumentFragment)},[]),a.open)?(0,t.jsx)(eh,{...e,ref:r}):l?y.createPortal((0,t.jsx)(eu,{scope:e.__scopeSelect,children:(0,t.jsx)(q.Slot,{scope:e.__scopeSelect,children:(0,t.jsx)("div",{children:e.children})})}),l):null});ec.displayName=ed;var[eu,ep]=Y(ed),em=(0,L.createSlot)("SelectContent.RemoveScroll"),eh=n.forwardRef((e,r)=>{let{__scopeSelect:a,position:l="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:s,side:d,sideOffset:c,align:u,alignOffset:p,arrowPadding:m,collisionBoundary:h,collisionPadding:f,sticky:g,hideWhenDetached:x,avoidCollisions:v,...w}=e,b=J(ed,a),[y,S]=n.useState(null),[C,I]=n.useState(null),M=(0,k.useComposedRefs)(r,e=>S(e)),[R,T]=n.useState(null),[A,D]=n.useState(null),L=G(a),[F,H]=n.useState(!1),B=n.useRef(!1);n.useEffect(()=>{if(y)return(0,V.hideOthers)(y)},[y]),(0,P.useFocusGuards)();let z=n.useCallback(e=>{let[t,...n]=L().map(e=>e.ref.current),[r]=n.slice(-1),a=document.activeElement;for(let n of e)if(n===a||(n?.scrollIntoView({block:"nearest"}),n===t&&C&&(C.scrollTop=0),n===r&&C&&(C.scrollTop=C.scrollHeight),n?.focus(),document.activeElement!==a))return},[L,C]),_=n.useCallback(()=>z([R,y]),[z,R,y]);n.useEffect(()=>{F&&_()},[F,_]);let{onOpenChange:O,triggerPointerDownPosRef:U}=b;n.useEffect(()=>{if(y){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(U.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(U.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():y.contains(n.target)||O(!1),document.removeEventListener("pointermove",t),U.current=null};return null!==U.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[y,O,U]),n.useEffect(()=>{let e=()=>O(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[O]);let[K,q]=eK(e=>{let t=L().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),r=eq(t,e,n);r&&setTimeout(()=>r.ref.current.focus())}),$=n.useCallback((e,t,n)=>{let r=!B.current&&!n;(void 0!==b.value&&b.value===t||r)&&(T(e),r&&(B.current=!0))},[b.value]),Y=n.useCallback(()=>y?.focus(),[y]),Z=n.useCallback((e,t,n)=>{let r=!B.current&&!n;(void 0!==b.value&&b.value===t||r)&&D(e)},[b.value]),X="popper"===l?eg:ef,Q=X===eg?{side:d,sideOffset:c,align:u,alignOffset:p,arrowPadding:m,collisionBoundary:h,collisionPadding:f,sticky:g,hideWhenDetached:x,avoidCollisions:v}:{};return(0,t.jsx)(eu,{scope:a,content:y,viewport:C,onViewportChange:I,itemRefCallback:$,selectedItem:R,onItemLeave:Y,itemTextRefCallback:Z,focusSelectedItem:_,selectedItemText:A,position:l,isPositioned:F,searchRef:K,children:(0,t.jsx)(W.RemoveScroll,{as:em,allowPinchZoom:!0,children:(0,t.jsx)(E.FocusScope,{asChild:!0,trapped:b.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:(0,j.composeEventHandlers)(i,e=>{b.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,t.jsx)(N.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:(0,t.jsx)(X,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:e=>e.preventDefault(),...w,...Q,onPlaced:()=>H(!0),ref:M,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:(0,j.composeEventHandlers)(w.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||q(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=L().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>z(t)),e.preventDefault()}})})})})})})});eh.displayName="SelectContentImpl";var ef=n.forwardRef((e,r)=>{let{__scopeSelect:a,onPlaced:l,...i}=e,o=J(ed,a),s=ep(ed,a),[d,c]=n.useState(null),[u,p]=n.useState(null),m=(0,k.useComposedRefs)(r,e=>p(e)),h=G(a),f=n.useRef(!1),g=n.useRef(!0),{viewport:x,selectedItem:v,selectedItemText:w,focusSelectedItem:b}=s,y=n.useCallback(()=>{if(o.trigger&&o.valueNode&&d&&u&&x&&v&&w){let e=o.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=o.valueNode.getBoundingClientRect(),r=w.getBoundingClientRect();if("rtl"!==o.dir){let a=r.left-t.left,l=n.left-a,i=e.left-l,o=e.width+i,s=Math.max(o,t.width),c=window.innerWidth-10,u=(0,S.clamp)(l,[10,Math.max(10,c-s)]);d.style.minWidth=o+"px",d.style.left=u+"px"}else{let a=t.right-r.right,l=window.innerWidth-n.right-a,i=window.innerWidth-e.right-l,o=e.width+i,s=Math.max(o,t.width),c=window.innerWidth-10,u=(0,S.clamp)(l,[10,Math.max(10,c-s)]);d.style.minWidth=o+"px",d.style.right=u+"px"}let a=h(),i=window.innerHeight-20,s=x.scrollHeight,c=window.getComputedStyle(u),p=parseInt(c.borderTopWidth,10),m=parseInt(c.paddingTop,10),g=parseInt(c.borderBottomWidth,10),b=p+m+s+parseInt(c.paddingBottom,10)+g,y=Math.min(5*v.offsetHeight,b),j=window.getComputedStyle(x),C=parseInt(j.paddingTop,10),k=parseInt(j.paddingBottom,10),I=e.top+e.height/2-10,M=v.offsetHeight/2,N=p+m+(v.offsetTop+M);if(N<=I){let e=a.length>0&&v===a[a.length-1].ref.current;d.style.bottom="0px";let t=Math.max(i-I,M+(e?k:0)+(u.clientHeight-x.offsetTop-x.offsetHeight)+g);d.style.height=N+t+"px"}else{let e=a.length>0&&v===a[0].ref.current;d.style.top="0px";let t=Math.max(I,p+x.offsetTop+(e?C:0)+M);d.style.height=t+(b-N)+"px",x.scrollTop=N-I+x.offsetTop}d.style.margin="10px 0",d.style.minHeight=y+"px",d.style.maxHeight=i+"px",l?.(),requestAnimationFrame(()=>f.current=!0)}},[h,o.trigger,o.valueNode,d,u,x,v,w,o.dir,l]);(0,B.useLayoutEffect)(()=>y(),[y]);let[j,C]=n.useState();(0,B.useLayoutEffect)(()=>{u&&C(window.getComputedStyle(u).zIndex)},[u]);let I=n.useCallback(e=>{e&&!0===g.current&&(y(),b?.(),g.current=!1)},[y,b]);return(0,t.jsx)(ex,{scope:a,contentWrapper:d,shouldExpandOnScrollRef:f,onScrollButtonChange:I,children:(0,t.jsx)("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:(0,t.jsx)(D.Primitive.div,{...i,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});ef.displayName="SelectItemAlignedPosition";var eg=n.forwardRef((e,n)=>{let{__scopeSelect:r,align:a="start",collisionPadding:l=10,...i}=e,o=X(r);return(0,t.jsx)(T.Content,{...o,...i,ref:n,align:a,collisionPadding:l,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});eg.displayName="SelectPopperPosition";var[ex,ev]=Y(ed,{}),ew="SelectViewport",eb=n.forwardRef((e,r)=>{let{__scopeSelect:a,nonce:l,...i}=e,o=ep(ew,a),s=ev(ew,a),d=(0,k.useComposedRefs)(r,o.onViewportChange),c=n.useRef(0);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:l}),(0,t.jsx)(q.Slot,{scope:a,children:(0,t.jsx)(D.Primitive.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:(0,j.composeEventHandlers)(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=s;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-20,a=Math.max(parseFloat(n.style.minHeight),parseFloat(n.style.height));if(a<r){let l=a+e,i=Math.min(r,l),o=l-i;n.style.height=i+"px","0px"===n.style.bottom&&(t.scrollTop=o>0?o:0,n.style.justifyContent="flex-end")}}}c.current=t.scrollTop})})})]})});eb.displayName=ew;var ey="SelectGroup",[eS,ej]=Y(ey),eC=n.forwardRef((e,n)=>{let{__scopeSelect:r,...a}=e,l=(0,R.useId)();return(0,t.jsx)(eS,{scope:r,id:l,children:(0,t.jsx)(D.Primitive.div,{role:"group","aria-labelledby":l,...a,ref:n})})});eC.displayName=ey;var ek="SelectLabel",eI=n.forwardRef((e,n)=>{let{__scopeSelect:r,...a}=e,l=ej(ek,r);return(0,t.jsx)(D.Primitive.div,{id:l.id,...a,ref:n})});eI.displayName=ek;var eM="SelectItem",[eN,eP]=Y(eM),eE=n.forwardRef((e,r)=>{let{__scopeSelect:a,value:l,disabled:i=!1,textValue:o,...s}=e,d=J(eM,a),c=ep(eM,a),u=d.value===l,[p,m]=n.useState(o??""),[h,f]=n.useState(!1),g=(0,k.useComposedRefs)(r,e=>c.itemRefCallback?.(e,l,i)),x=(0,R.useId)(),v=n.useRef("touch"),w=()=>{i||(d.onValueChange(l),d.onOpenChange(!1))};if(""===l)throw Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return(0,t.jsx)(eN,{scope:a,value:l,disabled:i,textId:x,isSelected:u,onItemTextChange:n.useCallback(e=>{m(t=>t||(e?.textContent??"").trim())},[]),children:(0,t.jsx)(q.ItemSlot,{scope:a,value:l,disabled:i,textValue:p,children:(0,t.jsx)(D.Primitive.div,{role:"option","aria-labelledby":x,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...s,ref:g,onFocus:(0,j.composeEventHandlers)(s.onFocus,()=>f(!0)),onBlur:(0,j.composeEventHandlers)(s.onBlur,()=>f(!1)),onClick:(0,j.composeEventHandlers)(s.onClick,()=>{"mouse"!==v.current&&w()}),onPointerUp:(0,j.composeEventHandlers)(s.onPointerUp,()=>{"mouse"===v.current&&w()}),onPointerDown:(0,j.composeEventHandlers)(s.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:(0,j.composeEventHandlers)(s.onPointerMove,e=>{v.current=e.pointerType,i?c.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:(0,j.composeEventHandlers)(s.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:(0,j.composeEventHandlers)(s.onKeyDown,e=>{(c.searchRef?.current===""||" "!==e.key)&&(U.includes(e.key)&&w()," "===e.key&&e.preventDefault())})})})})});eE.displayName=eM;var eR="SelectItemText",eT=n.forwardRef((e,r)=>{let{__scopeSelect:a,className:l,style:i,...o}=e,s=J(eR,a),d=ep(eR,a),c=eP(eR,a),u=et(eR,a),[p,m]=n.useState(null),h=(0,k.useComposedRefs)(r,e=>m(e),c.onItemTextChange,e=>d.itemTextRefCallback?.(e,c.value,c.disabled)),f=p?.textContent,g=n.useMemo(()=>(0,t.jsx)("option",{value:c.value,disabled:c.disabled,children:f},c.value),[c.disabled,c.value,f]),{onNativeOptionAdd:x,onNativeOptionRemove:v}=u;return(0,B.useLayoutEffect)(()=>(x(g),()=>v(g)),[x,v,g]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(D.Primitive.span,{id:c.textId,...o,ref:h}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?y.createPortal(o.children,s.valueNode):null]})});eT.displayName=eR;var eA="SelectItemIndicator",eD=n.forwardRef((e,n)=>{let{__scopeSelect:r,...a}=e;return eP(eA,r).isSelected?(0,t.jsx)(D.Primitive.span,{"aria-hidden":!0,...a,ref:n}):null});eD.displayName=eA;var eL="SelectScrollUpButton",eF=n.forwardRef((e,r)=>{let a=ep(eL,e.__scopeSelect),l=ev(eL,e.__scopeSelect),[i,o]=n.useState(!1),s=(0,k.useComposedRefs)(r,l.onScrollButtonChange);return(0,B.useLayoutEffect)(()=>{if(a.viewport&&a.isPositioned){let e=function(){o(t.scrollTop>0)},t=a.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[a.viewport,a.isPositioned]),i?(0,t.jsx)(ez,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=a;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});eF.displayName=eL;var eH="SelectScrollDownButton",eB=n.forwardRef((e,r)=>{let a=ep(eH,e.__scopeSelect),l=ev(eH,e.__scopeSelect),[i,o]=n.useState(!1),s=(0,k.useComposedRefs)(r,l.onScrollButtonChange);return(0,B.useLayoutEffect)(()=>{if(a.viewport&&a.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;o(Math.ceil(t.scrollTop)<e)},t=a.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[a.viewport,a.isPositioned]),i?(0,t.jsx)(ez,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=a;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});eB.displayName=eH;var ez=n.forwardRef((e,r)=>{let{__scopeSelect:a,onAutoScroll:l,...i}=e,o=ep("SelectScrollButton",a),s=n.useRef(null),d=G(a),c=n.useCallback(()=>{null!==s.current&&(window.clearInterval(s.current),s.current=null)},[]);return n.useEffect(()=>()=>c(),[c]),(0,B.useLayoutEffect)(()=>{let e=d().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[d]),(0,t.jsx)(D.Primitive.div,{"aria-hidden":!0,...i,ref:r,style:{flexShrink:0,...i.style},onPointerDown:(0,j.composeEventHandlers)(i.onPointerDown,()=>{null===s.current&&(s.current=window.setInterval(l,50))}),onPointerMove:(0,j.composeEventHandlers)(i.onPointerMove,()=>{o.onItemLeave?.(),null===s.current&&(s.current=window.setInterval(l,50))}),onPointerLeave:(0,j.composeEventHandlers)(i.onPointerLeave,()=>{c()})})}),e_=n.forwardRef((e,n)=>{let{__scopeSelect:r,...a}=e;return(0,t.jsx)(D.Primitive.div,{"aria-hidden":!0,...a,ref:n})});e_.displayName="SelectSeparator";var eV="SelectArrow",eW=n.forwardRef((e,n)=>{let{__scopeSelect:r,...a}=e,l=X(r),i=J(eV,r),o=ep(eV,r);return i.open&&"popper"===o.position?(0,t.jsx)(T.Arrow,{...l,...a,ref:n}):null});eW.displayName=eV;var eO=n.forwardRef(({__scopeSelect:e,value:r,...a},l)=>{let i=n.useRef(null),o=(0,k.useComposedRefs)(l,i),s=(0,z.usePrevious)(r);return n.useEffect(()=>{let e=i.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLSelectElement.prototype,"value").set;if(s!==r&&t){let n=new Event("change",{bubbles:!0});t.call(e,r),e.dispatchEvent(n)}},[s,r]),(0,t.jsx)(D.Primitive.select,{...a,style:{..._.VISUALLY_HIDDEN_STYLES,...a.style},ref:o,defaultValue:r})});function eU(e){return""===e||void 0===e}function eK(e){let t=(0,F.useCallbackRef)(e),r=n.useRef(""),a=n.useRef(0),l=n.useCallback(e=>{let n=r.current+e;t(n),function e(t){r.current=t,window.clearTimeout(a.current),""!==t&&(a.current=window.setTimeout(()=>e(""),1e3))}(n)},[t]),i=n.useCallback(()=>{r.current="",window.clearTimeout(a.current)},[]);return n.useEffect(()=>()=>window.clearTimeout(a.current),[]),[r,l,i]}function eq(e,t,n){var r,a;let l=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,o=(r=e,a=Math.max(i,0),r.map((e,t)=>r[(a+t)%r.length]));1===l.length&&(o=o.filter(e=>e!==n));let s=o.find(e=>e.textValue.toLowerCase().startsWith(l.toLowerCase()));return s!==n?s:void 0}eO.displayName="SelectBubbleInput",e.s(["Arrow",()=>eW,"Content",()=>ec,"Group",()=>eC,"Icon",()=>eo,"Item",()=>eE,"ItemIndicator",()=>eD,"ItemText",()=>eT,"Label",()=>eI,"Portal",()=>es,"Root",()=>en,"ScrollDownButton",()=>eB,"ScrollUpButton",()=>eF,"Select",()=>en,"SelectArrow",()=>eW,"SelectContent",()=>ec,"SelectGroup",()=>eC,"SelectIcon",()=>eo,"SelectItem",()=>eE,"SelectItemIndicator",()=>eD,"SelectItemText",()=>eT,"SelectLabel",()=>eI,"SelectPortal",()=>es,"SelectScrollDownButton",()=>eB,"SelectScrollUpButton",()=>eF,"SelectSeparator",()=>e_,"SelectTrigger",()=>ea,"SelectValue",()=>ei,"SelectViewport",()=>eb,"Separator",()=>e_,"Trigger",()=>ea,"Value",()=>ei,"Viewport",()=>eb,"createSelectScope",()=>Z],83830);var eG=e.i(83830),eG=eG,e$=e.i(99105);let eY=(0,a.default)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),eZ=eG.Root;eG.Group;let eX=eG.Value,eQ=n.forwardRef(({className:e,children:n,...r},a)=>(0,t.jsxs)(eG.Trigger,{ref:a,className:(0,v.cn)("border-input ring-offset-background placeholder:text-muted-foreground focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-sm focus:ring-1 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[n,(0,t.jsx)(eG.Icon,{asChild:!0,children:(0,t.jsx)(e$.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));eQ.displayName=eG.Trigger.displayName;let eJ=n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(eG.ScrollUpButton,{ref:r,className:(0,v.cn)("flex cursor-default items-center justify-center py-1",e),...n,children:(0,t.jsx)(eY,{className:"h-4 w-4"})}));eJ.displayName=eG.ScrollUpButton.displayName;let e0=n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(eG.ScrollDownButton,{ref:r,className:(0,v.cn)("flex cursor-default items-center justify-center py-1",e),...n,children:(0,t.jsx)(e$.ChevronDown,{className:"h-4 w-4"})}));e0.displayName=eG.ScrollDownButton.displayName;let e1=n.forwardRef(({className:e,children:n,position:r="popper",...a},l)=>(0,t.jsx)(eG.Portal,{children:(0,t.jsxs)(eG.Content,{ref:l,className:(0,v.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md","popper"===r&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...a,children:[(0,t.jsx)(eJ,{}),(0,t.jsx)(eG.Viewport,{className:(0,v.cn)("p-1","popper"===r&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),(0,t.jsx)(e0,{})]})}));e1.displayName=eG.Content.displayName,n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(eG.Label,{ref:r,className:(0,v.cn)("px-2 py-1.5 text-sm font-semibold",e),...n})).displayName=eG.Label.displayName;let e2=n.forwardRef(({className:e,children:n,...a},l)=>(0,t.jsxs)(eG.Item,{ref:l,className:(0,v.cn)("focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default items-center rounded-sm py-1.5 pr-8 pl-2 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[(0,t.jsx)("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,t.jsx)(eG.ItemIndicator,{children:(0,t.jsx)(r.Check,{className:"h-4 w-4"})})}),(0,t.jsx)(eG.ItemText,{children:n})]}));e2.displayName=eG.Item.displayName,n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(eG.Separator,{ref:r,className:(0,v.cn)("bg-muted -mx-1 my-1 h-px",e),...n})).displayName=eG.Separator.displayName;var e3=e.i(21023);let e5=(0,e3.createServerReference)("40e55194db5332fee8c142622149f1002e3aa78a82",e3.callServer,void 0,e3.findSourceMapURL,"updateSettingsAction");var e4=e.i(17406),e8=e.i(98804),e6=e.i(44229),e9=e.i(83902);function e7(e){return(0,t.jsx)(e6.Code,{className:(0,v.cn)("h-4 w-4",e.className),...e})}function te({className:e}){return(0,t.jsx)(e8.default,{src:"/icons/editors/vscode.svg",alt:"VS Code",width:24,height:24,className:(0,v.cn)("rounded-sm object-contain",e)})}function tt({className:e}){return(0,t.jsx)(e8.default,{src:"/icons/agents/cursor.jpeg",alt:"Cursor",width:24,height:24,className:(0,v.cn)("rounded-sm object-contain",e)})}function tn({className:e}){return(0,t.jsx)(e8.default,{src:"/icons/editors/windsurf.svg",alt:"Windsurf",width:24,height:24,className:(0,v.cn)("rounded-sm object-contain",e)})}function tr({className:e}){return(0,t.jsx)(e8.default,{src:"/icons/editors/zed.svg",alt:"Zed",width:24,height:24,className:(0,v.cn)("rounded-sm object-contain",e)})}function ta({className:e,...n}){return(0,t.jsx)(e9.Rocket,{className:(0,v.cn)("h-4 w-4",e),...n})}te.displayName="VsCodeIcon",tt.displayName="CursorEditorIcon",tn.displayName="WindsurfIcon",tr.displayName="ZedIcon",ta.displayName="AntigravityIcon";let tl={vscode:te,cursor:tt,windsurf:tn,zed:tr,antigravity:ta};var ti=e.i(41413),to=e.i(77624),ts=["PageUp","PageDown"],td=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],tc={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},tu="Slider",[tp,tm,th]=(0,C.createCollection)(tu),[tf,tg]=(0,I.createContextScope)(tu,[th]),[tx,tv]=tf(tu),tw=n.forwardRef((e,r)=>{let{name:a,min:l=0,max:i=100,step:o=1,orientation:s="horizontal",disabled:d=!1,minStepsBetweenThumbs:c=0,defaultValue:u=[l],value:p,onValueChange:m=()=>{},onValueCommit:h=()=>{},inverted:f=!1,form:g,...x}=e,v=n.useRef(new Set),w=n.useRef(0),b="horizontal"===s,[y=[],C]=(0,H.useControllableState)({prop:p,defaultProp:u,onChange:e=>{let t=[...v.current];t[w.current]?.focus(),m(e)}}),k=n.useRef(y);function I(e,t,{commit:n}={commit:!1}){let r,a=(String(o).split(".")[1]||"").length,s=Math.round((Math.round((e-l)/o)*o+l)*(r=Math.pow(10,a)))/r,d=(0,S.clamp)(s,[l,i]);C((e=[])=>{let r=function(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}(e,d,t);if(!function(e,t){if(t>0)return Math.min(...e.slice(0,-1).map((t,n)=>e[n+1]-t))>=t;return!0}(r,c*o))return e;{w.current=r.indexOf(d);let t=String(r)!==String(e);return t&&n&&h(r),t?r:e}})}return(0,t.jsx)(tx,{scope:e.__scopeSlider,name:a,disabled:d,min:l,max:i,valueIndexToChangeRef:w,thumbs:v.current,values:y,orientation:s,form:g,children:(0,t.jsx)(tp.Provider,{scope:e.__scopeSlider,children:(0,t.jsx)(tp.Slot,{scope:e.__scopeSlider,children:(0,t.jsx)(b?tS:tj,{"aria-disabled":d,"data-disabled":d?"":void 0,...x,ref:r,onPointerDown:(0,j.composeEventHandlers)(x.onPointerDown,()=>{d||(k.current=y)}),min:l,max:i,inverted:f,onSlideStart:d?void 0:function(e){let t=function(e,t){if(1===e.length)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}(y,e);I(e,t)},onSlideMove:d?void 0:function(e){I(e,w.current)},onSlideEnd:d?void 0:function(){let e=k.current[w.current];y[w.current]!==e&&h(y)},onHomeKeyDown:()=>!d&&I(l,0,{commit:!0}),onEndKeyDown:()=>!d&&I(i,y.length-1,{commit:!0}),onStepKeyDown:({event:e,direction:t})=>{if(!d){let n=ts.includes(e.key)||e.shiftKey&&td.includes(e.key),r=w.current;I(y[r]+o*(n?10:1)*t,r,{commit:!0})}}})})})})});tw.displayName=tu;var[tb,ty]=tf(tu,{startEdge:"left",endEdge:"right",size:"width",direction:1}),tS=n.forwardRef((e,r)=>{let{min:a,max:l,dir:i,inverted:o,onSlideStart:s,onSlideMove:d,onSlideEnd:c,onStepKeyDown:u,...p}=e,[m,h]=n.useState(null),f=(0,k.useComposedRefs)(r,e=>h(e)),g=n.useRef(void 0),x=(0,M.useDirection)(i),v="ltr"===x,w=v&&!o||!v&&o;function b(e){let t=g.current||m.getBoundingClientRect(),n=tD([0,t.width],w?[a,l]:[l,a]);return g.current=t,n(e-t.left)}return(0,t.jsx)(tb,{scope:e.__scopeSlider,startEdge:w?"left":"right",endEdge:w?"right":"left",direction:w?1:-1,size:"width",children:(0,t.jsx)(tC,{dir:x,"data-orientation":"horizontal",...p,ref:f,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:e=>{let t=b(e.clientX);s?.(t)},onSlideMove:e=>{let t=b(e.clientX);d?.(t)},onSlideEnd:()=>{g.current=void 0,c?.()},onStepKeyDown:e=>{let t=tc[w?"from-left":"from-right"].includes(e.key);u?.({event:e,direction:t?-1:1})}})})}),tj=n.forwardRef((e,r)=>{let{min:a,max:l,inverted:i,onSlideStart:o,onSlideMove:s,onSlideEnd:d,onStepKeyDown:c,...u}=e,p=n.useRef(null),m=(0,k.useComposedRefs)(r,p),h=n.useRef(void 0),f=!i;function g(e){let t=h.current||p.current.getBoundingClientRect(),n=tD([0,t.height],f?[l,a]:[a,l]);return h.current=t,n(e-t.top)}return(0,t.jsx)(tb,{scope:e.__scopeSlider,startEdge:f?"bottom":"top",endEdge:f?"top":"bottom",size:"height",direction:f?1:-1,children:(0,t.jsx)(tC,{"data-orientation":"vertical",...u,ref:m,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:e=>{let t=g(e.clientY);o?.(t)},onSlideMove:e=>{let t=g(e.clientY);s?.(t)},onSlideEnd:()=>{h.current=void 0,d?.()},onStepKeyDown:e=>{let t=tc[f?"from-bottom":"from-top"].includes(e.key);c?.({event:e,direction:t?-1:1})}})})}),tC=n.forwardRef((e,n)=>{let{__scopeSlider:r,onSlideStart:a,onSlideMove:l,onSlideEnd:i,onHomeKeyDown:o,onEndKeyDown:s,onStepKeyDown:d,...c}=e,u=tv(tu,r);return(0,t.jsx)(D.Primitive.span,{...c,ref:n,onKeyDown:(0,j.composeEventHandlers)(e.onKeyDown,e=>{"Home"===e.key?(o(e),e.preventDefault()):"End"===e.key?(s(e),e.preventDefault()):ts.concat(td).includes(e.key)&&(d(e),e.preventDefault())}),onPointerDown:(0,j.composeEventHandlers)(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),u.thumbs.has(t)?t.focus():a(e)}),onPointerMove:(0,j.composeEventHandlers)(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&l(e)}),onPointerUp:(0,j.composeEventHandlers)(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),i(e))})})}),tk="SliderTrack",tI=n.forwardRef((e,n)=>{let{__scopeSlider:r,...a}=e,l=tv(tk,r);return(0,t.jsx)(D.Primitive.span,{"data-disabled":l.disabled?"":void 0,"data-orientation":l.orientation,...a,ref:n})});tI.displayName=tk;var tM="SliderRange",tN=n.forwardRef((e,r)=>{let{__scopeSlider:a,...l}=e,i=tv(tM,a),o=ty(tM,a),s=n.useRef(null),d=(0,k.useComposedRefs)(r,s),c=i.values.length,u=i.values.map(e=>tA(e,i.min,i.max)),p=c>1?Math.min(...u):0,m=100-Math.max(...u);return(0,t.jsx)(D.Primitive.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...l,ref:d,style:{...e.style,[o.startEdge]:p+"%",[o.endEdge]:m+"%"}})});tN.displayName=tM;var tP="SliderThumb",tE=n.forwardRef((e,r)=>{let a=tm(e.__scopeSlider),[l,i]=n.useState(null),o=(0,k.useComposedRefs)(r,e=>i(e)),s=n.useMemo(()=>l?a().findIndex(e=>e.ref.current===l):-1,[a,l]);return(0,t.jsx)(tR,{...e,ref:o,index:s})}),tR=n.forwardRef((e,r)=>{var a,l,i,o,s;let d,c,{__scopeSlider:u,index:p,name:m,...h}=e,f=tv(tP,u),g=ty(tP,u),[x,v]=n.useState(null),w=(0,k.useComposedRefs)(r,e=>v(e)),b=!x||f.form||!!x.closest("form"),y=(0,to.useSize)(x),S=f.values[p],C=void 0===S?0:tA(S,f.min,f.max),I=(a=p,(l=f.values.length)>2?`Value ${a+1} of ${l}`:2===l?["Minimum","Maximum"][a]:void 0),M=y?.[g.size],N=M?(i=M,o=C,s=g.direction,c=tD([0,50],[0,d=i/2]),(d-c(o)*s)*s):0;return n.useEffect(()=>{if(x)return f.thumbs.add(x),()=>{f.thumbs.delete(x)}},[x,f.thumbs]),(0,t.jsxs)("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[g.startEdge]:`calc(${C}% + ${N}px)`},children:[(0,t.jsx)(tp.ItemSlot,{scope:e.__scopeSlider,children:(0,t.jsx)(D.Primitive.span,{role:"slider","aria-label":e["aria-label"]||I,"aria-valuemin":f.min,"aria-valuenow":S,"aria-valuemax":f.max,"aria-orientation":f.orientation,"data-orientation":f.orientation,"data-disabled":f.disabled?"":void 0,tabIndex:f.disabled?void 0:0,...h,ref:w,style:void 0===S?{display:"none"}:e.style,onFocus:(0,j.composeEventHandlers)(e.onFocus,()=>{f.valueIndexToChangeRef.current=p})})}),b&&(0,t.jsx)(tT,{name:m??(f.name?f.name+(f.values.length>1?"[]":""):void 0),form:f.form,value:S},p)]})});tE.displayName=tP;var tT=n.forwardRef(({__scopeSlider:e,value:r,...a},l)=>{let i=n.useRef(null),o=(0,k.useComposedRefs)(i,l),s=(0,z.usePrevious)(r);return n.useEffect(()=>{let e=i.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value").set;if(s!==r&&t){let n=new Event("input",{bubbles:!0});t.call(e,r),e.dispatchEvent(n)}},[s,r]),(0,t.jsx)(D.Primitive.input,{style:{display:"none"},...a,ref:o,defaultValue:r})});function tA(e,t,n){return(0,S.clamp)(100/(n-t)*(e-t),[0,100])}function tD(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}tT.displayName="RadioBubbleInput",e.s(["Range",()=>tN,"Root",()=>tw,"Slider",()=>tw,"SliderRange",()=>tN,"SliderThumb",()=>tE,"SliderTrack",()=>tI,"Thumb",()=>tE,"Track",()=>tI,"createSliderScope",()=>tg],29991);var tL=e.i(29991),tL=tL;function tF({className:e,defaultValue:r,value:a,min:l=0,max:i=100,...o}){let s=n.useMemo(()=>Array.isArray(a)?a:Array.isArray(r)?r:[l,i],[a,r,l,i]);return(0,t.jsxs)(tL.Root,{"data-slot":"slider",defaultValue:r,value:a,min:l,max:i,className:(0,v.cn)("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",e),...o,children:[(0,t.jsx)(tL.Track,{"data-slot":"slider-track",className:(0,v.cn)("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:(0,t.jsx)(tL.Range,{"data-slot":"slider-range",className:(0,v.cn)("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:s.length},(e,n)=>(0,t.jsx)(tL.Thumb,{"data-slot":"slider-thumb",className:"border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},n))]})}let tH=[60,120,300,600,900,1800,2700,3600,7200,10800,14400,21600,28800,43200,86400],tB=tH.length-1;function tz(e){let t=0,n=Math.abs(e-tH[0]);for(let r=1;r<tH.length;r++){let a=Math.abs(e-tH[r]);a<n&&(n=a,t=r)}return t}function t_({id:e,testId:r,value:a,onChange:l,onBlur:i,defaultSeconds:o=1800}){var s;let d,c,u=(""===a?o:parseInt(a,10))||o,[p,m]=(0,n.useState)(()=>tz(u)),h=tz(u);h!==p&&tH[p]!==u&&m(h);let f=(0,n.useCallback)(([e])=>{m(e),l(String(tH[e]))},[l]);return(0,t.jsxs)("div",{className:"flex w-55 items-center gap-2",children:[(0,t.jsx)(tF,{id:e,"data-testid":r,min:0,max:tB,step:1,value:[p],onValueChange:f,onValueCommit:()=>i(),className:"min-w-0 flex-1"}),(0,t.jsx)("span",{className:"text-muted-foreground shrink-0 text-right text-xs tabular-nums",children:(d=Math.floor((s=tH[p])/3600),c=Math.round(s%3600/60),0===d?`${c}m`:0===c?`${d}h`:`${d}h ${c}m`)})]})}let tV=[{value:e4.EditorType.VsCode,label:"VS Code"},{value:e4.EditorType.Cursor,label:"Cursor"},{value:e4.EditorType.Windsurf,label:"Windsurf"},{value:e4.EditorType.Zed,label:"Zed"},{value:e4.EditorType.Antigravity,label:"Antigravity"}],tW=[{value:"bash",label:"Bash"},{value:"zsh",label:"Zsh"},{value:"fish",label:"Fish"}],tO=[{id:"agent",label:"Agent",icon:l},{id:"environment",label:"Environment",icon:i.Terminal},{id:"workflow",label:"Workflow",icon:o.GitBranch},{id:"ci",label:"CI",icon:s},{id:"stage-timeouts",label:"Timeouts",icon:g.Timer},{id:"notifications",label:"Notifications",icon:d},{id:"feature-flags",label:"Flags",icon:c},{id:"database",label:"Database",icon:u}];function tU({label:e,description:n,htmlFor:r,children:a}){return(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4 border-b py-2.5 last:border-b-0",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)(w.Label,{htmlFor:r,className:"cursor-pointer text-sm font-normal whitespace-nowrap",children:e}),n?(0,t.jsx)("p",{className:"text-muted-foreground text-[11px] leading-tight",children:n}):null]}),(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:a})]})}function tK({label:e,description:n,id:r,testId:a,checked:l,onChange:i,disabled:o}){return(0,t.jsx)(tU,{label:e,description:n,htmlFor:r,children:(0,t.jsx)(b.Switch,{id:r,"data-testid":a,checked:l,onCheckedChange:i,disabled:o,className:(0,v.cn)("cursor-pointer",o&&"cursor-not-allowed opacity-50")})})}function tq({icon:e,title:n,description:r,badge:a,testId:l,children:i}){return(0,t.jsxs)("div",{className:"bg-background rounded-lg border","data-testid":l,children:[(0,t.jsxs)("div",{className:"bg-muted/30 border-b px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(e,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,t.jsx)("h2",{className:"text-sm font-semibold",children:n}),a?(0,t.jsx)("span",{className:"bg-muted text-muted-foreground rounded px-1.5 py-0.5 text-[9px] font-medium tracking-wider uppercase",children:a}):null]}),(0,t.jsx)("p",{className:"text-muted-foreground mt-0.5 text-[11px]",children:r})]}),(0,t.jsx)("div",{className:"px-4",children:i})]})}function tG({id:e,testId:n,value:r,onChange:a,onBlur:l,placeholder:i,min:o=1,max:s,step:d=1,suffix:c}){let u=""===r?void 0:parseInt(r,10);return(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)("div",{className:"flex items-center overflow-hidden rounded-md border",children:[(0,t.jsx)("button",{type:"button",onClick:()=>{a(String(Math.max(o,(u??parseInt(i,10))-d)))},onMouseUp:l,className:"text-muted-foreground hover:bg-muted hover:text-foreground flex h-8 w-7 cursor-pointer items-center justify-center border-r transition-colors","aria-label":"Decrease",children:(0,t.jsx)(p.default,{className:"h-3 w-3"})}),(0,t.jsx)("input",{id:e,"data-testid":n,type:"text",inputMode:"numeric",pattern:"[0-9]*",value:r,placeholder:i,onChange:e=>{a(e.target.value.replace(/[^0-9]/g,""))},onBlur:l,className:"h-8 w-14 bg-transparent text-center text-xs outline-none"}),(0,t.jsx)("button",{type:"button",onClick:()=>{let e;e=u??parseInt(i,10),a(String(null!=s?Math.min(s,e+d):e+d))},onMouseUp:l,className:"text-muted-foreground hover:bg-muted hover:text-foreground flex h-8 w-7 cursor-pointer items-center justify-center border-l transition-colors","aria-label":"Increase",children:(0,t.jsx)(m.Plus,{className:"h-3 w-3"})})]}),c?(0,t.jsx)("span",{className:"text-muted-foreground text-[11px]",children:c}):null]})}function t$({children:e}){return(0,t.jsx)("div",{className:"border-b pt-3 pb-1",children:(0,t.jsx)("span",{className:"text-muted-foreground text-[10px] font-semibold tracking-wider uppercase",children:e})})}function tY({children:e,links:n}){return(0,t.jsxs)("div",{className:"hidden pt-2 lg:block",children:[(0,t.jsx)("p",{className:"text-muted-foreground/70 text-[11px] leading-relaxed",children:e}),null!=n&&n.length>0?(0,t.jsx)("div",{className:"mt-2 flex flex-col gap-1",children:n.map(e=>(0,t.jsxs)("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-[10px] transition-colors",children:[(0,t.jsx)(h.ExternalLink,{className:"h-2.5 w-2.5"}),e.label]},e.href))}):null]})}function tZ({settings:e,shepHome:a,dbFileSize:p,availableTerminals:m}){let{showSaving:h,showSaved:w,save:b}=function(){let[e,t]=(0,n.useTransition)(),[r,a]=(0,n.useState)(!1),[l,i]=(0,n.useState)(!1),o=(0,n.useRef)(null),s=(0,n.useRef)(!1);return(0,n.useEffect)(()=>{e&&!r&&(a(!0),s.current=!1,o.current=setTimeout(()=>{o.current=null,s.current&&(a(!1),i(!0),setTimeout(()=>i(!1),2e3))},350)),!e&&r&&(s.current=!0,o.current||(a(!1),i(!0),setTimeout(()=>i(!1),2e3)))},[e,r]),{showSaving:r,showSaved:l,save:(0,n.useCallback)(e=>{t(async()=>{let t=await e5(e);t.success||x.toast.error(t.error??"Failed to save settings")})},[t])}}(),y=e.featureFlags??{skills:!1,envDeploy:!1,debug:!1,adoptBranch:!1},[S,j]=(0,n.useState)(e.agent.type),[C,k]=(0,n.useState)(e.environment.defaultEditor),[I,M]=(0,n.useState)(e.environment.shellPreference),[N,P]=(0,n.useState)(e.environment.terminalPreference??e4.TerminalType.System),E=m?m.filter(e=>e.available):[{id:e4.TerminalType.System,name:"System Terminal",available:!0}],[R,T]=(0,n.useState)(e.workflow.openPrOnImplementationComplete),[A,D]=(0,n.useState)(e.workflow.approvalGateDefaults.pushOnImplementationComplete),[L,F]=(0,n.useState)(e.workflow.approvalGateDefaults.allowPrd),[H,B]=(0,n.useState)(e.workflow.approvalGateDefaults.allowPlan),[z,_]=(0,n.useState)(e.workflow.approvalGateDefaults.allowMerge),[V,W]=(0,n.useState)(e.workflow.enableEvidence),[O,U]=(0,n.useState)(e.workflow.commitEvidence),[K,q]=(0,n.useState)(!1!==e.workflow.ciWatchEnabled),[G,$]=(0,n.useState)(null!=e.workflow.ciMaxFixAttempts?String(e.workflow.ciMaxFixAttempts):""),[Y,Z]=(0,n.useState)(null!=e.workflow.ciWatchTimeoutMs?String(Math.round(e.workflow.ciWatchTimeoutMs/1e3)):""),[X,Q]=(0,n.useState)(null!=e.workflow.ciLogMaxChars?String(e.workflow.ciLogMaxChars):""),[J,ee]=(0,n.useState)(null!=e.workflow.ciWatchPollIntervalSeconds?String(e.workflow.ciWatchPollIntervalSeconds):""),et=e.workflow.stageTimeouts,[en,er]=(0,n.useState)(String(Math.round((et?.analyzeMs??18e5)/1e3))),[ea,el]=(0,n.useState)(String(Math.round((et?.requirementsMs??18e5)/1e3))),[ei,eo]=(0,n.useState)(String(Math.round((et?.researchMs??18e5)/1e3))),[es,ed]=(0,n.useState)(String(Math.round((et?.planMs??18e5)/1e3))),[ec,eu]=(0,n.useState)(String(Math.round((et?.implementMs??18e5)/1e3))),[ep,em]=(0,n.useState)(String(Math.round((et?.mergeMs??18e5)/1e3))),eh=e.workflow.analyzeRepoTimeouts,[ef,eg]=(0,n.useState)(String(Math.round((eh?.analyzeMs??6e5)/1e3))),[ex,ev]=(0,n.useState)(e.notifications.inApp.enabled),[ew,eb]=(0,n.useState)({...e.notifications.events}),[ey,eS]=(0,n.useState)({...y}),ej=null!=e.workflow.ciMaxFixAttempts?String(e.workflow.ciMaxFixAttempts):"",eC=null!=e.workflow.ciWatchTimeoutMs?String(Math.round(e.workflow.ciWatchTimeoutMs/1e3)):"",ek=null!=e.workflow.ciLogMaxChars?String(e.workflow.ciLogMaxChars):"",eI=null!=e.workflow.ciWatchPollIntervalSeconds?String(e.workflow.ciWatchPollIntervalSeconds):"",eM=et?.analyzeMs!=null?String(Math.round(et.analyzeMs/1e3)):"",eN=et?.requirementsMs!=null?String(Math.round(et.requirementsMs/1e3)):"",eP=et?.researchMs!=null?String(Math.round(et.researchMs/1e3)):"",eE=et?.planMs!=null?String(Math.round(et.planMs/1e3)):"",eR=et?.implementMs!=null?String(Math.round(et.implementMs/1e3)):"",eT=et?.mergeMs!=null?String(Math.round(et.mergeMs/1e3)):"",eA=eh?.analyzeMs!=null?String(Math.round(eh.analyzeMs/1e3)):"";function eD(e){if(""===e)return;let t=parseInt(e,10);return Number.isNaN(t)||t<=0?void 0:t}function eL(e){if(void 0===e)return;let t=eD(e);return null!=t?1e3*t:void 0}function eF(e={}){let t=eD(e.ciTimeout??Y);return{workflow:{openPrOnImplementationComplete:e.openPr??R,approvalGateDefaults:{pushOnImplementationComplete:e.pushOnComplete??A,allowPrd:e.allowPrd??L,allowPlan:e.allowPlan??H,allowMerge:e.allowMerge??z},enableEvidence:e.enableEvidence??V,commitEvidence:e.commitEvidence??O,ciWatchEnabled:e.ciWatchEnabled??K,ciMaxFixAttempts:eD(e.ciMaxFix??G),ciWatchTimeoutMs:null!=t?1e3*t:void 0,ciLogMaxChars:eD(e.ciLogMax??X),ciWatchPollIntervalSeconds:eD(e.ciPollInterval??J),stageTimeouts:{analyzeMs:eL(e.analyzeTimeout??en),requirementsMs:eL(e.requirementsTimeout??ea),researchMs:eL(e.researchTimeout??ei),planMs:eL(e.planTimeout??es),implementMs:eL(e.implementTimeout??ec),mergeMs:eL(e.mergeTimeout??ep)},analyzeRepoTimeouts:{analyzeMs:eL(e.analyzeRepoTimeout??ef)}}}}function eH(e={}){return{notifications:{inApp:{enabled:e.inApp??ex},events:e.events??ew}}}let[eB,ez]=(0,n.useState)("agent");(0,n.useEffect)(()=>{let e=tO.map(e=>document.getElementById(`section-${e.id}`)).filter(Boolean);if(0===e.length)return;let t=new IntersectionObserver(e=>{for(let t of e)t.isIntersecting&&ez(t.target.id.replace("section-",""))},{rootMargin:"-65px 0px -60% 0px",threshold:0});for(let n of e)t.observe(n);return()=>t.disconnect()},[]);let e_=(0,n.useCallback)(e=>{let t=document.getElementById(`section-${e}`);t&&(t.scrollIntoView({behavior:"smooth",block:"start"}),t.style.animation="none",t.offsetHeight,t.style.animation="section-flash 1s ease-out")},[]);return(0,t.jsxs)("div",{"data-testid":"settings-page-client",className:"max-w-5xl",children:[(0,t.jsx)("div",{className:"bg-background/95 supports-backdrop-filter:bg-background/80 sticky top-0 z-10 grid grid-cols-1 gap-x-5 pt-6 pb-4 backdrop-blur lg:grid-cols-[1fr_280px]",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(f,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("h1",{className:"text-sm font-bold tracking-tight",children:"Settings"}),(0,t.jsxs)("span",{className:"relative h-4 w-16",children:[(0,t.jsx)("span",{className:(0,v.cn)("text-muted-foreground absolute inset-0 flex items-center text-xs transition-opacity duration-300",h?"opacity-100":"opacity-0"),children:"Saving..."}),(0,t.jsxs)("span",{className:(0,v.cn)("absolute inset-0 flex items-center gap-1 text-xs text-green-600 transition-opacity duration-300",w&&!h?"opacity-100":"opacity-0"),children:[(0,t.jsx)(r.Check,{className:"h-3 w-3"}),"Saved"]})]}),(0,t.jsx)("nav",{className:"ml-auto flex items-center gap-0.5",children:tO.map(e=>{let n=e.icon,r=eB===e.id;return(0,t.jsxs)("button",{type:"button",onClick:()=>e_(e.id),className:(0,v.cn)("flex cursor-pointer items-center gap-1 rounded-md px-1.5 py-1 text-[11px] transition-all",r?"bg-accent text-foreground font-medium":"text-muted-foreground/60 hover:text-foreground hover:bg-accent/50"),children:[(0,t.jsx)(n,{className:"h-3 w-3"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:e.label})]},e.id)})})]})}),(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsxs)("div",{id:"section-agent",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsx)(tq,{icon:l,title:"Agent",description:"AI coding agent and authentication",testId:"agent-settings-section",children:(0,t.jsx)(tU,{label:"Agent & Model",description:"Provider and model for all operations",htmlFor:"agent-model-picker",children:(0,t.jsx)(ti.AgentModelPicker,{initialAgentType:S,initialModel:e.models.default,mode:"settings",onAgentModelChange:e=>j(e),className:"w-55"})})}),(0,t.jsx)(tY,{links:[{label:"Agent system",href:"https://github.com/shep-ai/cli/blob/main/docs/architecture/agent-system.md"},{label:"Adding agents",href:"https://github.com/shep-ai/cli/blob/main/docs/development/adding-agents.md"},{label:"Configuration guide",href:"https://github.com/shep-ai/cli/blob/main/docs/guides/configuration.md"}],children:"Choose which AI coding agent powers your features. Each agent supports different models and capabilities. Authentication is resolved automatically via your active session."})]}),(0,t.jsxs)("div",{id:"section-environment",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tq,{icon:i.Terminal,title:"Environment",description:"Editor, shell, and terminal preferences",testId:"environment-settings-section",children:[(0,t.jsx)(tU,{label:"Default Editor",description:"Editor launched for file operations",htmlFor:"default-editor",children:(0,t.jsxs)(eZ,{value:C,onValueChange:e=>{k(e),b({environment:{defaultEditor:e,shellPreference:I,terminalPreference:N}})},children:[(0,t.jsx)(eQ,{id:"default-editor","data-testid":"editor-select",className:"w-55 cursor-pointer text-xs",children:(0,t.jsx)(eX,{})}),(0,t.jsx)(e1,{children:tV.map(e=>{var n;let r=(n=e.value)&&n in tl?tl[n]:e7;return(0,t.jsx)(e2,{value:e.value,children:(0,t.jsxs)("span",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)(r,{className:"h-4 w-4 shrink-0"}),e.label]})},e.value)})})]})}),(0,t.jsx)(tU,{label:"Shell",description:"Default shell for generated scripts",htmlFor:"shell-preference",children:(0,t.jsxs)(eZ,{value:I,onValueChange:e=>{M(e),b({environment:{defaultEditor:C,shellPreference:e,terminalPreference:N}})},children:[(0,t.jsx)(eQ,{id:"shell-preference","data-testid":"shell-select",className:"w-55 cursor-pointer text-xs",children:(0,t.jsx)(eX,{})}),(0,t.jsx)(e1,{children:tW.map(e=>(0,t.jsx)(e2,{value:e.value,children:e.label},e.value))})]})}),(0,t.jsx)(tU,{label:"Terminal",description:"Terminal emulator for shell sessions",htmlFor:"terminal-preference",children:(0,t.jsxs)(eZ,{value:N,onValueChange:e=>{P(e),b({environment:{defaultEditor:C,shellPreference:I,terminalPreference:e}})},children:[(0,t.jsx)(eQ,{id:"terminal-preference","data-testid":"terminal-select",className:"w-55 cursor-pointer text-xs",children:(0,t.jsx)(eX,{})}),(0,t.jsx)(e1,{children:E.map(e=>(0,t.jsx)(e2,{value:e.id,children:e.name},e.id))})]})})]}),(0,t.jsx)(tY,{links:[{label:"Configuration guide",href:"https://github.com/shep-ai/cli/blob/main/docs/guides/configuration.md"}],children:"Your preferred editor opens files for review. The shell setting controls generated scripts. The terminal emulator is launched when opening shell sessions from the web UI."})]}),(0,t.jsxs)("div",{id:"section-workflow",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tq,{icon:o.GitBranch,title:"Workflow",description:"Automation behavior after implementation",testId:"workflow-settings-section",children:[(0,t.jsx)(t$,{children:"Approve"}),(0,t.jsx)(tK,{label:"Auto-approve PRD",description:"Skip manual review of requirements",id:"allow-prd",testId:"switch-allow-prd",checked:L,onChange:e=>{F(e),b(eF({allowPrd:e}))}}),(0,t.jsx)(tK,{label:"Auto-approve Plan",description:"Skip manual review of implementation plan",id:"allow-plan",testId:"switch-allow-plan",checked:H,onChange:e=>{B(e),b(eF({allowPlan:e}))}}),(0,t.jsx)(tK,{label:"Auto-approve Merge",description:"Merge without manual review",id:"allow-merge",testId:"switch-allow-merge",checked:z,onChange:e=>{_(e),b(eF({allowMerge:e}))}}),(0,t.jsx)(t$,{children:"Evidence"}),(0,t.jsx)(tK,{label:"Collect evidence",description:"Capture screenshots and artifacts after implementation",id:"enable-evidence",testId:"switch-enable-evidence",checked:V,onChange:e=>{W(e),e?b(eF({enableEvidence:e})):(U(!1),b(eF({enableEvidence:e,commitEvidence:!1})))}}),(0,t.jsx)(tK,{label:"Add evidence to PR",description:"Include evidence in the pull request body",id:"commit-evidence",testId:"switch-commit-evidence",checked:O,disabled:!V||!R,onChange:e=>{U(e),b(eF({commitEvidence:e}))}}),(0,t.jsx)(t$,{children:"Git"}),(0,t.jsx)(tK,{label:"Push on complete",description:"Push to remote when implementation finishes",id:"push-on-complete",testId:"switch-push-on-complete",checked:A,onChange:e=>{D(e),b(eF({pushOnComplete:e}))}}),(0,t.jsx)(tK,{label:"Open PR on complete",description:"Create a pull request when done",id:"open-pr",testId:"switch-open-pr",checked:R,onChange:e=>{T(e),e?b(eF({openPr:e})):(U(!1),b(eF({openPr:e,commitEvidence:!1})))}}),(0,t.jsx)(tK,{label:"Watch CI after push",description:"Monitor CI and auto-fix failures. Disable to avoid rate limits.",id:"ci-watch-enabled",testId:"switch-ci-watch-enabled",checked:K,onChange:e=>{q(e),b(eF({ciWatchEnabled:e}))}})]}),(0,t.jsx)(tY,{links:[{label:"Approval gates",href:"https://github.com/shep-ai/cli/blob/main/specs/016-hitl-approval-gates/spec.yaml"},{label:"Push & PR flags",href:"https://github.com/shep-ai/cli/blob/main/specs/037-feature-pr-push-flags/spec.yaml"}],children:"Control how autonomous each feature run is. Auto-approve skips the human review pause at each phase. Push and PR options control what happens after successful implementation."})]}),(0,t.jsxs)("div",{id:"section-ci",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tq,{icon:s,title:"Continuous Integration",description:"Limits and timeouts for CI monitoring",testId:"ci-settings-section",children:[(0,t.jsx)(tU,{label:"Max fix attempts",description:"Agent retries on failing CI",htmlFor:"ci-max-fix",children:(0,t.jsx)(tG,{id:"ci-max-fix",testId:"ci-max-fix-input",placeholder:"3",value:G,onChange:$,onBlur:()=>{G!==ej&&b(eF({ciMaxFix:G}))},min:1,max:10})}),(0,t.jsx)(tU,{label:"Watch timeout",description:"Max wait for CI completion",htmlFor:"ci-timeout",children:(0,t.jsx)(tG,{id:"ci-timeout",testId:"ci-timeout-input",placeholder:"300",value:Y,onChange:Z,onBlur:()=>{Y!==eC&&b(eF({ciTimeout:Y}))},min:30,step:30,suffix:"sec"})}),(0,t.jsx)(tU,{label:"Max log size",description:"Truncate CI logs beyond this limit",htmlFor:"ci-log-max",children:(0,t.jsx)(tG,{id:"ci-log-max",testId:"ci-log-max-input",placeholder:"50000",value:X,onChange:Q,onBlur:()=>{X!==ek&&b(eF({ciLogMax:X}))},min:1e3,step:5e3,suffix:"chars"})}),(0,t.jsx)(tU,{label:"Poll interval",description:"How often to check GitHub for CI status updates",htmlFor:"ci-poll-interval",children:(0,t.jsx)(tG,{id:"ci-poll-interval",testId:"ci-poll-interval-input",placeholder:"30",value:J,onChange:ee,onBlur:()=>{J!==eI&&b(eF({ciPollInterval:J}))},min:5,step:5,suffix:"sec"})})]}),(0,t.jsx)(tY,{links:[{label:"CI/CD pipeline",href:"https://github.com/shep-ai/cli/blob/main/docs/development/cicd.md"},{label:"CI security gates",href:"https://github.com/shep-ai/cli/blob/main/specs/003-cicd-security-gates/spec.md"}],children:"When a feature completes, the agent can watch CI and auto-fix failures. These limits prevent runaway retries and control how much log output is sent to the agent for analysis."})]}),(0,t.jsxs)("div",{id:"section-stage-timeouts",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tq,{icon:g.Timer,title:"Stage Timeouts",description:"Maximum execution time per agent stage",testId:"stage-timeouts-settings-section",children:[(0,t.jsx)(t$,{children:"Feature Agent"}),(0,t.jsx)(tU,{label:"Analyze",description:"Repository analysis timeout",htmlFor:"timeout-analyze",children:(0,t.jsx)(t_,{id:"timeout-analyze",testId:"timeout-analyze-input",value:en,onChange:er,onBlur:()=>{en!==eM&&b(eF({analyzeTimeout:en}))},defaultSeconds:1800})}),(0,t.jsx)(tU,{label:"Requirements",description:"Requirements gathering timeout",htmlFor:"timeout-requirements",children:(0,t.jsx)(t_,{id:"timeout-requirements",testId:"timeout-requirements-input",value:ea,onChange:el,onBlur:()=>{ea!==eN&&b(eF({requirementsTimeout:ea}))},defaultSeconds:1800})}),(0,t.jsx)(tU,{label:"Research",description:"Technical research timeout",htmlFor:"timeout-research",children:(0,t.jsx)(t_,{id:"timeout-research",testId:"timeout-research-input",value:ei,onChange:eo,onBlur:()=>{ei!==eP&&b(eF({researchTimeout:ei}))},defaultSeconds:1800})}),(0,t.jsx)(tU,{label:"Plan",description:"Implementation planning timeout",htmlFor:"timeout-plan",children:(0,t.jsx)(t_,{id:"timeout-plan",testId:"timeout-plan-input",value:es,onChange:ed,onBlur:()=>{es!==eE&&b(eF({planTimeout:es}))},defaultSeconds:1800})}),(0,t.jsx)(tU,{label:"Implement",description:"Code implementation timeout",htmlFor:"timeout-implement",children:(0,t.jsx)(t_,{id:"timeout-implement",testId:"timeout-implement-input",value:ec,onChange:eu,onBlur:()=>{ec!==eR&&b(eF({implementTimeout:ec}))},defaultSeconds:1800})}),(0,t.jsx)(tU,{label:"Merge",description:"PR creation and merge timeout",htmlFor:"timeout-merge",children:(0,t.jsx)(t_,{id:"timeout-merge",testId:"timeout-merge-input",value:ep,onChange:em,onBlur:()=>{ep!==eT&&b(eF({mergeTimeout:ep}))},defaultSeconds:1800})}),(0,t.jsx)(t$,{children:"Analyze Repository Agent"}),(0,t.jsx)(tU,{label:"Analyze",description:"Repository analysis timeout",htmlFor:"timeout-analyze-repo",children:(0,t.jsx)(t_,{id:"timeout-analyze-repo",testId:"timeout-analyze-repo-input",value:ef,onChange:eg,onBlur:()=>{ef!==eA&&b(eF({analyzeRepoTimeout:ef}))},defaultSeconds:600})})]}),(0,t.jsx)(tY,{children:"Each agent has independently configurable stage timeouts. When a stage exceeds its timeout, the agent is terminated. Longer timeouts are useful for complex implementations. Feature agent defaults to 30 minutes per stage. Analyze repository agent defaults to 10 minutes."})]}),(0,t.jsxs)("div",{id:"section-notifications",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tq,{icon:d,title:"Notifications",description:"How and when you get notified",testId:"notification-settings-section",children:[(0,t.jsx)(t$,{children:"Channels"}),(0,t.jsx)(tK,{label:"In-app",description:"Notifications inside the Shep UI",id:"notif-in-app",testId:"switch-in-app",checked:ex,onChange:e=>{ev(e),b(eH({inApp:e}))}}),(0,t.jsx)(t$,{children:"Agent Events"}),(0,t.jsx)(tK,{label:"Agent started",id:"notif-event-agentStarted",testId:"switch-event-agentStarted",checked:ew.agentStarted,onChange:e=>{let t={...ew,agentStarted:e};eb(t),b(eH({events:t}))}}),(0,t.jsx)(tK,{label:"Phase completed",id:"notif-event-phaseCompleted",testId:"switch-event-phaseCompleted",checked:ew.phaseCompleted,onChange:e=>{let t={...ew,phaseCompleted:e};eb(t),b(eH({events:t}))}}),(0,t.jsx)(tK,{label:"Waiting approval",id:"notif-event-waitingApproval",testId:"switch-event-waitingApproval",checked:ew.waitingApproval,onChange:e=>{let t={...ew,waitingApproval:e};eb(t),b(eH({events:t}))}}),(0,t.jsx)(tK,{label:"Agent completed",id:"notif-event-agentCompleted",testId:"switch-event-agentCompleted",checked:ew.agentCompleted,onChange:e=>{let t={...ew,agentCompleted:e};eb(t),b(eH({events:t}))}}),(0,t.jsx)(tK,{label:"Agent failed",id:"notif-event-agentFailed",testId:"switch-event-agentFailed",checked:ew.agentFailed,onChange:e=>{let t={...ew,agentFailed:e};eb(t),b(eH({events:t}))}}),(0,t.jsx)(t$,{children:"Pull Request Events"}),(0,t.jsx)(tK,{label:"PR merged",id:"notif-event-prMerged",testId:"switch-event-prMerged",checked:ew.prMerged,onChange:e=>{let t={...ew,prMerged:e};eb(t),b(eH({events:t}))}}),(0,t.jsx)(tK,{label:"PR closed",id:"notif-event-prClosed",testId:"switch-event-prClosed",checked:ew.prClosed,onChange:e=>{let t={...ew,prClosed:e};eb(t),b(eH({events:t}))}}),(0,t.jsx)(tK,{label:"PR checks passed",id:"notif-event-prChecksPassed",testId:"switch-event-prChecksPassed",checked:ew.prChecksPassed,onChange:e=>{let t={...ew,prChecksPassed:e};eb(t),b(eH({events:t}))}}),(0,t.jsx)(tK,{label:"PR checks failed",id:"notif-event-prChecksFailed",testId:"switch-event-prChecksFailed",checked:ew.prChecksFailed,onChange:e=>{let t={...ew,prChecksFailed:e};eb(t),b(eH({events:t}))}}),(0,t.jsx)(tK,{label:"PR blocked",id:"notif-event-prBlocked",testId:"switch-event-prBlocked",checked:ew.prBlocked,onChange:e=>{let t={...ew,prBlocked:e};eb(t),b(eH({events:t}))}}),(0,t.jsx)(tK,{label:"Merge review ready",id:"notif-event-mergeReviewReady",testId:"switch-event-mergeReviewReady",checked:ew.mergeReviewReady,onChange:e=>{let t={...ew,mergeReviewReady:e};eb(t),b(eH({events:t}))}})]}),(0,t.jsx)(tY,{links:[{label:"Notification system",href:"https://github.com/shep-ai/cli/blob/main/specs/021-agent-notifications/spec.yaml"}],children:"In-app toast notifications keep you in the loop. Fine-tune which agent lifecycle events trigger a notification."})]}),(0,t.jsxs)("div",{id:"section-feature-flags",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tq,{icon:c,title:"Feature Flags",description:"Enable or disable experimental features",badge:"Experimental",testId:"feature-flags-settings-section",children:[(0,t.jsx)(tK,{label:"Skills",description:"Enable the skills system for agent capabilities",id:"flag-skills",testId:"switch-flag-skills",checked:ey.skills,onChange:e=>{let t={...ey,skills:e};eS(t),b({featureFlags:t})}}),(0,t.jsx)(tK,{label:"Deployments",description:"Enable environment deployment workflows",id:"flag-envDeploy",testId:"switch-flag-envDeploy",checked:ey.envDeploy,onChange:e=>{let t={...ey,envDeploy:e};eS(t),b({featureFlags:t})}}),(0,t.jsx)(tK,{label:"Debug",description:"Show debug panels and verbose logging",id:"flag-debug",testId:"switch-flag-debug",checked:ey.debug,onChange:e=>{let t={...ey,debug:e};eS(t),b({featureFlags:t})}}),(0,t.jsx)(tK,{label:"Adopt Branch",description:"Import existing branches as tracked features",id:"flag-adoptBranch",testId:"switch-flag-adoptBranch",checked:ey.adoptBranch,onChange:e=>{let t={...ey,adoptBranch:e};eS(t),b({featureFlags:t})}})]}),(0,t.jsx)(tY,{children:"Experimental features that are still under development. Enable at your own risk — they may change or be removed in future versions. Debug mode adds verbose logging useful for troubleshooting."})]}),(0,t.jsxs)("div",{id:"section-database",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tq,{icon:u,title:"Database",description:"Local storage information",testId:"database-settings-section",children:[(0,t.jsx)(tU,{label:"Location",description:"Path to the local SQLite database",children:(0,t.jsx)("span",{className:"text-muted-foreground max-w-50 truncate font-mono text-xs","data-testid":"shep-home-path",children:a})}),(0,t.jsx)(tU,{label:"Size",children:(0,t.jsx)("span",{className:"text-muted-foreground text-xs","data-testid":"db-file-size",children:p})})]}),(0,t.jsx)(tY,{links:[{label:"Settings service",href:"https://github.com/shep-ai/cli/blob/main/docs/architecture/settings-service.md"},{label:"Settings spec",href:"https://github.com/shep-ai/cli/blob/main/specs/005-global-settings-service/spec.md"}],children:"All settings are stored in a local SQLite database at ~/.shep/data. The database uses a singleton record pattern with automatic migrations on startup."})]})]})]})}e.s(["SettingsPageClient",()=>tZ],41952)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,58860,44229,e=>{"use strict";let t=(0,e.i(3645).default)("timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);e.s(["Timer",()=>t],58860);var r=e.i(93752);e.s(["Code",()=>r.default],44229)},93752,e=>{"use strict";let t=(0,e.i(3645).default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);e.s(["default",()=>t])},10714,99105,e=>{"use strict";var t=e.i(3645);let r=(0,t.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);e.s(["default",()=>r],10714);let s=(0,t.default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",()=>s],99105)},87342,e=>{"use strict";var t=e.i(79054),r=e.i(22528),s=e.i(5978),o=e.i(86874),i=e.i(20314);function n(e){let n=e+"CollectionProvider",[a,l]=(0,r.createContextScope)(n),[d,c]=a(n,{collectionRef:{current:null},itemMap:new Map}),u=e=>{let{scope:r,children:s}=e,o=t.default.useRef(null),n=t.default.useRef(new Map).current;return(0,i.jsx)(d,{scope:r,itemMap:n,collectionRef:o,children:s})};u.displayName=n;let p=e+"CollectionSlot",f=(0,o.createSlot)(p),h=t.default.forwardRef((e,t)=>{let{scope:r,children:o}=e,n=c(p,r),a=(0,s.useComposedRefs)(t,n.collectionRef);return(0,i.jsx)(f,{ref:a,children:o})});h.displayName=p;let m=e+"CollectionItemSlot",v="data-radix-collection-item",x=(0,o.createSlot)(m),g=t.default.forwardRef((e,r)=>{let{scope:o,children:n,...a}=e,l=t.default.useRef(null),d=(0,s.useComposedRefs)(r,l),u=c(m,o);return t.default.useEffect(()=>(u.itemMap.set(l,{ref:l,...a}),()=>void u.itemMap.delete(l))),(0,i.jsx)(x,{...{[v]:""},ref:d,children:n})});return g.displayName=m,[{Provider:u,Slot:h,ItemSlot:g},function(r){let s=c(e+"CollectionConsumer",r);return t.default.useCallback(()=>{let e=s.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${v}]`));return Array.from(s.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[s.collectionRef,s.itemMap])},l]}var a=new WeakMap;function l(e,t){var r,s;let o,i,n;if("at"in Array.prototype)return Array.prototype.at.call(e,t);let a=(r=e,s=t,o=r.length,(n=(i=d(s))>=0?i:o+i)<0||n>=o?-1:n);return -1===a?void 0:e[a]}function d(e){return e!=e||0===e?0:Math.trunc(e)}(class e extends Map{#e;constructor(e){super(e),this.#e=[...super.keys()],a.set(this,!0)}set(e,t){return a.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,r){let s,o=this.has(t),i=this.#e.length,n=d(e),a=n>=0?n:i+n,l=a<0||a>=i?-1:a;if(l===this.size||o&&l===this.size-1||-1===l)return this.set(t,r),this;let c=this.size+ +!o;n<0&&a++;let u=[...this.#e],p=!1;for(let e=a;e<c;e++)if(a===e){let i=u[e];u[e]===t&&(i=u[e+1]),o&&this.delete(t),s=this.get(i),this.set(t,r)}else{p||u[e-1]!==t||(p=!0);let r=u[p?e:e-1],o=s;s=this.get(r),this.delete(r),this.set(r,o)}return this}with(t,r,s){let o=new e(this);return o.insert(t,r,s),o}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,r){let s=this.#e.indexOf(e);return -1===s?this:this.insert(s,t,r)}after(e){let t=this.#e.indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,r){let s=this.#e.indexOf(e);return -1===s?this:this.insert(s+1,t,r)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=l(this.#e,e);if(void 0!==t)return this.get(t)}entryAt(e){let t=l(this.#e,e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return l(this.#e,e)}from(e,t){let r=this.indexOf(e);if(-1===r)return;let s=r+t;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.at(s)}keyFrom(e,t){let r=this.indexOf(e);if(-1===r)return;let s=r+t;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return s;r++}}findIndex(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return r;r++}return -1}filter(t,r){let s=[],o=0;for(let e of this)Reflect.apply(t,r,[e,o,this])&&s.push(e),o++;return new e(s)}map(t,r){let s=[],o=0;for(let e of this)s.push([e[0],Reflect.apply(t,r,[e,o,this])]),o++;return new e(s)}reduce(...e){let[t,r]=e,s=0,o=r??this.at(0);for(let r of this)o=0===s&&1===e.length?r:Reflect.apply(t,this,[o,r,s,this]),s++;return o}reduceRight(...e){let[t,r]=e,s=r??this.at(-1);for(let r=this.size-1;r>=0;r--){let o=this.at(r);s=r===this.size-1&&1===e.length?o:Reflect.apply(t,this,[s,o,r,this])}return s}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let r=this.keyAt(e),s=this.get(r);t.set(r,s)}return t}toSpliced(...t){let r=[...this.entries()];return r.splice(...t),new e(r)}slice(t,r){let s=new e,o=this.size-1;if(void 0===t)return s;t<0&&(t+=this.size),void 0!==r&&r>0&&(o=r-1);for(let e=t;e<=o;e++){let t=this.keyAt(e),r=this.get(t);s.set(t,r)}return s}every(e,t){let r=0;for(let s of this){if(!Reflect.apply(e,t,[s,r,this]))return!1;r++}return!0}some(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return!0;r++}return!1}}),e.s(["createCollection",()=>n])},38573,e=>{"use strict";let t=(0,e.i(3645).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",()=>t],38573)},30702,e=>{"use strict";let t=(0,e.i(3645).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",()=>t],30702)},23925,1012,e=>{"use strict";let t=(0,e.i(3645).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",()=>t],1012),e.s(["Check",()=>t],23925)},41957,e=>{"use strict";var t=e.i(20314),r=e.i(79054),s=e.i(87620),o=r.forwardRef((e,r)=>(0,t.jsx)(s.Primitive.label,{...e,ref:r,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));o.displayName="Label",e.s(["Label",()=>o,"Root",()=>o],27572);var i=e.i(27572),i=i,n=e.i(94237),a=e.i(31777);let l=(0,n.cva)("text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),d=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(i.Root,{ref:s,className:(0,a.cn)(l(),e),...r}));d.displayName=i.Root.displayName,e.s(["Label",()=>d],41957)},23405,e=>{"use strict";var t=e.i(79054);function r(e){let r=t.useRef({value:e,previous:e});return t.useMemo(()=>(r.current.value!==e&&(r.current.previous=r.current.value,r.current.value=e),r.current.previous),[e])}e.s(["usePrevious",()=>r])},11345,e=>{"use strict";let t=(0,e.i(3645).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",()=>t],11345)},76016,e=>{"use strict";let t=(0,e.i(3645).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",()=>t],76016)},83902,e=>{"use strict";let t=(0,e.i(3645).default)("rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);e.s(["Rocket",()=>t],83902)},90382,e=>{"use strict";var t=e.i(20314),r=e.i(79054),s=e.i(91967),o=e.i(5978),i=e.i(22528),n=e.i(53532),a=e.i(41687),l=e.i(56720),d=e.i(13123),c=e.i(52740),u=e.i(39979),p=e.i(85995),f=e.i(87620),h=e.i(86874),m=e.i(36589),v=e.i(73772),x=e.i(13044),g="Popover",[y,k]=(0,i.createContextScope)(g,[c.createPopperScope]),b=(0,c.createPopperScope)(),[w,C]=y(g),R=e=>{let{__scopePopover:s,children:o,open:i,defaultOpen:n,onOpenChange:a,modal:l=!1}=e,u=b(s),p=r.useRef(null),[f,h]=r.useState(!1),[v,x]=(0,m.useControllableState)({prop:i,defaultProp:n??!1,onChange:a,caller:g});return(0,t.jsx)(c.Root,{...u,children:(0,t.jsx)(w,{scope:s,contentId:(0,d.useId)(),triggerRef:p,open:v,onOpenChange:x,onOpenToggle:r.useCallback(()=>x(e=>!e),[x]),hasCustomAnchor:f,onCustomAnchorAdd:r.useCallback(()=>h(!0),[]),onCustomAnchorRemove:r.useCallback(()=>h(!1),[]),modal:l,children:o})})};R.displayName=g;var j="PopoverAnchor",P=r.forwardRef((e,s)=>{let{__scopePopover:o,...i}=e,n=C(j,o),a=b(o),{onCustomAnchorAdd:l,onCustomAnchorRemove:d}=n;return r.useEffect(()=>(l(),()=>d()),[l,d]),(0,t.jsx)(c.Anchor,{...a,...i,ref:s})});P.displayName=j;var A="PopoverTrigger",N=r.forwardRef((e,r)=>{let{__scopePopover:i,...n}=e,a=C(A,i),l=b(i),d=(0,o.useComposedRefs)(r,a.triggerRef),u=(0,t.jsx)(f.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":B(a.open),...n,ref:d,onClick:(0,s.composeEventHandlers)(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?u:(0,t.jsx)(c.Anchor,{asChild:!0,...l,children:u})});N.displayName=A;var S="PopoverPortal",[M,T]=y(S,{forceMount:void 0}),O=e=>{let{__scopePopover:r,forceMount:s,children:o,container:i}=e,n=C(S,r);return(0,t.jsx)(M,{scope:r,forceMount:s,children:(0,t.jsx)(p.Presence,{present:s||n.open,children:(0,t.jsx)(u.Portal,{asChild:!0,container:i,children:o})})})};O.displayName=S;var z="PopoverContent",E=r.forwardRef((e,r)=>{let s=T(z,e.__scopePopover),{forceMount:o=s.forceMount,...i}=e,n=C(z,e.__scopePopover);return(0,t.jsx)(p.Presence,{present:o||n.open,children:n.modal?(0,t.jsx)(D,{...i,ref:r}):(0,t.jsx)(I,{...i,ref:r})})});E.displayName=z;var F=(0,h.createSlot)("PopoverContent.RemoveScroll"),D=r.forwardRef((e,i)=>{let n=C(z,e.__scopePopover),a=r.useRef(null),l=(0,o.useComposedRefs)(i,a),d=r.useRef(!1);return r.useEffect(()=>{let e=a.current;if(e)return(0,v.hideOthers)(e)},[]),(0,t.jsx)(x.RemoveScroll,{as:F,allowPinchZoom:!0,children:(0,t.jsx)(q,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,s.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),d.current||n.triggerRef.current?.focus()}),onPointerDownOutside:(0,s.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;d.current=2===t.button||r},{checkForDefaultPrevented:!1}),onFocusOutside:(0,s.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),I=r.forwardRef((e,s)=>{let o=C(z,e.__scopePopover),i=r.useRef(!1),n=r.useRef(!1);return(0,t.jsx)(q,{...e,ref:s,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||o.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,n.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,"pointerdown"===t.detail.originalEvent.type&&(n.current=!0));let r=t.target;o.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&n.current&&t.preventDefault()}})}),q=r.forwardRef((e,r)=>{let{__scopePopover:s,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:d,disableOutsidePointerEvents:u,onEscapeKeyDown:p,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,...v}=e,x=C(z,s),g=b(s);return(0,a.useFocusGuards)(),(0,t.jsx)(l.FocusScope,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:d,children:(0,t.jsx)(n.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:u,onInteractOutside:m,onEscapeKeyDown:p,onPointerDownOutside:f,onFocusOutside:h,onDismiss:()=>x.onOpenChange(!1),children:(0,t.jsx)(c.Content,{"data-state":B(x.open),role:"dialog",id:x.contentId,...g,...v,ref:r,style:{...v.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),L="PopoverClose",H=r.forwardRef((e,r)=>{let{__scopePopover:o,...i}=e,n=C(L,o);return(0,t.jsx)(f.Primitive.button,{type:"button",...i,ref:r,onClick:(0,s.composeEventHandlers)(e.onClick,()=>n.onOpenChange(!1))})});H.displayName=L;var _=r.forwardRef((e,r)=>{let{__scopePopover:s,...o}=e,i=b(s);return(0,t.jsx)(c.Arrow,{...i,...o,ref:r})});function B(e){return e?"open":"closed"}_.displayName="PopoverArrow",e.s(["Anchor",()=>P,"Arrow",()=>_,"Close",()=>H,"Content",()=>E,"Popover",()=>R,"PopoverAnchor",()=>P,"PopoverArrow",()=>_,"PopoverClose",()=>H,"PopoverContent",()=>E,"PopoverPortal",()=>O,"PopoverTrigger",()=>N,"Portal",()=>O,"Root",()=>R,"Trigger",()=>N,"createPopoverScope",()=>k],89920);var U=e.i(89920),U=U,K=e.i(31777);let X=U.Root,$=U.Trigger;U.Anchor;let G=r.forwardRef(({className:e,align:r="center",sideOffset:s=4,...o},i)=>(0,t.jsx)(U.Portal,{children:(0,t.jsx)(U.Content,{ref:i,align:r,sideOffset:s,className:(0,K.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border p-4 shadow-md outline-none",e),...o})}));G.displayName=U.Content.displayName,e.s(["Popover",()=>X,"PopoverContent",()=>G,"PopoverTrigger",()=>$],90382)},98400,86822,e=>{"use strict";var t=e.i(21023);let r=(0,t.createServerReference)("009510e57d0adcf42fa39284a9b384b8dfee5a7253",t.callServer,void 0,t.findSourceMapURL,"getAllAgentModels");e.s(["getAllAgentModels",()=>r],98400);let s=(0,t.createServerReference)("60097c4ce7edc795570740e035f18b4ba1c50dce39",t.callServer,void 0,t.findSourceMapURL,"updateAgentAndModel");e.s(["updateAgentAndModel",()=>s],86822)},51911,41413,e=>{"use strict";var t=e.i(20314),r=e.i(79054),s=e.i(91967),o=e.i(5978),i=e.i(22528),n=e.i(36589),a=e.i(23405),l=e.i(77624),d=e.i(87620),c="Switch",[u,p]=(0,i.createContextScope)(c),[f,h]=u(c),m=r.forwardRef((e,i)=>{let{__scopeSwitch:a,name:l,checked:u,defaultChecked:p,required:h,disabled:m,value:v="on",onCheckedChange:x,form:k,...b}=e,[w,C]=r.useState(null),R=(0,o.useComposedRefs)(i,e=>C(e)),j=r.useRef(!1),P=!w||k||!!w.closest("form"),[A,N]=(0,n.useControllableState)({prop:u,defaultProp:p??!1,onChange:x,caller:c});return(0,t.jsxs)(f,{scope:a,checked:A,disabled:m,children:[(0,t.jsx)(d.Primitive.button,{type:"button",role:"switch","aria-checked":A,"aria-required":h,"data-state":y(A),"data-disabled":m?"":void 0,disabled:m,value:v,...b,ref:R,onClick:(0,s.composeEventHandlers)(e.onClick,e=>{N(e=>!e),P&&(j.current=e.isPropagationStopped(),j.current||e.stopPropagation())})}),P&&(0,t.jsx)(g,{control:w,bubbles:!j.current,name:l,value:v,checked:A,required:h,disabled:m,form:k,style:{transform:"translateX(-100%)"}})]})});m.displayName=c;var v="SwitchThumb",x=r.forwardRef((e,r)=>{let{__scopeSwitch:s,...o}=e,i=h(v,s);return(0,t.jsx)(d.Primitive.span,{"data-state":y(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:r})});x.displayName=v;var g=r.forwardRef(({__scopeSwitch:e,control:s,checked:i,bubbles:n=!0,...d},c)=>{let u=r.useRef(null),p=(0,o.useComposedRefs)(u,c),f=(0,a.usePrevious)(i),h=(0,l.useSize)(s);return r.useEffect(()=>{let e=u.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(f!==i&&t){let r=new Event("click",{bubbles:n});t.call(e,i),e.dispatchEvent(r)}},[f,i,n]),(0,t.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i,...d,tabIndex:-1,ref:p,style:{...d.style,...h,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function y(e){return e?"checked":"unchecked"}g.displayName="SwitchBubbleInput",e.s(["Root",()=>m,"Switch",()=>m,"SwitchThumb",()=>x,"Thumb",()=>x,"createSwitchScope",()=>p],95291);var k=e.i(95291),k=k,b=e.i(31777);function w({className:e,size:r="default",...s}){return(0,t.jsx)(k.Root,{"data-slot":"switch","data-size":r,className:(0,b.cn)("peer group/switch focus-visible:border-ring focus-visible:ring-ring/50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80 inline-flex shrink-0 cursor-pointer items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6",e),...s,children:(0,t.jsx)(k.Thumb,{"data-slot":"switch-thumb",className:(0,b.cn)("bg-background dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}e.s(["Switch",()=>w],51911);var C=e.i(23925),R=e.i(11345),j=e.i(76016),P=e.i(98400),A=e.i(86822),N=e.i(86782),S=e.i(29847),M=e.i(35364),T=e.i(90382);function O({initialAgentType:e,initialModel:s,onAgentModelChange:o,disabled:i,className:n,mode:a}){let[l,d]=r.useState(!1),[c,u]=r.useState([]),[p,f]=r.useState(!0),[h,m]=r.useState(e),[v,x]=r.useState(s),[g,y]=r.useState(null),[k,w]=r.useState(0),[O,z]=r.useState(null);r.useEffect(()=>{(0,P.getAllAgentModels)().then(u).finally(()=>f(!1))},[]),r.useEffect(()=>{if(!l){let e=setTimeout(()=>{w(0),z(null)},150);return()=>clearTimeout(e)}},[l]);let E=async(e,t)=>{if(d(!1),e!==h||t!==v){if("override"===a){m(e),x(t),o?.(e,t);return}m(e),x(t),o?.(e,t),y(null);try{let r=await (0,A.updateAgentAndModel)(e,t||null);r.ok||(m(h),x(v),o?.(h,v),y(r.error??"Failed to save"))}catch{m(h),x(v),o?.(h,v),y("Failed to save")}}},F=(0,N.getAgentTypeIcon)(h),D=c.find(e=>e.agentType===h)?.label??h,I=v?(0,S.getModelMeta)(v).displayName||v:null,q=O?c.find(e=>e.agentType===O):null;return(0,t.jsxs)("div",{className:(0,b.cn)("flex flex-col gap-1",n),children:[(0,t.jsxs)(T.Popover,{open:l,onOpenChange:d,children:[(0,t.jsx)(T.PopoverTrigger,{asChild:!0,children:(0,t.jsx)(M.Button,{variant:"outline",role:"combobox","aria-expanded":l,disabled:(i??!1)||p,className:"w-auto cursor-pointer justify-start font-normal hover:border-violet-300 hover:bg-violet-50/50 dark:hover:border-violet-700 dark:hover:bg-violet-950/30",children:(0,t.jsxs)("span",{className:"flex items-center gap-2 truncate",children:[(0,t.jsx)(F,{className:"h-4 w-4 shrink-0"}),p?"Loading…":(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:D}),I?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-muted-foreground/50 text-xs",children:"·"}),(0,t.jsx)("span",{className:"text-xs font-medium",children:I})]}):null]})]})})}),(0,t.jsx)(T.PopoverContent,{className:"w-(--radix-popover-trigger-width) overflow-hidden p-0",align:"start",children:(0,t.jsxs)("div",{className:"flex transition-transform duration-200 ease-in-out",style:{transform:`translateX(${1===k?"-50%":"0%"})`,width:"200%"},children:[(0,t.jsxs)("div",{className:"w-1/2 shrink-0",children:[(0,t.jsx)("div",{className:"text-muted-foreground border-b px-3 py-2 text-xs font-medium",children:"Select agent"}),c.map(e=>{let r=(0,N.getAgentTypeIcon)(e.agentType),s=h===e.agentType,o=e.models.length>0;return(0,t.jsxs)("button",{type:"button",className:(0,b.cn)("flex w-full cursor-pointer items-center gap-2.5 px-3 py-2 text-xs transition-colors","hover:bg-accent hover:text-accent-foreground",s&&"bg-accent/50"),onClick:()=>{o?(z(e.agentType),requestAnimationFrame(()=>{requestAnimationFrame(()=>w(1))})):E(e.agentType,"")},children:[(0,t.jsx)(r,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"flex-1 text-left",children:e.label}),s&&!o?(0,t.jsx)(C.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null,o?(0,t.jsx)(j.ChevronRight,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}):null]},e.agentType)})]}),(0,t.jsx)("div",{className:"w-1/2 shrink-0",children:q?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",className:"text-muted-foreground hover:text-foreground flex w-full cursor-pointer items-center gap-1.5 border-b px-3 py-2 text-xs font-medium transition-colors",onClick:()=>{w(0),setTimeout(()=>z(null),220)},children:[(0,t.jsx)(R.ChevronLeft,{className:"h-3.5 w-3.5"}),q.label]}),q.models.map(e=>{let r=h===q.agentType&&v===e.id;return(0,t.jsxs)("button",{type:"button",className:(0,b.cn)("flex w-full cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors","hover:bg-accent hover:text-accent-foreground",r&&"bg-accent/50"),onClick:()=>E(q.agentType,e.id),children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:e.displayName}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:e.description})]}),r?(0,t.jsx)(C.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null]},e.id)})]}):null})]})})]}),!!g&&(0,t.jsx)("p",{className:"text-destructive text-sm",children:g})]})}e.s(["AgentModelPicker",()=>O],41413)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,58860,44229,e=>{"use strict";let t=(0,e.i(3645).default)("timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);e.s(["Timer",()=>t],58860);var r=e.i(93752);e.s(["Code",()=>r.default],44229)},93752,e=>{"use strict";let t=(0,e.i(3645).default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);e.s(["default",()=>t])},10714,99105,e=>{"use strict";var t=e.i(3645);let r=(0,t.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);e.s(["default",()=>r],10714);let s=(0,t.default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",()=>s],99105)},87342,e=>{"use strict";var t=e.i(79054),r=e.i(22528),s=e.i(5978),o=e.i(86874),i=e.i(20314);function n(e){let n=e+"CollectionProvider",[a,l]=(0,r.createContextScope)(n),[d,c]=a(n,{collectionRef:{current:null},itemMap:new Map}),u=e=>{let{scope:r,children:s}=e,o=t.default.useRef(null),n=t.default.useRef(new Map).current;return(0,i.jsx)(d,{scope:r,itemMap:n,collectionRef:o,children:s})};u.displayName=n;let p=e+"CollectionSlot",f=(0,o.createSlot)(p),h=t.default.forwardRef((e,t)=>{let{scope:r,children:o}=e,n=c(p,r),a=(0,s.useComposedRefs)(t,n.collectionRef);return(0,i.jsx)(f,{ref:a,children:o})});h.displayName=p;let m=e+"CollectionItemSlot",v="data-radix-collection-item",x=(0,o.createSlot)(m),g=t.default.forwardRef((e,r)=>{let{scope:o,children:n,...a}=e,l=t.default.useRef(null),d=(0,s.useComposedRefs)(r,l),u=c(m,o);return t.default.useEffect(()=>(u.itemMap.set(l,{ref:l,...a}),()=>void u.itemMap.delete(l))),(0,i.jsx)(x,{...{[v]:""},ref:d,children:n})});return g.displayName=m,[{Provider:u,Slot:h,ItemSlot:g},function(r){let s=c(e+"CollectionConsumer",r);return t.default.useCallback(()=>{let e=s.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${v}]`));return Array.from(s.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[s.collectionRef,s.itemMap])},l]}var a=new WeakMap;function l(e,t){var r,s;let o,i,n;if("at"in Array.prototype)return Array.prototype.at.call(e,t);let a=(r=e,s=t,o=r.length,(n=(i=d(s))>=0?i:o+i)<0||n>=o?-1:n);return -1===a?void 0:e[a]}function d(e){return e!=e||0===e?0:Math.trunc(e)}(class e extends Map{#e;constructor(e){super(e),this.#e=[...super.keys()],a.set(this,!0)}set(e,t){return a.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,r){let s,o=this.has(t),i=this.#e.length,n=d(e),a=n>=0?n:i+n,l=a<0||a>=i?-1:a;if(l===this.size||o&&l===this.size-1||-1===l)return this.set(t,r),this;let c=this.size+ +!o;n<0&&a++;let u=[...this.#e],p=!1;for(let e=a;e<c;e++)if(a===e){let i=u[e];u[e]===t&&(i=u[e+1]),o&&this.delete(t),s=this.get(i),this.set(t,r)}else{p||u[e-1]!==t||(p=!0);let r=u[p?e:e-1],o=s;s=this.get(r),this.delete(r),this.set(r,o)}return this}with(t,r,s){let o=new e(this);return o.insert(t,r,s),o}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,r){let s=this.#e.indexOf(e);return -1===s?this:this.insert(s,t,r)}after(e){let t=this.#e.indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,r){let s=this.#e.indexOf(e);return -1===s?this:this.insert(s+1,t,r)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=l(this.#e,e);if(void 0!==t)return this.get(t)}entryAt(e){let t=l(this.#e,e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return l(this.#e,e)}from(e,t){let r=this.indexOf(e);if(-1===r)return;let s=r+t;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.at(s)}keyFrom(e,t){let r=this.indexOf(e);if(-1===r)return;let s=r+t;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return s;r++}}findIndex(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return r;r++}return -1}filter(t,r){let s=[],o=0;for(let e of this)Reflect.apply(t,r,[e,o,this])&&s.push(e),o++;return new e(s)}map(t,r){let s=[],o=0;for(let e of this)s.push([e[0],Reflect.apply(t,r,[e,o,this])]),o++;return new e(s)}reduce(...e){let[t,r]=e,s=0,o=r??this.at(0);for(let r of this)o=0===s&&1===e.length?r:Reflect.apply(t,this,[o,r,s,this]),s++;return o}reduceRight(...e){let[t,r]=e,s=r??this.at(-1);for(let r=this.size-1;r>=0;r--){let o=this.at(r);s=r===this.size-1&&1===e.length?o:Reflect.apply(t,this,[s,o,r,this])}return s}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let r=this.keyAt(e),s=this.get(r);t.set(r,s)}return t}toSpliced(...t){let r=[...this.entries()];return r.splice(...t),new e(r)}slice(t,r){let s=new e,o=this.size-1;if(void 0===t)return s;t<0&&(t+=this.size),void 0!==r&&r>0&&(o=r-1);for(let e=t;e<=o;e++){let t=this.keyAt(e),r=this.get(t);s.set(t,r)}return s}every(e,t){let r=0;for(let s of this){if(!Reflect.apply(e,t,[s,r,this]))return!1;r++}return!0}some(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return!0;r++}return!1}}),e.s(["createCollection",()=>n])},38573,e=>{"use strict";let t=(0,e.i(3645).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",()=>t],38573)},30702,e=>{"use strict";let t=(0,e.i(3645).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",()=>t],30702)},23925,1012,e=>{"use strict";let t=(0,e.i(3645).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",()=>t],1012),e.s(["Check",()=>t],23925)},41957,e=>{"use strict";var t=e.i(20314),r=e.i(79054),s=e.i(87620),o=r.forwardRef((e,r)=>(0,t.jsx)(s.Primitive.label,{...e,ref:r,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));o.displayName="Label",e.s(["Label",()=>o,"Root",()=>o],27572);var i=e.i(27572),i=i,n=e.i(94237),a=e.i(31777);let l=(0,n.cva)("text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),d=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(i.Root,{ref:s,className:(0,a.cn)(l(),e),...r}));d.displayName=i.Root.displayName,e.s(["Label",()=>d],41957)},23405,e=>{"use strict";var t=e.i(79054);function r(e){let r=t.useRef({value:e,previous:e});return t.useMemo(()=>(r.current.value!==e&&(r.current.previous=r.current.value,r.current.value=e),r.current.previous),[e])}e.s(["usePrevious",()=>r])},11345,e=>{"use strict";let t=(0,e.i(3645).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",()=>t],11345)},76016,e=>{"use strict";let t=(0,e.i(3645).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",()=>t],76016)},83902,e=>{"use strict";let t=(0,e.i(3645).default)("rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);e.s(["Rocket",()=>t],83902)},90382,e=>{"use strict";var t=e.i(20314),r=e.i(79054),s=e.i(91967),o=e.i(5978),i=e.i(22528),n=e.i(53532),a=e.i(41687),l=e.i(56720),d=e.i(13123),c=e.i(52740),u=e.i(39979),p=e.i(85995),f=e.i(87620),h=e.i(86874),m=e.i(36589),v=e.i(73772),x=e.i(13044),g="Popover",[y,k]=(0,i.createContextScope)(g,[c.createPopperScope]),b=(0,c.createPopperScope)(),[w,C]=y(g),R=e=>{let{__scopePopover:s,children:o,open:i,defaultOpen:n,onOpenChange:a,modal:l=!1}=e,u=b(s),p=r.useRef(null),[f,h]=r.useState(!1),[v,x]=(0,m.useControllableState)({prop:i,defaultProp:n??!1,onChange:a,caller:g});return(0,t.jsx)(c.Root,{...u,children:(0,t.jsx)(w,{scope:s,contentId:(0,d.useId)(),triggerRef:p,open:v,onOpenChange:x,onOpenToggle:r.useCallback(()=>x(e=>!e),[x]),hasCustomAnchor:f,onCustomAnchorAdd:r.useCallback(()=>h(!0),[]),onCustomAnchorRemove:r.useCallback(()=>h(!1),[]),modal:l,children:o})})};R.displayName=g;var j="PopoverAnchor",P=r.forwardRef((e,s)=>{let{__scopePopover:o,...i}=e,n=C(j,o),a=b(o),{onCustomAnchorAdd:l,onCustomAnchorRemove:d}=n;return r.useEffect(()=>(l(),()=>d()),[l,d]),(0,t.jsx)(c.Anchor,{...a,...i,ref:s})});P.displayName=j;var A="PopoverTrigger",N=r.forwardRef((e,r)=>{let{__scopePopover:i,...n}=e,a=C(A,i),l=b(i),d=(0,o.useComposedRefs)(r,a.triggerRef),u=(0,t.jsx)(f.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":B(a.open),...n,ref:d,onClick:(0,s.composeEventHandlers)(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?u:(0,t.jsx)(c.Anchor,{asChild:!0,...l,children:u})});N.displayName=A;var S="PopoverPortal",[M,T]=y(S,{forceMount:void 0}),O=e=>{let{__scopePopover:r,forceMount:s,children:o,container:i}=e,n=C(S,r);return(0,t.jsx)(M,{scope:r,forceMount:s,children:(0,t.jsx)(p.Presence,{present:s||n.open,children:(0,t.jsx)(u.Portal,{asChild:!0,container:i,children:o})})})};O.displayName=S;var z="PopoverContent",E=r.forwardRef((e,r)=>{let s=T(z,e.__scopePopover),{forceMount:o=s.forceMount,...i}=e,n=C(z,e.__scopePopover);return(0,t.jsx)(p.Presence,{present:o||n.open,children:n.modal?(0,t.jsx)(D,{...i,ref:r}):(0,t.jsx)(I,{...i,ref:r})})});E.displayName=z;var F=(0,h.createSlot)("PopoverContent.RemoveScroll"),D=r.forwardRef((e,i)=>{let n=C(z,e.__scopePopover),a=r.useRef(null),l=(0,o.useComposedRefs)(i,a),d=r.useRef(!1);return r.useEffect(()=>{let e=a.current;if(e)return(0,v.hideOthers)(e)},[]),(0,t.jsx)(x.RemoveScroll,{as:F,allowPinchZoom:!0,children:(0,t.jsx)(q,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,s.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),d.current||n.triggerRef.current?.focus()}),onPointerDownOutside:(0,s.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;d.current=2===t.button||r},{checkForDefaultPrevented:!1}),onFocusOutside:(0,s.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),I=r.forwardRef((e,s)=>{let o=C(z,e.__scopePopover),i=r.useRef(!1),n=r.useRef(!1);return(0,t.jsx)(q,{...e,ref:s,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||o.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,n.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,"pointerdown"===t.detail.originalEvent.type&&(n.current=!0));let r=t.target;o.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&n.current&&t.preventDefault()}})}),q=r.forwardRef((e,r)=>{let{__scopePopover:s,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:d,disableOutsidePointerEvents:u,onEscapeKeyDown:p,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,...v}=e,x=C(z,s),g=b(s);return(0,a.useFocusGuards)(),(0,t.jsx)(l.FocusScope,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:d,children:(0,t.jsx)(n.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:u,onInteractOutside:m,onEscapeKeyDown:p,onPointerDownOutside:f,onFocusOutside:h,onDismiss:()=>x.onOpenChange(!1),children:(0,t.jsx)(c.Content,{"data-state":B(x.open),role:"dialog",id:x.contentId,...g,...v,ref:r,style:{...v.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),L="PopoverClose",H=r.forwardRef((e,r)=>{let{__scopePopover:o,...i}=e,n=C(L,o);return(0,t.jsx)(f.Primitive.button,{type:"button",...i,ref:r,onClick:(0,s.composeEventHandlers)(e.onClick,()=>n.onOpenChange(!1))})});H.displayName=L;var _=r.forwardRef((e,r)=>{let{__scopePopover:s,...o}=e,i=b(s);return(0,t.jsx)(c.Arrow,{...i,...o,ref:r})});function B(e){return e?"open":"closed"}_.displayName="PopoverArrow",e.s(["Anchor",()=>P,"Arrow",()=>_,"Close",()=>H,"Content",()=>E,"Popover",()=>R,"PopoverAnchor",()=>P,"PopoverArrow",()=>_,"PopoverClose",()=>H,"PopoverContent",()=>E,"PopoverPortal",()=>O,"PopoverTrigger",()=>N,"Portal",()=>O,"Root",()=>R,"Trigger",()=>N,"createPopoverScope",()=>k],89920);var U=e.i(89920),U=U,K=e.i(31777);let X=U.Root,$=U.Trigger;U.Anchor;let G=r.forwardRef(({className:e,align:r="center",sideOffset:s=4,...o},i)=>(0,t.jsx)(U.Portal,{children:(0,t.jsx)(U.Content,{ref:i,align:r,sideOffset:s,className:(0,K.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border p-4 shadow-md outline-none",e),...o})}));G.displayName=U.Content.displayName,e.s(["Popover",()=>X,"PopoverContent",()=>G,"PopoverTrigger",()=>$],90382)},23852,95624,e=>{"use strict";var t=e.i(21023);let r=(0,t.createServerReference)("007f742a1639ad4b94cb8bae49483732dd6f16b589",t.callServer,void 0,t.findSourceMapURL,"getAllAgentModels");e.s(["getAllAgentModels",()=>r],23852);let s=(0,t.createServerReference)("603f193e9ea2ff792ad9e523d3102e639c1c78c088",t.callServer,void 0,t.findSourceMapURL,"updateAgentAndModel");e.s(["updateAgentAndModel",()=>s],95624)},51911,41413,e=>{"use strict";var t=e.i(20314),r=e.i(79054),s=e.i(91967),o=e.i(5978),i=e.i(22528),n=e.i(36589),a=e.i(23405),l=e.i(77624),d=e.i(87620),c="Switch",[u,p]=(0,i.createContextScope)(c),[f,h]=u(c),m=r.forwardRef((e,i)=>{let{__scopeSwitch:a,name:l,checked:u,defaultChecked:p,required:h,disabled:m,value:v="on",onCheckedChange:x,form:k,...b}=e,[w,C]=r.useState(null),R=(0,o.useComposedRefs)(i,e=>C(e)),j=r.useRef(!1),P=!w||k||!!w.closest("form"),[A,N]=(0,n.useControllableState)({prop:u,defaultProp:p??!1,onChange:x,caller:c});return(0,t.jsxs)(f,{scope:a,checked:A,disabled:m,children:[(0,t.jsx)(d.Primitive.button,{type:"button",role:"switch","aria-checked":A,"aria-required":h,"data-state":y(A),"data-disabled":m?"":void 0,disabled:m,value:v,...b,ref:R,onClick:(0,s.composeEventHandlers)(e.onClick,e=>{N(e=>!e),P&&(j.current=e.isPropagationStopped(),j.current||e.stopPropagation())})}),P&&(0,t.jsx)(g,{control:w,bubbles:!j.current,name:l,value:v,checked:A,required:h,disabled:m,form:k,style:{transform:"translateX(-100%)"}})]})});m.displayName=c;var v="SwitchThumb",x=r.forwardRef((e,r)=>{let{__scopeSwitch:s,...o}=e,i=h(v,s);return(0,t.jsx)(d.Primitive.span,{"data-state":y(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:r})});x.displayName=v;var g=r.forwardRef(({__scopeSwitch:e,control:s,checked:i,bubbles:n=!0,...d},c)=>{let u=r.useRef(null),p=(0,o.useComposedRefs)(u,c),f=(0,a.usePrevious)(i),h=(0,l.useSize)(s);return r.useEffect(()=>{let e=u.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(f!==i&&t){let r=new Event("click",{bubbles:n});t.call(e,i),e.dispatchEvent(r)}},[f,i,n]),(0,t.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i,...d,tabIndex:-1,ref:p,style:{...d.style,...h,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function y(e){return e?"checked":"unchecked"}g.displayName="SwitchBubbleInput",e.s(["Root",()=>m,"Switch",()=>m,"SwitchThumb",()=>x,"Thumb",()=>x,"createSwitchScope",()=>p],95291);var k=e.i(95291),k=k,b=e.i(31777);function w({className:e,size:r="default",...s}){return(0,t.jsx)(k.Root,{"data-slot":"switch","data-size":r,className:(0,b.cn)("peer group/switch focus-visible:border-ring focus-visible:ring-ring/50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80 inline-flex shrink-0 cursor-pointer items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6",e),...s,children:(0,t.jsx)(k.Thumb,{"data-slot":"switch-thumb",className:(0,b.cn)("bg-background dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}e.s(["Switch",()=>w],51911);var C=e.i(23925),R=e.i(11345),j=e.i(76016),P=e.i(23852),A=e.i(95624),N=e.i(86782),S=e.i(29847),M=e.i(35364),T=e.i(90382);function O({initialAgentType:e,initialModel:s,onAgentModelChange:o,disabled:i,className:n,mode:a}){let[l,d]=r.useState(!1),[c,u]=r.useState([]),[p,f]=r.useState(!0),[h,m]=r.useState(e),[v,x]=r.useState(s),[g,y]=r.useState(null),[k,w]=r.useState(0),[O,z]=r.useState(null);r.useEffect(()=>{(0,P.getAllAgentModels)().then(u).finally(()=>f(!1))},[]),r.useEffect(()=>{if(!l){let e=setTimeout(()=>{w(0),z(null)},150);return()=>clearTimeout(e)}},[l]);let E=async(e,t)=>{if(d(!1),e!==h||t!==v){if("override"===a){m(e),x(t),o?.(e,t);return}m(e),x(t),o?.(e,t),y(null);try{let r=await (0,A.updateAgentAndModel)(e,t||null);r.ok||(m(h),x(v),o?.(h,v),y(r.error??"Failed to save"))}catch{m(h),x(v),o?.(h,v),y("Failed to save")}}},F=(0,N.getAgentTypeIcon)(h),D=c.find(e=>e.agentType===h)?.label??h,I=v?(0,S.getModelMeta)(v).displayName||v:null,q=O?c.find(e=>e.agentType===O):null;return(0,t.jsxs)("div",{className:(0,b.cn)("flex flex-col gap-1",n),children:[(0,t.jsxs)(T.Popover,{open:l,onOpenChange:d,children:[(0,t.jsx)(T.PopoverTrigger,{asChild:!0,children:(0,t.jsx)(M.Button,{variant:"outline",role:"combobox","aria-expanded":l,disabled:(i??!1)||p,className:"w-auto cursor-pointer justify-start font-normal hover:border-violet-300 hover:bg-violet-50/50 dark:hover:border-violet-700 dark:hover:bg-violet-950/30",children:(0,t.jsxs)("span",{className:"flex items-center gap-2 truncate",children:[(0,t.jsx)(F,{className:"h-4 w-4 shrink-0"}),p?"Loading…":(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:D}),I?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-muted-foreground/50 text-xs",children:"·"}),(0,t.jsx)("span",{className:"text-xs font-medium",children:I})]}):null]})]})})}),(0,t.jsx)(T.PopoverContent,{className:"w-(--radix-popover-trigger-width) overflow-hidden p-0",align:"start",children:(0,t.jsxs)("div",{className:"flex transition-transform duration-200 ease-in-out",style:{transform:`translateX(${1===k?"-50%":"0%"})`,width:"200%"},children:[(0,t.jsxs)("div",{className:"w-1/2 shrink-0",children:[(0,t.jsx)("div",{className:"text-muted-foreground border-b px-3 py-2 text-xs font-medium",children:"Select agent"}),c.map(e=>{let r=(0,N.getAgentTypeIcon)(e.agentType),s=h===e.agentType,o=e.models.length>0;return(0,t.jsxs)("button",{type:"button",className:(0,b.cn)("flex w-full cursor-pointer items-center gap-2.5 px-3 py-2 text-xs transition-colors","hover:bg-accent hover:text-accent-foreground",s&&"bg-accent/50"),onClick:()=>{o?(z(e.agentType),requestAnimationFrame(()=>{requestAnimationFrame(()=>w(1))})):E(e.agentType,"")},children:[(0,t.jsx)(r,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"flex-1 text-left",children:e.label}),s&&!o?(0,t.jsx)(C.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null,o?(0,t.jsx)(j.ChevronRight,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}):null]},e.agentType)})]}),(0,t.jsx)("div",{className:"w-1/2 shrink-0",children:q?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",className:"text-muted-foreground hover:text-foreground flex w-full cursor-pointer items-center gap-1.5 border-b px-3 py-2 text-xs font-medium transition-colors",onClick:()=>{w(0),setTimeout(()=>z(null),220)},children:[(0,t.jsx)(R.ChevronLeft,{className:"h-3.5 w-3.5"}),q.label]}),q.models.map(e=>{let r=h===q.agentType&&v===e.id;return(0,t.jsxs)("button",{type:"button",className:(0,b.cn)("flex w-full cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors","hover:bg-accent hover:text-accent-foreground",r&&"bg-accent/50"),onClick:()=>E(q.agentType,e.id),children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:e.displayName}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:e.description})]}),r?(0,t.jsx)(C.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null]},e.id)})]}):null})]})})]}),!!g&&(0,t.jsx)("p",{className:"text-destructive text-sm",children:g})]})}e.s(["AgentModelPicker",()=>O],41413)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,10714,99105,e=>{"use strict";var t=e.i(3645);let r=(0,t.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);e.s(["default",()=>r],10714);let s=(0,t.default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",()=>s],99105)},19933,e=>{"use strict";let t=(0,e.i(3645).default)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);e.s(["FolderOpen",()=>t],19933)},8986,11124,18662,51684,e=>{"use strict";let t=(0,e.i(3645).default)("code-xml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);e.s(["Code2",()=>t],8986);var r=e.i(21023);let s=(0,r.createServerReference)("4037c9d2fae0699fd6555209e3896003d4ae95cd67",r.callServer,void 0,r.findSourceMapURL,"openIde");e.s(["openIde",()=>s],11124);let i=(0,r.createServerReference)("40b0c7dc69ad3c197c95ef523a9c4e2592266ab628",r.callServer,void 0,r.findSourceMapURL,"openShell");e.s(["openShell",()=>i],18662);let l=(0,r.createServerReference)("40249c55eaeb3deb88f6cfac62ab0ff50d2403235d",r.callServer,void 0,r.findSourceMapURL,"openFolder");e.s(["openFolder",()=>l],51684)},16298,e=>{"use strict";let t=(0,e.i(3645).default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);e.s(["default",()=>t])},53360,e=>{"use strict";let t=(0,e.i(3645).default)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);e.s(["Zap",()=>t],53360)},23405,e=>{"use strict";var t=e.i(79054);function r(e){let r=t.useRef({value:e,previous:e});return t.useMemo(()=>(r.current.value!==e&&(r.current.previous=r.current.value,r.current.value=e),r.current.previous),[e])}e.s(["usePrevious",()=>r])},76016,e=>{"use strict";let t=(0,e.i(3645).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",()=>t],76016)},11345,e=>{"use strict";let t=(0,e.i(3645).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",()=>t],11345)},97667,e=>{"use strict";var t=e.i(1012);e.s(["CheckIcon",()=>t.default])},30702,e=>{"use strict";let t=(0,e.i(3645).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",()=>t],30702)},38573,e=>{"use strict";let t=(0,e.i(3645).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",()=>t],38573)},81846,e=>{"use strict";var t=e.i(20314),r=e.i(94237),s=e.i(31777);let i=(0,r.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-none",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function l({className:e,variant:r,...l}){return(0,t.jsx)("div",{className:(0,s.cn)(i({variant:r}),e),...l})}e.s(["Badge",()=>l])},1650,e=>{"use strict";e.i(11495),e.s([])},23925,1012,e=>{"use strict";let t=(0,e.i(3645).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",()=>t],1012),e.s(["Check",()=>t],23925)},41957,e=>{"use strict";var t=e.i(20314),r=e.i(79054),s=e.i(87620),i=r.forwardRef((e,r)=>(0,t.jsx)(s.Primitive.label,{...e,ref:r,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));i.displayName="Label",e.s(["Label",()=>i,"Root",()=>i],27572);var l=e.i(27572),l=l,n=e.i(94237),o=e.i(31777);let a=(0,n.cva)("text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),u=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(l.Root,{ref:s,className:(0,o.cn)(a(),e),...r}));u.displayName=l.Root.displayName,e.s(["Label",()=>u],41957)},87342,e=>{"use strict";var t=e.i(79054),r=e.i(22528),s=e.i(5978),i=e.i(86874),l=e.i(20314);function n(e){let n=e+"CollectionProvider",[o,a]=(0,r.createContextScope)(n),[u,c]=o(n,{collectionRef:{current:null},itemMap:new Map}),d=e=>{let{scope:r,children:s}=e,i=t.default.useRef(null),n=t.default.useRef(new Map).current;return(0,l.jsx)(u,{scope:r,itemMap:n,collectionRef:i,children:s})};d.displayName=n;let f=e+"CollectionSlot",h=(0,i.createSlot)(f),p=t.default.forwardRef((e,t)=>{let{scope:r,children:i}=e,n=c(f,r),o=(0,s.useComposedRefs)(t,n.collectionRef);return(0,l.jsx)(h,{ref:o,children:i})});p.displayName=f;let v=e+"CollectionItemSlot",y="data-radix-collection-item",m=(0,i.createSlot)(v),x=t.default.forwardRef((e,r)=>{let{scope:i,children:n,...o}=e,a=t.default.useRef(null),u=(0,s.useComposedRefs)(r,a),d=c(v,i);return t.default.useEffect(()=>(d.itemMap.set(a,{ref:a,...o}),()=>void d.itemMap.delete(a))),(0,l.jsx)(m,{...{[y]:""},ref:u,children:n})});return x.displayName=v,[{Provider:d,Slot:p,ItemSlot:x},function(r){let s=c(e+"CollectionConsumer",r);return t.default.useCallback(()=>{let e=s.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${y}]`));return Array.from(s.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[s.collectionRef,s.itemMap])},a]}var o=new WeakMap;function a(e,t){var r,s;let i,l,n;if("at"in Array.prototype)return Array.prototype.at.call(e,t);let o=(r=e,s=t,i=r.length,(n=(l=u(s))>=0?l:i+l)<0||n>=i?-1:n);return -1===o?void 0:e[o]}function u(e){return e!=e||0===e?0:Math.trunc(e)}(class e extends Map{#e;constructor(e){super(e),this.#e=[...super.keys()],o.set(this,!0)}set(e,t){return o.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,r){let s,i=this.has(t),l=this.#e.length,n=u(e),o=n>=0?n:l+n,a=o<0||o>=l?-1:o;if(a===this.size||i&&a===this.size-1||-1===a)return this.set(t,r),this;let c=this.size+ +!i;n<0&&o++;let d=[...this.#e],f=!1;for(let e=o;e<c;e++)if(o===e){let l=d[e];d[e]===t&&(l=d[e+1]),i&&this.delete(t),s=this.get(l),this.set(t,r)}else{f||d[e-1]!==t||(f=!0);let r=d[f?e:e-1],i=s;s=this.get(r),this.delete(r),this.set(r,i)}return this}with(t,r,s){let i=new e(this);return i.insert(t,r,s),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,r){let s=this.#e.indexOf(e);return -1===s?this:this.insert(s,t,r)}after(e){let t=this.#e.indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,r){let s=this.#e.indexOf(e);return -1===s?this:this.insert(s+1,t,r)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=a(this.#e,e);if(void 0!==t)return this.get(t)}entryAt(e){let t=a(this.#e,e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return a(this.#e,e)}from(e,t){let r=this.indexOf(e);if(-1===r)return;let s=r+t;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.at(s)}keyFrom(e,t){let r=this.indexOf(e);if(-1===r)return;let s=r+t;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return s;r++}}findIndex(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return r;r++}return -1}filter(t,r){let s=[],i=0;for(let e of this)Reflect.apply(t,r,[e,i,this])&&s.push(e),i++;return new e(s)}map(t,r){let s=[],i=0;for(let e of this)s.push([e[0],Reflect.apply(t,r,[e,i,this])]),i++;return new e(s)}reduce(...e){let[t,r]=e,s=0,i=r??this.at(0);for(let r of this)i=0===s&&1===e.length?r:Reflect.apply(t,this,[i,r,s,this]),s++;return i}reduceRight(...e){let[t,r]=e,s=r??this.at(-1);for(let r=this.size-1;r>=0;r--){let i=this.at(r);s=r===this.size-1&&1===e.length?i:Reflect.apply(t,this,[s,i,r,this])}return s}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let r=this.keyAt(e),s=this.get(r);t.set(r,s)}return t}toSpliced(...t){let r=[...this.entries()];return r.splice(...t),new e(r)}slice(t,r){let s=new e,i=this.size-1;if(void 0===t)return s;t<0&&(t+=this.size),void 0!==r&&r>0&&(i=r-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),r=this.get(t);s.set(t,r)}return s}every(e,t){let r=0;for(let s of this){if(!Reflect.apply(e,t,[s,r,this]))return!1;r++}return!0}some(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return!0;r++}return!1}}),e.s(["createCollection",()=>n])},51080,e=>{"use strict";var t=e.i(79054),r=e.i(91967),s=e.i(87342),i=e.i(5978),l=e.i(22528),n=e.i(13123),o=e.i(87620),a=e.i(29297),u=e.i(36589),c=e.i(66033),d=e.i(20314),f="rovingFocusGroup.onEntryFocus",h={bubbles:!1,cancelable:!0},p="RovingFocusGroup",[v,y,m]=(0,s.createCollection)(p),[x,g]=(0,l.createContextScope)(p,[m]),[k,R]=x(p),b=t.forwardRef((e,t)=>(0,d.jsx)(v.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,d.jsx)(v.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,d.jsx)(w,{...e,ref:t})})}));b.displayName=p;var w=t.forwardRef((e,s)=>{let{__scopeRovingFocusGroup:l,orientation:n,loop:v=!1,dir:m,currentTabStopId:x,defaultCurrentTabStopId:g,onCurrentTabStopIdChange:R,onEntryFocus:b,preventScrollOnEntryFocus:w=!1,...S}=e,A=t.useRef(null),M=(0,i.useComposedRefs)(s,A),I=(0,c.useDirection)(m),[F,T]=(0,u.useControllableState)({prop:x,defaultProp:g??null,onChange:R,caller:p}),[j,z]=t.useState(!1),E=(0,a.useCallbackRef)(b),P=y(l),L=t.useRef(!1),[D,O]=t.useState(0);return t.useEffect(()=>{let e=A.current;if(e)return e.addEventListener(f,E),()=>e.removeEventListener(f,E)},[E]),(0,d.jsx)(k,{scope:l,orientation:n,dir:I,loop:v,currentTabStopId:F,onItemFocus:t.useCallback(e=>T(e),[T]),onItemShiftTab:t.useCallback(()=>z(!0),[]),onFocusableItemAdd:t.useCallback(()=>O(e=>e+1),[]),onFocusableItemRemove:t.useCallback(()=>O(e=>e-1),[]),children:(0,d.jsx)(o.Primitive.div,{tabIndex:j||0===D?-1:0,"data-orientation":n,...S,ref:M,style:{outline:"none",...e.style},onMouseDown:(0,r.composeEventHandlers)(e.onMouseDown,()=>{L.current=!0}),onFocus:(0,r.composeEventHandlers)(e.onFocus,e=>{let t=!L.current;if(e.target===e.currentTarget&&t&&!j){let t=new CustomEvent(f,h);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=P().filter(e=>e.focusable);C([e.find(e=>e.active),e.find(e=>e.id===F),...e].filter(Boolean).map(e=>e.ref.current),w)}}L.current=!1}),onBlur:(0,r.composeEventHandlers)(e.onBlur,()=>z(!1))})})}),S="RovingFocusGroupItem",A=t.forwardRef((e,s)=>{let{__scopeRovingFocusGroup:i,focusable:l=!0,active:a=!1,tabStopId:u,children:c,...f}=e,h=(0,n.useId)(),p=u||h,m=R(S,i),x=m.currentTabStopId===p,g=y(i),{onFocusableItemAdd:k,onFocusableItemRemove:b,currentTabStopId:w}=m;return t.useEffect(()=>{if(l)return k(),()=>b()},[l,k,b]),(0,d.jsx)(v.ItemSlot,{scope:i,id:p,focusable:l,active:a,children:(0,d.jsx)(o.Primitive.span,{tabIndex:x?0:-1,"data-orientation":m.orientation,...f,ref:s,onMouseDown:(0,r.composeEventHandlers)(e.onMouseDown,e=>{l?m.onItemFocus(p):e.preventDefault()}),onFocus:(0,r.composeEventHandlers)(e.onFocus,()=>m.onItemFocus(p)),onKeyDown:(0,r.composeEventHandlers)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void m.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=function(e,t,r){var s;let i=(s=e.key,"rtl"!==r?s:"ArrowLeft"===s?"ArrowRight":"ArrowRight"===s?"ArrowLeft":s);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(i))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(i)))return M[i]}(e,m.orientation,m.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let i=g().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)i.reverse();else if("prev"===t||"next"===t){var r,s;"prev"===t&&i.reverse();let l=i.indexOf(e.currentTarget);i=m.loop?(r=i,s=l+1,r.map((e,t)=>r[(s+t)%r.length])):i.slice(l+1)}setTimeout(()=>C(i))}}),children:"function"==typeof c?c({isCurrentTabStop:x,hasTabStop:null!=w}):c})})});A.displayName=S;var M={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function C(e,t=!1){let r=document.activeElement;for(let s of e)if(s===r||(s.focus({preventScroll:t}),document.activeElement!==r))return}e.s(["Item",()=>A,"Root",()=>b,"createRovingFocusGroupScope",()=>g])},33548,e=>{"use strict";let t=(0,e.i(3645).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",()=>t],33548)},95812,35e3,e=>{"use strict";let t=(0,e.i(3645).default)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["Circle",()=>t],95812);var r=e.i(80986);e.s(["CheckCircle2",()=>r.default],35e3)},54793,7729,e=>{"use strict";var t=e.i(20314),r=e.i(31777);function s({icon:e,title:s,description:i,action:l,className:n,...o}){return(0,t.jsxs)("div",{className:(0,r.cn)("flex flex-col items-center gap-4 px-4 py-12 text-center",n),...o,children:[e?(0,t.jsx)("div",{className:"text-muted-foreground",children:e}):null,(0,t.jsx)("h3",{className:"text-lg font-semibold",children:s}),i?(0,t.jsx)("p",{className:"text-muted-foreground max-w-md text-sm",children:i}):null,l?(0,t.jsx)("div",{className:"mt-2",children:l}):null]})}e.s(["EmptyState",()=>s],7729),e.s([],54793)},23852,95624,e=>{"use strict";var t=e.i(21023);let r=(0,t.createServerReference)("007f742a1639ad4b94cb8bae49483732dd6f16b589",t.callServer,void 0,t.findSourceMapURL,"getAllAgentModels");e.s(["getAllAgentModels",()=>r],23852);let s=(0,t.createServerReference)("603f193e9ea2ff792ad9e523d3102e639c1c78c088",t.callServer,void 0,t.findSourceMapURL,"updateAgentAndModel");e.s(["updateAgentAndModel",()=>s],95624)},18984,e=>{"use strict";var t=e.i(21023);let r=(0,t.createServerReference)("400e4de9e23b4d146df50e802a4329316d315eb642",t.callServer,void 0,t.findSourceMapURL,"addRepository");e.s(["addRepository",()=>r])},76852,e=>{"use strict";var t=e.i(79054),r=e.i(11124),s=e.i(18662),i=e.i(51684);function l(e){let[l,n]=(0,t.useState)(!1),[o,a]=(0,t.useState)(!1),[u,c]=(0,t.useState)(!1),[d,f]=(0,t.useState)(null),[h,p]=(0,t.useState)(null),[v,y]=(0,t.useState)(null),m=(0,t.useRef)(null),x=(0,t.useRef)(null),g=(0,t.useRef)(null);(0,t.useEffect)(()=>()=>{m.current&&clearTimeout(m.current),x.current&&clearTimeout(x.current),g.current&&clearTimeout(g.current)},[]);let k=(0,t.useCallback)(async(t,r,s,i,l)=>{if(e&&!l){i.current&&clearTimeout(i.current),r(!0),s(null);try{let e=await t();if(!e.success){let t=e.error??"An unexpected error occurred";s(t),i.current=setTimeout(()=>s(null),5e3)}}catch(e){s(e instanceof Error?e.message:"An unexpected error occurred"),i.current=setTimeout(()=>s(null),5e3)}finally{r(!1)}}},[e]);return{openInIde:(0,t.useCallback)(()=>k(()=>(0,r.openIde)({repositoryPath:e.repositoryPath}),n,f,m,l),[k,l,e]),openInShell:(0,t.useCallback)(()=>k(()=>(0,s.openShell)({repositoryPath:e.repositoryPath}),a,p,x,o),[k,o,e]),openFolder:(0,t.useCallback)(()=>k(()=>(0,i.openFolder)(e.repositoryPath),c,y,g,u),[k,u,e]),ideLoading:l,shellLoading:o,folderLoading:u,ideError:d,shellError:h,folderError:v}}e.s(["useRepositoryActions",()=>l])}]);