decocms 4.246.2 → 4.246.4

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 (280) hide show
  1. package/dist/client/assets/{AlertCircle-DOZzh9F_.js → AlertCircle-CywLLU7N.js} +1 -1
  2. package/dist/client/assets/{AreaChart-BEoF41lY.js → AreaChart-D_qhsjcn.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-D3IfTAWC.js → ArrowLeft-5kZnTkMw.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-D1Whwq-K.js → ArrowUp-Drc1UvH8.js} +1 -1
  5. package/dist/client/assets/{ArrowUpRight-CibKwsqg.js → ArrowUpRight-BmVMgmrB.js} +1 -1
  6. package/dist/client/assets/{Check-CSFy6eOj.js → Check-BMTcpyw9.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-BCbqPCn-.js → CheckCircle-DUIOLuHc.js} +1 -1
  8. package/dist/client/assets/{ChevronDown-DiERg-yU.js → ChevronDown-CRZWY5vZ.js} +1 -1
  9. package/dist/client/assets/{ChevronRight-H-_IIqWd.js → ChevronRight-D-hHdaJE.js} +1 -1
  10. package/dist/client/assets/{ChevronSelectorVertical-Bnz5tSS1.js → ChevronSelectorVertical-DfQTwZbh.js} +1 -1
  11. package/dist/client/assets/{ChevronUp-CT1Rb5MC.js → ChevronUp-AUp1Qpqu.js} +1 -1
  12. package/dist/client/assets/{Copy01-CzEeXGsa.js → Copy01-DsL2MX7-.js} +1 -1
  13. package/dist/client/assets/{CreditCard01-DTIKWUon.js → CreditCard01-DSiwLzu5.js} +1 -1
  14. package/dist/client/assets/{DotsVertical-Bqf_kSFh.js → DotsVertical-T-qNNFNq.js} +1 -1
  15. package/dist/client/assets/{Download01-BPvwRxeD.js → Download01-Dx5a-JSz.js} +1 -1
  16. package/dist/client/assets/{Eye-CDfbu42j.js → Eye-7PQLukgG.js} +1 -1
  17. package/dist/client/assets/{FilterLines-Dc1F-WNI.js → FilterLines-CrgP-FUu.js} +1 -1
  18. package/dist/client/assets/{Globe01-CHMths1B.js → Globe01-BIM1CfT5.js} +1 -1
  19. package/dist/client/assets/{Globe04-CIol-u19.js → Globe04-CFZMqgDC.js} +1 -1
  20. package/dist/client/assets/{HardDrive-Bs-QsH_i.js → HardDrive-D-plrf3i.js} +1 -1
  21. package/dist/client/assets/{Key01-WuBVakl2.js → Key01-CKfOfm2w.js} +1 -1
  22. package/dist/client/assets/{LayoutLeft-BF7bmTAo.js → LayoutLeft-CZkuUfPg.js} +1 -1
  23. package/dist/client/assets/{LinkExternal01-kQgSYVkJ.js → LinkExternal01-B6Mm4hAd.js} +1 -1
  24. package/dist/client/assets/{LockUnlocked01-Bvs7cZ-w.js → LockUnlocked01-BjEsmeyw.js} +1 -1
  25. package/dist/client/assets/{LogOut01-9xKoxZHy.js → LogOut01-C4uDW2hW.js} +1 -1
  26. package/dist/client/assets/{Monitor01-B5i4MO_v.js → Monitor01-DMCNMsNO.js} +1 -1
  27. package/dist/client/assets/{Palette-l5b6DG4Q.js → Palette-sGNsebP3.js} +1 -1
  28. package/dist/client/assets/{Play-AS6vVmkD.js → Play-CvUWjt5q.js} +1 -1
  29. package/dist/client/assets/{Plus-m61KPSTg.js → Plus-DPKssxLn.js} +1 -1
  30. package/dist/client/assets/{SearchLg-CDtXrrcW.js → SearchLg-L_JPa3fX.js} +1 -1
  31. package/dist/client/assets/{SearchMd-CF01LhHu.js → SearchMd-DHbBd3im.js} +1 -1
  32. package/dist/client/assets/{Settings02-CGZ0Ol25.js → Settings02-DyCd7JtA.js} +1 -1
  33. package/dist/client/assets/{Share07-Dc2LdheG.js → Share07-OGAtiC_R.js} +1 -1
  34. package/dist/client/assets/{Shield01-CkA8zl8k.js → Shield01-Ci_NiZAD.js} +1 -1
  35. package/dist/client/assets/{Stars01-Co5mOLjQ.js → Stars01-OuQBYZge.js} +1 -1
  36. package/dist/client/assets/{Stars02-CLHJV6ce.js → Stars02-Cp9bSUYT.js} +1 -1
  37. package/dist/client/assets/{Sun-Cz50Vxl-.js → Sun-B9dfSL2V.js} +1 -1
  38. package/dist/client/assets/{SwitchHorizontal01-BdWiZHby.js → SwitchHorizontal01-BhNLszpk.js} +1 -1
  39. package/dist/client/assets/{Tool01-D9lNVxCu.js → Tool01-BPmgbtqw.js} +1 -1
  40. package/dist/client/assets/{Tool02-DtJ6WkGT.js → Tool02-OPICFuOd.js} +1 -1
  41. package/dist/client/assets/{Trash01-BcRuo5Fe.js → Trash01-DgXUCXZR.js} +1 -1
  42. package/dist/client/assets/{TrendUp01-B2aFkzBy.js → TrendUp01-BfvESyFJ.js} +1 -1
  43. package/dist/client/assets/{Upload01-B1Z9PE0l.js → Upload01--adXJUt3.js} +1 -1
  44. package/dist/client/assets/{User01-D1UDDnNw.js → User01-Ddl7sykt.js} +1 -1
  45. package/dist/client/assets/UserSquare-DELWBgQx.js +1 -0
  46. package/dist/client/assets/{Users01-gv39jXBY.js → Users01-m82_DH1U.js} +1 -1
  47. package/dist/client/assets/{Users03-DM_1WdDy.js → Users03-D5uVoOJh.js} +1 -1
  48. package/dist/client/assets/{X-VMfnK-j5.js → X-GHDv2bPa.js} +1 -1
  49. package/dist/client/assets/{XCircle-D-ab7D3l.js → XCircle-Woz3hXm7.js} +1 -1
  50. package/dist/client/assets/{XClose-BmVO_SaY.js → XClose-C22JjfI5.js} +1 -1
  51. package/dist/client/assets/{YAxis-CYtp3V1k.js → YAxis-CTXvwn-w.js} +1 -1
  52. package/dist/client/assets/{Zap-BrJ2b2V7.js → Zap-DEkoWmnk.js} +1 -1
  53. package/dist/client/assets/{ZapSquare-BjQDrkMq.js → ZapSquare-Dk0j1NZT.js} +1 -1
  54. package/dist/client/assets/{access-gate-bmibgRvV.js → access-gate-CUuU4Akn.js} +1 -1
  55. package/dist/client/assets/agent-icon-BFfHpTj0.js +1 -0
  56. package/dist/client/assets/agents-list-B10S3S1o.js +1 -0
  57. package/dist/client/assets/ai-providers-D6M6vnH3.js +6 -0
  58. package/dist/client/assets/{alert-C6E9q71w.js → alert-CbzuL5U0.js} +1 -1
  59. package/dist/client/assets/{alert-dialog-DRGp9yFR.js → alert-dialog-B6efvq96.js} +1 -1
  60. package/dist/client/assets/api-keys-Be49xOHM.js +1 -0
  61. package/dist/client/assets/app-editor-Btw61HI8.js +1 -0
  62. package/dist/client/assets/{auth-Dk3-oFE7.js → auth-By9laq1a.js} +1 -1
  63. package/dist/client/assets/{auth-catchall-BB9-aq9V.js → auth-catchall-Dic0l2zL.js} +1 -1
  64. package/dist/client/assets/{auth-entry-C_2hGTBt.js → auth-entry-EiDYEymR.js} +1 -1
  65. package/dist/client/assets/{auth-split-layout-B7n763Vx.js → auth-split-layout-D9kcoAJV.js} +1 -1
  66. package/dist/client/assets/{authenticate-and-persist-oauth-BwcRtSiC.js → authenticate-and-persist-oauth-CjhkLgGL.js} +1 -1
  67. package/dist/client/assets/{automation-list-row-BIOSCgKN.js → automation-list-row-ByHEJHr4.js} +1 -1
  68. package/dist/client/assets/{automation-runs-D-R-Y_E3.js → automation-runs-CuJe3IJj.js} +16 -16
  69. package/dist/client/assets/automations-DRnBdfkP.js +1 -0
  70. package/dist/client/assets/{avatar-C448hZt-.js → avatar-XToRCTtg.js} +1 -1
  71. package/dist/client/assets/{badge-Bc-IWDm5.js → badge-DveTg52E.js} +1 -1
  72. package/dist/client/assets/{block-document-D__keZl9.js → block-document-CbRdyV4I.js} +1 -1
  73. package/dist/client/assets/{buckets-Dyp0YIko.js → buckets-HCO-gN-n.js} +1 -1
  74. package/dist/client/assets/bulk-category-panel-CZgZICpu.js +1 -0
  75. package/dist/client/assets/{capability-load-error-BPXMIbs3.js → capability-load-error-D9lVxIV_.js} +1 -1
  76. package/dist/client/assets/{card-CG7VHdDz.js → card-CzcIXv8O.js} +1 -1
  77. package/dist/client/assets/{cards-DY46VRdr.js → cards-CdIo4vf_.js} +1 -1
  78. package/dist/client/assets/category-editor-Nb4J4_cD.js +1 -0
  79. package/dist/client/assets/{chart-DoynaU7M.js → chart-CfPCrkm9.js} +1 -1
  80. package/dist/client/assets/{chat-context-D20WJCxs.js → chat-context-Dqusww-z.js} +5 -5
  81. package/dist/client/assets/{checkbox-BsGrD1YR.js → checkbox-BZtl3z8P.js} +1 -1
  82. package/dist/client/assets/choose-editor-CdvG_dim.js +1 -0
  83. package/dist/client/assets/{cli-auth-success-BBaOfXHx.js → cli-auth-success-CRHJTFXN.js} +1 -1
  84. package/dist/client/assets/collection-detail-BzgbN-Qy.js +1 -0
  85. package/dist/client/assets/{collection-display-button-CvRYqkOn.js → collection-display-button-CsTQ9UtS.js} +1 -1
  86. package/dist/client/assets/{collection-search-DGOZ00E9.js → collection-search-BAbgWU_h.js} +1 -1
  87. package/dist/client/assets/{collection-table-wrapper-Pg9EfyUB.js → collection-table-wrapper-DebkUlwo.js} +1 -1
  88. package/dist/client/assets/{collection-tabs-DaZaBm6K.js → collection-tabs-BuB0qOUO.js} +1 -1
  89. package/dist/client/assets/{command-D63NDRD_.js → command-DWt73k63.js} +1 -1
  90. package/dist/client/assets/commerce-onboarding-DNDoGFKk.js +1 -0
  91. package/dist/client/assets/{connect-GnxEAvmg.js → connect-Cii_fgku.js} +2 -2
  92. package/dist/client/assets/connection-card-C6y7PdX8.js +1 -0
  93. package/dist/client/assets/connection-detail-D7Voz52Y.js +1 -0
  94. package/dist/client/assets/{connection-form-helpers-ZW-hGCeS.js → connection-form-helpers-CvmIulQM.js} +1 -1
  95. package/dist/client/assets/{connection-C_INLdxb.js → connection-ybedUfG8.js} +1 -1
  96. package/dist/client/assets/connections-B-Q5XAol.js +1 -0
  97. package/dist/client/assets/constants-BSYv1IkQ.js +1 -0
  98. package/dist/client/assets/{decopilot-sse-pool-CeSWLSEV.js → decopilot-sse-pool-Hm5cR6Ox.js} +1 -1
  99. package/dist/client/assets/{dialog-Ww_zj2g-.js → dialog-DF-CfFZo.js} +1 -1
  100. package/dist/client/assets/{domain-settings-C1hsjq6B.js → domain-settings-DyFCdtS5.js} +1 -1
  101. package/dist/client/assets/{drawer-lF-HaYn9.js → drawer-CDoSEnu9.js} +1 -1
  102. package/dist/client/assets/{dropdown-menu-ByKxU4Y4.js → dropdown-menu-CJxuIExP.js} +1 -1
  103. package/dist/client/assets/{empty-state-BJ2gnfVT.js → empty-state-CAvGBBF6.js} +1 -1
  104. package/dist/client/assets/extract-connection-data-DHCZqcQQ.js +1 -0
  105. package/dist/client/assets/file-explorer-iP4x_Yhy.js +2 -0
  106. package/dist/client/assets/{file-type-icon-B5W8k3cc.js → file-type-icon-DXPee-3o.js} +1 -1
  107. package/dist/client/assets/{form-BhElkTfE.js → form-3gPXzjO1.js} +1 -1
  108. package/dist/client/assets/general-VYZWN_XI.js +1 -0
  109. package/dist/client/assets/github-repo-picker-CbrjFpAT.js +1 -0
  110. package/dist/client/assets/{hooks-D72xT78n.js → hooks-2knfRhQG.js} +4 -4
  111. package/dist/client/assets/{index-DGV2vBko.js → index-BtSjLcb4.js} +1 -1
  112. package/dist/client/assets/index-C4tNsqrz.js +1 -0
  113. package/dist/client/assets/{index-CVShUKw1.js → index-CS8hxwi8.js} +1 -1
  114. package/dist/client/assets/{index-BGQowlvH.js → index-Cd5TgCBJ.js} +2 -2
  115. package/dist/client/assets/{index-COAHvcVh.js → index-ChP7VzHg.js} +49 -49
  116. package/dist/client/assets/{index-E8TCV-RN.js → index-CwnG996Y.js} +2 -2
  117. package/dist/client/assets/{index-CacyxM-B.js → index-DScyN1ng.js} +36 -36
  118. package/dist/client/assets/{index-GDSYOTBM.js → index-Dj9nFK99.js} +1 -1
  119. package/dist/client/assets/index-DukI1vFj.js +1 -0
  120. package/dist/client/assets/{index-redirect-DkpgAZX1.js → index-redirect-hmUlblcp.js} +1 -1
  121. package/dist/client/assets/{index-CSqLyX3L.js → index-xuoH-ELf.js} +1 -1
  122. package/dist/client/assets/{infra-billing-YoJpQK-_.js → infra-billing-6qUJ8FpF.js} +1 -1
  123. package/dist/client/assets/{input-B8ln-0Wl.js → input-B-WAAZ8l.js} +1 -1
  124. package/dist/client/assets/{integration-icon-CLbqw16t.js → integration-icon-h2cZJQ9Q.js} +1 -1
  125. package/dist/client/assets/{invite-member-dialog-DBZ3baH8.js → invite-member-dialog-DmbzPllG.js} +1 -1
  126. package/dist/client/assets/{label-CCAJCJOj.js → label-Cg9QkeNq.js} +1 -1
  127. package/dist/client/assets/{layout-kT_5r6yU.js → layout-DZIITT9R.js} +1 -1
  128. package/dist/client/assets/{login-CdH7we7T.js → login-DjS6vG5F.js} +1 -1
  129. package/dist/client/assets/{mcp-oauth-YJCTRoaW.js → mcp-oauth-frjOq5nr.js} +1 -1
  130. package/dist/client/assets/{members-DkH9jYrb.js → members-DvCHXlKd.js} +1 -1
  131. package/dist/client/assets/{monaco-editor-q7NTyRwe.js → monaco-editor-B9zykm3x.js} +1 -1
  132. package/dist/client/assets/{monitoring-stats-row-DCpIn3aa.js → monitoring-stats-row-DeZ0cyol.js} +1 -1
  133. package/dist/client/assets/{multi-select-FeXmTrOe.js → multi-select-BeamEHNc.js} +1 -1
  134. package/dist/client/assets/{oauth-callback-Br4bRi-8.js → oauth-callback-ChRRKa65.js} +1 -1
  135. package/dist/client/assets/{oauth-callback-ai-provider-1lrQ44YW.js → oauth-callback-ai-provider-CAKZaPXP.js} +1 -1
  136. package/dist/client/assets/{onboarding-CJUbJrTS.js → onboarding-lmgUbBQe.js} +1 -1
  137. package/dist/client/assets/{org-layout-LRZQllfb.js → org-layout-B2VWo1QW.js} +1 -1
  138. package/dist/client/assets/{organization-choice-sfwWjhN7.js → organization-choice-BQ9U-Xq-.js} +1 -1
  139. package/dist/client/assets/{orgs-YJZRuVN_.js → orgs-Cdbe31pX.js} +1 -1
  140. package/dist/client/assets/{page-seo-form-BtKgt3m_.js → page-seo-form-D6iMCtAU.js} +1 -1
  141. package/dist/client/assets/{popover-5hCe1k-b.js → popover-Wy89IMWR.js} +1 -1
  142. package/dist/client/assets/post-editor-8um4AIC8.js +1 -0
  143. package/dist/client/assets/{primitives-BcUA5QnY.js → primitives-CuvVdjDA.js} +1 -1
  144. package/dist/client/assets/{profile-DLCbWXln.js → profile-C1mhmQtv.js} +1 -1
  145. package/dist/client/assets/project-app-view--LLIOxER.js +1 -0
  146. package/dist/client/assets/record-editor-DYnXx3r9.js +1 -0
  147. package/dist/client/assets/redirect-editor-B9-qGeUf.js +1 -0
  148. package/dist/client/assets/registry-CcjhOTSX.js +2 -0
  149. package/dist/client/assets/{registry-layout-DjY1XBxT.js → registry-layout-BR5urnXm.js} +2 -2
  150. package/dist/client/assets/{reports-gVOr0Sxi.js → reports-B9btUBiO.js} +1 -1
  151. package/dist/client/assets/{require-capability-BDCw5l2l.js → require-capability-DfzoRoy3.js} +1 -1
  152. package/dist/client/assets/{required-auth-layout-C0mQQwr6.js → required-auth-layout-BUpI2CfS.js} +1 -1
  153. package/dist/client/assets/{reset-password-DyhS2TkQ.js → reset-password-BVcWauyo.js} +1 -1
  154. package/dist/client/assets/roles-COefXdsU.js +1 -0
  155. package/dist/client/assets/{search-input-ByYoJKBQ.js → search-input-DGjtP6Rh.js} +1 -1
  156. package/dist/client/assets/{secrets-BRUyuZE5.js → secrets-BEPk1-eF.js} +1 -1
  157. package/dist/client/assets/{sections-editor-at21kKiT.js → sections-editor-DT6LvCBZ.js} +2 -2
  158. package/dist/client/assets/{select-CwAouusu.js → select-7pa4_aUT.js} +1 -1
  159. package/dist/client/assets/select-model-DQ1eNQu7.js +4 -0
  160. package/dist/client/assets/self-tool-result-BGGrfBl-.js +1 -0
  161. package/dist/client/assets/seo-editor-0ctPVCix.js +1 -0
  162. package/dist/client/assets/settings-layout-B147f-12.js +1 -0
  163. package/dist/client/assets/{settings-section-Cz2znp8W.js → settings-section-XDvcEzCV.js} +1 -1
  164. package/dist/client/assets/{settings-subnav-a1a1GCc2.js → settings-subnav-fRspG0-I.js} +1 -1
  165. package/dist/client/assets/{shell-controls-BPVHXOz1.js → shell-controls-nc8A-U3S.js} +1 -1
  166. package/dist/client/assets/shell-layout-BkFHuRxc.js +1 -0
  167. package/dist/client/assets/{sidebar-BDv_n64F.js → sidebar-BI-9XBR_.js} +1 -1
  168. package/dist/client/assets/{skeleton-DOg01VWn.js → skeleton-CmjcgP6R.js} +1 -1
  169. package/dist/client/assets/{spinner-D7fl_vK2.js → spinner-Ch7938P6.js} +1 -1
  170. package/dist/client/assets/{sso-kMJDATrG.js → sso-N3cjPoo1.js} +1 -1
  171. package/dist/client/assets/store-Dpv1v_pN.js +1 -0
  172. package/dist/client/assets/store-registry-B4Pzxsjd.js +2 -0
  173. package/dist/client/assets/{studio-tools-O0czolAT.js → studio-tools-DjBsxbnj.js} +1 -1
  174. package/dist/client/assets/{switch-B0vh0spM.js → switch-Bz_Ut2Tq.js} +1 -1
  175. package/dist/client/assets/synced-repos-4hDvRnUi.js +1 -0
  176. package/dist/client/assets/{tab-id-ZL6F14qy.js → tab-id-DgRfDePR.js} +1 -1
  177. package/dist/client/assets/{table-Dc0W0B0Q.js → table-BXTkk8zy.js} +1 -1
  178. package/dist/client/assets/{tabs-BerlyCPW.js → tabs-D_sEPUFk.js} +1 -1
  179. package/dist/client/assets/tasks-B38CkkW5.js +1 -0
  180. package/dist/client/assets/{textarea-CD_pYqo3.js → textarea-TMz6gyXu.js} +1 -1
  181. package/dist/client/assets/{toggle-group-BFyHFJ9G.js → toggle-group-CnQpN6py.js} +1 -1
  182. package/dist/client/assets/{toolbar-ClzusW5n.js → toolbar-CD4BCM4b.js} +1 -1
  183. package/dist/client/assets/{tooltip-CwIq9zTG.js → tooltip-BYHYsdou.js} +1 -1
  184. package/dist/client/assets/{track-Bufvtvpy.js → track-COzY04MD.js} +1 -1
  185. package/dist/client/assets/{types-D40WAxQO.js → types-CrCH3G_F.js} +1 -1
  186. package/dist/client/assets/{use-ai-providers-DF6xoNtC.js → use-ai-providers-D8ZxPPNl.js} +1 -1
  187. package/dist/client/assets/use-api-keys-QabOr7Sy.js +1 -0
  188. package/dist/client/assets/use-automations-olw2u0pZ.js +1 -0
  189. package/dist/client/assets/{use-autosave-BvdFNf3e.js → use-autosave-D0LAhUzj.js} +1 -1
  190. package/dist/client/assets/{use-capability-D8TgIows.js → use-capability-CzBu-J56.js} +1 -1
  191. package/dist/client/assets/{use-clock-tick-Dht-z9YX.js → use-clock-tick-DOlAeCMC.js} +1 -1
  192. package/dist/client/assets/use-commerce-diagnostic-BfO1Uz-E.js +1 -0
  193. package/dist/client/assets/use-connection-BPZswYGL.js +1 -0
  194. package/dist/client/assets/{use-copy-D87eemcY.js → use-copy-gUNHP8WW.js} +1 -1
  195. package/dist/client/assets/{use-create-virtual-mcp-BqCII4uA.js → use-create-virtual-mcp-CVBBpLVJ.js} +1 -1
  196. package/dist/client/assets/{use-debounced-autosave-fueOpbqS.js → use-debounced-autosave-CYC1_jOJ.js} +1 -1
  197. package/dist/client/assets/{use-debounced-value-DAmoRUxP.js → use-debounced-value-CRrTp2sD.js} +1 -1
  198. package/dist/client/assets/{use-decopilot-events-BIUvCjFX.js → use-decopilot-events-BZrhOh3J.js} +1 -1
  199. package/dist/client/assets/{use-delete-connection-CmSM7WcU.js → use-delete-connection-Dn80jRMf.js} +1 -1
  200. package/dist/client/assets/{use-deployment-admin-BRR0WTvL.js → use-deployment-admin-CczUz7z9.js} +1 -1
  201. package/dist/client/assets/{use-file-configs-EhMCIyTI.js → use-file-configs-bzI9NrYv.js} +1 -1
  202. package/dist/client/assets/{use-infinite-scroll-ChfJMk5S.js → use-infinite-scroll-qlOO1QTT.js} +1 -1
  203. package/dist/client/assets/{use-join-requests-DAyU8-6X.js → use-join-requests-Ve5ZEQzI.js} +1 -1
  204. package/dist/client/assets/use-mcp-client-CpcKk1mC.js +10 -0
  205. package/dist/client/assets/{use-mcp-tools-CMpvouUr.js → use-mcp-tools-BXCDAH3K.js} +1 -1
  206. package/dist/client/assets/{use-members-CYQAJOqU.js → use-members-lr2D4-9f.js} +1 -1
  207. package/dist/client/assets/{use-mobile-c0ak1uw4.js → use-mobile-CLhvlD5U.js} +1 -1
  208. package/dist/client/assets/{use-navigate-to-agent-IPGb4TnC.js → use-navigate-to-agent-B9V6njZa.js} +1 -1
  209. package/dist/client/assets/{use-org-auth-client-Bjx13kGF.js → use-org-auth-client-BKcaa9No.js} +1 -1
  210. package/dist/client/assets/{use-org-repo-syncs-CEYhU3FE.js → use-org-repo-syncs-qpXT2wCH.js} +1 -1
  211. package/dist/client/assets/{use-org-sso-BUVIJh4V.js → use-org-sso-CKd4_qDy.js} +1 -1
  212. package/dist/client/assets/{use-organization-roles-DZR-ca1L.js → use-organization-roles-dAemVnAv.js} +1 -1
  213. package/dist/client/assets/use-organization-settings-DqAGAUYM.js +1 -0
  214. package/dist/client/assets/use-registry-connections-BqF6UAct.js +1 -0
  215. package/dist/client/assets/{use-secrets-6DO3yZ-p.js → use-secrets-D0HFviXi.js} +1 -1
  216. package/dist/client/assets/{use-section-preview-base-Dc8Axtks.js → use-section-preview-base-BGsB97Xk.js} +1 -1
  217. package/dist/client/assets/use-settings-tabs-BjnrTXLq.js +1 -0
  218. package/dist/client/assets/{use-status-sounds-e0Pidqxv.js → use-status-sounds-DXRZEi59.js} +1 -1
  219. package/dist/client/assets/{use-tags-tOpGCqE_.js → use-tags-uV1Iq0hs.js} +1 -1
  220. package/dist/client/assets/{use-view-mode-BQejzyHA.js → use-view-mode-DuXFb47r.js} +1 -1
  221. package/dist/client/assets/use-virtual-mcp-CesHdqwl.js +1 -0
  222. package/dist/client/assets/useInfiniteQuery-DPD5wRLH.js +1 -0
  223. package/dist/client/assets/{useRouterState-Dk4tjkCW.js → useRouterState-C7_szwLj.js} +1 -1
  224. package/dist/client/assets/useSuspenseInfiniteQuery-kJZnOfaD.js +1 -0
  225. package/dist/client/assets/{users-Bv8CJJ4l.js → users-UKz0Vh9o.js} +1 -1
  226. package/dist/client/assets/variant-calendar-Bss6PO3E.js +1 -0
  227. package/dist/client/assets/{view-mode-toggle-BTBNp3sA.js → view-mode-toggle-BdaCG6S5.js} +1 -1
  228. package/dist/client/index.html +1 -1
  229. package/dist/server/cli.js +1 -1
  230. package/dist/server/server.js +1 -1
  231. package/package.json +1 -1
  232. package/dist/client/assets/agent-icon-BDevt-8Z.js +0 -1
  233. package/dist/client/assets/agents-list-DVOKstH-.js +0 -1
  234. package/dist/client/assets/ai-providers-qcQefmBS.js +0 -1
  235. package/dist/client/assets/api-keys-FMNqGQ51.js +0 -1
  236. package/dist/client/assets/app-editor-JM5Dp20k.js +0 -1
  237. package/dist/client/assets/automations-B-rlIa9G.js +0 -1
  238. package/dist/client/assets/billing-Do4qOo4X.js +0 -6
  239. package/dist/client/assets/bulk-category-panel-C5Gw6crO.js +0 -1
  240. package/dist/client/assets/category-editor-C2yNqWw9.js +0 -1
  241. package/dist/client/assets/choose-editor-D_7RLdI1.js +0 -1
  242. package/dist/client/assets/collection-detail-BcpNCPzg.js +0 -1
  243. package/dist/client/assets/commerce-onboarding-DptWqvBa.js +0 -1
  244. package/dist/client/assets/connection-card-BER9PD2I.js +0 -1
  245. package/dist/client/assets/connection-detail-BztCQFVl.js +0 -1
  246. package/dist/client/assets/connections-BkovTccm.js +0 -1
  247. package/dist/client/assets/extract-connection-data-BJ1FOt2x.js +0 -1
  248. package/dist/client/assets/file-explorer-DCujfpAL.js +0 -2
  249. package/dist/client/assets/general-DgbsvkYa.js +0 -1
  250. package/dist/client/assets/github-repo-picker-CcDCsGzG.js +0 -1
  251. package/dist/client/assets/index-DQv8YUWm.js +0 -1
  252. package/dist/client/assets/index-DRGw16I_.js +0 -1
  253. package/dist/client/assets/post-editor-C3I40PTm.js +0 -1
  254. package/dist/client/assets/project-app-view-TA-FxXgR.js +0 -1
  255. package/dist/client/assets/record-editor-wtWxgd5F.js +0 -1
  256. package/dist/client/assets/redirect-editor-BRBlF0cf.js +0 -1
  257. package/dist/client/assets/registry-D5JAnGyh.js +0 -2
  258. package/dist/client/assets/roles-BxtW1gkj.js +0 -1
  259. package/dist/client/assets/select-model-eoIBQakm.js +0 -4
  260. package/dist/client/assets/self-tool-result-DaPbHreD.js +0 -1
  261. package/dist/client/assets/seo-editor-DesMlOi9.js +0 -1
  262. package/dist/client/assets/settings-layout-Bf3LCUkH.js +0 -1
  263. package/dist/client/assets/shell-layout-VRjP3s0M.js +0 -1
  264. package/dist/client/assets/store-mWCGhxUC.js +0 -1
  265. package/dist/client/assets/store-registry-C-F9k1uh.js +0 -2
  266. package/dist/client/assets/synced-repos-DvIBkVQt.js +0 -1
  267. package/dist/client/assets/tasks-BhmY_7d9.js +0 -1
  268. package/dist/client/assets/use-api-keys-DMBDl3ic.js +0 -1
  269. package/dist/client/assets/use-automations-DQVxqjfN.js +0 -1
  270. package/dist/client/assets/use-commerce-diagnostic-B_wc4KWh.js +0 -1
  271. package/dist/client/assets/use-connection-BS7_Pbag.js +0 -1
  272. package/dist/client/assets/use-mcp-client-DRcy9vk6.js +0 -10
  273. package/dist/client/assets/use-open-billing-url-nNkK2kBm.js +0 -1
  274. package/dist/client/assets/use-organization-settings-DJYuvv-k.js +0 -1
  275. package/dist/client/assets/use-registry-connections-GX-tovow.js +0 -1
  276. package/dist/client/assets/use-settings-tabs-CkhP712K.js +0 -1
  277. package/dist/client/assets/use-virtual-mcp-zFcH9fRu.js +0 -1
  278. package/dist/client/assets/useInfiniteQuery-BxSgA-RD.js +0 -1
  279. package/dist/client/assets/useSuspenseInfiniteQuery-CNPxNyM-.js +0 -1
  280. package/dist/client/assets/variant-calendar-Cvw4xTeP.js +0 -1
@@ -1 +0,0 @@
1
- import{c as D,b as U,e as ne,j as n,B as $,t as te,bW as ee,y as Ne,a as Z,w as qe,x as Ae,K as ce,bX as Be,bY as Ue,G as X,m as ue,r as B,n as re,at as he,v as He,bZ as Je,p as pe,b_ as Ke,b$ as Ge,c0 as We,d as Ve,F as Qe,f as _e,u as Ye,J as Xe,bf as Ze,c1 as et,c2 as be,c3 as tt,c4 as nt,S as st,O as ot,c5 as it}from"./index-CacyxM-B.js";import{A as de}from"./avatar-C448hZt-.js";import{t as Te,a as at}from"./Users03-DM_1WdDy.js";import{i as rt}from"./SearchLg-CDtXrrcW.js";import{i as lt,s as ct,a as H,b as dt,n as ut}from"./Stars02-CLHJV6ce.js";import{s as mt}from"./XClose-BmVO_SaY.js";import{D as ft,t as gt,A as ht}from"./tab-id-ZL6F14qy.js";import{i as J}from"./CheckCircle-BCbqPCn-.js";import{i as ye}from"./FilterLines-Dc1F-WNI.js";import{i as xe}from"./Monitor01-B5i4MO_v.js";import{i as K}from"./Zap-BrJ2b2V7.js";import{a as Oe,b as Ce,d as Ee,e as Le,h as pt,c as bt}from"./dialog-Ww_zj2g-.js";import{u as yt}from"./use-is-desktop-app-BNujXJc_.js";import{R as xt}from"./required-auth-layout-C0mQQwr6.js";import{a as we,m as wt,S as St}from"./use-mcp-client-DRcy9vk6.js";import{b as vt}from"./hooks-D72xT78n.js";import{h as jt}from"./use-organization-settings-DJYuvv-k.js";import{u as kt}from"./use-org-sso-BUVIJh4V.js";function Nt(t){const e=D.c(49),{orgName:s,orgSlug:i,orgLogo:l,domain:r}=t,a=U();let o;e[0]!==i||e[1]!==a?(o=async()=>{const k=await fetch("/api/auth/custom/domain-join",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationSlug:i})}),O=await k.json();if(!k.ok||!O.success)throw new Error(O.error??a("common.autoDomainJoinScreen.joinError"));return O},e[0]=i,e[1]=a,e[2]=o):o=e[2];let d;e[3]!==i?(d=k=>{window.location.href=`/${k.slug??i}`},e[3]=i,e[4]=d):d=e[4];let f;e[5]!==a?(f=k=>{te.error(k instanceof Error?k.message:a("common.autoDomainJoinScreen.joinError"))},e[5]=a,e[6]=f):f=e[6];let y;e[7]!==o||e[8]!==d||e[9]!==f?(y={mutationFn:o,onSuccess:d,onError:f},e[7]=o,e[8]=d,e[9]=f,e[10]=y):y=e[10];const c=ne(y),v=At;let m;e[11]!==l||e[12]!==s?(m=l?n.jsx(de,{url:l,fallback:s.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(Te,{className:"h-6 w-6 text-primary"})}),e[11]=l,e[12]=s,e[13]=m):m=e[13];let u;e[14]!==s||e[15]!==a?(u=a("common.autoDomainJoinScreen.joinPrompt",{orgName:s}),e[14]=s,e[15]=a,e[16]=u):u=e[16];let p;e[17]!==u?(p=n.jsx("h3",{className:"text-lg font-medium",children:u}),e[17]=u,e[18]=p):p=e[18];let g;e[19]!==r||e[20]!==a?(g=a("common.autoDomainJoinScreen.joinDescription",{domain:r}),e[19]=r,e[20]=a,e[21]=g):g=e[21];let h;e[22]!==g?(h=n.jsx("p",{className:"text-sm text-muted-foreground",children:g}),e[22]=g,e[23]=h):h=e[23];let w;e[24]!==p||e[25]!==h?(w=n.jsxs("div",{className:"space-y-2",children:[p,h]}),e[24]=p,e[25]=h,e[26]=w):w=e[26];let x;e[27]!==c?(x=()=>c.mutate(),e[27]=c,e[28]=x):x=e[28];let S;e[29]!==c.isPending||e[30]!==s||e[31]!==a?(S=c.isPending?a("common.autoDomainJoinScreen.joining"):a("common.autoDomainJoinScreen.enterOrg",{orgName:s}),e[29]=c.isPending,e[30]=s,e[31]=a,e[32]=S):S=e[32];let N;e[33]!==c.isPending||e[34]!==x||e[35]!==S?(N=n.jsx($,{onClick:x,disabled:c.isPending,children:S}),e[33]=c.isPending,e[34]=x,e[35]=S,e[36]=N):N=e[36];const j=c.isPending;let A;e[37]!==a?(A=a("common.autoDomainJoinScreen.goHome"),e[37]=a,e[38]=A):A=e[38];let b;e[39]!==c.isPending||e[40]!==A?(b=n.jsx($,{variant:"ghost",onClick:v,disabled:j,children:A}),e[39]=c.isPending,e[40]=A,e[41]=b):b=e[41];let T;e[42]!==N||e[43]!==b?(T=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[N,b]}),e[42]=N,e[43]=b,e[44]=T):T=e[44];let _;return e[45]!==w||e[46]!==T||e[47]!==m?(_=n.jsxs(ee,{children:[m,w,T]}),e[45]=w,e[46]=T,e[47]=m,e[48]=_):_=e[48],_}function At(){window.location.href="/"}function Se(t){const e=D.c(25),{orgSlug:s,orgName:i,reason:l}=t,r=U(),a=_t,o=l==="not-found",d=o?rt:Ne;let f;e[0]!==o||e[1]!==r?(f=r(o?"common.noAccessScreen.organizationNotFound":"common.noAccessScreen.noAccess"),e[0]=o,e[1]=r,e[2]=f):f=e[2];const y=f;let c;e[3]!==o||e[4]!==i||e[5]!==s||e[6]!==r?(c=o?n.jsxs(n.Fragment,{children:[r("common.noAccessScreen.couldNotFind")," ",n.jsx("strong",{children:s}),"."]}):n.jsxs(n.Fragment,{children:[r("common.noAccessScreen.noAccessTo")," ",n.jsx("strong",{children:i??s}),".",n.jsx("br",{}),r("common.noAccessScreen.askAdminToInvite")]}),e[3]=o,e[4]=i,e[5]=s,e[6]=r,e[7]=c):c=e[7];const v=c;let m;e[8]!==d?(m=n.jsx("div",{className:"bg-muted p-3 rounded-full",children:n.jsx(d,{className:"h-6 w-6 text-muted-foreground"})}),e[8]=d,e[9]=m):m=e[9];let u;e[10]!==y?(u=n.jsx("h3",{className:"text-lg font-medium",children:y}),e[10]=y,e[11]=u):u=e[11];let p;e[12]!==v?(p=n.jsx("p",{className:"text-sm text-muted-foreground",children:v}),e[12]=v,e[13]=p):p=e[13];let g;e[14]!==u||e[15]!==p?(g=n.jsxs("div",{className:"space-y-2",children:[u,p]}),e[14]=u,e[15]=p,e[16]=g):g=e[16];let h;e[17]!==r?(h=r("common.noAccessScreen.goToHome"),e[17]=r,e[18]=h):h=e[18];let w;e[19]!==h?(w=n.jsx($,{onClick:a,children:h}),e[19]=h,e[20]=w):w=e[20];let x;return e[21]!==m||e[22]!==g||e[23]!==w?(x=n.jsxs(ee,{children:[m,g,w]}),e[21]=m,e[22]=g,e[23]=w,e[24]=x):x=e[24],x}function _t(){window.location.href="/"}function Tt(t){const e=D.c(59),{invitationId:s,orgName:i,orgSlug:l,orgLogo:r}=t,a=U();let o;e[0]!==s?(o=async()=>{const E=await Z.organization.acceptInvitation({invitationId:s});if(E.error)throw new Error(E.error.message);return E.data},e[0]=s,e[1]=o):o=e[1];let d;e[2]!==l?(d=()=>{qe(),window.location.href=`/${l}`},e[2]=l,e[3]=d):d=e[3];let f;e[4]!==a?(f=E=>{te.error(E instanceof Error?E.message:a("common.pendingInviteScreen.failedToAccept"))},e[4]=a,e[5]=f):f=e[5];let y;e[6]!==o||e[7]!==d||e[8]!==f?(y={mutationFn:o,onSuccess:d,onError:f},e[6]=o,e[7]=d,e[8]=f,e[9]=y):y=e[9];const c=ne(y);let v;e[10]!==s?(v=async()=>{const E=await Z.organization.rejectInvitation({invitationId:s});if(E.error)throw new Error(E.error.message);return E.data},e[10]=s,e[11]=v):v=e[11];let m,u;e[12]!==a?(m=()=>{te.success(a("common.pendingInviteScreen.invitationDeclined")),window.location.href="/"},u=E=>{te.error(E instanceof Error?E.message:a("common.pendingInviteScreen.failedToDecline"))},e[12]=a,e[13]=m,e[14]=u):(m=e[13],u=e[14]);let p;e[15]!==v||e[16]!==m||e[17]!==u?(p={mutationFn:v,onSuccess:m,onError:u},e[15]=v,e[16]=m,e[17]=u,e[18]=p):p=e[18];const g=ne(p),h=c.isPending||g.isPending;let w;e[19]!==r||e[20]!==i?(w=r?n.jsx(de,{url:r,fallback:i.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(lt,{className:"h-6 w-6 text-primary"})}),e[19]=r,e[20]=i,e[21]=w):w=e[21];let x;e[22]!==i||e[23]!==a?(x=a("common.pendingInviteScreen.invitedTo",{orgName:i}),e[22]=i,e[23]=a,e[24]=x):x=e[24];let S;e[25]!==x?(S=n.jsx("h3",{className:"text-lg font-medium",children:x}),e[25]=x,e[26]=S):S=e[26];let N;e[27]!==a?(N=a("common.pendingInviteScreen.acceptDescription"),e[27]=a,e[28]=N):N=e[28];let j;e[29]!==N?(j=n.jsx("p",{className:"text-sm text-muted-foreground",children:N}),e[29]=N,e[30]=j):j=e[30];let A;e[31]!==S||e[32]!==j?(A=n.jsxs("div",{className:"space-y-2",children:[S,j]}),e[31]=S,e[32]=j,e[33]=A):A=e[33];let b;e[34]!==c?(b=()=>c.mutate(),e[34]=c,e[35]=b):b=e[35];let T;e[36]!==c.isPending||e[37]!==a?(T=c.isPending?a("common.pendingInviteScreen.acceptingButton"):a("common.pendingInviteScreen.acceptButton"),e[36]=c.isPending,e[37]=a,e[38]=T):T=e[38];let _;e[39]!==h||e[40]!==b||e[41]!==T?(_=n.jsx($,{onClick:b,disabled:h,children:T}),e[39]=h,e[40]=b,e[41]=T,e[42]=_):_=e[42];let k;e[43]!==g?(k=()=>g.mutate(),e[43]=g,e[44]=k):k=e[44];let O;e[45]!==g.isPending||e[46]!==a?(O=g.isPending?a("common.pendingInviteScreen.decliningButton"):a("common.pendingInviteScreen.declineButton"),e[45]=g.isPending,e[46]=a,e[47]=O):O=e[47];let L;e[48]!==h||e[49]!==k||e[50]!==O?(L=n.jsx($,{variant:"ghost",onClick:k,disabled:h,children:O}),e[48]=h,e[49]=k,e[50]=O,e[51]=L):L=e[51];let C;e[52]!==_||e[53]!==L?(C=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[_,L]}),e[52]=_,e[53]=L,e[54]=C):C=e[54];let P;return e[55]!==A||e[56]!==C||e[57]!==w?(P=n.jsxs(ee,{children:[w,A,C]}),e[55]=A,e[56]=C,e[57]=w,e[58]=P):P=e[58],P}function Ot(t){const e=D.c(23),{orgName:s,orgLogo:i}=t,l=U();let r;e[0]!==i||e[1]!==s?(r=i?n.jsx(de,{url:i,fallback:s.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(ct,{className:"h-6 w-6 text-primary"})}),e[0]=i,e[1]=s,e[2]=r):r=e[2];let a;e[3]!==l?(a=l("common.requestPendingScreen.title"),e[3]=l,e[4]=a):a=e[4];let o;e[5]!==a?(o=n.jsx("h3",{className:"text-lg font-medium",children:a}),e[5]=a,e[6]=o):o=e[6];let d;e[7]!==s||e[8]!==l?(d=l("common.requestPendingScreen.description",{orgName:s}),e[7]=s,e[8]=l,e[9]=d):d=e[9];let f;e[10]!==d?(f=n.jsx("p",{className:"text-sm text-muted-foreground",children:d}),e[10]=d,e[11]=f):f=e[11];let y;e[12]!==o||e[13]!==f?(y=n.jsxs("div",{className:"space-y-2",children:[o,f]}),e[12]=o,e[13]=f,e[14]=y):y=e[14];let c;e[15]!==l?(c=l("common.requestPendingScreen.goHome"),e[15]=l,e[16]=c):c=e[16];let v;e[17]!==c?(v=n.jsx($,{variant:"ghost",onClick:Ct,children:c}),e[17]=c,e[18]=v):v=e[18];let m;return e[19]!==r||e[20]!==y||e[21]!==v?(m=n.jsxs(ee,{children:[r,y,v]}),e[19]=r,e[20]=y,e[21]=v,e[22]=m):m=e[22],m}function Ct(){window.location.href="/"}function Et(t){const e=D.c(45),{orgName:s,orgSlug:i,orgLogo:l,domain:r}=t,a=U();let o;e[0]!==i?(o=async()=>{const _=await fetch("/api/auth/custom/domain-request-join",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationSlug:i})}),k=await _.json();if(!_.ok||!k.success)throw new Error(k.error??"Failed to request access");return k},e[0]=i,e[1]=o):o=e[1];let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=It,e[2]=d):d=e[2];let f;e[3]!==a?(f=_=>{te.error(_ instanceof Error?_.message:a("common.requestToJoinScreen.failedToRequest"))},e[3]=a,e[4]=f):f=e[4];let y;e[5]!==o||e[6]!==f?(y={mutationFn:o,onSuccess:d,onError:f},e[5]=o,e[6]=f,e[7]=y):y=e[7];const c=ne(y);let v;e[8]!==l||e[9]!==s?(v=l?n.jsx(de,{url:l,fallback:s.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(Te,{className:"h-6 w-6 text-primary"})}),e[8]=l,e[9]=s,e[10]=v):v=e[10];let m;e[11]!==s||e[12]!==a?(m=a("common.requestToJoinScreen.title",{orgName:s}),e[11]=s,e[12]=a,e[13]=m):m=e[13];let u;e[14]!==m?(u=n.jsx("h3",{className:"text-lg font-medium",children:m}),e[14]=m,e[15]=u):u=e[15];let p;e[16]!==r||e[17]!==a?(p=a("common.requestToJoinScreen.description",{domain:r}),e[16]=r,e[17]=a,e[18]=p):p=e[18];let g;e[19]!==p?(g=n.jsx("p",{className:"text-sm text-muted-foreground",children:p}),e[19]=p,e[20]=g):g=e[20];let h;e[21]!==u||e[22]!==g?(h=n.jsxs("div",{className:"space-y-2",children:[u,g]}),e[21]=u,e[22]=g,e[23]=h):h=e[23];let w;e[24]!==c?(w=()=>c.mutate(),e[24]=c,e[25]=w):w=e[25];let x;e[26]!==c.isPending||e[27]!==a?(x=c.isPending?a("common.requestToJoinScreen.requesting"):a("common.requestToJoinScreen.requestButton"),e[26]=c.isPending,e[27]=a,e[28]=x):x=e[28];let S;e[29]!==c.isPending||e[30]!==w||e[31]!==x?(S=n.jsx($,{onClick:w,disabled:c.isPending,children:x}),e[29]=c.isPending,e[30]=w,e[31]=x,e[32]=S):S=e[32];const N=c.isPending;let j;e[33]!==a?(j=a("common.requestToJoinScreen.goToHome"),e[33]=a,e[34]=j):j=e[34];let A;e[35]!==c.isPending||e[36]!==j?(A=n.jsx($,{variant:"ghost",onClick:Lt,disabled:N,children:j}),e[35]=c.isPending,e[36]=j,e[37]=A):A=e[37];let b;e[38]!==S||e[39]!==A?(b=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[S,A]}),e[38]=S,e[39]=A,e[40]=b):b=e[40];let T;return e[41]!==h||e[42]!==b||e[43]!==v?(T=n.jsxs(ee,{children:[v,h,b]}),e[41]=h,e[42]=b,e[43]=v,e[44]=T):T=e[44],T}function Lt(){window.location.href="/"}function It(t){if(t.alreadyMember&&t.slug){window.location.href=`/${t.slug}`;return}window.location.reload()}function Pt(t){const e=D.c(7);let s;e[0]!==t?(s=ce.orgAccessStatus(t),e[0]=t,e[1]=s):s=e[1];let i;e[2]!==t?(i=async()=>{const r=await fetch(`/api/auth/custom/org-access-status/${encodeURIComponent(t)}`,{credentials:"include"});if(!r.ok)throw new Error(`org-access-status failed (${r.status})`);return await r.json()},e[2]=t,e[3]=i):i=e[3];let l;return e[4]!==s||e[5]!==i?(l={queryKey:s,queryFn:i,refetchOnWindowFocus:!1},e[4]=s,e[5]=i,e[6]=l):l=e[6],Ae(l)}function Dt({orgSlug:t}){const{data:e}=Pt(t);if(e.status!=="member"){Be()?.org===t&&Ue();const s=localStorage.getItem(X.lastOrgSlug())===t;if(s&&localStorage.removeItem(X.lastOrgSlug()),s&&(e.status==="not-found"||e.status==="no-access"))return window.location.href="/",null}return e.status==="not-found"?n.jsx(Se,{orgSlug:t,reason:"not-found"}):e.status==="pending-invite"?n.jsx(Tt,{invitationId:e.invitation.id,orgName:e.organization.name,orgSlug:e.organization.slug,orgLogo:e.organization.logo}):e.status==="auto-domain-join"?n.jsx(Nt,{orgName:e.organization.name,orgSlug:e.organization.slug,orgLogo:e.organization.logo,domain:e.organization.domain??""}):e.status==="can-request"?n.jsx(Et,{orgName:e.organization.name,orgSlug:e.organization.slug,orgLogo:e.organization.logo,domain:e.organization.domain??""}):e.status==="request-pending"?n.jsx(Ot,{orgName:e.organization.name,orgLogo:e.organization.logo}):e.status==="member"?(window.location.reload(),null):n.jsx(Se,{orgSlug:t,orgName:e.organization.name,reason:"no-access"})}function Ie(t){const e=D.c(42),{ariaLabel:s,dismissLabel:i,eyebrow:l,title:r,description:a,icon:o,children:d,footerLeading:f,actions:y,onDismiss:c,tone:v}=t,m=v===void 0?"neutral":v,u=f||y;let p;e[0]!==m?(p=m==="system"&&n.jsx("div",{className:"h-0.5 bg-special"}),e[0]=m,e[1]=p):p=e[1];let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(mt,{size:14}),e[2]=g):g=e[2];let h;e[3]!==i||e[4]!==c?(h=n.jsx($,{size:"icon-sm",variant:"ghost","aria-label":i,className:"absolute right-2 top-2 z-10 text-muted-foreground",onClick:c,children:g}),e[3]=i,e[4]=c,e[5]=h):h=e[5];const w=o&&"flex items-start gap-3",x=d&&"pb-3";let S;e[6]!==w||e[7]!==x?(S=ue("p-4 pr-11",w,x),e[6]=w,e[7]=x,e[8]=S):S=e[8];let N;e[9]!==o?(N=o&&n.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-special/10 text-special",children:o}),e[9]=o,e[10]=N):N=e[10];let j;e[11]!==l?(j=l&&n.jsx("p",{className:"text-xs text-muted-foreground",children:l}),e[11]=l,e[12]=j):j=e[12];let A;e[13]!==r?(A=n.jsx("h3",{className:"text-base font-semibold text-foreground",children:r}),e[13]=r,e[14]=A):A=e[14];let b;e[15]!==a?(b=a&&n.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:a}),e[15]=a,e[16]=b):b=e[16];let T;e[17]!==A||e[18]!==b||e[19]!==j?(T=n.jsxs("div",{children:[j,A,b]}),e[17]=A,e[18]=b,e[19]=j,e[20]=T):T=e[20];let _;e[21]!==d?(_=d&&n.jsx("div",{className:"mt-3",children:d}),e[21]=d,e[22]=_):_=e[22];let k;e[23]!==T||e[24]!==_?(k=n.jsxs("div",{className:"min-w-0 flex-1",children:[T,_]}),e[23]=T,e[24]=_,e[25]=k):k=e[25];let O;e[26]!==k||e[27]!==S||e[28]!==N?(O=n.jsxs("div",{className:S,children:[N,k]}),e[26]=k,e[27]=S,e[28]=N,e[29]=O):O=e[29];let L;e[30]!==y||e[31]!==f||e[32]!==u||e[33]!==m?(L=u&&n.jsxs("div",{className:ue("flex items-center justify-between gap-3 px-4 py-2.5",m==="system"?"border-t border-border bg-muted/50":"pt-0"),children:[n.jsx("div",{className:"min-w-0 text-xs text-muted-foreground",children:f}),n.jsx("div",{className:"flex shrink-0 items-center gap-2",children:y})]}),e[30]=y,e[31]=f,e[32]=u,e[33]=m,e[34]=L):L=e[34];let C;return e[35]!==s||e[36]!==O||e[37]!==L||e[38]!==p||e[39]!==h||e[40]!==m?(C=n.jsxs("div",{role:"dialog","aria-label":s,"data-slot":"announcement-card","data-tone":m,className:"relative w-full overflow-hidden rounded-lg border border-border bg-background shadow-lg animate-in fade-in slide-in-from-bottom-2 duration-300",children:[p,h,O,L]}),e[35]=s,e[36]=O,e[37]=L,e[38]=p,e[39]=h,e[40]=m,e[41]=C):C=e[41],C}const $t=[{id:"native-app-linux-beta",date:"2026-08-20",eyebrow:"Now Available",title:"Studio for Linux is now in beta",bullets:[{icon:xe,title:"Native Linux desktop app",body:"Studio now ships as an AppImage for 64-bit x86 Linux, bringing the local desktop workflow to Linux."},{icon:J,title:"Verified, no-root install",body:"The installer verifies the download, installs Studio to ~/.local/bin, and adds it to your application launcher without sudo."},{icon:K,title:"Beta today, broader support next",body:"We're validating more distributions and desktop environments. Arm builds are not available yet, and your feedback will shape general availability."}],cta:{label:"Install Studio",action:"download-app"},learnMoreHref:"https://github.com/decocms/studio/releases/tag/native-v4.242.0"},{id:"native-app-macos",date:"2026-07-30",eyebrow:"Now Available",title:"New beta studio app",bullets:[{icon:K,title:"Faster CMS previews",body:"Every draft gets its own git worktree on your machine, so previews render instantly as you edit."},{icon:H,title:"Native Claude Code & Codex support",body:"State-of-the-art coding agents, running natively against your local files."},{icon:dt,title:"Boosted performance",body:"Entirely rewritten in Rust with a smaller memory footprint than the Bun-based runtime — fast even on modest machines."},{icon:xe,title:"Apple Silicon only — Windows coming soon",body:"Today's builds target macOS on Apple Silicon; Windows is next."}],cta:{label:"Install on Mac",action:"download-app"},learnMoreHref:"https://github.com/decocms/studio/releases"},{id:"codex-gpt-5-6-defaults",date:"2026-07-13",eyebrow:"Now Available",title:"Codex defaults move to GPT-5.6",bullets:[{icon:H,title:"Sol leads Thinking",body:"Codex Thinking now defaults to `gpt-5.6-sol` for deeper coding and reasoning work."},{icon:J,title:"Terra balances Smart",body:"The Smart tier now uses `gpt-5.6-terra`, replacing GPT-5.4 as the default balanced Codex model."},{icon:K,title:"Luna speeds up Fast",body:"The Fast tier and lightweight Codex title generation now use `gpt-5.6-luna`. Existing threads that reference older GPT-5.4 or GPT-5.5 model IDs remain supported."}]},{id:"claude-sonnet-5",date:"2026-06-30",eyebrow:"Now Available",title:"Claude Sonnet 5 powers the Smart tier",bullets:[{icon:H,title:"More agentic coding",body:"Sonnet 5 is Anthropic's strongest Sonnet model yet, with improved reasoning, tool use, coding, and knowledge work compared with Sonnet 4.6."},{icon:J,title:"Available in Claude Code",body:"The Claude Code harness now pins the Smart tier to the new `claude-sonnet-5` model id so new sessions use Sonnet 5 by default."},{icon:K,title:"Nothing to change",body:"Existing Smart-tier chats and agents pick up Sonnet 5 automatically. Thinking remains on Opus 4.8 1M."}],learnMoreHref:"https://www.anthropic.com/news/claude-sonnet-5"},{id:"fable-5-suspension",date:"2026-06-13",eyebrow:"Important Update",title:"Fable 5 & Mythos 5 suspended — Opus 4.8 takes over",bullets:[{icon:J,title:"US government directive",body:"Anthropic received an export control directive requiring the suspension of Fable 5 and Mythos 5 access for all users, citing national security concerns. Anthropic is complying while it works to resolve the matter."},{icon:H,title:"Opus 4.8 steps in as the Thinking tier",body:"The Thinking tier now runs on Claude Opus 4.8, which remains fully operational. Performance on most tasks is comparable, and Anthropic reports more than 95% of sessions were unaffected by the Fable 5 classifiers anyway."},{icon:K,title:"Nothing to change",body:"The switch is automatic — any chat or agent already using the Thinking tier is now served by Opus 4.8. Anthropic will share further details within 24 hours."}],learnMoreHref:"https://www.anthropic.com/news/fable-mythos-access"},{id:"claude-fable-5",date:"2026-06-09",eyebrow:"Now Available",title:"Claude Fable 5 leads the Thinking tier",bullets:[{icon:H,title:"State-of-the-art reasoning",body:"Fable 5 takes the Thinking tier, posting top scores across software engineering, knowledge work, and vision — and outperforming Opus 4.8 on nearly every benchmark Anthropic tested."},{icon:J,title:"Safety without the slowdown",body:"New classifiers route the small slice of high-risk requests (cybersecurity, bio/chem) back to Opus 4.8. Anthropic reports more than 95% of sessions never trigger a fallback."},{icon:K,title:"Nothing to change",body:"Chats and agents pick up Fable 5 automatically wherever the Thinking tier is selected. Opus 4.8 stays available as the safety fallback."}],learnMoreHref:"https://www.anthropic.com/news/claude-fable-5-mythos-5"},{id:"claude-opus-4-8",date:"2026-05-28",eyebrow:"Now Available",title:"Claude Opus 4.8 is the new default",bullets:[{icon:H,title:"Smarter thinking, same price",body:"Opus 4.8 now leads the Thinking and Smarter tiers, outperforming Opus 4.7 on coding, reasoning, and agent tasks at the same cost."},{icon:J,title:"More honest answers",body:"It's about 4× less likely to let a code flaw slip through unflagged, and surfaces uncertainty instead of making unsupported claims."},{icon:K,title:"Nothing to change",body:"Chats and agents pick up Opus 4.8 automatically wherever the Thinking or Smarter tier is selected."}],learnMoreHref:"https://www.anthropic.com/news/claude-opus-4-8"},{id:"enhanced-sidebar",date:"2026-05-28",eyebrow:"Now Available",title:"Enhanced sidebar",bullets:[{icon:H,title:"A clearer view of what's running",body:"See every task in your organization at a glance, with each agent and status group laid out so you can spot active work without hunting for it."},{icon:ye,title:"Browse one group at a time",body:"Expand the groups you care about and pull in more results on demand — no more endless scrolling to find an older conversation."},{icon:J,title:"Polished and steadier",body:"Several sidebar bugs are fixed, including empty agent groups showing the right action and status filters returning the right tasks."}]},{id:"smarter-task-delegation",date:"2026-05-27",eyebrow:"Now Available",title:"Smarter task delegation",bullets:[{icon:at,title:"Real results from delegated agents",body:"When one agent hands work to another, you'll see the full report inline — no more empty replies hiding the work that was done."},{icon:K,title:"Same powers, top to bottom",body:"Delegated agents now work with the same tools, context, and memory as the agent that called them, so complex multi-agent investigations finish on the first try."},{icon:J,title:"Clearer progress signals",body:"When a delegated task hits its limit or runs into a problem, you get a plain-language message instead of a silent stall."}]},{id:"sidebar-task-groups",date:"2026-05-27",eyebrow:"Now Available",title:"Redesigned sidebar",bullets:[{icon:H,title:"Group by agent or status",body:"Switch the task list between grouping by agent or by status — pick whichever matches how you're working right now."},{icon:ye,title:"Sharper filters",body:"Narrow the list to your tasks, manual chats, or automations from a compact filter row above the groups."}]},{id:"release-channel",date:"2026-05-26",eyebrow:"Now Available",title:"Release announcements",bullets:[{icon:H,title:"Heads-up when features ship",body:"New releases surface in a corner card the first time you see them, then stick around in your inbox."},{icon:ut,title:"Unified inbox",body:"Org invitations and product updates now share one chronological feed in the sidebar."}]}],Pe=$t,le="studio.release-feed.v1",me=new Set;let W="",V={},fe=!1;function Mt(){if(fe)return W||"{}";try{return localStorage.getItem(le)??"{}"}catch{return W||"{}"}}function De(t){try{const e=JSON.parse(t);return e&&typeof e=="object"?e:{}}catch{return{}}}function ve(){const t=Mt();return t!==W&&(W=t,V=De(t)),V}function zt(t){me.add(t);const e=s=>{if(!(s.key!==le&&s.key!==null)){try{const i=localStorage.getItem(le)??"{}",r={...De(i),...V};V=r,W=JSON.stringify(r)}catch{}t()}};return window.addEventListener("storage",e),()=>{me.delete(t),window.removeEventListener("storage",e)}}function Ft(t){V=t,W=JSON.stringify(t);try{localStorage.setItem(le,W),fe=!1}catch{fe=!0}me.forEach(e=>e())}function Rt(){const t=D.c(7),e=B.useSyncExternalStore(zt,ve,ve);let s;t[0]!==e?(s=d=>!!e[d],t[0]=e,t[1]=s):s=t[1];const i=s,l=qt;let r;t[2]!==e?(r=Pe.reduce((d,f)=>e[f.id]?d:d+1,0),t[2]=e,t[3]=r):r=t[3];const a=r;let o;return t[4]!==i||t[5]!==a?(o={isSeen:i,markSeen:l,unseenCount:a},t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function qt(t){V[t]||Ft({...V,[t]:{seenAt:new Date().toISOString()}})}const Bt=720*60*60*1e3,Ut=10080*60*1e3;function Ht(t){const[e,s,i]=t.split("-").map(Number);return!e||!s||!i?new Date(t).getTime():new Date(e,s-1,i).getTime()}function Jt(t){const e=Pe[0];if(!e)return null;const s=Ht(e.date),i=t-s;return i<0||i>Bt?null:e}function Kt(t){if(t instanceof Date)return t.getTime();if(typeof t=="string"||typeof t=="number"){const e=new Date(t).getTime();return Number.isFinite(e)?e:null}return null}function Gt(t,e){const s=Kt(t);return s===null?!1:e-s>=Ut}function Wt(){const t=D.c(41),e=U(),{data:s}=Z.useSession(),{isSeen:i,markSeen:l}=Rt(),[r,a]=B.useState(!1);let o,d,f;if(t[0]!==i||t[1]!==s?.user?.createdAt){f=Symbol.for("react.early_return_sentinel");e:{const j=Date.now();if(o=Jt(j),!o){f=null;break e}if(!Gt(s?.user?.createdAt,j)){f=null;break e}d=i(o.id)}t[0]=i,t[1]=s?.user?.createdAt,t[2]=o,t[3]=d,t[4]=f}else o=t[2],d=t[3],f=t[4];if(f!==Symbol.for("react.early_return_sentinel"))return f;if(d)return null;let y;t[5]!==e?(y=e("announcements.release.ariaLabel"),t[5]=e,t[6]=y):y=t[6];let c;t[7]!==e?(c=e("announcements.release.dismiss"),t[7]=e,t[8]=c):c=t[8];const v=o.eyebrow,m=o.title;let u;t[9]!==o.id||t[10]!==l?(u=()=>l(o.id),t[9]=o.id,t[10]=l,t[11]=u):u=t[11];let p;t[12]!==o.id||t[13]!==o.learnMoreHref||t[14]!==l||t[15]!==e?(p=o.learnMoreHref?n.jsx("a",{href:o.learnMoreHref,target:"_blank",rel:"noreferrer",onClick:()=>l(o.id),className:"underline-offset-2 hover:text-foreground hover:underline",children:e("announcements.release.learnMore")}):null,t[12]=o.id,t[13]=o.learnMoreHref,t[14]=l,t[15]=e,t[16]=p):p=t[16];let g;t[17]!==o.cta||t[18]!==o.id||t[19]!==l?(g=o.cta?"href"in o.cta?n.jsx($,{asChild:!0,size:"sm",onClick:()=>l(o.id),children:n.jsx("a",{href:o.cta.href,children:o.cta.label})}):n.jsx($,{size:"sm",onClick:()=>a(!0),children:o.cta.label}):null,t[17]=o.cta,t[18]=o.id,t[19]=l,t[20]=g):g=t[20];let h;t[21]!==o.bullets?(h=o.bullets.map(Vt),t[21]=o.bullets,t[22]=h):h=t[22];let w;t[23]!==h?(w=n.jsx("ul",{className:"flex flex-col gap-3",children:h}),t[23]=h,t[24]=w):w=t[24];let x;t[25]!==o.id||t[26]!==l?(x=j=>{a(j),j||l(o.id)},t[25]=o.id,t[26]=l,t[27]=x):x=t[27];let S;t[28]!==r||t[29]!==x?(S=n.jsx(ft,{open:r,onOpenChange:x}),t[28]=r,t[29]=x,t[30]=S):S=t[30];let N;return t[31]!==o.eyebrow||t[32]!==o.title||t[33]!==w||t[34]!==S||t[35]!==y||t[36]!==c||t[37]!==u||t[38]!==p||t[39]!==g?(N=n.jsxs(Ie,{ariaLabel:y,dismissLabel:c,eyebrow:v,title:m,onDismiss:u,footerLeading:p,actions:g,children:[w,S]}),t[31]=o.eyebrow,t[32]=o.title,t[33]=w,t[34]=S,t[35]=y,t[36]=c,t[37]=u,t[38]=p,t[39]=g,t[40]=N):N=t[40],N}function Vt(t,e){return n.jsxs("li",{className:"flex items-start gap-3",children:[n.jsx(t.icon,{size:20,className:"mt-0.5 shrink-0 text-muted-foreground"}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("p",{className:"text-sm font-medium text-foreground",children:t.title}),n.jsx("p",{className:"text-xs text-muted-foreground",children:t.body})]})]},e)}const $e=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform),G=$e?"⌘":"Ctrl",F={keyboardShortcuts:{keys:[G,"K"],description:"Keyboard shortcuts"},back:{keys:[G,"["],description:"Back to previous"},focusChatInput:{keys:[G,"L"],description:"Focus chat input"},saveAndFormat:{keys:[G,"S"],description:"Save & format"},sendMessage:{keys:["Enter"],description:"Send message"},newLine:{keys:["Shift","Enter"],description:"New line"},selectOption:{keys:["1-9"],description:"Select option"},applyFilter:{keys:[G,"Enter"],description:"Apply filter"},togglePlanMode:{keys:[G,"Shift","L"],description:"Toggle plan mode"},newTask:{keys:["Shift",G,"S"],description:"New task"},toggleDaemon:{keys:[G,"D"],description:"Toggle daemon logs"}},Qt=[{label:"General",shortcuts:[F.keyboardShortcuts,F.back,F.newTask,F.toggleDaemon]},{label:"Editor",shortcuts:[F.saveAndFormat]},{label:"Chat",shortcuts:[F.focusChatInput,F.togglePlanMode,F.sendMessage,F.newLine]},{label:"Questions",shortcuts:[F.selectOption]},{label:"Monitoring",shortcuts:[F.applyFilter]}];function je(t){return $e?t.metaKey:t.ctrlKey}function Yt(t){const e=D.c(11),{open:s,onOpenChange:i}=t,l=U();let r;e[0]!==l?(r=l("common.keyboardShortcutsDialog.title"),e[0]=l,e[1]=r):r=e[1];let a;e[2]!==r?(a=n.jsx(Oe,{children:n.jsx(Ce,{children:r})}),e[2]=r,e[3]=a):a=e[3];let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("div",{className:"flex flex-col gap-4",children:Qt.map(Xt)}),e[4]=o):o=e[4];let d;e[5]!==a?(d=n.jsxs(Ee,{className:"sm:max-w-md",children:[a,o]}),e[5]=a,e[6]=d):d=e[6];let f;return e[7]!==i||e[8]!==s||e[9]!==d?(f=n.jsx(Le,{open:s,onOpenChange:i,children:d}),e[7]=i,e[8]=s,e[9]=d,e[10]=f):f=e[10],f}function Xt(t){return n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-2",children:t.label}),n.jsx("div",{className:"flex flex-col gap-1.5",children:t.shortcuts.map(Zt)})]},t.label)}function Zt(t){return n.jsxs("div",{className:"flex items-center justify-between py-1",children:[n.jsx("span",{className:"text-sm",children:t.description}),n.jsx("div",{className:"flex items-center gap-1",children:t.keys.map(en)})]},t.description)}function en(t){return n.jsx("kbd",{className:"inline-flex items-center justify-center min-w-6 h-6 px-1.5 rounded-sm border border-border bg-muted text-muted-foreground text-xs font-mono",children:t},t)}const tn=300*1e3,nn=2;function sn(t,e,s){return!e||e===s?{version:null,count:0}:t.version===e?{version:e,count:t.count+1}:{version:e,count:1}}function on(t,e){return t.count>=nn&&t.version!==null&&t.version!==e}function an(){const t=D.c(43),e=U(),s=yt();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={mutationFn:ln},t[0]=i):i=t[0];const l=ne(i);let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r={queryKey:ce.appVersionCheck(),queryFn:rn,refetchInterval:tn,refetchIntervalInBackground:!0,staleTime:0},t[1]=r):r=t[1];const{data:a,dataUpdatedAt:o}=re(r),[d,f]=B.useState(0);let y;t[2]===Symbol.for("react.memo_cache_sentinel")?(y={version:null,count:0},t[2]=y):y=t[2];const[c,v]=B.useState(y);o!==d&&(f(o),v(R=>sn(R,a,"4.246.2")));const[m,u]=B.useState(null),p=s;let g;t[3]!==s||t[4]!==l?(g=()=>window.location.reload(),t[3]=s,t[4]=l,t[5]=g):g=t[5];const h=g,w="announcements.version.refresh";if(!on(c,m))return null;let x;t[6]!==e?(x=e("announcements.version.ariaLabel"),t[6]=e,t[7]=x):x=t[7];let S;t[8]!==e?(S=e("announcements.version.dismiss"),t[8]=e,t[9]=S):S=t[9];let N;t[10]!==e?(N=e("announcements.version.eyebrow"),t[10]=e,t[11]=N):N=t[11];let j;t[12]!==e?(j=e("announcements.version.title"),t[12]=e,t[13]=j):j=t[13];const A="announcements.version.description";let b;t[14]!==e||t[15]!==A?(b=e(A),t[14]=e,t[15]=A,t[16]=b):b=t[16];let T;t[17]===Symbol.for("react.memo_cache_sentinel")?(T=n.jsx(he,{size:16}),t[17]=T):T=t[17];let _;t[18]!==c.version?(_=()=>u(c.version),t[18]=c.version,t[19]=_):_=t[19];let k;t[20]!==e?(k=e("announcements.version.currentSession",{version:"4.246.2"}),t[20]=e,t[21]=k):k=t[21];let O;t[22]!==w||t[23]!==e?(O=e(w),t[22]=w,t[23]=e,t[24]=O):O=t[24];const L=p;let C;t[25]!==L?(C=ue(L),t[25]=L,t[26]=C):C=t[26];let P;t[27]!==C?(P=n.jsx(he,{size:14,className:C}),t[27]=C,t[28]=P):P=t[28];let E;t[29]!==h||t[30]!==p||t[31]!==O||t[32]!==P?(E=n.jsxs($,{size:"sm",disabled:p,onClick:h,children:[O,P]}),t[29]=h,t[30]=p,t[31]=O,t[32]=P,t[33]=E):E=t[33];let z;return t[34]!==_||t[35]!==k||t[36]!==E||t[37]!==x||t[38]!==S||t[39]!==N||t[40]!==j||t[41]!==b?(z=n.jsx(Ie,{ariaLabel:x,dismissLabel:S,eyebrow:N,title:j,description:b,icon:T,tone:"system",onDismiss:_,footerLeading:k,actions:E}),t[34]=_,t[35]=k,t[36]=E,t[37]=x,t[38]=S,t[39]=N,t[40]=j,t[41]=b,t[42]=z):z=t[42],z}async function rn(){const t=await fetch("/api/config",{cache:"no-store"}),{config:e}=await t.json();return e.version}async function ln(){const t=await fetch("/_local/update/restart",{method:"POST"});if(!t.ok)throw new Error(`restart failed: ${t.status}`)}function cn(t){return{has(){try{return localStorage.getItem(t)==="1"}catch{return!1}},mark(){try{localStorage.setItem(t,"1")}catch{}}}}const dn=Date.parse("2026-07-21T00:00:00Z"),ke=t=>cn(X.ptBrAnnouncementSeen(t));function un(){const t=D.c(35),e=U(),[s,i]=He(),{data:l,isPending:r}=Z.useSession(),a=l?.user,o=a?.id,d=a?.createdAt,f=d!=null&&new Date(d).getTime()<dn,y=Je()==="pt-BR",c=!r&&!!o&&f&&y&&s.language==="en"&&!ke(o).has(),[v,m]=B.useState(!1),[u,p]=B.useState(!1);!v&&!r&&(m(!0),c&&o&&(ke(o).mark(),i(fn),p(!0),pe("pt_br_auto_switch_shown")));let g;t[0]===Symbol.for("react.memo_cache_sentinel")?(g=q=>{pe("pt_br_auto_switch_closed",{action:q}),p(!1)},t[0]=g):g=t[0];const h=g;let w;t[1]!==i?(w=()=>{i(mn),h("switch-back")},t[1]=i,t[2]=w):w=t[2];const x=w;let S;t[3]===Symbol.for("react.memo_cache_sentinel")?(S=q=>!q&&h("dismiss"),t[3]=S):S=t[3];let N;t[4]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx("div",{className:"text-4xl","aria-hidden":"true",children:"🇧🇷"}),t[4]=N):N=t[4];let j;t[5]!==e?(j=e("announcements.ptBr.title"),t[5]=e,t[6]=j):j=t[6];let A;t[7]!==j?(A=n.jsx(Ce,{children:j}),t[7]=j,t[8]=A):A=t[8];let b;t[9]!==e?(b=e("announcements.ptBr.description"),t[9]=e,t[10]=b):b=t[10];let T;t[11]!==b?(T=n.jsx(pt,{children:b}),t[11]=b,t[12]=T):T=t[12];let _;t[13]!==A||t[14]!==T?(_=n.jsxs(Oe,{children:[A,T]}),t[13]=A,t[14]=T,t[15]=_):_=t[15];let k;t[16]!==e?(k=e("announcements.ptBr.switchBack"),t[16]=e,t[17]=k):k=t[17];let O;t[18]!==x||t[19]!==k?(O=n.jsx($,{variant:"outline",onClick:x,children:k}),t[18]=x,t[19]=k,t[20]=O):O=t[20];let L;t[21]===Symbol.for("react.memo_cache_sentinel")?(L=()=>h("ok"),t[21]=L):L=t[21];let C;t[22]!==e?(C=e("announcements.ptBr.ok"),t[22]=e,t[23]=C):C=t[23];let P;t[24]!==C?(P=n.jsx($,{onClick:L,children:C}),t[24]=C,t[25]=P):P=t[25];let E;t[26]!==O||t[27]!==P?(E=n.jsxs(bt,{children:[O,P]}),t[26]=O,t[27]=P,t[28]=E):E=t[28];let z;t[29]!==E||t[30]!==_?(z=n.jsxs(Ee,{className:"sm:max-w-md",children:[N,_,E]}),t[29]=E,t[30]=_,t[31]=z):z=t[31];let R;return t[32]!==u||t[33]!==z?(R=n.jsx(Le,{open:u,onOpenChange:S,children:z}),t[32]=u,t[33]=z,t[34]=R):R=t[34],R}function mn(t){return{...t,language:"en"}}function fn(t){return{...t,language:"pt-BR"}}function gn(t){const e=Ke(t);return typeof e=="string"?e:void 0}function hn(){return gn("experiment-pipeline-check"),null}function pn(t){const e=D.c(1),{activeOrg:s}=t;if(!s)return null;Ge(s.id,{name:s.name??void 0,slug:s.slug??void 0}),We();let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(hn,{}),e[0]=i):i=e[0],i}function bn(t){const{prev:e,virtualMcpId:s,decopilotId:i,savedLayout:l,opts:r,autosendValue:a}=t,o={};s?o.virtualmcpid=s:e.virtualmcpid&&(o.virtualmcpid=e.virtualmcpid);const d=typeof e.virtualmcpid=="string"?e.virtualmcpid:i,y=(s??d)!==d;let c;if(r?.main)o.main=r.main;else if(l)l.main!==void 0&&(o.main=l.main),l.sidepanel!==void 0&&(c=l.sidepanel);else if(!y){const v=e.main;v&&typeof v=="string"&&!gt(v)&&(o.main=v)}return c!==void 0&&(o.sidepanel=c),r?.autosend&&(o.autosend=a),o}const Me="studio:thread-layout:v1",yn=50;function ze(t){const e={};return(t.main===0||typeof t.main=="string")&&(e.main=t.main),(t.sidepanel===0||t.sidepanel==="chat")&&(e.sidepanel=t.sidepanel),e}function xn(t,e,s,i=yn){const l=t.filter(([r])=>r!==e);for(l.push([e,ze(s)]);l.length>i;)l.shift();return l}function ge(){try{const t=sessionStorage.getItem(Me);if(!t)return[];const e=JSON.parse(t);return Array.isArray(e)?e.filter(s=>Array.isArray(s)&&s.length===2&&typeof s[0]=="string"):[]}catch{return[]}}function Fe(t){try{sessionStorage.setItem(Me,JSON.stringify(t))}catch{}}function wn(t,e){t&&Fe(xn(ge(),t,e))}function Sn(t){if(!t)return null;const e=ge().find(([s])=>s===t);return e?ze(e[1]):null}function Gn(t){if(!t)return;const e=ge(),s=e.filter(([i])=>i!==t);s.length!==e.length&&Fe(s)}function Re(t){return{queryKey:ce.homeNextActions(t),queryFn:async()=>{const e=await fetch(`/api/${t}/home-next-actions`,{cache:"no-store"});if(!e.ok)throw new Error("Failed to load home next actions");return await e.json()},staleTime:0,refetchOnWindowFocus:"always"}}function Wn(t){const e=D.c(10);let s;e[0]!==t?(s=Re(t),e[0]=t,e[1]=s):s=e[1];const i=re(s);let l;e[2]!==i.data?.prompts?(l=i.data?.prompts??[],e[2]=i.data?.prompts,e[3]=l):l=e[3];let r;e[4]!==i.data?.tiles?(r=i.data?.tiles??[],e[4]=i.data?.tiles,e[5]=r):r=e[5];let a;return e[6]!==i.isLoading||e[7]!==l||e[8]!==r?(a={isLoading:i.isLoading,prompts:l,tiles:r},e[6]=i.isLoading,e[7]=l,e[8]=r,e[9]=a):a=e[9],a}function vn(t){const e=D.c(31),{orgSlug:s,orgName:i,domain:l}=t,r=U();let a;e[0]!==s?(a=()=>{window.location.href=`/api/${encodeURIComponent(s)}/sso/authorize`},e[0]=s,e[1]=a):a=e[1];const o=a,d=jn;let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(Ne,{className:"h-6 w-6 text-primary"})}),e[2]=f):f=e[2];let y;e[3]!==r?(y=r("common.ssoRequiredScreen.title"),e[3]=r,e[4]=y):y=e[4];let c;e[5]!==y?(c=n.jsx("h3",{className:"text-lg font-medium",children:y}),e[5]=y,e[6]=c):c=e[6];let v;e[7]!==l||e[8]!==i||e[9]!==r?(v=i?n.jsxs(n.Fragment,{children:[n.jsx("strong",{children:i})," ",r("common.ssoRequiredScreen.requiresSsoAuth"),l?` ${r("common.ssoRequiredScreen.via",{domain:l})}`:"","."]}):r("common.ssoRequiredScreen.orgRequiresSsoAuth"),e[7]=l,e[8]=i,e[9]=r,e[10]=v):v=e[10];let m;e[11]!==v?(m=n.jsx("p",{className:"text-sm text-muted-foreground",children:v}),e[11]=v,e[12]=m):m=e[12];let u;e[13]!==c||e[14]!==m?(u=n.jsxs("div",{className:"space-y-2",children:[c,m]}),e[13]=c,e[14]=m,e[15]=u):u=e[15];let p;e[16]!==r?(p=r("common.ssoRequiredScreen.signInWithSso"),e[16]=r,e[17]=p):p=e[17];let g;e[18]!==o||e[19]!==p?(g=n.jsx($,{onClick:o,children:p}),e[18]=o,e[19]=p,e[20]=g):g=e[20];let h;e[21]!==r?(h=r("common.ssoRequiredScreen.goBack"),e[21]=r,e[22]=h):h=e[22];let w;e[23]!==h?(w=n.jsx($,{variant:"ghost",onClick:d,children:h}),e[23]=h,e[24]=w):w=e[24];let x;e[25]!==w||e[26]!==g?(x=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[g,w]}),e[25]=w,e[26]=g,e[27]=x):x=e[27];let S;return e[28]!==x||e[29]!==u?(S=n.jsxs(ee,{children:[f,u,x]}),e[28]=x,e[29]=u,e[30]=S):S=e[30],S}function jn(){window.location.href="/"}function kn(t){const e=D.c(8),{org:s,children:i}=t,r=jt(s.id,s.slug)?.enabled_plugins??null;let a;e[0]!==s.id||e[1]!==s.name||e[2]!==r?(a={id:s.id,organizationId:s.id,slug:"_org",name:s.name,enabledPlugins:r,ui:null},e[0]=s.id,e[1]=s.name,e[2]=r,e[3]=a):a=e[3];const o=a;let d;return e[4]!==i||e[5]!==s||e[6]!==o?(d=n.jsx(it,{org:s,project:o,children:i}),e[4]=i,e[5]=s,e[6]=o,e[7]=d):d=e[7],d}function Nn(){const t=Ve(),e=vt(),{org:s}=Qe(),i=_e({strict:!1}),l=Ye({strict:!1}),r=i.org??"",a=i.taskId??"",o=(m,u,p=!0)=>t({to:"/$org/$taskId",params:{org:r,taskId:m},search:u,replace:p}),d=(m,u=!0)=>o(a,m,u),f=m=>d(u=>({...u,sidepanel:m})),y=(m,u,p)=>{const g=!!a&&a===m;a&&!g&&wn(a,{main:l.main,sidepanel:l.sidepanel});const h=g?null:Sn(m),w=we(s.id).id;return o(m,x=>bn({prev:x,virtualMcpId:u,decopilotId:w,savedLayout:h,opts:p,autosendValue:ht}),!1)};return{openSidePanel:f,setTaskId:y,createNewTask:async(m,u,p)=>{const g=crypto.randomUUID(),h=m??l.virtualmcpid??we(s.id).id;try{await e?.create({id:g,virtual_mcp_id:h,...u?{branch:u}:{}})}catch{}y(g,h,p)},openTab:m=>o(a||crypto.randomUUID(),u=>({...u,main:m}))}}function An(){const t=D.c(53);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org",shouldThrow:!1},t[0]=e):e=t[0];const i=Xe(e)?.params.org;let l;t[1]===Symbol.for("react.memo_cache_sentinel")?(l={strict:!1},t[1]=l):l=t[1];const{taskId:r}=_e(l),[a,o]=B.useState(!1),d=Ze(),f=i??"";let y;t[2]!==f?(y=Re(f),t[2]=f,t[3]=y):y=t[3];const c=!!i&&!r;let v;t[4]!==y||t[5]!==c?(v={...y,enabled:c},t[4]=y,t[5]=c,t[6]=v):v=t[6],re(v);const{data:m}=Z.useSession(),u=m?.user?.id;let p;t[7]!==i||t[8]!==u?(p=i&&u?et(u,i):null,t[7]=i,t[8]=u,t[9]=p):p=t[9];const g=p;let h,w;t[10]!==d?(h=()=>{const I=M=>{if(je(M)&&M.code==="KeyK"){M.preventDefault(),o(!0);return}je(M)&&M.code==="BracketLeft"&&d.history.canGoBack()&&(M.preventDefault(),d.history.back())};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},w=[d],t[10]=d,t[11]=h,t[12]=w):(h=t[11],w=t[12]),B.useEffect(h,w);let x;t[13]!==i?(x=ce.activeOrganization(i),t[13]=i,t[14]=x):x=t[14];let S;t[15]!==i||t[16]!==u?(S=async()=>{if(!i)return null;performance.mark("mesh:active-org-fetch:start");const{data:I}=await Z.organization.getFullOrganization({query:{organizationSlug:i}}).finally(_n),M=be(I);return I&&!M&&localStorage.setItem(X.lastOrgSlug(),i),u&&I&&nt(u,i,I),I},t[15]=i,t[16]=u,t[17]=S):S=t[17];const N=g?g.data:void 0,j=g?.updatedAt;let A;t[18]!==S||t[19]!==N||t[20]!==j||t[21]!==x?(A={queryKey:x,queryFn:S,initialData:N,initialDataUpdatedAt:j,gcTime:1/0,refetchOnWindowFocus:!1},t[18]=S,t[19]=N,t[20]=j,t[21]=x,t[22]=A):A=t[22];const{data:b}=Ae(A),T=b?.id,_=b?.slug,{data:k}=kt(T,_),O=T??"",L=_??"";let C;t[23]!==O||t[24]!==L?(C=wt({connectionId:St,orgId:O,orgSlug:L}),t[23]=O,t[24]=L,t[25]=C):C=t[25];const P=!!T&&!!_;let E;if(t[26]!==C||t[27]!==P?(E={...C,enabled:P},t[26]=C,t[27]=P,t[28]=E):E=t[28],re(E),!b){let I;t[29]===Symbol.for("react.memo_cache_sentinel")?(I=n.jsx(st,{}),t[29]=I):I=t[29];let M;return t[30]!==i?(M=n.jsx(B.Suspense,{fallback:I,children:n.jsx(Dt,{orgSlug:i})}),t[30]=i,t[31]=M):M=t[31],M}if(be(b)){localStorage.getItem(X.lastOrgSlug())===i&&localStorage.removeItem(X.lastOrgSlug());let I;return t[32]!==b.name?(I=n.jsx(tt,{orgName:b.name}),t[32]=b.name,t[33]=I):I=t[33],I}if(k?.ssoRequired&&!k.authenticated){let I;return t[34]!==b.id||t[35]!==b.name||t[36]!==b.slug||t[37]!==k.domain?(I=n.jsx(vn,{orgId:b.id,orgSlug:b.slug,orgName:b.name,domain:k.domain}),t[34]=b.id,t[35]=b.name,t[36]=b.slug,t[37]=k.domain,t[38]=I):I=t[38],I}const R=b.logo??null;let q;t[39]!==b||t[40]!==R?(q={...b,logo:R},t[39]=b,t[40]=R,t[41]=q):q=t[41];let Q;t[42]!==b?(Q=n.jsx(pn,{activeOrg:b}),t[42]=b,t[43]=Q):Q=t[43];let se;t[44]===Symbol.for("react.memo_cache_sentinel")?(se=n.jsx(ot,{}),t[44]=se):se=t[44];let oe;t[45]===Symbol.for("react.memo_cache_sentinel")?(oe=n.jsxs("div",{className:"fixed bottom-6 right-6 z-50 flex w-[min(360px,calc(100vw-3rem))] flex-col gap-3",children:[n.jsx(Wt,{}),n.jsx(an,{})]}),t[45]=oe):oe=t[45];let Y;t[46]!==a?(Y=n.jsx(Yt,{open:a,onOpenChange:o}),t[46]=a,t[47]=Y):Y=t[47];let ie;t[48]===Symbol.for("react.memo_cache_sentinel")?(ie=n.jsx(un,{}),t[48]=ie):ie=t[48];let ae;return t[49]!==q||t[50]!==Q||t[51]!==Y?(ae=n.jsxs(kn,{org:q,children:[Q,se,oe,Y,ie]}),t[49]=q,t[50]=Q,t[51]=Y,t[52]=ae):ae=t[52],ae}function _n(){performance.mark("mesh:active-org-fetch:end"),performance.measure("mesh:active-org-fetch","mesh:active-org-fetch:start","mesh:active-org-fetch:end")}function Tn(){const t=D.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(xt,{children:n.jsx(An,{})}),t[0]=e):e=t[0],e}const Vn=Object.freeze(Object.defineProperty({__proto__:null,default:Tn,usePanelActions:Nn},Symbol.toStringTag,{value:"Module"}));export{F as K,Wn as a,Gn as f,je as i,cn as m,Vn as s,Nn as u};
@@ -1 +0,0 @@
1
- import{c as J,b as Z,j as i,r as V,E as pe,F as ue,o as Se,B as X,d as xe,f as he,p as ae,K as ye,e as je,t as ge}from"./index-CacyxM-B.js";import{i as ve}from"./AlertCircle-DOZzh9F_.js";import{i as Ce}from"./ChevronRight-H-_IIqWd.js";import{s as be}from"./Plus-m61KPSTg.js";import{s as _e}from"./Trash01-BcRuo5Fe.js";import{I as re}from"./input-B8ln-0Wl.js";import{S as de}from"./switch-B0vh0spM.js";import{S as Re}from"./skeleton-DOg01VWn.js";import{A as me}from"./avatar-C448hZt-.js";import{P as ke,a as Ne,b as Pe}from"./popover-5hCe1k-b.js";import{b as fe}from"./use-connection-BS7_Pbag.js";import{W as ne}from"./use-mcp-client-DRcy9vk6.js";import{P as te}from"./index-GDSYOTBM.js";import{u as Te}from"./use-registry-connections-GX-tovow.js";import{l as we,m as Ae}from"./use-organization-settings-DJYuvv-k.js";import{c as ze,b as H,a as ie,S as le}from"./settings-section-Cz2znp8W.js";import{R as Ee}from"./require-capability-BDCw5l2l.js";import"./User01-D1UDDnNw.js";import"./auth-Dk3-oFE7.js";import"./sidebar-BDv_n64F.js";import"./LayoutLeft-BF7bmTAo.js";import"./use-mobile-c0ak1uw4.js";import"./X-VMfnK-j5.js";import"./tooltip-CwIq9zTG.js";import"./studio-tools-O0czolAT.js";import"./card-CG7VHdDz.js";import"./ArrowUpRight-CibKwsqg.js";import"./use-capability-D8TgIows.js";import"./access-gate-bmibgRvV.js";import"./capability-load-error-BPXMIbs3.js";function Me(t){const e=J.c(6),{error:l}=t,c=Z();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx(ve,{size:16}),e[0]=s):s=e[0];let o;e[1]!==c?(o=c("settings.orgStore.failedLoadStoreSettings"),e[1]=c,e[2]=o):o=e[2];let r;return e[3]!==l.message||e[4]!==o?(r=i.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[s,i.jsxs("span",{className:"text-sm font-medium",children:[o," ",l.message]})]}),e[3]=l.message,e[4]=o,e[5]=r):r=e[5],r}function $e(t){const e=J.c(74),{onCancel:l,onSuccess:c}=t,s=Z(),o=fe(),[r,u]=V.useState(""),[a,A]=V.useState(""),[S,_]=V.useState("");let j;e[0]!==o||e[1]!==r||e[2]!==s||e[3]!==S||e[4]!==a?(j=async()=>(await o.create.mutateAsync({title:r||s("settings.orgStore.privateRegistry"),description:s("settings.orgStore.privateMcpRegistry"),connection_type:"HTTP",connection_url:a,connection_token:S||null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{type:"registry"},app_name:null,app_id:null,icon:null})).id,e[0]=o,e[1]=r,e[2]=s,e[3]=S,e[4]=a,e[5]=j):j=e[5];let d;e[6]!==c||e[7]!==s?(d=y=>{ae("store_private_registry_added",{connection_id:y}),ge.success(s("settings.orgStore.privateRegistryAdded")),c(y)},e[6]=c,e[7]=s,e[8]=d):d=e[8];let x;e[9]!==s?(x=y=>{ge.error(s("settings.orgStore.failedAddRegistry",{error:y.message}))},e[9]=s,e[10]=x):x=e[10];let m;e[11]!==j||e[12]!==d||e[13]!==x?(m={mutationFn:j,onSuccess:d,onError:x},e[11]=j,e[12]=d,e[13]=x,e[14]=m):m=e[14];const{mutate:v,isPending:g}=je(m);let h;e[15]!==s?(h=s("settings.orgStore.nameLabel"),e[15]=s,e[16]=h):h=e[16];let f;e[17]!==s?(f=s("settings.orgStore.namePlaceholder"),e[17]=s,e[18]=f):f=e[18];let p;e[19]===Symbol.for("react.memo_cache_sentinel")?(p=y=>u(y.target.value),e[19]=p):p=e[19];let C;e[20]!==r||e[21]!==f?(C=i.jsx(re,{placeholder:f,value:r,onChange:p,className:"w-[280px]"}),e[20]=r,e[21]=f,e[22]=C):C=e[22];let R;e[23]!==h||e[24]!==C?(R=i.jsx(H,{title:h,action:C}),e[23]=h,e[24]=C,e[25]=R):R=e[25];let F;e[26]!==s?(F=s("settings.orgStore.registryUrlLabel"),e[26]=s,e[27]=F):F=e[27];let U;e[28]!==s?(U=s("settings.orgStore.registryUrlPlaceholder"),e[28]=s,e[29]=U):U=e[29];let q;e[30]===Symbol.for("react.memo_cache_sentinel")?(q=y=>A(y.target.value),e[30]=q):q=e[30];let B;e[31]!==U||e[32]!==a?(B=i.jsx(re,{placeholder:U,value:a,onChange:q,className:"w-[280px]"}),e[31]=U,e[32]=a,e[33]=B):B=e[33];let O;e[34]!==F||e[35]!==B?(O=i.jsx(H,{title:F,action:B}),e[34]=F,e[35]=B,e[36]=O):O=e[36];let z;e[37]!==s?(z=s("settings.orgStore.authTokenLabel"),e[37]=s,e[38]=z):z=e[38];let b;e[39]!==s?(b=s("settings.orgStore.optional"),e[39]=s,e[40]=b):b=e[40];let E;e[41]!==s?(E=s("settings.orgStore.authTokenPlaceholder"),e[41]=s,e[42]=E):E=e[42];let Y;e[43]===Symbol.for("react.memo_cache_sentinel")?(Y=y=>_(y.target.value),e[43]=Y):Y=e[43];let M;e[44]!==E||e[45]!==S?(M=i.jsx(re,{type:"password",placeholder:E,value:S,onChange:Y,className:"w-[280px]"}),e[44]=E,e[45]=S,e[46]=M):M=e[46];let I;e[47]!==z||e[48]!==b||e[49]!==M?(I=i.jsx(H,{title:z,description:b,action:M}),e[47]=z,e[48]=b,e[49]=M,e[50]=I):I=e[50];let k;e[51]!==s?(k=s("settings.orgStore.cancel"),e[51]=s,e[52]=k):k=e[52];let D;e[53]!==g||e[54]!==l||e[55]!==k?(D=i.jsx(X,{variant:"ghost",size:"sm",onClick:l,disabled:g,children:k}),e[53]=g,e[54]=l,e[55]=k,e[56]=D):D=e[56];let N;e[57]!==v?(N=()=>v(),e[57]=v,e[58]=N):N=e[58];const L=!a||g;let P;e[59]!==g||e[60]!==s?(P=s(g?"settings.orgStore.adding":"settings.orgStore.addRegistry"),e[59]=g,e[60]=s,e[61]=P):P=e[61];let T;e[62]!==N||e[63]!==L||e[64]!==P?(T=i.jsx(X,{size:"sm",onClick:N,disabled:L,children:P}),e[62]=N,e[63]=L,e[64]=P,e[65]=T):T=e[65];let w;e[66]!==D||e[67]!==T?(w=i.jsxs("div",{className:"px-5 py-4 flex justify-end gap-2",children:[D,T]}),e[66]=D,e[67]=T,e[68]=w):w=e[68];let $;return e[69]!==O||e[70]!==I||e[71]!==w||e[72]!==R?($=i.jsxs(ie,{children:[R,O,I,w]}),e[69]=O,e[70]=I,e[71]=w,e[72]=R,e[73]=$):$=e[73],$}function se(t){const e=J.c(30),{name:l,description:c,icon:s,enabled:o,onToggle:r,onDelete:u,href:a}=t,A=Z(),S=xe();let _;e[0]===Symbol.for("react.memo_cache_sentinel")?(_={from:"/shell/$org"},e[0]=_):_=e[0];const{org:j}=he(_);let d;e[1]!==o||e[2]!==a||e[3]!==S||e[4]!==r||e[5]!==j?(d=()=>{a?S({to:a,params:{org:j}}):r(!o)},e[1]=o,e[2]=a,e[3]=S,e[4]=r,e[5]=j,e[6]=d):d=e[6];const x=d;let m;e[7]!==s||e[8]!==l?(m=s?i.jsx("img",{src:s,alt:l,className:"size-8 rounded-md object-contain"}):i.jsx(me,{fallback:l.charAt(0),className:"size-8 bg-primary/10 text-primary"}),e[7]=s,e[8]=l,e[9]=m):m=e[9];let v;e[10]!==u||e[11]!==A?(v=u&&i.jsxs(ke,{children:[i.jsx(Ne,{asChild:!0,children:i.jsx(X,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:Ie,children:i.jsx(_e,{size:14})})}),i.jsx(Pe,{className:"w-auto p-2",align:"end",children:i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsx("p",{className:"text-xs font-medium",children:A("settings.orgStore.removeRegistry")}),i.jsx(X,{variant:"destructive",size:"xs",onClick:R=>{R.stopPropagation(),u()},children:A("settings.orgStore.remove")})]})})]}),e[10]=u,e[11]=A,e[12]=v):v=e[12];let g;e[13]!==r?(g=R=>r(R),e[13]=r,e[14]=g):g=e[14];let h;e[15]!==o||e[16]!==g?(h=i.jsx(de,{checked:o,onClick:Fe,onCheckedChange:g}),e[15]=o,e[16]=g,e[17]=h):h=e[17];let f;e[18]!==a?(f=a&&i.jsx(Ce,{size:14,className:"text-muted-foreground"}),e[18]=a,e[19]=f):f=e[19];let p;e[20]!==v||e[21]!==h||e[22]!==f?(p=i.jsxs("div",{className:"flex items-center gap-2",children:[v,h,f]}),e[20]=v,e[21]=h,e[22]=f,e[23]=p):p=e[23];let C;return e[24]!==c||e[25]!==x||e[26]!==l||e[27]!==m||e[28]!==p?(C=i.jsx(H,{title:l,description:c,onClick:x,icon:m,action:p}),e[24]=c,e[25]=x,e[26]=l,e[27]=m,e[28]=p,e[29]=C):C=e[29],C}function Fe(t){return t.stopPropagation()}function Ie(t){return t.stopPropagation()}function De(){const t=J.c(78),e=Z(),{org:l}=ue(),c=Te(),s=fe(),o=we(),{mutateAsync:r}=Ae(),u=Se(),[a,A]=V.useState(!1);let S,_,j,d,x,m;if(t[0]!==s||t[1]!==l.id||t[2]!==u||t[3]!==o||t[4]!==c||t[5]!==a||t[6]!==e||t[7]!==r){const f=ne.REGISTRY(l.id),p=n=>{if(!o)return n===f;const K=o.registries[n];return K?K.enabled:n===f},C=ne.COMMUNITY_REGISTRY(l.id),R=c.find(n=>n.id===f),F=c.find(n=>n.id===C||n.id==="community-registry"),U=F?.id??C,q=ne.SELF(l.id),B=new Set([f,C,"community-registry",q]),O=c.filter(n=>!B.has(n.id));let z;t[14]!==o||t[15]!==r?(z=async(n,K)=>{ae("store_registry_toggled",{connection_id:n,enabled:K});const ce=o??{registries:{},blockedMcps:[]};await r({...ce,registries:{...ce.registries,[n]:{enabled:K}}})},t[14]=o,t[15]=r,t[16]=z):z=t[16];const b=z;let E;t[17]!==s||t[18]!==l.id||t[19]!==u?(E=async n=>{ae("store_private_registry_removed",{connection_id:n}),await s.delete.mutateAsync(n),u.invalidateQueries({queryKey:ye.organizationSettings(l.id)})},t[17]=s,t[18]=l.id,t[19]=u,t[20]=E):E=t[20];const Y=E;let M;t[21]!==o||t[22]!==r?(M=async n=>{A(!1);const K=o??{registries:{},blockedMcps:[]};await r({...K,registries:{...K.registries,[n]:{enabled:!0}}})},t[21]=o,t[22]=r,t[23]=M):M=t[23];const I=M;let k;t[24]!==e?(k=e("settings.orgStore.decoStoreSection"),t[24]=e,t[25]=k):k=t[25];const D=R?i.jsx(se,{name:e("settings.orgStore.decoStoreName"),description:e("settings.orgStore.decoStoreDescription"),icon:R.icon,enabled:p(f),onToggle:n=>b(f,n)}):i.jsx(H,{title:e("settings.orgStore.decoStoreName"),description:e("settings.orgStore.connectionNotFound")});let N;t[26]!==D?(N=i.jsx(ie,{children:D}),t[26]=D,t[27]=N):N=t[27],t[28]!==k||t[29]!==N?(x=i.jsx(le,{title:k,children:N}),t[28]=k,t[29]=N,t[30]=x):x=t[30];let L;t[31]!==e?(L=e("settings.orgStore.privateRegistriesSection"),t[31]=e,t[32]=L):L=t[32];let P;t[33]!==a||t[34]!==e?(P=a?void 0:i.jsxs(X,{variant:"outline",size:"sm",onClick:()=>A(!0),children:[i.jsx(be,{size:14}),e("settings.orgStore.addRegistry")]}),t[33]=a,t[34]=e,t[35]=P):P=t[35];let T;t[36]!==I||t[37]!==a?(T=a&&i.jsx($e,{onCancel:()=>A(!1),onSuccess:I}),t[36]=I,t[37]=a,t[38]=T):T=t[38];let w;t[39]!==e?(w=e("settings.orgStore.privateRegistry"),t[39]=e,t[40]=w):w=t[40];let $;t[41]!==e?($=e("settings.orgStore.privateRegistryDescription"),t[41]=e,t[42]=$):$=t[42];let y;t[43]!==p?(y=p("self"),t[43]=p,t[44]=y):y=t[44];let G;t[45]!==b?(G=n=>b("self",n),t[45]=b,t[46]=G):G=t[46];let Q;t[47]!==w||t[48]!==$||t[49]!==y||t[50]!==G?(Q=i.jsx(se,{name:w,description:$,enabled:y,onToggle:G,href:"/$org/settings/store/registry"}),t[47]=w,t[48]=$,t[49]=y,t[50]=G,t[51]=Q):Q=t[51];let ee;t[52]!==Y||t[53]!==b||t[54]!==p||t[55]!==e?(ee=n=>i.jsx(se,{name:n.title,description:n.description??e("settings.orgStore.privateMcpRegistry"),icon:n.icon,enabled:p(n.id),onToggle:K=>b(n.id,K),onDelete:()=>Y(n.id)},n.id),t[52]=Y,t[53]=b,t[54]=p,t[55]=e,t[56]=ee):ee=t[56];const oe=O.map(ee);let W;t[57]!==Q||t[58]!==oe?(W=i.jsxs(ie,{children:[Q,oe]}),t[57]=Q,t[58]=oe,t[59]=W):W=t[59],t[60]!==L||t[61]!==P||t[62]!==T||t[63]!==W?(m=i.jsxs(le,{title:L,actions:P,children:[T,W]}),t[60]=L,t[61]=P,t[62]=T,t[63]=W,t[64]=m):m=t[64],_=le,t[65]!==e?(d=e("settings.orgStore.communitySection"),t[65]=e,t[66]=d):d=t[66],S=ie,j=F?i.jsx(se,{name:e("settings.orgStore.mcpRegistry"),description:e("settings.orgStore.communityRegistryDescription"),icon:F.icon,enabled:p(U),onToggle:n=>b(U,n)}):i.jsx(H,{title:e("settings.orgStore.mcpRegistry"),description:e("settings.orgStore.communityRegistryNotAdded"),icon:i.jsx(me,{fallback:"M",className:"size-8 bg-primary/10 text-primary"}),action:i.jsx(de,{checked:!1,disabled:!0,onCheckedChange:Le})}),t[0]=s,t[1]=l.id,t[2]=u,t[3]=o,t[4]=c,t[5]=a,t[6]=e,t[7]=r,t[8]=S,t[9]=_,t[10]=j,t[11]=d,t[12]=x,t[13]=m}else S=t[8],_=t[9],j=t[10],d=t[11],x=t[12],m=t[13];let v;t[67]!==S||t[68]!==j?(v=i.jsx(S,{children:j}),t[67]=S,t[68]=j,t[69]=v):v=t[69];let g;t[70]!==_||t[71]!==d||t[72]!==v?(g=i.jsx(_,{title:d,children:v}),t[70]=_,t[71]=d,t[72]=v,t[73]=g):g=t[73];let h;return t[74]!==x||t[75]!==m||t[76]!==g?(h=i.jsxs(i.Fragment,{children:[x,m,g]}),t[74]=x,t[75]=m,t[76]=g,t[77]=h):h=t[77],h}function Le(){}function Ke(){const t=J.c(13),e=Z();let l;t[0]!==e?(l=A=>{const{error:S}=A;return i.jsx(Me,{error:S??new Error(e("settings.orgStore.failedLoadStoreSettings"))})},t[0]=e,t[1]=l):l=t[1];let c;t[2]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx(Re,{className:"h-64 w-full"}),t[2]=c):c=t[2];let s;t[3]!==e?(s=e("settings.orgStore.pageTitle"),t[3]=e,t[4]=s):s=t[4];let o;t[5]!==s?(o=i.jsx(te.Title,{children:s}),t[5]=s,t[6]=o):o=t[6];let r;t[7]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(De,{}),t[7]=r):r=t[7];let u;t[8]!==o?(u=i.jsx(V.Suspense,{fallback:c,children:i.jsx(te,{children:i.jsx(te.Content,{children:i.jsx(te.Body,{children:i.jsxs(ze,{children:[o,r]})})})})}),t[8]=o,t[9]=u):u=t[9];let a;return t[10]!==l||t[11]!==u?(a=i.jsx(pe,{fallback:l,children:u}),t[10]=l,t[11]=u,t[12]=a):a=t[12],a}function xt(){const t=J.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(Ee,{capability:"registry:manage",area:"the store",children:i.jsx(Ke,{})}),t[0]=e):e=t[0],e}export{xt as default};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-DjY1XBxT.js","assets/index-CacyxM-B.js","assets/index-B1fXHVYV.css","assets/Tool02-DtJ6WkGT.js","assets/CheckCircle-BCbqPCn-.js","assets/Settings02-CGZ0Ol25.js","assets/use-mcp-client-DRcy9vk6.js","assets/auth-Dk3-oFE7.js","assets/useInfiniteQuery-BxSgA-RD.js","assets/use-infinite-scroll-ChfJMk5S.js","assets/studio-tools-O0czolAT.js","assets/badge-Bc-IWDm5.js","assets/input-B8ln-0Wl.js","assets/dropdown-menu-ByKxU4Y4.js","assets/Check-CSFy6eOj.js","assets/ChevronRight-H-_IIqWd.js","assets/DotsVertical-Bqf_kSFh.js","assets/table-Dc0W0B0Q.js","assets/toggle-group-BFyHFJ9G.js","assets/use-view-mode-BQejzyHA.js","assets/use-mobile-c0ak1uw4.js","assets/FilterLines-Dc1F-WNI.js","assets/Globe01-CHMths1B.js","assets/SearchMd-CF01LhHu.js","assets/dialog-Ww_zj2g-.js","assets/X-VMfnK-j5.js","assets/AlertCircle-DOZzh9F_.js","assets/Download01-BPvwRxeD.js","assets/Upload01-B1Z9PE0l.js","assets/metadata-dUsYcpuu.js","assets/alert-dialog-DRGp9yFR.js","assets/card-CG7VHdDz.js","assets/Trash01-BcRuo5Fe.js","assets/label-CCAJCJOj.js","assets/select-CwAouusu.js","assets/tooltip-CwIq9zTG.js","assets/ChevronDown-DiERg-yU.js","assets/ChevronUp-CT1Rb5MC.js","assets/switch-B0vh0spM.js","assets/textarea-CD_pYqo3.js","assets/ArrowLeft-D3IfTAWC.js","assets/XCircle-D-ab7D3l.js","assets/checkbox-BsGrD1YR.js","assets/Eye-CDfbu42j.js","assets/LinkExternal01-kQgSYVkJ.js","assets/use-copy-D87eemcY.js","assets/Copy01-CzEeXGsa.js","assets/Key01-WuBVakl2.js","assets/Plus-m61KPSTg.js","assets/mcp-oauth-YJCTRoaW.js","assets/Play-AS6vVmkD.js"])))=>i.map(i=>d[i]);
2
- import{c as m,d as n,f as c,j as t,k as f,r as l,aF as p}from"./index-CacyxM-B.js";import{R as u}from"./require-capability-BDCw5l2l.js";import"./use-capability-D8TgIows.js";import"./access-gate-bmibgRvV.js";import"./capability-load-error-BPXMIbs3.js";const g=l.lazy(()=>p(()=>import("./registry-layout-DjY1XBxT.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50])));function j(){const e=m.c(5),i=n();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org"},e[0]=s):s=e[0];const{org:o}=c(s);let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"h-full flex items-center justify-center",children:t.jsx(f,{size:20,className:"animate-spin text-muted-foreground"})}),e[1]=r):r=e[1];let a;return e[2]!==i||e[3]!==o?(a=t.jsx(u,{capability:"registry:manage",area:"the registry",children:t.jsx(l.Suspense,{fallback:r,children:t.jsx(g,{onBack:()=>i({to:"/$org/settings/store",params:{org:o}})})})}),e[2]=i,e[3]=o,e[4]=a):a=e[4],a}export{j as default};
@@ -1 +0,0 @@
1
- import{c as te,j as s,b as ge,r as ce,B as ee,m as je,t as ae}from"./index-CacyxM-B.js";import{s as xe}from"./Plus-m61KPSTg.js";import{c as be,d as Re,b as Se,f as ve,g as Ne,e as De,a as _e,A as Ce}from"./alert-dialog-DRGp9yFR.js";import{b as Pe,h as Ae,a as ke,c as we,d as Oe,e as ze}from"./dialog-Ww_zj2g-.js";import{I as Ee}from"./input-B8ln-0Wl.js";import{S as Ie}from"./skeleton-DOg01VWn.js";import{P as ue}from"./index-GDSYOTBM.js";import{c as $e}from"./settings-section-Cz2znp8W.js";import{G as he,a as Fe}from"./github-repo-picker-CcDCsGzG.js";import{u as Te,b as He,c as Be}from"./use-org-repo-syncs-CEYhU3FE.js";import{t as Ge}from"./cards-DY46VRdr.js";import{S as qe}from"./settings-subnav-a1a1GCc2.js";import{R as Le}from"./require-capability-BDCw5l2l.js";import"./X-VMfnK-j5.js";import"./sidebar-BDv_n64F.js";import"./LayoutLeft-BF7bmTAo.js";import"./use-mobile-c0ak1uw4.js";import"./tooltip-CwIq9zTG.js";import"./card-CG7VHdDz.js";import"./ArrowUpRight-CibKwsqg.js";import"./collection-search-DGOZ00E9.js";import"./SearchMd-CF01LhHu.js";import"./use-debounced-value-DAmoRUxP.js";import"./use-connection-BS7_Pbag.js";import"./use-mcp-client-DRcy9vk6.js";import"./auth-Dk3-oFE7.js";import"./authenticate-and-persist-oauth-BwcRtSiC.js";import"./mcp-oauth-YJCTRoaW.js";import"./ArrowLeft-D3IfTAWC.js";import"./LinkExternal01-kQgSYVkJ.js";import"./LockUnlocked01-Bvs7cZ-w.js";import"./use-mcp-tools-CMpvouUr.js";import"./extract-connection-data-BJ1FOt2x.js";import"./metadata-dUsYcpuu.js";import"./use-navigate-to-agent-IPGb4TnC.js";import"./use-virtual-mcp-zFcH9fRu.js";import"./hooks-D72xT78n.js";import"./decopilot-sse-pool-CeSWLSEV.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./studio-tools-O0czolAT.js";import"./DotsVertical-Bqf_kSFh.js";import"./Download01-BPvwRxeD.js";import"./Share07-Dc2LdheG.js";import"./Globe01-CHMths1B.js";import"./Key01-WuBVakl2.js";import"./Palette-l5b6DG4Q.js";import"./Trash01-BcRuo5Fe.js";import"./Zap-BrJ2b2V7.js";import"./dropdown-menu-ByKxU4Y4.js";import"./Check-CSFy6eOj.js";import"./ChevronRight-H-_IIqWd.js";import"./file-type-icon-B5W8k3cc.js";import"./Eye-CDfbu42j.js";import"./useRouterState-Dk4tjkCW.js";import"./use-settings-tabs-CkhP712K.js";import"./use-capability-D8TgIows.js";import"./access-gate-bmibgRvV.js";import"./capability-load-error-BPXMIbs3.js";function Ve(e){return e.toLowerCase().replace(/[^a-z0-9_.-]+/g,"-").replace(/^[.-]+|[.-]+$/g,"").slice(0,128)}function Je(e,t){return e.lastSyncError?{label:e.lastSyncError,error:!0}:e.lastSyncedAt?{label:t("library.syncedRepos.syncedAgo",{ago:Ge(e.lastSyncedAt)}),error:!1}:{label:t("library.syncedRepos.waitingFirstSync"),error:!1}}function Ke(e){const t=te.c(32),{config:l,onRemove:i}=e,c=ge();let u;t[0]!==l||t[1]!==c?(u=Je(l,c),t[0]=l,t[1]=c,t[2]=u):u=t[2];const p=u;let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:s.jsx(he,{size:16,className:"text-muted-foreground"})}),t[3]=o):o=t[3];let a;t[4]!==l.repoName||t[5]!==l.repoOwner?(a=s.jsxs("span",{className:"font-medium text-sm truncate",children:[l.repoOwner,"/",l.repoName]}),t[4]=l.repoName,t[5]=l.repoOwner,t[6]=a):a=t[6];let n;t[7]!==l.ref?(n=s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:["@",l.ref]}),t[7]=l.ref,t[8]=n):n=t[8];let g;t[9]!==a||t[10]!==n?(g=s.jsxs("div",{className:"flex items-center gap-2",children:[a,n]}),t[9]=a,t[10]=n,t[11]=g):g=t[11];const m=p.error?"text-destructive":"text-muted-foreground";let d;t[12]!==m?(d=je("text-xs mt-0.5 truncate",m),t[12]=m,t[13]=d):d=t[13];let f;t[14]!==l.volume||t[15]!==c?(f=c("settings.syncedRepos.rowSubtitle",{volume:l.volume}),t[14]=l.volume,t[15]=c,t[16]=f):f=t[16];let y;t[17]!==p.label||t[18]!==d||t[19]!==f?(y=s.jsxs("p",{className:d,children:[f," ·"," ",p.label]}),t[17]=p.label,t[18]=d,t[19]=f,t[20]=y):y=t[20];let x;t[21]!==g||t[22]!==y?(x=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[o,s.jsxs("div",{className:"min-w-0",children:[g,y]})]}),t[21]=g,t[22]=y,t[23]=x):x=t[23];let j;t[24]!==c?(j=c("settings.syncedRepos.remove"),t[24]=c,t[25]=j):j=t[25];let h;t[26]!==i||t[27]!==j?(h=s.jsx(ee,{variant:"outline",size:"sm",onClick:i,children:j}),t[26]=i,t[27]=j,t[28]=h):h=t[28];let b;return t[29]!==x||t[30]!==h?(b=s.jsxs("div",{className:"flex items-center justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[x,h]}),t[29]=x,t[30]=h,t[31]=b):b=t[31],b}function Me(e){const t=te.c(21),{onAdd:l}=e,i=ge();let c;t[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:s.jsx(he,{size:20,className:"text-muted-foreground"})}),t[0]=c):c=t[0];let u;t[1]!==i?(u=i("settings.syncedRepos.emptyTitle"),t[1]=i,t[2]=u):u=t[2];let p;t[3]!==u?(p=s.jsx("p",{className:"font-medium text-sm",children:u}),t[3]=u,t[4]=p):p=t[4];let o;t[5]!==i?(o=i("settings.syncedRepos.emptyDescription"),t[5]=i,t[6]=o):o=t[6];let a;t[7]!==o?(a=s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:o}),t[7]=o,t[8]=a):a=t[8];let n;t[9]!==p||t[10]!==a?(n=s.jsxs("div",{children:[p,a]}),t[9]=p,t[10]=a,t[11]=n):n=t[11];let g;t[12]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(xe,{size:14}),t[12]=g):g=t[12];let m;t[13]!==i?(m=i("settings.syncedRepos.addRepo"),t[13]=i,t[14]=m):m=t[14];let d;t[15]!==l||t[16]!==m?(d=s.jsxs(ee,{onClick:l,size:"sm",className:"mt-2",children:[g,m]}),t[15]=l,t[16]=m,t[17]=d):d=t[17];let f;return t[18]!==n||t[19]!==d?(f=s.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[c,n,d]}),t[18]=n,t[19]=d,t[20]=f):f=t[20],f}function Qe(){const e=te.c(107),t=ge(),l=Te(),i=He(),c=Be(),[u,p]=ce.useState(!1),[o,a]=ce.useState(null),[n,g]=ce.useState(""),[m,d]=ce.useState(null);let f;e[0]!==i||e[1]!==o||e[2]!==t||e[3]!==n?(f=function(){!o||!n.trim()||i.mutate({connectionId:o.connectionId,volume:n.trim()},{onSuccess:R=>{a(null),ae.success(t("settings.syncedRepos.created",{volume:R.volume}))},onError:R=>{ae.error(R instanceof Error?R.message:t("settings.syncedRepos.failed"))}})},e[0]=i,e[1]=o,e[2]=t,e[3]=n,e[4]=f):f=e[4];const y=f;let x;e[5]!==m||e[6]!==c||e[7]!==t?(x=function(){m&&c.mutate(m.id,{onSuccess:()=>ae.success(t("settings.syncedRepos.removed")),onError:R=>ae.error(R instanceof Error?R.message:t("settings.syncedRepos.failed")),onSettled:()=>d(null)})},e[5]=m,e[6]=c,e[7]=t,e[8]=x):x=e[8];const j=x;if(l.isPending){let r;return e[9]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Ie,{className:"h-32 w-full"}),e[9]=r):r=e[9],r}let h;e[10]!==l.data?(h=l.data??[],e[10]=l.data,e[11]=h):h=e[11];const b=h;let S;e[12]!==t?(S=t("settings.syncedRepos.pageDescription"),e[12]=t,e[13]=S):S=e[13];let v;e[14]!==S?(v=s.jsx("p",{className:"text-sm text-muted-foreground",children:S}),e[14]=S,e[15]=v):v=e[15];let N;e[16]!==b||e[17]!==t?(N=b.length===0?s.jsx(Me,{onAdd:()=>p(!0)}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex items-center justify-end",children:s.jsxs(ee,{onClick:()=>p(!0),size:"sm",children:[s.jsx(xe,{size:14}),t("settings.syncedRepos.addRepo")]})}),s.jsx("section",{className:"rounded-2xl border border-border/60 bg-background px-5 py-2",children:b.map(r=>s.jsx(Ke,{config:r,onRemove:()=>d(r)},r.id))})]}),e[16]=b,e[17]=t,e[18]=N):N=e[18];let D;e[19]!==t?(D=t("settings.syncedRepos.pickerTitle"),e[19]=t,e[20]=D):D=e[20];let se;e[21]===Symbol.for("react.memo_cache_sentinel")?(se=r=>{p(!1),a(r),g(Ve(r.repo.name))},e[21]=se):se=e[21];let _;e[22]!==u||e[23]!==D?(_=s.jsx(Fe,{mode:"connection",open:u,onOpenChange:p,title:D,onImportComplete:se}),e[22]=u,e[23]=D,e[24]=_):_=e[24];const me=o!==null;let ie;e[25]===Symbol.for("react.memo_cache_sentinel")?(ie=r=>{r||a(null)},e[25]=ie):ie=e[25];let C;e[26]!==t?(C=t("settings.syncedRepos.nameDialogTitle"),e[26]=t,e[27]=C):C=e[27];let P;e[28]!==C?(P=s.jsx(Pe,{children:C}),e[28]=C,e[29]=P):P=e[29];const de=o?`${o.repo.owner}/${o.repo.name}`:"";let A;e[30]!==t||e[31]!==de?(A=t("settings.syncedRepos.nameDialogDescription",{repo:de}),e[30]=t,e[31]=de,e[32]=A):A=e[32];let k;e[33]!==A?(k=s.jsx(Ae,{children:A}),e[33]=A,e[34]=k):k=e[34];let w;e[35]!==P||e[36]!==k?(w=s.jsxs(ke,{children:[P,k]}),e[35]=P,e[36]=k,e[37]=w):w=e[37];let le;e[38]===Symbol.for("react.memo_cache_sentinel")?(le=r=>g(r.target.value),e[38]=le):le=e[38];let O;e[39]!==t?(O=t("settings.syncedRepos.namePlaceholder"),e[39]=t,e[40]=O):O=e[40];let z;e[41]!==O||e[42]!==n?(z=s.jsx(Ee,{value:n,onChange:le,placeholder:O,autoFocus:!0}),e[41]=O,e[42]=n,e[43]=z):z=e[43];let ne;e[44]===Symbol.for("react.memo_cache_sentinel")?(ne=()=>a(null),e[44]=ne):ne=e[44];const ye=i.isPending;let E;e[45]!==t?(E=t("settings.syncedRepos.cancel"),e[45]=t,e[46]=E):E=e[46];let I;e[47]!==i.isPending||e[48]!==E?(I=s.jsx(ee,{variant:"outline",onClick:ne,disabled:ye,children:E}),e[47]=i.isPending,e[48]=E,e[49]=I):I=e[49];let $;e[50]!==i.isPending||e[51]!==n?($=!n.trim()||i.isPending,e[50]=i.isPending,e[51]=n,e[52]=$):$=e[52];let F;e[53]!==i.isPending||e[54]!==t?(F=i.isPending?t("settings.syncedRepos.creating"):t("settings.syncedRepos.create"),e[53]=i.isPending,e[54]=t,e[55]=F):F=e[55];let T;e[56]!==y||e[57]!==$||e[58]!==F?(T=s.jsx(ee,{disabled:$,onClick:y,children:F}),e[56]=y,e[57]=$,e[58]=F,e[59]=T):T=e[59];let H;e[60]!==I||e[61]!==T?(H=s.jsxs(we,{children:[I,T]}),e[60]=I,e[61]=T,e[62]=H):H=e[62];let B;e[63]!==w||e[64]!==z||e[65]!==H?(B=s.jsxs(Oe,{className:"sm:max-w-sm",children:[w,z,H]}),e[63]=w,e[64]=z,e[65]=H,e[66]=B):B=e[66];let G;e[67]!==B||e[68]!==me?(G=s.jsx(ze,{open:me,onOpenChange:ie,children:B}),e[67]=B,e[68]=me,e[69]=G):G=e[69];const pe=m!==null;let oe;e[70]===Symbol.for("react.memo_cache_sentinel")?(oe=r=>{r||d(null)},e[70]=oe):oe=e[70];const fe=m?.volume??"";let q;e[71]!==t||e[72]!==fe?(q=t("settings.syncedRepos.removeTitle",{volume:fe}),e[71]=t,e[72]=fe,e[73]=q):q=e[73];let L;e[74]!==q?(L=s.jsx(be,{children:q}),e[74]=q,e[75]=L):L=e[75];let V;e[76]!==t?(V=t("settings.syncedRepos.removeDescription"),e[76]=t,e[77]=V):V=e[77];let J;e[78]!==V?(J=s.jsx(Re,{children:V}),e[78]=V,e[79]=J):J=e[79];let K;e[80]!==L||e[81]!==J?(K=s.jsxs(Se,{children:[L,J]}),e[80]=L,e[81]=J,e[82]=K):K=e[82];let M;e[83]!==t?(M=t("settings.syncedRepos.cancel"),e[83]=t,e[84]=M):M=e[84];let Q;e[85]!==M?(Q=s.jsx(ve,{children:M}),e[85]=M,e[86]=Q):Q=e[86];let U;e[87]!==t?(U=t("settings.syncedRepos.remove"),e[87]=t,e[88]=U):U=e[88];let W;e[89]!==j||e[90]!==U?(W=s.jsx(Ne,{onClick:j,children:U}),e[89]=j,e[90]=U,e[91]=W):W=e[91];let X;e[92]!==Q||e[93]!==W?(X=s.jsxs(De,{children:[Q,W]}),e[92]=Q,e[93]=W,e[94]=X):X=e[94];let Y;e[95]!==K||e[96]!==X?(Y=s.jsxs(_e,{children:[K,X]}),e[95]=K,e[96]=X,e[97]=Y):Y=e[97];let Z;e[98]!==pe||e[99]!==Y?(Z=s.jsx(Ce,{open:pe,onOpenChange:oe,children:Y}),e[98]=pe,e[99]=Y,e[100]=Z):Z=e[100];let re;return e[101]!==G||e[102]!==v||e[103]!==Z||e[104]!==N||e[105]!==_?(re=s.jsxs(s.Fragment,{children:[v,N,_,G,Z]}),e[101]=G,e[102]=v,e[103]=Z,e[104]=N,e[105]=_,e[106]=re):re=e[106],re}function Ue(){const e=te.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(ue,{children:s.jsx(ue.Content,{children:s.jsx(ue.Body,{children:s.jsxs($e,{children:[s.jsx(qe,{group:"storage"}),s.jsx(Qe,{})]})})})}),e[0]=t):t=e[0],t}function is(){const e=te.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(Le,{capability:"file-configs:manage",area:"files",children:s.jsx(Ue,{})}),e[0]=t):t=e[0],t}export{is as default};
@@ -1 +0,0 @@
1
- import{c as D,r as W,j as l,m as te,B as G,F as X,K as Z,n as oe,o as ce,e as de,b as z,t as M}from"./index-CacyxM-B.js";import{I as se}from"./input-B8ln-0Wl.js";import{i as ge}from"./Check-CSFy6eOj.js";import{i as pe}from"./ChevronSelectorVertical-Bnz5tSS1.js";import{C as be,a as ye,b as ve,c as Se,d as Ne,e as Ce}from"./command-D63NDRD_.js";import{a as we,P as ke,b as _e}from"./popover-5hCe1k-b.js";import{S as xe}from"./skeleton-DOg01VWn.js";import{S as me}from"./switch-B0vh0spM.js";import{c as Te,d as Ie,b as Pe,f as Ae,g as De,e as Ee,a as Fe,A as Me}from"./alert-dialog-DRGp9yFR.js";import{S as Re,a as $e,b as qe,c as Be,d as fe}from"./select-CwAouusu.js";import{P as le}from"./index-GDSYOTBM.js";import{c as Ke,S as Oe}from"./settings-section-Cz2znp8W.js";import{u as ee}from"./studio-tools-O0czolAT.js";import{t as Le}from"./cards-DY46VRdr.js";import{R as Je}from"./require-capability-BDCw5l2l.js";import"./index-CSqLyX3L.js";import"./dialog-Ww_zj2g-.js";import"./X-VMfnK-j5.js";import"./SearchMd-CF01LhHu.js";import"./tooltip-CwIq9zTG.js";import"./ChevronDown-DiERg-yU.js";import"./ChevronUp-CT1Rb5MC.js";import"./sidebar-BDv_n64F.js";import"./LayoutLeft-BF7bmTAo.js";import"./use-mobile-c0ak1uw4.js";import"./card-CG7VHdDz.js";import"./ArrowUpRight-CibKwsqg.js";import"./DotsVertical-Bqf_kSFh.js";import"./Download01-BPvwRxeD.js";import"./Share07-Dc2LdheG.js";import"./Globe01-CHMths1B.js";import"./Key01-WuBVakl2.js";import"./Palette-l5b6DG4Q.js";import"./Trash01-BcRuo5Fe.js";import"./Zap-BrJ2b2V7.js";import"./dropdown-menu-ByKxU4Y4.js";import"./ChevronRight-H-_IIqWd.js";import"./file-type-icon-B5W8k3cc.js";import"./Eye-CDfbu42j.js";import"./use-capability-D8TgIows.js";import"./access-gate-bmibgRvV.js";import"./capability-load-error-BPXMIbs3.js";function Ue(t){const e=D.c(41),{options:i,value:s,onChange:n,placeholder:a,triggerClassName:r,contentClassName:o,width:g,renderTrigger:c,renderItem:f,emptyMessage:d,searchPlaceholder:m,filter:u}=t,p=a===void 0?"Select...":a,x=g===void 0?"w-[200px]":g,S=d===void 0?"No results found.":d,b=m===void 0?"Search...":m;let h;e[0]!==s?(h=K=>K.value===s,e[0]=s,e[1]=h):h=e[1];const N=i.find(h),[y,j]=W.useState(!1),C=ke,k=we,_=!0,T=c?l.jsx("div",{className:te("cursor-pointer",r),children:c(N)}):l.jsxs(G,{variant:"outline",role:"combobox",className:te("justify-between",x,r),children:[N?N.label:p,l.jsx(pe,{className:"opacity-50"})]});let v;e[2]!==k||e[3]!==T?(v=l.jsx(k,{asChild:_,children:T}),e[2]=k,e[3]=T,e[4]=v):v=e[4];let w;e[5]!==o?(w=te("p-0",o),e[5]=o,e[6]=w):w=e[6];let P;e[7]===Symbol.for("react.memo_cache_sentinel")?(P={width:"var(--radix-popover-trigger-width)"},e[7]=P):P=e[7];let A;e[8]!==b?(A=l.jsx(be,{placeholder:b,className:"h-9"}),e[8]=b,e[9]=A):A=e[9];let E;e[10]!==S?(E=l.jsx(ye,{children:S}),e[10]=S,e[11]=E):E=e[11];let I;if(e[12]!==n||e[13]!==i||e[14]!==f||e[15]!==j||e[16]!==s){let K;e[18]!==n||e[19]!==f||e[20]!==j||e[21]!==s?(K=R=>{const J=s===R.value;return l.jsx(ve,{value:R.label,onSelect:()=>{n(R.value===s?"":R.value),j(!1)},children:f?f(R,J):l.jsxs(l.Fragment,{children:[R.label,l.jsx(ge,{className:te("ml-auto",J?"opacity-100":"opacity-0")})]})},R.value)},e[18]=n,e[19]=f,e[20]=j,e[21]=s,e[22]=K):K=e[22],I=i.map(K),e[12]=n,e[13]=i,e[14]=f,e[15]=j,e[16]=s,e[17]=I}else I=e[17];let $;e[23]!==I?($=l.jsx(Se,{children:I}),e[23]=I,e[24]=$):$=e[24];let q;e[25]!==E||e[26]!==$?(q=l.jsxs(Ne,{children:[E,$]}),e[25]=E,e[26]=$,e[27]=q):q=e[27];let L;e[28]!==u||e[29]!==A||e[30]!==q?(L=l.jsxs(Ce,{filter:u,children:[A,q]}),e[28]=u,e[29]=A,e[30]=q,e[31]=L):L=e[31];let B;e[32]!==L||e[33]!==w?(B=l.jsx(_e,{className:w,style:P,children:L}),e[32]=L,e[33]=w,e[34]=B):B=e[34];let O;return e[35]!==C||e[36]!==y||e[37]!==j||e[38]!==B||e[39]!==v?(O=l.jsxs(C,{open:y,onOpenChange:j,children:[v,B]}),e[35]=C,e[36]=y,e[37]=j,e[38]=B,e[39]=v,e[40]=O):O=e[40],O}function ze(t){const e=D.c(4),{size:i,className:s}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=l.jsx("path",{d:"M11.571 11.513H0a5.218 5.218 0 0 0 5.232 5.215h2.13v2.057A5.215 5.215 0 0 0 12.575 24V12.518a1.005 1.005 0 0 0-1.005-1.005zm5.723-5.756H5.736a5.215 5.215 0 0 0 5.215 5.214h2.129v2.058a5.218 5.218 0 0 0 5.215 5.214V6.758a1.001 1.001 0 0 0-1.001-1.001zM23.013 0H11.455a5.215 5.215 0 0 0 5.215 5.215h2.129v2.057A5.215 5.215 0 0 0 24 12.483V1.005A1.001 1.001 0 0 0 23.013 0z"}),e[0]=n):n=e[0];let a;return e[1]!==s||e[2]!==i?(a=l.jsx("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"#2684FF","aria-hidden":"true",className:s,children:n}),e[1]=s,e[2]=i,e[3]=a):a=e[3],a}function je(t){const e=t.projectName?.replace(/\s+/g," ").trim(),i=t.name.trim();return e?{primary:e,secondary:[i,t.projectKey].filter(Boolean).join(" · ")}:{primary:i,secondary:t.projectKey??""}}function Ve(t){const{primary:e,secondary:i}=je(t);return[e,i,`#${t.id}`].filter(Boolean).join(" ")}function ue(t){return t.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase()}function Ge(t,e){const i=ue(e).trim();if(!i)return 1;const s=ue(t);return i.split(/\s+/).every(n=>s.includes(n))?1:0}function Qe(){const t=D.c(7),{org:e}=X(),i=ee();let s;t[0]!==e.id?(s=Z.jiraIntegration(e.id),t[0]=e.id,t[1]=s):s=t[1];let n;t[2]!==i?(n=async()=>(await i.call("JIRA_INTEGRATION_GET",{})).integration,t[2]=i,t[3]=n):n=t[3];let a;return t[4]!==s||t[5]!==n?(a={queryKey:s,queryFn:n},t[4]=s,t[5]=n,t[6]=a):a=t[6],oe(a)}function ne(){const t=D.c(8),{org:e}=X(),i=ee(),s=ce();let n;t[0]!==i?(n=async o=>(await i.call("JIRA_INTEGRATION_UPSERT",o)).integration,t[0]=i,t[1]=n):n=t[1];let a;t[2]!==e||t[3]!==s?(a=()=>s.invalidateQueries({queryKey:Z.jiraIntegration(e.id)}),t[2]=e,t[3]=s,t[4]=a):a=t[4];let r;return t[5]!==n||t[6]!==a?(r={mutationFn:n,onSettled:a},t[5]=n,t[6]=a,t[7]=r):r=t[7],de(r)}function He(){const t=D.c(8),{org:e}=X(),i=ee(),s=ce();let n;t[0]!==i?(n=()=>i.call("JIRA_INTEGRATION_DELETE",{}),t[0]=i,t[1]=n):n=t[1];let a;t[2]!==e||t[3]!==s?(a=()=>s.invalidateQueries({queryKey:Z.jiraIntegration(e.id)}),t[2]=e,t[3]=s,t[4]=a):a=t[4];let r;return t[5]!==n||t[6]!==a?(r={mutationFn:n,onSettled:a},t[5]=n,t[6]=a,t[7]=r):r=t[7],de(r)}function Ye(t){const e=D.c(8),{org:i}=X(),s=ee();let n;e[0]!==i.id?(n=Z.jiraBoards(i.id),e[0]=i.id,e[1]=n):n=e[1];let a;e[2]!==s?(a=async()=>(await s.call("JIRA_BOARDS_LIST",{})).boards,e[2]=s,e[3]=a):a=e[3];let r;return e[4]!==t||e[5]!==n||e[6]!==a?(r={queryKey:n,enabled:t,staleTime:6e4,queryFn:a},e[4]=t,e[5]=n,e[6]=a,e[7]=r):r=e[7],oe(r)}function We(t){const e=D.c(10),{org:i}=X(),s=ee();let n;e[0]!==t||e[1]!==i.id?(n=Z.jiraBoardColumns(i.id,t??""),e[0]=t,e[1]=i.id,e[2]=n):n=e[2];const a=t!==null;let r;e[3]!==t||e[4]!==s?(r=async()=>(await s.call("JIRA_BOARD_COLUMNS_LIST",{boardId:t??""})).columns,e[3]=t,e[4]=s,e[5]=r):r=e[5];let o;return e[6]!==n||e[7]!==a||e[8]!==r?(o={queryKey:n,enabled:a,staleTime:6e4,queryFn:r},e[6]=n,e[7]=a,e[8]=r,e[9]=o):o=e[9],oe(o)}function Xe(){const t=D.c(8),{org:e}=X(),i=ee(),s=ce();let n;t[0]!==i?(n=async()=>(await i.call("JIRA_SYNC_RUN",{})).result,t[0]=i,t[1]=n):n=t[1];let a;t[2]!==e||t[3]!==s?(a=()=>s.invalidateQueries({queryKey:Z.jiraIntegration(e.id)}),t[2]=e,t[3]=s,t[4]=a):a=t[4];let r;return t[5]!==n||t[6]!==a?(r={mutationFn:n,onSettled:a},t[5]=n,t[6]=a,t[7]=r):r=t[7],de(r)}const Ze=[{value:"triage",labelKey:"taskBoard.config.statusBacklog"},{value:"todo",labelKey:"taskBoard.config.statusTodo"},{value:"in_progress",labelKey:"taskBoard.config.statusInProgress"},{value:"in_review",labelKey:"taskBoard.config.statusInReview"},{value:"done",labelKey:"taskBoard.config.statusDone"},{value:"archived",labelKey:"taskBoard.config.statusArchived"}],re="__dont_sync__";function U(t,e){return t instanceof Error?t.message:e}const et="https://id.atlassian.com/manage-profile/security/api-tokens";function ae(t){const e=D.c(15),{title:i,description:s,actions:n,children:a}=t;let r;e[0]!==i?(r=l.jsx("h3",{className:"text-sm font-medium leading-tight",children:i}),e[0]=i,e[1]=r):r=e[1];let o;e[2]!==s?(o=s&&l.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:s}),e[2]=s,e[3]=o):o=e[3];let g;e[4]!==r||e[5]!==o?(g=l.jsxs("div",{className:"min-w-0 flex flex-col gap-0.5",children:[r,o]}),e[4]=r,e[5]=o,e[6]=g):g=e[6];let c;e[7]!==n?(c=n&&l.jsx("div",{className:"shrink-0",children:n}),e[7]=n,e[8]=c):c=e[8];let f;e[9]!==g||e[10]!==c?(f=l.jsxs("div",{className:"flex items-center justify-between gap-3",children:[g,c]}),e[9]=g,e[10]=c,e[11]=f):f=e[11];let d;return e[12]!==a||e[13]!==f?(d=l.jsxs("section",{className:"flex flex-col gap-3",children:[f,a]}),e[12]=a,e[13]=f,e[14]=d):d=e[14],d}function he(t){const e=D.c(7),{stepKeys:i}=t,s=z();let n;if(e[0]!==i||e[1]!==s){let r;e[3]!==s?(r=o=>l.jsx("li",{children:s(o)},o),e[3]=s,e[4]=r):r=e[4],n=i.map(r),e[0]=i,e[1]=s,e[2]=n}else n=e[2];let a;return e[5]!==n?(a=l.jsx("ol",{className:"list-decimal pl-5 flex flex-col gap-1 text-xs text-muted-foreground",children:n}),e[5]=n,e[6]=a):a=e[6],a}function tt(){const t=D.c(54),e=z(),i=ne(),[s,n]=W.useState(""),[a,r]=W.useState(""),[o,g]=W.useState("");let c;t[0]!==o||t[1]!==a||t[2]!==s?(c=s.trim()!==""&&a.trim()!==""&&o.trim()!=="",t[0]=o,t[1]=a,t[2]=s,t[3]=c):c=t[3];const f=c;let d;t[4]!==e?(d=e("settings.jira.connectTitle"),t[4]=e,t[5]=d):d=t[5];let m;t[6]!==e?(m=e("settings.jira.connectDescription"),t[6]=e,t[7]=m):m=t[7];let u;t[8]===Symbol.for("react.memo_cache_sentinel")?(u=l.jsx(he,{stepKeys:["settings.jira.connectStep1","settings.jira.connectStep2","settings.jira.connectStep3"]}),t[8]=u):u=t[8];let p;t[9]!==e?(p=e("settings.jira.createTokenLink"),t[9]=e,t[10]=p):p=t[10];let x;t[11]!==p?(x=l.jsxs("a",{href:et,target:"_blank",rel:"noreferrer",className:"text-xs text-foreground hover:underline w-fit",children:[p," ↗"]}),t[11]=p,t[12]=x):x=t[12];let S;t[13]===Symbol.for("react.memo_cache_sentinel")?(S=I=>n(I.target.value),t[13]=S):S=t[13];let b;t[14]!==e?(b=e("settings.jira.sitePlaceholder"),t[14]=e,t[15]=b):b=t[15];let h;t[16]!==s||t[17]!==b?(h=l.jsx(se,{value:s,onChange:S,placeholder:b,autoComplete:"off"}),t[16]=s,t[17]=b,t[18]=h):h=t[18];let N;t[19]===Symbol.for("react.memo_cache_sentinel")?(N=I=>r(I.target.value),t[19]=N):N=t[19];let y;t[20]!==e?(y=e("settings.jira.emailPlaceholder"),t[20]=e,t[21]=y):y=t[21];let j;t[22]!==a||t[23]!==y?(j=l.jsx(se,{value:a,onChange:N,placeholder:y,autoComplete:"off"}),t[22]=a,t[23]=y,t[24]=j):j=t[24];let C;t[25]===Symbol.for("react.memo_cache_sentinel")?(C=I=>g(I.target.value),t[25]=C):C=t[25];let k;t[26]!==e?(k=e("settings.jira.tokenPlaceholder"),t[26]=e,t[27]=k):k=t[27];let _;t[28]!==o||t[29]!==k?(_=l.jsx(se,{type:"password",value:o,onChange:C,placeholder:k,autoComplete:"off"}),t[28]=o,t[29]=k,t[30]=_):_=t[30];const T=!f||i.isPending;let v;t[31]!==o||t[32]!==a||t[33]!==s||t[34]!==e||t[35]!==i?(v=()=>i.mutate({siteUrl:s.trim(),email:a.trim(),apiToken:o.trim()},{onSuccess:()=>M.success(e("settings.jira.connected")),onError:I=>M.error(U(I,e("settings.jira.connectFailed")))}),t[31]=o,t[32]=a,t[33]=s,t[34]=e,t[35]=i,t[36]=v):v=t[36];let w;t[37]!==e||t[38]!==i.isPending?(w=i.isPending?e("settings.jira.connecting"):e("settings.jira.connect"),t[37]=e,t[38]=i.isPending,t[39]=w):w=t[39];let P;t[40]!==T||t[41]!==v||t[42]!==w?(P=l.jsx("div",{children:l.jsx(G,{disabled:T,onClick:v,children:w})}),t[40]=T,t[41]=v,t[42]=w,t[43]=P):P=t[43];let A;t[44]!==j||t[45]!==_||t[46]!==P||t[47]!==x||t[48]!==h?(A=l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-background p-5 flex flex-col gap-3 max-w-lg",children:[u,x,h,j,_,P]}),t[44]=j,t[45]=_,t[46]=P,t[47]=x,t[48]=h,t[49]=A):A=t[49];let E;return t[50]!==d||t[51]!==A||t[52]!==m?(E=l.jsx(ae,{title:d,description:m,children:A}),t[50]=d,t[51]=A,t[52]=m,t[53]=E):E=t[53],E}function st(t){const e=D.c(7),{integration:i}=t,s=z();if(i.lastSyncError){let r;return e[0]!==i.lastSyncError?(r=l.jsx("p",{className:"text-xs text-destructive truncate",children:i.lastSyncError}),e[0]=i.lastSyncError,e[1]=r):r=e[1],r}let n;e[2]!==i.lastSyncedAt||e[3]!==s?(n=i.lastSyncedAt?s("settings.jira.lastSynced",{ago:Le(i.lastSyncedAt)}):s("settings.jira.waitingFirstSync"),e[2]=i.lastSyncedAt,e[3]=s,e[4]=n):n=e[4];let a;return e[5]!==n?(a=l.jsx("p",{className:"text-xs text-muted-foreground",children:n}),e[5]=n,e[6]=a):a=e[6],a}function it(t){const e=D.c(23),{integration:i}=t,s=z(),n=ne(),a=We(i.boardId);if(a.isPending){let d;return e[0]===Symbol.for("react.memo_cache_sentinel")?(d=l.jsx(xe,{className:"h-24 w-full"}),e[0]=d):d=e[0],d}if(a.isError){let d;e[1]!==a.error||e[2]!==s?(d=U(a.error,s("settings.jira.columnsFailed")),e[1]=a.error,e[2]=s,e[3]=d):d=e[3];let m;return e[4]!==d?(m=l.jsx("p",{className:"text-xs text-destructive",children:d}),e[4]=d,e[5]=m):m=e[5],m}let r;e[6]!==i.statusMapping||e[7]!==s||e[8]!==n?(r=function(m,u){const p={...i.statusMapping};for(const x of m)u===re?delete p[x]:p[x]=u;n.mutate({statusMapping:p},{onError:x=>M.error(U(x,s("settings.jira.saveFailed")))})},e[6]=i.statusMapping,e[7]=s,e[8]=n,e[9]=r):r=e[9];const o=r;let g;e[10]!==a.data?(g=a.data??[],e[10]=a.data,e[11]=g):g=e[11];let c;if(e[12]!==i.statusMapping||e[13]!==o||e[14]!==s||e[15]!==g){let d;e[17]!==i.statusMapping||e[18]!==o||e[19]!==s?(d=m=>l.jsxs("div",{className:"flex items-center justify-between gap-4 py-2.5 border-b border-border/60 last:border-b-0",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("span",{className:"text-sm truncate",children:m.name}),(m.statuses.length>1||m.statuses[0]!==m.name)&&l.jsx("p",{className:"text-xs text-muted-foreground truncate",children:m.statuses.join(", ")})]}),l.jsxs(Re,{value:(m.statuses[0]&&i.statusMapping[m.statuses[0]])??re,onValueChange:u=>o(m.statuses,u),children:[l.jsx($e,{className:"w-44 shrink-0",children:l.jsx(qe,{})}),l.jsxs(Be,{children:[l.jsx(fe,{value:re,children:s("settings.jira.dontSync")}),Ze.map(u=>l.jsx(fe,{value:u.value,children:s(u.labelKey)},u.value))]})]})]},m.name),e[17]=i.statusMapping,e[18]=o,e[19]=s,e[20]=d):d=e[20],c=g.map(d),e[12]=i.statusMapping,e[13]=o,e[14]=s,e[15]=g,e[16]=c}else c=e[16];let f;return e[21]!==c?(f=l.jsx("div",{className:"flex flex-col",children:c}),e[21]=c,e[22]=f):f=e[22],f}function lt(t){const e=D.c(33),{integration:i}=t,s=z(),n=ne(),[a,r]=W.useState(i.jqlFilter??"");let o;e[0]!==a?(o=a.trim(),e[0]=a,e[1]=o):o=e[1];const g=o!==(i.jqlFilter??"");let c;e[2]!==s?(c=s("settings.jira.jqlLabel"),e[2]=s,e[3]=c):c=e[3];let f;e[4]!==c?(f=l.jsx("p",{className:"text-sm font-medium",children:c}),e[4]=c,e[5]=f):f=e[5];let d;e[6]!==s?(d=s("settings.jira.jqlDescription"),e[6]=s,e[7]=d):d=e[7];let m;e[8]!==d?(m=l.jsx("p",{className:"text-xs text-muted-foreground",children:d}),e[8]=d,e[9]=m):m=e[9];let u;e[10]===Symbol.for("react.memo_cache_sentinel")?(u=C=>r(C.target.value),e[10]=u):u=e[10];let p;e[11]!==s?(p=s("settings.jira.jqlPlaceholder"),e[11]=s,e[12]=p):p=e[12];let x;e[13]!==p||e[14]!==a?(x=l.jsx(se,{value:a,onChange:u,placeholder:p,className:"font-mono text-xs"}),e[13]=p,e[14]=a,e[15]=x):x=e[15];const S=!g||n.isPending;let b;e[16]!==s||e[17]!==n||e[18]!==a?(b=()=>n.mutate({jqlFilter:a.trim()===""?null:a.trim()},{onSuccess:()=>M.success(s("settings.jira.jqlSaved")),onError:C=>M.error(U(C,s("settings.jira.saveFailed")))}),e[16]=s,e[17]=n,e[18]=a,e[19]=b):b=e[19];let h;e[20]!==s?(h=s("settings.jira.jqlSave"),e[20]=s,e[21]=h):h=e[21];let N;e[22]!==b||e[23]!==h||e[24]!==S?(N=l.jsx(G,{variant:"outline",size:"sm",className:"shrink-0",disabled:S,onClick:b,children:h}),e[22]=b,e[23]=h,e[24]=S,e[25]=N):N=e[25];let y;e[26]!==N||e[27]!==x?(y=l.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[x,N]}),e[26]=N,e[27]=x,e[28]=y):y=e[28];let j;return e[29]!==y||e[30]!==f||e[31]!==m?(j=l.jsxs("div",{className:"flex flex-col gap-1",children:[f,m,y]}),e[29]=y,e[30]=f,e[31]=m,e[32]=j):j=e[32],j}function nt(t){const e=D.c(102),{integration:i}=t,s=z(),n=ne(),a=Xe(),r=Ye(!0);let o;e[0]!==i.statusMapping?(o=Object.keys(i.statusMapping),e[0]=i.statusMapping,e[1]=o):o=e[1];const g=o.length>0;let c,f;e[2]!==r.data||e[3]!==i.boardId||e[4]!==i.boardName?(c=(r.data??[]).map(rt),f=i.boardId?c.find(F=>F.value===i.boardId)?.primary??i.boardName??i.boardId:null,e[2]=r.data,e[3]=i.boardId,e[4]=i.boardName,e[5]=c,e[6]=f):(c=e[5],f=e[6]);const d=f;let m;e[7]!==s?(m=s("settings.jira.syncTitle"),e[7]=s,e[8]=m):m=e[8];let u;e[9]!==s?(u=s("settings.jira.syncDescription"),e[9]=s,e[10]=u):u=e[10];let p;e[11]!==s?(p=s("settings.jira.boardLabel"),e[11]=s,e[12]=p):p=e[12];let x;e[13]!==p?(x=l.jsx("p",{className:"text-sm font-medium",children:p}),e[13]=p,e[14]=x):x=e[14];let S;e[15]!==s?(S=s("settings.jira.boardDescription"),e[15]=s,e[16]=S):S=e[16];let b;e[17]!==S?(b=l.jsx("p",{className:"text-xs text-muted-foreground",children:S}),e[17]=S,e[18]=b):b=e[18];let h;e[19]!==x||e[20]!==b?(h=l.jsxs("div",{className:"min-w-0",children:[x,b]}),e[19]=x,e[20]=b,e[21]=h):h=e[21];const N=i.boardId??"";let y;e[22]!==s?(y=s("settings.jira.boardPlaceholder"),e[22]=s,e[23]=y):y=e[23];let j;e[24]!==s?(j=s("settings.jira.boardSearchPlaceholder"),e[24]=s,e[25]=j):j=e[25];let C;e[26]!==r.isPending||e[27]!==s?(C=r.isPending?s("settings.jira.loadingBoards"):s("settings.jira.noBoardsMatch"),e[26]=r.isPending,e[27]=s,e[28]=C):C=e[28];let k;e[29]!==d||e[30]!==s?(k=()=>l.jsxs(G,{variant:"outline",role:"combobox",className:"w-72 justify-between font-normal",children:[l.jsx("span",{className:"truncate",children:d??s("settings.jira.boardPlaceholder")}),l.jsx(pe,{className:"opacity-50 shrink-0"})]}),e[29]=d,e[30]=s,e[31]=k):k=e[31];let _;e[32]!==c||e[33]!==i.boardId||e[34]!==s||e[35]!==n?(_=F=>{!F||F===i.boardId||n.mutate({boardId:F,boardName:c.find(V=>V.value===F)?.primary??null,statusMapping:{},enabled:!1},{onError:V=>M.error(U(V,s("settings.jira.saveFailed")))})},e[32]=c,e[33]=i.boardId,e[34]=s,e[35]=n,e[36]=_):_=e[36];let T;e[37]!==c||e[38]!==N||e[39]!==y||e[40]!==j||e[41]!==C||e[42]!==k||e[43]!==_?(T=l.jsx(Ue,{options:c,value:N,width:"w-72",triggerClassName:"shrink-0",placeholder:y,searchPlaceholder:j,filter:Ge,emptyMessage:C,renderTrigger:k,renderItem:at,onChange:_}),e[37]=c,e[38]=N,e[39]=y,e[40]=j,e[41]=C,e[42]=k,e[43]=_,e[44]=T):T=e[44];let v;e[45]!==T||e[46]!==h?(v=l.jsxs("div",{className:"flex items-center justify-between gap-4",children:[h,T]}),e[45]=T,e[46]=h,e[47]=v):v=e[47];let w;e[48]!==i||e[49]!==s?(w=i.boardId&&l.jsxs("div",{className:"flex flex-col gap-1",children:[l.jsx("p",{className:"text-sm font-medium",children:s("settings.jira.mappingLabel")}),l.jsx("p",{className:"text-xs text-muted-foreground",children:s("settings.jira.mappingDescription")}),l.jsx(it,{integration:i})]}),e[48]=i,e[49]=s,e[50]=w):w=e[50];let P;e[51]!==i?(P=i.boardId&&l.jsx(lt,{integration:i}),e[51]=i,e[52]=P):P=e[52];let A;e[53]!==i.autoDelegate||e[54]!==i.boardId||e[55]!==s||e[56]!==n?(A=i.boardId&&l.jsxs("div",{className:"flex items-center justify-between gap-4",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"text-sm font-medium",children:s("settings.jira.autoDelegateLabel")}),l.jsx("p",{className:"text-xs text-muted-foreground",children:s("settings.jira.autoDelegateDescription")})]}),l.jsx(me,{checked:i.autoDelegate,disabled:n.isPending,onCheckedChange:F=>n.mutate({autoDelegate:F},{onError:V=>M.error(U(V,s("settings.jira.saveFailed")))})})]}),e[53]=i.autoDelegate,e[54]=i.boardId,e[55]=s,e[56]=n,e[57]=A):A=e[57];let E;e[58]!==s?(E=s("settings.jira.enableLabel"),e[58]=s,e[59]=E):E=e[59];let I;e[60]!==E?(I=l.jsx("p",{className:"text-sm font-medium",children:E}),e[60]=E,e[61]=I):I=e[61];let $;e[62]!==i?($=l.jsx(st,{integration:i}),e[62]=i,e[63]=$):$=e[63];let q;e[64]!==I||e[65]!==$?(q=l.jsxs("div",{className:"min-w-0 flex flex-col gap-0.5",children:[I,$]}),e[64]=I,e[65]=$,e[66]=q):q=e[66];const L=!i.enabled||a.isPending;let B;e[67]!==a||e[68]!==s?(B=()=>a.mutate(void 0,{onSuccess:F=>{"error"in F?M.error(F.error):M.success(s("settings.jira.syncDone",{created:String(F.created),updated:String(F.updated)}))},onError:F=>M.error(U(F,s("settings.jira.syncFailed")))}),e[67]=a,e[68]=s,e[69]=B):B=e[69];let O;e[70]!==a.isPending||e[71]!==s?(O=a.isPending?s("settings.jira.syncing"):s("settings.jira.syncNow"),e[70]=a.isPending,e[71]=s,e[72]=O):O=e[72];let K;e[73]!==L||e[74]!==B||e[75]!==O?(K=l.jsx(G,{variant:"outline",size:"sm",disabled:L,onClick:B,children:O}),e[73]=L,e[74]=B,e[75]=O,e[76]=K):K=e[76];let R;e[77]!==g||e[78]!==i.boardId||e[79]!==s||e[80]!==n?(R=F=>{if(F&&(!i.boardId||!g)){M.error(s("settings.jira.enableRequirements"));return}n.mutate({enabled:F},{onError:V=>M.error(U(V,s("settings.jira.saveFailed")))})},e[77]=g,e[78]=i.boardId,e[79]=s,e[80]=n,e[81]=R):R=e[81];let J;e[82]!==i.enabled||e[83]!==R||e[84]!==n.isPending?(J=l.jsx(me,{checked:i.enabled,disabled:n.isPending,onCheckedChange:R}),e[82]=i.enabled,e[83]=R,e[84]=n.isPending,e[85]=J):J=e[85];let Q;e[86]!==K||e[87]!==J?(Q=l.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[K,J]}),e[86]=K,e[87]=J,e[88]=Q):Q=e[88];let H;e[89]!==q||e[90]!==Q?(H=l.jsxs("div",{className:"flex items-center justify-between gap-4 border-t border-border/60 pt-4",children:[q,Q]}),e[89]=q,e[90]=Q,e[91]=H):H=e[91];let Y;e[92]!==v||e[93]!==w||e[94]!==P||e[95]!==A||e[96]!==H?(Y=l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-background p-5 flex flex-col gap-5",children:[v,w,P,A,H]}),e[92]=v,e[93]=w,e[94]=P,e[95]=A,e[96]=H,e[97]=Y):Y=e[97];let ie;return e[98]!==m||e[99]!==Y||e[100]!==u?(ie=l.jsx(ae,{title:m,description:u,children:Y}),e[98]=m,e[99]=Y,e[100]=u,e[101]=ie):ie=e[101],ie}function at(t,e){return l.jsxs("div",{className:"flex items-start gap-2 min-w-0 w-full",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("p",{className:"truncate",children:t.primary}),l.jsx("p",{className:"text-xs text-muted-foreground truncate",children:t.secondary})]}),l.jsx(ge,{className:te("mt-0.5 shrink-0",e?"opacity-100":"opacity-0")})]})}function rt(t){const{primary:e,secondary:i}=je(t);return{value:String(t.id),label:Ve(t),primary:e,secondary:i}}function ot(t){const e=D.c(24),{integration:i}=t,s=z(),n=`${window.location.origin}/api/_jira/webhook/${i.webhookSecret}`;let a;e[0]!==s?(a=s("settings.jira.webhookTitle"),e[0]=s,e[1]=a):a=e[1];let r;e[2]!==s?(r=s("settings.jira.webhookDescription"),e[2]=s,e[3]=r):r=e[3];let o;e[4]!==n?(o=l.jsx(se,{readOnly:!0,value:n,className:"font-mono text-xs"}),e[4]=n,e[5]=o):o=e[5];let g;e[6]!==s||e[7]!==n?(g=()=>{navigator.clipboard.writeText(n),M.success(s("settings.jira.webhookCopied"))},e[6]=s,e[7]=n,e[8]=g):g=e[8];let c;e[9]!==s?(c=s("settings.jira.webhookCopy"),e[9]=s,e[10]=c):c=e[10];let f;e[11]!==g||e[12]!==c?(f=l.jsx(G,{variant:"outline",size:"sm",className:"shrink-0",onClick:g,children:c}),e[11]=g,e[12]=c,e[13]=f):f=e[13];let d;e[14]!==o||e[15]!==f?(d=l.jsxs("div",{className:"flex items-center gap-2",children:[o,f]}),e[14]=o,e[15]=f,e[16]=d):d=e[16];let m;e[17]===Symbol.for("react.memo_cache_sentinel")?(m=l.jsx(he,{stepKeys:["settings.jira.webhookStep1","settings.jira.webhookStep2","settings.jira.webhookStep3","settings.jira.webhookStep4","settings.jira.webhookStep5"]}),e[17]=m):m=e[17];let u;e[18]!==d?(u=l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-background p-5 flex flex-col gap-4",children:[d,m]}),e[18]=d,e[19]=u):u=e[19];let p;return e[20]!==a||e[21]!==r||e[22]!==u?(p=l.jsx(ae,{title:a,description:r,children:u}),e[20]=a,e[21]=r,e[22]=u,e[23]=p):p=e[23],p}function ct(t){const e=D.c(51),{integration:i}=t,s=z(),n=He(),[a,r]=W.useState(!1);let o;e[0]!==s?(o=s("settings.jira.connectionTitle"),e[0]=s,e[1]=o):o=e[1];let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=()=>r(!0),e[2]=g):g=e[2];let c;e[3]!==s?(c=s("settings.jira.disconnect"),e[3]=s,e[4]=c):c=e[4];let f;e[5]!==c?(f=l.jsx(G,{variant:"outline",size:"sm",onClick:g,children:c}),e[5]=c,e[6]=f):f=e[6];let d;e[7]!==i.siteUrl?(d=l.jsx("p",{className:"text-sm font-medium truncate",children:i.siteUrl}),e[7]=i.siteUrl,e[8]=d):d=e[8];let m;e[9]!==i.email?(m=l.jsx("p",{className:"text-xs mt-0.5 truncate text-muted-foreground",children:i.email}),e[9]=i.email,e[10]=m):m=e[10];let u;e[11]!==d||e[12]!==m?(u=l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-background px-5 py-4",children:[d,m]}),e[11]=d,e[12]=m,e[13]=u):u=e[13];let p;e[14]!==s?(p=s("settings.jira.disconnectTitle"),e[14]=s,e[15]=p):p=e[15];let x;e[16]!==p?(x=l.jsx(Te,{children:p}),e[16]=p,e[17]=x):x=e[17];let S;e[18]!==s?(S=s("settings.jira.disconnectDescription"),e[18]=s,e[19]=S):S=e[19];let b;e[20]!==S?(b=l.jsx(Ie,{children:S}),e[20]=S,e[21]=b):b=e[21];let h;e[22]!==b||e[23]!==x?(h=l.jsxs(Pe,{children:[x,b]}),e[22]=b,e[23]=x,e[24]=h):h=e[24];let N;e[25]!==s?(N=s("settings.jira.cancel"),e[25]=s,e[26]=N):N=e[26];let y;e[27]!==N?(y=l.jsx(Ae,{children:N}),e[27]=N,e[28]=y):y=e[28];let j;e[29]!==n||e[30]!==s?(j=()=>n.mutate(void 0,{onSuccess:()=>M.success(s("settings.jira.disconnected")),onError:P=>M.error(U(P,s("settings.jira.saveFailed")))}),e[29]=n,e[30]=s,e[31]=j):j=e[31];let C;e[32]!==s?(C=s("settings.jira.disconnect"),e[32]=s,e[33]=C):C=e[33];let k;e[34]!==j||e[35]!==C?(k=l.jsx(De,{onClick:j,children:C}),e[34]=j,e[35]=C,e[36]=k):k=e[36];let _;e[37]!==y||e[38]!==k?(_=l.jsxs(Ee,{children:[y,k]}),e[37]=y,e[38]=k,e[39]=_):_=e[39];let T;e[40]!==h||e[41]!==_?(T=l.jsxs(Fe,{children:[h,_]}),e[40]=h,e[41]=_,e[42]=T):T=e[42];let v;e[43]!==a||e[44]!==T?(v=l.jsx(Me,{open:a,onOpenChange:r,children:T}),e[43]=a,e[44]=T,e[45]=v):v=e[45];let w;return e[46]!==o||e[47]!==v||e[48]!==f||e[49]!==u?(w=l.jsxs(ae,{title:o,actions:f,children:[u,v]}),e[46]=o,e[47]=v,e[48]=f,e[49]=u,e[50]=w):w=e[50],w}function dt(){const t=D.c(4),e=Qe();if(e.isPending){let s;return t[0]===Symbol.for("react.memo_cache_sentinel")?(s=l.jsx(xe,{className:"h-40 w-full"}),t[0]=s):s=t[0],s}if(!e.data){let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=l.jsx(tt,{}),t[1]=s):s=t[1],s}let i;return t[2]!==e.data?(i=l.jsxs(l.Fragment,{children:[l.jsx(ct,{integration:e.data}),l.jsx(nt,{integration:e.data}),l.jsx(ot,{integration:e.data})]}),t[2]=e.data,t[3]=i):i=t[3],i}function mt(){const t=D.c(18),e=z();let i;t[0]!==e?(i=e("settings.nav.tasks"),t[0]=e,t[1]=i):i=t[1];let s;t[2]!==i?(s=l.jsx(le.Title,{children:i}),t[2]=i,t[3]=s):s=t[3];let n;t[4]===Symbol.for("react.memo_cache_sentinel")?(n=l.jsx(ze,{size:18}),t[4]=n):n=t[4];let a;t[5]!==e?(a=e("settings.jira.sectionTitle"),t[5]=e,t[6]=a):a=t[6];let r;t[7]!==a?(r=l.jsxs("span",{className:"flex items-center gap-2",children:[n,a]}),t[7]=a,t[8]=r):r=t[8];let o;t[9]!==e?(o=e("settings.jira.pageDescription"),t[9]=e,t[10]=o):o=t[10];let g;t[11]===Symbol.for("react.memo_cache_sentinel")?(g=l.jsx("div",{className:"flex flex-col gap-8",children:l.jsx(dt,{})}),t[11]=g):g=t[11];let c;t[12]!==r||t[13]!==o?(c=l.jsx(Oe,{title:r,description:o,children:g}),t[12]=r,t[13]=o,t[14]=c):c=t[14];let f;return t[15]!==s||t[16]!==c?(f=l.jsx(le,{children:l.jsx(le.Content,{children:l.jsx(le.Body,{children:l.jsxs(Ke,{children:[s,c]})})})}),t[15]=s,t[16]=c,t[17]=f):f=t[17],f}function es(){const t=D.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx(Je,{capability:"org:manage",area:"settings",children:l.jsx(mt,{})}),t[0]=e):e=t[0],e}export{es as default};
@@ -1 +0,0 @@
1
- import{c,F as d,o as I,e as E,K as g,n as K}from"./index-CacyxM-B.js";import{S as y,u as m}from"./use-mcp-client-DRcy9vk6.js";function f(e,t){if(e?.isError)throw new Error(e.content?.[0]?.text??t);if(!e.structuredContent)throw new Error(t);return e.structuredContent}function C(){const e=c.c(10),{org:t}=d();let n;e[0]!==t.id||e[1]!==t.slug?(n={connectionId:y,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=n):n=e[2];const r=m(n);let o;e[3]!==t.id?(o=g.apiKeysList(t.id),e[3]=t.id,e[4]=o):o=e[4];let s;e[5]!==r?(s=async()=>{const l=await r.callTool({name:"API_KEY_LIST",arguments:{}});return f(l,"Failed to list API keys").items},e[5]=r,e[6]=s):s=e[6];let i;return e[7]!==o||e[8]!==s?(i={queryKey:o,queryFn:s,staleTime:3e4},e[7]=o,e[8]=s,e[9]=i):i=e[9],K(i)}function S(){const e=c.c(11),{org:t}=d();let n;e[0]!==t.id||e[1]!==t.slug?(n={connectionId:y,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=n):n=e[2];const r=m(n),o=I();let s;e[3]!==r?(s=async u=>{const a=await r.callTool({name:"API_KEY_CREATE",arguments:{name:u.name,permissions:u.permissions??{"*":["*"]}}});return f(a,"Failed to create API key")},e[3]=r,e[4]=s):s=e[4];let i;e[5]!==t.id||e[6]!==o?(i=()=>{o.invalidateQueries({queryKey:g.apiKeysList(t.id)})},e[5]=t.id,e[6]=o,e[7]=i):i=e[7];let l;return e[8]!==s||e[9]!==i?(l={mutationFn:s,onSuccess:i},e[8]=s,e[9]=i,e[10]=l):l=e[10],E(l)}function P(){const e=c.c(11),{org:t}=d();let n;e[0]!==t.id||e[1]!==t.slug?(n={connectionId:y,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=n):n=e[2];const r=m(n),o=I();let s;e[3]!==r?(s=async u=>{const a=await r.callTool({name:"API_KEY_DELETE",arguments:{keyId:u}});return f(a,"Failed to delete API key")},e[3]=r,e[4]=s):s=e[4];let i;e[5]!==t.id||e[6]!==o?(i=()=>{o.invalidateQueries({queryKey:g.apiKeysList(t.id)})},e[5]=t.id,e[6]=o,e[7]=i):i=e[7];let l;return e[8]!==s||e[9]!==i?(l={mutationFn:s,onSuccess:i},e[8]=s,e[9]=i,e[10]=l):l=e[10],E(l)}export{C as a,P as b,S as u};
@@ -1 +0,0 @@
1
- import{c as U,F as q,K as T,n as I,o as x,e as y,t as m}from"./index-CacyxM-B.js";import{S as z,u as J}from"./use-mcp-client-DRcy9vk6.js";import{u as Q}from"./studio-tools-O0czolAT.js";function V(t){if(t.paramsSchema&&typeof t.paramsSchema=="object")return t;const e={};if(Array.isArray(t.params))for(const s of t.params)e[s.name]={type:s.type,description:s.description,enum:s.enum};else t.params&&typeof t.params=="object"&&Object.assign(e,t.params);return{type:t.type,description:t.description,paramsSchema:e}}function st(t){const e=U.c(12),{org:s}=q(),l=t??z;let a;e[0]!==s.id||e[1]!==s.slug||e[2]!==l?(a={connectionId:l,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=l,e[3]=a):a=e[3];const i=J(a);let n;e[4]!==t?(n=T.toolCall(t??"","TRIGGER_LIST",""),e[4]=t,e[5]=n):n=e[5];let o;e[6]!==i?(o=async()=>{const d=await i.callTool({name:"TRIGGER_LIST",arguments:{}});return(d.structuredContent??d).triggers.map(V)},e[6]=i,e[7]=o):o=e[7];const c=!!t;let r;return e[8]!==n||e[9]!==o||e[10]!==c?(r={queryKey:n,queryFn:o,enabled:c,staleTime:3e4},e[8]=n,e[9]=o,e[10]=c,e[11]=r):r=e[11],I(r)}function it(t){const e=U.c(9),{org:s}=q(),l=Q();let a;e[0]!==s.id||e[1]!==t?(a=T.automations(s.id,t),e[0]=s.id,e[1]=t,e[2]=a):a=e[2];let i;e[3]!==l||e[4]!==t?(i=async()=>(await l.call("AUTOMATION_LIST",t!=null?{virtual_mcp_id:t}:{})).automations,e[3]=l,e[4]=t,e[5]=i):i=e[5];let n;return e[6]!==a||e[7]!==i?(n={queryKey:a,queryFn:i,staleTime:1e4},e[6]=a,e[7]=i,e[8]=n):n=e[8],I(n)}function ot(t){const e=U.c(10),{org:s}=q(),l=Q();let a;e[0]!==t||e[1]!==s.id?(a=T.automation(s.id,t),e[0]=t,e[1]=s.id,e[2]=a):a=e[2];let i;e[3]!==t||e[4]!==l?(i=async()=>(await l.call("AUTOMATION_GET",{id:t})).automation,e[3]=t,e[4]=l,e[5]=i):i=e[5];const n=!!t;let o;return e[6]!==a||e[7]!==i||e[8]!==n?(o={queryKey:a,queryFn:i,enabled:n,staleTime:1e4},e[6]=a,e[7]=i,e[8]=n,e[9]=o):o=e[9],I(o)}function at(t,e){const s=U.c(12),{org:l}=q(),a=Q();let i;s[0]!==t||s[1]!==l.id||s[2]!==e?(i=T.automationRunStats(l.id,t,JSON.stringify(e??{})),s[0]=t,s[1]=l.id,s[2]=e,s[3]=i):i=s[3];let n;s[4]!==t||s[5]!==e||s[6]!==a?(n=async()=>await a.call("AUTOMATION_RUN_STATS",{automation_id:t,...e?.startDate?{startDate:e.startDate}:{},...e?.endDate?{endDate:e.endDate}:{}}),s[4]=t,s[5]=e,s[6]=a,s[7]=n):n=s[7];const o=!!t;let c;return s[8]!==i||s[9]!==n||s[10]!==o?(c={queryKey:i,queryFn:n,enabled:o,staleTime:3e4},s[8]=i,s[9]=n,s[10]=o,s[11]=c):c=s[11],I(c)}function nt(t){return{name:"New Automation",messages:[],models:{tier:"smart"},temperature:.5,active:!0,virtual_mcp_id:t}}function lt(){const t=U.c(64),{org:e}=q(),s=Q(),l=x();let a;t[0]!==e||t[1]!==l?(a=()=>l.invalidateQueries({queryKey:T.automationsAll(e.id)}),t[0]=e,t[1]=l,t[2]=a):a=t[2];const i=a;let n;t[3]!==e||t[4]!==l?(n=u=>l.invalidateQueries({queryKey:T.automation(e.id,u)}),t[3]=e,t[4]=l,t[5]=n):n=t[5];const o=n;let c;t[6]!==s?(c=async u=>await s.call("AUTOMATION_CREATE",u),t[6]=s,t[7]=c):c=t[7];let r;t[8]!==i?(r=()=>{i(),m.success("Automation created successfully")},t[8]=i,t[9]=r):r=t[9];let d;t[10]!==c||t[11]!==r?(d={mutationFn:c,onSuccess:r,onError:X},t[10]=c,t[11]=r,t[12]=d):d=t[12];const D=y(d);let A;t[13]!==s?(A=async u=>await s.call("AUTOMATION_UPDATE",u),t[13]=s,t[14]=A):A=t[14];let p;t[15]!==i||t[16]!==o?(p=(u,f)=>{i(),typeof f.id=="string"&&o(f.id),m.success("Automation updated successfully")},t[15]=i,t[16]=o,t[17]=p):p=t[17];let G;t[18]!==A||t[19]!==p?(G={mutationFn:A,onSuccess:p,onError:W},t[18]=A,t[19]=p,t[20]=G):G=t[20];const j=y(G);let g;t[21]!==s?(g=async u=>await s.call("AUTOMATION_DELETE",{id:u}),t[21]=s,t[22]=g):g=t[22];let _;t[23]!==i||t[24]!==e||t[25]!==l?(_=(u,f)=>{l.removeQueries({queryKey:T.automation(e.id,f)}),i(),m.success("Automation deleted successfully")},t[23]=i,t[24]=e,t[25]=l,t[26]=_):_=t[26];let $;t[27]!==g||t[28]!==_?($={mutationFn:g,onSuccess:_,onError:H},t[27]=g,t[28]=_,t[29]=$):$=t[29];const k=y($);let S;t[30]!==s?(S=async u=>await s.call("AUTOMATION_TRIGGER_ADD",u),t[30]=s,t[31]=S):S=t[31];let E;t[32]!==i||t[33]!==o?(E=u=>{i(),o(u.automation_id)},t[32]=i,t[33]=o,t[34]=E):E=t[34];let K;t[35]!==S||t[36]!==E?(K={mutationFn:S,onSuccess:E},t[35]=S,t[36]=E,t[37]=K):K=t[37];const P=y(K);let O;t[38]!==s?(O=async u=>await s.call("AUTOMATION_TRIGGER_ROTATE_TOKEN",{trigger_id:u.trigger_id}),t[38]=s,t[39]=O):O=t[39];let R;t[40]!==i||t[41]!==o?(R=(u,f)=>{i(),o(f.automation_id)},t[40]=i,t[41]=o,t[42]=R):R=t[42];let C;t[43]!==O||t[44]!==R?(C={mutationFn:O,onSuccess:R},t[43]=O,t[44]=R,t[45]=C):C=t[45];const h=y(C);let F;t[46]!==s?(F=async u=>await s.call("AUTOMATION_TRIGGER_REMOVE",{trigger_id:u.trigger_id}),t[46]=s,t[47]=F):F=t[47];let N;t[48]!==i||t[49]!==o?(N=(u,f)=>{i(),o(f.automation_id)},t[48]=i,t[49]=o,t[50]=N):N=t[50];let b;t[51]!==F||t[52]!==N?(b={mutationFn:F,onSuccess:N},t[51]=F,t[52]=N,t[53]=b):b=t[53];const v=y(b);let L;t[54]!==s?(L={mutationFn:async u=>await s.call("AUTOMATION_RUN",{id:u}),onSuccess:B,onError:Y},t[54]=s,t[55]=L):L=t[55];const w=y(L);let M;return t[56]!==D||t[57]!==k||t[58]!==w||t[59]!==P||t[60]!==v||t[61]!==h||t[62]!==j?(M={create:D,update:j,remove:k,triggerAdd:P,triggerRemove:v,triggerRotateToken:h,run:w},t[56]=D,t[57]=k,t[58]=w,t[59]=P,t[60]=v,t[61]=h,t[62]=j,t[63]=M):M=t[63],M}function Y(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to run automation: ${e}`)}function B(t){t.skipped?m.info(`Automation skipped: ${t.skipped}`):t.error?m.error(`Automation failed: ${t.error}`):m.success("Automation triggered")}function H(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to delete automation: ${e}`)}function W(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to update automation: ${e}`)}function X(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to create automation: ${e}`)}export{st as a,ot as b,it as c,nt as d,at as e,lt as u};
@@ -1 +0,0 @@
1
- import{c as $,b as G,j as t,y as xn,B as ye,r as V,aT as vn,d as rt,s as bn,m as Q,a as Te,t as X,w as jn,k as Ve,p as K,F as le,f as at,u as lt,L as yn,D as Cn,$ as _n,a0 as wn,I as Ct,G as Nn,K as Ue,o as Sn,n as He,aQ as kn,av as In}from"./index-CacyxM-B.js";import{i as Vt}from"./ChevronRight-H-_IIqWd.js";import{i as Dn}from"./X-VMfnK-j5.js";import{aK as An,T as Tn,A as qe,f as Mn,s as gt,aC as Pn,aL as On,aM as Fn}from"./agent-icon-BDevt-8Z.js";import{t as _t}from"./ChevronDown-DiERg-yU.js";import{T as Me,a as Pe,c as Oe}from"./tooltip-CwIq9zTG.js";import{u as Ut,d as qt,c as Kt}from"./sidebar-BDv_n64F.js";import{a as ct,i as $n,f as zn,S as Wt,u as Ln,W as Bn,m as Pt,C as Qt,g as En}from"./use-mcp-client-DRcy9vk6.js";import{u as Rn,a as wt}from"./use-virtual-mcp-zFcH9fRu.js";import{a as Xe,b as Nt,P as St}from"./popover-5hCe1k-b.js";import{i as st}from"./Check-CSFy6eOj.js";import{s as Ke}from"./Plus-m61KPSTg.js";import{i as Xt}from"./SearchMd-CF01LhHu.js";import{s as Yt}from"./XClose-BmVO_SaY.js";import{C as Gn,d as Ot}from"./self-tool-result-DaPbHreD.js";import{T as kt}from"./toolbar-ClzusW5n.js";import{S as Hn}from"./skeleton-DOg01VWn.js";import{D as Jt,a as Zt,b as en,c as Vn,g as Un,e as qn,f as Kn}from"./drawer-lF-HaYn9.js";import{u as tn}from"./use-mobile-c0ak1uw4.js";import{a as Wn,G as Qn}from"./github-repo-picker-CcDCsGzG.js";import{g as Xn,a as nn,u as dt,c as Yn}from"./hooks-D72xT78n.js";import{u as Jn,g as Zn,a as es,b as ts}from"./use-navigate-to-agent-IPGb4TnC.js";import{b as ns,a as sn,g as ss}from"./agent-capabilities-C4tLW0Za.js";import{u as ut,f as os}from"./shell-layout-VRjP3s0M.js";import{f as is}from"./reusable-new-chat-CouMjkYR.js";import{C as rs}from"./collection-search-DGOZ00E9.js";import{g as as,a as ls,b as cs,e as ds}from"./extract-connection-data-BJ1FOt2x.js";import{u as on,a as rn,g as us,C as ht}from"./connection-card-BER9PD2I.js";import{e as It,d as Dt,a as At,b as Tt,h as an,c as fs}from"./dialog-Ww_zj2g-.js";import{d as pe,a as xe,e as ve,b as be,c as je,F as Ft}from"./form-BhElkTfE.js";import{I as Le}from"./input-B8ln-0Wl.js";import{S as ms,a as gs,b as hs,c as ps,d as Qe}from"./select-CwAouusu.js";import{T as xs}from"./textarea-CD_pYqo3.js";import{b as ln}from"./use-connection-BS7_Pbag.js";import{n as tt,i as pt}from"./Tool02-DtJ6WkGT.js";import{c as vs,i as Je,a as $t,E as bs,p as js,b as ys,d as Cs}from"./connection-form-helpers-ZW-hGCeS.js";import{a as xt}from"./authenticate-and-persist-oauth-BwcRtSiC.js";import{g as _s}from"./connection-slug-eyAPH6o3.js";import{C as ws}from"./collection-tabs-DaZaBm6K.js";import{u as zt}from"./use-infinite-scroll-ChfJMk5S.js";import{B as Ze}from"./badge-Bc-IWDm5.js";import{u as Ns}from"./useSuspenseInfiniteQuery-CNPxNyM-.js";import{g as ot}from"./metadata-dUsYcpuu.js";import{u as ft}from"./studio-tools-O0czolAT.js";import{u as Ss}from"./use-ai-providers-DF6xoNtC.js";import{i as ks}from"./FilterLines-Dc1F-WNI.js";import{a as Is,T as Ds}from"./toggle-group-BFyHFJ9G.js";import{d as As,a as Ts,c as Ms,b as Ps,C as Os,e as Fs}from"./command-D63NDRD_.js";import{i as cn}from"./Zap-BrJ2b2V7.js";import{c as $s,d as zs,b as Ls,f as Bs,g as Es,e as Rs,a as Gs,A as Hs}from"./alert-dialog-DRGp9yFR.js";import{n as Vs}from"./Stars02-CLHJV6ce.js";import{g as Us,u as qs,S as Ks}from"./use-clock-tick-Dht-z9YX.js";import{a as Ws}from"./format-time-BnbuEtat.js";import{f as Qs}from"./tab-id-ZL6F14qy.js";const Xs="https://decoims.com/image?src=decocms%2F06b54678-5335-4671-b63a-e13d9e541155%2Fagataesteves.png&quality=original&fit=cover&width=160&height=160";function Ys(){const n=$.c(13),e=G();let s;n[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("img",{src:"/logos/summit/monte-carlo.svg",alt:"Monte Carlo",className:"h-14 w-[112px] shrink-0 self-start object-contain object-left brightness-0 invert"}),n[0]=s):s=n[0];let i;n[1]!==e?(i=e("routes.commerceOnboarding.connectModal.quote"),n[1]=e,n[2]=i):i=n[2];let r;n[3]!==i?(r=t.jsxs("blockquote",{className:"text-lg font-medium leading-[1.45] lg:text-xl",children:["“",i,"”"]}),n[3]=i,n[4]=r):r=n[4];let o;n[5]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("img",{src:Xs,alt:"",className:"size-10 shrink-0 rounded-full object-cover",loading:"lazy"}),n[5]=o):o=n[5];let a;n[6]!==e?(a=e("routes.commerceOnboarding.connectModal.quoteAuthor"),n[6]=e,n[7]=a):a=n[7];let l;n[8]!==a?(l=t.jsxs("figcaption",{className:"flex items-center gap-2.5",children:[o,t.jsx("span",{className:"text-base font-medium",children:a})]}),n[8]=a,n[9]=l):l=n[9];let c;return n[10]!==r||n[11]!==l?(c=t.jsxs("div",{className:"relative flex flex-col gap-8 text-white",children:[s,r,l]}),n[10]=r,n[11]=l,n[12]=c):c=n[12],c}function Js(){const n=$.c(19),e=G();let s;n[0]!==e?(s=e("routes.commerceOnboarding.connectModal.trustRevoke"),n[0]=e,n[1]=s):s=n[1];let i;n[2]!==s?(i={Icon:An,label:s},n[2]=s,n[3]=i):i=n[3];let r;n[4]!==e?(r=e("routes.commerceOnboarding.connectModal.trustEncrypted"),n[4]=e,n[5]=r):r=n[5];let o;n[6]!==r?(o={Icon:xn,label:r},n[6]=r,n[7]=o):o=n[7];let a;n[8]!==e?(a=e("routes.commerceOnboarding.connectModal.trustNeverSold"),n[8]=e,n[9]=a):a=n[9];let l;n[10]!==a?(l={Icon:Tn,label:a},n[10]=a,n[11]=l):l=n[11];let c;n[12]!==i||n[13]!==o||n[14]!==l?(c=[i,o,l],n[12]=i,n[13]=o,n[14]=l,n[15]=c):c=n[15];const d=c;let f;n[16]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("div",{className:"h-px w-full bg-white/15"}),n[16]=f):f=n[16];let m;return n[17]!==d?(m=t.jsxs("div",{className:"relative flex flex-col gap-2.5 text-white",children:[f,t.jsx("ul",{className:"mt-1 flex flex-col gap-2.5",children:d.map(Zs)})]}),n[17]=d,n[18]=m):m=n[18],m}function Zs(n){const{Icon:e,label:s}=n;return t.jsxs("li",{className:"flex items-center gap-2.5 text-[13px] leading-tight text-white/70",children:[t.jsx(e,{className:"size-4 shrink-0 opacity-85"}),s]},s)}function _r(n){const e=$.c(22),{siteHost:s,footer:i,onClose:r,children:o}=n,a=G(),l=s?`https://www.google.com/s2/favicons?domain=${s}&sz=128`:null;let c;e[0]!==r||e[1]!==a?(c=r&&t.jsx("button",{type:"button",onClick:r,"aria-label":a("routes.commerceOnboarding.connectModal.close"),className:"absolute right-3 top-3 z-10 flex size-9 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-black/10 hover:text-foreground lg:text-white/80 lg:hover:bg-white/15 lg:hover:text-white",children:t.jsx(Dn,{size:18})}),e[0]=r,e[1]=a,e[2]=c):c=e[2];let d,f;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"size-7 shrink-0 dark:hidden"}),f=t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"hidden size-7 shrink-0 dark:block"}),e[3]=d,e[4]=f):(d=e[3],f=e[4]);let m;e[5]!==l||e[6]!==s?(m=s&&t.jsxs(t.Fragment,{children:[t.jsx(Vt,{size:16,className:"shrink-0 text-foreground/25"}),l&&t.jsx("span",{className:"flex size-4 shrink-0 items-center justify-center overflow-hidden rounded bg-white",children:t.jsx("img",{src:l,alt:"",className:"size-full"})}),t.jsx("span",{className:"truncate text-[15px] leading-tight text-muted-foreground",children:s})]}),e[5]=l,e[6]=s,e[7]=m):m=e[7];let u;e[8]!==m?(u=t.jsxs("div",{className:"flex items-center gap-2",children:[d,f,m]}),e[8]=m,e[9]=u):u=e[9];let p;e[10]!==i?(p=t.jsx("div",{className:"flex shrink-0 flex-col gap-3",children:i}),e[10]=i,e[11]=p):p=e[11];let y;e[12]!==o||e[13]!==u||e[14]!==p?(y=t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-8 bg-background p-6 lg:p-8",children:[u,o,p]}),e[12]=o,e[13]=u,e[14]=p,e[15]=y):y=e[15];let x,g;e[16]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("img",{src:"https://decoims.com/image?src=decocms%2F8191643a-1947-4c30-afb4-36b8073c90fb%2Fbg-quote.png&quality=original&fit=cover&width=880",alt:"",className:"absolute inset-0 size-full object-cover"}),g=t.jsx("div",{className:"absolute inset-0 bg-black/20"}),e[16]=x,e[17]=g):(x=e[16],g=e[17]);let h;e[18]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsxs("aside",{className:"relative hidden shrink-0 overflow-hidden lg:flex lg:w-[440px] lg:flex-col lg:p-14",children:[x,g,t.jsxs("div",{className:"relative z-10 flex h-full flex-col",children:[t.jsx("div",{className:"flex-1"}),t.jsx(Ys,{}),t.jsx("div",{className:"flex-1"}),t.jsx(Js,{})]})]}),e[18]=h):h=e[18];let v;return e[19]!==c||e[20]!==y?(v=t.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col lg:flex-row",children:[c,y,h]}),e[19]=c,e[20]=y,e[21]=v):v=e[21],v}function wr(n){const e=$.c(5),{ready:s,pending:i,label:r,onClick:o,children:a}=n,l=i||!s,c=s&&!i?a:null;let d;return e[0]!==r||e[1]!==o||e[2]!==l||e[3]!==c?(d=t.jsxs(ye,{type:"button",size:"lg",className:"h-auto min-h-12 w-full whitespace-normal rounded-lg py-3 text-center text-base font-medium leading-tight",onClick:o,disabled:l,children:[r,c]}),e[0]=r,e[1]=o,e[2]=l,e[3]=c,e[4]=d):d=e[4],d}function dn(){const n=V.useContext(vn),{data:e,refetch:s}=n.hooks.useListUserInvitations();return{invitations:(e??[]).filter(r=>r.status==="pending"&&new Date(r.expiresAt)>new Date),refetch:()=>s?.()}}function eo(n){let e=0;for(let i=0;i<n.length;i++)e=n.charCodeAt(i)+((e<<5)-e);const s=Math.abs(e)%360;return{backgroundColor:`hsl(${s} 55% 70%)`,color:`hsl(${s} 55% 20%)`}}function Mt(n){const e=$.c(13),{org:s,size:i}=n,r=i===void 0?"sm":i,o=r==="xs"?"size-5":"size-6",a=r==="xs"?"text-[9px]":"text-xs";let l;e[0]!==o?(l=Q(o,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=o,e[1]=l):l=e[1];let c;e[2]!==s.logo||e[3]!==s.name?(c=s.logo?void 0:eo(s.name),e[2]=s.logo,e[3]=s.name,e[4]=c):c=e[4];let d;e[5]!==s.logo||e[6]!==s.name||e[7]!==a?(d=s.logo?t.jsx("img",{src:s.logo,alt:"",className:"size-full object-cover"}):t.jsx("span",{className:Q("font-semibold leading-none",a),children:s.name.slice(0,2).toUpperCase()}),e[5]=s.logo,e[6]=s.name,e[7]=a,e[8]=d):d=e[8];let f;return e[9]!==l||e[10]!==c||e[11]!==d?(f=t.jsx("div",{className:l,style:c,children:d}),e[9]=l,e[10]=c,e[11]=d,e[12]=f):f=e[12],f}function to({invitation:n,onChanged:e}){const s=G(),[i,r]=V.useState(!1),o=n.organizationName??s("header.orgSwitcher.unknownOrganization"),a=async()=>{r(!0);try{const d=await Te.organization.acceptInvitation({invitationId:n.id});if(d.error){X.error(d.error.message),r(!1);return}}catch{X.error(s("header.orgSwitcher.failedToAcceptInvitation")),r(!1);return}X.success(s("header.orgSwitcher.joined",{name:o})),jn();let c;try{c=(await Te.organization.getFullOrganization({query:{organizationId:n.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},l=async()=>{r(!0);try{const c=await Te.organization.rejectInvitation({invitationId:n.id});if(c.error){X.error(c.error.message),r(!1);return}X.success(s("header.orgSwitcher.invitationDeclined")),r(!1),e()}catch{X.error(s("header.orgSwitcher.failedToDeclineInvitation")),r(!1)}};return t.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[t.jsx(Mt,{org:{name:o},size:"sm"}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"truncate text-sm font-medium",children:o}),t.jsx("p",{className:"truncate text-xs text-muted-foreground",children:s("header.orgSwitcher.invitedToJoin")})]}),t.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[t.jsx(ye,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:a,disabled:i,children:s("header.orgSwitcher.accept")}),t.jsx(ye,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:l,disabled:i,"aria-label":s("header.orgSwitcher.declineInvitationTo",{name:o}),children:t.jsx(Yt,{size:14})})]})]})}function no(n){const e=$.c(32),{orgParam:s,onSelectOrg:i,onCreateOrg:r}=n,o=G(),{data:a}=bn(),{invitations:l,refetch:c}=dn();let d;e[0]!==s?(d=(P,D)=>P.slug===s?-1:D.slug===s?1:P.name.localeCompare(D.name),e[0]=s,e[1]=d):d=e[1];const f=[...a??[]].sort(d),[m,u]=V.useState(""),p=m.toLowerCase(),y=p?f.filter(P=>P.name.toLowerCase().includes(p)||P.slug.toLowerCase().includes(p)):f;let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(Xt,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=x):x=e[2];let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=P=>u(P.target.value),e[3]=g):g=e[3];let h;e[4]!==m?(h=P=>P.key==="Escape"&&m&&u(""),e[4]=m,e[5]=h):h=e[5];let v;e[6]!==o?(v=o("header.orgSwitcher.searchOrganizations"),e[6]=o,e[7]=v):v=e[7];let j;e[8]!==m||e[9]!==h||e[10]!==v?(j=t.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:m,onChange:g,onKeyDown:h,placeholder:v,className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),e[8]=m,e[9]=h,e[10]=v,e[11]=j):j=e[11];let C;e[12]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Ke,{size:16}),e[12]=C):C=e[12];let w;e[13]!==r?(w=t.jsx("button",{type:"button",onClick:r,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:C}),e[13]=r,e[14]=w):w=e[14];let I;e[15]!==j||e[16]!==w?(I=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[x,j,w]}),e[15]=j,e[16]=w,e[17]=I):I=e[17];const M="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1";let b;e[18]!==l||e[19]!==m||e[20]!==c?(b=!m&&l.map(P=>t.jsx(to,{invitation:P,onChanged:c},P.id)),e[18]=l,e[19]=m,e[20]=c,e[21]=b):b=e[21];const N=y.length===0&&t.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:m?o("header.orgSwitcher.noOrganizationsMatch",{query:m}):o("header.orgSwitcher.noOrganizationsAvailable")});let A;e[22]!==i||e[23]!==s?(A=P=>t.jsxs("button",{type:"button",onClick:()=>i(P.slug),className:Q("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",P.slug===s?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[t.jsx(Mt,{org:P,size:"sm"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:P.name}),t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:P.slug})]}),P.slug===s&&t.jsx(st,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},P.id),e[22]=i,e[23]=s,e[24]=A):A=e[24];const S=y.map(A);let _;e[25]!==b||e[26]!==N||e[27]!==S?(_=t.jsxs("div",{className:M,children:[b,N,S]}),e[25]=b,e[26]=N,e[27]=S,e[28]=_):_=e[28];let T;return e[29]!==_||e[30]!==I?(T=t.jsxs(t.Fragment,{children:[I,_]}),e[29]=_,e[30]=I,e[31]=T):T=e[31],T}function so(n){const e=$.c(22),{trigger:s,orgParam:i,align:r,side:o}=n,a=r===void 0?"start":r,l=o===void 0?"bottom":o,c=rt(),[d,f]=V.useState(!1),[m,u]=V.useState(!1);let p;e[0]!==s?(p=t.jsx(Xe,{asChild:!0,children:s}),e[0]=s,e[1]=p):p=e[1];const y=String(d);let x;e[2]!==c?(x=I=>{f(!1),c({to:"/$org",params:{org:I}})},e[2]=c,e[3]=x):x=e[3];let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{f(!1),u(!0)},e[4]=g):g=e[4];let h;e[5]!==i||e[6]!==y||e[7]!==x?(h=t.jsx(no,{orgParam:i,onSelectOrg:x,onCreateOrg:g},y),e[5]=i,e[6]=y,e[7]=x,e[8]=h):h=e[8];let v;e[9]!==a||e[10]!==l||e[11]!==h?(v=t.jsx(Nt,{side:l,align:a,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:io,onCloseAutoFocus:oo,children:h}),e[9]=a,e[10]=l,e[11]=h,e[12]=v):v=e[12];let j;e[13]!==d||e[14]!==p||e[15]!==v?(j=t.jsxs(St,{open:d,onOpenChange:f,children:[p,v]}),e[13]=d,e[14]=p,e[15]=v,e[16]=j):j=e[16];let C;e[17]!==m?(C=t.jsx(Gn,{open:m,onOpenChange:u}),e[17]=m,e[18]=C):C=e[18];let w;return e[19]!==C||e[20]!==j?(w=t.jsxs(t.Fragment,{children:[j,C]}),e[19]=C,e[20]=j,e[21]=w):w=e[21],w}function oo(n){return n.preventDefault()}function io(n){n.preventDefault(),n.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function ro(n){const e=$.c(21),{value:s,onChange:i,placeholder:r,onKeyDown:o,className:a,isSearching:l,disabled:c}=n,d=r===void 0?"Search...":r;let f;e[0]!==a?(f=Q("shrink-0 w-full border-b border-border h-12",a),e[0]=a,e[1]=f):f=e[1];const m=c?"cursor-not-allowed opacity-50":"cursor-text";let u;e[2]!==m?(u=Q("flex items-center gap-2.5 h-12 px-4",m),e[2]=m,e[3]=u):u=e[3];let p;e[4]!==l?(p=l?t.jsx(Ve,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):t.jsx(Xt,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=l,e[5]=p):p=e[5];let y;e[6]!==i?(y=v=>i(v.target.value),e[6]=i,e[7]=y):y=e[7];let x;e[8]!==c||e[9]!==o||e[10]!==d||e[11]!==y||e[12]!==s?(x=t.jsx("input",{type:"text",value:s,onChange:y,onKeyDown:o,placeholder:d,disabled:c,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=c,e[9]=o,e[10]=d,e[11]=y,e[12]=s,e[13]=x):x=e[13];let g;e[14]!==u||e[15]!==p||e[16]!==x?(g=t.jsxs("label",{className:u,children:[p,x]}),e[14]=u,e[15]=p,e[16]=x,e[17]=g):g=e[17];let h;return e[18]!==f||e[19]!==g?(h=t.jsx("div",{className:f,children:g}),e[18]=f,e[19]=g,e[20]=h):h=e[20],h}function ao(n,e,s){if(!s)return null;const i=Xn(n,e);return i?i.threads.get().find(o=>o.id===s)?.branch??null:null}function lo(n){const e=$.c(6),{value:s,onChange:i}=n,r=G();let o;e[0]!==r?(o=r("sidebar.agentsSection.searchAgents"),e[0]=r,e[1]=o):o=e[1];let a;return e[2]!==i||e[3]!==o||e[4]!==s?(a=t.jsx(ro,{value:s,onChange:i,placeholder:o}),e[2]=i,e[3]=o,e[4]=s,e[5]=a):a=e[5],a}function co(){const n=$.c(4),e=G();let s;n[0]!==e?(s=e("sidebar.agentsSection.noAgentsFound"),n[0]=e,n[1]=s):s=n[1];let i;return n[2]!==s?(i=t.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:s}),n[2]=s,n[3]=i):i=n[3],i}function uo(n){const e=$.c(10),{org:s,onClose:i}=n,r=G();let o;e[0]!==s.slug?(o={org:s.slug},e[0]=s.slug,e[1]=o):o=e[1];let a;e[2]!==i?(a=()=>i(),e[2]=i,e[3]=a):a=e[3];let l;e[4]!==r?(l=r("sidebar.agentsSection.seeAllAgents"),e[4]=r,e[5]=l):l=e[5];let c;return e[6]!==o||e[7]!==a||e[8]!==l?(c=t.jsx("div",{className:"border-t border-border px-3 py-2.5",children:t.jsx(yn,{to:"/$org/settings/agents",params:o,onClick:a,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:l})}),e[6]=o,e[7]=a,e[8]=l,e[9]=c):c=e[9],c}function fo(){const n=$.c(4),e=G();let s;n[0]!==e?(s=e("sidebar.agentsSection.agents"),n[0]=e,n[1]=s):s=n[1];let i;return n[2]!==s?(i=t.jsx(un,{children:s}),n[2]=s,n[3]=i):i=n[3],i}function mo(n){const e=$.c(11),{onImportFromGithub:s}=n,i=G();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Qn,{className:"size-3.5"}),e[0]=r):r=e[0];let o;e[1]!==i?(o=i("sidebar.agentsSection.import"),e[1]=i,e[2]=o):o=e[2];let a;e[3]!==s||e[4]!==o?(a=t.jsxs("button",{type:"button",onClick:s,className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",children:[r,o]}),e[3]=s,e[4]=o,e[5]=a):a=e[5];let l;e[6]!==i?(l=i("sidebar.agentsSection.codeAgents"),e[6]=i,e[7]=l):l=e[7];let c;return e[8]!==a||e[9]!==l?(c=t.jsx(un,{action:a,children:l}),e[8]=a,e[9]=l,e[10]=c):c=e[10],c}function go(n){const e=$.c(11),{setOpen:s,emptyCtaClass:i}=n,r=G();let o;e[0]!==r?(o=r("sidebar.agentsSection.browseAgents"),e[0]=r,e[1]=o):o=e[1];let a;e[2]!==i?(a=Q(i),e[2]=i,e[3]=a):a=e[3];let l;e[4]!==s?(l=()=>{K("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[4]=s,e[5]=l):l=e[5];let c;e[6]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Ke,{className:"size-4"}),e[6]=c):c=e[6];let d;return e[7]!==o||e[8]!==a||e[9]!==l?(d=t.jsx(kt,{"aria-label":o,className:a,onClick:l,children:c}),e[7]=o,e[8]=a,e[9]=l,e[10]=d):d=e[10],d}function ho(n){const e=$.c(17),{setOpen:s,highlightEmpty:i,emptyCtaClass:r}=n,o=G();let a;e[0]!==i||e[1]!==o?(a=i?void 0:o("sidebar.agentsSection.browseAgents"),e[0]=i,e[1]=o,e[2]=a):a=e[2];let l;e[3]!==r?(l=Q(r),e[3]=r,e[4]=l):l=e[4];let c;e[5]!==s?(c=()=>{K("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[5]=s,e[6]=c):c=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Ke,{}),e[7]=d):d=e[7];let f;e[8]!==o?(f=o("sidebar.agentsSection.newAgent"),e[8]=o,e[9]=f):f=e[9];let m;e[10]!==f?(m=t.jsx("span",{children:f}),e[10]=f,e[11]=m):m=e[11];let u;return e[12]!==a||e[13]!==l||e[14]!==c||e[15]!==m?(u=t.jsx(qt,{children:t.jsxs(Kt,{tooltip:a,className:l,onClick:c,children:[d,m]})}),e[12]=a,e[13]=l,e[14]=c,e[15]=m,e[16]=u):u=e[16],u}function po(){const n=$.c(4),e=G();let s;n[0]!==e?(s=e("sidebar.agentsSection.browseAgents"),n[0]=e,n[1]=s):s=n[1];let i;return n[2]!==s?(i=t.jsx(en,{className:"sr-only",children:s}),n[2]=s,n[3]=i):i=n[3],i}function xo(n){const e=$.c(8),{emptyCtaClass:s}=n,i=G();let r;e[0]!==i?(r=i("sidebar.agentsSection.browseAgents"),e[0]=i,e[1]=r):r=e[1];let o;e[2]!==s?(o=Q(s),e[2]=s,e[3]=o):o=e[3];let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Ke,{className:"size-4"}),e[4]=a):a=e[4];let l;return e[5]!==r||e[6]!==o?(l=t.jsx(kt,{"aria-label":r,className:o,children:a}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function vo(n){const e=$.c(19),{wrapEmptyHint:s,highlightEmpty:i,emptyCtaClass:r}=n,o=G();let a;e[0]!==i||e[1]!==o?(a=i?void 0:o("sidebar.agentsSection.browseAgents"),e[0]=i,e[1]=o,e[2]=a):a=e[2];let l;e[3]!==r?(l=Q(r),e[3]=r,e[4]=l):l=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Ke,{}),e[5]=c):c=e[5];let d;e[6]!==o?(d=o("sidebar.agentsSection.newAgent"),e[6]=o,e[7]=d):d=e[7];let f;e[8]!==d?(f=t.jsx("span",{children:d}),e[8]=d,e[9]=f):f=e[9];let m;e[10]!==a||e[11]!==l||e[12]!==f?(m=t.jsx(Xe,{asChild:!0,children:t.jsxs(Kt,{tooltip:a,className:l,children:[c,f]})}),e[10]=a,e[11]=l,e[12]=f,e[13]=m):m=e[13];let u;e[14]!==m||e[15]!==s?(u=s(m),e[14]=m,e[15]=s,e[16]=u):u=e[16];let p;return e[17]!==u?(p=t.jsx(qt,{children:u}),e[17]=u,e[18]=p):p=e[18],p}function bo(n){const e=$.c(9),{children:s}=n,i=G();let r;e[0]!==s?(r=t.jsx(Me,{asChild:!0,children:s}),e[0]=s,e[1]=r):r=e[1];let o;e[2]!==i?(o=i("sidebar.agentsSection.selectAnExistingAgent"),e[2]=i,e[3]=o):o=e[3];let a;e[4]!==o?(a=t.jsx(Pe,{side:"right",sideOffset:8,children:o}),e[4]=o,e[5]=a):a=e[5];let l;return e[6]!==r||e[7]!==a?(l=t.jsxs(Oe,{defaultOpen:!0,delayDuration:0,children:[r,a]}),e[6]=r,e[7]=a,e[8]=l):l=e[8],l}function jo(n){const e=rt(),{create:s}=nn(),{locator:i}=le(),r=at({strict:!1}),o=lt({strict:!1});return async a=>{const l=crypto.randomUUID(),c=a===o.virtualmcpid?ao(n,i,r.taskId??""):null;try{await s({id:l,virtual_mcp_id:a,...c?{branch:c}:{}})}catch{}e({to:"/$org/$taskId",params:{org:n,taskId:l},search:{virtualmcpid:a}})}}function vt(n){const e=$.c(20),{agent:s,selected:i,onClick:r}=n,o=i?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let a;e[0]!==o?(a=Q("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",o),e[0]=o,e[1]=a):a=e[1];let l;e[2]!==s.icon||e[3]!==s.title?(l=t.jsx(qe,{icon:s.icon,name:s.title,size:"xs",className:"shrink-0"}),e[2]=s.icon,e[3]=s.title,e[4]=l):l=e[4];let c;e[5]!==s.title?(c=t.jsx("p",{className:"text-sm font-medium truncate",children:s.title}),e[5]=s.title,e[6]=c):c=e[6];let d;e[7]!==s.description?(d=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[7]=s.description,e[8]=d):d=e[8];let f;e[9]!==c||e[10]!==d?(f=t.jsxs("div",{className:"flex-1 min-w-0",children:[c,d]}),e[9]=c,e[10]=d,e[11]=f):f=e[11];let m;e[12]!==i?(m=i&&t.jsx(st,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=i,e[13]=m):m=e[13];let u;return e[14]!==r||e[15]!==a||e[16]!==l||e[17]!==f||e[18]!==m?(u=t.jsxs("button",{type:"button",onClick:r,className:a,children:[l,f,m]}),e[14]=r,e[15]=a,e[16]=l,e[17]=f,e[18]=m,e[19]=u):u=e[19],u}function un(n){const e=$.c(5),{children:s,action:i}=n;let r;e[0]!==s?(r=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s}),e[0]=s,e[1]=r):r=e[1];let o;return e[2]!==i||e[3]!==r?(o=t.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[r,i]}),e[2]=i,e[3]=r,e[4]=o):o=e[4],o}function yo(n){const e=$.c(23),{onClose:s,onSelectAgent:i,selectedAgentId:r,onImportFromGithub:o}=n,[a,l]=V.useState(""),c=Rn(),d=c??[],{org:f}=le(),{data:m}=Te.useSession(),u=m?.user?.id??"anon",p=Zn(c),y=es(),x=jo(f.slug),g=ns(c),h=a.toLowerCase(),v=d.filter(No).filter(E=>!g.has(E.id)).filter(wo).filter(E=>!a||E.title.toLowerCase().includes(h)),j=v.filter(_o),C=v.filter(Co),w=ct(f.id),I=!a||w.title.toLowerCase().includes(h),M=!!(i&&I);let b;e[0]!==s||e[1]!==i?(b=()=>{i?.(null),s(),l("")},e[0]=s,e[1]=i,e[2]=b):b=e[2];const N=b,A=E=>{if(i){i(E.id),s(),l("");return}ts({orgId:f.id,userId:u},E.id,p),y(),s(),l(""),x(E.id)},S="flex flex-col max-h-[min(640px,80dvh)]";let _;e[3]!==a?(_=t.jsx(lo,{value:a,onChange:l}),e[3]=a,e[4]=_):_=e[4];const T="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5",P=i&&I&&w&&t.jsx(vt,{agent:w,selected:!r||r===w.id,onClick:N}),D=(j.length>0||!a)&&t.jsx(mo,{onImportFromGithub:o}),F=j.map(E=>t.jsx(vt,{agent:E,selected:i?r===E.id:void 0,onClick:()=>A(E)},E.id)),L=C.length>0&&t.jsx(fo,{}),O=C.map(E=>t.jsx(vt,{agent:E,selected:i?r===E.id:void 0,onClick:()=>A(E)},E.id));let z;e[5]!==M||e[6]!==a||e[7]!==v.length?(z=v.length===0&&!M&&a&&t.jsx(co,{}),e[5]=M,e[6]=a,e[7]=v.length,e[8]=z):z=e[8];let U;e[9]!==z||e[10]!==P||e[11]!==D||e[12]!==F||e[13]!==L||e[14]!==O?(U=t.jsxs("div",{className:T,children:[P,D,F,L,O,z]}),e[9]=z,e[10]=P,e[11]=D,e[12]=F,e[13]=L,e[14]=O,e[15]=U):U=e[15];let R;e[16]!==s||e[17]!==f?(R=t.jsx(uo,{org:f,onClose:s}),e[16]=s,e[17]=f,e[18]=R):R=e[18];let q;return e[19]!==U||e[20]!==R||e[21]!==_?(q=t.jsxs("div",{className:S,children:[_,U,R]}),e[19]=U,e[20]=R,e[21]=_,e[22]=q):q=e[22],q}function Co(n){return!sn(n.metadata)}function _o(n){return sn(n.metadata)}function wo(n){return!zn(n.id)}function No(n){return!$n(n.id)}function So(n){const e=$.c(31);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{compact:i,trigger:r,onSelectAgent:o,selectedAgentId:a,side:l,align:c}=s,d=i===void 0?!1:i,f=l===void 0?"right":l,m=c===void 0?"start":c,[u,p]=V.useState(!1),[y,x]=V.useState(!1),g=tn(),{setOpenMobile:h}=Ut(),v=Jn(),j=v?"border border-border":void 0;let C;e[2]!==v?(C=D=>v?t.jsx(bo,{children:D}):D,e[2]=v,e[3]=C):C=e[3];const w=C;let I;e[4]!==g||e[5]!==h?(I=()=>{p(!1),g&&h(!1)},e[4]=g,e[5]=h,e[6]=I):I=e[6];const M=I;let b;e[7]!==M?(b=()=>{M(),x(!0)},e[7]=M,e[8]=b):b=e[8];const N=b;let A;e[9]!==M||e[10]!==N||e[11]!==o||e[12]!==u||e[13]!==a?(A=u&&t.jsx(V.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx(Hn,{className:"h-4 w-24"})}),children:t.jsx(yo,{onClose:M,onSelectAgent:o,selectedAgentId:a,onImportFromGithub:N})}),e[9]=M,e[10]=N,e[11]=o,e[12]=u,e[13]=a,e[14]=A):A=e[14];const S=A;let _;e[15]!==m||e[16]!==d||e[17]!==j||e[18]!==v||e[19]!==g||e[20]!==u||e[21]!==S||e[22]!==f||e[23]!==r||e[24]!==w?(_=g?t.jsxs(t.Fragment,{children:[r?t.jsx("button",{type:"button",onClick:()=>p(!0),className:"contents",children:r}):d?w(t.jsx(go,{setOpen:p,emptyCtaClass:j})):t.jsx(ho,{setOpen:p,highlightEmpty:v,emptyCtaClass:j}),t.jsx(Jt,{open:u,onOpenChange:p,direction:"bottom",children:t.jsxs(Zt,{className:"max-h-[85dvh] p-0",children:[t.jsx(po,{}),S]})})]}):t.jsxs(St,{open:u,onOpenChange:D=>{D&&!u&&K("agent_browser_opened",{surface:"desktop_popover"}),p(D)},children:[r?t.jsx(Xe,{asChild:!0,children:r}):d?w(t.jsx(Xe,{asChild:!0,children:t.jsx(xo,{emptyCtaClass:j})})):t.jsx(vo,{wrapEmptyHint:w,highlightEmpty:v,emptyCtaClass:j}),t.jsx(Nt,{className:"w-[380px] p-0 overflow-hidden",side:f,align:m,children:S})]}),e[15]=m,e[16]=d,e[17]=j,e[18]=v,e[19]=g,e[20]=u,e[21]=S,e[22]=f,e[23]=r,e[24]=w,e[25]=_):_=e[25];let T;e[26]!==y?(T=t.jsx(Wn,{open:y,onOpenChange:x,mode:"agent"}),e[26]=y,e[27]=T):T=e[27];let P;return e[28]!==T||e[29]!==_?(P=t.jsxs(t.Fragment,{children:[_,T]}),e[28]=T,e[29]=_,e[30]=P):P=e[30],P}const ko="inline-flex items-center gap-1.5 min-w-0 rounded-md pl-1 pr-2 py-1.5 text-sm text-foreground hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";function Io(n){const e=$.c(29),{agentId:s,fallback:i,onOpenHome:r,onPick:o}=n,a=G(),l=wt(s)??i??null;let c,d,f,m,u;e[0]!==l?.title||e[1]!==r||e[2]!==a?(u=l?.title??a("header.shellBreadcrumb.superAgentDefaultName"),m="flex min-w-0 items-center gap-0",c="button",d=r,f=a("header.shellBreadcrumb.openAgentHome",{name:u}),e[0]=l?.title,e[1]=r,e[2]=a,e[3]=c,e[4]=d,e[5]=f,e[6]=m,e[7]=u):(c=e[3],d=e[4],f=e[5],m=e[6],u=e[7]);const p=l?.icon??null;let y;e[8]!==p||e[9]!==u?(y=t.jsx(qe,{icon:p,name:u,size:"xs"}),e[8]=p,e[9]=u,e[10]=y):y=e[10];let x;e[11]!==c||e[12]!==d||e[13]!==f||e[14]!==y?(x=t.jsx("button",{type:c,onClick:d,"aria-label":f,className:"flex items-center shrink-0 rounded-md p-1 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:y}),e[11]=c,e[12]=d,e[13]=f,e[14]=y,e[15]=x):x=e[15];let g;e[16]!==u?(g=t.jsx("span",{className:"truncate font-medium max-w-[8rem]",children:u}),e[16]=u,e[17]=g):g=e[17];let h;e[18]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(_t,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[18]=h):h=e[18];let v;e[19]!==g?(v=t.jsxs("button",{type:"button",className:ko,children:[g,h]}),e[19]=g,e[20]=v):v=e[20];let j;e[21]!==s||e[22]!==o||e[23]!==v?(j=t.jsx(So,{side:"bottom",align:"start",selectedAgentId:s,onSelectAgent:o,trigger:v}),e[21]=s,e[22]=o,e[23]=v,e[24]=j):j=e[24];let C;return e[25]!==j||e[26]!==m||e[27]!==x?(C=t.jsxs("div",{className:m,children:[x,j]}),e[25]=j,e[26]=m,e[27]=x,e[28]=C):C=e[28],C}function Nr(n){const e=$.c(30);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{showName:i}=s,r=G(),{org:o}=le(),{state:a,isMobile:l}=Ut(),c=dn().invitations.length>0,d=a==="collapsed"||l;let f;e[2]!==c||e[3]!==o.name||e[4]!==r?(f=c?r("header.shellBreadcrumb.switchOrganizationPendingInvitation",{name:o.name}):r("header.shellBreadcrumb.switchOrganization",{name:o.name}),e[2]=c,e[3]=o.name,e[4]=r,e[5]=f):f=e[5];let m;e[6]!==o?(m=t.jsx(Mt,{org:o,size:"sm"}),e[6]=o,e[7]=m):m=e[7];let u;e[8]!==c||e[9]!==d?(u=c&&t.jsx("span",{className:Q("absolute -right-1 size-2.5 rounded-full bg-destructive ring-2 ring-background",d?"-top-1":"top-1/2 -translate-y-1/2")}),e[8]=c,e[9]=d,e[10]=u):u=e[10];let p;e[11]!==m||e[12]!==u?(p=t.jsxs("span",{className:"relative inline-flex",children:[m,u]}),e[11]=m,e[12]=u,e[13]=p):p=e[13];let y;e[14]!==o.name||e[15]!==i?(y=i&&t.jsx("span",{className:"truncate text-sm font-medium text-foreground max-w-[10rem]",children:o.name}),e[14]=o.name,e[15]=i,e[16]=y):y=e[16];let x;e[17]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(_t,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[17]=x):x=e[17];let g;e[18]!==f||e[19]!==p||e[20]!==y?(g=t.jsx(Me,{asChild:!0,children:t.jsxs("button",{type:"button","aria-label":f,className:"flex items-center gap-1.5 shrink-0 rounded-lg pl-[5px] pr-1.5 py-1.5 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:[p,y,x]})}),e[18]=f,e[19]=p,e[20]=y,e[21]=g):g=e[21];let h;e[22]!==o.slug||e[23]!==g?(h=t.jsx(so,{orgParam:o.slug,trigger:g}),e[22]=o.slug,e[23]=g,e[24]=h):h=e[24];let v;e[25]!==o.name?(v=t.jsx(Pe,{side:"bottom",children:o.name}),e[25]=o.name,e[26]=v):v=e[26];let j;return e[27]!==v||e[28]!==h?(j=t.jsxs(Oe,{children:[h,v]}),e[27]=v,e[28]=h,e[29]=j):j=e[29],j}function Sr(n){const e=$.c(22);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{onNavigate:i}=s,{org:r}=le();let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[2]=o):o=e[2];const a=at(o);let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l={strict:!1},e[3]=l):l=e[3];const c=lt(l),{threads:d}=dt(),{data:f}=Te.useSession(),{setTaskId:m,createNewTask:u}=ut();let p;e[4]!==r.id?(p=ct(r.id),e[4]=r.id,e[5]=p):p=e[5];const y=p,x=y.id,g=a.taskId?c.virtualmcpid??x:x;let h;e[6]!==u||e[7]!==x||e[8]!==i||e[9]!==f?.user?.id||e[10]!==m||e[11]!==d?(h=M=>{const b=M??x,N=is(d,b,f?.user?.id);N?m(N.id,b):u(b),i?.()},e[6]=u,e[7]=x,e[8]=i,e[9]=f?.user?.id,e[10]=m,e[11]=d,e[12]=h):h=e[12];const v=h;let j;e[13]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),e[13]=j):j=e[13];const C=g===x?y:void 0;let w;e[14]!==g||e[15]!==v?(w=()=>v(g),e[14]=g,e[15]=v,e[16]=w):w=e[16];let I;return e[17]!==g||e[18]!==v||e[19]!==C||e[20]!==w?(I=t.jsx(V.Suspense,{fallback:j,children:t.jsx(Io,{agentId:g,fallback:C,onOpenHome:w,onPick:v})}),e[17]=g,e[18]=v,e[19]=C,e[20]=w,e[21]=I):I=e[21],I}function kr(){const n=$.c(24),e=G(),{org:s}=le();let i;n[0]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},n[0]=i):i=n[0];const r=at(i);let o;n[1]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},n[1]=o):o=n[1];const a=lt(o),{threads:l}=dt(),{createNewTask:c}=ut();let d;n[2]!==s.id?(d=ct(s.id),n[2]=s.id,n[3]=d):d=n[3];const f=d.id,m=r.taskId?a.virtualmcpid??f:f;let u;n[4]!==r.taskId||n[5]!==l?(u=(r.taskId?l.find(I=>I.id===r.taskId)?.branch:null)??null,n[4]=r.taskId,n[5]=l,n[6]=u):u=n[6];const p=u;let y;n[7]!==m||n[8]!==c||n[9]!==p?(y=()=>{c(m,p)},n[7]=m,n[8]=c,n[9]=p,n[10]=y):y=n[10];const x=y;let g;n[11]!==e?(g=e("sidebar.taskGroupsList.newChat"),n[11]=e,n[12]=g):g=n[12];let h;n[13]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(Mn,{size:16}),n[13]=h):h=n[13];let v;n[14]!==x||n[15]!==g?(v=t.jsx(Me,{asChild:!0,children:t.jsx("button",{type:"button",onClick:x,"aria-label":g,className:"flex shrink-0 items-center rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:h})}),n[14]=x,n[15]=g,n[16]=v):v=n[16];let j;n[17]!==e?(j=e("sidebar.taskGroupsList.newChat"),n[17]=e,n[18]=j):j=n[18];let C;n[19]!==j?(C=t.jsx(Pe,{side:"bottom",children:j}),n[19]=j,n[20]=C):C=n[20];let w;return n[21]!==v||n[22]!==C?(w=t.jsxs(Oe,{children:[v,C]}),n[21]=v,n[22]=C,n[23]=w):w=n[23],w}function Do({open:n,onOpenChange:e,onCreated:s}){const i=G(),{org:r}=le(),{data:o}=Te.useSession(),{stdioEnabled:a}=Cn(),l=tn(),c=ln(),d=on(),m=rn(d,"").items,u=_n({resolver:wn(vs),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),p=u.watch("ui_type"),y=u.watch("connection_url"),x=u.watch("npx_package"),g=Je({uiType:p,connectionUrl:y??"",npxPackage:x??""})??$t({uiType:p,connectionUrl:y??"",registryItems:m}),h=b=>{const N=b.trim();if(!N)return;const A=!!u.formState.dirtyFields.title,S=!!u.formState.dirtyFields.description,_=!!u.formState.dirtyFields.env_vars,T=D=>{if(D&&(!A&&!u.getValues("title").trim()&&D.title&&u.setValue("title",D.title,{shouldDirty:!1}),!S&&!(u.getValues("description")??"").trim()&&D.description&&u.setValue("description",D.description,{shouldDirty:!1}),!_&&D.envVarKeys?.length)){const F=u.getValues("env_vars")??[],L=new Set(F.map(z=>z.key)),O=D.envVarKeys.filter(z=>!L.has(z));O.length>0&&u.setValue("env_vars",[...F,...O.map(z=>({key:z,value:""}))],{shouldDirty:!0})}},P=js(N);if(P&&a){u.setValue("ui_type","NPX",{shouldDirty:!0}),u.setValue("npx_package",P.packageName,{shouldDirty:!0}),u.setValue("connection_url","",{shouldDirty:!0}),u.setValue("connection_token",null,{shouldDirty:!0}),T(Je({uiType:"NPX",npxPackage:P.packageName}));return}if(N.startsWith("http://")||N.startsWith("https://")){const D=p==="HTTP"||p==="SSE"||p==="Websocket"?p:"HTTP";u.setValue("ui_type",D,{shouldDirty:!0}),u.setValue("connection_url",N,{shouldDirty:!0}),T(Je({uiType:D,connectionUrl:N})??$t({uiType:D,connectionUrl:N,registryItems:m}));return}p==="NPX"&&T(Je({uiType:"NPX",npxPackage:N}))},v=b=>{b||u.reset(),e(b)},j=async b=>{let N,A=null,S=null,_=null;b.ui_type==="NPX"?(N="STDIO",A="",_=ys(b.npx_package||"",b.env_vars||[])):b.ui_type==="STDIO"?(N="STDIO",A="",_=Cs(b.stdio_command||"",b.stdio_args||"",b.stdio_cwd,b.env_vars||[])):(N=b.ui_type,A=b.connection_url||"",S=b.connection_token||null);const T=as("conn");try{await c.create.mutateAsync({id:T,title:b.title,description:b.description||null,connection_type:N,connection_url:A,connection_token:S,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:o?.user?.id||"system",organization_id:r.id,icon:b.icon??null,app_name:null,app_id:null,connection_headers:_,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),u.reset(),e(!1),s?.(T)}catch{X.error(i("connections.createConnectionDialog.failedToCreateConnection"))}},C=i("connections.createConnectionDialog.title"),w=i("connections.createConnectionDialog.description"),I=u.formState.isSubmitting?i("connections.createConnectionDialog.saving"):i("connections.createConnectionDialog.createButton"),M=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(pe,{control:u.control,name:"ui_type",render:({field:b})=>t.jsxs(xe,{children:[t.jsx(ve,{children:i("connections.createConnectionDialog.typeLabel")}),t.jsxs(ms,{value:b.value,onValueChange:b.onChange,children:[t.jsx(be,{children:t.jsx(gs,{children:t.jsx(hs,{})})}),t.jsxs(ps,{children:[t.jsx(Qe,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(gt,{className:"w-4 h-4"}),i("connections.createConnectionDialog.httpType")]})}),t.jsx(Qe,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(gt,{className:"w-4 h-4"}),i("connections.createConnectionDialog.sseType")]})}),t.jsx(Qe,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(gt,{className:"w-4 h-4"}),i("connections.createConnectionDialog.websocketType")]})}),a&&t.jsxs(t.Fragment,{children:[t.jsx(Qe,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(tt,{className:"w-4 h-4"}),i("connections.createConnectionDialog.npxPackageType")]})}),t.jsx(Qe,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Pn,{className:"w-4 h-4"}),i("connections.createConnectionDialog.customCommandType")]})})]})]})]}),t.jsx(je,{})]})}),p==="NPX"&&t.jsx(pe,{control:u.control,name:"npx_package",render:({field:b})=>t.jsxs(xe,{children:[t.jsx(ve,{children:i("connections.createConnectionDialog.npmPackageLabel")}),t.jsx(be,{children:t.jsx(Le,{placeholder:i("connections.createConnectionDialog.npmPackagePlaceholder"),...b,value:b.value??"",onPaste:N=>{const A=N.clipboardData.getData("text");A&&(N.preventDefault(),u.setValue("npx_package",A.trim(),{shouldDirty:!0}),h(A))},onBlur:N=>{h(N.target.value),b.onBlur()}})}),t.jsx(je,{})]})}),p==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(pe,{control:u.control,name:"stdio_command",render:({field:b})=>t.jsxs(xe,{children:[t.jsx(ve,{children:i("connections.createConnectionDialog.commandLabel")}),t.jsx(be,{children:t.jsx(Le,{placeholder:i("connections.createConnectionDialog.commandPlaceholder"),...b,value:b.value??""})}),t.jsx(je,{})]})}),t.jsx(pe,{control:u.control,name:"stdio_args",render:({field:b})=>t.jsxs(xe,{children:[t.jsx(ve,{children:i("connections.createConnectionDialog.argumentsLabel")}),t.jsx(be,{children:t.jsx(Le,{placeholder:i("connections.createConnectionDialog.argumentsPlaceholder"),...b,value:b.value??""})}),t.jsx(je,{})]})})]}),t.jsx(pe,{control:u.control,name:"stdio_cwd",render:({field:b})=>t.jsxs(xe,{children:[t.jsx(ve,{children:i("connections.createConnectionDialog.workingDirectoryLabel")}),t.jsx(be,{children:t.jsx(Le,{placeholder:i("connections.createConnectionDialog.workingDirectoryPlaceholder"),...b,value:b.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("connections.createConnectionDialog.workingDirectoryDescription")}),t.jsx(je,{})]})})]}),(p==="NPX"||p==="STDIO")&&t.jsx(pe,{control:u.control,name:"env_vars",render:({field:b})=>t.jsxs(xe,{children:[t.jsx(ve,{children:i("connections.createConnectionDialog.environmentVariablesLabel")}),t.jsx(be,{children:t.jsx(bs,{value:b.value??[],onChange:b.onChange})}),t.jsx(je,{})]})}),p!=="NPX"&&p!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(pe,{control:u.control,name:"connection_url",render:({field:b})=>t.jsxs(xe,{children:[t.jsx(ve,{children:i("connections.createConnectionDialog.urlLabel")}),t.jsx(be,{children:t.jsx(Le,{placeholder:i("connections.createConnectionDialog.urlPlaceholder"),...b,value:b.value??"",onPaste:N=>{const A=N.clipboardData.getData("text");A&&(N.preventDefault(),u.setValue("connection_url",A.trim(),{shouldDirty:!0}),h(A))},onBlur:N=>{h(N.target.value),b.onBlur()}})}),t.jsx(je,{})]})}),t.jsx(pe,{control:u.control,name:"connection_token",render:({field:b})=>t.jsxs(xe,{children:[t.jsx(ve,{children:g?.token?.label??i("connections.createConnectionDialog.tokenLabelDefault")}),t.jsx(be,{children:t.jsx(Le,{type:"password",placeholder:g?.token?.placeholder??i("connections.createConnectionDialog.tokenPlaceholderDefault"),className:"ph-no-capture",...b,value:b.value??""})}),g?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[g.token.helperText,g.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:i("connections.createConnectionDialog.openGitHubPatSettings")})]})]}),t.jsx(je,{})]})})]}),t.jsx(pe,{control:u.control,name:"title",render:({field:b})=>t.jsxs(xe,{children:[t.jsx(ve,{children:i("connections.createConnectionDialog.nameLabel")}),t.jsx(be,{children:t.jsx(Le,{placeholder:i("connections.createConnectionDialog.namePlaceholder"),...b})}),t.jsx(je,{})]})}),t.jsx(pe,{control:u.control,name:"description",render:({field:b})=>t.jsxs(xe,{children:[t.jsx(ve,{children:i("connections.createConnectionDialog.descriptionLabel")}),t.jsx(be,{children:t.jsx(xs,{placeholder:i("connections.createConnectionDialog.descriptionPlaceholder"),rows:3,...b,value:b.value??""})}),t.jsx(je,{})]})})]});return l?t.jsx(Jt,{open:n,onOpenChange:v,children:t.jsxs(Zt,{className:"max-h-[90vh]",children:[t.jsx(Vn,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(en,{children:C}),t.jsx(Un,{className:"mt-1",children:w})]}),t.jsx(qn,{asChild:!0,children:t.jsx(ye,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(Yt,{size:16})})})]})}),t.jsx(Ft,{...u,children:t.jsxs("form",{onSubmit:u.handleSubmit(j),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:M}),t.jsx(Kn,{children:t.jsx(ye,{type:"submit",disabled:u.formState.isSubmitting,className:"w-full",children:I})})]})})]})}):t.jsx(It,{open:n,onOpenChange:v,children:t.jsxs(Dt,{className:"sm:max-w-[525px]",children:[t.jsxs(At,{children:[t.jsx(Tt,{children:C}),t.jsx(an,{children:w})]}),t.jsx(Ft,{...u,children:t.jsxs("form",{onSubmit:u.handleSubmit(j),children:[t.jsx("div",{className:"py-4",children:M}),t.jsxs(fs,{children:[t.jsx(ye,{type:"button",variant:"outline",onClick:()=>v(!1),children:i("connections.createConnectionDialog.cancelButton")}),t.jsx(ye,{type:"submit",disabled:u.formState.isSubmitting,className:"min-w-40",children:I})]})]})})]})})}function Ao(n){const e=$.c(72),{mode:s,agentId:i,addedConnectionIds:r,onAdd:o,onCloneAndAdd:a,onConnectAndAdd:l,connectingItemId:c,search:d,onCreateConnection:f,onBrowseNavigate:m,defaultTab:u}=n,p=s===void 0?"add":s,y=u===void 0?"connected":u,x=G(),{org:g}=le(),h=V.useDeferredValue(d),v=d!==h;let j;e[0]!==h?(j=h.trim().toLowerCase(),e[0]=h,e[1]=j):j=e[1];const C=j;let w;e[2]!==y?(w=k=>k??y,e[2]=y,e[3]=w):w=e[3];const[I,M]=Ct(Nn.connectionsTab(g.slug)+(y==="all"?":home-modal":":agent-modal"),w);let b;e[4]!==I||e[5]!==M?(b=k=>{k!==I&&K("connections_dialog_tab_changed",{to_tab:k}),M(k)},e[4]=I,e[5]=M,e[6]=b):b=e[6];const N=b;let A;e[7]!==g.id||e[8]!==g.slug?(A={connectionId:Wt,orgId:g.id,orgSlug:g.slug},e[7]=g.id,e[8]=g.slug,e[9]=A):A=e[9];const S=Ln(A),_=h?.trim().split(/\s+/).filter(Boolean)??[],T=_.length>0?{operator:"or",conditions:_.flatMap(Lo)}:void 0,P={...T&&{where:T},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},D=JSON.stringify(P),{data:F,fetchNextPage:L,hasNextPage:O,isFetchingNextPage:z}=Ns({queryKey:Ue.collectionListInfinite(S,g.id,"","CONNECTIONS",D),queryFn:async k=>{const{pageParam:B}=k,Z=B===void 0?0:B;return(await S.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...T&&{where:T},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:Z}})).structuredContent},initialPageParam:0,getNextPageParam:$o,staleTime:3e4}),U=F?.pages.flatMap(Fo)??[],R=us(U),q=new Set(U.filter(Oo).map(Po)),E=on(),Y=rn(E,h),ee=zt(Y.loadMore,Y.hasMore,Y.isLoadingMore),te=zt(L,O??!1,z),H=I==="all"||!!C,J=H?Y.items.filter(k=>{const B=ls(k);if(B&&q.has(B))return!1;if(!C)return!0;const Z=ot(k._meta),ue=[k.title,k.description,k.name,k.server?.title,k.server?.description,k.server?.name,Z?.friendly_name,Z?.friendlyName].filter(Boolean).join(" ").toLowerCase();return _.some(he=>ue.includes(he.toLowerCase()))}):[],ne=J.filter(Mo),W=J.filter(To);let Ne;e[10]!==r?(Ne=k=>k.some(B=>r.has(B.id)),e[10]=r,e[11]=Ne):Ne=e[11];const Be=Ne;let Ce;e[12]!==r||e[13]!==i||e[14]!==c||e[15]!==Be||e[16]!==p||e[17]!==o||e[18]!==m||e[19]!==a||e[20]!==x?(Ce=(k,B,Z,ue,he)=>{const Ye=Be(he),Ge=he.find(ze=>!r.has(ze.id)),ce=he[0];if(p==="browse"){const ze=_s(ce);return t.jsx(ht,{connection:{title:B,icon:Z,description:he.length>1?`${he.length} instances`:ue??void 0},fallbackIcon:t.jsx(tt,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs(Ze,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(st,{size:11})," ",x("virtualMcp.connectionDialogContent.connected")]}),onClick:()=>{K("connection_browse_clicked",{app_name:ce.app_name??null,connection_id:ce.id,instances_count:he.length}),m?.(ze)}},k)}return t.jsx(ht,{connection:{title:B,icon:Z,description:ue},fallbackIcon:t.jsx(tt,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1.5",children:[Ye&&t.jsxs(Ze,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(st,{size:11})," ",x("virtualMcp.connectionDialogContent.added")]}),t.jsx(ye,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:c!==null,onClick:ze=>{ze.stopPropagation(),Ge?(K("connection_add_clicked",{action:"use_existing",app_name:ce.app_name??null,connection_id:Ge.id}),i&&K("agent_connection_attached",{agent_id:i,connection_id:Ge.id,app_name:ce.app_name??null,mode:"existing"}),o(Ge.id)):(K("connection_add_clicked",{action:"clone",app_name:ce.app_name??null,base_connection_id:ce.id}),a(ce))},children:x("virtualMcp.connectionDialogContent.add")})]})},k)},e[12]=r,e[13]=i,e[14]=c,e[15]=Be,e[16]=p,e[17]=o,e[18]=m,e[19]=a,e[20]=x,e[21]=Ce):Ce=e[21];const Ee=Ce;let _e;e[22]!==c||e[23]!==p||e[24]!==l||e[25]!==x?(_e=k=>{const B=ot(k._meta),Z=B?.friendlyName||B?.friendly_name||k.server?.title||k.title||k.server?.name||k.name||k.id||"",ue=k.server?.description||k.description||null,he=k.server?.icons?.[0]?.src||cs(k.server?.repository)||null,Ye=B?.official===!0,Ge=B?.verified===!0,ce=B?.owner==="deco";return t.jsx(ht,{connection:{title:Z,description:ue,icon:he},fallbackIcon:t.jsx(tt,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1.5",children:[ce&&t.jsxs(Oe,{children:[t.jsx(Me,{asChild:!0,children:t.jsx("span",{className:"inline-flex items-center justify-center size-5 rounded-md bg-muted shrink-0",children:t.jsx("img",{src:"/logos/deco logo.svg",alt:x("virtualMcp.connectionDialogContent.madeByDeco"),className:"size-3"})})}),t.jsx(Pe,{children:x("virtualMcp.connectionDialogContent.builtByDeco")})]}),!ce&&Ye&&t.jsxs(Oe,{children:[t.jsx(Me,{asChild:!0,children:t.jsx(Ze,{variant:"outline",size:"icon",children:t.jsx(pt,{})})}),t.jsx(Pe,{children:x("virtualMcp.connectionDialogContent.builtByOfficial")})]}),!ce&&!Ye&&Ge&&t.jsxs(Oe,{children:[t.jsx(Me,{asChild:!0,children:t.jsx(Ze,{variant:"outline",size:"icon",children:t.jsx(pt,{})})}),t.jsx(Pe,{children:x("virtualMcp.connectionDialogContent.verifiedByDeco")})]}),t.jsx(ye,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:c!==null,onClick:ze=>{ze.stopPropagation(),K("connection_add_clicked",{action:"connect_new",registry_item_id:k.id,app_name:B?.friendlyName||k.server?.name||k.name||null}),l(k)},children:c===k.id?t.jsx(Ve,{size:14,className:"animate-spin"}):x(p==="browse"?"virtualMcp.connectionDialogContent.connect":"virtualMcp.connectionDialogContent.add")})]})},`catalog-${k.id}`)},e[22]=c,e[23]=p,e[24]=l,e[25]=x,e[26]=_e):_e=e[26];const We=_e;let se;e[27]!==I||e[28]!==N||e[29]!==f||e[30]!==C||e[31]!==x?(se=!C&&t.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[t.jsx(ws,{tabs:[{id:"all",label:x("virtualMcp.connectionDialogContent.tabAll")},{id:"connected",label:x("virtualMcp.connectionDialogContent.tabConnected")}],activeTab:I,onTabChange:k=>N(k)}),t.jsxs(ye,{variant:"outline",size:"sm",className:"h-7 px-2 text-sm",onClick:()=>{K("connections_dialog_custom_clicked"),f()},children:[t.jsx(Ke,{size:12}),x("virtualMcp.connectionDialogContent.customConnection")]})]}),e[27]=I,e[28]=N,e[29]=f,e[30]=C,e[31]=x,e[32]=se):se=e[32];const Se=v&&"opacity-50 pointer-events-none";let oe;e[33]!==Se?(oe=Q("flex-1 overflow-auto p-5 transition-opacity duration-150",Se),e[33]=Se,e[34]=oe):oe=e[34];const Re="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4";let ke;e[35]!==Ee?(ke=k=>{if(k.type==="group")return Ee(k.key,k.title,k.icon,null,k.connections);const B=k.connection;return Ee(B.id,B.title,B.icon,B.description??null,[B])},e[35]=Ee,e[36]=ke):ke=e[36];const Ie=R.map(ke);let fe;e[37]!==te?(fe=t.jsx("div",{ref:te,className:"col-span-full h-1"}),e[37]=te,e[38]=fe):fe=e[38];let de;e[39]!==z?(de=z&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(Ve,{size:24,className:"animate-spin text-muted-foreground"})}),e[39]=z,e[40]=de):de=e[40];const Fe=H&&ne.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx(pt,{size:13,className:"text-muted-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:x("virtualMcp.connectionDialogContent.sectionVerified")}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),De=H&&ne.map(We),$e=H&&W.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:x("virtualMcp.connectionDialogContent.sectionAllConnections")}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),Ae=H&&W.map(We);let me;e[41]!==ee||e[42]!==E||e[43]!==H?(me=H&&E.length>0&&t.jsx("div",{ref:ee,className:"col-span-full h-1"}),e[41]=ee,e[42]=E,e[43]=H,e[44]=me):me=e[44];let ie;e[45]!==Y.isLoadingMore||e[46]!==H?(ie=H&&Y.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(Ve,{size:24,className:"animate-spin text-muted-foreground"})}),e[45]=Y.isLoadingMore,e[46]=H,e[47]=ie):ie=e[47];let ge;e[48]!==Ie||e[49]!==fe||e[50]!==de||e[51]!==Fe||e[52]!==De||e[53]!==$e||e[54]!==Ae||e[55]!==me||e[56]!==ie?(ge=t.jsxs("div",{className:Re,children:[Ie,fe,de,Fe,De,$e,Ae,me,ie]}),e[48]=Ie,e[49]=fe,e[50]=de,e[51]=Fe,e[52]=De,e[53]=$e,e[54]=Ae,e[55]=me,e[56]=ie,e[57]=ge):ge=e[57];let re;e[58]!==I||e[59]!==R.length||e[60]!==W||e[61]!==d||e[62]!==x||e[63]!==ne?(re=R.length===0&&ne.length===0&&W.length===0&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:d?x("virtualMcp.connectionDialogContent.emptyStateSearchNoMatch",{search:d}):x(I==="connected"?"virtualMcp.connectionDialogContent.emptyStateNoConnectionsYet":"virtualMcp.connectionDialogContent.emptyStateNoConnectionsAvailable")}),e[58]=I,e[59]=R.length,e[60]=W,e[61]=d,e[62]=x,e[63]=ne,e[64]=re):re=e[64];let ae;e[65]!==oe||e[66]!==ge||e[67]!==re?(ae=t.jsxs("div",{className:oe,children:[ge,re]}),e[65]=oe,e[66]=ge,e[67]=re,e[68]=ae):ae=e[68];let we;return e[69]!==se||e[70]!==ae?(we=t.jsxs(t.Fragment,{children:[se,ae]}),e[69]=se,e[70]=ae,e[71]=we):we=e[71],we}function To(n){return!n.verified&&!ot(n._meta)?.verified&&!n.meta?.verified}function Mo(n){return n.verified||ot(n._meta)?.verified||n.meta?.verified}function Po(n){return n.app_name}function Oo(n){return n.app_name}function Fo(n){return n?.items??[]}function $o(n,e){if(n?.hasMore)return e.reduce(zo,0)}function zo(n,e){return n+(e?.items?.length??0)}function Lo(n){return[{field:["title"],operator:"contains",value:n},{field:["description"],operator:"contains",value:n}]}function Ir({open:n,onOpenChange:e,defaultTab:s,initialSearch:i="",...r}){const o=G(),a=r.mode??"add",l="agentId"in r?r.agentId:void 0,c="addedConnectionIds"in r?r.addedConnectionIds??new Set:new Set,d="onAdd"in r&&r.onAdd?r.onAdd:S=>{},f=(S,_,T)=>{l&&K("agent_connection_attached",{agent_id:l,connection_id:S,app_name:_,mode:T})},[m,u]=V.useState(null),[p,y]=V.useState(i),[x,g]=V.useState(!1),{org:h}=le(),{data:v}=Te.useSession(),j=ln(),C=Sn(),w=rt(),I=S=>{e(!1),w({to:"/$org/settings/connections/$appSlug",params:{org:h.slug,appSlug:S}})},M=()=>{C.invalidateQueries({predicate:S=>{const _=S.queryKey;return _[1]===h.id&&_[3]==="collection"&&_[4]==="CONNECTIONS"}})},b=async(S,_)=>{K("connection_oauth_succeeded",{connection_id:S,flow:_});const T=new URL(`/api/${h.slug}/mcp/${S}`,window.location.origin);await C.invalidateQueries({queryKey:Ue.isMCPAuthenticated(T.href,null)}),M()},N=async S=>{u(S.app_name??S.id);try{const T=`${S.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,D=(await j.create.mutateAsync({title:T,description:S.description??null,connection_type:S.connection_type,connection_url:S.connection_url??null,connection_token:null,icon:S.icon??null,app_name:S.app_name??null,app_id:S.app_id??null,connection_headers:S.connection_headers??null})).id,F=await xt({connectionId:D,orgId:h.id,orgSlug:h.slug,persistFallback:L=>j.update.mutateAsync({id:D,data:{connection_token:L}}).then(()=>{})});if(F.ran&&!F.ok){K("connection_oauth_failed",{connection_id:D,flow:"clone",error:F.error??"no_token"}),X.error(o("virtualMcp.addConnectionDialog.authenticationFailedError",{error:F.error??"no token received"})),await j.delete.mutateAsync(D);return}F.ran&&await b(D,"clone"),f(D,S.app_name??null,"clone"),d(D)}catch(_){console.error("Failed to add connection:",_),X.error(o("virtualMcp.addConnectionDialog.failedToAddConnection"))}finally{u(null)}},A=async S=>{if(!(!h||!v?.user?.id)){u(S.id);try{const _=ds(S,h.id,v.user.id,{remoteIndex:0}),T=_.connection_type==="STDIO",P=!!_.connection_url,D=T&&_.connection_headers&&typeof _.connection_headers=="object"&&"command"in _.connection_headers;if(!P&&!D){X.error(o("virtualMcp.addConnectionDialog.mcpServerConnectionError")),u(null);return}const{id:F}=await j.create.mutateAsync(_),L=await xt({connectionId:F,orgId:h.id,orgSlug:h.slug,persistFallback:O=>j.update.mutateAsync({id:F,data:{connection_token:O}}).then(()=>{})});if(L.ran&&!L.ok){K("connection_oauth_failed",{connection_id:F,flow:"connect_new",error:L.error??"no_token"}),X.warning(o("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:o("virtualMcp.addConnectionDialog.signInFailedDescription",{error:L.error??"no token received"})}),f(F,_.app_name??null,"new"),d(F);return}L.ran?(await b(F,"connect_new"),X.success(o("virtualMcp.addConnectionDialog.connectedAuthenticated"))):X.success(o("virtualMcp.addConnectionDialog.connected")),f(F,_.app_name??null,"new"),d(F)}catch(_){console.error("Failed to connect:",_),X.error(o("virtualMcp.addConnectionDialog.failedToConnect"))}finally{u(null)}}};return t.jsxs(It,{open:n,onOpenChange:e,children:[t.jsxs(Dt,{className:"sm:max-w-5xl h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[t.jsx(At,{className:"px-6 pt-5 pb-0 shrink-0",children:t.jsx(Tt,{className:"text-base font-semibold",children:o(a==="browse"?"virtualMcp.addConnectionDialog.connectionsTitle":"virtualMcp.addConnectionDialog.addConnectionTitle")})}),t.jsx("div",{className:"pt-3 shrink-0",children:t.jsx(rs,{value:p,onChange:y,placeholder:o("virtualMcp.addConnectionDialog.searchConnectionsPlaceholder")})}),t.jsx(V.Suspense,{fallback:t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Ve,{size:24,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Ao,{mode:a,agentId:l,addedConnectionIds:c,onAdd:d,onCloneAndAdd:N,onConnectAndAdd:A,connectingItemId:m,search:p,onCreateConnection:()=>g(!0),onBrowseNavigate:I,defaultTab:s})})]}),t.jsx(Do,{open:x,onOpenChange:g,onCreated:async S=>{g(!1);const _=await xt({connectionId:S,orgId:h.id,orgSlug:h.slug,persistFallback:T=>j.update.mutateAsync({id:S,data:{connection_token:T}}).then(()=>{})});if(_.ran&&!_.ok){K("connection_oauth_failed",{connection_id:S,flow:"custom_create",error:_.error??"no_token"}),X.warning(o("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:o("virtualMcp.addConnectionDialog.signInFailedDescription",{error:_.error??"no token received"})}),f(S,null,"custom"),d(S),e(!1);return}_.ran&&await b(S,"custom_create"),f(S,null,"custom"),d(S),e(!1)}})]})}const Lt=new Map;function Dr(){const{org:n}=le(),e=ft(),s=Ss(),i=s.find(g=>g.providerId==="deco"),{data:r,isLoading:o,refetch:a,isFetching:l}=He({queryKey:Ue.aiProviderCredits(n.id,"deco"),enabled:!!i,staleTime:6e4,queryFn:async()=>{try{return await e.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),c=r?.balanceCents??null,d=c!=null?c/100:null,f=V.useRef(new Map);if(c!=null){const g=Lt.get(n.id);f.current.get(n.id)&&g!=null&&c>g&&K("credits_topped_up_detected",{organization_id:n.id,delta_cents:c-g,previous_balance_cents:g,new_balance_cents:c}),Lt.set(n.id,c),f.current.set(n.id,!0)}const m=!!i,u=c!=null&&c>0,p=c!=null&&c===0,y=c!=null&&c===200,x=s.length>0&&s.every(g=>g.providerId==="deco");return{hasDecoKey:m,decoKeyId:i?.id??null,balanceCents:c,balanceDollars:d,hasCredits:u,isZeroBalance:p,isInitialFreeCredit:y,hasOnlyDecoProvider:x,isLoading:o,isFetching:l,refetch:a}}function bt(n){const e=$.c(13),{label:s,value:i,onChange:r,options:o}=n;let a;e[0]!==s?(a=t.jsx("span",{className:"text-sm text-muted-foreground",children:s}),e[0]=s,e[1]=a):a=e[1];let l;e[2]!==r?(l=m=>m&&r(m),e[2]=r,e[3]=l):l=e[3];let c;e[4]!==o?(c=o.map(Bo),e[4]=o,e[5]=c):c=e[5];let d;e[6]!==l||e[7]!==c||e[8]!==i?(d=t.jsx(Ds,{type:"single",size:"sm",value:i,onValueChange:l,className:"gap-0.5 rounded-lg border border-border bg-muted/50 p-0.5",children:c}),e[6]=l,e[7]=c,e[8]=i,e[9]=d):d=e[9];let f;return e[10]!==a||e[11]!==d?(f=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a,d]}),e[10]=a,e[11]=d,e[12]=f):f=e[12],f}function Bo(n){return t.jsxs(Is,{value:n.value,className:"h-6 gap-1.5 rounded-md border border-transparent px-2 text-xs font-medium text-muted-foreground hover:bg-transparent data-[state=on]:border-border data-[state=on]:bg-background data-[state=on]:text-foreground data-[state=on]:shadow-sm",children:[n.icon,n.label]},n.value)}function Ar(n){const e=$.c(91),{panel:s,className:i}=n,r=i===void 0?"md:size-[34px] rounded-lg":i,o=G();let a;e[0]!==o?(a=o("sidebar.taskGroupsList.filterChats"),e[0]=o,e[1]=a):a=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ks,{size:16}),e[2]=l):l=e[2];let c;e[3]!==s.filtersActive?(c=s.filtersActive&&t.jsx("span",{className:"absolute right-1 top-1 size-1.5 rounded-full bg-primary ring-2 ring-sidebar"}),e[3]=s.filtersActive,e[4]=c):c=e[4];let d;e[5]!==r||e[6]!==s.filtersActive||e[7]!==a||e[8]!==c?(d=t.jsx(Me,{asChild:!0,children:t.jsx(Xe,{asChild:!0,children:t.jsxs(kt,{"aria-label":a,active:s.filtersActive,className:r,children:[l,c]})})}),e[5]=r,e[6]=s.filtersActive,e[7]=a,e[8]=c,e[9]=d):d=e[9];let f;e[10]!==o?(f=o("sidebar.taskGroupsList.filterChats"),e[10]=o,e[11]=f):f=e[11];let m;e[12]!==f?(m=t.jsx(Pe,{side:"bottom",children:f}),e[12]=f,e[13]=m):m=e[13];let u;e[14]!==d||e[15]!==m?(u=t.jsxs(Oe,{children:[d,m]}),e[14]=d,e[15]=m,e[16]=u):u=e[16];let p;e[17]!==o?(p=o("sidebar.taskGroupsList.filterView"),e[17]=o,e[18]=p):p=e[18];const y=s.groupBy;let x;e[19]!==s?(x=W=>{K("tasks_panel_group_by_changed",{to_value:W}),s.setGroupBy(W)},e[19]=s,e[20]=x):x=e[20];let g;e[21]!==o?(g=o("sidebar.taskGroupsList.viewList"),e[21]=o,e[22]=g):g=e[22];let h;e[23]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(On,{size:13}),e[23]=h):h=e[23];let v;e[24]!==g?(v={value:"flat",label:g,icon:h},e[24]=g,e[25]=v):v=e[25];let j;e[26]!==o?(j=o("sidebar.taskGroupsList.viewStatus"),e[26]=o,e[27]=j):j=e[27];let C;e[28]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Fn,{size:13}),e[28]=C):C=e[28];let w;e[29]!==j?(w={value:"status",label:j,icon:C},e[29]=j,e[30]=w):w=e[30];let I;e[31]!==v||e[32]!==w?(I=[v,w],e[31]=v,e[32]=w,e[33]=I):I=e[33];let M;e[34]!==s.groupBy||e[35]!==x||e[36]!==I||e[37]!==p?(M=t.jsx(bt,{label:p,value:y,onChange:x,options:I}),e[34]=s.groupBy,e[35]=x,e[36]=I,e[37]=p,e[38]=M):M=e[38];let b;e[39]!==o?(b=o("sidebar.taskGroupsList.filterType"),e[39]=o,e[40]=b):b=e[40];const N=s.typeFilter;let A;e[41]!==s?(A=W=>{K("tasks_panel_filter_changed",{to_value:W}),s.setTypeFilter(W)},e[41]=s,e[42]=A):A=e[42];let S;e[43]!==o?(S=o("sidebar.taskGroupsList.typeAll"),e[43]=o,e[44]=S):S=e[44];let _;e[45]!==S?(_={value:"all",label:S},e[45]=S,e[46]=_):_=e[46];let T;e[47]!==o?(T=o("sidebar.taskGroupsList.typeChats"),e[47]=o,e[48]=T):T=e[48];let P;e[49]!==T?(P={value:"manual",label:T},e[49]=T,e[50]=P):P=e[50];let D;e[51]!==o?(D=o("sidebar.taskGroupsList.typeAuto"),e[51]=o,e[52]=D):D=e[52];let F;e[53]!==D?(F={value:"automation",label:D},e[53]=D,e[54]=F):F=e[54];let L;e[55]!==_||e[56]!==P||e[57]!==F?(L=[_,P,F],e[55]=_,e[56]=P,e[57]=F,e[58]=L):L=e[58];let O;e[59]!==s.typeFilter||e[60]!==b||e[61]!==A||e[62]!==L?(O=t.jsx(bt,{label:b,value:N,onChange:A,options:L}),e[59]=s.typeFilter,e[60]=b,e[61]=A,e[62]=L,e[63]=O):O=e[63];let z;e[64]!==o?(z=o("sidebar.taskGroupsList.filterScope"),e[64]=o,e[65]=z):z=e[65];const U=s.showAll?"team":"mine";let R;e[66]!==s?(R=W=>s.setShowAll(W==="team"),e[66]=s,e[67]=R):R=e[67];let q;e[68]!==o?(q=o("sidebar.taskGroupsList.scopeMine"),e[68]=o,e[69]=q):q=e[69];let E;e[70]!==q?(E={value:"mine",label:q},e[70]=q,e[71]=E):E=e[71];let Y;e[72]!==o?(Y=o("sidebar.taskGroupsList.scopeTeam"),e[72]=o,e[73]=Y):Y=e[73];let ee;e[74]!==Y?(ee={value:"team",label:Y},e[74]=Y,e[75]=ee):ee=e[75];let te;e[76]!==E||e[77]!==ee?(te=[E,ee],e[76]=E,e[77]=ee,e[78]=te):te=e[78];let H;e[79]!==z||e[80]!==U||e[81]!==R||e[82]!==te?(H=t.jsx(bt,{label:z,value:U,onChange:R,options:te}),e[79]=z,e[80]=U,e[81]=R,e[82]=te,e[83]=H):H=e[83];let J;e[84]!==M||e[85]!==O||e[86]!==H?(J=t.jsxs(Nt,{align:"start",className:"w-64 flex flex-col gap-3 p-3",children:[M,O,H]}),e[84]=M,e[85]=O,e[86]=H,e[87]=J):J=e[87];let ne;return e[88]!==J||e[89]!==u?(ne=t.jsxs(St,{children:[u,J]}),e[88]=J,e[89]=u,e[90]=ne):ne=e[90],ne}function Eo(n){const e=$.c(9),{virtualMcpId:s,size:i,showAutomationBadge:r}=n,o=i===void 0?"sm":i,a=G();let l;e[0]!==o||e[1]!==s?(l=s?t.jsx(Ro,{virtualMcpId:s,size:o}):t.jsx(qe,{icon:null,name:"?",size:o}),e[0]=o,e[1]=s,e[2]=l):l=e[2];let c;e[3]!==r||e[4]!==a?(c=r&&t.jsx("span",{"aria-label":a("tasksPanel.mcpAvatar.automationTriggered"),className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-blue-500 border border-blue-600 text-white",children:t.jsx(cn,{size:10,className:"text-white"})}),e[3]=r,e[4]=a,e[5]=c):c=e[5];let d;return e[6]!==l||e[7]!==c?(d=t.jsxs("div",{className:"relative shrink-0",children:[l,c]}),e[6]=l,e[7]=c,e[8]=d):d=e[8],d}function Ro(n){const e=$.c(6),{virtualMcpId:s,size:i}=n,r=wt(s);if(!r){let l;return e[0]!==i?(l=t.jsx(qe,{icon:null,name:"?",size:i}),e[0]=i,e[1]=l):l=e[1],l}const o=r.icon??null;let a;return e[2]!==r.title||e[3]!==i||e[4]!==o?(a=t.jsx(qe,{icon:o,name:r.title,size:i}),e[2]=r.title,e[3]=i,e[4]=o,e[5]=a):a=e[5],a}function Go(n){const e=$.c(51),{open:s,onOpenChange:i}=n,[r,o]=V.useState(""),{org:a}=le(),{setTaskId:l}=ut(),c=ft(),d=G();let f,m,u;e[0]!==a.id||e[1]!==r?(u=r.trim(),m=He,f=Ue.globalSearch(a.id,u),e[0]=a.id,e[1]=r,e[2]=f,e[3]=m,e[4]=u):(f=e[2],m=e[3],u=e[4]);let p;e[5]!==c||e[6]!==u?(p=async()=>await c.call("GLOBAL_SEARCH",{query:u,limit:u?20:10}),e[5]=c,e[6]=u,e[7]=p):p=e[7];let y;e[8]!==s||e[9]!==f||e[10]!==p?(y={queryKey:f,enabled:s,queryFn:p,staleTime:1e4},e[8]=s,e[9]=f,e[10]=p,e[11]=y):y=e[11];const{data:x,isFetching:g}=m(y);let h;e[12]!==x?.items?(h=x?.items??[],e[12]=x?.items,e[13]=h):h=e[13];const v=h;let j;e[14]!==i?(j=O=>{O||o(""),i(O)},e[14]=i,e[15]=j):j=e[15];const C=j;let w;e[16]!==C||e[17]!==l?(w=O=>{C(!1),l(O.id,O.virtual_mcp_id??void 0)},e[16]=C,e[17]=l,e[18]=w):w=e[18];const I=w;let M;e[19]!==d?(M=d("tasksPanel.globalSearchDialog.title"),e[19]=d,e[20]=M):M=e[20];let b;e[21]!==M?(b=t.jsx(Tt,{children:M}),e[21]=M,e[22]=b):b=e[22];let N;e[23]!==d?(N=d("tasksPanel.globalSearchDialog.description"),e[23]=d,e[24]=N):N=e[24];let A;e[25]!==N?(A=t.jsx(an,{children:N}),e[25]=N,e[26]=A):A=e[26];let S;e[27]!==A||e[28]!==b?(S=t.jsxs(At,{className:"sr-only",children:[b,A]}),e[27]=A,e[28]=b,e[29]=S):S=e[29];let _;e[30]!==d?(_=d("tasksPanel.globalSearchDialog.placeholder"),e[30]=d,e[31]=_):_=e[31];let T;e[32]!==r||e[33]!==_?(T=t.jsx(Os,{value:r,onValueChange:o,placeholder:_}),e[32]=r,e[33]=_,e[34]=T):T=e[34];let P;e[35]!==I||e[36]!==g||e[37]!==v||e[38]!==d||e[39]!==u?(P=t.jsx(As,{children:g&&v.length===0?t.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:d("tasksPanel.globalSearchDialog.searching")}):v.length===0?t.jsx(Ts,{children:d("tasksPanel.globalSearchDialog.noResults")}):t.jsx(Ms,{heading:u?void 0:d("tasksPanel.globalSearchDialog.recent"),children:v.map(O=>O.type==="thread"?t.jsxs(Ps,{value:`thread:${O.id}:${O.title}`,onSelect:()=>I(O),className:"gap-2.5",children:[t.jsx(Eo,{virtualMcpId:O.virtual_mcp_id,size:"xs"}),t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("div",{className:"text-sm text-foreground truncate",children:O.title||d("tasksPanel.globalSearchDialog.untitledChat")})}),t.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(O.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${O.id}`):null)})}),e[35]=I,e[36]=g,e[37]=v,e[38]=d,e[39]=u,e[40]=P):P=e[40];let D;e[41]!==T||e[42]!==P?(D=t.jsxs(Fs,{shouldFilter:!1,className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:[T,P]}),e[41]=T,e[42]=P,e[43]=D):D=e[43];let F;e[44]!==S||e[45]!==D?(F=t.jsxs(Dt,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[S,D]}),e[44]=S,e[45]=D,e[46]=F):F=e[46];let L;return e[47]!==C||e[48]!==s||e[49]!==F?(L=t.jsx(It,{open:s,onOpenChange:C,children:F}),e[47]=C,e[48]=s,e[49]=F,e[50]=L):L=e[50],L}function Ho(n){const e=$.c(43),{branch:s,onOutcome:i}=n,r=G();let o;e[0]!==i?(o=M=>{M||i("cancel")},e[0]=i,e[1]=o):o=e[1];let a;e[2]!==r?(a=r("sidebar.archiveWorktreeDialog.title"),e[2]=r,e[3]=a):a=e[3];let l;e[4]!==a?(l=t.jsx($s,{children:a}),e[4]=a,e[5]=l):l=e[5];let c;e[6]!==r?(c=r("sidebar.archiveWorktreeDialog.stopsAndDeletesBefore"),e[6]=r,e[7]=c):c=e[7];let d;e[8]!==s?(d=t.jsx("span",{className:"font-mono",children:s}),e[8]=s,e[9]=d):d=e[9];let f;e[10]!==r?(f=r("sidebar.archiveWorktreeDialog.stopsAndDeletesAfter"),e[10]=r,e[11]=f):f=e[11];let m;e[12]!==c||e[13]!==d||e[14]!==f?(m=t.jsxs(zs,{children:[c," ",d," ",f]}),e[12]=c,e[13]=d,e[14]=f,e[15]=m):m=e[15];let u;e[16]!==l||e[17]!==m?(u=t.jsxs(Ls,{children:[l,m]}),e[16]=l,e[17]=m,e[18]=u):u=e[18];let p;e[19]!==i?(p=()=>i("cancel"),e[19]=i,e[20]=p):p=e[20];let y;e[21]!==r?(y=r("sidebar.archiveWorktreeDialog.cancel"),e[21]=r,e[22]=y):y=e[22];let x;e[23]!==y||e[24]!==p?(x=t.jsx(Bs,{onClick:p,children:y}),e[23]=y,e[24]=p,e[25]=x):x=e[25];let g;e[26]===Symbol.for("react.memo_cache_sentinel")?(g=Q(kn({variant:"destructive"})),e[26]=g):g=e[26];let h;e[27]!==i?(h=()=>i("confirm"),e[27]=i,e[28]=h):h=e[28];let v;e[29]!==r?(v=r("sidebar.archiveWorktreeDialog.confirm"),e[29]=r,e[30]=v):v=e[30];let j;e[31]!==h||e[32]!==v?(j=t.jsx(Es,{className:g,onClick:h,children:v}),e[31]=h,e[32]=v,e[33]=j):j=e[33];let C;e[34]!==x||e[35]!==j?(C=t.jsxs(Rs,{children:[x,j]}),e[34]=x,e[35]=j,e[36]=C):C=e[36];let w;e[37]!==C||e[38]!==u?(w=t.jsxs(Gs,{children:[u,C]}),e[37]=C,e[38]=u,e[39]=w):w=e[39];let I;return e[40]!==o||e[41]!==w?(I=t.jsx(Hs,{open:!0,onOpenChange:o,children:w}),e[40]=o,e[41]=w,e[42]=I):I=e[42],I}function Vo(n,e,s){if(!s)return;const i=n.findIndex(r=>r.id===e);if(i!==-1){for(let r=i+1;r<n.length;r++){const o=n[r];if(o?.created_by===s)return o}for(let r=i-1;r>=0;r--){const o=n[r];if(o?.created_by===s)return o}}}function Uo(n){return n==="ephemeral"||n.startsWith("thread:")}function fn(n){const e=$.c(45),{task:s,isActive:i,onClick:r,onArchive:o,showAutomationBadge:a,showAgentIcon:l,hideStatusIdle:c,indented:d}=n,f=G(),m=Us(s.status),u=m.icon,p=s.metadata?.kind==="tool_call_run",y=wt(p?void 0:s.virtual_mcp_id);let x;e[0]!==y?(x=ss(y),e[0]=y,e[1]=x):x=e[1];const g=x;qs(6e4);const h=a||!!s.trigger_id,v=s.id,j="button",C=0;let w;e[2]!==r?(w=R=>{R.target===R.currentTarget&&(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),r())},e[2]=r,e[3]=w):w=e[3];const I=d?"-ml-4 pl-6":"pl-[7px]",M=i?"bg-accent text-accent-foreground":"hover:bg-accent/60";let b;e[4]!==I||e[5]!==M?(b=Q("group/row flex items-center gap-2 py-1.5 rounded-md cursor-pointer transition-colors",I,"focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",M),e[4]=I,e[5]=M,e[6]=b):b=e[6];let N;e[7]!==p||e[8]!==l||e[9]!==y?.icon||e[10]!==y?.title?(N=l&&!p&&t.jsx(qe,{icon:y?.icon??null,name:y?.title??"?",size:"2xs"}),e[7]=p,e[8]=l,e[9]=y?.icon,e[10]=y?.title,e[11]=N):N=e[11];let A;e[12]!==h||e[13]!==f?(A=h&&t.jsx(cn,{size:12,"aria-label":f("tasksPanel.taskRow.automationTriggered"),className:"shrink-0 text-blue-500"}),e[12]=h,e[13]=f,e[14]=A):A=e[14];let S;e[15]!==f||e[16]!==s.title?(S=s.title||f("tasksPanel.taskRow.untitledTask"),e[15]=f,e[16]=s.title,e[17]=S):S=e[17];let _;e[18]!==S?(_=t.jsx("div",{className:"text-sm text-foreground truncate",children:S}),e[18]=S,e[19]=_):_=e[19];let T;e[20]!==A||e[21]!==_?(T=t.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[A,_]}),e[20]=A,e[21]=_,e[22]=T):T=e[22];let P;e[23]!==g||e[24]!==i||e[25]!==s.branch||e[26]!==s.updated_at?(P=s.updated_at&&t.jsxs("div",{className:Q("flex items-center gap-1 text-[11px] min-w-0",i?"text-accent-foreground/70":"text-muted-foreground/60"),children:[s.branch&&!Uo(s.branch)?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"truncate font-mono",children:s.branch}),t.jsx("span",{className:"shrink-0",children:"·"})]}):g?t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"truncate",children:[g.owner,"/",g.name]}),t.jsx("span",{className:"shrink-0",children:"·"})]}):null,t.jsx("span",{className:"shrink-0",children:Ws(new Date(s.updated_at))})]}),e[23]=g,e[24]=i,e[25]=s.branch,e[26]=s.updated_at,e[27]=P):P=e[27];let D;e[28]!==T||e[29]!==P?(D=t.jsxs("div",{className:"flex-1 min-w-0",children:[T,P]}),e[28]=T,e[29]=P,e[30]=D):D=e[30];const F="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",L=!c&&t.jsx("span",{className:Q("[grid-area:slot] flex size-8 items-center justify-center pointer-events-none transition-opacity",o&&"group-hover/row:opacity-0"),"aria-label":f("tasksPanel.taskRow.statusLabel",{status:m.label}),children:t.jsx(u,{size:14,className:Q(m.iconClassName,s.status==="in_progress"&&"animate-spin")})});let O;e[31]!==o||e[32]!==f?(O=o&&t.jsxs(Oe,{children:[t.jsx(Me,{asChild:!0,children:t.jsx("button",{type:"button","aria-label":f("tasksPanel.taskRow.archiveTask"),onClick:R=>{R.stopPropagation(),o()},className:"[grid-area:slot] opacity-0 pointer-events-none group-hover/row:opacity-100 group-hover/row:pointer-events-auto focus-visible:opacity-100 focus-visible:pointer-events-auto transition-opacity flex size-8 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:t.jsx(In,{size:14})})}),t.jsx(Pe,{side:"right",children:f("tasksPanel.taskRow.archive")})]}),e[31]=o,e[32]=f,e[33]=O):O=e[33];let z;e[34]!==L||e[35]!==O?(z=t.jsxs("div",{className:F,children:[L,O]}),e[34]=L,e[35]=O,e[36]=z):z=e[36];let U;return e[37]!==r||e[38]!==D||e[39]!==z||e[40]!==w||e[41]!==b||e[42]!==N||e[43]!==s.id?(U=t.jsxs("div",{"data-task-id":v,role:j,tabIndex:C,onClick:r,onKeyDown:w,className:b,children:[N,D,z]}),e[37]=r,e[38]=D,e[39]=z,e[40]=w,e[41]=b,e[42]=N,e[43]=s.id,e[44]=U):U=e[44],U}const Bt=["requires_action","in_progress","failed","expired","completed"];function qo(n){const e=new Map(Bt.map(s=>[s,[]]));for(const s of n){const i=s.status??"completed";(e.get(i)??e.get("completed")).push(s)}return Bt.map(s=>({status:s,threads:e.get(s)}))}const Ko="sidebar.group.expanded.";function Wo(n,e){const s=$.c(3),[i,r]=Ct(`${Ko}${n}`,e);let o;return s[0]!==i||s[1]!==r?(o=[i,r],s[0]=i,s[1]=r,s[2]=o):o=s[2],o}function mn(n){const e=$.c(18),{onClick:s,isFetching:i,indented:r}=n,o=G();let a;e[0]!==o?(a=o("sidebar.showMoreButton.ariaLabel"),e[0]=o,e[1]=a):a=e[1];const l=r?"-ml-4 pl-6 pr-2":"px-2";let c;e[2]!==l?(c=Q("flex items-center gap-2 py-1.5 rounded-md text-sm text-muted-foreground",l,"hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50","transition-colors disabled:cursor-progress disabled:opacity-60"),e[2]=l,e[3]=c):c=e[3];let d;e[4]!==i?(d=i&&t.jsx(Ve,{size:14,className:"animate-spin"}),e[4]=i,e[5]=d):d=e[5];let f;e[6]!==i||e[7]!==o?(f=o(i?"sidebar.showMoreButton.loading":"sidebar.showMoreButton.showMore"),e[6]=i,e[7]=o,e[8]=f):f=e[8];let m;e[9]!==f?(m=t.jsx("span",{children:f}),e[9]=f,e[10]=m):m=e[10];let u;return e[11]!==i||e[12]!==s||e[13]!==a||e[14]!==c||e[15]!==d||e[16]!==m?(u=t.jsxs("button",{type:"button","aria-label":a,onClick:s,disabled:i,className:c,children:[d,m]}),e[11]=i,e[12]=s,e[13]=a,e[14]=c,e[15]=d,e[16]=m,e[17]=u):u=e[17],u}function Qo(n,e,s,i){return[n,e,s,i.type,i.member,i.currentUserId??""].join("|")}function Xo(n){return n.member==="mine"&&!n.currentUserId}const gn=4;let nt=0;const yt=[];function Yo(){for(;nt<gn&&yt.length>0;){const n=yt.shift();n&&n()}}function hn(n){return new Promise((e,s)=>{const i=()=>{nt++,n().then(e,s).finally(()=>{nt--,Yo()})};nt<gn?i():yt.push(i)})}const mt=10;function Et(n,e,s,i,r){const o={hidden:!1};i.member==="mine"&&i.currentUserId&&(o.created_by=i.currentUserId),i.type==="automation"&&(o.has_trigger=!0),i.type==="manual"&&(o.has_trigger=!1);const a={where:o,limit:r,offset:s,orderBy:[{field:["updated_at"],direction:"desc"}]};return a.status=e,a}function Jo(n,e,s,i){let r=0;for(const o of n)pn(o,e,s,i)&&r++;return r}function jt(n,e,s,i){return Jo(n,e,s,i)}function Zo(n,e){return!!(n>=mt||n===0&&e)}function Rt(n,e){return n<e}function ei(n,e){return e===!1?!1:e===!0?!0:n}function pn(n,e,s,i){return!(n.hidden||(n.status??"completed")!==s||i.member==="mine"&&i.currentUserId&&n.created_by!==i.currentUserId||i.type==="automation"&&!n.trigger_id||i.type==="manual"&&n.trigger_id)}const it=new Map,et=new Map;function ti(n,e){return e?n>=mt?!0:null:!1}function Gt(n){return it.get(n)}function ni(n,e){it.set(n,e)}function si(n,e,s){const i=it.get(n);if(i!==void 0){s(i);return}let r=et.get(n);r||(r=hn(e).then(o=>(it.set(n,o),et.delete(n),o)).catch(()=>(et.delete(n),Promise.reject(new Error("group probe failed")))),et.set(n,r)),r.then(s,()=>s(!1))}function Ht(n){const e=n,s=Array.isArray(e.items)?e.items:[];return{items:s,hasMore:e.hasMore??s.length===mt,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function oi(n,e,s,i,r){let o=0;for(const a of n)e.has(a.id)||pn(a,s,i,r)&&o++;return o}function ii(n,e,s,i){const r=$.c(8),{org:o}=le(),a=Qo(o.id,n,e,s);let l;r[0]!==s?(l=Xo(s),r[0]=s,r[1]=l):l=r[1];const c=l,[d,f]=V.useState({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:null,serverHasMore:null});d.identity!==a&&f({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:null,serverHasMore:null});const m=Yn(),{threads:u,hasMore:p}=dt(),y=jt(u,n,e,s),x=Zo(y,p),g=ti(y,p),h=ft();if(d.identity===a&&d.serverHasMore===null){const M=g??Gt(a);M!==void 0&&f({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:d.probeSubscribedIdentity,serverHasMore:M})}!c&&d.identity===a&&d.serverHasMore===null&&g===null&&Gt(a)===void 0&&d.probeSubscribedIdentity!==a&&(f(M=>M.identity===a?{...M,isProbing:!0,probeSubscribedIdentity:a}:M),si(a,async()=>{const M=Et(n,e,0,s,1),b=await h.call("COLLECTION_THREADS_LIST",M),{totalCount:N}=Ht(b),A=jt(m.threads.get(),n,e,s);return N===void 0?!1:Rt(A,N)},M=>{f(b=>b.identity!==a?b:{...b,isProbing:!1,serverHasMore:M})}));const j=async function(){if(d.isFetching||d.isProbing||c)return;const b=a;f(N=>N.identity===b?{...N,isFetching:!0}:N);try{const N=jt(u,n,e,s),A=Et(n,e,N,s,mt),S=await hn(()=>h.call("COLLECTION_THREADS_LIST",A)),{items:_,hasMore:T,totalCount:P}=Ht(S),D=new Set(u.map(ri)),F=oi(_,D,n,e,s),L=N;m.mergeThreads(_),f(O=>{if(O.identity!==b)return O;let z;return P!==void 0?z=Rt(L+F,P):z=_.length===0||F===0?!1:T,ni(b,z),{...O,isFetching:!1,serverHasMore:z}})}catch(N){const A=N,S=A instanceof Error?A.message:String(A);X.error(`Could not load more tasks: ${S}`),f(_=>_.identity===b?{..._,isFetching:!1}:_)}},C=d.isFetching||d.isProbing,w=!c&&!C&&ei(x,d.serverHasMore);let I;return r[2]!==C||r[3]!==j||r[4]!==w||r[5]!==d.isProbing||r[6]!==d.serverHasMore?(I={hasMore:w,isFetching:C,isProbing:d.isProbing,serverHasMore:d.serverHasMore,loadMore:j},r[2]=C,r[3]=j,r[4]=w,r[5]=d.isProbing,r[6]=d.serverHasMore,r[7]=I):I=r[7],I}function ri(n){return n.id}function ai(n){const e=$.c(20),{status:s,threads:i,activeTaskId:r,onSelectTask:o,onArchiveTask:a,canArchive:l,filters:c}=n,{isFetching:d,isProbing:f,loadMore:m,hasMore:u,serverHasMore:p}=ii("status",s,c),[y,x]=V.useState(!1);!y&&i.length===0&&p===!0&&!d&&!f&&(x(!0),queueMicrotask(()=>{m()}));let g;if(e[0]!==r||e[1]!==l||e[2]!==c||e[3]!==a||e[4]!==o||e[5]!==i){let j;e[7]!==r||e[8]!==l||e[9]!==c||e[10]!==a||e[11]!==o?(j=C=>t.jsx(fn,{task:C,isActive:r===C.id,onClick:()=>o(C),onArchive:l&&C.created_by===c.currentUserId?()=>a(C):void 0,showAutomationBadge:!!C.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},C.id),e[7]=r,e[8]=l,e[9]=c,e[10]=a,e[11]=o,e[12]=j):j=e[12],g=i.map(j),e[0]=r,e[1]=l,e[2]=c,e[3]=a,e[4]=o,e[5]=i,e[6]=g}else g=e[6];let h;e[13]!==u||e[14]!==d||e[15]!==m?(h=(u||d)&&t.jsx(mn,{onClick:()=>{m()},isFetching:d,indented:!0}),e[13]=u,e[14]=d,e[15]=m,e[16]=h):h=e[16];let v;return e[17]!==g||e[18]!==h?(v=t.jsxs(t.Fragment,{children:[g,h]}),e[17]=g,e[18]=h,e[19]=v):v=e[19],v}function li(n){const e=$.c(36),{status:s,threads:i,activeTaskId:r,onSelectTask:o,onArchiveTask:a,canArchive:l,filters:c}=n,d=Ks[s],f=d.icon,[m,u]=Wo(`status-${s}`,!1);let p;e[0]!==m||e[1]!==u?(p=function(){u(!m)},e[0]=m,e[1]=u,e[2]=p):p=e[2];const y=p;let x;e[3]!==y?(x=b=>{b.target===b.currentTarget&&(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),y())},e[3]=y,e[4]=x):x=e[4];let g;e[5]!==f||e[6]!==d.iconClassName?(g=t.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:t.jsx(f,{size:12,className:d.iconClassName})}),e[5]=f,e[6]=d.iconClassName,e[7]=g):g=e[7];let h;e[8]!==m?(h=t.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:m?t.jsx(_t,{size:14}):t.jsx(Vt,{size:14})}),e[8]=m,e[9]=h):h=e[9];let v;e[10]!==g||e[11]!==h?(v=t.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[g,h]}),e[10]=g,e[11]=h,e[12]=v):v=e[12];let j;e[13]!==d.label?(j=t.jsx("span",{className:"flex-1 truncate",children:d.label}),e[13]=d.label,e[14]=j):j=e[14];let C;e[15]!==i.length?(C=t.jsx("div",{className:"size-5 shrink-0 flex items-center justify-center",children:t.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:i.length})}),e[15]=i.length,e[16]=C):C=e[16];let w;e[17]!==m||e[18]!==y||e[19]!==x||e[20]!==v||e[21]!==j||e[22]!==C?(w=t.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":m,onClick:y,onKeyDown:x,className:"group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium text-foreground cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[v,j,C]}),e[17]=m,e[18]=y,e[19]=x,e[20]=v,e[21]=j,e[22]=C,e[23]=w):w=e[23];let I;e[24]!==r||e[25]!==l||e[26]!==m||e[27]!==c||e[28]!==a||e[29]!==o||e[30]!==s||e[31]!==i?(I=m&&t.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:t.jsx(ai,{status:s,threads:i,activeTaskId:r,onSelectTask:o,onArchiveTask:a,canArchive:l,filters:c})}),e[24]=r,e[25]=l,e[26]=m,e[27]=c,e[28]=a,e[29]=o,e[30]=s,e[31]=i,e[32]=I):I=e[32];let M;return e[33]!==w||e[34]!==I?(M=t.jsxs("div",{className:"flex flex-col gap-0.5",children:[w,I]}),e[33]=w,e[34]=I,e[35]=M):M=e[35],M}function ci(n){const e=$.c(38),{threads:s,groupBy:i,activeTaskId:r,onSelectTask:o,onArchiveTask:a,filters:l,hasMore:c,isFetchingMore:d,onLoadMore:f,filtersActive:m}=n;if(s.length===0&&!c&&!d){let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(Vs,{className:"size-6 opacity-60"}),e[0]=g):g=e[0];const h=m?"No chats match your filters":"No chats yet";let v;return e[1]!==h?(v=t.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 px-4 py-12 text-center text-muted-foreground",children:[g,t.jsx("p",{className:"text-sm",children:h})]}),e[1]=h,e[2]=v):v=e[2],v}const u=s.length>1||c;if(i==="status"){let g;if(e[3]!==r||e[4]!==u||e[5]!==l||e[6]!==a||e[7]!==o||e[8]!==s){let v;e[10]!==r||e[11]!==u||e[12]!==l||e[13]!==a||e[14]!==o?(v=j=>t.jsx(li,{status:j.status,threads:j.threads,activeTaskId:r,onSelectTask:o,onArchiveTask:a,canArchive:u,filters:l},j.status),e[10]=r,e[11]=u,e[12]=l,e[13]=a,e[14]=o,e[15]=v):v=e[15],g=qo(s).map(v),e[3]=r,e[4]=u,e[5]=l,e[6]=a,e[7]=o,e[8]=s,e[9]=g}else g=e[9];let h;return e[16]!==g?(h=t.jsx(t.Fragment,{children:g}),e[16]=g,e[17]=h):h=e[17],h}let p;if(e[18]!==r||e[19]!==u||e[20]!==l||e[21]!==a||e[22]!==o||e[23]!==s){let g;e[25]!==r||e[26]!==u||e[27]!==l||e[28]!==a||e[29]!==o?(g=h=>t.jsx(fn,{task:h,isActive:r===h.id,onClick:()=>o(h),onArchive:u&&h.created_by===l.currentUserId?()=>a(h):void 0,showAutomationBadge:!!h.trigger_id,showAgentIcon:!0},h.id),e[25]=r,e[26]=u,e[27]=l,e[28]=a,e[29]=o,e[30]=g):g=e[30],p=s.map(g),e[18]=r,e[19]=u,e[20]=l,e[21]=a,e[22]=o,e[23]=s,e[24]=p}else p=e[24];let y;e[31]!==c||e[32]!==d||e[33]!==f?(y=(c||d)&&t.jsx(mn,{onClick:f,isFetching:d}),e[31]=c,e[32]=d,e[33]=f,e[34]=y):y=e[34];let x;return e[35]!==p||e[36]!==y?(x=t.jsxs(t.Fragment,{children:[p,y]}),e[35]=p,e[36]=y,e[37]=x):x=e[37],x}function di(n,e){return null}function ui(n,e){return n.some(s=>s.id!==e.taskId&&!s.hidden&&s.branch===e.branch&&s.virtual_mcp_id===e.virtualMcpId)}const fi=["archive","reclaim-worktree"],mi=[];function gi(n){return n==="confirm"?fi:mi}function Tr(n){const e=$.c(11),{panel:s}=n;let i;return e[0]!==s.activeTaskId||e[1]!==s.archiveTask||e[2]!==s.filters||e[3]!==s.filtersActive||e[4]!==s.groupBy||e[5]!==s.hasMore||e[6]!==s.isFetchingMore||e[7]!==s.loadMore||e[8]!==s.selectTask||e[9]!==s.threads?(i=t.jsx(ci,{threads:s.threads,groupBy:s.groupBy,activeTaskId:s.activeTaskId,onSelectTask:s.selectTask,onArchiveTask:s.archiveTask,filters:s.filters,hasMore:s.hasMore,isFetchingMore:s.isFetchingMore,onLoadMore:s.loadMore,filtersActive:s.filtersActive}),e[0]=s.activeTaskId,e[1]=s.archiveTask,e[2]=s.filters,e[3]=s.filtersActive,e[4]=s.groupBy,e[5]=s.hasMore,e[6]=s.isFetchingMore,e[7]=s.loadMore,e[8]=s.selectTask,e[9]=s.threads,e[10]=i):i=e[10],i}function Mr(n){const e=$.c(82);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{onNavigate:i}=s,r=G(),{data:o}=Te.useSession(),a=o?.user?.id,{org:l}=le();let c;e[2]!==l.id?(c=ct(l.id),e[2]=l.id,e[3]=c):c=e[3];const d=c.id,{threads:f,hasMore:m,isFetchingMore:u,fetchNextPage:p}=dt(),y=f.filter(vi),{hide:x,setScope:g}=nn(),h=rt(),v=ft(),{setTaskId:j,createNewTask:C}=ut();let w;e[4]===Symbol.for("react.memo_cache_sentinel")?(w={strict:!1},e[4]=w):w=e[4];const I=at(w);let M;e[5]===Symbol.for("react.memo_cache_sentinel")?(M={strict:!1},e[5]=M):M=e[5];const b=lt(M),N=I.taskId??null;let A;e[6]!==N||e[7]!==f||e[8]!==b.virtualmcpid?(A=b.virtualmcpid??f.find(k=>k.id===N)?.virtual_mcp_id??null,e[6]=N,e[7]=f,e[8]=b.virtualmcpid,e[9]=A):A=e[9];const S=A;let _;e[10]!==i?(_=()=>{i?.()},e[10]=i,e[11]=_):_=e[11];const T=_,P=[...y].sort(xi),[D,F]=V.useState("all"),[L,O]=V.useState("flat"),[z,U]=Ct("sidebar-threads-scope-all",!1),[R,q]=V.useState(!1),[E,Y]=V.useState(!1);let ee;e[12]!==q?(ee=()=>{K("tasks_panel_search_opened"),Y(!0),q(!0)},e[12]=q,e[13]=ee):ee=e[13];const te=ee,[H,J]=V.useState(null),ne=a??null;let W;e[14]!==ne||e[15]!==D?(W={type:D,member:"mine",currentUserId:ne},e[14]=ne,e[15]=D,e[16]=W):W=e[16];const Ne=W,Be={};z||(Be.created_by="me"),g(Be);let Ce;e[17]!==a?(Ce=k=>a?k.filter(B=>B.created_by===a):[],e[17]=a,e[18]=Ce):Ce=e[18];const Ee=Ce;let _e;e[19]!==D?(_e=k=>D==="automation"?k.filter(pi):D==="manual"?k.filter(hi):k,e[19]=D,e[20]=_e):_e=e[20];const We=_e,se=We(z?P:Ee(P));let Se;e[21]!==N||e[22]!==T||e[23]!==a||e[24]!==x||e[25]!==h||e[26]!==l.slug||e[27]!==j||e[28]!==se?(Se=k=>{const B=k.id===N,Z=x(k.id);if(os(k.id),!B)return Z;const ue=Vo(se,k.id,a);return T(),ue?j(ue.id,ue.virtual_mcp_id):h({to:"/$org",params:{org:l.slug}}),Z},e[21]=N,e[22]=T,e[23]=a,e[24]=x,e[25]=h,e[26]=l.slug,e[27]=j,e[28]=se,e[29]=Se):Se=e[29];const oe=Se;let Re;e[30]!==v||e[31]!==r?(Re=async k=>{try{await v.call("SANDBOX_DELETE",{virtualMcpId:k.virtualMcpId,branch:k.branch,sandboxProviderKind:"user-desktop",removeWorktree:!0})}catch{X.error(r("sidebar.archiveWorktreeDialog.reclaimFailed",{branch:k.branch}))}},e[30]=v,e[31]=r,e[32]=Re):Re=e[32];const ke=Re;let Ie;e[33]!==f||e[34]!==oe||e[35]!==a||e[36]!==J?(Ie=k=>{if(a&&k.created_by&&k.created_by!==a)return;const B=di();if(!B||ui(f,B)){oe(k);return}J({task:k,target:B})},e[33]=f,e[34]=oe,e[35]=a,e[36]=J,e[37]=Ie):Ie=e[37];const fe=Ie;let de;e[38]!==oe||e[39]!==H||e[40]!==ke||e[41]!==J?(de=k=>{const B=H;B&&(J(null),(async()=>{for(const Z of gi(k))if(Z==="archive")try{await oe(B.task)}catch{return}else await ke(B.target)})())},e[38]=oe,e[39]=H,e[40]=ke,e[41]=J,e[42]=de):de=e[42];const Fe=de;let De;e[43]!==T||e[44]!==j?(De=k=>{T(),j(k.id,k.virtual_mcp_id)},e[43]=T,e[44]=j,e[45]=De):De=e[45];const $e=De;let Ae;e[46]!==S||e[47]!==N||e[48]!==f||e[49]!==T||e[50]!==C||e[51]!==d?(Ae=()=>{const k=S??d,B=f.find(Z=>Z.id===N)?.branch??null;K("sidebar_new_thread_clicked",{virtual_mcp_id:k}),T(),C(k,B)},e[46]=S,e[47]=N,e[48]=f,e[49]=T,e[50]=C,e[51]=d,e[52]=Ae):Ae=e[52];const me=Ae;let ie;e[53]!==p?(ie=()=>{p()},e[53]=p,e[54]=ie):ie=e[54];const ge=L!=="flat"||D!=="all"||z;let re;e[55]!==Fe||e[56]!==H?(re=H?t.jsx(Ho,{branch:H.target.branch,onOutcome:Fe}):null,e[55]=Fe,e[56]=H,e[57]=re):re=e[57];let ae;e[58]!==E||e[59]!==R||e[60]!==q?(ae=E?t.jsx(Go,{open:R,onOpenChange:q}):null,e[58]=E,e[59]=R,e[60]=q,e[61]=ae):ae=e[61];let we;return e[62]!==N||e[63]!==fe||e[64]!==Ne||e[65]!==L||e[66]!==m||e[67]!==u||e[68]!==me||e[69]!==te||e[70]!==$e||e[71]!==O||e[72]!==U||e[73]!==F||e[74]!==z||e[75]!==ie||e[76]!==ge||e[77]!==re||e[78]!==ae||e[79]!==D||e[80]!==se?(we={threads:se,activeTaskId:N,filters:Ne,hasMore:m,isFetchingMore:u,loadMore:ie,groupBy:L,setGroupBy:O,typeFilter:D,setTypeFilter:F,showAll:z,setShowAll:U,filtersActive:ge,selectTask:$e,archiveTask:fe,newThread:me,openSearch:te,reclaimDialog:re,searchDialog:ae},e[62]=N,e[63]=fe,e[64]=Ne,e[65]=L,e[66]=m,e[67]=u,e[68]=me,e[69]=te,e[70]=$e,e[71]=O,e[72]=U,e[73]=F,e[74]=z,e[75]=ie,e[76]=ge,e[77]=re,e[78]=ae,e[79]=D,e[80]=se,e[81]=we):we=e[81],we}function hi(n){return!n.trigger_id}function pi(n){return!!n.trigger_id}function xi(n,e){return(e.updated_at??"").localeCompare(n.updated_at??"")}function vi(n){return!n.hidden}function bi(n){return n?n.run_in_progress?"generating":n.scanned_at?"ready":"none":"none"}const ji=2e4;function yi(n){if(typeof n!="string"||!n)return null;try{return new URL(n).hostname||null}catch{return null}}function Pr(){const n=$.c(17),{org:e}=le(),s=Bn.COMMERCE_DISCOVERY(e.id);let i;n[0]!==e.id||n[1]!==e.slug?(i=Pt({connectionId:Wt,orgId:e.id,orgSlug:e.slug}),n[0]=e.id,n[1]=e.slug,n[2]=i):i=n[2];const{data:r}=He(i),a=He({queryKey:Ue.commerceDiscoveryConnection(e.id,s),enabled:!!r,retry:!1,staleTime:6e4,queryFn:async()=>{if(!r)throw new Error("selfClient not ready");const j=await r.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:s}});return Ot(j)}}).data?.item??null,{data:l}=He({...Pt({connectionId:s,orgId:e.id,orgSlug:e.slug}),enabled:!!a}),c=Ue.commerceDiscoveryDiagnostic(e.id,s),d=!!l;let f;n[3]!==l?(f=async()=>{if(!l)throw new Error("cdClient not ready");const j=await l.callTool({name:Qt,arguments:{}});return Ot(j).diagnostic??null},n[3]=l,n[4]=f):f=n[4];let m;n[5]!==c||n[6]!==d||n[7]!==f?(m={queryKey:c,enabled:d,retry:1,refetchInterval:Ci,queryFn:f},n[5]=c,n[6]=d,n[7]=f,n[8]=m):m=n[8];const u=He(m),p=u.data??null,y=u.isSuccess,x=a?.metadata?.siteUrl;let g;n[9]!==x?(g=yi(x),n[9]=x,n[10]=g):g=n[10];const h=l??null;let v;return n[11]!==s||n[12]!==u.isSuccess||n[13]!==p||n[14]!==g||n[15]!==h?(v={diagnostic:p,isSuccess:y,host:g,connectionId:s,cdClient:h},n[11]=s,n[12]=u.isSuccess,n[13]=p,n[14]=g,n[15]=h,n[16]=v):v=n[16],v}function Ci(n){return n.state.status!=="error"&&bi(n.state.data)==="generating"?ji:!1}function Or(n,e){return{to:"/$org/$taskId",params:{org:n.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:En(n.id),main:Qs(e,Qt)}}}export{Sr as A,_r as C,kr as N,Nr as O,Ar as T,wr as a,Ir as b,Mr as c,so as d,Mt as e,Tr as f,Pr as g,bi as h,Or as i,Dr as u};
@@ -1 +0,0 @@
1
- import{c as f,F as C,bd as S,e3 as p,bc as T}from"./index-CacyxM-B.js";import{S as I,u as A}from"./use-mcp-client-DRcy9vk6.js";function v(t){const o=f.c(20);let i;o[0]!==t?(i=t===void 0?{}:t,o[0]=t,o[1]=i):i=o[1];const n=i;let l,s,c,d;o[2]!==n?({binding:l,includeVirtual:c,slug:d,...s}=n,o[2]=n,o[3]=l,o[4]=s,o[5]=c,o[6]=d):(l=o[3],s=o[4],c=o[5],d=o[6]);let e;o[7]!==l||o[8]!==s.additionalToolArgs||o[9]!==c||o[10]!==d?(e={...s.additionalToolArgs},l!==void 0&&(e.binding=l),c!==void 0&&(e.include_virtual=c),d!==void 0&&(e.slug=d),o[7]=l,o[8]=s.additionalToolArgs,o[9]=c,o[10]=d,o[11]=e):e=o[11];let g;o[12]!==e?(g=Object.keys(e).length>0?e:void 0,o[12]=e,o[13]=g):g=o[13];let r;o[14]!==s||o[15]!==g?(r={...s,additionalToolArgs:g},o[14]=s,o[15]=g,o[16]=r):r=o[16];const N=r,{org:u}=C();let a;o[17]!==u.id||o[18]!==u.slug?(a={connectionId:I,orgId:u.id,orgSlug:u.slug},o[17]=u.id,o[18]=u.slug,o[19]=a):a=o[19];const O=A(a);return p(u.id,"CONNECTIONS",O,N)}function E(t){const o=f.c(3),{org:i}=C();let n;o[0]!==i.id||o[1]!==i.slug?(n={connectionId:I,orgId:i.id,orgSlug:i.slug},o[0]=i.id,o[1]=i.slug,o[2]=n):n=o[2];const l=A(n);return T(i.id,"CONNECTIONS",t,l)}function _(){const t=f.c(3),{org:o}=C();let i;t[0]!==o.id||t[1]!==o.slug?(i={connectionId:I,orgId:o.id,orgSlug:o.slug},t[0]=o.id,t[1]=o.slug,t[2]=i):i=t[2];const n=A(i);return S(o.id,"CONNECTIONS",n)}export{E as a,_ as b,v as u};