@shipit-ai/cli 1.164.1 → 1.164.2

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 (177) hide show
  1. package/dist/packages/core/src/infrastructure/services/agents/analyze-repo/analyze-repository-graph.d.ts +1 -1
  2. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-graph.d.ts +1 -1
  3. package/dist/src/presentation/web/components/ui/badge.d.ts +1 -1
  4. package/dist/src/presentation/web/components/ui/button.d.ts +1 -1
  5. package/dist/tsconfig.build.tsbuildinfo +1 -1
  6. package/package.json +1 -1
  7. package/web/.next/BUILD_ID +1 -1
  8. package/web/.next/build-manifest.json +3 -3
  9. package/web/.next/fallback-build-manifest.json +3 -3
  10. package/web/.next/prerender-manifest.json +3 -3
  11. package/web/.next/required-server-files.js +6 -6
  12. package/web/.next/required-server-files.json +6 -6
  13. package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +29 -29
  14. package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -1
  15. package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +1 -1
  16. package/web/.next/server/app/(dashboard)/@drawer/chat/page/server-reference-manifest.json +27 -27
  17. package/web/.next/server/app/(dashboard)/@drawer/chat/page.js.nft.json +1 -1
  18. package/web/.next/server/app/(dashboard)/@drawer/chat/page_client-reference-manifest.js +1 -1
  19. package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +30 -30
  20. package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
  21. package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
  22. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +37 -37
  23. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  24. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  25. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +37 -37
  26. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
  27. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
  28. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +28 -28
  29. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
  30. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
  31. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +28 -28
  32. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
  33. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  34. package/web/.next/server/app/(dashboard)/chat/page/server-reference-manifest.json +27 -27
  35. package/web/.next/server/app/(dashboard)/chat/page.js.nft.json +1 -1
  36. package/web/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
  37. package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +30 -30
  38. package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
  39. package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
  40. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +37 -37
  41. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  42. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  43. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +37 -37
  44. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
  45. package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
  46. package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +27 -27
  47. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  48. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  49. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +28 -28
  50. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
  51. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
  52. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +28 -28
  53. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
  54. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  55. package/web/.next/server/app/_global-error.html +1 -1
  56. package/web/.next/server/app/_global-error.rsc +1 -1
  57. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  58. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  59. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  60. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  61. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  62. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +6 -6
  63. package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  64. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  65. package/web/.next/server/app/settings/page/server-reference-manifest.json +9 -9
  66. package/web/.next/server/app/settings/page.js.nft.json +1 -1
  67. package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  68. package/web/.next/server/app/skills/page/server-reference-manifest.json +11 -11
  69. package/web/.next/server/app/skills/page.js.nft.json +1 -1
  70. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  71. package/web/.next/server/app/tools/page/server-reference-manifest.json +11 -11
  72. package/web/.next/server/app/tools/page.js.nft.json +1 -1
  73. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  74. package/web/.next/server/app/version/page/server-reference-manifest.json +6 -6
  75. package/web/.next/server/app/version/page.js.nft.json +1 -1
  76. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  77. package/web/.next/server/chunks/[root-of-the-server]__0jx0isp._.js +1 -1
  78. package/web/.next/server/chunks/[root-of-the-server]__0jx0isp._.js.map +1 -1
  79. package/web/.next/server/chunks/[root-of-the-server]__0tb~wwk._.js +1 -1
  80. package/web/.next/server/chunks/[root-of-the-server]__0tb~wwk._.js.map +1 -1
  81. package/web/.next/server/chunks/ssr/0j.8_web_components_common_control-center-drawer_create-drawer-client_tsx_0g70fc5._.js +1 -1
  82. package/web/.next/server/chunks/ssr/0j.8_web_components_common_control-center-drawer_create-drawer-client_tsx_0g70fc5._.js.map +1 -1
  83. package/web/.next/server/chunks/ssr/0j.8_web_components_common_control-center-drawer_feature-drawer-client_tsx_104cna.._.js +2 -2
  84. package/web/.next/server/chunks/ssr/0j.8_web_components_common_control-center-drawer_feature-drawer-client_tsx_104cna.._.js.map +1 -1
  85. package/web/.next/server/chunks/ssr/0ukq_presentation_web_components_features_settings_settings-page-client_tsx_0j1uius._.js +1 -1
  86. package/web/.next/server/chunks/ssr/0ukq_presentation_web_components_features_settings_settings-page-client_tsx_0j1uius._.js.map +1 -1
  87. package/web/.next/server/chunks/ssr/11y9_components_common_control-center-drawer_repository-drawer-client_tsx_09z.znp._.js +1 -1
  88. package/web/.next/server/chunks/ssr/11y9_components_common_control-center-drawer_repository-drawer-client_tsx_09z.znp._.js.map +1 -1
  89. package/web/.next/server/chunks/ssr/[root-of-the-server]__0.j0ktf._.js +1 -1
  90. package/web/.next/server/chunks/ssr/[root-of-the-server]__0.j0ktf._.js.map +1 -1
  91. package/web/.next/server/chunks/ssr/[root-of-the-server]__07m44ax._.js +1 -1
  92. package/web/.next/server/chunks/ssr/[root-of-the-server]__07m44ax._.js.map +1 -1
  93. package/web/.next/server/chunks/ssr/[root-of-the-server]__0frgz11._.js +1 -1
  94. package/web/.next/server/chunks/ssr/[root-of-the-server]__0frgz11._.js.map +1 -1
  95. package/web/.next/server/chunks/ssr/[root-of-the-server]__0oi7r67._.js +1 -1
  96. package/web/.next/server/chunks/ssr/[root-of-the-server]__0pti1a3._.js +1 -1
  97. package/web/.next/server/chunks/ssr/[root-of-the-server]__0pti1a3._.js.map +1 -1
  98. package/web/.next/server/chunks/ssr/[root-of-the-server]__0rv1gci._.js +1 -1
  99. package/web/.next/server/chunks/ssr/[root-of-the-server]__0s9k_s3._.js +1 -1
  100. package/web/.next/server/chunks/ssr/[root-of-the-server]__0s9k_s3._.js.map +1 -1
  101. package/web/.next/server/chunks/ssr/[root-of-the-server]__0v-vmgt._.js +1 -1
  102. package/web/.next/server/chunks/ssr/[root-of-the-server]__0v-vmgt._.js.map +1 -1
  103. package/web/.next/server/chunks/ssr/[root-of-the-server]__0yky~xo._.js +1 -1
  104. package/web/.next/server/chunks/ssr/[root-of-the-server]__0yky~xo._.js.map +1 -1
  105. package/web/.next/server/chunks/ssr/[root-of-the-server]__11dc42t._.js +1 -1
  106. package/web/.next/server/chunks/ssr/[root-of-the-server]__11dc42t._.js.map +1 -1
  107. package/web/.next/server/chunks/ssr/{_0aakgii._.js → _05h68we._.js} +2 -2
  108. package/web/.next/server/chunks/ssr/{_0aakgii._.js.map → _05h68we._.js.map} +1 -1
  109. package/web/.next/server/chunks/ssr/_0__4si~._.js +1 -1
  110. package/web/.next/server/chunks/ssr/_0__4si~._.js.map +1 -1
  111. package/web/.next/server/chunks/ssr/_0_m17kl._.js +1 -1
  112. package/web/.next/server/chunks/ssr/_0_m17kl._.js.map +1 -1
  113. package/web/.next/server/chunks/ssr/_0aa~oer._.js +1 -1
  114. package/web/.next/server/chunks/ssr/_0d4miu.._.js +1 -1
  115. package/web/.next/server/chunks/ssr/_0d4miu.._.js.map +1 -1
  116. package/web/.next/server/chunks/ssr/_0e8ern9._.js +1 -1
  117. package/web/.next/server/chunks/ssr/_0e8ern9._.js.map +1 -1
  118. package/web/.next/server/chunks/ssr/_0ez.1o4._.js +1 -1
  119. package/web/.next/server/chunks/ssr/_0ez.1o4._.js.map +1 -1
  120. package/web/.next/server/chunks/ssr/_0hovej-._.js +2 -2
  121. package/web/.next/server/chunks/ssr/_0hovej-._.js.map +1 -1
  122. package/web/.next/server/chunks/ssr/_0p3zs6p._.js +1 -1
  123. package/web/.next/server/chunks/ssr/_0p3zs6p._.js.map +1 -1
  124. package/web/.next/server/chunks/ssr/_0r.3n~3._.js +1 -1
  125. package/web/.next/server/chunks/ssr/_0r.3n~3._.js.map +1 -1
  126. package/web/.next/server/chunks/ssr/_0sgeiju._.js +1 -1
  127. package/web/.next/server/chunks/ssr/_0sgeiju._.js.map +1 -1
  128. package/web/.next/server/chunks/ssr/_0t59q8r._.js +1 -1
  129. package/web/.next/server/chunks/ssr/_0t59q8r._.js.map +1 -1
  130. package/web/.next/server/chunks/ssr/{_133.z2f._.js → _0ts70ov._.js} +2 -2
  131. package/web/.next/server/chunks/ssr/{_133.z2f._.js.map → _0ts70ov._.js.map} +1 -1
  132. package/web/.next/server/chunks/ssr/_0v.yfmg._.js +1 -1
  133. package/web/.next/server/chunks/ssr/_0v.yfmg._.js.map +1 -1
  134. package/web/.next/server/chunks/ssr/_0w-_hww._.js +1 -1
  135. package/web/.next/server/chunks/ssr/_0w-_hww._.js.map +1 -1
  136. package/web/.next/server/chunks/ssr/_0zk-h5w._.js +1 -1
  137. package/web/.next/server/chunks/ssr/_0zk-h5w._.js.map +1 -1
  138. package/web/.next/server/chunks/ssr/_0~ev6dw._.js +2 -2
  139. package/web/.next/server/chunks/ssr/_0~ev6dw._.js.map +1 -1
  140. package/web/.next/server/chunks/ssr/_1161g9x._.js +1 -1
  141. package/web/.next/server/chunks/ssr/_1161g9x._.js.map +1 -1
  142. package/web/.next/server/chunks/ssr/_11kuznh._.js +1 -1
  143. package/web/.next/server/chunks/ssr/_11kuznh._.js.map +1 -1
  144. package/web/.next/server/chunks/ssr/_13e1_1b._.js +3 -0
  145. package/web/.next/server/chunks/ssr/{_0427j6p._.js.map → _13e1_1b._.js.map} +1 -1
  146. package/web/.next/server/chunks/ssr/src_presentation_web_0y11iiz._.js +1 -1
  147. package/web/.next/server/chunks/ssr/src_presentation_web_0y11iiz._.js.map +1 -1
  148. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_05m2q~u.js +1 -1
  149. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_05m2q~u.js.map +1 -1
  150. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_0.6zk.t.js +1 -1
  151. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_0.6zk.t.js.map +1 -1
  152. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_0w2wqvu._.js +1 -1
  153. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_0l3oxx9._.js +1 -1
  154. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_0l3oxx9._.js.map +1 -1
  155. package/web/.next/server/middleware/middleware-manifest.json +5 -5
  156. package/web/.next/server/middleware-build-manifest.js +3 -3
  157. package/web/.next/server/middleware-manifest.json +5 -5
  158. package/web/.next/server/pages/500.html +1 -1
  159. package/web/.next/server/server-reference-manifest.js +1 -1
  160. package/web/.next/server/server-reference-manifest.json +47 -47
  161. package/web/.next/static/chunks/{0qm-9ipi3co.d.js → 0.2owry_sk_ak.js} +1 -1
  162. package/web/.next/static/chunks/{0ureecfb3sk03.js → 01~tm1-qp0baa.js} +1 -1
  163. package/web/.next/static/chunks/{0si_11yihc0-l.js → 0_9hv9_f66hur.js} +1 -1
  164. package/web/.next/static/chunks/{0~io7k480nets.js → 0g-so1fagegtp.js} +1 -1
  165. package/web/.next/static/chunks/{09a1uo.4xdik3.js → 0in40lx7y7f8o.js} +1 -1
  166. package/web/.next/static/chunks/{0fc4~7_n~k~-y.js → 0qz02~wj25f-f.js} +1 -1
  167. package/web/.next/static/chunks/{0f698k1fycef7.js → 0rv6fo9ui94r9.js} +1 -1
  168. package/web/.next/static/chunks/{0yj1o1qkqnea0.js → 0t82zfhqgor5r.js} +1 -1
  169. package/web/.next/static/chunks/{0~d8qka._ncpd.js → 0whetjaoa5y.l.js} +2 -2
  170. package/web/.next/static/chunks/{0_5~ye5oqkvog.js → 0xs4~af3nc_15.js} +1 -1
  171. package/web/.next/static/chunks/{0dx9n.g50tq3h.js → 122mzkbtrj4-k.js} +2 -2
  172. package/web/.next/static/chunks/{0bkt5slti~l1x.js → 12pwrbjphv3z7.js} +1 -1
  173. package/web/.next/static/chunks/{0.ot~ed_rh0ui.js → 17jsatqy81xc..js} +2 -2
  174. package/web/.next/server/chunks/ssr/_0427j6p._.js +0 -3
  175. /package/web/.next/static/{ZJku-LesX1icuSm9WAIO0 → CJ4Fr1ggL4xWEe_fapYLv}/_buildManifest.js +0 -0
  176. /package/web/.next/static/{ZJku-LesX1icuSm9WAIO0 → CJ4Fr1ggL4xWEe_fapYLv}/_clientMiddlewareManifest.js +0 -0
  177. /package/web/.next/static/{ZJku-LesX1icuSm9WAIO0 → CJ4Fr1ggL4xWEe_fapYLv}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,15203,e=>{"use strict";var t=e.i(96871),r=e.i(16539),a=e.i(33109),s=e.i(60112),i=e.i(96976);let o=(0,i.createServerReference)("400cbf4d7dd921e69b088bbea9e93a24ce3bbaf66b",i.callServer,void 0,i.findSourceMapURL,"createFeature");e.i(98026);var n=e.i(50728);e.i(1650);var l=e.i(11495),c=e.i(45811),d=e.i(35364),p=e.i(41957),h=e.i(81846),u=e.i(2828),m=e.i(8361),x=e.i(30153);let f=(0,i.createServerReference)("40df728644f07c8ebf5e6ef2dd505e4415f93a85a0",i.callServer,void 0,i.findSourceMapURL,"getViewerPermission");var g=e.i(42076);let b=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"]),j={allowPrd:!1,allowPlan:!1,allowMerge:!1};var v=e.i(16868),w=e.i(53360),C=e.i(55016),y=e.i(31777),D=e.i(48306),N=e.i(51911);e.i(50032);var k=e.i(86254),P=e.i(9749);function T({description:e,onDescriptionChange:a,attachments:s,onRemoveFile:i,onNotesChange:o,onPaste:l,onDragEnter:c,onDragLeave:d,onDragOver:h,onDrop:m,onAddFiles:x,isDragOver:f,uploadError:g,isPromptFocused:b,onPromptFocus:j,onPromptBlur:S,fast:F,onFastChange:E,pending:R,onPendingChange:L,overrideAgent:A,overrideModel:M,currentAgentType:O,currentModel:I,onAgentModelChange:z,isSubmitting:U}){let{t:B}=(0,n.useTranslation)("web"),G=(0,r.useRef)(null);return(0,t.jsxs)("div",{role:"region","aria-label":B("createDrawer.fileDropZone"),"data-drag-over":f?"true":"false",onDragEnter:c,onDragLeave:d,onDragOver:h,onDrop:m,className:(0,y.cn)("flex flex-col gap-1.5 rounded-md border-2 border-transparent p-1 transition-colors",f&&"border-primary/50 bg-primary/5"),children:[(0,t.jsx)(p.Label,{htmlFor:"feature-description",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:B("createDrawer.describeFeature")}),(0,t.jsxs)("div",{ref:G,onFocus:j,onBlur:()=>{setTimeout(()=>{let e=G.current?.contains(document.activeElement),t=G.current?.querySelector('[aria-expanded="true"]')!==null;e||t||S()},0)},className:(0,y.cn)("border-input flex h-56 flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow]",b&&"ring-ring/50 border-ring ring-[3px]"),children:[(0,t.jsx)(D.Textarea,{id:"feature-description",placeholder:B("createDrawer.featurePlaceholder"),value:e,onChange:e=>a(e.target.value),onPaste:l,required:!0,disabled:U,"aria-invalid":!!g,"aria-describedby":g?"feature-upload-error":void 0,className:"min-h-0 flex-1 resize-none rounded-none border-0 shadow-none focus-visible:ring-0"}),s.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:s.map(e=>(0,t.jsx)(k.AttachmentChip,{name:e.name,size:e.size,mimeType:e.mimeType,path:e.path,onRemove:()=>i(e.id),disabled:U,loading:e.loading,notes:e.notes,onNotesChange:t=>o(e.id,t)},e.id))}),g?(0,t.jsx)("p",{id:"feature-upload-error",className:"text-destructive px-3 pb-2 text-xs",role:"alert",children:g}):null,(0,t.jsxs)("div",{className:"border-input flex items-center gap-3 border-t px-3 py-1.5",children:[(0,t.jsx)(P.AgentModelPicker,{initialAgentType:A??O??"claude-code",initialModel:M??I??"claude-sonnet-4-6",mode:"override",onAgentModelChange:z,disabled:U,className:"w-55"}),(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"ml-auto flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(N.Switch,{id:"pending-mode",checked:R,onCheckedChange:L,disabled:U}),(0,t.jsxs)(p.Label,{htmlFor:"pending-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,t.jsx)(C.Clock,{className:"h-3.5 w-3.5"}),B("createDrawer.pendingMode")]})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:B("createDrawer.pendingModeDescription")})]}),(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(N.Switch,{id:"fast-mode",checked:F,onCheckedChange:E,disabled:U}),(0,t.jsxs)(p.Label,{htmlFor:"fast-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,t.jsx)(w.Zap,{className:"h-3.5 w-3.5"}),B("createDrawer.fastModeLabel")]})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:B("createDrawer.fastModeDescription")})]}),(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:x,disabled:U,"aria-label":B("chat.attachFiles"),className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,t.jsx)(v.PaperclipIcon,{className:"h-4 w-4"})})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:B("chat.attachFiles")})]})]})]})]})}var S=e.i(81542),F=e.i(70471),E=e.i(43416);let R=["allowPrd","allowPlan","allowMerge"];function L({approvalGates:e,onApprovalGatesChange:r,enableEvidence:a,onEnableEvidenceChange:s,commitEvidence:i,onCommitEvidenceChange:o,push:l,onPushChange:c,openPr:d,onOpenPrChange:h,ciWatchEnabled:m,onCiWatchChange:x,rebaseBeforeBranch:f,onRebaseBeforeBranchChange:g,commitSpecs:b,onCommitSpecsChange:j,forkAndPr:v,onForkAndPrChange:w,canPush:C,fast:D,computedPush:k,computedOpenPr:P,isSubmitting:T}){let{t:A}=(0,n.useTranslation)("web"),M=[{id:"allowPrd",label:A("createDrawer.prd"),description:A("createDrawer.prdDescription")},{id:"allowPlan",label:A("createDrawer.plan"),description:A("createDrawer.planDescription")},{id:"allowMerge",label:A("createDrawer.merge"),description:A("createDrawer.mergeDescription")}];return(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)(u.Tooltip,{children:[(0,t.jsx)(u.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:A("createDrawer.approve")})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:A("createDrawer.approveDescription")})]}),(0,t.jsx)("div",{className:"flex flex-1 items-center gap-4",children:M.map(a=>(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:`approve-${a.id}`,size:"sm",checked:e[a.id]??!1,onCheckedChange:t=>r({...e,[a.id]:t}),disabled:T||D&&("allowPrd"===a.id||"allowPlan"===a.id)}),(0,t.jsx)(p.Label,{htmlFor:`approve-${a.id}`,className:"cursor-pointer text-xs font-medium",children:a.label})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:D&&("allowPrd"===a.id||"allowPlan"===a.id)?A("createDrawer.skippedInFastMode"):a.description})]},a.id))}),(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:()=>{let t=R.every(t=>e[t]),a={};for(let e of R)a[e]=!t;r(a)},disabled:T,className:(0,y.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",R.every(t=>e[t])&&"text-primary"),children:A("createDrawer.all")})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:A("createDrawer.toggleAllApprovalGates")})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.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:A("createDrawer.evidence")})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:A("createDrawer.evidenceDescription")})]}),(0,t.jsxs)("div",{className:"flex flex-1 items-center gap-4",children:[(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"enable-evidence",size:"sm",checked:a,onCheckedChange:e=>{s(e),e||o(!1)},disabled:T}),(0,t.jsx)(p.Label,{htmlFor:"enable-evidence",className:"cursor-pointer text-xs font-medium",children:A("createDrawer.collect")})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:A("createDrawer.collectDescription")})]}),(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"commit-evidence",size:"sm",checked:i,onCheckedChange:o,disabled:T||!a||!d&&!v}),(0,t.jsx)(p.Label,{htmlFor:"commit-evidence",className:(0,y.cn)("cursor-pointer text-xs font-medium",(!a||!d&&!v)&&"opacity-50"),children:A("createDrawer.addToPr")})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:d||v?a?A("createDrawer.addToPrDescription"):A("createDrawer.requiresEvidence"):A("createDrawer.requiresPr")})]})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-start gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 pt-0.5 text-xs font-semibold tracking-wider",children:A("createDrawer.git")}),(0,t.jsxs)("div",{className:"flex flex-1 flex-wrap items-center gap-4",children:[(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"push",size:"sm",checked:k,onCheckedChange:e=>{c(e),!e&&d&&h(!1)},disabled:T||v}),(0,t.jsx)(p.Label,{htmlFor:"push",className:(0,y.cn)("cursor-pointer text-xs font-medium",v&&"opacity-50"),children:A("createDrawer.push")})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:v?"Enabled — contributing to upstream":A("createDrawer.pushDescription")})]}),(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"open-pr",size:"sm",checked:P,onCheckedChange:e=>{h(e),e||o(!1)},disabled:T||v}),(0,t.jsx)(p.Label,{htmlFor:"open-pr",className:(0,y.cn)("cursor-pointer text-xs font-medium",v&&"opacity-50"),children:A("createDrawer.pr")})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:v?"Enabled — contributing to upstream":A("createDrawer.prDescription")})]}),(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"ci-watch",size:"sm",checked:m,onCheckedChange:x,disabled:T}),(0,t.jsx)(p.Label,{htmlFor:"ci-watch",className:"cursor-pointer text-xs font-medium",children:A("createDrawer.watch")})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:A("createDrawer.watchDescription")})]}),(0,t.jsx)("div",{className:"bg-border h-4 w-px shrink-0"}),(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"rebase-before-branch",size:"sm",checked:f,onCheckedChange:g,disabled:T}),(0,t.jsxs)(p.Label,{htmlFor:"rebase-before-branch",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(E.RefreshCw,{className:"h-3 w-3"}),A("createDrawer.sync")]})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:A("createDrawer.syncDescription")})]}),(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"commit-specs",size:"sm",checked:b,onCheckedChange:j,disabled:T}),(0,t.jsxs)(p.Label,{htmlFor:"commit-specs",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(F.FileText,{className:"h-3 w-3"}),A("createDrawer.commitSpecs")]})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:A("createDrawer.commitSpecsDescription")})]}),!C&&(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"fork-and-pr",size:"sm",checked:v,onCheckedChange:e=>{w(e),e&&j(!1)},disabled:T}),(0,t.jsxs)(p.Label,{htmlFor:"fork-and-pr",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(S.GitFork,{className:"h-3 w-3"}),A("createDrawer.forkAndPr")]})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:A("createDrawer.forkAndPrDescription")})]})]})]})]})}var A=e.i(83843),M=e.i(97667),O=e.i(98127),I=e.i(90382);function z({features:e,value:a,onChange:s,disabled:i}){let{t:o}=(0,n.useTranslation)("web"),[l,c]=(0,r.useState)(!1),[d,p]=(0,r.useState)(""),h=(0,r.useRef)(null),u=e.find(e=>e.id===a),m=d.trim()?e.filter(e=>e.name.toLowerCase().includes(d.toLowerCase())||e.id.toLowerCase().includes(d.toLowerCase())):e,x=(0,r.useCallback)(e=>{s(e),c(!1),p("")},[s]);return(0,r.useEffect)(()=>{l?setTimeout(()=>h.current?.focus(),0):p("")},[l]),(0,t.jsxs)(I.Popover,{open:l,onOpenChange:c,children:[(0,t.jsx)(I.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{id:"parent-feature",type:"button",role:"combobox","aria-expanded":l,"aria-label":"Parent Feature",disabled:i,"data-testid":"parent-feature-combobox",className:(0,y.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",!u&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:u?`${u.name} (${u.id.slice(0,8)})`:o("createDrawer.selectParent")}),(0,t.jsx)(A.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(I.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)(O.Input,{ref:h,placeholder:o("createDrawer.searchFeatures"),value:d,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:()=>x(void 0),className:(0,y.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)(M.CheckIcon,{className:(0,y.cn)("h-4 w-4 shrink-0",void 0!==a&&"invisible")}),(0,t.jsx)("span",{className:"text-muted-foreground italic",children:o("createDrawer.noParent")})]}),0===m.length&&d?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:o("createDrawer.noFeaturesFound")}):m.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":a===e.id,onClick:()=>x(e.id),className:(0,y.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)(M.CheckIcon,{className:(0,y.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))]})]})})]})}var U=e.i(91925),B=e.i(83428),G=e.i(25235),W=e.i(75921),$=e.i(31696),q=e.i(78521);e.i(13322);var K=e.i(61201);function Z({repositories:e,value:a,onChange:s,onAddRepository:i,disabled:o}){let[l,c]=(0,r.useState)(!1),[d,p]=(0,r.useState)(""),[h,u]=(0,r.useState)(!1),[m,x]=(0,r.useState)(null),[f,g]=(0,r.useState)(!1),b=(0,r.useRef)(null),{reactFileManager:j}=(0,W.useFeatureFlags)(),{t:v}=(0,n.useTranslation)("web"),w=e.find(e=>e.path===a),C=d.trim()?e.filter(e=>e.name.toLowerCase().includes(d.toLowerCase())||e.path.toLowerCase().includes(d.toLowerCase())):e,D=(0,r.useCallback)(e=>{s(e),c(!1),p("")},[s]),N=(0,r.useCallback)(async e=>{let t=await (0,$.addRepository)({path:e});if(t.error){x(t.error),u(!1);return}if(t.repository){let e={id:t.repository.id,name:t.repository.name,path:t.repository.path};i?.(e),s(e.path),c(!1),p("")}},[i,s]),k=(0,r.useCallback)(async()=>{if(!h){if(j)return void g(!0);u(!0),x(null);try{let e=await (0,q.pickFolder)();if(!e)return void u(!1);await N(e)}catch{g(!0)}finally{u(!1)}}},[h,j,N]),P=(0,r.useCallback)(async e=>{if(g(!1),e){u(!0),x(null);try{await N(e)}catch(e){x(e instanceof Error?e.message:"Failed to add repository")}finally{u(!1)}}},[N]);return(0,r.useEffect)(()=>{l?setTimeout(()=>b.current?.focus(),0):p("")},[l]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(I.Popover,{open:l,onOpenChange:c,children:[(0,t.jsx)(I.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"button",role:"combobox","aria-expanded":l,"aria-label":"Repository","aria-invalid":!!m,"aria-describedby":m?"add-repository-error-msg":void 0,disabled:o,"data-testid":"repository-combobox",className:(0,y.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",!w&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:w?w.name:"Select repository..."}),(0,t.jsx)(A.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(I.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)(O.Input,{ref:b,placeholder:v("createDrawer.searchRepositories"),value:d,onChange:e=>p(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===C.length?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm","data-testid":"repository-empty",children:"No repositories found."}):C.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":a===e.path,onClick:()=>D(e.path),className:(0,y.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)(M.CheckIcon,{className:(0,y.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)(G.Separator,{}),(0,t.jsxs)("button",{type:"button",onClick:k,disabled:h,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:[h?(0,t.jsx)(B.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..."})]}),m?(0,t.jsx)("p",{id:"add-repository-error-msg",className:"px-3 pb-2 text-xs text-red-500",role:"alert","data-testid":"add-repository-error",children:m}):null]})})]}),(0,t.jsx)(K.ReactFileManagerDialog,{open:f,onOpenChange:e=>{e||g(!1)},onSelect:P})]})}function J({open:e,onClose:a,onSubmit:s,repositoryPath:i,isSubmitting:o=!1,workflowDefaults:v,features:w,repositories:C,initialParentId:y,currentAgentType:D,currentModel:N,initialDescription:k,canPushDirectly:P}){let{t:S}=(0,n.useTranslation)("web"),F=function({open:e,onClose:t,onSubmit:a,repositoryPath:s,workflowDefaults:i,repositories:o,initialParentId:n,currentAgentType:l,currentModel:c,initialDescription:d,canPushDirectly:p}){let h=(0,m.useSoundAction)("create"),u=s&&(!o||0===o.length||o.some(e=>e.path===s))?s:"",v=i?.approvalGates??j,w=i?.push??!1,C=i?.openPr??!1,y=i?.ciWatchEnabled!==!1,D=i?.enableEvidence??!1,N=i?.commitEvidence??!1,k=i?.fast!==!1,[P,T]=(0,r.useState)(d??"");(0,r.useEffect)(()=>{d&&T(d)},[d]);let[S,F]=(0,r.useState)([]),[E,R]=(0,r.useState)({...v}),[L,A]=(0,r.useState)(w),[M,O]=(0,r.useState)(C),[I,z]=(0,r.useState)(i?.ciWatchEnabled!==!1),[U,B]=(0,r.useState)(D),[G,W]=(0,r.useState)(N),[$,q]=(0,r.useState)(void 0),[K,Z]=(0,r.useState)(k),[J,V]=(0,r.useState)(!1),[H,Q]=(0,r.useState)(!1),[X,Y]=(0,r.useState)(!0),[_,ee]=(0,r.useState)(!0),[et,er]=(0,r.useState)(void 0),[ea,es]=(0,r.useState)(void 0),[ei,eo]=(0,r.useState)(u||void 0),[en,el]=(0,r.useState)(o??[]),[ec,ed]=(0,r.useState)(!1),[ep,eh]=(0,r.useState)(null),[eu,em]=(0,r.useState)(!1),ex=(0,r.useRef)(crypto.randomUUID()),ef=(0,r.useRef)(0);(0,r.useEffect)(()=>{i&&(R({...i.approvalGates}),A(i.push),O(i.openPr),z(!1!==i.ciWatchEnabled),B(i.enableEvidence),W(i.commitEvidence),Z(!1!==i.fast))},[i]),(0,r.useEffect)(()=>{el(o??[])},[o]),(0,r.useEffect)(()=>{e&&n&&q(n)},[e,n]);let[eg,eb]=(0,r.useState)(p??!1);(0,r.useEffect)(()=>{eb(p??!1)},[p]);let ej=(0,r.useRef)(ei);(0,r.useEffect)(()=>{ei&&ei!==ej.current&&(ej.current=ei,f(ei).then(e=>eb(e.canPushDirectly)).catch(()=>eb(!1)))},[ei]),(0,r.useEffect)(()=>{eg&&(Q(!1),A(w),O(C),Y(!0))},[eg,w,C]);let ev=(0,r.useCallback)(()=>{T(""),F([]),R({...v}),A(w),O(C),z(y),B(D),W(N),q(void 0),eo(u||void 0),el(o??[]),Z(k),V(!1),Q(!1),Y(!0),ee(!0),er(void 0),es(void 0),eh(null),ef.current=0,ed(!1)},[v,w,C,D,y,N,k,u,o]),ew=""!==P.trim()||S.length>0,{attemptClose:eC}=(0,x.useGuardedDrawerClose)({open:e,isDirty:ew,onClose:t,onReset:ev}),ey=(0,r.useCallback)(async e=>{for(let t of(eh(null),e)){if(t.size>0xa00000)return void eh(`"${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&&!b.has(e))return void eh(`File type "${e}" is not allowed`)}for(let t of e){let e=crypto.randomUUID();F(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",ex.current);let a=await fetch("/api/attachments/upload",{method:"POST",body:r});if(!a.ok){let t=await a.json().catch(()=>({error:"Upload failed"}));F(t=>t.filter(t=>t.id!==e)),eh(t.error??"Upload failed");return}let s=await a.json();F(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{F(t=>t.filter(t=>t.id!==e)),eh("Upload failed")}}},[]),eD=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),ef.current+=1,1===ef.current&&ed(!0)},[]),eN=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),ef.current-=1,0===ef.current&&ed(!1)},[]),ek=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),eP=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),ef.current=0,ed(!1);let t=Array.from(e.dataTransfer.files);t.length>0&&ey(t)},[ey]),eT=(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(),ey(r))},[ey]),eS=(0,r.useCallback)(e=>{if(e.preventDefault(),!P.trim())return;let t=ei??u;t&&(h.play(),a({description:P.trim(),attachments:S.filter(e=>!e.loading),repositoryPath:t,approvalGates:{allowPrd:E.allowPrd??!1,allowPlan:E.allowPlan??!1,allowMerge:E.allowMerge??!1},push:!!H||L||M,openPr:!!H||M,ciWatchEnabled:I,enableEvidence:U,commitEvidence:G,fast:K,forkAndPr:H,commitSpecs:X,rebaseBeforeBranch:_,...J?{pending:J}:{},...et?{agentType:et}:{},...ea?{model:ea}:{},...$?{parentId:$}:{},sessionId:ex.current}),ev())},[P,S,E,ei,u,a,L,M,U,I,G,K,H,X,_,J,et,ea,$,h,ev]),eF=(0,r.useCallback)(async()=>{try{let e=await (0,g.pickFiles)();if(!e)return;for(let t of e){let e=crypto.randomUUID();F(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:ex.current})});if(!r.ok){let t=await r.json().catch(()=>({error:"Upload failed"}));F(t=>t.filter(t=>t.id!==e)),eh(t.error??"Upload failed");return}let a=await r.json();F(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{F(t=>t.filter(t=>t.id!==e)),eh("Upload failed")}}}catch{}},[]),eE=(0,r.useCallback)(e=>{F(t=>t.filter(t=>t.id!==e))},[]),eR=(0,r.useCallback)((e,t)=>{F(r=>r.map(r=>r.id===e?{...r,notes:t}:r))},[]);return{validRepoPath:u,canPush:eg,isDirty:ew,computedPush:!!H||L||M,computedOpenPr:!!H||M,description:P,setDescription:T,attachments:S,approvalGates:E,setApprovalGates:R,push:L,setPush:A,openPr:M,setOpenPr:O,ciWatchEnabled:I,setCiWatchEnabled:z,enableEvidence:U,setEnableEvidence:B,commitEvidence:G,setCommitEvidence:W,parentId:$,setParentId:q,fast:K,setFast:Z,pending:J,setPending:V,forkAndPr:H,setForkAndPr:Q,commitSpecs:X,setCommitSpecs:Y,rebaseBeforeBranch:_,setRebaseBeforeBranch:ee,overrideAgent:et,setOverrideAgent:er,overrideModel:ea,setOverrideModel:es,selectedRepoPath:ei,setSelectedRepoPath:eo,localRepos:en,setLocalRepos:el,isDragOver:ec,uploadError:ep,isPromptFocused:eu,setIsPromptFocused:em,sessionIdRef:ex,currentAgentType:l,currentModel:c,attemptClose:eC,handleFiles:ey,handleDragEnter:eD,handleDragLeave:eN,handleDragOver:ek,handleDrop:eP,handlePaste:eT,handleSubmit:eS,handleAddFiles:eF,handleRemoveFile:eE,handleNotesChange:eR,resetForm:ev}}({open:e,onClose:a,onSubmit:s,repositoryPath:i,workflowDefaults:v,repositories:C,initialParentId:y,currentAgentType:D,currentModel:N,initialDescription:k,canPushDirectly:P}),E=(0,r.useRef)(null),R=(0,r.useCallback)(e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),E.current?.requestSubmit())},[]),A=w&&w.length>0,M=!F.validRepoPath&&void 0!==C,O=!F.validRepoPath&&!F.selectedRepoPath;return(0,t.jsx)(l.BaseDrawer,{open:e,onClose:F.attemptClose,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)(c.DrawerTitle,{children:S("createDrawer.title")})]}),o?(0,t.jsx)(c.DrawerDescription,{asChild:!0,children:(0,t.jsx)("div",{children:(0,t.jsx)(h.Badge,{variant:"secondary",children:S("createDrawer.creating")})})}):null]}),footer:(0,t.jsxs)("div",{className:"flex flex-row justify-end gap-2",children:[(0,t.jsx)(d.Button,{variant:"outline",onClick:F.attemptClose,disabled:o,children:S("createDrawer.cancel")}),(0,t.jsx)(d.Button,{type:"submit",form:"create-feature-form",disabled:!F.description.trim()||o||O,children:S(o?"createDrawer.creating":"createDrawer.createFeature")})]}),children:(0,t.jsx)("div",{className:"overflow-y-auto p-4",children:(0,t.jsx)(u.TooltipProvider,{delayDuration:400,children:(0,t.jsxs)("form",{ref:E,id:"create-feature-form",onSubmit:F.handleSubmit,onKeyDown:R,className:"flex flex-col gap-4",children:[M?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-selector-section",children:[(0,t.jsx)(p.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:S("createDrawer.repository")}),(0,t.jsx)(Z,{repositories:F.localRepos,value:F.selectedRepoPath,onChange:F.setSelectedRepoPath,onAddRepository:e=>{F.setLocalRepos(t=>[...t,e]),F.setSelectedRepoPath(e.path)},disabled:o})]}):F.validRepoPath?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-readonly-section",children:[(0,t.jsx)(p.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:S("createDrawer.repository")}),(0,t.jsx)("p",{className:"text-sm","data-testid":"repo-readonly-label",children:C?.find(e=>e.path===F.validRepoPath)?.name??F.validRepoPath.split("/").pop()})]}):null,(0,t.jsx)(T,{description:F.description,onDescriptionChange:F.setDescription,attachments:F.attachments,onRemoveFile:F.handleRemoveFile,onNotesChange:F.handleNotesChange,onPaste:F.handlePaste,onDragEnter:F.handleDragEnter,onDragLeave:F.handleDragLeave,onDragOver:F.handleDragOver,onDrop:F.handleDrop,onAddFiles:F.handleAddFiles,isDragOver:F.isDragOver,uploadError:F.uploadError,isPromptFocused:F.isPromptFocused,onPromptFocus:()=>F.setIsPromptFocused(!0),onPromptBlur:()=>F.setIsPromptFocused(!1),fast:F.fast,onFastChange:F.setFast,pending:F.pending,onPendingChange:F.setPending,overrideAgent:F.overrideAgent,overrideModel:F.overrideModel,currentAgentType:D,currentModel:N,onAgentModelChange:(e,t)=>{F.setOverrideAgent(e),F.setOverrideModel(t)},isSubmitting:o}),A&&void 0!==y?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(p.Label,{htmlFor:"parent-feature",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:S("createDrawer.parentFeature")}),(0,t.jsx)(z,{features:w,value:F.parentId,onChange:F.setParentId,disabled:o})]}):null,(0,t.jsx)(L,{approvalGates:F.approvalGates,onApprovalGatesChange:F.setApprovalGates,enableEvidence:F.enableEvidence,onEnableEvidenceChange:F.setEnableEvidence,commitEvidence:F.commitEvidence,onCommitEvidenceChange:F.setCommitEvidence,push:F.push,onPushChange:F.setPush,openPr:F.openPr,onOpenPrChange:F.setOpenPr,ciWatchEnabled:F.ciWatchEnabled,onCiWatchChange:F.setCiWatchEnabled,rebaseBeforeBranch:F.rebaseBeforeBranch,onRebaseBeforeBranchChange:F.setRebaseBeforeBranch,commitSpecs:F.commitSpecs,onCommitSpecsChange:F.setCommitSpecs,forkAndPr:F.forkAndPr,onForkAndPrChange:F.setForkAndPr,canPush:F.canPush,fast:F.fast,computedPush:F.computedPush,computedOpenPr:F.computedOpenPr,isSubmitting:o})]})})})})}e.s(["CreateDrawerClient",0,function({repositoryPath:e,initialParentId:i,initialDescription:n,features:l,repositories:c,workflowDefaults:d,currentAgentType:p,currentModel:h,canPushDirectly:u}){let m=(0,a.useRouter)(),[x,f]=(0,r.useState)(!1),g=(0,a.usePathname)().startsWith("/create"),b=!x&&g;(0,r.useEffect)(()=>{!g&&x&&f(!1)},[g,x]);let j=(0,r.useCallback)(()=>{m.push("/")},[m]),v=(0,r.useCallback)(e=>{f(!0),m.push("/"),o(e).then(t=>{t.error?s.toast.error(t.error):window.dispatchEvent(new CustomEvent("shipit-ai: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"),f(!1)})},[m]);return(0,t.jsx)(J,{open:b,onClose:j,onSubmit:v,repositoryPath:e,features:l,repositories:c,workflowDefaults:d,initialParentId:i,initialDescription:n,isSubmitting:x,currentAgentType:p,currentModel:h,canPushDirectly:u})}],15203)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,15203,e=>{"use strict";var t=e.i(96871),r=e.i(16539),a=e.i(33109),s=e.i(60112),i=e.i(96976);let o=(0,i.createServerReference)("40334965bad865df464de0583e49535e5c2f29a6bf",i.callServer,void 0,i.findSourceMapURL,"createFeature");e.i(98026);var n=e.i(50728);e.i(1650);var l=e.i(11495),c=e.i(45811),d=e.i(35364),p=e.i(41957),h=e.i(81846),u=e.i(2828),m=e.i(8361),x=e.i(30153);let f=(0,i.createServerReference)("409f0d96e27b61bc387e0d2573fb24b2ae2b64eec4",i.callServer,void 0,i.findSourceMapURL,"getViewerPermission");var g=e.i(42076);let b=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"]),j={allowPrd:!1,allowPlan:!1,allowMerge:!1};var v=e.i(16868),w=e.i(53360),C=e.i(55016),y=e.i(31777),D=e.i(48306),N=e.i(51911);e.i(50032);var k=e.i(86254),P=e.i(9749);function T({description:e,onDescriptionChange:a,attachments:s,onRemoveFile:i,onNotesChange:o,onPaste:l,onDragEnter:c,onDragLeave:d,onDragOver:h,onDrop:m,onAddFiles:x,isDragOver:f,uploadError:g,isPromptFocused:b,onPromptFocus:j,onPromptBlur:S,fast:F,onFastChange:E,pending:R,onPendingChange:L,overrideAgent:A,overrideModel:M,currentAgentType:O,currentModel:I,onAgentModelChange:z,isSubmitting:U}){let{t:B}=(0,n.useTranslation)("web"),G=(0,r.useRef)(null);return(0,t.jsxs)("div",{role:"region","aria-label":B("createDrawer.fileDropZone"),"data-drag-over":f?"true":"false",onDragEnter:c,onDragLeave:d,onDragOver:h,onDrop:m,className:(0,y.cn)("flex flex-col gap-1.5 rounded-md border-2 border-transparent p-1 transition-colors",f&&"border-primary/50 bg-primary/5"),children:[(0,t.jsx)(p.Label,{htmlFor:"feature-description",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:B("createDrawer.describeFeature")}),(0,t.jsxs)("div",{ref:G,onFocus:j,onBlur:()=>{setTimeout(()=>{let e=G.current?.contains(document.activeElement),t=G.current?.querySelector('[aria-expanded="true"]')!==null;e||t||S()},0)},className:(0,y.cn)("border-input flex h-56 flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow]",b&&"ring-ring/50 border-ring ring-[3px]"),children:[(0,t.jsx)(D.Textarea,{id:"feature-description",placeholder:B("createDrawer.featurePlaceholder"),value:e,onChange:e=>a(e.target.value),onPaste:l,required:!0,disabled:U,"aria-invalid":!!g,"aria-describedby":g?"feature-upload-error":void 0,className:"min-h-0 flex-1 resize-none rounded-none border-0 shadow-none focus-visible:ring-0"}),s.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:s.map(e=>(0,t.jsx)(k.AttachmentChip,{name:e.name,size:e.size,mimeType:e.mimeType,path:e.path,onRemove:()=>i(e.id),disabled:U,loading:e.loading,notes:e.notes,onNotesChange:t=>o(e.id,t)},e.id))}),g?(0,t.jsx)("p",{id:"feature-upload-error",className:"text-destructive px-3 pb-2 text-xs",role:"alert",children:g}):null,(0,t.jsxs)("div",{className:"border-input flex items-center gap-3 border-t px-3 py-1.5",children:[(0,t.jsx)(P.AgentModelPicker,{initialAgentType:A??O??"claude-code",initialModel:M??I??"claude-sonnet-4-6",mode:"override",onAgentModelChange:z,disabled:U,className:"w-55"}),(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"ml-auto flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(N.Switch,{id:"pending-mode",checked:R,onCheckedChange:L,disabled:U}),(0,t.jsxs)(p.Label,{htmlFor:"pending-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,t.jsx)(C.Clock,{className:"h-3.5 w-3.5"}),B("createDrawer.pendingMode")]})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:B("createDrawer.pendingModeDescription")})]}),(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(N.Switch,{id:"fast-mode",checked:F,onCheckedChange:E,disabled:U}),(0,t.jsxs)(p.Label,{htmlFor:"fast-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,t.jsx)(w.Zap,{className:"h-3.5 w-3.5"}),B("createDrawer.fastModeLabel")]})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:B("createDrawer.fastModeDescription")})]}),(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:x,disabled:U,"aria-label":B("chat.attachFiles"),className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,t.jsx)(v.PaperclipIcon,{className:"h-4 w-4"})})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:B("chat.attachFiles")})]})]})]})]})}var S=e.i(81542),F=e.i(70471),E=e.i(43416);let R=["allowPrd","allowPlan","allowMerge"];function L({approvalGates:e,onApprovalGatesChange:r,enableEvidence:a,onEnableEvidenceChange:s,commitEvidence:i,onCommitEvidenceChange:o,push:l,onPushChange:c,openPr:d,onOpenPrChange:h,ciWatchEnabled:m,onCiWatchChange:x,rebaseBeforeBranch:f,onRebaseBeforeBranchChange:g,commitSpecs:b,onCommitSpecsChange:j,forkAndPr:v,onForkAndPrChange:w,canPush:C,fast:D,computedPush:k,computedOpenPr:P,isSubmitting:T}){let{t:A}=(0,n.useTranslation)("web"),M=[{id:"allowPrd",label:A("createDrawer.prd"),description:A("createDrawer.prdDescription")},{id:"allowPlan",label:A("createDrawer.plan"),description:A("createDrawer.planDescription")},{id:"allowMerge",label:A("createDrawer.merge"),description:A("createDrawer.mergeDescription")}];return(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)(u.Tooltip,{children:[(0,t.jsx)(u.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:A("createDrawer.approve")})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:A("createDrawer.approveDescription")})]}),(0,t.jsx)("div",{className:"flex flex-1 items-center gap-4",children:M.map(a=>(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:`approve-${a.id}`,size:"sm",checked:e[a.id]??!1,onCheckedChange:t=>r({...e,[a.id]:t}),disabled:T||D&&("allowPrd"===a.id||"allowPlan"===a.id)}),(0,t.jsx)(p.Label,{htmlFor:`approve-${a.id}`,className:"cursor-pointer text-xs font-medium",children:a.label})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:D&&("allowPrd"===a.id||"allowPlan"===a.id)?A("createDrawer.skippedInFastMode"):a.description})]},a.id))}),(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:()=>{let t=R.every(t=>e[t]),a={};for(let e of R)a[e]=!t;r(a)},disabled:T,className:(0,y.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",R.every(t=>e[t])&&"text-primary"),children:A("createDrawer.all")})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:A("createDrawer.toggleAllApprovalGates")})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.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:A("createDrawer.evidence")})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:A("createDrawer.evidenceDescription")})]}),(0,t.jsxs)("div",{className:"flex flex-1 items-center gap-4",children:[(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"enable-evidence",size:"sm",checked:a,onCheckedChange:e=>{s(e),e||o(!1)},disabled:T}),(0,t.jsx)(p.Label,{htmlFor:"enable-evidence",className:"cursor-pointer text-xs font-medium",children:A("createDrawer.collect")})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:A("createDrawer.collectDescription")})]}),(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"commit-evidence",size:"sm",checked:i,onCheckedChange:o,disabled:T||!a||!d&&!v}),(0,t.jsx)(p.Label,{htmlFor:"commit-evidence",className:(0,y.cn)("cursor-pointer text-xs font-medium",(!a||!d&&!v)&&"opacity-50"),children:A("createDrawer.addToPr")})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:d||v?a?A("createDrawer.addToPrDescription"):A("createDrawer.requiresEvidence"):A("createDrawer.requiresPr")})]})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-start gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 pt-0.5 text-xs font-semibold tracking-wider",children:A("createDrawer.git")}),(0,t.jsxs)("div",{className:"flex flex-1 flex-wrap items-center gap-4",children:[(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"push",size:"sm",checked:k,onCheckedChange:e=>{c(e),!e&&d&&h(!1)},disabled:T||v}),(0,t.jsx)(p.Label,{htmlFor:"push",className:(0,y.cn)("cursor-pointer text-xs font-medium",v&&"opacity-50"),children:A("createDrawer.push")})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:v?"Enabled — contributing to upstream":A("createDrawer.pushDescription")})]}),(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"open-pr",size:"sm",checked:P,onCheckedChange:e=>{h(e),e||o(!1)},disabled:T||v}),(0,t.jsx)(p.Label,{htmlFor:"open-pr",className:(0,y.cn)("cursor-pointer text-xs font-medium",v&&"opacity-50"),children:A("createDrawer.pr")})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:v?"Enabled — contributing to upstream":A("createDrawer.prDescription")})]}),(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"ci-watch",size:"sm",checked:m,onCheckedChange:x,disabled:T}),(0,t.jsx)(p.Label,{htmlFor:"ci-watch",className:"cursor-pointer text-xs font-medium",children:A("createDrawer.watch")})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:A("createDrawer.watchDescription")})]}),(0,t.jsx)("div",{className:"bg-border h-4 w-px shrink-0"}),(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"rebase-before-branch",size:"sm",checked:f,onCheckedChange:g,disabled:T}),(0,t.jsxs)(p.Label,{htmlFor:"rebase-before-branch",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(E.RefreshCw,{className:"h-3 w-3"}),A("createDrawer.sync")]})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:A("createDrawer.syncDescription")})]}),(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"commit-specs",size:"sm",checked:b,onCheckedChange:j,disabled:T}),(0,t.jsxs)(p.Label,{htmlFor:"commit-specs",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(F.FileText,{className:"h-3 w-3"}),A("createDrawer.commitSpecs")]})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:A("createDrawer.commitSpecsDescription")})]}),!C&&(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"fork-and-pr",size:"sm",checked:v,onCheckedChange:e=>{w(e),e&&j(!1)},disabled:T}),(0,t.jsxs)(p.Label,{htmlFor:"fork-and-pr",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(S.GitFork,{className:"h-3 w-3"}),A("createDrawer.forkAndPr")]})]})}),(0,t.jsx)(u.TooltipContent,{side:"bottom",children:A("createDrawer.forkAndPrDescription")})]})]})]})]})}var A=e.i(83843),M=e.i(97667),O=e.i(98127),I=e.i(90382);function z({features:e,value:a,onChange:s,disabled:i}){let{t:o}=(0,n.useTranslation)("web"),[l,c]=(0,r.useState)(!1),[d,p]=(0,r.useState)(""),h=(0,r.useRef)(null),u=e.find(e=>e.id===a),m=d.trim()?e.filter(e=>e.name.toLowerCase().includes(d.toLowerCase())||e.id.toLowerCase().includes(d.toLowerCase())):e,x=(0,r.useCallback)(e=>{s(e),c(!1),p("")},[s]);return(0,r.useEffect)(()=>{l?setTimeout(()=>h.current?.focus(),0):p("")},[l]),(0,t.jsxs)(I.Popover,{open:l,onOpenChange:c,children:[(0,t.jsx)(I.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{id:"parent-feature",type:"button",role:"combobox","aria-expanded":l,"aria-label":"Parent Feature",disabled:i,"data-testid":"parent-feature-combobox",className:(0,y.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",!u&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:u?`${u.name} (${u.id.slice(0,8)})`:o("createDrawer.selectParent")}),(0,t.jsx)(A.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(I.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)(O.Input,{ref:h,placeholder:o("createDrawer.searchFeatures"),value:d,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:()=>x(void 0),className:(0,y.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)(M.CheckIcon,{className:(0,y.cn)("h-4 w-4 shrink-0",void 0!==a&&"invisible")}),(0,t.jsx)("span",{className:"text-muted-foreground italic",children:o("createDrawer.noParent")})]}),0===m.length&&d?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:o("createDrawer.noFeaturesFound")}):m.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":a===e.id,onClick:()=>x(e.id),className:(0,y.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)(M.CheckIcon,{className:(0,y.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))]})]})})]})}var U=e.i(91925),B=e.i(83428),G=e.i(25235),W=e.i(75921),$=e.i(34629),q=e.i(78521);e.i(13322);var K=e.i(61201);function Z({repositories:e,value:a,onChange:s,onAddRepository:i,disabled:o}){let[l,c]=(0,r.useState)(!1),[d,p]=(0,r.useState)(""),[h,u]=(0,r.useState)(!1),[m,x]=(0,r.useState)(null),[f,g]=(0,r.useState)(!1),b=(0,r.useRef)(null),{reactFileManager:j}=(0,W.useFeatureFlags)(),{t:v}=(0,n.useTranslation)("web"),w=e.find(e=>e.path===a),C=d.trim()?e.filter(e=>e.name.toLowerCase().includes(d.toLowerCase())||e.path.toLowerCase().includes(d.toLowerCase())):e,D=(0,r.useCallback)(e=>{s(e),c(!1),p("")},[s]),N=(0,r.useCallback)(async e=>{let t=await (0,$.addRepository)({path:e});if(t.error){x(t.error),u(!1);return}if(t.repository){let e={id:t.repository.id,name:t.repository.name,path:t.repository.path};i?.(e),s(e.path),c(!1),p("")}},[i,s]),k=(0,r.useCallback)(async()=>{if(!h){if(j)return void g(!0);u(!0),x(null);try{let e=await (0,q.pickFolder)();if(!e)return void u(!1);await N(e)}catch{g(!0)}finally{u(!1)}}},[h,j,N]),P=(0,r.useCallback)(async e=>{if(g(!1),e){u(!0),x(null);try{await N(e)}catch(e){x(e instanceof Error?e.message:"Failed to add repository")}finally{u(!1)}}},[N]);return(0,r.useEffect)(()=>{l?setTimeout(()=>b.current?.focus(),0):p("")},[l]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(I.Popover,{open:l,onOpenChange:c,children:[(0,t.jsx)(I.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"button",role:"combobox","aria-expanded":l,"aria-label":"Repository","aria-invalid":!!m,"aria-describedby":m?"add-repository-error-msg":void 0,disabled:o,"data-testid":"repository-combobox",className:(0,y.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",!w&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:w?w.name:"Select repository..."}),(0,t.jsx)(A.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(I.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)(O.Input,{ref:b,placeholder:v("createDrawer.searchRepositories"),value:d,onChange:e=>p(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===C.length?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm","data-testid":"repository-empty",children:"No repositories found."}):C.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":a===e.path,onClick:()=>D(e.path),className:(0,y.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)(M.CheckIcon,{className:(0,y.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)(G.Separator,{}),(0,t.jsxs)("button",{type:"button",onClick:k,disabled:h,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:[h?(0,t.jsx)(B.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..."})]}),m?(0,t.jsx)("p",{id:"add-repository-error-msg",className:"px-3 pb-2 text-xs text-red-500",role:"alert","data-testid":"add-repository-error",children:m}):null]})})]}),(0,t.jsx)(K.ReactFileManagerDialog,{open:f,onOpenChange:e=>{e||g(!1)},onSelect:P})]})}function J({open:e,onClose:a,onSubmit:s,repositoryPath:i,isSubmitting:o=!1,workflowDefaults:v,features:w,repositories:C,initialParentId:y,currentAgentType:D,currentModel:N,initialDescription:k,canPushDirectly:P}){let{t:S}=(0,n.useTranslation)("web"),F=function({open:e,onClose:t,onSubmit:a,repositoryPath:s,workflowDefaults:i,repositories:o,initialParentId:n,currentAgentType:l,currentModel:c,initialDescription:d,canPushDirectly:p}){let h=(0,m.useSoundAction)("create"),u=s&&(!o||0===o.length||o.some(e=>e.path===s))?s:"",v=i?.approvalGates??j,w=i?.push??!1,C=i?.openPr??!1,y=i?.ciWatchEnabled!==!1,D=i?.enableEvidence??!1,N=i?.commitEvidence??!1,k=i?.fast!==!1,[P,T]=(0,r.useState)(d??"");(0,r.useEffect)(()=>{d&&T(d)},[d]);let[S,F]=(0,r.useState)([]),[E,R]=(0,r.useState)({...v}),[L,A]=(0,r.useState)(w),[M,O]=(0,r.useState)(C),[I,z]=(0,r.useState)(i?.ciWatchEnabled!==!1),[U,B]=(0,r.useState)(D),[G,W]=(0,r.useState)(N),[$,q]=(0,r.useState)(void 0),[K,Z]=(0,r.useState)(k),[J,V]=(0,r.useState)(!1),[H,Q]=(0,r.useState)(!1),[X,Y]=(0,r.useState)(!0),[_,ee]=(0,r.useState)(!0),[et,er]=(0,r.useState)(void 0),[ea,es]=(0,r.useState)(void 0),[ei,eo]=(0,r.useState)(u||void 0),[en,el]=(0,r.useState)(o??[]),[ec,ed]=(0,r.useState)(!1),[ep,eh]=(0,r.useState)(null),[eu,em]=(0,r.useState)(!1),ex=(0,r.useRef)(crypto.randomUUID()),ef=(0,r.useRef)(0);(0,r.useEffect)(()=>{i&&(R({...i.approvalGates}),A(i.push),O(i.openPr),z(!1!==i.ciWatchEnabled),B(i.enableEvidence),W(i.commitEvidence),Z(!1!==i.fast))},[i]),(0,r.useEffect)(()=>{el(o??[])},[o]),(0,r.useEffect)(()=>{e&&n&&q(n)},[e,n]);let[eg,eb]=(0,r.useState)(p??!1);(0,r.useEffect)(()=>{eb(p??!1)},[p]);let ej=(0,r.useRef)(ei);(0,r.useEffect)(()=>{ei&&ei!==ej.current&&(ej.current=ei,f(ei).then(e=>eb(e.canPushDirectly)).catch(()=>eb(!1)))},[ei]),(0,r.useEffect)(()=>{eg&&(Q(!1),A(w),O(C),Y(!0))},[eg,w,C]);let ev=(0,r.useCallback)(()=>{T(""),F([]),R({...v}),A(w),O(C),z(y),B(D),W(N),q(void 0),eo(u||void 0),el(o??[]),Z(k),V(!1),Q(!1),Y(!0),ee(!0),er(void 0),es(void 0),eh(null),ef.current=0,ed(!1)},[v,w,C,D,y,N,k,u,o]),ew=""!==P.trim()||S.length>0,{attemptClose:eC}=(0,x.useGuardedDrawerClose)({open:e,isDirty:ew,onClose:t,onReset:ev}),ey=(0,r.useCallback)(async e=>{for(let t of(eh(null),e)){if(t.size>0xa00000)return void eh(`"${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&&!b.has(e))return void eh(`File type "${e}" is not allowed`)}for(let t of e){let e=crypto.randomUUID();F(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",ex.current);let a=await fetch("/api/attachments/upload",{method:"POST",body:r});if(!a.ok){let t=await a.json().catch(()=>({error:"Upload failed"}));F(t=>t.filter(t=>t.id!==e)),eh(t.error??"Upload failed");return}let s=await a.json();F(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{F(t=>t.filter(t=>t.id!==e)),eh("Upload failed")}}},[]),eD=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),ef.current+=1,1===ef.current&&ed(!0)},[]),eN=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),ef.current-=1,0===ef.current&&ed(!1)},[]),ek=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),eP=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),ef.current=0,ed(!1);let t=Array.from(e.dataTransfer.files);t.length>0&&ey(t)},[ey]),eT=(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(),ey(r))},[ey]),eS=(0,r.useCallback)(e=>{if(e.preventDefault(),!P.trim())return;let t=ei??u;t&&(h.play(),a({description:P.trim(),attachments:S.filter(e=>!e.loading),repositoryPath:t,approvalGates:{allowPrd:E.allowPrd??!1,allowPlan:E.allowPlan??!1,allowMerge:E.allowMerge??!1},push:!!H||L||M,openPr:!!H||M,ciWatchEnabled:I,enableEvidence:U,commitEvidence:G,fast:K,forkAndPr:H,commitSpecs:X,rebaseBeforeBranch:_,...J?{pending:J}:{},...et?{agentType:et}:{},...ea?{model:ea}:{},...$?{parentId:$}:{},sessionId:ex.current}),ev())},[P,S,E,ei,u,a,L,M,U,I,G,K,H,X,_,J,et,ea,$,h,ev]),eF=(0,r.useCallback)(async()=>{try{let e=await (0,g.pickFiles)();if(!e)return;for(let t of e){let e=crypto.randomUUID();F(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:ex.current})});if(!r.ok){let t=await r.json().catch(()=>({error:"Upload failed"}));F(t=>t.filter(t=>t.id!==e)),eh(t.error??"Upload failed");return}let a=await r.json();F(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{F(t=>t.filter(t=>t.id!==e)),eh("Upload failed")}}}catch{}},[]),eE=(0,r.useCallback)(e=>{F(t=>t.filter(t=>t.id!==e))},[]),eR=(0,r.useCallback)((e,t)=>{F(r=>r.map(r=>r.id===e?{...r,notes:t}:r))},[]);return{validRepoPath:u,canPush:eg,isDirty:ew,computedPush:!!H||L||M,computedOpenPr:!!H||M,description:P,setDescription:T,attachments:S,approvalGates:E,setApprovalGates:R,push:L,setPush:A,openPr:M,setOpenPr:O,ciWatchEnabled:I,setCiWatchEnabled:z,enableEvidence:U,setEnableEvidence:B,commitEvidence:G,setCommitEvidence:W,parentId:$,setParentId:q,fast:K,setFast:Z,pending:J,setPending:V,forkAndPr:H,setForkAndPr:Q,commitSpecs:X,setCommitSpecs:Y,rebaseBeforeBranch:_,setRebaseBeforeBranch:ee,overrideAgent:et,setOverrideAgent:er,overrideModel:ea,setOverrideModel:es,selectedRepoPath:ei,setSelectedRepoPath:eo,localRepos:en,setLocalRepos:el,isDragOver:ec,uploadError:ep,isPromptFocused:eu,setIsPromptFocused:em,sessionIdRef:ex,currentAgentType:l,currentModel:c,attemptClose:eC,handleFiles:ey,handleDragEnter:eD,handleDragLeave:eN,handleDragOver:ek,handleDrop:eP,handlePaste:eT,handleSubmit:eS,handleAddFiles:eF,handleRemoveFile:eE,handleNotesChange:eR,resetForm:ev}}({open:e,onClose:a,onSubmit:s,repositoryPath:i,workflowDefaults:v,repositories:C,initialParentId:y,currentAgentType:D,currentModel:N,initialDescription:k,canPushDirectly:P}),E=(0,r.useRef)(null),R=(0,r.useCallback)(e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),E.current?.requestSubmit())},[]),A=w&&w.length>0,M=!F.validRepoPath&&void 0!==C,O=!F.validRepoPath&&!F.selectedRepoPath;return(0,t.jsx)(l.BaseDrawer,{open:e,onClose:F.attemptClose,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)(c.DrawerTitle,{children:S("createDrawer.title")})]}),o?(0,t.jsx)(c.DrawerDescription,{asChild:!0,children:(0,t.jsx)("div",{children:(0,t.jsx)(h.Badge,{variant:"secondary",children:S("createDrawer.creating")})})}):null]}),footer:(0,t.jsxs)("div",{className:"flex flex-row justify-end gap-2",children:[(0,t.jsx)(d.Button,{variant:"outline",onClick:F.attemptClose,disabled:o,children:S("createDrawer.cancel")}),(0,t.jsx)(d.Button,{type:"submit",form:"create-feature-form",disabled:!F.description.trim()||o||O,children:S(o?"createDrawer.creating":"createDrawer.createFeature")})]}),children:(0,t.jsx)("div",{className:"overflow-y-auto p-4",children:(0,t.jsx)(u.TooltipProvider,{delayDuration:400,children:(0,t.jsxs)("form",{ref:E,id:"create-feature-form",onSubmit:F.handleSubmit,onKeyDown:R,className:"flex flex-col gap-4",children:[M?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-selector-section",children:[(0,t.jsx)(p.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:S("createDrawer.repository")}),(0,t.jsx)(Z,{repositories:F.localRepos,value:F.selectedRepoPath,onChange:F.setSelectedRepoPath,onAddRepository:e=>{F.setLocalRepos(t=>[...t,e]),F.setSelectedRepoPath(e.path)},disabled:o})]}):F.validRepoPath?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-readonly-section",children:[(0,t.jsx)(p.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:S("createDrawer.repository")}),(0,t.jsx)("p",{className:"text-sm","data-testid":"repo-readonly-label",children:C?.find(e=>e.path===F.validRepoPath)?.name??F.validRepoPath.split("/").pop()})]}):null,(0,t.jsx)(T,{description:F.description,onDescriptionChange:F.setDescription,attachments:F.attachments,onRemoveFile:F.handleRemoveFile,onNotesChange:F.handleNotesChange,onPaste:F.handlePaste,onDragEnter:F.handleDragEnter,onDragLeave:F.handleDragLeave,onDragOver:F.handleDragOver,onDrop:F.handleDrop,onAddFiles:F.handleAddFiles,isDragOver:F.isDragOver,uploadError:F.uploadError,isPromptFocused:F.isPromptFocused,onPromptFocus:()=>F.setIsPromptFocused(!0),onPromptBlur:()=>F.setIsPromptFocused(!1),fast:F.fast,onFastChange:F.setFast,pending:F.pending,onPendingChange:F.setPending,overrideAgent:F.overrideAgent,overrideModel:F.overrideModel,currentAgentType:D,currentModel:N,onAgentModelChange:(e,t)=>{F.setOverrideAgent(e),F.setOverrideModel(t)},isSubmitting:o}),A&&void 0!==y?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(p.Label,{htmlFor:"parent-feature",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:S("createDrawer.parentFeature")}),(0,t.jsx)(z,{features:w,value:F.parentId,onChange:F.setParentId,disabled:o})]}):null,(0,t.jsx)(L,{approvalGates:F.approvalGates,onApprovalGatesChange:F.setApprovalGates,enableEvidence:F.enableEvidence,onEnableEvidenceChange:F.setEnableEvidence,commitEvidence:F.commitEvidence,onCommitEvidenceChange:F.setCommitEvidence,push:F.push,onPushChange:F.setPush,openPr:F.openPr,onOpenPrChange:F.setOpenPr,ciWatchEnabled:F.ciWatchEnabled,onCiWatchChange:F.setCiWatchEnabled,rebaseBeforeBranch:F.rebaseBeforeBranch,onRebaseBeforeBranchChange:F.setRebaseBeforeBranch,commitSpecs:F.commitSpecs,onCommitSpecsChange:F.setCommitSpecs,forkAndPr:F.forkAndPr,onForkAndPrChange:F.setForkAndPr,canPush:F.canPush,fast:F.fast,computedPush:F.computedPush,computedOpenPr:F.computedOpenPr,isSubmitting:o})]})})})})}e.s(["CreateDrawerClient",0,function({repositoryPath:e,initialParentId:i,initialDescription:n,features:l,repositories:c,workflowDefaults:d,currentAgentType:p,currentModel:h,canPushDirectly:u}){let m=(0,a.useRouter)(),[x,f]=(0,r.useState)(!1),g=(0,a.usePathname)().startsWith("/create"),b=!x&&g;(0,r.useEffect)(()=>{!g&&x&&f(!1)},[g,x]);let j=(0,r.useCallback)(()=>{m.push("/")},[m]),v=(0,r.useCallback)(e=>{f(!0),m.push("/"),o(e).then(t=>{t.error?s.toast.error(t.error):window.dispatchEvent(new CustomEvent("shipit-ai: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"),f(!1)})},[m]);return(0,t.jsx)(J,{open:b,onClose:j,onSubmit:v,repositoryPath:e,features:l,repositories:c,workflowDefaults:d,initialParentId:i,initialDescription:n,isSubmitting:x,currentAgentType:p,currentModel:h,canPushDirectly:u})}],15203)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,83843,e=>{"use strict";let a=(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"}]]);e.s(["ChevronsUpDown",0,a],83843)},36479,e=>{"use strict";var a=e.i(96871),t=e.i(16539),s=e.i(33109),r=e.i(60112),o=e.i(96976);let n=(0,o.createServerReference)("40025d3c064984ec0fbcb0fa1642bb0cf89a116ab9",o.callServer,void 0,o.findSourceMapURL,"adoptBranch"),l=(0,o.createServerReference)("40c9c70398e7ce670f224c4ded59cd803aaf88b153",o.callServer,void 0,o.findSourceMapURL,"listBranches");var c=e.i(23925),i=e.i(97667),d=e.i(83843),p=e.i(49228),h=e.i(83428);e.i(1650);var u=e.i(11495),m=e.i(45811),x=e.i(35364),f=e.i(98127),b=e.i(41957),v=e.i(66459),g=e.i(31777);let j=t.forwardRef(({className:e,...t},s)=>(0,a.jsx)("div",{ref:s,className:(0,g.cn)("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t}));j.displayName="Command";let w=t.forwardRef(({className:e,...t},s)=>(0,a.jsxs)("div",{className:"flex items-center border-b px-3",children:[(0,a.jsx)(v.Search,{className:"me-2 h-4 w-4 shrink-0 opacity-50"}),(0,a.jsx)("input",{ref:s,className:(0,g.cn)("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));w.displayName="CommandInput";let N=t.forwardRef(({className:e,...t},s)=>(0,a.jsx)("div",{ref:s,className:(0,g.cn)("max-h-[300px] overflow-x-hidden overflow-y-auto",e),...t}));N.displayName="CommandList";let y=t.forwardRef(({className:e,...t},s)=>(0,a.jsx)("div",{ref:s,className:(0,g.cn)("text-muted-foreground py-6 text-center text-sm",e),...t}));y.displayName="CommandEmpty";let C=t.forwardRef(({className:e,...t},s)=>(0,a.jsx)("div",{ref:s,className:(0,g.cn)("text-foreground overflow-hidden p-1",e),...t}));C.displayName="CommandGroup";let S=t.forwardRef(({className:e,selected:t,...s},r)=>(0,a.jsx)("button",{ref:r,type:"button","data-selected":t,className:(0,g.cn)("relative flex w-full cursor-default items-center rounded-sm px-2 py-1.5 text-sm transition-colors outline-none select-none","hover:bg-accent hover:text-accent-foreground","data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground","disabled:pointer-events-none disabled:opacity-50",e),...s}));S.displayName="CommandItem",t.forwardRef(({className:e,...t},s)=>(0,a.jsx)("div",{ref:s,className:(0,g.cn)("bg-border -mx-1 h-px",e),...t})).displayName="CommandSeparator";var k=e.i(90382);function R({open:e,onClose:s,onSubmit:r,isSubmitting:o=!1,error:n,repositories:l=[],selectedRepositoryPath:v,onRepositoryChange:L,branches:B=[],branchesLoading:P=!1}){let[E,D]=(0,t.useState)(""),[T,U]=(0,t.useState)(!1),[A,I]=(0,t.useState)(""),O=(0,t.useRef)(null),[F,G]=(0,t.useState)(!1),[K,M]=(0,t.useState)(""),$=(0,t.useRef)(null),z=l.find(e=>e.path===v),W=!!v;(0,t.useEffect)(()=>{e||(D(""),I(""),U(!1),G(!1),M(""))},[e]),(0,t.useEffect)(()=>{D(""),I("")},[v]);let q=(0,t.useCallback)(e=>{e.preventDefault();let a=E.trim();a&&v&&!o&&r(a,v)},[E,v,o,r]),H=(0,t.useCallback)(()=>{D(""),I(""),s()},[s]),J=(0,t.useCallback)(e=>{D(e),I(e),U(!1)},[]),Q=(0,t.useCallback)(e=>{I(e.target.value),T||U(!0)},[T]),V=(0,t.useCallback)(e=>{if("Enter"===e.key){e.preventDefault();let a=A.trim();a&&(D(a),U(!1))}"Escape"===e.key&&(U(!1),I(E))},[A,E]),X=(0,t.useCallback)(e=>{L?.(e),G(!1),M("")},[L]),Y=B.filter(e=>e.toLowerCase().includes(A.toLowerCase())),Z=K.trim()?l.filter(e=>e.name.toLowerCase().includes(K.toLowerCase())||e.path.toLowerCase().includes(K.toLowerCase())):l;(0,t.useEffect)(()=>{F?setTimeout(()=>$.current?.focus(),0):M("")},[F]);let _=!E.trim()||!v||o,ee=(0,a.jsxs)("div",{children:[(0,a.jsxs)(m.DrawerTitle,{className:"flex items-center gap-2",children:[(0,a.jsx)(p.GitBranch,{className:"h-4 w-4"}),"Adopt Branch"]}),(0,a.jsx)(m.DrawerDescription,{className:"text-muted-foreground text-sm",children:"Import an existing git branch into Shep's feature tracking"})]});return(0,a.jsx)(u.BaseDrawer,{open:e,onClose:H,size:"sm",modal:!1,header:ee,"data-testid":"adopt-branch-drawer",children:(0,a.jsxs)("form",{onSubmit:q,className:"flex flex-1 flex-col",children:[(0,a.jsx)("div",{className:"flex-1 overflow-y-auto p-4",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(b.Label,{children:"Repository"}),(0,a.jsxs)(k.Popover,{open:F,onOpenChange:G,children:[(0,a.jsx)(k.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)("button",{type:"button",role:"combobox","aria-expanded":F,"aria-label":"Repository",disabled:o,"data-testid":"adopt-repo-combobox",className:(0,g.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",!z&&"text-muted-foreground"),children:[(0,a.jsx)("span",{className:"truncate",children:z?z.name:"Select repository..."}),(0,a.jsx)(d.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,a.jsx)(k.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"adopt-repo-combobox-content",children:(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("div",{className:"border-b p-2",children:(0,a.jsx)(f.Input,{ref:$,placeholder:"Search repositories...",value:K,onChange:e=>M(e.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"adopt-repo-search"})}),(0,a.jsx)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Repositories",children:0===Z.length?(0,a.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:"No repositories found."}):Z.map(e=>(0,a.jsxs)("button",{type:"button",role:"option","aria-selected":v===e.path,onClick:()=>X(e.path),className:(0,g.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",v===e.path&&"bg-accent/50"),"data-testid":`adopt-repo-option-${e.id}`,children:[(0,a.jsx)(i.CheckIcon,{className:(0,g.cn)("h-4 w-4 shrink-0",v!==e.path&&"invisible")}),(0,a.jsxs)("span",{className:"flex flex-col items-start truncate",children:[(0,a.jsx)("span",{className:"truncate",children:e.name}),(0,a.jsx)("span",{className:"text-muted-foreground truncate text-xs",children:e.path})]})]},e.id))})]})})]}),(0,a.jsx)("p",{className:"text-muted-foreground text-xs",children:"Select the repository that contains the branch you want to adopt."})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(b.Label,{htmlFor:"branch-name",children:"Branch name"}),(0,a.jsxs)(k.Popover,{open:T,onOpenChange:U,children:[(0,a.jsx)(k.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(x.Button,{variant:"outline",role:"combobox","aria-expanded":T,"aria-invalid":!!n,"aria-describedby":n?"adopt-branch-error-msg":void 0,disabled:o||!W,className:"w-full justify-between font-normal","data-testid":"adopt-branch-input",children:[(0,a.jsx)("span",{className:"truncate",children:W?P?"Loading branches...":E||"Select a branch...":"Select a repository first..."}),(0,a.jsx)(d.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,a.jsx)(k.PopoverContent,{className:"w-[var(--radix-popover-trigger-width)] p-0",align:"start",children:(0,a.jsxs)(j,{children:[(0,a.jsx)(w,{ref:O,placeholder:"Search branches...",value:A,onChange:Q,onKeyDown:V,"data-testid":"adopt-branch-search"}),(0,a.jsxs)(N,{children:[!P&&0===Y.length&&(0,a.jsx)(y,{children:0===B.length?"No branches found.":A?"No match — press Enter to use this value.":"No branches available."}),P?(0,a.jsx)(y,{children:(0,a.jsx)(h.Loader2,{className:"mx-auto h-4 w-4 animate-spin"})}):null,Y.length>0&&(0,a.jsx)(C,{children:Y.map(e=>(0,a.jsxs)(S,{selected:e===E,onClick:()=>J(e),children:[(0,a.jsx)(c.Check,{className:(0,g.cn)("me-2 h-4 w-4",e===E?"opacity-100":"opacity-0")}),(0,a.jsx)(p.GitBranch,{className:"me-2 h-3 w-3 opacity-50"}),e]},e))})]})]})})]}),(0,a.jsx)("p",{className:"text-muted-foreground text-xs",children:W?"Select a branch from the dropdown or type to search. Local and remote branches are shown.":"Please select a repository above to see available branches."})]}),n?(0,a.jsx)("p",{id:"adopt-branch-error-msg",className:"text-destructive text-sm",role:"alert","data-testid":"adopt-branch-error",children:n}):null]})}),(0,a.jsx)("div",{className:"border-t p-4",children:(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(x.Button,{type:"button",variant:"outline",onClick:H,disabled:o,className:"flex-1",children:"Cancel"}),(0,a.jsx)(x.Button,{type:"submit",disabled:_,className:"flex-1","data-testid":"adopt-branch-submit",children:o?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h.Loader2,{className:"me-2 h-4 w-4 animate-spin"}),"Adopting..."]}):"Adopt Branch"})]})})]})})}e.s(["AdoptDrawerClient",0,function({repositoryPath:e,repositories:o}){let c=(0,s.useRouter)(),i=(0,s.usePathname)(),[d,p]=(0,t.useState)(!1),[h,u]=(0,t.useState)(),[m,x]=(0,t.useState)([]),[f,b]=(0,t.useState)(!1),[v,g]=(0,t.useState)(e),j=i.startsWith("/adopt"),w=!d&&j;(0,t.useEffect)(()=>{!j&&d&&p(!1)},[j,d]),(0,t.useEffect)(()=>{j&&(u(void 0),g(e))},[j,e]),(0,t.useEffect)(()=>{j&&v?(b(!0),x([]),l(v).then(x).catch(()=>x([])).finally(()=>b(!1))):x([])},[j,v]);let N=(0,t.useCallback)(()=>{c.push("/")},[c]),y=(0,t.useCallback)(e=>{g(e)},[]),C=(0,t.useCallback)((e,a)=>{u(void 0),p(!0),c.push("/"),n({branchName:e,repositoryPath:a}).then(e=>{e.error?r.toast.error(e.error):(window.dispatchEvent(new CustomEvent("shipit-ai:feature-created",{detail:{featureId:e.feature.id,name:e.feature.name,description:e.feature.description,repositoryPath:e.feature.repositoryPath}})),r.toast.success(`Branch adopted as "${e.feature.name}"`))}).catch(()=>{r.toast.error("Failed to adopt branch"),p(!1)})},[c]);return(0,a.jsx)(R,{open:w,onClose:N,onSubmit:C,isSubmitting:d,error:h,repositories:o,selectedRepositoryPath:v,onRepositoryChange:y,branches:m,branchesLoading:f})}],36479)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,83843,e=>{"use strict";let a=(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"}]]);e.s(["ChevronsUpDown",0,a],83843)},36479,e=>{"use strict";var a=e.i(96871),t=e.i(16539),s=e.i(33109),r=e.i(60112),o=e.i(96976);let n=(0,o.createServerReference)("40941acb822b92b6b629ae5d2e57531a3a3cae9784",o.callServer,void 0,o.findSourceMapURL,"adoptBranch"),l=(0,o.createServerReference)("40afd0d96b36d5d9a3de7ac917d957badf3f21e340",o.callServer,void 0,o.findSourceMapURL,"listBranches");var i=e.i(23925),c=e.i(97667),d=e.i(83843),p=e.i(49228),h=e.i(83428);e.i(1650);var u=e.i(11495),m=e.i(45811),x=e.i(35364),f=e.i(98127),b=e.i(41957),v=e.i(66459),g=e.i(31777);let j=t.forwardRef(({className:e,...t},s)=>(0,a.jsx)("div",{ref:s,className:(0,g.cn)("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t}));j.displayName="Command";let w=t.forwardRef(({className:e,...t},s)=>(0,a.jsxs)("div",{className:"flex items-center border-b px-3",children:[(0,a.jsx)(v.Search,{className:"me-2 h-4 w-4 shrink-0 opacity-50"}),(0,a.jsx)("input",{ref:s,className:(0,g.cn)("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));w.displayName="CommandInput";let N=t.forwardRef(({className:e,...t},s)=>(0,a.jsx)("div",{ref:s,className:(0,g.cn)("max-h-[300px] overflow-x-hidden overflow-y-auto",e),...t}));N.displayName="CommandList";let y=t.forwardRef(({className:e,...t},s)=>(0,a.jsx)("div",{ref:s,className:(0,g.cn)("text-muted-foreground py-6 text-center text-sm",e),...t}));y.displayName="CommandEmpty";let C=t.forwardRef(({className:e,...t},s)=>(0,a.jsx)("div",{ref:s,className:(0,g.cn)("text-foreground overflow-hidden p-1",e),...t}));C.displayName="CommandGroup";let S=t.forwardRef(({className:e,selected:t,...s},r)=>(0,a.jsx)("button",{ref:r,type:"button","data-selected":t,className:(0,g.cn)("relative flex w-full cursor-default items-center rounded-sm px-2 py-1.5 text-sm transition-colors outline-none select-none","hover:bg-accent hover:text-accent-foreground","data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground","disabled:pointer-events-none disabled:opacity-50",e),...s}));S.displayName="CommandItem",t.forwardRef(({className:e,...t},s)=>(0,a.jsx)("div",{ref:s,className:(0,g.cn)("bg-border -mx-1 h-px",e),...t})).displayName="CommandSeparator";var k=e.i(90382);function R({open:e,onClose:s,onSubmit:r,isSubmitting:o=!1,error:n,repositories:l=[],selectedRepositoryPath:v,onRepositoryChange:L,branches:B=[],branchesLoading:P=!1}){let[E,D]=(0,t.useState)(""),[T,U]=(0,t.useState)(!1),[A,I]=(0,t.useState)(""),O=(0,t.useRef)(null),[F,G]=(0,t.useState)(!1),[K,M]=(0,t.useState)(""),$=(0,t.useRef)(null),z=l.find(e=>e.path===v),W=!!v;(0,t.useEffect)(()=>{e||(D(""),I(""),U(!1),G(!1),M(""))},[e]),(0,t.useEffect)(()=>{D(""),I("")},[v]);let q=(0,t.useCallback)(e=>{e.preventDefault();let a=E.trim();a&&v&&!o&&r(a,v)},[E,v,o,r]),H=(0,t.useCallback)(()=>{D(""),I(""),s()},[s]),J=(0,t.useCallback)(e=>{D(e),I(e),U(!1)},[]),Q=(0,t.useCallback)(e=>{I(e.target.value),T||U(!0)},[T]),V=(0,t.useCallback)(e=>{if("Enter"===e.key){e.preventDefault();let a=A.trim();a&&(D(a),U(!1))}"Escape"===e.key&&(U(!1),I(E))},[A,E]),X=(0,t.useCallback)(e=>{L?.(e),G(!1),M("")},[L]),Y=B.filter(e=>e.toLowerCase().includes(A.toLowerCase())),Z=K.trim()?l.filter(e=>e.name.toLowerCase().includes(K.toLowerCase())||e.path.toLowerCase().includes(K.toLowerCase())):l;(0,t.useEffect)(()=>{F?setTimeout(()=>$.current?.focus(),0):M("")},[F]);let _=!E.trim()||!v||o,ee=(0,a.jsxs)("div",{children:[(0,a.jsxs)(m.DrawerTitle,{className:"flex items-center gap-2",children:[(0,a.jsx)(p.GitBranch,{className:"h-4 w-4"}),"Adopt Branch"]}),(0,a.jsx)(m.DrawerDescription,{className:"text-muted-foreground text-sm",children:"Import an existing git branch into Shep's feature tracking"})]});return(0,a.jsx)(u.BaseDrawer,{open:e,onClose:H,size:"sm",modal:!1,header:ee,"data-testid":"adopt-branch-drawer",children:(0,a.jsxs)("form",{onSubmit:q,className:"flex flex-1 flex-col",children:[(0,a.jsx)("div",{className:"flex-1 overflow-y-auto p-4",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(b.Label,{children:"Repository"}),(0,a.jsxs)(k.Popover,{open:F,onOpenChange:G,children:[(0,a.jsx)(k.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)("button",{type:"button",role:"combobox","aria-expanded":F,"aria-label":"Repository",disabled:o,"data-testid":"adopt-repo-combobox",className:(0,g.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",!z&&"text-muted-foreground"),children:[(0,a.jsx)("span",{className:"truncate",children:z?z.name:"Select repository..."}),(0,a.jsx)(d.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,a.jsx)(k.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"adopt-repo-combobox-content",children:(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("div",{className:"border-b p-2",children:(0,a.jsx)(f.Input,{ref:$,placeholder:"Search repositories...",value:K,onChange:e=>M(e.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"adopt-repo-search"})}),(0,a.jsx)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Repositories",children:0===Z.length?(0,a.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:"No repositories found."}):Z.map(e=>(0,a.jsxs)("button",{type:"button",role:"option","aria-selected":v===e.path,onClick:()=>X(e.path),className:(0,g.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",v===e.path&&"bg-accent/50"),"data-testid":`adopt-repo-option-${e.id}`,children:[(0,a.jsx)(c.CheckIcon,{className:(0,g.cn)("h-4 w-4 shrink-0",v!==e.path&&"invisible")}),(0,a.jsxs)("span",{className:"flex flex-col items-start truncate",children:[(0,a.jsx)("span",{className:"truncate",children:e.name}),(0,a.jsx)("span",{className:"text-muted-foreground truncate text-xs",children:e.path})]})]},e.id))})]})})]}),(0,a.jsx)("p",{className:"text-muted-foreground text-xs",children:"Select the repository that contains the branch you want to adopt."})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(b.Label,{htmlFor:"branch-name",children:"Branch name"}),(0,a.jsxs)(k.Popover,{open:T,onOpenChange:U,children:[(0,a.jsx)(k.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(x.Button,{variant:"outline",role:"combobox","aria-expanded":T,"aria-invalid":!!n,"aria-describedby":n?"adopt-branch-error-msg":void 0,disabled:o||!W,className:"w-full justify-between font-normal","data-testid":"adopt-branch-input",children:[(0,a.jsx)("span",{className:"truncate",children:W?P?"Loading branches...":E||"Select a branch...":"Select a repository first..."}),(0,a.jsx)(d.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,a.jsx)(k.PopoverContent,{className:"w-[var(--radix-popover-trigger-width)] p-0",align:"start",children:(0,a.jsxs)(j,{children:[(0,a.jsx)(w,{ref:O,placeholder:"Search branches...",value:A,onChange:Q,onKeyDown:V,"data-testid":"adopt-branch-search"}),(0,a.jsxs)(N,{children:[!P&&0===Y.length&&(0,a.jsx)(y,{children:0===B.length?"No branches found.":A?"No match — press Enter to use this value.":"No branches available."}),P?(0,a.jsx)(y,{children:(0,a.jsx)(h.Loader2,{className:"mx-auto h-4 w-4 animate-spin"})}):null,Y.length>0&&(0,a.jsx)(C,{children:Y.map(e=>(0,a.jsxs)(S,{selected:e===E,onClick:()=>J(e),children:[(0,a.jsx)(i.Check,{className:(0,g.cn)("me-2 h-4 w-4",e===E?"opacity-100":"opacity-0")}),(0,a.jsx)(p.GitBranch,{className:"me-2 h-3 w-3 opacity-50"}),e]},e))})]})]})})]}),(0,a.jsx)("p",{className:"text-muted-foreground text-xs",children:W?"Select a branch from the dropdown or type to search. Local and remote branches are shown.":"Please select a repository above to see available branches."})]}),n?(0,a.jsx)("p",{id:"adopt-branch-error-msg",className:"text-destructive text-sm",role:"alert","data-testid":"adopt-branch-error",children:n}):null]})}),(0,a.jsx)("div",{className:"border-t p-4",children:(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(x.Button,{type:"button",variant:"outline",onClick:H,disabled:o,className:"flex-1",children:"Cancel"}),(0,a.jsx)(x.Button,{type:"submit",disabled:_,className:"flex-1","data-testid":"adopt-branch-submit",children:o?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h.Loader2,{className:"me-2 h-4 w-4 animate-spin"}),"Adopting..."]}):"Adopt Branch"})]})})]})})}e.s(["AdoptDrawerClient",0,function({repositoryPath:e,repositories:o}){let i=(0,s.useRouter)(),c=(0,s.usePathname)(),[d,p]=(0,t.useState)(!1),[h,u]=(0,t.useState)(),[m,x]=(0,t.useState)([]),[f,b]=(0,t.useState)(!1),[v,g]=(0,t.useState)(e),j=c.startsWith("/adopt"),w=!d&&j;(0,t.useEffect)(()=>{!j&&d&&p(!1)},[j,d]),(0,t.useEffect)(()=>{j&&(u(void 0),g(e))},[j,e]),(0,t.useEffect)(()=>{j&&v?(b(!0),x([]),l(v).then(x).catch(()=>x([])).finally(()=>b(!1))):x([])},[j,v]);let N=(0,t.useCallback)(()=>{i.push("/")},[i]),y=(0,t.useCallback)(e=>{g(e)},[]),C=(0,t.useCallback)((e,a)=>{u(void 0),p(!0),i.push("/"),n({branchName:e,repositoryPath:a}).then(e=>{e.error?r.toast.error(e.error):(window.dispatchEvent(new CustomEvent("shipit-ai:feature-created",{detail:{featureId:e.feature.id,name:e.feature.name,description:e.feature.description,repositoryPath:e.feature.repositoryPath}})),r.toast.success(`Branch adopted as "${e.feature.name}"`))}).catch(()=>{r.toast.error("Failed to adopt branch"),p(!1)})},[i]);return(0,a.jsx)(R,{open:w,onClose:N,onSubmit:C,isSubmitting:d,error:h,repositories:o,selectedRepositoryPath:v,onRepositoryChange:y,branches:m,branchesLoading:f})}],36479)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,74442,e=>{"use strict";var t=e.i(16539),r=e.i(76173),a=e.i(40854),l=e.i(57945),c=e.i(96976);let s=(0,c.createServerReference)("401a1d298407c9480a450eae36ac427e745844758f",c.callServer,void 0,c.findSourceMapURL,"syncRepository");e.s(["useRepositoryActions",0,function(e){let[c,i]=(0,t.useState)(!1),[u,n]=(0,t.useState)(!1),[d,o]=(0,t.useState)(!1),[p,h]=(0,t.useState)(!1),[y,f]=(0,t.useState)(null),[m,k]=(0,t.useState)(null),[v,x]=(0,t.useState)(null),[S,b]=(0,t.useState)(null),M=(0,t.useRef)(null),R=(0,t.useRef)(null),g=(0,t.useRef)(null),C=(0,t.useRef)(null);(0,t.useEffect)(()=>()=>{M.current&&clearTimeout(M.current),R.current&&clearTimeout(R.current),g.current&&clearTimeout(g.current),C.current&&clearTimeout(C.current)},[]);let T=(0,t.useCallback)(async(t,r,a,l,c)=>{if(e&&!c){l.current&&clearTimeout(l.current),r(!0),a(null);try{let e=await t();if(!e.success){let t=e.error??"An unexpected error occurred";a(t),l.current=setTimeout(()=>a(null),5e3)}}catch(e){a(e instanceof Error?e.message:"An unexpected error occurred"),l.current=setTimeout(()=>a(null),5e3)}finally{r(!1)}}},[e]);return{openInIde:(0,t.useCallback)(()=>T(()=>(0,r.openIde)({repositoryPath:e.repositoryPath}),i,f,M,c),[T,c,e]),openInShell:(0,t.useCallback)(()=>T(()=>(0,a.openShell)({repositoryPath:e.repositoryPath}),n,k,R,u),[T,u,e]),openFolder:(0,t.useCallback)(()=>T(()=>(0,l.openFolder)(e.repositoryPath),o,x,g,d),[T,d,e]),syncMain:(0,t.useCallback)(()=>T(()=>s(e.repositoryId??""),h,b,C,p),[T,p,e]),ideLoading:c,shellLoading:u,folderLoading:d,syncLoading:p,ideError:y,shellError:m,folderError:v,syncError:S}}],74442)},49228,e=>{"use strict";let t=(0,e.i(3645).default)("git-branch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);e.s(["GitBranch",0,t],49228)},30702,e=>{"use strict";let t=(0,e.i(3645).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",0,t],30702)},38573,e=>{"use strict";let t=(0,e.i(3645).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",0,t],38573)},1650,e=>{"use strict";e.i(11495),e.s([])},19933,e=>{"use strict";let t=(0,e.i(3645).default)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);e.s(["FolderOpen",0,t],19933)},37260,e=>{"use strict";let t=(0,e.i(3645).default)("archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);e.s(["Archive",0,t],37260)},8986,e=>{"use strict";let t=(0,e.i(3645).default)("code-xml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);e.s(["Code2",0,t],8986)},65530,e=>{"use strict";let t=(0,e.i(3645).default)("git-commit-horizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);e.s(["GitCommitHorizontal",0,t],65530)},76173,40854,57945,e=>{"use strict";var t=e.i(96976);let r=(0,t.createServerReference)("400d2680ca5bab0c8fc611f285083dcfbe6aaf4a64",t.callServer,void 0,t.findSourceMapURL,"openIde");e.s(["openIde",0,r],76173);let a=(0,t.createServerReference)("40bba3b283f9d9d9fdab42150d5ee8cc6d0bc7bc98",t.callServer,void 0,t.findSourceMapURL,"openShell");e.s(["openShell",0,a],40854);let l=(0,t.createServerReference)("40980e971dcf9ec3dbc94bb530594772aa913eeaef",t.callServer,void 0,t.findSourceMapURL,"openFolder");e.s(["openFolder",0,l],57945)},58481,e=>{"use strict";let t=(0,e.i(3645).default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);e.s(["AlertTriangle",0,t],58481)},97667,e=>{"use strict";var t=e.i(1012);e.s(["CheckIcon",()=>t.default])},95812,35e3,e=>{"use strict";let t=(0,e.i(3645).default)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["Circle",0,t],95812);var r=e.i(80986);e.s(["CheckCircle2",()=>r.default],35e3)},3214,e=>{"use strict";let t=(0,e.i(3645).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",0,t],3214)},61569,e=>{"use strict";let t=(0,e.i(3645).default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);e.s(["default",0,t])},54793,7729,e=>{"use strict";var t=e.i(96871),r=e.i(31777);e.s(["EmptyState",0,function({icon:e,title:a,description:l,action:c,className:s,...i}){return(0,t.jsxs)("div",{className:(0,r.cn)("flex flex-col items-center gap-4 px-4 py-12 text-center",s),...i,children:[e?(0,t.jsx)("div",{className:"text-muted-foreground",children:e}):null,(0,t.jsx)("h3",{className:"text-lg font-semibold",children:a}),l?(0,t.jsx)("p",{className:"text-muted-foreground max-w-md text-sm",children:l}):null,c?(0,t.jsx)("div",{className:"mt-2",children:c}):null]})}],7729),e.s([],54793)},91925,e=>{"use strict";let t=(0,e.i(3645).default)("folder-plus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);e.s(["FolderPlus",0,t],91925)},31696,e=>{"use strict";var t=e.i(96976);let r=(0,t.createServerReference)("408effa8880314dd59fb31ad0001aa8651a9e3a293",t.callServer,void 0,t.findSourceMapURL,"addRepository");e.s(["addRepository",0,r])}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,74442,e=>{"use strict";var t=e.i(16539),r=e.i(97093),a=e.i(62794),l=e.i(33328),c=e.i(96976);let s=(0,c.createServerReference)("4017024772e38a9b1e3fbbe9c98ab2b8ab488ed38d",c.callServer,void 0,c.findSourceMapURL,"syncRepository");e.s(["useRepositoryActions",0,function(e){let[c,i]=(0,t.useState)(!1),[u,n]=(0,t.useState)(!1),[d,o]=(0,t.useState)(!1),[p,h]=(0,t.useState)(!1),[y,f]=(0,t.useState)(null),[m,k]=(0,t.useState)(null),[v,b]=(0,t.useState)(null),[x,S]=(0,t.useState)(null),M=(0,t.useRef)(null),R=(0,t.useRef)(null),g=(0,t.useRef)(null),C=(0,t.useRef)(null);(0,t.useEffect)(()=>()=>{M.current&&clearTimeout(M.current),R.current&&clearTimeout(R.current),g.current&&clearTimeout(g.current),C.current&&clearTimeout(C.current)},[]);let T=(0,t.useCallback)(async(t,r,a,l,c)=>{if(e&&!c){l.current&&clearTimeout(l.current),r(!0),a(null);try{let e=await t();if(!e.success){let t=e.error??"An unexpected error occurred";a(t),l.current=setTimeout(()=>a(null),5e3)}}catch(e){a(e instanceof Error?e.message:"An unexpected error occurred"),l.current=setTimeout(()=>a(null),5e3)}finally{r(!1)}}},[e]);return{openInIde:(0,t.useCallback)(()=>T(()=>(0,r.openIde)({repositoryPath:e.repositoryPath}),i,f,M,c),[T,c,e]),openInShell:(0,t.useCallback)(()=>T(()=>(0,a.openShell)({repositoryPath:e.repositoryPath}),n,k,R,u),[T,u,e]),openFolder:(0,t.useCallback)(()=>T(()=>(0,l.openFolder)(e.repositoryPath),o,b,g,d),[T,d,e]),syncMain:(0,t.useCallback)(()=>T(()=>s(e.repositoryId??""),h,S,C,p),[T,p,e]),ideLoading:c,shellLoading:u,folderLoading:d,syncLoading:p,ideError:y,shellError:m,folderError:v,syncError:x}}],74442)},49228,e=>{"use strict";let t=(0,e.i(3645).default)("git-branch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);e.s(["GitBranch",0,t],49228)},30702,e=>{"use strict";let t=(0,e.i(3645).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",0,t],30702)},38573,e=>{"use strict";let t=(0,e.i(3645).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",0,t],38573)},1650,e=>{"use strict";e.i(11495),e.s([])},19933,e=>{"use strict";let t=(0,e.i(3645).default)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);e.s(["FolderOpen",0,t],19933)},37260,e=>{"use strict";let t=(0,e.i(3645).default)("archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);e.s(["Archive",0,t],37260)},8986,e=>{"use strict";let t=(0,e.i(3645).default)("code-xml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);e.s(["Code2",0,t],8986)},65530,e=>{"use strict";let t=(0,e.i(3645).default)("git-commit-horizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);e.s(["GitCommitHorizontal",0,t],65530)},97093,62794,33328,e=>{"use strict";var t=e.i(96976);let r=(0,t.createServerReference)("4009bb066df82b47adcb57237f3f4e338726c11294",t.callServer,void 0,t.findSourceMapURL,"openIde");e.s(["openIde",0,r],97093);let a=(0,t.createServerReference)("407b7ef3bcae0730612ba3dd73081c19fc9c614bd6",t.callServer,void 0,t.findSourceMapURL,"openShell");e.s(["openShell",0,a],62794);let l=(0,t.createServerReference)("40e7a6cda217260e3b033ec160669d9eb291dfb7c6",t.callServer,void 0,t.findSourceMapURL,"openFolder");e.s(["openFolder",0,l],33328)},58481,e=>{"use strict";let t=(0,e.i(3645).default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);e.s(["AlertTriangle",0,t],58481)},97667,e=>{"use strict";var t=e.i(1012);e.s(["CheckIcon",()=>t.default])},95812,35e3,e=>{"use strict";let t=(0,e.i(3645).default)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["Circle",0,t],95812);var r=e.i(80986);e.s(["CheckCircle2",()=>r.default],35e3)},3214,e=>{"use strict";let t=(0,e.i(3645).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",0,t],3214)},61569,e=>{"use strict";let t=(0,e.i(3645).default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);e.s(["default",0,t])},54793,7729,e=>{"use strict";var t=e.i(96871),r=e.i(31777);e.s(["EmptyState",0,function({icon:e,title:a,description:l,action:c,className:s,...i}){return(0,t.jsxs)("div",{className:(0,r.cn)("flex flex-col items-center gap-4 px-4 py-12 text-center",s),...i,children:[e?(0,t.jsx)("div",{className:"text-muted-foreground",children:e}):null,(0,t.jsx)("h3",{className:"text-lg font-semibold",children:a}),l?(0,t.jsx)("p",{className:"text-muted-foreground max-w-md text-sm",children:l}):null,c?(0,t.jsx)("div",{className:"mt-2",children:c}):null]})}],7729),e.s([],54793)},91925,e=>{"use strict";let t=(0,e.i(3645).default)("folder-plus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);e.s(["FolderPlus",0,t],91925)},34629,e=>{"use strict";var t=e.i(96976);let r=(0,t.createServerReference)("40183536720a1fbb25a5eb2a2d8d4183286275d9e3",t.callServer,void 0,t.findSourceMapURL,"addRepository");e.s(["addRepository",0,r])}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,41952,e=>{"use strict";var t=e.i(96871),i=e.i(16539),n=e.i(23925),s=e.i(26370),a=e.i(38573),r=e.i(49228),l=e.i(74294),o=e.i(3645);let c=(0,o.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"}]]),d=(0,o.default)("flag",[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]]),u=(0,o.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 g=e.i(32494);let m=(0,o.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 h=e.i(58860),p=e.i(48109);let f=(0,o.default)("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);var x=e.i(60112);e.i(98026);var v=e.i(50728),b=e.i(31777),w=e.i(47373),j=e.i(96976);let y=(0,j.createServerReference)("4002c50773df6a66d80c66a754b2d564b1c81deb47",j.callServer,void 0,j.findSourceMapURL,"updateSettingsAction");var S=e.i(17406),k=e.i(30342),C=e.i(44229),M=e.i(83902);function N(e){return(0,t.jsx)(C.Code,{className:(0,b.cn)("h-4 w-4",e.className),...e})}function I({className:e}){return(0,t.jsx)(k.default,{src:"/icons/editors/vscode.svg",alt:"VS Code",width:24,height:24,className:(0,b.cn)("rounded-sm object-contain",e)})}function T({className:e}){return(0,t.jsx)(k.default,{src:"/icons/agents/cursor.jpeg",alt:"Cursor",width:24,height:24,className:(0,b.cn)("rounded-sm object-contain",e)})}function A({className:e}){return(0,t.jsx)(k.default,{src:"/icons/editors/windsurf.svg",alt:"Windsurf",width:24,height:24,className:(0,b.cn)("rounded-sm object-contain",e)})}function D({className:e}){return(0,t.jsx)(k.default,{src:"/icons/editors/zed.svg",alt:"Zed",width:24,height:24,className:(0,b.cn)("rounded-sm object-contain",e)})}function F({className:e,...i}){return(0,t.jsx)(M.Rocket,{className:(0,b.cn)("h-4 w-4",e),...i})}I.displayName="VsCodeIcon",T.displayName="CursorEditorIcon",A.displayName="WindsurfIcon",D.displayName="ZedIcon",F.displayName="AntigravityIcon";let P={vscode:I,cursor:T,windsurf:A,zed:D,antigravity:F};var E=e.i(9749),R=e.i(956),z=e.i(41957);let B=[{value:S.Language.English,label:"English",nativeName:"English"},{value:S.Language.Russian,label:"Русский",nativeName:"Русский"},{value:S.Language.Portuguese,label:"Português",nativeName:"Português"},{value:S.Language.Spanish,label:"Español",nativeName:"Español"},{value:S.Language.Arabic,label:"العربية",nativeName:"العربية"},{value:S.Language.Hebrew,label:"עברית",nativeName:"עברית"},{value:S.Language.French,label:"Français",nativeName:"Français"},{value:S.Language.German,label:"Deutsch",nativeName:"Deutsch"}];function L({language:e}){let{t:s,i18n:a}=(0,v.useTranslation)("web"),[r,l]=(0,i.useState)(e),[o,c]=(0,i.useTransition)(),[d,u]=(0,i.useState)(!1),m=(0,i.useRef)(!1);return(0,i.useEffect)(()=>{if(m.current&&!o){u(!0);let e=setTimeout(()=>u(!1),2e3);return()=>clearTimeout(e)}m.current=o},[o]),(0,t.jsxs)(R.Card,{id:"language",className:"scroll-mt-6","data-testid":"language-settings-section",children:[(0,t.jsxs)(R.CardHeader,{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(g.Globe,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)(R.CardTitle,{children:s("settings.language.title")})]}),o?(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:s("common:labels.saving")}):null,d&&!o?(0,t.jsxs)("span",{className:"flex items-center gap-1 text-xs text-green-600",children:[(0,t.jsx)(n.Check,{className:"h-3 w-3"}),s("common:labels.saved")]}):null]}),(0,t.jsx)(R.CardDescription,{children:s("settings.language.description")})]}),(0,t.jsx)(R.CardContent,{className:"space-y-4",children:(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(z.Label,{htmlFor:"display-language",children:s("settings.language.label")}),(0,t.jsxs)(w.Select,{value:r,onValueChange:function(e){l(e),a.changeLanguage(e);let t="ar"===e||"he"===e?"rtl":"ltr";document.documentElement.lang=e,document.documentElement.dir=t,c(async()=>{let t=await y({user:{preferredLanguage:e}});t.success||x.toast.error(t.error??s("settings.language.failedToSave","Failed to save language settings"))})},children:[(0,t.jsx)(w.SelectTrigger,{id:"display-language","data-testid":"language-select",children:(0,t.jsx)(w.SelectValue,{placeholder:s("settings.language.placeholder")})}),(0,t.jsx)(w.SelectContent,{children:B.map(e=>(0,t.jsx)(w.SelectItem,{value:e.value,children:e.nativeName},e.value))})]})]})})]})}var _=e.i(61569),_=_,K=e.i(3214),V=e.i(30702),W=e.i(51911);function H({label:e,description:i,htmlFor:n,children:s}){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)(z.Label,{htmlFor:n,className:"cursor-pointer text-sm font-normal whitespace-nowrap",children:e}),i?(0,t.jsx)("p",{className:"text-muted-foreground text-[11px] leading-tight",children:i}):null]}),(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:s})]})}function O({label:e,description:i,id:n,testId:s,checked:a,onChange:r,disabled:l}){return(0,t.jsx)(H,{label:e,description:i,htmlFor:n,children:(0,t.jsx)(W.Switch,{id:n,"data-testid":s,checked:a,onCheckedChange:r,disabled:l,className:(0,b.cn)("cursor-pointer",l&&"cursor-not-allowed opacity-50")})})}function q({icon:e,title:i,description:n,badge:s,testId:a,children:r}){return(0,t.jsxs)("div",{className:"bg-background rounded-lg border","data-testid":a,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:i}),s?(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:s}):null]}),(0,t.jsx)("p",{className:"text-muted-foreground mt-0.5 text-[11px]",children:n})]}),(0,t.jsx)("div",{className:"px-4",children:r})]})}function G({id:e,testId:i,value:n,onChange:s,onBlur:a,placeholder:r,min:l=1,max:o,step:c=1,suffix:d}){let{t:u}=(0,v.useTranslation)("web"),g=""===n?void 0:parseInt(n,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:()=>{s(String(Math.max(l,(g??parseInt(r,10))-c)))},onMouseUp:a,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":u("common.decrease"),children:(0,t.jsx)(_.default,{className:"h-3 w-3"})}),(0,t.jsx)("input",{id:e,"data-testid":i,type:"text",inputMode:"numeric",pattern:"[0-9]*",value:n,placeholder:r,onChange:e=>{s(e.target.value.replace(/[^0-9]/g,""))},onBlur:a,className:"h-8 w-14 bg-transparent text-center text-xs outline-none"}),(0,t.jsx)("button",{type:"button",onClick:()=>{let e;e=g??parseInt(r,10),s(String(null!=o?Math.min(o,e+c):e+c))},onMouseUp:a,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":u("common.increase"),children:(0,t.jsx)(K.Plus,{className:"h-3 w-3"})})]}),d?(0,t.jsx)("span",{className:"text-muted-foreground text-[11px]",children:d}):null]})}function U({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 $({children:e,links:i}){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!=i&&i.length>0?(0,t.jsx)("div",{className:"mt-2 flex flex-col gap-1",children:i.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)(V.ExternalLink,{className:"h-2.5 w-2.5"}),e.label]},e.href))}):null]})}function Z(e){if(""===e)return;let t=parseInt(e,10);return Number.isNaN(t)||t<=0?void 0:t}function X({settings:e}){let{t:n}=(0,v.useTranslation)("web"),[,s]=(0,i.useTransition)(),[a,r]=(0,i.useState)(null!=e.workflow.ciMaxFixAttempts?String(e.workflow.ciMaxFixAttempts):""),[o,c]=(0,i.useState)(null!=e.workflow.ciWatchTimeoutMs?String(Math.round(e.workflow.ciWatchTimeoutMs/1e3)):""),[d,u]=(0,i.useState)(null!=e.workflow.ciLogMaxChars?String(e.workflow.ciLogMaxChars):""),[g,m]=(0,i.useState)(null!=e.workflow.ciWatchPollIntervalSeconds?String(e.workflow.ciWatchPollIntervalSeconds):""),[h,p]=(0,i.useState)(!1!==e.workflow.hideCiStatus),f=null!=e.workflow.ciMaxFixAttempts?String(e.workflow.ciMaxFixAttempts):"",b=null!=e.workflow.ciWatchTimeoutMs?String(Math.round(e.workflow.ciWatchTimeoutMs/1e3)):"",w=null!=e.workflow.ciLogMaxChars?String(e.workflow.ciLogMaxChars):"",j=null!=e.workflow.ciWatchPollIntervalSeconds?String(e.workflow.ciWatchPollIntervalSeconds):"";function S(e){s(async()=>{let t=await y(e);t.success||x.toast.error(t.error??n("settings.failedToSave"))})}function k(e){let t=Z(e.ciTimeout??o);return{workflow:{ciMaxFixAttempts:Z(e.ciMaxFix??a),ciWatchTimeoutMs:null!=t?1e3*t:void 0,ciLogMaxChars:Z(e.ciLogMax??d),ciWatchPollIntervalSeconds:Z(e.ciPollInterval??g),hideCiStatus:e.hideCiStatus??h}}}return(0,t.jsxs)(q,{icon:l.Activity,title:n("settings.ci.title"),description:n("settings.ci.description"),testId:"ci-settings-section",children:[(0,t.jsx)(H,{label:n("settings.ci.maxFixAttempts"),description:n("settings.ci.maxFixAttemptsDescription"),htmlFor:"ci-max-fix",children:(0,t.jsx)(G,{id:"ci-max-fix",testId:"ci-max-fix-input",placeholder:"3",value:a,onChange:r,onBlur:()=>{a!==f&&S(k({ciMaxFix:a}))},min:1,max:10})}),(0,t.jsx)(H,{label:n("settings.ci.watchTimeout"),description:n("settings.ci.watchTimeoutDescription"),htmlFor:"ci-timeout",children:(0,t.jsx)(G,{id:"ci-timeout",testId:"ci-timeout-input",placeholder:"300",value:o,onChange:c,onBlur:()=>{o!==b&&S(k({ciTimeout:o}))},min:30,step:30,suffix:"sec"})}),(0,t.jsx)(H,{label:n("settings.ci.maxLogSize"),description:n("settings.ci.maxLogSizeDescription"),htmlFor:"ci-log-max",children:(0,t.jsx)(G,{id:"ci-log-max",testId:"ci-log-max-input",placeholder:"50000",value:d,onChange:u,onBlur:()=>{d!==w&&S(k({ciLogMax:d}))},min:1e3,step:5e3,suffix:"chars"})}),(0,t.jsx)(H,{label:n("settings.ci.pollInterval"),description:n("settings.ci.pollIntervalDescription"),htmlFor:"ci-poll-interval",children:(0,t.jsx)(G,{id:"ci-poll-interval",testId:"ci-poll-interval-input",placeholder:"30",value:g,onChange:m,onBlur:()=>{g!==j&&S(k({ciPollInterval:g}))},min:5,step:5,suffix:"sec"})}),(0,t.jsx)(O,{label:n("settings.ci.hideCiStatus"),description:n("settings.ci.hideCiStatusDescription"),id:"hide-ci-status",testId:"switch-hide-ci-status",checked:h,onChange:e=>{p(e),S(k({hideCiStatus:e}))}})]})}var Y=e.i(27069),J=e.i(91967),Q=e.i(22353),ee=e.i(9413),et=e.i(36567),ei=e.i(75649),en=e.i(9641),es=e.i(70391),ea=e.i(85565),er=e.i(87099),el=["PageUp","PageDown"],eo=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ec={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},ed="Slider",[eu,eg,em]=(0,er.createCollection)(ed),[eh,ep]=(0,ee.createContextScope)(ed,[em]),[ef,ex]=eh(ed),ev=i.forwardRef((e,n)=>{let{name:s,min:a=0,max:r=100,step:l=1,orientation:o="horizontal",disabled:c=!1,minStepsBetweenThumbs:d=0,defaultValue:u=[a],value:g,onValueChange:m=()=>{},onValueCommit:h=()=>{},inverted:p=!1,form:f,...x}=e,v=i.useRef(new Set),b=i.useRef(0),w="horizontal"===o,[j=[],y]=(0,et.useControllableState)({prop:g,defaultProp:u,onChange:e=>{let t=[...v.current];t[b.current]?.focus(),m(e)}}),S=i.useRef(j);function k(e,t,{commit:i}={commit:!1}){let n,s=(String(l).split(".")[1]||"").length,o=Math.round((Math.round((e-a)/l)*l+a)*(n=Math.pow(10,s)))/n,c=(0,Y.clamp)(o,[a,r]);y((e=[])=>{let n=function(e=[],t,i){let n=[...e];return n[i]=t,n.sort((e,t)=>e-t)}(e,c,t);if(!function(e,t){if(t>0)return Math.min(...e.slice(0,-1).map((t,i)=>e[i+1]-t))>=t;return!0}(n,d*l))return e;{b.current=n.indexOf(c);let t=String(n)!==String(e);return t&&i&&h(n),t?n:e}})}return(0,t.jsx)(ef,{scope:e.__scopeSlider,name:s,disabled:c,min:a,max:r,valueIndexToChangeRef:b,thumbs:v.current,values:j,orientation:o,form:f,children:(0,t.jsx)(eu.Provider,{scope:e.__scopeSlider,children:(0,t.jsx)(eu.Slot,{scope:e.__scopeSlider,children:(0,t.jsx)(w?ej:ey,{"aria-disabled":c,"data-disabled":c?"":void 0,...x,ref:n,onPointerDown:(0,J.composeEventHandlers)(x.onPointerDown,()=>{c||(S.current=j)}),min:a,max:r,inverted:p,onSlideStart:c?void 0:function(e){let t=function(e,t){if(1===e.length)return 0;let i=e.map(e=>Math.abs(e-t)),n=Math.min(...i);return i.indexOf(n)}(j,e);k(e,t)},onSlideMove:c?void 0:function(e){k(e,b.current)},onSlideEnd:c?void 0:function(){let e=S.current[b.current];j[b.current]!==e&&h(j)},onHomeKeyDown:()=>!c&&k(a,0,{commit:!0}),onEndKeyDown:()=>!c&&k(r,j.length-1,{commit:!0}),onStepKeyDown:({event:e,direction:t})=>{if(!c){let i=el.includes(e.key)||e.shiftKey&&eo.includes(e.key),n=b.current;k(j[n]+l*(i?10:1)*t,n,{commit:!0})}}})})})})});ev.displayName=ed;var[eb,ew]=eh(ed,{startEdge:"left",endEdge:"right",size:"width",direction:1}),ej=i.forwardRef((e,n)=>{let{min:s,max:a,dir:r,inverted:l,onSlideStart:o,onSlideMove:c,onSlideEnd:d,onStepKeyDown:u,...g}=e,[m,h]=i.useState(null),p=(0,Q.useComposedRefs)(n,e=>h(e)),f=i.useRef(void 0),x=(0,ei.useDirection)(r),v="ltr"===x,b=v&&!l||!v&&l;function w(e){let t=f.current||m.getBoundingClientRect(),i=eP([0,t.width],b?[s,a]:[a,s]);return f.current=t,i(e-t.left)}return(0,t.jsx)(eb,{scope:e.__scopeSlider,startEdge:b?"left":"right",endEdge:b?"right":"left",direction:b?1:-1,size:"width",children:(0,t.jsx)(eS,{dir:x,"data-orientation":"horizontal",...g,ref:p,style:{...g.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:e=>{let t=w(e.clientX);o?.(t)},onSlideMove:e=>{let t=w(e.clientX);c?.(t)},onSlideEnd:()=>{f.current=void 0,d?.()},onStepKeyDown:e=>{let t=ec[b?"from-left":"from-right"].includes(e.key);u?.({event:e,direction:t?-1:1})}})})}),ey=i.forwardRef((e,n)=>{let{min:s,max:a,inverted:r,onSlideStart:l,onSlideMove:o,onSlideEnd:c,onStepKeyDown:d,...u}=e,g=i.useRef(null),m=(0,Q.useComposedRefs)(n,g),h=i.useRef(void 0),p=!r;function f(e){let t=h.current||g.current.getBoundingClientRect(),i=eP([0,t.height],p?[a,s]:[s,a]);return h.current=t,i(e-t.top)}return(0,t.jsx)(eb,{scope:e.__scopeSlider,startEdge:p?"bottom":"top",endEdge:p?"top":"bottom",size:"height",direction:p?1:-1,children:(0,t.jsx)(eS,{"data-orientation":"vertical",...u,ref:m,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:e=>{let t=f(e.clientY);l?.(t)},onSlideMove:e=>{let t=f(e.clientY);o?.(t)},onSlideEnd:()=>{h.current=void 0,c?.()},onStepKeyDown:e=>{let t=ec[p?"from-bottom":"from-top"].includes(e.key);d?.({event:e,direction:t?-1:1})}})})}),eS=i.forwardRef((e,i)=>{let{__scopeSlider:n,onSlideStart:s,onSlideMove:a,onSlideEnd:r,onHomeKeyDown:l,onEndKeyDown:o,onStepKeyDown:c,...d}=e,u=ex(ed,n);return(0,t.jsx)(ea.Primitive.span,{...d,ref:i,onKeyDown:(0,J.composeEventHandlers)(e.onKeyDown,e=>{"Home"===e.key?(l(e),e.preventDefault()):"End"===e.key?(o(e),e.preventDefault()):el.concat(eo).includes(e.key)&&(c(e),e.preventDefault())}),onPointerDown:(0,J.composeEventHandlers)(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),u.thumbs.has(t)?t.focus():s(e)}),onPointerMove:(0,J.composeEventHandlers)(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&a(e)}),onPointerUp:(0,J.composeEventHandlers)(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),r(e))})})}),ek="SliderTrack",eC=i.forwardRef((e,i)=>{let{__scopeSlider:n,...s}=e,a=ex(ek,n);return(0,t.jsx)(ea.Primitive.span,{"data-disabled":a.disabled?"":void 0,"data-orientation":a.orientation,...s,ref:i})});eC.displayName=ek;var eM="SliderRange",eN=i.forwardRef((e,n)=>{let{__scopeSlider:s,...a}=e,r=ex(eM,s),l=ew(eM,s),o=i.useRef(null),c=(0,Q.useComposedRefs)(n,o),d=r.values.length,u=r.values.map(e=>eF(e,r.min,r.max)),g=d>1?Math.min(...u):0,m=100-Math.max(...u);return(0,t.jsx)(ea.Primitive.span,{"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,...a,ref:c,style:{...e.style,[l.startEdge]:g+"%",[l.endEdge]:m+"%"}})});eN.displayName=eM;var eI="SliderThumb",eT=i.forwardRef((e,n)=>{let s=eg(e.__scopeSlider),[a,r]=i.useState(null),l=(0,Q.useComposedRefs)(n,e=>r(e)),o=i.useMemo(()=>a?s().findIndex(e=>e.ref.current===a):-1,[s,a]);return(0,t.jsx)(eA,{...e,ref:l,index:o})}),eA=i.forwardRef((e,n)=>{var s,a,r,l,o;let c,d,{__scopeSlider:u,index:g,name:m,...h}=e,p=ex(eI,u),f=ew(eI,u),[x,v]=i.useState(null),b=(0,Q.useComposedRefs)(n,e=>v(e)),w=!x||p.form||!!x.closest("form"),j=(0,es.useSize)(x),y=p.values[g],S=void 0===y?0:eF(y,p.min,p.max),k=(s=g,(a=p.values.length)>2?`Value ${s+1} of ${a}`:2===a?["Minimum","Maximum"][s]:void 0),C=j?.[f.size],M=C?(r=C,l=S,o=f.direction,d=eP([0,50],[0,c=r/2]),(c-d(l)*o)*o):0;return i.useEffect(()=>{if(x)return p.thumbs.add(x),()=>{p.thumbs.delete(x)}},[x,p.thumbs]),(0,t.jsxs)("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[f.startEdge]:`calc(${S}% + ${M}px)`},children:[(0,t.jsx)(eu.ItemSlot,{scope:e.__scopeSlider,children:(0,t.jsx)(ea.Primitive.span,{role:"slider","aria-label":e["aria-label"]||k,"aria-valuemin":p.min,"aria-valuenow":y,"aria-valuemax":p.max,"aria-orientation":p.orientation,"data-orientation":p.orientation,"data-disabled":p.disabled?"":void 0,tabIndex:p.disabled?void 0:0,...h,ref:b,style:void 0===y?{display:"none"}:e.style,onFocus:(0,J.composeEventHandlers)(e.onFocus,()=>{p.valueIndexToChangeRef.current=g})})}),w&&(0,t.jsx)(eD,{name:m??(p.name?p.name+(p.values.length>1?"[]":""):void 0),form:p.form,value:y},g)]})});eT.displayName=eI;var eD=i.forwardRef(({__scopeSlider:e,value:n,...s},a)=>{let r=i.useRef(null),l=(0,Q.useComposedRefs)(r,a),o=(0,en.usePrevious)(n);return i.useEffect(()=>{let e=r.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value").set;if(o!==n&&t){let i=new Event("input",{bubbles:!0});t.call(e,n),e.dispatchEvent(i)}},[o,n]),(0,t.jsx)(ea.Primitive.input,{style:{display:"none"},...s,ref:l,defaultValue:n})});function eF(e,t,i){return(0,Y.clamp)(100/(i-t)*(e-t),[0,100])}function eP(e,t){return i=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(i-e[0])}}eD.displayName="RadioBubbleInput",e.s(["Range",0,eN,"Root",0,ev,"Slider",0,ev,"SliderRange",0,eN,"SliderThumb",0,eT,"SliderTrack",0,eC,"Thumb",0,eT,"Track",0,eC,"createSliderScope",0,ep],98207);var eE=e.i(98207),eE=eE;function eR({className:e,defaultValue:n,value:s,min:a=0,max:r=100,...l}){let o=i.useMemo(()=>Array.isArray(s)?s:Array.isArray(n)?n:[a,r],[s,n,a,r]);return(0,t.jsxs)(eE.Root,{"data-slot":"slider",defaultValue:n,value:s,min:a,max:r,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)(eE.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)(eE.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:o.length},(e,i)=>(0,t.jsx)(eE.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"},i))]})}let ez=[60,120,300,600,900,1800,2700,3600,7200,10800,14400,21600,28800,43200,86400],eB=ez.length-1;function eL(e){let t=0,i=Math.abs(e-ez[0]);for(let n=1;n<ez.length;n++){let s=Math.abs(e-ez[n]);s<i&&(i=s,t=n)}return t}function e_({id:e,testId:n,value:s,onChange:a,onBlur:r,defaultSeconds:l=1800}){var o;let c,d,u=(""===s?l:parseInt(s,10))||l,[g,m]=(0,i.useState)(()=>eL(u)),h=eL(u);h!==g&&ez[g]!==u&&m(h);let p=(0,i.useCallback)(([e])=>{m(e),a(String(ez[e]))},[a]);return(0,t.jsxs)("div",{className:"flex w-55 items-center gap-2",children:[(0,t.jsx)(eR,{id:e,"data-testid":n,min:0,max:eB,step:1,value:[g],onValueChange:p,onValueCommit:()=>r(),className:"min-w-0 flex-1"}),(0,t.jsx)("span",{className:"text-muted-foreground shrink-0 text-end text-xs tabular-nums",children:(c=Math.floor((o=ez[g])/3600),d=Math.round(o%3600/60),0===c?`${d}m`:0===d?`${c}h`:`${c}h ${d}m`)})]})}function eK(e){if(void 0===e)return;let t=function(e){if(""===e)return;let t=parseInt(e,10);return Number.isNaN(t)||t<=0?void 0:t}(e);return null!=t?1e3*t:void 0}function eV({settings:e}){let{t:n}=(0,v.useTranslation)("web"),[,s]=(0,i.useTransition)(),a=e.workflow.stageTimeouts,r=e.workflow.analyzeRepoTimeouts,[l,o]=(0,i.useState)(String(Math.round((a?.analyzeMs??18e5)/1e3))),[c,d]=(0,i.useState)(String(Math.round((a?.requirementsMs??18e5)/1e3))),[u,g]=(0,i.useState)(String(Math.round((a?.researchMs??18e5)/1e3))),[m,p]=(0,i.useState)(String(Math.round((a?.planMs??18e5)/1e3))),[f,b]=(0,i.useState)(String(Math.round((a?.implementMs??18e5)/1e3))),[w,j]=(0,i.useState)(String(Math.round((a?.mergeMs??18e5)/1e3))),[S,k]=(0,i.useState)(String(Math.round((r?.analyzeMs??6e5)/1e3))),C=a?.analyzeMs!=null?String(Math.round(a.analyzeMs/1e3)):"",M=a?.requirementsMs!=null?String(Math.round(a.requirementsMs/1e3)):"",N=a?.researchMs!=null?String(Math.round(a.researchMs/1e3)):"",I=a?.planMs!=null?String(Math.round(a.planMs/1e3)):"",T=a?.implementMs!=null?String(Math.round(a.implementMs/1e3)):"",A=a?.mergeMs!=null?String(Math.round(a.mergeMs/1e3)):"",D=r?.analyzeMs!=null?String(Math.round(r.analyzeMs/1e3)):"";function F(e){return{workflow:{stageTimeouts:{analyzeMs:eK(e.analyzeTimeout??l),requirementsMs:eK(e.requirementsTimeout??c),researchMs:eK(e.researchTimeout??u),planMs:eK(e.planTimeout??m),implementMs:eK(e.implementTimeout??f),mergeMs:eK(e.mergeTimeout??w)},analyzeRepoTimeouts:{analyzeMs:eK(e.analyzeRepoTimeout??S)}}}}function P(e){s(async()=>{let t=await y(e);t.success||x.toast.error(t.error??n("settings.failedToSave"))})}return(0,t.jsxs)(q,{icon:h.Timer,title:n("settings.stageTimeouts.title"),description:n("settings.stageTimeouts.description"),testId:"stage-timeouts-settings-section",children:[(0,t.jsx)(U,{children:n("settings.stageTimeouts.subsections.featureAgent")}),(0,t.jsx)(H,{label:n("settings.stageTimeouts.analyze"),description:n("settings.stageTimeouts.analyzeDescription"),htmlFor:"timeout-analyze",children:(0,t.jsx)(e_,{id:"timeout-analyze",testId:"timeout-analyze-input",value:l,onChange:o,onBlur:()=>{l!==C&&P(F({analyzeTimeout:l}))},defaultSeconds:1800})}),(0,t.jsx)(H,{label:n("settings.stageTimeouts.requirements"),description:n("settings.stageTimeouts.requirementsDescription"),htmlFor:"timeout-requirements",children:(0,t.jsx)(e_,{id:"timeout-requirements",testId:"timeout-requirements-input",value:c,onChange:d,onBlur:()=>{c!==M&&P(F({requirementsTimeout:c}))},defaultSeconds:1800})}),(0,t.jsx)(H,{label:n("settings.stageTimeouts.research"),description:n("settings.stageTimeouts.researchDescription"),htmlFor:"timeout-research",children:(0,t.jsx)(e_,{id:"timeout-research",testId:"timeout-research-input",value:u,onChange:g,onBlur:()=>{u!==N&&P(F({researchTimeout:u}))},defaultSeconds:1800})}),(0,t.jsx)(H,{label:n("settings.stageTimeouts.plan"),description:n("settings.stageTimeouts.planDescription"),htmlFor:"timeout-plan",children:(0,t.jsx)(e_,{id:"timeout-plan",testId:"timeout-plan-input",value:m,onChange:p,onBlur:()=>{m!==I&&P(F({planTimeout:m}))},defaultSeconds:1800})}),(0,t.jsx)(H,{label:n("settings.stageTimeouts.implement"),description:n("settings.stageTimeouts.implementDescription"),htmlFor:"timeout-implement",children:(0,t.jsx)(e_,{id:"timeout-implement",testId:"timeout-implement-input",value:f,onChange:b,onBlur:()=>{f!==T&&P(F({implementTimeout:f}))},defaultSeconds:1800})}),(0,t.jsx)(H,{label:n("settings.stageTimeouts.merge"),description:n("settings.stageTimeouts.mergeDescription"),htmlFor:"timeout-merge",children:(0,t.jsx)(e_,{id:"timeout-merge",testId:"timeout-merge-input",value:w,onChange:j,onBlur:()=>{w!==A&&P(F({mergeTimeout:w}))},defaultSeconds:1800})}),(0,t.jsx)(U,{children:n("settings.stageTimeouts.subsections.analyzeRepoAgent")}),(0,t.jsx)(H,{label:n("settings.stageTimeouts.analyze"),description:n("settings.stageTimeouts.analyzeDescription"),htmlFor:"timeout-analyze-repo",children:(0,t.jsx)(e_,{id:"timeout-analyze-repo",testId:"timeout-analyze-repo-input",value:S,onChange:k,onBlur:()=>{S!==D&&P(F({analyzeRepoTimeout:S}))},defaultSeconds:600})})]})}function eW({settings:e}){let{t:n}=(0,v.useTranslation)("web"),[,s]=(0,i.useTransition)(),a=e.interactiveAgent??{enabled:!0,autoTimeoutMinutes:15,maxConcurrentSessions:3},[r,l]=(0,i.useState)(a.enabled),[o,c]=(0,i.useState)(String(a.autoTimeoutMinutes)),[d,u]=(0,i.useState)(String(a.maxConcurrentSessions));function g(e){s(async()=>{let t=await y(e);t.success||x.toast.error(t.error??n("settings.failedToSave"))})}return(0,t.jsxs)(q,{icon:p.MessageSquare,title:n("settings.interactiveAgent.title"),description:n("settings.interactiveAgent.description"),testId:"interactive-agent-settings-section",children:[(0,t.jsx)(O,{label:n("settings.interactiveAgent.enableChatTab"),description:n("settings.interactiveAgent.enableChatTabDescription"),id:"interactive-agent-enabled",testId:"switch-interactive-agent-enabled",checked:r,onChange:e=>{l(e),g({interactiveAgent:{enabled:e,autoTimeoutMinutes:parseInt(o,10)||15,maxConcurrentSessions:parseInt(d,10)||3}})}}),(0,t.jsx)(H,{label:n("settings.interactiveAgent.autoTimeout"),description:n("settings.interactiveAgent.autoTimeoutDescription"),htmlFor:"interactive-agent-timeout",children:(0,t.jsx)(G,{id:"interactive-agent-timeout",testId:"input-interactive-agent-timeout",value:o,placeholder:"15",min:1,max:120,suffix:"min",onChange:c,onBlur:()=>{let e=parseInt(o,10),t=Number.isNaN(e)?15:Math.min(120,Math.max(1,e));c(String(t)),g({interactiveAgent:{enabled:r,autoTimeoutMinutes:t,maxConcurrentSessions:parseInt(d,10)||3}})}})}),(0,t.jsx)(H,{label:n("settings.interactiveAgent.maxConcurrentSessions"),description:n("settings.interactiveAgent.maxConcurrentSessionsDescription"),htmlFor:"interactive-agent-sessions",children:(0,t.jsx)(G,{id:"interactive-agent-sessions",testId:"input-interactive-agent-sessions",value:d,placeholder:"3",min:1,max:10,onChange:u,onBlur:()=>{let e=parseInt(d,10),t=Number.isNaN(e)?3:Math.min(10,Math.max(1,e));u(String(t)),g({interactiveAgent:{enabled:r,autoTimeoutMinutes:parseInt(o,10)||15,maxConcurrentSessions:t}})}})})]})}function eH({settings:e}){let{t:n}=(0,v.useTranslation)("web"),[,s]=(0,i.useTransition)(),a=e.fabLayout??{swapPosition:!1},[r,l]=(0,i.useState)(a.swapPosition);return(0,t.jsx)(q,{icon:f,title:n("settings.fabLayout.title"),description:n("settings.fabLayout.description"),testId:"fab-layout-settings-section",children:(0,t.jsx)(O,{label:n("settings.fabLayout.swapPosition"),description:n("settings.fabLayout.swapPositionDescription"),id:"fab-swap-position",testId:"switch-fab-swap-position",checked:r,onChange:e=>{var t;l(e),t={fabLayout:{swapPosition:e}},s(async()=>{let e=await y(t);e.success||x.toast.error(e.error??n("settings.failedToSave"))})}})})}let eO=[{value:S.EditorType.VsCode,label:"VS Code"},{value:S.EditorType.Cursor,label:"Cursor"},{value:S.EditorType.Windsurf,label:"Windsurf"},{value:S.EditorType.Zed,label:"Zed"},{value:S.EditorType.Antigravity,label:"Antigravity"}],eq=[{value:"bash",label:"Bash"},{value:"zsh",label:"Zsh"},{value:"fish",label:"Fish"}],eG=[{id:"language",labelKey:"settings.sections.language",icon:g.Globe},{id:"agent",labelKey:"settings.sections.agent",icon:s.Bot},{id:"environment",labelKey:"settings.sections.environment",icon:a.Terminal},{id:"workflow",labelKey:"settings.sections.workflow",icon:r.GitBranch},{id:"ci",labelKey:"settings.sections.ci",icon:l.Activity},{id:"stage-timeouts",labelKey:"settings.sections.timeouts",icon:h.Timer},{id:"notifications",labelKey:"settings.sections.notifications",icon:c},{id:"feature-flags",labelKey:"settings.sections.flags",icon:d},{id:"interactive-agent",labelKey:"settings.sections.chat",icon:p.MessageSquare},{id:"fab-layout",labelKey:"settings.sections.layout",icon:f},{id:"database",labelKey:"settings.sections.database",icon:u}];e.s(["SettingsPageClient",0,function({settings:e,shipitAiHome:l,dbFileSize:o,availableTerminals:g}){let{t:h}=(0,v.useTranslation)("web"),{showSaving:p,showSaved:f,save:j}=function(){let{t:e}=(0,v.useTranslation)("web"),[t,n]=(0,i.useTransition)(),[s,a]=(0,i.useState)(!1),[r,l]=(0,i.useState)(!1),o=(0,i.useRef)(null),c=(0,i.useRef)(!1);return(0,i.useEffect)(()=>{t&&!s&&(a(!0),c.current=!1,o.current=setTimeout(()=>{o.current=null,c.current&&(a(!1),l(!0),setTimeout(()=>l(!1),2e3))},350)),!t&&s&&(c.current=!0,o.current||(a(!1),l(!0),setTimeout(()=>l(!1),2e3)))},[t,s]),{showSaving:s,showSaved:r,save:(0,i.useCallback)(t=>{n(async()=>{let i=await y(t);i.success||x.toast.error(i.error??e("settings.failedToSave"))})},[n,e])}}(),k=e.featureFlags??{skills:!1,envDeploy:!1,debug:!1,githubImport:!1,adoptBranch:!1,gitRebaseSync:!1,reactFileManager:!1},[C,M]=(0,i.useState)(e.agent.type),[I,T]=(0,i.useState)(e.environment.defaultEditor),[A,D]=(0,i.useState)(e.environment.shellPreference),[F,R]=(0,i.useState)(e.environment.terminalPreference??S.TerminalType.System),z=g?g.filter(e=>e.available):[{id:S.TerminalType.System,name:h("settings.environment.systemTerminal"),available:!0}],[B,_]=(0,i.useState)(e.workflow.openPrOnImplementationComplete),[K,V]=(0,i.useState)(e.workflow.approvalGateDefaults.pushOnImplementationComplete),[W,Z]=(0,i.useState)(e.workflow.approvalGateDefaults.allowPrd),[Y,J]=(0,i.useState)(e.workflow.approvalGateDefaults.allowPlan),[Q,ee]=(0,i.useState)(e.workflow.approvalGateDefaults.allowMerge),[et,ei]=(0,i.useState)(e.workflow.enableEvidence),[en,es]=(0,i.useState)(e.workflow.commitEvidence),[ea,er]=(0,i.useState)(!1!==e.workflow.ciWatchEnabled),[el,eo]=(0,i.useState)(!1!==e.workflow.defaultFastMode),[ec,ed]=(0,i.useState)((e.workflow.autoArchiveDelayMinutes??10)>0),[eu,eg]=(0,i.useState)(String(e.workflow.autoArchiveDelayMinutes??10)),[em,eh]=(0,i.useState)(e.notifications.inApp.enabled),[ep,ef]=(0,i.useState)({...e.notifications.events}),[ex,ev]=(0,i.useState)({...k});function eb(e={}){let t=e.autoArchiveEnabled??ec,i=parseInt(e.autoArchiveDelay??eu,10);return{workflow:{openPrOnImplementationComplete:e.openPr??B,approvalGateDefaults:{pushOnImplementationComplete:e.pushOnComplete??K,allowPrd:e.allowPrd??W,allowPlan:e.allowPlan??Y,allowMerge:e.allowMerge??Q},enableEvidence:e.enableEvidence??et,commitEvidence:e.commitEvidence??en,ciWatchEnabled:e.ciWatchEnabled??ea,defaultFastMode:e.defaultFastMode??el,autoArchiveDelayMinutes:t?Number.isNaN(i)||i<1?10:i:0}}}function ew(e={}){return{notifications:{inApp:{enabled:e.inApp??em},events:e.events??ep}}}let[ej,ey]=(0,i.useState)("agent");(0,i.useEffect)(()=>{let e=eG.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&&ey(t.target.id.replace("section-",""))},{rootMargin:"-65px 0px -60% 0px",threshold:0});for(let i of e)t.observe(i);return()=>t.disconnect()},[]);let eS=(0,i.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)(m,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("h1",{className:"text-sm font-bold tracking-tight",children:h("settings.title")}),(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",p?"opacity-100":"opacity-0"),children:h("settings.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",f&&!p?"opacity-100":"opacity-0"),children:[(0,t.jsx)(n.Check,{className:"h-3 w-3"}),h("settings.saved")]})]}),(0,t.jsx)("nav",{className:"ml-auto flex items-center gap-0.5",children:eG.map(e=>{let i=e.icon,n=ej===e.id;return(0,t.jsxs)("button",{type:"button",onClick:()=>eS(e.id),className:(0,b.cn)("flex cursor-pointer items-center gap-1 rounded-md px-1.5 py-1 text-[11px] transition-all",n?"bg-accent text-foreground font-medium":"text-muted-foreground/60 hover:text-foreground hover:bg-accent/50"),children:[(0,t.jsx)(i,{className:"h-3 w-3"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:h(e.labelKey)})]},e.id)})})]})}),(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsx)("div",{id:"section-language",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:(0,t.jsx)(L,{language:e.user?.preferredLanguage??S.Language.English})}),(0,t.jsxs)("div",{id:"section-agent",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsx)(q,{icon:s.Bot,title:h("settings.agent.sectionTitle"),description:h("settings.agent.sectionDescription"),testId:"agent-settings-section",children:(0,t.jsx)(H,{label:h("settings.agent.agentAndModel"),description:h("settings.agent.agentAndModelDescription"),htmlFor:"agent-model-picker",children:(0,t.jsx)(E.AgentModelPicker,{initialAgentType:C,initialModel:e.models.default,mode:"settings",onAgentModelChange:e=>M(e),className:"w-55"})})}),(0,t.jsx)($,{links:[{label:h("settings.agent.links.agentSystem"),href:"https://github.com/jrmatherly/shipit/blob/main/docs/architecture/agent-system.md"},{label:h("settings.agent.links.addingAgents"),href:"https://github.com/jrmatherly/shipit/blob/main/docs/development/adding-agents.md"},{label:h("settings.agent.links.configurationGuide"),href:"https://github.com/jrmatherly/shipit/blob/main/docs/guides/configuration.md"}],children:h("settings.agent.hint")})]}),(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)(q,{icon:a.Terminal,title:h("settings.environment.sectionTitle"),description:h("settings.environment.sectionDescription"),testId:"environment-settings-section",children:[(0,t.jsx)(H,{label:h("settings.environment.defaultEditor"),description:h("settings.environment.defaultEditorDescription"),htmlFor:"default-editor",children:(0,t.jsxs)(w.Select,{value:I,onValueChange:e=>{T(e),j({environment:{defaultEditor:e,shellPreference:A,terminalPreference:F}})},children:[(0,t.jsx)(w.SelectTrigger,{id:"default-editor","data-testid":"editor-select",className:"w-55 cursor-pointer text-xs",children:(0,t.jsx)(w.SelectValue,{})}),(0,t.jsx)(w.SelectContent,{children:eO.map(e=>{var i;let n=(i=e.value)&&i in P?P[i]:N;return(0,t.jsx)(w.SelectItem,{value:e.value,children:(0,t.jsxs)("span",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)(n,{className:"h-4 w-4 shrink-0"}),e.label]})},e.value)})})]})}),(0,t.jsx)(H,{label:h("settings.environment.shell"),description:h("settings.environment.shellDescription"),htmlFor:"shell-preference",children:(0,t.jsxs)(w.Select,{value:A,onValueChange:e=>{D(e),j({environment:{defaultEditor:I,shellPreference:e,terminalPreference:F}})},children:[(0,t.jsx)(w.SelectTrigger,{id:"shell-preference","data-testid":"shell-select",className:"w-55 cursor-pointer text-xs",children:(0,t.jsx)(w.SelectValue,{})}),(0,t.jsx)(w.SelectContent,{children:eq.map(e=>(0,t.jsx)(w.SelectItem,{value:e.value,children:e.label},e.value))})]})}),(0,t.jsx)(H,{label:h("settings.environment.terminal"),description:h("settings.environment.terminalDescription"),htmlFor:"terminal-preference",children:(0,t.jsxs)(w.Select,{value:F,onValueChange:e=>{R(e),j({environment:{defaultEditor:I,shellPreference:A,terminalPreference:e}})},children:[(0,t.jsx)(w.SelectTrigger,{id:"terminal-preference","data-testid":"terminal-select",className:"w-55 cursor-pointer text-xs",children:(0,t.jsx)(w.SelectValue,{})}),(0,t.jsx)(w.SelectContent,{children:z.map(e=>(0,t.jsx)(w.SelectItem,{value:e.id,children:e.name},e.id))})]})})]}),(0,t.jsx)($,{links:[{label:h("settings.environment.links.configurationGuide"),href:"https://github.com/jrmatherly/shipit/blob/main/docs/guides/configuration.md"}],children:h("settings.environment.hint")})]}),(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)(q,{icon:r.GitBranch,title:h("settings.workflow.title"),description:h("settings.workflow.sectionDescription"),testId:"workflow-settings-section",children:[(0,t.jsx)(O,{label:h("settings.workflow.defaultFastMode"),description:h("settings.workflow.defaultFastModeDescription"),id:"default-fast-mode",testId:"switch-default-fast-mode",checked:el,onChange:e=>{eo(e),j(eb({defaultFastMode:e}))}}),(0,t.jsx)(U,{children:h("settings.workflow.subsections.approve")}),(0,t.jsx)(O,{label:h("settings.workflow.autoApprovePrd"),description:h("settings.workflow.autoApprovePrdDescription"),id:"allow-prd",testId:"switch-allow-prd",checked:W,onChange:e=>{Z(e),j(eb({allowPrd:e}))}}),(0,t.jsx)(O,{label:h("settings.workflow.autoApprovePlan"),description:h("settings.workflow.autoApprovePlanDescription"),id:"allow-plan",testId:"switch-allow-plan",checked:Y,onChange:e=>{J(e),j(eb({allowPlan:e}))}}),(0,t.jsx)(O,{label:h("settings.workflow.autoApproveMerge"),description:h("settings.workflow.autoApproveMergeDescription"),id:"allow-merge",testId:"switch-allow-merge",checked:Q,onChange:e=>{ee(e),j(eb({allowMerge:e}))}}),(0,t.jsx)(U,{children:h("settings.workflow.subsections.evidence")}),(0,t.jsx)(O,{label:h("settings.workflow.collectEvidence"),description:h("settings.workflow.collectEvidenceDescription"),id:"enable-evidence",testId:"switch-enable-evidence",checked:et,onChange:e=>{ei(e),e?j(eb({enableEvidence:e})):(es(!1),j(eb({enableEvidence:e,commitEvidence:!1})))}}),(0,t.jsx)(O,{label:h("settings.workflow.addEvidenceToPr"),description:h("settings.workflow.addEvidenceToPrDescription"),id:"commit-evidence",testId:"switch-commit-evidence",checked:en,disabled:!et||!B,onChange:e=>{es(e),j(eb({commitEvidence:e}))}}),(0,t.jsx)(U,{children:h("settings.workflow.subsections.git")}),(0,t.jsx)(O,{label:h("settings.workflow.pushOnComplete"),description:h("settings.workflow.pushOnCompleteDescription"),id:"push-on-complete",testId:"switch-push-on-complete",checked:K,onChange:e=>{V(e),j(eb({pushOnComplete:e}))}}),(0,t.jsx)(O,{label:h("settings.workflow.openPrOnComplete"),description:h("settings.workflow.openPrOnCompleteDescription"),id:"open-pr",testId:"switch-open-pr",checked:B,onChange:e=>{_(e),e?j(eb({openPr:e})):(es(!1),j(eb({openPr:e,commitEvidence:!1})))}}),(0,t.jsx)(O,{label:h("settings.workflow.watchCiAfterPush"),description:h("settings.workflow.watchCiAfterPushDescription"),id:"ci-watch-enabled",testId:"switch-ci-watch-enabled",checked:ea,onChange:e=>{er(e),j(eb({ciWatchEnabled:e}))}}),(0,t.jsx)(U,{children:"Archive"}),(0,t.jsx)(O,{label:"Auto-archive completed",description:"Automatically archive features after they reach the completed state",id:"auto-archive-enabled",testId:"switch-auto-archive-enabled",checked:ec,onChange:e=>{ed(e),j(eb({autoArchiveEnabled:e}))}}),(0,t.jsx)(H,{label:"Archive delay",description:"Minutes to wait after completion before archiving (1–1440)",htmlFor:"auto-archive-delay",children:(0,t.jsx)(G,{id:"auto-archive-delay",testId:"input-auto-archive-delay",value:eu,placeholder:"10",min:1,max:1440,suffix:"min",onChange:e=>{eg(e)},onBlur:()=>{if(!ec)return;let e=parseInt(eu,10),t=Number.isNaN(e)?10:Math.min(1440,Math.max(1,e));eg(String(t)),j(eb({autoArchiveDelay:String(t)}))}})})]}),(0,t.jsx)($,{links:[{label:h("settings.workflow.links.approvalGates"),href:"https://github.com/jrmatherly/shipit/blob/main/specs/016-hitl-approval-gates/spec.yaml"},{label:h("settings.workflow.links.pushAndPrFlags"),href:"https://github.com/jrmatherly/shipit/blob/main/specs/037-feature-pr-push-flags/spec.yaml"}],children:h("settings.workflow.hint")})]}),(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.jsx)(X,{settings:e}),(0,t.jsx)($,{links:[{label:h("settings.ci.links.cicdPipeline"),href:"https://github.com/jrmatherly/shipit/blob/main/docs/development/cicd.md"},{label:h("settings.ci.links.ciSecurityGates"),href:"https://github.com/jrmatherly/shipit/blob/main/specs/003-cicd-security-gates/spec.md"}],children:h("settings.ci.hint")})]}),(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.jsx)(eV,{settings:e}),(0,t.jsx)($,{children:h("settings.stageTimeouts.hint")})]}),(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)(q,{icon:c,title:h("settings.notifications.title"),description:h("settings.notifications.sectionDescription"),testId:"notification-settings-section",children:[(0,t.jsx)(U,{children:h("settings.notifications.channels")}),(0,t.jsx)(O,{label:h("settings.notifications.inAppLabel"),description:h("settings.notifications.inAppDescription"),id:"notif-in-app",testId:"switch-in-app",checked:em,onChange:e=>{eh(e),j(ew({inApp:e}))}}),(0,t.jsx)(U,{children:h("settings.notifications.subsections.agentEvents")}),(0,t.jsx)(O,{label:h("settings.notifications.events.agentStarted"),id:"notif-event-agentStarted",testId:"switch-event-agentStarted",checked:ep.agentStarted,onChange:e=>{let t={...ep,agentStarted:e};ef(t),j(ew({events:t}))}}),(0,t.jsx)(O,{label:h("settings.notifications.events.phaseCompleted"),id:"notif-event-phaseCompleted",testId:"switch-event-phaseCompleted",checked:ep.phaseCompleted,onChange:e=>{let t={...ep,phaseCompleted:e};ef(t),j(ew({events:t}))}}),(0,t.jsx)(O,{label:h("settings.notifications.events.waitingApproval"),id:"notif-event-waitingApproval",testId:"switch-event-waitingApproval",checked:ep.waitingApproval,onChange:e=>{let t={...ep,waitingApproval:e};ef(t),j(ew({events:t}))}}),(0,t.jsx)(O,{label:h("settings.notifications.events.agentCompleted"),id:"notif-event-agentCompleted",testId:"switch-event-agentCompleted",checked:ep.agentCompleted,onChange:e=>{let t={...ep,agentCompleted:e};ef(t),j(ew({events:t}))}}),(0,t.jsx)(O,{label:h("settings.notifications.events.agentFailed"),id:"notif-event-agentFailed",testId:"switch-event-agentFailed",checked:ep.agentFailed,onChange:e=>{let t={...ep,agentFailed:e};ef(t),j(ew({events:t}))}}),(0,t.jsx)(U,{children:h("settings.notifications.subsections.pullRequestEvents")}),(0,t.jsx)(O,{label:h("settings.notifications.events.prMerged"),id:"notif-event-prMerged",testId:"switch-event-prMerged",checked:ep.prMerged,onChange:e=>{let t={...ep,prMerged:e};ef(t),j(ew({events:t}))}}),(0,t.jsx)(O,{label:h("settings.notifications.events.prClosed"),id:"notif-event-prClosed",testId:"switch-event-prClosed",checked:ep.prClosed,onChange:e=>{let t={...ep,prClosed:e};ef(t),j(ew({events:t}))}}),(0,t.jsx)(O,{label:h("settings.notifications.events.prChecksPassed"),id:"notif-event-prChecksPassed",testId:"switch-event-prChecksPassed",checked:ep.prChecksPassed,onChange:e=>{let t={...ep,prChecksPassed:e};ef(t),j(ew({events:t}))}}),(0,t.jsx)(O,{label:h("settings.notifications.events.prChecksFailed"),id:"notif-event-prChecksFailed",testId:"switch-event-prChecksFailed",checked:ep.prChecksFailed,onChange:e=>{let t={...ep,prChecksFailed:e};ef(t),j(ew({events:t}))}}),(0,t.jsx)(O,{label:h("settings.notifications.events.prBlocked"),id:"notif-event-prBlocked",testId:"switch-event-prBlocked",checked:ep.prBlocked,onChange:e=>{let t={...ep,prBlocked:e};ef(t),j(ew({events:t}))}}),(0,t.jsx)(O,{label:h("settings.notifications.events.mergeReviewReady"),id:"notif-event-mergeReviewReady",testId:"switch-event-mergeReviewReady",checked:ep.mergeReviewReady,onChange:e=>{let t={...ep,mergeReviewReady:e};ef(t),j(ew({events:t}))}})]}),(0,t.jsx)($,{links:[{label:h("settings.notifications.links.notificationSystem"),href:"https://github.com/jrmatherly/shipit/blob/main/specs/021-agent-notifications/spec.yaml"}],children:h("settings.notifications.hint")})]}),(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)(q,{icon:d,title:h("settings.featureFlags.title"),description:h("settings.featureFlags.sectionDescription"),badge:h("settings.featureFlags.badge"),testId:"feature-flags-settings-section",children:[(0,t.jsx)(O,{label:h("settings.featureFlags.skills"),description:h("settings.featureFlags.skillsDescription"),id:"flag-skills",testId:"switch-flag-skills",checked:ex.skills,onChange:e=>{let t={...ex,skills:e};ev(t),j({featureFlags:t})}}),(0,t.jsx)(O,{label:h("settings.featureFlags.deployments"),description:h("settings.featureFlags.deploymentsDescription"),id:"flag-envDeploy",testId:"switch-flag-envDeploy",checked:ex.envDeploy,onChange:e=>{let t={...ex,envDeploy:e};ev(t),j({featureFlags:t})}}),(0,t.jsx)(O,{label:h("settings.featureFlags.debug"),description:h("settings.featureFlags.debugDescription"),id:"flag-debug",testId:"switch-flag-debug",checked:ex.debug,onChange:e=>{let t={...ex,debug:e};ev(t),j({featureFlags:t})}}),(0,t.jsx)(O,{label:h("settings.featureFlags.githubImport"),description:h("settings.featureFlags.githubImportDescription"),id:"flag-githubImport",testId:"switch-flag-githubImport",checked:ex.githubImport,onChange:e=>{let t={...ex,githubImport:e};ev(t),j({featureFlags:t})}}),(0,t.jsx)(O,{label:h("settings.featureFlags.adoptBranch"),description:h("settings.featureFlags.adoptBranchDescription"),id:"flag-adoptBranch",testId:"switch-flag-adoptBranch",checked:ex.adoptBranch,onChange:e=>{let t={...ex,adoptBranch:e};ev(t),j({featureFlags:t})}}),(0,t.jsx)(O,{label:h("settings.featureFlags.gitRebaseSync"),description:h("settings.featureFlags.gitRebaseSyncDescription"),id:"flag-gitRebaseSync",testId:"switch-flag-gitRebaseSync",checked:ex.gitRebaseSync,onChange:e=>{let t={...ex,gitRebaseSync:e};ev(t),j({featureFlags:t})}}),(0,t.jsx)(O,{label:h("settings.featureFlags.reactFileManager"),description:h("settings.featureFlags.reactFileManagerDescription"),id:"flag-reactFileManager",testId:"switch-flag-reactFileManager",checked:ex.reactFileManager,onChange:e=>{let t={...ex,reactFileManager:e};ev(t),j({featureFlags:t})}})]}),(0,t.jsx)($,{children:h("settings.featureFlags.hint")})]}),(0,t.jsxs)("div",{id:"section-interactive-agent",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsx)(eW,{settings:e}),(0,t.jsx)($,{children:h("settings.interactiveAgent.hint")})]}),(0,t.jsxs)("div",{id:"section-fab-layout",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsx)(eH,{settings:e}),(0,t.jsx)($,{children:h("settings.fabLayout.hint")})]}),(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)(q,{icon:u,title:h("settings.database.title"),description:h("settings.database.sectionDescription"),testId:"database-settings-section",children:[(0,t.jsx)(H,{label:h("settings.database.location"),description:h("settings.database.locationDescription"),children:(0,t.jsx)("span",{className:"text-muted-foreground max-w-50 truncate font-mono text-xs","data-testid":"shipit-ai-home-path",children:l})}),(0,t.jsx)(H,{label:h("settings.database.size"),children:(0,t.jsx)("span",{className:"text-muted-foreground text-xs","data-testid":"db-file-size",children:o})})]}),(0,t.jsx)($,{links:[{label:h("settings.database.links.settingsService"),href:"https://github.com/jrmatherly/shipit/blob/main/docs/architecture/settings-service.md"},{label:h("settings.database.links.settingsSpec"),href:"https://github.com/jrmatherly/shipit/blob/main/specs/005-global-settings-service/spec.md"}],children:h("settings.database.hint")})]})]})]})}],41952)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,41952,e=>{"use strict";var t=e.i(96871),i=e.i(16539),n=e.i(23925),s=e.i(26370),a=e.i(38573),r=e.i(49228),l=e.i(74294),o=e.i(3645);let c=(0,o.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"}]]),d=(0,o.default)("flag",[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]]),u=(0,o.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 g=e.i(32494);let m=(0,o.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 h=e.i(58860),p=e.i(48109);let f=(0,o.default)("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);var x=e.i(60112);e.i(98026);var v=e.i(50728),b=e.i(31777),w=e.i(47373),j=e.i(96976);let y=(0,j.createServerReference)("400e4e46405b9b45e7442f750b0ff21eded1528306",j.callServer,void 0,j.findSourceMapURL,"updateSettingsAction");var S=e.i(17406),k=e.i(30342),C=e.i(44229),M=e.i(83902);function N(e){return(0,t.jsx)(C.Code,{className:(0,b.cn)("h-4 w-4",e.className),...e})}function I({className:e}){return(0,t.jsx)(k.default,{src:"/icons/editors/vscode.svg",alt:"VS Code",width:24,height:24,className:(0,b.cn)("rounded-sm object-contain",e)})}function T({className:e}){return(0,t.jsx)(k.default,{src:"/icons/agents/cursor.jpeg",alt:"Cursor",width:24,height:24,className:(0,b.cn)("rounded-sm object-contain",e)})}function A({className:e}){return(0,t.jsx)(k.default,{src:"/icons/editors/windsurf.svg",alt:"Windsurf",width:24,height:24,className:(0,b.cn)("rounded-sm object-contain",e)})}function D({className:e}){return(0,t.jsx)(k.default,{src:"/icons/editors/zed.svg",alt:"Zed",width:24,height:24,className:(0,b.cn)("rounded-sm object-contain",e)})}function F({className:e,...i}){return(0,t.jsx)(M.Rocket,{className:(0,b.cn)("h-4 w-4",e),...i})}I.displayName="VsCodeIcon",T.displayName="CursorEditorIcon",A.displayName="WindsurfIcon",D.displayName="ZedIcon",F.displayName="AntigravityIcon";let P={vscode:I,cursor:T,windsurf:A,zed:D,antigravity:F};var E=e.i(9749),R=e.i(956),z=e.i(41957);let B=[{value:S.Language.English,label:"English",nativeName:"English"},{value:S.Language.Russian,label:"Русский",nativeName:"Русский"},{value:S.Language.Portuguese,label:"Português",nativeName:"Português"},{value:S.Language.Spanish,label:"Español",nativeName:"Español"},{value:S.Language.Arabic,label:"العربية",nativeName:"العربية"},{value:S.Language.Hebrew,label:"עברית",nativeName:"עברית"},{value:S.Language.French,label:"Français",nativeName:"Français"},{value:S.Language.German,label:"Deutsch",nativeName:"Deutsch"}];function L({language:e}){let{t:s,i18n:a}=(0,v.useTranslation)("web"),[r,l]=(0,i.useState)(e),[o,c]=(0,i.useTransition)(),[d,u]=(0,i.useState)(!1),m=(0,i.useRef)(!1);return(0,i.useEffect)(()=>{if(m.current&&!o){u(!0);let e=setTimeout(()=>u(!1),2e3);return()=>clearTimeout(e)}m.current=o},[o]),(0,t.jsxs)(R.Card,{id:"language",className:"scroll-mt-6","data-testid":"language-settings-section",children:[(0,t.jsxs)(R.CardHeader,{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(g.Globe,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)(R.CardTitle,{children:s("settings.language.title")})]}),o?(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:s("common:labels.saving")}):null,d&&!o?(0,t.jsxs)("span",{className:"flex items-center gap-1 text-xs text-green-600",children:[(0,t.jsx)(n.Check,{className:"h-3 w-3"}),s("common:labels.saved")]}):null]}),(0,t.jsx)(R.CardDescription,{children:s("settings.language.description")})]}),(0,t.jsx)(R.CardContent,{className:"space-y-4",children:(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(z.Label,{htmlFor:"display-language",children:s("settings.language.label")}),(0,t.jsxs)(w.Select,{value:r,onValueChange:function(e){l(e),a.changeLanguage(e);let t="ar"===e||"he"===e?"rtl":"ltr";document.documentElement.lang=e,document.documentElement.dir=t,c(async()=>{let t=await y({user:{preferredLanguage:e}});t.success||x.toast.error(t.error??s("settings.language.failedToSave","Failed to save language settings"))})},children:[(0,t.jsx)(w.SelectTrigger,{id:"display-language","data-testid":"language-select",children:(0,t.jsx)(w.SelectValue,{placeholder:s("settings.language.placeholder")})}),(0,t.jsx)(w.SelectContent,{children:B.map(e=>(0,t.jsx)(w.SelectItem,{value:e.value,children:e.nativeName},e.value))})]})]})})]})}var _=e.i(61569),_=_,K=e.i(3214),V=e.i(30702),W=e.i(51911);function H({label:e,description:i,htmlFor:n,children:s}){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)(z.Label,{htmlFor:n,className:"cursor-pointer text-sm font-normal whitespace-nowrap",children:e}),i?(0,t.jsx)("p",{className:"text-muted-foreground text-[11px] leading-tight",children:i}):null]}),(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:s})]})}function O({label:e,description:i,id:n,testId:s,checked:a,onChange:r,disabled:l}){return(0,t.jsx)(H,{label:e,description:i,htmlFor:n,children:(0,t.jsx)(W.Switch,{id:n,"data-testid":s,checked:a,onCheckedChange:r,disabled:l,className:(0,b.cn)("cursor-pointer",l&&"cursor-not-allowed opacity-50")})})}function q({icon:e,title:i,description:n,badge:s,testId:a,children:r}){return(0,t.jsxs)("div",{className:"bg-background rounded-lg border","data-testid":a,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:i}),s?(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:s}):null]}),(0,t.jsx)("p",{className:"text-muted-foreground mt-0.5 text-[11px]",children:n})]}),(0,t.jsx)("div",{className:"px-4",children:r})]})}function G({id:e,testId:i,value:n,onChange:s,onBlur:a,placeholder:r,min:l=1,max:o,step:c=1,suffix:d}){let{t:u}=(0,v.useTranslation)("web"),g=""===n?void 0:parseInt(n,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:()=>{s(String(Math.max(l,(g??parseInt(r,10))-c)))},onMouseUp:a,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":u("common.decrease"),children:(0,t.jsx)(_.default,{className:"h-3 w-3"})}),(0,t.jsx)("input",{id:e,"data-testid":i,type:"text",inputMode:"numeric",pattern:"[0-9]*",value:n,placeholder:r,onChange:e=>{s(e.target.value.replace(/[^0-9]/g,""))},onBlur:a,className:"h-8 w-14 bg-transparent text-center text-xs outline-none"}),(0,t.jsx)("button",{type:"button",onClick:()=>{let e;e=g??parseInt(r,10),s(String(null!=o?Math.min(o,e+c):e+c))},onMouseUp:a,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":u("common.increase"),children:(0,t.jsx)(K.Plus,{className:"h-3 w-3"})})]}),d?(0,t.jsx)("span",{className:"text-muted-foreground text-[11px]",children:d}):null]})}function U({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 $({children:e,links:i}){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!=i&&i.length>0?(0,t.jsx)("div",{className:"mt-2 flex flex-col gap-1",children:i.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)(V.ExternalLink,{className:"h-2.5 w-2.5"}),e.label]},e.href))}):null]})}function Z(e){if(""===e)return;let t=parseInt(e,10);return Number.isNaN(t)||t<=0?void 0:t}function X({settings:e}){let{t:n}=(0,v.useTranslation)("web"),[,s]=(0,i.useTransition)(),[a,r]=(0,i.useState)(null!=e.workflow.ciMaxFixAttempts?String(e.workflow.ciMaxFixAttempts):""),[o,c]=(0,i.useState)(null!=e.workflow.ciWatchTimeoutMs?String(Math.round(e.workflow.ciWatchTimeoutMs/1e3)):""),[d,u]=(0,i.useState)(null!=e.workflow.ciLogMaxChars?String(e.workflow.ciLogMaxChars):""),[g,m]=(0,i.useState)(null!=e.workflow.ciWatchPollIntervalSeconds?String(e.workflow.ciWatchPollIntervalSeconds):""),[h,p]=(0,i.useState)(!1!==e.workflow.hideCiStatus),f=null!=e.workflow.ciMaxFixAttempts?String(e.workflow.ciMaxFixAttempts):"",b=null!=e.workflow.ciWatchTimeoutMs?String(Math.round(e.workflow.ciWatchTimeoutMs/1e3)):"",w=null!=e.workflow.ciLogMaxChars?String(e.workflow.ciLogMaxChars):"",j=null!=e.workflow.ciWatchPollIntervalSeconds?String(e.workflow.ciWatchPollIntervalSeconds):"";function S(e){s(async()=>{let t=await y(e);t.success||x.toast.error(t.error??n("settings.failedToSave"))})}function k(e){let t=Z(e.ciTimeout??o);return{workflow:{ciMaxFixAttempts:Z(e.ciMaxFix??a),ciWatchTimeoutMs:null!=t?1e3*t:void 0,ciLogMaxChars:Z(e.ciLogMax??d),ciWatchPollIntervalSeconds:Z(e.ciPollInterval??g),hideCiStatus:e.hideCiStatus??h}}}return(0,t.jsxs)(q,{icon:l.Activity,title:n("settings.ci.title"),description:n("settings.ci.description"),testId:"ci-settings-section",children:[(0,t.jsx)(H,{label:n("settings.ci.maxFixAttempts"),description:n("settings.ci.maxFixAttemptsDescription"),htmlFor:"ci-max-fix",children:(0,t.jsx)(G,{id:"ci-max-fix",testId:"ci-max-fix-input",placeholder:"3",value:a,onChange:r,onBlur:()=>{a!==f&&S(k({ciMaxFix:a}))},min:1,max:10})}),(0,t.jsx)(H,{label:n("settings.ci.watchTimeout"),description:n("settings.ci.watchTimeoutDescription"),htmlFor:"ci-timeout",children:(0,t.jsx)(G,{id:"ci-timeout",testId:"ci-timeout-input",placeholder:"300",value:o,onChange:c,onBlur:()=>{o!==b&&S(k({ciTimeout:o}))},min:30,step:30,suffix:"sec"})}),(0,t.jsx)(H,{label:n("settings.ci.maxLogSize"),description:n("settings.ci.maxLogSizeDescription"),htmlFor:"ci-log-max",children:(0,t.jsx)(G,{id:"ci-log-max",testId:"ci-log-max-input",placeholder:"50000",value:d,onChange:u,onBlur:()=>{d!==w&&S(k({ciLogMax:d}))},min:1e3,step:5e3,suffix:"chars"})}),(0,t.jsx)(H,{label:n("settings.ci.pollInterval"),description:n("settings.ci.pollIntervalDescription"),htmlFor:"ci-poll-interval",children:(0,t.jsx)(G,{id:"ci-poll-interval",testId:"ci-poll-interval-input",placeholder:"30",value:g,onChange:m,onBlur:()=>{g!==j&&S(k({ciPollInterval:g}))},min:5,step:5,suffix:"sec"})}),(0,t.jsx)(O,{label:n("settings.ci.hideCiStatus"),description:n("settings.ci.hideCiStatusDescription"),id:"hide-ci-status",testId:"switch-hide-ci-status",checked:h,onChange:e=>{p(e),S(k({hideCiStatus:e}))}})]})}var Y=e.i(27069),J=e.i(91967),Q=e.i(22353),ee=e.i(9413),et=e.i(36567),ei=e.i(75649),en=e.i(9641),es=e.i(70391),ea=e.i(85565),er=e.i(87099),el=["PageUp","PageDown"],eo=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ec={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},ed="Slider",[eu,eg,em]=(0,er.createCollection)(ed),[eh,ep]=(0,ee.createContextScope)(ed,[em]),[ef,ex]=eh(ed),ev=i.forwardRef((e,n)=>{let{name:s,min:a=0,max:r=100,step:l=1,orientation:o="horizontal",disabled:c=!1,minStepsBetweenThumbs:d=0,defaultValue:u=[a],value:g,onValueChange:m=()=>{},onValueCommit:h=()=>{},inverted:p=!1,form:f,...x}=e,v=i.useRef(new Set),b=i.useRef(0),w="horizontal"===o,[j=[],y]=(0,et.useControllableState)({prop:g,defaultProp:u,onChange:e=>{let t=[...v.current];t[b.current]?.focus(),m(e)}}),S=i.useRef(j);function k(e,t,{commit:i}={commit:!1}){let n,s=(String(l).split(".")[1]||"").length,o=Math.round((Math.round((e-a)/l)*l+a)*(n=Math.pow(10,s)))/n,c=(0,Y.clamp)(o,[a,r]);y((e=[])=>{let n=function(e=[],t,i){let n=[...e];return n[i]=t,n.sort((e,t)=>e-t)}(e,c,t);if(!function(e,t){if(t>0)return Math.min(...e.slice(0,-1).map((t,i)=>e[i+1]-t))>=t;return!0}(n,d*l))return e;{b.current=n.indexOf(c);let t=String(n)!==String(e);return t&&i&&h(n),t?n:e}})}return(0,t.jsx)(ef,{scope:e.__scopeSlider,name:s,disabled:c,min:a,max:r,valueIndexToChangeRef:b,thumbs:v.current,values:j,orientation:o,form:f,children:(0,t.jsx)(eu.Provider,{scope:e.__scopeSlider,children:(0,t.jsx)(eu.Slot,{scope:e.__scopeSlider,children:(0,t.jsx)(w?ej:ey,{"aria-disabled":c,"data-disabled":c?"":void 0,...x,ref:n,onPointerDown:(0,J.composeEventHandlers)(x.onPointerDown,()=>{c||(S.current=j)}),min:a,max:r,inverted:p,onSlideStart:c?void 0:function(e){let t=function(e,t){if(1===e.length)return 0;let i=e.map(e=>Math.abs(e-t)),n=Math.min(...i);return i.indexOf(n)}(j,e);k(e,t)},onSlideMove:c?void 0:function(e){k(e,b.current)},onSlideEnd:c?void 0:function(){let e=S.current[b.current];j[b.current]!==e&&h(j)},onHomeKeyDown:()=>!c&&k(a,0,{commit:!0}),onEndKeyDown:()=>!c&&k(r,j.length-1,{commit:!0}),onStepKeyDown:({event:e,direction:t})=>{if(!c){let i=el.includes(e.key)||e.shiftKey&&eo.includes(e.key),n=b.current;k(j[n]+l*(i?10:1)*t,n,{commit:!0})}}})})})})});ev.displayName=ed;var[eb,ew]=eh(ed,{startEdge:"left",endEdge:"right",size:"width",direction:1}),ej=i.forwardRef((e,n)=>{let{min:s,max:a,dir:r,inverted:l,onSlideStart:o,onSlideMove:c,onSlideEnd:d,onStepKeyDown:u,...g}=e,[m,h]=i.useState(null),p=(0,Q.useComposedRefs)(n,e=>h(e)),f=i.useRef(void 0),x=(0,ei.useDirection)(r),v="ltr"===x,b=v&&!l||!v&&l;function w(e){let t=f.current||m.getBoundingClientRect(),i=eP([0,t.width],b?[s,a]:[a,s]);return f.current=t,i(e-t.left)}return(0,t.jsx)(eb,{scope:e.__scopeSlider,startEdge:b?"left":"right",endEdge:b?"right":"left",direction:b?1:-1,size:"width",children:(0,t.jsx)(eS,{dir:x,"data-orientation":"horizontal",...g,ref:p,style:{...g.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:e=>{let t=w(e.clientX);o?.(t)},onSlideMove:e=>{let t=w(e.clientX);c?.(t)},onSlideEnd:()=>{f.current=void 0,d?.()},onStepKeyDown:e=>{let t=ec[b?"from-left":"from-right"].includes(e.key);u?.({event:e,direction:t?-1:1})}})})}),ey=i.forwardRef((e,n)=>{let{min:s,max:a,inverted:r,onSlideStart:l,onSlideMove:o,onSlideEnd:c,onStepKeyDown:d,...u}=e,g=i.useRef(null),m=(0,Q.useComposedRefs)(n,g),h=i.useRef(void 0),p=!r;function f(e){let t=h.current||g.current.getBoundingClientRect(),i=eP([0,t.height],p?[a,s]:[s,a]);return h.current=t,i(e-t.top)}return(0,t.jsx)(eb,{scope:e.__scopeSlider,startEdge:p?"bottom":"top",endEdge:p?"top":"bottom",size:"height",direction:p?1:-1,children:(0,t.jsx)(eS,{"data-orientation":"vertical",...u,ref:m,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:e=>{let t=f(e.clientY);l?.(t)},onSlideMove:e=>{let t=f(e.clientY);o?.(t)},onSlideEnd:()=>{h.current=void 0,c?.()},onStepKeyDown:e=>{let t=ec[p?"from-bottom":"from-top"].includes(e.key);d?.({event:e,direction:t?-1:1})}})})}),eS=i.forwardRef((e,i)=>{let{__scopeSlider:n,onSlideStart:s,onSlideMove:a,onSlideEnd:r,onHomeKeyDown:l,onEndKeyDown:o,onStepKeyDown:c,...d}=e,u=ex(ed,n);return(0,t.jsx)(ea.Primitive.span,{...d,ref:i,onKeyDown:(0,J.composeEventHandlers)(e.onKeyDown,e=>{"Home"===e.key?(l(e),e.preventDefault()):"End"===e.key?(o(e),e.preventDefault()):el.concat(eo).includes(e.key)&&(c(e),e.preventDefault())}),onPointerDown:(0,J.composeEventHandlers)(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),u.thumbs.has(t)?t.focus():s(e)}),onPointerMove:(0,J.composeEventHandlers)(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&a(e)}),onPointerUp:(0,J.composeEventHandlers)(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),r(e))})})}),ek="SliderTrack",eC=i.forwardRef((e,i)=>{let{__scopeSlider:n,...s}=e,a=ex(ek,n);return(0,t.jsx)(ea.Primitive.span,{"data-disabled":a.disabled?"":void 0,"data-orientation":a.orientation,...s,ref:i})});eC.displayName=ek;var eM="SliderRange",eN=i.forwardRef((e,n)=>{let{__scopeSlider:s,...a}=e,r=ex(eM,s),l=ew(eM,s),o=i.useRef(null),c=(0,Q.useComposedRefs)(n,o),d=r.values.length,u=r.values.map(e=>eF(e,r.min,r.max)),g=d>1?Math.min(...u):0,m=100-Math.max(...u);return(0,t.jsx)(ea.Primitive.span,{"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,...a,ref:c,style:{...e.style,[l.startEdge]:g+"%",[l.endEdge]:m+"%"}})});eN.displayName=eM;var eI="SliderThumb",eT=i.forwardRef((e,n)=>{let s=eg(e.__scopeSlider),[a,r]=i.useState(null),l=(0,Q.useComposedRefs)(n,e=>r(e)),o=i.useMemo(()=>a?s().findIndex(e=>e.ref.current===a):-1,[s,a]);return(0,t.jsx)(eA,{...e,ref:l,index:o})}),eA=i.forwardRef((e,n)=>{var s,a,r,l,o;let c,d,{__scopeSlider:u,index:g,name:m,...h}=e,p=ex(eI,u),f=ew(eI,u),[x,v]=i.useState(null),b=(0,Q.useComposedRefs)(n,e=>v(e)),w=!x||p.form||!!x.closest("form"),j=(0,es.useSize)(x),y=p.values[g],S=void 0===y?0:eF(y,p.min,p.max),k=(s=g,(a=p.values.length)>2?`Value ${s+1} of ${a}`:2===a?["Minimum","Maximum"][s]:void 0),C=j?.[f.size],M=C?(r=C,l=S,o=f.direction,d=eP([0,50],[0,c=r/2]),(c-d(l)*o)*o):0;return i.useEffect(()=>{if(x)return p.thumbs.add(x),()=>{p.thumbs.delete(x)}},[x,p.thumbs]),(0,t.jsxs)("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[f.startEdge]:`calc(${S}% + ${M}px)`},children:[(0,t.jsx)(eu.ItemSlot,{scope:e.__scopeSlider,children:(0,t.jsx)(ea.Primitive.span,{role:"slider","aria-label":e["aria-label"]||k,"aria-valuemin":p.min,"aria-valuenow":y,"aria-valuemax":p.max,"aria-orientation":p.orientation,"data-orientation":p.orientation,"data-disabled":p.disabled?"":void 0,tabIndex:p.disabled?void 0:0,...h,ref:b,style:void 0===y?{display:"none"}:e.style,onFocus:(0,J.composeEventHandlers)(e.onFocus,()=>{p.valueIndexToChangeRef.current=g})})}),w&&(0,t.jsx)(eD,{name:m??(p.name?p.name+(p.values.length>1?"[]":""):void 0),form:p.form,value:y},g)]})});eT.displayName=eI;var eD=i.forwardRef(({__scopeSlider:e,value:n,...s},a)=>{let r=i.useRef(null),l=(0,Q.useComposedRefs)(r,a),o=(0,en.usePrevious)(n);return i.useEffect(()=>{let e=r.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value").set;if(o!==n&&t){let i=new Event("input",{bubbles:!0});t.call(e,n),e.dispatchEvent(i)}},[o,n]),(0,t.jsx)(ea.Primitive.input,{style:{display:"none"},...s,ref:l,defaultValue:n})});function eF(e,t,i){return(0,Y.clamp)(100/(i-t)*(e-t),[0,100])}function eP(e,t){return i=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(i-e[0])}}eD.displayName="RadioBubbleInput",e.s(["Range",0,eN,"Root",0,ev,"Slider",0,ev,"SliderRange",0,eN,"SliderThumb",0,eT,"SliderTrack",0,eC,"Thumb",0,eT,"Track",0,eC,"createSliderScope",0,ep],98207);var eE=e.i(98207),eE=eE;function eR({className:e,defaultValue:n,value:s,min:a=0,max:r=100,...l}){let o=i.useMemo(()=>Array.isArray(s)?s:Array.isArray(n)?n:[a,r],[s,n,a,r]);return(0,t.jsxs)(eE.Root,{"data-slot":"slider",defaultValue:n,value:s,min:a,max:r,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)(eE.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)(eE.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:o.length},(e,i)=>(0,t.jsx)(eE.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"},i))]})}let ez=[60,120,300,600,900,1800,2700,3600,7200,10800,14400,21600,28800,43200,86400],eB=ez.length-1;function eL(e){let t=0,i=Math.abs(e-ez[0]);for(let n=1;n<ez.length;n++){let s=Math.abs(e-ez[n]);s<i&&(i=s,t=n)}return t}function e_({id:e,testId:n,value:s,onChange:a,onBlur:r,defaultSeconds:l=1800}){var o;let c,d,u=(""===s?l:parseInt(s,10))||l,[g,m]=(0,i.useState)(()=>eL(u)),h=eL(u);h!==g&&ez[g]!==u&&m(h);let p=(0,i.useCallback)(([e])=>{m(e),a(String(ez[e]))},[a]);return(0,t.jsxs)("div",{className:"flex w-55 items-center gap-2",children:[(0,t.jsx)(eR,{id:e,"data-testid":n,min:0,max:eB,step:1,value:[g],onValueChange:p,onValueCommit:()=>r(),className:"min-w-0 flex-1"}),(0,t.jsx)("span",{className:"text-muted-foreground shrink-0 text-end text-xs tabular-nums",children:(c=Math.floor((o=ez[g])/3600),d=Math.round(o%3600/60),0===c?`${d}m`:0===d?`${c}h`:`${c}h ${d}m`)})]})}function eK(e){if(void 0===e)return;let t=function(e){if(""===e)return;let t=parseInt(e,10);return Number.isNaN(t)||t<=0?void 0:t}(e);return null!=t?1e3*t:void 0}function eV({settings:e}){let{t:n}=(0,v.useTranslation)("web"),[,s]=(0,i.useTransition)(),a=e.workflow.stageTimeouts,r=e.workflow.analyzeRepoTimeouts,[l,o]=(0,i.useState)(String(Math.round((a?.analyzeMs??18e5)/1e3))),[c,d]=(0,i.useState)(String(Math.round((a?.requirementsMs??18e5)/1e3))),[u,g]=(0,i.useState)(String(Math.round((a?.researchMs??18e5)/1e3))),[m,p]=(0,i.useState)(String(Math.round((a?.planMs??18e5)/1e3))),[f,b]=(0,i.useState)(String(Math.round((a?.implementMs??18e5)/1e3))),[w,j]=(0,i.useState)(String(Math.round((a?.mergeMs??18e5)/1e3))),[S,k]=(0,i.useState)(String(Math.round((r?.analyzeMs??6e5)/1e3))),C=a?.analyzeMs!=null?String(Math.round(a.analyzeMs/1e3)):"",M=a?.requirementsMs!=null?String(Math.round(a.requirementsMs/1e3)):"",N=a?.researchMs!=null?String(Math.round(a.researchMs/1e3)):"",I=a?.planMs!=null?String(Math.round(a.planMs/1e3)):"",T=a?.implementMs!=null?String(Math.round(a.implementMs/1e3)):"",A=a?.mergeMs!=null?String(Math.round(a.mergeMs/1e3)):"",D=r?.analyzeMs!=null?String(Math.round(r.analyzeMs/1e3)):"";function F(e){return{workflow:{stageTimeouts:{analyzeMs:eK(e.analyzeTimeout??l),requirementsMs:eK(e.requirementsTimeout??c),researchMs:eK(e.researchTimeout??u),planMs:eK(e.planTimeout??m),implementMs:eK(e.implementTimeout??f),mergeMs:eK(e.mergeTimeout??w)},analyzeRepoTimeouts:{analyzeMs:eK(e.analyzeRepoTimeout??S)}}}}function P(e){s(async()=>{let t=await y(e);t.success||x.toast.error(t.error??n("settings.failedToSave"))})}return(0,t.jsxs)(q,{icon:h.Timer,title:n("settings.stageTimeouts.title"),description:n("settings.stageTimeouts.description"),testId:"stage-timeouts-settings-section",children:[(0,t.jsx)(U,{children:n("settings.stageTimeouts.subsections.featureAgent")}),(0,t.jsx)(H,{label:n("settings.stageTimeouts.analyze"),description:n("settings.stageTimeouts.analyzeDescription"),htmlFor:"timeout-analyze",children:(0,t.jsx)(e_,{id:"timeout-analyze",testId:"timeout-analyze-input",value:l,onChange:o,onBlur:()=>{l!==C&&P(F({analyzeTimeout:l}))},defaultSeconds:1800})}),(0,t.jsx)(H,{label:n("settings.stageTimeouts.requirements"),description:n("settings.stageTimeouts.requirementsDescription"),htmlFor:"timeout-requirements",children:(0,t.jsx)(e_,{id:"timeout-requirements",testId:"timeout-requirements-input",value:c,onChange:d,onBlur:()=>{c!==M&&P(F({requirementsTimeout:c}))},defaultSeconds:1800})}),(0,t.jsx)(H,{label:n("settings.stageTimeouts.research"),description:n("settings.stageTimeouts.researchDescription"),htmlFor:"timeout-research",children:(0,t.jsx)(e_,{id:"timeout-research",testId:"timeout-research-input",value:u,onChange:g,onBlur:()=>{u!==N&&P(F({researchTimeout:u}))},defaultSeconds:1800})}),(0,t.jsx)(H,{label:n("settings.stageTimeouts.plan"),description:n("settings.stageTimeouts.planDescription"),htmlFor:"timeout-plan",children:(0,t.jsx)(e_,{id:"timeout-plan",testId:"timeout-plan-input",value:m,onChange:p,onBlur:()=>{m!==I&&P(F({planTimeout:m}))},defaultSeconds:1800})}),(0,t.jsx)(H,{label:n("settings.stageTimeouts.implement"),description:n("settings.stageTimeouts.implementDescription"),htmlFor:"timeout-implement",children:(0,t.jsx)(e_,{id:"timeout-implement",testId:"timeout-implement-input",value:f,onChange:b,onBlur:()=>{f!==T&&P(F({implementTimeout:f}))},defaultSeconds:1800})}),(0,t.jsx)(H,{label:n("settings.stageTimeouts.merge"),description:n("settings.stageTimeouts.mergeDescription"),htmlFor:"timeout-merge",children:(0,t.jsx)(e_,{id:"timeout-merge",testId:"timeout-merge-input",value:w,onChange:j,onBlur:()=>{w!==A&&P(F({mergeTimeout:w}))},defaultSeconds:1800})}),(0,t.jsx)(U,{children:n("settings.stageTimeouts.subsections.analyzeRepoAgent")}),(0,t.jsx)(H,{label:n("settings.stageTimeouts.analyze"),description:n("settings.stageTimeouts.analyzeDescription"),htmlFor:"timeout-analyze-repo",children:(0,t.jsx)(e_,{id:"timeout-analyze-repo",testId:"timeout-analyze-repo-input",value:S,onChange:k,onBlur:()=>{S!==D&&P(F({analyzeRepoTimeout:S}))},defaultSeconds:600})})]})}function eW({settings:e}){let{t:n}=(0,v.useTranslation)("web"),[,s]=(0,i.useTransition)(),a=e.interactiveAgent??{enabled:!0,autoTimeoutMinutes:15,maxConcurrentSessions:3},[r,l]=(0,i.useState)(a.enabled),[o,c]=(0,i.useState)(String(a.autoTimeoutMinutes)),[d,u]=(0,i.useState)(String(a.maxConcurrentSessions));function g(e){s(async()=>{let t=await y(e);t.success||x.toast.error(t.error??n("settings.failedToSave"))})}return(0,t.jsxs)(q,{icon:p.MessageSquare,title:n("settings.interactiveAgent.title"),description:n("settings.interactiveAgent.description"),testId:"interactive-agent-settings-section",children:[(0,t.jsx)(O,{label:n("settings.interactiveAgent.enableChatTab"),description:n("settings.interactiveAgent.enableChatTabDescription"),id:"interactive-agent-enabled",testId:"switch-interactive-agent-enabled",checked:r,onChange:e=>{l(e),g({interactiveAgent:{enabled:e,autoTimeoutMinutes:parseInt(o,10)||15,maxConcurrentSessions:parseInt(d,10)||3}})}}),(0,t.jsx)(H,{label:n("settings.interactiveAgent.autoTimeout"),description:n("settings.interactiveAgent.autoTimeoutDescription"),htmlFor:"interactive-agent-timeout",children:(0,t.jsx)(G,{id:"interactive-agent-timeout",testId:"input-interactive-agent-timeout",value:o,placeholder:"15",min:1,max:120,suffix:"min",onChange:c,onBlur:()=>{let e=parseInt(o,10),t=Number.isNaN(e)?15:Math.min(120,Math.max(1,e));c(String(t)),g({interactiveAgent:{enabled:r,autoTimeoutMinutes:t,maxConcurrentSessions:parseInt(d,10)||3}})}})}),(0,t.jsx)(H,{label:n("settings.interactiveAgent.maxConcurrentSessions"),description:n("settings.interactiveAgent.maxConcurrentSessionsDescription"),htmlFor:"interactive-agent-sessions",children:(0,t.jsx)(G,{id:"interactive-agent-sessions",testId:"input-interactive-agent-sessions",value:d,placeholder:"3",min:1,max:10,onChange:u,onBlur:()=>{let e=parseInt(d,10),t=Number.isNaN(e)?3:Math.min(10,Math.max(1,e));u(String(t)),g({interactiveAgent:{enabled:r,autoTimeoutMinutes:parseInt(o,10)||15,maxConcurrentSessions:t}})}})})]})}function eH({settings:e}){let{t:n}=(0,v.useTranslation)("web"),[,s]=(0,i.useTransition)(),a=e.fabLayout??{swapPosition:!1},[r,l]=(0,i.useState)(a.swapPosition);return(0,t.jsx)(q,{icon:f,title:n("settings.fabLayout.title"),description:n("settings.fabLayout.description"),testId:"fab-layout-settings-section",children:(0,t.jsx)(O,{label:n("settings.fabLayout.swapPosition"),description:n("settings.fabLayout.swapPositionDescription"),id:"fab-swap-position",testId:"switch-fab-swap-position",checked:r,onChange:e=>{var t;l(e),t={fabLayout:{swapPosition:e}},s(async()=>{let e=await y(t);e.success||x.toast.error(e.error??n("settings.failedToSave"))})}})})}let eO=[{value:S.EditorType.VsCode,label:"VS Code"},{value:S.EditorType.Cursor,label:"Cursor"},{value:S.EditorType.Windsurf,label:"Windsurf"},{value:S.EditorType.Zed,label:"Zed"},{value:S.EditorType.Antigravity,label:"Antigravity"}],eq=[{value:"bash",label:"Bash"},{value:"zsh",label:"Zsh"},{value:"fish",label:"Fish"}],eG=[{id:"language",labelKey:"settings.sections.language",icon:g.Globe},{id:"agent",labelKey:"settings.sections.agent",icon:s.Bot},{id:"environment",labelKey:"settings.sections.environment",icon:a.Terminal},{id:"workflow",labelKey:"settings.sections.workflow",icon:r.GitBranch},{id:"ci",labelKey:"settings.sections.ci",icon:l.Activity},{id:"stage-timeouts",labelKey:"settings.sections.timeouts",icon:h.Timer},{id:"notifications",labelKey:"settings.sections.notifications",icon:c},{id:"feature-flags",labelKey:"settings.sections.flags",icon:d},{id:"interactive-agent",labelKey:"settings.sections.chat",icon:p.MessageSquare},{id:"fab-layout",labelKey:"settings.sections.layout",icon:f},{id:"database",labelKey:"settings.sections.database",icon:u}];e.s(["SettingsPageClient",0,function({settings:e,shipitAiHome:l,dbFileSize:o,availableTerminals:g}){let{t:h}=(0,v.useTranslation)("web"),{showSaving:p,showSaved:f,save:j}=function(){let{t:e}=(0,v.useTranslation)("web"),[t,n]=(0,i.useTransition)(),[s,a]=(0,i.useState)(!1),[r,l]=(0,i.useState)(!1),o=(0,i.useRef)(null),c=(0,i.useRef)(!1);return(0,i.useEffect)(()=>{t&&!s&&(a(!0),c.current=!1,o.current=setTimeout(()=>{o.current=null,c.current&&(a(!1),l(!0),setTimeout(()=>l(!1),2e3))},350)),!t&&s&&(c.current=!0,o.current||(a(!1),l(!0),setTimeout(()=>l(!1),2e3)))},[t,s]),{showSaving:s,showSaved:r,save:(0,i.useCallback)(t=>{n(async()=>{let i=await y(t);i.success||x.toast.error(i.error??e("settings.failedToSave"))})},[n,e])}}(),k=e.featureFlags??{skills:!1,envDeploy:!1,debug:!1,githubImport:!1,adoptBranch:!1,gitRebaseSync:!1,reactFileManager:!1},[C,M]=(0,i.useState)(e.agent.type),[I,T]=(0,i.useState)(e.environment.defaultEditor),[A,D]=(0,i.useState)(e.environment.shellPreference),[F,R]=(0,i.useState)(e.environment.terminalPreference??S.TerminalType.System),z=g?g.filter(e=>e.available):[{id:S.TerminalType.System,name:h("settings.environment.systemTerminal"),available:!0}],[B,_]=(0,i.useState)(e.workflow.openPrOnImplementationComplete),[K,V]=(0,i.useState)(e.workflow.approvalGateDefaults.pushOnImplementationComplete),[W,Z]=(0,i.useState)(e.workflow.approvalGateDefaults.allowPrd),[Y,J]=(0,i.useState)(e.workflow.approvalGateDefaults.allowPlan),[Q,ee]=(0,i.useState)(e.workflow.approvalGateDefaults.allowMerge),[et,ei]=(0,i.useState)(e.workflow.enableEvidence),[en,es]=(0,i.useState)(e.workflow.commitEvidence),[ea,er]=(0,i.useState)(!1!==e.workflow.ciWatchEnabled),[el,eo]=(0,i.useState)(!1!==e.workflow.defaultFastMode),[ec,ed]=(0,i.useState)((e.workflow.autoArchiveDelayMinutes??10)>0),[eu,eg]=(0,i.useState)(String(e.workflow.autoArchiveDelayMinutes??10)),[em,eh]=(0,i.useState)(e.notifications.inApp.enabled),[ep,ef]=(0,i.useState)({...e.notifications.events}),[ex,ev]=(0,i.useState)({...k});function eb(e={}){let t=e.autoArchiveEnabled??ec,i=parseInt(e.autoArchiveDelay??eu,10);return{workflow:{openPrOnImplementationComplete:e.openPr??B,approvalGateDefaults:{pushOnImplementationComplete:e.pushOnComplete??K,allowPrd:e.allowPrd??W,allowPlan:e.allowPlan??Y,allowMerge:e.allowMerge??Q},enableEvidence:e.enableEvidence??et,commitEvidence:e.commitEvidence??en,ciWatchEnabled:e.ciWatchEnabled??ea,defaultFastMode:e.defaultFastMode??el,autoArchiveDelayMinutes:t?Number.isNaN(i)||i<1?10:i:0}}}function ew(e={}){return{notifications:{inApp:{enabled:e.inApp??em},events:e.events??ep}}}let[ej,ey]=(0,i.useState)("agent");(0,i.useEffect)(()=>{let e=eG.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&&ey(t.target.id.replace("section-",""))},{rootMargin:"-65px 0px -60% 0px",threshold:0});for(let i of e)t.observe(i);return()=>t.disconnect()},[]);let eS=(0,i.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)(m,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("h1",{className:"text-sm font-bold tracking-tight",children:h("settings.title")}),(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",p?"opacity-100":"opacity-0"),children:h("settings.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",f&&!p?"opacity-100":"opacity-0"),children:[(0,t.jsx)(n.Check,{className:"h-3 w-3"}),h("settings.saved")]})]}),(0,t.jsx)("nav",{className:"ml-auto flex items-center gap-0.5",children:eG.map(e=>{let i=e.icon,n=ej===e.id;return(0,t.jsxs)("button",{type:"button",onClick:()=>eS(e.id),className:(0,b.cn)("flex cursor-pointer items-center gap-1 rounded-md px-1.5 py-1 text-[11px] transition-all",n?"bg-accent text-foreground font-medium":"text-muted-foreground/60 hover:text-foreground hover:bg-accent/50"),children:[(0,t.jsx)(i,{className:"h-3 w-3"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:h(e.labelKey)})]},e.id)})})]})}),(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsx)("div",{id:"section-language",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:(0,t.jsx)(L,{language:e.user?.preferredLanguage??S.Language.English})}),(0,t.jsxs)("div",{id:"section-agent",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsx)(q,{icon:s.Bot,title:h("settings.agent.sectionTitle"),description:h("settings.agent.sectionDescription"),testId:"agent-settings-section",children:(0,t.jsx)(H,{label:h("settings.agent.agentAndModel"),description:h("settings.agent.agentAndModelDescription"),htmlFor:"agent-model-picker",children:(0,t.jsx)(E.AgentModelPicker,{initialAgentType:C,initialModel:e.models.default,mode:"settings",onAgentModelChange:e=>M(e),className:"w-55"})})}),(0,t.jsx)($,{links:[{label:h("settings.agent.links.agentSystem"),href:"https://github.com/jrmatherly/shipit/blob/main/docs/architecture/agent-system.md"},{label:h("settings.agent.links.addingAgents"),href:"https://github.com/jrmatherly/shipit/blob/main/docs/development/adding-agents.md"},{label:h("settings.agent.links.configurationGuide"),href:"https://github.com/jrmatherly/shipit/blob/main/docs/guides/configuration.md"}],children:h("settings.agent.hint")})]}),(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)(q,{icon:a.Terminal,title:h("settings.environment.sectionTitle"),description:h("settings.environment.sectionDescription"),testId:"environment-settings-section",children:[(0,t.jsx)(H,{label:h("settings.environment.defaultEditor"),description:h("settings.environment.defaultEditorDescription"),htmlFor:"default-editor",children:(0,t.jsxs)(w.Select,{value:I,onValueChange:e=>{T(e),j({environment:{defaultEditor:e,shellPreference:A,terminalPreference:F}})},children:[(0,t.jsx)(w.SelectTrigger,{id:"default-editor","data-testid":"editor-select",className:"w-55 cursor-pointer text-xs",children:(0,t.jsx)(w.SelectValue,{})}),(0,t.jsx)(w.SelectContent,{children:eO.map(e=>{var i;let n=(i=e.value)&&i in P?P[i]:N;return(0,t.jsx)(w.SelectItem,{value:e.value,children:(0,t.jsxs)("span",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)(n,{className:"h-4 w-4 shrink-0"}),e.label]})},e.value)})})]})}),(0,t.jsx)(H,{label:h("settings.environment.shell"),description:h("settings.environment.shellDescription"),htmlFor:"shell-preference",children:(0,t.jsxs)(w.Select,{value:A,onValueChange:e=>{D(e),j({environment:{defaultEditor:I,shellPreference:e,terminalPreference:F}})},children:[(0,t.jsx)(w.SelectTrigger,{id:"shell-preference","data-testid":"shell-select",className:"w-55 cursor-pointer text-xs",children:(0,t.jsx)(w.SelectValue,{})}),(0,t.jsx)(w.SelectContent,{children:eq.map(e=>(0,t.jsx)(w.SelectItem,{value:e.value,children:e.label},e.value))})]})}),(0,t.jsx)(H,{label:h("settings.environment.terminal"),description:h("settings.environment.terminalDescription"),htmlFor:"terminal-preference",children:(0,t.jsxs)(w.Select,{value:F,onValueChange:e=>{R(e),j({environment:{defaultEditor:I,shellPreference:A,terminalPreference:e}})},children:[(0,t.jsx)(w.SelectTrigger,{id:"terminal-preference","data-testid":"terminal-select",className:"w-55 cursor-pointer text-xs",children:(0,t.jsx)(w.SelectValue,{})}),(0,t.jsx)(w.SelectContent,{children:z.map(e=>(0,t.jsx)(w.SelectItem,{value:e.id,children:e.name},e.id))})]})})]}),(0,t.jsx)($,{links:[{label:h("settings.environment.links.configurationGuide"),href:"https://github.com/jrmatherly/shipit/blob/main/docs/guides/configuration.md"}],children:h("settings.environment.hint")})]}),(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)(q,{icon:r.GitBranch,title:h("settings.workflow.title"),description:h("settings.workflow.sectionDescription"),testId:"workflow-settings-section",children:[(0,t.jsx)(O,{label:h("settings.workflow.defaultFastMode"),description:h("settings.workflow.defaultFastModeDescription"),id:"default-fast-mode",testId:"switch-default-fast-mode",checked:el,onChange:e=>{eo(e),j(eb({defaultFastMode:e}))}}),(0,t.jsx)(U,{children:h("settings.workflow.subsections.approve")}),(0,t.jsx)(O,{label:h("settings.workflow.autoApprovePrd"),description:h("settings.workflow.autoApprovePrdDescription"),id:"allow-prd",testId:"switch-allow-prd",checked:W,onChange:e=>{Z(e),j(eb({allowPrd:e}))}}),(0,t.jsx)(O,{label:h("settings.workflow.autoApprovePlan"),description:h("settings.workflow.autoApprovePlanDescription"),id:"allow-plan",testId:"switch-allow-plan",checked:Y,onChange:e=>{J(e),j(eb({allowPlan:e}))}}),(0,t.jsx)(O,{label:h("settings.workflow.autoApproveMerge"),description:h("settings.workflow.autoApproveMergeDescription"),id:"allow-merge",testId:"switch-allow-merge",checked:Q,onChange:e=>{ee(e),j(eb({allowMerge:e}))}}),(0,t.jsx)(U,{children:h("settings.workflow.subsections.evidence")}),(0,t.jsx)(O,{label:h("settings.workflow.collectEvidence"),description:h("settings.workflow.collectEvidenceDescription"),id:"enable-evidence",testId:"switch-enable-evidence",checked:et,onChange:e=>{ei(e),e?j(eb({enableEvidence:e})):(es(!1),j(eb({enableEvidence:e,commitEvidence:!1})))}}),(0,t.jsx)(O,{label:h("settings.workflow.addEvidenceToPr"),description:h("settings.workflow.addEvidenceToPrDescription"),id:"commit-evidence",testId:"switch-commit-evidence",checked:en,disabled:!et||!B,onChange:e=>{es(e),j(eb({commitEvidence:e}))}}),(0,t.jsx)(U,{children:h("settings.workflow.subsections.git")}),(0,t.jsx)(O,{label:h("settings.workflow.pushOnComplete"),description:h("settings.workflow.pushOnCompleteDescription"),id:"push-on-complete",testId:"switch-push-on-complete",checked:K,onChange:e=>{V(e),j(eb({pushOnComplete:e}))}}),(0,t.jsx)(O,{label:h("settings.workflow.openPrOnComplete"),description:h("settings.workflow.openPrOnCompleteDescription"),id:"open-pr",testId:"switch-open-pr",checked:B,onChange:e=>{_(e),e?j(eb({openPr:e})):(es(!1),j(eb({openPr:e,commitEvidence:!1})))}}),(0,t.jsx)(O,{label:h("settings.workflow.watchCiAfterPush"),description:h("settings.workflow.watchCiAfterPushDescription"),id:"ci-watch-enabled",testId:"switch-ci-watch-enabled",checked:ea,onChange:e=>{er(e),j(eb({ciWatchEnabled:e}))}}),(0,t.jsx)(U,{children:"Archive"}),(0,t.jsx)(O,{label:"Auto-archive completed",description:"Automatically archive features after they reach the completed state",id:"auto-archive-enabled",testId:"switch-auto-archive-enabled",checked:ec,onChange:e=>{ed(e),j(eb({autoArchiveEnabled:e}))}}),(0,t.jsx)(H,{label:"Archive delay",description:"Minutes to wait after completion before archiving (1–1440)",htmlFor:"auto-archive-delay",children:(0,t.jsx)(G,{id:"auto-archive-delay",testId:"input-auto-archive-delay",value:eu,placeholder:"10",min:1,max:1440,suffix:"min",onChange:e=>{eg(e)},onBlur:()=>{if(!ec)return;let e=parseInt(eu,10),t=Number.isNaN(e)?10:Math.min(1440,Math.max(1,e));eg(String(t)),j(eb({autoArchiveDelay:String(t)}))}})})]}),(0,t.jsx)($,{links:[{label:h("settings.workflow.links.approvalGates"),href:"https://github.com/jrmatherly/shipit/blob/main/specs/016-hitl-approval-gates/spec.yaml"},{label:h("settings.workflow.links.pushAndPrFlags"),href:"https://github.com/jrmatherly/shipit/blob/main/specs/037-feature-pr-push-flags/spec.yaml"}],children:h("settings.workflow.hint")})]}),(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.jsx)(X,{settings:e}),(0,t.jsx)($,{links:[{label:h("settings.ci.links.cicdPipeline"),href:"https://github.com/jrmatherly/shipit/blob/main/docs/development/cicd.md"},{label:h("settings.ci.links.ciSecurityGates"),href:"https://github.com/jrmatherly/shipit/blob/main/specs/003-cicd-security-gates/spec.md"}],children:h("settings.ci.hint")})]}),(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.jsx)(eV,{settings:e}),(0,t.jsx)($,{children:h("settings.stageTimeouts.hint")})]}),(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)(q,{icon:c,title:h("settings.notifications.title"),description:h("settings.notifications.sectionDescription"),testId:"notification-settings-section",children:[(0,t.jsx)(U,{children:h("settings.notifications.channels")}),(0,t.jsx)(O,{label:h("settings.notifications.inAppLabel"),description:h("settings.notifications.inAppDescription"),id:"notif-in-app",testId:"switch-in-app",checked:em,onChange:e=>{eh(e),j(ew({inApp:e}))}}),(0,t.jsx)(U,{children:h("settings.notifications.subsections.agentEvents")}),(0,t.jsx)(O,{label:h("settings.notifications.events.agentStarted"),id:"notif-event-agentStarted",testId:"switch-event-agentStarted",checked:ep.agentStarted,onChange:e=>{let t={...ep,agentStarted:e};ef(t),j(ew({events:t}))}}),(0,t.jsx)(O,{label:h("settings.notifications.events.phaseCompleted"),id:"notif-event-phaseCompleted",testId:"switch-event-phaseCompleted",checked:ep.phaseCompleted,onChange:e=>{let t={...ep,phaseCompleted:e};ef(t),j(ew({events:t}))}}),(0,t.jsx)(O,{label:h("settings.notifications.events.waitingApproval"),id:"notif-event-waitingApproval",testId:"switch-event-waitingApproval",checked:ep.waitingApproval,onChange:e=>{let t={...ep,waitingApproval:e};ef(t),j(ew({events:t}))}}),(0,t.jsx)(O,{label:h("settings.notifications.events.agentCompleted"),id:"notif-event-agentCompleted",testId:"switch-event-agentCompleted",checked:ep.agentCompleted,onChange:e=>{let t={...ep,agentCompleted:e};ef(t),j(ew({events:t}))}}),(0,t.jsx)(O,{label:h("settings.notifications.events.agentFailed"),id:"notif-event-agentFailed",testId:"switch-event-agentFailed",checked:ep.agentFailed,onChange:e=>{let t={...ep,agentFailed:e};ef(t),j(ew({events:t}))}}),(0,t.jsx)(U,{children:h("settings.notifications.subsections.pullRequestEvents")}),(0,t.jsx)(O,{label:h("settings.notifications.events.prMerged"),id:"notif-event-prMerged",testId:"switch-event-prMerged",checked:ep.prMerged,onChange:e=>{let t={...ep,prMerged:e};ef(t),j(ew({events:t}))}}),(0,t.jsx)(O,{label:h("settings.notifications.events.prClosed"),id:"notif-event-prClosed",testId:"switch-event-prClosed",checked:ep.prClosed,onChange:e=>{let t={...ep,prClosed:e};ef(t),j(ew({events:t}))}}),(0,t.jsx)(O,{label:h("settings.notifications.events.prChecksPassed"),id:"notif-event-prChecksPassed",testId:"switch-event-prChecksPassed",checked:ep.prChecksPassed,onChange:e=>{let t={...ep,prChecksPassed:e};ef(t),j(ew({events:t}))}}),(0,t.jsx)(O,{label:h("settings.notifications.events.prChecksFailed"),id:"notif-event-prChecksFailed",testId:"switch-event-prChecksFailed",checked:ep.prChecksFailed,onChange:e=>{let t={...ep,prChecksFailed:e};ef(t),j(ew({events:t}))}}),(0,t.jsx)(O,{label:h("settings.notifications.events.prBlocked"),id:"notif-event-prBlocked",testId:"switch-event-prBlocked",checked:ep.prBlocked,onChange:e=>{let t={...ep,prBlocked:e};ef(t),j(ew({events:t}))}}),(0,t.jsx)(O,{label:h("settings.notifications.events.mergeReviewReady"),id:"notif-event-mergeReviewReady",testId:"switch-event-mergeReviewReady",checked:ep.mergeReviewReady,onChange:e=>{let t={...ep,mergeReviewReady:e};ef(t),j(ew({events:t}))}})]}),(0,t.jsx)($,{links:[{label:h("settings.notifications.links.notificationSystem"),href:"https://github.com/jrmatherly/shipit/blob/main/specs/021-agent-notifications/spec.yaml"}],children:h("settings.notifications.hint")})]}),(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)(q,{icon:d,title:h("settings.featureFlags.title"),description:h("settings.featureFlags.sectionDescription"),badge:h("settings.featureFlags.badge"),testId:"feature-flags-settings-section",children:[(0,t.jsx)(O,{label:h("settings.featureFlags.skills"),description:h("settings.featureFlags.skillsDescription"),id:"flag-skills",testId:"switch-flag-skills",checked:ex.skills,onChange:e=>{let t={...ex,skills:e};ev(t),j({featureFlags:t})}}),(0,t.jsx)(O,{label:h("settings.featureFlags.deployments"),description:h("settings.featureFlags.deploymentsDescription"),id:"flag-envDeploy",testId:"switch-flag-envDeploy",checked:ex.envDeploy,onChange:e=>{let t={...ex,envDeploy:e};ev(t),j({featureFlags:t})}}),(0,t.jsx)(O,{label:h("settings.featureFlags.debug"),description:h("settings.featureFlags.debugDescription"),id:"flag-debug",testId:"switch-flag-debug",checked:ex.debug,onChange:e=>{let t={...ex,debug:e};ev(t),j({featureFlags:t})}}),(0,t.jsx)(O,{label:h("settings.featureFlags.githubImport"),description:h("settings.featureFlags.githubImportDescription"),id:"flag-githubImport",testId:"switch-flag-githubImport",checked:ex.githubImport,onChange:e=>{let t={...ex,githubImport:e};ev(t),j({featureFlags:t})}}),(0,t.jsx)(O,{label:h("settings.featureFlags.adoptBranch"),description:h("settings.featureFlags.adoptBranchDescription"),id:"flag-adoptBranch",testId:"switch-flag-adoptBranch",checked:ex.adoptBranch,onChange:e=>{let t={...ex,adoptBranch:e};ev(t),j({featureFlags:t})}}),(0,t.jsx)(O,{label:h("settings.featureFlags.gitRebaseSync"),description:h("settings.featureFlags.gitRebaseSyncDescription"),id:"flag-gitRebaseSync",testId:"switch-flag-gitRebaseSync",checked:ex.gitRebaseSync,onChange:e=>{let t={...ex,gitRebaseSync:e};ev(t),j({featureFlags:t})}}),(0,t.jsx)(O,{label:h("settings.featureFlags.reactFileManager"),description:h("settings.featureFlags.reactFileManagerDescription"),id:"flag-reactFileManager",testId:"switch-flag-reactFileManager",checked:ex.reactFileManager,onChange:e=>{let t={...ex,reactFileManager:e};ev(t),j({featureFlags:t})}})]}),(0,t.jsx)($,{children:h("settings.featureFlags.hint")})]}),(0,t.jsxs)("div",{id:"section-interactive-agent",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsx)(eW,{settings:e}),(0,t.jsx)($,{children:h("settings.interactiveAgent.hint")})]}),(0,t.jsxs)("div",{id:"section-fab-layout",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsx)(eH,{settings:e}),(0,t.jsx)($,{children:h("settings.fabLayout.hint")})]}),(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)(q,{icon:u,title:h("settings.database.title"),description:h("settings.database.sectionDescription"),testId:"database-settings-section",children:[(0,t.jsx)(H,{label:h("settings.database.location"),description:h("settings.database.locationDescription"),children:(0,t.jsx)("span",{className:"text-muted-foreground max-w-50 truncate font-mono text-xs","data-testid":"shipit-ai-home-path",children:l})}),(0,t.jsx)(H,{label:h("settings.database.size"),children:(0,t.jsx)("span",{className:"text-muted-foreground text-xs","data-testid":"db-file-size",children:o})})]}),(0,t.jsx)($,{links:[{label:h("settings.database.links.settingsService"),href:"https://github.com/jrmatherly/shipit/blob/main/docs/architecture/settings-service.md"},{label:h("settings.database.links.settingsSpec"),href:"https://github.com/jrmatherly/shipit/blob/main/specs/005-global-settings-service/spec.md"}],children:h("settings.database.hint")})]})]})]})}],41952)}]);