@shepai/cli 1.150.2 → 1.151.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/dist/packages/core/src/application/ports/output/services/github-repository-service.interface.d.ts +17 -0
  2. package/dist/packages/core/src/application/ports/output/services/github-repository-service.interface.d.ts.map +1 -1
  3. package/dist/packages/core/src/application/ports/output/services/github-repository-service.interface.js +12 -0
  4. package/dist/packages/core/src/infrastructure/services/external/github-repository.service.d.ts +1 -0
  5. package/dist/packages/core/src/infrastructure/services/external/github-repository.service.d.ts.map +1 -1
  6. package/dist/packages/core/src/infrastructure/services/external/github-repository.service.js +18 -1
  7. package/dist/src/presentation/web/app/(dashboard)/@drawer/create/page.d.ts.map +1 -1
  8. package/dist/src/presentation/web/app/(dashboard)/@drawer/create/page.js +6 -2
  9. package/dist/src/presentation/web/app/actions/get-viewer-permission.d.ts +4 -0
  10. package/dist/src/presentation/web/app/actions/get-viewer-permission.d.ts.map +1 -0
  11. package/dist/src/presentation/web/app/actions/get-viewer-permission.js +14 -0
  12. package/dist/src/presentation/web/components/common/control-center-drawer/create-drawer-client.d.ts +2 -1
  13. package/dist/src/presentation/web/components/common/control-center-drawer/create-drawer-client.d.ts.map +1 -1
  14. package/dist/src/presentation/web/components/common/control-center-drawer/create-drawer-client.js +2 -2
  15. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.d.ts +3 -1
  16. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.d.ts.map +1 -1
  17. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.js +29 -3
  18. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.stories.d.ts +10 -0
  19. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.stories.d.ts.map +1 -1
  20. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.stories.js +37 -3
  21. package/dist/tsconfig.build.tsbuildinfo +1 -1
  22. package/package.json +1 -1
  23. package/web/.next/BUILD_ID +1 -1
  24. package/web/.next/build-manifest.json +2 -2
  25. package/web/.next/fallback-build-manifest.json +2 -2
  26. package/web/.next/prerender-manifest.json +3 -3
  27. package/web/.next/required-server-files.js +2 -2
  28. package/web/.next/required-server-files.json +2 -2
  29. package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +28 -28
  30. package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js +1 -1
  31. package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -1
  32. package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +1 -1
  33. package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +71 -56
  34. package/web/.next/server/app/(dashboard)/@drawer/create/page.js +1 -1
  35. package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
  36. package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
  37. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +36 -36
  38. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  39. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  40. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +36 -36
  41. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
  42. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
  43. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +26 -26
  44. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
  45. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  46. package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +71 -56
  47. package/web/.next/server/app/(dashboard)/create/page.js +1 -1
  48. package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
  49. package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
  50. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +36 -36
  51. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  52. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  53. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +36 -36
  54. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
  55. package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
  56. package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +26 -26
  57. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  58. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  59. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +26 -26
  60. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
  61. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  62. package/web/.next/server/app/_global-error.html +2 -2
  63. package/web/.next/server/app/_global-error.rsc +1 -1
  64. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  65. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  66. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  67. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  68. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  69. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +3 -3
  70. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  71. package/web/.next/server/app/api/attachments/preview/route.js.nft.json +1 -1
  72. package/web/.next/server/app/api/evidence/route.js.nft.json +1 -1
  73. package/web/.next/server/app/api/graph-data/route.js.nft.json +1 -1
  74. package/web/.next/server/app/settings/page/server-reference-manifest.json +8 -8
  75. package/web/.next/server/app/settings/page.js.nft.json +1 -1
  76. package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  77. package/web/.next/server/app/skills/page/server-reference-manifest.json +8 -8
  78. package/web/.next/server/app/skills/page.js.nft.json +1 -1
  79. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  80. package/web/.next/server/app/tools/page/server-reference-manifest.json +8 -8
  81. package/web/.next/server/app/tools/page.js.nft.json +1 -1
  82. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  83. package/web/.next/server/app/version/page/server-reference-manifest.json +3 -3
  84. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  85. package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
  86. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
  87. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
  88. package/web/.next/server/chunks/ssr/[root-of-the-server]__2138fa7e._.js +2 -2
  89. package/web/.next/server/chunks/ssr/[root-of-the-server]__2138fa7e._.js.map +1 -1
  90. package/web/.next/server/chunks/ssr/[root-of-the-server]__29580090._.js +1 -1
  91. package/web/.next/server/chunks/ssr/[root-of-the-server]__29580090._.js.map +1 -1
  92. package/web/.next/server/chunks/ssr/[root-of-the-server]__357d99f9._.js +1 -1
  93. package/web/.next/server/chunks/ssr/[root-of-the-server]__3ef34e4c._.js +1 -1
  94. package/web/.next/server/chunks/ssr/[root-of-the-server]__3ef34e4c._.js.map +1 -1
  95. package/web/.next/server/chunks/ssr/[root-of-the-server]__43f51aa6._.js +1 -1
  96. package/web/.next/server/chunks/ssr/[root-of-the-server]__43f51aa6._.js.map +1 -1
  97. package/web/.next/server/chunks/ssr/[root-of-the-server]__815546bd._.js +1 -1
  98. package/web/.next/server/chunks/ssr/[root-of-the-server]__815546bd._.js.map +1 -1
  99. package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js +2 -2
  100. package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js.map +1 -1
  101. package/web/.next/server/chunks/ssr/[root-of-the-server]__c094882b._.js +1 -1
  102. package/web/.next/server/chunks/ssr/[root-of-the-server]__c094882b._.js.map +1 -1
  103. package/web/.next/server/chunks/ssr/[root-of-the-server]__c9777776._.js +1 -1
  104. package/web/.next/server/chunks/ssr/[root-of-the-server]__c9777776._.js.map +1 -1
  105. package/web/.next/server/chunks/ssr/[root-of-the-server]__d48c5b11._.js +1 -1
  106. package/web/.next/server/chunks/ssr/[root-of-the-server]__d48c5b11._.js.map +1 -1
  107. package/web/.next/server/chunks/ssr/[root-of-the-server]__dac5dbf1._.js +1 -1
  108. package/web/.next/server/chunks/ssr/[root-of-the-server]__dac5dbf1._.js.map +1 -1
  109. package/web/.next/server/chunks/ssr/[root-of-the-server]__fae8b355._.js +1 -1
  110. package/web/.next/server/chunks/ssr/[root-of-the-server]__fae8b355._.js.map +1 -1
  111. package/web/.next/server/chunks/ssr/_05c23ad9._.js +1 -1
  112. package/web/.next/server/chunks/ssr/_05c23ad9._.js.map +1 -1
  113. package/web/.next/server/chunks/ssr/{_0c5f56e3._.js → _0c473fef._.js} +3 -3
  114. package/web/.next/server/chunks/ssr/_0c473fef._.js.map +1 -0
  115. package/web/.next/server/chunks/ssr/_16eb4fec._.js +1 -1
  116. package/web/.next/server/chunks/ssr/_16eb4fec._.js.map +1 -1
  117. package/web/.next/server/chunks/ssr/_1b719e7f._.js +1 -1
  118. package/web/.next/server/chunks/ssr/_1b719e7f._.js.map +1 -1
  119. package/web/.next/server/chunks/ssr/_37e8548b._.js +1 -1
  120. package/web/.next/server/chunks/ssr/_37e8548b._.js.map +1 -1
  121. package/web/.next/server/chunks/ssr/{_695769ba._.js → _55bf82c8._.js} +2 -2
  122. package/web/.next/server/chunks/ssr/{_695769ba._.js.map → _55bf82c8._.js.map} +1 -1
  123. package/web/.next/server/chunks/ssr/_55d763e2._.js +1 -1
  124. package/web/.next/server/chunks/ssr/_55d763e2._.js.map +1 -1
  125. package/web/.next/server/chunks/ssr/_6256a985._.js +1 -1
  126. package/web/.next/server/chunks/ssr/_6256a985._.js.map +1 -1
  127. package/web/.next/server/chunks/ssr/{_f8187a14._.js → _8e927591._.js} +2 -2
  128. package/web/.next/server/chunks/ssr/{_f8187a14._.js.map → _8e927591._.js.map} +1 -1
  129. package/web/.next/server/chunks/ssr/_8fcc39d4._.js +1 -1
  130. package/web/.next/server/chunks/ssr/_8fcc39d4._.js.map +1 -1
  131. package/web/.next/server/chunks/ssr/_b71645b4._.js +1 -1
  132. package/web/.next/server/chunks/ssr/_b71645b4._.js.map +1 -1
  133. package/web/.next/server/chunks/ssr/_d8575088._.js +1 -1
  134. package/web/.next/server/chunks/ssr/_d8575088._.js.map +1 -1
  135. package/web/.next/server/chunks/ssr/{_64bdfc6f._.js → _e9e9ed20._.js} +3 -3
  136. package/web/.next/server/chunks/ssr/_e9e9ed20._.js.map +1 -0
  137. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
  138. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
  139. package/web/.next/server/chunks/ssr/src_presentation_web_789f6455._.js +3 -0
  140. package/web/.next/server/chunks/ssr/{src_presentation_web_94d3ebb0._.js.map → src_presentation_web_789f6455._.js.map} +1 -1
  141. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1b176e3c.js +1 -1
  142. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1b176e3c.js.map +1 -1
  143. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_bd9f0dda.js +1 -1
  144. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_bd9f0dda.js.map +1 -1
  145. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_baaca5d5._.js +1 -1
  146. package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js +1 -1
  147. package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js.map +1 -1
  148. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
  149. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
  150. package/web/.next/server/pages/500.html +2 -2
  151. package/web/.next/server/server-reference-manifest.js +1 -1
  152. package/web/.next/server/server-reference-manifest.json +122 -100
  153. package/web/.next/static/chunks/{3818fbb40965ae3f.js → 03a989d0e8bc00fd.js} +1 -1
  154. package/web/.next/static/chunks/{e16c5caa0013aaf0.js → 0e2ba692a8d487f4.js} +1 -1
  155. package/web/.next/static/chunks/{25dc964bed9ed181.js → 1cb8aca84ee55038.js} +1 -1
  156. package/web/.next/static/chunks/58d6fbe9b1644b3b.js +5 -0
  157. package/web/.next/static/chunks/{49057cf8cd37e262.js → 5aa2268f5398cea3.js} +1 -1
  158. package/web/.next/static/chunks/{65426ebcea60e166.js → 64d0db4c27aa89d4.js} +1 -1
  159. package/web/.next/static/chunks/{47cfc2a88674ac18.js → 981f007316324a03.js} +1 -1
  160. package/web/.next/static/chunks/982af891d00a7cda.js +1 -0
  161. package/web/.next/static/chunks/9d5cfdd485c12417.js +1 -0
  162. package/web/.next/static/chunks/{36b9b5fd99a44449.js → bd5b4b4969da3e0d.js} +1 -1
  163. package/web/.next/static/chunks/{7a347740423afe43.js → c2c0e398e3a1aee0.js} +1 -1
  164. package/web/.next/static/chunks/{5afd402b04d34aef.js → dfd8aae9053fb13e.js} +1 -1
  165. package/web/.next/static/chunks/{261c1d86233fc28b.js → eae7626511ddddbf.js} +1 -1
  166. package/web/.next/server/chunks/ssr/_0c5f56e3._.js.map +0 -1
  167. package/web/.next/server/chunks/ssr/_64bdfc6f._.js.map +0 -1
  168. package/web/.next/server/chunks/ssr/src_presentation_web_94d3ebb0._.js +0 -3
  169. package/web/.next/static/chunks/1726b267b5058237.js +0 -1
  170. package/web/.next/static/chunks/48591f3d861a3c52.js +0 -1
  171. package/web/.next/static/chunks/9a5c77f449eaa1b3.js +0 -5
  172. /package/web/.next/static/{HsdbagW-OgDuUo9t_JJ83 → VXswdUutW5ng5ySwEwQVs}/_buildManifest.js +0 -0
  173. /package/web/.next/static/{HsdbagW-OgDuUo9t_JJ83 → VXswdUutW5ng5ySwEwQVs}/_clientMiddlewareManifest.json +0 -0
  174. /package/web/.next/static/{HsdbagW-OgDuUo9t_JJ83 → VXswdUutW5ng5ySwEwQVs}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,81181,e=>{"use strict";var t=e.i(95230);e.s(["Download",()=>t.default])},43416,e=>{"use strict";let t=(0,e.i(3645).default)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);e.s(["RefreshCw",()=>t],43416)},58860,44229,e=>{"use strict";let t=(0,e.i(3645).default)("timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);e.s(["Timer",()=>t],58860);var a=e.i(93752);e.s(["Code",()=>a.default],44229)},93752,e=>{"use strict";let t=(0,e.i(3645).default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);e.s(["default",()=>t])},95230,e=>{"use strict";let t=(0,e.i(3645).default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);e.s(["default",()=>t])},16868,e=>{"use strict";let t=(0,e.i(3645).default)("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);e.s(["PaperclipIcon",()=>t],16868)},48306,64764,80436,17087,28267,57484,e=>{"use strict";var t=e.i(20314),a=e.i(31777);function l({className:e,...l}){return(0,t.jsx)("textarea",{"data-slot":"textarea",className:(0,a.cn)("placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input field-sizing-content min-h-[80px] w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...l})}e.s(["Textarea",()=>l],48306);var s=e.i(15506);e.s(["Loader2Icon",()=>s.default],64764);var r=e.i(95230);e.s(["DownloadIcon",()=>r.default],80436);var i=e.i(3645);let o=(0,i.default)("sticky-note",[["path",{d:"M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z",key:"1dfntj"}],["path",{d:"M15 3v5a1 1 0 0 0 1 1h5",key:"6s6qgf"}]]);e.s(["StickyNoteIcon",()=>o],17087);var d=e.i(1693);e.s(["VisuallyHidden",0,d],28267);let n=(0,i.default)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);e.s(["FileIcon",()=>n],57484)},16298,e=>{"use strict";let t=(0,e.i(3645).default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);e.s(["default",()=>t])},50032,86254,42076,e=>{"use strict";var t=e.i(20314),a=e.i(60253),l=e.i(64764),s=e.i(80436),r=e.i(17087),i=e.i(31777),o=e.i(2287),d=e.i(48306),n=e.i(2828),c=e.i(28267),u=e.i(57484),h=e.i(16298),h=h;let x=(0,e.i(3645).default)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);var m=e.i(93752),m=m;e.i(35364);let p=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]),f=new Set([".ts",".tsx",".js",".jsx",".json",".yaml",".yml",".xml",".html",".css",".md"]);function g(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,t)).toFixed(+(0!==t))} ${["B","KB","MB","GB"][t]}`}let b=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]);function v(e,t){let a=new URLSearchParams({path:e,mimeType:t});return`/api/attachments/preview?${a.toString()}`}function y({name:e,size:y,mimeType:j,path:w,onRemove:k,loading:N=!1,disabled:M=!1,notes:T,onNotesChange:C}){let I,D,S=(I=e.lastIndexOf("."))>=0?e.slice(I).toLowerCase():"",z=p.has(S)?x:".pdf"===S?h.default:f.has(S)?m.default:u.FileIcon,H=".pdf"===S?"bg-red-50 text-red-600":p.has(S)?"bg-blue-50 text-blue-600":f.has(S)?"bg-emerald-50 text-emerald-600":"bg-gray-50 text-gray-600",L=(D=e.lastIndexOf("."))>=0&&b.has(e.slice(D).toLowerCase());if(N)return(0,t.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-md border",children:(0,t.jsx)(l.Loader2Icon,{className:"text-muted-foreground h-5 w-5 animate-spin"})});if(L){let l=(0,t.jsxs)("button",{type:"button",className:"relative block cursor-pointer rounded-md",children:[(0,t.jsx)("img",{src:v(w,j),alt:e,title:e,className:"h-12 w-12 rounded-md border object-cover transition-opacity hover:opacity-80"}),T?(0,t.jsx)("span",{className:"ring-background absolute -right-1 -bottom-1 flex h-4 w-4 items-center justify-center rounded-full bg-amber-500 text-white shadow-sm ring-2",children:(0,t.jsx)(r.StickyNoteIcon,{className:"h-2.5 w-2.5"})}):null]});return(0,t.jsx)(n.TooltipProvider,{delayDuration:200,children:(0,t.jsxs)(o.Dialog,{children:[(0,t.jsxs)(n.Tooltip,{children:[(0,t.jsxs)("div",{className:"group relative",children:[(0,t.jsx)(n.TooltipTrigger,{asChild:!0,children:(0,t.jsx)(o.DialogTrigger,{asChild:!0,children:l})}),!M&&(0,t.jsx)("button",{type:"button",onClick:k,className:"absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex","aria-label":`Remove ${e}`,children:(0,t.jsx)(a.X,{className:"h-3 w-3"})})]}),T?(0,t.jsx)(n.TooltipContent,{side:"bottom",className:"max-w-[220px] border border-amber-200 bg-amber-50 text-amber-950 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-100",children:(0,t.jsx)("p",{className:"line-clamp-3 text-xs leading-snug",children:T})}):null]}),(0,t.jsxs)(o.DialogContent,{className:"max-w-3xl gap-0 overflow-hidden border-0 p-0 [&>button:last-child]:!cursor-pointer [&>button:last-child]:!rounded-full [&>button:last-child]:!bg-black/70 [&>button:last-child]:!p-1.5 [&>button:last-child]:!text-white [&>button:last-child]:!opacity-100 [&>button:last-child]:!shadow-lg [&>button:last-child]:!backdrop-blur-md [&>button:last-child]:hover:!bg-black/90",children:[(0,t.jsx)(c.VisuallyHidden.Root,{children:(0,t.jsxs)(o.DialogTitle,{children:["Preview: ",e]})}),(0,t.jsx)("div",{className:"relative bg-black/90",children:(0,t.jsx)("img",{src:v(w,j),alt:e,className:"h-auto max-h-[70vh] w-full object-contain"})}),(0,t.jsxs)("div",{className:"bg-background flex flex-col gap-2 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:e}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:g(y)})]}),(0,t.jsx)("a",{href:v(w,j),download:e,className:"text-muted-foreground hover:text-foreground shrink-0 cursor-pointer rounded p-1.5 transition-colors","aria-label":`Download ${e}`,children:(0,t.jsx)(s.DownloadIcon,{className:"h-4 w-4"})})]}),C?(0,t.jsx)(d.Textarea,{placeholder:"Add notes about this image…",value:T??"",onChange:e=>C(e.target.value),rows:2,className:"resize-none text-sm","aria-label":"Image notes"}):T?(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:T}):null]})]})]})})}return(0,t.jsxs)("div",{className:"group relative flex items-center gap-2 rounded-full border py-1 pr-3 pl-2",children:[(0,t.jsx)("div",{className:(0,i.cn)("flex h-6 w-6 shrink-0 items-center justify-center rounded-full",H),children:(0,t.jsx)(z,{className:"h-3 w-3"})}),(0,t.jsx)("span",{className:"max-w-[120px] truncate text-sm",children:e}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:g(y)}),!M&&(0,t.jsx)("button",{type:"button",onClick:k,className:"absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex","aria-label":`Remove ${e}`,children:(0,t.jsx)(a.X,{className:"h-3 w-3"})})]})}async function j(){let e=await fetch("/api/dialog/pick-files",{method:"POST"});if(!e.ok)throw Error("Failed to open file dialog");let t=await e.json();return t.cancelled?null:t.files}e.s(["AttachmentChip",()=>y],86254),e.s([],50032),e.s(["pickFiles",()=>j],42076)},70471,e=>{"use strict";var t=e.i(16298);e.s(["FileText",()=>t.default])}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,81181,e=>{"use strict";var t=e.i(95230);e.s(["Download",()=>t.default])},43416,e=>{"use strict";let t=(0,e.i(3645).default)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);e.s(["RefreshCw",()=>t],43416)},58860,44229,e=>{"use strict";let t=(0,e.i(3645).default)("timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);e.s(["Timer",()=>t],58860);var a=e.i(93752);e.s(["Code",()=>a.default],44229)},93752,e=>{"use strict";let t=(0,e.i(3645).default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);e.s(["default",()=>t])},95230,e=>{"use strict";let t=(0,e.i(3645).default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);e.s(["default",()=>t])},16868,e=>{"use strict";let t=(0,e.i(3645).default)("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);e.s(["PaperclipIcon",()=>t],16868)},48306,64764,80436,17087,28267,57484,e=>{"use strict";var t=e.i(20314),a=e.i(31777);function l({className:e,...l}){return(0,t.jsx)("textarea",{"data-slot":"textarea",className:(0,a.cn)("placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input field-sizing-content min-h-[80px] w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...l})}e.s(["Textarea",()=>l],48306);var s=e.i(15506);e.s(["Loader2Icon",()=>s.default],64764);var r=e.i(95230);e.s(["DownloadIcon",()=>r.default],80436);var i=e.i(3645);let o=(0,i.default)("sticky-note",[["path",{d:"M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z",key:"1dfntj"}],["path",{d:"M15 3v5a1 1 0 0 0 1 1h5",key:"6s6qgf"}]]);e.s(["StickyNoteIcon",()=>o],17087);var d=e.i(1693);e.s(["VisuallyHidden",0,d],28267);let n=(0,i.default)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);e.s(["FileIcon",()=>n],57484)},16298,e=>{"use strict";let t=(0,e.i(3645).default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);e.s(["default",()=>t])},50032,86254,58194,e=>{"use strict";var t=e.i(20314),a=e.i(60253),l=e.i(64764),s=e.i(80436),r=e.i(17087),i=e.i(31777),o=e.i(2287),d=e.i(48306),n=e.i(2828),c=e.i(28267),u=e.i(57484),h=e.i(16298),h=h;let x=(0,e.i(3645).default)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);var m=e.i(93752),m=m;e.i(35364);let p=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]),f=new Set([".ts",".tsx",".js",".jsx",".json",".yaml",".yml",".xml",".html",".css",".md"]);function g(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,t)).toFixed(+(0!==t))} ${["B","KB","MB","GB"][t]}`}let b=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]);function v(e,t){let a=new URLSearchParams({path:e,mimeType:t});return`/api/attachments/preview?${a.toString()}`}function y({name:e,size:y,mimeType:j,path:w,onRemove:k,loading:N=!1,disabled:M=!1,notes:T,onNotesChange:C}){let I,D,S=(I=e.lastIndexOf("."))>=0?e.slice(I).toLowerCase():"",z=p.has(S)?x:".pdf"===S?h.default:f.has(S)?m.default:u.FileIcon,H=".pdf"===S?"bg-red-50 text-red-600":p.has(S)?"bg-blue-50 text-blue-600":f.has(S)?"bg-emerald-50 text-emerald-600":"bg-gray-50 text-gray-600",L=(D=e.lastIndexOf("."))>=0&&b.has(e.slice(D).toLowerCase());if(N)return(0,t.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-md border",children:(0,t.jsx)(l.Loader2Icon,{className:"text-muted-foreground h-5 w-5 animate-spin"})});if(L){let l=(0,t.jsxs)("button",{type:"button",className:"relative block cursor-pointer rounded-md",children:[(0,t.jsx)("img",{src:v(w,j),alt:e,title:e,className:"h-12 w-12 rounded-md border object-cover transition-opacity hover:opacity-80"}),T?(0,t.jsx)("span",{className:"ring-background absolute -right-1 -bottom-1 flex h-4 w-4 items-center justify-center rounded-full bg-amber-500 text-white shadow-sm ring-2",children:(0,t.jsx)(r.StickyNoteIcon,{className:"h-2.5 w-2.5"})}):null]});return(0,t.jsx)(n.TooltipProvider,{delayDuration:200,children:(0,t.jsxs)(o.Dialog,{children:[(0,t.jsxs)(n.Tooltip,{children:[(0,t.jsxs)("div",{className:"group relative",children:[(0,t.jsx)(n.TooltipTrigger,{asChild:!0,children:(0,t.jsx)(o.DialogTrigger,{asChild:!0,children:l})}),!M&&(0,t.jsx)("button",{type:"button",onClick:k,className:"absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex","aria-label":`Remove ${e}`,children:(0,t.jsx)(a.X,{className:"h-3 w-3"})})]}),T?(0,t.jsx)(n.TooltipContent,{side:"bottom",className:"max-w-[220px] border border-amber-200 bg-amber-50 text-amber-950 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-100",children:(0,t.jsx)("p",{className:"line-clamp-3 text-xs leading-snug",children:T})}):null]}),(0,t.jsxs)(o.DialogContent,{className:"max-w-3xl gap-0 overflow-hidden border-0 p-0 [&>button:last-child]:!cursor-pointer [&>button:last-child]:!rounded-full [&>button:last-child]:!bg-black/70 [&>button:last-child]:!p-1.5 [&>button:last-child]:!text-white [&>button:last-child]:!opacity-100 [&>button:last-child]:!shadow-lg [&>button:last-child]:!backdrop-blur-md [&>button:last-child]:hover:!bg-black/90",children:[(0,t.jsx)(c.VisuallyHidden.Root,{children:(0,t.jsxs)(o.DialogTitle,{children:["Preview: ",e]})}),(0,t.jsx)("div",{className:"relative bg-black/90",children:(0,t.jsx)("img",{src:v(w,j),alt:e,className:"h-auto max-h-[70vh] w-full object-contain"})}),(0,t.jsxs)("div",{className:"bg-background flex flex-col gap-2 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:e}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:g(y)})]}),(0,t.jsx)("a",{href:v(w,j),download:e,className:"text-muted-foreground hover:text-foreground shrink-0 cursor-pointer rounded p-1.5 transition-colors","aria-label":`Download ${e}`,children:(0,t.jsx)(s.DownloadIcon,{className:"h-4 w-4"})})]}),C?(0,t.jsx)(d.Textarea,{placeholder:"Add notes about this image…",value:T??"",onChange:e=>C(e.target.value),rows:2,className:"resize-none text-sm","aria-label":"Image notes"}):T?(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:T}):null]})]})]})})}return(0,t.jsxs)("div",{className:"group relative flex items-center gap-2 rounded-full border py-1 pr-3 pl-2",children:[(0,t.jsx)("div",{className:(0,i.cn)("flex h-6 w-6 shrink-0 items-center justify-center rounded-full",H),children:(0,t.jsx)(z,{className:"h-3 w-3"})}),(0,t.jsx)("span",{className:"max-w-[120px] truncate text-sm",children:e}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:g(y)}),!M&&(0,t.jsx)("button",{type:"button",onClick:k,className:"absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex","aria-label":`Remove ${e}`,children:(0,t.jsx)(a.X,{className:"h-3 w-3"})})]})}async function j(){let e=await fetch("/api/dialog/pick-files",{method:"POST"});if(!e.ok)throw Error("Failed to open file dialog");let t=await e.json();return t.cancelled?null:t.files}e.s(["AttachmentChip",()=>y],86254),e.s([],50032),e.s(["pickFiles",()=>j],58194)},70471,e=>{"use strict";var t=e.i(16298);e.s(["FileText",()=>t.default])}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,58860,44229,e=>{"use strict";let t=(0,e.i(3645).default)("timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);e.s(["Timer",()=>t],58860);var r=e.i(93752);e.s(["Code",()=>r.default],44229)},10714,99105,e=>{"use strict";var t=e.i(3645);let r=(0,t.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);e.s(["default",()=>r],10714);let o=(0,t.default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",()=>o],99105)},38573,e=>{"use strict";let t=(0,e.i(3645).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",()=>t],38573)},30702,e=>{"use strict";let t=(0,e.i(3645).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",()=>t],30702)},23925,1012,e=>{"use strict";let t=(0,e.i(3645).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",()=>t],1012),e.s(["Check",()=>t],23925)},23405,e=>{"use strict";var t=e.i(79054);function r(e){let r=t.useRef({value:e,previous:e});return t.useMemo(()=>(r.current.value!==e&&(r.current.previous=r.current.value,r.current.value=e),r.current.previous),[e])}e.s(["usePrevious",()=>r])},11345,e=>{"use strict";let t=(0,e.i(3645).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",()=>t],11345)},76016,e=>{"use strict";let t=(0,e.i(3645).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",()=>t],76016)},93752,e=>{"use strict";let t=(0,e.i(3645).default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);e.s(["default",()=>t])},83902,e=>{"use strict";let t=(0,e.i(3645).default)("rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);e.s(["Rocket",()=>t],83902)},90382,e=>{"use strict";var t=e.i(20314),r=e.i(79054),o=e.i(91967),a=e.i(5978),n=e.i(22528),s=e.i(53532),i=e.i(41687),l=e.i(56720),d=e.i(13123),c=e.i(52740),u=e.i(39979),p=e.i(85995),f=e.i(87620),h=e.i(86874),m=e.i(36589),v=e.i(73772),x=e.i(13044),g="Popover",[b,y]=(0,n.createContextScope)(g,[c.createPopperScope]),k=(0,c.createPopperScope)(),[w,j]=b(g),C=e=>{let{__scopePopover:o,children:a,open:n,defaultOpen:s,onOpenChange:i,modal:l=!1}=e,u=k(o),p=r.useRef(null),[f,h]=r.useState(!1),[v,x]=(0,m.useControllableState)({prop:n,defaultProp:s??!1,onChange:i,caller:g});return(0,t.jsx)(c.Root,{...u,children:(0,t.jsx)(w,{scope:o,contentId:(0,d.useId)(),triggerRef:p,open:v,onOpenChange:x,onOpenToggle:r.useCallback(()=>x(e=>!e),[x]),hasCustomAnchor:f,onCustomAnchorAdd:r.useCallback(()=>h(!0),[]),onCustomAnchorRemove:r.useCallback(()=>h(!1),[]),modal:l,children:a})})};C.displayName=g;var P="PopoverAnchor",R=r.forwardRef((e,o)=>{let{__scopePopover:a,...n}=e,s=j(P,a),i=k(a),{onCustomAnchorAdd:l,onCustomAnchorRemove:d}=s;return r.useEffect(()=>(l(),()=>d()),[l,d]),(0,t.jsx)(c.Anchor,{...i,...n,ref:o})});R.displayName=P;var N="PopoverTrigger",A=r.forwardRef((e,r)=>{let{__scopePopover:n,...s}=e,i=j(N,n),l=k(n),d=(0,a.useComposedRefs)(r,i.triggerRef),u=(0,t.jsx)(f.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":U(i.open),...s,ref:d,onClick:(0,o.composeEventHandlers)(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?u:(0,t.jsx)(c.Anchor,{asChild:!0,...l,children:u})});A.displayName=N;var S="PopoverPortal",[T,M]=b(S,{forceMount:void 0}),E=e=>{let{__scopePopover:r,forceMount:o,children:a,container:n}=e,s=j(S,r);return(0,t.jsx)(T,{scope:r,forceMount:o,children:(0,t.jsx)(p.Presence,{present:o||s.open,children:(0,t.jsx)(u.Portal,{asChild:!0,container:n,children:a})})})};E.displayName=S;var F="PopoverContent",O=r.forwardRef((e,r)=>{let o=M(F,e.__scopePopover),{forceMount:a=o.forceMount,...n}=e,s=j(F,e.__scopePopover);return(0,t.jsx)(p.Presence,{present:a||s.open,children:s.modal?(0,t.jsx)(D,{...n,ref:r}):(0,t.jsx)(I,{...n,ref:r})})});O.displayName=F;var z=(0,h.createSlot)("PopoverContent.RemoveScroll"),D=r.forwardRef((e,n)=>{let s=j(F,e.__scopePopover),i=r.useRef(null),l=(0,a.useComposedRefs)(n,i),d=r.useRef(!1);return r.useEffect(()=>{let e=i.current;if(e)return(0,v.hideOthers)(e)},[]),(0,t.jsx)(x.RemoveScroll,{as:z,allowPinchZoom:!0,children:(0,t.jsx)(q,{...e,ref:l,trapFocus:s.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,o.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),d.current||s.triggerRef.current?.focus()}),onPointerDownOutside:(0,o.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;d.current=2===t.button||r},{checkForDefaultPrevented:!1}),onFocusOutside:(0,o.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),I=r.forwardRef((e,o)=>{let a=j(F,e.__scopePopover),n=r.useRef(!1),s=r.useRef(!1);return(0,t.jsx)(q,{...e,ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(n.current||a.triggerRef.current?.focus(),t.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(n.current=!0,"pointerdown"===t.detail.originalEvent.type&&(s.current=!0));let r=t.target;a.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&s.current&&t.preventDefault()}})}),q=r.forwardRef((e,r)=>{let{__scopePopover:o,trapFocus:a,onOpenAutoFocus:n,onCloseAutoFocus:d,disableOutsidePointerEvents:u,onEscapeKeyDown:p,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,...v}=e,x=j(F,o),g=k(o);return(0,i.useFocusGuards)(),(0,t.jsx)(l.FocusScope,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:n,onUnmountAutoFocus:d,children:(0,t.jsx)(s.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:u,onInteractOutside:m,onEscapeKeyDown:p,onPointerDownOutside:f,onFocusOutside:h,onDismiss:()=>x.onOpenChange(!1),children:(0,t.jsx)(c.Content,{"data-state":U(x.open),role:"dialog",id:x.contentId,...g,...v,ref:r,style:{...v.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),H="PopoverClose",L=r.forwardRef((e,r)=>{let{__scopePopover:a,...n}=e,s=j(H,a);return(0,t.jsx)(f.Primitive.button,{type:"button",...n,ref:r,onClick:(0,o.composeEventHandlers)(e.onClick,()=>s.onOpenChange(!1))})});L.displayName=H;var _=r.forwardRef((e,r)=>{let{__scopePopover:o,...a}=e,n=k(o);return(0,t.jsx)(c.Arrow,{...n,...a,ref:r})});function U(e){return e?"open":"closed"}_.displayName="PopoverArrow",e.s(["Anchor",()=>R,"Arrow",()=>_,"Close",()=>L,"Content",()=>O,"Popover",()=>C,"PopoverAnchor",()=>R,"PopoverArrow",()=>_,"PopoverClose",()=>L,"PopoverContent",()=>O,"PopoverPortal",()=>E,"PopoverTrigger",()=>A,"Portal",()=>E,"Root",()=>C,"Trigger",()=>A,"createPopoverScope",()=>y],89920);var B=e.i(89920),B=B,K=e.i(31777);let X=B.Root,G=B.Trigger;B.Anchor;let V=r.forwardRef(({className:e,align:r="center",sideOffset:o=4,...a},n)=>(0,t.jsx)(B.Portal,{children:(0,t.jsx)(B.Content,{ref:n,align:r,sideOffset:o,className:(0,K.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border p-4 shadow-md outline-none",e),...a})}));V.displayName=B.Content.displayName,e.s(["Popover",()=>X,"PopoverContent",()=>V,"PopoverTrigger",()=>G],90382)},66967,22503,e=>{"use strict";var t=e.i(21023);let r=(0,t.createServerReference)("007e9b74bf9ae67d99881beff65868dbc1685b13e2",t.callServer,void 0,t.findSourceMapURL,"getAllAgentModels");e.s(["getAllAgentModels",()=>r],66967);let o=(0,t.createServerReference)("60124454584b1b2bdf2a30a9e4ad153d18a7b0483e",t.callServer,void 0,t.findSourceMapURL,"updateAgentAndModel");e.s(["updateAgentAndModel",()=>o],22503)},51911,41413,e=>{"use strict";var t=e.i(20314),r=e.i(79054),o=e.i(91967),a=e.i(5978),n=e.i(22528),s=e.i(36589),i=e.i(23405),l=e.i(77624),d=e.i(87620),c="Switch",[u,p]=(0,n.createContextScope)(c),[f,h]=u(c),m=r.forwardRef((e,n)=>{let{__scopeSwitch:i,name:l,checked:u,defaultChecked:p,required:h,disabled:m,value:v="on",onCheckedChange:x,form:y,...k}=e,[w,j]=r.useState(null),C=(0,a.useComposedRefs)(n,e=>j(e)),P=r.useRef(!1),R=!w||y||!!w.closest("form"),[N,A]=(0,s.useControllableState)({prop:u,defaultProp:p??!1,onChange:x,caller:c});return(0,t.jsxs)(f,{scope:i,checked:N,disabled:m,children:[(0,t.jsx)(d.Primitive.button,{type:"button",role:"switch","aria-checked":N,"aria-required":h,"data-state":b(N),"data-disabled":m?"":void 0,disabled:m,value:v,...k,ref:C,onClick:(0,o.composeEventHandlers)(e.onClick,e=>{A(e=>!e),R&&(P.current=e.isPropagationStopped(),P.current||e.stopPropagation())})}),R&&(0,t.jsx)(g,{control:w,bubbles:!P.current,name:l,value:v,checked:N,required:h,disabled:m,form:y,style:{transform:"translateX(-100%)"}})]})});m.displayName=c;var v="SwitchThumb",x=r.forwardRef((e,r)=>{let{__scopeSwitch:o,...a}=e,n=h(v,o);return(0,t.jsx)(d.Primitive.span,{"data-state":b(n.checked),"data-disabled":n.disabled?"":void 0,...a,ref:r})});x.displayName=v;var g=r.forwardRef(({__scopeSwitch:e,control:o,checked:n,bubbles:s=!0,...d},c)=>{let u=r.useRef(null),p=(0,a.useComposedRefs)(u,c),f=(0,i.usePrevious)(n),h=(0,l.useSize)(o);return r.useEffect(()=>{let e=u.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(f!==n&&t){let r=new Event("click",{bubbles:s});t.call(e,n),e.dispatchEvent(r)}},[f,n,s]),(0,t.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...d,tabIndex:-1,ref:p,style:{...d.style,...h,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function b(e){return e?"checked":"unchecked"}g.displayName="SwitchBubbleInput",e.s(["Root",()=>m,"Switch",()=>m,"SwitchThumb",()=>x,"Thumb",()=>x,"createSwitchScope",()=>p],95291);var y=e.i(95291),y=y,k=e.i(31777);function w({className:e,size:r="default",...o}){return(0,t.jsx)(y.Root,{"data-slot":"switch","data-size":r,className:(0,k.cn)("peer group/switch focus-visible:border-ring focus-visible:ring-ring/50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80 inline-flex shrink-0 cursor-pointer items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6",e),...o,children:(0,t.jsx)(y.Thumb,{"data-slot":"switch-thumb",className:(0,k.cn)("bg-background dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}e.s(["Switch",()=>w],51911);var j=e.i(23925),C=e.i(11345),P=e.i(76016),R=e.i(66967),N=e.i(22503),A=e.i(86782),S=e.i(29847),T=e.i(35364),M=e.i(90382);function E({initialAgentType:e,initialModel:o,onAgentModelChange:a,disabled:n,className:s,mode:i}){let[l,d]=r.useState(!1),[c,u]=r.useState([]),[p,f]=r.useState(!0),[h,m]=r.useState(e),[v,x]=r.useState(o),[g,b]=r.useState(null),[y,w]=r.useState(0),[E,F]=r.useState(null);r.useEffect(()=>{(0,R.getAllAgentModels)().then(u).finally(()=>f(!1))},[]),r.useEffect(()=>{if(!l){let e=setTimeout(()=>{w(0),F(null)},150);return()=>clearTimeout(e)}},[l]);let O=async(e,t)=>{if(d(!1),e!==h||t!==v){if("override"===i){m(e),x(t),a?.(e,t);return}m(e),x(t),a?.(e,t),b(null);try{let r=await (0,N.updateAgentAndModel)(e,t||null);r.ok||(m(h),x(v),a?.(h,v),b(r.error??"Failed to save"))}catch{m(h),x(v),a?.(h,v),b("Failed to save")}}},z=(0,A.getAgentTypeIcon)(h),D=c.find(e=>e.agentType===h)?.label??h,I=v?(0,S.getModelMeta)(v).displayName||v:null,q=E?c.find(e=>e.agentType===E):null;return(0,t.jsxs)("div",{className:(0,k.cn)("flex flex-col gap-1",s),children:[(0,t.jsxs)(M.Popover,{open:l,onOpenChange:d,children:[(0,t.jsx)(M.PopoverTrigger,{asChild:!0,children:(0,t.jsx)(T.Button,{variant:"outline",role:"combobox","aria-expanded":l,disabled:(n??!1)||p,className:"w-auto cursor-pointer justify-start font-normal hover:border-violet-300 hover:bg-violet-50/50 dark:hover:border-violet-700 dark:hover:bg-violet-950/30",children:(0,t.jsxs)("span",{className:"flex items-center gap-2 truncate",children:[(0,t.jsx)(z,{className:"h-4 w-4 shrink-0"}),p?"Loading…":(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:D}),I?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-muted-foreground/50 text-xs",children:"·"}),(0,t.jsx)("span",{className:"text-xs font-medium",children:I})]}):null]})]})})}),(0,t.jsx)(M.PopoverContent,{className:"w-(--radix-popover-trigger-width) overflow-hidden p-0",align:"start",children:(0,t.jsxs)("div",{className:"flex transition-transform duration-200 ease-in-out",style:{transform:`translateX(${1===y?"-50%":"0%"})`,width:"200%"},children:[(0,t.jsxs)("div",{className:"w-1/2 shrink-0",children:[(0,t.jsx)("div",{className:"text-muted-foreground border-b px-3 py-2 text-xs font-medium",children:"Select agent"}),c.map(e=>{let r=(0,A.getAgentTypeIcon)(e.agentType),o=h===e.agentType,a=e.models.length>0;return(0,t.jsxs)("button",{type:"button",className:(0,k.cn)("flex w-full cursor-pointer items-center gap-2.5 px-3 py-2 text-xs transition-colors","hover:bg-accent hover:text-accent-foreground",o&&"bg-accent/50"),onClick:()=>{a?(F(e.agentType),requestAnimationFrame(()=>{requestAnimationFrame(()=>w(1))})):O(e.agentType,"")},children:[(0,t.jsx)(r,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"flex-1 text-left",children:e.label}),o&&!a?(0,t.jsx)(j.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null,a?(0,t.jsx)(P.ChevronRight,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}):null]},e.agentType)})]}),(0,t.jsx)("div",{className:"w-1/2 shrink-0",children:q?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",className:"text-muted-foreground hover:text-foreground flex w-full cursor-pointer items-center gap-1.5 border-b px-3 py-2 text-xs font-medium transition-colors",onClick:()=>{w(0),setTimeout(()=>F(null),220)},children:[(0,t.jsx)(C.ChevronLeft,{className:"h-3.5 w-3.5"}),q.label]}),q.models.map(e=>{let r=h===q.agentType&&v===e.id;return(0,t.jsxs)("button",{type:"button",className:(0,k.cn)("flex w-full cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors","hover:bg-accent hover:text-accent-foreground",r&&"bg-accent/50"),onClick:()=>O(q.agentType,e.id),children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:e.displayName}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:e.description})]}),r?(0,t.jsx)(j.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null]},e.id)})]}):null})]})})]}),!!g&&(0,t.jsx)("p",{className:"text-destructive text-sm",children:g})]})}e.s(["AgentModelPicker",()=>E],41413)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,58860,44229,e=>{"use strict";let t=(0,e.i(3645).default)("timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);e.s(["Timer",()=>t],58860);var r=e.i(93752);e.s(["Code",()=>r.default],44229)},10714,99105,e=>{"use strict";var t=e.i(3645);let r=(0,t.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);e.s(["default",()=>r],10714);let o=(0,t.default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",()=>o],99105)},38573,e=>{"use strict";let t=(0,e.i(3645).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",()=>t],38573)},30702,e=>{"use strict";let t=(0,e.i(3645).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",()=>t],30702)},23925,1012,e=>{"use strict";let t=(0,e.i(3645).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",()=>t],1012),e.s(["Check",()=>t],23925)},23405,e=>{"use strict";var t=e.i(79054);function r(e){let r=t.useRef({value:e,previous:e});return t.useMemo(()=>(r.current.value!==e&&(r.current.previous=r.current.value,r.current.value=e),r.current.previous),[e])}e.s(["usePrevious",()=>r])},11345,e=>{"use strict";let t=(0,e.i(3645).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",()=>t],11345)},76016,e=>{"use strict";let t=(0,e.i(3645).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",()=>t],76016)},93752,e=>{"use strict";let t=(0,e.i(3645).default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);e.s(["default",()=>t])},83902,e=>{"use strict";let t=(0,e.i(3645).default)("rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);e.s(["Rocket",()=>t],83902)},90382,e=>{"use strict";var t=e.i(20314),r=e.i(79054),o=e.i(91967),a=e.i(5978),n=e.i(22528),s=e.i(53532),i=e.i(41687),l=e.i(56720),c=e.i(13123),d=e.i(52740),u=e.i(39979),p=e.i(85995),f=e.i(87620),h=e.i(86874),m=e.i(36589),v=e.i(73772),x=e.i(13044),g="Popover",[b,y]=(0,n.createContextScope)(g,[d.createPopperScope]),k=(0,d.createPopperScope)(),[w,j]=b(g),C=e=>{let{__scopePopover:o,children:a,open:n,defaultOpen:s,onOpenChange:i,modal:l=!1}=e,u=k(o),p=r.useRef(null),[f,h]=r.useState(!1),[v,x]=(0,m.useControllableState)({prop:n,defaultProp:s??!1,onChange:i,caller:g});return(0,t.jsx)(d.Root,{...u,children:(0,t.jsx)(w,{scope:o,contentId:(0,c.useId)(),triggerRef:p,open:v,onOpenChange:x,onOpenToggle:r.useCallback(()=>x(e=>!e),[x]),hasCustomAnchor:f,onCustomAnchorAdd:r.useCallback(()=>h(!0),[]),onCustomAnchorRemove:r.useCallback(()=>h(!1),[]),modal:l,children:a})})};C.displayName=g;var P="PopoverAnchor",R=r.forwardRef((e,o)=>{let{__scopePopover:a,...n}=e,s=j(P,a),i=k(a),{onCustomAnchorAdd:l,onCustomAnchorRemove:c}=s;return r.useEffect(()=>(l(),()=>c()),[l,c]),(0,t.jsx)(d.Anchor,{...i,...n,ref:o})});R.displayName=P;var N="PopoverTrigger",A=r.forwardRef((e,r)=>{let{__scopePopover:n,...s}=e,i=j(N,n),l=k(n),c=(0,a.useComposedRefs)(r,i.triggerRef),u=(0,t.jsx)(f.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":U(i.open),...s,ref:c,onClick:(0,o.composeEventHandlers)(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?u:(0,t.jsx)(d.Anchor,{asChild:!0,...l,children:u})});A.displayName=N;var S="PopoverPortal",[T,M]=b(S,{forceMount:void 0}),E=e=>{let{__scopePopover:r,forceMount:o,children:a,container:n}=e,s=j(S,r);return(0,t.jsx)(T,{scope:r,forceMount:o,children:(0,t.jsx)(p.Presence,{present:o||s.open,children:(0,t.jsx)(u.Portal,{asChild:!0,container:n,children:a})})})};E.displayName=S;var F="PopoverContent",O=r.forwardRef((e,r)=>{let o=M(F,e.__scopePopover),{forceMount:a=o.forceMount,...n}=e,s=j(F,e.__scopePopover);return(0,t.jsx)(p.Presence,{present:a||s.open,children:s.modal?(0,t.jsx)(D,{...n,ref:r}):(0,t.jsx)(I,{...n,ref:r})})});O.displayName=F;var z=(0,h.createSlot)("PopoverContent.RemoveScroll"),D=r.forwardRef((e,n)=>{let s=j(F,e.__scopePopover),i=r.useRef(null),l=(0,a.useComposedRefs)(n,i),c=r.useRef(!1);return r.useEffect(()=>{let e=i.current;if(e)return(0,v.hideOthers)(e)},[]),(0,t.jsx)(x.RemoveScroll,{as:z,allowPinchZoom:!0,children:(0,t.jsx)(q,{...e,ref:l,trapFocus:s.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,o.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),c.current||s.triggerRef.current?.focus()}),onPointerDownOutside:(0,o.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;c.current=2===t.button||r},{checkForDefaultPrevented:!1}),onFocusOutside:(0,o.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),I=r.forwardRef((e,o)=>{let a=j(F,e.__scopePopover),n=r.useRef(!1),s=r.useRef(!1);return(0,t.jsx)(q,{...e,ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(n.current||a.triggerRef.current?.focus(),t.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(n.current=!0,"pointerdown"===t.detail.originalEvent.type&&(s.current=!0));let r=t.target;a.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&s.current&&t.preventDefault()}})}),q=r.forwardRef((e,r)=>{let{__scopePopover:o,trapFocus:a,onOpenAutoFocus:n,onCloseAutoFocus:c,disableOutsidePointerEvents:u,onEscapeKeyDown:p,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,...v}=e,x=j(F,o),g=k(o);return(0,i.useFocusGuards)(),(0,t.jsx)(l.FocusScope,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:n,onUnmountAutoFocus:c,children:(0,t.jsx)(s.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:u,onInteractOutside:m,onEscapeKeyDown:p,onPointerDownOutside:f,onFocusOutside:h,onDismiss:()=>x.onOpenChange(!1),children:(0,t.jsx)(d.Content,{"data-state":U(x.open),role:"dialog",id:x.contentId,...g,...v,ref:r,style:{...v.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),H="PopoverClose",L=r.forwardRef((e,r)=>{let{__scopePopover:a,...n}=e,s=j(H,a);return(0,t.jsx)(f.Primitive.button,{type:"button",...n,ref:r,onClick:(0,o.composeEventHandlers)(e.onClick,()=>s.onOpenChange(!1))})});L.displayName=H;var _=r.forwardRef((e,r)=>{let{__scopePopover:o,...a}=e,n=k(o);return(0,t.jsx)(d.Arrow,{...n,...a,ref:r})});function U(e){return e?"open":"closed"}_.displayName="PopoverArrow",e.s(["Anchor",()=>R,"Arrow",()=>_,"Close",()=>L,"Content",()=>O,"Popover",()=>C,"PopoverAnchor",()=>R,"PopoverArrow",()=>_,"PopoverClose",()=>L,"PopoverContent",()=>O,"PopoverPortal",()=>E,"PopoverTrigger",()=>A,"Portal",()=>E,"Root",()=>C,"Trigger",()=>A,"createPopoverScope",()=>y],89920);var B=e.i(89920),B=B,K=e.i(31777);let X=B.Root,G=B.Trigger;B.Anchor;let V=r.forwardRef(({className:e,align:r="center",sideOffset:o=4,...a},n)=>(0,t.jsx)(B.Portal,{children:(0,t.jsx)(B.Content,{ref:n,align:r,sideOffset:o,className:(0,K.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border p-4 shadow-md outline-none",e),...a})}));V.displayName=B.Content.displayName,e.s(["Popover",()=>X,"PopoverContent",()=>V,"PopoverTrigger",()=>G],90382)},65124,38555,e=>{"use strict";var t=e.i(21023);let r=(0,t.createServerReference)("000d595c46be84e00422908accc7fd8c44c9a7db8a",t.callServer,void 0,t.findSourceMapURL,"getAllAgentModels");e.s(["getAllAgentModels",()=>r],65124);let o=(0,t.createServerReference)("60fbb4d32249d0f954a00c657c1426486ad51ae09d",t.callServer,void 0,t.findSourceMapURL,"updateAgentAndModel");e.s(["updateAgentAndModel",()=>o],38555)},51911,41413,e=>{"use strict";var t=e.i(20314),r=e.i(79054),o=e.i(91967),a=e.i(5978),n=e.i(22528),s=e.i(36589),i=e.i(23405),l=e.i(77624),c=e.i(87620),d="Switch",[u,p]=(0,n.createContextScope)(d),[f,h]=u(d),m=r.forwardRef((e,n)=>{let{__scopeSwitch:i,name:l,checked:u,defaultChecked:p,required:h,disabled:m,value:v="on",onCheckedChange:x,form:y,...k}=e,[w,j]=r.useState(null),C=(0,a.useComposedRefs)(n,e=>j(e)),P=r.useRef(!1),R=!w||y||!!w.closest("form"),[N,A]=(0,s.useControllableState)({prop:u,defaultProp:p??!1,onChange:x,caller:d});return(0,t.jsxs)(f,{scope:i,checked:N,disabled:m,children:[(0,t.jsx)(c.Primitive.button,{type:"button",role:"switch","aria-checked":N,"aria-required":h,"data-state":b(N),"data-disabled":m?"":void 0,disabled:m,value:v,...k,ref:C,onClick:(0,o.composeEventHandlers)(e.onClick,e=>{A(e=>!e),R&&(P.current=e.isPropagationStopped(),P.current||e.stopPropagation())})}),R&&(0,t.jsx)(g,{control:w,bubbles:!P.current,name:l,value:v,checked:N,required:h,disabled:m,form:y,style:{transform:"translateX(-100%)"}})]})});m.displayName=d;var v="SwitchThumb",x=r.forwardRef((e,r)=>{let{__scopeSwitch:o,...a}=e,n=h(v,o);return(0,t.jsx)(c.Primitive.span,{"data-state":b(n.checked),"data-disabled":n.disabled?"":void 0,...a,ref:r})});x.displayName=v;var g=r.forwardRef(({__scopeSwitch:e,control:o,checked:n,bubbles:s=!0,...c},d)=>{let u=r.useRef(null),p=(0,a.useComposedRefs)(u,d),f=(0,i.usePrevious)(n),h=(0,l.useSize)(o);return r.useEffect(()=>{let e=u.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(f!==n&&t){let r=new Event("click",{bubbles:s});t.call(e,n),e.dispatchEvent(r)}},[f,n,s]),(0,t.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...c,tabIndex:-1,ref:p,style:{...c.style,...h,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function b(e){return e?"checked":"unchecked"}g.displayName="SwitchBubbleInput",e.s(["Root",()=>m,"Switch",()=>m,"SwitchThumb",()=>x,"Thumb",()=>x,"createSwitchScope",()=>p],95291);var y=e.i(95291),y=y,k=e.i(31777);function w({className:e,size:r="default",...o}){return(0,t.jsx)(y.Root,{"data-slot":"switch","data-size":r,className:(0,k.cn)("peer group/switch focus-visible:border-ring focus-visible:ring-ring/50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80 inline-flex shrink-0 cursor-pointer items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6",e),...o,children:(0,t.jsx)(y.Thumb,{"data-slot":"switch-thumb",className:(0,k.cn)("bg-background dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}e.s(["Switch",()=>w],51911);var j=e.i(23925),C=e.i(11345),P=e.i(76016),R=e.i(65124),N=e.i(38555),A=e.i(86782),S=e.i(29847),T=e.i(35364),M=e.i(90382);function E({initialAgentType:e,initialModel:o,onAgentModelChange:a,disabled:n,className:s,mode:i}){let[l,c]=r.useState(!1),[d,u]=r.useState([]),[p,f]=r.useState(!0),[h,m]=r.useState(e),[v,x]=r.useState(o),[g,b]=r.useState(null),[y,w]=r.useState(0),[E,F]=r.useState(null);r.useEffect(()=>{(0,R.getAllAgentModels)().then(u).finally(()=>f(!1))},[]),r.useEffect(()=>{if(!l){let e=setTimeout(()=>{w(0),F(null)},150);return()=>clearTimeout(e)}},[l]);let O=async(e,t)=>{if(c(!1),e!==h||t!==v){if("override"===i){m(e),x(t),a?.(e,t);return}m(e),x(t),a?.(e,t),b(null);try{let r=await (0,N.updateAgentAndModel)(e,t||null);r.ok||(m(h),x(v),a?.(h,v),b(r.error??"Failed to save"))}catch{m(h),x(v),a?.(h,v),b("Failed to save")}}},z=(0,A.getAgentTypeIcon)(h),D=d.find(e=>e.agentType===h)?.label??h,I=v?(0,S.getModelMeta)(v).displayName||v:null,q=E?d.find(e=>e.agentType===E):null;return(0,t.jsxs)("div",{className:(0,k.cn)("flex flex-col gap-1",s),children:[(0,t.jsxs)(M.Popover,{open:l,onOpenChange:c,children:[(0,t.jsx)(M.PopoverTrigger,{asChild:!0,children:(0,t.jsx)(T.Button,{variant:"outline",role:"combobox","aria-expanded":l,disabled:(n??!1)||p,className:"w-auto cursor-pointer justify-start font-normal hover:border-violet-300 hover:bg-violet-50/50 dark:hover:border-violet-700 dark:hover:bg-violet-950/30",children:(0,t.jsxs)("span",{className:"flex items-center gap-2 truncate",children:[(0,t.jsx)(z,{className:"h-4 w-4 shrink-0"}),p?"Loading…":(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:D}),I?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-muted-foreground/50 text-xs",children:"·"}),(0,t.jsx)("span",{className:"text-xs font-medium",children:I})]}):null]})]})})}),(0,t.jsx)(M.PopoverContent,{className:"w-(--radix-popover-trigger-width) overflow-hidden p-0",align:"start",children:(0,t.jsxs)("div",{className:"flex transition-transform duration-200 ease-in-out",style:{transform:`translateX(${1===y?"-50%":"0%"})`,width:"200%"},children:[(0,t.jsxs)("div",{className:"w-1/2 shrink-0",children:[(0,t.jsx)("div",{className:"text-muted-foreground border-b px-3 py-2 text-xs font-medium",children:"Select agent"}),d.map(e=>{let r=(0,A.getAgentTypeIcon)(e.agentType),o=h===e.agentType,a=e.models.length>0;return(0,t.jsxs)("button",{type:"button",className:(0,k.cn)("flex w-full cursor-pointer items-center gap-2.5 px-3 py-2 text-xs transition-colors","hover:bg-accent hover:text-accent-foreground",o&&"bg-accent/50"),onClick:()=>{a?(F(e.agentType),requestAnimationFrame(()=>{requestAnimationFrame(()=>w(1))})):O(e.agentType,"")},children:[(0,t.jsx)(r,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"flex-1 text-left",children:e.label}),o&&!a?(0,t.jsx)(j.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null,a?(0,t.jsx)(P.ChevronRight,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}):null]},e.agentType)})]}),(0,t.jsx)("div",{className:"w-1/2 shrink-0",children:q?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",className:"text-muted-foreground hover:text-foreground flex w-full cursor-pointer items-center gap-1.5 border-b px-3 py-2 text-xs font-medium transition-colors",onClick:()=>{w(0),setTimeout(()=>F(null),220)},children:[(0,t.jsx)(C.ChevronLeft,{className:"h-3.5 w-3.5"}),q.label]}),q.models.map(e=>{let r=h===q.agentType&&v===e.id;return(0,t.jsxs)("button",{type:"button",className:(0,k.cn)("flex w-full cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors","hover:bg-accent hover:text-accent-foreground",r&&"bg-accent/50"),onClick:()=>O(q.agentType,e.id),children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:e.displayName}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:e.description})]}),r?(0,t.jsx)(j.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null]},e.id)})]}):null})]})})]}),!!g&&(0,t.jsx)("p",{className:"text-destructive text-sm",children:g})]})}e.s(["AgentModelPicker",()=>E],41413)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,90382,e=>{"use strict";var t=e.i(20314),r=e.i(79054),o=e.i(91967),a=e.i(5978),s=e.i(22528),n=e.i(53532),l=e.i(41687),i=e.i(56720),c=e.i(13123),d=e.i(52740),p=e.i(39979),u=e.i(85995),h=e.i(87620),f=e.i(86874),m=e.i(36589),x=e.i(73772),v=e.i(13044),b="Popover",[g,j]=(0,s.createContextScope)(b,[d.createPopperScope]),C=(0,d.createPopperScope)(),[w,y]=g(b),N=e=>{let{__scopePopover:o,children:a,open:s,defaultOpen:n,onOpenChange:l,modal:i=!1}=e,p=C(o),u=r.useRef(null),[h,f]=r.useState(!1),[x,v]=(0,m.useControllableState)({prop:s,defaultProp:n??!1,onChange:l,caller:b});return(0,t.jsx)(d.Root,{...p,children:(0,t.jsx)(w,{scope:o,contentId:(0,c.useId)(),triggerRef:u,open:x,onOpenChange:v,onOpenToggle:r.useCallback(()=>v(e=>!e),[v]),hasCustomAnchor:h,onCustomAnchorAdd:r.useCallback(()=>f(!0),[]),onCustomAnchorRemove:r.useCallback(()=>f(!1),[]),modal:i,children:a})})};N.displayName=b;var P="PopoverAnchor",R=r.forwardRef((e,o)=>{let{__scopePopover:a,...s}=e,n=y(P,a),l=C(a),{onCustomAnchorAdd:i,onCustomAnchorRemove:c}=n;return r.useEffect(()=>(i(),()=>c()),[i,c]),(0,t.jsx)(d.Anchor,{...l,...s,ref:o})});R.displayName=P;var S="PopoverTrigger",k=r.forwardRef((e,r)=>{let{__scopePopover:s,...n}=e,l=y(S,s),i=C(s),c=(0,a.useComposedRefs)(r,l.triggerRef),p=(0,t.jsx)(h.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":z(l.open),...n,ref:c,onClick:(0,o.composeEventHandlers)(e.onClick,l.onOpenToggle)});return l.hasCustomAnchor?p:(0,t.jsx)(d.Anchor,{asChild:!0,...i,children:p})});k.displayName=S;var A="PopoverPortal",[E,D]=g(A,{forceMount:void 0}),O=e=>{let{__scopePopover:r,forceMount:o,children:a,container:s}=e,n=y(A,r);return(0,t.jsx)(E,{scope:r,forceMount:o,children:(0,t.jsx)(u.Presence,{present:o||n.open,children:(0,t.jsx)(p.Portal,{asChild:!0,container:s,children:a})})})};O.displayName=A;var F="PopoverContent",L=r.forwardRef((e,r)=>{let o=D(F,e.__scopePopover),{forceMount:a=o.forceMount,...s}=e,n=y(F,e.__scopePopover);return(0,t.jsx)(u.Presence,{present:a||n.open,children:n.modal?(0,t.jsx)(B,{...s,ref:r}):(0,t.jsx)(I,{...s,ref:r})})});L.displayName=F;var T=(0,f.createSlot)("PopoverContent.RemoveScroll"),B=r.forwardRef((e,s)=>{let n=y(F,e.__scopePopover),l=r.useRef(null),i=(0,a.useComposedRefs)(s,l),c=r.useRef(!1);return r.useEffect(()=>{let e=l.current;if(e)return(0,x.hideOthers)(e)},[]),(0,t.jsx)(v.RemoveScroll,{as:T,allowPinchZoom:!0,children:(0,t.jsx)(U,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,o.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),c.current||n.triggerRef.current?.focus()}),onPointerDownOutside:(0,o.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;c.current=2===t.button||r},{checkForDefaultPrevented:!1}),onFocusOutside:(0,o.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),I=r.forwardRef((e,o)=>{let a=y(F,e.__scopePopover),s=r.useRef(!1),n=r.useRef(!1);return(0,t.jsx)(U,{...e,ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(s.current||a.triggerRef.current?.focus(),t.preventDefault()),s.current=!1,n.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(s.current=!0,"pointerdown"===t.detail.originalEvent.type&&(n.current=!0));let r=t.target;a.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&n.current&&t.preventDefault()}})}),U=r.forwardRef((e,r)=>{let{__scopePopover:o,trapFocus:a,onOpenAutoFocus:s,onCloseAutoFocus:c,disableOutsidePointerEvents:p,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:f,onInteractOutside:m,...x}=e,v=y(F,o),b=C(o);return(0,l.useFocusGuards)(),(0,t.jsx)(i.FocusScope,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:s,onUnmountAutoFocus:c,children:(0,t.jsx)(n.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:p,onInteractOutside:m,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:f,onDismiss:()=>v.onOpenChange(!1),children:(0,t.jsx)(d.Content,{"data-state":z(v.open),role:"dialog",id:v.contentId,...b,...x,ref:r,style:{...x.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),_="PopoverClose",H=r.forwardRef((e,r)=>{let{__scopePopover:a,...s}=e,n=y(_,a);return(0,t.jsx)(h.Primitive.button,{type:"button",...s,ref:r,onClick:(0,o.composeEventHandlers)(e.onClick,()=>n.onOpenChange(!1))})});H.displayName=_;var M=r.forwardRef((e,r)=>{let{__scopePopover:o,...a}=e,s=C(o);return(0,t.jsx)(d.Arrow,{...s,...a,ref:r})});function z(e){return e?"open":"closed"}M.displayName="PopoverArrow",e.s(["Anchor",()=>R,"Arrow",()=>M,"Close",()=>H,"Content",()=>L,"Popover",()=>N,"PopoverAnchor",()=>R,"PopoverArrow",()=>M,"PopoverClose",()=>H,"PopoverContent",()=>L,"PopoverPortal",()=>O,"PopoverTrigger",()=>k,"Portal",()=>O,"Root",()=>N,"Trigger",()=>k,"createPopoverScope",()=>j],89920);var G=e.i(89920),G=G,K=e.i(31777);let $=G.Root,W=G.Trigger;G.Anchor;let Z=r.forwardRef(({className:e,align:r="center",sideOffset:o=4,...a},s)=>(0,t.jsx)(G.Portal,{children:(0,t.jsx)(G.Content,{ref:s,align:r,sideOffset:o,className:(0,K.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border p-4 shadow-md outline-none",e),...a})}));Z.displayName=G.Content.displayName,e.s(["Popover",()=>$,"PopoverContent",()=>Z,"PopoverTrigger",()=>W],90382)},83843,e=>{"use strict";let t=(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",()=>t],83843)},36479,e=>{"use strict";var t=e.i(20314),r=e.i(79054),o=e.i(31406),a=e.i(60112),s=e.i(21023);let n=(0,s.createServerReference)("40b2d387e66ca0dbae9167bddcd7c3d2141812b28b",s.callServer,void 0,s.findSourceMapURL,"adoptBranch"),l=(0,s.createServerReference)("40d28fcf5c96bc4055fbfe0d8c6dfa9489411b2d97",s.callServer,void 0,s.findSourceMapURL,"listBranches");var i=e.i(23925),c=e.i(97667),d=e.i(83843),p=e.i(49228),u=e.i(83428);e.i(1650);var h=e.i(11495),f=e.i(45811),m=e.i(35364),x=e.i(98127),v=e.i(41957),b=e.i(66459),g=e.i(31777);let j=r.forwardRef(({className:e,...r},o)=>(0,t.jsx)("div",{ref:o,className:(0,g.cn)("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...r}));j.displayName="Command";let C=r.forwardRef(({className:e,...r},o)=>(0,t.jsxs)("div",{className:"flex items-center border-b px-3",children:[(0,t.jsx)(b.Search,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),(0,t.jsx)("input",{ref:o,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),...r})]}));C.displayName="CommandInput";let w=r.forwardRef(({className:e,...r},o)=>(0,t.jsx)("div",{ref:o,className:(0,g.cn)("max-h-[300px] overflow-x-hidden overflow-y-auto",e),...r}));w.displayName="CommandList";let y=r.forwardRef(({className:e,...r},o)=>(0,t.jsx)("div",{ref:o,className:(0,g.cn)("text-muted-foreground py-6 text-center text-sm",e),...r}));y.displayName="CommandEmpty";let N=r.forwardRef(({className:e,...r},o)=>(0,t.jsx)("div",{ref:o,className:(0,g.cn)("text-foreground overflow-hidden p-1",e),...r}));N.displayName="CommandGroup";let P=r.forwardRef(({className:e,selected:r,...o},a)=>(0,t.jsx)("button",{ref:a,type:"button","data-selected":r,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),...o}));P.displayName="CommandItem",r.forwardRef(({className:e,...r},o)=>(0,t.jsx)("div",{ref:o,className:(0,g.cn)("bg-border -mx-1 h-px",e),...r})).displayName="CommandSeparator";var R=e.i(90382);function S({open:e,onClose:o,onSubmit:a,isSubmitting:s=!1,error:n,repositories:l=[],selectedRepositoryPath:b,onRepositoryChange:S,branches:k=[],branchesLoading:A=!1}){let[E,D]=(0,r.useState)(""),[O,F]=(0,r.useState)(!1),[L,T]=(0,r.useState)(""),B=(0,r.useRef)(null),[I,U]=(0,r.useState)(!1),[_,H]=(0,r.useState)(""),M=(0,r.useRef)(null),z=l.find(e=>e.path===b),G=!!b;(0,r.useEffect)(()=>{e||(D(""),T(""),F(!1),U(!1),H(""))},[e]),(0,r.useEffect)(()=>{D(""),T("")},[b]);let K=(0,r.useCallback)(e=>{e.preventDefault();let t=E.trim();t&&b&&!s&&a(t,b)},[E,b,s,a]),$=(0,r.useCallback)(()=>{D(""),T(""),o()},[o]),W=(0,r.useCallback)(e=>{D(e),T(e),F(!1)},[]),Z=(0,r.useCallback)(e=>{T(e.target.value),O||F(!0)},[O]),q=(0,r.useCallback)(e=>{if("Enter"===e.key){e.preventDefault();let t=L.trim();t&&(D(t),F(!1))}"Escape"===e.key&&(F(!1),T(E))},[L,E]),J=(0,r.useCallback)(e=>{S?.(e),U(!1),H("")},[S]),Q=k.filter(e=>e.toLowerCase().includes(L.toLowerCase())),V=_.trim()?l.filter(e=>e.name.toLowerCase().includes(_.toLowerCase())||e.path.toLowerCase().includes(_.toLowerCase())):l;(0,r.useEffect)(()=>{I?setTimeout(()=>M.current?.focus(),0):H("")},[I]);let X=!E.trim()||!b||s,Y=(0,t.jsxs)("div",{children:[(0,t.jsxs)(f.DrawerTitle,{className:"flex items-center gap-2",children:[(0,t.jsx)(p.GitBranch,{className:"h-4 w-4"}),"Adopt Branch"]}),(0,t.jsx)(f.DrawerDescription,{className:"text-muted-foreground text-sm",children:"Import an existing git branch into Shep's feature tracking"})]});return(0,t.jsx)(h.BaseDrawer,{open:e,onClose:$,size:"sm",modal:!1,header:Y,"data-testid":"adopt-branch-drawer",children:(0,t.jsxs)("form",{onSubmit:K,className:"flex flex-1 flex-col",children:[(0,t.jsx)("div",{className:"flex-1 overflow-y-auto p-4",children:(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)(v.Label,{children:"Repository"}),(0,t.jsxs)(R.Popover,{open:I,onOpenChange:U,children:[(0,t.jsx)(R.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"button",role:"combobox","aria-expanded":I,"aria-label":"Repository",disabled:s,"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,t.jsx)("span",{className:"truncate",children:z?z.name:"Select repository..."}),(0,t.jsx)(d.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(R.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"adopt-repo-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)(x.Input,{ref:M,placeholder:"Search repositories...",value:_,onChange:e=>H(e.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"adopt-repo-search"})}),(0,t.jsx)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Repositories",children:0===V.length?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:"No repositories found."}):V.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":b===e.path,onClick:()=>J(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",b===e.path&&"bg-accent/50"),"data-testid":`adopt-repo-option-${e.id}`,children:[(0,t.jsx)(c.CheckIcon,{className:(0,g.cn)("h-4 w-4 shrink-0",b!==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)("p",{className:"text-muted-foreground text-xs",children:"Select the repository that contains the branch you want to adopt."})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)(v.Label,{htmlFor:"branch-name",children:"Branch name"}),(0,t.jsxs)(R.Popover,{open:O,onOpenChange:F,children:[(0,t.jsx)(R.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)(m.Button,{variant:"outline",role:"combobox","aria-expanded":O,disabled:s||!G,className:"w-full justify-between font-normal","data-testid":"adopt-branch-input",children:[(0,t.jsx)("span",{className:"truncate",children:G?A?"Loading branches...":E||"Select a branch...":"Select a repository first..."}),(0,t.jsx)(d.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(R.PopoverContent,{className:"w-[var(--radix-popover-trigger-width)] p-0",align:"start",children:(0,t.jsxs)(j,{children:[(0,t.jsx)(C,{ref:B,placeholder:"Search branches...",value:L,onChange:Z,onKeyDown:q,"data-testid":"adopt-branch-search"}),(0,t.jsxs)(w,{children:[!A&&0===Q.length&&(0,t.jsx)(y,{children:0===k.length?"No branches found.":L?"No match — press Enter to use this value.":"No branches available."}),A?(0,t.jsx)(y,{children:(0,t.jsx)(u.Loader2,{className:"mx-auto h-4 w-4 animate-spin"})}):null,Q.length>0&&(0,t.jsx)(N,{children:Q.map(e=>(0,t.jsxs)(P,{selected:e===E,onClick:()=>W(e),children:[(0,t.jsx)(i.Check,{className:(0,g.cn)("mr-2 h-4 w-4",e===E?"opacity-100":"opacity-0")}),(0,t.jsx)(p.GitBranch,{className:"mr-2 h-3 w-3 opacity-50"}),e]},e))})]})]})})]}),(0,t.jsx)("p",{className:"text-muted-foreground text-xs",children:G?"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,t.jsx)("p",{className:"text-destructive text-sm","data-testid":"adopt-branch-error",children:n}):null]})}),(0,t.jsx)("div",{className:"border-t p-4",children:(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(m.Button,{type:"button",variant:"outline",onClick:$,disabled:s,className:"flex-1",children:"Cancel"}),(0,t.jsx)(m.Button,{type:"submit",disabled:X,className:"flex-1","data-testid":"adopt-branch-submit",children:s?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),"Adopting..."]}):"Adopt Branch"})]})})]})})}function k({repositoryPath:e,repositories:s}){let i=(0,o.useRouter)(),c=(0,o.usePathname)(),[d,p]=(0,r.useState)(!1),[u,h]=(0,r.useState)(),[f,m]=(0,r.useState)([]),[x,v]=(0,r.useState)(!1),[b,g]=(0,r.useState)(e),j=c.startsWith("/adopt"),C=!d&&j;(0,r.useEffect)(()=>{!j&&d&&p(!1)},[j,d]),(0,r.useEffect)(()=>{j&&(h(void 0),g(e))},[j,e]),(0,r.useEffect)(()=>{j&&b?(v(!0),m([]),l(b).then(m).catch(()=>m([])).finally(()=>v(!1))):m([])},[j,b]);let w=(0,r.useCallback)(()=>{i.push("/")},[i]),y=(0,r.useCallback)(e=>{g(e)},[]),N=(0,r.useCallback)((e,t)=>{h(void 0),p(!0),i.push("/"),n({branchName:e,repositoryPath:t}).then(e=>{e.error?a.toast.error(e.error):(window.dispatchEvent(new CustomEvent("shep:feature-created",{detail:{featureId:e.feature.id,name:e.feature.name,description:e.feature.description,repositoryPath:e.feature.repositoryPath}})),a.toast.success(`Branch adopted as "${e.feature.name}"`))}).catch(()=>{a.toast.error("Failed to adopt branch"),p(!1)})},[i]);return(0,t.jsx)(S,{open:C,onClose:w,onSubmit:N,isSubmitting:d,error:u,repositories:s,selectedRepositoryPath:b,onRepositoryChange:y,branches:f,branchesLoading:x})}e.s(["AdoptDrawerClient",()=>k],36479)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,90382,e=>{"use strict";var t=e.i(20314),r=e.i(79054),o=e.i(91967),a=e.i(5978),s=e.i(22528),n=e.i(53532),l=e.i(41687),i=e.i(56720),c=e.i(13123),d=e.i(52740),p=e.i(39979),u=e.i(85995),h=e.i(87620),f=e.i(86874),m=e.i(36589),x=e.i(73772),v=e.i(13044),b="Popover",[g,j]=(0,s.createContextScope)(b,[d.createPopperScope]),C=(0,d.createPopperScope)(),[w,y]=g(b),N=e=>{let{__scopePopover:o,children:a,open:s,defaultOpen:n,onOpenChange:l,modal:i=!1}=e,p=C(o),u=r.useRef(null),[h,f]=r.useState(!1),[x,v]=(0,m.useControllableState)({prop:s,defaultProp:n??!1,onChange:l,caller:b});return(0,t.jsx)(d.Root,{...p,children:(0,t.jsx)(w,{scope:o,contentId:(0,c.useId)(),triggerRef:u,open:x,onOpenChange:v,onOpenToggle:r.useCallback(()=>v(e=>!e),[v]),hasCustomAnchor:h,onCustomAnchorAdd:r.useCallback(()=>f(!0),[]),onCustomAnchorRemove:r.useCallback(()=>f(!1),[]),modal:i,children:a})})};N.displayName=b;var P="PopoverAnchor",R=r.forwardRef((e,o)=>{let{__scopePopover:a,...s}=e,n=y(P,a),l=C(a),{onCustomAnchorAdd:i,onCustomAnchorRemove:c}=n;return r.useEffect(()=>(i(),()=>c()),[i,c]),(0,t.jsx)(d.Anchor,{...l,...s,ref:o})});R.displayName=P;var S="PopoverTrigger",k=r.forwardRef((e,r)=>{let{__scopePopover:s,...n}=e,l=y(S,s),i=C(s),c=(0,a.useComposedRefs)(r,l.triggerRef),p=(0,t.jsx)(h.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":z(l.open),...n,ref:c,onClick:(0,o.composeEventHandlers)(e.onClick,l.onOpenToggle)});return l.hasCustomAnchor?p:(0,t.jsx)(d.Anchor,{asChild:!0,...i,children:p})});k.displayName=S;var A="PopoverPortal",[E,D]=g(A,{forceMount:void 0}),O=e=>{let{__scopePopover:r,forceMount:o,children:a,container:s}=e,n=y(A,r);return(0,t.jsx)(E,{scope:r,forceMount:o,children:(0,t.jsx)(u.Presence,{present:o||n.open,children:(0,t.jsx)(p.Portal,{asChild:!0,container:s,children:a})})})};O.displayName=A;var F="PopoverContent",L=r.forwardRef((e,r)=>{let o=D(F,e.__scopePopover),{forceMount:a=o.forceMount,...s}=e,n=y(F,e.__scopePopover);return(0,t.jsx)(u.Presence,{present:a||n.open,children:n.modal?(0,t.jsx)(B,{...s,ref:r}):(0,t.jsx)(I,{...s,ref:r})})});L.displayName=F;var T=(0,f.createSlot)("PopoverContent.RemoveScroll"),B=r.forwardRef((e,s)=>{let n=y(F,e.__scopePopover),l=r.useRef(null),i=(0,a.useComposedRefs)(s,l),c=r.useRef(!1);return r.useEffect(()=>{let e=l.current;if(e)return(0,x.hideOthers)(e)},[]),(0,t.jsx)(v.RemoveScroll,{as:T,allowPinchZoom:!0,children:(0,t.jsx)(U,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,o.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),c.current||n.triggerRef.current?.focus()}),onPointerDownOutside:(0,o.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;c.current=2===t.button||r},{checkForDefaultPrevented:!1}),onFocusOutside:(0,o.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),I=r.forwardRef((e,o)=>{let a=y(F,e.__scopePopover),s=r.useRef(!1),n=r.useRef(!1);return(0,t.jsx)(U,{...e,ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(s.current||a.triggerRef.current?.focus(),t.preventDefault()),s.current=!1,n.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(s.current=!0,"pointerdown"===t.detail.originalEvent.type&&(n.current=!0));let r=t.target;a.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&n.current&&t.preventDefault()}})}),U=r.forwardRef((e,r)=>{let{__scopePopover:o,trapFocus:a,onOpenAutoFocus:s,onCloseAutoFocus:c,disableOutsidePointerEvents:p,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:f,onInteractOutside:m,...x}=e,v=y(F,o),b=C(o);return(0,l.useFocusGuards)(),(0,t.jsx)(i.FocusScope,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:s,onUnmountAutoFocus:c,children:(0,t.jsx)(n.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:p,onInteractOutside:m,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:f,onDismiss:()=>v.onOpenChange(!1),children:(0,t.jsx)(d.Content,{"data-state":z(v.open),role:"dialog",id:v.contentId,...b,...x,ref:r,style:{...x.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),_="PopoverClose",H=r.forwardRef((e,r)=>{let{__scopePopover:a,...s}=e,n=y(_,a);return(0,t.jsx)(h.Primitive.button,{type:"button",...s,ref:r,onClick:(0,o.composeEventHandlers)(e.onClick,()=>n.onOpenChange(!1))})});H.displayName=_;var M=r.forwardRef((e,r)=>{let{__scopePopover:o,...a}=e,s=C(o);return(0,t.jsx)(d.Arrow,{...s,...a,ref:r})});function z(e){return e?"open":"closed"}M.displayName="PopoverArrow",e.s(["Anchor",()=>R,"Arrow",()=>M,"Close",()=>H,"Content",()=>L,"Popover",()=>N,"PopoverAnchor",()=>R,"PopoverArrow",()=>M,"PopoverClose",()=>H,"PopoverContent",()=>L,"PopoverPortal",()=>O,"PopoverTrigger",()=>k,"Portal",()=>O,"Root",()=>N,"Trigger",()=>k,"createPopoverScope",()=>j],89920);var G=e.i(89920),G=G,K=e.i(31777);let $=G.Root,W=G.Trigger;G.Anchor;let Z=r.forwardRef(({className:e,align:r="center",sideOffset:o=4,...a},s)=>(0,t.jsx)(G.Portal,{children:(0,t.jsx)(G.Content,{ref:s,align:r,sideOffset:o,className:(0,K.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border p-4 shadow-md outline-none",e),...a})}));Z.displayName=G.Content.displayName,e.s(["Popover",()=>$,"PopoverContent",()=>Z,"PopoverTrigger",()=>W],90382)},83843,e=>{"use strict";let t=(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",()=>t],83843)},36479,e=>{"use strict";var t=e.i(20314),r=e.i(79054),o=e.i(31406),a=e.i(60112),s=e.i(21023);let n=(0,s.createServerReference)("402ac29c25669d6402b8273176dd025653657f0e09",s.callServer,void 0,s.findSourceMapURL,"adoptBranch"),l=(0,s.createServerReference)("40ee6c574559ec271eef5d93f361273e12dfc49c42",s.callServer,void 0,s.findSourceMapURL,"listBranches");var i=e.i(23925),c=e.i(97667),d=e.i(83843),p=e.i(49228),u=e.i(83428);e.i(1650);var h=e.i(11495),f=e.i(45811),m=e.i(35364),x=e.i(98127),v=e.i(41957),b=e.i(66459),g=e.i(31777);let j=r.forwardRef(({className:e,...r},o)=>(0,t.jsx)("div",{ref:o,className:(0,g.cn)("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...r}));j.displayName="Command";let C=r.forwardRef(({className:e,...r},o)=>(0,t.jsxs)("div",{className:"flex items-center border-b px-3",children:[(0,t.jsx)(b.Search,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),(0,t.jsx)("input",{ref:o,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),...r})]}));C.displayName="CommandInput";let w=r.forwardRef(({className:e,...r},o)=>(0,t.jsx)("div",{ref:o,className:(0,g.cn)("max-h-[300px] overflow-x-hidden overflow-y-auto",e),...r}));w.displayName="CommandList";let y=r.forwardRef(({className:e,...r},o)=>(0,t.jsx)("div",{ref:o,className:(0,g.cn)("text-muted-foreground py-6 text-center text-sm",e),...r}));y.displayName="CommandEmpty";let N=r.forwardRef(({className:e,...r},o)=>(0,t.jsx)("div",{ref:o,className:(0,g.cn)("text-foreground overflow-hidden p-1",e),...r}));N.displayName="CommandGroup";let P=r.forwardRef(({className:e,selected:r,...o},a)=>(0,t.jsx)("button",{ref:a,type:"button","data-selected":r,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),...o}));P.displayName="CommandItem",r.forwardRef(({className:e,...r},o)=>(0,t.jsx)("div",{ref:o,className:(0,g.cn)("bg-border -mx-1 h-px",e),...r})).displayName="CommandSeparator";var R=e.i(90382);function S({open:e,onClose:o,onSubmit:a,isSubmitting:s=!1,error:n,repositories:l=[],selectedRepositoryPath:b,onRepositoryChange:S,branches:k=[],branchesLoading:A=!1}){let[E,D]=(0,r.useState)(""),[O,F]=(0,r.useState)(!1),[L,T]=(0,r.useState)(""),B=(0,r.useRef)(null),[I,U]=(0,r.useState)(!1),[_,H]=(0,r.useState)(""),M=(0,r.useRef)(null),z=l.find(e=>e.path===b),G=!!b;(0,r.useEffect)(()=>{e||(D(""),T(""),F(!1),U(!1),H(""))},[e]),(0,r.useEffect)(()=>{D(""),T("")},[b]);let K=(0,r.useCallback)(e=>{e.preventDefault();let t=E.trim();t&&b&&!s&&a(t,b)},[E,b,s,a]),$=(0,r.useCallback)(()=>{D(""),T(""),o()},[o]),W=(0,r.useCallback)(e=>{D(e),T(e),F(!1)},[]),Z=(0,r.useCallback)(e=>{T(e.target.value),O||F(!0)},[O]),q=(0,r.useCallback)(e=>{if("Enter"===e.key){e.preventDefault();let t=L.trim();t&&(D(t),F(!1))}"Escape"===e.key&&(F(!1),T(E))},[L,E]),J=(0,r.useCallback)(e=>{S?.(e),U(!1),H("")},[S]),Q=k.filter(e=>e.toLowerCase().includes(L.toLowerCase())),V=_.trim()?l.filter(e=>e.name.toLowerCase().includes(_.toLowerCase())||e.path.toLowerCase().includes(_.toLowerCase())):l;(0,r.useEffect)(()=>{I?setTimeout(()=>M.current?.focus(),0):H("")},[I]);let X=!E.trim()||!b||s,Y=(0,t.jsxs)("div",{children:[(0,t.jsxs)(f.DrawerTitle,{className:"flex items-center gap-2",children:[(0,t.jsx)(p.GitBranch,{className:"h-4 w-4"}),"Adopt Branch"]}),(0,t.jsx)(f.DrawerDescription,{className:"text-muted-foreground text-sm",children:"Import an existing git branch into Shep's feature tracking"})]});return(0,t.jsx)(h.BaseDrawer,{open:e,onClose:$,size:"sm",modal:!1,header:Y,"data-testid":"adopt-branch-drawer",children:(0,t.jsxs)("form",{onSubmit:K,className:"flex flex-1 flex-col",children:[(0,t.jsx)("div",{className:"flex-1 overflow-y-auto p-4",children:(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)(v.Label,{children:"Repository"}),(0,t.jsxs)(R.Popover,{open:I,onOpenChange:U,children:[(0,t.jsx)(R.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"button",role:"combobox","aria-expanded":I,"aria-label":"Repository",disabled:s,"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,t.jsx)("span",{className:"truncate",children:z?z.name:"Select repository..."}),(0,t.jsx)(d.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(R.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"adopt-repo-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)(x.Input,{ref:M,placeholder:"Search repositories...",value:_,onChange:e=>H(e.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"adopt-repo-search"})}),(0,t.jsx)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Repositories",children:0===V.length?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:"No repositories found."}):V.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":b===e.path,onClick:()=>J(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",b===e.path&&"bg-accent/50"),"data-testid":`adopt-repo-option-${e.id}`,children:[(0,t.jsx)(c.CheckIcon,{className:(0,g.cn)("h-4 w-4 shrink-0",b!==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)("p",{className:"text-muted-foreground text-xs",children:"Select the repository that contains the branch you want to adopt."})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)(v.Label,{htmlFor:"branch-name",children:"Branch name"}),(0,t.jsxs)(R.Popover,{open:O,onOpenChange:F,children:[(0,t.jsx)(R.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)(m.Button,{variant:"outline",role:"combobox","aria-expanded":O,disabled:s||!G,className:"w-full justify-between font-normal","data-testid":"adopt-branch-input",children:[(0,t.jsx)("span",{className:"truncate",children:G?A?"Loading branches...":E||"Select a branch...":"Select a repository first..."}),(0,t.jsx)(d.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(R.PopoverContent,{className:"w-[var(--radix-popover-trigger-width)] p-0",align:"start",children:(0,t.jsxs)(j,{children:[(0,t.jsx)(C,{ref:B,placeholder:"Search branches...",value:L,onChange:Z,onKeyDown:q,"data-testid":"adopt-branch-search"}),(0,t.jsxs)(w,{children:[!A&&0===Q.length&&(0,t.jsx)(y,{children:0===k.length?"No branches found.":L?"No match — press Enter to use this value.":"No branches available."}),A?(0,t.jsx)(y,{children:(0,t.jsx)(u.Loader2,{className:"mx-auto h-4 w-4 animate-spin"})}):null,Q.length>0&&(0,t.jsx)(N,{children:Q.map(e=>(0,t.jsxs)(P,{selected:e===E,onClick:()=>W(e),children:[(0,t.jsx)(i.Check,{className:(0,g.cn)("mr-2 h-4 w-4",e===E?"opacity-100":"opacity-0")}),(0,t.jsx)(p.GitBranch,{className:"mr-2 h-3 w-3 opacity-50"}),e]},e))})]})]})})]}),(0,t.jsx)("p",{className:"text-muted-foreground text-xs",children:G?"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,t.jsx)("p",{className:"text-destructive text-sm","data-testid":"adopt-branch-error",children:n}):null]})}),(0,t.jsx)("div",{className:"border-t p-4",children:(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(m.Button,{type:"button",variant:"outline",onClick:$,disabled:s,className:"flex-1",children:"Cancel"}),(0,t.jsx)(m.Button,{type:"submit",disabled:X,className:"flex-1","data-testid":"adopt-branch-submit",children:s?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),"Adopting..."]}):"Adopt Branch"})]})})]})})}function k({repositoryPath:e,repositories:s}){let i=(0,o.useRouter)(),c=(0,o.usePathname)(),[d,p]=(0,r.useState)(!1),[u,h]=(0,r.useState)(),[f,m]=(0,r.useState)([]),[x,v]=(0,r.useState)(!1),[b,g]=(0,r.useState)(e),j=c.startsWith("/adopt"),C=!d&&j;(0,r.useEffect)(()=>{!j&&d&&p(!1)},[j,d]),(0,r.useEffect)(()=>{j&&(h(void 0),g(e))},[j,e]),(0,r.useEffect)(()=>{j&&b?(v(!0),m([]),l(b).then(m).catch(()=>m([])).finally(()=>v(!1))):m([])},[j,b]);let w=(0,r.useCallback)(()=>{i.push("/")},[i]),y=(0,r.useCallback)(e=>{g(e)},[]),N=(0,r.useCallback)((e,t)=>{h(void 0),p(!0),i.push("/"),n({branchName:e,repositoryPath:t}).then(e=>{e.error?a.toast.error(e.error):(window.dispatchEvent(new CustomEvent("shep:feature-created",{detail:{featureId:e.feature.id,name:e.feature.name,description:e.feature.description,repositoryPath:e.feature.repositoryPath}})),a.toast.success(`Branch adopted as "${e.feature.name}"`))}).catch(()=>{a.toast.error("Failed to adopt branch"),p(!1)})},[i]);return(0,t.jsx)(S,{open:C,onClose:w,onSubmit:N,isSubmitting:d,error:u,repositories:s,selectedRepositoryPath:b,onRepositoryChange:y,branches:f,branchesLoading:x})}e.s(["AdoptDrawerClient",()=>k],36479)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,93752,e=>{"use strict";let t=(0,e.i(3645).default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);e.s(["default",()=>t])},95230,e=>{"use strict";let t=(0,e.i(3645).default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);e.s(["default",()=>t])},16868,e=>{"use strict";let t=(0,e.i(3645).default)("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);e.s(["PaperclipIcon",()=>t],16868)},16298,e=>{"use strict";let t=(0,e.i(3645).default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);e.s(["default",()=>t])},70471,e=>{"use strict";var t=e.i(16298);e.s(["FileText",()=>t.default])},48306,64764,80436,17087,28267,57484,e=>{"use strict";var t=e.i(20314),r=e.i(31777);function a({className:e,...a}){return(0,t.jsx)("textarea",{"data-slot":"textarea",className:(0,r.cn)("placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input field-sizing-content min-h-[80px] w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...a})}e.s(["Textarea",()=>a],48306);var s=e.i(15506);e.s(["Loader2Icon",()=>s.default],64764);var o=e.i(95230);e.s(["DownloadIcon",()=>o.default],80436);var i=e.i(3645);let n=(0,i.default)("sticky-note",[["path",{d:"M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z",key:"1dfntj"}],["path",{d:"M15 3v5a1 1 0 0 0 1 1h5",key:"6s6qgf"}]]);e.s(["StickyNoteIcon",()=>n],17087);var l=e.i(1693);e.s(["VisuallyHidden",0,l],28267);let d=(0,i.default)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);e.s(["FileIcon",()=>d],57484)},50032,86254,58194,e=>{"use strict";var t=e.i(20314),r=e.i(60253),a=e.i(64764),s=e.i(80436),o=e.i(17087),i=e.i(31777),n=e.i(2287),l=e.i(48306),d=e.i(2828),c=e.i(28267),p=e.i(57484),u=e.i(16298),u=u;let h=(0,e.i(3645).default)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);var m=e.i(93752),m=m;e.i(35364);let x=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]),f=new Set([".ts",".tsx",".js",".jsx",".json",".yaml",".yml",".xml",".html",".css",".md"]);function g(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,t)).toFixed(+(0!==t))} ${["B","KB","MB","GB"][t]}`}let b=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]);function v(e,t){let r=new URLSearchParams({path:e,mimeType:t});return`/api/attachments/preview?${r.toString()}`}function j({name:e,size:j,mimeType:w,path:y,onRemove:C,loading:k=!1,disabled:N=!1,notes:T,onNotesChange:P}){let S,R,F=(S=e.lastIndexOf("."))>=0?e.slice(S).toLowerCase():"",A=x.has(F)?h:".pdf"===F?u.default:f.has(F)?m.default:p.FileIcon,E=".pdf"===F?"bg-red-50 text-red-600":x.has(F)?"bg-blue-50 text-blue-600":f.has(F)?"bg-emerald-50 text-emerald-600":"bg-gray-50 text-gray-600",D=(R=e.lastIndexOf("."))>=0&&b.has(e.slice(R).toLowerCase());if(k)return(0,t.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-md border",children:(0,t.jsx)(a.Loader2Icon,{className:"text-muted-foreground h-5 w-5 animate-spin"})});if(D){let a=(0,t.jsxs)("button",{type:"button",className:"relative block cursor-pointer rounded-md",children:[(0,t.jsx)("img",{src:v(y,w),alt:e,title:e,className:"h-12 w-12 rounded-md border object-cover transition-opacity hover:opacity-80"}),T?(0,t.jsx)("span",{className:"ring-background absolute -right-1 -bottom-1 flex h-4 w-4 items-center justify-center rounded-full bg-amber-500 text-white shadow-sm ring-2",children:(0,t.jsx)(o.StickyNoteIcon,{className:"h-2.5 w-2.5"})}):null]});return(0,t.jsx)(d.TooltipProvider,{delayDuration:200,children:(0,t.jsxs)(n.Dialog,{children:[(0,t.jsxs)(d.Tooltip,{children:[(0,t.jsxs)("div",{className:"group relative",children:[(0,t.jsx)(d.TooltipTrigger,{asChild:!0,children:(0,t.jsx)(n.DialogTrigger,{asChild:!0,children:a})}),!N&&(0,t.jsx)("button",{type:"button",onClick:C,className:"absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex","aria-label":`Remove ${e}`,children:(0,t.jsx)(r.X,{className:"h-3 w-3"})})]}),T?(0,t.jsx)(d.TooltipContent,{side:"bottom",className:"max-w-[220px] border border-amber-200 bg-amber-50 text-amber-950 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-100",children:(0,t.jsx)("p",{className:"line-clamp-3 text-xs leading-snug",children:T})}):null]}),(0,t.jsxs)(n.DialogContent,{className:"max-w-3xl gap-0 overflow-hidden border-0 p-0 [&>button:last-child]:!cursor-pointer [&>button:last-child]:!rounded-full [&>button:last-child]:!bg-black/70 [&>button:last-child]:!p-1.5 [&>button:last-child]:!text-white [&>button:last-child]:!opacity-100 [&>button:last-child]:!shadow-lg [&>button:last-child]:!backdrop-blur-md [&>button:last-child]:hover:!bg-black/90",children:[(0,t.jsx)(c.VisuallyHidden.Root,{children:(0,t.jsxs)(n.DialogTitle,{children:["Preview: ",e]})}),(0,t.jsx)("div",{className:"relative bg-black/90",children:(0,t.jsx)("img",{src:v(y,w),alt:e,className:"h-auto max-h-[70vh] w-full object-contain"})}),(0,t.jsxs)("div",{className:"bg-background flex flex-col gap-2 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:e}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:g(j)})]}),(0,t.jsx)("a",{href:v(y,w),download:e,className:"text-muted-foreground hover:text-foreground shrink-0 cursor-pointer rounded p-1.5 transition-colors","aria-label":`Download ${e}`,children:(0,t.jsx)(s.DownloadIcon,{className:"h-4 w-4"})})]}),P?(0,t.jsx)(l.Textarea,{placeholder:"Add notes about this image…",value:T??"",onChange:e=>P(e.target.value),rows:2,className:"resize-none text-sm","aria-label":"Image notes"}):T?(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:T}):null]})]})]})})}return(0,t.jsxs)("div",{className:"group relative flex items-center gap-2 rounded-full border py-1 pr-3 pl-2",children:[(0,t.jsx)("div",{className:(0,i.cn)("flex h-6 w-6 shrink-0 items-center justify-center rounded-full",E),children:(0,t.jsx)(A,{className:"h-3 w-3"})}),(0,t.jsx)("span",{className:"max-w-[120px] truncate text-sm",children:e}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:g(j)}),!N&&(0,t.jsx)("button",{type:"button",onClick:C,className:"absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex","aria-label":`Remove ${e}`,children:(0,t.jsx)(r.X,{className:"h-3 w-3"})})]})}async function w(){let e=await fetch("/api/dialog/pick-files",{method:"POST"});if(!e.ok)throw Error("Failed to open file dialog");let t=await e.json();return t.cancelled?null:t.files}e.s(["AttachmentChip",()=>j],86254),e.s([],50032),e.s(["pickFiles",()=>w],58194)},90382,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(91967),s=e.i(5978),o=e.i(22528),i=e.i(53532),n=e.i(41687),l=e.i(56720),d=e.i(13123),c=e.i(52740),p=e.i(39979),u=e.i(85995),h=e.i(87620),m=e.i(86874),x=e.i(36589),f=e.i(73772),g=e.i(13044),b="Popover",[v,j]=(0,o.createContextScope)(b,[c.createPopperScope]),w=(0,c.createPopperScope)(),[y,C]=v(b),k=e=>{let{__scopePopover:a,children:s,open:o,defaultOpen:i,onOpenChange:n,modal:l=!1}=e,p=w(a),u=r.useRef(null),[h,m]=r.useState(!1),[f,g]=(0,x.useControllableState)({prop:o,defaultProp:i??!1,onChange:n,caller:b});return(0,t.jsx)(c.Root,{...p,children:(0,t.jsx)(y,{scope:a,contentId:(0,d.useId)(),triggerRef:u,open:f,onOpenChange:g,onOpenToggle:r.useCallback(()=>g(e=>!e),[g]),hasCustomAnchor:h,onCustomAnchorAdd:r.useCallback(()=>m(!0),[]),onCustomAnchorRemove:r.useCallback(()=>m(!1),[]),modal:l,children:s})})};k.displayName=b;var N="PopoverAnchor",T=r.forwardRef((e,a)=>{let{__scopePopover:s,...o}=e,i=C(N,s),n=w(s),{onCustomAnchorAdd:l,onCustomAnchorRemove:d}=i;return r.useEffect(()=>(l(),()=>d()),[l,d]),(0,t.jsx)(c.Anchor,{...n,...o,ref:a})});T.displayName=N;var P="PopoverTrigger",S=r.forwardRef((e,r)=>{let{__scopePopover:o,...i}=e,n=C(P,o),l=w(o),d=(0,s.useComposedRefs)(r,n.triggerRef),p=(0,t.jsx)(h.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":$(n.open),...i,ref:d,onClick:(0,a.composeEventHandlers)(e.onClick,n.onOpenToggle)});return n.hasCustomAnchor?p:(0,t.jsx)(c.Anchor,{asChild:!0,...l,children:p})});S.displayName=P;var R="PopoverPortal",[F,A]=v(R,{forceMount:void 0}),E=e=>{let{__scopePopover:r,forceMount:a,children:s,container:o}=e,i=C(R,r);return(0,t.jsx)(F,{scope:r,forceMount:a,children:(0,t.jsx)(u.Presence,{present:a||i.open,children:(0,t.jsx)(p.Portal,{asChild:!0,container:o,children:s})})})};E.displayName=R;var D="PopoverContent",I=r.forwardRef((e,r)=>{let a=A(D,e.__scopePopover),{forceMount:s=a.forceMount,...o}=e,i=C(D,e.__scopePopover);return(0,t.jsx)(u.Presence,{present:s||i.open,children:i.modal?(0,t.jsx)(z,{...o,ref:r}):(0,t.jsx)(O,{...o,ref:r})})});I.displayName=D;var M=(0,m.createSlot)("PopoverContent.RemoveScroll"),z=r.forwardRef((e,o)=>{let i=C(D,e.__scopePopover),n=r.useRef(null),l=(0,s.useComposedRefs)(o,n),d=r.useRef(!1);return r.useEffect(()=>{let e=n.current;if(e)return(0,f.hideOthers)(e)},[]),(0,t.jsx)(g.RemoveScroll,{as:M,allowPinchZoom:!0,children:(0,t.jsx)(L,{...e,ref:l,trapFocus:i.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,a.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),d.current||i.triggerRef.current?.focus()}),onPointerDownOutside:(0,a.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;d.current=2===t.button||r},{checkForDefaultPrevented:!1}),onFocusOutside:(0,a.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),O=r.forwardRef((e,a)=>{let s=C(D,e.__scopePopover),o=r.useRef(!1),i=r.useRef(!1);return(0,t.jsx)(L,{...e,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(o.current||s.triggerRef.current?.focus(),t.preventDefault()),o.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));let r=t.target;s.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})}),L=r.forwardRef((e,r)=>{let{__scopePopover:a,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:d,disableOutsidePointerEvents:p,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:m,onInteractOutside:x,...f}=e,g=C(D,a),b=w(a);return(0,n.useFocusGuards)(),(0,t.jsx)(l.FocusScope,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:o,onUnmountAutoFocus:d,children:(0,t.jsx)(i.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:p,onInteractOutside:x,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:m,onDismiss:()=>g.onOpenChange(!1),children:(0,t.jsx)(c.Content,{"data-state":$(g.open),role:"dialog",id:g.contentId,...b,...f,ref:r,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),U="PopoverClose",B=r.forwardRef((e,r)=>{let{__scopePopover:s,...o}=e,i=C(U,s);return(0,t.jsx)(h.Primitive.button,{type:"button",...o,ref:r,onClick:(0,a.composeEventHandlers)(e.onClick,()=>i.onOpenChange(!1))})});B.displayName=U;var H=r.forwardRef((e,r)=>{let{__scopePopover:a,...s}=e,o=w(a);return(0,t.jsx)(c.Arrow,{...o,...s,ref:r})});function $(e){return e?"open":"closed"}H.displayName="PopoverArrow",e.s(["Anchor",()=>T,"Arrow",()=>H,"Close",()=>B,"Content",()=>I,"Popover",()=>k,"PopoverAnchor",()=>T,"PopoverArrow",()=>H,"PopoverClose",()=>B,"PopoverContent",()=>I,"PopoverPortal",()=>E,"PopoverTrigger",()=>S,"Portal",()=>E,"Root",()=>k,"Trigger",()=>S,"createPopoverScope",()=>j],89920);var q=e.i(89920),q=q,V=e.i(31777);let G=q.Root,_=q.Trigger;q.Anchor;let K=r.forwardRef(({className:e,align:r="center",sideOffset:a=4,...s},o)=>(0,t.jsx)(q.Portal,{children:(0,t.jsx)(q.Content,{ref:o,align:r,sideOffset:a,className:(0,V.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border p-4 shadow-md outline-none",e),...s})}));K.displayName=q.Content.displayName,e.s(["Popover",()=>G,"PopoverContent",()=>K,"PopoverTrigger",()=>_],90382)},83843,e=>{"use strict";let t=(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",()=>t],83843)},51911,41413,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(91967),s=e.i(5978),o=e.i(22528),i=e.i(36589),n=e.i(23405),l=e.i(77624),d=e.i(87620),c="Switch",[p,u]=(0,o.createContextScope)(c),[h,m]=p(c),x=r.forwardRef((e,o)=>{let{__scopeSwitch:n,name:l,checked:p,defaultChecked:u,required:m,disabled:x,value:f="on",onCheckedChange:g,form:j,...w}=e,[y,C]=r.useState(null),k=(0,s.useComposedRefs)(o,e=>C(e)),N=r.useRef(!1),T=!y||j||!!y.closest("form"),[P,S]=(0,i.useControllableState)({prop:p,defaultProp:u??!1,onChange:g,caller:c});return(0,t.jsxs)(h,{scope:n,checked:P,disabled:x,children:[(0,t.jsx)(d.Primitive.button,{type:"button",role:"switch","aria-checked":P,"aria-required":m,"data-state":v(P),"data-disabled":x?"":void 0,disabled:x,value:f,...w,ref:k,onClick:(0,a.composeEventHandlers)(e.onClick,e=>{S(e=>!e),T&&(N.current=e.isPropagationStopped(),N.current||e.stopPropagation())})}),T&&(0,t.jsx)(b,{control:y,bubbles:!N.current,name:l,value:f,checked:P,required:m,disabled:x,form:j,style:{transform:"translateX(-100%)"}})]})});x.displayName=c;var f="SwitchThumb",g=r.forwardRef((e,r)=>{let{__scopeSwitch:a,...s}=e,o=m(f,a);return(0,t.jsx)(d.Primitive.span,{"data-state":v(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:r})});g.displayName=f;var b=r.forwardRef(({__scopeSwitch:e,control:a,checked:o,bubbles:i=!0,...d},c)=>{let p=r.useRef(null),u=(0,s.useComposedRefs)(p,c),h=(0,n.usePrevious)(o),m=(0,l.useSize)(a);return r.useEffect(()=>{let e=p.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(h!==o&&t){let r=new Event("click",{bubbles:i});t.call(e,o),e.dispatchEvent(r)}},[h,o,i]),(0,t.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o,...d,tabIndex:-1,ref:u,style:{...d.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function v(e){return e?"checked":"unchecked"}b.displayName="SwitchBubbleInput",e.s(["Root",()=>x,"Switch",()=>x,"SwitchThumb",()=>g,"Thumb",()=>g,"createSwitchScope",()=>u],95291);var j=e.i(95291),j=j,w=e.i(31777);function y({className:e,size:r="default",...a}){return(0,t.jsx)(j.Root,{"data-slot":"switch","data-size":r,className:(0,w.cn)("peer group/switch focus-visible:border-ring focus-visible:ring-ring/50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80 inline-flex shrink-0 cursor-pointer items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6",e),...a,children:(0,t.jsx)(j.Thumb,{"data-slot":"switch-thumb",className:(0,w.cn)("bg-background dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}e.s(["Switch",()=>y],51911);var C=e.i(23925),k=e.i(11345),N=e.i(76016),T=e.i(65124),P=e.i(38555),S=e.i(86782),R=e.i(29847),F=e.i(35364),A=e.i(90382);function E({initialAgentType:e,initialModel:a,onAgentModelChange:s,disabled:o,className:i,mode:n}){let[l,d]=r.useState(!1),[c,p]=r.useState([]),[u,h]=r.useState(!0),[m,x]=r.useState(e),[f,g]=r.useState(a),[b,v]=r.useState(null),[j,y]=r.useState(0),[E,D]=r.useState(null);r.useEffect(()=>{(0,T.getAllAgentModels)().then(p).finally(()=>h(!1))},[]),r.useEffect(()=>{if(!l){let e=setTimeout(()=>{y(0),D(null)},150);return()=>clearTimeout(e)}},[l]);let I=async(e,t)=>{if(d(!1),e!==m||t!==f){if("override"===n){x(e),g(t),s?.(e,t);return}x(e),g(t),s?.(e,t),v(null);try{let r=await (0,P.updateAgentAndModel)(e,t||null);r.ok||(x(m),g(f),s?.(m,f),v(r.error??"Failed to save"))}catch{x(m),g(f),s?.(m,f),v("Failed to save")}}},M=(0,S.getAgentTypeIcon)(m),z=c.find(e=>e.agentType===m)?.label??m,O=f?(0,R.getModelMeta)(f).displayName||f:null,L=E?c.find(e=>e.agentType===E):null;return(0,t.jsxs)("div",{className:(0,w.cn)("flex flex-col gap-1",i),children:[(0,t.jsxs)(A.Popover,{open:l,onOpenChange:d,children:[(0,t.jsx)(A.PopoverTrigger,{asChild:!0,children:(0,t.jsx)(F.Button,{variant:"outline",role:"combobox","aria-expanded":l,disabled:(o??!1)||u,className:"w-auto cursor-pointer justify-start font-normal hover:border-violet-300 hover:bg-violet-50/50 dark:hover:border-violet-700 dark:hover:bg-violet-950/30",children:(0,t.jsxs)("span",{className:"flex items-center gap-2 truncate",children:[(0,t.jsx)(M,{className:"h-4 w-4 shrink-0"}),u?"Loading…":(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:z}),O?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-muted-foreground/50 text-xs",children:"·"}),(0,t.jsx)("span",{className:"text-xs font-medium",children:O})]}):null]})]})})}),(0,t.jsx)(A.PopoverContent,{className:"w-(--radix-popover-trigger-width) overflow-hidden p-0",align:"start",children:(0,t.jsxs)("div",{className:"flex transition-transform duration-200 ease-in-out",style:{transform:`translateX(${1===j?"-50%":"0%"})`,width:"200%"},children:[(0,t.jsxs)("div",{className:"w-1/2 shrink-0",children:[(0,t.jsx)("div",{className:"text-muted-foreground border-b px-3 py-2 text-xs font-medium",children:"Select agent"}),c.map(e=>{let r=(0,S.getAgentTypeIcon)(e.agentType),a=m===e.agentType,s=e.models.length>0;return(0,t.jsxs)("button",{type:"button",className:(0,w.cn)("flex w-full cursor-pointer items-center gap-2.5 px-3 py-2 text-xs transition-colors","hover:bg-accent hover:text-accent-foreground",a&&"bg-accent/50"),onClick:()=>{s?(D(e.agentType),requestAnimationFrame(()=>{requestAnimationFrame(()=>y(1))})):I(e.agentType,"")},children:[(0,t.jsx)(r,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"flex-1 text-left",children:e.label}),a&&!s?(0,t.jsx)(C.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null,s?(0,t.jsx)(N.ChevronRight,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}):null]},e.agentType)})]}),(0,t.jsx)("div",{className:"w-1/2 shrink-0",children:L?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",className:"text-muted-foreground hover:text-foreground flex w-full cursor-pointer items-center gap-1.5 border-b px-3 py-2 text-xs font-medium transition-colors",onClick:()=>{y(0),setTimeout(()=>D(null),220)},children:[(0,t.jsx)(k.ChevronLeft,{className:"h-3.5 w-3.5"}),L.label]}),L.models.map(e=>{let r=m===L.agentType&&f===e.id;return(0,t.jsxs)("button",{type:"button",className:(0,w.cn)("flex w-full cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors","hover:bg-accent hover:text-accent-foreground",r&&"bg-accent/50"),onClick:()=>I(L.agentType,e.id),children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:e.displayName}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:e.description})]}),r?(0,t.jsx)(C.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null]},e.id)})]}):null})]})})]}),!!b&&(0,t.jsx)("p",{className:"text-destructive text-sm",children:b})]})}e.s(["AgentModelPicker",()=>E],41413)},15203,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(31406),s=e.i(60112),o=e.i(21023);let i=(0,o.createServerReference)("404e5407101f7bb20e38b232e9c44d8fc7c6d541fa",o.callServer,void 0,o.findSourceMapURL,"createFeature");var n=e.i(16868),l=e.i(83843),d=e.i(97667),c=e.i(53360),p=e.i(55016),u=e.i(91925),h=e.i(83428);let m=(0,e.i(3645).default)("git-fork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]);var x=e.i(70471),f=e.i(31777),g=e.i(8361);e.i(1650);var b=e.i(11495),v=e.i(45811),j=e.i(35364),w=e.i(98127),y=e.i(48306),C=e.i(41957),k=e.i(81846),N=e.i(90382),T=e.i(51911),P=e.i(2828),S=e.i(30153);e.i(50032);var R=e.i(86254);let F=(0,o.createServerReference)("40bc06b8c520f94d30ad8b6ee28e732aa8b8e446e6",o.callServer,void 0,o.findSourceMapURL,"getViewerPermission");var A=e.i(41413),E=e.i(25235),D=e.i(78521);e.i(13322);var I=e.i(61201),M=e.i(75921),z=e.i(4988),O=e.i(58194);let L=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"]),U=[{id:"allowPrd",label:"PRD",description:"Auto-approve requirements move to planning."},{id:"allowPlan",label:"Plan",description:"Auto-approve planning move to implementation."},{id:"allowMerge",label:"Merge",description:"Auto-approve merge move to Done."}],B={allowPrd:!1,allowPlan:!1,allowMerge:!1};function H({open:e,onClose:a,onSubmit:s,repositoryPath:o,isSubmitting:i=!1,workflowDefaults:l,features:d,repositories:u,initialParentId:h,currentAgentType:w,currentModel:N,initialDescription:E,canPushDirectly:D}){let I=(0,g.useSoundAction)("create"),M=o&&(!u||0===u.length||u.some(e=>e.path===o))?o:"",z=l?.approvalGates??B,H=l?.push??!1,V=l?.openPr??!1,G=l?.ciWatchEnabled!==!1,_=l?.enableEvidence??!1,K=l?.commitEvidence??!1,[W,X]=(0,r.useState)(E??"");(0,r.useEffect)(()=>{E&&X(E)},[E]);let[Y,Z]=(0,r.useState)([]),[J,Q]=(0,r.useState)({...z}),[ee,et]=(0,r.useState)(H),[er,ea]=(0,r.useState)(V),[es,eo]=(0,r.useState)(l?.ciWatchEnabled!==!1),[ei,en]=(0,r.useState)(_),[el,ed]=(0,r.useState)(K),[ec,ep]=(0,r.useState)(void 0),[eu,eh]=(0,r.useState)(!1),[em,ex]=(0,r.useState)(!1),[ef,eg]=(0,r.useState)(!1),[eb,ev]=(0,r.useState)(!0),[ej,ew]=(0,r.useState)(void 0),[ey,eC]=(0,r.useState)(void 0),[ek,eN]=(0,r.useState)(M||void 0),[eT,eP]=(0,r.useState)(u??[]),[eS,eR]=(0,r.useState)(!1),[eF,eA]=(0,r.useState)(null),[eE,eD]=(0,r.useState)(!1),eI=(0,r.useRef)(crypto.randomUUID()),eM=(0,r.useRef)(0),ez=(0,r.useRef)(null);(0,r.useEffect)(()=>{l&&(Q({...l.approvalGates}),et(l.push),ea(l.openPr),eo(!1!==l.ciWatchEnabled),en(l.enableEvidence),ed(l.commitEvidence))},[l]),(0,r.useEffect)(()=>{eP(u??[])},[u]),(0,r.useEffect)(()=>{e&&h&&ep(h)},[e,h]);let[eO,eL]=(0,r.useState)(D??!1);(0,r.useEffect)(()=>{eL(D??!1)},[D]);let eU=(0,r.useRef)(ek);(0,r.useEffect)(()=>{ek&&ek!==eU.current&&(eU.current=ek,F(ek).then(e=>eL(e.canPushDirectly)).catch(()=>eL(!1)))},[ek]),(0,r.useEffect)(()=>{eO&&(eg(!1),et(H),ea(V),ev(!0))},[eO,H,V]);let eB=(0,r.useCallback)(()=>{X(""),Z([]),Q({...z}),et(H),ea(V),eo(G),en(_),ed(K),ep(void 0),eN(M||void 0),eP(u??[]),eh(!1),ex(!1),eg(!1),ev(!0),ew(void 0),eC(void 0),eA(null),eM.current=0,eR(!1)},[z,H,V,_,G,K,M,u]),eH=""!==W.trim()||Y.length>0,{attemptClose:e$}=(0,S.useGuardedDrawerClose)({open:e,isDirty:eH,onClose:a,onReset:eB}),eq=(0,r.useCallback)(async e=>{for(let t of(eA(null),e)){if(t.size>0xa00000)return void eA(`"${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&&!L.has(e))return void eA(`File type "${e}" is not allowed`)}for(let t of e){let e=crypto.randomUUID();Z(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",eI.current);let a=await fetch("/api/attachments/upload",{method:"POST",body:r});if(!a.ok){let t=await a.json().catch(()=>({error:"Upload failed"}));Z(t=>t.filter(t=>t.id!==e)),eA(t.error??"Upload failed");return}let s=await a.json();Z(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{Z(t=>t.filter(t=>t.id!==e)),eA("Upload failed")}}},[]),eV=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eM.current+=1,1===eM.current&&eR(!0)},[]),eG=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eM.current-=1,0===eM.current&&eR(!1)},[]),e_=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),eK=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eM.current=0,eR(!1);let t=Array.from(e.dataTransfer.files);t.length>0&&eq(t)},[eq]),eW=(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(),eq(r))},[eq]),eX=(0,r.useCallback)(e=>{if(e.preventDefault(),!W.trim())return;let t=ek??M;t&&(I.play(),s({description:W.trim(),attachments:Y.filter(e=>!e.loading),repositoryPath:t,approvalGates:{allowPrd:J.allowPrd??!1,allowPlan:J.allowPlan??!1,allowMerge:J.allowMerge??!1},push:!!ef||ee||er,openPr:!!ef||er,ciWatchEnabled:es,enableEvidence:ei,commitEvidence:el,fast:eu,forkAndPr:ef,commitSpecs:eb,...em?{pending:em}:{},...ej?{agentType:ej}:{},...ey?{model:ey}:{},...ec?{parentId:ec}:{},sessionId:eI.current}),eB())},[W,Y,J,ek,M,s,ee,er,ei,es,el,eu,ef,eb,em,ej,ey,ec,I,eB]),eY=(0,r.useCallback)(async()=>{try{let e=await (0,O.pickFiles)();if(!e)return;for(let t of e){let e=crypto.randomUUID();Z(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:eI.current})});if(!r.ok){let t=await r.json().catch(()=>({error:"Upload failed"}));Z(t=>t.filter(t=>t.id!==e)),eA(t.error??"Upload failed");return}let a=await r.json();Z(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{Z(t=>t.filter(t=>t.id!==e)),eA("Upload failed")}}}catch{}},[]),eZ=(0,r.useCallback)(e=>{Z(t=>t.filter(t=>t.id!==e))},[]),eJ=(0,r.useCallback)((e,t)=>{Z(r=>r.map(r=>r.id===e?{...r,notes:t}:r))},[]),eQ=(0,r.useRef)(null),e0=(0,r.useCallback)(e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),eQ.current?.requestSubmit())},[]),e1=(0,r.useCallback)(()=>{eD(!0)},[]),e2=(0,r.useCallback)(()=>{setTimeout(()=>{let e=ez.current?.contains(document.activeElement),t=ez.current?.querySelector('[aria-expanded="true"]')!==null;e||t||eD(!1)},0)},[]),e5=d&&d.length>0,e3=!M&&!ek,e4=!M&&void 0!==u;return(0,t.jsx)(b.BaseDrawer,{open:e,onClose:e$,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)(v.DrawerTitle,{children:"NEW FEATURE"})]}),i?(0,t.jsx)(v.DrawerDescription,{asChild:!0,children:(0,t.jsx)("div",{children:(0,t.jsx)(k.Badge,{variant:"secondary",children:"Creating..."})})}):null]}),footer:(0,t.jsxs)("div",{className:"flex flex-row justify-end gap-2",children:[(0,t.jsx)(j.Button,{variant:"outline",onClick:e$,disabled:i,children:"Cancel"}),(0,t.jsx)(j.Button,{type:"submit",form:"create-feature-form",disabled:!W.trim()||i||e3,children:i?"Creating...":"+ Create Feature"})]}),children:(0,t.jsx)("div",{className:"overflow-y-auto p-4",children:(0,t.jsx)(P.TooltipProvider,{delayDuration:400,children:(0,t.jsxs)("form",{ref:eQ,id:"create-feature-form",onSubmit:eX,onKeyDown:e0,className:"flex flex-col gap-4",children:[e4?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-selector-section",children:[(0,t.jsx)(C.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"REPOSITORY"}),(0,t.jsx)(q,{repositories:eT,value:ek,onChange:eN,onAddRepository:e=>{eP(t=>[...t,e]),eN(e.path)},disabled:i})]}):M?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-readonly-section",children:[(0,t.jsx)(C.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"REPOSITORY"}),(0,t.jsx)("p",{className:"text-sm","data-testid":"repo-readonly-label",children:u?.find(e=>e.path===M)?.name??M.split("/").pop()})]}):null,(0,t.jsxs)("div",{role:"region","aria-label":"File drop zone","data-drag-over":eS?"true":"false",onDragEnter:eV,onDragLeave:eG,onDragOver:e_,onDrop:eK,className:(0,f.cn)("flex flex-col gap-1.5 rounded-md border-2 border-transparent p-1 transition-colors",eS&&"border-primary/50 bg-primary/5"),children:[(0,t.jsx)(C.Label,{htmlFor:"feature-description",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"DESCRIBE YOUR FEATURE"}),(0,t.jsxs)("div",{ref:ez,onFocus:e1,onBlur:e2,className:(0,f.cn)("border-input flex h-56 flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow]",eE&&"ring-ring/50 border-ring ring-[3px]"),children:[(0,t.jsx)(y.Textarea,{id:"feature-description",placeholder:"e.g. Add GitHub OAuth login with callback handling and token refresh...",value:W,onChange:e=>X(e.target.value),onPaste:eW,required:!0,disabled:i,className:"min-h-0 flex-1 resize-none rounded-none border-0 shadow-none focus-visible:ring-0"}),Y.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:Y.map(e=>(0,t.jsx)(R.AttachmentChip,{name:e.name,size:e.size,mimeType:e.mimeType,path:e.path,onRemove:()=>eZ(e.id),disabled:i,loading:e.loading,notes:e.notes,onNotesChange:t=>eJ(e.id,t)},e.id))}),eF?(0,t.jsx)("p",{className:"text-destructive px-3 pb-2 text-xs",children:eF}):null,(0,t.jsxs)("div",{className:"border-input flex items-center gap-3 border-t px-3 py-1.5",children:[(0,t.jsx)(A.AgentModelPicker,{initialAgentType:ej??w??"claude-code",initialModel:ey??N??"claude-sonnet-4-6",mode:"override",onAgentModelChange:(e,t)=>{ew(e),eC(t)},disabled:i,className:"w-55"}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"ml-auto flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(T.Switch,{id:"pending-mode",checked:em,onCheckedChange:ex,disabled:i}),(0,t.jsxs)(C.Label,{htmlFor:"pending-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,t.jsx)(p.Clock,{className:"h-3.5 w-3.5"}),"Pending"]})]})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:"Create without starting — start manually later."})]}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(T.Switch,{id:"fast-mode",checked:eu,onCheckedChange:eh,disabled:i}),(0,t.jsxs)(C.Label,{htmlFor:"fast-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,t.jsx)(c.Zap,{className:"h-3.5 w-3.5"}),"Fast Mode"]})]})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:"Skip SDLC phases and implement directly from your prompt."})]}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:eY,disabled:i,"aria-label":"Attach files",className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,t.jsx)(n.PaperclipIcon,{className:"h-4 w-4"})})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:"Attach files"})]})]})]})]}),e5&&void 0!==h?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(C.Label,{htmlFor:"parent-feature",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"PARENT FEATURE"}),(0,t.jsx)($,{features:d,value:ec,onChange:ep,disabled:i})]}):null,(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:"APPROVE"})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:"Auto-approve phase transitions without manual review."})]}),(0,t.jsx)("div",{className:"flex flex-1 items-center gap-4",children:U.map(e=>(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:`approve-${e.id}`,size:"sm",checked:J[e.id]??!1,onCheckedChange:t=>Q(r=>({...r,[e.id]:t})),disabled:i||eu&&("allowPrd"===e.id||"allowPlan"===e.id)}),(0,t.jsx)(C.Label,{htmlFor:`approve-${e.id}`,className:"cursor-pointer text-xs font-medium",children:e.label})]})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:eu&&("allowPrd"===e.id||"allowPlan"===e.id)?"Skipped in Fast Mode":e.description})]},e.id))}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:()=>{let e=U.every(e=>J[e.id]),t={};for(let r of U)t[r.id]=!e;Q(t)},disabled:i,className:(0,f.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",U.every(e=>J[e.id])&&"text-primary"),children:"All"})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:"Toggle all approval gates"})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:"EVIDENCE"})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:"Collect and attach evidence after implementation."})]}),(0,t.jsxs)("div",{className:"flex flex-1 items-center gap-4",children:[(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"enable-evidence",size:"sm",checked:ei,onCheckedChange:e=>{en(e),e||ed(!1)},disabled:i}),(0,t.jsx)(C.Label,{htmlFor:"enable-evidence",className:"cursor-pointer text-xs font-medium",children:"Collect"})]})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:"Capture screenshots and artifacts after implementation."})]}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"commit-evidence",size:"sm",checked:el,onCheckedChange:ed,disabled:i||!ei||!er&&!ef}),(0,t.jsx)(C.Label,{htmlFor:"commit-evidence",className:(0,f.cn)("cursor-pointer text-xs font-medium",(!ei||!er&&!ef)&&"opacity-50"),children:"Add to PR"})]})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:er||ef?ei?"Include evidence in the pull request body.":"Requires evidence collection to be enabled":"Requires PR to be enabled"})]})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-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:"GIT"}),(0,t.jsxs)("div",{className:"flex flex-1 flex-wrap items-center gap-4",children:[(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"push",size:"sm",checked:!!ef||ee||er,onCheckedChange:e=>{et(e),!e&&er&&ea(!1)},disabled:i||ef}),(0,t.jsx)(C.Label,{htmlFor:"push",className:(0,f.cn)("cursor-pointer text-xs font-medium",ef&&"opacity-50"),children:"Push"})]})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:ef?"Enabled — contributing to upstream":"Push branch to remote after implementation."})]}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"open-pr",size:"sm",checked:!!ef||er,onCheckedChange:e=>{ea(e),e||ed(!1)},disabled:i||ef}),(0,t.jsx)(C.Label,{htmlFor:"open-pr",className:(0,f.cn)("cursor-pointer text-xs font-medium",ef&&"opacity-50"),children:"PR"})]})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:ef?"Enabled — contributing to upstream":"Open a pull request after pushing."})]}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"ci-watch",size:"sm",checked:es,onCheckedChange:eo,disabled:i}),(0,t.jsx)(C.Label,{htmlFor:"ci-watch",className:"cursor-pointer text-xs font-medium",children:"Watch"})]})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:"Watch CI and auto-fix after push."})]}),(0,t.jsx)("div",{className:"bg-border h-4 w-px shrink-0"}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"commit-specs",size:"sm",checked:eb,onCheckedChange:ev,disabled:i}),(0,t.jsxs)(C.Label,{htmlFor:"commit-specs",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(x.FileText,{className:"h-3 w-3"}),"Commit Specs"]})]})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:"Commit specs to repository."})]}),!eO&&(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"fork-and-pr",size:"sm",checked:ef,onCheckedChange:e=>{eg(e),e&&ev(!1)},disabled:i}),(0,t.jsxs)(C.Label,{htmlFor:"fork-and-pr",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(m,{className:"h-3 w-3"}),"Fork & PR"]})]})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:"Contribute via fork (PR to upstream)."})]})]})]})]})]})})})})}function $({features:e,value:a,onChange:s,disabled:o}){let[i,n]=(0,r.useState)(!1),[c,p]=(0,r.useState)(""),u=(0,r.useRef)(null),h=e.find(e=>e.id===a),m=c.trim()?e.filter(e=>e.name.toLowerCase().includes(c.toLowerCase())||e.id.toLowerCase().includes(c.toLowerCase())):e,x=(0,r.useCallback)(e=>{s(e),n(!1),p("")},[s]);return(0,r.useEffect)(()=>{i?setTimeout(()=>u.current?.focus(),0):p("")},[i]),(0,t.jsxs)(N.Popover,{open:i,onOpenChange:n,children:[(0,t.jsx)(N.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{id:"parent-feature",type:"button",role:"combobox","aria-expanded":i,"aria-label":"Parent Feature",disabled:o,"data-testid":"parent-feature-combobox",className:(0,f.cn)("border-input bg-background ring-offset-background focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",!h&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:h?`${h.name} (${h.id.slice(0,8)})`:"Select parent feature..."}),(0,t.jsx)(l.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(N.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)(w.Input,{ref:u,placeholder:"Search features...",value:c,onChange:e=>p(e.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"parent-feature-search"})}),(0,t.jsxs)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Features",children:[(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":void 0===a,onClick:()=>x(void 0),className:(0,f.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",void 0===a&&"bg-accent/50"),"data-testid":"parent-feature-option-none",children:[(0,t.jsx)(d.CheckIcon,{className:(0,f.cn)("h-4 w-4 shrink-0",void 0!==a&&"invisible")}),(0,t.jsx)("span",{className:"text-muted-foreground italic",children:"No parent"})]}),0===m.length&&c?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:"No features found."}):m.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":a===e.id,onClick:()=>x(e.id),className:(0,f.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",a===e.id&&"bg-accent/50"),"data-testid":`parent-feature-option-${e.id}`,children:[(0,t.jsx)(d.CheckIcon,{className:(0,f.cn)("h-4 w-4 shrink-0",a!==e.id&&"invisible")}),(0,t.jsxs)("span",{className:"truncate",children:[e.name," ",(0,t.jsxs)("span",{className:"text-muted-foreground font-mono text-xs",children:["(",e.id.slice(0,8),")"]})]})]},e.id))]})]})})]})}function q({repositories:e,value:a,onChange:s,onAddRepository:o,disabled:i}){let[n,c]=(0,r.useState)(!1),[p,m]=(0,r.useState)(""),[x,g]=(0,r.useState)(!1),[b,v]=(0,r.useState)(null),[j,y]=(0,r.useState)(!1),C=(0,r.useRef)(null),{reactFileManager:k}=(0,M.useFeatureFlags)(),T=e.find(e=>e.path===a),P=p.trim()?e.filter(e=>e.name.toLowerCase().includes(p.toLowerCase())||e.path.toLowerCase().includes(p.toLowerCase())):e,S=(0,r.useCallback)(e=>{s(e),c(!1),m("")},[s]),R=(0,r.useCallback)(async e=>{let t=await (0,z.addRepository)({path:e});if(t.error){v(t.error),g(!1);return}if(t.repository){let e={id:t.repository.id,name:t.repository.name,path:t.repository.path};o?.(e),s(e.path),c(!1),m("")}},[o,s]),F=(0,r.useCallback)(async()=>{if(!x){if(k)return void y(!0);g(!0),v(null);try{let e=await (0,D.pickFolder)();if(!e)return void g(!1);await R(e)}catch{y(!0)}finally{g(!1)}}},[x,k,R]),A=(0,r.useCallback)(async e=>{if(y(!1),e){g(!0),v(null);try{await R(e)}catch(e){v(e instanceof Error?e.message:"Failed to add repository")}finally{g(!1)}}},[R]);return(0,r.useEffect)(()=>{n?setTimeout(()=>C.current?.focus(),0):m("")},[n]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(N.Popover,{open:n,onOpenChange:c,children:[(0,t.jsx)(N.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"button",role:"combobox","aria-expanded":n,"aria-label":"Repository",disabled:i,"data-testid":"repository-combobox",className:(0,f.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",!T&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:T?T.name:"Select repository..."}),(0,t.jsx)(l.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(N.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)(w.Input,{ref:C,placeholder:"Search repositories...",value:p,onChange:e=>m(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===P.length?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm","data-testid":"repository-empty",children:"No repositories found."}):P.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":a===e.path,onClick:()=>S(e.path),className:(0,f.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",a===e.path&&"bg-accent/50"),"data-testid":`repository-option-${e.id}`,children:[(0,t.jsx)(d.CheckIcon,{className:(0,f.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)(E.Separator,{}),(0,t.jsxs)("button",{type:"button",onClick:F,disabled:x,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:[x?(0,t.jsx)(h.Loader2,{className:"h-4 w-4 shrink-0 animate-spin"}):(0,t.jsx)(u.FolderPlus,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:"Add new repository..."})]}),b?(0,t.jsx)("p",{className:"px-3 pb-2 text-xs text-red-500","data-testid":"add-repository-error",children:b}):null]})})]}),(0,t.jsx)(I.ReactFileManagerDialog,{open:j,onOpenChange:e=>{e||y(!1)},onSelect:A})]})}function V({repositoryPath:e,initialParentId:o,initialDescription:n,features:l,repositories:d,workflowDefaults:c,currentAgentType:p,currentModel:u,canPushDirectly:h}){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 v=(0,r.useCallback)(()=>{m.push("/")},[m]),j=(0,r.useCallback)(e=>{f(!0),m.push("/"),i(e).then(t=>{t.error?s.toast.error(t.error):window.dispatchEvent(new CustomEvent("shep:feature-created",{detail:{featureId:t.feature.id,name:t.feature.name,description:t.feature.description,repositoryPath:t.feature.repositoryPath,parentId:e.parentId}}))}).catch(()=>{s.toast.error("Failed to create feature"),f(!1)})},[m]);return(0,t.jsx)(H,{open:b,onClose:v,onSubmit:j,repositoryPath:e,features:l,repositories:d,workflowDefaults:c,initialParentId:o,initialDescription:n,isSubmitting:x,currentAgentType:p,currentModel:u,canPushDirectly:h})}e.s(["CreateDrawerClient",()=>V],15203)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,10714,99105,e=>{"use strict";var t=e.i(3645);let r=(0,t.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);e.s(["default",()=>r],10714);let a=(0,t.default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",()=>a],99105)},33548,e=>{"use strict";let t=(0,e.i(3645).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",()=>t],33548)},95812,35e3,e=>{"use strict";let t=(0,e.i(3645).default)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["Circle",()=>t],95812);var r=e.i(80986);e.s(["CheckCircle2",()=>r.default],35e3)},19933,e=>{"use strict";let t=(0,e.i(3645).default)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);e.s(["FolderOpen",()=>t],19933)},8986,31299,6075,58640,e=>{"use strict";let t=(0,e.i(3645).default)("code-xml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);e.s(["Code2",()=>t],8986);var r=e.i(21023);let a=(0,r.createServerReference)("40f3319f6d4b0f98c2dfacffb1c0989d5c2599e7dc",r.callServer,void 0,r.findSourceMapURL,"openIde");e.s(["openIde",()=>a],31299);let l=(0,r.createServerReference)("40e7d0dd62466d4c83406c82ad1e411e63bda7a0c8",r.callServer,void 0,r.findSourceMapURL,"openShell");e.s(["openShell",()=>l],6075);let c=(0,r.createServerReference)("400a25ae74919a04fc13f17a5fbde79f1b4701acca",r.callServer,void 0,r.findSourceMapURL,"openFolder");e.s(["openFolder",()=>c],58640)},53360,e=>{"use strict";let t=(0,e.i(3645).default)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);e.s(["Zap",()=>t],53360)},23405,e=>{"use strict";var t=e.i(79054);function r(e){let r=t.useRef({value:e,previous:e});return t.useMemo(()=>(r.current.value!==e&&(r.current.previous=r.current.value,r.current.value=e),r.current.previous),[e])}e.s(["usePrevious",()=>r])},76016,e=>{"use strict";let t=(0,e.i(3645).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",()=>t],76016)},11345,e=>{"use strict";let t=(0,e.i(3645).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",()=>t],11345)},97667,e=>{"use strict";var t=e.i(1012);e.s(["CheckIcon",()=>t.default])},23925,1012,e=>{"use strict";let t=(0,e.i(3645).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",()=>t],1012),e.s(["Check",()=>t],23925)},30702,e=>{"use strict";let t=(0,e.i(3645).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",()=>t],30702)},38573,e=>{"use strict";let t=(0,e.i(3645).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",()=>t],38573)},1650,e=>{"use strict";e.i(11495),e.s([])},54793,7729,e=>{"use strict";var t=e.i(20314),r=e.i(31777);function a({icon:e,title:a,description:l,action:c,className:s,...u}){return(0,t.jsxs)("div",{className:(0,r.cn)("flex flex-col items-center gap-4 px-4 py-12 text-center",s),...u,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]})}e.s(["EmptyState",()=>a],7729),e.s([],54793)},65124,38555,e=>{"use strict";var t=e.i(21023);let r=(0,t.createServerReference)("000d595c46be84e00422908accc7fd8c44c9a7db8a",t.callServer,void 0,t.findSourceMapURL,"getAllAgentModels");e.s(["getAllAgentModels",()=>r],65124);let a=(0,t.createServerReference)("60fbb4d32249d0f954a00c657c1426486ad51ae09d",t.callServer,void 0,t.findSourceMapURL,"updateAgentAndModel");e.s(["updateAgentAndModel",()=>a],38555)},4988,e=>{"use strict";var t=e.i(21023);let r=(0,t.createServerReference)("40b544a9d99cc22369c48f8e94fe51849437638018",t.callServer,void 0,t.findSourceMapURL,"addRepository");e.s(["addRepository",()=>r])},76852,e=>{"use strict";var t=e.i(79054),r=e.i(31299),a=e.i(6075),l=e.i(58640),c=e.i(21023);let s=(0,c.createServerReference)("4042ab18d10c4ba29ba0195815e96176c468aeae14",c.callServer,void 0,c.findSourceMapURL,"syncRepository");function u(e){let[c,u]=(0,t.useState)(!1),[n,i]=(0,t.useState)(!1),[d,o]=(0,t.useState)(!1),[f,p]=(0,t.useState)(!1),[h,v]=(0,t.useState)(null),[y,m]=(0,t.useState)(null),[S,k]=(0,t.useState)(null),[x,R]=(0,t.useState)(null),b=(0,t.useRef)(null),g=(0,t.useRef)(null),M=(0,t.useRef)(null),C=(0,t.useRef)(null);(0,t.useEffect)(()=>()=>{b.current&&clearTimeout(b.current),g.current&&clearTimeout(g.current),M.current&&clearTimeout(M.current),C.current&&clearTimeout(C.current)},[]);let A=(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)(()=>A(()=>(0,r.openIde)({repositoryPath:e.repositoryPath}),u,v,b,c),[A,c,e]),openInShell:(0,t.useCallback)(()=>A(()=>(0,a.openShell)({repositoryPath:e.repositoryPath}),i,m,g,n),[A,n,e]),openFolder:(0,t.useCallback)(()=>A(()=>(0,l.openFolder)(e.repositoryPath),o,k,M,d),[A,d,e]),syncMain:(0,t.useCallback)(()=>A(()=>s(e.repositoryId??""),p,R,C,f),[A,f,e]),ideLoading:c,shellLoading:n,folderLoading:d,syncLoading:f,ideError:h,shellError:y,folderError:S,syncError:x}}e.s(["useRepositoryActions",()=>u],76852)}]);