decocms 4.321.1 → 4.321.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (253) hide show
  1. package/dist/client/assets/{AlertCircle-DTA-xmN8.js → AlertCircle-mzPvygUw.js} +1 -1
  2. package/dist/client/assets/{AreaChart-DWzH4cl2.js → AreaChart-DpI9x93q.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-DJHyaGVg.js → ArrowLeft-Bp9N4N0-.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-B56zz92l.js → ArrowUp-Yj21fZGL.js} +1 -1
  5. package/dist/client/assets/{Check-yANPvlWH.js → Check-DFpZ57WE.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-CEm5M3Tl.js → CheckCircle-BL9fUGh0.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-D_8iRnVD.js → ChevronRight-B0k8i06h.js} +1 -1
  8. package/dist/client/assets/{ChevronSelectorVertical-CDr8Ovfg.js → ChevronSelectorVertical-C36SdIlf.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-D9JVuW7G.js → ChevronUp-DoFbOo5V.js} +1 -1
  10. package/dist/client/assets/{Copy01-ZnkwptEM.js → Copy01-DQrZ6li-.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-DBOo-aYq.js → CreditCard01-BwmXIXJx.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-mvRvTh6x.js → DotsVertical-DJWfzfak.js} +1 -1
  13. package/dist/client/assets/{Download01-CeBHR-fX.js → Download01-DsQzO8cd.js} +1 -1
  14. package/dist/client/assets/{ErrorBarContext-CMbUifoM.js → ErrorBarContext-CJd0p0QO.js} +1 -1
  15. package/dist/client/assets/{Eye-ggEjyhYq.js → Eye-BC_4l4lG.js} +1 -1
  16. package/dist/client/assets/{GitBranch01-DZEodcVR.js → GitBranch01-C4EIccIA.js} +1 -1
  17. package/dist/client/assets/{Globe01-Dj13xfTI.js → Globe01-DHMT8bp9.js} +1 -1
  18. package/dist/client/assets/{HardDrive-Bkrrs0FV.js → HardDrive-DO3IjmaH.js} +1 -1
  19. package/dist/client/assets/{Image01-DfTbYbFE.js → Image01-C4TVJnST.js} +1 -1
  20. package/dist/client/assets/{Key01-BBxtRrGm.js → Key01-a9vi-Tku.js} +1 -1
  21. package/dist/client/assets/{Link01-DUUbBvGo.js → Link01-BWge3x25.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-61qG-hFo.js → LinkExternal01-qomjjlr4.js} +1 -1
  23. package/dist/client/assets/{LockUnlocked01-BfX9zVyU.js → LockUnlocked01-BD5ISYeA.js} +1 -1
  24. package/dist/client/assets/{Monitor01-Cvj67Ryv.js → Monitor01-BB9oelwa.js} +1 -1
  25. package/dist/client/assets/{Package-B4jzjbE8.js → Package-DRO-nel6.js} +1 -1
  26. package/dist/client/assets/{Palette-CXReGsk_.js → Palette-CzJtqmLV.js} +1 -1
  27. package/dist/client/assets/{Play-kr1GKsAc.js → Play-BOlL7p4H.js} +1 -1
  28. package/dist/client/assets/{Plus-Bz1cAYCY.js → Plus-B4HOF1E1.js} +1 -1
  29. package/dist/client/assets/{SearchMd-DN6cu6SZ.js → SearchMd-BL3yOzl8.js} +1 -1
  30. package/dist/client/assets/{Sector-DidaJ4gW.js → Sector-B66RdjM2.js} +1 -1
  31. package/dist/client/assets/{Settings02-C39ViKVB.js → Settings02-Bj1lDwij.js} +1 -1
  32. package/dist/client/assets/{Share07-vMCtuazW.js → Share07-K9acKdZ2.js} +1 -1
  33. package/dist/client/assets/{Shield01-SPzOFIU1.js → Shield01-B2le5qB9.js} +1 -1
  34. package/dist/client/assets/{Stars01-q62Ogx-P.js → Stars01-DBkTEhiq.js} +1 -1
  35. package/dist/client/assets/{Sun-B3CG15-H.js → Sun-v51TgHoC.js} +1 -1
  36. package/dist/client/assets/{ThumbsUp-DV6K5Csu.js → ThumbsUp-DZtUuNqz.js} +1 -1
  37. package/dist/client/assets/{Tool01-DP3BW23e.js → Tool01-3TSBet75.js} +1 -1
  38. package/dist/client/assets/{Tool02-DT-zZ1ks.js → Tool02-CUjmmZmP.js} +1 -1
  39. package/dist/client/assets/{Trash01-D5j2YoAs.js → Trash01-RcSuYrVJ.js} +1 -1
  40. package/dist/client/assets/{TrendUp01-CaNIYwx8.js → TrendUp01-B1pPYfuK.js} +1 -1
  41. package/dist/client/assets/{Upload01-DSJ1fWRp.js → Upload01-lXk5j7xP.js} +1 -1
  42. package/dist/client/assets/{User01-Bq-AsdvG.js → User01-AECGy6qL.js} +1 -1
  43. package/dist/client/assets/{UserSquare-DGuYrk9Q.js → UserSquare-DAvB_kFJ.js} +1 -1
  44. package/dist/client/assets/{Users01-CS6rfCga.js → Users01-BgVgHDh8.js} +1 -1
  45. package/dist/client/assets/{Users03-BnbWbfJy.js → Users03-B7rH-Prq.js} +1 -1
  46. package/dist/client/assets/{XCircle-Dlv7pZja.js → XCircle-BcRsQfbp.js} +1 -1
  47. package/dist/client/assets/{XClose-BNIppwTn.js → XClose-CfMSoySe.js} +1 -1
  48. package/dist/client/assets/{Zap-CywbYsFI.js → Zap-B1-2Q3w4.js} +1 -1
  49. package/dist/client/assets/{ZoomOut-jLe5z2Gu.js → ZoomOut-CN3_bE81.js} +1 -1
  50. package/dist/client/assets/{access-gate-CgF7Ajgl.js → access-gate-Bqb_IoZo.js} +1 -1
  51. package/dist/client/assets/{agent-icon-D-9pJpLD.js → agent-icon-9NxB5SOp.js} +1 -1
  52. package/dist/client/assets/{agents-list-Bp5Z7NYF.js → agents-list-C76JNu3A.js} +1 -1
  53. package/dist/client/assets/{ai-providers-BxXtxvrC.js → ai-providers-BaeUPfRB.js} +1 -1
  54. package/dist/client/assets/{alert-DlKRUXrR.js → alert-4OAU_nBA.js} +1 -1
  55. package/dist/client/assets/{alert-dialog-D3FLXTEj.js → alert-dialog-CcHS-XLY.js} +1 -1
  56. package/dist/client/assets/{analytics-tab-BfjNGR6F.js → analytics-tab-BCxp8jRR.js} +1 -1
  57. package/dist/client/assets/api-keys-B1rGBGLW.js +1 -0
  58. package/dist/client/assets/{api-keys-DyNVpi-W.js → api-keys-gIqXyv9f.js} +1 -1
  59. package/dist/client/assets/app-editor-CO_1PqE8.js +1 -0
  60. package/dist/client/assets/{auth-CeWlFDdC.js → auth-7gOJrCJs.js} +1 -1
  61. package/dist/client/assets/{auth-catchall-D7POTu6Q.js → auth-catchall-DUFwyN0I.js} +1 -1
  62. package/dist/client/assets/{auth-entry-COCcX5A_.js → auth-entry-CmvczzF5.js} +1 -1
  63. package/dist/client/assets/{auth-split-layout-BG8u1Dhb.js → auth-split-layout-CdiwAUW1.js} +1 -1
  64. package/dist/client/assets/{authenticate-and-persist-oauth-CxGKh8aj.js → authenticate-and-persist-oauth-BSmdaYES.js} +1 -1
  65. package/dist/client/assets/{automation-list-row-Dr9aH5cl.js → automation-list-row-vaYTAqBr.js} +1 -1
  66. package/dist/client/assets/{automation-runs-D-MsqDZA.js → automation-runs-CH0DGbop.js} +1 -1
  67. package/dist/client/assets/{automations-DmzNjC10.js → automations-DS-29qSN.js} +1 -1
  68. package/dist/client/assets/{avatar-CsipcR4h.js → avatar-gFJWL-Vg.js} +1 -1
  69. package/dist/client/assets/{badge-Cr2fQRq8.js → badge-DU8Pt1Ge.js} +1 -1
  70. package/dist/client/assets/{block-document-CPpzuDJ1.js → block-document-B-APilfu.js} +1 -1
  71. package/dist/client/assets/{breadcrumb-BOw37uby.js → breadcrumb-TNKPI3dS.js} +1 -1
  72. package/dist/client/assets/{buckets-BhMvQpB6.js → buckets-rWwZp5wi.js} +1 -1
  73. package/dist/client/assets/{bulk-category-panel-lgnUhRZs.js → bulk-category-panel-Dmla31YZ.js} +1 -1
  74. package/dist/client/assets/{capability-load-error-D2I8YlS5.js → capability-load-error-BsnWRA5W.js} +1 -1
  75. package/dist/client/assets/{cards-Ckz_jSmB.js → cards-GrxitjN9.js} +1 -1
  76. package/dist/client/assets/{category-editor-CUeNF_8r.js → category-editor-CJqNv7_k.js} +1 -1
  77. package/dist/client/assets/{cdn-tab-EuSTLp5_.js → cdn-tab-CGwd_rBy.js} +1 -1
  78. package/dist/client/assets/{chart-BIwqiDqG.js → chart-Ctqg6c-J.js} +1 -1
  79. package/dist/client/assets/{chat-context-oSgRN_kR.js → chat-context-E6CzjtFL.js} +6 -6
  80. package/dist/client/assets/{checkbox-DRf1c0rh.js → checkbox-DoENx1Tp.js} +1 -1
  81. package/dist/client/assets/{choose-editor-Pdurttdh.js → choose-editor-6iE-NUNZ.js} +1 -1
  82. package/dist/client/assets/{cli-auth-success-CAWRFjR6.js → cli-auth-success-wrrg72SU.js} +1 -1
  83. package/dist/client/assets/{client-icons-BFT3ByhX.js → client-icons-DZ-wX-6W.js} +1 -1
  84. package/dist/client/assets/{collection-detail-B9Md04g8.js → collection-detail-BaCsEwRG.js} +1 -1
  85. package/dist/client/assets/{collection-display-button-DWOMOsAO.js → collection-display-button-DakfldYj.js} +1 -1
  86. package/dist/client/assets/{collection-search-lJZ_AiYh.js → collection-search-Bfeg8_4N.js} +1 -1
  87. package/dist/client/assets/{collection-table-wrapper-DvYmVRqQ.js → collection-table-wrapper-BtrS3OmC.js} +1 -1
  88. package/dist/client/assets/{collection-tabs-BCClisiC.js → collection-tabs-CtU4r8Hy.js} +1 -1
  89. package/dist/client/assets/{command-BvTOvAwX.js → command-C_Uammpe.js} +1 -1
  90. package/dist/client/assets/{commerce-onboarding-BVfRsUSf.js → commerce-onboarding-D5Q-YKhe.js} +1 -1
  91. package/dist/client/assets/{config-ykFar5kq.js → config-BGIQidIa.js} +1 -1
  92. package/dist/client/assets/{connect-C2gWPZrC.js → connect-0x4VThqB.js} +2 -2
  93. package/dist/client/assets/{connect-layout-DPz52OVW.js → connect-layout-CN6ikwT9.js} +1 -1
  94. package/dist/client/assets/{connection-q0Pvw2B2.js → connection-CZKw5XC0.js} +1 -1
  95. package/dist/client/assets/{connection-card-CLVO7gWM.js → connection-card-C8JTppjB.js} +1 -1
  96. package/dist/client/assets/{connection-detail-BUdncL7r.js → connection-detail-Ber683jR.js} +1 -1
  97. package/dist/client/assets/{connection-form-helpers-BhB23GqA.js → connection-form-helpers-C8Ib0fh-.js} +1 -1
  98. package/dist/client/assets/{connections-B8VbHw_f.js → connections-CnGMoGPi.js} +1 -1
  99. package/dist/client/assets/{create-organization-dialog-CfcRT_JW.js → create-organization-dialog-DmjxuakX.js} +1 -1
  100. package/dist/client/assets/{decopilot-sse-pool-_NQmGFbS.js → decopilot-sse-pool-CGjOzfxR.js} +1 -1
  101. package/dist/client/assets/{dialog-C7M7JvTo.js → dialog-oJmEQ7fd.js} +1 -1
  102. package/dist/client/assets/{domain-settings-9aEPBIWO.js → domain-settings-CArlyMNt.js} +1 -1
  103. package/dist/client/assets/{drawer-CMB3kWdd.js → drawer-Bw9gslIb.js} +1 -1
  104. package/dist/client/assets/{dropdown-menu-D4_fxfOo.js → dropdown-menu-DwjXZoet.js} +1 -1
  105. package/dist/client/assets/{e2e-tab-C_eFWdmQ.js → e2e-tab-Co0R0nLL.js} +1 -1
  106. package/dist/client/assets/{editor-D9KXkL69.js → editor-BX-SJ89b.js} +1 -1
  107. package/dist/client/assets/{empty-state-CMqWP7WN.js → empty-state-CRx1rEIR.js} +1 -1
  108. package/dist/client/assets/{empty-state-CXTU0Gr5.js → empty-state-DJ43bnFn.js} +1 -1
  109. package/dist/client/assets/{extract-connection-data-D_rrQk5k.js → extract-connection-data-MINwSTDT.js} +1 -1
  110. package/dist/client/assets/{file-explorer-_NdkqYe1.js → file-explorer-DpEq8ubB.js} +1 -1
  111. package/dist/client/assets/{file-type-icon-BnnSdDsH.js → file-type-icon-D_Zgk3qT.js} +1 -1
  112. package/dist/client/assets/{folder-icon-DlTz7QPL.js → folder-icon-Bp7D1Lcv.js} +1 -1
  113. package/dist/client/assets/{form-kmhrAcMq.js → form-KNJGif8F.js} +1 -1
  114. package/dist/client/assets/{general-Ds56K9tp.js → general-BMvfpBmx.js} +1 -1
  115. package/dist/client/assets/{github-repo-picker-CG5N8uO0.js → github-repo-picker-XPNUm2jV.js} +1 -1
  116. package/dist/client/assets/{hooks-D05F-stG.js → hooks-WsI05bHe.js} +1 -1
  117. package/dist/client/assets/{hosting-tab-r6isx4QP.js → hosting-tab-DAwmuGFe.js} +1 -1
  118. package/dist/client/assets/{index-DY3dr3k9.js → index-6Ycnwbva.js} +1 -1
  119. package/dist/client/assets/{index-BSbcWYFA.js → index-B0bzsRbf.js} +1 -1
  120. package/dist/client/assets/{index-BoKx8Diy.js → index-BbTCpGvf.js} +1 -1
  121. package/dist/client/assets/{index-Br8dpGPA.js → index-CHXtyL0r.js} +1 -1
  122. package/dist/client/assets/{index-CgPdM9sX.js → index-CvdDBP2H.js} +1 -1
  123. package/dist/client/assets/{index-BWEmC9U0.js → index-CwsK8XI2.js} +46 -46
  124. package/dist/client/assets/{index-CthsQzIN.js → index-Da2hHsRU.js} +1 -1
  125. package/dist/client/assets/{index-B8v6bpri.js → index-KlN2gCIz.js} +3 -3
  126. package/dist/client/assets/{index-M-Ir9x4g.js → index-Uk_mCif6.js} +1 -1
  127. package/dist/client/assets/{index-BsAjbvxf.js → index-a87BkhVH.js} +1 -1
  128. package/dist/client/assets/{index-redirect-CUiCthS_.js → index-redirect-DleK1Yt6.js} +1 -1
  129. package/dist/client/assets/{infra-billing-DhUuoMMN.js → infra-billing-Gef8-Dhn.js} +1 -1
  130. package/dist/client/assets/{input-DW2ahhtH.js → input-HEtJVl9i.js} +1 -1
  131. package/dist/client/assets/{integration-icon-B89DtTTF.js → integration-icon-BgsghQ7E.js} +1 -1
  132. package/dist/client/assets/{invite-member-dialog-BVqSRdPq.js → invite-member-dialog-DGzj_Tvq.js} +1 -1
  133. package/dist/client/assets/{label-BhS7vsEg.js → label-C0PesxR-.js} +1 -1
  134. package/dist/client/assets/{layout-CCn5VLb4.js → layout-D6_KfOu0.js} +1 -1
  135. package/dist/client/assets/{login-DUuhqIbA.js → login-Otop9Ck2.js} +1 -1
  136. package/dist/client/assets/{markdown-C3hAzezL.js → markdown-eRJzb9Cb.js} +1 -1
  137. package/dist/client/assets/{mcp-oauth-DLj5d3Vy.js → mcp-oauth-B78QmrXr.js} +1 -1
  138. package/dist/client/assets/{members-DwYXjhhh.js → members-cV_AP40t.js} +1 -1
  139. package/dist/client/assets/{monaco-editor-Vy_rhpBS.js → monaco-editor-u3OHcMfo.js} +1 -1
  140. package/dist/client/assets/{monitoring-stats-row-D_d5RjHF.js → monitoring-stats-row-DvisuCi9.js} +1 -1
  141. package/dist/client/assets/{multi-select-peQ8D8Pu.js → multi-select-kuRZRD8_.js} +1 -1
  142. package/dist/client/assets/{oauth-callback-D4zEQe6g.js → oauth-callback-CFiWX7_u.js} +1 -1
  143. package/dist/client/assets/{oauth-callback-ai-provider-9a41pxZK.js → oauth-callback-ai-provider-BXFT1DOb.js} +1 -1
  144. package/dist/client/assets/{onboarding-CUeeEM4A.js → onboarding-i3HWUuTF.js} +1 -1
  145. package/dist/client/assets/org-layout-CDZCpF2V.js +1 -0
  146. package/dist/client/assets/{organization-choice-CufRbPCe.js → organization-choice-DjXSPcsB.js} +1 -1
  147. package/dist/client/assets/{orgs-DOJ311_K.js → orgs-DzhQ4XlA.js} +1 -1
  148. package/dist/client/assets/{page-seo-form-Bzm5UnJ9.js → page-seo-form-CCYA0iJF.js} +1 -1
  149. package/dist/client/assets/{popover-t_ZIm7eh.js → popover-DMAen6H4.js} +1 -1
  150. package/dist/client/assets/{post-calendar-Bmj9kbgm.js → post-calendar-DFTSle3P.js} +1 -1
  151. package/dist/client/assets/{post-editor-B04BBFsL.js → post-editor-lUsz95wa.js} +1 -1
  152. package/dist/client/assets/{primitives-B8PIMqZF.js → primitives-B-Wm41ZY.js} +1 -1
  153. package/dist/client/assets/{profile-2ky8_NJs.js → profile-BmPUiRfA.js} +1 -1
  154. package/dist/client/assets/{project-app-view-CPyowKnA.js → project-app-view-CA9ASpQB.js} +1 -1
  155. package/dist/client/assets/{prompts-DF_PvFvF.js → prompts-B9q2oJHk.js} +1 -1
  156. package/dist/client/assets/record-editor-BCumq3mK.js +1 -0
  157. package/dist/client/assets/redirect-editor-CAyDfHTn.js +1 -0
  158. package/dist/client/assets/registry-DZUz6BnD.js +2 -0
  159. package/dist/client/assets/{registry-layout-CxgAdcGY.js → registry-layout-Bq-4xMFT.js} +1 -1
  160. package/dist/client/assets/{reports-Cfr_ooDi.js → reports-B6dBYVE9.js} +1 -1
  161. package/dist/client/assets/{require-capability-C3U03ONf.js → require-capability-BcT35GEL.js} +1 -1
  162. package/dist/client/assets/{required-auth-layout-BFd3YKM1.js → required-auth-layout-ByszmYIS.js} +1 -1
  163. package/dist/client/assets/{reset-password-CB7WpCLR.js → reset-password-C-j76GLY.js} +1 -1
  164. package/dist/client/assets/{review-settings-BWlNqIKi.js → review-settings-DOzVKzXE.js} +1 -1
  165. package/dist/client/assets/{roles-BypxpQys.js → roles-VMVSF7hO.js} +1 -1
  166. package/dist/client/assets/{schema-BuoIK2NM.js → schema-84vLWA89.js} +1 -1
  167. package/dist/client/assets/{scroll-area-CF5KP4xT.js → scroll-area-BC0xk88l.js} +1 -1
  168. package/dist/client/assets/{search-input-l9JmQN1V.js → search-input-BE0KVAOM.js} +1 -1
  169. package/dist/client/assets/{secrets-mUX1ZJSA.js → secrets-8as8OGs2.js} +1 -1
  170. package/dist/client/assets/{sections-editor-DkA5v4Ou.js → sections-editor-DT_YOSrM.js} +1 -1
  171. package/dist/client/assets/{select-BeM39jjH.js → select-BqDsJm6t.js} +1 -1
  172. package/dist/client/assets/{select-model-rW6YwKIw.js → select-model-BluwSVID.js} +1 -1
  173. package/dist/client/assets/{self-tool-result-BOY_ezHR.js → self-tool-result-Crp_HAZ-.js} +1 -1
  174. package/dist/client/assets/{seo-editor-ARl87ZpS.js → seo-editor-Dx0IkBh5.js} +1 -1
  175. package/dist/client/assets/settings-layout-CbCqYC0T.js +1 -0
  176. package/dist/client/assets/{settings-sidebar-qm5r11nz.js → settings-sidebar-HbW6Jgug.js} +1 -1
  177. package/dist/client/assets/{shell-controls-Dtx9w7-l.js → shell-controls-YRTZQ5Ef.js} +1 -1
  178. package/dist/client/assets/{shell-layout-CGFwfHMp.js → shell-layout-CvYCmCNz.js} +1 -1
  179. package/dist/client/assets/{skill-preview-hysKC1kO.js → skill-preview-JuBBgBRK.js} +1 -1
  180. package/dist/client/assets/{skills-C7wLCrdg.js → skills-CZPxgiPp.js} +1 -1
  181. package/dist/client/assets/{sso-b4d7V5F8.js → sso-BZACPXqJ.js} +1 -1
  182. package/dist/client/assets/{store-BPxn9mDU.js → store-cJ0amgmM.js} +1 -1
  183. package/dist/client/assets/store-registry-ByK7cRvk.js +2 -0
  184. package/dist/client/assets/{switch-BTJg1O9U.js → switch-D_k4Qu1u.js} +1 -1
  185. package/dist/client/assets/{synced-repos-iq5etoTM.js → synced-repos-uwlv0Pey.js} +1 -1
  186. package/dist/client/assets/{table-B_EStcLQ.js → table-Dap-hV0L.js} +1 -1
  187. package/dist/client/assets/{tabs-BjBxcmhp.js → tabs-COqGDJL6.js} +1 -1
  188. package/dist/client/assets/{task-board-BHMys9hW.js → task-board-B75_z9Rj.js} +1 -1
  189. package/dist/client/assets/{task-route-r-W3qHvB.js → task-route-DbcCoz7p.js} +1 -1
  190. package/dist/client/assets/{tasks-Dz1vfh1l.js → tasks-BhNpm5RX.js} +1 -1
  191. package/dist/client/assets/{textarea-ByOwMVOP.js → textarea-BvwRrfOE.js} +1 -1
  192. package/dist/client/assets/{thread-intent-DeAJERp8.js → thread-intent-aJd8je2A.js} +1 -1
  193. package/dist/client/assets/{thread-route-JP_jBQl2.js → thread-route-nSN2wMws.js} +1 -1
  194. package/dist/client/assets/{toggle-group-BQMbtzfI.js → toggle-group-5clbhSyw.js} +1 -1
  195. package/dist/client/assets/{toolbar-CR_lIJhX.js → toolbar-6ATG38pw.js} +1 -1
  196. package/dist/client/assets/{toolbar-icon-button-CyVRuDcs.js → toolbar-icon-button-D78WqDTu.js} +1 -1
  197. package/dist/client/assets/{track-BzrD-gEE.js → track-D1An3sTA.js} +1 -1
  198. package/dist/client/assets/{types-DdehnnVY.js → types-D6oSpRz1.js} +1 -1
  199. package/dist/client/assets/{use-ai-providers-VRUuTRhq.js → use-ai-providers-D3ICNjqW.js} +1 -1
  200. package/dist/client/assets/{use-automations-1X67KfoT.js → use-automations-BRtBR0Tx.js} +1 -1
  201. package/dist/client/assets/{use-autosave-DCQJH_gL.js → use-autosave-Cuy0PbSg.js} +1 -1
  202. package/dist/client/assets/use-connection-C_L1iNkQ.js +1 -0
  203. package/dist/client/assets/{use-copy-B1L1W9s2.js → use-copy-cKoPwH5D.js} +1 -1
  204. package/dist/client/assets/{use-create-virtual-mcp-DiQNHYEZ.js → use-create-virtual-mcp-BaW9xhHR.js} +1 -1
  205. package/dist/client/assets/{use-debounced-autosave-BMYZ2YGs.js → use-debounced-autosave-BufHbfWF.js} +1 -1
  206. package/dist/client/assets/{use-debounced-value-D1N9FCWc.js → use-debounced-value-B4gfPGsg.js} +1 -1
  207. package/dist/client/assets/{use-decopilot-events-q6jF3KyR.js → use-decopilot-events-CjxND1rZ.js} +1 -1
  208. package/dist/client/assets/{use-delete-connection-DjOX5zhj.js → use-delete-connection-DpF13y-G.js} +1 -1
  209. package/dist/client/assets/{use-deployment-admin-DnmqgnN7.js → use-deployment-admin-D6YGJgYx.js} +1 -1
  210. package/dist/client/assets/{use-destination-route-BZnZlxip.js → use-destination-route-C-c7cE6M.js} +1 -1
  211. package/dist/client/assets/{use-file-configs-RNJYyxdo.js → use-file-configs-BTZYprex.js} +1 -1
  212. package/dist/client/assets/{use-infinite-scroll-BkUvStlN.js → use-infinite-scroll-Ce21aioX.js} +1 -1
  213. package/dist/client/assets/{use-join-requests-D243QYrm.js → use-join-requests-DpubSuKS.js} +1 -1
  214. package/dist/client/assets/{use-mcp-auth-status-B_NYbaoD.js → use-mcp-auth-status-DIwhYzpu.js} +1 -1
  215. package/dist/client/assets/{use-mcp-client-DJ3fa1xp.js → use-mcp-client-DaJV2zKk.js} +1 -1
  216. package/dist/client/assets/{use-mcp-prompts-EDCEFkva.js → use-mcp-prompts-9qMQ8HS9.js} +1 -1
  217. package/dist/client/assets/{use-mcp-tools-CSF0Nzff.js → use-mcp-tools-DS4bYai0.js} +1 -1
  218. package/dist/client/assets/{use-members-CfnD8M7u.js → use-members-CNWUo54i.js} +1 -1
  219. package/dist/client/assets/{use-navigate-to-agent-Bfd85iwi.js → use-navigate-to-agent-DsYRGB5d.js} +1 -1
  220. package/dist/client/assets/{use-org-auth-client-C0QDcwVK.js → use-org-auth-client-BDB3wxk-.js} +1 -1
  221. package/dist/client/assets/{use-org-repo-syncs-D_mgvf_i.js → use-org-repo-syncs-sXrl_DWw.js} +1 -1
  222. package/dist/client/assets/{use-org-sso-DMI8WwP0.js → use-org-sso-BhjEyf4c.js} +1 -1
  223. package/dist/client/assets/{use-organization-roles-D8aZ-ZR_.js → use-organization-roles-G6p07kEe.js} +1 -1
  224. package/dist/client/assets/{use-organization-settings-BA2lxbR3.js → use-organization-settings-Bm9CU7A0.js} +1 -1
  225. package/dist/client/assets/{use-panel-navigate-Bd6QXiJy.js → use-panel-navigate-B_jYd-oO.js} +1 -1
  226. package/dist/client/assets/{use-project-scope-l_KFftl6.js → use-project-scope-M7A4kaM_.js} +1 -1
  227. package/dist/client/assets/{use-registry-connections-DXPYxL2r.js → use-registry-connections-BPblfAxm.js} +1 -1
  228. package/dist/client/assets/{use-secrets-Bgkr4W3S.js → use-secrets-ASFtQe9O.js} +1 -1
  229. package/dist/client/assets/{use-section-preview-base-BV3vay05.js → use-section-preview-base-DEmQvfgW.js} +1 -1
  230. package/dist/client/assets/{use-status-sounds-BBTrZxa1.js → use-status-sounds-C5nQIKjo.js} +1 -1
  231. package/dist/client/assets/{use-tags-CehLjUea.js → use-tags-BAdNUKqb.js} +1 -1
  232. package/dist/client/assets/{use-view-mode-DhfDSglh.js → use-view-mode-DixmuAd0.js} +1 -1
  233. package/dist/client/assets/{use-virtual-mcp-7JAczJJM.js → use-virtual-mcp-D1i-P-jz.js} +1 -1
  234. package/dist/client/assets/useInfiniteQuery-CEWWIp6Z.js +1 -0
  235. package/dist/client/assets/useSuspenseInfiniteQuery-Bv4wKU6R.js +1 -0
  236. package/dist/client/assets/{users-DlROvta_.js → users-D8OY72ZK.js} +1 -1
  237. package/dist/client/assets/{variant-calendar-BL03vejT.js → variant-calendar-BH49MFNR.js} +1 -1
  238. package/dist/client/assets/{view-mode-toggle-DITqQxrp.js → view-mode-toggle-BxwtIeBE.js} +1 -1
  239. package/dist/client/index.html +1 -1
  240. package/dist/server/cli.js +1 -1
  241. package/dist/server/server.js +1 -1
  242. package/package.json +1 -1
  243. package/dist/client/assets/api-keys-DpAgTJhn.js +0 -1
  244. package/dist/client/assets/app-editor-Zo3b9Buj.js +0 -1
  245. package/dist/client/assets/org-layout-C14JwsL-.js +0 -1
  246. package/dist/client/assets/record-editor-CdeH0PSN.js +0 -1
  247. package/dist/client/assets/redirect-editor-DNQScjsS.js +0 -1
  248. package/dist/client/assets/registry-DXjIrXbl.js +0 -2
  249. package/dist/client/assets/settings-layout-DYs5pwaZ.js +0 -1
  250. package/dist/client/assets/store-registry-BtXrmEhT.js +0 -2
  251. package/dist/client/assets/use-connection-C-dhEQVr.js +0 -1
  252. package/dist/client/assets/useInfiniteQuery-CVCgU7w5.js +0 -1
  253. package/dist/client/assets/useSuspenseInfiniteQuery-BONtGFny.js +0 -1
@@ -1 +1 @@
1
- import{c as M,l as q,j as t,h as Ge,r as Q,I as Wt,G as Cs,o as Z,b as K,b6 as ks,W as we,d as Xt,a6 as Yt,_ as qt,L as ys,a1 as ze,a2 as Ee,a4 as Re,a as bt,F as Ns,ar as Ss,as as _s,B as je,t as xe,H as ws,J as Ds,K as vt,n as As,a7 as Fs,m as Is,ap as Ts}from"./index-B8v6bpri.js";import{c as Qt,u as Bs,d as Jt}from"./thread-route-JP_jBQl2.js";import{t as De}from"./ChevronUp-D9JVuW7G.js";import{A as Zt,L as Ps,s as ct,a3 as dt,a2 as Ls,a1 as $s,a8 as Ms}from"./agent-icon-D-9pJpLD.js";import{a as es,i as Os,e as zs,S as Es,f as Rs}from"./constants-DNuUCxmW.js";import{b as Ct,u as Vs}from"./use-virtual-mcp-7JAczJJM.js";import{g as Ks}from"./github-repo-BpKUwJal.js";import{T as ts}from"./toolbar-icon-button-CyVRuDcs.js";import{P as st,a as Ve,b as nt}from"./popover-t_ZIm7eh.js";import{D as kt,a as yt,b as Nt,c as Gs,e as Hs,f as ss,g as ns,d as Us}from"./drawer-CMB3kWdd.js";import{i as Ws}from"./SearchMd-DN6cu6SZ.js";import{i as He}from"./Check-yANPvlWH.js";import{s as We}from"./Plus-Bz1cAYCY.js";import{G as ht,a as Xs}from"./github-repo-picker-CG5N8uO0.js";import{g as Ys,u as qs,b as ls}from"./hooks-D05F-stG.js";import{g as Qs,b as os}from"./use-project-scope-l_KFftl6.js";import{b as Js,c as Zs,a as en}from"./use-navigate-to-agent-Bfd85iwi.js";import{u as is}from"./shell-layout-CGFwfHMp.js";import{d as tn}from"./thread-intent-DeAJERp8.js";import{C as sn}from"./collection-search-lJZ_AiYh.js";import{g as nn,b as ln,a as on,e as an}from"./extract-connection-data-D_rrQk5k.js";import{u as as,a as rs,g as rn,C as ut}from"./connection-card-CLVO7gWM.js";import{D as cs,b as ds,c as us,d as fs,h as cn,e as dn}from"./dialog-C7M7JvTo.js";import{d as re,a as ce,e as de,b as ue,c as fe,F as Pt}from"./form-kmhrAcMq.js";import{I as Se}from"./input-DW2ahhtH.js";import{S as un,a as fn,b as mn,c as pn,d as Ke}from"./select-BeM39jjH.js";import{T as hn}from"./textarea-ByOwMVOP.js";import{b as ms}from"./use-connection-C-dhEQVr.js";import{n as Ze,a as ft,i as ps}from"./Tool02-DT-zZ1ks.js";import{b as gn}from"./UserSquare-DGuYrk9Q.js";import{s as xn}from"./XClose-BNIppwTn.js";import{c as jn,i as qe,a as Lt,E as bn,p as vn,b as Cn,d as kn}from"./connection-form-helpers-BhB23GqA.js";import{a as mt}from"./authenticate-and-persist-oauth-CxGKh8aj.js";import{g as yn}from"./connection-slug-CITJ0kGN.js";import{C as Nn}from"./collection-tabs-BCClisiC.js";import{u as $t}from"./use-infinite-scroll-BkUvStlN.js";import{B as Qe}from"./badge-Cr2fQRq8.js";import{u as Sn}from"./useSuspenseInfiniteQuery-BONtGFny.js";import{u as _n}from"./use-mcp-client-DJ3fa1xp.js";import{g as et}from"./metadata-dUsYcpuu.js";import{u as wn}from"./use-ai-providers-VRUuTRhq.js";import{A as Mt}from"./avatar-CsipcR4h.js";import{h as _e,D as St,b as _t,g as wt,c as Dt}from"./dropdown-menu-D4_fxfOo.js";import{a as At,c as Ft,d as Ce,e as Ue,b as It,C as Tt}from"./command-BvTOvAwX.js";import{s as Dn}from"./TrendUp01-CaNIYwx8.js";import{a as An}from"./Settings02-C39ViKVB.js";import{s as Ot}from"./User01-Bq-AsdvG.js";import{g as zt}from"./get-initials-D-f_fDFw.js";import{P as Je,d as Fn,f as Et,j as In}from"./config-ykFar5kq.js";import{S as gt}from"./task-board-BHMys9hW.js";function Tn(n){const e=M.c(21),{value:s,onChange:o,placeholder:a,onKeyDown:i,className:l,isSearching:c,disabled:u}=n,d=a===void 0?"Search...":a;let p;e[0]!==l?(p=q("shrink-0 w-full border-b border-border h-12",l),e[0]=l,e[1]=p):p=e[1];const x=u?"cursor-not-allowed opacity-50":"cursor-text";let r;e[2]!==x?(r=q("flex items-center gap-2.5 h-12 px-4",x),e[2]=x,e[3]=r):r=e[3];let f;e[4]!==c?(f=c?t.jsx(Ge,{className:"size-4 text-muted-foreground shrink-0"}):t.jsx(Ws,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=c,e[5]=f):f=e[5];let g;e[6]!==o?(g=S=>o(S.target.value),e[6]=o,e[7]=g):g=e[7];let h;e[8]!==u||e[9]!==i||e[10]!==d||e[11]!==g||e[12]!==s?(h=t.jsx("input",{type:"text",value:s,onChange:g,onKeyDown:i,placeholder:d,disabled:u,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=u,e[9]=i,e[10]=d,e[11]=g,e[12]=s,e[13]=h):h=e[13];let j;e[14]!==r||e[15]!==f||e[16]!==h?(j=t.jsxs("label",{className:r,children:[f,h]}),e[14]=r,e[15]=f,e[16]=h,e[17]=j):j=e[17];let y;return e[18]!==p||e[19]!==j?(y=t.jsx("div",{className:p,children:j}),e[18]=p,e[19]=j,e[20]=y):y=e[20],y}function Bn(n,e,s){if(!s)return null;const o=Ys(n,e);return o?o.threads.get().find(i=>i.id===s)?.branch??null:null}function Pn(n){const e=M.c(6),{value:s,onChange:o}=n,a=K();let i;e[0]!==a?(i=a("sidebar.agentsSection.searchAgents"),e[0]=a,e[1]=i):i=e[1];let l;return e[2]!==o||e[3]!==i||e[4]!==s?(l=t.jsx(Tn,{value:s,onChange:o,placeholder:i}),e[2]=o,e[3]=i,e[4]=s,e[5]=l):l=e[5],l}function Ln(){const n=M.c(4),e=K();let s;n[0]!==e?(s=e("sidebar.agentsSection.noAgentsFound"),n[0]=e,n[1]=s):s=n[1];let o;return n[2]!==s?(o=t.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:s}),n[2]=s,n[3]=o):o=n[3],o}function $n(n){const e=M.c(10),{org:s,onClose:o}=n,a=K();let i;e[0]!==s.slug?(i={org:s.slug},e[0]=s.slug,e[1]=i):i=e[1];let l;e[2]!==o?(l=()=>o(),e[2]=o,e[3]=l):l=e[3];let c;e[4]!==a?(c=a("sidebar.agentsSection.seeAllAgents"),e[4]=a,e[5]=c):c=e[5];let u;return e[6]!==i||e[7]!==l||e[8]!==c?(u=t.jsx("div",{className:"border-t border-border px-3 py-2.5",children:t.jsx(ys,{to:"/$org/settings/agents",params:i,onClick:l,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:c})}),e[6]=i,e[7]=l,e[8]=c,e[9]=u):u=e[9],u}function Mn(){const n=M.c(4),e=K();let s;n[0]!==e?(s=e("sidebar.agentsSection.agents"),n[0]=e,n[1]=s):s=n[1];let o;return n[2]!==s?(o=t.jsx(hs,{children:s}),n[2]=s,n[3]=o):o=n[3],o}function On(n){const e=M.c(11),{onImportFromGithub:s}=n,o=K();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(ht,{className:"size-3.5"}),e[0]=a):a=e[0];let i;e[1]!==o?(i=o("sidebar.agentsSection.import"),e[1]=o,e[2]=i):i=e[2];let l;e[3]!==s||e[4]!==i?(l=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:[a,i]}),e[3]=s,e[4]=i,e[5]=l):l=e[5];let c;e[6]!==o?(c=o("sidebar.agentsSection.codeAgents"),e[6]=o,e[7]=c):c=e[7];let u;return e[8]!==l||e[9]!==c?(u=t.jsx(hs,{action:l,children:c}),e[8]=l,e[9]=c,e[10]=u):u=e[10],u}function zn(n){const e=M.c(11),{setOpen:s,emptyCtaClass:o}=n,a=K();let i;e[0]!==a?(i=a("sidebar.agentsSection.browseAgents"),e[0]=a,e[1]=i):i=e[1];let l;e[2]!==o?(l=q(o),e[2]=o,e[3]=l):l=e[3];let c;e[4]!==s?(c=()=>{Z("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[4]=s,e[5]=c):c=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(We,{className:"size-4"}),e[6]=u):u=e[6];let d;return e[7]!==i||e[8]!==l||e[9]!==c?(d=t.jsx(ts,{"aria-label":i,className:l,onClick:c,children:u}),e[7]=i,e[8]=l,e[9]=c,e[10]=d):d=e[10],d}function En(n){const e=M.c(17),{setOpen:s,highlightEmpty:o,emptyCtaClass:a}=n,i=K();let l;e[0]!==o||e[1]!==i?(l=o?void 0:i("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=i,e[2]=l):l=e[2];let c;e[3]!==a?(c=q(a),e[3]=a,e[4]=c):c=e[4];let u;e[5]!==s?(u=()=>{Z("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[5]=s,e[6]=u):u=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(We,{}),e[7]=d):d=e[7];let p;e[8]!==i?(p=i("sidebar.agentsSection.newAgent"),e[8]=i,e[9]=p):p=e[9];let x;e[10]!==p?(x=t.jsx("span",{children:p}),e[10]=p,e[11]=x):x=e[11];let r;return e[12]!==l||e[13]!==c||e[14]!==u||e[15]!==x?(r=t.jsx(Yt,{children:t.jsxs(qt,{tooltip:l,className:c,onClick:u,children:[d,x]})}),e[12]=l,e[13]=c,e[14]=u,e[15]=x,e[16]=r):r=e[16],r}function Rn(){const n=M.c(4),e=K();let s;n[0]!==e?(s=e("sidebar.agentsSection.browseAgents"),n[0]=e,n[1]=s):s=n[1];let o;return n[2]!==s?(o=t.jsx(Nt,{className:"sr-only",children:s}),n[2]=s,n[3]=o):o=n[3],o}function Vn(n){const e=M.c(8),{emptyCtaClass:s}=n,o=K();let a;e[0]!==o?(a=o("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=a):a=e[1];let i;e[2]!==s?(i=q(s),e[2]=s,e[3]=i):i=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(We,{className:"size-4"}),e[4]=l):l=e[4];let c;return e[5]!==a||e[6]!==i?(c=t.jsx(ts,{"aria-label":a,className:i,children:l}),e[5]=a,e[6]=i,e[7]=c):c=e[7],c}function Kn(n){const e=M.c(19),{wrapEmptyHint:s,highlightEmpty:o,emptyCtaClass:a}=n,i=K();let l;e[0]!==o||e[1]!==i?(l=o?void 0:i("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=i,e[2]=l):l=e[2];let c;e[3]!==a?(c=q(a),e[3]=a,e[4]=c):c=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(We,{}),e[5]=u):u=e[5];let d;e[6]!==i?(d=i("sidebar.agentsSection.newAgent"),e[6]=i,e[7]=d):d=e[7];let p;e[8]!==d?(p=t.jsx("span",{children:d}),e[8]=d,e[9]=p):p=e[9];let x;e[10]!==l||e[11]!==c||e[12]!==p?(x=t.jsx(Ve,{asChild:!0,children:t.jsxs(qt,{tooltip:l,className:c,children:[u,p]})}),e[10]=l,e[11]=c,e[12]=p,e[13]=x):x=e[13];let r;e[14]!==x||e[15]!==s?(r=s(x),e[14]=x,e[15]=s,e[16]=r):r=e[16];let f;return e[17]!==r?(f=t.jsx(Yt,{children:r}),e[17]=r,e[18]=f):f=e[18],f}function Gn(n){const e=M.c(9),{children:s}=n,o=K();let a;e[0]!==s?(a=t.jsx(ze,{asChild:!0,children:s}),e[0]=s,e[1]=a):a=e[1];let i;e[2]!==o?(i=o("sidebar.agentsSection.selectAnExistingAgent"),e[2]=o,e[3]=i):i=e[3];let l;e[4]!==i?(l=t.jsx(Ee,{side:"right",sideOffset:8,children:i}),e[4]=i,e[5]=l):l=e[5];let c;return e[6]!==a||e[7]!==l?(c=t.jsxs(Re,{defaultOpen:!0,delayDuration:0,children:[a,l]}),e[6]=a,e[7]=l,e[8]=c):c=e[8],c}function Hn(n){const e=Xt(),{create:s}=qs(),{locator:o}=we(),a=Qt(),i=Bs();return async l=>{const c=crypto.randomUUID(),u=l===i?Bn(n,o,a??""):null;try{await s({id:c,virtual_mcp_id:l,...u?{branch:u}:{}})}catch{}e({to:"/$org/$taskId",params:{org:n,taskId:c},search:{virtualmcpid:l}})}}function pt(n){const e=M.c(20),{agent:s,selected:o,onClick:a}=n,i=o?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let l;e[0]!==i?(l=q("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",i),e[0]=i,e[1]=l):l=e[1];let c;e[2]!==s.icon||e[3]!==s.title?(c=t.jsx(Zt,{icon:s.icon,name:s.title,size:"xs",className:"shrink-0"}),e[2]=s.icon,e[3]=s.title,e[4]=c):c=e[4];let u;e[5]!==s.title?(u=t.jsx("p",{className:"text-sm font-medium truncate",children:s.title}),e[5]=s.title,e[6]=u):u=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 p;e[9]!==u||e[10]!==d?(p=t.jsxs("div",{className:"flex-1 min-w-0",children:[u,d]}),e[9]=u,e[10]=d,e[11]=p):p=e[11];let x;e[12]!==o?(x=o&&t.jsx(He,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=o,e[13]=x):x=e[13];let r;return e[14]!==a||e[15]!==l||e[16]!==c||e[17]!==p||e[18]!==x?(r=t.jsxs("button",{type:"button",onClick:a,className:l,children:[c,p,x]}),e[14]=a,e[15]=l,e[16]=c,e[17]=p,e[18]=x,e[19]=r):r=e[19],r}function hs(n){const e=M.c(5),{children:s,action:o}=n;let a;e[0]!==s?(a=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s}),e[0]=s,e[1]=a):a=e[1];let i;return e[2]!==o||e[3]!==a?(i=t.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[a,o]}),e[2]=o,e[3]=a,e[4]=i):i=e[4],i}function Un(n){const e=M.c(44),{onClose:s,onSelectAgent:o,selectedAgentId:a,onImportFromGithub:i}=n,[l,c]=Q.useState(""),u=Q.useDeferredValue(l),d=u||void 0;let p;e[0]!==d?(p={searchTerm:d},e[0]=d,e[1]=p):p=e[1];const x=Ct(p),r=x??[],{org:f}=we(),g=Zs(),h=Hn(f.slug),j=Qs(x),y=u.toLowerCase(),S=r.filter(qn).filter(O=>!j.has(O.id)).filter(Yn),v=S.filter(Xn),N=S.filter(Wn),C=es(f.id),k=!u||C.title.toLowerCase().includes(y),w=!!(o&&k);let m;e[2]!==s||e[3]!==o?(m=()=>{o?.(null),s(),c("")},e[2]=s,e[3]=o,e[4]=m):m=e[4];const _=m;let D;e[5]!==g||e[6]!==h||e[7]!==s||e[8]!==o?(D=O=>{if(o){o(O.id),s(),c("");return}g(),s(),c(""),h(O.id)},e[5]=g,e[6]=h,e[7]=s,e[8]=o,e[9]=D):D=e[9];const F=D,I="flex flex-col max-h-[min(640px,80dvh)]";let b;e[10]!==l?(b=t.jsx(Pn,{value:l,onChange:c}),e[10]=l,e[11]=b):b=e[11];const A="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5";let T;e[12]!==C||e[13]!==o||e[14]!==_||e[15]!==a||e[16]!==k?(T=o&&k&&C&&t.jsx(pt,{agent:C,selected:!a||a===C.id,onClick:_}),e[12]=C,e[13]=o,e[14]=_,e[15]=a,e[16]=k,e[17]=T):T=e[17];const z=(v.length>0||!u)&&t.jsx(On,{onImportFromGithub:i});let L;e[18]!==F||e[19]!==o||e[20]!==a?(L=O=>t.jsx(pt,{agent:O,selected:o?a===O.id:void 0,onClick:()=>F(O)},O.id),e[18]=F,e[19]=o,e[20]=a,e[21]=L):L=e[21];const P=v.map(L),$=N.length>0&&t.jsx(Mn,{});let U;e[22]!==F||e[23]!==o||e[24]!==a?(U=O=>t.jsx(pt,{agent:O,selected:o?a===O.id:void 0,onClick:()=>F(O)},O.id),e[22]=F,e[23]=o,e[24]=a,e[25]=U):U=e[25];const X=N.map(U);let Y;e[26]!==w||e[27]!==u||e[28]!==S.length?(Y=S.length===0&&!w&&u&&t.jsx(Ln,{}),e[26]=w,e[27]=u,e[28]=S.length,e[29]=Y):Y=e[29];let G;e[30]!==P||e[31]!==$||e[32]!==X||e[33]!==Y||e[34]!==T||e[35]!==z?(G=t.jsxs("div",{className:A,children:[T,z,P,$,X,Y]}),e[30]=P,e[31]=$,e[32]=X,e[33]=Y,e[34]=T,e[35]=z,e[36]=G):G=e[36];let V;e[37]!==s||e[38]!==f?(V=t.jsx($n,{org:f,onClose:s}),e[37]=s,e[38]=f,e[39]=V):V=e[39];let J;return e[40]!==G||e[41]!==V||e[42]!==b?(J=t.jsxs("div",{className:I,children:[b,G,V]}),e[40]=G,e[41]=V,e[42]=b,e[43]=J):J=e[43],J}function Wn(n){return!os(n.metadata)}function Xn(n){return os(n.metadata)}function Yn(n){return!zs(n.id)}function qn(n){return!Os(n.id)}function Qn(n){const e=M.c(14),{compact:s,trigger:o,onSelectAgent:a,selectedAgentId:i,side:l,align:c}=n===void 0?{}:n,u=s===void 0?!1:s,d=l===void 0?"right":l,p=c===void 0?"start":c,[x,r]=Q.useState(!1),[f,g]=Q.useState(!1),h=Wt(),{setOpenMobile:j}=Cs(),y=Js(),S=y?"border border-border":void 0;let v;e[0]!==y?(v=b=>y?t.jsx(Gn,{children:b}):b,e[0]=y,e[1]=v):v=e[1];const N=v;let C;e[2]!==h||e[3]!==j?(C=()=>{r(!1),h&&j(!1)},e[2]=h,e[3]=j,e[4]=C):C=e[4];const k=C;let w;e[5]!==k||e[6]!==g?(w=()=>{k(),g(!0)},e[5]=k,e[6]=g,e[7]=w):w=e[7];const m=w,_=x&&t.jsx(Q.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx(ks,{className:"h-4 w-24"})}),children:t.jsx(Un,{onClose:k,onSelectAgent:a,selectedAgentId:i,onImportFromGithub:m})}),D=h?t.jsxs(t.Fragment,{children:[o?Q.cloneElement(o,{onClick:b=>{o.props.onClick?.(b),r(!0)}}):u?N(t.jsx(zn,{setOpen:r,emptyCtaClass:S})):t.jsx(En,{setOpen:r,highlightEmpty:y,emptyCtaClass:S}),t.jsx(kt,{open:x,onOpenChange:r,direction:"bottom",children:t.jsxs(yt,{className:"max-h-[85dvh] p-0",children:[t.jsx(Rn,{}),_]})})]}):t.jsxs(st,{open:x,onOpenChange:b=>{b&&!x&&Z("agent_browser_opened",{surface:"desktop_popover"}),r(b)},children:[o?t.jsx(Ve,{asChild:!0,children:o}):u?N(t.jsx(Ve,{asChild:!0,children:t.jsx(Vn,{emptyCtaClass:S})})):t.jsx(Kn,{wrapEmptyHint:N,highlightEmpty:y,emptyCtaClass:S}),t.jsx(nt,{className:"w-[380px] p-0 overflow-hidden",side:d,align:p,children:_})]});let F;e[8]!==f||e[9]!==g?(F=t.jsx(Xs,{open:f,onOpenChange:g,mode:"agent"}),e[8]=f,e[9]=g,e[10]=F):F=e[10];let I;return e[11]!==D||e[12]!==F?(I=t.jsxs(t.Fragment,{children:[D,F]}),e[11]=D,e[12]=F,e[13]=I):I=e[13],I}function Jn(){const n=M.c(2),e=Ct()??[];let s;return n[0]!==e?(s=o=>{if(!o)return;const a=e.find(i=>i.id===o);return a?tn(a.metadata):void 0},n[0]=e,n[1]=s):s=n[1],s}const Zn="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 el(n){const e=M.c(29),{agentId:s,fallback:o,onOpenHome:a,onPick:i}=n,l=K(),c=Vs(s)??o??null;let u,d,p,x,r;e[0]!==c?.title||e[1]!==a||e[2]!==l?(r=c?.title??l("header.shellBreadcrumb.superAgentDefaultName"),x="flex min-w-0 items-center gap-0",u="button",d=a,p=l("header.shellBreadcrumb.openAgentHome",{name:r}),e[0]=c?.title,e[1]=a,e[2]=l,e[3]=u,e[4]=d,e[5]=p,e[6]=x,e[7]=r):(u=e[3],d=e[4],p=e[5],x=e[6],r=e[7]);const f=c?.icon??null;let g;e[8]!==f||e[9]!==r?(g=t.jsx(Zt,{icon:f,name:r,size:"xs"}),e[8]=f,e[9]=r,e[10]=g):g=e[10];let h;e[11]!==u||e[12]!==d||e[13]!==p||e[14]!==g?(h=t.jsx("button",{type:u,onClick:d,"aria-label":p,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:g}),e[11]=u,e[12]=d,e[13]=p,e[14]=g,e[15]=h):h=e[15];let j;e[16]!==r?(j=t.jsx("span",{className:"truncate font-medium max-w-[8rem]",children:r}),e[16]=r,e[17]=j):j=e[17];let y;e[18]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(De,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[18]=y):y=e[18];let S;e[19]!==j?(S=t.jsxs("button",{type:"button",className:Zn,children:[j,y]}),e[19]=j,e[20]=S):S=e[20];let v;e[21]!==s||e[22]!==i||e[23]!==S?(v=t.jsx(Qn,{side:"bottom",align:"start",selectedAgentId:s,onSelectAgent:i,trigger:S}),e[21]=s,e[22]=i,e[23]=S,e[24]=v):v=e[24];let N;return e[25]!==v||e[26]!==x||e[27]!==h?(N=t.jsxs("div",{className:x,children:[h,v]}),e[25]=v,e[26]=x,e[27]=h,e[28]=N):N=e[28],N}function Ao(n){const e=M.c(22);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{onNavigate:o}=s,{org:a}=we(),{threads:i}=ls(),l=Ct(),{data:c}=bt.useSession(),{setTaskId:u,createNewTask:d}=is(),p=Jn();let x;e[2]!==a.id?(x=es(a.id),e[2]=a.id,e[3]=x):x=e[3];const r=x,f=r.id,g=Jt();let h;e[4]!==l||e[5]!==d||e[6]!==f||e[7]!==o||e[8]!==p||e[9]!==c?.user?.id||e[10]!==u||e[11]!==i?(h=C=>{const k=C??f,w=(l??[]).find(_=>_.id===k),m=en(i,k,c?.user?.id,p(k),!!(w&&Ks(w)));m?u(m.id,k):d(k),o?.()},e[4]=l,e[5]=d,e[6]=f,e[7]=o,e[8]=p,e[9]=c?.user?.id,e[10]=u,e[11]=i,e[12]=h):h=e[12];const j=h;let y;e[13]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),e[13]=y):y=e[13];const S=g===f?r:void 0;let v;e[14]!==g||e[15]!==j?(v=()=>j(g),e[14]=g,e[15]=j,e[16]=v):v=e[16];let N;return e[17]!==g||e[18]!==j||e[19]!==S||e[20]!==v?(N=t.jsx(Q.Suspense,{fallback:y,children:t.jsx(el,{agentId:g,fallback:S,onOpenHome:v,onPick:j})}),e[17]=g,e[18]=j,e[19]=S,e[20]=v,e[21]=N):N=e[21],N}function Fo(){const n=M.c(20),e=K(),{threads:s}=ls(),{createNewTask:o}=is(),a=Jt(),i=Qt();let l;n[0]!==i||n[1]!==s?(l=s.find(j=>j.id===i)?.branch??null,n[0]=i,n[1]=s,n[2]=l):l=n[2];const c=l;let u;n[3]!==a||n[4]!==o||n[5]!==c?(u=()=>{o(a,c)},n[3]=a,n[4]=o,n[5]=c,n[6]=u):u=n[6];const d=u;let p;n[7]!==e?(p=e("sidebar.taskGroupsList.newChat"),n[7]=e,n[8]=p):p=n[8];let x;n[9]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(Ps,{size:16}),n[9]=x):x=n[9];let r;n[10]!==d||n[11]!==p?(r=t.jsx(ze,{asChild:!0,children:t.jsx("button",{type:"button",onClick:d,"aria-label":p,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:x})}),n[10]=d,n[11]=p,n[12]=r):r=n[12];let f;n[13]!==e?(f=e("sidebar.taskGroupsList.newChat"),n[13]=e,n[14]=f):f=n[14];let g;n[15]!==f?(g=t.jsx(Ee,{side:"bottom",children:f}),n[15]=f,n[16]=g):g=n[16];let h;return n[17]!==r||n[18]!==g?(h=t.jsxs(Re,{children:[r,g]}),n[17]=r,n[18]=g,n[19]=h):h=n[19],h}function tl({open:n,onOpenChange:e,onCreated:s}){const o=K(),{org:a}=we(),{data:i}=bt.useSession(),{stdioEnabled:l}=Ns(),c=Wt(),u=ms(),d=as(),x=rs(d,"").items,r=Ss({resolver:_s(jn),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),f=r.watch("ui_type"),g=r.watch("connection_url"),h=r.watch("npx_package"),j=qe({uiType:f,connectionUrl:g??"",npxPackage:h??""})??Lt({uiType:f,connectionUrl:g??"",registryItems:x}),y=m=>{const _=m.trim();if(!_)return;const D=!!r.formState.dirtyFields.title,F=!!r.formState.dirtyFields.description,I=!!r.formState.dirtyFields.env_vars,b=T=>{if(T&&(!D&&!r.getValues("title").trim()&&T.title&&r.setValue("title",T.title,{shouldDirty:!1}),!F&&!(r.getValues("description")??"").trim()&&T.description&&r.setValue("description",T.description,{shouldDirty:!1}),!I&&T.envVarKeys?.length)){const z=r.getValues("env_vars")??[],L=new Set(z.map($=>$.key)),P=T.envVarKeys.filter($=>!L.has($));P.length>0&&r.setValue("env_vars",[...z,...P.map($=>({key:$,value:""}))],{shouldDirty:!0})}},A=vn(_);if(A&&l){r.setValue("ui_type","NPX",{shouldDirty:!0}),r.setValue("npx_package",A.packageName,{shouldDirty:!0}),r.setValue("connection_url","",{shouldDirty:!0}),r.setValue("connection_token",null,{shouldDirty:!0}),b(qe({uiType:"NPX",npxPackage:A.packageName}));return}if(_.startsWith("http://")||_.startsWith("https://")){const T=f==="HTTP"||f==="SSE"||f==="Websocket"?f:"HTTP";r.setValue("ui_type",T,{shouldDirty:!0}),r.setValue("connection_url",_,{shouldDirty:!0}),b(qe({uiType:T,connectionUrl:_})??Lt({uiType:T,connectionUrl:_,registryItems:x}));return}f==="NPX"&&b(qe({uiType:"NPX",npxPackage:_}))},S=m=>{m||r.reset(),e(m)},v=async m=>{let _,D=null,F=null,I=null;m.ui_type==="NPX"?(_="STDIO",D="",I=Cn(m.npx_package||"",m.env_vars||[])):m.ui_type==="STDIO"?(_="STDIO",D="",I=kn(m.stdio_command||"",m.stdio_args||"",m.stdio_cwd,m.env_vars||[])):(_=m.ui_type,D=m.connection_url||"",F=m.connection_token||null);const b=nn("conn");try{await u.create.mutateAsync({id:b,title:m.title,description:m.description||null,connection_type:_,connection_url:D,connection_token:F,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:i?.user?.id||"system",organization_id:a.id,icon:m.icon??null,app_name:null,app_id:null,connection_headers:I,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),r.reset(),e(!1),s?.(b)}catch{xe.error(o("connections.createConnectionDialog.failedToCreateConnection"))}},N=o("connections.createConnectionDialog.title"),C=o("connections.createConnectionDialog.description"),k=r.formState.isSubmitting?o("connections.createConnectionDialog.saving"):o("connections.createConnectionDialog.createButton"),w=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(re,{control:r.control,name:"ui_type",render:({field:m})=>t.jsxs(ce,{children:[t.jsx(de,{children:o("connections.createConnectionDialog.typeLabel")}),t.jsxs(un,{value:m.value,onValueChange:m.onChange,children:[t.jsx(ue,{children:t.jsx(fn,{children:t.jsx(mn,{})})}),t.jsxs(pn,{children:[t.jsx(Ke,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ct,{className:"w-4 h-4"}),o("connections.createConnectionDialog.httpType")]})}),t.jsx(Ke,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ct,{className:"w-4 h-4"}),o("connections.createConnectionDialog.sseType")]})}),t.jsx(Ke,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ct,{className:"w-4 h-4"}),o("connections.createConnectionDialog.websocketType")]})}),l&&t.jsxs(t.Fragment,{children:[t.jsx(Ke,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ze,{className:"w-4 h-4"}),o("connections.createConnectionDialog.npxPackageType")]})}),t.jsx(Ke,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(gn,{className:"w-4 h-4"}),o("connections.createConnectionDialog.customCommandType")]})})]})]})]}),t.jsx(fe,{})]})}),f==="NPX"&&t.jsx(re,{control:r.control,name:"npx_package",render:({field:m})=>t.jsxs(ce,{children:[t.jsx(de,{children:o("connections.createConnectionDialog.npmPackageLabel")}),t.jsx(ue,{children:t.jsx(Se,{placeholder:o("connections.createConnectionDialog.npmPackagePlaceholder"),...m,value:m.value??"",onPaste:_=>{const D=_.clipboardData.getData("text");D&&(_.preventDefault(),r.setValue("npx_package",D.trim(),{shouldDirty:!0}),y(D))},onBlur:_=>{y(_.target.value),m.onBlur()}})}),t.jsx(fe,{})]})}),f==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(re,{control:r.control,name:"stdio_command",render:({field:m})=>t.jsxs(ce,{children:[t.jsx(de,{children:o("connections.createConnectionDialog.commandLabel")}),t.jsx(ue,{children:t.jsx(Se,{placeholder:o("connections.createConnectionDialog.commandPlaceholder"),...m,value:m.value??""})}),t.jsx(fe,{})]})}),t.jsx(re,{control:r.control,name:"stdio_args",render:({field:m})=>t.jsxs(ce,{children:[t.jsx(de,{children:o("connections.createConnectionDialog.argumentsLabel")}),t.jsx(ue,{children:t.jsx(Se,{placeholder:o("connections.createConnectionDialog.argumentsPlaceholder"),...m,value:m.value??""})}),t.jsx(fe,{})]})})]}),t.jsx(re,{control:r.control,name:"stdio_cwd",render:({field:m})=>t.jsxs(ce,{children:[t.jsx(de,{children:o("connections.createConnectionDialog.workingDirectoryLabel")}),t.jsx(ue,{children:t.jsx(Se,{placeholder:o("connections.createConnectionDialog.workingDirectoryPlaceholder"),...m,value:m.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:o("connections.createConnectionDialog.workingDirectoryDescription")}),t.jsx(fe,{})]})})]}),(f==="NPX"||f==="STDIO")&&t.jsx(re,{control:r.control,name:"env_vars",render:({field:m})=>t.jsxs(ce,{children:[t.jsx(de,{children:o("connections.createConnectionDialog.environmentVariablesLabel")}),t.jsx(ue,{children:t.jsx(bn,{value:m.value??[],onChange:m.onChange})}),t.jsx(fe,{})]})}),f!=="NPX"&&f!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(re,{control:r.control,name:"connection_url",render:({field:m})=>t.jsxs(ce,{children:[t.jsx(de,{children:o("connections.createConnectionDialog.urlLabel")}),t.jsx(ue,{children:t.jsx(Se,{placeholder:o("connections.createConnectionDialog.urlPlaceholder"),...m,value:m.value??"",onPaste:_=>{const D=_.clipboardData.getData("text");D&&(_.preventDefault(),r.setValue("connection_url",D.trim(),{shouldDirty:!0}),y(D))},onBlur:_=>{y(_.target.value),m.onBlur()}})}),t.jsx(fe,{})]})}),t.jsx(re,{control:r.control,name:"connection_token",render:({field:m})=>t.jsxs(ce,{children:[t.jsx(de,{children:j?.token?.label??o("connections.createConnectionDialog.tokenLabelDefault")}),t.jsx(ue,{children:t.jsx(Se,{type:"password",placeholder:j?.token?.placeholder??o("connections.createConnectionDialog.tokenPlaceholderDefault"),className:"ph-no-capture",...m,value:m.value??""})}),j?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[j.token.helperText,j.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:o("connections.createConnectionDialog.openGitHubPatSettings")})]})]}),t.jsx(fe,{})]})})]}),t.jsx(re,{control:r.control,name:"title",render:({field:m})=>t.jsxs(ce,{children:[t.jsx(de,{children:o("connections.createConnectionDialog.nameLabel")}),t.jsx(ue,{children:t.jsx(Se,{placeholder:o("connections.createConnectionDialog.namePlaceholder"),...m})}),t.jsx(fe,{})]})}),t.jsx(re,{control:r.control,name:"description",render:({field:m})=>t.jsxs(ce,{children:[t.jsx(de,{children:o("connections.createConnectionDialog.descriptionLabel")}),t.jsx(ue,{children:t.jsx(hn,{placeholder:o("connections.createConnectionDialog.descriptionPlaceholder"),rows:3,...m,value:m.value??""})}),t.jsx(fe,{})]})})]});return c?t.jsx(kt,{open:n,onOpenChange:S,children:t.jsxs(yt,{className:"max-h-[90vh]",children:[t.jsx(Gs,{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(Nt,{children:N}),t.jsx(Hs,{className:"mt-1",children:C})]}),t.jsx(ss,{asChild:!0,children:t.jsx(je,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(xn,{size:16})})})]})}),t.jsx(Pt,{...r,children:t.jsxs("form",{onSubmit:r.handleSubmit(v),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:w}),t.jsx(ns,{children:t.jsx(je,{type:"submit",disabled:r.formState.isSubmitting,className:"w-full",children:k})})]})})]})}):t.jsx(cs,{open:n,onOpenChange:S,children:t.jsxs(ds,{className:"sm:max-w-[525px]",children:[t.jsxs(us,{children:[t.jsx(fs,{children:N}),t.jsx(cn,{children:C})]}),t.jsx(Pt,{...r,children:t.jsxs("form",{onSubmit:r.handleSubmit(v),children:[t.jsx("div",{className:"py-4",children:w}),t.jsxs(dn,{children:[t.jsx(je,{type:"button",variant:"outline",onClick:()=>S(!1),children:o("connections.createConnectionDialog.cancelButton")}),t.jsx(je,{type:"submit",disabled:r.formState.isSubmitting,className:"min-w-40",children:k})]})]})})]})})}function sl(n){const e=M.c(72),{mode:s,agentId:o,addedConnectionIds:a,onAdd:i,onCloneAndAdd:l,onConnectAndAdd:c,connectingItemId:u,search:d,onCreateConnection:p,onBrowseNavigate:x,defaultTab:r}=n,f=s===void 0?"add":s,g=r===void 0?"connected":r,h=K(),{org:j}=we(),y=Q.useDeferredValue(d),S=d!==y;let v;e[0]!==y?(v=y.trim().toLowerCase(),e[0]=y,e[1]=v):v=e[1];const N=v;let C;e[2]!==g?(C=B=>B??g,e[2]=g,e[3]=C):C=e[3];const[k,w]=ws(Ds.connectionsTab(j.slug)+(g==="all"?":home-modal":":agent-modal"),C);let m;e[4]!==k||e[5]!==w?(m=B=>{B!==k&&Z("connections_dialog_tab_changed",{to_tab:B}),w(B)},e[4]=k,e[5]=w,e[6]=m):m=e[6];const _=m;let D;e[7]!==j.id||e[8]!==j.slug?(D={connectionId:Es,orgId:j.id,orgSlug:j.slug},e[7]=j.id,e[8]=j.slug,e[9]=D):D=e[9];const F=_n(D),I=y?.trim().split(/\s+/).filter(Boolean)??[],b=I.length>0?{operator:"or",conditions:I.flatMap(dl)}:void 0,A={...b&&{where:b},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},T=JSON.stringify(A),{data:z,fetchNextPage:L,hasNextPage:P,isFetchingNextPage:$}=Sn({queryKey:vt.collectionListInfinite(F,j.id,"","CONNECTIONS",T),queryFn:async B=>{const{pageParam:W}=B,ge=W===void 0?0:W;return(await F.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...b&&{where:b},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:ge}})).structuredContent},initialPageParam:0,getNextPageParam:rl,staleTime:3e4}),U=z?.pages.flatMap(al)??[],X=rn(U),Y=new Set(U.filter(il).map(ol)),G=as(),V=rs(G,y),J=$t(V.loadMore,V.hasMore,V.isLoadingMore),O=$t(L,P??!1,$),H=k==="all"||!!N,me=H?V.items.filter(B=>{const W=ln(B);if(W&&Y.has(W))return!1;if(!N)return!0;const ge=et(B._meta),ye=[B.title,B.description,B.name,B.server?.title,B.server?.description,B.server?.name,ge?.friendly_name,ge?.friendlyName].filter(Boolean).join(" ").toLowerCase();return I.some(ae=>ye.includes(ae.toLowerCase()))}):[],te=me.filter(ll),se=me.filter(nl);let le;e[10]!==a?(le=B=>B.some(W=>a.has(W.id)),e[10]=a,e[11]=le):le=e[11];const ie=le;let pe;e[12]!==a||e[13]!==o||e[14]!==u||e[15]!==ie||e[16]!==f||e[17]!==i||e[18]!==x||e[19]!==l||e[20]!==h?(pe=(B,W,ge,ye,ae)=>{const Ye=ie(ae),Oe=ae.find(Ne=>!a.has(Ne.id)),ne=ae[0];if(f==="browse"){const Ne=yn(ne);return t.jsx(ut,{connection:{title:W,icon:ge,description:ae.length>1?`${ae.length} instances`:ye??void 0},fallbackIcon:t.jsx(Ze,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs(Qe,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(He,{size:11})," ",h("virtualMcp.connectionDialogContent.connected")]}),onClick:()=>{Z("connection_browse_clicked",{app_name:ne.app_name??null,connection_id:ne.id,instances_count:ae.length}),x?.(Ne)}},B)}return t.jsx(ut,{connection:{title:W,icon:ge,description:ye},fallbackIcon:t.jsx(Ze,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1.5",children:[Ye&&t.jsxs(Qe,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(He,{size:11})," ",h("virtualMcp.connectionDialogContent.added")]}),t.jsx(je,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:u!==null,onClick:Ne=>{Ne.stopPropagation(),Oe?(Z("connection_add_clicked",{action:"use_existing",app_name:ne.app_name??null,connection_id:Oe.id}),o&&Z("agent_connection_attached",{agent_id:o,connection_id:Oe.id,app_name:ne.app_name??null,mode:"existing"}),i(Oe.id)):(Z("connection_add_clicked",{action:"clone",app_name:ne.app_name??null,base_connection_id:ne.id}),l(ne))},children:h("virtualMcp.connectionDialogContent.add")})]})},B)},e[12]=a,e[13]=o,e[14]=u,e[15]=ie,e[16]=f,e[17]=i,e[18]=x,e[19]=l,e[20]=h,e[21]=pe):pe=e[21];const E=pe;let R;e[22]!==u||e[23]!==f||e[24]!==c||e[25]!==h?(R=B=>{const W=et(B._meta),ge=W?.friendlyName||W?.friendly_name||B.server?.title||B.title||B.server?.name||B.name||B.id||"",ye=B.server?.description||B.description||null,ae=B.server?.icons?.[0]?.src||on(B.server?.repository)||null,Ye=W?.official===!0,Oe=W?.verified===!0,ne=W?.owner==="deco";return t.jsx(ut,{connection:{title:ge,description:ye,icon:ae},fallbackIcon:t.jsx(Ze,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1.5",children:[ne&&t.jsxs(Re,{children:[t.jsx(ze,{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:h("virtualMcp.connectionDialogContent.madeByDeco"),className:"size-3"})})}),t.jsx(Ee,{children:h("virtualMcp.connectionDialogContent.builtByDeco")})]}),!ne&&Ye&&t.jsxs(Re,{children:[t.jsx(ze,{asChild:!0,children:t.jsx(Qe,{variant:"outline",size:"icon",children:t.jsx(ft,{})})}),t.jsx(Ee,{children:h("virtualMcp.connectionDialogContent.builtByOfficial")})]}),!ne&&!Ye&&Oe&&t.jsxs(Re,{children:[t.jsx(ze,{asChild:!0,children:t.jsx(Qe,{variant:"outline",size:"icon",children:t.jsx(ft,{})})}),t.jsx(Ee,{children:h("virtualMcp.connectionDialogContent.verifiedByDeco")})]}),t.jsx(je,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:u!==null,onClick:Ne=>{Ne.stopPropagation(),Z("connection_add_clicked",{action:"connect_new",registry_item_id:B.id,app_name:W?.friendlyName||B.server?.name||B.name||null}),c(B)},children:u===B.id?t.jsx(Ge,{className:"size-3.5"}):h(f==="browse"?"virtualMcp.connectionDialogContent.connect":"virtualMcp.connectionDialogContent.add")})]})},`catalog-${B.id}`)},e[22]=u,e[23]=f,e[24]=c,e[25]=h,e[26]=R):R=e[26];const he=R;let ee;e[27]!==k||e[28]!==_||e[29]!==p||e[30]!==N||e[31]!==h?(ee=!N&&t.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[t.jsx(Nn,{tabs:[{id:"all",label:h("virtualMcp.connectionDialogContent.tabAll")},{id:"connected",label:h("virtualMcp.connectionDialogContent.tabConnected")}],activeTab:k,onTabChange:B=>_(B)}),t.jsxs(je,{variant:"outline",size:"sm",className:"h-7 px-2 text-sm",onClick:()=>{Z("connections_dialog_custom_clicked"),p()},children:[t.jsx(We,{size:12}),h("virtualMcp.connectionDialogContent.customConnection")]})]}),e[27]=k,e[28]=_,e[29]=p,e[30]=N,e[31]=h,e[32]=ee):ee=e[32];const ve=S&&"opacity-50 pointer-events-none";let oe;e[33]!==ve?(oe=q("flex-1 overflow-auto p-5 transition-opacity duration-150",ve),e[33]=ve,e[34]=oe):oe=e[34];const Ae="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4";let Fe;e[35]!==E?(Fe=B=>{if(B.type==="group")return E(B.key,B.title,B.icon,null,B.connections);const W=B.connection;return E(W.id,W.title,W.icon,W.description??null,[W])},e[35]=E,e[36]=Fe):Fe=e[36];const lt=X.map(Fe);let Ie;e[37]!==O?(Ie=t.jsx("div",{ref:O,className:"col-span-full h-1"}),e[37]=O,e[38]=Ie):Ie=e[38];let Te;e[39]!==$?(Te=$&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(Ge,{className:"size-6 text-muted-foreground"})}),e[39]=$,e[40]=Te):Te=e[40];const ot=H&&te.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx(ft,{size:13,className:"text-muted-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:h("virtualMcp.connectionDialogContent.sectionVerified")}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),it=H&&te.map(he),at=H&&se.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:h("virtualMcp.connectionDialogContent.sectionAllConnections")}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),rt=H&&se.map(he);let Be;e[41]!==J||e[42]!==G||e[43]!==H?(Be=H&&G.length>0&&t.jsx("div",{ref:J,className:"col-span-full h-1"}),e[41]=J,e[42]=G,e[43]=H,e[44]=Be):Be=e[44];let Pe;e[45]!==V.isLoadingMore||e[46]!==H?(Pe=H&&V.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(Ge,{className:"size-6 text-muted-foreground"})}),e[45]=V.isLoadingMore,e[46]=H,e[47]=Pe):Pe=e[47];let Le;e[48]!==lt||e[49]!==Ie||e[50]!==Te||e[51]!==ot||e[52]!==it||e[53]!==at||e[54]!==rt||e[55]!==Be||e[56]!==Pe?(Le=t.jsxs("div",{className:Ae,children:[lt,Ie,Te,ot,it,at,rt,Be,Pe]}),e[48]=lt,e[49]=Ie,e[50]=Te,e[51]=ot,e[52]=it,e[53]=at,e[54]=rt,e[55]=Be,e[56]=Pe,e[57]=Le):Le=e[57];let $e;e[58]!==k||e[59]!==X.length||e[60]!==se||e[61]!==d||e[62]!==h||e[63]!==te?($e=X.length===0&&te.length===0&&se.length===0&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:d?h("virtualMcp.connectionDialogContent.emptyStateSearchNoMatch",{search:d}):h(k==="connected"?"virtualMcp.connectionDialogContent.emptyStateNoConnectionsYet":"virtualMcp.connectionDialogContent.emptyStateNoConnectionsAvailable")}),e[58]=k,e[59]=X.length,e[60]=se,e[61]=d,e[62]=h,e[63]=te,e[64]=$e):$e=e[64];let Me;e[65]!==oe||e[66]!==Le||e[67]!==$e?(Me=t.jsxs("div",{className:oe,children:[Le,$e]}),e[65]=oe,e[66]=Le,e[67]=$e,e[68]=Me):Me=e[68];let Xe;return e[69]!==ee||e[70]!==Me?(Xe=t.jsxs(t.Fragment,{children:[ee,Me]}),e[69]=ee,e[70]=Me,e[71]=Xe):Xe=e[71],Xe}function nl(n){return!n.verified&&!et(n._meta)?.verified&&!n.meta?.verified}function ll(n){return n.verified||et(n._meta)?.verified||n.meta?.verified}function ol(n){return n.app_name}function il(n){return n.app_name}function al(n){return n?.items??[]}function rl(n,e){if(n?.hasMore)return e.reduce(cl,0)}function cl(n,e){return n+(e?.items?.length??0)}function dl(n){return[{field:["title"],operator:"contains",value:n},{field:["description"],operator:"contains",value:n}]}function Io({open:n,onOpenChange:e,defaultTab:s,initialSearch:o="",...a}){const i=K(),l=a.mode??"add",c="agentId"in a?a.agentId:void 0,u="addedConnectionIds"in a?a.addedConnectionIds??new Set:new Set,d="onAdd"in a&&a.onAdd?a.onAdd:b=>{},p=(b,A,T)=>{c&&Z("agent_connection_attached",{agent_id:c,connection_id:b,app_name:A,mode:T})},[x,r]=Q.useState(null),[f,g]=Q.useState(o),[h,j]=Q.useState(!1),[y,S]=Q.useState(n);n!==y&&(S(n),n&&g(o));const{org:v}=we(),{data:N}=bt.useSession(),C=ms(),k=As(),w=Xt(),m=b=>{e(!1),w({to:"/$org/settings/connections/$appSlug",params:{org:v.slug,appSlug:b}})},_=()=>{k.invalidateQueries({predicate:b=>{const A=b.queryKey;return A[1]===v.id&&A[3]==="collection"&&A[4]==="CONNECTIONS"}})},D=async(b,A)=>{Z("connection_oauth_succeeded",{connection_id:b,flow:A});const T=new URL(`/api/${v.slug}/mcp/${b}`,window.location.origin);await k.invalidateQueries({queryKey:vt.isMCPAuthenticated(T.href,null)}),_()},F=async b=>{r(b.app_name??b.id);try{const T=`${b.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,L=(await C.create.mutateAsync({title:T,description:b.description??null,connection_type:b.connection_type,connection_url:b.connection_url??null,connection_token:null,icon:b.icon??null,app_name:b.app_name??null,app_id:b.app_id??null,connection_headers:b.connection_headers??null})).id,P=await mt({connectionId:L,orgId:v.id,orgSlug:v.slug,persistFallback:$=>C.update.mutateAsync({id:L,data:{connection_token:$}}).then(()=>{})});if(P.ran&&!P.ok){Z("connection_oauth_failed",{connection_id:L,flow:"clone",error:P.error??"no_token"}),xe.error(i("virtualMcp.addConnectionDialog.authenticationFailedError",{error:P.error??"no token received"})),await C.delete.mutateAsync(L);return}P.ran&&await D(L,"clone"),p(L,b.app_name??null,"clone"),d(L)}catch(A){console.error("Failed to add connection:",A),xe.error(i("virtualMcp.addConnectionDialog.failedToAddConnection"))}finally{r(null)}},I=async b=>{if(!(!v||!N?.user?.id)){r(b.id);try{const A=an(b,v.id,N.user.id,{remoteIndex:0}),T=A.connection_type==="STDIO",z=!!A.connection_url,L=T&&A.connection_headers&&typeof A.connection_headers=="object"&&"command"in A.connection_headers;if(!z&&!L){xe.error(i("virtualMcp.addConnectionDialog.mcpServerConnectionError")),r(null);return}const{id:P}=await C.create.mutateAsync(A),$=await mt({connectionId:P,orgId:v.id,orgSlug:v.slug,persistFallback:U=>C.update.mutateAsync({id:P,data:{connection_token:U}}).then(()=>{})});if($.ran&&!$.ok){Z("connection_oauth_failed",{connection_id:P,flow:"connect_new",error:$.error??"no_token"}),xe.warning(i("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:i("virtualMcp.addConnectionDialog.signInFailedDescription",{error:$.error??"no token received"})}),p(P,A.app_name??null,"new"),d(P);return}$.ran?(await D(P,"connect_new"),xe.success(i("virtualMcp.addConnectionDialog.connectedAuthenticated"))):xe.success(i("virtualMcp.addConnectionDialog.connected")),p(P,A.app_name??null,"new"),d(P)}catch(A){console.error("Failed to connect:",A),xe.error(i("virtualMcp.addConnectionDialog.failedToConnect"))}finally{r(null)}}};return t.jsxs(cs,{open:n,onOpenChange:e,children:[t.jsxs(ds,{className:"sm:max-w-5xl h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[t.jsx(us,{className:"px-6 pt-5 pb-0 shrink-0",children:t.jsx(fs,{className:"text-base font-semibold",children:i(l==="browse"?"virtualMcp.addConnectionDialog.connectionsTitle":"virtualMcp.addConnectionDialog.addConnectionTitle")})}),t.jsx("div",{className:"pt-3 shrink-0",children:t.jsx(sn,{value:f,onChange:g,placeholder:i("virtualMcp.addConnectionDialog.searchConnectionsPlaceholder")})}),t.jsx(Q.Suspense,{fallback:t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Ge,{className:"size-6 text-muted-foreground"})}),children:t.jsx(sl,{mode:l,agentId:c,addedConnectionIds:u,onAdd:d,onCloneAndAdd:F,onConnectAndAdd:I,connectingItemId:x,search:f,onCreateConnection:()=>j(!0),onBrowseNavigate:m,defaultTab:s})})]}),t.jsx(tl,{open:h,onOpenChange:j,onCreated:async b=>{j(!1);const A=await mt({connectionId:b,orgId:v.id,orgSlug:v.slug,persistFallback:T=>C.update.mutateAsync({id:b,data:{connection_token:T}}).then(()=>{})});if(A.ran&&!A.ok){Z("connection_oauth_failed",{connection_id:b,flow:"custom_create",error:A.error??"no_token"}),xe.warning(i("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:i("virtualMcp.addConnectionDialog.signInFailedDescription",{error:A.error??"no token received"})}),p(b,null,"custom"),d(b),e(!1);return}A.ran&&await D(b,"custom_create"),p(b,null,"custom"),d(b),e(!1)}})]})}const Rt=new Map;function To(){const{org:n}=we(),e=Fs(),s=wn(),o=s.find(j=>j.providerId==="deco"),{data:a,isLoading:i,refetch:l,isFetching:c}=Is({queryKey:vt.aiProviderCredits(n.id,"deco"),enabled:!!o,staleTime:6e4,queryFn:async()=>{try{return await e.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),u=a?.balanceCents??null,d=u!=null?u/100:null,p=Q.useRef(new Map);if(u!=null){const j=Rt.get(n.id);p.current.get(n.id)&&j!=null&&u>j&&Z("credits_topped_up_detected",{organization_id:n.id,delta_cents:u-j,previous_balance_cents:j,new_balance_cents:u}),Rt.set(n.id,u),p.current.set(n.id,!0)}const x=!!o,r=u!=null&&u>0,f=u!=null&&u===0,g=u!=null&&u===200,h=s.length>0&&s.every(j=>j.providerId==="deco");return{hasDecoKey:x,decoKeyId:o?.id??null,balanceCents:u,balanceDollars:d,hasCredits:r,isZeroBalance:f,isInitialFreeCredit:g,hasOnlyDecoProvider:h,isLoading:i,isFetching:c,refetch:l}}const ul=4,fl="TASK";function ml(n){return n.replace(/[^a-zA-Z]/g,"").toUpperCase().slice(0,ul)||fl}function pl(n,e,s){const o=s?.trim();return o||(e==null?null:`${ml(n)}-${String(e).padStart(2,"0")}`)}const hl=/^(?:[a-z]{1,8}-)?0*(\d+)$/i;function Vt(n){const e=hl.exec(n.trim())?.[1];return e===void 0?null:Number(e)}function Kt(n){const e=M.c(8),{size:s,className:o}=n,a=s===void 0?16:s;let i;e[0]!==a?(i={width:a,height:a},e[0]=a,e[1]=i):i=e[1];let l;e[2]!==o?(l=q("shrink-0 rounded-full object-cover",o),e[2]=o,e[3]=l):l=e[3];let c;return e[4]!==a||e[5]!==i||e[6]!==l?(c=t.jsx("img",{src:Rs,alt:"Super Agent",width:a,height:a,style:i,className:l}),e[4]=a,e[5]=i,e[6]=l,e[7]=c):c=e[7],c}function Bo(n,e){if(!e)return null;const s=e.toLowerCase();return n.find(o=>{const a=o.bucket.toLowerCase();return o.siteSlug?.toLowerCase()===s||a===s||a===`deco-assets-${s}`})??null}const Gt={active:0,future:1,closed:2};function Ht(n){if(!n.startsAt)return null;const e=Date.parse(n.startsAt);return Number.isNaN(e)?null:e}function gl(n,e){const s=Gt[n.state]-Gt[e.state];if(s!==0)return s;const o=Ht(n),a=Ht(e);if(o===null||a===null){if(o!==a)return o===null?1:-1}else if(o!==a)return n.state==="closed"?a-o:o-a;return n.name.localeCompare(e.name)||n.id.localeCompare(e.id)}function Bt(n){return n.filter(s=>s.state==="active").sort(gl)[0]?.id??null}const xt="__unassigned__",jt="__no_repo__",tt="backlog",gs="all",be="__any__",xs={assignee:null,priority:null,due:null,tags:[],repo:null,sprint:null,search:""};function Po(n,e){return n===gs?null:n===tt||n!==null&&e.some(s=>s.id===n)?n:Bt(e)}function js(n,e){return n.sprint!==null&&n.sprint!==e}function xl(n,e){return n.assignee!==null||n.priority!==null||n.due!==null||n.tags.length>0||n.repo!==null||js(n,e)||n.search.trim()!==""}function jl(n,e){return(n.assignee!==null?1:0)+(n.priority!==null?1:0)+(n.due!==null?1:0)+(n.tags.length>0?1:0)+(n.repo!==null?1:0)+(js(n,e)?1:0)+(n.search.trim()!==""?1:0)}const bl=864e5;function vl(n,e){const s=new Date(n),o=new Date(e);return s.getFullYear()===o.getFullYear()&&s.getMonth()===o.getMonth()&&s.getDate()===o.getDate()}const Cl=/^0*(\d+)$/;function bs(n,e,s){const o=n.trim();if(o==="")return!1;const a=s?.trim();if(a){if(o.toLowerCase()===a.toLowerCase())return!0;const i=Cl.exec(o)?.[1];return i!==void 0&&Number(i)===Vt(a)}return e!=null&&Vt(o)===e}function kl(n,e){return n.assigneeId===e?!0:n.assigneeId===gt&&n.assignedBy===e}function Lo(n,e){const s=e.search.trim().toLowerCase();if(s!==""&&!`${n.title} ${n.description??""}`.toLowerCase().includes(s)&&!bs(s,n.keySeq,n.jiraIssueKey))return!1;if(e.assignee!==null){if(e.assignee===xt){if(n.assigneeId!==null)return!1}else if(!kl(n,e.assignee))return!1}if(e.priority!==null&&n.priority!==e.priority)return!1;if(e.due!==null)if(e.due==="none"){if(n.dueDate)return!1}else{if(!n.dueDate)return!1;const o=new Date(n.dueDate).getTime(),a=Date.now();if(e.due==="overdue"&&o>=a||e.due==="today"&&!vl(o,a)||e.due==="week"&&(o<a||o>a+7*bl))return!1}if(e.tags.length>0){const o=n.tags.map(a=>a.id);if(!e.tags.some(a=>o.includes(a)))return!1}if(e.repo!==null){if(e.repo===jt){if(n.repo!=null)return!1}else if(n.repo?.toLowerCase()!==e.repo.toLowerCase())return!1}if(e.sprint!==null){if(e.sprint===tt){if(n.sprintId!=null)return!1}else if(n.sprintId!==e.sprint)return!1}return!0}const Ut={overdue:"taskBoard.taskFilters.dueDateFilterOverdue",today:"taskBoard.taskFilters.dueDateFilterDueToday",week:"taskBoard.taskFilters.dueDateFilterDueThisWeek",none:"taskBoard.taskFilters.dueDateFilterNoDueDate"};function ke(n,e=!1){return q("inline-flex h-8 items-center gap-1.5 rounded-lg border px-2.5 text-xs font-medium outline-none transition-colors focus-visible:border-ring focus-visible:ring-[2px] focus-visible:ring-ring/20",e&&"h-10 w-full justify-start px-3 text-sm",n?"border-transparent bg-accent text-foreground":"border-border text-muted-foreground hover:bg-muted/60 hover:text-foreground")}function yl(n){const e=M.c(107),{value:s,members:o,onChange:a,block:i}=n,l=K(),[c,u]=Q.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Ot,{size:14,className:"shrink-0"}),e[0]=d):d=e[0];let p=d,x;e[1]!==l?(x=l("taskBoard.taskFilters.assigneeLabel"),e[1]=l,e[2]=x):x=e[2];let r=x;if(s===xt){let E;e[3]!==l?(E=l("taskBoard.taskFilters.assigneeUnassigned"),e[3]=l,e[4]=E):E=e[4],r=E}else if(s===gt){let E;e[5]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(Kt,{size:14}),e[5]=E):E=e[5],p=E;let R;e[6]!==l?(R=l("taskBoard.taskFilters.assigneeSuperAgent"),e[6]=l,e[7]=R):R=e[7],r=R}else if(s){let E,R,he,ee;if(e[8]!==o||e[9]!==s){let Ae;e[14]!==s?(Ae=Fe=>Fe.userId===s,e[14]=s,e[15]=Ae):Ae=e[15],R=o.find(Ae),E=Mt,he=R?.user?.image??void 0,ee=zt(R?.user?.name),e[8]=o,e[9]=s,e[10]=E,e[11]=R,e[12]=he,e[13]=ee}else E=e[10],R=e[11],he=e[12],ee=e[13];let ve;e[16]!==E||e[17]!==he||e[18]!==ee?(ve=t.jsx(E,{url:he,fallback:ee,shape:"circle",size:"2xs"}),e[16]=E,e[17]=he,e[18]=ee,e[19]=ve):ve=e[19],p=ve;let oe;e[20]!==R?.user?.name||e[21]!==l?(oe=R?.user?.name??l("taskBoard.taskFilters.assigneeMember"),e[20]=R?.user?.name,e[21]=l,e[22]=oe):oe=e[22],r=oe}let f;e[23]!==a?(f=E=>{a(E),u(!1)},e[23]=a,e[24]=f):f=e[24];const g=f,h=s!==null;let j;e[25]!==i||e[26]!==h?(j=ke(h,i),e[25]=i,e[26]=h,e[27]=j):j=e[27];const y=j,S=i&&"ml-auto";let v;e[28]!==S?(v=q("shrink-0 opacity-60",S),e[28]=S,e[29]=v):v=e[29];const N=v;let C;e[30]!==r?(C=t.jsx("span",{className:"max-w-[10rem] truncate",children:r}),e[30]=r,e[31]=C):C=e[31];let k;e[32]!==N?(k=t.jsx(De,{size:12,className:N}),e[32]=N,e[33]=k):k=e[33];let w;e[34]!==p||e[35]!==C||e[36]!==k||e[37]!==y?(w=t.jsx(Ve,{asChild:!0,children:t.jsxs("button",{type:"button",className:y,children:[p,C,k]})}),e[34]=p,e[35]=C,e[36]=k,e[37]=y,e[38]=w):w=e[38];let m;e[39]!==l?(m=l("taskBoard.taskFilters.assigneeFilterPlaceholder"),e[39]=l,e[40]=m):m=e[40];let _;e[41]!==l?(_=l("taskBoard.taskFilters.assigneeFilterPlaceholder"),e[41]=l,e[42]=_):_=e[42];let D;e[43]!==m||e[44]!==_?(D=t.jsx(At,{placeholder:m,"aria-label":_,className:"h-9"}),e[43]=m,e[44]=_,e[45]=D):D=e[45];let F;e[46]!==l?(F=l("taskBoard.taskFilters.assigneeNoMembersFound"),e[46]=l,e[47]=F):F=e[47];let I;e[48]!==F?(I=t.jsx(Ft,{children:F}),e[48]=F,e[49]=I):I=e[49];let b;e[50]!==l?(b=l("taskBoard.taskFilters.assigneeAnyone"),e[50]=l,e[51]=b):b=e[51];let A;e[52]!==g?(A=()=>g(null),e[52]=g,e[53]=A):A=e[53];let T;e[54]!==l?(T=l("taskBoard.taskFilters.assigneeAnyone"),e[54]=l,e[55]=T):T=e[55];let z;e[56]!==b||e[57]!==A||e[58]!==T?(z=t.jsx(Ce,{value:b,onSelect:A,children:T}),e[56]=b,e[57]=A,e[58]=T,e[59]=z):z=e[59];let L;e[60]!==l?(L=l("taskBoard.taskFilters.assigneeUnassigned"),e[60]=l,e[61]=L):L=e[61];let P;e[62]!==g?(P=()=>g(xt),e[62]=g,e[63]=P):P=e[63];let $;e[64]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(Ot,{size:16,className:"text-muted-foreground"}),e[64]=$):$=e[64];let U;e[65]!==l?(U=l("taskBoard.taskFilters.assigneeUnassigned"),e[65]=l,e[66]=U):U=e[66];let X;e[67]!==L||e[68]!==P||e[69]!==U?(X=t.jsxs(Ce,{value:L,onSelect:P,className:"gap-2",children:[$,U]}),e[67]=L,e[68]=P,e[69]=U,e[70]=X):X=e[70];let Y;e[71]!==l?(Y=l("taskBoard.taskFilters.assigneeSuperAgent"),e[71]=l,e[72]=Y):Y=e[72];let G;e[73]!==g?(G=()=>g(gt),e[73]=g,e[74]=G):G=e[74];let V;e[75]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(Kt,{size:16}),e[75]=V):V=e[75];let J;e[76]!==l?(J=l("taskBoard.taskFilters.assigneeSuperAgent"),e[76]=l,e[77]=J):J=e[77];let O;e[78]!==Y||e[79]!==G||e[80]!==J?(O=t.jsxs(Ce,{value:Y,onSelect:G,className:"gap-2",children:[V,J]}),e[78]=Y,e[79]=G,e[80]=J,e[81]=O):O=e[81];let H;e[82]!==z||e[83]!==X||e[84]!==O?(H=t.jsxs(Ue,{children:[z,X,O]}),e[82]=z,e[83]=X,e[84]=O,e[85]=H):H=e[85];let me;e[86]!==l?(me=l("taskBoard.taskFilters.assigneeGroupMembers"),e[86]=l,e[87]=me):me=e[87];let te;if(e[88]!==o||e[89]!==g){let E;e[91]!==g?(E=R=>t.jsxs(Ce,{value:R.user?.name??R.userId,onSelect:()=>g(R.userId),className:"gap-2",children:[t.jsx(Mt,{url:R.user?.image??void 0,fallback:zt(R.user?.name),shape:"circle",size:"2xs"}),t.jsx("span",{className:"truncate",children:R.user?.name??R.userId})]},R.userId),e[91]=g,e[92]=E):E=e[92],te=o.map(E),e[88]=o,e[89]=g,e[90]=te}else te=e[90];let se;e[93]!==me||e[94]!==te?(se=t.jsx(Ue,{heading:me,children:te}),e[93]=me,e[94]=te,e[95]=se):se=e[95];let le;e[96]!==I||e[97]!==H||e[98]!==se?(le=t.jsxs(It,{children:[I,H,se]}),e[96]=I,e[97]=H,e[98]=se,e[99]=le):le=e[99];let ie;e[100]!==D||e[101]!==le?(ie=t.jsx(nt,{align:"start",className:"w-56 p-0",children:t.jsxs(Tt,{children:[D,le]})}),e[100]=D,e[101]=le,e[102]=ie):ie=e[102];let pe;return e[103]!==c||e[104]!==w||e[105]!==ie?(pe=t.jsxs(st,{open:c,onOpenChange:u,children:[w,ie]}),e[103]=c,e[104]=w,e[105]=ie,e[106]=pe):pe=e[106],pe}function Nl(n){const e=M.c(33),{value:s,onChange:o,block:a}=n,i=K(),l=s!==null;let c;e[0]!==a||e[1]!==l?(c=ke(l,a),e[0]=a,e[1]=l,e[2]=c):c=e[2];const u=c,d=a&&"ml-auto";let p;e[3]!==d?(p=q("shrink-0 opacity-60",d),e[3]=d,e[4]=p):p=e[4];const x=p;let r;e[5]!==s?(r=s?t.jsx("span",{className:q("size-2 shrink-0 rounded-full",Je[s].dotClassName)}):t.jsx(Dn,{size:14,className:"shrink-0"}),e[5]=s,e[6]=r):r=e[6];let f;e[7]!==i||e[8]!==s?(f=i(s?Je[s].labelKey:"taskBoard.taskFilters.priorityLabel"),e[7]=i,e[8]=s,e[9]=f):f=e[9];let g;e[10]!==x?(g=t.jsx(De,{size:12,className:x}),e[10]=x,e[11]=g):g=e[11];let h;e[12]!==r||e[13]!==f||e[14]!==g||e[15]!==u?(h=t.jsx(St,{asChild:!0,children:t.jsxs("button",{type:"button",className:u,children:[r,f,g]})}),e[12]=r,e[13]=f,e[14]=g,e[15]=u,e[16]=h):h=e[16];const j=s??be;let y;e[17]!==o?(y=w=>o(w===be?null:w),e[17]=o,e[18]=y):y=e[18];let S;e[19]!==i?(S=i("taskBoard.taskFilters.priorityAnyPriority"),e[19]=i,e[20]=S):S=e[20];let v;e[21]!==S?(v=t.jsx(_e,{value:be,children:S}),e[21]=S,e[22]=v):v=e[22];let N;e[23]!==i?(N=Fn.map(w=>t.jsxs(_e,{value:w,className:"gap-2",children:[t.jsx("span",{className:q("size-2 rounded-full",Je[w].dotClassName)}),i(Je[w].labelKey)]},w)),e[23]=i,e[24]=N):N=e[24];let C;e[25]!==y||e[26]!==v||e[27]!==N||e[28]!==j?(C=t.jsx(_t,{align:"start",className:"w-40",children:t.jsxs(wt,{value:j,onValueChange:y,children:[v,N]})}),e[25]=y,e[26]=v,e[27]=N,e[28]=j,e[29]=C):C=e[29];let k;return e[30]!==C||e[31]!==h?(k=t.jsxs(Dt,{children:[h,C]}),e[30]=C,e[31]=h,e[32]=k):k=e[32],k}function Sl(n){const e=M.c(35),{value:s,onChange:o,block:a}=n,i=K();let l;e[0]!==i||e[1]!==s?(l=s?i(Ut[s]):void 0,e[0]=i,e[1]=s,e[2]=l):l=e[2];const c=l,u=s!==null;let d;e[3]!==a||e[4]!==u?(d=ke(u,a),e[3]=a,e[4]=u,e[5]=d):d=e[5];const p=d,x=a&&"ml-auto";let r;e[6]!==x?(r=q("shrink-0 opacity-60",x),e[6]=x,e[7]=r):r=e[7];const f=r;let g;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(dt,{size:14,className:"shrink-0"}),e[8]=g):g=e[8];let h;e[9]!==c||e[10]!==i?(h=c??i("taskBoard.taskFilters.dueDateLabel"),e[9]=c,e[10]=i,e[11]=h):h=e[11];let j;e[12]!==f?(j=t.jsx(De,{size:12,className:f}),e[12]=f,e[13]=j):j=e[13];let y;e[14]!==h||e[15]!==j||e[16]!==p?(y=t.jsx(St,{asChild:!0,children:t.jsxs("button",{type:"button",className:p,children:[g,h,j]})}),e[14]=h,e[15]=j,e[16]=p,e[17]=y):y=e[17];const S=s??be;let v;e[18]!==o?(v=D=>o(D===be?null:D),e[18]=o,e[19]=v):v=e[19];let N;e[20]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(dt,{size:16,className:"text-muted-foreground"}),e[20]=N):N=e[20];let C;e[21]!==i?(C=i("taskBoard.taskFilters.dueDateAnyTime"),e[21]=i,e[22]=C):C=e[22];let k;e[23]!==C?(k=t.jsxs(_e,{value:be,className:"gap-2",children:[N,C]}),e[23]=C,e[24]=k):k=e[24];let w;e[25]!==i?(w=Object.entries(Ut).map(D=>{const[F,I]=D,b=F==="overdue";return t.jsxs(_e,{value:F,className:q("gap-2",b&&"text-destructive"),children:[t.jsx(dt,{size:16,className:q("shrink-0",b?"text-destructive":"text-muted-foreground")}),i(I)]},F)}),e[25]=i,e[26]=w):w=e[26];let m;e[27]!==S||e[28]!==v||e[29]!==k||e[30]!==w?(m=t.jsx(_t,{align:"start",className:"w-44",children:t.jsxs(wt,{value:S,onValueChange:v,children:[k,w]})}),e[27]=S,e[28]=v,e[29]=k,e[30]=w,e[31]=m):m=e[31];let _;return e[32]!==m||e[33]!==y?(_=t.jsxs(Dt,{children:[y,m]}),e[32]=m,e[33]=y,e[34]=_):_=e[34],_}function _l(n){const e=M.c(56),{value:s,tags:o,onChange:a,block:i}=n,l=K(),[c,u]=Q.useState(!1);let d;e[0]!==a||e[1]!==s?(d=L=>a(s.includes(L)?s.filter(P=>P!==L):[...s,L]),e[0]=a,e[1]=s,e[2]=d):d=e[2];const p=d;let x;e[3]!==l||e[4]!==o||e[5]!==s[0]||e[6]!==s.length?(x=s.length===0?l("taskBoard.taskFilters.tagsLabel"):s.length===1?o.find(L=>L.id===s[0])?.name??l("taskBoard.taskFilters.tagsLabel"):l("taskBoard.taskFilters.tagsSelectedCount",{count:s.length}),e[3]=l,e[4]=o,e[5]=s[0],e[6]=s.length,e[7]=x):x=e[7];const r=x,f=s.length>0;let g;e[8]!==i||e[9]!==f?(g=ke(f,i),e[8]=i,e[9]=f,e[10]=g):g=e[10];const h=g,j=i&&"ml-auto";let y;e[11]!==j?(y=q("shrink-0 opacity-60",j),e[11]=j,e[12]=y):y=e[12];const S=y;let v;e[13]!==o||e[14]!==s[0]||e[15]!==s.length?(v=s.length===1?t.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:Et(o.find(L=>L.id===s[0])?.color)}}):t.jsx(Ls,{size:14,className:"shrink-0"}),e[13]=o,e[14]=s[0],e[15]=s.length,e[16]=v):v=e[16];let N;e[17]!==r?(N=t.jsx("span",{className:"max-w-[10rem] truncate",children:r}),e[17]=r,e[18]=N):N=e[18];let C;e[19]!==S?(C=t.jsx(De,{size:12,className:S}),e[19]=S,e[20]=C):C=e[20];let k;e[21]!==v||e[22]!==N||e[23]!==C||e[24]!==h?(k=t.jsx(Ve,{asChild:!0,children:t.jsxs("button",{type:"button",className:h,children:[v,N,C]})}),e[21]=v,e[22]=N,e[23]=C,e[24]=h,e[25]=k):k=e[25];let w;e[26]!==l?(w=l("taskBoard.taskFilters.tagsFilterPlaceholder"),e[26]=l,e[27]=w):w=e[27];let m;e[28]!==l?(m=l("taskBoard.taskFilters.tagsFilterPlaceholder"),e[28]=l,e[29]=m):m=e[29];let _;e[30]!==w||e[31]!==m?(_=t.jsx(At,{placeholder:w,"aria-label":m,className:"h-9"}),e[30]=w,e[31]=m,e[32]=_):_=e[32];let D;e[33]!==l?(D=l("taskBoard.taskFilters.tagsNoTagsFound"),e[33]=l,e[34]=D):D=e[34];let F;e[35]!==D?(F=t.jsx(Ft,{children:D}),e[35]=D,e[36]=F):F=e[36];let I;if(e[37]!==o||e[38]!==p||e[39]!==s){let L;e[41]!==p||e[42]!==s?(L=P=>t.jsxs(Ce,{value:P.name,onSelect:()=>p(P.id),className:"gap-2",children:[t.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:Et(P.color)}}),t.jsx("span",{className:"flex-1 truncate",children:P.name}),s.includes(P.id)&&t.jsx(He,{size:14,className:"shrink-0 text-foreground"})]},P.id),e[41]=p,e[42]=s,e[43]=L):L=e[43],I=o.map(L),e[37]=o,e[38]=p,e[39]=s,e[40]=I}else I=e[40];let b;e[44]!==I?(b=t.jsx(Ue,{children:I}),e[44]=I,e[45]=b):b=e[45];let A;e[46]!==F||e[47]!==b?(A=t.jsxs(It,{children:[F,b]}),e[46]=F,e[47]=b,e[48]=A):A=e[48];let T;e[49]!==_||e[50]!==A?(T=t.jsx(nt,{align:"start",className:"w-56 p-0",children:t.jsxs(Tt,{children:[_,A]})}),e[49]=_,e[50]=A,e[51]=T):T=e[51];let z;return e[52]!==c||e[53]!==k||e[54]!==T?(z=t.jsxs(st,{open:c,onOpenChange:u,children:[k,T]}),e[52]=c,e[53]=k,e[54]=T,e[55]=z):z=e[55],z}function wl(n){const e=M.c(73),{value:s,repos:o,onChange:a,block:i}=n,l=K(),[c,u]=Q.useState(!1);let d;e[0]!==l||e[1]!==s?(d=s===null?l("taskBoard.taskFilters.repoLabel"):s===jt?l("taskBoard.taskFilters.repoNoRepo"):s,e[0]=l,e[1]=s,e[2]=d):d=e[2];const p=d;let x;e[3]!==a?(x=O=>{a(O),u(!1)},e[3]=a,e[4]=x):x=e[4];const r=x,f=s!==null;let g;e[5]!==i||e[6]!==f?(g=ke(f,i),e[5]=i,e[6]=f,e[7]=g):g=e[7];const h=g,j=i&&"ml-auto";let y;e[8]!==j?(y=q("shrink-0 opacity-60",j),e[8]=j,e[9]=y):y=e[9];const S=y;let v;e[10]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(ht,{className:"size-3.5 shrink-0"}),e[10]=v):v=e[10];let N;e[11]!==p?(N=t.jsx("span",{className:"max-w-[12rem] truncate",children:p}),e[11]=p,e[12]=N):N=e[12];let C;e[13]!==S?(C=t.jsx(De,{size:12,className:S}),e[13]=S,e[14]=C):C=e[14];let k;e[15]!==N||e[16]!==C||e[17]!==h?(k=t.jsx(Ve,{asChild:!0,children:t.jsxs("button",{type:"button",className:h,children:[v,N,C]})}),e[15]=N,e[16]=C,e[17]=h,e[18]=k):k=e[18];let w;e[19]!==l?(w=l("taskBoard.taskFilters.repoFilterPlaceholder"),e[19]=l,e[20]=w):w=e[20];let m;e[21]!==l?(m=l("taskBoard.taskFilters.repoFilterPlaceholder"),e[21]=l,e[22]=m):m=e[22];let _;e[23]!==w||e[24]!==m?(_=t.jsx(At,{placeholder:w,"aria-label":m,className:"h-9"}),e[23]=w,e[24]=m,e[25]=_):_=e[25];let D;e[26]!==l?(D=l("taskBoard.taskFilters.repoNoReposFound"),e[26]=l,e[27]=D):D=e[27];let F;e[28]!==D?(F=t.jsx(Ft,{children:D}),e[28]=D,e[29]=F):F=e[29];let I;e[30]!==l?(I=l("taskBoard.taskFilters.repoAnyRepo"),e[30]=l,e[31]=I):I=e[31];let b;e[32]!==r?(b=()=>r(null),e[32]=r,e[33]=b):b=e[33];let A;e[34]!==l?(A=l("taskBoard.taskFilters.repoAnyRepo"),e[34]=l,e[35]=A):A=e[35];let T;e[36]!==I||e[37]!==b||e[38]!==A?(T=t.jsx(Ce,{value:I,onSelect:b,children:A}),e[36]=I,e[37]=b,e[38]=A,e[39]=T):T=e[39];let z;e[40]!==l?(z=l("taskBoard.taskFilters.repoNoRepo"),e[40]=l,e[41]=z):z=e[41];let L;e[42]!==r?(L=()=>r(jt),e[42]=r,e[43]=L):L=e[43];let P;e[44]!==l?(P=l("taskBoard.taskFilters.repoNoRepo"),e[44]=l,e[45]=P):P=e[45];let $;e[46]!==z||e[47]!==L||e[48]!==P?($=t.jsx(Ce,{value:z,onSelect:L,children:P}),e[46]=z,e[47]=L,e[48]=P,e[49]=$):$=e[49];let U;e[50]!==T||e[51]!==$?(U=t.jsxs(Ue,{children:[T,$]}),e[50]=T,e[51]=$,e[52]=U):U=e[52];let X;if(e[53]!==o||e[54]!==r||e[55]!==s){let O;e[57]!==r||e[58]!==s?(O=H=>t.jsxs(Ce,{value:H,onSelect:()=>r(H),className:"gap-2",children:[t.jsx(ht,{className:"size-4 shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:H}),s===H&&t.jsx(He,{size:14,className:"shrink-0 text-foreground"})]},H),e[57]=r,e[58]=s,e[59]=O):O=e[59],X=o.map(O),e[53]=o,e[54]=r,e[55]=s,e[56]=X}else X=e[56];let Y;e[60]!==X?(Y=t.jsx(Ue,{children:X}),e[60]=X,e[61]=Y):Y=e[61];let G;e[62]!==F||e[63]!==U||e[64]!==Y?(G=t.jsxs(It,{children:[F,U,Y]}),e[62]=F,e[63]=U,e[64]=Y,e[65]=G):G=e[65];let V;e[66]!==_||e[67]!==G?(V=t.jsx(nt,{align:"start",className:"w-64 p-0",children:t.jsxs(Tt,{children:[_,G]})}),e[66]=_,e[67]=G,e[68]=V):V=e[68];let J;return e[69]!==c||e[70]!==k||e[71]!==V?(J=t.jsxs(st,{open:c,onOpenChange:u,children:[k,V]}),e[69]=c,e[70]=k,e[71]=V,e[72]=J):J=e[72],J}function Dl(n){const e=M.c(45),{value:s,sprints:o,onChange:a,block:i}=n,l=K();let c;if(e[0]!==o||e[1]!==s){let b;e[3]!==s?(b=A=>A.id===s,e[3]=s,e[4]=b):b=e[4],c=o.find(b),e[0]=o,e[1]=s,e[2]=c}else c=e[2];const u=c;let d;e[5]!==u?.name||e[6]!==l||e[7]!==s?(d=s===null?l("taskBoard.taskFilters.sprintLabel"):s===tt?l("taskBoard.taskFilters.sprintBacklog"):u?.name??l("taskBoard.taskFilters.sprintLabel"),e[5]=u?.name,e[6]=l,e[7]=s,e[8]=d):d=e[8];const p=d,x=s!==null;let r;e[9]!==i||e[10]!==x?(r=ke(x,i),e[9]=i,e[10]=x,e[11]=r):r=e[11];const f=r,g=i&&"ml-auto";let h;e[12]!==g?(h=q("shrink-0 opacity-60",g),e[12]=g,e[13]=h):h=e[13];const j=h;let y;e[14]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx($s,{size:14,className:"shrink-0"}),e[14]=y):y=e[14];let S;e[15]!==j?(S=t.jsx(De,{size:12,className:j}),e[15]=j,e[16]=S):S=e[16];let v;e[17]!==p||e[18]!==S||e[19]!==f?(v=t.jsx(St,{asChild:!0,children:t.jsxs("button",{type:"button",className:f,children:[y,p,S]})}),e[17]=p,e[18]=S,e[19]=f,e[20]=v):v=e[20];const N=s===null?be:s;let C;e[21]!==a?(C=b=>a(b===be?gs:b),e[21]=a,e[22]=C):C=e[22];let k;e[23]!==l?(k=l("taskBoard.taskFilters.sprintAnySprint"),e[23]=l,e[24]=k):k=e[24];let w;e[25]!==k?(w=t.jsx(_e,{value:be,children:k}),e[25]=k,e[26]=w):w=e[26];let m;e[27]!==l?(m=l("taskBoard.taskFilters.sprintBacklog"),e[27]=l,e[28]=m):m=e[28];let _;e[29]!==m?(_=t.jsx(_e,{value:tt,children:m}),e[29]=m,e[30]=_):_=e[30];let D;if(e[31]!==o||e[32]!==l){let b;e[34]!==l?(b=A=>t.jsxs(_e,{value:A.id,children:[t.jsx("span",{className:"truncate",children:A.name}),t.jsx("span",{className:"ml-auto shrink-0 text-muted-foreground",children:A.state==="active"?l("taskBoard.taskFilters.sprintCurrent"):In(A)})]},A.id),e[34]=l,e[35]=b):b=e[35],D=o.map(b),e[31]=o,e[32]=l,e[33]=D}else D=e[33];let F;e[36]!==N||e[37]!==C||e[38]!==w||e[39]!==_||e[40]!==D?(F=t.jsx(_t,{align:"start",className:"max-h-80 w-72 overflow-y-auto",children:t.jsxs(wt,{value:N,onValueChange:C,children:[w,_,D]})}),e[36]=N,e[37]=C,e[38]=w,e[39]=_,e[40]=D,e[41]=F):F=e[41];let I;return e[42]!==F||e[43]!==v?(I=t.jsxs(Dt,{children:[v,F]}),e[42]=F,e[43]=v,e[44]=I):I=e[44],I}function Al(n){const e=M.c(25),{value:s,onChange:o,block:a}=n,i=K(),[l,c]=Q.useState(s!==""),[u,d]=Q.useState(!1),[p,x]=Q.useState(s);s!==p&&(x(s),s===""&&!u&&c(!1));const r=l||a,f=r?"w-32 sm:w-44":"w-8 px-0 justify-center",g=a&&"h-10 w-full px-3 text-sm sm:w-full";let h;e[0]!==f||e[1]!==g?(h=q("inline-flex h-8 shrink-0 items-center gap-1.5 overflow-hidden rounded-lg border border-border px-2.5 text-xs text-foreground transition-all duration-200 ease-out",f,g),e[0]=f,e[1]=g,e[2]=h):h=e[2];let j;e[3]!==i?(j=i("taskBoard.taskFilters.searchLabel"),e[3]=i,e[4]=j):j=e[4];let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=()=>c(!0),e[5]=y):y=e[5];let S;e[6]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(Ms,{size:14}),e[6]=S):S=e[6];let v;e[7]!==j?(v=t.jsx("button",{type:"button","aria-label":j,onClick:y,className:"shrink-0 text-muted-foreground transition-colors hover:text-foreground",children:S}),e[7]=j,e[8]=v):v=e[8];let N;e[9]!==a||e[10]!==r||e[11]!==o||e[12]!==i||e[13]!==s?(N=r&&t.jsx("input",{autoFocus:!a,value:s,onChange:w=>o(w.target.value),onFocus:()=>d(!0),onBlur:()=>{d(!1),s===""&&c(!1)},placeholder:i("taskBoard.taskFilters.searchPlaceholder"),"aria-label":i("taskBoard.taskFilters.searchPlaceholder"),className:"w-full min-w-0 bg-transparent text-xs outline-none placeholder:text-muted-foreground"}),e[9]=a,e[10]=r,e[11]=o,e[12]=i,e[13]=s,e[14]=N):N=e[14];let C;e[15]!==a||e[16]!==o||e[17]!==i||e[18]!==s?(C=s!==""&&t.jsx("button",{type:"button","aria-label":i("taskBoard.taskFilters.searchClearLabel"),onMouseDown:Fl,onClick:()=>{o(""),a||c(!1)},className:"shrink-0 text-muted-foreground hover:text-foreground",children:t.jsx(Ts,{size:14})}),e[15]=a,e[16]=o,e[17]=i,e[18]=s,e[19]=C):C=e[19];let k;return e[20]!==h||e[21]!==v||e[22]!==N||e[23]!==C?(k=t.jsxs("div",{className:h,children:[v,N,C]}),e[20]=h,e[21]=v,e[22]=N,e[23]=C,e[24]=k):k=e[24],k}function Fl(n){return n.preventDefault()}function Il(n){const e=M.c(20),{block:s,onClick:o}=n,a=K();let i;e[0]!==a?(i=a("taskBoard.taskFilters.boardSettingsLabel"),e[0]=a,e[1]=i):i=e[1];const l=i;let c;e[2]!==s?(c=q(ke(!1,s),s?"h-10 w-full":"w-8 justify-center px-0"),e[2]=s,e[3]=c):c=e[3];let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(An,{size:14,className:"shrink-0"}),e[4]=u):u=e[4];let d;e[5]!==s||e[6]!==l?(d=s&&t.jsx("span",{children:l}),e[5]=s,e[6]=l,e[7]=d):d=e[7];let p;e[8]!==l||e[9]!==o||e[10]!==c||e[11]!==d?(p=t.jsxs("button",{type:"button",onClick:o,"aria-label":l,className:c,children:[u,d]}),e[8]=l,e[9]=o,e[10]=c,e[11]=d,e[12]=p):p=e[12];const x=p;if(s)return x;let r;e[13]!==x?(r=t.jsx(ze,{asChild:!0,children:x}),e[13]=x,e[14]=r):r=e[14];let f;e[15]!==l?(f=t.jsx(Ee,{side:"top",children:l}),e[15]=l,e[16]=f):f=e[16];let g;return e[17]!==r||e[18]!==f?(g=t.jsxs(Re,{children:[r,f]}),e[17]=r,e[18]=f,e[19]=g):g=e[19],g}function vs(n){const e=M.c(59),{filters:s,members:o,tags:a,repos:i,sprints:l,onChange:c,onOpenBoardSettings:u,block:d}=n;let p;e[0]!==s||e[1]!==c?(p=m=>c({...s,search:m}),e[0]=s,e[1]=c,e[2]=p):p=e[2];let x;e[3]!==d||e[4]!==s.search||e[5]!==p?(x=t.jsx(Al,{block:d,value:s.search,onChange:p}),e[3]=d,e[4]=s.search,e[5]=p,e[6]=x):x=e[6];let r;e[7]!==s||e[8]!==c?(r=m=>c({...s,assignee:m}),e[7]=s,e[8]=c,e[9]=r):r=e[9];let f;e[10]!==d||e[11]!==s.assignee||e[12]!==o||e[13]!==r?(f=t.jsx(yl,{block:d,value:s.assignee,members:o,onChange:r}),e[10]=d,e[11]=s.assignee,e[12]=o,e[13]=r,e[14]=f):f=e[14];let g;e[15]!==s||e[16]!==c?(g=m=>c({...s,priority:m}),e[15]=s,e[16]=c,e[17]=g):g=e[17];let h;e[18]!==d||e[19]!==s.priority||e[20]!==g?(h=t.jsx(Nl,{block:d,value:s.priority,onChange:g}),e[18]=d,e[19]=s.priority,e[20]=g,e[21]=h):h=e[21];let j;e[22]!==s||e[23]!==c?(j=m=>c({...s,due:m}),e[22]=s,e[23]=c,e[24]=j):j=e[24];let y;e[25]!==d||e[26]!==s.due||e[27]!==j?(y=t.jsx(Sl,{block:d,value:s.due,onChange:j}),e[25]=d,e[26]=s.due,e[27]=j,e[28]=y):y=e[28];let S;e[29]!==s||e[30]!==c?(S=m=>c({...s,tags:m}),e[29]=s,e[30]=c,e[31]=S):S=e[31];let v;e[32]!==d||e[33]!==s.tags||e[34]!==S||e[35]!==a?(v=t.jsx(_l,{block:d,value:s.tags,tags:a,onChange:S}),e[32]=d,e[33]=s.tags,e[34]=S,e[35]=a,e[36]=v):v=e[36];let N;e[37]!==d||e[38]!==s||e[39]!==c||e[40]!==i?(N=(i.length>0||s.repo!==null)&&t.jsx(wl,{block:d,value:s.repo,repos:i,onChange:m=>c({...s,repo:m})}),e[37]=d,e[38]=s,e[39]=c,e[40]=i,e[41]=N):N=e[41];let C;e[42]!==d||e[43]!==s||e[44]!==c||e[45]!==l?(C=(l.length>0||s.sprint!==null)&&t.jsx(Dl,{block:d,value:s.sprint,sprints:l,onChange:m=>c({...s,sprint:m})}),e[42]=d,e[43]=s,e[44]=c,e[45]=l,e[46]=C):C=e[46];let k;e[47]!==d||e[48]!==u?(k=t.jsx(Il,{block:d,onClick:u}),e[47]=d,e[48]=u,e[49]=k):k=e[49];let w;return e[50]!==v||e[51]!==N||e[52]!==C||e[53]!==k||e[54]!==x||e[55]!==f||e[56]!==h||e[57]!==y?(w=t.jsxs(t.Fragment,{children:[x,f,h,y,v,N,C,k]}),e[50]=v,e[51]=N,e[52]=C,e[53]=k,e[54]=x,e[55]=f,e[56]=h,e[57]=y,e[58]=w):w=e[58],w}function $o(n){const e=M.c(17),{filters:s,members:o,tags:a,repos:i,sprints:l,onChange:c,onOpenBoardSettings:u}=n,d=K();let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(ps,{size:16,className:"mr-0.5 shrink-0 text-muted-foreground"}),e[0]=p):p=e[0];let x;e[1]!==s||e[2]!==o||e[3]!==c||e[4]!==u||e[5]!==i||e[6]!==l||e[7]!==a?(x=t.jsx(vs,{filters:s,members:o,tags:a,repos:i,sprints:l,onChange:c,onOpenBoardSettings:u}),e[1]=s,e[2]=o,e[3]=c,e[4]=u,e[5]=i,e[6]=l,e[7]=a,e[8]=x):x=e[8];let r;e[9]!==s||e[10]!==c||e[11]!==l||e[12]!==d?(r=xl(s,Bt(l))&&t.jsx("button",{type:"button",onClick:()=>c(xs),className:"ml-1 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground",children:d("taskBoard.taskFilters.clearButton")}),e[9]=s,e[10]=c,e[11]=l,e[12]=d,e[13]=r):r=e[13];let f;return e[14]!==x||e[15]!==r?(f=t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[p,x,r]}),e[14]=x,e[15]=r,e[16]=f):f=e[16],f}function Mo(n){const e=M.c(45),{filters:s,members:o,tags:a,repos:i,sprints:l,onChange:c,onOpenBoardSettings:u}=n,d=K(),[p,x]=Q.useState(!1);let r;e[0]!==s||e[1]!==l?(r=jl(s,Bt(l)),e[0]=s,e[1]=l,e[2]=r):r=e[2];const f=r,g=f>0;let h;e[3]!==g?(h=ke(g),e[3]=g,e[4]=h):h=e[4];const j=h;let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(ps,{size:14,className:"shrink-0"}),e[5]=y):y=e[5];let S;e[6]!==d?(S=d("taskBoard.taskFilters.filterDrawerButtonLabel"),e[6]=d,e[7]=S):S=e[7];let v;e[8]!==f?(v=f>0&&t.jsx("span",{className:"ml-0.5 flex size-4 items-center justify-center rounded-full bg-foreground text-[10px] font-semibold text-background",children:f}),e[8]=f,e[9]=v):v=e[9];let N;e[10]!==S||e[11]!==v||e[12]!==j?(N=t.jsx(Us,{asChild:!0,children:t.jsxs("button",{type:"button",className:j,children:[y,S,v]})}),e[10]=S,e[11]=v,e[12]=j,e[13]=N):N=e[13];let C;e[14]!==d?(C=d("taskBoard.taskFilters.filterDrawerTitle"),e[14]=d,e[15]=C):C=e[15];let k;e[16]!==C?(k=t.jsx(Nt,{className:"px-4 pt-4 text-base font-medium text-foreground",children:C}),e[16]=C,e[17]=k):k=e[17];let w;e[18]!==s||e[19]!==o||e[20]!==c||e[21]!==u||e[22]!==i||e[23]!==l||e[24]!==a?(w=t.jsx("div",{className:"flex flex-col gap-2 p-4",children:t.jsx(vs,{block:!0,filters:s,members:o,tags:a,repos:i,sprints:l,onChange:c,onOpenBoardSettings:u})}),e[18]=s,e[19]=o,e[20]=c,e[21]=u,e[22]=i,e[23]=l,e[24]=a,e[25]=w):w=e[25];let m;e[26]!==f||e[27]!==c||e[28]!==d?(m=f>0&&t.jsx(je,{variant:"outline",className:"flex-1",onClick:()=>c(xs),children:d("taskBoard.taskFilters.clearAllButton")}),e[26]=f,e[27]=c,e[28]=d,e[29]=m):m=e[29];let _;e[30]!==d?(_=d("taskBoard.taskFilters.doneButton"),e[30]=d,e[31]=_):_=e[31];let D;e[32]!==_?(D=t.jsx(ss,{asChild:!0,children:t.jsx(je,{className:"flex-1",children:_})}),e[32]=_,e[33]=D):D=e[33];let F;e[34]!==m||e[35]!==D?(F=t.jsxs(ns,{className:"flex-row gap-2",children:[m,D]}),e[34]=m,e[35]=D,e[36]=F):F=e[36];let I;e[37]!==w||e[38]!==F||e[39]!==k?(I=t.jsxs(yt,{className:"p-0",children:[k,w,F]}),e[37]=w,e[38]=F,e[39]=k,e[40]=I):I=e[40];let b;return e[41]!==p||e[42]!==I||e[43]!==N?(b=t.jsxs(kt,{open:p,onOpenChange:x,direction:"bottom",children:[N,I]}),e[41]=p,e[42]=I,e[43]=N,e[44]=b):b=e[44],b}function Oo(n,e){return pl(n,e.keySeq,e.jiraIssueKey)??e.id}function zo(n,e){const s=e?.trim();if(!s)return;const o=s.toLowerCase();return n.find(a=>a.jiraIssueKey?.trim().toLowerCase()===o)??n.find(a=>bs(s,a.keySeq,a.jiraIssueKey))??n.find(a=>a.id===s)}export{Io as A,xs as E,Fo as N,Kt as S,Mo as T,Oo as a,Ao as b,$o as c,Lo as d,Jn as e,zo as f,Bo as m,Po as r,pl as t,To as u};
1
+ import{c as M,l as q,j as t,h as Ge,r as Q,I as Wt,G as Cs,o as Z,b as K,b6 as ks,W as we,d as Xt,a6 as Yt,_ as qt,L as ys,a1 as ze,a2 as Ee,a4 as Re,a as bt,F as Ns,ar as Ss,as as _s,B as je,t as xe,H as ws,J as Ds,K as vt,n as As,a7 as Fs,m as Is,ap as Ts}from"./index-KlN2gCIz.js";import{c as Qt,u as Bs,d as Jt}from"./thread-route-nSN2wMws.js";import{t as De}from"./ChevronUp-DoFbOo5V.js";import{A as Zt,L as Ps,s as ct,a3 as dt,a2 as Ls,a1 as $s,a8 as Ms}from"./agent-icon-9NxB5SOp.js";import{a as es,i as Os,e as zs,S as Es,f as Rs}from"./constants-DNuUCxmW.js";import{b as Ct,u as Vs}from"./use-virtual-mcp-D1i-P-jz.js";import{g as Ks}from"./github-repo-BpKUwJal.js";import{T as ts}from"./toolbar-icon-button-D78WqDTu.js";import{P as st,a as Ve,b as nt}from"./popover-DMAen6H4.js";import{D as kt,a as yt,b as Nt,c as Gs,e as Hs,f as ss,g as ns,d as Us}from"./drawer-Bw9gslIb.js";import{i as Ws}from"./SearchMd-BL3yOzl8.js";import{i as He}from"./Check-DFpZ57WE.js";import{s as We}from"./Plus-B4HOF1E1.js";import{G as ht,a as Xs}from"./github-repo-picker-XPNUm2jV.js";import{g as Ys,u as qs,b as ls}from"./hooks-WsI05bHe.js";import{g as Qs,b as os}from"./use-project-scope-M7A4kaM_.js";import{b as Js,c as Zs,a as en}from"./use-navigate-to-agent-DsYRGB5d.js";import{u as is}from"./shell-layout-CvYCmCNz.js";import{d as tn}from"./thread-intent-aJd8je2A.js";import{C as sn}from"./collection-search-Bfeg8_4N.js";import{g as nn,b as ln,a as on,e as an}from"./extract-connection-data-MINwSTDT.js";import{u as as,a as rs,g as rn,C as ut}from"./connection-card-C8JTppjB.js";import{D as cs,b as ds,c as us,d as fs,h as cn,e as dn}from"./dialog-oJmEQ7fd.js";import{d as re,a as ce,e as de,b as ue,c as fe,F as Pt}from"./form-KNJGif8F.js";import{I as Se}from"./input-HEtJVl9i.js";import{S as un,a as fn,b as mn,c as pn,d as Ke}from"./select-BqDsJm6t.js";import{T as hn}from"./textarea-BvwRrfOE.js";import{b as ms}from"./use-connection-C_L1iNkQ.js";import{n as Ze,a as ft,i as ps}from"./Tool02-CUjmmZmP.js";import{b as gn}from"./UserSquare-DAvB_kFJ.js";import{s as xn}from"./XClose-CfMSoySe.js";import{c as jn,i as qe,a as Lt,E as bn,p as vn,b as Cn,d as kn}from"./connection-form-helpers-C8Ib0fh-.js";import{a as mt}from"./authenticate-and-persist-oauth-BSmdaYES.js";import{g as yn}from"./connection-slug-CITJ0kGN.js";import{C as Nn}from"./collection-tabs-CtU4r8Hy.js";import{u as $t}from"./use-infinite-scroll-Ce21aioX.js";import{B as Qe}from"./badge-DU8Pt1Ge.js";import{u as Sn}from"./useSuspenseInfiniteQuery-Bv4wKU6R.js";import{u as _n}from"./use-mcp-client-DaJV2zKk.js";import{g as et}from"./metadata-dUsYcpuu.js";import{u as wn}from"./use-ai-providers-D3ICNjqW.js";import{A as Mt}from"./avatar-gFJWL-Vg.js";import{h as _e,D as St,b as _t,g as wt,c as Dt}from"./dropdown-menu-DwjXZoet.js";import{a as At,c as Ft,d as Ce,e as Ue,b as It,C as Tt}from"./command-C_Uammpe.js";import{s as Dn}from"./TrendUp01-B1pPYfuK.js";import{a as An}from"./Settings02-Bj1lDwij.js";import{s as Ot}from"./User01-AECGy6qL.js";import{g as zt}from"./get-initials-D-f_fDFw.js";import{P as Je,d as Fn,f as Et,j as In}from"./config-BGIQidIa.js";import{S as gt}from"./task-board-B75_z9Rj.js";function Tn(n){const e=M.c(21),{value:s,onChange:o,placeholder:a,onKeyDown:i,className:l,isSearching:c,disabled:u}=n,d=a===void 0?"Search...":a;let p;e[0]!==l?(p=q("shrink-0 w-full border-b border-border h-12",l),e[0]=l,e[1]=p):p=e[1];const x=u?"cursor-not-allowed opacity-50":"cursor-text";let r;e[2]!==x?(r=q("flex items-center gap-2.5 h-12 px-4",x),e[2]=x,e[3]=r):r=e[3];let f;e[4]!==c?(f=c?t.jsx(Ge,{className:"size-4 text-muted-foreground shrink-0"}):t.jsx(Ws,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=c,e[5]=f):f=e[5];let g;e[6]!==o?(g=S=>o(S.target.value),e[6]=o,e[7]=g):g=e[7];let h;e[8]!==u||e[9]!==i||e[10]!==d||e[11]!==g||e[12]!==s?(h=t.jsx("input",{type:"text",value:s,onChange:g,onKeyDown:i,placeholder:d,disabled:u,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=u,e[9]=i,e[10]=d,e[11]=g,e[12]=s,e[13]=h):h=e[13];let j;e[14]!==r||e[15]!==f||e[16]!==h?(j=t.jsxs("label",{className:r,children:[f,h]}),e[14]=r,e[15]=f,e[16]=h,e[17]=j):j=e[17];let y;return e[18]!==p||e[19]!==j?(y=t.jsx("div",{className:p,children:j}),e[18]=p,e[19]=j,e[20]=y):y=e[20],y}function Bn(n,e,s){if(!s)return null;const o=Ys(n,e);return o?o.threads.get().find(i=>i.id===s)?.branch??null:null}function Pn(n){const e=M.c(6),{value:s,onChange:o}=n,a=K();let i;e[0]!==a?(i=a("sidebar.agentsSection.searchAgents"),e[0]=a,e[1]=i):i=e[1];let l;return e[2]!==o||e[3]!==i||e[4]!==s?(l=t.jsx(Tn,{value:s,onChange:o,placeholder:i}),e[2]=o,e[3]=i,e[4]=s,e[5]=l):l=e[5],l}function Ln(){const n=M.c(4),e=K();let s;n[0]!==e?(s=e("sidebar.agentsSection.noAgentsFound"),n[0]=e,n[1]=s):s=n[1];let o;return n[2]!==s?(o=t.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:s}),n[2]=s,n[3]=o):o=n[3],o}function $n(n){const e=M.c(10),{org:s,onClose:o}=n,a=K();let i;e[0]!==s.slug?(i={org:s.slug},e[0]=s.slug,e[1]=i):i=e[1];let l;e[2]!==o?(l=()=>o(),e[2]=o,e[3]=l):l=e[3];let c;e[4]!==a?(c=a("sidebar.agentsSection.seeAllAgents"),e[4]=a,e[5]=c):c=e[5];let u;return e[6]!==i||e[7]!==l||e[8]!==c?(u=t.jsx("div",{className:"border-t border-border px-3 py-2.5",children:t.jsx(ys,{to:"/$org/settings/agents",params:i,onClick:l,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:c})}),e[6]=i,e[7]=l,e[8]=c,e[9]=u):u=e[9],u}function Mn(){const n=M.c(4),e=K();let s;n[0]!==e?(s=e("sidebar.agentsSection.agents"),n[0]=e,n[1]=s):s=n[1];let o;return n[2]!==s?(o=t.jsx(hs,{children:s}),n[2]=s,n[3]=o):o=n[3],o}function On(n){const e=M.c(11),{onImportFromGithub:s}=n,o=K();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(ht,{className:"size-3.5"}),e[0]=a):a=e[0];let i;e[1]!==o?(i=o("sidebar.agentsSection.import"),e[1]=o,e[2]=i):i=e[2];let l;e[3]!==s||e[4]!==i?(l=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:[a,i]}),e[3]=s,e[4]=i,e[5]=l):l=e[5];let c;e[6]!==o?(c=o("sidebar.agentsSection.codeAgents"),e[6]=o,e[7]=c):c=e[7];let u;return e[8]!==l||e[9]!==c?(u=t.jsx(hs,{action:l,children:c}),e[8]=l,e[9]=c,e[10]=u):u=e[10],u}function zn(n){const e=M.c(11),{setOpen:s,emptyCtaClass:o}=n,a=K();let i;e[0]!==a?(i=a("sidebar.agentsSection.browseAgents"),e[0]=a,e[1]=i):i=e[1];let l;e[2]!==o?(l=q(o),e[2]=o,e[3]=l):l=e[3];let c;e[4]!==s?(c=()=>{Z("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[4]=s,e[5]=c):c=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(We,{className:"size-4"}),e[6]=u):u=e[6];let d;return e[7]!==i||e[8]!==l||e[9]!==c?(d=t.jsx(ts,{"aria-label":i,className:l,onClick:c,children:u}),e[7]=i,e[8]=l,e[9]=c,e[10]=d):d=e[10],d}function En(n){const e=M.c(17),{setOpen:s,highlightEmpty:o,emptyCtaClass:a}=n,i=K();let l;e[0]!==o||e[1]!==i?(l=o?void 0:i("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=i,e[2]=l):l=e[2];let c;e[3]!==a?(c=q(a),e[3]=a,e[4]=c):c=e[4];let u;e[5]!==s?(u=()=>{Z("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[5]=s,e[6]=u):u=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(We,{}),e[7]=d):d=e[7];let p;e[8]!==i?(p=i("sidebar.agentsSection.newAgent"),e[8]=i,e[9]=p):p=e[9];let x;e[10]!==p?(x=t.jsx("span",{children:p}),e[10]=p,e[11]=x):x=e[11];let r;return e[12]!==l||e[13]!==c||e[14]!==u||e[15]!==x?(r=t.jsx(Yt,{children:t.jsxs(qt,{tooltip:l,className:c,onClick:u,children:[d,x]})}),e[12]=l,e[13]=c,e[14]=u,e[15]=x,e[16]=r):r=e[16],r}function Rn(){const n=M.c(4),e=K();let s;n[0]!==e?(s=e("sidebar.agentsSection.browseAgents"),n[0]=e,n[1]=s):s=n[1];let o;return n[2]!==s?(o=t.jsx(Nt,{className:"sr-only",children:s}),n[2]=s,n[3]=o):o=n[3],o}function Vn(n){const e=M.c(8),{emptyCtaClass:s}=n,o=K();let a;e[0]!==o?(a=o("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=a):a=e[1];let i;e[2]!==s?(i=q(s),e[2]=s,e[3]=i):i=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(We,{className:"size-4"}),e[4]=l):l=e[4];let c;return e[5]!==a||e[6]!==i?(c=t.jsx(ts,{"aria-label":a,className:i,children:l}),e[5]=a,e[6]=i,e[7]=c):c=e[7],c}function Kn(n){const e=M.c(19),{wrapEmptyHint:s,highlightEmpty:o,emptyCtaClass:a}=n,i=K();let l;e[0]!==o||e[1]!==i?(l=o?void 0:i("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=i,e[2]=l):l=e[2];let c;e[3]!==a?(c=q(a),e[3]=a,e[4]=c):c=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(We,{}),e[5]=u):u=e[5];let d;e[6]!==i?(d=i("sidebar.agentsSection.newAgent"),e[6]=i,e[7]=d):d=e[7];let p;e[8]!==d?(p=t.jsx("span",{children:d}),e[8]=d,e[9]=p):p=e[9];let x;e[10]!==l||e[11]!==c||e[12]!==p?(x=t.jsx(Ve,{asChild:!0,children:t.jsxs(qt,{tooltip:l,className:c,children:[u,p]})}),e[10]=l,e[11]=c,e[12]=p,e[13]=x):x=e[13];let r;e[14]!==x||e[15]!==s?(r=s(x),e[14]=x,e[15]=s,e[16]=r):r=e[16];let f;return e[17]!==r?(f=t.jsx(Yt,{children:r}),e[17]=r,e[18]=f):f=e[18],f}function Gn(n){const e=M.c(9),{children:s}=n,o=K();let a;e[0]!==s?(a=t.jsx(ze,{asChild:!0,children:s}),e[0]=s,e[1]=a):a=e[1];let i;e[2]!==o?(i=o("sidebar.agentsSection.selectAnExistingAgent"),e[2]=o,e[3]=i):i=e[3];let l;e[4]!==i?(l=t.jsx(Ee,{side:"right",sideOffset:8,children:i}),e[4]=i,e[5]=l):l=e[5];let c;return e[6]!==a||e[7]!==l?(c=t.jsxs(Re,{defaultOpen:!0,delayDuration:0,children:[a,l]}),e[6]=a,e[7]=l,e[8]=c):c=e[8],c}function Hn(n){const e=Xt(),{create:s}=qs(),{locator:o}=we(),a=Qt(),i=Bs();return async l=>{const c=crypto.randomUUID(),u=l===i?Bn(n,o,a??""):null;try{await s({id:c,virtual_mcp_id:l,...u?{branch:u}:{}})}catch{}e({to:"/$org/$taskId",params:{org:n,taskId:c},search:{virtualmcpid:l}})}}function pt(n){const e=M.c(20),{agent:s,selected:o,onClick:a}=n,i=o?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let l;e[0]!==i?(l=q("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",i),e[0]=i,e[1]=l):l=e[1];let c;e[2]!==s.icon||e[3]!==s.title?(c=t.jsx(Zt,{icon:s.icon,name:s.title,size:"xs",className:"shrink-0"}),e[2]=s.icon,e[3]=s.title,e[4]=c):c=e[4];let u;e[5]!==s.title?(u=t.jsx("p",{className:"text-sm font-medium truncate",children:s.title}),e[5]=s.title,e[6]=u):u=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 p;e[9]!==u||e[10]!==d?(p=t.jsxs("div",{className:"flex-1 min-w-0",children:[u,d]}),e[9]=u,e[10]=d,e[11]=p):p=e[11];let x;e[12]!==o?(x=o&&t.jsx(He,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=o,e[13]=x):x=e[13];let r;return e[14]!==a||e[15]!==l||e[16]!==c||e[17]!==p||e[18]!==x?(r=t.jsxs("button",{type:"button",onClick:a,className:l,children:[c,p,x]}),e[14]=a,e[15]=l,e[16]=c,e[17]=p,e[18]=x,e[19]=r):r=e[19],r}function hs(n){const e=M.c(5),{children:s,action:o}=n;let a;e[0]!==s?(a=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s}),e[0]=s,e[1]=a):a=e[1];let i;return e[2]!==o||e[3]!==a?(i=t.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[a,o]}),e[2]=o,e[3]=a,e[4]=i):i=e[4],i}function Un(n){const e=M.c(44),{onClose:s,onSelectAgent:o,selectedAgentId:a,onImportFromGithub:i}=n,[l,c]=Q.useState(""),u=Q.useDeferredValue(l),d=u||void 0;let p;e[0]!==d?(p={searchTerm:d},e[0]=d,e[1]=p):p=e[1];const x=Ct(p),r=x??[],{org:f}=we(),g=Zs(),h=Hn(f.slug),j=Qs(x),y=u.toLowerCase(),S=r.filter(qn).filter(O=>!j.has(O.id)).filter(Yn),v=S.filter(Xn),N=S.filter(Wn),C=es(f.id),k=!u||C.title.toLowerCase().includes(y),w=!!(o&&k);let m;e[2]!==s||e[3]!==o?(m=()=>{o?.(null),s(),c("")},e[2]=s,e[3]=o,e[4]=m):m=e[4];const _=m;let D;e[5]!==g||e[6]!==h||e[7]!==s||e[8]!==o?(D=O=>{if(o){o(O.id),s(),c("");return}g(),s(),c(""),h(O.id)},e[5]=g,e[6]=h,e[7]=s,e[8]=o,e[9]=D):D=e[9];const F=D,I="flex flex-col max-h-[min(640px,80dvh)]";let b;e[10]!==l?(b=t.jsx(Pn,{value:l,onChange:c}),e[10]=l,e[11]=b):b=e[11];const A="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5";let T;e[12]!==C||e[13]!==o||e[14]!==_||e[15]!==a||e[16]!==k?(T=o&&k&&C&&t.jsx(pt,{agent:C,selected:!a||a===C.id,onClick:_}),e[12]=C,e[13]=o,e[14]=_,e[15]=a,e[16]=k,e[17]=T):T=e[17];const z=(v.length>0||!u)&&t.jsx(On,{onImportFromGithub:i});let L;e[18]!==F||e[19]!==o||e[20]!==a?(L=O=>t.jsx(pt,{agent:O,selected:o?a===O.id:void 0,onClick:()=>F(O)},O.id),e[18]=F,e[19]=o,e[20]=a,e[21]=L):L=e[21];const P=v.map(L),$=N.length>0&&t.jsx(Mn,{});let U;e[22]!==F||e[23]!==o||e[24]!==a?(U=O=>t.jsx(pt,{agent:O,selected:o?a===O.id:void 0,onClick:()=>F(O)},O.id),e[22]=F,e[23]=o,e[24]=a,e[25]=U):U=e[25];const X=N.map(U);let Y;e[26]!==w||e[27]!==u||e[28]!==S.length?(Y=S.length===0&&!w&&u&&t.jsx(Ln,{}),e[26]=w,e[27]=u,e[28]=S.length,e[29]=Y):Y=e[29];let G;e[30]!==P||e[31]!==$||e[32]!==X||e[33]!==Y||e[34]!==T||e[35]!==z?(G=t.jsxs("div",{className:A,children:[T,z,P,$,X,Y]}),e[30]=P,e[31]=$,e[32]=X,e[33]=Y,e[34]=T,e[35]=z,e[36]=G):G=e[36];let V;e[37]!==s||e[38]!==f?(V=t.jsx($n,{org:f,onClose:s}),e[37]=s,e[38]=f,e[39]=V):V=e[39];let J;return e[40]!==G||e[41]!==V||e[42]!==b?(J=t.jsxs("div",{className:I,children:[b,G,V]}),e[40]=G,e[41]=V,e[42]=b,e[43]=J):J=e[43],J}function Wn(n){return!os(n.metadata)}function Xn(n){return os(n.metadata)}function Yn(n){return!zs(n.id)}function qn(n){return!Os(n.id)}function Qn(n){const e=M.c(14),{compact:s,trigger:o,onSelectAgent:a,selectedAgentId:i,side:l,align:c}=n===void 0?{}:n,u=s===void 0?!1:s,d=l===void 0?"right":l,p=c===void 0?"start":c,[x,r]=Q.useState(!1),[f,g]=Q.useState(!1),h=Wt(),{setOpenMobile:j}=Cs(),y=Js(),S=y?"border border-border":void 0;let v;e[0]!==y?(v=b=>y?t.jsx(Gn,{children:b}):b,e[0]=y,e[1]=v):v=e[1];const N=v;let C;e[2]!==h||e[3]!==j?(C=()=>{r(!1),h&&j(!1)},e[2]=h,e[3]=j,e[4]=C):C=e[4];const k=C;let w;e[5]!==k||e[6]!==g?(w=()=>{k(),g(!0)},e[5]=k,e[6]=g,e[7]=w):w=e[7];const m=w,_=x&&t.jsx(Q.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx(ks,{className:"h-4 w-24"})}),children:t.jsx(Un,{onClose:k,onSelectAgent:a,selectedAgentId:i,onImportFromGithub:m})}),D=h?t.jsxs(t.Fragment,{children:[o?Q.cloneElement(o,{onClick:b=>{o.props.onClick?.(b),r(!0)}}):u?N(t.jsx(zn,{setOpen:r,emptyCtaClass:S})):t.jsx(En,{setOpen:r,highlightEmpty:y,emptyCtaClass:S}),t.jsx(kt,{open:x,onOpenChange:r,direction:"bottom",children:t.jsxs(yt,{className:"max-h-[85dvh] p-0",children:[t.jsx(Rn,{}),_]})})]}):t.jsxs(st,{open:x,onOpenChange:b=>{b&&!x&&Z("agent_browser_opened",{surface:"desktop_popover"}),r(b)},children:[o?t.jsx(Ve,{asChild:!0,children:o}):u?N(t.jsx(Ve,{asChild:!0,children:t.jsx(Vn,{emptyCtaClass:S})})):t.jsx(Kn,{wrapEmptyHint:N,highlightEmpty:y,emptyCtaClass:S}),t.jsx(nt,{className:"w-[380px] p-0 overflow-hidden",side:d,align:p,children:_})]});let F;e[8]!==f||e[9]!==g?(F=t.jsx(Xs,{open:f,onOpenChange:g,mode:"agent"}),e[8]=f,e[9]=g,e[10]=F):F=e[10];let I;return e[11]!==D||e[12]!==F?(I=t.jsxs(t.Fragment,{children:[D,F]}),e[11]=D,e[12]=F,e[13]=I):I=e[13],I}function Jn(){const n=M.c(2),e=Ct()??[];let s;return n[0]!==e?(s=o=>{if(!o)return;const a=e.find(i=>i.id===o);return a?tn(a.metadata):void 0},n[0]=e,n[1]=s):s=n[1],s}const Zn="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 el(n){const e=M.c(29),{agentId:s,fallback:o,onOpenHome:a,onPick:i}=n,l=K(),c=Vs(s)??o??null;let u,d,p,x,r;e[0]!==c?.title||e[1]!==a||e[2]!==l?(r=c?.title??l("header.shellBreadcrumb.superAgentDefaultName"),x="flex min-w-0 items-center gap-0",u="button",d=a,p=l("header.shellBreadcrumb.openAgentHome",{name:r}),e[0]=c?.title,e[1]=a,e[2]=l,e[3]=u,e[4]=d,e[5]=p,e[6]=x,e[7]=r):(u=e[3],d=e[4],p=e[5],x=e[6],r=e[7]);const f=c?.icon??null;let g;e[8]!==f||e[9]!==r?(g=t.jsx(Zt,{icon:f,name:r,size:"xs"}),e[8]=f,e[9]=r,e[10]=g):g=e[10];let h;e[11]!==u||e[12]!==d||e[13]!==p||e[14]!==g?(h=t.jsx("button",{type:u,onClick:d,"aria-label":p,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:g}),e[11]=u,e[12]=d,e[13]=p,e[14]=g,e[15]=h):h=e[15];let j;e[16]!==r?(j=t.jsx("span",{className:"truncate font-medium max-w-[8rem]",children:r}),e[16]=r,e[17]=j):j=e[17];let y;e[18]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(De,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[18]=y):y=e[18];let S;e[19]!==j?(S=t.jsxs("button",{type:"button",className:Zn,children:[j,y]}),e[19]=j,e[20]=S):S=e[20];let v;e[21]!==s||e[22]!==i||e[23]!==S?(v=t.jsx(Qn,{side:"bottom",align:"start",selectedAgentId:s,onSelectAgent:i,trigger:S}),e[21]=s,e[22]=i,e[23]=S,e[24]=v):v=e[24];let N;return e[25]!==v||e[26]!==x||e[27]!==h?(N=t.jsxs("div",{className:x,children:[h,v]}),e[25]=v,e[26]=x,e[27]=h,e[28]=N):N=e[28],N}function Ao(n){const e=M.c(22);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{onNavigate:o}=s,{org:a}=we(),{threads:i}=ls(),l=Ct(),{data:c}=bt.useSession(),{setTaskId:u,createNewTask:d}=is(),p=Jn();let x;e[2]!==a.id?(x=es(a.id),e[2]=a.id,e[3]=x):x=e[3];const r=x,f=r.id,g=Jt();let h;e[4]!==l||e[5]!==d||e[6]!==f||e[7]!==o||e[8]!==p||e[9]!==c?.user?.id||e[10]!==u||e[11]!==i?(h=C=>{const k=C??f,w=(l??[]).find(_=>_.id===k),m=en(i,k,c?.user?.id,p(k),!!(w&&Ks(w)));m?u(m.id,k):d(k),o?.()},e[4]=l,e[5]=d,e[6]=f,e[7]=o,e[8]=p,e[9]=c?.user?.id,e[10]=u,e[11]=i,e[12]=h):h=e[12];const j=h;let y;e[13]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),e[13]=y):y=e[13];const S=g===f?r:void 0;let v;e[14]!==g||e[15]!==j?(v=()=>j(g),e[14]=g,e[15]=j,e[16]=v):v=e[16];let N;return e[17]!==g||e[18]!==j||e[19]!==S||e[20]!==v?(N=t.jsx(Q.Suspense,{fallback:y,children:t.jsx(el,{agentId:g,fallback:S,onOpenHome:v,onPick:j})}),e[17]=g,e[18]=j,e[19]=S,e[20]=v,e[21]=N):N=e[21],N}function Fo(){const n=M.c(20),e=K(),{threads:s}=ls(),{createNewTask:o}=is(),a=Jt(),i=Qt();let l;n[0]!==i||n[1]!==s?(l=s.find(j=>j.id===i)?.branch??null,n[0]=i,n[1]=s,n[2]=l):l=n[2];const c=l;let u;n[3]!==a||n[4]!==o||n[5]!==c?(u=()=>{o(a,c)},n[3]=a,n[4]=o,n[5]=c,n[6]=u):u=n[6];const d=u;let p;n[7]!==e?(p=e("sidebar.taskGroupsList.newChat"),n[7]=e,n[8]=p):p=n[8];let x;n[9]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(Ps,{size:16}),n[9]=x):x=n[9];let r;n[10]!==d||n[11]!==p?(r=t.jsx(ze,{asChild:!0,children:t.jsx("button",{type:"button",onClick:d,"aria-label":p,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:x})}),n[10]=d,n[11]=p,n[12]=r):r=n[12];let f;n[13]!==e?(f=e("sidebar.taskGroupsList.newChat"),n[13]=e,n[14]=f):f=n[14];let g;n[15]!==f?(g=t.jsx(Ee,{side:"bottom",children:f}),n[15]=f,n[16]=g):g=n[16];let h;return n[17]!==r||n[18]!==g?(h=t.jsxs(Re,{children:[r,g]}),n[17]=r,n[18]=g,n[19]=h):h=n[19],h}function tl({open:n,onOpenChange:e,onCreated:s}){const o=K(),{org:a}=we(),{data:i}=bt.useSession(),{stdioEnabled:l}=Ns(),c=Wt(),u=ms(),d=as(),x=rs(d,"").items,r=Ss({resolver:_s(jn),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),f=r.watch("ui_type"),g=r.watch("connection_url"),h=r.watch("npx_package"),j=qe({uiType:f,connectionUrl:g??"",npxPackage:h??""})??Lt({uiType:f,connectionUrl:g??"",registryItems:x}),y=m=>{const _=m.trim();if(!_)return;const D=!!r.formState.dirtyFields.title,F=!!r.formState.dirtyFields.description,I=!!r.formState.dirtyFields.env_vars,b=T=>{if(T&&(!D&&!r.getValues("title").trim()&&T.title&&r.setValue("title",T.title,{shouldDirty:!1}),!F&&!(r.getValues("description")??"").trim()&&T.description&&r.setValue("description",T.description,{shouldDirty:!1}),!I&&T.envVarKeys?.length)){const z=r.getValues("env_vars")??[],L=new Set(z.map($=>$.key)),P=T.envVarKeys.filter($=>!L.has($));P.length>0&&r.setValue("env_vars",[...z,...P.map($=>({key:$,value:""}))],{shouldDirty:!0})}},A=vn(_);if(A&&l){r.setValue("ui_type","NPX",{shouldDirty:!0}),r.setValue("npx_package",A.packageName,{shouldDirty:!0}),r.setValue("connection_url","",{shouldDirty:!0}),r.setValue("connection_token",null,{shouldDirty:!0}),b(qe({uiType:"NPX",npxPackage:A.packageName}));return}if(_.startsWith("http://")||_.startsWith("https://")){const T=f==="HTTP"||f==="SSE"||f==="Websocket"?f:"HTTP";r.setValue("ui_type",T,{shouldDirty:!0}),r.setValue("connection_url",_,{shouldDirty:!0}),b(qe({uiType:T,connectionUrl:_})??Lt({uiType:T,connectionUrl:_,registryItems:x}));return}f==="NPX"&&b(qe({uiType:"NPX",npxPackage:_}))},S=m=>{m||r.reset(),e(m)},v=async m=>{let _,D=null,F=null,I=null;m.ui_type==="NPX"?(_="STDIO",D="",I=Cn(m.npx_package||"",m.env_vars||[])):m.ui_type==="STDIO"?(_="STDIO",D="",I=kn(m.stdio_command||"",m.stdio_args||"",m.stdio_cwd,m.env_vars||[])):(_=m.ui_type,D=m.connection_url||"",F=m.connection_token||null);const b=nn("conn");try{await u.create.mutateAsync({id:b,title:m.title,description:m.description||null,connection_type:_,connection_url:D,connection_token:F,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:i?.user?.id||"system",organization_id:a.id,icon:m.icon??null,app_name:null,app_id:null,connection_headers:I,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),r.reset(),e(!1),s?.(b)}catch{xe.error(o("connections.createConnectionDialog.failedToCreateConnection"))}},N=o("connections.createConnectionDialog.title"),C=o("connections.createConnectionDialog.description"),k=r.formState.isSubmitting?o("connections.createConnectionDialog.saving"):o("connections.createConnectionDialog.createButton"),w=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(re,{control:r.control,name:"ui_type",render:({field:m})=>t.jsxs(ce,{children:[t.jsx(de,{children:o("connections.createConnectionDialog.typeLabel")}),t.jsxs(un,{value:m.value,onValueChange:m.onChange,children:[t.jsx(ue,{children:t.jsx(fn,{children:t.jsx(mn,{})})}),t.jsxs(pn,{children:[t.jsx(Ke,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ct,{className:"w-4 h-4"}),o("connections.createConnectionDialog.httpType")]})}),t.jsx(Ke,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ct,{className:"w-4 h-4"}),o("connections.createConnectionDialog.sseType")]})}),t.jsx(Ke,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ct,{className:"w-4 h-4"}),o("connections.createConnectionDialog.websocketType")]})}),l&&t.jsxs(t.Fragment,{children:[t.jsx(Ke,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ze,{className:"w-4 h-4"}),o("connections.createConnectionDialog.npxPackageType")]})}),t.jsx(Ke,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(gn,{className:"w-4 h-4"}),o("connections.createConnectionDialog.customCommandType")]})})]})]})]}),t.jsx(fe,{})]})}),f==="NPX"&&t.jsx(re,{control:r.control,name:"npx_package",render:({field:m})=>t.jsxs(ce,{children:[t.jsx(de,{children:o("connections.createConnectionDialog.npmPackageLabel")}),t.jsx(ue,{children:t.jsx(Se,{placeholder:o("connections.createConnectionDialog.npmPackagePlaceholder"),...m,value:m.value??"",onPaste:_=>{const D=_.clipboardData.getData("text");D&&(_.preventDefault(),r.setValue("npx_package",D.trim(),{shouldDirty:!0}),y(D))},onBlur:_=>{y(_.target.value),m.onBlur()}})}),t.jsx(fe,{})]})}),f==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(re,{control:r.control,name:"stdio_command",render:({field:m})=>t.jsxs(ce,{children:[t.jsx(de,{children:o("connections.createConnectionDialog.commandLabel")}),t.jsx(ue,{children:t.jsx(Se,{placeholder:o("connections.createConnectionDialog.commandPlaceholder"),...m,value:m.value??""})}),t.jsx(fe,{})]})}),t.jsx(re,{control:r.control,name:"stdio_args",render:({field:m})=>t.jsxs(ce,{children:[t.jsx(de,{children:o("connections.createConnectionDialog.argumentsLabel")}),t.jsx(ue,{children:t.jsx(Se,{placeholder:o("connections.createConnectionDialog.argumentsPlaceholder"),...m,value:m.value??""})}),t.jsx(fe,{})]})})]}),t.jsx(re,{control:r.control,name:"stdio_cwd",render:({field:m})=>t.jsxs(ce,{children:[t.jsx(de,{children:o("connections.createConnectionDialog.workingDirectoryLabel")}),t.jsx(ue,{children:t.jsx(Se,{placeholder:o("connections.createConnectionDialog.workingDirectoryPlaceholder"),...m,value:m.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:o("connections.createConnectionDialog.workingDirectoryDescription")}),t.jsx(fe,{})]})})]}),(f==="NPX"||f==="STDIO")&&t.jsx(re,{control:r.control,name:"env_vars",render:({field:m})=>t.jsxs(ce,{children:[t.jsx(de,{children:o("connections.createConnectionDialog.environmentVariablesLabel")}),t.jsx(ue,{children:t.jsx(bn,{value:m.value??[],onChange:m.onChange})}),t.jsx(fe,{})]})}),f!=="NPX"&&f!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(re,{control:r.control,name:"connection_url",render:({field:m})=>t.jsxs(ce,{children:[t.jsx(de,{children:o("connections.createConnectionDialog.urlLabel")}),t.jsx(ue,{children:t.jsx(Se,{placeholder:o("connections.createConnectionDialog.urlPlaceholder"),...m,value:m.value??"",onPaste:_=>{const D=_.clipboardData.getData("text");D&&(_.preventDefault(),r.setValue("connection_url",D.trim(),{shouldDirty:!0}),y(D))},onBlur:_=>{y(_.target.value),m.onBlur()}})}),t.jsx(fe,{})]})}),t.jsx(re,{control:r.control,name:"connection_token",render:({field:m})=>t.jsxs(ce,{children:[t.jsx(de,{children:j?.token?.label??o("connections.createConnectionDialog.tokenLabelDefault")}),t.jsx(ue,{children:t.jsx(Se,{type:"password",placeholder:j?.token?.placeholder??o("connections.createConnectionDialog.tokenPlaceholderDefault"),className:"ph-no-capture",...m,value:m.value??""})}),j?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[j.token.helperText,j.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:o("connections.createConnectionDialog.openGitHubPatSettings")})]})]}),t.jsx(fe,{})]})})]}),t.jsx(re,{control:r.control,name:"title",render:({field:m})=>t.jsxs(ce,{children:[t.jsx(de,{children:o("connections.createConnectionDialog.nameLabel")}),t.jsx(ue,{children:t.jsx(Se,{placeholder:o("connections.createConnectionDialog.namePlaceholder"),...m})}),t.jsx(fe,{})]})}),t.jsx(re,{control:r.control,name:"description",render:({field:m})=>t.jsxs(ce,{children:[t.jsx(de,{children:o("connections.createConnectionDialog.descriptionLabel")}),t.jsx(ue,{children:t.jsx(hn,{placeholder:o("connections.createConnectionDialog.descriptionPlaceholder"),rows:3,...m,value:m.value??""})}),t.jsx(fe,{})]})})]});return c?t.jsx(kt,{open:n,onOpenChange:S,children:t.jsxs(yt,{className:"max-h-[90vh]",children:[t.jsx(Gs,{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(Nt,{children:N}),t.jsx(Hs,{className:"mt-1",children:C})]}),t.jsx(ss,{asChild:!0,children:t.jsx(je,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(xn,{size:16})})})]})}),t.jsx(Pt,{...r,children:t.jsxs("form",{onSubmit:r.handleSubmit(v),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:w}),t.jsx(ns,{children:t.jsx(je,{type:"submit",disabled:r.formState.isSubmitting,className:"w-full",children:k})})]})})]})}):t.jsx(cs,{open:n,onOpenChange:S,children:t.jsxs(ds,{className:"sm:max-w-[525px]",children:[t.jsxs(us,{children:[t.jsx(fs,{children:N}),t.jsx(cn,{children:C})]}),t.jsx(Pt,{...r,children:t.jsxs("form",{onSubmit:r.handleSubmit(v),children:[t.jsx("div",{className:"py-4",children:w}),t.jsxs(dn,{children:[t.jsx(je,{type:"button",variant:"outline",onClick:()=>S(!1),children:o("connections.createConnectionDialog.cancelButton")}),t.jsx(je,{type:"submit",disabled:r.formState.isSubmitting,className:"min-w-40",children:k})]})]})})]})})}function sl(n){const e=M.c(72),{mode:s,agentId:o,addedConnectionIds:a,onAdd:i,onCloneAndAdd:l,onConnectAndAdd:c,connectingItemId:u,search:d,onCreateConnection:p,onBrowseNavigate:x,defaultTab:r}=n,f=s===void 0?"add":s,g=r===void 0?"connected":r,h=K(),{org:j}=we(),y=Q.useDeferredValue(d),S=d!==y;let v;e[0]!==y?(v=y.trim().toLowerCase(),e[0]=y,e[1]=v):v=e[1];const N=v;let C;e[2]!==g?(C=B=>B??g,e[2]=g,e[3]=C):C=e[3];const[k,w]=ws(Ds.connectionsTab(j.slug)+(g==="all"?":home-modal":":agent-modal"),C);let m;e[4]!==k||e[5]!==w?(m=B=>{B!==k&&Z("connections_dialog_tab_changed",{to_tab:B}),w(B)},e[4]=k,e[5]=w,e[6]=m):m=e[6];const _=m;let D;e[7]!==j.id||e[8]!==j.slug?(D={connectionId:Es,orgId:j.id,orgSlug:j.slug},e[7]=j.id,e[8]=j.slug,e[9]=D):D=e[9];const F=_n(D),I=y?.trim().split(/\s+/).filter(Boolean)??[],b=I.length>0?{operator:"or",conditions:I.flatMap(dl)}:void 0,A={...b&&{where:b},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},T=JSON.stringify(A),{data:z,fetchNextPage:L,hasNextPage:P,isFetchingNextPage:$}=Sn({queryKey:vt.collectionListInfinite(F,j.id,"","CONNECTIONS",T),queryFn:async B=>{const{pageParam:W}=B,ge=W===void 0?0:W;return(await F.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...b&&{where:b},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:ge}})).structuredContent},initialPageParam:0,getNextPageParam:rl,staleTime:3e4}),U=z?.pages.flatMap(al)??[],X=rn(U),Y=new Set(U.filter(il).map(ol)),G=as(),V=rs(G,y),J=$t(V.loadMore,V.hasMore,V.isLoadingMore),O=$t(L,P??!1,$),H=k==="all"||!!N,me=H?V.items.filter(B=>{const W=ln(B);if(W&&Y.has(W))return!1;if(!N)return!0;const ge=et(B._meta),ye=[B.title,B.description,B.name,B.server?.title,B.server?.description,B.server?.name,ge?.friendly_name,ge?.friendlyName].filter(Boolean).join(" ").toLowerCase();return I.some(ae=>ye.includes(ae.toLowerCase()))}):[],te=me.filter(ll),se=me.filter(nl);let le;e[10]!==a?(le=B=>B.some(W=>a.has(W.id)),e[10]=a,e[11]=le):le=e[11];const ie=le;let pe;e[12]!==a||e[13]!==o||e[14]!==u||e[15]!==ie||e[16]!==f||e[17]!==i||e[18]!==x||e[19]!==l||e[20]!==h?(pe=(B,W,ge,ye,ae)=>{const Ye=ie(ae),Oe=ae.find(Ne=>!a.has(Ne.id)),ne=ae[0];if(f==="browse"){const Ne=yn(ne);return t.jsx(ut,{connection:{title:W,icon:ge,description:ae.length>1?`${ae.length} instances`:ye??void 0},fallbackIcon:t.jsx(Ze,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs(Qe,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(He,{size:11})," ",h("virtualMcp.connectionDialogContent.connected")]}),onClick:()=>{Z("connection_browse_clicked",{app_name:ne.app_name??null,connection_id:ne.id,instances_count:ae.length}),x?.(Ne)}},B)}return t.jsx(ut,{connection:{title:W,icon:ge,description:ye},fallbackIcon:t.jsx(Ze,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1.5",children:[Ye&&t.jsxs(Qe,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(He,{size:11})," ",h("virtualMcp.connectionDialogContent.added")]}),t.jsx(je,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:u!==null,onClick:Ne=>{Ne.stopPropagation(),Oe?(Z("connection_add_clicked",{action:"use_existing",app_name:ne.app_name??null,connection_id:Oe.id}),o&&Z("agent_connection_attached",{agent_id:o,connection_id:Oe.id,app_name:ne.app_name??null,mode:"existing"}),i(Oe.id)):(Z("connection_add_clicked",{action:"clone",app_name:ne.app_name??null,base_connection_id:ne.id}),l(ne))},children:h("virtualMcp.connectionDialogContent.add")})]})},B)},e[12]=a,e[13]=o,e[14]=u,e[15]=ie,e[16]=f,e[17]=i,e[18]=x,e[19]=l,e[20]=h,e[21]=pe):pe=e[21];const E=pe;let R;e[22]!==u||e[23]!==f||e[24]!==c||e[25]!==h?(R=B=>{const W=et(B._meta),ge=W?.friendlyName||W?.friendly_name||B.server?.title||B.title||B.server?.name||B.name||B.id||"",ye=B.server?.description||B.description||null,ae=B.server?.icons?.[0]?.src||on(B.server?.repository)||null,Ye=W?.official===!0,Oe=W?.verified===!0,ne=W?.owner==="deco";return t.jsx(ut,{connection:{title:ge,description:ye,icon:ae},fallbackIcon:t.jsx(Ze,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1.5",children:[ne&&t.jsxs(Re,{children:[t.jsx(ze,{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:h("virtualMcp.connectionDialogContent.madeByDeco"),className:"size-3"})})}),t.jsx(Ee,{children:h("virtualMcp.connectionDialogContent.builtByDeco")})]}),!ne&&Ye&&t.jsxs(Re,{children:[t.jsx(ze,{asChild:!0,children:t.jsx(Qe,{variant:"outline",size:"icon",children:t.jsx(ft,{})})}),t.jsx(Ee,{children:h("virtualMcp.connectionDialogContent.builtByOfficial")})]}),!ne&&!Ye&&Oe&&t.jsxs(Re,{children:[t.jsx(ze,{asChild:!0,children:t.jsx(Qe,{variant:"outline",size:"icon",children:t.jsx(ft,{})})}),t.jsx(Ee,{children:h("virtualMcp.connectionDialogContent.verifiedByDeco")})]}),t.jsx(je,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:u!==null,onClick:Ne=>{Ne.stopPropagation(),Z("connection_add_clicked",{action:"connect_new",registry_item_id:B.id,app_name:W?.friendlyName||B.server?.name||B.name||null}),c(B)},children:u===B.id?t.jsx(Ge,{className:"size-3.5"}):h(f==="browse"?"virtualMcp.connectionDialogContent.connect":"virtualMcp.connectionDialogContent.add")})]})},`catalog-${B.id}`)},e[22]=u,e[23]=f,e[24]=c,e[25]=h,e[26]=R):R=e[26];const he=R;let ee;e[27]!==k||e[28]!==_||e[29]!==p||e[30]!==N||e[31]!==h?(ee=!N&&t.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[t.jsx(Nn,{tabs:[{id:"all",label:h("virtualMcp.connectionDialogContent.tabAll")},{id:"connected",label:h("virtualMcp.connectionDialogContent.tabConnected")}],activeTab:k,onTabChange:B=>_(B)}),t.jsxs(je,{variant:"outline",size:"sm",className:"h-7 px-2 text-sm",onClick:()=>{Z("connections_dialog_custom_clicked"),p()},children:[t.jsx(We,{size:12}),h("virtualMcp.connectionDialogContent.customConnection")]})]}),e[27]=k,e[28]=_,e[29]=p,e[30]=N,e[31]=h,e[32]=ee):ee=e[32];const ve=S&&"opacity-50 pointer-events-none";let oe;e[33]!==ve?(oe=q("flex-1 overflow-auto p-5 transition-opacity duration-150",ve),e[33]=ve,e[34]=oe):oe=e[34];const Ae="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4";let Fe;e[35]!==E?(Fe=B=>{if(B.type==="group")return E(B.key,B.title,B.icon,null,B.connections);const W=B.connection;return E(W.id,W.title,W.icon,W.description??null,[W])},e[35]=E,e[36]=Fe):Fe=e[36];const lt=X.map(Fe);let Ie;e[37]!==O?(Ie=t.jsx("div",{ref:O,className:"col-span-full h-1"}),e[37]=O,e[38]=Ie):Ie=e[38];let Te;e[39]!==$?(Te=$&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(Ge,{className:"size-6 text-muted-foreground"})}),e[39]=$,e[40]=Te):Te=e[40];const ot=H&&te.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx(ft,{size:13,className:"text-muted-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:h("virtualMcp.connectionDialogContent.sectionVerified")}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),it=H&&te.map(he),at=H&&se.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:h("virtualMcp.connectionDialogContent.sectionAllConnections")}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),rt=H&&se.map(he);let Be;e[41]!==J||e[42]!==G||e[43]!==H?(Be=H&&G.length>0&&t.jsx("div",{ref:J,className:"col-span-full h-1"}),e[41]=J,e[42]=G,e[43]=H,e[44]=Be):Be=e[44];let Pe;e[45]!==V.isLoadingMore||e[46]!==H?(Pe=H&&V.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(Ge,{className:"size-6 text-muted-foreground"})}),e[45]=V.isLoadingMore,e[46]=H,e[47]=Pe):Pe=e[47];let Le;e[48]!==lt||e[49]!==Ie||e[50]!==Te||e[51]!==ot||e[52]!==it||e[53]!==at||e[54]!==rt||e[55]!==Be||e[56]!==Pe?(Le=t.jsxs("div",{className:Ae,children:[lt,Ie,Te,ot,it,at,rt,Be,Pe]}),e[48]=lt,e[49]=Ie,e[50]=Te,e[51]=ot,e[52]=it,e[53]=at,e[54]=rt,e[55]=Be,e[56]=Pe,e[57]=Le):Le=e[57];let $e;e[58]!==k||e[59]!==X.length||e[60]!==se||e[61]!==d||e[62]!==h||e[63]!==te?($e=X.length===0&&te.length===0&&se.length===0&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:d?h("virtualMcp.connectionDialogContent.emptyStateSearchNoMatch",{search:d}):h(k==="connected"?"virtualMcp.connectionDialogContent.emptyStateNoConnectionsYet":"virtualMcp.connectionDialogContent.emptyStateNoConnectionsAvailable")}),e[58]=k,e[59]=X.length,e[60]=se,e[61]=d,e[62]=h,e[63]=te,e[64]=$e):$e=e[64];let Me;e[65]!==oe||e[66]!==Le||e[67]!==$e?(Me=t.jsxs("div",{className:oe,children:[Le,$e]}),e[65]=oe,e[66]=Le,e[67]=$e,e[68]=Me):Me=e[68];let Xe;return e[69]!==ee||e[70]!==Me?(Xe=t.jsxs(t.Fragment,{children:[ee,Me]}),e[69]=ee,e[70]=Me,e[71]=Xe):Xe=e[71],Xe}function nl(n){return!n.verified&&!et(n._meta)?.verified&&!n.meta?.verified}function ll(n){return n.verified||et(n._meta)?.verified||n.meta?.verified}function ol(n){return n.app_name}function il(n){return n.app_name}function al(n){return n?.items??[]}function rl(n,e){if(n?.hasMore)return e.reduce(cl,0)}function cl(n,e){return n+(e?.items?.length??0)}function dl(n){return[{field:["title"],operator:"contains",value:n},{field:["description"],operator:"contains",value:n}]}function Io({open:n,onOpenChange:e,defaultTab:s,initialSearch:o="",...a}){const i=K(),l=a.mode??"add",c="agentId"in a?a.agentId:void 0,u="addedConnectionIds"in a?a.addedConnectionIds??new Set:new Set,d="onAdd"in a&&a.onAdd?a.onAdd:b=>{},p=(b,A,T)=>{c&&Z("agent_connection_attached",{agent_id:c,connection_id:b,app_name:A,mode:T})},[x,r]=Q.useState(null),[f,g]=Q.useState(o),[h,j]=Q.useState(!1),[y,S]=Q.useState(n);n!==y&&(S(n),n&&g(o));const{org:v}=we(),{data:N}=bt.useSession(),C=ms(),k=As(),w=Xt(),m=b=>{e(!1),w({to:"/$org/settings/connections/$appSlug",params:{org:v.slug,appSlug:b}})},_=()=>{k.invalidateQueries({predicate:b=>{const A=b.queryKey;return A[1]===v.id&&A[3]==="collection"&&A[4]==="CONNECTIONS"}})},D=async(b,A)=>{Z("connection_oauth_succeeded",{connection_id:b,flow:A});const T=new URL(`/api/${v.slug}/mcp/${b}`,window.location.origin);await k.invalidateQueries({queryKey:vt.isMCPAuthenticated(T.href,null)}),_()},F=async b=>{r(b.app_name??b.id);try{const T=`${b.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,L=(await C.create.mutateAsync({title:T,description:b.description??null,connection_type:b.connection_type,connection_url:b.connection_url??null,connection_token:null,icon:b.icon??null,app_name:b.app_name??null,app_id:b.app_id??null,connection_headers:b.connection_headers??null})).id,P=await mt({connectionId:L,orgId:v.id,orgSlug:v.slug,persistFallback:$=>C.update.mutateAsync({id:L,data:{connection_token:$}}).then(()=>{})});if(P.ran&&!P.ok){Z("connection_oauth_failed",{connection_id:L,flow:"clone",error:P.error??"no_token"}),xe.error(i("virtualMcp.addConnectionDialog.authenticationFailedError",{error:P.error??"no token received"})),await C.delete.mutateAsync(L);return}P.ran&&await D(L,"clone"),p(L,b.app_name??null,"clone"),d(L)}catch(A){console.error("Failed to add connection:",A),xe.error(i("virtualMcp.addConnectionDialog.failedToAddConnection"))}finally{r(null)}},I=async b=>{if(!(!v||!N?.user?.id)){r(b.id);try{const A=an(b,v.id,N.user.id,{remoteIndex:0}),T=A.connection_type==="STDIO",z=!!A.connection_url,L=T&&A.connection_headers&&typeof A.connection_headers=="object"&&"command"in A.connection_headers;if(!z&&!L){xe.error(i("virtualMcp.addConnectionDialog.mcpServerConnectionError")),r(null);return}const{id:P}=await C.create.mutateAsync(A),$=await mt({connectionId:P,orgId:v.id,orgSlug:v.slug,persistFallback:U=>C.update.mutateAsync({id:P,data:{connection_token:U}}).then(()=>{})});if($.ran&&!$.ok){Z("connection_oauth_failed",{connection_id:P,flow:"connect_new",error:$.error??"no_token"}),xe.warning(i("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:i("virtualMcp.addConnectionDialog.signInFailedDescription",{error:$.error??"no token received"})}),p(P,A.app_name??null,"new"),d(P);return}$.ran?(await D(P,"connect_new"),xe.success(i("virtualMcp.addConnectionDialog.connectedAuthenticated"))):xe.success(i("virtualMcp.addConnectionDialog.connected")),p(P,A.app_name??null,"new"),d(P)}catch(A){console.error("Failed to connect:",A),xe.error(i("virtualMcp.addConnectionDialog.failedToConnect"))}finally{r(null)}}};return t.jsxs(cs,{open:n,onOpenChange:e,children:[t.jsxs(ds,{className:"sm:max-w-5xl h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[t.jsx(us,{className:"px-6 pt-5 pb-0 shrink-0",children:t.jsx(fs,{className:"text-base font-semibold",children:i(l==="browse"?"virtualMcp.addConnectionDialog.connectionsTitle":"virtualMcp.addConnectionDialog.addConnectionTitle")})}),t.jsx("div",{className:"pt-3 shrink-0",children:t.jsx(sn,{value:f,onChange:g,placeholder:i("virtualMcp.addConnectionDialog.searchConnectionsPlaceholder")})}),t.jsx(Q.Suspense,{fallback:t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Ge,{className:"size-6 text-muted-foreground"})}),children:t.jsx(sl,{mode:l,agentId:c,addedConnectionIds:u,onAdd:d,onCloneAndAdd:F,onConnectAndAdd:I,connectingItemId:x,search:f,onCreateConnection:()=>j(!0),onBrowseNavigate:m,defaultTab:s})})]}),t.jsx(tl,{open:h,onOpenChange:j,onCreated:async b=>{j(!1);const A=await mt({connectionId:b,orgId:v.id,orgSlug:v.slug,persistFallback:T=>C.update.mutateAsync({id:b,data:{connection_token:T}}).then(()=>{})});if(A.ran&&!A.ok){Z("connection_oauth_failed",{connection_id:b,flow:"custom_create",error:A.error??"no_token"}),xe.warning(i("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:i("virtualMcp.addConnectionDialog.signInFailedDescription",{error:A.error??"no token received"})}),p(b,null,"custom"),d(b),e(!1);return}A.ran&&await D(b,"custom_create"),p(b,null,"custom"),d(b),e(!1)}})]})}const Rt=new Map;function To(){const{org:n}=we(),e=Fs(),s=wn(),o=s.find(j=>j.providerId==="deco"),{data:a,isLoading:i,refetch:l,isFetching:c}=Is({queryKey:vt.aiProviderCredits(n.id,"deco"),enabled:!!o,staleTime:6e4,queryFn:async()=>{try{return await e.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),u=a?.balanceCents??null,d=u!=null?u/100:null,p=Q.useRef(new Map);if(u!=null){const j=Rt.get(n.id);p.current.get(n.id)&&j!=null&&u>j&&Z("credits_topped_up_detected",{organization_id:n.id,delta_cents:u-j,previous_balance_cents:j,new_balance_cents:u}),Rt.set(n.id,u),p.current.set(n.id,!0)}const x=!!o,r=u!=null&&u>0,f=u!=null&&u===0,g=u!=null&&u===200,h=s.length>0&&s.every(j=>j.providerId==="deco");return{hasDecoKey:x,decoKeyId:o?.id??null,balanceCents:u,balanceDollars:d,hasCredits:r,isZeroBalance:f,isInitialFreeCredit:g,hasOnlyDecoProvider:h,isLoading:i,isFetching:c,refetch:l}}const ul=4,fl="TASK";function ml(n){return n.replace(/[^a-zA-Z]/g,"").toUpperCase().slice(0,ul)||fl}function pl(n,e,s){const o=s?.trim();return o||(e==null?null:`${ml(n)}-${String(e).padStart(2,"0")}`)}const hl=/^(?:[a-z]{1,8}-)?0*(\d+)$/i;function Vt(n){const e=hl.exec(n.trim())?.[1];return e===void 0?null:Number(e)}function Kt(n){const e=M.c(8),{size:s,className:o}=n,a=s===void 0?16:s;let i;e[0]!==a?(i={width:a,height:a},e[0]=a,e[1]=i):i=e[1];let l;e[2]!==o?(l=q("shrink-0 rounded-full object-cover",o),e[2]=o,e[3]=l):l=e[3];let c;return e[4]!==a||e[5]!==i||e[6]!==l?(c=t.jsx("img",{src:Rs,alt:"Super Agent",width:a,height:a,style:i,className:l}),e[4]=a,e[5]=i,e[6]=l,e[7]=c):c=e[7],c}function Bo(n,e){if(!e)return null;const s=e.toLowerCase();return n.find(o=>{const a=o.bucket.toLowerCase();return o.siteSlug?.toLowerCase()===s||a===s||a===`deco-assets-${s}`})??null}const Gt={active:0,future:1,closed:2};function Ht(n){if(!n.startsAt)return null;const e=Date.parse(n.startsAt);return Number.isNaN(e)?null:e}function gl(n,e){const s=Gt[n.state]-Gt[e.state];if(s!==0)return s;const o=Ht(n),a=Ht(e);if(o===null||a===null){if(o!==a)return o===null?1:-1}else if(o!==a)return n.state==="closed"?a-o:o-a;return n.name.localeCompare(e.name)||n.id.localeCompare(e.id)}function Bt(n){return n.filter(s=>s.state==="active").sort(gl)[0]?.id??null}const xt="__unassigned__",jt="__no_repo__",tt="backlog",gs="all",be="__any__",xs={assignee:null,priority:null,due:null,tags:[],repo:null,sprint:null,search:""};function Po(n,e){return n===gs?null:n===tt||n!==null&&e.some(s=>s.id===n)?n:Bt(e)}function js(n,e){return n.sprint!==null&&n.sprint!==e}function xl(n,e){return n.assignee!==null||n.priority!==null||n.due!==null||n.tags.length>0||n.repo!==null||js(n,e)||n.search.trim()!==""}function jl(n,e){return(n.assignee!==null?1:0)+(n.priority!==null?1:0)+(n.due!==null?1:0)+(n.tags.length>0?1:0)+(n.repo!==null?1:0)+(js(n,e)?1:0)+(n.search.trim()!==""?1:0)}const bl=864e5;function vl(n,e){const s=new Date(n),o=new Date(e);return s.getFullYear()===o.getFullYear()&&s.getMonth()===o.getMonth()&&s.getDate()===o.getDate()}const Cl=/^0*(\d+)$/;function bs(n,e,s){const o=n.trim();if(o==="")return!1;const a=s?.trim();if(a){if(o.toLowerCase()===a.toLowerCase())return!0;const i=Cl.exec(o)?.[1];return i!==void 0&&Number(i)===Vt(a)}return e!=null&&Vt(o)===e}function kl(n,e){return n.assigneeId===e?!0:n.assigneeId===gt&&n.assignedBy===e}function Lo(n,e){const s=e.search.trim().toLowerCase();if(s!==""&&!`${n.title} ${n.description??""}`.toLowerCase().includes(s)&&!bs(s,n.keySeq,n.jiraIssueKey))return!1;if(e.assignee!==null){if(e.assignee===xt){if(n.assigneeId!==null)return!1}else if(!kl(n,e.assignee))return!1}if(e.priority!==null&&n.priority!==e.priority)return!1;if(e.due!==null)if(e.due==="none"){if(n.dueDate)return!1}else{if(!n.dueDate)return!1;const o=new Date(n.dueDate).getTime(),a=Date.now();if(e.due==="overdue"&&o>=a||e.due==="today"&&!vl(o,a)||e.due==="week"&&(o<a||o>a+7*bl))return!1}if(e.tags.length>0){const o=n.tags.map(a=>a.id);if(!e.tags.some(a=>o.includes(a)))return!1}if(e.repo!==null){if(e.repo===jt){if(n.repo!=null)return!1}else if(n.repo?.toLowerCase()!==e.repo.toLowerCase())return!1}if(e.sprint!==null){if(e.sprint===tt){if(n.sprintId!=null)return!1}else if(n.sprintId!==e.sprint)return!1}return!0}const Ut={overdue:"taskBoard.taskFilters.dueDateFilterOverdue",today:"taskBoard.taskFilters.dueDateFilterDueToday",week:"taskBoard.taskFilters.dueDateFilterDueThisWeek",none:"taskBoard.taskFilters.dueDateFilterNoDueDate"};function ke(n,e=!1){return q("inline-flex h-8 items-center gap-1.5 rounded-lg border px-2.5 text-xs font-medium outline-none transition-colors focus-visible:border-ring focus-visible:ring-[2px] focus-visible:ring-ring/20",e&&"h-10 w-full justify-start px-3 text-sm",n?"border-transparent bg-accent text-foreground":"border-border text-muted-foreground hover:bg-muted/60 hover:text-foreground")}function yl(n){const e=M.c(107),{value:s,members:o,onChange:a,block:i}=n,l=K(),[c,u]=Q.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Ot,{size:14,className:"shrink-0"}),e[0]=d):d=e[0];let p=d,x;e[1]!==l?(x=l("taskBoard.taskFilters.assigneeLabel"),e[1]=l,e[2]=x):x=e[2];let r=x;if(s===xt){let E;e[3]!==l?(E=l("taskBoard.taskFilters.assigneeUnassigned"),e[3]=l,e[4]=E):E=e[4],r=E}else if(s===gt){let E;e[5]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(Kt,{size:14}),e[5]=E):E=e[5],p=E;let R;e[6]!==l?(R=l("taskBoard.taskFilters.assigneeSuperAgent"),e[6]=l,e[7]=R):R=e[7],r=R}else if(s){let E,R,he,ee;if(e[8]!==o||e[9]!==s){let Ae;e[14]!==s?(Ae=Fe=>Fe.userId===s,e[14]=s,e[15]=Ae):Ae=e[15],R=o.find(Ae),E=Mt,he=R?.user?.image??void 0,ee=zt(R?.user?.name),e[8]=o,e[9]=s,e[10]=E,e[11]=R,e[12]=he,e[13]=ee}else E=e[10],R=e[11],he=e[12],ee=e[13];let ve;e[16]!==E||e[17]!==he||e[18]!==ee?(ve=t.jsx(E,{url:he,fallback:ee,shape:"circle",size:"2xs"}),e[16]=E,e[17]=he,e[18]=ee,e[19]=ve):ve=e[19],p=ve;let oe;e[20]!==R?.user?.name||e[21]!==l?(oe=R?.user?.name??l("taskBoard.taskFilters.assigneeMember"),e[20]=R?.user?.name,e[21]=l,e[22]=oe):oe=e[22],r=oe}let f;e[23]!==a?(f=E=>{a(E),u(!1)},e[23]=a,e[24]=f):f=e[24];const g=f,h=s!==null;let j;e[25]!==i||e[26]!==h?(j=ke(h,i),e[25]=i,e[26]=h,e[27]=j):j=e[27];const y=j,S=i&&"ml-auto";let v;e[28]!==S?(v=q("shrink-0 opacity-60",S),e[28]=S,e[29]=v):v=e[29];const N=v;let C;e[30]!==r?(C=t.jsx("span",{className:"max-w-[10rem] truncate",children:r}),e[30]=r,e[31]=C):C=e[31];let k;e[32]!==N?(k=t.jsx(De,{size:12,className:N}),e[32]=N,e[33]=k):k=e[33];let w;e[34]!==p||e[35]!==C||e[36]!==k||e[37]!==y?(w=t.jsx(Ve,{asChild:!0,children:t.jsxs("button",{type:"button",className:y,children:[p,C,k]})}),e[34]=p,e[35]=C,e[36]=k,e[37]=y,e[38]=w):w=e[38];let m;e[39]!==l?(m=l("taskBoard.taskFilters.assigneeFilterPlaceholder"),e[39]=l,e[40]=m):m=e[40];let _;e[41]!==l?(_=l("taskBoard.taskFilters.assigneeFilterPlaceholder"),e[41]=l,e[42]=_):_=e[42];let D;e[43]!==m||e[44]!==_?(D=t.jsx(At,{placeholder:m,"aria-label":_,className:"h-9"}),e[43]=m,e[44]=_,e[45]=D):D=e[45];let F;e[46]!==l?(F=l("taskBoard.taskFilters.assigneeNoMembersFound"),e[46]=l,e[47]=F):F=e[47];let I;e[48]!==F?(I=t.jsx(Ft,{children:F}),e[48]=F,e[49]=I):I=e[49];let b;e[50]!==l?(b=l("taskBoard.taskFilters.assigneeAnyone"),e[50]=l,e[51]=b):b=e[51];let A;e[52]!==g?(A=()=>g(null),e[52]=g,e[53]=A):A=e[53];let T;e[54]!==l?(T=l("taskBoard.taskFilters.assigneeAnyone"),e[54]=l,e[55]=T):T=e[55];let z;e[56]!==b||e[57]!==A||e[58]!==T?(z=t.jsx(Ce,{value:b,onSelect:A,children:T}),e[56]=b,e[57]=A,e[58]=T,e[59]=z):z=e[59];let L;e[60]!==l?(L=l("taskBoard.taskFilters.assigneeUnassigned"),e[60]=l,e[61]=L):L=e[61];let P;e[62]!==g?(P=()=>g(xt),e[62]=g,e[63]=P):P=e[63];let $;e[64]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(Ot,{size:16,className:"text-muted-foreground"}),e[64]=$):$=e[64];let U;e[65]!==l?(U=l("taskBoard.taskFilters.assigneeUnassigned"),e[65]=l,e[66]=U):U=e[66];let X;e[67]!==L||e[68]!==P||e[69]!==U?(X=t.jsxs(Ce,{value:L,onSelect:P,className:"gap-2",children:[$,U]}),e[67]=L,e[68]=P,e[69]=U,e[70]=X):X=e[70];let Y;e[71]!==l?(Y=l("taskBoard.taskFilters.assigneeSuperAgent"),e[71]=l,e[72]=Y):Y=e[72];let G;e[73]!==g?(G=()=>g(gt),e[73]=g,e[74]=G):G=e[74];let V;e[75]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(Kt,{size:16}),e[75]=V):V=e[75];let J;e[76]!==l?(J=l("taskBoard.taskFilters.assigneeSuperAgent"),e[76]=l,e[77]=J):J=e[77];let O;e[78]!==Y||e[79]!==G||e[80]!==J?(O=t.jsxs(Ce,{value:Y,onSelect:G,className:"gap-2",children:[V,J]}),e[78]=Y,e[79]=G,e[80]=J,e[81]=O):O=e[81];let H;e[82]!==z||e[83]!==X||e[84]!==O?(H=t.jsxs(Ue,{children:[z,X,O]}),e[82]=z,e[83]=X,e[84]=O,e[85]=H):H=e[85];let me;e[86]!==l?(me=l("taskBoard.taskFilters.assigneeGroupMembers"),e[86]=l,e[87]=me):me=e[87];let te;if(e[88]!==o||e[89]!==g){let E;e[91]!==g?(E=R=>t.jsxs(Ce,{value:R.user?.name??R.userId,onSelect:()=>g(R.userId),className:"gap-2",children:[t.jsx(Mt,{url:R.user?.image??void 0,fallback:zt(R.user?.name),shape:"circle",size:"2xs"}),t.jsx("span",{className:"truncate",children:R.user?.name??R.userId})]},R.userId),e[91]=g,e[92]=E):E=e[92],te=o.map(E),e[88]=o,e[89]=g,e[90]=te}else te=e[90];let se;e[93]!==me||e[94]!==te?(se=t.jsx(Ue,{heading:me,children:te}),e[93]=me,e[94]=te,e[95]=se):se=e[95];let le;e[96]!==I||e[97]!==H||e[98]!==se?(le=t.jsxs(It,{children:[I,H,se]}),e[96]=I,e[97]=H,e[98]=se,e[99]=le):le=e[99];let ie;e[100]!==D||e[101]!==le?(ie=t.jsx(nt,{align:"start",className:"w-56 p-0",children:t.jsxs(Tt,{children:[D,le]})}),e[100]=D,e[101]=le,e[102]=ie):ie=e[102];let pe;return e[103]!==c||e[104]!==w||e[105]!==ie?(pe=t.jsxs(st,{open:c,onOpenChange:u,children:[w,ie]}),e[103]=c,e[104]=w,e[105]=ie,e[106]=pe):pe=e[106],pe}function Nl(n){const e=M.c(33),{value:s,onChange:o,block:a}=n,i=K(),l=s!==null;let c;e[0]!==a||e[1]!==l?(c=ke(l,a),e[0]=a,e[1]=l,e[2]=c):c=e[2];const u=c,d=a&&"ml-auto";let p;e[3]!==d?(p=q("shrink-0 opacity-60",d),e[3]=d,e[4]=p):p=e[4];const x=p;let r;e[5]!==s?(r=s?t.jsx("span",{className:q("size-2 shrink-0 rounded-full",Je[s].dotClassName)}):t.jsx(Dn,{size:14,className:"shrink-0"}),e[5]=s,e[6]=r):r=e[6];let f;e[7]!==i||e[8]!==s?(f=i(s?Je[s].labelKey:"taskBoard.taskFilters.priorityLabel"),e[7]=i,e[8]=s,e[9]=f):f=e[9];let g;e[10]!==x?(g=t.jsx(De,{size:12,className:x}),e[10]=x,e[11]=g):g=e[11];let h;e[12]!==r||e[13]!==f||e[14]!==g||e[15]!==u?(h=t.jsx(St,{asChild:!0,children:t.jsxs("button",{type:"button",className:u,children:[r,f,g]})}),e[12]=r,e[13]=f,e[14]=g,e[15]=u,e[16]=h):h=e[16];const j=s??be;let y;e[17]!==o?(y=w=>o(w===be?null:w),e[17]=o,e[18]=y):y=e[18];let S;e[19]!==i?(S=i("taskBoard.taskFilters.priorityAnyPriority"),e[19]=i,e[20]=S):S=e[20];let v;e[21]!==S?(v=t.jsx(_e,{value:be,children:S}),e[21]=S,e[22]=v):v=e[22];let N;e[23]!==i?(N=Fn.map(w=>t.jsxs(_e,{value:w,className:"gap-2",children:[t.jsx("span",{className:q("size-2 rounded-full",Je[w].dotClassName)}),i(Je[w].labelKey)]},w)),e[23]=i,e[24]=N):N=e[24];let C;e[25]!==y||e[26]!==v||e[27]!==N||e[28]!==j?(C=t.jsx(_t,{align:"start",className:"w-40",children:t.jsxs(wt,{value:j,onValueChange:y,children:[v,N]})}),e[25]=y,e[26]=v,e[27]=N,e[28]=j,e[29]=C):C=e[29];let k;return e[30]!==C||e[31]!==h?(k=t.jsxs(Dt,{children:[h,C]}),e[30]=C,e[31]=h,e[32]=k):k=e[32],k}function Sl(n){const e=M.c(35),{value:s,onChange:o,block:a}=n,i=K();let l;e[0]!==i||e[1]!==s?(l=s?i(Ut[s]):void 0,e[0]=i,e[1]=s,e[2]=l):l=e[2];const c=l,u=s!==null;let d;e[3]!==a||e[4]!==u?(d=ke(u,a),e[3]=a,e[4]=u,e[5]=d):d=e[5];const p=d,x=a&&"ml-auto";let r;e[6]!==x?(r=q("shrink-0 opacity-60",x),e[6]=x,e[7]=r):r=e[7];const f=r;let g;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(dt,{size:14,className:"shrink-0"}),e[8]=g):g=e[8];let h;e[9]!==c||e[10]!==i?(h=c??i("taskBoard.taskFilters.dueDateLabel"),e[9]=c,e[10]=i,e[11]=h):h=e[11];let j;e[12]!==f?(j=t.jsx(De,{size:12,className:f}),e[12]=f,e[13]=j):j=e[13];let y;e[14]!==h||e[15]!==j||e[16]!==p?(y=t.jsx(St,{asChild:!0,children:t.jsxs("button",{type:"button",className:p,children:[g,h,j]})}),e[14]=h,e[15]=j,e[16]=p,e[17]=y):y=e[17];const S=s??be;let v;e[18]!==o?(v=D=>o(D===be?null:D),e[18]=o,e[19]=v):v=e[19];let N;e[20]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(dt,{size:16,className:"text-muted-foreground"}),e[20]=N):N=e[20];let C;e[21]!==i?(C=i("taskBoard.taskFilters.dueDateAnyTime"),e[21]=i,e[22]=C):C=e[22];let k;e[23]!==C?(k=t.jsxs(_e,{value:be,className:"gap-2",children:[N,C]}),e[23]=C,e[24]=k):k=e[24];let w;e[25]!==i?(w=Object.entries(Ut).map(D=>{const[F,I]=D,b=F==="overdue";return t.jsxs(_e,{value:F,className:q("gap-2",b&&"text-destructive"),children:[t.jsx(dt,{size:16,className:q("shrink-0",b?"text-destructive":"text-muted-foreground")}),i(I)]},F)}),e[25]=i,e[26]=w):w=e[26];let m;e[27]!==S||e[28]!==v||e[29]!==k||e[30]!==w?(m=t.jsx(_t,{align:"start",className:"w-44",children:t.jsxs(wt,{value:S,onValueChange:v,children:[k,w]})}),e[27]=S,e[28]=v,e[29]=k,e[30]=w,e[31]=m):m=e[31];let _;return e[32]!==m||e[33]!==y?(_=t.jsxs(Dt,{children:[y,m]}),e[32]=m,e[33]=y,e[34]=_):_=e[34],_}function _l(n){const e=M.c(56),{value:s,tags:o,onChange:a,block:i}=n,l=K(),[c,u]=Q.useState(!1);let d;e[0]!==a||e[1]!==s?(d=L=>a(s.includes(L)?s.filter(P=>P!==L):[...s,L]),e[0]=a,e[1]=s,e[2]=d):d=e[2];const p=d;let x;e[3]!==l||e[4]!==o||e[5]!==s[0]||e[6]!==s.length?(x=s.length===0?l("taskBoard.taskFilters.tagsLabel"):s.length===1?o.find(L=>L.id===s[0])?.name??l("taskBoard.taskFilters.tagsLabel"):l("taskBoard.taskFilters.tagsSelectedCount",{count:s.length}),e[3]=l,e[4]=o,e[5]=s[0],e[6]=s.length,e[7]=x):x=e[7];const r=x,f=s.length>0;let g;e[8]!==i||e[9]!==f?(g=ke(f,i),e[8]=i,e[9]=f,e[10]=g):g=e[10];const h=g,j=i&&"ml-auto";let y;e[11]!==j?(y=q("shrink-0 opacity-60",j),e[11]=j,e[12]=y):y=e[12];const S=y;let v;e[13]!==o||e[14]!==s[0]||e[15]!==s.length?(v=s.length===1?t.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:Et(o.find(L=>L.id===s[0])?.color)}}):t.jsx(Ls,{size:14,className:"shrink-0"}),e[13]=o,e[14]=s[0],e[15]=s.length,e[16]=v):v=e[16];let N;e[17]!==r?(N=t.jsx("span",{className:"max-w-[10rem] truncate",children:r}),e[17]=r,e[18]=N):N=e[18];let C;e[19]!==S?(C=t.jsx(De,{size:12,className:S}),e[19]=S,e[20]=C):C=e[20];let k;e[21]!==v||e[22]!==N||e[23]!==C||e[24]!==h?(k=t.jsx(Ve,{asChild:!0,children:t.jsxs("button",{type:"button",className:h,children:[v,N,C]})}),e[21]=v,e[22]=N,e[23]=C,e[24]=h,e[25]=k):k=e[25];let w;e[26]!==l?(w=l("taskBoard.taskFilters.tagsFilterPlaceholder"),e[26]=l,e[27]=w):w=e[27];let m;e[28]!==l?(m=l("taskBoard.taskFilters.tagsFilterPlaceholder"),e[28]=l,e[29]=m):m=e[29];let _;e[30]!==w||e[31]!==m?(_=t.jsx(At,{placeholder:w,"aria-label":m,className:"h-9"}),e[30]=w,e[31]=m,e[32]=_):_=e[32];let D;e[33]!==l?(D=l("taskBoard.taskFilters.tagsNoTagsFound"),e[33]=l,e[34]=D):D=e[34];let F;e[35]!==D?(F=t.jsx(Ft,{children:D}),e[35]=D,e[36]=F):F=e[36];let I;if(e[37]!==o||e[38]!==p||e[39]!==s){let L;e[41]!==p||e[42]!==s?(L=P=>t.jsxs(Ce,{value:P.name,onSelect:()=>p(P.id),className:"gap-2",children:[t.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:Et(P.color)}}),t.jsx("span",{className:"flex-1 truncate",children:P.name}),s.includes(P.id)&&t.jsx(He,{size:14,className:"shrink-0 text-foreground"})]},P.id),e[41]=p,e[42]=s,e[43]=L):L=e[43],I=o.map(L),e[37]=o,e[38]=p,e[39]=s,e[40]=I}else I=e[40];let b;e[44]!==I?(b=t.jsx(Ue,{children:I}),e[44]=I,e[45]=b):b=e[45];let A;e[46]!==F||e[47]!==b?(A=t.jsxs(It,{children:[F,b]}),e[46]=F,e[47]=b,e[48]=A):A=e[48];let T;e[49]!==_||e[50]!==A?(T=t.jsx(nt,{align:"start",className:"w-56 p-0",children:t.jsxs(Tt,{children:[_,A]})}),e[49]=_,e[50]=A,e[51]=T):T=e[51];let z;return e[52]!==c||e[53]!==k||e[54]!==T?(z=t.jsxs(st,{open:c,onOpenChange:u,children:[k,T]}),e[52]=c,e[53]=k,e[54]=T,e[55]=z):z=e[55],z}function wl(n){const e=M.c(73),{value:s,repos:o,onChange:a,block:i}=n,l=K(),[c,u]=Q.useState(!1);let d;e[0]!==l||e[1]!==s?(d=s===null?l("taskBoard.taskFilters.repoLabel"):s===jt?l("taskBoard.taskFilters.repoNoRepo"):s,e[0]=l,e[1]=s,e[2]=d):d=e[2];const p=d;let x;e[3]!==a?(x=O=>{a(O),u(!1)},e[3]=a,e[4]=x):x=e[4];const r=x,f=s!==null;let g;e[5]!==i||e[6]!==f?(g=ke(f,i),e[5]=i,e[6]=f,e[7]=g):g=e[7];const h=g,j=i&&"ml-auto";let y;e[8]!==j?(y=q("shrink-0 opacity-60",j),e[8]=j,e[9]=y):y=e[9];const S=y;let v;e[10]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(ht,{className:"size-3.5 shrink-0"}),e[10]=v):v=e[10];let N;e[11]!==p?(N=t.jsx("span",{className:"max-w-[12rem] truncate",children:p}),e[11]=p,e[12]=N):N=e[12];let C;e[13]!==S?(C=t.jsx(De,{size:12,className:S}),e[13]=S,e[14]=C):C=e[14];let k;e[15]!==N||e[16]!==C||e[17]!==h?(k=t.jsx(Ve,{asChild:!0,children:t.jsxs("button",{type:"button",className:h,children:[v,N,C]})}),e[15]=N,e[16]=C,e[17]=h,e[18]=k):k=e[18];let w;e[19]!==l?(w=l("taskBoard.taskFilters.repoFilterPlaceholder"),e[19]=l,e[20]=w):w=e[20];let m;e[21]!==l?(m=l("taskBoard.taskFilters.repoFilterPlaceholder"),e[21]=l,e[22]=m):m=e[22];let _;e[23]!==w||e[24]!==m?(_=t.jsx(At,{placeholder:w,"aria-label":m,className:"h-9"}),e[23]=w,e[24]=m,e[25]=_):_=e[25];let D;e[26]!==l?(D=l("taskBoard.taskFilters.repoNoReposFound"),e[26]=l,e[27]=D):D=e[27];let F;e[28]!==D?(F=t.jsx(Ft,{children:D}),e[28]=D,e[29]=F):F=e[29];let I;e[30]!==l?(I=l("taskBoard.taskFilters.repoAnyRepo"),e[30]=l,e[31]=I):I=e[31];let b;e[32]!==r?(b=()=>r(null),e[32]=r,e[33]=b):b=e[33];let A;e[34]!==l?(A=l("taskBoard.taskFilters.repoAnyRepo"),e[34]=l,e[35]=A):A=e[35];let T;e[36]!==I||e[37]!==b||e[38]!==A?(T=t.jsx(Ce,{value:I,onSelect:b,children:A}),e[36]=I,e[37]=b,e[38]=A,e[39]=T):T=e[39];let z;e[40]!==l?(z=l("taskBoard.taskFilters.repoNoRepo"),e[40]=l,e[41]=z):z=e[41];let L;e[42]!==r?(L=()=>r(jt),e[42]=r,e[43]=L):L=e[43];let P;e[44]!==l?(P=l("taskBoard.taskFilters.repoNoRepo"),e[44]=l,e[45]=P):P=e[45];let $;e[46]!==z||e[47]!==L||e[48]!==P?($=t.jsx(Ce,{value:z,onSelect:L,children:P}),e[46]=z,e[47]=L,e[48]=P,e[49]=$):$=e[49];let U;e[50]!==T||e[51]!==$?(U=t.jsxs(Ue,{children:[T,$]}),e[50]=T,e[51]=$,e[52]=U):U=e[52];let X;if(e[53]!==o||e[54]!==r||e[55]!==s){let O;e[57]!==r||e[58]!==s?(O=H=>t.jsxs(Ce,{value:H,onSelect:()=>r(H),className:"gap-2",children:[t.jsx(ht,{className:"size-4 shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:H}),s===H&&t.jsx(He,{size:14,className:"shrink-0 text-foreground"})]},H),e[57]=r,e[58]=s,e[59]=O):O=e[59],X=o.map(O),e[53]=o,e[54]=r,e[55]=s,e[56]=X}else X=e[56];let Y;e[60]!==X?(Y=t.jsx(Ue,{children:X}),e[60]=X,e[61]=Y):Y=e[61];let G;e[62]!==F||e[63]!==U||e[64]!==Y?(G=t.jsxs(It,{children:[F,U,Y]}),e[62]=F,e[63]=U,e[64]=Y,e[65]=G):G=e[65];let V;e[66]!==_||e[67]!==G?(V=t.jsx(nt,{align:"start",className:"w-64 p-0",children:t.jsxs(Tt,{children:[_,G]})}),e[66]=_,e[67]=G,e[68]=V):V=e[68];let J;return e[69]!==c||e[70]!==k||e[71]!==V?(J=t.jsxs(st,{open:c,onOpenChange:u,children:[k,V]}),e[69]=c,e[70]=k,e[71]=V,e[72]=J):J=e[72],J}function Dl(n){const e=M.c(45),{value:s,sprints:o,onChange:a,block:i}=n,l=K();let c;if(e[0]!==o||e[1]!==s){let b;e[3]!==s?(b=A=>A.id===s,e[3]=s,e[4]=b):b=e[4],c=o.find(b),e[0]=o,e[1]=s,e[2]=c}else c=e[2];const u=c;let d;e[5]!==u?.name||e[6]!==l||e[7]!==s?(d=s===null?l("taskBoard.taskFilters.sprintLabel"):s===tt?l("taskBoard.taskFilters.sprintBacklog"):u?.name??l("taskBoard.taskFilters.sprintLabel"),e[5]=u?.name,e[6]=l,e[7]=s,e[8]=d):d=e[8];const p=d,x=s!==null;let r;e[9]!==i||e[10]!==x?(r=ke(x,i),e[9]=i,e[10]=x,e[11]=r):r=e[11];const f=r,g=i&&"ml-auto";let h;e[12]!==g?(h=q("shrink-0 opacity-60",g),e[12]=g,e[13]=h):h=e[13];const j=h;let y;e[14]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx($s,{size:14,className:"shrink-0"}),e[14]=y):y=e[14];let S;e[15]!==j?(S=t.jsx(De,{size:12,className:j}),e[15]=j,e[16]=S):S=e[16];let v;e[17]!==p||e[18]!==S||e[19]!==f?(v=t.jsx(St,{asChild:!0,children:t.jsxs("button",{type:"button",className:f,children:[y,p,S]})}),e[17]=p,e[18]=S,e[19]=f,e[20]=v):v=e[20];const N=s===null?be:s;let C;e[21]!==a?(C=b=>a(b===be?gs:b),e[21]=a,e[22]=C):C=e[22];let k;e[23]!==l?(k=l("taskBoard.taskFilters.sprintAnySprint"),e[23]=l,e[24]=k):k=e[24];let w;e[25]!==k?(w=t.jsx(_e,{value:be,children:k}),e[25]=k,e[26]=w):w=e[26];let m;e[27]!==l?(m=l("taskBoard.taskFilters.sprintBacklog"),e[27]=l,e[28]=m):m=e[28];let _;e[29]!==m?(_=t.jsx(_e,{value:tt,children:m}),e[29]=m,e[30]=_):_=e[30];let D;if(e[31]!==o||e[32]!==l){let b;e[34]!==l?(b=A=>t.jsxs(_e,{value:A.id,children:[t.jsx("span",{className:"truncate",children:A.name}),t.jsx("span",{className:"ml-auto shrink-0 text-muted-foreground",children:A.state==="active"?l("taskBoard.taskFilters.sprintCurrent"):In(A)})]},A.id),e[34]=l,e[35]=b):b=e[35],D=o.map(b),e[31]=o,e[32]=l,e[33]=D}else D=e[33];let F;e[36]!==N||e[37]!==C||e[38]!==w||e[39]!==_||e[40]!==D?(F=t.jsx(_t,{align:"start",className:"max-h-80 w-72 overflow-y-auto",children:t.jsxs(wt,{value:N,onValueChange:C,children:[w,_,D]})}),e[36]=N,e[37]=C,e[38]=w,e[39]=_,e[40]=D,e[41]=F):F=e[41];let I;return e[42]!==F||e[43]!==v?(I=t.jsxs(Dt,{children:[v,F]}),e[42]=F,e[43]=v,e[44]=I):I=e[44],I}function Al(n){const e=M.c(25),{value:s,onChange:o,block:a}=n,i=K(),[l,c]=Q.useState(s!==""),[u,d]=Q.useState(!1),[p,x]=Q.useState(s);s!==p&&(x(s),s===""&&!u&&c(!1));const r=l||a,f=r?"w-32 sm:w-44":"w-8 px-0 justify-center",g=a&&"h-10 w-full px-3 text-sm sm:w-full";let h;e[0]!==f||e[1]!==g?(h=q("inline-flex h-8 shrink-0 items-center gap-1.5 overflow-hidden rounded-lg border border-border px-2.5 text-xs text-foreground transition-all duration-200 ease-out",f,g),e[0]=f,e[1]=g,e[2]=h):h=e[2];let j;e[3]!==i?(j=i("taskBoard.taskFilters.searchLabel"),e[3]=i,e[4]=j):j=e[4];let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=()=>c(!0),e[5]=y):y=e[5];let S;e[6]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(Ms,{size:14}),e[6]=S):S=e[6];let v;e[7]!==j?(v=t.jsx("button",{type:"button","aria-label":j,onClick:y,className:"shrink-0 text-muted-foreground transition-colors hover:text-foreground",children:S}),e[7]=j,e[8]=v):v=e[8];let N;e[9]!==a||e[10]!==r||e[11]!==o||e[12]!==i||e[13]!==s?(N=r&&t.jsx("input",{autoFocus:!a,value:s,onChange:w=>o(w.target.value),onFocus:()=>d(!0),onBlur:()=>{d(!1),s===""&&c(!1)},placeholder:i("taskBoard.taskFilters.searchPlaceholder"),"aria-label":i("taskBoard.taskFilters.searchPlaceholder"),className:"w-full min-w-0 bg-transparent text-xs outline-none placeholder:text-muted-foreground"}),e[9]=a,e[10]=r,e[11]=o,e[12]=i,e[13]=s,e[14]=N):N=e[14];let C;e[15]!==a||e[16]!==o||e[17]!==i||e[18]!==s?(C=s!==""&&t.jsx("button",{type:"button","aria-label":i("taskBoard.taskFilters.searchClearLabel"),onMouseDown:Fl,onClick:()=>{o(""),a||c(!1)},className:"shrink-0 text-muted-foreground hover:text-foreground",children:t.jsx(Ts,{size:14})}),e[15]=a,e[16]=o,e[17]=i,e[18]=s,e[19]=C):C=e[19];let k;return e[20]!==h||e[21]!==v||e[22]!==N||e[23]!==C?(k=t.jsxs("div",{className:h,children:[v,N,C]}),e[20]=h,e[21]=v,e[22]=N,e[23]=C,e[24]=k):k=e[24],k}function Fl(n){return n.preventDefault()}function Il(n){const e=M.c(20),{block:s,onClick:o}=n,a=K();let i;e[0]!==a?(i=a("taskBoard.taskFilters.boardSettingsLabel"),e[0]=a,e[1]=i):i=e[1];const l=i;let c;e[2]!==s?(c=q(ke(!1,s),s?"h-10 w-full":"w-8 justify-center px-0"),e[2]=s,e[3]=c):c=e[3];let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(An,{size:14,className:"shrink-0"}),e[4]=u):u=e[4];let d;e[5]!==s||e[6]!==l?(d=s&&t.jsx("span",{children:l}),e[5]=s,e[6]=l,e[7]=d):d=e[7];let p;e[8]!==l||e[9]!==o||e[10]!==c||e[11]!==d?(p=t.jsxs("button",{type:"button",onClick:o,"aria-label":l,className:c,children:[u,d]}),e[8]=l,e[9]=o,e[10]=c,e[11]=d,e[12]=p):p=e[12];const x=p;if(s)return x;let r;e[13]!==x?(r=t.jsx(ze,{asChild:!0,children:x}),e[13]=x,e[14]=r):r=e[14];let f;e[15]!==l?(f=t.jsx(Ee,{side:"top",children:l}),e[15]=l,e[16]=f):f=e[16];let g;return e[17]!==r||e[18]!==f?(g=t.jsxs(Re,{children:[r,f]}),e[17]=r,e[18]=f,e[19]=g):g=e[19],g}function vs(n){const e=M.c(59),{filters:s,members:o,tags:a,repos:i,sprints:l,onChange:c,onOpenBoardSettings:u,block:d}=n;let p;e[0]!==s||e[1]!==c?(p=m=>c({...s,search:m}),e[0]=s,e[1]=c,e[2]=p):p=e[2];let x;e[3]!==d||e[4]!==s.search||e[5]!==p?(x=t.jsx(Al,{block:d,value:s.search,onChange:p}),e[3]=d,e[4]=s.search,e[5]=p,e[6]=x):x=e[6];let r;e[7]!==s||e[8]!==c?(r=m=>c({...s,assignee:m}),e[7]=s,e[8]=c,e[9]=r):r=e[9];let f;e[10]!==d||e[11]!==s.assignee||e[12]!==o||e[13]!==r?(f=t.jsx(yl,{block:d,value:s.assignee,members:o,onChange:r}),e[10]=d,e[11]=s.assignee,e[12]=o,e[13]=r,e[14]=f):f=e[14];let g;e[15]!==s||e[16]!==c?(g=m=>c({...s,priority:m}),e[15]=s,e[16]=c,e[17]=g):g=e[17];let h;e[18]!==d||e[19]!==s.priority||e[20]!==g?(h=t.jsx(Nl,{block:d,value:s.priority,onChange:g}),e[18]=d,e[19]=s.priority,e[20]=g,e[21]=h):h=e[21];let j;e[22]!==s||e[23]!==c?(j=m=>c({...s,due:m}),e[22]=s,e[23]=c,e[24]=j):j=e[24];let y;e[25]!==d||e[26]!==s.due||e[27]!==j?(y=t.jsx(Sl,{block:d,value:s.due,onChange:j}),e[25]=d,e[26]=s.due,e[27]=j,e[28]=y):y=e[28];let S;e[29]!==s||e[30]!==c?(S=m=>c({...s,tags:m}),e[29]=s,e[30]=c,e[31]=S):S=e[31];let v;e[32]!==d||e[33]!==s.tags||e[34]!==S||e[35]!==a?(v=t.jsx(_l,{block:d,value:s.tags,tags:a,onChange:S}),e[32]=d,e[33]=s.tags,e[34]=S,e[35]=a,e[36]=v):v=e[36];let N;e[37]!==d||e[38]!==s||e[39]!==c||e[40]!==i?(N=(i.length>0||s.repo!==null)&&t.jsx(wl,{block:d,value:s.repo,repos:i,onChange:m=>c({...s,repo:m})}),e[37]=d,e[38]=s,e[39]=c,e[40]=i,e[41]=N):N=e[41];let C;e[42]!==d||e[43]!==s||e[44]!==c||e[45]!==l?(C=(l.length>0||s.sprint!==null)&&t.jsx(Dl,{block:d,value:s.sprint,sprints:l,onChange:m=>c({...s,sprint:m})}),e[42]=d,e[43]=s,e[44]=c,e[45]=l,e[46]=C):C=e[46];let k;e[47]!==d||e[48]!==u?(k=t.jsx(Il,{block:d,onClick:u}),e[47]=d,e[48]=u,e[49]=k):k=e[49];let w;return e[50]!==v||e[51]!==N||e[52]!==C||e[53]!==k||e[54]!==x||e[55]!==f||e[56]!==h||e[57]!==y?(w=t.jsxs(t.Fragment,{children:[x,f,h,y,v,N,C,k]}),e[50]=v,e[51]=N,e[52]=C,e[53]=k,e[54]=x,e[55]=f,e[56]=h,e[57]=y,e[58]=w):w=e[58],w}function $o(n){const e=M.c(17),{filters:s,members:o,tags:a,repos:i,sprints:l,onChange:c,onOpenBoardSettings:u}=n,d=K();let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(ps,{size:16,className:"mr-0.5 shrink-0 text-muted-foreground"}),e[0]=p):p=e[0];let x;e[1]!==s||e[2]!==o||e[3]!==c||e[4]!==u||e[5]!==i||e[6]!==l||e[7]!==a?(x=t.jsx(vs,{filters:s,members:o,tags:a,repos:i,sprints:l,onChange:c,onOpenBoardSettings:u}),e[1]=s,e[2]=o,e[3]=c,e[4]=u,e[5]=i,e[6]=l,e[7]=a,e[8]=x):x=e[8];let r;e[9]!==s||e[10]!==c||e[11]!==l||e[12]!==d?(r=xl(s,Bt(l))&&t.jsx("button",{type:"button",onClick:()=>c(xs),className:"ml-1 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground",children:d("taskBoard.taskFilters.clearButton")}),e[9]=s,e[10]=c,e[11]=l,e[12]=d,e[13]=r):r=e[13];let f;return e[14]!==x||e[15]!==r?(f=t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[p,x,r]}),e[14]=x,e[15]=r,e[16]=f):f=e[16],f}function Mo(n){const e=M.c(45),{filters:s,members:o,tags:a,repos:i,sprints:l,onChange:c,onOpenBoardSettings:u}=n,d=K(),[p,x]=Q.useState(!1);let r;e[0]!==s||e[1]!==l?(r=jl(s,Bt(l)),e[0]=s,e[1]=l,e[2]=r):r=e[2];const f=r,g=f>0;let h;e[3]!==g?(h=ke(g),e[3]=g,e[4]=h):h=e[4];const j=h;let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(ps,{size:14,className:"shrink-0"}),e[5]=y):y=e[5];let S;e[6]!==d?(S=d("taskBoard.taskFilters.filterDrawerButtonLabel"),e[6]=d,e[7]=S):S=e[7];let v;e[8]!==f?(v=f>0&&t.jsx("span",{className:"ml-0.5 flex size-4 items-center justify-center rounded-full bg-foreground text-[10px] font-semibold text-background",children:f}),e[8]=f,e[9]=v):v=e[9];let N;e[10]!==S||e[11]!==v||e[12]!==j?(N=t.jsx(Us,{asChild:!0,children:t.jsxs("button",{type:"button",className:j,children:[y,S,v]})}),e[10]=S,e[11]=v,e[12]=j,e[13]=N):N=e[13];let C;e[14]!==d?(C=d("taskBoard.taskFilters.filterDrawerTitle"),e[14]=d,e[15]=C):C=e[15];let k;e[16]!==C?(k=t.jsx(Nt,{className:"px-4 pt-4 text-base font-medium text-foreground",children:C}),e[16]=C,e[17]=k):k=e[17];let w;e[18]!==s||e[19]!==o||e[20]!==c||e[21]!==u||e[22]!==i||e[23]!==l||e[24]!==a?(w=t.jsx("div",{className:"flex flex-col gap-2 p-4",children:t.jsx(vs,{block:!0,filters:s,members:o,tags:a,repos:i,sprints:l,onChange:c,onOpenBoardSettings:u})}),e[18]=s,e[19]=o,e[20]=c,e[21]=u,e[22]=i,e[23]=l,e[24]=a,e[25]=w):w=e[25];let m;e[26]!==f||e[27]!==c||e[28]!==d?(m=f>0&&t.jsx(je,{variant:"outline",className:"flex-1",onClick:()=>c(xs),children:d("taskBoard.taskFilters.clearAllButton")}),e[26]=f,e[27]=c,e[28]=d,e[29]=m):m=e[29];let _;e[30]!==d?(_=d("taskBoard.taskFilters.doneButton"),e[30]=d,e[31]=_):_=e[31];let D;e[32]!==_?(D=t.jsx(ss,{asChild:!0,children:t.jsx(je,{className:"flex-1",children:_})}),e[32]=_,e[33]=D):D=e[33];let F;e[34]!==m||e[35]!==D?(F=t.jsxs(ns,{className:"flex-row gap-2",children:[m,D]}),e[34]=m,e[35]=D,e[36]=F):F=e[36];let I;e[37]!==w||e[38]!==F||e[39]!==k?(I=t.jsxs(yt,{className:"p-0",children:[k,w,F]}),e[37]=w,e[38]=F,e[39]=k,e[40]=I):I=e[40];let b;return e[41]!==p||e[42]!==I||e[43]!==N?(b=t.jsxs(kt,{open:p,onOpenChange:x,direction:"bottom",children:[N,I]}),e[41]=p,e[42]=I,e[43]=N,e[44]=b):b=e[44],b}function Oo(n,e){return pl(n,e.keySeq,e.jiraIssueKey)??e.id}function zo(n,e){const s=e?.trim();if(!s)return;const o=s.toLowerCase();return n.find(a=>a.jiraIssueKey?.trim().toLowerCase()===o)??n.find(a=>bs(s,a.keySeq,a.jiraIssueKey))??n.find(a=>a.id===s)}export{Io as A,xs as E,Fo as N,Kt as S,Mo as T,Oo as a,Ao as b,$o as c,Lo as d,Jn as e,zo as f,Bo as m,Po as r,pl as t,To as u};
@@ -1 +1 @@
1
- import{c as P,r as U,j as a,l as X,B as G,W as z,a7 as J,K as Q,m as ee,n as V,e as Y,b as L,dr as Z,ds as H,dq as de,b6 as ae,t as F,P as se,dt as ke,p as Re}from"./index-B8v6bpri.js";import{I as le}from"./input-DW2ahhtH.js";import{i as ge}from"./Check-yANPvlWH.js";import{i as pe}from"./ChevronSelectorVertical-CDr8Ovfg.js";import{a as Oe,c as Ke,d as Ee,e as Ie,b as Be,C as De}from"./command-BvTOvAwX.js";import{a as $e,P as Me,b as Fe}from"./popover-t_ZIm7eh.js";import{S as qe}from"./switch-BTJg1O9U.js";import{c as xe,d as he,b as je,f as ye,g as be,e as Se,a as ve,A as Ce}from"./alert-dialog-D3FLXTEj.js";import{d as ne,a as _e,b as Ne,c as we,S as Te}from"./select-BeM39jjH.js";import{R as Le,A as Ue}from"./review-settings-BWlNqIKi.js";import{t as ze}from"./cards-Ckz_jSmB.js";import{p as Je,A as Qe}from"./config-ykFar5kq.js";import{u as me}from"./use-organization-settings-BA2lxbR3.js";import{s as Ge}from"./Plus-Bz1cAYCY.js";import{s as We}from"./Trash01-D5j2YoAs.js";import{T as Ae}from"./textarea-ByOwMVOP.js";import{f as He}from"./task-board-BHMys9hW.js";import{R as Ve}from"./require-capability-C3U03ONf.js";import"./index-BoKx8Diy.js";import"./dialog-C7M7JvTo.js";import"./SearchMd-DN6cu6SZ.js";import"./ChevronUp-D9JVuW7G.js";import"./UserSquare-DGuYrk9Q.js";import"./GitBranch01-DZEodcVR.js";import"./folder-icon-DlTz7QPL.js";import"./Eye-ggEjyhYq.js";import"./DotsVertical-mvRvTh6x.js";import"./Download01-CeBHR-fX.js";import"./Share07-vMCtuazW.js";import"./Globe01-Dj13xfTI.js";import"./Key01-BBxtRrGm.js";import"./Palette-CXReGsk_.js";import"./Zap-CywbYsFI.js";import"./dropdown-menu-D4_fxfOo.js";import"./ChevronRight-D_8iRnVD.js";import"./file-type-icon-BnnSdDsH.js";import"./decopilot-sse-pool-_NQmGFbS.js";import"./backoff-CrEUbyZT.js";import"./use-decopilot-events-q6jF3KyR.js";import"./AlertCircle-DTA-xmN8.js";import"./ThumbsUp-DV6K5Csu.js";import"./CheckCircle-CEm5M3Tl.js";import"./Shield01-SPzOFIU1.js";import"./constants-DNuUCxmW.js";import"./schema-BuoIK2NM.js";import"./access-gate-CgF7Ajgl.js";import"./capability-load-error-D2I8YlS5.js";function Ye(t){const e=P.c(41),{options:l,value:s,onChange:n,placeholder:i,triggerClassName:r,contentClassName:o,width:d,renderTrigger:u,renderItem:c,emptyMessage:m,searchPlaceholder:f,filter:p}=t,h=i===void 0?"Select...":i,y=d===void 0?"w-[200px]":d,b=m===void 0?"No results found.":m,S=f===void 0?"Search...":f;let g;e[0]!==s?(g=q=>q.value===s,e[0]=s,e[1]=g):g=e[1];const x=l.find(g),[j,C]=U.useState(!1),v=Me,_=$e,N=!0,w=u?a.jsx("div",{className:X("cursor-pointer",r),children:u(x)}):a.jsxs(G,{variant:"outline",role:"combobox",className:X("justify-between",y,r),children:[x?x.label:h,a.jsx(pe,{className:"opacity-50"})]});let A;e[2]!==_||e[3]!==w?(A=a.jsx(_,{asChild:N,children:w}),e[2]=_,e[3]=w,e[4]=A):A=e[4];let k;e[5]!==o?(k=X("p-0",o),e[5]=o,e[6]=k):k=e[6];let O;e[7]===Symbol.for("react.memo_cache_sentinel")?(O={width:"var(--radix-popover-trigger-width)"},e[7]=O):O=e[7];let K;e[8]!==S?(K=a.jsx(Oe,{placeholder:S,className:"h-9"}),e[8]=S,e[9]=K):K=e[9];let I;e[10]!==b?(I=a.jsx(Ke,{children:b}),e[10]=b,e[11]=I):I=e[11];let E;if(e[12]!==n||e[13]!==l||e[14]!==c||e[15]!==C||e[16]!==s){let q;e[18]!==n||e[19]!==c||e[20]!==C||e[21]!==s?(q=R=>{const te=s===R.value;return a.jsx(Ee,{value:R.label,onSelect:()=>{n(R.value===s?"":R.value),C(!1)},children:c?c(R,te):a.jsxs(a.Fragment,{children:[R.label,a.jsx(ge,{className:X("ml-auto",te?"opacity-100":"opacity-0")})]})},R.value)},e[18]=n,e[19]=c,e[20]=C,e[21]=s,e[22]=q):q=e[22],E=l.map(q),e[12]=n,e[13]=l,e[14]=c,e[15]=C,e[16]=s,e[17]=E}else E=e[17];let T;e[23]!==E?(T=a.jsx(Ie,{children:E}),e[23]=E,e[24]=T):T=e[24];let M;e[25]!==I||e[26]!==T?(M=a.jsxs(Be,{children:[I,T]}),e[25]=I,e[26]=T,e[27]=M):M=e[27];let B;e[28]!==p||e[29]!==K||e[30]!==M?(B=a.jsxs(De,{filter:p,children:[K,M]}),e[28]=p,e[29]=K,e[30]=M,e[31]=B):B=e[31];let D;e[32]!==B||e[33]!==k?(D=a.jsx(Fe,{className:k,style:O,children:B}),e[32]=B,e[33]=k,e[34]=D):D=e[34];let $;return e[35]!==v||e[36]!==j||e[37]!==C||e[38]!==D||e[39]!==A?($=a.jsxs(v,{open:j,onOpenChange:C,children:[A,D]}),e[35]=v,e[36]=j,e[37]=C,e[38]=D,e[39]=A,e[40]=$):$=e[40],$}function Xe(t){const e=P.c(4),{size:l,className:s}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=a.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 i;return e[1]!==s||e[2]!==l?(i=a.jsx("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"#2684FF","aria-hidden":"true",className:s,children:n}),e[1]=s,e[2]=l,e[3]=i):i=e[3],i}function Pe(t){const e=t.projectName?.replace(/\s+/g," ").trim(),l=t.name.trim();return e?{primary:e,secondary:[l,t.projectKey].filter(Boolean).join(" · ")}:{primary:l,secondary:t.projectKey??""}}function Ze(t){const{primary:e,secondary:l}=Pe(t);return[e,l,`#${t.id}`].filter(Boolean).join(" ")}function ue(t){return t.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase()}function et(t,e){const l=ue(e).trim();if(!l)return 1;const s=ue(t);return l.split(/\s+/).every(n=>s.includes(n))?1:0}function tt(){const t=P.c(7),{org:e}=z(),l=J();let s;t[0]!==e.id?(s=Q.jiraIntegration(e.id),t[0]=e.id,t[1]=s):s=t[1];let n;t[2]!==l?(n=async()=>(await l.call("JIRA_INTEGRATION_GET",{})).integration,t[2]=l,t[3]=n):n=t[3];let i;return t[4]!==s||t[5]!==n?(i={queryKey:s,queryFn:n},t[4]=s,t[5]=n,t[6]=i):i=t[6],ee(i)}function re(){const t=P.c(8),{org:e}=z(),l=J(),s=V();let n;t[0]!==l?(n=async o=>(await l.call("JIRA_INTEGRATION_UPSERT",o)).integration,t[0]=l,t[1]=n):n=t[1];let i;t[2]!==e||t[3]!==s?(i=()=>s.invalidateQueries({queryKey:Q.jiraIntegration(e.id)}),t[2]=e,t[3]=s,t[4]=i):i=t[4];let r;return t[5]!==n||t[6]!==i?(r={mutationFn:n,onSettled:i},t[5]=n,t[6]=i,t[7]=r):r=t[7],Y(r)}function st(){const t=P.c(8),{org:e}=z(),l=J(),s=V();let n;t[0]!==l?(n=()=>l.call("JIRA_INTEGRATION_DELETE",{}),t[0]=l,t[1]=n):n=t[1];let i;t[2]!==e||t[3]!==s?(i=()=>s.invalidateQueries({queryKey:Q.jiraIntegration(e.id)}),t[2]=e,t[3]=s,t[4]=i):i=t[4];let r;return t[5]!==n||t[6]!==i?(r={mutationFn:n,onSettled:i},t[5]=n,t[6]=i,t[7]=r):r=t[7],Y(r)}function it(t){const e=P.c(8),{org:l}=z(),s=J();let n;e[0]!==l.id?(n=Q.jiraBoards(l.id),e[0]=l.id,e[1]=n):n=e[1];let i;e[2]!==s?(i=async()=>(await s.call("JIRA_BOARDS_LIST",{})).boards,e[2]=s,e[3]=i):i=e[3];let r;return e[4]!==t||e[5]!==n||e[6]!==i?(r={queryKey:n,enabled:t,staleTime:6e4,queryFn:i},e[4]=t,e[5]=n,e[6]=i,e[7]=r):r=e[7],ee(r)}function lt(t){const e=P.c(10),{org:l}=z(),s=J();let n;e[0]!==t||e[1]!==l.id?(n=Q.jiraBoardColumns(l.id,t??""),e[0]=t,e[1]=l.id,e[2]=n):n=e[2];const i=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]!==i||e[8]!==r?(o={queryKey:n,enabled:i,staleTime:6e4,queryFn:r},e[6]=n,e[7]=i,e[8]=r,e[9]=o):o=e[9],ee(o)}function nt(){const t=P.c(8),{org:e}=z(),l=J(),s=V();let n;t[0]!==l?(n=async()=>(await l.call("JIRA_SYNC_RUN",{})).result,t[0]=l,t[1]=n):n=t[1];let i;t[2]!==e||t[3]!==s?(i=()=>s.invalidateQueries({queryKey:Q.jiraIntegration(e.id)}),t[2]=e,t[3]=s,t[4]=i):i=t[4];let r;return t[5]!==n||t[6]!==i?(r={mutationFn:n,onSettled:i},t[5]=n,t[6]=i,t[7]=r):r=t[7],Y(r)}function at(){const t=P.c(8),{org:e}=z(),l=J(),s=V();let n;t[0]!==l?(n=async()=>await l.call("JIRA_RESYNC_REQUEST",{}),t[0]=l,t[1]=n):n=t[1];let i;t[2]!==e||t[3]!==s?(i=()=>s.invalidateQueries({queryKey:Q.jiraIntegration(e.id)}),t[2]=e,t[3]=s,t[4]=i):i=t[4];let r;return t[5]!==n||t[6]!==i?(r={mutationFn:n,onSettled:i},t[5]=n,t[6]=i,t[7]=r):r=t[7],Y(r)}function rt(){const t=P.c(8),{locator:e}=z(),l=J(),s=V();let n;t[0]!==l?(n=async o=>await l.call("TASK_BOARD_COLUMN_ROLE_SET",{columnKey:o.columnKey,role:o.role}),t[0]=l,t[1]=n):n=t[1];let i;t[2]!==e||t[3]!==s?(i=()=>s.invalidateQueries({queryKey:Q.taskBoardItems(e)}),t[2]=e,t[3]=s,t[4]=i):i=t[4];let r;return t[5]!==n||t[6]!==i?(r={mutationFn:n,onSettled:i},t[5]=n,t[6]=i,t[7]=r):r=t[7],Y(r)}function ot(){const t=P.c(12),{locator:e}=z(),l=J();let s;t[0]!==e?(s=Q.taskBoardColumnAutomations(e),t[0]=e,t[1]=s):s=t[1];let n;t[2]!==l?(n=async()=>{const{automations:u}=await l.call("TASK_BOARD_AUTOMATION_LIST",{});return u},t[2]=l,t[3]=n):n=t[3];let i;t[4]!==s||t[5]!==n?(i={queryKey:s,queryFn:n},t[4]=s,t[5]=n,t[6]=i):i=t[6];const r=ee(i);let o;t[7]!==r.data?(o=r.data??[],t[7]=r.data,t[8]=o):o=t[8];let d;return t[9]!==r.isPending||t[10]!==o?(d={automations:o,isPending:r.isPending},t[9]=r.isPending,t[10]=o,t[11]=d):d=t[11],d}function ct(){const t=P.c(8),{locator:e}=z(),l=J(),s=V();let n;t[0]!==l?(n=async o=>{if(o.prompt===null){await l.call("TASK_BOARD_AUTOMATION_DELETE",{columnKey:o.columnKey});return}await l.call("TASK_BOARD_AUTOMATION_UPSERT",{columnKey:o.columnKey,prompt:o.prompt.trim()===""?void 0:o.prompt})},t[0]=l,t[1]=n):n=t[1];let i;t[2]!==s||t[3]!==e?(i=()=>s.invalidateQueries({queryKey:Q.taskBoardColumnAutomations(e)}),t[2]=s,t[3]=e,t[4]=i):i=t[4];let r;return t[5]!==n||t[6]!==i?(r={mutationFn:n,onSuccess:i},t[5]=n,t[6]=i,t[7]=r):r=t[7],Y(r)}const oe="__none__",dt=[{value:"in_progress",labelKey:"settings.boardColumns.whenRunStarts"},{value:"in_review",labelKey:"settings.boardColumns.whenRunFinishes"},{value:"archived",labelKey:"settings.boardColumns.whenMergedAndSettled"},{value:"todo",labelKey:"settings.boardColumns.whenRunFailsOut"}];function mt(){const t=P.c(16),e=L();if(!me("org_board_columns"))return null;let s;t[0]!==e?(s=e("settings.boardColumns.title"),t[0]=e,t[1]=s):s=t[1];let n;t[2]!==e?(n=e("settings.boardColumns.description"),t[2]=e,t[3]=n):n=t[3];let i;t[4]!==e?(i=e("settings.boardColumns.fieldLabel"),t[4]=e,t[5]=i):i=t[5];let r;t[6]!==e?(r=e("settings.boardColumns.fieldDescription"),t[6]=e,t[7]=r):r=t[7];let o;t[8]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(ut,{}),t[8]=o):o=t[8];let d;t[9]!==i||t[10]!==r?(d=a.jsx(Z,{children:a.jsx(H,{title:i,description:r,children:o})}),t[9]=i,t[10]=r,t[11]=d):d=t[11];let u;return t[12]!==s||t[13]!==n||t[14]!==d?(u=a.jsx(de,{title:s,description:n,children:d}),t[12]=s,t[13]=n,t[14]=d,t[15]=u):u=t[15],u}function ut(){const t=P.c(14),e=L(),{columns:l,isLoading:s}=Je(),{automations:n,isPending:i}=ot();if(s||i){let c;return t[0]===Symbol.for("react.memo_cache_sentinel")?(c=a.jsx(ae,{className:"h-40 w-full"}),t[0]=c):c=t[0],c}if(l.length===0){let c;t[1]!==e?(c=e("settings.jira.noColumnsYet"),t[1]=e,t[2]=c):c=t[2];let m;return t[3]!==c?(m=a.jsx("p",{className:"text-xs text-muted-foreground",children:c}),t[3]=c,t[4]=m):m=t[4],m}let r;t[5]!==n?(r=new Map(n.map(ft)),t[5]=n,t[6]=r):r=t[6];const o=r;let d;if(t[7]!==l||t[8]!==o){let c;t[10]!==o?(c=m=>a.jsx(gt,{columnKey:m.key,title:m.title,trigger:m.role,hasAutomation:o.has(m.key),prompt:o.get(m.key)??null},m.key),t[10]=o,t[11]=c):c=t[11],d=l.map(c),t[7]=l,t[8]=o,t[9]=d}else d=t[9];let u;return t[12]!==d?(u=a.jsx("div",{className:"flex w-full flex-col gap-3",children:d}),t[12]=d,t[13]=u):u=t[13],u}function ft(t){return[t.columnKey,t.prompt]}function gt(t){const e=P.c(45),{columnKey:l,title:s,trigger:n,hasAutomation:i,prompt:r}=t,o=L(),d=rt(),u=ct(),[c,m]=U.useState(r??""),[f,p]=U.useState(r);f!==r&&(p(r),m(r??""));let h;e[0]!==o?(h=()=>F.error(o("settings.boardColumns.saveFailed")),e[0]=o,e[1]=h):h=e[1];const y=h;let b;e[2]!==l||e[3]!==y||e[4]!==u?(b=T=>u.mutate({columnKey:l,prompt:T},{onError:y}),e[2]=l,e[3]=y,e[4]=u,e[5]=b):b=e[5];const S=b;let g;e[6]!==s?(g=a.jsx("span",{className:"truncate text-sm font-medium",children:s}),e[6]=s,e[7]=g):g=e[7];let x;e[8]!==o?(x=o("settings.boardColumns.moveHereWhen"),e[8]=o,e[9]=x):x=e[9];let j;e[10]!==x?(j=a.jsx("span",{className:"text-xs text-muted-foreground",children:x}),e[10]=x,e[11]=j):j=e[11];const C=n??oe;let v;e[12]!==l||e[13]!==y||e[14]!==d?(v=T=>d.mutate({columnKey:l,role:T===oe?null:T},{onError:y}),e[12]=l,e[13]=y,e[14]=d,e[15]=v):v=e[15];let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_=a.jsx(_e,{className:"w-64",children:a.jsx(Ne,{})}),e[16]=_):_=e[16];let N;e[17]!==o?(N=o("settings.boardColumns.whenNever"),e[17]=o,e[18]=N):N=e[18];let w;e[19]!==N?(w=a.jsx(ne,{value:oe,children:N}),e[19]=N,e[20]=w):w=e[20];let A;e[21]!==o?(A=dt.map(T=>a.jsx(ne,{value:T.value,children:o(T.labelKey)},T.value)),e[21]=o,e[22]=A):A=e[22];let k;e[23]!==w||e[24]!==A?(k=a.jsxs(we,{children:[w,A]}),e[23]=w,e[24]=A,e[25]=k):k=e[25];let O;e[26]!==k||e[27]!==C||e[28]!==v?(O=a.jsxs(Te,{value:C,onValueChange:v,children:[_,k]}),e[26]=k,e[27]=C,e[28]=v,e[29]=O):O=e[29];let K;e[30]!==O||e[31]!==j?(K=a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[j,O]}),e[30]=O,e[31]=j,e[32]=K):K=e[32];let I;e[33]!==l||e[34]!==c||e[35]!==i||e[36]!==r||e[37]!==S||e[38]!==o||e[39]!==s?(I=i?a.jsxs("div",{className:"flex flex-col gap-2 rounded-lg bg-muted/40 p-2.5",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx("span",{className:"text-xs font-medium",children:o("settings.boardColumns.automationOn")}),a.jsx(G,{variant:"ghost",size:"sm","aria-label":o("settings.boardColumns.removeAriaLabel",{column:s}),onClick:()=>S(null),children:a.jsx(We,{size:14})})]}),a.jsx(Ae,{value:c,rows:2,placeholder:o("settings.boardColumns.promptPlaceholder"),onChange:T=>m(T.target.value),onBlur:()=>{c!==(r??"")&&S(c)},"data-column-automation-prompt":l}),a.jsx("p",{className:"text-xs text-muted-foreground",children:o("settings.boardColumns.promptHelp")})]}):a.jsxs(G,{variant:"outline",size:"sm",className:"w-fit",onClick:()=>S(""),children:[a.jsx(Ge,{size:14}),o("settings.boardColumns.addAutomation")]}),e[33]=l,e[34]=c,e[35]=i,e[36]=r,e[37]=S,e[38]=o,e[39]=s,e[40]=I):I=e[40];let E;return e[41]!==K||e[42]!==I||e[43]!==g?(E=a.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-border p-3",children:[g,K,I]}),e[41]=K,e[42]=I,e[43]=g,e[44]=E):E=e[44],E}function pt(){const t=P.c(12),{org:e}=z(),l=J();let s;t[0]!==e.id?(s=Q.taskBoardPrompts(e.id),t[0]=e.id,t[1]=s):s=t[1];let n;t[2]!==l?(n=async()=>(await l.call("TASK_BOARD_PROMPT_LIST",{})).prompts,t[2]=l,t[3]=n):n=t[3];let i;t[4]!==s||t[5]!==n?(i={queryKey:s,staleTime:6e4,queryFn:n},t[4]=s,t[5]=n,t[6]=i):i=t[6];const r=ee(i);let o;t[7]!==r.data?(o=r.data?.find(xt)?.prompt??"",t[7]=r.data,t[8]=o):o=t[8];let d;return t[9]!==r.isPending||t[10]!==o?(d={prompt:o,isPending:r.isPending},t[9]=r.isPending,t[10]=o,t[11]=d):d=t[11],d}function xt(t){return t.columnKey===null}function ht(){const t=P.c(8),{org:e}=z(),l=J(),s=V();let n;t[0]!==l?(n=async o=>{const d=o.trim();if(!d){await l.call("TASK_BOARD_PROMPT_DELETE",{});return}await l.call("TASK_BOARD_PROMPT_UPSERT",{prompt:d})},t[0]=l,t[1]=n):n=t[1];let i;t[2]!==e||t[3]!==s?(i=()=>s.invalidateQueries({queryKey:Q.taskBoardPrompts(e.id)}),t[2]=e,t[3]=s,t[4]=i):i=t[4];let r;return t[5]!==n||t[6]!==i?(r={mutationFn:n,onSettled:i},t[5]=n,t[6]=i,t[7]=r):r=t[7],Y(r)}function jt(){const t=P.c(16),e=L(),{prompt:l,isPending:s}=pt(),n=ht(),[i,r]=U.useState(l),[o,d]=U.useState(l);o!==l&&(d(l),r(l));let u;t[0]!==e?(u=e("settings.taskPrompt.title"),t[0]=e,t[1]=u):u=t[1];let c;t[2]!==e?(c=e("settings.taskPrompt.fieldLabel"),t[2]=e,t[3]=c):c=t[3];let m;t[4]!==i||t[5]!==s||t[6]!==l||t[7]!==n||t[8]!==e?(m=s?a.jsx(ae,{className:"h-44 w-full"}):a.jsxs("div",{className:"flex flex-col items-start gap-2",children:[a.jsx(Ae,{value:i,rows:10,maxLength:He,placeholder:e("settings.taskPrompt.placeholder"),onChange:h=>r(h.target.value)}),a.jsx(G,{size:"sm",disabled:i===l||n.isPending,onClick:()=>n.mutate(i,{onSuccess:()=>F.success(e("settings.taskPrompt.saved")),onError:()=>F.error(e("settings.taskPrompt.failed"))}),children:e("settings.taskPrompt.save")})]}),t[4]=i,t[5]=s,t[6]=l,t[7]=n,t[8]=e,t[9]=m):m=t[9];let f;t[10]!==c||t[11]!==m?(f=a.jsx(Z,{children:a.jsx(H,{title:c,children:m})}),t[10]=c,t[11]=m,t[12]=f):f=t[12];let p;return t[13]!==u||t[14]!==f?(p=a.jsx(de,{title:u,children:f}),t[13]=u,t[14]=f,t[15]=p):p=t[15],p}function ie(t,e){const l=e.statuses[0];if(l)return Object.entries(t).find(([,s])=>s.includes(l))?.[0]}const fe=[{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:"approved",labelKey:"taskBoard.config.statusApproved"},{value:"merged",labelKey:"taskBoard.config.statusMerged"},{value:"post_deploy_validation",labelKey:"taskBoard.config.statusPostDeployValidation"},{value:"done",labelKey:"taskBoard.config.statusDone"},{value:"archived",labelKey:"taskBoard.config.statusArchived"}];function yt(t,e){return t?fe:fe.filter(l=>!Qe(l.value)||l.value===e)}const ce="__dont_sync__";function W(t,e){return t instanceof Error?t.message:e}const bt="https://id.atlassian.com/manage-profile/security/api-tokens";function St(t){const e=P.c(7),{stepKeys:l}=t,s=L();let n;if(e[0]!==l||e[1]!==s){let r;e[3]!==s?(r=o=>a.jsx("li",{children:s(o)},o),e[3]=s,e[4]=r):r=e[4],n=l.map(r),e[0]=l,e[1]=s,e[2]=n}else n=e[2];let i;return e[5]!==n?(i=a.jsx("ol",{className:"list-decimal pl-5 flex flex-col gap-1 text-xs text-muted-foreground",children:n}),e[5]=n,e[6]=i):i=e[6],i}function vt(){const t=P.c(69),e=L(),l=re(),[s,n]=U.useState(""),[i,r]=U.useState(""),[o,d]=U.useState("");let u;t[0]!==o||t[1]!==i||t[2]!==s?(u=s.trim()!==""&&i.trim()!==""&&o.trim()!=="",t[0]=o,t[1]=i,t[2]=s,t[3]=u):u=t[3];const c=u;let m;t[4]!==e?(m=e("settings.jira.siteLabel"),t[4]=e,t[5]=m):m=t[5];let f;t[6]!==m?(f=a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:m}),t[6]=m,t[7]=f):f=t[7];let p;t[8]===Symbol.for("react.memo_cache_sentinel")?(p=R=>n(R.target.value),t[8]=p):p=t[8];let h;t[9]!==e?(h=e("settings.jira.sitePlaceholder"),t[9]=e,t[10]=h):h=t[10];let y;t[11]!==s||t[12]!==h?(y=a.jsx(le,{value:s,onChange:p,placeholder:h,autoComplete:"off"}),t[11]=s,t[12]=h,t[13]=y):y=t[13];let b;t[14]!==f||t[15]!==y?(b=a.jsxs("div",{className:"flex flex-col gap-1.5",children:[f,y]}),t[14]=f,t[15]=y,t[16]=b):b=t[16];let S;t[17]!==e?(S=e("settings.jira.emailLabel"),t[17]=e,t[18]=S):S=t[18];let g;t[19]!==S?(g=a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:S}),t[19]=S,t[20]=g):g=t[20];let x;t[21]===Symbol.for("react.memo_cache_sentinel")?(x=R=>r(R.target.value),t[21]=x):x=t[21];let j;t[22]!==e?(j=e("settings.jira.emailPlaceholder"),t[22]=e,t[23]=j):j=t[23];let C;t[24]!==i||t[25]!==j?(C=a.jsx(le,{value:i,onChange:x,placeholder:j,autoComplete:"off"}),t[24]=i,t[25]=j,t[26]=C):C=t[26];let v;t[27]!==C||t[28]!==g?(v=a.jsxs("div",{className:"flex flex-col gap-1.5",children:[g,C]}),t[27]=C,t[28]=g,t[29]=v):v=t[29];let _;t[30]!==e?(_=e("settings.jira.tokenLabel"),t[30]=e,t[31]=_):_=t[31];let N;t[32]!==_?(N=a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:_}),t[32]=_,t[33]=N):N=t[33];let w;t[34]!==e?(w=e("settings.jira.createTokenLink"),t[34]=e,t[35]=w):w=t[35];let A;t[36]===Symbol.for("react.memo_cache_sentinel")?(A=a.jsx(Re,{size:12}),t[36]=A):A=t[36];let k;t[37]!==w?(k=a.jsxs("a",{href:bt,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-0.5 text-xs text-foreground hover:underline",children:[w,A]}),t[37]=w,t[38]=k):k=t[38];let O;t[39]!==N||t[40]!==k?(O=a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[N,k]}),t[39]=N,t[40]=k,t[41]=O):O=t[41];let K;t[42]===Symbol.for("react.memo_cache_sentinel")?(K=R=>d(R.target.value),t[42]=K):K=t[42];let I;t[43]!==e?(I=e("settings.jira.tokenPlaceholder"),t[43]=e,t[44]=I):I=t[44];let E;t[45]!==o||t[46]!==I?(E=a.jsx(le,{type:"password",value:o,onChange:K,placeholder:I,autoComplete:"off"}),t[45]=o,t[46]=I,t[47]=E):E=t[47];let T;t[48]!==O||t[49]!==E?(T=a.jsxs("div",{className:"flex flex-col gap-1.5",children:[O,E]}),t[48]=O,t[49]=E,t[50]=T):T=t[50];const M=!c||l.isPending;let B;t[51]!==o||t[52]!==i||t[53]!==s||t[54]!==e||t[55]!==l?(B=()=>l.mutate({siteUrl:s.trim(),email:i.trim(),apiToken:o.trim()},{onSuccess:()=>F.success(e("settings.jira.connected")),onError:R=>F.error(W(R,e("settings.jira.connectFailed")))}),t[51]=o,t[52]=i,t[53]=s,t[54]=e,t[55]=l,t[56]=B):B=t[56];let D;t[57]!==e||t[58]!==l.isPending?(D=l.isPending?e("settings.jira.connecting"):e("settings.jira.connect"),t[57]=e,t[58]=l.isPending,t[59]=D):D=t[59];let $;t[60]!==M||t[61]!==B||t[62]!==D?($=a.jsx(G,{size:"sm",className:"w-fit",disabled:M,onClick:B,children:D}),t[60]=M,t[61]=B,t[62]=D,t[63]=$):$=t[63];let q;return t[64]!==v||t[65]!==T||t[66]!==$||t[67]!==b?(q=a.jsxs("div",{className:"flex flex-col gap-4 mt-3 max-w-md",children:[b,v,T,$]}),t[64]=v,t[65]=T,t[66]=$,t[67]=b,t[68]=q):q=t[68],q}function Ct(t){const e=P.c(7),{integration:l}=t,s=L();if(l.lastSyncError){let r;return e[0]!==l.lastSyncError?(r=a.jsx("p",{className:"text-xs text-destructive truncate",children:l.lastSyncError}),e[0]=l.lastSyncError,e[1]=r):r=e[1],r}let n;e[2]!==l.lastSyncedAt||e[3]!==s?(n=l.lastSyncedAt?s("settings.jira.lastSynced",{ago:ze(l.lastSyncedAt)}):s("settings.jira.waitingFirstSync"),e[2]=l.lastSyncedAt,e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==n?(i=a.jsx("p",{className:"text-xs text-muted-foreground",children:n}),e[5]=n,e[6]=i):i=e[6],i}function _t(t){const e=P.c(35),{integration:l}=t,s=L(),n=re(),i=lt(l.boardId),r=me("delivery_lanes_enabled"),[o,d]=U.useState(l.statusMapping),[u,c]=U.useState(l);if(u!==l&&(c(l),d(l.statusMapping)),i.isPending){let g;return e[0]===Symbol.for("react.memo_cache_sentinel")?(g=a.jsx(ae,{className:"h-24 w-full mt-3"}),e[0]=g):g=e[0],g}if(i.isError){let g;e[1]!==i.error||e[2]!==s?(g=W(i.error,s("settings.jira.columnsFailed")),e[1]=i.error,e[2]=s,e[3]=g):g=e[3];let x;return e[4]!==g?(x=a.jsx("p",{className:"text-xs text-destructive mt-3",children:g}),e[4]=g,e[5]=x):x=e[5],x}let m;e[6]!==i.data||e[7]!==o||e[8]!==s||e[9]!==n?(m=function(x,j){const C=o,v={};for(const _ of i.data??[]){const N=_.name===x.name?j===ce?void 0:j:ie(o,_);N&&(v[N]=[...v[N]??[],..._.statuses])}d(v),n.mutate({statusMapping:v},{onError:_=>{d(C),F.error(W(_,s("settings.jira.saveFailed")))}})},e[6]=i.data,e[7]=o,e[8]=s,e[9]=n,e[10]=m):m=e[10];const f=m;let p,h;if(e[11]!==i.data||e[12]!==o||e[13]!==s){let g;e[16]!==o?(g=j=>!ie(o,j),e[16]=o,e[17]=g):g=e[17];const x=(i.data??[]).filter(g);p="flex flex-col mt-3",h=x.length>0&&a.jsx("p",{className:"mb-2 rounded-md bg-warning/10 px-3 py-2 text-xs text-warning",children:s("settings.jira.unmappedWarning",{columns:x.map(Nt).join(", ")})}),e[11]=i.data,e[12]=o,e[13]=s,e[14]=p,e[15]=h}else p=e[14],h=e[15];let y;e[18]!==i.data?(y=i.data??[],e[18]=i.data,e[19]=y):y=e[19];let b;if(e[20]!==r||e[21]!==o||e[22]!==f||e[23]!==s||e[24]!==y){let g;e[26]!==r||e[27]!==o||e[28]!==f||e[29]!==s?(g=x=>a.jsxs("div",{className:"flex items-center justify-between gap-4 py-2.5 border-b border-border/60 last:border-b-0",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("span",{className:"text-sm truncate",children:x.name}),(x.statuses.length>1||x.statuses[0]!==x.name)&&a.jsx("p",{className:"text-xs text-muted-foreground truncate",children:x.statuses.join(", ")})]}),a.jsxs(Te,{value:ie(o,x)??ce,onValueChange:j=>f(x,j),children:[a.jsx(_e,{className:"w-44 shrink-0",children:a.jsx(Ne,{})}),a.jsxs(we,{children:[a.jsx(ne,{value:ce,children:s("settings.jira.dontSync")}),yt(r,ie(o,x)).map(j=>a.jsx(ne,{value:j.value,children:s(j.labelKey)},j.value))]})]})]},x.name),e[26]=r,e[27]=o,e[28]=f,e[29]=s,e[30]=g):g=e[30],b=y.map(g),e[20]=r,e[21]=o,e[22]=f,e[23]=s,e[24]=y,e[25]=b}else b=e[25];let S;return e[31]!==p||e[32]!==h||e[33]!==b?(S=a.jsxs("div",{className:p,children:[h,b]}),e[31]=p,e[32]=h,e[33]=b,e[34]=S):S=e[34],S}function Nt(t){return t.name}function wt(t){const e=P.c(44),{integration:l}=t,s=L(),n=st(),[i,r]=U.useState(!1),o=l.siteUrl,d=l.email;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=()=>r(!0),e[0]=u):u=e[0];let c;e[1]!==s?(c=s("settings.jira.disconnect"),e[1]=s,e[2]=c):c=e[2];let m;e[3]!==c?(m=a.jsx(G,{variant:"outline",size:"sm",onClick:u,children:c}),e[3]=c,e[4]=m):m=e[4];let f;e[5]!==l.email||e[6]!==l.siteUrl||e[7]!==m?(f=a.jsx(H,{title:o,description:d,action:m}),e[5]=l.email,e[6]=l.siteUrl,e[7]=m,e[8]=f):f=e[8];let p;e[9]!==s?(p=s("settings.jira.disconnectTitle"),e[9]=s,e[10]=p):p=e[10];let h;e[11]!==p?(h=a.jsx(xe,{children:p}),e[11]=p,e[12]=h):h=e[12];let y;e[13]!==s?(y=s("settings.jira.disconnectDescription"),e[13]=s,e[14]=y):y=e[14];let b;e[15]!==y?(b=a.jsx(he,{children:y}),e[15]=y,e[16]=b):b=e[16];let S;e[17]!==b||e[18]!==h?(S=a.jsxs(je,{children:[h,b]}),e[17]=b,e[18]=h,e[19]=S):S=e[19];let g;e[20]!==s?(g=s("settings.jira.cancel"),e[20]=s,e[21]=g):g=e[21];let x;e[22]!==g?(x=a.jsx(ye,{children:g}),e[22]=g,e[23]=x):x=e[23];let j;e[24]!==n||e[25]!==s?(j=()=>n.mutate(void 0,{onSuccess:()=>F.success(s("settings.jira.disconnected")),onError:k=>F.error(W(k,s("settings.jira.saveFailed")))}),e[24]=n,e[25]=s,e[26]=j):j=e[26];let C;e[27]!==s?(C=s("settings.jira.disconnect"),e[27]=s,e[28]=C):C=e[28];let v;e[29]!==j||e[30]!==C?(v=a.jsx(be,{onClick:j,children:C}),e[29]=j,e[30]=C,e[31]=v):v=e[31];let _;e[32]!==x||e[33]!==v?(_=a.jsxs(Se,{children:[x,v]}),e[32]=x,e[33]=v,e[34]=_):_=e[34];let N;e[35]!==S||e[36]!==_?(N=a.jsxs(ve,{children:[S,_]}),e[35]=S,e[36]=_,e[37]=N):N=e[37];let w;e[38]!==i||e[39]!==N?(w=a.jsx(Ce,{open:i,onOpenChange:r,children:N}),e[38]=i,e[39]=N,e[40]=w):w=e[40];let A;return e[41]!==w||e[42]!==f?(A=a.jsxs(a.Fragment,{children:[f,w]}),e[41]=w,e[42]=f,e[43]=A):A=e[43],A}function Tt(t){const e=P.c(36),{integration:l}=t,s=L(),n=re(),i=it(!0);let r,o;e[0]!==i.data||e[1]!==l.boardId||e[2]!==l.boardName?(r=(i.data??[]).map(Pt),o=l.boardId?r.find(x=>x.value===l.boardId)?.primary??l.boardName??l.boardId:null,e[0]=i.data,e[1]=l.boardId,e[2]=l.boardName,e[3]=r,e[4]=o):(r=e[3],o=e[4]);const d=o;let u;e[5]!==s?(u=s("settings.jira.boardLabel"),e[5]=s,e[6]=u):u=e[6];let c;e[7]!==s?(c=s("settings.jira.boardDescription"),e[7]=s,e[8]=c):c=e[8];const m=l.boardId??"";let f;e[9]!==s?(f=s("settings.jira.boardPlaceholder"),e[9]=s,e[10]=f):f=e[10];let p;e[11]!==s?(p=s("settings.jira.boardSearchPlaceholder"),e[11]=s,e[12]=p):p=e[12];let h;e[13]!==i.isPending||e[14]!==s?(h=i.isPending?s("settings.jira.loadingBoards"):s("settings.jira.noBoardsMatch"),e[13]=i.isPending,e[14]=s,e[15]=h):h=e[15];let y;e[16]!==d||e[17]!==s?(y=()=>a.jsxs(G,{variant:"outline",role:"combobox",className:"w-72 justify-between font-normal",children:[a.jsx("span",{className:"truncate",children:d??s("settings.jira.boardPlaceholder")}),a.jsx(pe,{className:"opacity-50 shrink-0"})]}),e[16]=d,e[17]=s,e[18]=y):y=e[18];let b;e[19]!==r||e[20]!==l.boardId||e[21]!==s||e[22]!==n?(b=x=>{!x||x===l.boardId||n.mutate({boardId:x,boardName:r.find(j=>j.value===x)?.primary??null,statusMapping:{},enabled:!1},{onError:j=>F.error(W(j,s("settings.jira.saveFailed")))})},e[19]=r,e[20]=l.boardId,e[21]=s,e[22]=n,e[23]=b):b=e[23];let S;e[24]!==r||e[25]!==m||e[26]!==f||e[27]!==p||e[28]!==h||e[29]!==y||e[30]!==b?(S=a.jsx(Ye,{options:r,value:m,width:"w-72",triggerClassName:"shrink-0",placeholder:f,searchPlaceholder:p,filter:et,emptyMessage:h,renderTrigger:y,renderItem:At,onChange:b}),e[24]=r,e[25]=m,e[26]=f,e[27]=p,e[28]=h,e[29]=y,e[30]=b,e[31]=S):S=e[31];let g;return e[32]!==S||e[33]!==u||e[34]!==c?(g=a.jsx(H,{title:u,description:c,action:S}),e[32]=S,e[33]=u,e[34]=c,e[35]=g):g=e[35],g}function At(t,e){return a.jsxs("div",{className:"flex items-start gap-2 min-w-0 w-full",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("p",{className:"truncate",children:t.primary}),a.jsx("p",{className:"text-xs text-muted-foreground truncate",children:t.secondary})]}),a.jsx(ge,{className:X("mt-0.5 shrink-0",e?"opacity-100":"opacity-0")})]})}function Pt(t){const{primary:e,secondary:l}=Pe(t);return{value:String(t.id),label:Ze(t),primary:e,secondary:l}}function kt(t){const e=P.c(10),{integration:l}=t,s=L();if(me("org_board_columns"))return null;let i;e[0]!==s?(i=s("settings.jira.mappingLabel"),e[0]=s,e[1]=i):i=e[1];let r;e[2]!==s?(r=s("settings.jira.mappingDescription"),e[2]=s,e[3]=r):r=e[3];let o;e[4]!==l?(o=a.jsx(_t,{integration:l}),e[4]=l,e[5]=o):o=e[5];let d;return e[6]!==i||e[7]!==r||e[8]!==o?(d=a.jsx(H,{title:i,description:r,children:o}),e[6]=i,e[7]=r,e[8]=o,e[9]=d):d=e[9],d}function Rt(t){const e=P.c(72),{integration:l}=t,s=L(),n=re(),i=nt(),r=at(),[o,d]=U.useState(!1);let u;e[0]!==l.statusMapping?(u=Object.keys(l.statusMapping),e[0]=l.statusMapping,e[1]=u):u=e[1];const c=u.length>0;let m;e[2]!==s?(m=s("settings.jira.enableLabel"),e[2]=s,e[3]=m):m=e[3];let f;e[4]!==l?(f=a.jsx(Ct,{integration:l}),e[4]=l,e[5]=f):f=e[5];const p=!l.enabled||i.isPending||r.isPending;let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=()=>d(!0),e[6]=h):h=e[6];let y;e[7]!==s?(y=s("settings.jira.resyncAll"),e[7]=s,e[8]=y):y=e[8];let b;e[9]!==p||e[10]!==y?(b=a.jsx(G,{variant:"outline",size:"sm",disabled:p,onClick:h,children:y}),e[9]=p,e[10]=y,e[11]=b):b=e[11];let S;e[12]!==s?(S=s("settings.jira.resyncAllTitle"),e[12]=s,e[13]=S):S=e[13];let g;e[14]!==S?(g=a.jsx(xe,{children:S}),e[14]=S,e[15]=g):g=e[15];let x;e[16]!==s?(x=s("settings.jira.resyncAllDescription"),e[16]=s,e[17]=x):x=e[17];let j;e[18]!==x?(j=a.jsx(he,{children:x}),e[18]=x,e[19]=j):j=e[19];let C;e[20]!==j||e[21]!==g?(C=a.jsxs(je,{children:[g,j]}),e[20]=j,e[21]=g,e[22]=C):C=e[22];let v;e[23]!==s?(v=s("settings.jira.cancel"),e[23]=s,e[24]=v):v=e[24];let _;e[25]!==v?(_=a.jsx(ye,{children:v}),e[25]=v,e[26]=_):_=e[26];let N;e[27]!==r||e[28]!==s?(N=()=>r.mutate(void 0,{onSuccess:()=>F.success(s("settings.jira.resyncAllQueued")),onError:R=>F.error(W(R,s("settings.jira.syncFailed")))}),e[27]=r,e[28]=s,e[29]=N):N=e[29];let w;e[30]!==s?(w=s("settings.jira.resyncAll"),e[30]=s,e[31]=w):w=e[31];let A;e[32]!==N||e[33]!==w?(A=a.jsx(be,{onClick:N,children:w}),e[32]=N,e[33]=w,e[34]=A):A=e[34];let k;e[35]!==_||e[36]!==A?(k=a.jsxs(Se,{children:[_,A]}),e[35]=_,e[36]=A,e[37]=k):k=e[37];let O;e[38]!==C||e[39]!==k?(O=a.jsxs(ve,{children:[C,k]}),e[38]=C,e[39]=k,e[40]=O):O=e[40];let K;e[41]!==o||e[42]!==O||e[43]!==b?(K=a.jsxs(Ce,{open:o,onOpenChange:d,children:[b,O]}),e[41]=o,e[42]=O,e[43]=b,e[44]=K):K=e[44];const I=!l.enabled||i.isPending;let E;e[45]!==i||e[46]!==s?(E=()=>i.mutate(void 0,{onSuccess:R=>{"error"in R?F.error(R.error):F.success(s("settings.jira.syncDone",{created:String(R.created),updated:String(R.updated),archived:String(R.archived)}))},onError:R=>F.error(W(R,s("settings.jira.syncFailed")))}),e[45]=i,e[46]=s,e[47]=E):E=e[47];let T;e[48]!==i.isPending||e[49]!==s?(T=i.isPending?s("settings.jira.syncing"):s("settings.jira.syncNow"),e[48]=i.isPending,e[49]=s,e[50]=T):T=e[50];let M;e[51]!==I||e[52]!==E||e[53]!==T?(M=a.jsx(G,{variant:"outline",size:"sm",disabled:I,onClick:E,children:T}),e[51]=I,e[52]=E,e[53]=T,e[54]=M):M=e[54];let B;e[55]!==c||e[56]!==l.boardId||e[57]!==s||e[58]!==n?(B=R=>{if(R&&(!l.boardId||!c)){F.error(s("settings.jira.enableRequirements"));return}n.mutate({enabled:R},{onError:te=>F.error(W(te,s("settings.jira.saveFailed")))})},e[55]=c,e[56]=l.boardId,e[57]=s,e[58]=n,e[59]=B):B=e[59];let D;e[60]!==l.enabled||e[61]!==B||e[62]!==n.isPending?(D=a.jsx(qe,{checked:l.enabled,disabled:n.isPending,onCheckedChange:B}),e[60]=l.enabled,e[61]=B,e[62]=n.isPending,e[63]=D):D=e[63];let $;e[64]!==K||e[65]!==M||e[66]!==D?($=a.jsxs("div",{className:"flex items-center gap-3",children:[K,M,D]}),e[64]=K,e[65]=M,e[66]=D,e[67]=$):$=e[67];let q;return e[68]!==m||e[69]!==$||e[70]!==f?(q=a.jsx(H,{title:m,description:f,action:$}),e[68]=m,e[69]=$,e[70]=f,e[71]=q):q=e[71],q}function Ot(t){const e=P.c(24),{integration:l}=t,s=L(),n=`${window.location.origin}/api/_jira/webhook/${l.webhookSecret}`;let i;e[0]!==s?(i=s("settings.jira.webhookTitle"),e[0]=s,e[1]=i):i=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=a.jsx(le,{readOnly:!0,value:n,className:"font-mono text-xs"}),e[4]=n,e[5]=o):o=e[5];let d;e[6]!==s||e[7]!==n?(d=()=>{navigator.clipboard.writeText(n),F.success(s("settings.jira.webhookCopied"))},e[6]=s,e[7]=n,e[8]=d):d=e[8];let u;e[9]!==s?(u=s("settings.jira.webhookCopy"),e[9]=s,e[10]=u):u=e[10];let c;e[11]!==d||e[12]!==u?(c=a.jsx(G,{variant:"outline",size:"sm",className:"shrink-0",onClick:d,children:u}),e[11]=d,e[12]=u,e[13]=c):c=e[13];let m;e[14]!==o||e[15]!==c?(m=a.jsxs("div",{className:"flex items-center gap-2",children:[o,c]}),e[14]=o,e[15]=c,e[16]=m):m=e[16];let f;e[17]===Symbol.for("react.memo_cache_sentinel")?(f=a.jsx(St,{stepKeys:["settings.jira.webhookStep1","settings.jira.webhookStep2","settings.jira.webhookStep3","settings.jira.webhookStep4","settings.jira.webhookStep5"]}),e[17]=f):f=e[17];let p;e[18]!==m?(p=a.jsxs("div",{className:"flex flex-col gap-3 mt-3",children:[m,f]}),e[18]=m,e[19]=p):p=e[19];let h;return e[20]!==i||e[21]!==r||e[22]!==p?(h=a.jsx(H,{title:i,description:r,children:p}),e[20]=i,e[21]=r,e[22]=p,e[23]=h):h=e[23],h}function Kt(){const t=P.c(22),e=L(),l=tt();if(l.isPending){let c;return t[0]===Symbol.for("react.memo_cache_sentinel")?(c=a.jsx(Z,{children:a.jsx("div",{className:"p-4",children:a.jsx(ae,{className:"h-40 w-full"})})}),t[0]=c):c=t[0],c}if(!l.data){let c;t[1]!==e?(c=e("settings.jira.connectTitle"),t[1]=e,t[2]=c):c=t[2];let m;t[3]!==e?(m=e("settings.jira.connectDescription"),t[3]=e,t[4]=m):m=t[4];let f;t[5]===Symbol.for("react.memo_cache_sentinel")?(f=a.jsx(vt,{}),t[5]=f):f=t[5];let p;return t[6]!==c||t[7]!==m?(p=a.jsx(Z,{children:a.jsx(H,{title:c,description:m,children:f})}),t[6]=c,t[7]=m,t[8]=p):p=t[8],p}const s=l.data;let n,i,r;t[9]!==s?(n=a.jsx(wt,{integration:s}),i=a.jsx(Tt,{integration:s}),r=s.boardId&&a.jsx(kt,{integration:s}),t[9]=s,t[10]=n,t[11]=i,t[12]=r):(n=t[10],i=t[11],r=t[12]);let o,d;t[13]!==s?(o=a.jsx(Rt,{integration:s}),d=a.jsx(Ot,{integration:s}),t[13]=s,t[14]=o,t[15]=d):(o=t[14],d=t[15]);let u;return t[16]!==n||t[17]!==i||t[18]!==r||t[19]!==o||t[20]!==d?(u=a.jsxs(Z,{children:[n,i,r,o,d]}),t[16]=n,t[17]=i,t[18]=r,t[19]=o,t[20]=d,t[21]=u):u=t[21],u}function Et(){const t=P.c(19),e=L();let l;t[0]!==e?(l=e("settings.nav.tasks"),t[0]=e,t[1]=l):l=t[1];let s;t[2]!==l?(s=a.jsx(se.Title,{children:l}),t[2]=l,t[3]=s):s=t[3];let n,i,r,o;t[4]===Symbol.for("react.memo_cache_sentinel")?(n=a.jsx(Le,{}),i=a.jsx(jt,{}),r=a.jsx(mt,{}),o=a.jsx(Ue,{}),t[4]=n,t[5]=i,t[6]=r,t[7]=o):(n=t[4],i=t[5],r=t[6],o=t[7]);let d;t[8]===Symbol.for("react.memo_cache_sentinel")?(d=a.jsx(Xe,{size:18}),t[8]=d):d=t[8];let u;t[9]!==e?(u=e("settings.jira.sectionTitle"),t[9]=e,t[10]=u):u=t[10];let c;t[11]!==u?(c=a.jsxs("span",{className:"flex items-center gap-2",children:[d,u]}),t[11]=u,t[12]=c):c=t[12];let m;t[13]===Symbol.for("react.memo_cache_sentinel")?(m=a.jsx(Kt,{}),t[13]=m):m=t[13];let f;t[14]!==c?(f=a.jsx(de,{title:c,children:m}),t[14]=c,t[15]=f):f=t[15];let p;return t[16]!==s||t[17]!==f?(p=a.jsx(se,{children:a.jsx(se.Content,{children:a.jsx(se.Body,{children:a.jsxs(ke,{children:[s,n,i,r,o,f]})})})}),t[16]=s,t[17]=f,t[18]=p):p=t[18],p}function As(){const t=P.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx(Ve,{capability:"org:manage",area:"settings",children:a.jsx(Et,{})}),t[0]=e):e=t[0],e}export{As as default};
1
+ import{c as P,r as U,j as a,l as X,B as G,W as z,a7 as J,K as Q,m as ee,n as V,e as Y,b as L,dq as Z,dr as H,dp as de,b6 as ae,t as F,P as se,ds as ke,p as Re}from"./index-KlN2gCIz.js";import{I as le}from"./input-HEtJVl9i.js";import{i as ge}from"./Check-DFpZ57WE.js";import{i as pe}from"./ChevronSelectorVertical-C36SdIlf.js";import{a as Oe,c as Ke,d as Ee,e as Ie,b as Be,C as De}from"./command-C_Uammpe.js";import{a as $e,P as Me,b as Fe}from"./popover-DMAen6H4.js";import{S as qe}from"./switch-D_k4Qu1u.js";import{c as xe,d as he,b as je,f as ye,g as be,e as Se,a as ve,A as Ce}from"./alert-dialog-CcHS-XLY.js";import{d as ne,a as _e,b as Ne,c as we,S as Te}from"./select-BqDsJm6t.js";import{R as Le,A as Ue}from"./review-settings-DOzVKzXE.js";import{t as ze}from"./cards-GrxitjN9.js";import{p as Je,A as Qe}from"./config-BGIQidIa.js";import{u as me}from"./use-organization-settings-Bm9CU7A0.js";import{s as Ge}from"./Plus-B4HOF1E1.js";import{s as We}from"./Trash01-RcSuYrVJ.js";import{T as Ae}from"./textarea-BvwRrfOE.js";import{f as He}from"./task-board-B75_z9Rj.js";import{R as Ve}from"./require-capability-BcT35GEL.js";import"./index-BbTCpGvf.js";import"./dialog-oJmEQ7fd.js";import"./SearchMd-BL3yOzl8.js";import"./ChevronUp-DoFbOo5V.js";import"./UserSquare-DAvB_kFJ.js";import"./GitBranch01-C4EIccIA.js";import"./folder-icon-Bp7D1Lcv.js";import"./Eye-BC_4l4lG.js";import"./DotsVertical-DJWfzfak.js";import"./Download01-DsQzO8cd.js";import"./Share07-K9acKdZ2.js";import"./Globe01-DHMT8bp9.js";import"./Key01-a9vi-Tku.js";import"./Palette-CzJtqmLV.js";import"./Zap-B1-2Q3w4.js";import"./dropdown-menu-DwjXZoet.js";import"./ChevronRight-B0k8i06h.js";import"./file-type-icon-D_Zgk3qT.js";import"./decopilot-sse-pool-CGjOzfxR.js";import"./backoff-CrEUbyZT.js";import"./use-decopilot-events-CjxND1rZ.js";import"./AlertCircle-mzPvygUw.js";import"./ThumbsUp-DZtUuNqz.js";import"./CheckCircle-BL9fUGh0.js";import"./Shield01-B2le5qB9.js";import"./constants-DNuUCxmW.js";import"./schema-84vLWA89.js";import"./access-gate-Bqb_IoZo.js";import"./capability-load-error-BsnWRA5W.js";function Ye(t){const e=P.c(41),{options:l,value:s,onChange:n,placeholder:i,triggerClassName:r,contentClassName:o,width:d,renderTrigger:u,renderItem:c,emptyMessage:m,searchPlaceholder:f,filter:p}=t,h=i===void 0?"Select...":i,y=d===void 0?"w-[200px]":d,b=m===void 0?"No results found.":m,S=f===void 0?"Search...":f;let g;e[0]!==s?(g=q=>q.value===s,e[0]=s,e[1]=g):g=e[1];const x=l.find(g),[j,C]=U.useState(!1),v=Me,_=$e,N=!0,w=u?a.jsx("div",{className:X("cursor-pointer",r),children:u(x)}):a.jsxs(G,{variant:"outline",role:"combobox",className:X("justify-between",y,r),children:[x?x.label:h,a.jsx(pe,{className:"opacity-50"})]});let A;e[2]!==_||e[3]!==w?(A=a.jsx(_,{asChild:N,children:w}),e[2]=_,e[3]=w,e[4]=A):A=e[4];let k;e[5]!==o?(k=X("p-0",o),e[5]=o,e[6]=k):k=e[6];let O;e[7]===Symbol.for("react.memo_cache_sentinel")?(O={width:"var(--radix-popover-trigger-width)"},e[7]=O):O=e[7];let K;e[8]!==S?(K=a.jsx(Oe,{placeholder:S,className:"h-9"}),e[8]=S,e[9]=K):K=e[9];let I;e[10]!==b?(I=a.jsx(Ke,{children:b}),e[10]=b,e[11]=I):I=e[11];let E;if(e[12]!==n||e[13]!==l||e[14]!==c||e[15]!==C||e[16]!==s){let q;e[18]!==n||e[19]!==c||e[20]!==C||e[21]!==s?(q=R=>{const te=s===R.value;return a.jsx(Ee,{value:R.label,onSelect:()=>{n(R.value===s?"":R.value),C(!1)},children:c?c(R,te):a.jsxs(a.Fragment,{children:[R.label,a.jsx(ge,{className:X("ml-auto",te?"opacity-100":"opacity-0")})]})},R.value)},e[18]=n,e[19]=c,e[20]=C,e[21]=s,e[22]=q):q=e[22],E=l.map(q),e[12]=n,e[13]=l,e[14]=c,e[15]=C,e[16]=s,e[17]=E}else E=e[17];let T;e[23]!==E?(T=a.jsx(Ie,{children:E}),e[23]=E,e[24]=T):T=e[24];let M;e[25]!==I||e[26]!==T?(M=a.jsxs(Be,{children:[I,T]}),e[25]=I,e[26]=T,e[27]=M):M=e[27];let B;e[28]!==p||e[29]!==K||e[30]!==M?(B=a.jsxs(De,{filter:p,children:[K,M]}),e[28]=p,e[29]=K,e[30]=M,e[31]=B):B=e[31];let D;e[32]!==B||e[33]!==k?(D=a.jsx(Fe,{className:k,style:O,children:B}),e[32]=B,e[33]=k,e[34]=D):D=e[34];let $;return e[35]!==v||e[36]!==j||e[37]!==C||e[38]!==D||e[39]!==A?($=a.jsxs(v,{open:j,onOpenChange:C,children:[A,D]}),e[35]=v,e[36]=j,e[37]=C,e[38]=D,e[39]=A,e[40]=$):$=e[40],$}function Xe(t){const e=P.c(4),{size:l,className:s}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=a.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 i;return e[1]!==s||e[2]!==l?(i=a.jsx("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"#2684FF","aria-hidden":"true",className:s,children:n}),e[1]=s,e[2]=l,e[3]=i):i=e[3],i}function Pe(t){const e=t.projectName?.replace(/\s+/g," ").trim(),l=t.name.trim();return e?{primary:e,secondary:[l,t.projectKey].filter(Boolean).join(" · ")}:{primary:l,secondary:t.projectKey??""}}function Ze(t){const{primary:e,secondary:l}=Pe(t);return[e,l,`#${t.id}`].filter(Boolean).join(" ")}function ue(t){return t.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase()}function et(t,e){const l=ue(e).trim();if(!l)return 1;const s=ue(t);return l.split(/\s+/).every(n=>s.includes(n))?1:0}function tt(){const t=P.c(7),{org:e}=z(),l=J();let s;t[0]!==e.id?(s=Q.jiraIntegration(e.id),t[0]=e.id,t[1]=s):s=t[1];let n;t[2]!==l?(n=async()=>(await l.call("JIRA_INTEGRATION_GET",{})).integration,t[2]=l,t[3]=n):n=t[3];let i;return t[4]!==s||t[5]!==n?(i={queryKey:s,queryFn:n},t[4]=s,t[5]=n,t[6]=i):i=t[6],ee(i)}function re(){const t=P.c(8),{org:e}=z(),l=J(),s=V();let n;t[0]!==l?(n=async o=>(await l.call("JIRA_INTEGRATION_UPSERT",o)).integration,t[0]=l,t[1]=n):n=t[1];let i;t[2]!==e||t[3]!==s?(i=()=>s.invalidateQueries({queryKey:Q.jiraIntegration(e.id)}),t[2]=e,t[3]=s,t[4]=i):i=t[4];let r;return t[5]!==n||t[6]!==i?(r={mutationFn:n,onSettled:i},t[5]=n,t[6]=i,t[7]=r):r=t[7],Y(r)}function st(){const t=P.c(8),{org:e}=z(),l=J(),s=V();let n;t[0]!==l?(n=()=>l.call("JIRA_INTEGRATION_DELETE",{}),t[0]=l,t[1]=n):n=t[1];let i;t[2]!==e||t[3]!==s?(i=()=>s.invalidateQueries({queryKey:Q.jiraIntegration(e.id)}),t[2]=e,t[3]=s,t[4]=i):i=t[4];let r;return t[5]!==n||t[6]!==i?(r={mutationFn:n,onSettled:i},t[5]=n,t[6]=i,t[7]=r):r=t[7],Y(r)}function it(t){const e=P.c(8),{org:l}=z(),s=J();let n;e[0]!==l.id?(n=Q.jiraBoards(l.id),e[0]=l.id,e[1]=n):n=e[1];let i;e[2]!==s?(i=async()=>(await s.call("JIRA_BOARDS_LIST",{})).boards,e[2]=s,e[3]=i):i=e[3];let r;return e[4]!==t||e[5]!==n||e[6]!==i?(r={queryKey:n,enabled:t,staleTime:6e4,queryFn:i},e[4]=t,e[5]=n,e[6]=i,e[7]=r):r=e[7],ee(r)}function lt(t){const e=P.c(10),{org:l}=z(),s=J();let n;e[0]!==t||e[1]!==l.id?(n=Q.jiraBoardColumns(l.id,t??""),e[0]=t,e[1]=l.id,e[2]=n):n=e[2];const i=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]!==i||e[8]!==r?(o={queryKey:n,enabled:i,staleTime:6e4,queryFn:r},e[6]=n,e[7]=i,e[8]=r,e[9]=o):o=e[9],ee(o)}function nt(){const t=P.c(8),{org:e}=z(),l=J(),s=V();let n;t[0]!==l?(n=async()=>(await l.call("JIRA_SYNC_RUN",{})).result,t[0]=l,t[1]=n):n=t[1];let i;t[2]!==e||t[3]!==s?(i=()=>s.invalidateQueries({queryKey:Q.jiraIntegration(e.id)}),t[2]=e,t[3]=s,t[4]=i):i=t[4];let r;return t[5]!==n||t[6]!==i?(r={mutationFn:n,onSettled:i},t[5]=n,t[6]=i,t[7]=r):r=t[7],Y(r)}function at(){const t=P.c(8),{org:e}=z(),l=J(),s=V();let n;t[0]!==l?(n=async()=>await l.call("JIRA_RESYNC_REQUEST",{}),t[0]=l,t[1]=n):n=t[1];let i;t[2]!==e||t[3]!==s?(i=()=>s.invalidateQueries({queryKey:Q.jiraIntegration(e.id)}),t[2]=e,t[3]=s,t[4]=i):i=t[4];let r;return t[5]!==n||t[6]!==i?(r={mutationFn:n,onSettled:i},t[5]=n,t[6]=i,t[7]=r):r=t[7],Y(r)}function rt(){const t=P.c(8),{locator:e}=z(),l=J(),s=V();let n;t[0]!==l?(n=async o=>await l.call("TASK_BOARD_COLUMN_ROLE_SET",{columnKey:o.columnKey,role:o.role}),t[0]=l,t[1]=n):n=t[1];let i;t[2]!==e||t[3]!==s?(i=()=>s.invalidateQueries({queryKey:Q.taskBoardItems(e)}),t[2]=e,t[3]=s,t[4]=i):i=t[4];let r;return t[5]!==n||t[6]!==i?(r={mutationFn:n,onSettled:i},t[5]=n,t[6]=i,t[7]=r):r=t[7],Y(r)}function ot(){const t=P.c(12),{locator:e}=z(),l=J();let s;t[0]!==e?(s=Q.taskBoardColumnAutomations(e),t[0]=e,t[1]=s):s=t[1];let n;t[2]!==l?(n=async()=>{const{automations:u}=await l.call("TASK_BOARD_AUTOMATION_LIST",{});return u},t[2]=l,t[3]=n):n=t[3];let i;t[4]!==s||t[5]!==n?(i={queryKey:s,queryFn:n},t[4]=s,t[5]=n,t[6]=i):i=t[6];const r=ee(i);let o;t[7]!==r.data?(o=r.data??[],t[7]=r.data,t[8]=o):o=t[8];let d;return t[9]!==r.isPending||t[10]!==o?(d={automations:o,isPending:r.isPending},t[9]=r.isPending,t[10]=o,t[11]=d):d=t[11],d}function ct(){const t=P.c(8),{locator:e}=z(),l=J(),s=V();let n;t[0]!==l?(n=async o=>{if(o.prompt===null){await l.call("TASK_BOARD_AUTOMATION_DELETE",{columnKey:o.columnKey});return}await l.call("TASK_BOARD_AUTOMATION_UPSERT",{columnKey:o.columnKey,prompt:o.prompt.trim()===""?void 0:o.prompt})},t[0]=l,t[1]=n):n=t[1];let i;t[2]!==s||t[3]!==e?(i=()=>s.invalidateQueries({queryKey:Q.taskBoardColumnAutomations(e)}),t[2]=s,t[3]=e,t[4]=i):i=t[4];let r;return t[5]!==n||t[6]!==i?(r={mutationFn:n,onSuccess:i},t[5]=n,t[6]=i,t[7]=r):r=t[7],Y(r)}const oe="__none__",dt=[{value:"in_progress",labelKey:"settings.boardColumns.whenRunStarts"},{value:"in_review",labelKey:"settings.boardColumns.whenRunFinishes"},{value:"archived",labelKey:"settings.boardColumns.whenMergedAndSettled"},{value:"todo",labelKey:"settings.boardColumns.whenRunFailsOut"}];function mt(){const t=P.c(16),e=L();if(!me("org_board_columns"))return null;let s;t[0]!==e?(s=e("settings.boardColumns.title"),t[0]=e,t[1]=s):s=t[1];let n;t[2]!==e?(n=e("settings.boardColumns.description"),t[2]=e,t[3]=n):n=t[3];let i;t[4]!==e?(i=e("settings.boardColumns.fieldLabel"),t[4]=e,t[5]=i):i=t[5];let r;t[6]!==e?(r=e("settings.boardColumns.fieldDescription"),t[6]=e,t[7]=r):r=t[7];let o;t[8]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(ut,{}),t[8]=o):o=t[8];let d;t[9]!==i||t[10]!==r?(d=a.jsx(Z,{children:a.jsx(H,{title:i,description:r,children:o})}),t[9]=i,t[10]=r,t[11]=d):d=t[11];let u;return t[12]!==s||t[13]!==n||t[14]!==d?(u=a.jsx(de,{title:s,description:n,children:d}),t[12]=s,t[13]=n,t[14]=d,t[15]=u):u=t[15],u}function ut(){const t=P.c(14),e=L(),{columns:l,isLoading:s}=Je(),{automations:n,isPending:i}=ot();if(s||i){let c;return t[0]===Symbol.for("react.memo_cache_sentinel")?(c=a.jsx(ae,{className:"h-40 w-full"}),t[0]=c):c=t[0],c}if(l.length===0){let c;t[1]!==e?(c=e("settings.jira.noColumnsYet"),t[1]=e,t[2]=c):c=t[2];let m;return t[3]!==c?(m=a.jsx("p",{className:"text-xs text-muted-foreground",children:c}),t[3]=c,t[4]=m):m=t[4],m}let r;t[5]!==n?(r=new Map(n.map(ft)),t[5]=n,t[6]=r):r=t[6];const o=r;let d;if(t[7]!==l||t[8]!==o){let c;t[10]!==o?(c=m=>a.jsx(gt,{columnKey:m.key,title:m.title,trigger:m.role,hasAutomation:o.has(m.key),prompt:o.get(m.key)??null},m.key),t[10]=o,t[11]=c):c=t[11],d=l.map(c),t[7]=l,t[8]=o,t[9]=d}else d=t[9];let u;return t[12]!==d?(u=a.jsx("div",{className:"flex w-full flex-col gap-3",children:d}),t[12]=d,t[13]=u):u=t[13],u}function ft(t){return[t.columnKey,t.prompt]}function gt(t){const e=P.c(45),{columnKey:l,title:s,trigger:n,hasAutomation:i,prompt:r}=t,o=L(),d=rt(),u=ct(),[c,m]=U.useState(r??""),[f,p]=U.useState(r);f!==r&&(p(r),m(r??""));let h;e[0]!==o?(h=()=>F.error(o("settings.boardColumns.saveFailed")),e[0]=o,e[1]=h):h=e[1];const y=h;let b;e[2]!==l||e[3]!==y||e[4]!==u?(b=T=>u.mutate({columnKey:l,prompt:T},{onError:y}),e[2]=l,e[3]=y,e[4]=u,e[5]=b):b=e[5];const S=b;let g;e[6]!==s?(g=a.jsx("span",{className:"truncate text-sm font-medium",children:s}),e[6]=s,e[7]=g):g=e[7];let x;e[8]!==o?(x=o("settings.boardColumns.moveHereWhen"),e[8]=o,e[9]=x):x=e[9];let j;e[10]!==x?(j=a.jsx("span",{className:"text-xs text-muted-foreground",children:x}),e[10]=x,e[11]=j):j=e[11];const C=n??oe;let v;e[12]!==l||e[13]!==y||e[14]!==d?(v=T=>d.mutate({columnKey:l,role:T===oe?null:T},{onError:y}),e[12]=l,e[13]=y,e[14]=d,e[15]=v):v=e[15];let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_=a.jsx(_e,{className:"w-64",children:a.jsx(Ne,{})}),e[16]=_):_=e[16];let N;e[17]!==o?(N=o("settings.boardColumns.whenNever"),e[17]=o,e[18]=N):N=e[18];let w;e[19]!==N?(w=a.jsx(ne,{value:oe,children:N}),e[19]=N,e[20]=w):w=e[20];let A;e[21]!==o?(A=dt.map(T=>a.jsx(ne,{value:T.value,children:o(T.labelKey)},T.value)),e[21]=o,e[22]=A):A=e[22];let k;e[23]!==w||e[24]!==A?(k=a.jsxs(we,{children:[w,A]}),e[23]=w,e[24]=A,e[25]=k):k=e[25];let O;e[26]!==k||e[27]!==C||e[28]!==v?(O=a.jsxs(Te,{value:C,onValueChange:v,children:[_,k]}),e[26]=k,e[27]=C,e[28]=v,e[29]=O):O=e[29];let K;e[30]!==O||e[31]!==j?(K=a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[j,O]}),e[30]=O,e[31]=j,e[32]=K):K=e[32];let I;e[33]!==l||e[34]!==c||e[35]!==i||e[36]!==r||e[37]!==S||e[38]!==o||e[39]!==s?(I=i?a.jsxs("div",{className:"flex flex-col gap-2 rounded-lg bg-muted/40 p-2.5",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx("span",{className:"text-xs font-medium",children:o("settings.boardColumns.automationOn")}),a.jsx(G,{variant:"ghost",size:"sm","aria-label":o("settings.boardColumns.removeAriaLabel",{column:s}),onClick:()=>S(null),children:a.jsx(We,{size:14})})]}),a.jsx(Ae,{value:c,rows:2,placeholder:o("settings.boardColumns.promptPlaceholder"),onChange:T=>m(T.target.value),onBlur:()=>{c!==(r??"")&&S(c)},"data-column-automation-prompt":l}),a.jsx("p",{className:"text-xs text-muted-foreground",children:o("settings.boardColumns.promptHelp")})]}):a.jsxs(G,{variant:"outline",size:"sm",className:"w-fit",onClick:()=>S(""),children:[a.jsx(Ge,{size:14}),o("settings.boardColumns.addAutomation")]}),e[33]=l,e[34]=c,e[35]=i,e[36]=r,e[37]=S,e[38]=o,e[39]=s,e[40]=I):I=e[40];let E;return e[41]!==K||e[42]!==I||e[43]!==g?(E=a.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-border p-3",children:[g,K,I]}),e[41]=K,e[42]=I,e[43]=g,e[44]=E):E=e[44],E}function pt(){const t=P.c(12),{org:e}=z(),l=J();let s;t[0]!==e.id?(s=Q.taskBoardPrompts(e.id),t[0]=e.id,t[1]=s):s=t[1];let n;t[2]!==l?(n=async()=>(await l.call("TASK_BOARD_PROMPT_LIST",{})).prompts,t[2]=l,t[3]=n):n=t[3];let i;t[4]!==s||t[5]!==n?(i={queryKey:s,staleTime:6e4,queryFn:n},t[4]=s,t[5]=n,t[6]=i):i=t[6];const r=ee(i);let o;t[7]!==r.data?(o=r.data?.find(xt)?.prompt??"",t[7]=r.data,t[8]=o):o=t[8];let d;return t[9]!==r.isPending||t[10]!==o?(d={prompt:o,isPending:r.isPending},t[9]=r.isPending,t[10]=o,t[11]=d):d=t[11],d}function xt(t){return t.columnKey===null}function ht(){const t=P.c(8),{org:e}=z(),l=J(),s=V();let n;t[0]!==l?(n=async o=>{const d=o.trim();if(!d){await l.call("TASK_BOARD_PROMPT_DELETE",{});return}await l.call("TASK_BOARD_PROMPT_UPSERT",{prompt:d})},t[0]=l,t[1]=n):n=t[1];let i;t[2]!==e||t[3]!==s?(i=()=>s.invalidateQueries({queryKey:Q.taskBoardPrompts(e.id)}),t[2]=e,t[3]=s,t[4]=i):i=t[4];let r;return t[5]!==n||t[6]!==i?(r={mutationFn:n,onSettled:i},t[5]=n,t[6]=i,t[7]=r):r=t[7],Y(r)}function jt(){const t=P.c(16),e=L(),{prompt:l,isPending:s}=pt(),n=ht(),[i,r]=U.useState(l),[o,d]=U.useState(l);o!==l&&(d(l),r(l));let u;t[0]!==e?(u=e("settings.taskPrompt.title"),t[0]=e,t[1]=u):u=t[1];let c;t[2]!==e?(c=e("settings.taskPrompt.fieldLabel"),t[2]=e,t[3]=c):c=t[3];let m;t[4]!==i||t[5]!==s||t[6]!==l||t[7]!==n||t[8]!==e?(m=s?a.jsx(ae,{className:"h-44 w-full"}):a.jsxs("div",{className:"flex flex-col items-start gap-2",children:[a.jsx(Ae,{value:i,rows:10,maxLength:He,placeholder:e("settings.taskPrompt.placeholder"),onChange:h=>r(h.target.value)}),a.jsx(G,{size:"sm",disabled:i===l||n.isPending,onClick:()=>n.mutate(i,{onSuccess:()=>F.success(e("settings.taskPrompt.saved")),onError:()=>F.error(e("settings.taskPrompt.failed"))}),children:e("settings.taskPrompt.save")})]}),t[4]=i,t[5]=s,t[6]=l,t[7]=n,t[8]=e,t[9]=m):m=t[9];let f;t[10]!==c||t[11]!==m?(f=a.jsx(Z,{children:a.jsx(H,{title:c,children:m})}),t[10]=c,t[11]=m,t[12]=f):f=t[12];let p;return t[13]!==u||t[14]!==f?(p=a.jsx(de,{title:u,children:f}),t[13]=u,t[14]=f,t[15]=p):p=t[15],p}function ie(t,e){const l=e.statuses[0];if(l)return Object.entries(t).find(([,s])=>s.includes(l))?.[0]}const fe=[{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:"approved",labelKey:"taskBoard.config.statusApproved"},{value:"merged",labelKey:"taskBoard.config.statusMerged"},{value:"post_deploy_validation",labelKey:"taskBoard.config.statusPostDeployValidation"},{value:"done",labelKey:"taskBoard.config.statusDone"},{value:"archived",labelKey:"taskBoard.config.statusArchived"}];function yt(t,e){return t?fe:fe.filter(l=>!Qe(l.value)||l.value===e)}const ce="__dont_sync__";function W(t,e){return t instanceof Error?t.message:e}const bt="https://id.atlassian.com/manage-profile/security/api-tokens";function St(t){const e=P.c(7),{stepKeys:l}=t,s=L();let n;if(e[0]!==l||e[1]!==s){let r;e[3]!==s?(r=o=>a.jsx("li",{children:s(o)},o),e[3]=s,e[4]=r):r=e[4],n=l.map(r),e[0]=l,e[1]=s,e[2]=n}else n=e[2];let i;return e[5]!==n?(i=a.jsx("ol",{className:"list-decimal pl-5 flex flex-col gap-1 text-xs text-muted-foreground",children:n}),e[5]=n,e[6]=i):i=e[6],i}function vt(){const t=P.c(69),e=L(),l=re(),[s,n]=U.useState(""),[i,r]=U.useState(""),[o,d]=U.useState("");let u;t[0]!==o||t[1]!==i||t[2]!==s?(u=s.trim()!==""&&i.trim()!==""&&o.trim()!=="",t[0]=o,t[1]=i,t[2]=s,t[3]=u):u=t[3];const c=u;let m;t[4]!==e?(m=e("settings.jira.siteLabel"),t[4]=e,t[5]=m):m=t[5];let f;t[6]!==m?(f=a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:m}),t[6]=m,t[7]=f):f=t[7];let p;t[8]===Symbol.for("react.memo_cache_sentinel")?(p=R=>n(R.target.value),t[8]=p):p=t[8];let h;t[9]!==e?(h=e("settings.jira.sitePlaceholder"),t[9]=e,t[10]=h):h=t[10];let y;t[11]!==s||t[12]!==h?(y=a.jsx(le,{value:s,onChange:p,placeholder:h,autoComplete:"off"}),t[11]=s,t[12]=h,t[13]=y):y=t[13];let b;t[14]!==f||t[15]!==y?(b=a.jsxs("div",{className:"flex flex-col gap-1.5",children:[f,y]}),t[14]=f,t[15]=y,t[16]=b):b=t[16];let S;t[17]!==e?(S=e("settings.jira.emailLabel"),t[17]=e,t[18]=S):S=t[18];let g;t[19]!==S?(g=a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:S}),t[19]=S,t[20]=g):g=t[20];let x;t[21]===Symbol.for("react.memo_cache_sentinel")?(x=R=>r(R.target.value),t[21]=x):x=t[21];let j;t[22]!==e?(j=e("settings.jira.emailPlaceholder"),t[22]=e,t[23]=j):j=t[23];let C;t[24]!==i||t[25]!==j?(C=a.jsx(le,{value:i,onChange:x,placeholder:j,autoComplete:"off"}),t[24]=i,t[25]=j,t[26]=C):C=t[26];let v;t[27]!==C||t[28]!==g?(v=a.jsxs("div",{className:"flex flex-col gap-1.5",children:[g,C]}),t[27]=C,t[28]=g,t[29]=v):v=t[29];let _;t[30]!==e?(_=e("settings.jira.tokenLabel"),t[30]=e,t[31]=_):_=t[31];let N;t[32]!==_?(N=a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:_}),t[32]=_,t[33]=N):N=t[33];let w;t[34]!==e?(w=e("settings.jira.createTokenLink"),t[34]=e,t[35]=w):w=t[35];let A;t[36]===Symbol.for("react.memo_cache_sentinel")?(A=a.jsx(Re,{size:12}),t[36]=A):A=t[36];let k;t[37]!==w?(k=a.jsxs("a",{href:bt,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-0.5 text-xs text-foreground hover:underline",children:[w,A]}),t[37]=w,t[38]=k):k=t[38];let O;t[39]!==N||t[40]!==k?(O=a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[N,k]}),t[39]=N,t[40]=k,t[41]=O):O=t[41];let K;t[42]===Symbol.for("react.memo_cache_sentinel")?(K=R=>d(R.target.value),t[42]=K):K=t[42];let I;t[43]!==e?(I=e("settings.jira.tokenPlaceholder"),t[43]=e,t[44]=I):I=t[44];let E;t[45]!==o||t[46]!==I?(E=a.jsx(le,{type:"password",value:o,onChange:K,placeholder:I,autoComplete:"off"}),t[45]=o,t[46]=I,t[47]=E):E=t[47];let T;t[48]!==O||t[49]!==E?(T=a.jsxs("div",{className:"flex flex-col gap-1.5",children:[O,E]}),t[48]=O,t[49]=E,t[50]=T):T=t[50];const M=!c||l.isPending;let B;t[51]!==o||t[52]!==i||t[53]!==s||t[54]!==e||t[55]!==l?(B=()=>l.mutate({siteUrl:s.trim(),email:i.trim(),apiToken:o.trim()},{onSuccess:()=>F.success(e("settings.jira.connected")),onError:R=>F.error(W(R,e("settings.jira.connectFailed")))}),t[51]=o,t[52]=i,t[53]=s,t[54]=e,t[55]=l,t[56]=B):B=t[56];let D;t[57]!==e||t[58]!==l.isPending?(D=l.isPending?e("settings.jira.connecting"):e("settings.jira.connect"),t[57]=e,t[58]=l.isPending,t[59]=D):D=t[59];let $;t[60]!==M||t[61]!==B||t[62]!==D?($=a.jsx(G,{size:"sm",className:"w-fit",disabled:M,onClick:B,children:D}),t[60]=M,t[61]=B,t[62]=D,t[63]=$):$=t[63];let q;return t[64]!==v||t[65]!==T||t[66]!==$||t[67]!==b?(q=a.jsxs("div",{className:"flex flex-col gap-4 mt-3 max-w-md",children:[b,v,T,$]}),t[64]=v,t[65]=T,t[66]=$,t[67]=b,t[68]=q):q=t[68],q}function Ct(t){const e=P.c(7),{integration:l}=t,s=L();if(l.lastSyncError){let r;return e[0]!==l.lastSyncError?(r=a.jsx("p",{className:"text-xs text-destructive truncate",children:l.lastSyncError}),e[0]=l.lastSyncError,e[1]=r):r=e[1],r}let n;e[2]!==l.lastSyncedAt||e[3]!==s?(n=l.lastSyncedAt?s("settings.jira.lastSynced",{ago:ze(l.lastSyncedAt)}):s("settings.jira.waitingFirstSync"),e[2]=l.lastSyncedAt,e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==n?(i=a.jsx("p",{className:"text-xs text-muted-foreground",children:n}),e[5]=n,e[6]=i):i=e[6],i}function _t(t){const e=P.c(35),{integration:l}=t,s=L(),n=re(),i=lt(l.boardId),r=me("delivery_lanes_enabled"),[o,d]=U.useState(l.statusMapping),[u,c]=U.useState(l);if(u!==l&&(c(l),d(l.statusMapping)),i.isPending){let g;return e[0]===Symbol.for("react.memo_cache_sentinel")?(g=a.jsx(ae,{className:"h-24 w-full mt-3"}),e[0]=g):g=e[0],g}if(i.isError){let g;e[1]!==i.error||e[2]!==s?(g=W(i.error,s("settings.jira.columnsFailed")),e[1]=i.error,e[2]=s,e[3]=g):g=e[3];let x;return e[4]!==g?(x=a.jsx("p",{className:"text-xs text-destructive mt-3",children:g}),e[4]=g,e[5]=x):x=e[5],x}let m;e[6]!==i.data||e[7]!==o||e[8]!==s||e[9]!==n?(m=function(x,j){const C=o,v={};for(const _ of i.data??[]){const N=_.name===x.name?j===ce?void 0:j:ie(o,_);N&&(v[N]=[...v[N]??[],..._.statuses])}d(v),n.mutate({statusMapping:v},{onError:_=>{d(C),F.error(W(_,s("settings.jira.saveFailed")))}})},e[6]=i.data,e[7]=o,e[8]=s,e[9]=n,e[10]=m):m=e[10];const f=m;let p,h;if(e[11]!==i.data||e[12]!==o||e[13]!==s){let g;e[16]!==o?(g=j=>!ie(o,j),e[16]=o,e[17]=g):g=e[17];const x=(i.data??[]).filter(g);p="flex flex-col mt-3",h=x.length>0&&a.jsx("p",{className:"mb-2 rounded-md bg-warning/10 px-3 py-2 text-xs text-warning",children:s("settings.jira.unmappedWarning",{columns:x.map(Nt).join(", ")})}),e[11]=i.data,e[12]=o,e[13]=s,e[14]=p,e[15]=h}else p=e[14],h=e[15];let y;e[18]!==i.data?(y=i.data??[],e[18]=i.data,e[19]=y):y=e[19];let b;if(e[20]!==r||e[21]!==o||e[22]!==f||e[23]!==s||e[24]!==y){let g;e[26]!==r||e[27]!==o||e[28]!==f||e[29]!==s?(g=x=>a.jsxs("div",{className:"flex items-center justify-between gap-4 py-2.5 border-b border-border/60 last:border-b-0",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("span",{className:"text-sm truncate",children:x.name}),(x.statuses.length>1||x.statuses[0]!==x.name)&&a.jsx("p",{className:"text-xs text-muted-foreground truncate",children:x.statuses.join(", ")})]}),a.jsxs(Te,{value:ie(o,x)??ce,onValueChange:j=>f(x,j),children:[a.jsx(_e,{className:"w-44 shrink-0",children:a.jsx(Ne,{})}),a.jsxs(we,{children:[a.jsx(ne,{value:ce,children:s("settings.jira.dontSync")}),yt(r,ie(o,x)).map(j=>a.jsx(ne,{value:j.value,children:s(j.labelKey)},j.value))]})]})]},x.name),e[26]=r,e[27]=o,e[28]=f,e[29]=s,e[30]=g):g=e[30],b=y.map(g),e[20]=r,e[21]=o,e[22]=f,e[23]=s,e[24]=y,e[25]=b}else b=e[25];let S;return e[31]!==p||e[32]!==h||e[33]!==b?(S=a.jsxs("div",{className:p,children:[h,b]}),e[31]=p,e[32]=h,e[33]=b,e[34]=S):S=e[34],S}function Nt(t){return t.name}function wt(t){const e=P.c(44),{integration:l}=t,s=L(),n=st(),[i,r]=U.useState(!1),o=l.siteUrl,d=l.email;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=()=>r(!0),e[0]=u):u=e[0];let c;e[1]!==s?(c=s("settings.jira.disconnect"),e[1]=s,e[2]=c):c=e[2];let m;e[3]!==c?(m=a.jsx(G,{variant:"outline",size:"sm",onClick:u,children:c}),e[3]=c,e[4]=m):m=e[4];let f;e[5]!==l.email||e[6]!==l.siteUrl||e[7]!==m?(f=a.jsx(H,{title:o,description:d,action:m}),e[5]=l.email,e[6]=l.siteUrl,e[7]=m,e[8]=f):f=e[8];let p;e[9]!==s?(p=s("settings.jira.disconnectTitle"),e[9]=s,e[10]=p):p=e[10];let h;e[11]!==p?(h=a.jsx(xe,{children:p}),e[11]=p,e[12]=h):h=e[12];let y;e[13]!==s?(y=s("settings.jira.disconnectDescription"),e[13]=s,e[14]=y):y=e[14];let b;e[15]!==y?(b=a.jsx(he,{children:y}),e[15]=y,e[16]=b):b=e[16];let S;e[17]!==b||e[18]!==h?(S=a.jsxs(je,{children:[h,b]}),e[17]=b,e[18]=h,e[19]=S):S=e[19];let g;e[20]!==s?(g=s("settings.jira.cancel"),e[20]=s,e[21]=g):g=e[21];let x;e[22]!==g?(x=a.jsx(ye,{children:g}),e[22]=g,e[23]=x):x=e[23];let j;e[24]!==n||e[25]!==s?(j=()=>n.mutate(void 0,{onSuccess:()=>F.success(s("settings.jira.disconnected")),onError:k=>F.error(W(k,s("settings.jira.saveFailed")))}),e[24]=n,e[25]=s,e[26]=j):j=e[26];let C;e[27]!==s?(C=s("settings.jira.disconnect"),e[27]=s,e[28]=C):C=e[28];let v;e[29]!==j||e[30]!==C?(v=a.jsx(be,{onClick:j,children:C}),e[29]=j,e[30]=C,e[31]=v):v=e[31];let _;e[32]!==x||e[33]!==v?(_=a.jsxs(Se,{children:[x,v]}),e[32]=x,e[33]=v,e[34]=_):_=e[34];let N;e[35]!==S||e[36]!==_?(N=a.jsxs(ve,{children:[S,_]}),e[35]=S,e[36]=_,e[37]=N):N=e[37];let w;e[38]!==i||e[39]!==N?(w=a.jsx(Ce,{open:i,onOpenChange:r,children:N}),e[38]=i,e[39]=N,e[40]=w):w=e[40];let A;return e[41]!==w||e[42]!==f?(A=a.jsxs(a.Fragment,{children:[f,w]}),e[41]=w,e[42]=f,e[43]=A):A=e[43],A}function Tt(t){const e=P.c(36),{integration:l}=t,s=L(),n=re(),i=it(!0);let r,o;e[0]!==i.data||e[1]!==l.boardId||e[2]!==l.boardName?(r=(i.data??[]).map(Pt),o=l.boardId?r.find(x=>x.value===l.boardId)?.primary??l.boardName??l.boardId:null,e[0]=i.data,e[1]=l.boardId,e[2]=l.boardName,e[3]=r,e[4]=o):(r=e[3],o=e[4]);const d=o;let u;e[5]!==s?(u=s("settings.jira.boardLabel"),e[5]=s,e[6]=u):u=e[6];let c;e[7]!==s?(c=s("settings.jira.boardDescription"),e[7]=s,e[8]=c):c=e[8];const m=l.boardId??"";let f;e[9]!==s?(f=s("settings.jira.boardPlaceholder"),e[9]=s,e[10]=f):f=e[10];let p;e[11]!==s?(p=s("settings.jira.boardSearchPlaceholder"),e[11]=s,e[12]=p):p=e[12];let h;e[13]!==i.isPending||e[14]!==s?(h=i.isPending?s("settings.jira.loadingBoards"):s("settings.jira.noBoardsMatch"),e[13]=i.isPending,e[14]=s,e[15]=h):h=e[15];let y;e[16]!==d||e[17]!==s?(y=()=>a.jsxs(G,{variant:"outline",role:"combobox",className:"w-72 justify-between font-normal",children:[a.jsx("span",{className:"truncate",children:d??s("settings.jira.boardPlaceholder")}),a.jsx(pe,{className:"opacity-50 shrink-0"})]}),e[16]=d,e[17]=s,e[18]=y):y=e[18];let b;e[19]!==r||e[20]!==l.boardId||e[21]!==s||e[22]!==n?(b=x=>{!x||x===l.boardId||n.mutate({boardId:x,boardName:r.find(j=>j.value===x)?.primary??null,statusMapping:{},enabled:!1},{onError:j=>F.error(W(j,s("settings.jira.saveFailed")))})},e[19]=r,e[20]=l.boardId,e[21]=s,e[22]=n,e[23]=b):b=e[23];let S;e[24]!==r||e[25]!==m||e[26]!==f||e[27]!==p||e[28]!==h||e[29]!==y||e[30]!==b?(S=a.jsx(Ye,{options:r,value:m,width:"w-72",triggerClassName:"shrink-0",placeholder:f,searchPlaceholder:p,filter:et,emptyMessage:h,renderTrigger:y,renderItem:At,onChange:b}),e[24]=r,e[25]=m,e[26]=f,e[27]=p,e[28]=h,e[29]=y,e[30]=b,e[31]=S):S=e[31];let g;return e[32]!==S||e[33]!==u||e[34]!==c?(g=a.jsx(H,{title:u,description:c,action:S}),e[32]=S,e[33]=u,e[34]=c,e[35]=g):g=e[35],g}function At(t,e){return a.jsxs("div",{className:"flex items-start gap-2 min-w-0 w-full",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("p",{className:"truncate",children:t.primary}),a.jsx("p",{className:"text-xs text-muted-foreground truncate",children:t.secondary})]}),a.jsx(ge,{className:X("mt-0.5 shrink-0",e?"opacity-100":"opacity-0")})]})}function Pt(t){const{primary:e,secondary:l}=Pe(t);return{value:String(t.id),label:Ze(t),primary:e,secondary:l}}function kt(t){const e=P.c(10),{integration:l}=t,s=L();if(me("org_board_columns"))return null;let i;e[0]!==s?(i=s("settings.jira.mappingLabel"),e[0]=s,e[1]=i):i=e[1];let r;e[2]!==s?(r=s("settings.jira.mappingDescription"),e[2]=s,e[3]=r):r=e[3];let o;e[4]!==l?(o=a.jsx(_t,{integration:l}),e[4]=l,e[5]=o):o=e[5];let d;return e[6]!==i||e[7]!==r||e[8]!==o?(d=a.jsx(H,{title:i,description:r,children:o}),e[6]=i,e[7]=r,e[8]=o,e[9]=d):d=e[9],d}function Rt(t){const e=P.c(72),{integration:l}=t,s=L(),n=re(),i=nt(),r=at(),[o,d]=U.useState(!1);let u;e[0]!==l.statusMapping?(u=Object.keys(l.statusMapping),e[0]=l.statusMapping,e[1]=u):u=e[1];const c=u.length>0;let m;e[2]!==s?(m=s("settings.jira.enableLabel"),e[2]=s,e[3]=m):m=e[3];let f;e[4]!==l?(f=a.jsx(Ct,{integration:l}),e[4]=l,e[5]=f):f=e[5];const p=!l.enabled||i.isPending||r.isPending;let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=()=>d(!0),e[6]=h):h=e[6];let y;e[7]!==s?(y=s("settings.jira.resyncAll"),e[7]=s,e[8]=y):y=e[8];let b;e[9]!==p||e[10]!==y?(b=a.jsx(G,{variant:"outline",size:"sm",disabled:p,onClick:h,children:y}),e[9]=p,e[10]=y,e[11]=b):b=e[11];let S;e[12]!==s?(S=s("settings.jira.resyncAllTitle"),e[12]=s,e[13]=S):S=e[13];let g;e[14]!==S?(g=a.jsx(xe,{children:S}),e[14]=S,e[15]=g):g=e[15];let x;e[16]!==s?(x=s("settings.jira.resyncAllDescription"),e[16]=s,e[17]=x):x=e[17];let j;e[18]!==x?(j=a.jsx(he,{children:x}),e[18]=x,e[19]=j):j=e[19];let C;e[20]!==j||e[21]!==g?(C=a.jsxs(je,{children:[g,j]}),e[20]=j,e[21]=g,e[22]=C):C=e[22];let v;e[23]!==s?(v=s("settings.jira.cancel"),e[23]=s,e[24]=v):v=e[24];let _;e[25]!==v?(_=a.jsx(ye,{children:v}),e[25]=v,e[26]=_):_=e[26];let N;e[27]!==r||e[28]!==s?(N=()=>r.mutate(void 0,{onSuccess:()=>F.success(s("settings.jira.resyncAllQueued")),onError:R=>F.error(W(R,s("settings.jira.syncFailed")))}),e[27]=r,e[28]=s,e[29]=N):N=e[29];let w;e[30]!==s?(w=s("settings.jira.resyncAll"),e[30]=s,e[31]=w):w=e[31];let A;e[32]!==N||e[33]!==w?(A=a.jsx(be,{onClick:N,children:w}),e[32]=N,e[33]=w,e[34]=A):A=e[34];let k;e[35]!==_||e[36]!==A?(k=a.jsxs(Se,{children:[_,A]}),e[35]=_,e[36]=A,e[37]=k):k=e[37];let O;e[38]!==C||e[39]!==k?(O=a.jsxs(ve,{children:[C,k]}),e[38]=C,e[39]=k,e[40]=O):O=e[40];let K;e[41]!==o||e[42]!==O||e[43]!==b?(K=a.jsxs(Ce,{open:o,onOpenChange:d,children:[b,O]}),e[41]=o,e[42]=O,e[43]=b,e[44]=K):K=e[44];const I=!l.enabled||i.isPending;let E;e[45]!==i||e[46]!==s?(E=()=>i.mutate(void 0,{onSuccess:R=>{"error"in R?F.error(R.error):F.success(s("settings.jira.syncDone",{created:String(R.created),updated:String(R.updated),archived:String(R.archived)}))},onError:R=>F.error(W(R,s("settings.jira.syncFailed")))}),e[45]=i,e[46]=s,e[47]=E):E=e[47];let T;e[48]!==i.isPending||e[49]!==s?(T=i.isPending?s("settings.jira.syncing"):s("settings.jira.syncNow"),e[48]=i.isPending,e[49]=s,e[50]=T):T=e[50];let M;e[51]!==I||e[52]!==E||e[53]!==T?(M=a.jsx(G,{variant:"outline",size:"sm",disabled:I,onClick:E,children:T}),e[51]=I,e[52]=E,e[53]=T,e[54]=M):M=e[54];let B;e[55]!==c||e[56]!==l.boardId||e[57]!==s||e[58]!==n?(B=R=>{if(R&&(!l.boardId||!c)){F.error(s("settings.jira.enableRequirements"));return}n.mutate({enabled:R},{onError:te=>F.error(W(te,s("settings.jira.saveFailed")))})},e[55]=c,e[56]=l.boardId,e[57]=s,e[58]=n,e[59]=B):B=e[59];let D;e[60]!==l.enabled||e[61]!==B||e[62]!==n.isPending?(D=a.jsx(qe,{checked:l.enabled,disabled:n.isPending,onCheckedChange:B}),e[60]=l.enabled,e[61]=B,e[62]=n.isPending,e[63]=D):D=e[63];let $;e[64]!==K||e[65]!==M||e[66]!==D?($=a.jsxs("div",{className:"flex items-center gap-3",children:[K,M,D]}),e[64]=K,e[65]=M,e[66]=D,e[67]=$):$=e[67];let q;return e[68]!==m||e[69]!==$||e[70]!==f?(q=a.jsx(H,{title:m,description:f,action:$}),e[68]=m,e[69]=$,e[70]=f,e[71]=q):q=e[71],q}function Ot(t){const e=P.c(24),{integration:l}=t,s=L(),n=`${window.location.origin}/api/_jira/webhook/${l.webhookSecret}`;let i;e[0]!==s?(i=s("settings.jira.webhookTitle"),e[0]=s,e[1]=i):i=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=a.jsx(le,{readOnly:!0,value:n,className:"font-mono text-xs"}),e[4]=n,e[5]=o):o=e[5];let d;e[6]!==s||e[7]!==n?(d=()=>{navigator.clipboard.writeText(n),F.success(s("settings.jira.webhookCopied"))},e[6]=s,e[7]=n,e[8]=d):d=e[8];let u;e[9]!==s?(u=s("settings.jira.webhookCopy"),e[9]=s,e[10]=u):u=e[10];let c;e[11]!==d||e[12]!==u?(c=a.jsx(G,{variant:"outline",size:"sm",className:"shrink-0",onClick:d,children:u}),e[11]=d,e[12]=u,e[13]=c):c=e[13];let m;e[14]!==o||e[15]!==c?(m=a.jsxs("div",{className:"flex items-center gap-2",children:[o,c]}),e[14]=o,e[15]=c,e[16]=m):m=e[16];let f;e[17]===Symbol.for("react.memo_cache_sentinel")?(f=a.jsx(St,{stepKeys:["settings.jira.webhookStep1","settings.jira.webhookStep2","settings.jira.webhookStep3","settings.jira.webhookStep4","settings.jira.webhookStep5"]}),e[17]=f):f=e[17];let p;e[18]!==m?(p=a.jsxs("div",{className:"flex flex-col gap-3 mt-3",children:[m,f]}),e[18]=m,e[19]=p):p=e[19];let h;return e[20]!==i||e[21]!==r||e[22]!==p?(h=a.jsx(H,{title:i,description:r,children:p}),e[20]=i,e[21]=r,e[22]=p,e[23]=h):h=e[23],h}function Kt(){const t=P.c(22),e=L(),l=tt();if(l.isPending){let c;return t[0]===Symbol.for("react.memo_cache_sentinel")?(c=a.jsx(Z,{children:a.jsx("div",{className:"p-4",children:a.jsx(ae,{className:"h-40 w-full"})})}),t[0]=c):c=t[0],c}if(!l.data){let c;t[1]!==e?(c=e("settings.jira.connectTitle"),t[1]=e,t[2]=c):c=t[2];let m;t[3]!==e?(m=e("settings.jira.connectDescription"),t[3]=e,t[4]=m):m=t[4];let f;t[5]===Symbol.for("react.memo_cache_sentinel")?(f=a.jsx(vt,{}),t[5]=f):f=t[5];let p;return t[6]!==c||t[7]!==m?(p=a.jsx(Z,{children:a.jsx(H,{title:c,description:m,children:f})}),t[6]=c,t[7]=m,t[8]=p):p=t[8],p}const s=l.data;let n,i,r;t[9]!==s?(n=a.jsx(wt,{integration:s}),i=a.jsx(Tt,{integration:s}),r=s.boardId&&a.jsx(kt,{integration:s}),t[9]=s,t[10]=n,t[11]=i,t[12]=r):(n=t[10],i=t[11],r=t[12]);let o,d;t[13]!==s?(o=a.jsx(Rt,{integration:s}),d=a.jsx(Ot,{integration:s}),t[13]=s,t[14]=o,t[15]=d):(o=t[14],d=t[15]);let u;return t[16]!==n||t[17]!==i||t[18]!==r||t[19]!==o||t[20]!==d?(u=a.jsxs(Z,{children:[n,i,r,o,d]}),t[16]=n,t[17]=i,t[18]=r,t[19]=o,t[20]=d,t[21]=u):u=t[21],u}function Et(){const t=P.c(19),e=L();let l;t[0]!==e?(l=e("settings.nav.tasks"),t[0]=e,t[1]=l):l=t[1];let s;t[2]!==l?(s=a.jsx(se.Title,{children:l}),t[2]=l,t[3]=s):s=t[3];let n,i,r,o;t[4]===Symbol.for("react.memo_cache_sentinel")?(n=a.jsx(Le,{}),i=a.jsx(jt,{}),r=a.jsx(mt,{}),o=a.jsx(Ue,{}),t[4]=n,t[5]=i,t[6]=r,t[7]=o):(n=t[4],i=t[5],r=t[6],o=t[7]);let d;t[8]===Symbol.for("react.memo_cache_sentinel")?(d=a.jsx(Xe,{size:18}),t[8]=d):d=t[8];let u;t[9]!==e?(u=e("settings.jira.sectionTitle"),t[9]=e,t[10]=u):u=t[10];let c;t[11]!==u?(c=a.jsxs("span",{className:"flex items-center gap-2",children:[d,u]}),t[11]=u,t[12]=c):c=t[12];let m;t[13]===Symbol.for("react.memo_cache_sentinel")?(m=a.jsx(Kt,{}),t[13]=m):m=t[13];let f;t[14]!==c?(f=a.jsx(de,{title:c,children:m}),t[14]=c,t[15]=f):f=t[15];let p;return t[16]!==s||t[17]!==f?(p=a.jsx(se,{children:a.jsx(se.Content,{children:a.jsx(se.Body,{children:a.jsxs(ke,{children:[s,n,i,r,o,f]})})})}),t[16]=s,t[17]=f,t[18]=p):p=t[18],p}function As(){const t=P.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx(Ve,{capability:"org:manage",area:"settings",children:a.jsx(Et,{})}),t[0]=e):e=t[0],e}export{As as default};
@@ -1 +1 @@
1
- import{c as o,l,j as n}from"./index-B8v6bpri.js";function c(s){const e=o.c(8);let i,r;e[0]!==s?({className:i,...r}=s,e[0]=s,e[1]=i,e[2]=r):(i=e[1],r=e[2]);let t;e[3]!==i?(t=l("placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive flex field-sizing-content min-h-16 w-full rounded-xl bg-background dark:bg-input/30 px-3 py-2 text-sm transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:cursor-not-allowed disabled:opacity-50",i),e[3]=i,e[4]=t):t=e[4];let a;return e[5]!==r||e[6]!==t?(a=n.jsx("textarea",{"data-slot":"textarea",className:t,...r}),e[5]=r,e[6]=t,e[7]=a):a=e[7],a}export{c as T};
1
+ import{c as o,l,j as n}from"./index-KlN2gCIz.js";function c(s){const e=o.c(8);let i,r;e[0]!==s?({className:i,...r}=s,e[0]=s,e[1]=i,e[2]=r):(i=e[1],r=e[2]);let t;e[3]!==i?(t=l("placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive flex field-sizing-content min-h-16 w-full rounded-xl bg-background dark:bg-input/30 px-3 py-2 text-sm transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:cursor-not-allowed disabled:opacity-50",i),e[3]=i,e[4]=t):t=e[4];let a;return e[5]!==r||e[6]!==t?(a=n.jsx("textarea",{"data-slot":"textarea",className:t,...r}),e[5]=r,e[6]=t,e[7]=a):a=e[7],a}export{c as T};
@@ -1 +1 @@
1
- import{s as h}from"./slugify-CEUa2lfQ.js";import{J as m}from"./index-B8v6bpri.js";function c(r){const t=r?.trim();if(!t)return null;try{const n=new URL(t);return n.protocol!=="http:"&&n.protocol!=="https:"?null:n.href}catch{return null}}function d(r){return c(r?.previewServerUrl)??c(r?.productionUrl)}function I(r){return r?.find(t=>t.production)?.domain??r?.[0]?.domain}function p(r){const t=r?.trim();if(!t)return null;const n=/^https?:\/\//i.test(t)?t:`https://${t}`;return c(n)}function S(r){const t=h(r??"");return t?p(`${t}.deco.site`):null}function l(r){return r==="cms"||r==="sandbox"?r:null}function w(r){return!!d(r)&&r?.fastPreview===!0}function y(r){return w(r)?"cms":"sandbox"}function T(r,t){return l(r?.runtime)??y(t)}function a(r,t){return m.chatThreadIntent(r,t)}function U(r,t,n,e){if(!(!e.runtime&&!e.branch))try{r.setItem(a(t,n),JSON.stringify(e))}catch{}}function g(r,t,n){try{r.removeItem(a(t,n))}catch{}}function P(r,t,n){const e=a(t,n);let u=null;try{u=r.getItem(e),r.removeItem(e)}catch{return{}}if(!u)return{};let i;try{i=JSON.parse(u)}catch{return{}}if(!i||typeof i!="object")return{};const o=i,s=l(o.runtime),f=typeof o.branch=="string"&&o.branch?o.branch:void 0;return{...s?{runtime:s}:{},...f?{branch:f}:{}}}export{d as a,p as b,P as c,y as d,g as e,S as f,I as g,l as p,T as r,c as s,U as w};
1
+ import{s as h}from"./slugify-CEUa2lfQ.js";import{J as m}from"./index-KlN2gCIz.js";function c(r){const t=r?.trim();if(!t)return null;try{const n=new URL(t);return n.protocol!=="http:"&&n.protocol!=="https:"?null:n.href}catch{return null}}function d(r){return c(r?.previewServerUrl)??c(r?.productionUrl)}function I(r){return r?.find(t=>t.production)?.domain??r?.[0]?.domain}function p(r){const t=r?.trim();if(!t)return null;const n=/^https?:\/\//i.test(t)?t:`https://${t}`;return c(n)}function S(r){const t=h(r??"");return t?p(`${t}.deco.site`):null}function l(r){return r==="cms"||r==="sandbox"?r:null}function w(r){return!!d(r)&&r?.fastPreview===!0}function y(r){return w(r)?"cms":"sandbox"}function T(r,t){return l(r?.runtime)??y(t)}function a(r,t){return m.chatThreadIntent(r,t)}function U(r,t,n,e){if(!(!e.runtime&&!e.branch))try{r.setItem(a(t,n),JSON.stringify(e))}catch{}}function g(r,t,n){try{r.removeItem(a(t,n))}catch{}}function P(r,t,n){const e=a(t,n);let u=null;try{u=r.getItem(e),r.removeItem(e)}catch{return{}}if(!u)return{};let i;try{i=JSON.parse(u)}catch{return{}}if(!i||typeof i!="object")return{};const o=i,s=l(o.runtime),f=typeof o.branch=="string"&&o.branch?o.branch:void 0;return{...s?{runtime:s}:{},...f?{branch:f}:{}}}export{d as a,p as b,P as c,y as d,g as e,S as f,I as g,l as p,T as r,c as s,U as w};