@shepai/cli 1.122.2 → 1.123.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (227) hide show
  1. package/dist/src/presentation/web/app/(dashboard)/get-graph-data.d.ts +6 -0
  2. package/dist/src/presentation/web/app/(dashboard)/get-graph-data.d.ts.map +1 -1
  3. package/dist/src/presentation/web/app/(dashboard)/get-graph-data.js +60 -0
  4. package/dist/src/presentation/web/app/actions/get-feature-phase-timings.d.ts +2 -0
  5. package/dist/src/presentation/web/app/actions/get-feature-phase-timings.d.ts.map +1 -1
  6. package/dist/src/presentation/web/app/actions/get-feature-phase-timings.js +2 -0
  7. package/dist/src/presentation/web/app/build-graph-nodes.d.ts +7 -0
  8. package/dist/src/presentation/web/app/build-graph-nodes.d.ts.map +1 -1
  9. package/dist/src/presentation/web/app/build-graph-nodes.js +7 -0
  10. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.d.ts.map +1 -1
  11. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.js +20 -9
  12. package/dist/src/presentation/web/components/common/feature-drawer-tabs/activity-tab.d.ts.map +1 -1
  13. package/dist/src/presentation/web/components/common/feature-drawer-tabs/activity-tab.js +130 -31
  14. package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.d.ts.map +1 -1
  15. package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.js +13 -0
  16. package/dist/src/presentation/web/components/common/feature-drawer-tabs/use-tab-data-fetch.d.ts.map +1 -1
  17. package/dist/src/presentation/web/components/common/feature-drawer-tabs/use-tab-data-fetch.js +18 -9
  18. package/dist/src/presentation/web/components/common/repository-node/repository-node-config.d.ts +8 -0
  19. package/dist/src/presentation/web/components/common/repository-node/repository-node-config.d.ts.map +1 -1
  20. package/dist/src/presentation/web/components/common/repository-node/repository-node.d.ts.map +1 -1
  21. package/dist/src/presentation/web/components/common/repository-node/repository-node.js +6 -6
  22. package/dist/src/presentation/web/components/common/repository-node/repository-node.stories.d.ts +2 -0
  23. package/dist/src/presentation/web/components/common/repository-node/repository-node.stories.d.ts.map +1 -1
  24. package/dist/src/presentation/web/components/common/repository-node/repository-node.stories.js +107 -17
  25. package/dist/src/presentation/web/components/features/control-center/control-center-empty-state.d.ts.map +1 -1
  26. package/dist/src/presentation/web/components/features/control-center/control-center-empty-state.js +18 -18
  27. package/dist/src/presentation/web/components/features/control-center/control-center-inner.d.ts.map +1 -1
  28. package/dist/src/presentation/web/components/features/control-center/control-center-inner.js +31 -17
  29. package/dist/src/presentation/web/components/features/control-center/welcome-agent-setup.d.ts.map +1 -1
  30. package/dist/src/presentation/web/components/features/control-center/welcome-agent-setup.js +29 -22
  31. package/dist/src/presentation/web/components/features/features-canvas/features-canvas.js +1 -1
  32. package/dist/src/presentation/web/components/layouts/app-shell/app-shell.d.ts.map +1 -1
  33. package/dist/src/presentation/web/components/layouts/app-shell/app-shell.js +2 -2
  34. package/dist/src/presentation/web/hooks/sidebar-features-context.d.ts +2 -0
  35. package/dist/src/presentation/web/hooks/sidebar-features-context.d.ts.map +1 -1
  36. package/dist/src/presentation/web/hooks/sidebar-features-context.js +2 -1
  37. package/dist/src/presentation/web/lib/layout-with-dagre.js +1 -1
  38. package/dist/tsconfig.build.tsbuildinfo +1 -1
  39. package/package.json +1 -1
  40. package/web/.next/BUILD_ID +1 -1
  41. package/web/.next/build-manifest.json +2 -2
  42. package/web/.next/fallback-build-manifest.json +2 -2
  43. package/web/.next/prerender-manifest.json +3 -3
  44. package/web/.next/required-server-files.js +2 -2
  45. package/web/.next/required-server-files.json +2 -2
  46. package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +22 -22
  47. package/web/.next/server/app/(dashboard)/@drawer/create/page.js +2 -2
  48. package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
  49. package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
  50. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +28 -28
  51. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js +3 -3
  52. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  53. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  54. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +28 -28
  55. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js +3 -3
  56. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
  57. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
  58. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +20 -20
  59. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js +2 -2
  60. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
  61. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  62. package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +22 -22
  63. package/web/.next/server/app/(dashboard)/create/page.js +2 -2
  64. package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
  65. package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
  66. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +28 -28
  67. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js +3 -3
  68. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  69. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  70. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +28 -28
  71. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js +3 -3
  72. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
  73. package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
  74. package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +20 -20
  75. package/web/.next/server/app/(dashboard)/page.js +2 -2
  76. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  77. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  78. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +20 -20
  79. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js +2 -2
  80. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
  81. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  82. package/web/.next/server/app/_global-error.html +2 -2
  83. package/web/.next/server/app/_global-error.rsc +1 -1
  84. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  85. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  86. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  87. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  88. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  89. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  90. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  91. package/web/.next/server/app/api/graph-data/route.js +1 -1
  92. package/web/.next/server/app/api/graph-data/route.js.nft.json +1 -1
  93. package/web/.next/server/app/settings/page/server-reference-manifest.json +6 -6
  94. package/web/.next/server/app/settings/page.js.nft.json +1 -1
  95. package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  96. package/web/.next/server/app/skills/page/server-reference-manifest.json +6 -6
  97. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  98. package/web/.next/server/app/tools/page/server-reference-manifest.json +6 -6
  99. package/web/.next/server/app/tools/page.js.nft.json +1 -1
  100. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  101. package/web/.next/server/app/version/page/server-reference-manifest.json +1 -1
  102. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  103. package/web/.next/server/chunks/403f9_next_dist_esm_build_templates_app-route_370c43b1.js +1 -1
  104. package/web/.next/server/chunks/403f9_next_dist_esm_build_templates_app-route_370c43b1.js.map +1 -1
  105. package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
  106. package/web/.next/server/chunks/[root-of-the-server]__dcd4f847._.js +3 -0
  107. package/web/.next/server/chunks/{[root-of-the-server]__42b7ab55._.js.map → [root-of-the-server]__dcd4f847._.js.map} +1 -1
  108. package/web/.next/server/chunks/ssr/403f9_next_dist_31ea46d3._.js +1 -1
  109. package/web/.next/server/chunks/ssr/403f9_next_dist_c9d9b4d7._.js +1 -1
  110. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
  111. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
  112. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_f30d0343.js +1 -1
  113. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_f30d0343.js.map +1 -1
  114. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_9f1775bb.js +1 -1
  115. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_9f1775bb.js.map +1 -1
  116. package/web/.next/server/chunks/ssr/[root-of-the-server]__06fef644._.js +1 -1
  117. package/web/.next/server/chunks/ssr/{[root-of-the-server]__a022445f._.js → [root-of-the-server]__14664e9b._.js} +3 -3
  118. package/web/.next/server/chunks/ssr/{[root-of-the-server]__a022445f._.js.map → [root-of-the-server]__14664e9b._.js.map} +1 -1
  119. package/web/.next/server/chunks/ssr/[root-of-the-server]__4993a47c._.js +3 -0
  120. package/web/.next/server/chunks/ssr/[root-of-the-server]__4993a47c._.js.map +1 -0
  121. package/web/.next/server/chunks/ssr/[root-of-the-server]__545792ab._.js +1 -1
  122. package/web/.next/server/chunks/ssr/[root-of-the-server]__545792ab._.js.map +1 -1
  123. package/web/.next/server/chunks/ssr/[root-of-the-server]__6677a82c._.js +3 -0
  124. package/web/.next/server/chunks/ssr/{[root-of-the-server]__b724df9e._.js.map → [root-of-the-server]__6677a82c._.js.map} +1 -1
  125. package/web/.next/server/chunks/ssr/[root-of-the-server]__6b17a22d._.js +1 -1
  126. package/web/.next/server/chunks/ssr/[root-of-the-server]__6b17a22d._.js.map +1 -1
  127. package/web/.next/server/chunks/ssr/[root-of-the-server]__6bb00d90._.js +2 -2
  128. package/web/.next/server/chunks/ssr/[root-of-the-server]__6bb00d90._.js.map +1 -1
  129. package/web/.next/server/chunks/ssr/{[root-of-the-server]__8e3bf5d7._.js → [root-of-the-server]__7cbda1ea._.js} +2 -2
  130. package/web/.next/server/chunks/ssr/[root-of-the-server]__7cbda1ea._.js.map +1 -0
  131. package/web/.next/server/chunks/ssr/[root-of-the-server]__804c006d._.js +1 -1
  132. package/web/.next/server/chunks/ssr/[root-of-the-server]__804c006d._.js.map +1 -1
  133. package/web/.next/server/chunks/ssr/[root-of-the-server]__8c553503._.js +2 -2
  134. package/web/.next/server/chunks/ssr/{[root-of-the-server]__2698e9f4._.js → [root-of-the-server]__9e8b25ad._.js} +2 -2
  135. package/web/.next/server/chunks/ssr/[root-of-the-server]__9e8b25ad._.js.map +1 -0
  136. package/web/.next/server/chunks/ssr/[root-of-the-server]__a7de2711._.js +2 -2
  137. package/web/.next/server/chunks/ssr/{[root-of-the-server]__c07f9f79._.js → [root-of-the-server]__aed1d6f8._.js} +2 -2
  138. package/web/.next/server/chunks/ssr/[root-of-the-server]__aed1d6f8._.js.map +1 -0
  139. package/web/.next/server/chunks/ssr/{[root-of-the-server]__c605a375._.js → [root-of-the-server]__ce6057f6._.js} +2 -2
  140. package/web/.next/server/chunks/ssr/[root-of-the-server]__ce6057f6._.js.map +1 -0
  141. package/web/.next/server/chunks/ssr/_135edb9c._.js +1 -1
  142. package/web/.next/server/chunks/ssr/_135edb9c._.js.map +1 -1
  143. package/web/.next/server/chunks/ssr/_2f6f48b8._.js +1 -1
  144. package/web/.next/server/chunks/ssr/_2f6f48b8._.js.map +1 -1
  145. package/web/.next/server/chunks/ssr/_3a4c94e3._.js +1 -1
  146. package/web/.next/server/chunks/ssr/{_42caff2c._.js → _960ceb5d._.js} +2 -2
  147. package/web/.next/server/chunks/ssr/_960ceb5d._.js.map +1 -0
  148. package/web/.next/server/chunks/ssr/_b56e7571._.js +3 -0
  149. package/web/.next/server/chunks/ssr/_b56e7571._.js.map +1 -0
  150. package/web/.next/server/chunks/ssr/_cc77a143._.js +1 -1
  151. package/web/.next/server/chunks/ssr/_cc77a143._.js.map +1 -1
  152. package/web/.next/server/chunks/ssr/{_0dc2cfd3._.js → _e9703421._.js} +2 -2
  153. package/web/.next/server/chunks/ssr/_e9703421._.js.map +1 -0
  154. package/web/.next/server/chunks/ssr/_fd4c574b._.js +3 -0
  155. package/web/.next/server/chunks/ssr/_fd4c574b._.js.map +1 -0
  156. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
  157. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
  158. package/web/.next/server/chunks/ssr/node_modules__pnpm_bc66dcc6._.js +3 -0
  159. package/web/.next/server/chunks/ssr/node_modules__pnpm_bc66dcc6._.js.map +1 -0
  160. package/web/.next/server/chunks/ssr/src_presentation_web_5f039db1._.js +2 -2
  161. package/web/.next/server/chunks/ssr/src_presentation_web_5f039db1._.js.map +1 -1
  162. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_2a52b697.js +1 -1
  163. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_2a52b697.js.map +1 -1
  164. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js +1 -1
  165. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js.map +1 -1
  166. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js +1 -1
  167. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js.map +1 -1
  168. package/web/.next/server/chunks/ssr/src_presentation_web_c4337169._.js +2 -2
  169. package/web/.next/server/chunks/ssr/src_presentation_web_c4337169._.js.map +1 -1
  170. package/web/.next/server/chunks/ssr/src_presentation_web_ca99d62d._.js +1 -1
  171. package/web/.next/server/chunks/ssr/src_presentation_web_ca99d62d._.js.map +1 -1
  172. package/web/.next/server/chunks/ssr/src_presentation_web_components_bf50c527._.js +1 -1
  173. package/web/.next/server/chunks/ssr/src_presentation_web_components_bf50c527._.js.map +1 -1
  174. package/web/.next/server/chunks/ssr/src_presentation_web_components_de814675._.js +1 -1
  175. package/web/.next/server/chunks/ssr/src_presentation_web_components_de814675._.js.map +1 -1
  176. package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js +1 -1
  177. package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js.map +1 -1
  178. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
  179. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
  180. package/web/.next/server/chunks/ssr/src_presentation_web_db779ef4._.js +3 -0
  181. package/web/.next/server/chunks/ssr/src_presentation_web_db779ef4._.js.map +1 -0
  182. package/web/.next/server/pages/500.html +2 -2
  183. package/web/.next/server/server-reference-manifest.js +1 -1
  184. package/web/.next/server/server-reference-manifest.json +34 -34
  185. package/web/.next/static/chunks/{0110425f3a60fc18.js → 310be54600c8ce20.js} +2 -2
  186. package/web/.next/static/chunks/{ff81a9dd7b7bc56f.js → 373e10090c6410c4.js} +1 -1
  187. package/web/.next/static/chunks/3925626b99dcd57a.css +1 -0
  188. package/web/.next/static/chunks/3f6c44cbad751310.js +1 -0
  189. package/web/.next/static/chunks/4443ee9c7733399b.js +1 -0
  190. package/web/.next/static/chunks/{f464a486bd88502d.js → 64d063449c3be0ec.js} +1 -1
  191. package/web/.next/static/chunks/694718e5449b3150.js +1 -0
  192. package/web/.next/static/chunks/{6339d1c357e7fea3.js → 878643f90bc6360f.js} +2 -2
  193. package/web/.next/static/chunks/94af5be1ccf8842e.js +1 -0
  194. package/web/.next/static/chunks/9821072252ddb89a.js +1 -0
  195. package/web/.next/static/chunks/ac7251026c1e2cdf.js +1 -0
  196. package/web/.next/static/chunks/{96eeeb28e06de78c.js → dbbb446493f21874.js} +1 -1
  197. package/web/.next/static/chunks/e418898e8e02f50a.js +1 -0
  198. package/web/.next/static/chunks/{17d618a2fb4e9a11.js → f0dfeedb263eb906.js} +1 -1
  199. package/web/.next/server/chunks/[root-of-the-server]__42b7ab55._.js +0 -3
  200. package/web/.next/server/chunks/ssr/[root-of-the-server]__2698e9f4._.js.map +0 -1
  201. package/web/.next/server/chunks/ssr/[root-of-the-server]__8e3bf5d7._.js.map +0 -1
  202. package/web/.next/server/chunks/ssr/[root-of-the-server]__9f155c0e._.js +0 -3
  203. package/web/.next/server/chunks/ssr/[root-of-the-server]__9f155c0e._.js.map +0 -1
  204. package/web/.next/server/chunks/ssr/[root-of-the-server]__b724df9e._.js +0 -3
  205. package/web/.next/server/chunks/ssr/[root-of-the-server]__c07f9f79._.js.map +0 -1
  206. package/web/.next/server/chunks/ssr/[root-of-the-server]__c605a375._.js.map +0 -1
  207. package/web/.next/server/chunks/ssr/_0dc2cfd3._.js.map +0 -1
  208. package/web/.next/server/chunks/ssr/_42caff2c._.js.map +0 -1
  209. package/web/.next/server/chunks/ssr/_75f4ccb3._.js +0 -3
  210. package/web/.next/server/chunks/ssr/_75f4ccb3._.js.map +0 -1
  211. package/web/.next/server/chunks/ssr/_9b7b1c2b._.js +0 -3
  212. package/web/.next/server/chunks/ssr/_9b7b1c2b._.js.map +0 -1
  213. package/web/.next/server/chunks/ssr/_ecfef26e._.js +0 -3
  214. package/web/.next/server/chunks/ssr/_ecfef26e._.js.map +0 -1
  215. package/web/.next/server/chunks/ssr/node_modules__pnpm_b59e4b16._.js +0 -3
  216. package/web/.next/server/chunks/ssr/node_modules__pnpm_b59e4b16._.js.map +0 -1
  217. package/web/.next/static/chunks/0d2af96e64960ef5.css +0 -1
  218. package/web/.next/static/chunks/12f3ae6b693c8baf.js +0 -1
  219. package/web/.next/static/chunks/4562ee849ea13c3a.js +0 -1
  220. package/web/.next/static/chunks/83fed73369b40eaf.js +0 -1
  221. package/web/.next/static/chunks/845d8e58a91014e6.js +0 -1
  222. package/web/.next/static/chunks/8e5bdf9fb945ae6a.js +0 -1
  223. package/web/.next/static/chunks/be0d245d0e672d44.js +0 -1
  224. package/web/.next/static/chunks/e6c0bf49bcd5d0fb.js +0 -1
  225. /package/web/.next/static/{DIjy_LTLHBNoz5RRTRhBy → gBTe97SiNDA2hbG9dbfpb}/_buildManifest.js +0 -0
  226. /package/web/.next/static/{DIjy_LTLHBNoz5RRTRhBy → gBTe97SiNDA2hbG9dbfpb}/_clientMiddlewareManifest.json +0 -0
  227. /package/web/.next/static/{DIjy_LTLHBNoz5RRTRhBy → gBTe97SiNDA2hbG9dbfpb}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,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])},95230,e=>{"use strict";let t=(0,e.i(3645).default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);e.s(["default",()=>t])},16868,48306,80436,28267,86254,50032,42076,e=>{"use strict";var t=e.i(3645);let r=(0,t.default)("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);e.s(["PaperclipIcon",()=>r],16868);var a=e.i(20314),s=e.i(31777);function o({className:e,...t}){return(0,a.jsx)("textarea",{"data-slot":"textarea",className:(0,s.cn)("placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input field-sizing-content min-h-[80px] w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none 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),...t})}e.s(["Textarea",()=>o],48306);var i=e.i(60253),n=e.i(15506),n=n,l=e.i(95230);e.s(["DownloadIcon",()=>l.default],80436);var l=l,d=e.i(2287),c=e.i(1693);e.s(["VisuallyHidden",0,c],28267);var c=c;let p=(0,t.default)("file",[["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"}]]);var u=e.i(16298),u=u;let h=(0,t.default)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);var m=e.i(93752),m=m;e.i(35364);let x=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]),f=new Set([".ts",".tsx",".js",".jsx",".json",".yaml",".yml",".xml",".html",".css",".md"]);function g(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,t)).toFixed(+(0!==t))} ${["B","KB","MB","GB"][t]}`}let b=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]);function v(e,t){let r=new URLSearchParams({path:e,mimeType:t});return`/api/attachments/preview?${r.toString()}`}function j({name:e,size:t,mimeType:r,path:o,onRemove:j,loading:w=!1,disabled:y=!1}){let C,k,N=(C=e.lastIndexOf("."))>=0?e.slice(C).toLowerCase():"",P=x.has(N)?h:".pdf"===N?u.default:f.has(N)?m.default:p,T=".pdf"===N?"bg-red-50 text-red-600":x.has(N)?"bg-blue-50 text-blue-600":f.has(N)?"bg-emerald-50 text-emerald-600":"bg-gray-50 text-gray-600",S=(k=e.lastIndexOf("."))>=0&&b.has(e.slice(k).toLowerCase());return w?(0,a.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-md border",children:(0,a.jsx)(n.default,{className:"text-muted-foreground h-5 w-5 animate-spin"})}):S?(0,a.jsxs)(d.Dialog,{children:[(0,a.jsxs)("div",{className:"group relative",children:[(0,a.jsx)(d.DialogTrigger,{asChild:!0,children:(0,a.jsx)("img",{src:v(o,r),alt:e,title:e,className:"h-12 w-12 cursor-pointer rounded-md border object-cover transition-opacity hover:opacity-80"})}),!y&&(0,a.jsx)("button",{type:"button",onClick:j,className:"absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex","aria-label":`Remove ${e}`,children:(0,a.jsx)(i.X,{className:"h-3 w-3"})})]}),(0,a.jsxs)(d.DialogContent,{className:"max-w-3xl gap-0 overflow-hidden border-0 p-0 [&>button:last-child]:!cursor-pointer [&>button:last-child]:!rounded-full [&>button:last-child]:!bg-black/70 [&>button:last-child]:!p-1.5 [&>button:last-child]:!text-white [&>button:last-child]:!opacity-100 [&>button:last-child]:!shadow-lg [&>button:last-child]:!backdrop-blur-md [&>button:last-child]:hover:!bg-black/90",children:[(0,a.jsx)(c.Root,{children:(0,a.jsxs)(d.DialogTitle,{children:["Preview: ",e]})}),(0,a.jsx)("div",{className:"relative bg-black/90",children:(0,a.jsx)("img",{src:v(o,r),alt:e,className:"h-auto max-h-[70vh] w-full object-contain"})}),(0,a.jsxs)("div",{className:"bg-background flex items-center gap-3 px-4 py-3",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,a.jsx)("span",{className:"truncate text-sm font-medium",children:e}),(0,a.jsx)("span",{className:"text-muted-foreground text-xs",children:g(t)})]}),(0,a.jsx)("a",{href:v(o,r),download:e,className:"text-muted-foreground hover:text-foreground shrink-0 cursor-pointer rounded p-1.5 transition-colors","aria-label":`Download ${e}`,children:(0,a.jsx)(l.default,{className:"h-4 w-4"})})]})]})]}):(0,a.jsxs)("div",{className:"group relative flex items-center gap-2 rounded-full border py-1 pr-3 pl-2",children:[(0,a.jsx)("div",{className:(0,s.cn)("flex h-6 w-6 shrink-0 items-center justify-center rounded-full",T),children:(0,a.jsx)(P,{className:"h-3 w-3"})}),(0,a.jsx)("span",{className:"max-w-[120px] truncate text-sm",children:e}),(0,a.jsx)("span",{className:"text-muted-foreground text-xs",children:g(t)}),!y&&(0,a.jsx)("button",{type:"button",onClick:j,className:"absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex","aria-label":`Remove ${e}`,children:(0,a.jsx)(i.X,{className:"h-3 w-3"})})]})}async function w(){let e=await fetch("/api/dialog/pick-files",{method:"POST"});if(!e.ok)throw Error("Failed to open file dialog");let t=await e.json();return t.cancelled?null:t.files}e.s(["AttachmentChip",()=>j],86254),e.s([],50032),e.s(["pickFiles",()=>w],42076)},90382,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(91967),s=e.i(5978),o=e.i(22528),i=e.i(53532),n=e.i(41687),l=e.i(56720),d=e.i(13123),c=e.i(52740),p=e.i(39979),u=e.i(85995),h=e.i(87620),m=e.i(86874),x=e.i(36589),f=e.i(73772),g=e.i(13044),b="Popover",[v,j]=(0,o.createContextScope)(b,[c.createPopperScope]),w=(0,c.createPopperScope)(),[y,C]=v(b),k=e=>{let{__scopePopover:a,children:s,open:o,defaultOpen:i,onOpenChange:n,modal:l=!1}=e,p=w(a),u=r.useRef(null),[h,m]=r.useState(!1),[f,g]=(0,x.useControllableState)({prop:o,defaultProp:i??!1,onChange:n,caller:b});return(0,t.jsx)(c.Root,{...p,children:(0,t.jsx)(y,{scope:a,contentId:(0,d.useId)(),triggerRef:u,open:f,onOpenChange:g,onOpenToggle:r.useCallback(()=>g(e=>!e),[g]),hasCustomAnchor:h,onCustomAnchorAdd:r.useCallback(()=>m(!0),[]),onCustomAnchorRemove:r.useCallback(()=>m(!1),[]),modal:l,children:s})})};k.displayName=b;var N="PopoverAnchor",P=r.forwardRef((e,a)=>{let{__scopePopover:s,...o}=e,i=C(N,s),n=w(s),{onCustomAnchorAdd:l,onCustomAnchorRemove:d}=i;return r.useEffect(()=>(l(),()=>d()),[l,d]),(0,t.jsx)(c.Anchor,{...n,...o,ref:a})});P.displayName=N;var T="PopoverTrigger",S=r.forwardRef((e,r)=>{let{__scopePopover:o,...i}=e,n=C(T,o),l=w(o),d=(0,s.useComposedRefs)(r,n.triggerRef),p=(0,t.jsx)(h.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":q(n.open),...i,ref:d,onClick:(0,a.composeEventHandlers)(e.onClick,n.onOpenToggle)});return n.hasCustomAnchor?p:(0,t.jsx)(c.Anchor,{asChild:!0,...l,children:p})});S.displayName=T;var R="PopoverPortal",[A,E]=v(R,{forceMount:void 0}),F=e=>{let{__scopePopover:r,forceMount:a,children:s,container:o}=e,i=C(R,r);return(0,t.jsx)(A,{scope:r,forceMount:a,children:(0,t.jsx)(u.Presence,{present:a||i.open,children:(0,t.jsx)(p.Portal,{asChild:!0,container:o,children:s})})})};F.displayName=R;var D="PopoverContent",O=r.forwardRef((e,r)=>{let a=E(D,e.__scopePopover),{forceMount:s=a.forceMount,...o}=e,i=C(D,e.__scopePopover);return(0,t.jsx)(u.Presence,{present:s||i.open,children:i.modal?(0,t.jsx)(z,{...o,ref:r}):(0,t.jsx)(L,{...o,ref:r})})});O.displayName=D;var I=(0,m.createSlot)("PopoverContent.RemoveScroll"),z=r.forwardRef((e,o)=>{let i=C(D,e.__scopePopover),n=r.useRef(null),l=(0,s.useComposedRefs)(o,n),d=r.useRef(!1);return r.useEffect(()=>{let e=n.current;if(e)return(0,f.hideOthers)(e)},[]),(0,t.jsx)(g.RemoveScroll,{as:I,allowPinchZoom:!0,children:(0,t.jsx)(M,{...e,ref:l,trapFocus:i.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,a.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),d.current||i.triggerRef.current?.focus()}),onPointerDownOutside:(0,a.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,a.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),L=r.forwardRef((e,a)=>{let s=C(D,e.__scopePopover),o=r.useRef(!1),i=r.useRef(!1);return(0,t.jsx)(M,{...e,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(o.current||s.triggerRef.current?.focus(),t.preventDefault()),o.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));let r=t.target;s.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})}),M=r.forwardRef((e,r)=>{let{__scopePopover:a,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:d,disableOutsidePointerEvents:p,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:m,onInteractOutside:x,...f}=e,g=C(D,a),b=w(a);return(0,n.useFocusGuards)(),(0,t.jsx)(l.FocusScope,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:o,onUnmountAutoFocus:d,children:(0,t.jsx)(i.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:p,onInteractOutside:x,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:m,onDismiss:()=>g.onOpenChange(!1),children:(0,t.jsx)(c.Content,{"data-state":q(g.open),role:"dialog",id:g.contentId,...b,...f,ref:r,style:{...f.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)"}})})})}),U="PopoverClose",B=r.forwardRef((e,r)=>{let{__scopePopover:s,...o}=e,i=C(U,s);return(0,t.jsx)(h.Primitive.button,{type:"button",...o,ref:r,onClick:(0,a.composeEventHandlers)(e.onClick,()=>i.onOpenChange(!1))})});B.displayName=U;var $=r.forwardRef((e,r)=>{let{__scopePopover:a,...s}=e,o=w(a);return(0,t.jsx)(c.Arrow,{...o,...s,ref:r})});function q(e){return e?"open":"closed"}$.displayName="PopoverArrow",e.s(["Anchor",()=>P,"Arrow",()=>$,"Close",()=>B,"Content",()=>O,"Popover",()=>k,"PopoverAnchor",()=>P,"PopoverArrow",()=>$,"PopoverClose",()=>B,"PopoverContent",()=>O,"PopoverPortal",()=>F,"PopoverTrigger",()=>S,"Portal",()=>F,"Root",()=>k,"Trigger",()=>S,"createPopoverScope",()=>j],89920);var H=e.i(89920),H=H,G=e.i(31777);let _=H.Root,K=H.Trigger;H.Anchor;let W=r.forwardRef(({className:e,align:r="center",sideOffset:a=4,...s},o)=>(0,t.jsx)(H.Portal,{children:(0,t.jsx)(H.Content,{ref:o,align:r,sideOffset:a,className:(0,G.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),...s})}));W.displayName=H.Content.displayName,e.s(["Popover",()=>_,"PopoverContent",()=>W,"PopoverTrigger",()=>K],90382)},51911,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(91967),s=e.i(5978),o=e.i(22528),i=e.i(36589),n=e.i(23405),l=e.i(77624),d=e.i(87620),c="Switch",[p,u]=(0,o.createContextScope)(c),[h,m]=p(c),x=r.forwardRef((e,o)=>{let{__scopeSwitch:n,name:l,checked:p,defaultChecked:u,required:m,disabled:x,value:f="on",onCheckedChange:g,form:j,...w}=e,[y,C]=r.useState(null),k=(0,s.useComposedRefs)(o,e=>C(e)),N=r.useRef(!1),P=!y||j||!!y.closest("form"),[T,S]=(0,i.useControllableState)({prop:p,defaultProp:u??!1,onChange:g,caller:c});return(0,t.jsxs)(h,{scope:n,checked:T,disabled:x,children:[(0,t.jsx)(d.Primitive.button,{type:"button",role:"switch","aria-checked":T,"aria-required":m,"data-state":v(T),"data-disabled":x?"":void 0,disabled:x,value:f,...w,ref:k,onClick:(0,a.composeEventHandlers)(e.onClick,e=>{S(e=>!e),P&&(N.current=e.isPropagationStopped(),N.current||e.stopPropagation())})}),P&&(0,t.jsx)(b,{control:y,bubbles:!N.current,name:l,value:f,checked:T,required:m,disabled:x,form:j,style:{transform:"translateX(-100%)"}})]})});x.displayName=c;var f="SwitchThumb",g=r.forwardRef((e,r)=>{let{__scopeSwitch:a,...s}=e,o=m(f,a);return(0,t.jsx)(d.Primitive.span,{"data-state":v(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:r})});g.displayName=f;var b=r.forwardRef(({__scopeSwitch:e,control:a,checked:o,bubbles:i=!0,...d},c)=>{let p=r.useRef(null),u=(0,s.useComposedRefs)(p,c),h=(0,n.usePrevious)(o),m=(0,l.useSize)(a);return r.useEffect(()=>{let e=p.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(h!==o&&t){let r=new Event("click",{bubbles:i});t.call(e,o),e.dispatchEvent(r)}},[h,o,i]),(0,t.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o,...d,tabIndex:-1,ref:u,style:{...d.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function v(e){return e?"checked":"unchecked"}b.displayName="SwitchBubbleInput",e.s(["Root",()=>x,"Switch",()=>x,"SwitchThumb",()=>g,"Thumb",()=>g,"createSwitchScope",()=>u],95291);var j=e.i(95291),j=j,w=e.i(31777);function y({className:e,size:r="default",...a}){return(0,t.jsx)(j.Root,{"data-slot":"switch","data-size":r,className:(0,w.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),...a,children:(0,t.jsx)(j.Thumb,{"data-slot":"switch-thumb",className:(0,w.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",()=>y],51911)},41413,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(23925),s=e.i(11345),o=e.i(76016),i=e.i(28111),n=e.i(34970),l=e.i(86782),d=e.i(29847),c=e.i(35364),p=e.i(90382),u=e.i(31777);function h({initialAgentType:e,initialModel:h,onAgentModelChange:m,disabled:x,className:f,mode:g}){let[b,v]=r.useState(!1),[j,w]=r.useState([]),[y,C]=r.useState(!0),[k,N]=r.useState(e),[P,T]=r.useState(h),[S,R]=r.useState(null),[A,E]=r.useState(0),[F,D]=r.useState(null);r.useEffect(()=>{(0,i.getAllAgentModels)().then(w).finally(()=>C(!1))},[]),r.useEffect(()=>{if(!b){let e=setTimeout(()=>{E(0),D(null)},150);return()=>clearTimeout(e)}},[b]);let O=async(e,t)=>{if(v(!1),e!==k||t!==P){if("override"===g){N(e),T(t),m?.(e,t);return}N(e),T(t),m?.(e,t),R(null);try{let r=await (0,n.updateAgentAndModel)(e,t||null);r.ok||(N(k),T(P),m?.(k,P),R(r.error??"Failed to save"))}catch{N(k),T(P),m?.(k,P),R("Failed to save")}}},I=(0,l.getAgentTypeIcon)(k),z=j.find(e=>e.agentType===k)?.label??k,L=P?(0,d.getModelMeta)(P).displayName||P:null,M=F?j.find(e=>e.agentType===F):null;return(0,t.jsxs)("div",{className:(0,u.cn)("flex flex-col gap-1",f),children:[(0,t.jsxs)(p.Popover,{open:b,onOpenChange:v,children:[(0,t.jsx)(p.PopoverTrigger,{asChild:!0,children:(0,t.jsx)(c.Button,{variant:"outline",role:"combobox","aria-expanded":b,disabled:(x??!1)||y,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)(I,{className:"h-4 w-4 shrink-0"}),y?"Loading…":(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:z}),L?(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:L})]}):null]})]})})}),(0,t.jsx)(p.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===A?"-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"}),j.map(e=>{let r=(0,l.getAgentTypeIcon)(e.agentType),s=k===e.agentType,i=e.models.length>0;return(0,t.jsxs)("button",{type:"button",className:(0,u.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:()=>{i?(D(e.agentType),requestAnimationFrame(()=>{requestAnimationFrame(()=>E(1))})):O(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&&!i?(0,t.jsx)(a.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null,i?(0,t.jsx)(o.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:M?(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:()=>{E(0),setTimeout(()=>D(null),220)},children:[(0,t.jsx)(s.ChevronLeft,{className:"h-3.5 w-3.5"}),M.label]}),M.models.map(e=>{let r=k===M.agentType&&P===e.id;return(0,t.jsxs)("button",{type:"button",className:(0,u.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:()=>O(M.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)(a.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null]},e.id)})]}):null})]})})]}),!!S&&(0,t.jsx)("p",{className:"text-destructive text-sm",children:S})]})}e.s(["AgentModelPicker",()=>h])},15203,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(31406),s=e.i(60112),o=e.i(21023);let i=(0,o.createServerReference)("4075a082db11244f324640576b2dbf0f92c9cef9a5",o.callServer,void 0,o.findSourceMapURL,"createFeature");var n=e.i(16868);let l=(0,e.i(3645).default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);var d=e.i(97667),c=e.i(53360),p=e.i(55016),u=e.i(91925),h=e.i(83428),m=e.i(31777),x=e.i(8361);e.i(1650);var f=e.i(11495),g=e.i(45811),b=e.i(35364),v=e.i(98127),j=e.i(48306),w=e.i(41957),y=e.i(81846),C=e.i(90382),k=e.i(51911),N=e.i(2828),P=e.i(30153);e.i(50032);var T=e.i(86254),S=e.i(41413),R=e.i(25235),A=e.i(78521),E=e.i(49370),F=e.i(42076);let D=new Set([".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp",".ico",".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".txt",".md",".csv",".json",".yaml",".yml",".xml",".ts",".tsx",".js",".jsx",".py",".rb",".go",".rs",".java",".c",".cpp",".h",".hpp",".cs",".swift",".kt",".html",".css",".scss",".less",".sh",".bash",".zsh",".fish",".toml",".ini",".cfg",".conf",".env",".zip",".tar",".gz",".log"]),O=[{id:"allowPrd",label:"PRD",description:"Auto-approve requirements move to planning."},{id:"allowPlan",label:"Plan",description:"Auto-approve planning move to implementation."},{id:"allowMerge",label:"Merge",description:"Auto-approve merge move to Done."}],I={allowPrd:!1,allowPlan:!1,allowMerge:!1};function z({open:e,onClose:a,onSubmit:s,repositoryPath:o,isSubmitting:i=!1,workflowDefaults:l,features:d,repositories:u,initialParentId:h,currentAgentType:v,currentModel:C,initialDescription:R}){let A=(0,x.useSoundAction)("create"),E=o&&(!u||0===u.length||u.some(e=>e.path===o))?o:"",z=l?.approvalGates??I,U=l?.push??!1,B=l?.openPr??!1,$=l?.ciWatchEnabled!==!1,q=l?.enableEvidence??!1,H=l?.commitEvidence??!1,[G,_]=(0,r.useState)(R??"");(0,r.useEffect)(()=>{R&&_(R)},[R]);let[K,W]=(0,r.useState)([]),[V,X]=(0,r.useState)({...z}),[Y,Z]=(0,r.useState)(U),[J,Q]=(0,r.useState)(B),[ee,et]=(0,r.useState)(l?.ciWatchEnabled!==!1),[er,ea]=(0,r.useState)(q),[es,eo]=(0,r.useState)(H),[ei,en]=(0,r.useState)(void 0),[el,ed]=(0,r.useState)(!1),[ec,ep]=(0,r.useState)(!1),[eu,eh]=(0,r.useState)(void 0),[em,ex]=(0,r.useState)(void 0),[ef,eg]=(0,r.useState)(E||void 0),[eb,ev]=(0,r.useState)(u??[]),[ej,ew]=(0,r.useState)(!1),[ey,eC]=(0,r.useState)(null),[ek,eN]=(0,r.useState)(!1),eP=(0,r.useRef)(crypto.randomUUID()),eT=(0,r.useRef)(0),eS=(0,r.useRef)(null);(0,r.useEffect)(()=>{l&&(X({...l.approvalGates}),Z(l.push),Q(l.openPr),et(!1!==l.ciWatchEnabled),ea(l.enableEvidence),eo(l.commitEvidence))},[l]),(0,r.useEffect)(()=>{ev(u??[])},[u]),(0,r.useEffect)(()=>{e&&h&&en(h)},[e,h]);let eR=(0,r.useCallback)(()=>{_(""),W([]),X({...z}),Z(U),Q(B),et($),ea(q),eo(H),en(void 0),eg(E||void 0),ev(u??[]),ed(!1),ep(!1),eh(void 0),ex(void 0),eC(null),eT.current=0,ew(!1)},[z,U,B,q,$,H,E,u]),eA=""!==G.trim()||K.length>0,{attemptClose:eE}=(0,P.useGuardedDrawerClose)({open:e,isDirty:eA,onClose:a,onReset:eR}),eF=(0,r.useCallback)(async e=>{for(let t of(eC(null),e)){if(t.size>0xa00000)return void eC(`"${t.name}" exceeds 10 MB limit`);let e=function(e){let t=e.lastIndexOf(".");return t>=0?e.slice(t).toLowerCase():""}(t.name);if(e&&!D.has(e))return void eC(`File type "${e}" is not allowed`)}for(let t of e){let e=crypto.randomUUID();W(r=>[...r,{id:e,name:t.name,size:t.size,mimeType:t.type||"application/octet-stream",path:"",loading:!0}]);try{let r=new FormData;r.append("file",t),r.append("sessionId",eP.current);let a=await fetch("/api/attachments/upload",{method:"POST",body:r});if(!a.ok){let t=await a.json().catch(()=>({error:"Upload failed"}));W(t=>t.filter(t=>t.id!==e)),eC(t.error??"Upload failed");return}let s=await a.json();W(t=>t.some(t=>t.id!==e&&t.path===s.path)?t.filter(t=>t.id!==e):t.map(t=>t.id===e?{...s,id:e,loading:!1}:t))}catch{W(t=>t.filter(t=>t.id!==e)),eC("Upload failed")}}},[]),eD=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eT.current+=1,1===eT.current&&ew(!0)},[]),eO=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eT.current-=1,0===eT.current&&ew(!1)},[]),eI=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),ez=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eT.current=0,ew(!1);let t=Array.from(e.dataTransfer.files);t.length>0&&eF(t)},[eF]),eL=(0,r.useCallback)(e=>{let t=e.clipboardData?.items;if(!t)return;let r=[];for(let e of Array.from(t))if("file"===e.kind){let t=e.getAsFile();t&&r.push(t)}r.length>0&&(e.preventDefault(),eF(r))},[eF]),eM=(0,r.useCallback)(e=>{if(e.preventDefault(),!G.trim())return;let t=ef??E;t&&(A.play(),s({description:G.trim(),attachments:K.filter(e=>!e.loading),repositoryPath:t,approvalGates:{allowPrd:V.allowPrd??!1,allowPlan:V.allowPlan??!1,allowMerge:V.allowMerge??!1},push:Y||J,openPr:J,ciWatchEnabled:ee,enableEvidence:er,commitEvidence:es,fast:el,...ec?{pending:ec}:{},...eu?{agentType:eu}:{},...em?{model:em}:{},...ei?{parentId:ei}:{},sessionId:eP.current}),eR())},[G,K,V,ef,E,s,Y,J,er,ee,es,el,ec,eu,em,ei,A,eR]),eU=(0,r.useCallback)(async()=>{try{let e=await (0,F.pickFiles)();if(!e)return;for(let t of e){let e=crypto.randomUUID();W(r=>[...r,{id:e,name:t.name,size:t.size,mimeType:"application/octet-stream",path:"",loading:!0}]);try{let r=await fetch("/api/attachments/upload-from-path",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t.path,sessionId:eP.current})});if(!r.ok){let t=await r.json().catch(()=>({error:"Upload failed"}));W(t=>t.filter(t=>t.id!==e)),eC(t.error??"Upload failed");return}let a=await r.json();W(t=>t.some(t=>t.id!==e&&t.path===a.path)?t.filter(t=>t.id!==e):t.map(t=>t.id===e?{...a,id:e,loading:!1}:t))}catch{W(t=>t.filter(t=>t.id!==e)),eC("Upload failed")}}}catch{}},[]),eB=(0,r.useCallback)(e=>{W(t=>t.filter(t=>t.id!==e))},[]),e$=(0,r.useRef)(null),eq=(0,r.useCallback)(e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),e$.current?.requestSubmit())},[]),eH=(0,r.useCallback)(()=>{eN(!0)},[]),eG=(0,r.useCallback)(()=>{setTimeout(()=>{let e=eS.current?.contains(document.activeElement),t=eS.current?.querySelector('[aria-expanded="true"]')!==null;e||t||eN(!1)},0)},[]),e_=d&&d.length>0,eK=!E&&!ef,eW=!E&&void 0!==u;return(0,t.jsx)(f.BaseDrawer,{open:e,onClose:eE,size:"md",modal:!1,dismissOnOutsideClick:!0,"data-testid":"feature-create-drawer",header:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"h-2.5 w-2.5 shrink-0 rounded-full bg-blue-500"}),(0,t.jsx)(g.DrawerTitle,{children:"NEW FEATURE"})]}),i?(0,t.jsx)(g.DrawerDescription,{asChild:!0,children:(0,t.jsx)("div",{children:(0,t.jsx)(y.Badge,{variant:"secondary",children:"Creating..."})})}):null]}),footer:(0,t.jsxs)("div",{className:"flex flex-row justify-end gap-2",children:[(0,t.jsx)(b.Button,{variant:"outline",onClick:eE,disabled:i,children:"Cancel"}),(0,t.jsx)(b.Button,{type:"submit",form:"create-feature-form",disabled:!G.trim()||i||eK,children:i?"Creating...":"+ Create Feature"})]}),children:(0,t.jsx)("div",{className:"overflow-y-auto p-4",children:(0,t.jsx)(N.TooltipProvider,{delayDuration:400,children:(0,t.jsxs)("form",{ref:e$,id:"create-feature-form",onSubmit:eM,onKeyDown:eq,className:"flex flex-col gap-4",children:[eW?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-selector-section",children:[(0,t.jsx)(w.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"REPOSITORY"}),(0,t.jsx)(M,{repositories:eb,value:ef,onChange:eg,onAddRepository:e=>{ev(t=>[...t,e]),eg(e.path)},disabled:i})]}):E?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-readonly-section",children:[(0,t.jsx)(w.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"REPOSITORY"}),(0,t.jsx)("p",{className:"text-sm","data-testid":"repo-readonly-label",children:u?.find(e=>e.path===E)?.name??E.split("/").pop()})]}):null,(0,t.jsxs)("div",{role:"region","aria-label":"File drop zone","data-drag-over":ej?"true":"false",onDragEnter:eD,onDragLeave:eO,onDragOver:eI,onDrop:ez,className:(0,m.cn)("flex flex-col gap-1.5 rounded-md border-2 border-transparent p-1 transition-colors",ej&&"border-primary/50 bg-primary/5"),children:[(0,t.jsx)(w.Label,{htmlFor:"feature-description",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"DESCRIBE YOUR FEATURE"}),(0,t.jsxs)("div",{ref:eS,onFocus:eH,onBlur:eG,className:(0,m.cn)("border-input flex h-56 flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow]",ek&&"ring-ring/50 border-ring ring-[3px]"),children:[(0,t.jsx)(j.Textarea,{id:"feature-description",placeholder:"e.g. Add GitHub OAuth login with callback handling and token refresh...",value:G,onChange:e=>_(e.target.value),onPaste:eL,required:!0,disabled:i,className:"min-h-0 flex-1 resize-none rounded-none border-0 shadow-none focus-visible:ring-0"}),K.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:K.map(e=>(0,t.jsx)(T.AttachmentChip,{name:e.name,size:e.size,mimeType:e.mimeType,path:e.path,onRemove:()=>eB(e.id),disabled:i,loading:e.loading},e.id))}),ey?(0,t.jsx)("p",{className:"text-destructive px-3 pb-2 text-xs",children:ey}):null,(0,t.jsxs)("div",{className:"border-input flex items-center gap-3 border-t px-3 py-1.5",children:[(0,t.jsx)(S.AgentModelPicker,{initialAgentType:eu??v??"claude-code",initialModel:em??C??"claude-sonnet-4-6",mode:"override",onAgentModelChange:(e,t)=>{eh(e),ex(t)},disabled:i,className:"w-55"}),(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"ml-auto flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(k.Switch,{id:"pending-mode",checked:ec,onCheckedChange:ep,disabled:i}),(0,t.jsxs)(w.Label,{htmlFor:"pending-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,t.jsx)(p.Clock,{className:"h-3.5 w-3.5"}),"Pending"]})]})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:"Create without starting — start manually later."})]}),(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(k.Switch,{id:"fast-mode",checked:el,onCheckedChange:ed,disabled:i}),(0,t.jsxs)(w.Label,{htmlFor:"fast-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,t.jsx)(c.Zap,{className:"h-3.5 w-3.5"}),"Fast Mode"]})]})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:"Skip SDLC phases and implement directly from your prompt."})]}),(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:eU,disabled:i,"aria-label":"Attach files",className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,t.jsx)(n.PaperclipIcon,{className:"h-4 w-4"})})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:"Attach files"})]})]})]})]}),e_&&void 0!==h?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(w.Label,{htmlFor:"parent-feature",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"PARENT FEATURE"}),(0,t.jsx)(L,{features:d,value:ei,onChange:en,disabled:i})]}):null,(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:"APPROVE"})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:"Auto-approve phase transitions without manual review."})]}),(0,t.jsx)("div",{className:"flex flex-1 items-center gap-4",children:O.map(e=>(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(k.Switch,{id:`approve-${e.id}`,size:"sm",checked:V[e.id]??!1,onCheckedChange:t=>X(r=>({...r,[e.id]:t})),disabled:i||el&&("allowPrd"===e.id||"allowPlan"===e.id)}),(0,t.jsx)(w.Label,{htmlFor:`approve-${e.id}`,className:"cursor-pointer text-xs font-medium",children:e.label})]})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:el&&("allowPrd"===e.id||"allowPlan"===e.id)?"Skipped in Fast Mode":e.description})]},e.id))}),(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:()=>{let e=O.every(e=>V[e.id]),t={};for(let r of O)t[r.id]=!e;X(t)},disabled:i,className:(0,m.cn)("text-muted-foreground hover:text-foreground cursor-pointer rounded px-1.5 py-0.5 text-[10px] font-semibold tracking-wider uppercase transition-colors",O.every(e=>V[e.id])&&"text-primary"),children:"All"})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:"Toggle all approval gates"})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:"EVIDENCE"})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:"Collect and attach evidence after implementation."})]}),(0,t.jsxs)("div",{className:"flex flex-1 items-center gap-4",children:[(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(k.Switch,{id:"enable-evidence",size:"sm",checked:er,onCheckedChange:e=>{ea(e),e||eo(!1)},disabled:i}),(0,t.jsx)(w.Label,{htmlFor:"enable-evidence",className:"cursor-pointer text-xs font-medium",children:"Collect"})]})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:"Capture screenshots and artifacts after implementation."})]}),(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(k.Switch,{id:"commit-evidence",size:"sm",checked:es,onCheckedChange:eo,disabled:i||!er||!J}),(0,t.jsx)(w.Label,{htmlFor:"commit-evidence",className:(0,m.cn)("cursor-pointer text-xs font-medium",(!er||!J)&&"opacity-50"),children:"Add to PR"})]})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:J?er?"Include evidence in the pull request body.":"Requires evidence collection to be enabled":"Requires PR to be enabled"})]})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 text-xs font-semibold tracking-wider",children:"GIT"}),(0,t.jsxs)("div",{className:"flex flex-1 items-center gap-4",children:[(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(k.Switch,{id:"push",size:"sm",checked:Y||J,onCheckedChange:e=>{Z(e),!e&&J&&Q(!1)},disabled:i}),(0,t.jsx)(w.Label,{htmlFor:"push",className:"cursor-pointer text-xs font-medium",children:"Push"})]})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:"Push branch to remote after implementation."})]}),(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(k.Switch,{id:"open-pr",size:"sm",checked:J,onCheckedChange:e=>{Q(e),e||eo(!1)},disabled:i}),(0,t.jsx)(w.Label,{htmlFor:"open-pr",className:"cursor-pointer text-xs font-medium",children:"PR"})]})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:"Open a pull request after pushing."})]}),(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(k.Switch,{id:"ci-watch",size:"sm",checked:ee,onCheckedChange:et,disabled:i}),(0,t.jsx)(w.Label,{htmlFor:"ci-watch",className:"cursor-pointer text-xs font-medium",children:"Watch"})]})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:"Watch CI and auto-fix after push."})]})]})]})]})]})})})})}function L({features:e,value:a,onChange:s,disabled:o}){let[i,n]=(0,r.useState)(!1),[c,p]=(0,r.useState)(""),u=(0,r.useRef)(null),h=e.find(e=>e.id===a),x=c.trim()?e.filter(e=>e.name.toLowerCase().includes(c.toLowerCase())||e.id.toLowerCase().includes(c.toLowerCase())):e,f=(0,r.useCallback)(e=>{s(e),n(!1),p("")},[s]);return(0,r.useEffect)(()=>{i?setTimeout(()=>u.current?.focus(),0):p("")},[i]),(0,t.jsxs)(C.Popover,{open:i,onOpenChange:n,children:[(0,t.jsx)(C.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{id:"parent-feature",type:"button",role:"combobox","aria-expanded":i,"aria-label":"Parent Feature",disabled:o,"data-testid":"parent-feature-combobox",className:(0,m.cn)("border-input bg-background ring-offset-background focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",!h&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:h?`${h.name} (${h.id.slice(0,8)})`:"Select parent feature..."}),(0,t.jsx)(l,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(C.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"parent-feature-combobox-content",children:(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("div",{className:"border-b p-2",children:(0,t.jsx)(v.Input,{ref:u,placeholder:"Search features...",value:c,onChange:e=>p(e.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"parent-feature-search"})}),(0,t.jsxs)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Features",children:[(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":void 0===a,onClick:()=>f(void 0),className:(0,m.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",void 0===a&&"bg-accent/50"),"data-testid":"parent-feature-option-none",children:[(0,t.jsx)(d.CheckIcon,{className:(0,m.cn)("h-4 w-4 shrink-0",void 0!==a&&"invisible")}),(0,t.jsx)("span",{className:"text-muted-foreground italic",children:"No parent"})]}),0===x.length&&c?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:"No features found."}):x.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":a===e.id,onClick:()=>f(e.id),className:(0,m.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",a===e.id&&"bg-accent/50"),"data-testid":`parent-feature-option-${e.id}`,children:[(0,t.jsx)(d.CheckIcon,{className:(0,m.cn)("h-4 w-4 shrink-0",a!==e.id&&"invisible")}),(0,t.jsxs)("span",{className:"truncate",children:[e.name," ",(0,t.jsxs)("span",{className:"text-muted-foreground font-mono text-xs",children:["(",e.id.slice(0,8),")"]})]})]},e.id))]})]})})]})}function M({repositories:e,value:a,onChange:s,onAddRepository:o,disabled:i}){let[n,c]=(0,r.useState)(!1),[p,x]=(0,r.useState)(""),[f,g]=(0,r.useState)(!1),[b,j]=(0,r.useState)(null),w=(0,r.useRef)(null),y=e.find(e=>e.path===a),k=p.trim()?e.filter(e=>e.name.toLowerCase().includes(p.toLowerCase())||e.path.toLowerCase().includes(p.toLowerCase())):e,N=(0,r.useCallback)(e=>{s(e),c(!1),x("")},[s]),P=(0,r.useCallback)(async()=>{if(!f){g(!0),j(null);try{let e=await (0,A.pickFolder)();if(!e)return void g(!1);let t=await (0,E.addRepository)({path:e});if(t.error){j(t.error),g(!1);return}if(t.repository){let e={id:t.repository.id,name:t.repository.name,path:t.repository.path};o?.(e),s(e.path),c(!1),x("")}}catch(e){j(e instanceof Error?e.message:"Failed to add repository")}finally{g(!1)}}},[f,o,s]);return(0,r.useEffect)(()=>{n?setTimeout(()=>w.current?.focus(),0):x("")},[n]),(0,t.jsxs)(C.Popover,{open:n,onOpenChange:c,children:[(0,t.jsx)(C.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"button",role:"combobox","aria-expanded":n,"aria-label":"Repository",disabled:i,"data-testid":"repository-combobox",className:(0,m.cn)("border-input bg-background ring-offset-background focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",!y&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:y?y.name:"Select repository..."}),(0,t.jsx)(l,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(C.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"repository-combobox-content",children:(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("div",{className:"border-b p-2",children:(0,t.jsx)(v.Input,{ref:w,placeholder:"Search repositories...",value:p,onChange:e=>x(e.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"repository-search"})}),(0,t.jsx)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Repositories",children:0===k.length?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm","data-testid":"repository-empty",children:"No repositories found."}):k.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":a===e.path,onClick:()=>N(e.path),className:(0,m.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",a===e.path&&"bg-accent/50"),"data-testid":`repository-option-${e.id}`,children:[(0,t.jsx)(d.CheckIcon,{className:(0,m.cn)("h-4 w-4 shrink-0",a!==e.path&&"invisible")}),(0,t.jsxs)("span",{className:"flex flex-col items-start truncate",children:[(0,t.jsx)("span",{className:"truncate",children:e.name}),(0,t.jsx)("span",{className:"text-muted-foreground truncate text-xs",children:e.path})]})]},e.id))}),(0,t.jsx)(R.Separator,{}),(0,t.jsxs)("button",{type:"button",onClick:P,disabled:f,className:"hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm","data-testid":"add-repository-item",children:[f?(0,t.jsx)(h.Loader2,{className:"h-4 w-4 shrink-0 animate-spin"}):(0,t.jsx)(u.FolderPlus,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:"Add new repository..."})]}),b?(0,t.jsx)("p",{className:"px-3 pb-2 text-xs text-red-500","data-testid":"add-repository-error",children:b}):null]})})]})}function U({repositoryPath:e,initialParentId:o,initialDescription:n,features:l,repositories:d,workflowDefaults:c,currentAgentType:p,currentModel:u}){let h=(0,a.useRouter)(),[m,x]=(0,r.useState)(!1),f=(0,a.usePathname)().startsWith("/create"),g=!m&&f;(0,r.useEffect)(()=>{!f&&m&&x(!1)},[f,m]);let b=(0,r.useCallback)(()=>{h.push("/")},[h]),v=(0,r.useCallback)(e=>{x(!0),h.push("/"),i(e).then(t=>{t.error?s.toast.error(t.error):window.dispatchEvent(new CustomEvent("shep:feature-created",{detail:{featureId:t.feature.id,name:t.feature.name,description:t.feature.description,repositoryPath:t.feature.repositoryPath,parentId:e.parentId}}))}).catch(()=>{s.toast.error("Failed to create feature"),x(!1)})},[h]);return(0,t.jsx)(z,{open:g,onClose:b,onSubmit:v,repositoryPath:e,features:l,repositories:d,workflowDefaults:c,initialParentId:o,initialDescription:n,isSubmitting:m,currentAgentType:p,currentModel:u})}e.s(["CreateDrawerClient",()=>U],15203)}]);
@@ -0,0 +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(87889),a=e.i(3645);let i=(0,a.default)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);var o=e.i(23925);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 s=e.i(38573),d=e.i(49228);let c=(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"}]]),u=(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"}]]),p=(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"}]]),h=(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 m=e.i(10714),m=m,f=e.i(3214),g=e.i(30702);let x=(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 v=e.i(58860),w=e.i(60112),b=e.i(31777),y=e.i(41957),j=e.i(98127),S=e.i(35364),C=e.i(51911),k=e.i(2828),M=e.i(26036),I=e.i(27069),N=e.i(91967),P=e.i(87342),E=e.i(5978),R=e.i(22528),T=e.i(66033),A=e.i(53532),D=e.i(41687),L=e.i(56720),F=e.i(13123),H=e.i(52740),z=e.i(39979),B=e.i(87620),_=e.i(86874),V=e.i(29297),W=e.i(36589),O=e.i(5192),U=e.i(23405),K=e.i(1693),q=e.i(73772),G=e.i(13044),$=[" ","Enter","ArrowUp","ArrowDown"],Y=[" ","Enter"],Z="Select",[X,Q,J]=(0,P.createCollection)(Z),[ee,et]=(0,R.createContextScope)(Z,[J,H.createPopperScope]),en=(0,H.createPopperScope)(),[er,ea]=ee(Z),[ei,eo]=ee(Z),el=e=>{let{__scopeSelect:r,children:a,open:i,defaultOpen:o,onOpenChange:l,value:s,defaultValue:d,onValueChange:c,dir:u,name:p,autoComplete:h,disabled:m,required:f,form:g}=e,x=en(r),[v,w]=n.useState(null),[b,y]=n.useState(null),[j,S]=n.useState(!1),C=(0,T.useDirection)(u),[k,M]=(0,W.useControllableState)({prop:i,defaultProp:o??!1,onChange:l,caller:Z}),[I,N]=(0,W.useControllableState)({prop:s,defaultProp:d,onChange:c,caller:Z}),P=n.useRef(null),E=!v||g||!!v.closest("form"),[R,A]=n.useState(new Set),D=Array.from(R).map(e=>e.props.value).join(";");return(0,t.jsx)(H.Root,{...x,children:(0,t.jsxs)(er,{required:f,scope:r,trigger:v,onTriggerChange:w,valueNode:b,onValueNodeChange:y,valueNodeHasChildren:j,onValueNodeHasChildrenChange:S,contentId:(0,F.useId)(),value:I,onValueChange:N,open:k,onOpenChange:M,dir:C,triggerPointerDownPosRef:P,disabled:m,children:[(0,t.jsx)(X.Provider,{scope:r,children:(0,t.jsx)(ei,{scope:e.__scopeSelect,onNativeOptionAdd:n.useCallback(e=>{A(t=>new Set(t).add(e))},[]),onNativeOptionRemove:n.useCallback(e=>{A(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:a})}),E?(0,t.jsxs)(e$,{"aria-hidden":!0,required:f,tabIndex:-1,name:p,autoComplete:h,value:I,onChange:e=>N(e.target.value),disabled:m,form:g,children:[void 0===I?(0,t.jsx)("option",{value:""}):null,Array.from(R)]},D):null]})})};el.displayName=Z;var es="SelectTrigger",ed=n.forwardRef((e,r)=>{let{__scopeSelect:a,disabled:i=!1,...o}=e,l=en(a),s=ea(es,a),d=s.disabled||i,c=(0,E.useComposedRefs)(r,s.onTriggerChange),u=Q(a),p=n.useRef("touch"),[h,m,f]=eZ(e=>{let t=u().filter(e=>!e.disabled),n=t.find(e=>e.value===s.value),r=eX(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)(H.Anchor,{asChild:!0,...l,children:(0,t.jsx)(B.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":eY(s.value)?"":void 0,...o,ref:c,onClick:(0,N.composeEventHandlers)(o.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&g(e)}),onPointerDown:(0,N.composeEventHandlers)(o.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,N.composeEventHandlers)(o.onKeyDown,e=>{let t=""!==h.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||m(e.key),(!t||" "!==e.key)&&$.includes(e.key)&&(g(),e.preventDefault())})})})});ed.displayName=es;var ec="SelectValue",eu=n.forwardRef((e,n)=>{let{__scopeSelect:r,className:a,style:i,children:o,placeholder:l="",...s}=e,d=ea(ec,r),{onValueNodeHasChildrenChange:c}=d,u=void 0!==o,p=(0,E.useComposedRefs)(n,d.onValueNodeChange);return(0,O.useLayoutEffect)(()=>{c(u)},[c,u]),(0,t.jsx)(B.Primitive.span,{...s,ref:p,style:{pointerEvents:"none"},children:eY(d.value)?(0,t.jsx)(t.Fragment,{children:l}):o})});eu.displayName=ec;var ep=n.forwardRef((e,n)=>{let{__scopeSelect:r,children:a,...i}=e;return(0,t.jsx)(B.Primitive.span,{"aria-hidden":!0,...i,ref:n,children:a||"▼"})});ep.displayName="SelectIcon";var eh=e=>(0,t.jsx)(z.Portal,{asChild:!0,...e});eh.displayName="SelectPortal";var em="SelectContent",ef=n.forwardRef((e,r)=>{let a=ea(em,e.__scopeSelect),[i,o]=n.useState();return((0,O.useLayoutEffect)(()=>{o(new DocumentFragment)},[]),a.open)?(0,t.jsx)(ew,{...e,ref:r}):i?M.createPortal((0,t.jsx)(eg,{scope:e.__scopeSelect,children:(0,t.jsx)(X.Slot,{scope:e.__scopeSelect,children:(0,t.jsx)("div",{children:e.children})})}),i):null});ef.displayName=em;var[eg,ex]=ee(em),ev=(0,_.createSlot)("SelectContent.RemoveScroll"),ew=n.forwardRef((e,r)=>{let{__scopeSelect:a,position:i="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:l,onPointerDownOutside:s,side:d,sideOffset:c,align:u,alignOffset:p,arrowPadding:h,collisionBoundary:m,collisionPadding:f,sticky:g,hideWhenDetached:x,avoidCollisions:v,...w}=e,b=ea(em,a),[y,j]=n.useState(null),[S,C]=n.useState(null),k=(0,E.useComposedRefs)(r,e=>j(e)),[M,I]=n.useState(null),[P,R]=n.useState(null),T=Q(a),[F,H]=n.useState(!1),z=n.useRef(!1);n.useEffect(()=>{if(y)return(0,q.hideOthers)(y)},[y]),(0,D.useFocusGuards)();let B=n.useCallback(e=>{let[t,...n]=T().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&&S&&(S.scrollTop=0),n===r&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==a))return},[T,S]),_=n.useCallback(()=>B([M,y]),[B,M,y]);n.useEffect(()=>{F&&_()},[F,_]);let{onOpenChange:V,triggerPointerDownPosRef:W}=b;n.useEffect(()=>{if(y){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(W.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(W.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():y.contains(n.target)||V(!1),document.removeEventListener("pointermove",t),W.current=null};return null!==W.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[y,V,W]),n.useEffect(()=>{let e=()=>V(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[V]);let[O,U]=eZ(e=>{let t=T().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),r=eX(t,e,n);r&&setTimeout(()=>r.ref.current.focus())}),K=n.useCallback((e,t,n)=>{let r=!z.current&&!n;(void 0!==b.value&&b.value===t||r)&&(I(e),r&&(z.current=!0))},[b.value]),$=n.useCallback(()=>y?.focus(),[y]),Y=n.useCallback((e,t,n)=>{let r=!z.current&&!n;(void 0!==b.value&&b.value===t||r)&&R(e)},[b.value]),Z="popper"===i?ey:eb,X=Z===ey?{side:d,sideOffset:c,align:u,alignOffset:p,arrowPadding:h,collisionBoundary:m,collisionPadding:f,sticky:g,hideWhenDetached:x,avoidCollisions:v}:{};return(0,t.jsx)(eg,{scope:a,content:y,viewport:S,onViewportChange:C,itemRefCallback:K,selectedItem:M,onItemLeave:$,itemTextRefCallback:Y,focusSelectedItem:_,selectedItemText:P,position:i,isPositioned:F,searchRef:O,children:(0,t.jsx)(G.RemoveScroll,{as:ev,allowPinchZoom:!0,children:(0,t.jsx)(L.FocusScope,{asChild:!0,trapped:b.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:(0,N.composeEventHandlers)(o,e=>{b.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,t.jsx)(A.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:(0,t.jsx)(Z,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:e=>e.preventDefault(),...w,...X,onPlaced:()=>H(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:(0,N.composeEventHandlers)(w.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||U(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=T().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(()=>B(t)),e.preventDefault()}})})})})})})});ew.displayName="SelectContentImpl";var eb=n.forwardRef((e,r)=>{let{__scopeSelect:a,onPlaced:i,...o}=e,l=ea(em,a),s=ex(em,a),[d,c]=n.useState(null),[u,p]=n.useState(null),h=(0,E.useComposedRefs)(r,e=>p(e)),m=Q(a),f=n.useRef(!1),g=n.useRef(!0),{viewport:x,selectedItem:v,selectedItemText:w,focusSelectedItem:b}=s,y=n.useCallback(()=>{if(l.trigger&&l.valueNode&&d&&u&&x&&v&&w){let e=l.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=l.valueNode.getBoundingClientRect(),r=w.getBoundingClientRect();if("rtl"!==l.dir){let a=r.left-t.left,i=n.left-a,o=e.left-i,l=e.width+o,s=Math.max(l,t.width),c=window.innerWidth-10,u=(0,I.clamp)(i,[10,Math.max(10,c-s)]);d.style.minWidth=l+"px",d.style.left=u+"px"}else{let a=t.right-r.right,i=window.innerWidth-n.right-a,o=window.innerWidth-e.right-i,l=e.width+o,s=Math.max(l,t.width),c=window.innerWidth-10,u=(0,I.clamp)(i,[10,Math.max(10,c-s)]);d.style.minWidth=l+"px",d.style.right=u+"px"}let a=m(),o=window.innerHeight-20,s=x.scrollHeight,c=window.getComputedStyle(u),p=parseInt(c.borderTopWidth,10),h=parseInt(c.paddingTop,10),g=parseInt(c.borderBottomWidth,10),b=p+h+s+parseInt(c.paddingBottom,10)+g,y=Math.min(5*v.offsetHeight,b),j=window.getComputedStyle(x),S=parseInt(j.paddingTop,10),C=parseInt(j.paddingBottom,10),k=e.top+e.height/2-10,M=v.offsetHeight/2,N=p+h+(v.offsetTop+M);if(N<=k){let e=a.length>0&&v===a[a.length-1].ref.current;d.style.bottom="0px";let t=Math.max(o-k,M+(e?C: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(k,p+x.offsetTop+(e?S:0)+M);d.style.height=t+(b-N)+"px",x.scrollTop=N-k+x.offsetTop}d.style.margin="10px 0",d.style.minHeight=y+"px",d.style.maxHeight=o+"px",i?.(),requestAnimationFrame(()=>f.current=!0)}},[m,l.trigger,l.valueNode,d,u,x,v,w,l.dir,i]);(0,O.useLayoutEffect)(()=>y(),[y]);let[j,S]=n.useState();(0,O.useLayoutEffect)(()=>{u&&S(window.getComputedStyle(u).zIndex)},[u]);let C=n.useCallback(e=>{e&&!0===g.current&&(y(),b?.(),g.current=!1)},[y,b]);return(0,t.jsx)(ej,{scope:a,contentWrapper:d,shouldExpandOnScrollRef:f,onScrollButtonChange:C,children:(0,t.jsx)("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:(0,t.jsx)(B.Primitive.div,{...o,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});eb.displayName="SelectItemAlignedPosition";var ey=n.forwardRef((e,n)=>{let{__scopeSelect:r,align:a="start",collisionPadding:i=10,...o}=e,l=en(r);return(0,t.jsx)(H.Content,{...l,...o,ref:n,align:a,collisionPadding:i,style:{boxSizing:"border-box",...o.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)"}})});ey.displayName="SelectPopperPosition";var[ej,eS]=ee(em,{}),eC="SelectViewport",ek=n.forwardRef((e,r)=>{let{__scopeSelect:a,nonce:i,...o}=e,l=ex(eC,a),s=eS(eC,a),d=(0,E.useComposedRefs)(r,l.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:i}),(0,t.jsx)(X.Slot,{scope:a,children:(0,t.jsx)(B.Primitive.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:(0,N.composeEventHandlers)(o.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 i=a+e,o=Math.min(r,i),l=i-o;n.style.height=o+"px","0px"===n.style.bottom&&(t.scrollTop=l>0?l:0,n.style.justifyContent="flex-end")}}}c.current=t.scrollTop})})})]})});ek.displayName=eC;var eM="SelectGroup",[eI,eN]=ee(eM),eP=n.forwardRef((e,n)=>{let{__scopeSelect:r,...a}=e,i=(0,F.useId)();return(0,t.jsx)(eI,{scope:r,id:i,children:(0,t.jsx)(B.Primitive.div,{role:"group","aria-labelledby":i,...a,ref:n})})});eP.displayName=eM;var eE="SelectLabel",eR=n.forwardRef((e,n)=>{let{__scopeSelect:r,...a}=e,i=eN(eE,r);return(0,t.jsx)(B.Primitive.div,{id:i.id,...a,ref:n})});eR.displayName=eE;var eT="SelectItem",[eA,eD]=ee(eT),eL=n.forwardRef((e,r)=>{let{__scopeSelect:a,value:i,disabled:o=!1,textValue:l,...s}=e,d=ea(eT,a),c=ex(eT,a),u=d.value===i,[p,h]=n.useState(l??""),[m,f]=n.useState(!1),g=(0,E.useComposedRefs)(r,e=>c.itemRefCallback?.(e,i,o)),x=(0,F.useId)(),v=n.useRef("touch"),w=()=>{o||(d.onValueChange(i),d.onOpenChange(!1))};if(""===i)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)(eA,{scope:a,value:i,disabled:o,textId:x,isSelected:u,onItemTextChange:n.useCallback(e=>{h(t=>t||(e?.textContent??"").trim())},[]),children:(0,t.jsx)(X.ItemSlot,{scope:a,value:i,disabled:o,textValue:p,children:(0,t.jsx)(B.Primitive.div,{role:"option","aria-labelledby":x,"data-highlighted":m?"":void 0,"aria-selected":u&&m,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:g,onFocus:(0,N.composeEventHandlers)(s.onFocus,()=>f(!0)),onBlur:(0,N.composeEventHandlers)(s.onBlur,()=>f(!1)),onClick:(0,N.composeEventHandlers)(s.onClick,()=>{"mouse"!==v.current&&w()}),onPointerUp:(0,N.composeEventHandlers)(s.onPointerUp,()=>{"mouse"===v.current&&w()}),onPointerDown:(0,N.composeEventHandlers)(s.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:(0,N.composeEventHandlers)(s.onPointerMove,e=>{v.current=e.pointerType,o?c.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:(0,N.composeEventHandlers)(s.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:(0,N.composeEventHandlers)(s.onKeyDown,e=>{(c.searchRef?.current===""||" "!==e.key)&&(Y.includes(e.key)&&w()," "===e.key&&e.preventDefault())})})})})});eL.displayName=eT;var eF="SelectItemText",eH=n.forwardRef((e,r)=>{let{__scopeSelect:a,className:i,style:o,...l}=e,s=ea(eF,a),d=ex(eF,a),c=eD(eF,a),u=eo(eF,a),[p,h]=n.useState(null),m=(0,E.useComposedRefs)(r,e=>h(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,O.useLayoutEffect)(()=>(x(g),()=>v(g)),[x,v,g]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(B.Primitive.span,{id:c.textId,...l,ref:m}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?M.createPortal(l.children,s.valueNode):null]})});eH.displayName=eF;var ez="SelectItemIndicator",eB=n.forwardRef((e,n)=>{let{__scopeSelect:r,...a}=e;return eD(ez,r).isSelected?(0,t.jsx)(B.Primitive.span,{"aria-hidden":!0,...a,ref:n}):null});eB.displayName=ez;var e_="SelectScrollUpButton",eV=n.forwardRef((e,r)=>{let a=ex(e_,e.__scopeSelect),i=eS(e_,e.__scopeSelect),[o,l]=n.useState(!1),s=(0,E.useComposedRefs)(r,i.onScrollButtonChange);return(0,O.useLayoutEffect)(()=>{if(a.viewport&&a.isPositioned){let e=function(){l(t.scrollTop>0)},t=a.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[a.viewport,a.isPositioned]),o?(0,t.jsx)(eU,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=a;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});eV.displayName=e_;var eW="SelectScrollDownButton",eO=n.forwardRef((e,r)=>{let a=ex(eW,e.__scopeSelect),i=eS(eW,e.__scopeSelect),[o,l]=n.useState(!1),s=(0,E.useComposedRefs)(r,i.onScrollButtonChange);return(0,O.useLayoutEffect)(()=>{if(a.viewport&&a.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;l(Math.ceil(t.scrollTop)<e)},t=a.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[a.viewport,a.isPositioned]),o?(0,t.jsx)(eU,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=a;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});eO.displayName=eW;var eU=n.forwardRef((e,r)=>{let{__scopeSelect:a,onAutoScroll:i,...o}=e,l=ex("SelectScrollButton",a),s=n.useRef(null),d=Q(a),c=n.useCallback(()=>{null!==s.current&&(window.clearInterval(s.current),s.current=null)},[]);return n.useEffect(()=>()=>c(),[c]),(0,O.useLayoutEffect)(()=>{let e=d().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[d]),(0,t.jsx)(B.Primitive.div,{"aria-hidden":!0,...o,ref:r,style:{flexShrink:0,...o.style},onPointerDown:(0,N.composeEventHandlers)(o.onPointerDown,()=>{null===s.current&&(s.current=window.setInterval(i,50))}),onPointerMove:(0,N.composeEventHandlers)(o.onPointerMove,()=>{l.onItemLeave?.(),null===s.current&&(s.current=window.setInterval(i,50))}),onPointerLeave:(0,N.composeEventHandlers)(o.onPointerLeave,()=>{c()})})}),eK=n.forwardRef((e,n)=>{let{__scopeSelect:r,...a}=e;return(0,t.jsx)(B.Primitive.div,{"aria-hidden":!0,...a,ref:n})});eK.displayName="SelectSeparator";var eq="SelectArrow",eG=n.forwardRef((e,n)=>{let{__scopeSelect:r,...a}=e,i=en(r),o=ea(eq,r),l=ex(eq,r);return o.open&&"popper"===l.position?(0,t.jsx)(H.Arrow,{...i,...a,ref:n}):null});eG.displayName=eq;var e$=n.forwardRef(({__scopeSelect:e,value:r,...a},i)=>{let o=n.useRef(null),l=(0,E.useComposedRefs)(i,o),s=(0,U.usePrevious)(r);return n.useEffect(()=>{let e=o.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)(B.Primitive.select,{...a,style:{...K.VISUALLY_HIDDEN_STYLES,...a.style},ref:l,defaultValue:r})});function eY(e){return""===e||void 0===e}function eZ(e){let t=(0,V.useCallbackRef)(e),r=n.useRef(""),a=n.useRef(0),i=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]),o=n.useCallback(()=>{r.current="",window.clearTimeout(a.current)},[]);return n.useEffect(()=>()=>window.clearTimeout(a.current),[]),[r,i,o]}function eX(e,t,n){var r,a;let i=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,o=n?e.indexOf(n):-1,l=(r=e,a=Math.max(o,0),r.map((e,t)=>r[(a+t)%r.length]));1===i.length&&(l=l.filter(e=>e!==n));let s=l.find(e=>e.textValue.toLowerCase().startsWith(i.toLowerCase()));return s!==n?s:void 0}e$.displayName="SelectBubbleInput",e.s(["Arrow",()=>eG,"Content",()=>ef,"Group",()=>eP,"Icon",()=>ep,"Item",()=>eL,"ItemIndicator",()=>eB,"ItemText",()=>eH,"Label",()=>eR,"Portal",()=>eh,"Root",()=>el,"ScrollDownButton",()=>eO,"ScrollUpButton",()=>eV,"Select",()=>el,"SelectArrow",()=>eG,"SelectContent",()=>ef,"SelectGroup",()=>eP,"SelectIcon",()=>ep,"SelectItem",()=>eL,"SelectItemIndicator",()=>eB,"SelectItemText",()=>eH,"SelectLabel",()=>eR,"SelectPortal",()=>eh,"SelectScrollDownButton",()=>eO,"SelectScrollUpButton",()=>eV,"SelectSeparator",()=>eK,"SelectTrigger",()=>ed,"SelectValue",()=>eu,"SelectViewport",()=>ek,"Separator",()=>eK,"Trigger",()=>ed,"Value",()=>eu,"Viewport",()=>ek,"createSelectScope",()=>et],83830);var eQ=e.i(83830),eQ=eQ,eJ=e.i(99105);let e0=(0,a.default)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),e1=eQ.Root;eQ.Group;let e2=eQ.Value,e5=n.forwardRef(({className:e,children:n,...r},a)=>(0,t.jsxs)(eQ.Trigger,{ref:a,className:(0,b.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)(eQ.Icon,{asChild:!0,children:(0,t.jsx)(eJ.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));e5.displayName=eQ.Trigger.displayName;let e3=n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(eQ.ScrollUpButton,{ref:r,className:(0,b.cn)("flex cursor-default items-center justify-center py-1",e),...n,children:(0,t.jsx)(e0,{className:"h-4 w-4"})}));e3.displayName=eQ.ScrollUpButton.displayName;let e4=n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(eQ.ScrollDownButton,{ref:r,className:(0,b.cn)("flex cursor-default items-center justify-center py-1",e),...n,children:(0,t.jsx)(eJ.ChevronDown,{className:"h-4 w-4"})}));e4.displayName=eQ.ScrollDownButton.displayName;let e8=n.forwardRef(({className:e,children:n,position:r="popper",...a},i)=>(0,t.jsx)(eQ.Portal,{children:(0,t.jsxs)(eQ.Content,{ref:i,className:(0,b.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)(e3,{}),(0,t.jsx)(eQ.Viewport,{className:(0,b.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)(e4,{})]})}));e8.displayName=eQ.Content.displayName,n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(eQ.Label,{ref:r,className:(0,b.cn)("px-2 py-1.5 text-sm font-semibold",e),...n})).displayName=eQ.Label.displayName;let e6=n.forwardRef(({className:e,children:n,...r},a)=>(0,t.jsxs)(eQ.Item,{ref:a,className:(0,b.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),...r,children:[(0,t.jsx)("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,t.jsx)(eQ.ItemIndicator,{children:(0,t.jsx)(o.Check,{className:"h-4 w-4"})})}),(0,t.jsx)(eQ.ItemText,{children:n})]}));e6.displayName=eQ.Item.displayName,n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(eQ.Separator,{ref:r,className:(0,b.cn)("bg-muted -mx-1 my-1 h-px",e),...n})).displayName=eQ.Separator.displayName;var e9=e.i(21023);let e7=(0,e9.createServerReference)("40be811b13973dd9e25fc78ee7fed7c6618a5cccc2",e9.callServer,void 0,e9.findSourceMapURL,"updateSettingsAction");var te=e.i(17406),tt=e.i(98804),tn=e.i(44229),tr=e.i(83902);function ta(e){return(0,t.jsx)(tn.Code,{className:(0,b.cn)("h-4 w-4",e.className),...e})}function ti({className:e}){return(0,t.jsx)(tt.default,{src:"/icons/editors/vscode.svg",alt:"VS Code",width:24,height:24,className:(0,b.cn)("rounded-sm object-contain",e)})}function to({className:e}){return(0,t.jsx)(tt.default,{src:"/icons/agents/cursor.jpeg",alt:"Cursor",width:24,height:24,className:(0,b.cn)("rounded-sm object-contain",e)})}function tl({className:e}){return(0,t.jsx)(tt.default,{src:"/icons/editors/windsurf.svg",alt:"Windsurf",width:24,height:24,className:(0,b.cn)("rounded-sm object-contain",e)})}function ts({className:e}){return(0,t.jsx)(tt.default,{src:"/icons/editors/zed.svg",alt:"Zed",width:24,height:24,className:(0,b.cn)("rounded-sm object-contain",e)})}function td({className:e,...n}){return(0,t.jsx)(tr.Rocket,{className:(0,b.cn)("h-4 w-4",e),...n})}ti.displayName="VsCodeIcon",to.displayName="CursorEditorIcon",tl.displayName="WindsurfIcon",ts.displayName="ZedIcon",td.displayName="AntigravityIcon";let tc={vscode:ti,cursor:to,windsurf:tl,zed:ts,antigravity:td};var tu=e.i(41413),tp=e.i(77624),th=["PageUp","PageDown"],tm=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],tf={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},tg="Slider",[tx,tv,tw]=(0,P.createCollection)(tg),[tb,ty]=(0,R.createContextScope)(tg,[tw]),[tj,tS]=tb(tg),tC=n.forwardRef((e,r)=>{let{name:a,min:i=0,max:o=100,step:l=1,orientation:s="horizontal",disabled:d=!1,minStepsBetweenThumbs:c=0,defaultValue:u=[i],value:p,onValueChange:h=()=>{},onValueCommit:m=()=>{},inverted:f=!1,form:g,...x}=e,v=n.useRef(new Set),w=n.useRef(0),b="horizontal"===s,[y=[],j]=(0,W.useControllableState)({prop:p,defaultProp:u,onChange:e=>{let t=[...v.current];t[w.current]?.focus(),h(e)}}),S=n.useRef(y);function C(e,t,{commit:n}={commit:!1}){let r,a=(String(l).split(".")[1]||"").length,s=Math.round((Math.round((e-i)/l)*l+i)*(r=Math.pow(10,a)))/r,d=(0,I.clamp)(s,[i,o]);j((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*l))return e;{w.current=r.indexOf(d);let t=String(r)!==String(e);return t&&n&&m(r),t?r:e}})}return(0,t.jsx)(tj,{scope:e.__scopeSlider,name:a,disabled:d,min:i,max:o,valueIndexToChangeRef:w,thumbs:v.current,values:y,orientation:s,form:g,children:(0,t.jsx)(tx.Provider,{scope:e.__scopeSlider,children:(0,t.jsx)(tx.Slot,{scope:e.__scopeSlider,children:(0,t.jsx)(b?tI:tN,{"aria-disabled":d,"data-disabled":d?"":void 0,...x,ref:r,onPointerDown:(0,N.composeEventHandlers)(x.onPointerDown,()=>{d||(S.current=y)}),min:i,max:o,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);C(e,t)},onSlideMove:d?void 0:function(e){C(e,w.current)},onSlideEnd:d?void 0:function(){let e=S.current[w.current];y[w.current]!==e&&m(y)},onHomeKeyDown:()=>!d&&C(i,0,{commit:!0}),onEndKeyDown:()=>!d&&C(o,y.length-1,{commit:!0}),onStepKeyDown:({event:e,direction:t})=>{if(!d){let n=th.includes(e.key)||e.shiftKey&&tm.includes(e.key),r=w.current;C(y[r]+l*(n?10:1)*t,r,{commit:!0})}}})})})})});tC.displayName=tg;var[tk,tM]=tb(tg,{startEdge:"left",endEdge:"right",size:"width",direction:1}),tI=n.forwardRef((e,r)=>{let{min:a,max:i,dir:o,inverted:l,onSlideStart:s,onSlideMove:d,onSlideEnd:c,onStepKeyDown:u,...p}=e,[h,m]=n.useState(null),f=(0,E.useComposedRefs)(r,e=>m(e)),g=n.useRef(void 0),x=(0,T.useDirection)(o),v="ltr"===x,w=v&&!l||!v&&l;function b(e){let t=g.current||h.getBoundingClientRect(),n=tB([0,t.width],w?[a,i]:[i,a]);return g.current=t,n(e-t.left)}return(0,t.jsx)(tk,{scope:e.__scopeSlider,startEdge:w?"left":"right",endEdge:w?"right":"left",direction:w?1:-1,size:"width",children:(0,t.jsx)(tP,{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=tf[w?"from-left":"from-right"].includes(e.key);u?.({event:e,direction:t?-1:1})}})})}),tN=n.forwardRef((e,r)=>{let{min:a,max:i,inverted:o,onSlideStart:l,onSlideMove:s,onSlideEnd:d,onStepKeyDown:c,...u}=e,p=n.useRef(null),h=(0,E.useComposedRefs)(r,p),m=n.useRef(void 0),f=!o;function g(e){let t=m.current||p.current.getBoundingClientRect(),n=tB([0,t.height],f?[i,a]:[a,i]);return m.current=t,n(e-t.top)}return(0,t.jsx)(tk,{scope:e.__scopeSlider,startEdge:f?"bottom":"top",endEdge:f?"top":"bottom",size:"height",direction:f?1:-1,children:(0,t.jsx)(tP,{"data-orientation":"vertical",...u,ref:h,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:e=>{let t=g(e.clientY);l?.(t)},onSlideMove:e=>{let t=g(e.clientY);s?.(t)},onSlideEnd:()=>{m.current=void 0,d?.()},onStepKeyDown:e=>{let t=tf[f?"from-bottom":"from-top"].includes(e.key);c?.({event:e,direction:t?-1:1})}})})}),tP=n.forwardRef((e,n)=>{let{__scopeSlider:r,onSlideStart:a,onSlideMove:i,onSlideEnd:o,onHomeKeyDown:l,onEndKeyDown:s,onStepKeyDown:d,...c}=e,u=tS(tg,r);return(0,t.jsx)(B.Primitive.span,{...c,ref:n,onKeyDown:(0,N.composeEventHandlers)(e.onKeyDown,e=>{"Home"===e.key?(l(e),e.preventDefault()):"End"===e.key?(s(e),e.preventDefault()):th.concat(tm).includes(e.key)&&(d(e),e.preventDefault())}),onPointerDown:(0,N.composeEventHandlers)(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),u.thumbs.has(t)?t.focus():a(e)}),onPointerMove:(0,N.composeEventHandlers)(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&i(e)}),onPointerUp:(0,N.composeEventHandlers)(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),o(e))})})}),tE="SliderTrack",tR=n.forwardRef((e,n)=>{let{__scopeSlider:r,...a}=e,i=tS(tE,r);return(0,t.jsx)(B.Primitive.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...a,ref:n})});tR.displayName=tE;var tT="SliderRange",tA=n.forwardRef((e,r)=>{let{__scopeSlider:a,...i}=e,o=tS(tT,a),l=tM(tT,a),s=n.useRef(null),d=(0,E.useComposedRefs)(r,s),c=o.values.length,u=o.values.map(e=>tz(e,o.min,o.max)),p=c>1?Math.min(...u):0,h=100-Math.max(...u);return(0,t.jsx)(B.Primitive.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,...i,ref:d,style:{...e.style,[l.startEdge]:p+"%",[l.endEdge]:h+"%"}})});tA.displayName=tT;var tD="SliderThumb",tL=n.forwardRef((e,r)=>{let a=tv(e.__scopeSlider),[i,o]=n.useState(null),l=(0,E.useComposedRefs)(r,e=>o(e)),s=n.useMemo(()=>i?a().findIndex(e=>e.ref.current===i):-1,[a,i]);return(0,t.jsx)(tF,{...e,ref:l,index:s})}),tF=n.forwardRef((e,r)=>{var a,i,o,l,s;let d,c,{__scopeSlider:u,index:p,name:h,...m}=e,f=tS(tD,u),g=tM(tD,u),[x,v]=n.useState(null),w=(0,E.useComposedRefs)(r,e=>v(e)),b=!x||f.form||!!x.closest("form"),y=(0,tp.useSize)(x),j=f.values[p],S=void 0===j?0:tz(j,f.min,f.max),C=(a=p,(i=f.values.length)>2?`Value ${a+1} of ${i}`:2===i?["Minimum","Maximum"][a]:void 0),k=y?.[g.size],M=k?(o=k,l=S,s=g.direction,c=tB([0,50],[0,d=o/2]),(d-c(l)*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(${S}% + ${M}px)`},children:[(0,t.jsx)(tx.ItemSlot,{scope:e.__scopeSlider,children:(0,t.jsx)(B.Primitive.span,{role:"slider","aria-label":e["aria-label"]||C,"aria-valuemin":f.min,"aria-valuenow":j,"aria-valuemax":f.max,"aria-orientation":f.orientation,"data-orientation":f.orientation,"data-disabled":f.disabled?"":void 0,tabIndex:f.disabled?void 0:0,...m,ref:w,style:void 0===j?{display:"none"}:e.style,onFocus:(0,N.composeEventHandlers)(e.onFocus,()=>{f.valueIndexToChangeRef.current=p})})}),b&&(0,t.jsx)(tH,{name:h??(f.name?f.name+(f.values.length>1?"[]":""):void 0),form:f.form,value:j},p)]})});tL.displayName=tD;var tH=n.forwardRef(({__scopeSlider:e,value:r,...a},i)=>{let o=n.useRef(null),l=(0,E.useComposedRefs)(o,i),s=(0,U.usePrevious)(r);return n.useEffect(()=>{let e=o.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)(B.Primitive.input,{style:{display:"none"},...a,ref:l,defaultValue:r})});function tz(e,t,n){return(0,I.clamp)(100/(n-t)*(e-t),[0,100])}function tB(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])}}tH.displayName="RadioBubbleInput",e.s(["Range",()=>tA,"Root",()=>tC,"Slider",()=>tC,"SliderRange",()=>tA,"SliderThumb",()=>tL,"SliderTrack",()=>tR,"Thumb",()=>tL,"Track",()=>tR,"createSliderScope",()=>ty],29991);var t_=e.i(29991),t_=t_;function tV({className:e,defaultValue:r,value:a,min:i=0,max:o=100,...l}){let s=n.useMemo(()=>Array.isArray(a)?a:Array.isArray(r)?r:[i,o],[a,r,i,o]);return(0,t.jsxs)(t_.Root,{"data-slot":"slider",defaultValue:r,value:a,min:i,max:o,className:(0,b.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),...l,children:[(0,t.jsx)(t_.Track,{"data-slot":"slider-track",className:(0,b.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)(t_.Range,{"data-slot":"slider-range",className:(0,b.cn)("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:s.length},(e,n)=>(0,t.jsx)(t_.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 tW=[60,120,300,600,900,1800,2700,3600,7200,10800,14400,21600,28800,43200,86400],tO=tW.length-1;function tU(e){let t=0,n=Math.abs(e-tW[0]);for(let r=1;r<tW.length;r++){let a=Math.abs(e-tW[r]);a<n&&(n=a,t=r)}return t}function tK({id:e,testId:r,value:a,onChange:i,onBlur:o,defaultSeconds:l=1800}){var s;let d,c,u=(""===a?l:parseInt(a,10))||l,[p,h]=(0,n.useState)(()=>tU(u)),m=tU(u);m!==p&&tW[p]!==u&&h(m);let f=(0,n.useCallback)(([e])=>{h(e),i(String(tW[e]))},[i]);return(0,t.jsxs)("div",{className:"flex w-55 items-center gap-2",children:[(0,t.jsx)(tV,{id:e,"data-testid":r,min:0,max:tO,step:1,value:[p],onValueChange:f,onValueCommit:()=>o(),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=tW[p])/3600),c=Math.round(s%3600/60),0===d?`${c}m`:0===c?`${d}h`:`${d}h ${c}m`)})]})}let tq=[{value:te.AgentAuthMethod.Session,label:"Session"},{value:te.AgentAuthMethod.Token,label:"Token"}],tG=[{value:te.EditorType.VsCode,label:"VS Code"},{value:te.EditorType.Cursor,label:"Cursor"},{value:te.EditorType.Windsurf,label:"Windsurf"},{value:te.EditorType.Zed,label:"Zed"},{value:te.EditorType.Antigravity,label:"Antigravity"}],t$=[{value:"bash",label:"Bash"},{value:"zsh",label:"Zsh"},{value:"fish",label:"Fish"}],tY=[{id:"agent",label:"Agent",icon:l},{id:"environment",label:"Environment",icon:s.Terminal},{id:"workflow",label:"Workflow",icon:d.GitBranch},{id:"ci",label:"CI",icon:c},{id:"stage-timeouts",label:"Timeouts",icon:v.Timer},{id:"notifications",label:"Notifications",icon:u},{id:"feature-flags",label:"Flags",icon:p},{id:"database",label:"Database",icon:h}];function tZ({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)(y.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 tX({label:e,description:n,id:r,testId:a,checked:i,onChange:o,disabled:l}){return(0,t.jsx)(tZ,{label:e,description:n,htmlFor:r,children:(0,t.jsx)(C.Switch,{id:r,"data-testid":a,checked:i,onCheckedChange:o,disabled:l,className:(0,b.cn)("cursor-pointer",l&&"cursor-not-allowed opacity-50")})})}function tQ({icon:e,title:n,description:r,badge:a,testId:i,children:o}){return(0,t.jsxs)("div",{className:"bg-background rounded-lg border","data-testid":i,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:o})]})}function tJ({id:e,testId:n,value:r,onChange:a,onBlur:i,placeholder:o,min:l=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(l,(u??parseInt(o,10))-d)))},onMouseUp:i,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)(m.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:o,onChange:e=>{a(e.target.value.replace(/[^0-9]/g,""))},onBlur:i,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(o,10),a(String(null!=s?Math.min(s,e+d):e+d))},onMouseUp:i,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)(f.Plus,{className:"h-3 w-3"})})]}),c?(0,t.jsx)("span",{className:"text-muted-foreground text-[11px]",children:c}):null]})}function t0({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 t1({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)(g.ExternalLink,{className:"h-2.5 w-2.5"}),e.label]},e.href))}):null]})}function t2({settings:e,shepHome:a,dbFileSize:m,availableTerminals:f}){let{showSaving:g,showSaved:y,save:C}=function(){let[e,t]=(0,n.useTransition)(),[r,a]=(0,n.useState)(!1),[i,o]=(0,n.useState)(!1),l=(0,n.useRef)(null),s=(0,n.useRef)(!1);return(0,n.useEffect)(()=>{e&&!r&&(a(!0),s.current=!1,l.current=setTimeout(()=>{l.current=null,s.current&&(a(!1),o(!0),setTimeout(()=>o(!1),2e3))},350)),!e&&r&&(s.current=!0,l.current||(a(!1),o(!0),setTimeout(()=>o(!1),2e3)))},[e,r]),{showSaving:r,showSaved:i,save:(0,n.useCallback)(e=>{t(async()=>{let t=await e7(e);t.success||w.toast.error(t.error??"Failed to save settings")})},[t])}}(),M=e.featureFlags??{skills:!1,envDeploy:!1,debug:!1},[I,N]=(0,n.useState)(e.agent.type),P=e.agent.authMethod,[E,R]=(0,n.useState)(e.agent.token??""),[T,A]=(0,n.useState)(!1),[D,L]=(0,n.useState)(e.environment.defaultEditor),[F,H]=(0,n.useState)(e.environment.shellPreference),[z,B]=(0,n.useState)(e.environment.terminalPreference??te.TerminalType.System),_=f?f.filter(e=>e.available):[{id:te.TerminalType.System,name:"System Terminal",available:!0}],[V,W]=(0,n.useState)(e.workflow.openPrOnImplementationComplete),[O,U]=(0,n.useState)(e.workflow.approvalGateDefaults.pushOnImplementationComplete),[K,q]=(0,n.useState)(e.workflow.approvalGateDefaults.allowPrd),[G,$]=(0,n.useState)(e.workflow.approvalGateDefaults.allowPlan),[Y,Z]=(0,n.useState)(e.workflow.approvalGateDefaults.allowMerge),[X,Q]=(0,n.useState)(e.workflow.enableEvidence),[J,ee]=(0,n.useState)(e.workflow.commitEvidence),[et,en]=(0,n.useState)(!1!==e.workflow.ciWatchEnabled),[er,ea]=(0,n.useState)(null!=e.workflow.ciMaxFixAttempts?String(e.workflow.ciMaxFixAttempts):""),[ei,eo]=(0,n.useState)(null!=e.workflow.ciWatchTimeoutMs?String(Math.round(e.workflow.ciWatchTimeoutMs/1e3)):""),[el,es]=(0,n.useState)(null!=e.workflow.ciLogMaxChars?String(e.workflow.ciLogMaxChars):""),[ed,ec]=(0,n.useState)(null!=e.workflow.ciWatchPollIntervalSeconds?String(e.workflow.ciWatchPollIntervalSeconds):""),eu=e.workflow.stageTimeouts,[ep,eh]=(0,n.useState)(String(Math.round((eu?.analyzeMs??18e5)/1e3))),[em,ef]=(0,n.useState)(String(Math.round((eu?.requirementsMs??18e5)/1e3))),[eg,ex]=(0,n.useState)(String(Math.round((eu?.researchMs??18e5)/1e3))),[ev,ew]=(0,n.useState)(String(Math.round((eu?.planMs??18e5)/1e3))),[eb,ey]=(0,n.useState)(String(Math.round((eu?.implementMs??18e5)/1e3))),[ej,eS]=(0,n.useState)(String(Math.round((eu?.mergeMs??18e5)/1e3))),eC=e.workflow.analyzeRepoTimeouts,[ek,eM]=(0,n.useState)(String(Math.round((eC?.analyzeMs??6e5)/1e3))),[eI,eN]=(0,n.useState)(e.notifications.inApp.enabled),[eP,eE]=(0,n.useState)(e.notifications.browser.enabled),[eR,eT]=(0,n.useState)(e.notifications.desktop.enabled),[eA,eD]=(0,n.useState)({...e.notifications.events}),[eL,eF]=(0,n.useState)({...M}),eH=null!=e.workflow.ciMaxFixAttempts?String(e.workflow.ciMaxFixAttempts):"",ez=null!=e.workflow.ciWatchTimeoutMs?String(Math.round(e.workflow.ciWatchTimeoutMs/1e3)):"",eB=null!=e.workflow.ciLogMaxChars?String(e.workflow.ciLogMaxChars):"",e_=null!=e.workflow.ciWatchPollIntervalSeconds?String(e.workflow.ciWatchPollIntervalSeconds):"",eV=eu?.analyzeMs!=null?String(Math.round(eu.analyzeMs/1e3)):"",eW=eu?.requirementsMs!=null?String(Math.round(eu.requirementsMs/1e3)):"",eO=eu?.researchMs!=null?String(Math.round(eu.researchMs/1e3)):"",eU=eu?.planMs!=null?String(Math.round(eu.planMs/1e3)):"",eK=eu?.implementMs!=null?String(Math.round(eu.implementMs/1e3)):"",eq=eu?.mergeMs!=null?String(Math.round(eu.mergeMs/1e3)):"",eG=eC?.analyzeMs!=null?String(Math.round(eC.analyzeMs/1e3)):"";function e$(e){if(""===e)return;let t=parseInt(e,10);return Number.isNaN(t)||t<=0?void 0:t}function eY(e){if(void 0===e)return;let t=e$(e);return null!=t?1e3*t:void 0}function eZ(e={}){let t=e$(e.ciTimeout??ei);return{workflow:{openPrOnImplementationComplete:e.openPr??V,approvalGateDefaults:{pushOnImplementationComplete:e.pushOnComplete??O,allowPrd:e.allowPrd??K,allowPlan:e.allowPlan??G,allowMerge:e.allowMerge??Y},enableEvidence:e.enableEvidence??X,commitEvidence:e.commitEvidence??J,ciWatchEnabled:e.ciWatchEnabled??et,ciMaxFixAttempts:e$(e.ciMaxFix??er),ciWatchTimeoutMs:null!=t?1e3*t:void 0,ciLogMaxChars:e$(e.ciLogMax??el),ciWatchPollIntervalSeconds:e$(e.ciPollInterval??ed),stageTimeouts:{analyzeMs:eY(e.analyzeTimeout??ep),requirementsMs:eY(e.requirementsTimeout??em),researchMs:eY(e.researchTimeout??eg),planMs:eY(e.planTimeout??ev),implementMs:eY(e.implementTimeout??eb),mergeMs:eY(e.mergeTimeout??ej)},analyzeRepoTimeouts:{analyzeMs:eY(e.analyzeRepoTimeout??ek)}}}}function eX(e={}){return{notifications:{inApp:{enabled:e.inApp??eI},browser:{enabled:e.browser??eP},desktop:{enabled:e.desktop??eR},events:e.events??eA}}}let[eQ,eJ]=(0,n.useState)("agent");(0,n.useEffect)(()=>{let e=tY.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&&eJ(t.target.id.replace("section-",""))},{rootMargin:"-65px 0px -60% 0px",threshold:0});for(let n of e)t.observe(n);return()=>t.disconnect()},[]);let e0=(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)(x,{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,b.cn)("text-muted-foreground absolute inset-0 flex items-center text-xs transition-opacity duration-300",g?"opacity-100":"opacity-0"),children:"Saving..."}),(0,t.jsxs)("span",{className:(0,b.cn)("absolute inset-0 flex items-center gap-1 text-xs text-green-600 transition-opacity duration-300",y&&!g?"opacity-100":"opacity-0"),children:[(0,t.jsx)(o.Check,{className:"h-3 w-3"}),"Saved"]})]}),(0,t.jsx)("nav",{className:"ml-auto flex items-center gap-0.5",children:tY.map(e=>{let n=e.icon,r=eQ===e.id;return(0,t.jsxs)("button",{type:"button",onClick:()=>e0(e.id),className:(0,b.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.jsxs)(tQ,{icon:l,title:"Agent",description:"AI coding agent and authentication",testId:"agent-settings-section",children:[(0,t.jsx)(tZ,{label:"Agent & Model",description:"Provider and model for all operations",htmlFor:"agent-model-picker",children:(0,t.jsx)(tu.AgentModelPicker,{initialAgentType:I,initialModel:e.models.default,mode:"settings",onAgentModelChange:e=>N(e),className:"w-55"})}),(0,t.jsx)(tZ,{label:"Authentication",description:"How the agent authenticates",htmlFor:"auth-method",children:(0,t.jsx)(k.TooltipProvider,{children:(0,t.jsxs)(k.Tooltip,{children:[(0,t.jsx)(k.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("div",{children:(0,t.jsxs)(e1,{value:P,disabled:!0,children:[(0,t.jsx)(e5,{id:"auth-method","data-testid":"auth-method-select",className:"w-55 cursor-not-allowed text-xs opacity-60",children:(0,t.jsx)(e2,{})}),(0,t.jsx)(e8,{children:tq.map(e=>(0,t.jsx)(e6,{value:e.value,children:e.label},e.value))})]})})}),(0,t.jsx)(k.TooltipContent,{children:"Coming soon"})]})})}),P===te.AgentAuthMethod.Token&&(0,t.jsx)(tZ,{label:"API Token",htmlFor:"agent-token",children:(0,t.jsxs)("div",{className:"relative w-45",children:[(0,t.jsx)(j.Input,{id:"agent-token","data-testid":"agent-token-input",type:T?"text":"password",value:E,onChange:e=>R(e.target.value),onBlur:()=>{E!==(e.agent.token??"")&&C(function(e={}){let t={type:I,authMethod:P,...e},n={type:t.type,authMethod:t.authMethod};return t.authMethod===te.AgentAuthMethod.Token&&(n.token=e.token??E),{agent:n}}({token:E}))},placeholder:"Enter token",className:"pr-8"}),(0,t.jsx)(S.Button,{type:"button",variant:"ghost",size:"sm",className:"absolute top-0 right-0 h-full px-2 hover:bg-transparent",onClick:()=>A(!T),"data-testid":"toggle-token-visibility","aria-label":T?"Hide token":"Show token",children:T?(0,t.jsx)(i,{className:"h-3 w-3"}):(0,t.jsx)(r.Eye,{className:"h-3 w-3"})})]})})]}),(0,t.jsx)(t1,{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:s.Terminal,title:"Environment",description:"Editor, shell, and terminal preferences",testId:"environment-settings-section",children:[(0,t.jsx)(tZ,{label:"Default Editor",description:"Editor launched for file operations",htmlFor:"default-editor",children:(0,t.jsxs)(e1,{value:D,onValueChange:e=>{L(e),C({environment:{defaultEditor:e,shellPreference:F,terminalPreference:z}})},children:[(0,t.jsx)(e5,{id:"default-editor","data-testid":"editor-select",className:"w-55 cursor-pointer text-xs",children:(0,t.jsx)(e2,{})}),(0,t.jsx)(e8,{children:tG.map(e=>{var n;let r=(n=e.value)&&n in tc?tc[n]:ta;return(0,t.jsx)(e6,{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)(tZ,{label:"Shell",description:"Default shell for generated scripts",htmlFor:"shell-preference",children:(0,t.jsxs)(e1,{value:F,onValueChange:e=>{H(e),C({environment:{defaultEditor:D,shellPreference:e,terminalPreference:z}})},children:[(0,t.jsx)(e5,{id:"shell-preference","data-testid":"shell-select",className:"w-55 cursor-pointer text-xs",children:(0,t.jsx)(e2,{})}),(0,t.jsx)(e8,{children:t$.map(e=>(0,t.jsx)(e6,{value:e.value,children:e.label},e.value))})]})}),(0,t.jsx)(tZ,{label:"Terminal",description:"Terminal emulator for shell sessions",htmlFor:"terminal-preference",children:(0,t.jsxs)(e1,{value:z,onValueChange:e=>{B(e),C({environment:{defaultEditor:D,shellPreference:F,terminalPreference:e}})},children:[(0,t.jsx)(e5,{id:"terminal-preference","data-testid":"terminal-select",className:"w-55 cursor-pointer text-xs",children:(0,t.jsx)(e2,{})}),(0,t.jsx)(e8,{children:_.map(e=>(0,t.jsx)(e6,{value:e.id,children:e.name},e.id))})]})})]}),(0,t.jsx)(t1,{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:d.GitBranch,title:"Workflow",description:"Automation behavior after implementation",testId:"workflow-settings-section",children:[(0,t.jsx)(t0,{children:"Approve"}),(0,t.jsx)(tX,{label:"Auto-approve PRD",description:"Skip manual review of requirements",id:"allow-prd",testId:"switch-allow-prd",checked:K,onChange:e=>{q(e),C(eZ({allowPrd:e}))}}),(0,t.jsx)(tX,{label:"Auto-approve Plan",description:"Skip manual review of implementation plan",id:"allow-plan",testId:"switch-allow-plan",checked:G,onChange:e=>{$(e),C(eZ({allowPlan:e}))}}),(0,t.jsx)(tX,{label:"Auto-approve Merge",description:"Merge without manual review",id:"allow-merge",testId:"switch-allow-merge",checked:Y,onChange:e=>{Z(e),C(eZ({allowMerge:e}))}}),(0,t.jsx)(t0,{children:"Evidence"}),(0,t.jsx)(tX,{label:"Collect evidence",description:"Capture screenshots and artifacts after implementation",id:"enable-evidence",testId:"switch-enable-evidence",checked:X,onChange:e=>{Q(e),e?C(eZ({enableEvidence:e})):(ee(!1),C(eZ({enableEvidence:e,commitEvidence:!1})))}}),(0,t.jsx)(tX,{label:"Add evidence to PR",description:"Include evidence in the pull request body",id:"commit-evidence",testId:"switch-commit-evidence",checked:J,disabled:!X||!V,onChange:e=>{ee(e),C(eZ({commitEvidence:e}))}}),(0,t.jsx)(t0,{children:"Git"}),(0,t.jsx)(tX,{label:"Push on complete",description:"Push to remote when implementation finishes",id:"push-on-complete",testId:"switch-push-on-complete",checked:O,onChange:e=>{U(e),C(eZ({pushOnComplete:e}))}}),(0,t.jsx)(tX,{label:"Open PR on complete",description:"Create a pull request when done",id:"open-pr",testId:"switch-open-pr",checked:V,onChange:e=>{W(e),e?C(eZ({openPr:e})):(ee(!1),C(eZ({openPr:e,commitEvidence:!1})))}}),(0,t.jsx)(tX,{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:et,onChange:e=>{en(e),C(eZ({ciWatchEnabled:e}))}})]}),(0,t.jsx)(t1,{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:c,title:"Continuous Integration",description:"Limits and timeouts for CI monitoring",testId:"ci-settings-section",children:[(0,t.jsx)(tZ,{label:"Max fix attempts",description:"Agent retries on failing CI",htmlFor:"ci-max-fix",children:(0,t.jsx)(tJ,{id:"ci-max-fix",testId:"ci-max-fix-input",placeholder:"3",value:er,onChange:ea,onBlur:()=>{er!==eH&&C(eZ({ciMaxFix:er}))},min:1,max:10})}),(0,t.jsx)(tZ,{label:"Watch timeout",description:"Max wait for CI completion",htmlFor:"ci-timeout",children:(0,t.jsx)(tJ,{id:"ci-timeout",testId:"ci-timeout-input",placeholder:"300",value:ei,onChange:eo,onBlur:()=>{ei!==ez&&C(eZ({ciTimeout:ei}))},min:30,step:30,suffix:"sec"})}),(0,t.jsx)(tZ,{label:"Max log size",description:"Truncate CI logs beyond this limit",htmlFor:"ci-log-max",children:(0,t.jsx)(tJ,{id:"ci-log-max",testId:"ci-log-max-input",placeholder:"50000",value:el,onChange:es,onBlur:()=>{el!==eB&&C(eZ({ciLogMax:el}))},min:1e3,step:5e3,suffix:"chars"})}),(0,t.jsx)(tZ,{label:"Poll interval",description:"How often to check GitHub for CI status updates",htmlFor:"ci-poll-interval",children:(0,t.jsx)(tJ,{id:"ci-poll-interval",testId:"ci-poll-interval-input",placeholder:"30",value:ed,onChange:ec,onBlur:()=>{ed!==e_&&C(eZ({ciPollInterval:ed}))},min:5,step:5,suffix:"sec"})})]}),(0,t.jsx)(t1,{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:v.Timer,title:"Stage Timeouts",description:"Maximum execution time per agent stage",testId:"stage-timeouts-settings-section",children:[(0,t.jsx)(t0,{children:"Feature Agent"}),(0,t.jsx)(tZ,{label:"Analyze",description:"Repository analysis timeout",htmlFor:"timeout-analyze",children:(0,t.jsx)(tK,{id:"timeout-analyze",testId:"timeout-analyze-input",value:ep,onChange:eh,onBlur:()=>{ep!==eV&&C(eZ({analyzeTimeout:ep}))},defaultSeconds:1800})}),(0,t.jsx)(tZ,{label:"Requirements",description:"Requirements gathering timeout",htmlFor:"timeout-requirements",children:(0,t.jsx)(tK,{id:"timeout-requirements",testId:"timeout-requirements-input",value:em,onChange:ef,onBlur:()=>{em!==eW&&C(eZ({requirementsTimeout:em}))},defaultSeconds:1800})}),(0,t.jsx)(tZ,{label:"Research",description:"Technical research timeout",htmlFor:"timeout-research",children:(0,t.jsx)(tK,{id:"timeout-research",testId:"timeout-research-input",value:eg,onChange:ex,onBlur:()=>{eg!==eO&&C(eZ({researchTimeout:eg}))},defaultSeconds:1800})}),(0,t.jsx)(tZ,{label:"Plan",description:"Implementation planning timeout",htmlFor:"timeout-plan",children:(0,t.jsx)(tK,{id:"timeout-plan",testId:"timeout-plan-input",value:ev,onChange:ew,onBlur:()=>{ev!==eU&&C(eZ({planTimeout:ev}))},defaultSeconds:1800})}),(0,t.jsx)(tZ,{label:"Implement",description:"Code implementation timeout",htmlFor:"timeout-implement",children:(0,t.jsx)(tK,{id:"timeout-implement",testId:"timeout-implement-input",value:eb,onChange:ey,onBlur:()=>{eb!==eK&&C(eZ({implementTimeout:eb}))},defaultSeconds:1800})}),(0,t.jsx)(tZ,{label:"Merge",description:"PR creation and merge timeout",htmlFor:"timeout-merge",children:(0,t.jsx)(tK,{id:"timeout-merge",testId:"timeout-merge-input",value:ej,onChange:eS,onBlur:()=>{ej!==eq&&C(eZ({mergeTimeout:ej}))},defaultSeconds:1800})}),(0,t.jsx)(t0,{children:"Analyze Repository Agent"}),(0,t.jsx)(tZ,{label:"Analyze",description:"Repository analysis timeout",htmlFor:"timeout-analyze-repo",children:(0,t.jsx)(tK,{id:"timeout-analyze-repo",testId:"timeout-analyze-repo-input",value:ek,onChange:eM,onBlur:()=>{ek!==eG&&C(eZ({analyzeRepoTimeout:ek}))},defaultSeconds:600})})]}),(0,t.jsx)(t1,{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:u,title:"Notifications",description:"How and when you get notified",testId:"notification-settings-section",children:[(0,t.jsx)(t0,{children:"Channels"}),(0,t.jsx)(tX,{label:"In-app",description:"Notifications inside the Shep UI",id:"notif-in-app",testId:"switch-in-app",checked:eI,onChange:e=>{eN(e),C(eX({inApp:e}))}}),(0,t.jsx)(tX,{label:"Browser",description:"Push notifications via the browser",id:"notif-browser",testId:"switch-browser",checked:eP,onChange:e=>{eE(e),C(eX({browser:e}))}}),(0,t.jsx)(tX,{label:"Desktop",description:"Native OS notifications",id:"notif-desktop",testId:"switch-desktop",checked:eR,onChange:e=>{eT(e),C(eX({desktop:e}))}}),(0,t.jsx)(t0,{children:"Agent Events"}),(0,t.jsx)(tX,{label:"Agent started",id:"notif-event-agentStarted",testId:"switch-event-agentStarted",checked:eA.agentStarted,onChange:e=>{let t={...eA,agentStarted:e};eD(t),C(eX({events:t}))}}),(0,t.jsx)(tX,{label:"Phase completed",id:"notif-event-phaseCompleted",testId:"switch-event-phaseCompleted",checked:eA.phaseCompleted,onChange:e=>{let t={...eA,phaseCompleted:e};eD(t),C(eX({events:t}))}}),(0,t.jsx)(tX,{label:"Waiting approval",id:"notif-event-waitingApproval",testId:"switch-event-waitingApproval",checked:eA.waitingApproval,onChange:e=>{let t={...eA,waitingApproval:e};eD(t),C(eX({events:t}))}}),(0,t.jsx)(tX,{label:"Agent completed",id:"notif-event-agentCompleted",testId:"switch-event-agentCompleted",checked:eA.agentCompleted,onChange:e=>{let t={...eA,agentCompleted:e};eD(t),C(eX({events:t}))}}),(0,t.jsx)(tX,{label:"Agent failed",id:"notif-event-agentFailed",testId:"switch-event-agentFailed",checked:eA.agentFailed,onChange:e=>{let t={...eA,agentFailed:e};eD(t),C(eX({events:t}))}}),(0,t.jsx)(t0,{children:"Pull Request Events"}),(0,t.jsx)(tX,{label:"PR merged",id:"notif-event-prMerged",testId:"switch-event-prMerged",checked:eA.prMerged,onChange:e=>{let t={...eA,prMerged:e};eD(t),C(eX({events:t}))}}),(0,t.jsx)(tX,{label:"PR closed",id:"notif-event-prClosed",testId:"switch-event-prClosed",checked:eA.prClosed,onChange:e=>{let t={...eA,prClosed:e};eD(t),C(eX({events:t}))}}),(0,t.jsx)(tX,{label:"PR checks passed",id:"notif-event-prChecksPassed",testId:"switch-event-prChecksPassed",checked:eA.prChecksPassed,onChange:e=>{let t={...eA,prChecksPassed:e};eD(t),C(eX({events:t}))}}),(0,t.jsx)(tX,{label:"PR checks failed",id:"notif-event-prChecksFailed",testId:"switch-event-prChecksFailed",checked:eA.prChecksFailed,onChange:e=>{let t={...eA,prChecksFailed:e};eD(t),C(eX({events:t}))}})]}),(0,t.jsx)(t1,{links:[{label:"Notification system",href:"https://github.com/shep-ai/cli/blob/main/specs/021-agent-notifications/spec.yaml"}],children:"Three notification channels keep you in the loop: in-app toasts, browser push notifications, and native desktop alerts. 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:p,title:"Feature Flags",description:"Enable or disable experimental features",badge:"Experimental",testId:"feature-flags-settings-section",children:[(0,t.jsx)(tX,{label:"Skills",description:"Enable the skills system for agent capabilities",id:"flag-skills",testId:"switch-flag-skills",checked:eL.skills,onChange:e=>{let t={...eL,skills:e};eF(t),C({featureFlags:t})}}),(0,t.jsx)(tX,{label:"Deployments",description:"Enable environment deployment workflows",id:"flag-envDeploy",testId:"switch-flag-envDeploy",checked:eL.envDeploy,onChange:e=>{let t={...eL,envDeploy:e};eF(t),C({featureFlags:t})}}),(0,t.jsx)(tX,{label:"Debug",description:"Show debug panels and verbose logging",id:"flag-debug",testId:"switch-flag-debug",checked:eL.debug,onChange:e=>{let t={...eL,debug:e};eF(t),C({featureFlags:t})}})]}),(0,t.jsx)(t1,{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:h,title:"Database",description:"Local storage information",testId:"database-settings-section",children:[(0,t.jsx)(tZ,{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)(tZ,{label:"Size",children:(0,t.jsx)("span",{className:"text-muted-foreground text-xs","data-testid":"db-file-size",children:m})})]}),(0,t.jsx)(t1,{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",()=>t2],41952)}]);
@@ -0,0 +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 a=e.i(93752);e.s(["Code",()=>a.default],44229)},87889,e=>{"use strict";let t=(0,e.i(3645).default)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Eye",()=>t],87889)},68304,e=>{"use strict";var t=e.i(20314),a=e.i(79054),i=e.i(91967),r=e.i(22528),s=e.i(51080),n=e.i(85995),o=e.i(87620),l=e.i(66033),d=e.i(36589),c=e.i(13123),u="Tabs",[f,m]=(0,r.createContextScope)(u,[s.createRovingFocusGroupScope]),p=(0,s.createRovingFocusGroupScope)(),[h,b]=f(u),g=a.forwardRef((e,a)=>{let{__scopeTabs:i,value:r,onValueChange:s,defaultValue:n,orientation:f="horizontal",dir:m,activationMode:p="automatic",...b}=e,g=(0,l.useDirection)(m),[x,v]=(0,d.useControllableState)({prop:r,onChange:s,defaultProp:n??"",caller:u});return(0,t.jsx)(h,{scope:i,baseId:(0,c.useId)(),value:x,onValueChange:v,orientation:f,dir:g,activationMode:p,children:(0,t.jsx)(o.Primitive.div,{dir:g,"data-orientation":f,...b,ref:a})})});g.displayName=u;var x="TabsList",v=a.forwardRef((e,a)=>{let{__scopeTabs:i,loop:r=!0,...n}=e,l=b(x,i),d=p(i);return(0,t.jsx)(s.Root,{asChild:!0,...d,orientation:l.orientation,dir:l.dir,loop:r,children:(0,t.jsx)(o.Primitive.div,{role:"tablist","aria-orientation":l.orientation,...n,ref:a})})});v.displayName=x;var y="TabsTrigger",w=a.forwardRef((e,a)=>{let{__scopeTabs:r,value:n,disabled:l=!1,...d}=e,c=b(y,r),u=p(r),f=N(c.baseId,n),m=T(c.baseId,n),h=n===c.value;return(0,t.jsx)(s.Item,{asChild:!0,...u,focusable:!l,active:h,children:(0,t.jsx)(o.Primitive.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":m,"data-state":h?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:f,...d,ref:a,onMouseDown:(0,i.composeEventHandlers)(e.onMouseDown,e=>{l||0!==e.button||!1!==e.ctrlKey?e.preventDefault():c.onValueChange(n)}),onKeyDown:(0,i.composeEventHandlers)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&c.onValueChange(n)}),onFocus:(0,i.composeEventHandlers)(e.onFocus,()=>{let e="manual"!==c.activationMode;h||l||!e||c.onValueChange(n)})})})});w.displayName=y;var j="TabsContent",k=a.forwardRef((e,i)=>{let{__scopeTabs:r,value:s,forceMount:l,children:d,...c}=e,u=b(j,r),f=N(u.baseId,s),m=T(u.baseId,s),p=s===u.value,h=a.useRef(p);return a.useEffect(()=>{let e=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,t.jsx)(n.Presence,{present:l||p,children:({present:a})=>(0,t.jsx)(o.Primitive.div,{"data-state":p?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":f,hidden:!a,id:m,tabIndex:0,...c,ref:i,style:{...e.style,animationDuration:h.current?"0s":void 0},children:a&&d})})});function N(e,t){return`${e}-trigger-${t}`}function T(e,t){return`${e}-content-${t}`}k.displayName=j,e.s(["Content",()=>k,"List",()=>v,"Root",()=>g,"Tabs",()=>g,"TabsContent",()=>k,"TabsList",()=>v,"TabsTrigger",()=>w,"Trigger",()=>w,"createTabsScope",()=>m],43133);var C=e.i(43133),C=C,R=e.i(31777);let D=C.Root,M=a.forwardRef(({className:e,...a},i)=>(0,t.jsx)(C.List,{ref:i,className:(0,R.cn)("bg-muted text-muted-foreground inline-flex h-9 items-center justify-center rounded-lg p-1",e),...a}));M.displayName=C.List.displayName;let I=a.forwardRef(({className:e,...a},i)=>(0,t.jsx)(C.Trigger,{ref:i,className:(0,R.cn)("ring-offset-background focus-visible:ring-ring data-[state=active]:bg-background data-[state=active]:text-foreground inline-flex items-center justify-center rounded-md px-3 py-1 text-sm font-medium whitespace-nowrap transition-all focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow",e),...a}));I.displayName=C.Trigger.displayName;let P=a.forwardRef(({className:e,...a},i)=>(0,t.jsx)(C.Content,{ref:i,className:(0,R.cn)("ring-offset-background focus-visible:ring-ring mt-2 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",e),...a}));P.displayName=C.Content.displayName,e.s(["Tabs",()=>D,"TabsContent",()=>P,"TabsList",()=>M,"TabsTrigger",()=>I],68304)},81181,e=>{"use strict";var t=e.i(95230);e.s(["Download",()=>t.default])},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])},95230,e=>{"use strict";let t=(0,e.i(3645).default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);e.s(["default",()=>t])},16868,48306,80436,28267,86254,50032,42076,e=>{"use strict";var t=e.i(3645);let a=(0,t.default)("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);e.s(["PaperclipIcon",()=>a],16868);var i=e.i(20314),r=e.i(31777);function s({className:e,...t}){return(0,i.jsx)("textarea",{"data-slot":"textarea",className:(0,r.cn)("placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input field-sizing-content min-h-[80px] w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none 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),...t})}e.s(["Textarea",()=>s],48306);var n=e.i(60253),o=e.i(15506),o=o,l=e.i(95230);e.s(["DownloadIcon",()=>l.default],80436);var l=l,d=e.i(2287),c=e.i(1693);e.s(["VisuallyHidden",0,c],28267);var c=c;let u=(0,t.default)("file",[["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"}]]);var f=e.i(16298),f=f;let m=(0,t.default)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);var p=e.i(93752),p=p;e.i(35364);let h=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]),b=new Set([".ts",".tsx",".js",".jsx",".json",".yaml",".yml",".xml",".html",".css",".md"]);function g(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,t)).toFixed(+(0!==t))} ${["B","KB","MB","GB"][t]}`}let x=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]);function v(e,t){let a=new URLSearchParams({path:e,mimeType:t});return`/api/attachments/preview?${a.toString()}`}function y({name:e,size:t,mimeType:a,path:s,onRemove:y,loading:w=!1,disabled:j=!1}){let k,N,T=(k=e.lastIndexOf("."))>=0?e.slice(k).toLowerCase():"",C=h.has(T)?m:".pdf"===T?f.default:b.has(T)?p.default:u,R=".pdf"===T?"bg-red-50 text-red-600":h.has(T)?"bg-blue-50 text-blue-600":b.has(T)?"bg-emerald-50 text-emerald-600":"bg-gray-50 text-gray-600",D=(N=e.lastIndexOf("."))>=0&&x.has(e.slice(N).toLowerCase());return w?(0,i.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-md border",children:(0,i.jsx)(o.default,{className:"text-muted-foreground h-5 w-5 animate-spin"})}):D?(0,i.jsxs)(d.Dialog,{children:[(0,i.jsxs)("div",{className:"group relative",children:[(0,i.jsx)(d.DialogTrigger,{asChild:!0,children:(0,i.jsx)("img",{src:v(s,a),alt:e,title:e,className:"h-12 w-12 cursor-pointer rounded-md border object-cover transition-opacity hover:opacity-80"})}),!j&&(0,i.jsx)("button",{type:"button",onClick:y,className:"absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex","aria-label":`Remove ${e}`,children:(0,i.jsx)(n.X,{className:"h-3 w-3"})})]}),(0,i.jsxs)(d.DialogContent,{className:"max-w-3xl gap-0 overflow-hidden border-0 p-0 [&>button:last-child]:!cursor-pointer [&>button:last-child]:!rounded-full [&>button:last-child]:!bg-black/70 [&>button:last-child]:!p-1.5 [&>button:last-child]:!text-white [&>button:last-child]:!opacity-100 [&>button:last-child]:!shadow-lg [&>button:last-child]:!backdrop-blur-md [&>button:last-child]:hover:!bg-black/90",children:[(0,i.jsx)(c.Root,{children:(0,i.jsxs)(d.DialogTitle,{children:["Preview: ",e]})}),(0,i.jsx)("div",{className:"relative bg-black/90",children:(0,i.jsx)("img",{src:v(s,a),alt:e,className:"h-auto max-h-[70vh] w-full object-contain"})}),(0,i.jsxs)("div",{className:"bg-background flex items-center gap-3 px-4 py-3",children:[(0,i.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,i.jsx)("span",{className:"truncate text-sm font-medium",children:e}),(0,i.jsx)("span",{className:"text-muted-foreground text-xs",children:g(t)})]}),(0,i.jsx)("a",{href:v(s,a),download:e,className:"text-muted-foreground hover:text-foreground shrink-0 cursor-pointer rounded p-1.5 transition-colors","aria-label":`Download ${e}`,children:(0,i.jsx)(l.default,{className:"h-4 w-4"})})]})]})]}):(0,i.jsxs)("div",{className:"group relative flex items-center gap-2 rounded-full border py-1 pr-3 pl-2",children:[(0,i.jsx)("div",{className:(0,r.cn)("flex h-6 w-6 shrink-0 items-center justify-center rounded-full",R),children:(0,i.jsx)(C,{className:"h-3 w-3"})}),(0,i.jsx)("span",{className:"max-w-[120px] truncate text-sm",children:e}),(0,i.jsx)("span",{className:"text-muted-foreground text-xs",children:g(t)}),!j&&(0,i.jsx)("button",{type:"button",onClick:y,className:"absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex","aria-label":`Remove ${e}`,children:(0,i.jsx)(n.X,{className:"h-3 w-3"})})]})}async function w(){let e=await fetch("/api/dialog/pick-files",{method:"POST"});if(!e.ok)throw Error("Failed to open file dialog");let t=await e.json();return t.cancelled?null:t.files}e.s(["AttachmentChip",()=>y],86254),e.s([],50032),e.s(["pickFiles",()=>w],42076)}]);